]> git.immae.eu Git - perso/Immae/Projets/packagist/ludivine-ckeditor-component.git/blobdiff - sources/plugins/html5audio/plugin.js
Update to 4.7.3
[perso/Immae/Projets/packagist/ludivine-ckeditor-component.git] / sources / plugins / html5audio / plugin.js
index 86bcfbd32e5494754ef9f23a7cbb90fbfb07a173..7d0d8868c181caa238c6753a5767e68d0f7e31c3 100644 (file)
@@ -1,6 +1,6 @@
 CKEDITOR.plugins.add( 'html5audio', {\r
     requires: 'widget',\r
-    lang: 'de,en,eu,es,fr,ru,uk,uz',\r
+    lang: 'de,el,en,eu,es,fr,ru,uk,uz,zh-cn',\r
     icons: 'html5audio',\r
     init: function( editor ) {\r
         editor.widgets.add( 'html5audio', {\r
@@ -13,7 +13,7 @@
              *  - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-audio class.\r
              *  - audio tags with src and controls attributes.\r
              */\r
-            allowedContent: 'div(!ckeditor-html5-audio){text-align,float,margin-left,margin-right}; audio[src,controls,autoplay];',\r
+            allowedContent: 'div(!ckeditor-html5-audio){text-align,float,margin-left,margin-right}; audio[src,controls,controlslist,autoplay];',\r
             requiredContent: 'div(ckeditor-html5-audio); audio[src,controls];',\r
             upcast: function( element ) {\r
                 return element.name === 'div' && element.hasClass( 'ckeditor-html5-audio' );\r
@@ -29,6 +29,7 @@
                     // get it's attributes.\r
                     src = this.element.getChild( 0 ).getAttribute( 'src' );\r
                     autoplay = this.element.getChild( 0 ).getAttribute( 'autoplay' );\r
+                    allowdownload = !this.element.getChild( 0 ).getAttribute( 'controlslist' );\r
                 }\r
 \r
                 if ( src ) {\r
                     if ( autoplay ) {\r
                         this.setData( 'autoplay', 'yes' );\r
                     }\r
+\r
+                    if ( allowdownload ) {\r
+                        this.setData( 'allowdownload', 'yes' );\r
+                    }\r
                 }\r
             },\r
             data: function() {\r
                     } else {\r
                         this.element.getChild( 0 ).removeAttribute( 'autoplay' );\r
                     }\r
+                    if ( this.data.allowdownload === 'yes' ) {\r
+                        this.element.getChild( 0 ).removeAttribute( 'controlslist' );\r
+                    } else {\r
+                        this.element.getChild( 0 ).setAttribute( 'controlslist', 'nodownload' );\r
+                    }\r
                 }\r
             }\r
         } );\r