studio2011 initial commit
No files matched your search
@@ -0,0 +1,29 @@
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
img.wpGallery {
|
||||
border: 1px dashed #888;
|
||||
background: #f2f8ff url("../../wpgallery/img/gallery.png") no-repeat scroll center center;
|
||||
width: 99%;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
img.wp-oembed {
|
||||
border: 1px dashed #888;
|
||||
background: #f7f5f2 url("../img/embedded.png") no-repeat scroll center center;
|
||||
width: 300px;
|
||||
height: 250px;
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
/**
|
||||
* WordPress plugin.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var DOM = tinymce.DOM;
|
||||
|
||||
tinymce.create('tinymce.plugins.WordPress', {
|
||||
mceTout : 0,
|
||||
|
||||
init : function(ed, url) {
|
||||
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML;
|
||||
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
|
||||
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
|
||||
|
||||
if ( getUserSetting('hidetb', '0') == '1' )
|
||||
ed.settings.wordpress_adv_hidden = 0;
|
||||
|
||||
// Hides the specified toolbar and resizes the iframe
|
||||
ed.onPostRender.add(function() {
|
||||
var adv_toolbar = ed.controlManager.get(tbId);
|
||||
if ( ed.getParam('wordpress_adv_hidden', 1) && adv_toolbar ) {
|
||||
DOM.hide(adv_toolbar.id);
|
||||
t._resizeIframe(ed, tbId, 28);
|
||||
}
|
||||
});
|
||||
|
||||
// Register commands
|
||||
ed.addCommand('WP_More', function() {
|
||||
ed.execCommand('mceInsertContent', 0, moreHTML);
|
||||
});
|
||||
|
||||
ed.addCommand('WP_Page', function() {
|
||||
ed.execCommand('mceInsertContent', 0, nextpageHTML);
|
||||
});
|
||||
|
||||
ed.addCommand('WP_Help', function() {
|
||||
ed.windowManager.open({
|
||||
url : tinymce.baseURL + '/wp-mce-help.php',
|
||||
width : 450,
|
||||
height : 420,
|
||||
inline : 1
|
||||
});
|
||||
});
|
||||
|
||||
ed.addCommand('WP_Adv', function() {
|
||||
var cm = ed.controlManager, id = cm.get(tbId).id;
|
||||
|
||||
if ( 'undefined' == id )
|
||||
return;
|
||||
|
||||
if ( DOM.isHidden(id) ) {
|
||||
cm.setActive('wp_adv', 1);
|
||||
DOM.show(id);
|
||||
t._resizeIframe(ed, tbId, -28);
|
||||
ed.settings.wordpress_adv_hidden = 0;
|
||||
setUserSetting('hidetb', '1');
|
||||
} else {
|
||||
cm.setActive('wp_adv', 0);
|
||||
DOM.hide(id);
|
||||
t._resizeIframe(ed, tbId, 28);
|
||||
ed.settings.wordpress_adv_hidden = 1;
|
||||
setUserSetting('hidetb', '0');
|
||||
}
|
||||
});
|
||||
|
||||
// Register buttons
|
||||
ed.addButton('wp_more', {
|
||||
title : 'wordpress.wp_more_desc',
|
||||
image : url + '/img/more.gif',
|
||||
cmd : 'WP_More'
|
||||
});
|
||||
|
||||
ed.addButton('wp_page', {
|
||||
title : 'wordpress.wp_page_desc',
|
||||
image : url + '/img/page.gif',
|
||||
cmd : 'WP_Page'
|
||||
});
|
||||
|
||||
ed.addButton('wp_help', {
|
||||
title : 'wordpress.wp_help_desc',
|
||||
image : url + '/img/help.gif',
|
||||
cmd : 'WP_Help'
|
||||
});
|
||||
|
||||
ed.addButton('wp_adv', {
|
||||
title : 'wordpress.wp_adv_desc',
|
||||
image : url + '/img/toolbars.gif',
|
||||
cmd : 'WP_Adv'
|
||||
});
|
||||
|
||||
// Add Media buttons
|
||||
ed.addButton('add_media', {
|
||||
title : 'wordpress.add_media',
|
||||
image : url + '/img/media.gif',
|
||||
onclick : function() {
|
||||
tb_show('', tinymce.DOM.get('add_media').href);
|
||||
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
|
||||
}
|
||||
});
|
||||
|
||||
ed.addButton('add_image', {
|
||||
title : 'wordpress.add_image',
|
||||
image : url + '/img/image.gif',
|
||||
onclick : function() {
|
||||
tb_show('', tinymce.DOM.get('add_image').href);
|
||||
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
|
||||
}
|
||||
});
|
||||
|
||||
ed.addButton('add_video', {
|
||||
title : 'wordpress.add_video',
|
||||
image : url + '/img/video.gif',
|
||||
onclick : function() {
|
||||
tb_show('', tinymce.DOM.get('add_video').href);
|
||||
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
|
||||
}
|
||||
});
|
||||
|
||||
ed.addButton('add_audio', {
|
||||
title : 'wordpress.add_audio',
|
||||
image : url + '/img/audio.gif',
|
||||
onclick : function() {
|
||||
tb_show('', tinymce.DOM.get('add_audio').href);
|
||||
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
|
||||
}
|
||||
});
|
||||
|
||||
// Add Media buttons to fullscreen and handle align buttons for image captions
|
||||
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val, o) {
|
||||
var DOM = tinymce.DOM, n, DL, DIV, cls, a, align;
|
||||
if ( 'mceFullScreen' == cmd ) {
|
||||
if ( 'mce_fullscreen' != ed.id && DOM.get('add_audio') && DOM.get('add_video') && DOM.get('add_image') && DOM.get('add_media') )
|
||||
ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media';
|
||||
}
|
||||
|
||||
if ( 'JustifyLeft' == cmd || 'JustifyRight' == cmd || 'JustifyCenter' == cmd ) {
|
||||
n = ed.selection.getNode();
|
||||
|
||||
if ( n.nodeName == 'IMG' ) {
|
||||
align = cmd.substr(7).toLowerCase();
|
||||
a = 'align' + align;
|
||||
DL = ed.dom.getParent(n, 'dl.wp-caption');
|
||||
DIV = ed.dom.getParent(n, 'div.mceTemp');
|
||||
|
||||
if ( DL && DIV ) {
|
||||
cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a;
|
||||
DL.className = DL.className.replace(/align[^ '"]+\s?/g, '');
|
||||
ed.dom.addClass(DL, cls);
|
||||
|
||||
if (cls == 'aligncenter')
|
||||
ed.dom.addClass(DIV, 'mceIEcenter');
|
||||
else
|
||||
ed.dom.removeClass(DIV, 'mceIEcenter');
|
||||
|
||||
o.terminate = true;
|
||||
ed.execCommand('mceRepaint');
|
||||
} else {
|
||||
if ( ed.dom.hasClass(n, a) )
|
||||
ed.dom.addClass(n, 'alignnone');
|
||||
else
|
||||
ed.dom.removeClass(n, 'alignnone');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ed.onInit.add(function(ed) {
|
||||
// make sure these run last
|
||||
ed.onNodeChange.add( function(ed, cm, e) {
|
||||
var DL;
|
||||
|
||||
if ( e.nodeName == 'IMG' ) {
|
||||
DL = ed.dom.getParent(e, 'dl.wp-caption');
|
||||
} else if ( e.nodeName == 'DIV' && ed.dom.hasClass(e, 'mceTemp') ) {
|
||||
DL = e.firstChild;
|
||||
|
||||
if ( ! ed.dom.hasClass(DL, 'wp-caption') )
|
||||
DL = false;
|
||||
}
|
||||
|
||||
if ( DL ) {
|
||||
if ( ed.dom.hasClass(DL, 'alignleft') )
|
||||
cm.setActive('justifyleft', 1);
|
||||
else if ( ed.dom.hasClass(DL, 'alignright') )
|
||||
cm.setActive('justifyright', 1);
|
||||
else if ( ed.dom.hasClass(DL, 'aligncenter') )
|
||||
cm.setActive('justifycenter', 1);
|
||||
}
|
||||
});
|
||||
|
||||
// remove invalid parent paragraphs when pasting HTML and/or switching to the HTML editor and back
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
if ( o.content ) {
|
||||
o.content = o.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi, '<$1$2>');
|
||||
o.content = o.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi, '</$1>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Word count if script is loaded
|
||||
if ( 'undefined' != typeof wpWordCount ) {
|
||||
ed.onKeyUp.add(function(ed, e) {
|
||||
if ( e.keyCode == last ) return;
|
||||
if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) );
|
||||
last = e.keyCode;
|
||||
});
|
||||
};
|
||||
|
||||
ed.onSaveContent.add(function(ed, o) {
|
||||
if ( typeof(switchEditors) == 'object' ) {
|
||||
if ( ed.isHidden() )
|
||||
o.content = o.element.value;
|
||||
else
|
||||
o.content = switchEditors.pre_wpautop(o.content);
|
||||
}
|
||||
});
|
||||
|
||||
/* disable for now
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t._setEmbed(o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if ( o.get )
|
||||
o.content = t._getEmbed(o.content);
|
||||
});
|
||||
*/
|
||||
|
||||
// Add listeners to handle more break
|
||||
t._handleMoreBreak(ed, url);
|
||||
|
||||
// Add custom shortcuts
|
||||
ed.addShortcut('alt+shift+c', ed.getLang('justifycenter_desc'), 'JustifyCenter');
|
||||
ed.addShortcut('alt+shift+r', ed.getLang('justifyright_desc'), 'JustifyRight');
|
||||
ed.addShortcut('alt+shift+l', ed.getLang('justifyleft_desc'), 'JustifyLeft');
|
||||
ed.addShortcut('alt+shift+j', ed.getLang('justifyfull_desc'), 'JustifyFull');
|
||||
ed.addShortcut('alt+shift+q', ed.getLang('blockquote_desc'), 'mceBlockQuote');
|
||||
ed.addShortcut('alt+shift+u', ed.getLang('bullist_desc'), 'InsertUnorderedList');
|
||||
ed.addShortcut('alt+shift+o', ed.getLang('numlist_desc'), 'InsertOrderedList');
|
||||
ed.addShortcut('alt+shift+d', ed.getLang('striketrough_desc'), 'Strikethrough');
|
||||
ed.addShortcut('alt+shift+n', ed.getLang('spellchecker.desc'), 'mceSpellCheck');
|
||||
ed.addShortcut('alt+shift+a', ed.getLang('link_desc'), 'mceLink');
|
||||
ed.addShortcut('alt+shift+s', ed.getLang('unlink_desc'), 'unlink');
|
||||
ed.addShortcut('alt+shift+m', ed.getLang('image_desc'), 'mceImage');
|
||||
ed.addShortcut('alt+shift+g', ed.getLang('fullscreen.desc'), 'mceFullScreen');
|
||||
ed.addShortcut('alt+shift+z', ed.getLang('wp_adv_desc'), 'WP_Adv');
|
||||
ed.addShortcut('alt+shift+h', ed.getLang('help_desc'), 'WP_Help');
|
||||
ed.addShortcut('alt+shift+t', ed.getLang('wp_more_desc'), 'WP_More');
|
||||
ed.addShortcut('alt+shift+p', ed.getLang('wp_page_desc'), 'WP_Page');
|
||||
ed.addShortcut('ctrl+s', ed.getLang('save_desc'), function(){if('function'==typeof autosave)autosave();});
|
||||
|
||||
if ( tinymce.isWebKit ) {
|
||||
ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold');
|
||||
ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic');
|
||||
}
|
||||
|
||||
ed.onInit.add(function(ed) {
|
||||
tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
|
||||
ed.plugins.wordpress._hideButtons();
|
||||
});
|
||||
tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) {
|
||||
ed.plugins.wordpress._hideButtons();
|
||||
});
|
||||
});
|
||||
|
||||
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
|
||||
ed.plugins.wordpress._hideButtons();
|
||||
});
|
||||
|
||||
ed.onSaveContent.add(function(ed, o) {
|
||||
ed.plugins.wordpress._hideButtons();
|
||||
});
|
||||
|
||||
ed.onMouseDown.add(function(ed, e) {
|
||||
if ( e.target.nodeName != 'IMG' )
|
||||
ed.plugins.wordpress._hideButtons();
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'WordPress Plugin',
|
||||
author : 'WordPress', // add Moxiecode?
|
||||
authorurl : 'http://wordpress.org',
|
||||
infourl : 'http://wordpress.org',
|
||||
version : '3.0'
|
||||
};
|
||||
},
|
||||
|
||||
// Internal functions
|
||||
_setEmbed : function(c) {
|
||||
return c.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function(a,b){
|
||||
return '<img width="300" height="200" src="' + tinymce.baseURL + '/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+b+'" title="'+b+'" />';
|
||||
});
|
||||
},
|
||||
|
||||
_getEmbed : function(c) {
|
||||
return c.replace(/<img[^>]+>/g, function(a) {
|
||||
if ( a.indexOf('class="wp-oembed') != -1 ) {
|
||||
var u = a.match(/alt="([^\"]+)"/);
|
||||
if ( u[1] )
|
||||
a = '[embed]' + u[1] + '[/embed]';
|
||||
}
|
||||
return a;
|
||||
});
|
||||
},
|
||||
|
||||
_showButtons : function(n, id) {
|
||||
var ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
|
||||
|
||||
vp = ed.dom.getViewPort(ed.getWin());
|
||||
p1 = DOM.getPos(ed.getContentAreaContainer());
|
||||
p2 = ed.dom.getPos(n);
|
||||
|
||||
X = Math.max(p2.x - vp.x, 0) + p1.x;
|
||||
Y = Math.max(p2.y - vp.y, 0) + p1.y;
|
||||
|
||||
DOM.setStyles(id, {
|
||||
'top' : Y+5+'px',
|
||||
'left' : X+5+'px',
|
||||
'display' : 'block'
|
||||
});
|
||||
|
||||
if ( this.mceTout )
|
||||
clearTimeout(this.mceTout);
|
||||
|
||||
this.mceTout = setTimeout( function(){ed.plugins.wordpress._hideButtons();}, 5000 );
|
||||
},
|
||||
|
||||
_hideButtons : function() {
|
||||
if ( !this.mceTout )
|
||||
return;
|
||||
|
||||
if ( document.getElementById('wp_editbtns') )
|
||||
tinymce.DOM.hide('wp_editbtns');
|
||||
|
||||
if ( document.getElementById('wp_gallerybtns') )
|
||||
tinymce.DOM.hide('wp_gallerybtns');
|
||||
|
||||
clearTimeout(this.mceTout);
|
||||
this.mceTout = 0;
|
||||
},
|
||||
|
||||
// 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, nextpageHTML;
|
||||
|
||||
moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
|
||||
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';
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Replace morebreak with images
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
if ( o.content ) {
|
||||
o.content = o.content.replace(/<!--more(.*?)-->/g, moreHTML);
|
||||
o.content = o.content.replace(/<!--nextpage-->/g, nextpageHTML);
|
||||
}
|
||||
});
|
||||
|
||||
// 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, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : '';
|
||||
im = '<!--more'+moretext+'-->';
|
||||
}
|
||||
if (im.indexOf('class="mceWPnextpage') !== -1)
|
||||
im = '<!--nextpage-->';
|
||||
|
||||
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'));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress);
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(p,m,s,l,j){var v=tinymce.DOM,k,i,r,u,t,q;if("mceFullScreen"==m){if("mce_fullscreen"!=p.id&&v.get("add_audio")&&v.get("add_video")&&v.get("add_image")&&v.get("add_media")){p.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}}if("JustifyLeft"==m||"JustifyRight"==m||"JustifyCenter"==m){k=p.selection.getNode();if(k.nodeName=="IMG"){q=m.substr(7).toLowerCase();t="align"+q;i=p.dom.getParent(k,"dl.wp-caption");r=p.dom.getParent(k,"div.mceTemp");if(i&&r){u=p.dom.hasClass(i,t)?"alignnone":t;i.className=i.className.replace(/align[^ '"]+\s?/g,"");p.dom.addClass(i,u);if(u=="aligncenter"){p.dom.addClass(r,"mceIEcenter")}else{p.dom.removeClass(r,"mceIEcenter")}j.terminate=true;p.execCommand("mceRepaint")}else{if(p.dom.hasClass(k,t)){p.dom.addClass(k,"alignnone")}else{p.dom.removeClass(k,"alignnone")}}}}});c.onInit.add(function(i){i.onNodeChange.add(function(k,j,m){var l;if(m.nodeName=="IMG"){l=k.dom.getParent(m,"dl.wp-caption")}else{if(m.nodeName=="DIV"&&k.dom.hasClass(m,"mceTemp")){l=m.firstChild;if(!k.dom.hasClass(l,"wp-caption")){l=false}}}if(l){if(k.dom.hasClass(l,"alignleft")){j.setActive("justifyleft",1)}else{if(k.dom.hasClass(l,"alignright")){j.setActive("justifyright",1)}else{if(k.dom.hasClass(l,"aligncenter")){j.setActive("justifycenter",1)}}}}});i.onBeforeSetContent.add(function(j,k){if(k.content){k.content=k.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");k.content=k.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"</$1>")}})});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("Line truncated
|
||||
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 101 B |
|
After Width: | Height: | Size: 149 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 180 B |
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 99 B |