/* Import plugin specific language pack */ tinyMCE.importPluginLanguagePack('flash', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br'); function TinyMCE_flash_initInstance(inst) { if (!tinyMCE.settings['flash_skip_plugin_css']) tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/flash.css"); } function TinyMCE_flash_getControlHTML(control_name) { switch (control_name) { case "flash": return ''; } return ""; } function TinyMCE_flash_parseAttributes(attribute_string) { var attributeName = ""; var attributeValue = ""; var withInName; var withInValue; var attributes = new Array(); var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g'); if (attribute_string == null || attribute_string.length < 2) return null; withInName = withInValue = false; for (var i=0; i','gi'),''); content = content.replace(new RegExp('<[ ]*object','gi'),'','gi'),''); // Parse all embed tags while ((startPos = content.indexOf('', startPos); var attribs = TinyMCE_flash_parseAttributes(content.substring(startPos + 6, endPos)); embedList[embedList.length] = attribs; } // Parse all object tags and replace them with images from the embed data var index = 0; while ((startPos = content.indexOf('= embedList.length) break; var attribs = embedList[index]; // Find end of object endPos = content.indexOf('', startPos); endPos += 9; // Insert image var contentAfter = content.substring(endPos); content = content.substring(0, startPos); content += '' + content.substring(endPos); content += contentAfter; index++; startPos++; } break; case "get_from_editor": // Parse all img tags and replace them with object+embed var startPos = -1; while ((startPos = content.indexOf('', startPos); var attribs = TinyMCE_flash_parseAttributes(content.substring(startPos + 4, endPos)); // Is not flash, skip it if (attribs['name'] != "mce_plugin_flash") continue; endPos += 2; var embedHTML = ''; // Insert object + embed embedHTML += ''; embedHTML += ''; embedHTML += ''; embedHTML += ''; embedHTML += ''; // Insert embed/object chunk chunkBefore = content.substring(0, startPos); chunkAfter = content.substring(endPos); content = chunkBefore + embedHTML + chunkAfter; } break; } // Pass through to next handler in chain return content; } function TinyMCE_flash_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { function getAttrib(elm, name) { return elm.getAttribute(name) ? elm.getAttribute(name) : ""; } tinyMCE.switchClassSticky(editor_id + '_flash', 'mceButtonNormal'); if (node == null) return; do { if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'name').indexOf('mce_plugin_flash') == 0) tinyMCE.switchClassSticky(editor_id + '_flash', 'mceButtonSelected'); } while ((node = node.parentNode)); return true; }