TinyMCE 3.0 Final from azaozz. see #5674

git-svn-id: http://svn.automattic.com/wordpress/trunk@6694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-31 18:10:46 +00:00
parent 2340b8dda6
commit c1a034bcbe
57 changed files with 1353 additions and 13092 deletions

View File

@ -178,3 +178,155 @@ addLoadEvent( function() {
} );
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
});
wpEditorInit = function() {
// Activate tinyMCE if it's the user's default editor
if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) {
document.getElementById('editorcontainer').style.padding = '0px';
tinyMCE.execCommand("mceAddControl", true, "content");
} else {
var H;
if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
document.getElementById('content').style.height = H.ch - 30 + 'px';
}
};
switchEditors = {
saveCallback : function(el, content, body) {
document.getElementById(el).style.color = '#fff';
if ( tinyMCE.activeEditor.isHidden() )
content = document.getElementById(el).value;
else
content = this.pre_wpautop(content);
return content;
},
pre_wpautop : function(content) {
// We have a TON of cleanup to do.
// content = content.replace(/\n|\r/g, ' ');
// Remove anonymous, empty paragraphs.
content = content.replace(new RegExp('<p>(\\s|&nbsp;|<br>)*</p>', 'mg'), '');
// Mark </p> if it has any attributes.
content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>');
// Get it ready for wpautop.
content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');
// Fix some block element newline issues
var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre';
content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
content = content.replace(new RegExp('<li>', 'g'), '\t<li>');
if ( content.indexOf('<object') != -1 ) {
content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'g'), "<param$1>"); // no pee inside object/embed
content = content.replace(new RegExp('\\s*</embed>\\s*', 'g'), '</embed>');
}
// Unmark special paragraph closing tags
content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
content = content.replace(new RegExp('\\s*(<p[^>]+>.*</p>)', 'mg'), '\n$1');
// Trim trailing whitespace
content = content.replace(new RegExp('\\s*$', ''), '');
// Hope.
return content;
},
go : function(id) {
var ed = tinyMCE.get(id);
var qt = document.getElementById('quicktags');
var H = document.getElementById('edButtonHTML');
var P = document.getElementById('edButtonPreview');
var ta = document.getElementById(id);
var ec = document.getElementById('editorcontainer');
if ( ! ed || ed.isHidden() ) {
ta.style.color = '#fff';
this.edToggle(P, H);
edCloseAllTags(); // :-(
qt.style.display = 'none';
ec.style.padding = '0px';
ta.value = this.wpautop(ta.value);
if ( ed ) ed.show();
else tinyMCE.execCommand("mceAddControl", false, id);
this.wpSetDefaultEditor( 'tinymce' );
} else {
this.edToggle(H, P);
tinyMCE.triggerSave();
ta.style.height = tinyMCE.activeEditor.contentAreaContainer.offsetHeight + 6 + 'px';
if ( tinymce.isIE6 )
ta.style.width = tinyMCE.activeEditor.contentAreaContainer.offsetWidth - 12 + 'px';
ed.hide();
ta.value = this.pre_wpautop(ta.value);
qt.style.display = 'block';
ec.style.padding = '6px';
ta.style.color = '';
this.wpSetDefaultEditor( 'html' );
}
},
edToggle : function(A, B) {
A.className = 'active';
B.className = '';
B.onclick = A.onclick;
A.onclick = null;
},
wpSetDefaultEditor : function( editor ) {
try {
editor = escape( editor.toString() );
} catch(err) {
editor = 'tinymce';
}
var userID = document.getElementById('user-id');
var date = new Date();
date.setTime(date.getTime()+(10*365*24*60*60*1000));
document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString();
},
wpautop : function(pee) {
var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
pee = pee + "\n\n";
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
pee = pee.replace(new RegExp('<p>\\s*?</p>', 'gi'), '');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
pee = pee.replace(new RegExp('<p><blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
pee = pee.replace(new RegExp('</blockquote></p>', 'gi'), '</p></blockquote>');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;');
//pee = pee.replace(new RegExp('(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' "); // Hmm...
return pee;
}
}

View File

@ -370,9 +370,14 @@ input.disabled, textarea.disabled {
width: 100%;
}
#postdivrich #content {
padding: 5px;
line-height: 140%;
#editorcontainer #content {
padding: 0;
line-height: 150%;
border: 0 none;
}
#editorcontainer {
padding: 6px;
}
#currenttheme img {
@ -394,10 +399,9 @@ input.delete:hover {
}
#postdivrich #quicktags {
background: #f0f0ee;
background: #cee1ef;
padding: 0;
border: 1px solid #ccc;
border-bottom: none;
border: 0 none;
}
#postdiv #quicktags {
@ -1178,7 +1182,7 @@ html, body {
padding: 2px;
}
#poststuff .postbox, #titlediv {
#poststuff .postbox, #titlediv, #poststuff .postarea {
margin-left: 20px;
border: 1px solid #ebebeb;
border-right: 1px solid #ccc;
@ -1188,7 +1192,6 @@ html, body {
}
#poststuff .postarea {
margin-left: 20px;
margin-right: 8px;
}
@ -1223,7 +1226,7 @@ html, body {
#poststuff #edButtonPreview, #poststuff #edButtonHTML {
display: block;
height: 18px;
height: 20px;
padding: 5px;
margin-right: 8px;
float: right;
@ -1235,7 +1238,8 @@ html, body {
background: #cee1ef;
color: #333;
font-weight: bold;
-moz-border-radius: 2px;
-moz-border-radius-topright: 2px;
-moz-border-radius-topleft: 2px;
}
#poststuff #media-buttons {

View File

@ -928,19 +928,20 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
if ( user_can_richedit() ) :
$wp_default_editor = wp_default_editor();
$active = " class='active'";
$inactive = " onclick='switchEditors(\"$id\");'";
$inactive = " onclick='switchEditors.go(\"$id\");'";
if ( 'tinymce' == $wp_default_editor )
add_filter('the_editor_content', 'wp_richedit_pre');
// The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it.
?>
<style type="text/css">
?>
<style type="text/css">
#postdivrich table, #postdivrich #quicktags {border-top: none;}
#quicktags {border-bottom: none; padding-bottom: 2px; margin-bottom: -1px;}
</style>
<div id='editor-toolbar' style='display:none;'>
<div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors("<?php echo $id; ?>")' /></div>
<div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors.go("<?php echo $id; ?>")' /></div>
<a id='edButtonHTML'<?php echo 'html' == $wp_default_editor ? $active : $inactive; ?>><?php _e('HTML'); ?></a>
<a id='edButtonPreview'<?php echo 'tinymce' == $wp_default_editor ? $active : $inactive; ?>><?php _e('Visual'); ?></a>
@ -973,7 +974,7 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
</script>
<?php endif; // 'html' != $wp_default_editor
$the_editor = apply_filters('the_editor', "<div><textarea class='' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n");
$the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea class='' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n");
$the_editor_content = apply_filters('the_editor_content', $content);
printf($the_editor, $the_editor_content);
@ -986,39 +987,18 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
// If tinyMCE is defined.
if ( typeof tinyMCE != 'undefined' ) {
// This code is meant to allow tabbing from Title to Post (TinyMCE).
if ( tinyMCE.isMSIE ) {
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
if ( tinyMCE.idCounter == 0 )
return true;
e = e ? e : window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
if(typeof i == 'undefined')
return true;
tinyMCE.execCommand("mceStartTyping");
this.blur();
i.contentWindow.focus();
e.returnValue = false;
return false;
}
}
} else {
document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e) {
if ( tinyMCE.idCounter == 0 )
return true;
e = e ? e : window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
var i = tinyMCE.getInstanceById('<?php echo $id; ?>');
if(typeof i == 'undefined')
return true;
tinyMCE.execCommand("mceStartTyping");
this.blur();
i.contentWindow.focus();
e.returnValue = false;
return false;
}
}
}
document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
e = e || window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
if ( tinyMCE.activeEditor ) {
e = null;
if ( tinyMCE.activeEditor.isHidden() ) return true;
tinyMCE.activeEditor.focus();
return false;
}
return true;
}
}
}
<?php endif; ?>
//-->

View File

@ -82,7 +82,7 @@ function autosave_enable_buttons() {
}
function autosave() {
var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false;
var rich = ( (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() ) ? true : false;
var post_data = {
action: "autosave",
post_ID: jQuery("#post_ID").val() || 0,
@ -93,15 +93,14 @@ function autosave() {
};
/* Gotta do this up here so we can check the length when tinyMCE is in use */
if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
post_data["content"] = jQuery("#content").val();
} else {
if ( rich ) {
// Don't run while the TinyMCE spellcheck is on.
if(tinyMCE.selectedInstance.spellcheckerOn) return;
tinyMCE.wpTriggerSave();
post_data["content"] = jQuery("#content").val();
if ( tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) return;
tinyMCE.triggerSave();
}
post_data["content"] = jQuery("#content").val();
if(post_data["post_title"].length==0 || post_data["content"].length==0 || post_data["post_title"] + post_data["content"] == autosaveLast) {
return;
}
@ -122,12 +121,10 @@ function autosave() {
if( jQuery("#excerpt"))
post_data["excerpt"] = jQuery("#excerpt").val();
if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
post_data["content"] = jQuery("#content").val();
} else {
tinyMCE.wpTriggerSave();
post_data["content"] = jQuery("#content").val();
}
if ( rich )
tinyMCE.triggerSave();
post_data["content"] = jQuery("#content").val();
if(parseInt(post_data["post_ID"]) < 1) {
post_data["temp_ID"] = post_data["post_ID"];

View File

@ -1,51 +1 @@
/**
* $Id$
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
tinymce.create('tinymce.plugins.AutoSavePlugin', {
init : function(ed, url) {
var t = this;
t.editor = ed;
window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;
},
getInfo : function() {
return {
longname : 'Auto save',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private plugin internal methods
'static' : {
_beforeUnloadHandler : function() {
var msg;
tinymce.each(tinyMCE.editors, function(ed) {
if (ed.getParam("fullscreen_is_enabled"))
return;
if (ed.isDirty()) {
msg = ed.getLang("autosave.unload_msg");
return false;
}
});
return msg;
}
}
});
// Register plugin
tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin);
})();
(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})();

View File

@ -1,79 +1 @@
/**
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
tinymce.create('tinymce.plugins.Directionality', {
init : function(ed, url) {
var t = this;
t.editor = ed;
ed.addCommand('mceDirectionLTR', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "ltr")
ed.dom.setAttrib(e, "dir", "ltr");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
});
ed.addCommand('mceDirectionRTL', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "rtl")
ed.dom.setAttrib(e, "dir", "rtl");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
});
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
ed.onNodeChange.add(t._nodeChange, t);
},
getInfo : function() {
return {
longname : 'Directionality',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
_nodeChange : function(ed, cm, n) {
var dom = ed.dom, dir;
n = dom.getParent(n, dom.isBlock);
if (!n) {
cm.setDisabled('ltr', 1);
cm.setDisabled('rtl', 1);
return;
}
dir = dom.getAttrib(n, 'dir');
cm.setActive('ltr', dir == "ltr");
cm.setDisabled('ltr', 0);
cm.setActive('rtl', dir == "rtl");
cm.setDisabled('rtl', 0);
}
});
// Register plugin
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
})();
(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();

View File

@ -1,127 +1 @@
/**
* $Id: editor_plugin_src.js 544 2008-01-17 13:07:00Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var DOM = tinymce.DOM;
tinymce.create('tinymce.plugins.FullScreenPlugin', {
init : function(ed, url) {
var t = this, s = {}, vp;
t.editor = ed;
// Register commands
ed.addCommand('mceFullScreen', function() {
var win, de = document.documentElement;
if (ed.getParam('fullscreen_is_enabled')) {
if (ed.getParam('fullscreen_new_window'))
closeFullscreen(); // Call to close in new window
else {
window.setTimeout(function() {
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
tinyMCE.remove(ed);
DOM.remove('mce_fullscreen_container');
de.style.overflow = ed.getParam('fullscreen_html_overflow');
DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow'));
window.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
}, 10);
}
return;
}
if (ed.getParam('fullscreen_new_window')) {
win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
try {
win.resizeTo(screen.availWidth, screen.availHeight);
} catch (e) {
// Ignore
}
} else {
s.fullscreen_overflow = DOM.getStyle(document.body, 'overflow', 1) || 'auto';
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
vp = DOM.getViewPort();
s.fullscreen_scrollx = vp.x;
s.fullscreen_scrolly = vp.y;
// Fixes an Opera bug where the scrollbars doesn't reappear
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
s.fullscreen_overflow = 'auto';
// Fixes an IE bug where horizontal scrollbars would appear
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
s.fullscreen_overflow = 'auto';
if (s.fullscreen_overflow == '0px')
s.fullscreen_overflow = '';
DOM.setStyle(document.body, 'overflow', 'hidden');
de.style.overflow = 'hidden'; //Fix for IE6/7
vp = DOM.getViewPort();
window.scrollTo(0, 0);
if (tinymce.isIE)
vp.h -= 1;
n = DOM.add(document.body, 'div', {id : 'mce_fullscreen_container', style : 'position:absolute;top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:150;'});
DOM.add(n, 'div', {id : 'mce_fullscreen'});
tinymce.each(ed.settings, function(v, n) {
s[n] = v;
});
s.id = 'mce_fullscreen';
s.width = n.clientWidth;
s.height = n.clientHeight - 15;
s.fullscreen_is_enabled = true;
s.fullscreen_editor_id = ed.id;
s.theme_advanced_resizing = false;
tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
s[k] = v;
});
if (s.theme_advanced_toolbar_location === 'external')
s.theme_advanced_toolbar_location = 'top';
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
t.fullscreenEditor.onInit.add(function() {
t.fullscreenEditor.setContent(ed.getContent({format : 'raw', no_events : 1}), {format : 'raw', no_events : 1});
});
t.fullscreenEditor.render();
tinyMCE.add(t.fullscreenEditor);
t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
t.fullscreenElement.update();
//document.body.overflow = 'hidden';
}
});
// Register buttons
ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
ed.onNodeChange.add(function(ed, cm) {
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
});
},
getInfo : function() {
return {
longname : 'Fullscreen',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
})();
(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent({format:'raw',no_events:1}),{format:'raw',no_events:1});});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();

View File

@ -1,6 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_fullscreen_title}</title>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="../../tiny_mce.js"></script>
<script type="text/javascript">
@ -69,20 +70,21 @@
return false;
}
function init() {
var e = document.getElementById('fullscreenarea');
e.value = window.opener.tinyMCE.activeEditor.getContent({format : 'raw'});
settings['width'] = e.clientWidth;
settings['height'] = e.clientHeight;
tinyMCE.init(settings);
}
</script>
<base target="_self" />
</head>
<body onload="init();" style="margin:0; overflow:hidden; height:100%;" scrolling="no" scroll="no">
<form onsubmit="doParentSubmit();" style="height: 100%">
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
<form onsubmit="doParentSubmit();">
<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
</form>
<script type="text/javascript">
var e = document.getElementById('fullscreenarea');
e.value = window.opener.tinyMCE.activeEditor.getContent({format : 'raw'});
settings['width'] = window.innerWidth || document.body.clientWidth;
settings['height'] = (window.innerHeight || document.body.clientHeight) - 18;
tinyMCE.init(settings);
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 B

View File

@ -8,30 +8,73 @@
.clearlooks2 .placeholder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50)}
/* Top */
.clearlooks2 .top, .clearlooks2 .top div {top:0; width:100%; height:23px}
.clearlooks2 .top .left {width:6px; background:url(img/corners.gif)}
.clearlooks2 .top .center {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
.clearlooks2 .top .right {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
.clearlooks2 .top span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
.clearlooks2 .focus .top .left {background:url(img/corners.gif) -6px 0}
.clearlooks2 .focus .top .center {background:url(img/horizontal.gif) 0 -23px}
.clearlooks2 .focus .top .right {background:url(img/corners.gif) -18px 0}
.clearlooks2 .focus .top span {color:#FFF}
.clearlooks2 .top,
.clearlooks2 .top div {
top:0;
width:100%;
height:23px
}
.clearlooks2 .top .left {
width:55%;
background: #cee1ef;
border-left: 1px solid #c6d9e9;
border-top: 1px solid #c6d9e9;
}
.clearlooks2 .top .center {
/*right:6px;
width:100%;
height:23px;
background: #dedede;
border-top: 1px solid #ccc;*/
}
.clearlooks2 .top .right {
right:0;
width:55%;
height:23px;
background: #cee1ef;
border-right: 1px solid #c6d9e9;
border-top: 1px solid #c6d9e9;
}
.clearlooks2 .top span {
width:100%;
font: 12px/20px bold "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;
text-align:center;
vertical-align:middle;
line-height:23px;
font-weight:bold
}
.clearlooks2 .focus .top .left {
background: #2683ae;
border-left: 1px solid #464646;
border-top: 1px solid #464646;
}
.clearlooks2 .focus .top .center {
/*background: #2683ae;
border-top: 1px solid #454545;*/
}
.clearlooks2 .focus .top .right {
background: #2683ae;
border-right: 1px solid #464646;
border-top: 1px solid #464646;
}
.clearlooks2 .focus .top span {
color:#FFF
}
/* Middle */
.clearlooks2 .middle, .clearlooks2 .middle div {top:0}
.clearlooks2 .middle {width:100%; height:100%; clip:rect(23px auto auto auto)}
.clearlooks2 .middle .left {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
.clearlooks2 .middle .left {left:0; width:5px; height:100%; background:#eaf3ea;border-left:1px solid #c6d9e9;}
.clearlooks2 .middle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
.clearlooks2 .middle .right {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
.clearlooks2 .middle .right {right:0; width:5px; height:100%; background:#eaf3ea;border-right:1px solid #c6d9e9;}
/* Bottom */
.clearlooks2 .bottom, .clearlooks2 .bottom div {height:6px}
.clearlooks2 .bottom {left:0; bottom:0; width:100%}
.clearlooks2 .bottom div {top:0}
.clearlooks2 .bottom .left {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
.clearlooks2 .bottom .center {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
.clearlooks2 .bottom .right {right:0; width:5px; background: url(img/corners.gif) -34px 0}
.clearlooks2 .bottom {left:0; bottom:0; width:100%;background:#eaf3ea;border-bottom:1px solid #c6d9e9;}
.clearlooks2 .bottom div {top:0;}
.clearlooks2 .bottom .left {left:0; width:5px; background:#eaf3ea;border-left:1px solid #c6d9e9;}
.clearlooks2 .bottom .center {left:5px; width:100%; }
.clearlooks2 .bottom .right {right:0; width:6px; background:#eaf3ea url(img/drag.gif) no-repeat;border-right:1px solid #c6d9e9;}
.clearlooks2 .bottom span {display:none}
.clearlooks2 .statusbar .bottom, .clearlooks2 .statusbar .bottom div {height:23px}
.clearlooks2 .statusbar .bottom .left {background:url(img/corners.gif) -29px 0}

File diff suppressed because one or more lines are too long

View File

@ -2,14 +2,15 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#media_dlg.title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/media.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
<link href="css/media.css" rel="stylesheet" type="text/css" />
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('src').focus();},500);});</script>
<base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertMedia();return false;" action="#">
@ -811,11 +812,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="insertMedia();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="{#insert}" onclick="insertMedia();" />
</div>
</div>
</form>

File diff suppressed because one or more lines are too long

View File

@ -2,9 +2,10 @@
<head>
<title>{#paste.paste_text_desc}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/pastetext.js"></script>
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('htmlSource').focus();},500);});</script>
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();">
@ -22,11 +23,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" name="insert" value="{#insert}" onclick="saveContent();" id="insert" />
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
</div>
<div style="float: right">
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
<input type="submit" name="insert" value="{#insert}" onclick="saveContent();" id="insert" />
</div>
</div>
</form>

View File

@ -17,11 +17,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
</div>
</div>
</form>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
.mceWPnextpage, .mceWPmore {
border: 0px;
border-top: 1px dotted #cccccc;
display: block;
width: 100%;
height: 12px;
margin-top: 15px;
}
.mceWPmore {
background: #ffffff url(../img/more_bug.gif) no-repeat right top;
}
.mceWPnextpage {
background: #ffffff url(../img/page_bug.gif) no-repeat right top;
}

View File

@ -1,616 +1,153 @@
/* Import plugin specific language pack */
//tinyMCE.importPluginLanguagePack('wordpress', 'en');
/**
* Wordpress plugin.
*/
var TinyMCE_wordpressPlugin = {
getInfo : function() {
return {
longname : 'WordPress Plugin',
author : 'WordPress',
authorurl : 'http://wordpress.org',
infourl : 'http://wordpress.org',
version : '1'
};
},
(function() {
var DOM = tinymce.DOM;
getControlHTML : function(control_name) {
switch (control_name) {
case "wp_more":
return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_more_button', '{$pluginurl}/images/more.gif', 'wpMore');
case "wp_page":
return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_page_button', '{$pluginurl}/images/page.gif', 'wpPage');
case "wp_help":
var buttons = tinyMCE.getButtonHTML(control_name, 'lang_help_button_title', '{$pluginurl}/images/help.gif', 'wpHelp');
var hiddenControls = '<div class="zerosize">'
+ '<input type="button" accesskey="n" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSpellCheck\',false);" />'
+ '<input type="button" accesskey="k" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Strikethrough\',false);" />'
+ '<input type="button" accesskey="l" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertUnorderedList\',false);" />'
+ '<input type="button" accesskey="o" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertOrderedList\',false);" />'
+ '<input type="button" accesskey="w" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Outdent\',false);" />'
+ '<input type="button" accesskey="q" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Indent\',false);" />'
+ '<input type="button" accesskey="f" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyLeft\',false);" />'
+ '<input type="button" accesskey="c" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyCenter\',false);" />'
+ '<input type="button" accesskey="r" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyRight\',false);" />'
+ '<input type="button" accesskey="j" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyFull\',false);" />'
+ '<input type="button" accesskey="a" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceLink\',true);" />'
+ '<input type="button" accesskey="s" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'unlink\',false);" />'
+ '<input type="button" accesskey="m" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceImage\',true);" />'
+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'wpMore\');" />'
+ '<input type="button" accesskey="g" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'wpPage\');" />'
+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'
+ '<input type="button" accesskey="y" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\',false);" />'
+ '<input type="button" accesskey="h" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'wpHelp\',false);" />'
+ '<input type="button" accesskey="b" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Bold\',false);" />'
+ '<input type="button" accesskey="v" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'wpAdv\',false);" />'
+ '</div>';
return buttons+hiddenControls;
case "wp_adv":
return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_adv_button', '{$pluginurl}/images/toolbars.gif', 'wpAdv');
case "wp_adv_start":
return '<div id="wpadvbar" style="display:none;"><br />';
case "wp_adv_end":
return '</div>';
}
return '';
},
// Load plugin specific language pack
tinymce.PluginManager.requireLangPack('wordpress');
execCommand : function(editor_id, element, command, user_interface, value) {
var inst = tinyMCE.getInstanceById(editor_id);
var focusElm = inst.getFocusElement();
var doc = inst.getDoc();
tinymce.create('tinymce.plugins.WordPress', {
init : function(ed, url) {
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2');
var moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
var nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
// Hides the specified toolbar and resizes the iframe
ed.onPostRender.add(function() {
DOM.hide(ed.controlManager.get(tbId).id);
t._resizeIframe(ed, tbId, 28);
});
// Handle commands
switch (command) {
case "wpMore":
var flag = "";
var template = new Array();
var altMore = tinyMCE.getLang('lang_wordpress_more_alt');
// Is selection a image
if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
flag = getAttrib(focusElm, 'class');
if (flag != 'mce_plugin_wordpress_more') // Not a wordpress
return true;
action = "update";
// Register buttons
ed.addButton('wp_more', {
title : 'wordpress.wp_more_desc',
image : url + '/img/more.gif',
onclick : function() {
ed.execCommand('mceInsertContent', 0, moreHTML);
}
});
html = ''
+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
+ ' width="100%" height="10px" '
+ 'alt="'+altMore+'" title="'+altMore+'" class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />';
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, html);
tinyMCE.selectedInstance.repaint();
return true;
case "wpPage":
var flag = "";
var template = new Array();
var altPage = tinyMCE.getLang('lang_wordpress_more_alt');
// Is selection a image
if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
flag = getAttrib(focusElm, 'name');
if (flag != 'mce_plugin_wordpress_page') // Not a wordpress
return true;
action = "update";
ed.addButton('wp_page', {
title : 'wordpress.wp_page_desc',
image : url + '/img/page.gif',
onclick : function() {
// ed.execCommand('mcePageBreak');
ed.execCommand('mceInsertContent', 0, nextpageHTML);
}
});
html = ''
+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
+ ' width="100%" height="10px" '
+ 'alt="'+altPage+'" title="'+altPage+'" class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page" />';
tinyMCE.execCommand("mceInsertContent",true,html);
tinyMCE.selectedInstance.repaint();
return true;
case "wpHelp":
var template = new Array();
template['file'] = tinyMCE.baseURL + '/wp-mce-help.php';
template['width'] = 480;
template['height'] = 380;
args = {
resizable : 'yes',
scrollbars : 'yes'
};
tinyMCE.openWindow(template, args);
return true;
case "wpAdv":
var adv = document.getElementById('wpadvbar');
if ( adv.style.display == 'none' ) {
adv.style.display = 'block';
tinyMCE.switchClass(editor_id + '_wp_adv', 'mceButtonSelected');
} else {
adv.style.display = 'none';
tinyMCE.switchClass(editor_id + '_wp_adv', 'mceButtonNormal');
ed.addButton('wp_help', {
title : 'wordpress.wp_help_desc',
image : url + '/img/help.gif',
onclick : function() {
ed.windowManager.open({
url : tinymce.baseURL + '/wp-mce-help.php',
width : 450,
height : 420,
inline : 1
});
}
return true;
}
});
// Pass to next handler in chain
return false;
},
ed.addButton('wp_adv', {
title : 'wordpress.wp_adv_desc',
image : url + '/img/toolbars.gif',
onclick : function() {
var id = ed.controlManager.get(tbId).id, cm = ed.controlManager;
cleanup : function(type, content) {
switch (type) {
case "insert_to_editor":
var startPos = 0;
var altMore = tinyMCE.getLang('lang_wordpress_more_alt');
var altPage = tinyMCE.getLang('lang_wordpress_page_alt');
// Parse all <!--more--> tags and replace them with images
while ((startPos = content.indexOf('<!--more', startPos)) != -1) {
var endPos = content.indexOf('-->', startPos) + 3;
// Insert image
var moreText = content.substring(startPos + 8, endPos - 3);
var contentAfter = content.substring(endPos);
content = content.substring(0, startPos);
content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
content += ' width="100%" height="10px" moretext="'+moreText+'" ';
content += 'alt="'+altMore+'" title="'+altMore+'" class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />';
content += contentAfter;
startPos++;
}
var startPos = 0;
// Parse all <!--page--> tags and replace them with images
while ((startPos = content.indexOf('<!--nextpage-->', startPos)) != -1) {
// Insert image
var contentAfter = content.substring(startPos + 15);
content = content.substring(0, startPos);
content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
content += ' width="100%" height="10px" ';
content += 'alt="'+altPage+'" title="'+altPage+'" class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page" />';
content += contentAfter;
startPos++;
}
// Look for \n in <pre>, replace with <br>
var startPos = -1;
while ((startPos = content.indexOf('<pre', startPos+1)) != -1) {
var endPos = content.indexOf('</pre>', startPos+1);
var innerPos = content.indexOf('>', startPos+1);
var chunkBefore = content.substring(0, innerPos);
var chunkAfter = content.substring(endPos);
var innards = content.substring(innerPos, endPos);
innards = innards.replace(/\n/g, '<br />');
content = chunkBefore + innards + chunkAfter;
}
break;
case "get_from_editor":
// Parse all img tags and replace them with <!--more-->
var startPos = -1;
while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
var endPos = content.indexOf('/>', startPos);
var attribs = this._parseAttributes(content.substring(startPos + 4, endPos));
if (attribs['class'] == "mce_plugin_wordpress_more" || attribs['name'] == "mce_plugin_wordpress_more") {
endPos += 2;
var moreText = attribs['moretext'] ? attribs['moretext'] : '';
var embedHTML = '<!--more'+moreText+'-->';
// Insert embed/object chunk
chunkBefore = content.substring(0, startPos);
chunkAfter = content.substring(endPos);
content = chunkBefore + embedHTML + chunkAfter;
}
if (attribs['class'] == "mce_plugin_wordpress_page" || attribs['name'] == "mce_plugin_wordpress_page") {
endPos += 2;
var embedHTML = '<!--nextpage-->';
// Insert embed/object chunk
chunkBefore = content.substring(0, startPos);
chunkAfter = content.substring(endPos);
content = chunkBefore + embedHTML + chunkAfter;
if (DOM.isHidden(id)) {
cm.setActive('wp_adv', 1);
DOM.show(id);
t._resizeIframe(ed, tbId, -28);
} else {
cm.setActive('wp_adv', 0);
DOM.hide(id);
t._resizeIframe(ed, tbId, 28);
}
}
});
// Remove normal line breaks
content = content.replace(/\n|\r/g, ' ');
// Add listeners to handle more break
t._handleMoreBreak(ed, url);
},
// Look for <br> in <pre>, replace with \n
var startPos = -1;
while ((startPos = content.indexOf('<pre', startPos+1)) != -1) {
var endPos = content.indexOf('</pre>', startPos+1);
var innerPos = content.indexOf('>', startPos+1);
var chunkBefore = content.substring(0, innerPos);
var chunkAfter = content.substring(endPos);
getInfo : function() {
return {
longname : 'WordPress Plugin',
author : 'WordPress', // add Moxiecode?
authorurl : 'http://wordpress.org',
infourl : 'http://wordpress.org',
version : '1.0a1'
};
},
var innards = content.substring(innerPos, endPos);
innards = innards.replace(new RegExp('<br\\s?/?>', 'g'), '\n');
innards = innards.replace(new RegExp('\\s$', ''), '');
content = chunkBefore + innards + chunkAfter;
// Internal functions
// Resizes the iframe by a relative height value
_resizeIframe : function(ed, tb_id, dy) {
var ifr = ed.getContentAreaContainer().firstChild;
DOM.setStyle(ifr, 'height', ifr.clientHeight + dy); // Resize iframe
ed.theme.deltaHeight += dy; // For resize cookie
},
_handleMoreBreak : function(ed, url) {
var moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
var nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
// Load plugin specific CSS into editor
ed.onInit.add(function() {
ed.dom.loadCSS(url + '/css/content.css');
});
// Display morebreak instead if img in element path
ed.onPostRender.add(function() {
if (ed.theme.onResolveName) {
ed.theme.onResolveName.add(function(th, o) {
if (o.node.nodeName == 'IMG') {
if ( ed.dom.hasClass(o.node, 'mceWPmore') )
o.name = 'wpmore';
if ( ed.dom.hasClass(o.node, 'mceWPnextpage') )
o.name = 'wppage';
}
});
}
});
// Remove anonymous, empty paragraphs.
content = content.replace(new RegExp('<p>(\\s|&nbsp;)*</p>', 'mg'), '');
// Replace morebreak with images
ed.onBeforeSetContent.add(function(ed, o) {
o.content = o.content.replace(/<!--more(.*?)-->/g, moreHTML);
o.content = o.content.replace(/<!--nextpage-->/g, nextpageHTML);
});
// Handle table badness.
content = content.replace(new RegExp('<(table( [^>]*)?)>.*?<((tr|thead)( [^>]*)?)>', 'mg'), '<$1><$3>');
content = content.replace(new RegExp('<((?:tr|thead|tfoot)(?: [^>]*)?)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>');
content = content.replace(new RegExp('</(td|th)>.*?<(td( [^>]*)?|th( [^>]*)?|/tr|/thead|/tfoot)>', 'mg'), '</$1><$2>');
content = content.replace(new RegExp('</tr>.*?<(tr( [^>]*)?|/table)>', 'mg'), '</tr><$1>');
content = content.replace(new RegExp('<(/?(table|tbody|tr|th|td)[^>]*)>(\\s*|(<br ?/?>)*)*', 'g'), '<$1>');
// Replace images with morebreak
ed.onPostProcess.add(function(ed, o) {
if (o.get)
o.content = o.content.replace(/<img[^>]+>/g, function(im) {
if (im.indexOf('class="mceWPmore') !== -1) {
var m;
var moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : '';
// Pretty it up for the source editor.
var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre|p';
content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
content = content.replace(new RegExp('\\s*<(('+blocklist+')[^>]*)>', 'mg'), '\n<$1>');
content = content.replace(new RegExp('<((li|/?tr|/?thead|/?tfoot)( [^>]*)?)>', 'g'), '\t<$1>');
content = content.replace(new RegExp('<((td|th)( [^>]*)?)>', 'g'), '\t\t<$1>');
content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'mg'), '<br />\n');
content = content.replace(new RegExp('^\\s*', ''), '');
content = content.replace(new RegExp('\\s*$', ''), '');
im = '<!--more'+moretext+'-->';
}
if (im.indexOf('class="mceWPnextpage') !== -1)
im = '<!--nextpage-->';
break;
return im;
});
});
// Set active buttons if user selected pagebreak or more break
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPnextpage'));
cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPmore'));
});
}
});
// Pass through to next handler in chain
return content;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
tinyMCE.switchClass(editor_id + '_wp_more', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_wp_page', 'mceButtonNormal');
if (node == null)
return;
do {
if (node.nodeName.toLowerCase() == "img" && tinyMCE.getAttrib(node, 'class').indexOf('mce_plugin_wordpress_more') == 0)
tinyMCE.switchClass(editor_id + '_wp_more', 'mceButtonSelected');
if (node.nodeName.toLowerCase() == "img" && tinyMCE.getAttrib(node, 'class').indexOf('mce_plugin_wordpress_page') == 0)
tinyMCE.switchClass(editor_id + '_wp_page', 'mceButtonSelected');
} while ((node = node.parentNode));
return true;
},
saveCallback : function(el, content, body) {
// We have a TON of cleanup to do.
if ( tinyMCE.activeEditor.isHidden() ) {
// return content;
}
// Mark </p> if it has any attributes.
content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>');
// Decode the ampersands of time.
// content = content.replace(new RegExp('&amp;', 'g'), '&');
// Get it ready for wpautop.
content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');
// Fix some block element newline issues
var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre';
content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
content = content.replace(new RegExp('<li>', 'g'), '\t<li>');
if ( content.indexOf('<object') != -1 ) {
content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'g'), "<param$1>"); // no pee inside object/embed
content = content.replace(new RegExp('\\s*</embed>\\s*', 'g'), '</embed>');
}
// Unmark special paragraph closing tags
content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
content = content.replace(new RegExp('\\s*(<p[^>]+>.*</p>)', 'mg'), '\n$1');
// Trim trailing whitespace
content = content.replace(new RegExp('\\s*$', ''), '');
// Hope.
return content;
},
_parseAttributes : function(attribute_string) {
var attributeName = "";
var attributeValue = "";
var withInName;
var withInValue;
var attributes = new Array();
var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
var titleText = tinyMCE.getLang('lang_wordpress_more');
var titleTextPage = tinyMCE.getLang('lang_wordpress_page');
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("wordpress", TinyMCE_wordpressPlugin);
/* This little hack protects our More and Page placeholders from the removeformat command */
tinyMCE.orgExecCommand = tinyMCE.execCommand;
tinyMCE.execCommand = function (command, user_interface, value) {
re = this.orgExecCommand(command, user_interface, value);
if ( command == 'removeformat' ) {
var inst = tinyMCE.getInstanceById('mce_editor_0');
doc = inst.getDoc();
var imgs = doc.getElementsByTagName('img');
for (i=0;img=imgs[i];i++)
img.className = img.name;
}
return re;
};
wpInstTriggerSave = function (skip_cleanup, skip_callback) {
var e, nl = new Array(), i, s;
this.switchSettings();
s = tinyMCE.settings;
// Force hidden tabs visible while serializing
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
e = this.iframeElement;
do {
if (e.style && e.style.display == 'none') {
e.style.display = 'block';
nl[nl.length] = {elm : e, type : 'style'};
}
if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) {
e.className = s.display_tab_class;
nl[nl.length] = {elm : e, type : 'class'};
}
} while ((e = e.parentNode) != null)
}
tinyMCE.settings['preformatted'] = false;
// Default to false
if (typeof(skip_cleanup) == "undefined")
skip_cleanup = false;
// Default to false
if (typeof(skip_callback) == "undefined")
skip_callback = false;
// tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML);
// Remove visual aids when cleanup is disabled
if (this.settings['cleanup'] == false) {
tinyMCE.handleVisualAid(this.getBody(), true, false, this);
tinyMCE._setEventsEnabled(this.getBody(), true);
}
tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body);
tinyMCE.selectedInstance.getWin().oldfocus=tinyMCE.selectedInstance.getWin().focus;
tinyMCE.selectedInstance.getWin().focus=function() {};
var htm = tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true);
tinyMCE.selectedInstance.getWin().focus=tinyMCE.selectedInstance.getWin().oldfocus;
htm = tinyMCE._customCleanup(this, "submit_content", htm);
if (!skip_callback && tinyMCE.settings['save_callback'] != "")
var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());");
// Use callback content if available
if ((typeof(content) != "undefined") && content != null)
htm = content;
// Replace some weird entities (Bug: #1056343)
htm = tinyMCE.regexpReplace(htm, "&#40;", "(", "gi");
htm = tinyMCE.regexpReplace(htm, "&#41;", ")", "gi");
htm = tinyMCE.regexpReplace(htm, "&#59;", ";", "gi");
htm = tinyMCE.regexpReplace(htm, "&#34;", "&quot;", "gi");
htm = tinyMCE.regexpReplace(htm, "&#94;", "^", "gi");
if (this.formElement)
this.formElement.value = htm;
if (tinyMCE.isSafari && this.formElement)
this.formElement.innerText = htm;
// Hide them again (tabs in MSIE)
for (i=0; i<nl.length; i++) {
if (nl[i].type == 'style')
nl[i].elm.style.display = 'none';
else
nl[i].elm.className = s.hidden_tab_class;
}
}
tinyMCE.wpTriggerSave = function () {
var inst, n;
for (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
inst.wpTriggerSave = wpInstTriggerSave;
inst.wpTriggerSave(false, false);
}
}
function switchEditors(id) {
var inst = tinyMCE.getInstanceById(id);
var qt = document.getElementById('quicktags');
var H = document.getElementById('edButtonHTML');
var P = document.getElementById('edButtonPreview');
var ta = document.getElementById(id);
var pdr = ta.parentNode;
if ( ! inst.isHidden(id) ) {
edToggle(H, P);
if ( tinyMCE.isMSIE && !tinyMCE.isOpera ) {
// IE rejects the later overflow assignment so we skip this step.
// Alternate code might be nice. Until then, IE reflows.
} else {
// Lock the fieldset's height to prevent reflow/flicker
pdr.style.height = pdr.clientHeight + 'px';
pdr.style.overflow = 'hidden';
}
// Save the coords of the bottom right corner of the rich editor
var table = document.getElementById(inst.editorId + '_parent').getElementsByTagName('table')[0];
var y1 = table.offsetTop + table.offsetHeight;
if ( tinymce.util.Cookie.get("TinyMCE_" + inst.editorId + "_height") == null ) {
var expires = new Date();
expires.setTime(expires.getTime() + 3600000 * 24 * 30);
var offset = tinyMCE.isMSIE ? 1 : 2;
tinymce.util.Cookie.set("TinyMCE_" + inst.editorId + "_height", "" + (table.offsetHeight - offset), expires);
}
// Unload the rich editor
// inst.triggerSave(false, false);
// inst.formElement.value;
inst.hide(); // tinyMCE.removeMCEControl(id);
// document.getElementById(id).value = htm;
// --tinyMCE.idCounter;
// Reveal Quicktags and textarea
qt.style.display = 'block';
ta.style.display = 'inline';
// Set the textarea height to match the rich editor
y2 = ta.offsetTop + ta.offsetHeight;
ta.style.height = (ta.clientHeight + y1 - y2) + 'px';
// Tweak the widths
ta.parentNode.style.paddingRight = '12px';
if ( tinyMCE.isMSIE && !tinyMCE.isOpera ) {
} else {
// Unlock the fieldset's height
pdr.style.height = 'auto';
pdr.style.overflow = 'display';
}
wpSetDefaultEditor( 'html' );
} else {
edToggle(P, H);
edCloseAllTags(); // :-(
if ( tinyMCE.isMSIE && !tinyMCE.isOpera ) {
} else {
// Lock the fieldset's height
pdr.style.height = pdr.clientHeight + 'px';
pdr.style.overflow = 'hidden';
}
// Hide Quicktags and textarea
qt.style.display = 'none';
ta.style.display = 'none';
// Tweak the widths
ta.parentNode.style.paddingRight = '0px';
// Load the rich editor with formatted html
//if ( tinyMCE.isMSIE ) {
// ta.value = wpautop(ta.value);
// tinyMCE.addMCEControl(ta, id);
//} else {
ta.value = wpautop(ta.value);
inst.show() // tinyMCE.addMCEControl(ta, id);
//tinyMCE.getInstanceById(id).execCommand('mceSetContent', null, htm);
//}
if ( tinyMCE.isMSIE && !tinyMCE.isOpera ) {
} else {
// Unlock the fieldset's height
pdr.style.height = 'auto';
pdr.style.overflow = 'display';
}
wpSetDefaultEditor( 'tinymce' );
}
}
function edToggle(A, B) {
A.className = 'active';
B.className = '';
B.onclick = A.onclick;
A.onclick = null;
}
function wpSetDefaultEditor( editor ) {
try {
editor = escape( editor.toString() );
} catch(err) {
editor = 'tinymce';
}
var userID = document.getElementById('user-id');
var date = new Date();
date.setTime(date.getTime()+(10*365*24*60*60*1000));
document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString();
}
function wpautop(pee) {
pee = pee + "\n\n";
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
pee = pee.replace(new RegExp('(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)', 'gi'), "\n$1");
pee = pee.replace(new RegExp('(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)', 'gi'), "$1\n\n");
pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
pee = pee.replace(new RegExp('<p>\\s*?</p>', 'gi'), '');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
pee = pee.replace(new RegExp('<p><blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
pee = pee.replace(new RegExp('</blockquote></p>', 'gi'), '</p></blockquote>');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)', 'gi'), "$1");
pee = pee.replace(new RegExp('(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
pee = pee.replace(new RegExp('(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\\s*<br />', 'gi'), "$1");
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;');
//pee = pee.replace(new RegExp('(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' "); // Hmm...
return pee;
}
// Register plugin
tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress);
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@ -1,37 +1,8 @@
// EN lang variables
if (navigator.userAgent.indexOf('Mac OS') != -1) {
// Mac OS browsers use Ctrl to hit accesskeys
var metaKey = 'Ctrl';
}
else if (navigator.userAgent.indexOf('Firefox/2') != -1) {
// Firefox 2.x uses Alt+Shift to hit accesskeys
var metaKey = 'Alt+Shift';
}
else {
var metaKey = 'Alt';
}
tinyMCE.addI18n('',{
wordpress_more_button : 'Split post with More tag (' + metaKey + '+t)',
wordpress_page_button : 'Split post with Page tag',
wordpress_adv_button : 'Show/Hide Advanced Toolbar (' + metaKey + '+v)',
wordpress_more_alt : 'More...',
wordpress_page_alt : '...page...',
help_button_title : 'Help (' + metaKey + '+h)',
bold_desc : 'Bold (Ctrl+B)',
italic_desc : 'Italic (Ctrl+I)',
underline_desc : 'Underline (Ctrl+U)',
link_desc : 'Insert/edit link (' + metaKey + '+a)',
unlink_desc : 'Unlink (' + metaKey + '+s)',
image_desc : 'Insert/edit image (' + metaKey + '+m)',
striketrough_desc : 'Strikethrough (' + metaKey + '+k)',
justifyleft_desc : 'Align left (' + metaKey + '+f)',
justifycenter_desc : 'Align center (' + metaKey + '+c)',
justifyright_desc : 'Align right (' + metaKey + '+r)',
justifyfull_desc : 'Align full (' + metaKey + '+j)',
bullist_desc : 'Unordered list (' + metaKey + '+l)',
numlist_desc : 'Ordered list (' + metaKey + '+o)',
outdent_desc : 'Outdent (' + metaKey + '+w)',
indent_desc : 'Indent list/blockquote (' + metaKey + '+q)'
tinyMCE.addI18n('en.wordpress',{
wp_adv_desc : 'Show/Hide Advanced Toolbar',
wp_more_desc : 'Split post with More tag',
wp_page_desc : 'Split post with Page tag',
wp_help_desc : 'Help',
wp_more_alt : 'More...',
wp_page_alt : 'Next page...'
});

View File

@ -2,9 +2,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.anchor_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/anchor.js"></script>
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('anchorName').focus();},500);});</script>
<base target="_self" />
</head>
<body style="display: none">
<form onsubmit="AnchorDialog.update();return false;" action="#">
@ -20,11 +21,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#update}" onclick="AnchorDialog.update();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="{#update}" onclick="AnchorDialog.update();" />
</div>
</div>
</form>

View File

@ -7,7 +7,7 @@
<base target="_self" />
</head>
<body style="display: none">
<table align="center" border="0" cellspacing="0" cellpadding="2">
<table style="background:#fff;" align="center" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>
</tr>

File diff suppressed because one or more lines are too long

View File

@ -2,11 +2,12 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.image_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/image.js"></script>
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('src').focus();},500);});</script>
<base target="_self" />
</head>
<body id="image" style="display: none">
<form onsubmit="ImageDialog.update();return false;" action="#">
@ -74,11 +75,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.update();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.update();" />
</div>
</div>
</form>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

View File

@ -306,6 +306,7 @@ function insertChar(chr) {
if (tinyMCEPopup.isWindow)
window.focus();
tinyMCEPopup.editor.focus();
tinyMCEPopup.close();
}

View File

@ -2,12 +2,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.link_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="js/link.js"></script>
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('href').focus();},500);});</script>
<base target="_self" />
</head>
<body id="link" style="display: none">
<form onsubmit="LinkDialog.update();return false;" action="#">
@ -52,11 +53,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="LinkDialog.update();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="submit" id="insert" name="insert" value="{#insert}" onclick="LinkDialog.update();" />
</div>
</div>
</form>

View File

@ -1,4 +1,4 @@
body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px; }
body {background:#FFF;}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}

View File

@ -1,5 +1,5 @@
/* Reset */
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline}
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate}
.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
.defaultSkin table td {vertical-align:middle}
@ -23,7 +23,7 @@
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
.defaultSkin .mceStatusbar {position:relative; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; padding:2px; color:#000; display:block}
.defaultSkin .mceStatusbar a.resize {display:block; position:absolute; top:0; right:0; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px}
.defaultSkin .mceStatusbar a.resize {display:block; position:absolute; top:0; right:0; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
.defaultSkin table.mceToolbar {margin-left:3px}
.defaultSkin span.icon, .defaultSkin img.icon {display:block; width:20px; height:20px}

View File

@ -1,4 +1,4 @@
body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}

View File

@ -1,5 +1,5 @@
/* Reset */
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline}
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate}
.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
.o2k7Skin table td {vertical-align:middle}
@ -21,7 +21,7 @@
.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px;}
.o2k7Skin .mceStatusbar div {float:left; padding:2px;}
.o2k7Skin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px}
.o2k7Skin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
.o2k7Skin table.mceToolbar {margin-left:3px}
.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }

View File

@ -0,0 +1,19 @@
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
img {border:0;}
/* IE
* html body {
scrollbar-3dlight-color:#F0F0EE;
scrollbar-arrow-color:#676662;
scrollbar-base-color:#F0F0EE;
scrollbar-darkshadow-color:#DDD;
scrollbar-face-color:#E0E0DD;
scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
}
*/

View File

@ -0,0 +1,117 @@
/* Generic */
body {
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
/*scrollbar-3dlight-color:#F0F0EE;
scrollbar-arrow-color:#676662;
scrollbar-base-color:#F0F0EE;
scrollbar-darkshadow-color:#DDDDDD;
scrollbar-face-color:#E0E0DD;
scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;*/
background:#eaf3ea;
padding:0;
margin:8px 8px 0 8px;
}
html {background:#eaf3ea;}
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
textarea {resize:none;outline:none;}
a:link, a:visited {color:black;}
a:hover {color:#2B6FB6;}
/* Forms */
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
legend {color:#2B6FB6; font-weight:bold;}
label.msg {display:none;}
label.invalid {color:#EE0000; display:inline;}
input.invalid {border:1px solid #EE0000;}
input {background:#FFF; border:1px solid #CCC;}
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
input, select, textarea {border:1px solid #808080;}
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
.input_noborder {border:0;}
/* Buttons */
#insert, #cancel, input.button, .updateButton {
border: 1px solid #bbb;
margin:0;
padding:0 0 1px;
font-weight:bold;
font-size: 11px;
width:94px;
height:24px;
background:url(img/fade-butt.png) 0 0;
cursor:pointer;
}
#insert:hover, #cancel:hover, input.button:hover, .updateButton:hover,
#insert:focus, #cancel:focus, input.button:focus, .updateButton:focus {
border: 1px solid #555;
}
/*#insert {background:url(img/fade-butt.png) 0 0;}
#cancel {background:url(img/fade-butt.png) 0 0;}*/
/* Browse */
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
.mceOldBoxModel a.browse span {width:22px; height:20px;}
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);}
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
a.pickcolor:hover span {background-color:#B2BBD0;}
a.pickcolor:hover span.disabled {}
/* Charmap */
table.charmap {border-style:solid; border-width:1px; border-color:#AAA;}
td.charmap, td.charmapOver {color:#000; border-color:#AAA; border-style:solid; border-width:1px; text-align:center; font-size:12px;}
td.charmapOver {background:#CCC; cursor:default;}
a.charmap {color:#000; text-decoration:none}
/* Source */
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
.mceActionPanel {margin-top:5px;background:transparent;}
/* Tabs classes */
.tabs {width:100%; height:18px; line-height:normal; background: #eaf3ea url(../default/img/tabs.gif) repeat-x 0 -72px;}
.tabs ul {margin:0; padding:0; list-style:none;}
.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:18px;}
.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */
.column {float:left;}
.properties {width:100%;}
.properties .column1 {}
.properties .column2 {text-align:left;}
/* Titles */
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
h3 {font-size:14px;}
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
/* Dialog specific */
#link .panel_wrapper, #link div.current {height:125px;}
#image .panel_wrapper, #image div.current {height:200px;}
#plugintable thead {font-weight:bold; background:#DDD;}
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
#plugintable {width:96%; margin-top:10px;}
#pluginscontainer {height:290px; overflow:auto;}
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
#colorpicker #light div {overflow:hidden;}
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
#colorpicker .panel_wrapper div.current {height:175px;}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
#colorpicker #colornamecontainer {margin-top:5px;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 B

View File

@ -0,0 +1,322 @@
/* Reset */
.wp_themeSkin table, .wp_themeSkin tbody, .wp_themeSkin a, .wp_themeSkin img, .wp_themeSkin tr, .wp_themeSkin div, .wp_themeSkin td, .wp_themeSkin iframe, .wp_themeSkin span, .wp_themeSkin *, .wp_themeSkin .text {
border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate;
}
.wp_themeSkin a:hover, .wp_themeSkin a:link, .wp_themeSkin a:visited, .wp_themeSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
.wp_themeSkin table td {vertical-align:middle}
/* Containers */
.wp_themeSkin table {background:#cee1ef}
.wp_themeSkin iframe {display:block; background:#FFF}
.wp_themeSkin .mceToolbar {}
/* External */
.wp_themeSkin .mceExternalToolbar {position:absolute; border:1px solid #ddd; border-bottom:0; display:none}
.wp_themeSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
.wp_themeSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
/* Layout */
.wp_themeSkin table.mceToolbar, .wp_themeSkin tr.first .mceToolbar tr td, .wp_themeSkin tr.last .mceToolbar tr td {border:0; margin:0; padding:0}
.wp_themeSkin table.mceLayout {border:0;}
.wp_themeSkin .mceIframeContainer {}
.wp_themeSkin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px;background-color: #eaf3fa;}
.wp_themeSkin .mceStatusbar div {float:left; padding:2px;}
.wp_themeSkin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
.wp_themeSkin .mceStatusbar a:hover {text-decoration:underline}
.wp_themeSkin table.mceToolbar {margin: 0 3px 3px;}
.wp_themeSkin #content_toolbar1 {margin-top: 3px;}
/*
.wp_themeSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
.wp_themeSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
*/
.wp_themeSkin .mceToolbar .mceToolbarEndListBox span {display:none}
.wp_themeSkin span.icon, .wp_themeSkin img.icon {display:block; width:20px; height:20px}
.wp_themeSkin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px}
/* Button */
.wp_themeSkin .mceButton {
display:block;
width: 20px;
height: 20px;
cursor: default;
padding: 1px 2px;
margin: 1px;
background: #e9e8e8 url(img/butt2.png) 1px 1px no-repeat scroll;
-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: 1px solid #ccc;
}
.wp_themeSkin a.mceButton span, .wp_themeSkin a.mceButton img {}
.wp_themeSkin .mceOldBoxModel a.mceButton span, .wp_themeSkin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}
.wp_themeSkin a.mceButtonEnabled:hover {background-color:#D1D2D4; background-position:0 -20px;border: 1px solid #6779AA !important;}
.wp_themeSkin a.mceButtonActive, .wp_themeSkin a.mceButtonSelected {background-position:0 -20px;border: 1px solid #6779AA !important; background: #D1D2D4;}
.wp_themeSkin .mceButtonDisabled .icon {opacity:0.3; filter:alpha(opacity=30);}
/* Separator */
.wp_themeSkin .mceSeparator {
height: 24px;
width: 1px;
display: block;
background: transparent;
overflow: hidden;
margin: 0 2px;
}
/* ListBox */
.wp_themeSkin .mceListBox, .wp_themeSkin .mceListBox a {display:block}
.wp_themeSkin .mceListBox .text {
padding: 1px 2px 1px 5px;
-moz-border-radius-bottomleft: 4px; -webkit-border-radius-bottomleft: 4px; border-radius-bottomleft: 4px;
-moz-border-radius-topleft: 4px; -webkit-border-radius-topleft: 4px; border-radius-topleft: 4px;
border: 1px solid #ccc;
text-align:left;
width:70px;
border-right:0;
background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll;
font-family:Tahoma,Verdana,Arial,Helvetica;
font-size:11px;
height:20px;
line-height:20px;
overflow:hidden;
}
.wp_themeSkin .mceListBox {
margin: 1px;
}
.wp_themeSkin .mceListBox .open {
width:14px;
height:20px;
border-collapse:separate;
background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll;
padding: 1px;
-moz-border-radius-bottomright: 4px; -webkit-border-radius-bottomright: 4px; border-radius-bottomright: 4px;
-moz-border-radius-topright: 4px; -webkit-border-radius-topright: 4px; border-radius-topright: 4px;
border: 1px solid #ccc;
}
.wp_themeSkin .mceListBox .open span {
display: block;
width:14px;
height:20px;
background:url(img/down_arrow.gif) 2px 1px no-repeat;
}
.wp_themeSkin table.mceListBoxEnabled:hover .text,
.wp_themeSkin .mceListBoxHover .text,
.wp_themeSkin .mceListBoxSelected .text {
background:#eae8ea;
border-collapse:separate;
border: 1px solid #6779AA !important;
border-right: 0 none !important;
}
.wp_themeSkin table.mceListBoxEnabled:hover .open,
.wp_themeSkin .mceListBoxHover .open,
.wp_themeSkin .mceListBoxSelected .open {
background: #ccc;
border: 1px solid #6779AA !important;
}
.wp_themeSkin .mceListBoxDisabled .text {color:gray}
.wp_themeSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
.wp_themeSkin .mceOldBoxModel .mceListBox .text {height:22px}
.wp_themeSkin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
/* SplitButton */
.wp_themeSkin .mceSplitButton a, .wp_themeSkin .mceSplitButton span {display:block; height:20px}
.wp_themeSkin .mceSplitButton {
display:block;
margin: 1px;
}
.wp_themeSkin table.mceSplitButton td {
padding: 2px;
}
.wp_themeSkin .mceSplitButton a.action {
height:20px;
width:20px;
background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll;
padding: 1px 2px;
-moz-border-radius-bottomleft: 4px; -webkit-border-radius-bottomleft: 4px; border-radius-bottomleft: 4px;
-moz-border-radius-topleft: 4px; -webkit-border-radius-topleft: 4px; border-radius-topleft: 4px;
border: 1px solid #ccc;
}
.wp_themeSkin .mceSplitButton span.action {
background: url(../../img/icons.gif) 20px 20px;
width:20px;
}
.wp_themeSkin .mceSplitButton a.open {
width:10px;
height:20px;
border-collapse:separate;
background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll;
padding: 1px;
-moz-border-radius-bottomright: 4px; -webkit-border-radius-bottomright: 4px; border-radius-bottomright: 4px;
-moz-border-radius-topright: 4px; -webkit-border-radius-topright: 4px; border-radius-topright: 4px;
border: 1px solid #ccc;
border-left: 0 none;
}
.wp_themeSkin .mceSplitButton span.open {
width:10px;
background:url(img/down_arrow.gif) 0px 1px;
}
.wp_themeSkin .mceSplitButton a.open:hover,
.wp_themeSkin .mceSplitButtonSelected a.open {
background: #ccc;
border-collapse:separate;
border: 1px solid #6779AA !important;
border-left: 0 none !important;
}
.wp_themeSkin table.mceSplitButtonEnabled:hover a.action {
background: #ccc;
border: 1px solid #6779AA !important;
}
.wp_themeSkin .mceSplitButtonHover a.action,
.wp_themeSkin .mceSplitButtonSelected {
}
.wp_themeSkin table.mceSplitButtonEnabled:hover span.open,
.wp_themeSkin .mceSplitButtonHover span.open,
.wp_themeSkin .mceSplitButtonSelected span.open {
}
.wp_themeSkin .mceSplitButtonDisabled .action {
opacity:0.3; filter:alpha(opacity=30)
}
.wp_themeSkin .mceSplitButtonActive {
background: #D1D2D4;
}
/* ColorSplitButton */
.wp_themeSkin div.mceColorSplitMenu table {background:#ebeaeb; border:1px solid gray}
.wp_themeSkin .mceColorSplitMenu td {padding:2px}
.wp_themeSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
.wp_themeSkin .mceColorSplitMenu td.morecolors {padding:1px 3px 1px 1px}
.wp_themeSkin .mceColorSplitMenu a.morecolors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
.wp_themeSkin .mceColorSplitMenu a.morecolors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
.wp_themeSkin a.mceMoreColors:hover {border:1px solid #0A246A}
.wp_themeSkin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden}
/* Menu */
.wp_themeSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ddd}
.wp_themeSkin .noIcons span.icon {width:0;}
.wp_themeSkin .noIcons a .text {padding-left:10px}
.wp_themeSkin .mceMenu table {background:#ebeaeb}
.wp_themeSkin .mceMenu a, .wp_themeSkin .mceMenu span, .wp_themeSkin .mceMenu {display:block}
.wp_themeSkin .mceMenu td {height:20px}
.wp_themeSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
.wp_themeSkin .mceMenu .text {
position:relative;
display:block;
font-family:Tahoma,Verdana,Arial,Helvetica;
color:#000;
cursor:default;
margin:0;
padding:0 25px 0 25px;
display:block
}
.wp_themeSkin .mceMenu span.text, .wp_themeSkin .mceMenu .preview {font-size:11px}
.wp_themeSkin .mceMenu pre.text {font-family:Monospace}
.wp_themeSkin .mceMenu .icon {position:absolute; top:0; left:0; width:22px;}
.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
.wp_themeSkin .mceMenu .mceMenuItemActive {
background-color: #CEE1EF;
}
.wp_themeSkin td.mceMenuItemSeparator {background:#aaa; height:1px}
.wp_themeSkin .mceMenuItemTitle a {
border:0;
background:#ccc;
border-bottom:1px solid #aaa;
}
.wp_themeSkin .mceMenuItemTitle span.text {color:#000; font-weight:bold; padding-left:4px}
.wp_themeSkin .mceMenuItemDisabled .text {color:#888}
.wp_themeSkin .mceMenuItemSelected .icon {background:url(../default/img/menu_check.gif)}
.wp_themeSkin .noIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
.wp_themeSkin .mceMenu span.mceMenuLine {display:none}
.wp_themeSkin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
/* Progress,Resize */
.wp_themeSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; filter:alpha(opacity=50); background:#FFF}
.wp_themeSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
.wp_themeSkin .mcePlaceHolder {border:1px dotted gray}
/* Theme */
.wp_themeSkin span.bold {background-position:0 0}
.wp_themeSkin span.italic {background-position:-60px 0}
.wp_themeSkin span.underline {background-position:-140px 0}
.wp_themeSkin span.strikethrough {background-position:-120px 0}
.wp_themeSkin span.undo {background-position:-160px 0}
.wp_themeSkin span.redo {background-position:-100px 0}
.wp_themeSkin span.cleanup {background-position:-40px 0}
.wp_themeSkin span.bullist {background-position:-20px 0}
.wp_themeSkin span.numlist {background-position:-80px 0}
.wp_themeSkin span.justifyleft {background-position:-460px 0}
.wp_themeSkin span.justifyright {background-position:-480px 0}
.wp_themeSkin span.justifycenter {background-position:-420px 0}
.wp_themeSkin span.justifyfull {background-position:-440px 0}
.wp_themeSkin span.anchor {background-position:-200px 0}
.wp_themeSkin span.indent {background-position:-400px 0}
.wp_themeSkin span.outdent {background-position:-540px 0}
.wp_themeSkin span.link {background-position:-500px 0}
.wp_themeSkin span.unlink {background-position:-640px 0}
.wp_themeSkin span.sub {background-position:-600px 0}
.wp_themeSkin span.sup {background-position:-620px 0}
.wp_themeSkin span.removeformat {background-position:-580px 0}
.wp_themeSkin span.newdocument {background-position:-520px 0}
.wp_themeSkin span.image {background-position:-380px 0}
.wp_themeSkin span.help {background-position:-340px 0}
.wp_themeSkin span.code {background-position:-260px 0}
.wp_themeSkin span.hr {background-position:-360px 0}
.wp_themeSkin span.visualaid {background-position:-660px 0}
.wp_themeSkin span.charmap {background-position:-240px 0}
.wp_themeSkin span.paste {background-position:-560px 0}
.wp_themeSkin span.copy {background-position:-700px 0}
.wp_themeSkin span.cut {background-position:-680px 0}
.wp_themeSkin span.blockquote {background-position:-220px 0}
.wp_themeSkin .forecolor span.action {background-position:-720px 0}
.wp_themeSkin .backcolor span.action {background-position:-760px 0}
.wp_themeSkin .forecolorpicker {background-position:-720px 0}
.wp_themeSkin .backcolorpicker {background-position:-760px 0}
/* Plugins */
.wp_themeSkin span.advhr {background-position:-0px -20px}
.wp_themeSkin span.ltr {background-position:-20px -20px}
.wp_themeSkin span.rtl {background-position:-40px -20px}
.wp_themeSkin span.emotions {background-position:-60px -20px}
.wp_themeSkin span.fullpage {background-position:-80px -20px}
.wp_themeSkin span.fullscreen {background-position:-100px -20px}
.wp_themeSkin span.iespell {background-position:-120px -20px}
.wp_themeSkin span.insertdate {background-position:-140px -20px}
.wp_themeSkin span.inserttime {background-position:-160px -20px}
.wp_themeSkin span.absolute {background-position:-180px -20px}
.wp_themeSkin span.backward {background-position:-200px -20px}
.wp_themeSkin span.forward {background-position:-220px -20px}
.wp_themeSkin span.insert_layer {background-position:-240px -20px}
.wp_themeSkin span.insertlayer {background-position:-260px -20px}
.wp_themeSkin span.movebackward {background-position:-280px -20px}
.wp_themeSkin span.moveforward {background-position:-300px -20px}
.wp_themeSkin span.media {background-position:-320px -20px}
.wp_themeSkin span.nonbreaking {background-position:-340px -20px}
.wp_themeSkin span.pastetext {background-position:-360px -20px}
.wp_themeSkin span.pasteword {background-position:-380px -20px}
.wp_themeSkin span.selectall {background-position:-400px -20px}
.wp_themeSkin span.preview {background-position:-420px -20px}
.wp_themeSkin span.print {background-position:-440px -20px}
.wp_themeSkin span.cancel {background-position:-460px -20px}
.wp_themeSkin span.save {background-position:-480px -20px}
.wp_themeSkin span.replace {background-position:-500px -20px}
.wp_themeSkin span.search {background-position:-520px -20px}
.wp_themeSkin span.styleprops {background-position:-560px -20px}
.wp_themeSkin span.table {background-position:-580px -20px}
.wp_themeSkin span.cell_props {background-position:-600px -20px}
.wp_themeSkin span.delete_table {background-position:-620px -20px}
.wp_themeSkin span.delete_col {background-position:-640px -20px}
.wp_themeSkin span.delete_row {background-position:-660px -20px}
.wp_themeSkin span.col_after {background-position:-680px -20px}
.wp_themeSkin span.col_before {background-position:-700px -20px}
.wp_themeSkin span.row_after {background-position:-720px -20px}
.wp_themeSkin span.row_before {background-position:-740px -20px}
.wp_themeSkin span.merge_cells {background-position:-760px -20px}
.wp_themeSkin span.table_props {background-position:-980px -20px}
.wp_themeSkin span.row_props {background-position:-780px -20px}
.wp_themeSkin span.split_cells {background-position:-800px -20px}
.wp_themeSkin span.template {background-position:-820px -20px}
.wp_themeSkin span.visualchars {background-position:-840px -20px}
.wp_themeSkin span.abbr {background-position:-860px -20px}
.wp_themeSkin span.acronym {background-position:-880px -20px}
.wp_themeSkin span.attribs {background-position:-900px -20px}
.wp_themeSkin span.cite {background-position:-920px -20px}
.wp_themeSkin span.del {background-position:-940px -20px}
.wp_themeSkin span.ins {background-position:-960px -20px}
.wp_themeSkin span.pagebreak {background-position:0 -40px}
.wp_themeSkin .spellchecker span.action {background-position:-540px -20px}

View File

@ -2,9 +2,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#advanced_dlg.code_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/source_editor.js"></script>
<base target="_self" />
<script type="text/javascript">tinyMCEPopup.onInit.add(function(){window.setTimeout(function(){document.getElementById('htmlSource').focus();},500);});</script>
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();" action="#">
@ -20,11 +21,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" name="insert" value="{#update}" onclick="saveContent();" id="insert" />
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
</div>
<div style="float: right">
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
<input type="submit" name="insert" value="{#update}" onclick="saveContent();" id="insert" />
</div>
</div>
</form>

File diff suppressed because one or more lines are too long

View File

@ -25,59 +25,46 @@
$valid_elements = '*[*]';
$valid_elements = apply_filters('mce_valid_elements', $valid_elements);
$invalid_elements = apply_filters('mce_invalid_elements', '');
$invalid_elements = apply_filters('mce_invalid_elements', '');
$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'wphelp', 'media', 'fullscreen' );
$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
$plugins = apply_filters('mce_plugins', $plugins);
$plugins = implode($plugins, ',');
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'image', 'wp_more', 'separator', 'spellchecker', 'separator', 'wp_help', 'wp_adv', 'wp_adv_start', 'wp_adv_end'));
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'outdent', 'indent', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', '|', 'wp_help', 'wp_adv' ));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', 'media', 'separator', 'pastetext', 'pasteword', 'separator', 'removeformat', 'cleanup', 'separator', 'charmap', 'separator', 'undo', 'redo', 'fullscreen'));
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', '|', 'removeformat', 'cleanup', '|', 'media', 'charmap', 'blockquote', '|', 'undo', 'redo', 'fullscreen' ));
$mce_buttons_2 = implode($mce_buttons_2, ',');
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
$mce_buttons_3 = implode($mce_buttons_3, ',');
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
$mce_buttons_4 = implode($mce_buttons_4, ',');
$mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera', 'safari'));
$mce_browsers = implode($mce_browsers, ',');
$mce_popups_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/popups.css';
$mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css';
$mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/wordpress.css';
$mce_css = apply_filters('mce_css', $mce_css);
if ( $_SERVER['HTTPS'] == 'on' ) {
if ( $_SERVER['HTTPS'] == 'on' )
$mce_css = str_replace('http://', 'https://', $mce_css);
$mce_popups_css = str_replace('http://', 'https://', $mce_popups_css);
}
$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale());
?>
/*
wpEditorInit = function() {
// Activate tinyMCE if it's the user's default editor
if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor )
tinyMCE.execCommand('mceAddControl', false, 'content');
};
*/
wpEditorInit = function() {
if ( ( 'undefined' != typeof wpTinyMCEConfig ) && 'tinymce' != wpTinyMCEConfig.defaultEditor )
tinyMCE.get('content').hide();
}
initArray = {
mode : "exact",
elements : "content",
// editor_selector : "mceEditor",
oninit : "wpEditorInit",
width : "100%",
mode : "none",
onpageload : "wpEditorInit",
width : "100%",
theme : "advanced",
skin : "o2k7",
skin : "wp_theme",
theme_advanced_buttons1 : "<?php echo $mce_buttons; ?>",
theme_advanced_buttons2 : "<?php echo $mce_buttons_2; ?>",
theme_advanced_buttons3 : "<?php echo $mce_buttons_3; ?>",
theme_advanced_buttons4 : "<?php echo $mce_buttons_4; ?>",
language : "<?php echo $mce_locale; ?>",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
@ -94,14 +81,15 @@ initArray = {
convert_newlines_to_brs : false,
remove_linebreaks : false,
fix_list_elements : true,
fix_table_elements : true,
gecko_spellcheck : true,
entities : "38,amp,60,lt,62,gt",
button_tile_map : false,
accessibility_focus : false,
tab_focus : ":next",
content_css : "<?php echo $mce_css; ?>",
valid_elements : "<?php echo $valid_elements; ?>",
invalid_elements : "<?php echo $invalid_elements; ?>",
save_callback : 'TinyMCE_wordpressPlugin.saveCallback',
imp_version : "<?php echo intval($_GET['ver']); ?>",
<?php if ( $valid_elements ) echo 'valid_elements : "' . $valid_elements . '",' . "\n"; ?>
<?php if ( $invalid_elements ) echo 'invalid_elements : "' . $invalid_elements . '",' . "\n"; ?>
save_callback : "switchEditors.saveCallback",
<?php do_action('mce_options'); ?>
plugins : "<?php echo $plugins; ?>"
};
@ -112,4 +100,4 @@ initArray = {
do_action('tinymce_before_init');
?>
tinyMCE.init(initArray);
tinyMCE_GZ.init(initArray);

View File

@ -1,181 +1,216 @@
<?php
/**
* $Id: tiny_mce_gzip.php 158 2006-12-21 14:32:19Z spocke $
* $Id: tiny_mce_gzip.php 315 2007-10-25 14:03:43Z spocke $
*
* @author Moxiecode
* @copyright Copyright 2005-2006, Moxiecode Systems AB, All rights reserved.
* @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
*
* This file compresses the TinyMCE JavaScript using GZip and
* enables the browser to do two requests instead of one for each .js file.
* Notice: This script defaults the button_tile_map option to true for extra performance.
*/
//error_reporting(E_ALL);
@require_once('../../../wp-config.php'); // For get_bloginfo().
?>
var scriptURL = '<?php echo get_bloginfo('wpurl') . '/' . WPINC; ?>/js/tinymce/tiny_mce.js';
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + scriptURL + '"></script>');
<?php
exit; // tiny_mce_gzip.php needs changes, but also it's much easier to test the js when it's not in one big file
// Get input
$plugins = explode(',', getParam("plugins", ""));
$languages = explode(',', getParam("languages", ""));
$themes = explode(',', getParam("themes", ""));
$diskCache = getParam("diskcache", "") == "true";
$isJS = getParam("js", "") == "true";
$compress = getParam("compress", "true") == "true";
$suffix = getParam("suffix", "_src") == "_src" ? "_src" : "";
$cachePath = realpath("."); // Cache path, this is where the .gz files will be stored
$expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
$content = "";
$encodings = array();
$supportsGzip = false;
$enc = "";
$cacheKey = "";
// Custom extra javascripts to pack
$custom = array(/*
"some custom .js file",
"some custom .js file"
*/);
// WP
$index = getParam("index", -1);
$theme = getParam("theme", "");
$themes = array($theme);
$language = getParam("language", "en");
if ( empty($language) )
$language = 'en';
$languages = array($language);
if ( $language != strtolower($language) )
$languages[] = strtolower($language);
if ( $language != substr($language, 0, 2) )
$languages[] = substr($language, 0, 2);
$diskCache = false;
$isJS = true;
$suffix = '';
// Headers
header("Content-Type: text/javascript; charset=" . get_bloginfo('charset'));
// Headers
$expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
header("Content-type: text/javascript");
header("Vary: Accept-Encoding"); // Handle proxies
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
if ( isset($_GET['load']) ) {
function getParam( $name, $def = false ) {
if ( ! isset($_GET[$name]) )
return $def;
return preg_replace( "/[^0-9a-z\-_,]+/i", "", $_GET[$name] ); // Remove anything but 0-9,a-z,-_
}
function getFileContents($path) {
$path = realpath($path);
if ( !$path || !@is_file($path) )
return '';
if ( function_exists('file_get_contents') )
return @file_get_contents($path);
$content = '';
$fp = @fopen( $path, 'r' );
if (!$fp)
return '';
while ( ! feof($fp) )
$content .= fgets($fp);
fclose($fp);
return $content;
}
function putFileContents( $path, $content ) {
if ( function_exists('file_put_contents') )
return @file_put_contents($path, $content);
$fp = @fopen($path, 'wb');
if ($fp) {
fwrite($fp, $content);
fclose($fp);
}
}
// Get input
$plugins = explode( ',', getParam('plugins', '') );
$languages = explode( ',', getParam('languages', '') );
$themes = explode( ',', getParam('themes', '') );
$diskCache = getParam( 'diskcache', '' ) == 'true';
$isJS = getParam( 'js', '' ) == 'true';
$compress = getParam( 'compress', 'true' ) == 'true';
$core = getParam( 'core', 'true' ) == 'true';
$suffix = getParam( 'suffix', '_src' ) == '_src' ? '_src' : '';
$cachePath = realpath('.'); // Cache path, this is where the .gz files will be stored
$content = '';
$encodings = array();
$supportsGzip = false;
$enc = '';
$cacheKey = '';
// WP. Language handling could be improved... Concat all translated langs files and store in /wp-content/languages as .mo?
$theme = getParam( 'theme', 'advanced' );
$themes = array($theme);
$language = getParam( 'language', 'en' );
$languages = array($language);
if ( $language != strtolower($language) )
$languages[] = strtolower($language);
if ( $language != substr($language, 0, 2) )
$languages[] = substr($language, 0, 2);
$diskCache = false;
$isJS = true;
$suffix = '';
// Custom extra javascripts to pack
// WP - add a hook for external plugins to be compressed too?
$custom = array(/*
'some custom .js file',
'some custom .js file'
*/);
// Is called directly then auto init with default settings
if (!$isJS) {
echo getFileContents("tiny_mce_gzip.js");
echo "tinyMCE_GZ.init({});";
if ( ! $isJS ) {
echo getFileContents('tiny_mce_gzip.js');
echo 'tinyMCE_GZ.init({});';
die();
}
// Setup cache info
if ($diskCache) {
if (!$cachePath)
die("alert('Real path failed.');");
// Setup cache info
if ( $diskCache ) {
if ( ! $cachePath )
die('Real path failed.');
$cacheKey = getParam("plugins", "") . getParam("languages", "") . getParam("themes", "");
$cacheKey = getParam( 'plugins', '' ) . getParam( 'languages', '' ) . getParam( 'themes', '' ) . $suffix;
foreach ($custom as $file)
foreach ( $custom as $file )
$cacheKey .= $file;
$cacheKey = md5($cacheKey);
if ($compress)
$cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".gz";
if ( $compress )
$cacheFile = $cachePath . '/tiny_mce_' . $cacheKey . '.gz';
else
$cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".js";
$cacheFile = $cachePath . '/tiny_mce_' . $cacheKey . '.js';
}
// Check if it supports gzip
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
$encodings = explode( ',', strtolower( preg_replace('/\s+/', '', $_SERVER['HTTP_ACCEPT_ENCODING']) ) );
if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler') {
$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
if ( ( in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------']) ) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression') ) {
$enc = in_array( 'x-gzip', $encodings ) ? 'x-gzip' : 'gzip';
$supportsGzip = true;
}
// Use cached file disk cache
if ($diskCache && $supportsGzip && file_exists($cacheFile)) {
if ($compress)
header("Content-Encoding: " . $enc);
if ( $diskCache && $supportsGzip && file_exists($cacheFile) ) {
if ( $compress )
header('Content-Encoding: ' . $enc);
echo getFileContents($cacheFile);
die();
}
if ($index > -1) {
// Write main script and patch some things
if ( $index == 0 ) {
// Add core
$content .= wp_compact_tinymce_js(getFileContents("tiny_mce" . $suffix . ".js"));
$content .= 'TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;';
$content .= 'TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;';
} else
$content .= 'tinyMCE = realTinyMCE;';
// Add core
if ( $core == 'true' ) {
$content .= getFileContents('tiny_mce' . $suffix . '.js');
// Patch loading functions
//$content .= "tinyMCE_GZ.start();";
// Do init based on index
$content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);";
// Load external plugins
if ( $index == 0 )
$content .= "tinyMCECompressed.loadPlugins();";
// Patch loading functions
$content .= 'tinyMCE_GZ.start();';
}
// Add core languages
$lang_content = '';
foreach ($languages as $lang)
$lang_content .= getFileContents("langs/" . $lang . ".js");
if ( empty($lang_content) )
$lang_content .= getFileContents("langs/en.js");
$content .= $lang_content;
foreach ( $languages as $lang )
$lang_content .= getFileContents('langs/' . $lang . '.js');
if ( empty($lang_content) && file_exists('langs/en.js') )
$lang_content .= getFileContents('langs/en.js');
$content .= $lang_content;
// Add themes
foreach ($themes as $theme) {
$content .= wp_compact_tinymce_js(getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js"));
foreach ( $themes as $theme ) {
$content .= getFileContents( 'themes/' . $theme . '/editor_template' . $suffix . '.js');
$lang_content = '';
foreach ($languages as $lang)
$lang_content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js");
if ( empty($lang_content) )
$lang_content .= getFileContents("themes/" . $theme . "/langs/en.js");
$content .= $lang_content;
foreach ( $languages as $lang )
$lang_content .= getFileContents( 'themes/' . $theme . '/langs/' . $lang . '.js' );
if ( empty($lang_content) && file_exists( 'themes/' . $theme . '/langs/en.js' ) )
$lang_content .= getFileContents( 'themes/' . $theme . '/langs/en.js' );
$content .= $lang_content;
}
// Add plugins
foreach ($plugins as $plugin) {
$content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
foreach ( $plugins as $plugin ) {
$content .= getFileContents('plugins/' . $plugin . '/editor_plugin' . $suffix . '.js');
$lang_content = '';
foreach ($languages as $lang)
$lang_content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js");
if ( empty($lang_content) )
$lang_content .= getFileContents("plugins/" . $plugin . "/langs/en.js");
$content .= $lang_content;
foreach ( $languages as $lang )
$lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/' . $lang . '.js' );
if ( empty($lang_content) && file_exists( 'plugins/' . $plugin . '/langs/en.js' ) )
$lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/en.js' );
$content .= $lang_content;
}
// Add custom files
foreach ($custom as $file)
foreach ( $custom as $file )
$content .= getFileContents($file);
// Reset tinyMCE compressor engine
$content .= "tinyMCE = tinyMCECompressed;";
// Restore loading functions
//$content .= "tinyMCE_GZ.end();";
if ( $core == 'true' )
$content .= 'tinyMCE_GZ.end();';
// Generate GZIP'd content
if ($supportsGzip) {
if ($compress) {
header("Content-Encoding: " . $enc);
$cacheData = gzencode($content, 9, FORCE_GZIP);
if ( $supportsGzip ) {
if ( $compress ) {
header('Content-Encoding: ' . $enc);
$cacheData = gzencode( $content, 9, FORCE_GZIP );
} else
$cacheData = $content;
// Write gz file
if ($diskCache && $cacheKey != "")
putFileContents($cacheFile, $cacheData);
if ( $diskCache && $cacheKey != '' )
putFileContents( $cacheFile, $cacheData );
// Stream to client
echo $cacheData;
@ -184,183 +219,205 @@ if ($index > -1) {
echo $content;
}
die;
exit;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function getParam($name, $def = false) {
if (!isset($_GET[$name]))
return $def;
return preg_replace("/[^0-9a-z\-_,]+/i", "", $_GET[$name]); // Remove anything but 0-9,a-z,-_
}
function getFileContents($path) {
$path = realpath($path);
if (!$path || !@is_file($path))
return "";
if (function_exists("file_get_contents"))
return @file_get_contents($path);
$content = "";
$fp = @fopen($path, "r");
if (!$fp)
return "";
while (!feof($fp))
$content .= fgets($fp);
fclose($fp);
return $content;
}
function putFileContents($path, $content) {
if (function_exists("file_put_contents"))
return @file_put_contents($path, $content);
$fp = @fopen($path, "wb");
if ($fp) {
fwrite($fp, $content);
fclose($fp);
}
}
// WP specific
function wp_compact_tinymce_js($text) {
// This function was custom-made for TinyMCE 2.0, not expected to work with any other JS.
// Strip comments
$text = preg_replace("!(^|\s+)//.*$!m", '', $text);
$text = preg_replace("!/\*.*?\*/!s", '', $text);
// Strip leading tabs, carriage returns and unnecessary line breaks.
$text = preg_replace("!^\t+!m", '', $text);
$text = str_replace("\r", '', $text);
$text = preg_replace("!(^|{|}|;|:|\))\n!m", '\\1', $text);
return "$text\n";
}
?>
function TinyMCECompressed() {
this.configs = new Array();
this.loadedFiles = new Array();
this.externalPlugins = new Array();
this.loadAdded = false;
this.isLoaded = false;
}
var tinyMCEPreInit = {suffix : ''};
TinyMCECompressed.prototype.init = function(settings) {
var elements = document.getElementsByTagName('script');
var scriptURL = "";
var tinyMCE_GZ = {
settings : {
themes : '',
plugins : '',
languages : '',
disk_cache : false,
page_name : 'tiny_mce_gzip.php',
debug : false,
suffix : ''
},
for (var i=0; i<elements.length; i++) {
if (elements[i].src && elements[i].src.indexOf("tiny_mce_gzip.php") != -1) {
scriptURL = elements[i].src;
break;
opt : {},
init : function(arr, cb) {
var t = this, n, s, nl = document.getElementsByTagName('script');
t.opt = arr;
t.settings.themes = arr.theme;
t.settings.plugins = arr.plugins;
t.settings.languages = arr.language;
s = t.settings;
t.cb = cb || '';
for (i=0; i<nl.length; i++) {
n = nl[i];
if (n.src && n.src.indexOf('tiny_mce') != -1)
t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
}
tinyMCEPreInit.base = t.baseURL;
if (!t.coreLoaded)
t.loadScripts(1, s.themes, s.plugins, s.languages);
},
loadScripts : function(co, th, pl, la, cb, sc) {
var t = this, x, w = window, q, c = 0, ti, s = t.settings;
function get(s) {
x = 0;
try {
x = new ActiveXObject(s);
} catch (s) {
}
return x;
};
// Build query string
q = 'load=true&js=true&diskcache=' + (s.disk_cache ? 'true' : 'false') + '&core=' + (co ? 'true' : 'false') + '&suffix=' + escape(s.suffix) + '&themes=' + escape(th) + '&plugins=' + escape(pl) + '&languages=' + escape(la);
if (co)
t.coreLoaded = 1;
// Easier to debug with this...
// document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + t.baseURL + '/' + s.page_name + '?' + q + '"></script>');
// Send request
x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP');
x.overrideMimeType && x.overrideMimeType('text/javascript');
x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb);
// x.setRequestHeader('Content-Type', 'text/javascript');
x.send('');
// Handle asyncronous loading
if (cb) {
// Wait for response
ti = w.setInterval(function() {
if (x.readyState == 4 || c++ > 10000) {
w.clearInterval(ti);
if (c < 10000 && x.status == 200) {
t.loaded = 1;
t.eval(x.responseText);
tinymce.dom.Event.domLoaded = true;
// cb.call(sc || t, x);
}
ti = x = null;
}
}, 10);
} else
t.eval(x.responseText);
},
start : function() {
var t = this, each = tinymce.each, s = t.settings, sl, ln = s.languages.split(',');
tinymce.suffix = s.suffix;
// Extend script loader
tinymce.create('tinymce.compressor.ScriptLoader:tinymce.dom.ScriptLoader', {
loadScripts : function(sc, cb, s) {
var ti = this, th = [], pl = [], la = [];
each(sc, function(o) {
var u = o.url;
if ((!ti.lookup[u] || ti.lookup[u].state != 2) && u.indexOf(t.baseURL) === 0) {
// Collect theme
if (u.indexOf('editor_template') != -1) {
th.push(/\/themes\/([^\/]+)/.exec(u)[1]);
load(u, 1);
}
// Collect plugin
if (u.indexOf('editor_plugin') != -1) {
pl.push(/\/plugins\/([^\/]+)/.exec(u)[1]);
load(u, 1);
}
// Collect language
if (u.indexOf('/langs/') != -1) {
la.push(/\/langs\/([^.]+)/.exec(u)[1]);
load(u, 1);
}
}
});
if (th.length + pl.length + la.length > 0) {
if (sl.settings.strict_mode) {
// Async
t.loadScripts(0, th.join(','), pl.join(','), la.join(','), cb, s);
return;
} else
t.loadScripts(0, th.join(','), pl.join(','), la.join(','), cb, s);
}
return ti.parent(sc, cb, s);
}
});
sl = tinymce.ScriptLoader = new tinymce.compressor.ScriptLoader();
function load(u, sp) {
var o;
if (!sp)
u = t.baseURL + u;
o = {url : u, state : 2};
sl.queue.push(o);
sl.lookup[o.url] = o;
};
// Add core languages
each (ln, function(c) {
if (c)
load('/langs/' + c + '.js');
});
// Add themes with languages
each(s.themes.split(','), function(n) {
if (n) {
load('/themes/' + n + '/editor_template' + s.suffix + '.js');
each (ln, function(c) {
if (c)
load('/themes/' + n + '/langs/' + c + '.js');
});
}
});
// Add plugins with languages
each(s.plugins.split(','), function(n) {
if (n) {
load('/plugins/' + n + '/editor_plugin' + s.suffix + '.js');
each (ln, function(c) {
if (c)
load('/plugins/' + n + '/langs/' + c + '.js');
});
}
});
},
end : function() {
tinyMCE.init(this.opt);
},
eval : function(co) {
var w = window;
// Evaluate script
if (!w.execScript) {
try {
eval.call(w, co);
} catch (ex) {
eval(co, w); // Firefox 3.0a8
}
} else
w.execScript(co); // IE
}
settings["theme"] = typeof(settings["theme"]) != "undefined" ? settings["theme"] : "default";
settings["plugins"] = typeof(settings["plugins"]) != "undefined" ? settings["plugins"] : "";
settings["language"] = typeof(settings["language"]) != "undefined" ? settings["language"] : "en";
settings["button_tile_map"] = typeof(settings["button_tile_map"]) != "undefined" ? settings["button_tile_map"] : true;
this.configs[this.configs.length] = settings;
this.settings = settings;
scriptURL += (scriptURL.indexOf('?') == -1) ? '?' : '&';
scriptURL += "theme=" + escape(this.getOnce(settings["theme"])) + "&language=" + escape(this.getOnce(settings["language"])) + "&plugins=" + escape(this.getOnce(settings["plugins"])) + "&lang=" + settings["language"] + "&index=" + escape(this.configs.length-1);
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + scriptURL + '"></script>');
if (!this.loadAdded) {
tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad);
tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad);
this.loadAdded = true;
}
}
TinyMCECompressed.prototype.onLoad = function() {
if (tinyMCE.isLoaded)
return true;
tinyMCE = realTinyMCE;
TinyMCE_Engine.prototype.onLoad();
tinyMCE._addUnloadEvents();
tinyMCE.isLoaded = true;
}
TinyMCECompressed.prototype.addEvent = function(o, n, h) {
if (o.attachEvent)
o.attachEvent("on" + n, h);
else
o.addEventListener(n, h, false);
}
TinyMCECompressed.prototype.getOnce = function(str) {
var ar = str.replace(/\s+/g, '').split(',');
for (var i=0; i<ar.length; i++) {
if (ar[i] == '' || ar[i].charAt(0) == '-') {
ar[i] = null;
continue;
}
// Skip load
for (var x=0; x<this.loadedFiles.length; x++) {
if (this.loadedFiles[x] == ar[i])
ar[i] = null;
}
this.loadedFiles[this.loadedFiles.length] = ar[i];
}
// Glue
str = "";
for (var i=0; i<ar.length; i++) {
if (ar[i] == null)
continue;
str += ar[i];
if (i != ar.length-1)
str += ",";
}
return str;
};
TinyMCECompressed.prototype.loadPlugins = function() {
var i, ar;
TinyMCE.prototype.loadScript = TinyMCE.prototype.orgLoadScript;
tinyMCE = realTinyMCE;
ar = tinyMCECompressed.externalPlugins;
for (i=0; i<ar.length; i++)
tinyMCE.loadPlugin(ar[i].name, ar[i].url);
TinyMCE.prototype.loadScript = function() {};
};
TinyMCECompressed.prototype.loadPlugin = function(n, u) {
this.externalPlugins[this.externalPlugins.length] = {name : n, url : u};
};
TinyMCECompressed.prototype.importPluginLanguagePack = function(n, v) {
tinyMCE = realTinyMCE;
TinyMCE.prototype.loadScript = TinyMCE.prototype.orgLoadScript;
tinyMCE.importPluginLanguagePack(n, v);
};
TinyMCECompressed.prototype.addPlugin = function(n, p) {
tinyMCE = realTinyMCE;
tinyMCE.addPlugin(n, p);
};
var tinyMCE = new TinyMCECompressed();
var tinyMCECompressed = tinyMCE;

View File

@ -46,9 +46,9 @@ tinyMCEPopup = {
return this.editor.getLang(n, dv);
},
execCommand : function(cmd, ui, val) {
execCommand : function(cmd, ui, val, a) {
this.restoreSelection();
return this.editor.execCommand(cmd, ui, val);
return this.editor.execCommand(cmd, ui, val, a || {skip_focus : 1});
},
resizeToInnerSize : function() {
@ -93,8 +93,11 @@ tinyMCEPopup = {
func : function(c) {
document.getElementById(element_id).value = c;
if (tinymce.is(document.getElementById(element_id).onchange, 'function'))
try {
document.getElementById(element_id).onchange();
} catch (ex) {
// Try fire event, ignore errors
}
}
});
},

View File

@ -0,0 +1,29 @@
/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
/* You can extend this CSS by adding your own CSS file with the the content_css option */
body {
background: #fff;
font: 13px/19px "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif;
padding: .2em;
}
td {
font-size: 10px;
}
pre {
font: 12px/18px "Courier New", fixed;
}
.mceVisualAid {
border: 1px dashed #BBBBBB !important;
}
.mceItemAnchor {
width: 12px;
line-height: 6px;
overflow: hidden;
padding-left: 12px;
background-position: bottom;
background-repeat: no-repeat;
}

View File

@ -9,15 +9,21 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
<script type="text/javascript" src="tiny_mce_popup.js"></script>
<?php wp_admin_css(); ?>
<style type="text/css">
#wphead {
padding-top: 5px;
body {
background-color: #eaf3ea;
}
#wphead {
padding-top: 2px;
padding-left: 15px;
font-size: 80%;
border-top: 0;
background-color: #eaf3ea;
}
#adminmenu {
padding-top: 2px;
padding-left: 15px;
font-size: 80%;
background-color: #eaf3ea;
}
#user_info {
right: 5%;
@ -38,6 +44,8 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
margin: 0;
padding: 5px 20px 10px;
background-color: #fff;
border-left: 1px solid #c6d9e9;
border-bottom: 1px solid #c6d9e9;
}
* html {
overflow-x: hidden;
@ -113,7 +121,7 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
c = d('content'+i.toString());
t = d('tab'+i.toString());
if ( n == i ) {
c.className = 'vizible';
c.className = '';
t.className = 'current';
} else {
c.className = 'hidden';
@ -136,7 +144,7 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
<body>
<div class="zerosize"></div>
<div id="wphead"><h1><?php echo get_bloginfo('blogtitle'); ?></h1></div>
<div id="user_info"><p><strong><?php _e('Rich Editor Help') ?></strong></p></div>
<ul id="adminmenu">
<li><a id="tab1" href="javascript:flipTab(1)" title="<?php _e('Basics of Rich Editing') ?>" accesskey="1" class="current"><?php _e('Basics') ?></a></li>
<li><a id="tab2" href="javascript:flipTab(2)" title="<?php _e('Advanced use of the Rich Editor') ?>" accesskey="2"><?php _e('Advanced') ?></a></li>
@ -189,13 +197,18 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
<p><?php _e('For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.') ?></p>
<div id="buttoncontainer">
<a href="http://www.moxiecode.com" target="_new"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="<?php _e('Got Moxie?') ?>" border="0" /></a>
<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="<?php _e('Hosted By Sourceforge') ?>" border="0" /></a>
<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="<?php _e('Also on freshmeat') ?>" border="0" /></a>
<a href="http://www.moxiecode.com" target="_new"><img src="themes/advanced/img/gotmoxie.png" alt="<?php _e('Got Moxie?') ?>" border="0" /></a>
<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="themes/advanced/img/sflogo.png" alt="<?php _e('Hosted By Sourceforge') ?>" border="0" /></a>
<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="themes/advanced/img/fm.gif" alt="<?php _e('Also on freshmeat') ?>" border="0" /></a>
</div>
</div>
</div>
<div class="mceActionPanel">
<div style="margin: 8px auto; text-align: center;padding-bottom: 10px;">
<input type="button" id="cancel" name="cancel" value="<?php _e('Close'); ?>" title="<?php _e('Close'); ?>" onclick="tinyMCEPopup.close();" />
</div>
</div>
</body>

View File

@ -30,10 +30,10 @@ class WP_Scripts {
$this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
// Modify this version when tinyMCE plugins are changed
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20080105' );
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20080129' );
$mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
$this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20080105' );
$this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20080129' );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');