diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/content.css b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/content.css new file mode 100644 index 00000000..843258b7 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/content.css @@ -0,0 +1,7 @@ +.mceItemFlash { + border: 1px dotted #cc0000; + background-image: url('../images/flash.gif'); + background-position: center; + background-repeat: no-repeat; + background-color: #ffffcc; +} diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/flash.css b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/flash.css new file mode 100644 index 00000000..d3e88e1a --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/flash.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 100px; +} + +#width, #height { + width: 50px; +} + +#file { + width: 250px; +} diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/index.html b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js new file mode 100644 index 00000000..ddcf35d3 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('flash');var TinyMCE_FlashPlugin={getInfo:function(){return{longname:'Flash',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['flash_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/flash/css/content.css")},getControlHTML:function(cn){switch(cn){case"flash":return tinyMCE.getButtonHTML(cn,'lang_flash_desc','{$pluginurl}/images/flash.gif','mceFlash')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFlash":var name="",swffile="",swfwidth="",swfheight="",action="insert";var template=new Array();var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();template['file']='../../plugins/flash/flash.htm';template['width']=430;template['height']=175;template['width']+=tinyMCE.getLang('lang_flash_delta_width',0);template['height']+=tinyMCE.getLang('lang_flash_delta_height',0);if(focusElm!=null&&focusElm.nodeName.toLowerCase()=="img"){name=tinyMCE.getAttrib(focusElm,'class');if(name.indexOf('mceItemFlash')==-1)return true;swffile=tinyMCE.getAttrib(focusElm,'alt');if(tinyMCE.getParam('convert_urls'))swffile=eval(tinyMCE.settings['urlconverter_callback']+"(swffile, null, true);");swfwidth=tinyMCE.getAttrib(focusElm,'width');swfheight=tinyMCE.getAttrib(focusElm,'height');action="update"}tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,action:action});return true}return false},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":if(tinyMCE.getParam('convert_urls')){var imgs=content.getElementsByTagName("img");for(var i=0;i','gi'),'');content=content.replace(new RegExp('<[ ]*object','gi'),'','gi'),'');while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++}break;case"get_from_editor":var startPos=-1;while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+4,endPos));if(attribs['class']!="mceItemFlash")continue;endPos+=2;var embedHTML='';var wmode=tinyMCE.getParam("flash_wmode","");var quality=tinyMCE.getParam("flash_quality","high");var menu=tinyMCE.getParam("flash_menu","false");embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItemFlash')==0){tinyMCE.switchClass(editor_id+'_flash','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_flash','mceButtonNormal');return true},_parseAttributes:function(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_FlashPlugin._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++; + } + + // Parse all embed 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 embed + 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_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos)); + + // Is not flash, skip it + if (attribs['class'] != "mceItemFlash") + continue; + + endPos += 2; + + var embedHTML = ''; + var wmode = tinyMCE.getParam("flash_wmode", ""); + var quality = tinyMCE.getParam("flash_quality", "high"); + var menu = tinyMCE.getParam("flash_menu", "false"); + + // Insert object + embed + embedHTML += ''; + 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; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) { + tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected'); + return true; + } + } while ((node = node.parentNode)); + + tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal'); + + return true; + }, + + // Private plugin internal functions + + _parseAttributes : function(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 +
+ + +
+
+
+ {$lang_flash_general} + + + + + + + + + + + + + + +
+ + + + + +
 
+
 
+ +  x  + +
+
+
+
+ +
+
+ +
+ +
+ +
+
+
+ + diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/flash.gif b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/flash.gif new file mode 100644 index 00000000..cb192e6c Binary files /dev/null and b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/flash.gif differ diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/index.html b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/images/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/index.html b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/flash.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/flash.js new file mode 100644 index 00000000..4f080772 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/flash.js @@ -0,0 +1,107 @@ +var url = tinyMCE.getParam("flash_external_list_url"); +if (url != null) { + // Fix relative + if (url.charAt(0) != '/' && url.indexOf('://') == -1) + url = tinyMCE.documentBasePath + "/" + url; + + document.write(''); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById("filebrowsercontainer").innerHTML = getBrowserHTML('filebrowser','file','flash','flash'); + + // Image list outsrc + var html = getFlashListHTML('filebrowser','file','flash','flash'); + if (html == "") + document.getElementById("linklistrow").style.display = 'none'; + else + document.getElementById("linklistcontainer").innerHTML = html; + + var formObj = document.forms[0]; + var swffile = tinyMCE.getWindowArg('swffile'); + var swfwidth = '' + tinyMCE.getWindowArg('swfwidth'); + var swfheight = '' + tinyMCE.getWindowArg('swfheight'); + + if (swfwidth.indexOf('%')!=-1) { + formObj.width2.value = "%"; + formObj.width.value = swfwidth.substring(0,swfwidth.length-1); + } else { + formObj.width2.value = "px"; + formObj.width.value = swfwidth; + } + + if (swfheight.indexOf('%')!=-1) { + formObj.height2.value = "%"; + formObj.height.value = swfheight.substring(0,swfheight.length-1); + } else { + formObj.height2.value = "px"; + formObj.height.value = swfheight; + } + + formObj.file.value = swffile; + formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); + + selectByValue(formObj, 'linklist', swffile); + + // Handle file browser + if (isVisible('filebrowser')) + document.getElementById('file').style.width = '230px'; + + // Auto select flash in list + if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) { + for (var i=0; i 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; +} + +function insertFlash() { + var formObj = document.forms[0]; + var html = ''; + var file = formObj.file.value; + var width = formObj.width.value; + var height = formObj.height.value; + if (formObj.width2.value=='%') { + width = width + '%'; + } + if (formObj.height2.value=='%') { + height = height + '%'; + } + + if (width == "") + width = 100; + + if (height == "") + height = 100; + + html += '' + + '' + file + ''; + + tinyMCEPopup.execCommand("mceInsertContent", true, html); + tinyMCE.selectedInstance.repaint(); + + tinyMCEPopup.close(); +} diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/index.html b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/jscripts/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js new file mode 100644 index 00000000..67272bc9 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/en.js @@ -0,0 +1,11 @@ +// UK lang variables + +tinyMCE.addToLang('flash',{ +title : 'Insert / edit Flash Movie', +desc : 'Insert / edit Flash Movie', +file : 'Flash-File (.swf)', +size : 'Size', +list : 'Flash files', +props : 'Flash properties', +general : 'General' +}); diff --git a/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/index.html b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce/jscripts/tiny_mce/plugins/flash/langs/index.html @@ -0,0 +1 @@ + \ No newline at end of file