2 Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.md or http://ckeditor.com/license
9 for (var f = this instanceof CKEDITOR.ui.dialog.checkbox, e = 0; e < h.length; e++) {
14 if (null !== a.getAttribute(d.name)) {
15 a = a.getAttribute(d.name);
16 f ? this.setValue("true" == a.toLowerCase()) : this.setValue(a);
19 f && this.setValue(!!d["default"]);
25 f ? this.setValue("true" == a.toLowerCase()) : this.setValue(a);
28 f && this.setValue(!!d["default"]);
32 if (b.getAttribute(d.name)) {
33 a = b.getAttribute(d.name);
34 f ? this.setValue("true" == a.toLowerCase()) : this.setValue(a);
37 f && this.setValue(!!d["default"])
45 for (var f = "" === this.getValue(), e = this instanceof CKEDITOR.ui.dialog.checkbox, d = 0; d < h.length; d++) {
49 if (!a || "data" == g.name && b && !a.hasAttribute("data")) continue;
50 var m = this.getValue();
51 f || e && m === g["default"] ? a.removeAttribute(g.name) : a.setAttribute(g.name, m);
56 if (f || e && m === g["default"]) g.name in c && c[g.name].remove();
57 else if (g.name in c) c[g.name].setAttribute("value", m);
59 var p = CKEDITOR.dom.element.createFromHtml("\x3ccke:param\x3e\x3c/cke:param\x3e", a.getDocument());
64 1 > a.getChildCount() ? p.appendTo(a) : p.insertBefore(a.getFirst())
70 f || e && m === g["default"] ? b.removeAttribute(g.name) : b.setAttribute(g.name, m)
155 }, k = "play loop menu quality scale salign wmode bgcolor base flashvars allowScriptAccess allowFullScreen".split(" "), l = 0; l < k.length; l++) n[k[l]] = [{
162 k = ["play", "loop", "menu"];
163 for (l = 0; l < k.length; l++) n[k[l]][0]["default"] = n[k[l]][1]["default"] = !0;
164 CKEDITOR.dialog.add("flash", function(a) {
165 var l = !a.config.flashEmbedTagOnly,
166 k = a.config.flashAddEmbedTag || a.config.flashEmbedTagOnly,
167 h, f = "\x3cdiv\x3e" + CKEDITOR.tools.htmlEncode(a.lang.common.preview) +
168 '\x3cbr\x3e\x3cdiv id\x3d"cke_FlashPreviewLoader' + CKEDITOR.tools.getNextNumber() + '" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"cke_FlashPreviewBox' + CKEDITOR.tools.getNextNumber() + '" class\x3d"FlashPreviewBox"\x3e\x3c/div\x3e\x3c/div\x3e';
170 title: a.lang.flash.title,
174 this.fakeImage = this.objectNode = this.embedNode = null;
175 h = new CKEDITOR.dom.element("embed", a.document);
176 var e = this.getSelectedElement();
177 if (e && e.data("cke-real-element-type") && "flash" == e.data("cke-real-element-type")) {
179 var d = a.restoreRealElement(e),
183 if ("cke:object" == d.getName()) {
185 d = g.getElementsByTag("embed", "cke");
186 0 < d.count() && (b = d.getItem(0));
187 for (var d = g.getElementsByTag("param", "cke"), f = 0, l = d.count(); f < l; f++) {
188 var k = d.getItem(f),
189 n = k.getAttribute("name"),
190 k = k.getAttribute("value");
193 } else "cke:embed" == d.getName() && (b = d);
196 this.setupContent(g, b, c, e)
204 this.fakeImage ? (e = this.objectNode, d = this.embedNode) : (l && (e = CKEDITOR.dom.element.createFromHtml("\x3ccke:object\x3e\x3c/cke:object\x3e", a.document), e.setAttributes({
205 classid: "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
206 codebase: "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version\x3d6,0,40,0"
207 })), k && (d = CKEDITOR.dom.element.createFromHtml("\x3ccke:embed\x3e\x3c/cke:embed\x3e", a.document), d.setAttributes({
208 type: "application/x-shockwave-flash",
209 pluginspage: "http://www.macromedia.com/go/getflashplayer"
211 e && d.appendTo(e)));
213 for (var b = {}, c = e.getElementsByTag("param", "cke"), f = 0, h = c.count(); f < h; f++) b[c.getItem(f).getAttribute("name")] = c.getItem(f);
216 this.commitContent(e, d, b, c, f);
217 e = a.createFakeElement(e || d, "cke_flash", "flash", !0);
220 this.fakeImage ? (e.replace(this.fakeImage), a.getSelection().selectElement(e)) : a.insertElement(e)
223 this.preview && this.preview.setHtml("")
227 label: a.lang.common.generalTab,
234 widths: ["280px", "110px"],
236 className: "cke_dialog_flash_url",
240 label: a.lang.common.url,
242 validate: CKEDITOR.dialog.validate.notEmpty(a.lang.flash.validateSrc),
246 var a = this.getDialog(),
248 h.setAttribute("src", b);
249 a.preview.setHtml('\x3cembed height\x3d"100%" width\x3d"100%" src\x3d"' + CKEDITOR.tools.htmlEncode(h.getAttribute("src")) + '" type\x3d"application/x-shockwave-flash"\x3e\x3c/embed\x3e')
251 a.preview = a.getContentElement("info", "preview").getElement().getChild(3);
252 this.on("change", function(a) {
253 a.data && a.data.value && b(a.data.value)
255 this.getInputElement().on("change", function() {
262 filebrowser: "info:src",
264 style: "display:inline-block;margin-top:14px;",
265 label: a.lang.common.browseServer
270 widths: ["25%", "25%", "25%", "25%", "25%"],
274 requiredContent: "embed[width]",
276 label: a.lang.common.width,
277 validate: CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1", a.lang.common.width)),
283 requiredContent: "embed[height]",
285 label: a.lang.common.height,
286 validate: CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1", a.lang.common.height)),
292 requiredContent: "embed[hspace]",
294 label: a.lang.flash.hSpace,
295 validate: CKEDITOR.dialog.validate.integer(a.lang.flash.validateHSpace),
301 requiredContent: "embed[vspace]",
303 label: a.lang.flash.vSpace,
304 validate: CKEDITOR.dialog.validate.integer(a.lang.flash.validateVSpace),
320 filebrowser: "uploadButton",
321 label: a.lang.common.upload,
325 label: a.lang.common.upload,
330 label: a.lang.common.uploadSubmit,
331 filebrowser: "info:src",
332 "for": ["Upload", "upload"]
336 label: a.lang.flash.propertiesTab,
339 widths: ["50%", "50%"],
343 requiredContent: "embed[scale]",
344 label: a.lang.flash.scale,
346 style: "width : 100%;",
348 [a.lang.common.notSet, ""],
349 [a.lang.flash.scaleAll, "showall"],
350 [a.lang.flash.scaleNoBorder, "noborder"],
351 [a.lang.flash.scaleFit, "exactfit"]
356 id: "allowScriptAccess",
358 requiredContent: "embed[allowscriptaccess]",
359 label: a.lang.flash.access,
361 style: "width : 100%;",
363 [a.lang.common.notSet, ""],
364 [a.lang.flash.accessAlways, "always"],
365 [a.lang.flash.accessSameDomain, "samedomain"],
366 [a.lang.flash.accessNever, "never"]
373 widths: ["50%", "50%"],
377 requiredContent: "embed[wmode]",
378 label: a.lang.flash.windowMode,
380 style: "width : 100%;",
382 [a.lang.common.notSet, ""],
383 [a.lang.flash.windowModeWindow, "window"],
384 [a.lang.flash.windowModeOpaque,
387 [a.lang.flash.windowModeTransparent, "transparent"]
394 requiredContent: "embed[quality]",
395 label: a.lang.flash.quality,
397 style: "width : 100%;",
399 [a.lang.common.notSet, ""],
400 [a.lang.flash.qualityBest, "best"],
401 [a.lang.flash.qualityHigh, "high"],
402 [a.lang.flash.qualityAutoHigh, "autohigh"],
403 [a.lang.flash.qualityMedium, "medium"],
404 [a.lang.flash.qualityAutoLow, "autolow"],
405 [a.lang.flash.qualityLow, "low"]
418 requiredContent: "object[align]",
419 label: a.lang.common.align,
421 style: "width : 100%;",
423 [a.lang.common.notSet, ""],
424 [a.lang.common.alignLeft, "left"],
425 [a.lang.flash.alignAbsBottom, "absBottom"],
426 [a.lang.flash.alignAbsMiddle, "absMiddle"],
427 [a.lang.flash.alignBaseline, "baseline"],
428 [a.lang.common.alignBottom, "bottom"],
429 [a.lang.common.alignMiddle, "middle"],
430 [a.lang.common.alignRight, "right"],
431 [a.lang.flash.alignTextTop, "textTop"],
432 [a.lang.common.alignTop, "top"]
435 commit: function(a, b, f, k, l) {
436 var h = this.getValue();
437 c.apply(this, arguments);
442 html: "\x3cdiv\x3e\x3c/div\x3e"
446 label: CKEDITOR.tools.htmlEncode(a.lang.flash.flashvars),
453 label: a.lang.flash.chkMenu,
460 label: a.lang.flash.chkPlay,
467 label: a.lang.flash.chkLoop,
473 id: "allowFullScreen",
474 label: a.lang.flash.chkFull,
483 label: a.lang.common.advancedTab,
489 requiredContent: "object[id]",
490 label: a.lang.common.id,
496 widths: ["45%", "55%"],
500 requiredContent: "embed[bgcolor]",
501 label: a.lang.flash.bgcolor,
507 requiredContent: "embed(cke-xyz)",
508 label: a.lang.common.cssClass,
515 requiredContent: "embed{cke-xyz}",
516 validate: CKEDITOR.dialog.validate.inlineStyle(a.lang.common.invalidInlineStyle),
517 label: a.lang.common.cssStyle,