From fef99df9a236381827736700e18221dc7523c821 Mon Sep 17 00:00:00 2001 From: Heckyel Date: Mon, 19 Dec 2016 15:04:38 -0500 Subject: falta ajustar interfaz al nuevo librevideojs-html5-player.php que soporta resoluciones desde extra --- GWP_bs3_panel_shortcode.php | 2 +- librevideojs/js/mce-button.js | 157 +++++++++++++++++++++----------------- librevideojs/js/mce-button.min.js | 4 +- 3 files changed, 88 insertions(+), 75 deletions(-) diff --git a/GWP_bs3_panel_shortcode.php b/GWP_bs3_panel_shortcode.php index 2f89322..8acc164 100644 --- a/GWP_bs3_panel_shortcode.php +++ b/GWP_bs3_panel_shortcode.php @@ -89,7 +89,7 @@ class GWP_bs3_panel_shortcode{ * @return array */ function mce_external_plugins($plugin_array) { - $plugin_array[$this->shortcode_tag] = plugins_url('librevideojs/js/mce-button.min.js' , __FILE__ ); + $plugin_array[$this->shortcode_tag] = plugins_url('librevideojs/js/mce-button.js' , __FILE__ ); return $plugin_array; } 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: '' + }); + } + }); + }); })(); diff --git a/librevideojs/js/mce-button.min.js b/librevideojs/js/mce-button.min.js index 10a26f6..a3c9489 100644 --- a/librevideojs/js/mce-button.min.js +++ b/librevideojs/js/mce-button.min.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 @@ -25,4 +25,4 @@ * for the JavaScript code in this page. * */ -(function(){tinymce.PluginManager.add("bs3_panel",function(b,a){var c="librevideojs_video";b.addCommand("bs3_panel_popup",function(h,d){var e="";if(d.url){e=d.url}var g="webm";if(d.code){g=d.code}var f="";if(d.content){f=d.content}b.windowManager.open({title:"LibreVideoJS - Inserción de vídeo",body:[{type:"textbox",name:"url",label:"URL",value:e,tooltip:"Inserta la URL del vídeo"},{type:"listbox",name:"code",label:"Formato",value:g,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:f,multiline:true,minWidth:300,minHeight:100}],onsubmit:function(j){var i="["+c+' code="'+j.data.code+'"';if(typeof j.data.url!="undefined"&&j.data.url.length){i+=' url="'+j.data.url+'"'}i+=" "+j.data.content+"]";b.insertContent(i)}})});b.addButton("bs3_panel",{icon:"bs3_panel",tooltip:"LibreVideoJS",onclick:function(){b.execCommand("bs3_panel_popup","",{url:"",code:"webm",content:""})}})})})(); +(function(){tinymce.PluginManager.add("librevideojs",function(b,a){var c="librevideojs_video";b.addCommand("librevideojs_popup",function(h,d){var e="";if(d.url){e=d.url}var i="";if(d.poster){i=d.poster}var g="webm";if(d.code){g=d.code}var f="";if(d.content){f=d.content}b.windowManager.open({title:"LibreVideoJS - Inserción de vídeo",body:[{type:"textbox",name:"url",label:"URL",value:e,tooltip:"Inserta la URL del vídeo"},{type:"textbox",name:"poster",label:"Poster",value:i,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:g,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:f,multiline:true,minWidth:300,minHeight:100}],onsubmit:function(k){var j="["+c;if(typeof k.data.url!="undefined"&&k.data.url.length){j+=' url="'+k.data.url+'"'}if(typeof k.data.poster!="undefined"&&k.data.poster.length){j+=' poster="'+k.data.poster+'"'}if(typeof k.data.code!="undefined"&&k.data.code.length){j+=' code="'+k.data.code+'"'}j+="]"+k.data.content+"[/"+c+"]";b.insertContent(j)}})});b.addButton("librevideojs",{icon:"librevideojs",tooltip:"LibreVideoJS",onclick:function(){b.execCommand("librevideojs_popup","",{url:"",poster:"",code:"webm",content:""})}})})})(); \ No newline at end of file -- cgit v1.2.3