aboutsummaryrefslogtreecommitdiff
path: root/sources/plugins/html5audio/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'sources/plugins/html5audio/plugin.js')
-rw-r--r--sources/plugins/html5audio/plugin.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/sources/plugins/html5audio/plugin.js b/sources/plugins/html5audio/plugin.js
index 86bcfbd..7d0d886 100644
--- a/sources/plugins/html5audio/plugin.js
+++ b/sources/plugins/html5audio/plugin.js
@@ -1,6 +1,6 @@
1CKEDITOR.plugins.add( 'html5audio', { 1CKEDITOR.plugins.add( 'html5audio', {
2 requires: 'widget', 2 requires: 'widget',
3 lang: 'de,en,eu,es,fr,ru,uk,uz', 3 lang: 'de,el,en,eu,es,fr,ru,uk,uz,zh-cn',
4 icons: 'html5audio', 4 icons: 'html5audio',
5 init: function( editor ) { 5 init: function( editor ) {
6 editor.widgets.add( 'html5audio', { 6 editor.widgets.add( 'html5audio', {
@@ -13,7 +13,7 @@
13 * - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-audio class. 13 * - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-audio class.
14 * - audio tags with src and controls attributes. 14 * - audio tags with src and controls attributes.
15 */ 15 */
16 allowedContent: 'div(!ckeditor-html5-audio){text-align,float,margin-left,margin-right}; audio[src,controls,autoplay];', 16 allowedContent: 'div(!ckeditor-html5-audio){text-align,float,margin-left,margin-right}; audio[src,controls,controlslist,autoplay];',
17 requiredContent: 'div(ckeditor-html5-audio); audio[src,controls];', 17 requiredContent: 'div(ckeditor-html5-audio); audio[src,controls];',
18 upcast: function( element ) { 18 upcast: function( element ) {
19 return element.name === 'div' && element.hasClass( 'ckeditor-html5-audio' ); 19 return element.name === 'div' && element.hasClass( 'ckeditor-html5-audio' );
@@ -29,6 +29,7 @@
29 // get it's attributes. 29 // get it's attributes.
30 src = this.element.getChild( 0 ).getAttribute( 'src' ); 30 src = this.element.getChild( 0 ).getAttribute( 'src' );
31 autoplay = this.element.getChild( 0 ).getAttribute( 'autoplay' ); 31 autoplay = this.element.getChild( 0 ).getAttribute( 'autoplay' );
32 allowdownload = !this.element.getChild( 0 ).getAttribute( 'controlslist' );
32 } 33 }
33 34
34 if ( src ) { 35 if ( src ) {
@@ -43,6 +44,10 @@
43 if ( autoplay ) { 44 if ( autoplay ) {
44 this.setData( 'autoplay', 'yes' ); 45 this.setData( 'autoplay', 'yes' );
45 } 46 }
47
48 if ( allowdownload ) {
49 this.setData( 'allowdownload', 'yes' );
50 }
46 } 51 }
47 }, 52 },
48 data: function() { 53 data: function() {
@@ -84,6 +89,11 @@
84 } else { 89 } else {
85 this.element.getChild( 0 ).removeAttribute( 'autoplay' ); 90 this.element.getChild( 0 ).removeAttribute( 'autoplay' );
86 } 91 }
92 if ( this.data.allowdownload === 'yes' ) {
93 this.element.getChild( 0 ).removeAttribute( 'controlslist' );
94 } else {
95 this.element.getChild( 0 ).setAttribute( 'controlslist', 'nodownload' );
96 }
87 } 97 }
88 } 98 }
89 } ); 99 } );