国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
9.9KB

  1. CKEDITOR.dialog.add( 'html5video', function( editor ) {
  2. return {
  3. title: editor.lang.html5video.title,
  4. minWidth: 500,
  5. minHeight: 100,
  6. contents: [ {
  7. id: 'info',
  8. label: editor.lang.html5video.infoLabel,
  9. elements: [
  10. {
  11. type: 'vbox',
  12. padding: 0,
  13. children: [
  14. {
  15. type: 'hbox',
  16. widths: [ '365px', '110px' ],
  17. align: 'right',
  18. children: [ {
  19. type: 'text',
  20. id: 'url',
  21. label: editor.lang.html5video.allowed,
  22. required: true,
  23. validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.html5video.urlMissing ),
  24. setup: function( widget ) {
  25. this.setValue( widget.data.src );
  26. },
  27. commit: function( widget ) {
  28. widget.setData( 'src', this.getValue() );
  29. }
  30. },
  31. {
  32. type: 'button',
  33. id: 'browse',
  34. // v-align with the 'txtUrl' field.
  35. // TODO: We need something better than a fixed size here.
  36. style: 'display:inline-block;margin-top:14px;',
  37. align: 'center',
  38. label: editor.lang.common.browseServer,
  39. hidden: true,
  40. filebrowser: 'info:url'
  41. } ]
  42. } ]
  43. },
  44. {
  45. type: 'checkbox',
  46. id: 'responsive',
  47. label: editor.lang.html5video.responsive,
  48. setup: function( widget ) {
  49. this.setValue( widget.data.responsive );
  50. },
  51. commit: function( widget ) {
  52. widget.setData( 'responsive', this.getValue()?'true':'' );
  53. }
  54. },
  55. {
  56. type: 'vbox',
  57. padding: 0,
  58. children: [{
  59. type: 'hbox',
  60. widths: [ '365px', '110px' ],
  61. align: 'right',
  62. children: [ {
  63. type: 'text',
  64. id: 'poster',
  65. label: editor.lang.html5video.poster,
  66. setup: function( widget ) {
  67. this.setValue( widget.data.poster );
  68. },
  69. commit: function( widget ) {
  70. widget.setData( 'poster', this.getValue() );
  71. }
  72. },
  73. {
  74. type: 'button',
  75. id: 'browseposter',
  76. // v-align with the 'txtUrl' field.
  77. // TODO: We need something better than a fixed size here.
  78. style: 'display:inline-block;margin-top:14px;',
  79. align: 'center',
  80. label: editor.lang.common.browseServer,
  81. hidden: true,
  82. filebrowser:{action:"Browse",target:"info:poster",url:editor.config.filebrowserImageBrowseUrl}
  83. } ]
  84. }]
  85. },
  86. {
  87. type: 'checkbox',
  88. id: 'controls',
  89. label: editor.lang.html5video.controls,
  90. setup: function (widget) {
  91. this.setValue(widget.data.controls);
  92. },
  93. commit: function (widget) {
  94. widget.setData('controls', this.getValue() ? 'true' : '');
  95. }
  96. },
  97. {
  98. type: 'hbox',
  99. id: 'size',
  100. children: [ {
  101. type: 'text',
  102. id: 'width',
  103. label: editor.lang.common.width,
  104. setup: function( widget ) {
  105. if ( widget.data.width ) {
  106. this.setValue( widget.data.width );
  107. }
  108. },
  109. commit: function( widget ) {
  110. widget.setData( 'width', this.getValue() );
  111. }
  112. },
  113. {
  114. type: 'text',
  115. id: 'height',
  116. label: editor.lang.common.height,
  117. setup: function( widget ) {
  118. if ( widget.data.height ) {
  119. this.setValue( widget.data.height );
  120. }
  121. },
  122. commit: function( widget ) {
  123. widget.setData( 'height', this.getValue() );
  124. }
  125. },
  126. ]
  127. },
  128. {
  129. type: 'hbox',
  130. id: 'alignment',
  131. children: [ {
  132. type: 'radio',
  133. id: 'align',
  134. label: editor.lang.common.align,
  135. items: [
  136. [editor.lang.common.alignCenter, 'center'],
  137. [editor.lang.common.alignLeft, 'left'],
  138. [editor.lang.common.alignRight, 'right'],
  139. [editor.lang.common.alignNone, 'none']
  140. ],
  141. 'default': 'center',
  142. setup: function( widget ) {
  143. if ( widget.data.align ) {
  144. this.setValue( widget.data.align );
  145. }
  146. },
  147. commit: function( widget ) {
  148. widget.setData( 'align', this.getValue() );
  149. }
  150. } ]
  151. } ]
  152. },
  153. {
  154. id: 'Upload',
  155. hidden: true,
  156. filebrowser: 'uploadButton',
  157. label: editor.lang.html5video.upload,
  158. elements: [ {
  159. type: 'file',
  160. id: 'upload',
  161. label: editor.lang.html5video.btnUpload,
  162. style: 'height:40px',
  163. size: 38
  164. },
  165. {
  166. type: 'fileButton',
  167. id: 'uploadButton',
  168. filebrowser: 'info:url',
  169. label: editor.lang.html5video.btnUpload,
  170. 'for': [ 'Upload', 'upload' ]
  171. } ]
  172. },
  173. {
  174. id: 'advanced',
  175. label: editor.lang.html5video.advanced,
  176. elements: [ {
  177. type: 'vbox',
  178. padding: 10,
  179. children: [ {
  180. type: 'hbox',
  181. widths: ["33%", "33%", "33%"],
  182. children: [ {
  183. type: 'radio',
  184. id: 'autoplay',
  185. label: editor.lang.html5video.autoplay,
  186. items: [
  187. [editor.lang.html5video.yes, 'yes'],
  188. [editor.lang.html5video.no, 'no']
  189. ],
  190. 'default': 'no',
  191. setup: function( widget ) {
  192. if ( widget.data.autoplay ) {
  193. this.setValue( widget.data.autoplay );
  194. }
  195. },
  196. commit: function( widget ) {
  197. widget.setData( 'autoplay', this.getValue() );
  198. }
  199. },
  200. {
  201. type: 'radio',
  202. id: 'loop',
  203. label: editor.lang.html5video.loop,
  204. items: [
  205. [editor.lang.html5video.yes, 'yes'],
  206. [editor.lang.html5video.no, 'no']
  207. ],
  208. 'default': 'no',
  209. setup: function( widget ) {
  210. if ( widget.data.loop ) {
  211. this.setValue( widget.data.loop );
  212. }
  213. },
  214. commit: function( widget ) {
  215. widget.setData( 'loop', this.getValue() );
  216. }
  217. },
  218. {
  219. type: 'radio',
  220. id: 'allowdownload',
  221. label: editor.lang.html5video.allowdownload,
  222. items: [
  223. [editor.lang.html5video.yes, 'yes'],
  224. [editor.lang.html5video.no, 'no']
  225. ],
  226. 'default': 'no',
  227. setup: function( widget ) {
  228. if ( widget.data.allowdownload ) {
  229. this.setValue(widget.data.allowdownload);
  230. }
  231. },
  232. commit: function( widget ) {
  233. widget.setData( 'allowdownload', this.getValue() );
  234. }
  235. } ]
  236. },
  237. {
  238. type: 'hbox',
  239. children: [ {
  240. type: "text",
  241. id: 'advisorytitle',
  242. label: editor.lang.html5video.advisorytitle,
  243. 'default': '',
  244. setup: function( widget ) {
  245. if ( widget.data.advisorytitle ) {
  246. this.setValue(widget.data.advisorytitle);
  247. }
  248. },
  249. commit: function( widget ) {
  250. widget.setData( 'advisorytitle', this.getValue() );
  251. }
  252. } ]
  253. } ]
  254. } ]
  255. } ]
  256. };
  257. } );