/* Import plugin specific language pack */ tinyMCE.importPluginLanguagePack('flash', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr'); 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('', startPos); // Find end of embed endPos = content.indexOf('/>', endPos); if (endPos == -1) { endPos = content.indexOf('', endPos); endPos += 8; } else endPos += 2; if (index >= embedList.length) break; var attribs = embedList[index]; // Insert image var contentAfter = content.substring(endPos+1); content = content.substring(0, startPos); content += '' + content.substring(endPos+1); content += contentAfter; index++; startPos++; } break; case "get_from_editor": // Parse all img tags and replace them with object+embed var startPos = 0; while ((startPos = content.indexOf('', startPos); var attribs = TinyMCE_flash_parseAttributes(content.substring(startPos + 4, endPos)); // Is not flash if (attribs['name'] != "mce_plugin_flash") break; endPos += 2; var embedHTML = ''; // Insert object + embed embedHTML += ''; embedHTML += ''; embedHTML += ''; embedHTML += ''; embedHTML += ''; /* */ content = content.substring(0, startPos) + embedHTML + content.substring(endPos+1); startPos++; } 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; }