From 9946db9daaa76448d0e43247472cdedd2a5ea22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 4 Dec 2017 18:46:08 +0100 Subject: Change audio plugin --- release/plugins/Audio/dialogs/audio.js | 9 --- release/plugins/Audio/docs/install.html | 69 ----------------------- release/plugins/Audio/docs/styles.css | 67 ---------------------- release/plugins/Audio/images/audio.png | Bin 15258 -> 0 bytes release/plugins/Audio/images/icon.png | Bin 1356 -> 0 bytes release/plugins/Audio/images/placeholder.png | Bin 862 -> 0 bytes release/plugins/html5audio/dialogs/html5audio.js | 4 ++ release/plugins/icons.png | Bin 4993 -> 5377 bytes release/plugins/icons_hidpi.png | Bin 14581 -> 15009 bytes 9 files changed, 4 insertions(+), 145 deletions(-) delete mode 100644 release/plugins/Audio/dialogs/audio.js delete mode 100644 release/plugins/Audio/docs/install.html delete mode 100644 release/plugins/Audio/docs/styles.css delete mode 100644 release/plugins/Audio/images/audio.png delete mode 100644 release/plugins/Audio/images/icon.png delete mode 100644 release/plugins/Audio/images/placeholder.png create mode 100644 release/plugins/html5audio/dialogs/html5audio.js (limited to 'release/plugins') diff --git a/release/plugins/Audio/dialogs/audio.js b/release/plugins/Audio/dialogs/audio.js deleted file mode 100644 index da9495c..0000000 --- a/release/plugins/Audio/dialogs/audio.js +++ /dev/null @@ -1,9 +0,0 @@ -CKEDITOR.dialog.add("audio",function(d){function g(a,c){var b=this.getValue();!b&&"id"==this.id&&(b=m());a.setAttribute(this.id,b);if(b)switch(this.id){case "poster":c.backgroundImage="url("+b+")";break;case "width":c.width=b+"px";break;case "height":c.height=b+"px"}}function i(a,c,b){c=this.id.match(/(\w+)(\d)/);a=c[1];c=parseInt(c[2],10);(b[c]||(b[c]={}))[a]=this.getValue()}function j(a){a?this.setValue(a.getAttribute(this.id)):"id"==this.id&&this.setValue(m())}function h(a,c){var b=this.id.match(/(\w+)(\d)/), -d=b[1],b=parseInt(b[2],10);(b=c[b])&&this.setValue(b[d])}function m(){var a=new Date;return"audio"+a.getFullYear()+a.getMonth()+a.getDate()+a.getHours()+a.getMinutes()+a.getSeconds()}var e=d.lang.audio,l=function(){var a=this.previewImage;a.removeListener("load",l);a.removeListener("error",f);a.removeListener("abort",f);this.setValueOf("info","width",a.$.width);this.setValueOf("info","height",a.$.height)},f=function(){var a=this.previewImage;a.removeListener("load",l);a.removeListener("error",f); -a.removeListener("abort",f)};return{title:e.dialogTitle,minWidth:400,minHeight:200,onShow:function(){this.fakeImage=this.audioNode=null;this.previewImage=d.document.createElement("img");var a=this.getSelectedElement();if(a&&a.data("cke-real-element-type")&&"audio"==a.data("cke-real-element-type")){this.fakeImage=a;var a=d.restoreRealElement(a),c=[],b=a.getElementsByTag("source","");0==b.count()&&(b=a.getElementsByTag("source","cke"));for(var e=0,f=b.count();e",d.document),a.setAttributes({controls:"controls"}));var c={},b=[];this.commitContent(a,c,b);for(var f="",g="",i=e.linkTemplate||"",j=e.fallbackTemplate||"",h=0;h',g+=i.replace("%src%",k.src).replace("%type%", -k.type))}a.setHtml(f+j.replace("%links%",g));a=d.createFakeElement(a,"cke_audio","audio",!1);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),d.getSelection().selectElement(a)):(c=new CKEDITOR.dom.element("DIV",d.document),d.insertElement(c),c.append(a))},onHide:function(){this.previewImage&&(this.previewImage.removeListener("load",l),this.previewImage.removeListener("error",f),this.previewImage.removeListener("abort",f),this.previewImage.remove(),this.previewImage=null)},contents:[{id:"info", -elements:[{type:"hbox",widths:["","100px"],children:[{type:"text",id:"poster",label:e.poster,commit:g,setup:j,onChange:function(){var a=this.getDialog(),c=this.getValue();if(0 - - - -Audio plugin - - - - -

Audio Plugin for CKEditor

- -

Introduction

-

This is a plugin to create HTML5 <audio> elements in CKEditor.

-

Version history:

-
    -
  1. 1.0: 10-July-2015. First version.
  2. -
- -

Installation

-

1. Copying the files

-

Extract the contents of the zip in you plugins directory, so it ends up like - this
- -

-
-ckeditor\
-	...
-	images\
-	lang\
-	plugins\
-		...
-		audio\
-			plugin.js
-			dialogs\
-				audio.js
-			docs\
-				install.html
-			images\
-				icon.png
-				placeholder.png
-		...
-	skins\
-	themes\
-
-

2. Adding it to CKEditor

-

Now add the plugin in your config.js or custom js configuration -file: -config.extraPlugins='audio'; -

- -

3. Add it to your toolbar

-

In your toolbar configuration, add a new 'Audio' item in the place where you want the button to show up.

- -

4. Configure server browser for audio

-

You can use the config.filebrowserAudioBrowseUrl entry to specify a url so the file browser shows just audio elements (as long as your configure properly your file browser).

- -

5. Use it

-

Now empty the cache of your browser and reload the editor, the new button should show up and you can add <audio> elements into the content.

- -

Final notes

-

Please, note that only newer browsers support the Audio element, in older ones a simple text linking to the source audios is provided, you might want to -use some javascript or css to customize the final behavior of these elements.

- - -

Disclaimers

-

CKEditor is © CKSource.com

- - diff --git a/release/plugins/Audio/docs/styles.css b/release/plugins/Audio/docs/styles.css deleted file mode 100644 index 5eba91e..0000000 --- a/release/plugins/Audio/docs/styles.css +++ /dev/null @@ -1,67 +0,0 @@ -body { - font-family: Arial, Helvetica, sans-serif; - font-size: 90%; -} -h1 { - text-align:center; - font-size:180%; -} -h2 { - border-bottom:2px solid #CCC; - margin:1em 0 0.4em 0; -} -h3 { - margin-bottom:0.4em; -} -p { - margin:0 0 1em 1em; - text-align:justify; -} -ol { - margin:0 0 1.2em 1em; - padding:0; - list-style-type:none; -} -ol li { - margin:0.2em 0; -} -pre { - font-size:100%; - font-family:"Courier New", Courier, mono; - background-color: #CCCCCC; - border:1px solid #999; - padding:0.2em 1em; - margin: 0.4em 0; - display:block; - white-space: pre; - overflow: auto; -} -code { - font-size:100%; - font-family:"Courier New", Courier, mono; - background-color: #CCCCCC; - border:1px solid #999; - padding:0.2em; - white-space: pre; -} -form { - margin:0 0 0 1em; -} -span.key { - color: #006600; -} -#install { - display:none -} -#languages ul { - display:inline; - list-style-type:none; - margin:0; - padding:0; -} -#languages li { - display:inline; - margin:0; - padding:0; - vertical-align:bottom; -} diff --git a/release/plugins/Audio/images/audio.png b/release/plugins/Audio/images/audio.png deleted file mode 100644 index b4a4ef7..0000000 Binary files a/release/plugins/Audio/images/audio.png and /dev/null differ diff --git a/release/plugins/Audio/images/icon.png b/release/plugins/Audio/images/icon.png deleted file mode 100644 index 1ec7ecc..0000000 Binary files a/release/plugins/Audio/images/icon.png and /dev/null differ diff --git a/release/plugins/Audio/images/placeholder.png b/release/plugins/Audio/images/placeholder.png deleted file mode 100644 index 1456cac..0000000 Binary files a/release/plugins/Audio/images/placeholder.png and /dev/null differ diff --git a/release/plugins/html5audio/dialogs/html5audio.js b/release/plugins/html5audio/dialogs/html5audio.js new file mode 100644 index 0000000..fb2efe0 --- /dev/null +++ b/release/plugins/html5audio/dialogs/html5audio.js @@ -0,0 +1,4 @@ +CKEDITOR.dialog.add("html5audio",function(a){return{title:a.lang.html5audio.title,minWidth:500,minHeight:100,contents:[{id:"info",label:a.lang.html5audio.infoLabel,elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["365px","110px"],align:"right",children:[{type:"text",id:"url",label:a.lang.common.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(a.lang.html5audio.urlMissing),setup:function(a){this.setValue(a.data.src)},commit:function(a){a.setData("src",this.getValue())}},{type:"button", +id:"browse",style:"display:inline-block;margin-top:14px;",align:"center",label:a.lang.common.browseServer,hidden:!0,filebrowser:"info:url"}]}]},{type:"hbox",id:"alignment",children:[{type:"radio",id:"align",label:a.lang.common.align,items:[[a.lang.common.alignCenter,"center"],[a.lang.common.alignLeft,"left"],[a.lang.common.alignRight,"right"],[a.lang.common.alignNone,"none"]],"default":"center",setup:function(a){a.data.align&&this.setValue(a.data.align)},commit:function(a){a.setData("align",this.getValue())}}]}]}, +{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:a.lang.html5audio.upload,elements:[{type:"file",id:"upload",label:a.lang.html5audio.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:url",label:a.lang.html5audio.btnUpload,"for":["Upload","upload"]}]},{id:"advanced",label:a.lang.html5audio.advanced,elements:[{type:"vbox",padding:0,children:[{type:"hbox",children:[{type:"radio",id:"autoplay",label:a.lang.html5audio.autoplay,items:[[a.lang.html5audio.yes, +"yes"],[a.lang.html5audio.no,"no"]],"default":"no",setup:function(a){a.data.autoplay&&this.setValue(a.data.autoplay)},commit:function(a){a.setData("autoplay",this.getValue())}},{type:"radio",id:"allowdownload",label:a.lang.html5audio.allowdownload,items:[[a.lang.html5audio.yes,"yes"],[a.lang.html5audio.no,"no"]],"default":"no",setup:function(a){a.data.allowdownload&&this.setValue(a.data.allowdownload)},commit:function(a){a.setData("allowdownload",this.getValue())}}]}]}]}]}}); \ No newline at end of file diff --git a/release/plugins/icons.png b/release/plugins/icons.png index ab7c411..43b7e45 100644 Binary files a/release/plugins/icons.png and b/release/plugins/icons.png differ diff --git a/release/plugins/icons_hidpi.png b/release/plugins/icons_hidpi.png index 2516678..5b237a8 100644 Binary files a/release/plugins/icons_hidpi.png and b/release/plugins/icons_hidpi.png differ -- cgit v1.2.3