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 6 files changed, 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 (limited to 'release/plugins/Audio') 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 -- cgit v1.2.3