aboutsummaryrefslogtreecommitdiffstats
path: root/librevideojs/js/mce-button.js
diff options
context:
space:
mode:
authorHeckyel <heckyel@openmailbox.org>2016-12-19 15:04:38 -0500
committerHeckyel <heckyel@openmailbox.org>2016-12-19 15:04:38 -0500
commitfef99df9a236381827736700e18221dc7523c821 (patch)
tree4fa91e9bcb4efdfc96aaa66a8c2ef599428039f8 /librevideojs/js/mce-button.js
parent7870d3623d552d030600e2f6ac0743154ad9e0d7 (diff)
downloadlibrevideojs-html5-player-fef99df9a236381827736700e18221dc7523c821.tar.lz
librevideojs-html5-player-fef99df9a236381827736700e18221dc7523c821.tar.xz
librevideojs-html5-player-fef99df9a236381827736700e18221dc7523c821.zip
falta ajustar interfaz al nuevo librevideojs-html5-player.php que soporta resoluciones desde extra
Diffstat (limited to 'librevideojs/js/mce-button.js')
-rw-r--r--librevideojs/js/mce-button.js157
1 files changed, 85 insertions, 72 deletions
diff --git a/librevideojs/js/mce-button.js b/librevideojs/js/mce-button.js
index 76a2418..22bea77 100644
--- a/librevideojs/js/mce-button.js
+++ b/librevideojs/js/mce-button.js
@@ -5,7 +5,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
- * Copyleft 2016 Jorge Maldonado
+ * Copyleft 2016 Jorge Maldonado Ventura
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
@@ -29,79 +29,92 @@
*
*/
(function() {
- tinymce.PluginManager.add('bs3_panel', function(editor, url) {
- var sh_tag = 'librevideojs_video';
+ tinymce.PluginManager.add('librevideojs', function(editor, url) {
+ var sh_tag = 'librevideojs_video';
- //add popup
- editor.addCommand('bs3_panel_popup', function(ui, v) {
- //setup defaults
- var url = '';
- if (v.url)
- url = v.url;
- var code = 'webm';
- if (v.code)
- code = v.code;
- var content = '';
- if (v.content)
- content = v.content;
+ //add popup
+ editor.addCommand('librevideojs_popup', function(ui, v) {
+ //setup defaults
+ var url = '';
+ if (v.url)
+ url = v.url;
+ var poster = '';
+ if (v.poster)
+ poster = v.poster;
+ var code = 'webm';
+ if (v.code)
+ code = v.code;
+ var content = '';
+ if (v.content)
+ content = v.content;
- editor.windowManager.open( {
- title: 'LibreVideoJS - Inserción de vídeo',
- body: [
- {
- type: 'textbox',
- name: 'url',
- label: 'URL',
- value: url,
- tooltip: 'Inserta la URL del vídeo'
- },
- {
- type: 'listbox',
- name: 'code',
- label: 'Formato',
- value: code,
- 'values': [
- {text: 'webm', value: 'webm'},
- {text: 'ogv', value: 'ogg'},
- {text: 'mp4', value: 'mp4'}
- ],
- tooltip: 'Selecciona el formato del vídeo'
- },
- {
- type: 'textbox',
- name: 'content',
- label: 'Extra',
- value: content,
- multiline: true,
- minWidth: 300,
- minHeight: 100
- }
- ],
- onsubmit: function( e ) {
- var shortcode_str = '[' + sh_tag + ' code="'+e.data.code+'"';
- //check for url
- if (typeof e.data.url != 'undefined' && e.data.url.length)
- shortcode_str += ' url="' + e.data.url + '"';
+ editor.windowManager.open( {
+ title: 'LibreVideoJS - Inserción de vídeo',
+ body: [
+ {
+ type: 'textbox',
+ name: 'url',
+ label: 'URL',
+ value: url,
+ tooltip: 'Inserta la URL del vídeo'
+ },
+ {
+ type: 'textbox',
+ name: 'poster',
+ label: 'Poster',
+ value: poster,
+ tooltip: 'Escribe aquí la URL de la imagen que deseas que se visualice antes de reproducir el vídeo'
+ },
+ {
+ type: 'listbox',
+ name: 'code',
+ label: 'Formato',
+ value: code,
+ 'values': [
+ {text: 'webm', value: 'webm'},
+ {text: 'ogv', value: 'ogg'},
+ {text: 'mp4', value: 'mp4'}
+ ],
+ tooltip: 'Selecciona el formato del vídeo'
+ },
+ {
+ type: 'textbox',
+ name: 'content',
+ label: 'Extra',
+ value: content,
+ multiline: true,
+ minWidth: 300,
+ minHeight: 100
+ }
+ ],
+ onsubmit: function(e) {
+ var shortcode_str = '[' + sh_tag;
+ if (typeof e.data.url != 'undefined' && e.data.url.length)
+ shortcode_str += ' url="' + e.data.url + '"';
+ if (typeof e.data.poster != 'undefined' && e.data.poster.length)
+ shortcode_str += ' poster="' + e.data.poster + '"';
+ if (typeof e.data.code != 'undefined' && e.data.code.length)
+ shortcode_str += ' code="' + e.data.code + '"';
- //add panel content
- shortcode_str += ' ' + e.data.content + ']';
- //insert shortcode to tinymce
- editor.insertContent( shortcode_str);
- }
- });
- });
+ //add panel content
+ shortcode_str += ']' + e.data.content + '[/' + sh_tag + ']';
+ //insert shortcode to tinymce
+ editor.insertContent(shortcode_str);
+ }
+ });
+ });
- //add button
- editor.addButton('bs3_panel', {
- icon: 'bs3_panel',
- tooltip: 'LibreVideoJS',
- onclick: function() {
- editor.execCommand('bs3_panel_popup','',{
- url : '',
- code : 'webm',
- content: ''
- });
- }
- });
- });
+ editor.addButton('librevideojs', {
+ icon: 'librevideojs',
+ tooltip: 'LibreVideoJS',
+ onclick: function() {
+ editor.execCommand('librevideojs_popup', '', {
+ url : '',
+ poster: '',
+ code : 'webm',
+ content: ''
+ });
+ }
+ });
+ });
})();