diff options
Diffstat (limited to 'program/js/tiny_mce/plugins')
44 files changed, 2489 insertions, 302 deletions
diff --git a/program/js/tiny_mce/plugins/cleanup/editor_plugin_src.js b/program/js/tiny_mce/plugins/cleanup/editor_plugin_src.js index cb7dfac96..c672a6e94 100644 --- a/program/js/tiny_mce/plugins/cleanup/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/cleanup/editor_plugin_src.js @@ -1,7 +1,5 @@ /**
- * $RCSfile: editor_plugin_src.js,v $
- * $Revision: 1.10 $
- * $Date: 2006/02/10 16:29:38 $
+ * $Id: editor_plugin_src.js 18 2006-06-29 14:11:23Z spocke $
*
* Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth.
*
diff --git a/program/js/tiny_mce/plugins/emotions/editor_plugin.js b/program/js/tiny_mce/plugins/emotions/editor_plugin.js index 07779873b..64ede7ac8 100644 --- a/program/js/tiny_mce/plugins/emotions/editor_plugin.js +++ b/program/js/tiny_mce/plugins/emotions/editor_plugin.js @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('emotions','en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=160;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
\ No newline at end of file +tinyMCE.importPluginLanguagePack('emotions');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=160;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/emotions/editor_plugin_src.js b/program/js/tiny_mce/plugins/emotions/editor_plugin_src.js index 10db6422d..f5bedfaac 100644 --- a/program/js/tiny_mce/plugins/emotions/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -1,21 +1,19 @@ /**
- * $RCSfile: editor_plugin_src.js,v $
- * $Revision: 1.23 $
- * $Date: 2006/02/10 16:29:38 $
+ * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('emotions', 'en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
+tinyMCE.importPluginLanguagePack('emotions');
// Plucin static class
var TinyMCE_EmotionsPlugin = {
getInfo : function() {
return {
longname : 'Emotions',
- author : 'Moxiecode Systems',
+ author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
diff --git a/program/js/tiny_mce/plugins/emotions/emotions.htm b/program/js/tiny_mce/plugins/emotions/emotions.htm index c70f4b45f..fca8ffa08 100644 --- a/program/js/tiny_mce/plugins/emotions/emotions.htm +++ b/program/js/tiny_mce/plugins/emotions/emotions.htm @@ -5,7 +5,7 @@ <script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
<base target="_self" />
</head>
-<body style="display: none">
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<div align="center">
<div class="title">{$lang_emotions_title}:<br /><br /></div>
diff --git a/program/js/tiny_mce/plugins/media/css/content.css b/program/js/tiny_mce/plugins/media/css/content.css new file mode 100755 index 000000000..1f667e633 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/css/content.css @@ -0,0 +1,26 @@ +.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {
+ border: 1px dotted #cc0000;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-color: #ffffcc;
+}
+
+.mceItemShockWave {
+ background-image: url('../images/shockwave.gif');
+}
+
+.mceItemFlash {
+ background-image: url('../images/flash.gif');
+}
+
+.mceItemQuickTime {
+ background-image: url('../images/quicktime.gif');
+}
+
+.mceItemWindowsMedia {
+ background-image: url('../images/windowsmedia.gif');
+}
+
+.mceItemRealMedia {
+ background-image: url('../images/realmedia.gif');
+}
diff --git a/program/js/tiny_mce/plugins/media/css/media.css b/program/js/tiny_mce/plugins/media/css/media.css new file mode 100755 index 000000000..89c6bd5a0 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,68 @@ +#id, #name, #hspace, #vspace, #class_name, #align {
+ width: 100px;
+}
+
+#hspace, #vspace {
+ width: 50px;
+}
+
+#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
+ width: 100px;
+}
+
+#flash_base, #flash_flashvars {
+ width: 240px;
+}
+
+#width, #height {
+ width: 40px;
+}
+
+#src, #media_type {
+ width: 250px;
+}
+
+#class {
+ width: 120px;
+}
+
+#prev {
+ margin: 0;
+ border: 1px solid black;
+ width: 99%;
+ height: 230px;
+ overflow: auto;
+}
+
+.panel_wrapper div.current {
+ height: 390px;
+ overflow: auto;
+}
+
+#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
+ display: none;
+}
+
+.mceAddSelectValue {
+ background-color: #DDDDDD;
+}
+
+#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
+ width: 70px;
+}
+
+#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
+ width: 70px;
+}
+
+#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
+ width: 70px;
+}
+
+#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
+ width: 90px;
+}
+
+#qt_qtsrc {
+ width: 200px;
+}
diff --git a/program/js/tiny_mce/plugins/media/editor_plugin.js b/program/js/tiny_mce/plugins/media/editor_plugin.js new file mode 100755 index 000000000..67dc81fb3 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('media');var TinyMCE_MediaPlugin={getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_media.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['media_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/media/css/content.css")},getControlHTML:function(cn){switch(cn){case"media":return tinyMCE.getButtonHTML(cn,'lang_media_desc','{$pluginurl}/images/media.gif','mceMedia')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceMedia":tinyMCE.openWindow({file:'../../plugins/media/media.htm',width:430+tinyMCE.getLang('lang_media_delta_width',0),height:470+tinyMCE.getLang('lang_media_delta_height',0)},{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content,inst){var nl,img,i,ne,d,s,ci;switch(type){case"insert_to_editor":img=tinyMCE.getParam("theme_href")+'/images/spacer.gif';content=content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,'<img class="mceItem$1" title="$2" src="'+img+'" />');content=content.replace(/<object([^>]*)>/gi,'<div class="mceItemObject" $1>');content=content.replace(/<embed([^>]*)>/gi,'<div class="mceItemObjectEmbed" $1>');content=content.replace(/<\/(object|embed)([^>]*)>/gi,'</div>');content=content.replace(/<param([^>]*)>/gi,'<div $1 class="mceItemParam"></div>');content=content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>','gi'),'class="mceItemParam"></div>');break;case"insert_to_editor_dom":d=inst.getDoc();nl=content.getElementsByTagName("img");for(i=0;i<nl.length;i++){if(/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)){nl[i].width=nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g,'$1');nl[i].height=nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g,'$1');}}nl=tinyMCE.selectElements(content,'DIV',function(n){return tinyMCE.hasCSSClass(n,'mceItemObject')});for(i=0;i<nl.length;i++){ci=tinyMCE.getAttrib(nl[i],"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash',d,nl[i]),nl[i]);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave',d,nl[i]),nl[i]);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia',d,nl[i]),nl[i]);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime',d,nl[i]),nl[i]);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia',d,nl[i]),nl[i]);break}}nl=tinyMCE.selectNodes(content,function(n){return n.className=='mceItemObjectEmbed'});for(i=0;i<nl.length;i++){switch(tinyMCE.getAttrib(nl[i],'type')){case'application/x-shockwave-flash':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemFlash');break;case'application/x-director':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemShockWave');break;case'application/x-mplayer2':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemWindowsMedia');break;case'video/quicktime':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemQuickTime');break;case'audio/x-pn-realaudio-plugin':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemRealMedia');break}}break;case"get_from_editor":var startPos=-1,endPos,attribs,chunkBefore,chunkAfter,embedHTML,at,pl,cb,mt,ex;while((startPos=content.indexOf('<img',startPos+1))!=-1){endPos=content.indexOf('/>',startPos);attribs=TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos+4,endPos));if(!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))continue;endPos+=2;at=attribs['title'];if(at){at=at.replace(/'/g,"'");at=at.replace(/&#quot;/g,'"');try{pl=eval('x={'+at+'};')}catch(ex){pl={}}}if(!tinyMCE.getParam('media_use_script',false)){switch(attribs['class']){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166B1BCA-3F9C-11CF-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=tinyMCE.getParam('media_wmp6_compatible')?'05589FA1-C356-11CE-BF01-00AA0055595A':'6BF52A52-394A-11D3-B153-00C04F79FAA6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break}if(!tinyMCE.getParam("relative_urls"))pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);embedHTML=TinyMCE_MediaPlugin._getEmbed(ci,cb,mt,pl,attribs)}else{switch(attribs['class']){case'mceItemFlash':s='writeFlash';break;case'mceItemShockWave':s='writeShockWave';break;case'mceItemWindowsMedia':s='writeWindowsMedia';break;case'mceItemQuickTime':s='writeQuickTime';break;case'mceItemRealMedia':s='writeRealMedia';break}if(attribs.width)at=at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g,"width:'"+attribs.width+"'");if(attribs.height)at=at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g,"height:'"+attribs.height+"'");if(!tinyMCE.getParam("relative_urls")){pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);at=at.replace(new RegExp("src:'[^']*'","g"),"src:'"+pl.src+"'")}embedHTML='<script type="text/javascript">'+s+'({'+at+'});</script>'}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"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node,'class'))){tinyMCE.switchClass(editor_id+'_media','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_media','mceButtonNormal');return true},_createImgFromEmbed:function(n,d,cl){var ne,at,i,ti='',an;ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;at=n.attributes;for(i=0;i<at.length;i++){if(at[i].specified&&at[i].nodeValue){an=at[i].nodeName.toLowerCase();if(an=='src')continue;if(an=='mce_src')an='src';if(an.indexOf('mce_')==-1&&!new RegExp('^(class|type)$').test(an))ti+=an.toLowerCase()+':\''+at[i].nodeValue+"',"}}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;n.parentNode.replaceChild(ne,n)},_createImg:function(cl,d,n){var i,nl,ti="",an,av,al=new Array();ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;al.id=tinyMCE.getAttrib(n,'id');al.name=tinyMCE.getAttrib(n,'name');al.width=tinyMCE.getAttrib(n,'width');al.height=tinyMCE.getAttrib(n,'height');al.bgcolor=tinyMCE.getAttrib(n,'bgcolor');al.align=tinyMCE.getAttrib(n,'align');al.class_name=tinyMCE.getAttrib(n,'mce_class');nl=n.getElementsByTagName('div');for(i=0;i<nl.length;i++){av=tinyMCE.getAttrib(nl[i],'value');av=av.replace(new RegExp('\\\\','g'),'\\\\');av=av.replace(new RegExp('"','g'),'\\"');av=av.replace(new RegExp("'",'g'),"\\'");an=tinyMCE.getAttrib(nl[i],'name');al[an]=av}if(al.movie){al.src=al.movie;al.movie=null}for(an in al){if(al[an]!=null&&typeof(al[an])!="function"&&al[an]!='')ti+=an.toLowerCase()+':\''+al[an]+"',"}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;return ne},_getEmbed:function(cls,cb,mt,p,at){var h='',n;p.width=at.width?at.width:p.width;p.height=at.height?at.height:p.height;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?' id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?' name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?' width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?' height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?' align="'+p.align+'"':'';h+='>';for(n in p){if(p[n]&&typeof(p[n])!="function"){h+='<param name="'+n+'" value="'+p[n]+'" />';if(n=='src'&&p[n].indexOf('://')!=-1&&mt=='application/x-mplayer2')h+='<param name="url" value="'+p[n]+'" />'}}h+='<embed type="'+mt+'"';for(n in p){if(typeof(p[n])=="function")continue;if(!(n=='url'&&mt=='application/x-mplayer2'))h+=' '+n+'="'+p[n]+'"'}h+='></embed></object>';return h},_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<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue)withInValue=true;else if((chr=='"'||chr=="'")&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue=""}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr}return attributes}};tinyMCE.addPlugin("media",TinyMCE_MediaPlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/media/editor_plugin_src.js b/program/js/tiny_mce/plugins/media/editor_plugin_src.js new file mode 100755 index 000000000..b8c2eb6c0 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/editor_plugin_src.js @@ -0,0 +1,428 @@ +/**
+ * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('media');
+
+var TinyMCE_MediaPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Media',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_media.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ initInstance : function(inst) {
+ if (!tinyMCE.settings['media_skip_plugin_css'])
+ tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/media/css/content.css");
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "media":
+ return tinyMCE.getButtonHTML(cn, 'lang_media_desc', '{$pluginurl}/images/media.gif', 'mceMedia');
+ }
+
+ return "";
+ },
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mceMedia":
+ tinyMCE.openWindow({
+ file : '../../plugins/media/media.htm',
+ width : 430 + tinyMCE.getLang('lang_media_delta_width', 0),
+ height : 470 + tinyMCE.getLang('lang_media_delta_height', 0)
+ }, {
+ editor_id : editor_id,
+ inline : "yes"
+ });
+
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+ },
+
+ cleanup : function(type, content, inst) {
+ var nl, img, i, ne, d, s, ci;
+
+ switch (type) {
+ case "insert_to_editor":
+ img = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
+ content = content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, '<img class="mceItem$1" title="$2" src="' + img + '" />');
+ content = content.replace(/<object([^>]*)>/gi, '<div class="mceItemObject" $1>');
+ content = content.replace(/<embed([^>]*)>/gi, '<div class="mceItemObjectEmbed" $1>');
+ content = content.replace(/<\/(object|embed)([^>]*)>/gi, '</div>');
+ content = content.replace(/<param([^>]*)>/gi, '<div $1 class="mceItemParam"></div>');
+ content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam"></div>');
+ break;
+
+ case "insert_to_editor_dom":
+ d = inst.getDoc();
+ nl = content.getElementsByTagName("img");
+ for (i=0; i<nl.length; i++) {
+ if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)) {
+ nl[i].width = nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g, '$1');
+ nl[i].height = nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g, '$1');
+ //nl[i].align = nl[i].title.replace(/.*align:([a-z]+).*/gi, '$1');
+ }
+ }
+
+ nl = tinyMCE.selectElements(content, 'DIV', function (n) {return tinyMCE.hasCSSClass(n, 'mceItemObject');});
+ for (i=0; i<nl.length; i++) {
+ ci = tinyMCE.getAttrib(nl[i], "classid").toLowerCase().replace(/\s+/g, '');
+
+ switch (ci) {
+ case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
+ nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash', d, nl[i]), nl[i]);
+ break;
+
+ case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
+ nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave', d, nl[i]), nl[i]);
+ break;
+
+ case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
+ nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia', d, nl[i]), nl[i]);
+ break;
+
+ case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
+ nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime', d, nl[i]), nl[i]);
+ break;
+
+ case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
+ case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
+ case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
+ nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia', d, nl[i]), nl[i]);
+ break;
+ }
+ }
+
+ // Handle embed (if any)
+ nl = tinyMCE.selectNodes(content, function (n) {return n.className == 'mceItemObjectEmbed';});
+ for (i=0; i<nl.length; i++) {
+ switch (tinyMCE.getAttrib(nl[i], 'type')) {
+ case 'application/x-shockwave-flash':
+ TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemFlash');
+ break;
+
+ case 'application/x-director':
+ TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemShockWave');
+ break;
+
+ case 'application/x-mplayer2':
+ TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemWindowsMedia');
+ break;
+
+ case 'video/quicktime':
+ TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemQuickTime');
+ break;
+
+ case 'audio/x-pn-realaudio-plugin':
+ TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemRealMedia');
+ break;
+ }
+ }
+ break;
+
+ case "get_from_editor":
+ var startPos = -1, endPos, attribs, chunkBefore, chunkAfter, embedHTML, at, pl, cb, mt, ex;
+
+ while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
+ endPos = content.indexOf('/>', startPos);
+ attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos));
+
+ // Is not flash, skip it
+ if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))
+ continue;
+
+ endPos += 2;
+
+ // Parse attributes
+ at = attribs['title'];
+ if (at) {
+ at = at.replace(/'/g, "'");
+ at = at.replace(/&#quot;/g, '"');
+
+ try {
+ pl = eval('x={' + at + '};');
+ } catch (ex) {
+ pl = {};
+ }
+ }
+
+ // Use object/embed
+ if (!tinyMCE.getParam('media_use_script', false)) {
+ switch (attribs['class']) {
+ case 'mceItemFlash':
+ ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+ mt = 'application/x-shockwave-flash';
+ break;
+
+ case 'mceItemShockWave':
+ ci = '166B1BCA-3F9C-11CF-8075-444553540000';
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
+ mt = 'application/x-director';
+ break;
+
+ case 'mceItemWindowsMedia':
+ ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6';
+ cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+ mt = 'application/x-mplayer2';
+ break;
+
+ case 'mceItemQuickTime':
+ ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
+ cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
+ mt = 'video/quicktime';
+ break;
+
+ case 'mceItemRealMedia':
+ ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+ mt = 'audio/x-pn-realaudio-plugin';
+ break;
+ }
+
+ // Force absolute URL
+ if (!tinyMCE.getParam("relative_urls"))
+ pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
+
+ embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs);
+ } else {
+ // Use script version
+ switch (attribs['class']) {
+ case 'mceItemFlash':
+ s = 'writeFlash';
+ break;
+
+ case 'mceItemShockWave':
+ s = 'writeShockWave';
+ break;
+
+ case 'mceItemWindowsMedia':
+ s = 'writeWindowsMedia';
+ break;
+
+ case 'mceItemQuickTime':
+ s = 'writeQuickTime';
+ break;
+
+ case 'mceItemRealMedia':
+ s = 'writeRealMedia';
+ break;
+ }
+
+ if (attribs.width)
+ at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'");
+
+ if (attribs.height)
+ at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'");
+
+ // Force absolute URL
+ if (!tinyMCE.getParam("relative_urls")) {
+ pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
+ at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'");
+ }
+
+ embedHTML = '<script type="text/javascript">' + s + '({' + at + '});</script>';
+ }
+
+ // Insert embed/object chunk
+ 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" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) {
+ tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected');
+ return true;
+ }
+ } while ((node = node.parentNode));
+
+ tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal');
+
+ return true;
+ },
+
+ _createImgFromEmbed : function(n, d, cl) {
+ var ne, at, i, ti = '', an;
+
+ ne = d.createElement('img');
+ ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
+ ne.width = tinyMCE.getAttrib(n, 'width');
+ ne.height = tinyMCE.getAttrib(n, 'height');
+ ne.className = cl;
+
+ at = n.attributes;
+ for (i=0; i<at.length; i++) {
+ if (at[i].specified && at[i].nodeValue) {
+ an = at[i].nodeName.toLowerCase();
+
+ if (an == 'src')
+ continue;
+
+ if (an == 'mce_src')
+ an = 'src';
+
+ if (an.indexOf('mce_') == -1 && !new RegExp('^(class|type)$').test(an))
+ ti += an.toLowerCase() + ':\'' + at[i].nodeValue + "',";
+ }
+ }
+
+ ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
+ ne.title = ti;
+
+ n.parentNode.replaceChild(ne, n);
+ },
+
+ _createImg : function(cl, d, n) {
+ var i, nl, ti = "", an, av, al = new Array();
+
+ ne = d.createElement('img');
+ ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
+ ne.width = tinyMCE.getAttrib(n, 'width');
+ ne.height = tinyMCE.getAttrib(n, 'height');
+ ne.className = cl;
+
+ al.id = tinyMCE.getAttrib(n, 'id');
+ al.name = tinyMCE.getAttrib(n, 'name');
+ al.width = tinyMCE.getAttrib(n, 'width');
+ al.height = tinyMCE.getAttrib(n, 'height');
+ al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor');
+ al.align = tinyMCE.getAttrib(n, 'align');
+ al.class_name = tinyMCE.getAttrib(n, 'mce_class');
+
+ nl = n.getElementsByTagName('div');
+ for (i=0; i<nl.length; i++) {
+ av = tinyMCE.getAttrib(nl[i], 'value');
+ av = av.replace(new RegExp('\\\\', 'g'), '\\\\');
+ av = av.replace(new RegExp('"', 'g'), '\\"');
+ av = av.replace(new RegExp("'", 'g'), "\\'");
+ an = tinyMCE.getAttrib(nl[i], 'name');
+ al[an] = av;
+ }
+
+ if (al.movie) {
+ al.src = al.movie;
+ al.movie = null;
+ }
+
+ for (an in al) {
+ if (al[an] != null && typeof(al[an]) != "function" && al[an] != '')
+ ti += an.toLowerCase() + ':\'' + al[an] + "',";
+ }
+
+ ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
+ ne.title = ti;
+
+ return ne;
+ },
+
+ _getEmbed : function(cls, cb, mt, p, at) {
+ var h = '', n;
+
+ p.width = at.width ? at.width : p.width;
+ p.height = at.height ? at.height : p.height;
+
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+ h += typeof(p.id) != "undefined" ? ' id="' + p.id + '"' : '';
+ h += typeof(p.name) != "undefined" ? ' name="' + p.name + '"' : '';
+ h += typeof(p.width) != "undefined" ? ' width="' + p.width + '"' : '';
+ h += typeof(p.height) != "undefined" ? ' height="' + p.height + '"' : '';
+ h += typeof(p.align) != "undefined" ? ' align="' + p.align + '"' : '';
+ h += '>';
+
+ for (n in p) {
+ if (p[n] && typeof(p[n]) != "function") {
+ h += '<param name="' + n + '" value="' + p[n] + '" />';
+
+ // Add extra url parameter if it's an absolute URL on WMP
+ if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2')
+ h += '<param name="url" value="' + p[n] + '" />';
+ }
+ }
+
+ h += '<embed type="' + mt + '"';
+
+ for (n in p) {
+ if (typeof(p[n]) == "function")
+ continue;
+
+ // Skip url parameter for embed tag on WMP
+ if (!(n == 'url' && mt == 'application/x-mplayer2'))
+ h += ' ' + n + '="' + p[n] + '"';
+ }
+
+ h += '></embed></object>';
+
+ return h;
+ },
+
+ _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<attribute_string.length; i++) {
+ var chr = attribute_string.charAt(i);
+
+ if ((chr == '"' || chr == "'") && !withInValue)
+ withInValue = true;
+ else if ((chr == '"' || chr == "'") && withInValue) {
+ withInValue = false;
+
+ var pos = attributeName.lastIndexOf(' ');
+ if (pos != -1)
+ attributeName = attributeName.substring(pos+1);
+
+ attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
+
+ attributeName = "";
+ attributeValue = "";
+ } else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
+ withInName = true;
+
+ if (chr == '=' && withInName)
+ withInName = false;
+
+ if (withInName)
+ attributeName += chr;
+
+ if (withInValue)
+ attributeValue += chr;
+ }
+
+ return attributes;
+ }
+};
+
+tinyMCE.addPlugin("media", TinyMCE_MediaPlugin);
diff --git a/program/js/tiny_mce/plugins/media/images/flash.gif b/program/js/tiny_mce/plugins/media/images/flash.gif Binary files differnew file mode 100755 index 000000000..cb192e6ce --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/flash.gif diff --git a/program/js/tiny_mce/plugins/media/images/media.gif b/program/js/tiny_mce/plugins/media/images/media.gif Binary files differnew file mode 100755 index 000000000..856df5237 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/media.gif diff --git a/program/js/tiny_mce/plugins/media/images/quicktime.gif b/program/js/tiny_mce/plugins/media/images/quicktime.gif Binary files differnew file mode 100755 index 000000000..3b0499145 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/quicktime.gif diff --git a/program/js/tiny_mce/plugins/media/images/realmedia.gif b/program/js/tiny_mce/plugins/media/images/realmedia.gif Binary files differnew file mode 100755 index 000000000..fdfe0b9ac --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/realmedia.gif diff --git a/program/js/tiny_mce/plugins/media/images/shockwave.gif b/program/js/tiny_mce/plugins/media/images/shockwave.gif Binary files differnew file mode 100755 index 000000000..5f235dfc7 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/shockwave.gif diff --git a/program/js/tiny_mce/plugins/media/images/windowsmedia.gif b/program/js/tiny_mce/plugins/media/images/windowsmedia.gif Binary files differnew file mode 100755 index 000000000..ab50f2d88 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/images/windowsmedia.gif diff --git a/program/js/tiny_mce/plugins/media/jscripts/embed.js b/program/js/tiny_mce/plugins/media/jscripts/embed.js new file mode 100755 index 000000000..f8dc81052 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/jscripts/embed.js @@ -0,0 +1,73 @@ +/**
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
+ */
+
+function writeFlash(p) {
+ writeEmbed(
+ 'D27CDB6E-AE6D-11cf-96B8-444553540000',
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+ 'application/x-shockwave-flash',
+ p
+ );
+}
+
+function writeShockWave(p) {
+ writeEmbed(
+ '166B1BCA-3F9C-11CF-8075-444553540000',
+ 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
+ 'application/x-director',
+ p
+ );
+}
+
+function writeQuickTime(p) {
+ writeEmbed(
+ '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+ 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
+ 'video/quicktime',
+ p
+ );
+}
+
+function writeRealMedia(p) {
+ writeEmbed(
+ 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+ 'audio/x-pn-realaudio-plugin',
+ p
+ );
+}
+
+function writeWindowsMedia(p) {
+ p.url = p.src;
+ writeEmbed(
+ '6BF52A52-394A-11D3-B153-00C04F79FAA6',
+ 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
+ 'application/x-mplayer2',
+ p
+ );
+}
+
+function writeEmbed(cls, cb, mt, p) {
+ var h = '', n;
+
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+ h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
+ h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
+ h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
+ h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
+ h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
+ h += '>';
+
+ for (n in p)
+ h += '<param name="' + n + '" value="' + p[n] + '">';
+
+ h += '<embed type="' + mt + '"';
+
+ for (n in p)
+ h += n + '="' + p[n] + '" ';
+
+ h += '></embed></object>';
+
+ document.write(h);
+}
diff --git a/program/js/tiny_mce/plugins/media/jscripts/media.js b/program/js/tiny_mce/plugins/media/jscripts/media.js new file mode 100755 index 000000000..44b68fa4d --- /dev/null +++ b/program/js/tiny_mce/plugins/media/jscripts/media.js @@ -0,0 +1,572 @@ +var oldWidth, oldHeight;
+var url = tinyMCE.getParam("media_external_list_url");
+if (url != null) {
+ // Fix relative
+ if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+ url = tinyMCE.documentBasePath + "/" + url;
+
+ document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+ var pl = "", f, val;
+ var type = "flash", fe, i;
+
+ tinyMCEPopup.resizeToInnerSize();
+ f = document.forms[0]
+
+ fe = tinyMCE.selectedInstance.getFocusElement();
+ if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) {
+ pl = "x={" + fe.title + "};";
+
+ switch (tinyMCE.getAttrib(fe, 'class')) {
+ case 'mceItemFlash':
+ type = 'flash';
+ break;
+
+ case 'mceItemShockWave':
+ type = 'shockwave';
+ break;
+
+ case 'mceItemWindowsMedia':
+ type = 'wmp';
+ break;
+
+ case 'mceItemQuickTime':
+ type = 'qt';
+ break;
+
+ case 'mceItemRealMedia':
+ type = 'rmp';
+ break;
+ }
+
+ document.forms[0].insert.value = tinyMCE.getLang('lang_update', 'Insert', true);
+ }
+
+ document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
+ document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+ var html = getMediaListHTML('filebrowser','src','media','media');
+ if (html == "")
+ document.getElementById("linklistrow").style.display = 'none';
+ else
+ document.getElementById("linklistcontainer").innerHTML = html;
+
+ // Resize some elements
+ if (isVisible('filebrowsercontainer'))
+ document.getElementById('src').style.width = '230px';
+
+ // Setup form
+ if (pl != "") {
+ pl = eval(pl);
+
+ switch (type) {
+ case "flash":
+ setBool(pl, 'flash', 'play');
+ setBool(pl, 'flash', 'loop');
+ setBool(pl, 'flash', 'menu');
+ setBool(pl, 'flash', 'swliveconnect');
+ setStr(pl, 'flash', 'quality');
+ setStr(pl, 'flash', 'scale');
+ setStr(pl, 'flash', 'salign');
+ setStr(pl, 'flash', 'wmode');
+ setStr(pl, 'flash', 'base');
+ setStr(pl, 'flash', 'flashvars');
+ break;
+
+ case "qt":
+ setBool(pl, 'qt', 'loop');
+ setBool(pl, 'qt', 'autoplay');
+ setBool(pl, 'qt', 'cache');
+ setBool(pl, 'qt', 'controller');
+ setBool(pl, 'qt', 'correction');
+ setBool(pl, 'qt', 'enablejavascript');
+ setBool(pl, 'qt', 'kioskmode');
+ setBool(pl, 'qt', 'autohref');
+ setBool(pl, 'qt', 'playeveryframe');
+ setBool(pl, 'qt', 'tarsetcache');
+ setStr(pl, 'qt', 'scale');
+ setStr(pl, 'qt', 'starttime');
+ setStr(pl, 'qt', 'endtime');
+ setStr(pl, 'qt', 'tarset');
+ setStr(pl, 'qt', 'qtsrcchokespeed');
+ setStr(pl, 'qt', 'volume');
+ setStr(pl, 'qt', 'qtsrc');
+ break;
+
+ case "shockwave":
+ setBool(pl, 'shockwave', 'sound');
+ setBool(pl, 'shockwave', 'progress');
+ setBool(pl, 'shockwave', 'autostart');
+ setBool(pl, 'shockwave', 'swliveconnect');
+ setStr(pl, 'shockwave', 'swvolume');
+ setStr(pl, 'shockwave', 'swstretchstyle');
+ setStr(pl, 'shockwave', 'swstretchhalign');
+ setStr(pl, 'shockwave', 'swstretchvalign');
+ break;
+
+ case "wmp":
+ setBool(pl, 'wmp', 'autostart');
+ setBool(pl, 'wmp', 'enabled');
+ setBool(pl, 'wmp', 'enablecontextmenu');
+ setBool(pl, 'wmp', 'fullscreen');
+ setBool(pl, 'wmp', 'invokeurls');
+ setBool(pl, 'wmp', 'mute');
+ setBool(pl, 'wmp', 'stretchtofit');
+ setBool(pl, 'wmp', 'windowlessvideo');
+ setStr(pl, 'wmp', 'balance');
+ setStr(pl, 'wmp', 'baseurl');
+ setStr(pl, 'wmp', 'captioningid');
+ setStr(pl, 'wmp', 'currentmarker');
+ setStr(pl, 'wmp', 'currentposition');
+ setStr(pl, 'wmp', 'defaultframe');
+ setStr(pl, 'wmp', 'playcount');
+ setStr(pl, 'wmp', 'rate');
+ setStr(pl, 'wmp', 'uimode');
+ setStr(pl, 'wmp', 'volume');
+ break;
+
+ case "rmp":
+ setBool(pl, 'rmp', 'autostart');
+ setBool(pl, 'rmp', 'loop');
+ setBool(pl, 'rmp', 'autogotourl');
+ setBool(pl, 'rmp', 'center');
+ setBool(pl, 'rmp', 'imagestatus');
+ setBool(pl, 'rmp', 'maintainaspect');
+ setBool(pl, 'rmp', 'nojava');
+ setBool(pl, 'rmp', 'prefetch');
+ setBool(pl, 'rmp', 'shuffle');
+ setStr(pl, 'rmp', 'console');
+ setStr(pl, 'rmp', 'controls');
+ setStr(pl, 'rmp', 'numloop');
+ setStr(pl, 'rmp', 'scriptcallbacks');
+ break;
+ }
+
+ setStr(pl, null, 'src');
+ setStr(pl, null, 'id');
+ setStr(pl, null, 'name');
+ setStr(pl, null, 'vspace');
+ setStr(pl, null, 'hspace');
+ setStr(pl, null, 'bgcolor');
+ setStr(pl, null, 'align');
+ setStr(pl, null, 'width');
+ setStr(pl, null, 'height');
+
+ if ((val = tinyMCE.getAttrib(fe, "width")) != "")
+ pl.width = f.width.value = val;
+
+ if ((val = tinyMCE.getAttrib(fe, "height")) != "")
+ pl.height = f.height.value = val;
+
+ oldWidth = pl.width ? parseInt(pl.width) : 0;
+ oldHeight = pl.height ? parseInt(pl.height) : 0;
+ } else
+ oldWidth = oldHeight = 0;
+
+ selectByValue(f, 'media_type', type);
+ changedType(type);
+ updateColor('bgcolor_pick', 'bgcolor');
+
+ TinyMCE_EditableSelects.init();
+ generatePreview();
+}
+
+function insertMedia() {
+ var fe, f = document.forms[0], h;
+
+ if (!AutoValidator.validate(f)) {
+ alert(tinyMCE.getLang('lang_invalid_data'));
+ return false;
+ }
+
+ f.width.value = f.width.value == "" ? 100 : f.width.value;
+ f.height.value = f.height.value == "" ? 100 : f.height.value;
+
+ fe = tinyMCE.selectedInstance.getFocusElement();
+ if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) {
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {
+ case "flash":
+ fe.className = "mceItemFlash";
+ break;
+
+ case "shockwave":
+ fe.className = "mceItemShockWave";
+ break;
+
+ case "qt":
+ fe.className = "mceItemQuickTime";
+ break;
+
+ case "wmp":
+ fe.className = "mceItemWindowsMedia";
+ break;
+
+ case "rmp":
+ fe.className = "mceItemRealMedia";
+ break;
+ }
+
+ if (fe.width != f.width.value || fe.height != f.width.height)
+ tinyMCE.selectedInstance.repaint();
+
+ fe.title = serializeParameters();
+ fe.width = f.width.value;
+ fe.height = f.height.value;
+ fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
+ fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
+ fe.align = f.align.options[f.align.selectedIndex].value;
+ } else {
+ h = '<img src="' + tinyMCE.getParam("theme_href") + '/images/spacer.gif"' ;
+
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {
+ case "flash":
+ h += ' class="mceItemFlash"';
+ break;
+
+ case "shockwave":
+ h += ' class="mceItemShockWave"';
+ break;
+
+ case "qt":
+ h += ' class="mceItemQuickTime"';
+ break;
+
+ case "wmp":
+ h += ' class="mceItemWindowsMedia"';
+ break;
+
+ case "rmp":
+ h += ' class="mceItemRealMedia"';
+ break;
+ }
+
+ h += ' title="' + serializeParameters() + '"';
+ h += ' width="' + f.width.value + '"';
+ h += ' height="' + f.height.value + '"';
+ h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
+
+ h += ' />';
+
+ tinyMCE.selectedInstance.execCommand('mceInsertContent', false, h);
+ }
+
+ tinyMCEPopup.close();
+}
+
+function getMediaListHTML() {
+ if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
+ var html = "";
+
+ html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.src.value=this.options[this.selectedIndex].value;">';
+ html += '<option value="">---</option>';
+
+ for (var i=0; i<tinyMCEMediaList.length; i++)
+ html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
+
+ html += '</select>';
+
+ return html;
+ }
+
+ return "";
+}
+
+function getType(v) {
+ var fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'), i, c, el, x;
+
+ for (i=0; i<fo.length; i++) {
+ c = fo[i].split('=');
+
+ el = c[1].split(',');
+ for (x=0; x<el.length; x++)
+ if (v.indexOf('.' + el[x]) != -1)
+ return c[0];
+ }
+
+ return null;
+}
+
+function switchType(v) {
+ var t = getType(v), d = document, f = d.forms[0];
+
+ if (!t)
+ return;
+
+ selectByValue(d.forms[0], 'media_type', t);
+ changedType(t);
+
+ // Update qtsrc also
+ if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
+ alert(tinyMCE.getLang("lang_media_qt_stream_warn"));
+
+ if (f.qt_qtsrc.value == '')
+ f.qt_qtsrc.value = f.src.value;
+ }
+}
+
+function changedType(t) {
+ var d = document;
+
+ d.getElementById('flash_options').style.display = 'none';
+ d.getElementById('qt_options').style.display = 'none';
+ d.getElementById('shockwave_options').style.display = 'none';
+ d.getElementById('wmp_options').style.display = 'none';
+ d.getElementById('rmp_options').style.display = 'none';
+ d.getElementById(t + '_options').style.display = 'block';
+}
+
+function serializeParameters() {
+ var d = document, f = d.forms[0], s = '';
+
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {
+ case "flash":
+ s += getBool('flash', 'play', true);
+ s += getBool('flash', 'loop', true);
+ s += getBool('flash', 'menu', true);
+ s += getBool('flash', 'swliveconnect', false);
+ s += getStr('flash', 'quality');
+ s += getStr('flash', 'scale');
+ s += getStr('flash', 'salign');
+ s += getStr('flash', 'wmode');
+ s += getStr('flash', 'base');
+ s += getStr('flash', 'flashvars');
+ break;
+
+ case "qt":
+ s += getBool('qt', 'loop', false);
+ s += getBool('qt', 'autoplay', false);
+ s += getBool('qt', 'cache', false);
+ s += getBool('qt', 'controller', true);
+ s += getBool('qt', 'correction', false, 'none', 'full');
+ s += getBool('qt', 'enablejavascript', false);
+ s += getBool('qt', 'kioskmode', false);
+ s += getBool('qt', 'autohref', false);
+ s += getBool('qt', 'playeveryframe', false);
+ s += getBool('qt', 'targetcache', false);
+ s += getStr('qt', 'scale');
+ s += getStr('qt', 'starttime');
+ s += getStr('qt', 'endtime');
+ s += getStr('qt', 'target');
+ s += getStr('qt', 'qtsrcchokespeed');
+ s += getStr('qt', 'volume');
+ s += getStr('qt', 'qtsrc');
+ break;
+
+ case "shockwave":
+ s += getBool('shockwave', 'sound');
+ s += getBool('shockwave', 'progress');
+ s += getBool('shockwave', 'autostart');
+ s += getBool('shockwave', 'swliveconnect');
+ s += getStr('shockwave', 'swvolume');
+ s += getStr('shockwave', 'swstretchstyle');
+ s += getStr('shockwave', 'swstretchhalign');
+ s += getStr('shockwave', 'swstretchvalign');
+ break;
+
+ case "wmp":
+ s += getBool('wmp', 'autostart', true);
+ s += getBool('wmp', 'enabled', false);
+ s += getBool('wmp', 'enablecontextmenu', true);
+ s += getBool('wmp', 'fullscreen', false);
+ s += getBool('wmp', 'invokeurls', true);
+ s += getBool('wmp', 'mute', false);
+ s += getBool('wmp', 'stretchtofit', false);
+ s += getBool('wmp', 'windowlessvideo', false);
+ s += getStr('wmp', 'balance');
+ s += getStr('wmp', 'baseurl');
+ s += getStr('wmp', 'captioningid');
+ s += getStr('wmp', 'currentmarker');
+ s += getStr('wmp', 'currentposition');
+ s += getStr('wmp', 'defaultframe');
+ s += getStr('wmp', 'playcount');
+ s += getStr('wmp', 'rate');
+ s += getStr('wmp', 'uimode');
+ s += getStr('wmp', 'volume');
+ break;
+
+ case "rmp":
+ s += getBool('rmp', 'autostart', false);
+ s += getBool('rmp', 'loop', false);
+ s += getBool('rmp', 'autogotourl', true);
+ s += getBool('rmp', 'center', false);
+ s += getBool('rmp', 'imagestatus', true);
+ s += getBool('rmp', 'maintainaspect', false);
+ s += getBool('rmp', 'nojava', false);
+ s += getBool('rmp', 'prefetch', false);
+ s += getBool('rmp', 'shuffle', false);
+ s += getStr('rmp', 'console');
+ s += getStr('rmp', 'controls');
+ s += getStr('rmp', 'numloop');
+ s += getStr('rmp', 'scriptcallbacks');
+ break;
+ }
+
+ s += getStr(null, 'id');
+ s += getStr(null, 'name');
+ s += getStr(null, 'src');
+ s += getStr(null, 'align');
+ s += getStr(null, 'bgcolor');
+ s += getInt(null, 'vspace');
+ s += getInt(null, 'hspace');
+ s += getStr(null, 'width');
+ s += getStr(null, 'height');
+
+ s = s.length > 0 ? s.substring(0, s.length - 1) : s;
+
+ return s;
+}
+
+function setBool(pl, p, n) {
+ if (typeof(pl[n]) == "undefined")
+ return;
+
+ document.forms[0].elements[p + "_" + n].checked = pl[n];
+}
+
+function setStr(pl, p, n) {
+ var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
+
+ if (typeof(pl[n]) == "undefined")
+ return;
+
+ if (e.type == "text")
+ e.value = pl[n];
+ else
+ selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
+}
+
+function getBool(p, n, d, tv, fv) {
+ var v = document.forms[0].elements[p + "_" + n].checked;
+
+ tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
+ fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
+
+ return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ',');
+}
+
+function getStr(p, n, d) {
+ var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
+ var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
+
+ return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
+}
+
+function getInt(p, n, d) {
+ var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
+ var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
+
+ return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
+}
+
+function jsEncode(s) {
+ s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
+ s = s.replace(new RegExp('"', 'g'), '\\"');
+ s = s.replace(new RegExp("'", 'g'), "\\'");
+
+ return s;
+}
+
+function generatePreview(c) {
+ var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
+
+ p.innerHTML = '<!-- x --->';
+
+ nw = parseInt(f.width.value);
+ nh = parseInt(f.height.value);
+
+ if (f.width.value != "" && f.height.value != "") {
+ if (f.constrain.checked) {
+ if (c == 'width' && oldWidth != 0) {
+ wp = nw / oldWidth;
+ nh = Math.round(wp * nh);
+ f.height.value = nh;
+ } else if (c == 'height' && oldHeight != 0) {
+ hp = nh / oldHeight;
+ nw = Math.round(hp * nw);
+ f.width.value = nw;
+ }
+ }
+ }
+
+ if (f.width.value != "")
+ oldWidth = nw;
+
+ if (f.height.value != "")
+ oldHeight = nh;
+
+ // After constrain
+ pl = serializeParameters();
+
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {
+ case "flash":
+ cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
+ codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+ type = 'application/x-shockwave-flash';
+ break;
+
+ case "shockwave":
+ cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
+ codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
+ type = 'application/x-director';
+ break;
+
+ case "qt":
+ cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
+ codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
+ type = 'video/quicktime';
+ break;
+
+ case "wmp":
+ cls = tinyMCE.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
+ codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+ type = 'application/x-mplayer2';
+ break;
+
+ case "rmp":
+ cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
+ codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+ type = 'audio/x-pn-realaudio-plugin';
+ break;
+ }
+
+ if (pl == '') {
+ p.innerHTML = '';
+ return;
+ }
+
+ pl = eval('x={' + pl + '};');
+
+ if (!pl.src) {
+ p.innerHTML = '';
+ return;
+ }
+
+ pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
+ pl.width = !pl.width ? 100 : pl.width;
+ pl.height = !pl.height ? 100 : pl.height;
+ pl.id = !pl.id ? 'obj' : pl.id;
+ pl.name = !pl.name ? 'eobj' : pl.name;
+ pl.align = !pl.align ? '' : pl.align;
+
+ h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
+
+ for (n in pl) {
+ h += '<param name="' + n + '" value="' + pl[n] + '">';
+
+ // Add extra url parameter if it's an absolute URL
+ if (n == 'src' && pl[n].indexOf('://') != -1)
+ h += '<param name="url" value="' + pl[n] + '" />';
+ }
+
+ h += '<embed type="' + type + '" ';
+
+ for (n in pl)
+ h += n + '="' + pl[n] + '" ';
+
+ h += '></embed></object>';
+
+ p.innerHTML = "<!-- x --->" + h;
+}
diff --git a/program/js/tiny_mce/plugins/media/langs/en.js b/program/js/tiny_mce/plugins/media/langs/en.js new file mode 100755 index 000000000..4cbfae654 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/langs/en.js @@ -0,0 +1,85 @@ +// UK lang variables
+
+tinyMCE.addToLang('media',{
+title : 'Insert / edit embedded media',
+desc : 'Insert / edit embedded media',
+general : 'General',
+advanced : 'Advanced',
+file : 'File',
+list : 'List',
+size : 'Dimensions',
+preview : 'Preview',
+constrain_proportions : 'Constrain proportions',
+type : 'Type',
+id : 'Id',
+name : 'Name',
+class_name : 'Class',
+vspace : 'V-Space',
+hspace : 'H-Space',
+play : 'Auto play',
+loop : 'Loop',
+menu : 'Show menu',
+quality : 'Quality',
+scale : 'Scale',
+align : 'Align',
+salign : 'SAlign',
+wmode : 'WMode',
+bgcolor : 'Background',
+base : 'Base',
+flashvars : 'Flashvars',
+liveconnect : 'SWLiveConnect',
+autohref : 'AutoHREF',
+cache : 'Cache',
+hidden : 'Hidden',
+controller : 'Controller',
+kioskmode : 'Kiosk mode',
+playeveryframe : 'Play every frame',
+targetcache : 'Target cache',
+correction : 'No correction',
+enablejavascript : 'Enable JavaScript',
+starttime : 'Start time',
+endtime : 'End time',
+href : 'Href',
+qtsrcchokespeed : 'Choke speed',
+target : 'Target',
+volume : 'Volume',
+autostart : 'Auto start',
+enabled : 'Enabled',
+fullscreen : 'Fullscreen',
+invokeurls : 'Invoke URLs',
+mute : 'Mute',
+stretchtofit : 'Stretch to fit',
+windowlessvideo : 'Windowless video',
+balance : 'Balance',
+baseurl : 'Base URL',
+captioningid : 'Captioning id',
+currentmarker : 'Current marker',
+currentposition : 'Current position',
+defaultframe : 'Default frame',
+playcount : 'Play count',
+rate : 'Rate',
+uimode : 'UI Mode',
+flash_options : 'Flash options',
+qt_options : 'Quicktime options',
+wmp_options : 'Windows media player options',
+rmp_options : 'Real media player options',
+shockwave_options : 'Shockwave options',
+autogotourl : 'Auto goto URL',
+center : 'Center',
+imagestatus : 'Image status',
+maintainaspect : 'Maintain aspect',
+nojava : 'No java',
+prefetch : 'Prefetch',
+shuffle : 'Shuffle',
+console : 'Console',
+numloop : 'Num loops',
+controls : 'Controls',
+scriptcallbacks : 'Script callbacks',
+swstretchstyle : 'Stretch style',
+swstretchhalign : 'Stretch H-Align',
+swstretchvalign : 'Stretch V-Align',
+sound : 'Sound',
+progress : 'Progress',
+qtsrc : 'QT Src',
+qt_stream_warn : 'Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..'
+});
diff --git a/program/js/tiny_mce/plugins/media/media.htm b/program/js/tiny_mce/plugins/media/media.htm new file mode 100755 index 000000000..cf64a6df2 --- /dev/null +++ b/program/js/tiny_mce/plugins/media/media.htm @@ -0,0 +1,723 @@ +<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{$lang_media_title}</title>
+ <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script language="javascript" type="text/javascript" src="jscripts/media.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
+ <link href="css/media.css" rel="stylesheet" type="text/css" />
+ <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+ <form onsubmit="insertMedia();return false;" action="#">
+ <div class="tabs">
+ <ul>
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{$lang_media_general}</a></span></li>
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_media_advanced}</a></span></li>
+ </ul>
+ </div>
+
+ <div class="panel_wrapper">
+ <div id="general_panel" class="panel current">
+ <fieldset>
+ <legend>{$lang_media_general}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td><label for="media_type">{$lang_media_type}</label></td>
+ <td>
+ <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
+ <option value="flash">Flash</option>
+ <option value="qt">Quicktime</option>
+ <option value="shockwave">Shockware</option>
+ <option value="wmp">Windows Media</option>
+ <option value="rmp">Real Media</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="src">{$lang_media_file}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="src" name="src" type="text" value="" onchange="switchType(this.value);generatePreview();" /></td>
+ <td id="filebrowsercontainer"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr id="linklistrow">
+ <td><label for="linklist">{$lang_media_list}</label></td>
+ <td id="linklistcontainer"> </td>
+ </tr>
+ <tr>
+ <td><label for="width">{$lang_media_size}</label></td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
+ <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
+ <td><label id="constrainlabel" for="constrain">{$lang_media_constrain_proportions}</label></td>
+ </tr>
+ </table>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset>
+ <legend>{$lang_media_preview}</legend>
+ <div id="prev"></div>
+ </fieldset>
+ </div>
+
+ <div id="advanced_panel" class="panel">
+ <fieldset>
+ <legend>{$lang_media_advanced}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">
+ <tr>
+ <td><label for="id">{$lang_media_id}</label></td>
+ <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
+ <td><label for="name">{$lang_media_name}</label></td>
+ <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="align">{$lang_media_align}</label></td>
+ <td>
+ <select id="align" name="align" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="top">top</option>
+ <option value="right">right</option>
+ <option value="bottom">bottom</option>
+ <option value="left">left</option>
+ </select>
+ </td>
+
+ <td><label for="bgcolor">{$lang_media_bgcolor}</label></td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
+ <td id="bgcolor_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="vspace">{$lang_media_vspace}</label></td>
+ <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
+ <td><label for="hspace">{$lang_media_hspace}</label></td>
+ <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset id="flash_options">
+ <legend>{$lang_media_flash_options}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td><label for="flash_quality">{$lang_media_quality}</label></td>
+ <td>
+ <select id="flash_quality" name="flash_quality" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="high">high</option>
+ <option value="low">low</option>
+ <option value="autolow">autolow</option>
+ <option value="autohigh">autohigh</option>
+ <option value="best">best</option>
+ </select>
+ </td>
+
+ <td><label for="flash_scale">{$lang_media_scale}</label></td>
+ <td>
+ <select id="flash_scale" name="flash_scale" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="showall">showall</option>
+ <option value="noborder">noborder</option>
+ <option value="exactfit">exactfit</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="flash_wmode">{$lang_media_wmode}</label></td>
+ <td>
+ <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="window">window</option>
+ <option value="opaque">opaque</option>
+ <option value="transparent">transparent</option>
+ </select>
+ </td>
+
+ <td><label for="flash_salign">{$lang_media_salign}</label></td>
+ <td>
+ <select id="flash_salign" name="flash_salign" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="l">left</option>
+ <option value="t">top</option>
+ <option value="r">right</option>
+ <option value="b">bottom</option>
+ <option value="tl">top-left</option>
+ <option value="tr">top_right</option>
+ <option value="bl">bottom-left</option>
+ <option value="br">bottom-right</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="flash_play">{$lang_media_play}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="flash_loop">{$lang_media_loop}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="flash_menu">{$lang_media_menu}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
+ <td><label for="flash_swliveconnect">{$lang_media_liveconnect}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <table>
+ <tr>
+ <td><label for="flash_base">{$lang_media_base}</label></td>
+ <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="flash_flashvars">{$lang_media_flashvars}</label></td>
+ <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset id="qt_options">
+ <legend>{$lang_media_qt_options}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
+ <td><label for="qt_loop">{$lang_media_loop}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" onchange="generatePreview();" /></td>
+ <td><label for="qt_autoplay">{$lang_media_play}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
+ <td><label for="qt_cache">{$lang_media_cache}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="qt_controller">{$lang_media_controller}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
+ <td><label for="qt_correction">{$lang_media_correction}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
+ <td><label for="qt_enablejavascript">{$lang_media_enablejavascript}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
+ <td><label for="qt_kioskmode">{$lang_media_kioskmode}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
+ <td><label for="qt_autohref">{$lang_media_autohref}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
+ <td><label for="qt_playeveryframe">{$lang_media_playeveryframe}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
+ <td><label for="qt_targetcache">{$lang_media_targetcache}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="qt_scale">{$lang_media_scale}</label></td>
+ <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
+ <option value="">{$lang_not_set}</option>
+ <option value="tofit">tofit</option>
+ <option value="aspect">aspect</option>
+ </select>
+ </td>
+
+ <td colspan="2"> </td>
+ </tr>
+
+ <tr>
+ <td><label for="qt_starttime">{$lang_media_starttime}</label></td>
+ <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
+
+ <td><label for="qt_endtime">{$lang_media_endtime}</label></td>
+ <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="qt_target">{$lang_media_target}</label></td>
+ <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
+
+ <td><label for="qt_href">{$lang_media_href}</label></td>
+ <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="qt_qtsrcchokespeed">{$lang_media_qtsrcchokespeed}</label></td>
+ <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
+
+ <td><label for="qt_volume">{$lang_media_volume}</label></td>
+ <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="qt_qtsrc">{$lang_media_qtsrc}</label></td>
+ <td colspan="4">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
+ <td id="qtsrcfilebrowsercontainer"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset id="wmp_options">
+ <legend>{$lang_media_wmp_options}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="wmp_autostart">{$lang_media_autostart}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
+ <td><label for="wmp_enabled">{$lang_media_enabled}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="wmp_enablecontextmenu">{$lang_media_menu}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
+ <td><label for="wmp_fullscreen">{$lang_media_fullscreen}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="wmp_invokeurls">{$lang_media_invokeurls}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
+ <td><label for="wmp_mute">{$lang_media_mute}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
+ <td><label for="wmp_stretchtofit">{$lang_media_stretchtofit}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
+ <td><label for="wmp_windowlessvideo">{$lang_media_windowlessvideo}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="wmp_balance">{$lang_media_balance}</label></td>
+ <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
+
+ <td><label for="wmp_baseurl">{$lang_media_baseurl}</label></td>
+ <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="wmp_captioningid">{$lang_media_captioningid}</label></td>
+ <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
+
+ <td><label for="wmp_currentmarker">{$lang_media_currentmarker}</label></td>
+ <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="wmp_currentposition">{$lang_media_currentposition}</label></td>
+ <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
+
+ <td><label for="wmp_defaultframe">{$lang_media_defaultframe}</label></td>
+ <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="wmp_playcount">{$lang_media_playcount}</label></td>
+ <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
+
+ <td><label for="wmp_rate">{$lang_media_rate}</label></td>
+ <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="wmp_uimode">{$lang_media_uimode}</label></td>
+ <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
+
+ <td><label for="wmp_volume">{$lang_media_volume}</label></td>
+ <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
+ </tr>
+
+ </table>
+ </fieldset>
+
+ <fieldset id="rmp_options">
+ <legend>{$lang_media_rmp_options}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
+ <td><label for="rmp_autostart">{$lang_media_autostart}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
+ <td><label for="rmp_loop">{$lang_media_loop}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="rmp_autogotourl">{$lang_media_autogotourl}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
+ <td><label for="rmp_center">{$lang_media_center}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
+ <td><label for="rmp_imagestatus">{$lang_media_imagestatus}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
+ <td><label for="rmp_maintainaspect">{$lang_media_maintainaspect}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
+ <td><label for="rmp_nojava">{$lang_media_nojava}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
+ <td><label for="rmp_prefetch">{$lang_media_prefetch}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
+ <td><label for="rmp_shuffle">{$lang_media_shuffle}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="rmp_console">{$lang_media_console}</label></td>
+ <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
+
+ <td><label for="rmp_controls">{$lang_media_controls}</label></td>
+ <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="rmp_numloop">{$lang_media_numloop}</label></td>
+ <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
+
+ <td><label for="rmp_scriptcallbacks">{$lang_media_scriptcallbacks}</label></td>
+ <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <fieldset id="shockwave_options">
+ <legend>{$lang_media_shockwave_options}</legend>
+
+ <table border="0" cellpadding="4" cellspacing="0">
+ <tr>
+ <td><label for="shockwave_swstretchstyle">{$lang_media_swstretchstyle}</label></td>
+ <td>
+ <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
+ <option value="none">None</option>
+ <option value="meet">Meet</option>
+ <option value="fill">Fill</option>
+ <option value="stage">Stage</option>
+ </select>
+ </td>
+
+ <td><label for="shockwave_swvolume">{$lang_media_volume}</label></td>
+ <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="shockwave_swstretchhalign">{$lang_media_swstretchhalign}</label></td>
+ <td>
+ <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
+ <option value="none">None</option>
+ <option value="left">left</option>
+ <option value="center">center</option>
+ <option value="right">right</option>
+ </select>
+ </td>
+
+ <td><label for="shockwave_swstretchvalign">{$lang_media_swstretchvalign}</label></td>
+ <td>
+ <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
+ <option value="none">None</option>
+ <option value="meet">Top</option>
+ <option value="fill">Center</option>
+ <option value="stage">Bottom</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
+ <td><label for="shockwave_autostart">{$lang_media_autostart}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
+ <td><label for="shockwave_sound">{$lang_media_sound}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
+ <td><label for="shockwave_swliveconnect">{$lang_media_liveconnect}</label></td>
+ </tr>
+ </table>
+ </td>
+
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
+ <td><label for="shockwave_progress">{$lang_media_progress}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+ </div>
+ </div>
+
+ <div class="mceActionPanel">
+ <div style="float: left">
+ <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertMedia();" />
+ </div>
+
+ <div style="float: right">
+ <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+ </div>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/program/js/tiny_mce/plugins/nonbreaking/editor_plugin.js b/program/js/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100755 index 000000000..ade6ae8fe --- /dev/null +++ b/program/js/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('nonbreaking');var TinyMCE_NonBreakingPlugin={getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_nonbreaking.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"nonbreaking":return tinyMCE.getButtonHTML(cn,'lang_nonbreaking_desc','{$pluginurl}/images/nonbreaking.gif','mceNonBreaking',false)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),h;switch(command){case"mceNonBreaking":h=(inst.visualChars&&inst.visualChars.state)?'<span class="mceItemHiddenVisualChar">·</span>':' ';tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,h);return true}return false},handleEvent:function(e){var inst,h;if(!tinyMCE.isOpera&&e.type=='keydown'&&e.keyCode==9&&tinyMCE.getParam('nonbreaking_force_tab',false)){inst=tinyMCE.selectedInstance;h=(inst.visualChars&&inst.visualChars.state)?'<span class="mceItemHiddenVisualChar">···</span>':' ';tinyMCE.execInstanceCommand(inst.editorId,'mceInsertContent',false,h);tinyMCE.cancelEvent(e);return false}return true}};tinyMCE.addPlugin("nonbreaking",TinyMCE_NonBreakingPlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/program/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100755 index 000000000..72da2cc93 --- /dev/null +++ b/program/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -0,0 +1,62 @@ +/**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('nonbreaking');
+
+var TinyMCE_NonBreakingPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Nonbreaking space',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_nonbreaking.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "nonbreaking":
+ return tinyMCE.getButtonHTML(cn, 'lang_nonbreaking_desc', '{$pluginurl}/images/nonbreaking.gif', 'mceNonBreaking', false);
+ }
+
+ return "";
+ },
+
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ var inst = tinyMCE.getInstanceById(editor_id), h;
+
+ switch (command) {
+ case "mceNonBreaking":
+ h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">·</span>' : ' ';
+ tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, h);
+ return true;
+ }
+
+ return false;
+ },
+
+ handleEvent : function(e) {
+ var inst, h;
+
+ if (!tinyMCE.isOpera && e.type == 'keydown' && e.keyCode == 9 && tinyMCE.getParam('nonbreaking_force_tab', false)) {
+ inst = tinyMCE.selectedInstance;
+
+ h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">···</span>' : ' ';
+ tinyMCE.execInstanceCommand(inst.editorId, 'mceInsertContent', false, h);
+
+ tinyMCE.cancelEvent(e);
+ return false;
+ }
+
+ return true;
+ }
+};
+
+tinyMCE.addPlugin("nonbreaking", TinyMCE_NonBreakingPlugin);
diff --git a/program/js/tiny_mce/plugins/nonbreaking/images/nonbreaking.gif b/program/js/tiny_mce/plugins/nonbreaking/images/nonbreaking.gif Binary files differnew file mode 100755 index 000000000..a731fc91a --- /dev/null +++ b/program/js/tiny_mce/plugins/nonbreaking/images/nonbreaking.gif diff --git a/program/js/tiny_mce/plugins/nonbreaking/langs/en.js b/program/js/tiny_mce/plugins/nonbreaking/langs/en.js new file mode 100755 index 000000000..fd49a646c --- /dev/null +++ b/program/js/tiny_mce/plugins/nonbreaking/langs/en.js @@ -0,0 +1,5 @@ +// UK lang variables
+
+tinyMCE.addToLang('nonbreaking',{
+desc : 'Insert non-breaking space character'
+});
diff --git a/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css b/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100755 index 000000000..4c7bd13c4 --- /dev/null +++ b/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,20 @@ +/* stylesheet for advsearchreplace plugin*/
+
+.panel_wrapper { height: 85px; }
+.panel_wrapper div.current { height: 85px; }
+
+/* MS IE only styles */
+* html .panel_wrapper { height: 100px; }
+* html .panel_wrapper div.current { height: 100px; }
+
+#replaceBtn, #replaceAllBtn {
+ padding-bottom: 2px;
+ font-weight: bold;
+ width: 90px;
+ height: 21px;
+ border: 0;
+ cursor: pointer;
+}
+
+#replaceBtn { background: url(../images/replace_button_bg.gif); }
+#replaceAllBtn { background: url(../images/replace_all_button_bg.gif); }
diff --git a/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js b/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js index a78b35e06..2ba606647 100644 --- a/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js +++ b/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('searchreplace','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var instance=tinyMCE.getInstanceById(editor_id);function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str,back){instance.execCommand('mceInsertContent',false,str);}if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=100+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}instance.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=instance.selection.getRng();r.collapse(true);r.select();}else instance.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
\ No newline at end of file +tinyMCE.importPluginLanguagePack('searchreplace');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),selectedText=inst.selection.getSelectedText(),rng;function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key]}function replaceSel(search_str,str,back){inst.execCommand('mceInsertContent',false,str)}if(!value)value=[];defValue("editor_id",editor_id);defValue("searchstring",selectedText);defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");defValue("resizable","no");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();template['file']='../../plugins/searchreplace/searchreplace.htm';template['width']=380;template['height']=155+(tinyMCE.isNS7?20:0)+(tinyMCE.isMSIE?15:0);template['width']+=tinyMCE.getLang('lang_searchreplace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_delta_height',0);inst.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=inst.selection.getRng();r.collapse(true);r.select()}else inst.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value)}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards'])}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng}else alert(tinyMCE.getLang('lang_searchreplace_notfound'))}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'))}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}return false}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js index eed96db9e..f8aee25c6 100644 --- a/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -1,60 +1,56 @@ /**
- * $RCSfile: editor_plugin_src.js,v $
- * $Revision: 1.27 $
- * $Date: 2006/02/13 15:09:28 $
+ * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
-/* Import theme specific language pack */
-tinyMCE.importPluginLanguagePack('searchreplace', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
+tinyMCE.importPluginLanguagePack('searchreplace');
var TinyMCE_SearchReplacePlugin = {
getInfo : function() {
return {
longname : 'Search/Replace',
- author : 'Moxiecode Systems',
+ author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
- initInstance : function(inst) {
+ initInstance : function (inst) {
inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
+ // No CTRL+R for "replace" because browsers will reload page instead of executing plugin
},
- getControlHTML : function(cn) {
+ getControlHTML : function (cn) {
switch (cn) {
- case "search":
- return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif', 'mceSearch', true);
- case "replace":
+ case "search" :
+ return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif','mceSearch', true);
+
+ case "replace" :
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
}
+
return "";
},
- /**
- * Executes the search/replace commands.
- */
- execCommand : function(editor_id, element, command, user_interface, value) {
- var instance = tinyMCE.getInstanceById(editor_id);
+ execCommand : function (editor_id, element, command, user_interface, value) {
+ var inst = tinyMCE.getInstanceById(editor_id), selectedText = inst.selection.getSelectedText(), rng;
function defValue(key, default_value) {
value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
}
function replaceSel(search_str, str, back) {
- instance.execCommand('mceInsertContent', false, str);
+ inst.execCommand('mceInsertContent', false, str);
}
if (!value)
- value = new Array();
+ value = [];
- // Setup defualt values
defValue("editor_id", editor_id);
- defValue("searchstring", "");
+ defValue("searchstring", selectedText);
defValue("replacestring", null);
defValue("replacemode", "none");
defValue("casesensitive", false);
@@ -62,68 +58,52 @@ var TinyMCE_SearchReplacePlugin = { defValue("wrap", false);
defValue("wholeword", false);
defValue("inline", "yes");
+ defValue("resizable", "no");
- // Handle commands
switch (command) {
- case "mceResetSearch":
+ case "mceResetSearch" :
tinyMCE.lastSearchRng = null;
return true;
- case "mceSearch":
+ case "mceSearch" :
if (user_interface) {
- // Open search dialog
var template = new Array();
- if (value['replacestring'] != null) {
- template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme
- template['width'] = 320;
- template['height'] = 100 + (tinyMCE.isNS7 ? 20 : 0);
- template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
- } else {
- template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme
- template['width'] = 310;
- template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
- template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
- }
+ template['file'] = '../../plugins/searchreplace/searchreplace.htm';
+ template['width'] = 380;
+ template['height'] = 155 + (tinyMCE.isNS7 ? 20 : 0) + (tinyMCE.isMSIE ? 15 : 0);
+ template['width'] += tinyMCE.getLang('lang_searchreplace_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_searchreplace_delta_height', 0);
- instance.execCommand('SelectAll');
+ inst.execCommand('SelectAll');
if (tinyMCE.isMSIE) {
- var r = instance.selection.getRng();
+ var r = inst.selection.getRng();
r.collapse(true);
r.select();
} else
- instance.selection.getSel().collapseToStart();
+ inst.selection.getSel().collapseToStart();
tinyMCE.openWindow(template, value);
} else {
var win = tinyMCE.getInstanceById(editor_id).contentWindow;
var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
-
- // Whats the point
if (body.innerHTML == "") {
alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
- // Handle replace current
if (value['replacemode'] == "current") {
replaceSel(value['string'], value['replacestring'], value['backwards']);
-
- // Search next one
value['replacemode'] = "none";
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
-
return true;
}
if (tinyMCE.isMSIE) {
var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange();
var flags = 0;
-
if (value['wholeword'])
flags = flags | 2;
@@ -135,7 +115,6 @@ var TinyMCE_SearchReplacePlugin = { return true;
}
- // Handle replace all mode
if (value['replacemode'] == "all") {
while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
rng.scrollIntoView();
@@ -155,6 +134,7 @@ var TinyMCE_SearchReplacePlugin = { tinyMCE.lastSearchRng = rng;
} else
alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+
} else {
if (value['replacemode'] == "all") {
while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
@@ -168,18 +148,17 @@ var TinyMCE_SearchReplacePlugin = { alert(tinyMCE.getLang('lang_searchreplace_notfound'));
}
}
+
return true;
- case "mceSearchReplace":
+ case "mceSearchReplace" :
value['replacestring'] = "";
-
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
return true;
}
- // Pass to next handler in chain
return false;
}
};
-tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
+tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif b/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif Binary files differnew file mode 100755 index 000000000..123fa5bf5 --- /dev/null +++ b/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif diff --git a/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif b/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif Binary files differnew file mode 100755 index 000000000..cc2c56e61 --- /dev/null +++ b/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif diff --git a/program/js/tiny_mce/plugins/searchreplace/jscripts/replace.js b/program/js/tiny_mce/plugins/searchreplace/jscripts/replace.js deleted file mode 100644 index 3cb417813..000000000 --- a/program/js/tiny_mce/plugins/searchreplace/jscripts/replace.js +++ /dev/null @@ -1,40 +0,0 @@ -function init() {
- tinyMCEPopup.resizeToInnerSize();
-
- var formObj = document.forms[0];
-
- formObj.searchstring.value = tinyMCE.getWindowArg("searchstring");
- formObj.replacestring.value = tinyMCE.getWindowArg("replacestring");
- formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive");
-// formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
-// formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
-// formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap");
-// formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword");
-
- tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
-}
-
-function searchNext(replacemode) {
- var formObj = document.forms[0];
-
- // Whats the point?
- if (formObj.searchstring.value == "" || formObj.searchstring.value == formObj.replacestring.value)
- return;
-
- // Do search
- tinyMCEPopup.execCommand('mceSearch', false, {
- string : formObj.searchstring.value,
- replacestring : formObj.replacestring.value,
- replacemode : replacemode,
- casesensitive : formObj.casesensitivebox.checked,
- backwards : false
-// wrap : formObj.wrapatend.checked,
-// wholeword : formObj.wholeword.checked
- }, false);
-
- window.focus();
-}
-
-function cancelAction() {
- tinyMCEPopup.close();
-}
diff --git a/program/js/tiny_mce/plugins/searchreplace/jscripts/search.js b/program/js/tiny_mce/plugins/searchreplace/jscripts/search.js deleted file mode 100644 index 5202fdc50..000000000 --- a/program/js/tiny_mce/plugins/searchreplace/jscripts/search.js +++ /dev/null @@ -1,36 +0,0 @@ -function init() {
- tinyMCEPopup.resizeToInnerSize();
-
- var formObj = document.forms[0];
-
- formObj.searchstring.value = tinyMCE.getWindowArg("searchstring");
- formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive");
- formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
- formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
-// formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap");
-// formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword");
-
- tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
-}
-
-function searchNext() {
- var formObj = document.forms[0];
-
- if (formObj.searchstring.value == "")
- return;
-
- // Do search
- tinyMCEPopup.execCommand('mceSearch', false, {
- string : formObj.searchstring.value,
- casesensitive : formObj.casesensitivebox.checked,
- backwards : formObj.backwards[0].checked
-// wrap : formObj.wrapatend.checked,
-// wholeword : formObj.wholeword.checked
- }, false);
-
- window.focus();
-}
-
-function cancelAction() {
- tinyMCEPopup.close();
-}
diff --git a/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js b/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js new file mode 100755 index 000000000..2eca3ea64 --- /dev/null +++ b/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js @@ -0,0 +1,85 @@ +function init() {
+ tinyMCEPopup.resizeToInnerSize();
+
+ // start with appropiate tab
+ var task = (tinyMCE.getWindowArg("replacestring") != null) ? "replace" : "search";
+ mcTabs.displayTab(task + '_tab', task +'_panel');
+ manageReplaceButtons();
+
+ var formObj = document.forms[0];
+
+ formObj[task + "_panel_searchstring"].value = tinyMCE.getWindowArg("searchstring");
+ formObj["replace_panel_replacestring"].value = (tinyMCE.getWindowArg("replacestring") != null) ? tinyMCE.getWindowArg("replacestring") : "";
+ formObj[task + "_panel_casesensitivebox"].checked = tinyMCE.getWindowArg("casesensitive");
+ formObj[task + "_panel_backwardsu"].checked = tinyMCE.getWindowArg("backwards");
+ formObj[task + "_panel_backwardsd"].checked = !tinyMCE.getWindowArg("backwards");
+
+ tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
+}
+
+function searchNext(replacemode) {
+ // "search" or "replace" mode of operation?
+ var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
+
+ var formObj = document.forms[0];
+
+ if (task == "replace") {
+ // Whats the point?
+ if (formObj[task + "_panel_searchstring"].value == "" || formObj[task + "_panel_searchstring"].value == formObj[task + "_panel_replacestring"].value)
+ return;
+ }
+
+ // Do search
+ tinyMCEPopup.execCommand('mceSearch', false, {
+ string : formObj[task + "_panel_searchstring"].value,
+ replacestring : formObj["replace_panel_replacestring"].value,
+ replacemode : replacemode,
+ casesensitive : formObj[task + "_panel_casesensitivebox"].checked,
+ backwards : false
+ }, false);
+
+ window.focus();
+}
+
+function cancelAction() {
+ tinyMCEPopup.close();
+}
+
+function manageReplaceButtons() {
+ // "search" or "replace" mode of operation?
+ var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
+ document.getElementById("replace_buttons").style.visibility = (task == "replace") ? "visible" : "hidden";
+}
+
+function copyValues(link) {
+ // check if tab is already active
+ var tab = link;
+ while (tab.tagName && tab.tagName.toLowerCase() != "li") tab = tab.parentNode;
+ if (tab.className) return false; // tab is already active -> no need to copy any values!
+
+ // copy values from one panel to the other (if they exist there)
+ var from_panel_name = tab.id.match(/^search/i) ? "replace_panel" : "search_panel";
+ var to_panel_name = (from_panel_name == "search_panel") ? "replace_panel" : "search_panel";
+
+ // find all elements with IDs to copy their values
+ var elms = document.getElementById(from_panel_name).getElementsByTagName("*");
+ for (var i = 0; i < elms.length; i++) {
+ if (elms[i].id && elms[i].id != "") {
+ var checked = "undefined";
+ if (elms[i].type.toLowerCase() == "checkbox" || elms[i].type.toLowerCase() == "radio")
+ checked = elms[i].checked;
+
+ // copy values if element exists in other panel
+ var to_elm_name = to_panel_name + elms[i].id.substring(from_panel_name.length, elms[i].id.length);
+ var to_elm = document.getElementById(to_elm_name);
+ if (to_elm) {
+ if (checked != "undefined")
+ to_elm.checked = checked;
+ else
+ to_elm.value = elms[i].value;
+ }
+ }
+ }
+
+ return false;
+}
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/searchreplace/replace.htm b/program/js/tiny_mce/plugins/searchreplace/replace.htm deleted file mode 100644 index 0629da334..000000000 --- a/program/js/tiny_mce/plugins/searchreplace/replace.htm +++ /dev/null @@ -1,49 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{$lang_searchreplace_replace_title}</title>
- <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
- <script language="javascript" type="text/javascript" src="jscripts/replace.js"></script>
- <base target="_self" />
-</head>
-<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
-<form onsubmit="searchNext('none');return false;" action="#">
- <table border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td><label for="searchstring">{$lang_searchreplace_findwhat}</label></td>
- <td><input type="text" id="searchstring" name="searchstring" style="width: 200px" /></td>
- </tr>
- <tr>
- <td><label for="replacestring">{$lang_searchreplace_replacewith}</label></td>
- <td><input type="text" id="replacestring" name="replacestring" style="width: 200px" /></td>
- </tr>
- <tr>
- <td colspan="2"><!--<table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><label>{$lang_searchreplace_direction}</label></td>
- <td><input id="backwardsu" name="backwards" class="radio" type="radio" value="true" /></td>
- <td><label for="backwardsu">{$lang_searchreplace_up}</label></td>
- <td><input id="backwardsd" name="backwards" class="radio" type="radio" value="false" /></td>
- <td><label for="backwardsd">{$lang_searchreplace_down}</label></td>
- </tr>
- </table>--></td>
- </tr>
- <tr>
-<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="casesensitivebox" name="casesensitivebox" class="checkbox" type="checkbox" value="true" /></td>
- <td><label for="casesensitivebox">{$lang_searchreplace_case}</label></td>
- </tr>
-</table></td>
-</tr>
- </table>
- <table border="0" width="300" cellspacing="0" cellpadding="4">
- <tr>
- <td><input id="insertBtn" name="insertBtn" type="button" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" /></td>
- <td><input name="replaceBtn" type="button" id="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" /></td>
- <td><input name="replaceBtn" type="button" id="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');" /></td>
- <td align="right"><input name="cancelBtn" type="button" id="cancelBtn" value="{$lang_searchreplace_cancel}" onclick="cancelAction();" /></td>
- </tr>
- </table>
-</form>
-</body>
-</html>
diff --git a/program/js/tiny_mce/plugins/searchreplace/search.htm b/program/js/tiny_mce/plugins/searchreplace/search.htm deleted file mode 100644 index fe9055ed5..000000000 --- a/program/js/tiny_mce/plugins/searchreplace/search.htm +++ /dev/null @@ -1,42 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{$lang_searchreplace_search_title}</title>
- <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
- <script language="javascript" type="text/javascript" src="jscripts/search.js"></script>
- <base target="_self" />
-</head>
-<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
-<form onsubmit="searchNext();return false;" action="#">
- <table border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td><label for="searchstring">{$lang_searchreplace_findwhat}</label> <input type="text" id="searchstring" name="searchstring" style="width: 200px" /></td>
- </tr>
- <tr>
- <td><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><label>{$lang_searchreplace_direction}</label></td>
- <td><input id="backwardsu" name="backwards" class="radio" type="radio" value="true" /></td>
- <td><label for="backwardsu">{$lang_searchreplace_up}</label></td>
- <td><input id="backwardsd" name="backwards" class="radio" type="radio" value="false" /></td>
- <td><label for="backwardsd">{$lang_searchreplace_down}</label></td>
- </tr>
- </table></td>
- </tr>
- <tr>
-<td><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="casesensitivebox" name="casesensitivebox" class="checkbox" type="checkbox" value="true" /></td>
- <td><label for="casesensitivebox">{$lang_searchreplace_case}</label></td>
- </tr>
-</table></td>
-</tr>
- </table>
- <table border="0" width="300" cellspacing="0" cellpadding="4">
- <tr>
- <td><input id="insert" name="insert" type="submit" value="{$lang_searchreplace_findnext}" /></td>
- <td align="right"><input id="cancel" name="cancel" type="button" value="{$lang_searchreplace_cancel}" onclick="cancelAction();" /></td>
- </tr>
- </table>
-</form>
-</body>
-</html>
diff --git a/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm b/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100755 index 000000000..8575e2aad --- /dev/null +++ b/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,104 @@ +<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{$lang_searchreplace_replace_title}</title>
+ <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+ <script language="javascript" type="text/javascript" src="jscripts/searchreplace.js"></script>
+ <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
+ <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
+<form onsubmit="return false;" action="#">
+ <div class="tabs">
+ <ul>
+ <li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_search_desc}</a></span></li>
+ <li id="replace_tab"><span><a href="javascript:mcTabs.displayTab('replace_tab','replace_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_replace}</a></span></li>
+ </ul>
+ </div>
+
+ <div class="panel_wrapper">
+
+ <div id="search_panel" class="panel">
+ <table border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><label for="search_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
+ <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">
+ <tr>
+ <td><label>{$lang_searchreplace_direction}</label></td>
+ <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
+ <td><label for="search_panel_backwardsu">{$lang_searchreplace_up}</label></td>
+ <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" /></td>
+ <td><label for="search_panel_backwardsd">{$lang_searchreplace_down}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+ <td><label for="search_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div id="replace_panel" class="panel">
+ <table border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><label for="replace_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
+ <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
+ </tr>
+ <tr>
+ <td><label for="replace_panel_replacestring">{$lang_searchreplace_replacewith}</label></td>
+ <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">
+ <tr>
+ <td><label>{$lang_searchreplace_direction}</label></td>
+ <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
+ <td><label for="replace_panel_backwardsu">{$lang_searchreplace_up}</label></td>
+ <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" /></td>
+ <td><label for="replace_panel_backwardsd">{$lang_searchreplace_down}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+ <td><label for="replace_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </div>
+
+ <div class="mceActionPanel">
+ <div style="text-align: center;">
+ <input type="button" id="insert" name="insert" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" />
+ <span id="replace_buttons">
+ <input type="button" id="replaceBtn" name="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" />
+ <input type="button" id="replaceAllBtn" name="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');;" />
+ </span>
+ <input type="button" id="cancel" name="cancel" value="{$lang_searchreplace_cancel}" onclick="tinyMCEPopup.close();" />
+ </div>
+ </div>
+</form>
+</body>
+</html>
diff --git a/program/js/tiny_mce/plugins/table/editor_plugin.js b/program/js/tiny_mce/plugins/table/editor_plugin.js index 2e0fd012b..b476b052d 100644 --- a/program/js/tiny_mce/plugins/table/editor_plugin.js +++ b/program/js/tiny_mce/plugins/table/editor_plugin.js @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('table','en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler);}inst.tableRowClipboard=null;},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false));}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html;}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1";var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal');}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal');}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);},10);}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" ";}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getTableGrid(table){var grid=new Array();var rows=table.rows;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].cells.length;x++){var td=rows[y].cells[x];var sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(var y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(var x2=xstart;x2<xstart+sd['colspan'];x2++){grid[y2][x2]=td;}}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table);var cpos=getCellPos(grid,td);if(new_tr.cells.length!=tr.childNodes.length){var cells=tr.childNodes;var lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML=" ";}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value});}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild(table);inst.repaint();}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm.parentNode.removeChild(tableElm);return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;inst.selection.selectNode(getCell(grid,cpos.rowindex,0),true,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm.parentNode.removeChild(tableElm);return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;inst.selection.selectNode(getCell(grid,0,cpos.cellindex),true,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint();}return true;}return false;}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file +tinyMCE.importPluginLanguagePack('table');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler)}inst.tableRowClipboard=null},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_table','table_delete.gif','lang_table_del','mceTableDelete'],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false))}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1",tdElm;var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal')}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal')}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance)},10)}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true}return false}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" "}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan}}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y}}}return null}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null}function getTableGrid(table){var grid=new Array(),rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td}}}return grid}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td}deleteMarked(tableElm)}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node}return null}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node}}return null}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td)}while((td=nexttd)!=null)}}while((tr=next)!=null)}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR")}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML=" "}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm}return newTR}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value})}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild(table);inst.repaint()}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}trElm.parentNode.insertBefore(newTR,trElm);grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex+1,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR)}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD)}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true}lastTDElm=tdElm}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex+1),tinyMCE.isGecko,true);break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm)}lastTDElm=tdElm}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan)}addRows(tdElm,trElm,rowspan)}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td}}if(rowCells.length>0)rows[rows.length]=rowCells}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td}}}if(rowCells.length>0)rows[rows.length]=rowCells}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y}x2=x;y2=y;grid[y][x]._selected=true}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true}lastRowSpan=sd['rowspan']}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true}lastColSpan=sd['colspan']}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm}if(tdElm.rowSpan>1)tdElm.rowSpan--}}}}break}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint()}return true}return false}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/table/editor_plugin_src.js b/program/js/tiny_mce/plugins/table/editor_plugin_src.js index 4b512b42b..21d23cf52 100644 --- a/program/js/tiny_mce/plugins/table/editor_plugin_src.js +++ b/program/js/tiny_mce/plugins/table/editor_plugin_src.js @@ -1,20 +1,18 @@ /**
- * $RCSfile: editor_plugin_src.js,v $
- * $Revision: 1.38 $
- * $Date: 2006/02/11 18:53:51 $
+ * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('table', 'en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');
+tinyMCE.importPluginLanguagePack('table');
var TinyMCE_TablePlugin = {
getInfo : function() {
return {
longname : 'Tables',
- author : 'Moxiecode Systems',
+ author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
@@ -36,6 +34,7 @@ var TinyMCE_TablePlugin = { getControlHTML : function(control_name) {
var controls = new Array(
['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
+ ['delete_table', 'table_delete.gif', 'lang_table_del', 'mceTableDelete'],
['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
@@ -118,12 +117,13 @@ var TinyMCE_TablePlugin = { },
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
- var colspan = "1", rowspan = "1";
+ var colspan = "1", rowspan = "1", tdElm;
var inst = tinyMCE.getInstanceById(editor_id);
// Reset table controls
tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonDisabled');
tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
@@ -138,6 +138,7 @@ var TinyMCE_TablePlugin = { // Within a td element
if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
+ tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
@@ -228,8 +229,10 @@ var TinyMCE_TablePlugin = { }
function getCellPos(grid, td) {
- for (var y=0; y<grid.length; y++) {
- for (var x=0; x<grid[y].length; x++) {
+ var x, y;
+
+ for (y=0; y<grid.length; y++) {
+ for (x=0; x<grid[y].length; x++) {
if (grid[y][x] == td)
return {cellindex : x, rowindex : y};
}
@@ -246,25 +249,23 @@ var TinyMCE_TablePlugin = { }
function getTableGrid(table) {
- var grid = new Array();
- var rows = table.rows;
+ var grid = new Array(), rows = table.rows, x, y, td, sd, xstart, x2, y2;
- for (var y=0; y<rows.length; y++) {
- for (var x=0; x<rows[y].cells.length; x++) {
- var td = rows[y].cells[x];
- var sd = getColRowSpan(td);
+ for (y=0; y<rows.length; y++) {
+ for (x=0; x<rows[y].cells.length; x++) {
+ td = rows[y].cells[x];
+ sd = getColRowSpan(td);
// All ready filled
for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
// Fill box
- for (var y2=y; y2<y+sd['rowspan']; y2++) {
+ for (y2=y; y2<y+sd['rowspan']; y2++) {
if (!grid[y2])
grid[y2] = new Array();
- for (var x2=xstart; x2<xstart+sd['colspan']; x2++) {
+ for (x2=xstart; x2<xstart+sd['colspan']; x2++)
grid[y2][x2] = td;
- }
}
}
}
@@ -273,13 +274,13 @@ var TinyMCE_TablePlugin = { }
function trimRow(table, tr, td, new_tr) {
- var grid = getTableGrid(table);
- var cpos = getCellPos(grid, td);
+ var grid = getTableGrid(table), cpos = getCellPos(grid, td);
+ var cells, lastElm;
// Time to crop away some
if (new_tr.cells.length != tr.childNodes.length) {
- var cells = tr.childNodes;
- var lastElm = null;
+ cells = tr.childNodes;
+ lastElm = null;
for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
var remove = true;
@@ -500,46 +501,11 @@ var TinyMCE_TablePlugin = { // Table has a tbody use that reference
// Changed logic by ApTest 2005.07.12 (www.aptest.com)
// Now lookk at the focused element and take its parentNode. That will be a tbody or a table.
- if (tableElm != trElm.parentNode)
+ if (trElm && tableElm != trElm.parentNode)
tableElm = trElm.parentNode;
if (tableElm && trElm) {
switch (command) {
- case "mceTableInsertRowBefore":
- if (!trElm || !tdElm)
- return true;
-
- var grid = getTableGrid(tableElm);
- var cpos = getCellPos(grid, tdElm);
- var newTR = doc.createElement("tr");
- var lastTDElm = null;
-
- cpos.rowindex--;
- if (cpos.rowindex < 0)
- cpos.rowindex = 0;
-
- // Create cells
- for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
- if (tdElm != lastTDElm) {
- var sd = getColRowSpan(tdElm);
-
- if (sd['rowspan'] == 1) {
- var newTD = doc.createElement("td");
-
- newTD.innerHTML = " ";
- newTD.colSpan = tdElm.colSpan;
-
- newTR.appendChild(newTD);
- } else
- tdElm.rowSpan = sd['rowspan'] + 1;
-
- lastTDElm = tdElm;
- }
- }
-
- trElm.parentNode.insertBefore(newTR, trElm);
- break;
-
case "mceTableCutRow":
if (!trElm || !tdElm)
return true;
@@ -584,6 +550,44 @@ var TinyMCE_TablePlugin = { break;
+ case "mceTableInsertRowBefore":
+ if (!trElm || !tdElm)
+ return true;
+
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
+ var newTR = doc.createElement("tr");
+ var lastTDElm = null;
+
+ cpos.rowindex--;
+ if (cpos.rowindex < 0)
+ cpos.rowindex = 0;
+
+ // Create cells
+ for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
+
+ if (sd['rowspan'] == 1) {
+ var newTD = doc.createElement("td");
+
+ newTD.innerHTML = " ";
+ newTD.colSpan = tdElm.colSpan;
+
+ newTR.appendChild(newTD);
+ } else
+ tdElm.rowSpan = sd['rowspan'] + 1;
+
+ lastTDElm = tdElm;
+ }
+ }
+
+ trElm.parentNode.insertBefore(newTR, trElm);
+
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex + 1, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
+ break;
+
case "mceTableInsertRowAfter":
if (!trElm || !tdElm)
return true;
@@ -619,17 +623,21 @@ var TinyMCE_TablePlugin = { else
tableElm.appendChild(newTR);
}
+
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
break;
case "mceTableDeleteRow":
if (!trElm || !tdElm)
return true;
-
+
var grid = getTableGrid(tableElm);
var cpos = getCellPos(grid, tdElm);
// Only one row, remove whole table
if (grid.length == 1) {
+ tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
tableElm.parentNode.removeChild(tableElm);
return true;
}
@@ -678,7 +686,9 @@ var TinyMCE_TablePlugin = { if (cpos.rowindex < 0)
cpos.rowindex = 0;
- inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), true, true);
+ // Recalculate grid and select
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
break;
case "mceTableInsertColBefore":
@@ -706,6 +716,9 @@ var TinyMCE_TablePlugin = { lastTDElm = tdElm;
}
}
+
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex + 1), tinyMCE.isGecko, true); // Only collape on gecko
break;
case "mceTableInsertColAfter":
@@ -737,6 +750,9 @@ var TinyMCE_TablePlugin = { lastTDElm = tdElm;
}
}
+
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
break;
case "mceTableDeleteCol":
@@ -749,6 +765,7 @@ var TinyMCE_TablePlugin = { // Only one col, remove whole table
if (grid.length > 1 && grid[0].length <= 1) {
+ tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
tableElm.parentNode.removeChild(tableElm);
return true;
}
@@ -773,7 +790,9 @@ var TinyMCE_TablePlugin = { if (cpos.cellindex < 0)
cpos.cellindex = 0;
- inst.selection.selectNode(getCell(grid, 0, cpos.cellindex), true, true);
+ // Recalculate grid and select
+ grid = getTableGrid(tableElm);
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
break;
case "mceTableSplitCells":
diff --git a/program/js/tiny_mce/plugins/table/images/buttons.gif b/program/js/tiny_mce/plugins/table/images/buttons.gif Binary files differindex bfc1568be..8c09ff952 100644 --- a/program/js/tiny_mce/plugins/table/images/buttons.gif +++ b/program/js/tiny_mce/plugins/table/images/buttons.gif diff --git a/program/js/tiny_mce/plugins/table/jscripts/merge_cells.js b/program/js/tiny_mce/plugins/table/jscripts/merge_cells.js index 51a274962..06cbb275d 100644 --- a/program/js/tiny_mce/plugins/table/jscripts/merge_cells.js +++ b/program/js/tiny_mce/plugins/table/jscripts/merge_cells.js @@ -11,6 +11,11 @@ function mergeCells() { var args = new Array();
var formObj = document.forms[0];
+ if (!AutoValidator.validate(formObj)) {
+ alert(tinyMCE.getLang('lang_invalid_data'));
+ return false;
+ }
+
args["numcols"] = formObj.numcols.value;
args["numrows"] = formObj.numrows.value;
diff --git a/program/js/tiny_mce/plugins/table/jscripts/table.js b/program/js/tiny_mce/plugins/table/jscripts/table.js index 02eaeee27..6904ed0f7 100644 --- a/program/js/tiny_mce/plugins/table/jscripts/table.js +++ b/program/js/tiny_mce/plugins/table/jscripts/table.js @@ -8,6 +8,11 @@ function insertTable() { var elm = tinyMCE.tableElm;
var cellLimit, rowLimit, colLimit;
+ if (!AutoValidator.validate(formObj)) {
+ alert(tinyMCE.getLang('lang_invalid_data'));
+ return false;
+ }
+
tinyMCEPopup.restoreSelection();
// Get form data
@@ -180,7 +185,7 @@ function init() { document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
- var cols = 2, rows = 2, border = 0, cellpadding = "", cellspacing = "";
+ var cols = 2, rows = 2, border = tinyMCE.getParam('table_default_border', '0'), cellpadding = tinyMCE.getParam('table_default_cellpadding', ''), cellspacing = tinyMCE.getParam('table_default_cellspacing', '');
var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
var inst = tinyMCE.selectedInstance;
diff --git a/program/js/tiny_mce/plugins/table/merge_cells.htm b/program/js/tiny_mce/plugins/table/merge_cells.htm index be723a9fa..10896bf9e 100644 --- a/program/js/tiny_mce/plugins/table/merge_cells.htm +++ b/program/js/tiny_mce/plugins/table/merge_cells.htm @@ -3,6 +3,7 @@ <title>{$lang_table_merge_cells_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
<base target="_self" />
</head>
@@ -13,12 +14,12 @@ <table border="0" cellpadding="0" cellspacing="3" width="100%">
<tr>
<td>{$lang_table_cols}:</td>
- <td align="right"><input type="text" name="numcols" value="" style="width: 30px" /></td>
+ <td align="right"><input type="text" name="numcols" value="" class="number min1" style="width: 30px" /></td>
<td>
</tr>
<tr>
<td>{$lang_table_rows}:</td>
- <td align="right"><input type="text" name="numrows" value="" style="width: 30px" /></td>
+ <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
</tr>
</table>
</fieldset>
diff --git a/program/js/tiny_mce/plugins/table/table.htm b/program/js/tiny_mce/plugins/table/table.htm index 846f55131..6c4078db9 100644 --- a/program/js/tiny_mce/plugins/table/table.htm +++ b/program/js/tiny_mce/plugins/table/table.htm @@ -4,6 +4,7 @@ <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+ <script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
<link href="css/table.css" rel="stylesheet" type="text/css" />
<base target="_self" />
@@ -25,15 +26,15 @@ <table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
- <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" /></td>
+ <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
<td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
- <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" /></td>
+ <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
</tr>
<tr>
<td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
- <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" /></td>
+ <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
<td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
- <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" /></td>
+ <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
</tr>
<tr>
<td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
@@ -44,13 +45,13 @@ <option value="right">{$lang_table_align_right}</option>
</select></td>
<td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" /></td>
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
</tr>
- <tr>
+ <tr id="width_row">
<td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
- <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+ <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
<td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
- <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+ <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
</tr>
<tr id="styleSelectRow">
<td><label id="classlabel" for="class">{$lang_class_name}</label></td>
diff --git a/program/js/tiny_mce/plugins/visualchars/editor_plugin.js b/program/js/tiny_mce/plugins/visualchars/editor_plugin.js new file mode 100755 index 000000000..6056b9fe7 --- /dev/null +++ b/program/js/tiny_mce/plugins/visualchars/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('visualchars');var TinyMCE_VisualCharsPlugin={getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_visualchars.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.visualChars={state:false}},getControlHTML:function(cn){switch(cn){case"visualchars":return tinyMCE.getButtonHTML(cn,'lang_visualchars_desc','{$pluginurl}/images/visualchars.gif','mceVisualChars',false)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);switch(command){case"mceVisualChars":this._toggleVisualChars(editor_id,inst);return true}return false},cleanup:function(type,content,inst){if(type=="insert_to_editor_dom"||type=="get_from_editor_dom"){inst.visualChars.state=true;this._toggleVisualChars(inst.editorId,inst)}return content},_toggleVisualChars:function(editor_id,inst){var nl,i,h,d=inst.getDoc(),b=inst.getBody(),nv,s=inst.selection,bo;inst.visualChars.state=!inst.visualChars.state;bo=s.getBookmark(true);tinyMCE.switchClass(editor_id+'_visualchars',inst.visualChars.state?'mceButtonSelected':'mceButtonNormal');if(inst.visualChars.state){nl=tinyMCE.selectNodes(b,function(n){return n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1});for(i=0;i<nl.length;i++){nv=nl[i].nodeValue;nv=nv.replace(/(\u00a0+)/g,'<span class="mceItemHiddenVisualChar">$1</span>');nv=nv.replace(/\u00a0/g,'\u00b7');tinyMCE.setOuterHTML(nl[i],nv,d)}}else{nl=tinyMCE.selectNodes(b,function(n){return n.nodeType==1&&n.nodeName=='SPAN'&&n.className=='mceItemHiddenVisualChar'});for(i=0;i<nl.length;i++)tinyMCE.setOuterHTML(nl[i],nl[i].innerHTML.replace(/(·|\u00b7)/g,' '),d)}}};tinyMCE.addPlugin("visualchars",TinyMCE_VisualCharsPlugin);
\ No newline at end of file diff --git a/program/js/tiny_mce/plugins/visualchars/editor_plugin_src.js b/program/js/tiny_mce/plugins/visualchars/editor_plugin_src.js new file mode 100755 index 000000000..44124434d --- /dev/null +++ b/program/js/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -0,0 +1,89 @@ +/**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('visualchars');
+
+var TinyMCE_VisualCharsPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Visual characters',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_visualchars.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ initInstance : function(inst) {
+ inst.visualChars = {
+ state : false
+ };
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "visualchars":
+ return tinyMCE.getButtonHTML(cn, 'lang_visualchars_desc', '{$pluginurl}/images/visualchars.gif', 'mceVisualChars', false);
+ }
+
+ return "";
+ },
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ var inst = tinyMCE.getInstanceById(editor_id);
+
+ switch (command) {
+ case "mceVisualChars":
+ this._toggleVisualChars(editor_id, inst);
+ return true;
+ }
+
+ return false;
+ },
+
+ cleanup : function(type, content, inst) {
+ if (type == "insert_to_editor_dom" || type == "get_from_editor_dom") {
+ inst.visualChars.state = true;
+ this._toggleVisualChars(inst.editorId, inst);
+ }
+
+ return content;
+ },
+
+ // Private plugin internal methods
+
+ _toggleVisualChars : function(editor_id, inst) {
+ var nl, i, h, d = inst.getDoc(), b = inst.getBody(), nv, s = inst.selection, bo;
+
+ inst.visualChars.state = !inst.visualChars.state;
+
+ bo = s.getBookmark(true);
+
+ tinyMCE.switchClass(editor_id + '_visualchars', inst.visualChars.state ? 'mceButtonSelected' : 'mceButtonNormal');
+
+ if (inst.visualChars.state) {
+ nl = tinyMCE.selectNodes(b, function(n) {return n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1;});
+
+ for (i=0; i<nl.length; i++) {
+ nv = nl[i].nodeValue;
+ nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHiddenVisualChar">$1</span>');
+ nv = nv.replace(/\u00a0/g, '\u00b7');
+ tinyMCE.setOuterHTML(nl[i], nv, d);
+ }
+ } else {
+ nl = tinyMCE.selectNodes(b, function(n) {return n.nodeType == 1 && n.nodeName == 'SPAN' && n.className == 'mceItemHiddenVisualChar';});
+
+ for (i=0; i<nl.length; i++)
+ tinyMCE.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(·|\u00b7)/g, ' '), d);
+ }
+
+ //s.moveToBookmark(bo);
+ }
+};
+
+tinyMCE.addPlugin("visualchars", TinyMCE_VisualCharsPlugin);
diff --git a/program/js/tiny_mce/plugins/visualchars/images/visualchars.gif b/program/js/tiny_mce/plugins/visualchars/images/visualchars.gif Binary files differnew file mode 100755 index 000000000..3b4293e06 --- /dev/null +++ b/program/js/tiny_mce/plugins/visualchars/images/visualchars.gif diff --git a/program/js/tiny_mce/plugins/visualchars/langs/en.js b/program/js/tiny_mce/plugins/visualchars/langs/en.js new file mode 100755 index 000000000..a82a4ee57 --- /dev/null +++ b/program/js/tiny_mce/plugins/visualchars/langs/en.js @@ -0,0 +1,5 @@ +// EN lang variables
+
+tinyMCE.addToLang('visualchars',{
+desc : 'Visual control characters on/off.'
+});
|