]> git.immae.eu Git - perso/Immae/Projets/packagist/ludivine-ckeditor-component.git/blame - sources/plugins/html5audio/dialogs/html5audio.js
Change html5 audio player
[perso/Immae/Projets/packagist/ludivine-ckeditor-component.git] / sources / plugins / html5audio / dialogs / html5audio.js
CommitLineData
d1844275
IB
1CKEDITOR.dialog.add( 'html5audio', function( editor ) {\r
2 return {\r
3 title: editor.lang.html5audio.title,\r
4 minWidth: 500,\r
5 minHeight: 100,\r
6 contents: [ {\r
7 id: 'info',\r
8 label: editor.lang.html5audio.infoLabel,\r
9 elements: [ {\r
10 type: 'vbox',\r
11 padding: 0,\r
12 children: [ {\r
13 type: 'hbox',\r
14 widths: [ '365px', '110px' ],\r
15 align: 'right',\r
16 children: [ {\r
17 type: 'text',\r
18 id: 'url',\r
19 label: editor.lang.common.url,\r
20 required: true,\r
21 validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.html5audio.urlMissing ),\r
22 setup: function( widget ) {\r
23 this.setValue( widget.data.src );\r
24 },\r
25 commit: function( widget ) {\r
26 widget.setData( 'src', this.getValue() );\r
27 }\r
28 },\r
29 {\r
30 type: 'button',\r
31 id: 'browse',\r
32 // v-align with the 'txtUrl' field.\r
33 // TODO: We need something better than a fixed size here.\r
34 style: 'display:inline-block;margin-top:14px;',\r
35 align: 'center',\r
36 label: editor.lang.common.browseServer,\r
37 hidden: true,\r
38 filebrowser: 'info:url'\r
39 } ]\r
40 } ]\r
41 },\r
42 {\r
43 type: 'hbox',\r
44 id: 'alignment',\r
45 children: [ {\r
46 type: 'radio',\r
47 id: 'align',\r
48 label: editor.lang.common.align,\r
49 items: [\r
50 [editor.lang.common.alignCenter, 'center'],\r
51 [editor.lang.common.alignLeft, 'left'],\r
52 [editor.lang.common.alignRight, 'right'],\r
53 [editor.lang.common.alignNone, 'none']\r
54 ],\r
55 'default': 'center',\r
56 setup: function( widget ) {\r
57 if ( widget.data.align ) {\r
58 this.setValue( widget.data.align );\r
59 }\r
60 },\r
61 commit: function( widget ) {\r
62 widget.setData( 'align', this.getValue() );\r
63 }\r
64 } ]\r
65 } ]\r
66 },\r
67 {\r
68 id: 'Upload',\r
69 hidden: true,\r
70 filebrowser: 'uploadButton',\r
71 label: editor.lang.html5audio.upload,\r
72 elements: [ {\r
73 type: 'file',\r
74 id: 'upload',\r
75 label: editor.lang.html5audio.btnUpload,\r
76 style: 'height:40px',\r
77 size: 38\r
78 },\r
79 {\r
80 type: 'fileButton',\r
81 id: 'uploadButton',\r
82 filebrowser: 'info:url',\r
83 label: editor.lang.html5audio.btnUpload,\r
84 'for': [ 'Upload', 'upload' ]\r
85 } ]\r
86 },\r
87 {\r
88 id: 'advanced',\r
89 label: editor.lang.html5audio.advanced,\r
90 elements: [ {\r
91 type: 'vbox',\r
92 padding: 0,\r
93 children: [ {\r
94 type: 'hbox',\r
95 children: [ {\r
96 type: 'radio',\r
97 id: 'autoplay',\r
98 label: editor.lang.html5audio.autoplay,\r
99 items: [\r
100 [editor.lang.html5audio.yes, 'yes'],\r
101 [editor.lang.html5audio.no, 'no']\r
102 ],\r
103 'default': 'no',\r
104 setup: function( widget ) {\r
105 if ( widget.data.autoplay ) {\r
106 this.setValue( widget.data.autoplay );\r
107 }\r
108 },\r
109 commit: function( widget ) {\r
110 widget.setData( 'autoplay', this.getValue() );\r
111 }\r
112 } ]\r
113 } ]\r
114 } ]\r
115 } ]\r
116 };\r
117} );\r