diff options
-rw-r--r-- | GWP_bs3_panel_shortcode.php | 50 | ||||
-rw-r--r-- | librevideojs/css/mce-button.css | 2 | ||||
-rw-r--r-- | librevideojs/js/mce-button.js | 4 | ||||
-rw-r--r-- | librevideojs/js/mce-button.min.js | 4 |
4 files changed, 8 insertions, 52 deletions
diff --git a/GWP_bs3_panel_shortcode.php b/GWP_bs3_panel_shortcode.php index 8acc164..01ac7e9 100644 --- a/GWP_bs3_panel_shortcode.php +++ b/GWP_bs3_panel_shortcode.php @@ -5,7 +5,7 @@ class GWP_bs3_panel_shortcode{ * holds the name of the shortcode tag * @var string */ - public $shortcode_tag = 'bs3_panel'; + public $shortcode_tag = 'librevideojs'; /** * __construct @@ -14,9 +14,6 @@ class GWP_bs3_panel_shortcode{ * @param array $args */ function __construct($args = array()){ - //add shortcode - add_shortcode($this->shortcode_tag, array($this, 'shortcode_handler')); - if (is_admin()){ add_action('admin_head', array($this, 'admin_head')); add_action('admin_enqueue_scripts', array($this , 'admin_enqueue_scripts')); @@ -24,47 +21,6 @@ class GWP_bs3_panel_shortcode{ } /** - * shortcode_handler - * @param array $atts shortcode attributes - * @param string $content shortcode content - * @return string - */ - function shortcode_handler($atts , $content = null){ - // Attributes - extract( shortcode_atts( - array( - 'url' => 'no', - 'footer' => 'no', - 'code' => 'webm', - ), $atts ) - ); - - //make sure the panel type is a valid styled type if not revert to webm - $panel_types = array('ogv','webm','mp4'); - $type = in_array($type, $panel_types)? $type: 'webm'; - - //start panel markup - $output = '<div class="panel panel-'.$type.'">'; - - //check if panel has a header - if ('no' != $header) - $output .= '<div class="panel-heading">'.$header.'</div>'; - - //add panel body content and allow shortcode in it - $output .= '<div class="panel-body">'.trim(do_shortcode($content)).'</div>'; - - //check if panel has a footer - if ('no' != $footer) - $output .= '<div class="panel-footer">'.$footer.'</div>'; - - //add closing div tag - $output .= '</div>'; - - //return shortcode output - return $output; - } - - /** * admin_head * calls your functions into the correct filters * @return void @@ -89,7 +45,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.js' , __FILE__ ); + $plugin_array[$this->shortcode_tag] = plugins_url('librevideojs/js/mce-button.js', __FILE__); return $plugin_array; } @@ -110,7 +66,7 @@ class GWP_bs3_panel_shortcode{ * @return void */ function admin_enqueue_scripts() { - wp_enqueue_style('bs3_panel_shortcode', plugins_url('librevideojs/css/mce-button.css' , __FILE__)); + wp_enqueue_style('librevideojs_shortcode', plugins_url('librevideojs/css/mce-button.css', __FILE__)); } } diff --git a/librevideojs/css/mce-button.css b/librevideojs/css/mce-button.css index 7630374..311ee9e 100644 --- a/librevideojs/css/mce-button.css +++ b/librevideojs/css/mce-button.css @@ -1,4 +1,4 @@ -i.mce-i-bs3_panel:before { +i.mce-i-librevideojs:before { font-family: "dashicons"; content: "\f236"; } diff --git a/librevideojs/js/mce-button.js b/librevideojs/js/mce-button.js index 22bea77..f823366 100644 --- a/librevideojs/js/mce-button.js +++ b/librevideojs/js/mce-button.js @@ -1,5 +1,5 @@ /*! - * @source: + * @source: here * * * @licstart The following is the entire license notice for the @@ -112,7 +112,7 @@ url : '', poster: '', code : 'webm', - content: '' + content: '', }); } }); diff --git a/librevideojs/js/mce-button.min.js b/librevideojs/js/mce-button.min.js index a3c9489..2aacc8b 100644 --- a/librevideojs/js/mce-button.min.js +++ b/librevideojs/js/mce-button.min.js @@ -1,5 +1,5 @@ /*! - * @source: + * @source: here * * * @licstart The following is the entire license notice for the @@ -25,4 +25,4 @@ * for the JavaScript code in this page. * */ -(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 +(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 |