mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
tinyMCE 2.0.5 coming at you live. fixes #2598
git-svn-id: https://develop.svn.wordpress.org/trunk@3664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
/**
|
||||
* $RCSfile: form_utils.js,v $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2005/10/25 16:01:51 $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2006/03/22 12:21:24 $
|
||||
*
|
||||
* Various form utilitiy functions.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved.
|
||||
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
function getColorPickerHTML(id, target_form_element) {
|
||||
var html = "";
|
||||
|
||||
html += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
|
||||
html += '<img id="' + id + '" src="../../themes/advanced/images/color.gif"';
|
||||
html += ' onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');"';
|
||||
html += ' onmouseout="tinyMCE.restoreClass(this);"';
|
||||
html += ' onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');"';
|
||||
html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/color.gif"';
|
||||
html += ' onmouseover="this.className=\'mceButtonOver\'"';
|
||||
html += ' onmouseout="this.className=\'mceButtonNormal\'"';
|
||||
html += ' onmousedown="this.className=\'mceButtonDown\'"';
|
||||
html += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
|
||||
html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
|
||||
|
||||
@@ -57,10 +57,10 @@ function getBrowserHTML(id, target_form_element, type, prefix) {
|
||||
var html = "";
|
||||
|
||||
html += '<a id="' + id + '_link" href="javascript:openBrower(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
|
||||
html += '<img id="' + id + '" src="../../themes/advanced/images/browse.gif"';
|
||||
html += ' onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');"';
|
||||
html += ' onmouseout="tinyMCE.restoreClass(this);"';
|
||||
html += ' onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');"';
|
||||
html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/browse.gif"';
|
||||
html += ' onmouseover="this.className=\'mceButtonOver\';"';
|
||||
html += ' onmouseout="this.className=\'mceButtonNormal\';"';
|
||||
html += ' onmousedown="this.className=\'mceButtonDown\';"';
|
||||
html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
|
||||
html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
|
||||
|
||||
@@ -74,7 +74,7 @@ function openBrower(img_id, target_form_element, type, option) {
|
||||
tinyMCEPopup.openBrowser(target_form_element, type, option);
|
||||
}
|
||||
|
||||
function selectByValue(form_obj, field_name, value, add_custom) {
|
||||
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
|
||||
if (!form_obj || !form_obj.elements[field_name])
|
||||
return;
|
||||
|
||||
@@ -84,7 +84,7 @@ function selectByValue(form_obj, field_name, value, add_custom) {
|
||||
for (var i=0; i<sel.options.length; i++) {
|
||||
var option = sel.options[i];
|
||||
|
||||
if (option.value == value) {
|
||||
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
|
||||
option.selected = true;
|
||||
found = true;
|
||||
} else
|
||||
@@ -109,8 +109,13 @@ function getSelectValue(form_obj, field_name) {
|
||||
return elm.options[elm.selectedIndex].value;
|
||||
}
|
||||
|
||||
function addSelectValue(form_obj, field_name, name, value) {
|
||||
var s = form_obj.elements[field_name];
|
||||
var o = new Option(name, value);
|
||||
s.options[s.options.length] = o;
|
||||
}
|
||||
|
||||
function addClassesToList(list_id, specific_option) {
|
||||
return;
|
||||
// Setup class droplist
|
||||
var styleSelectElm = document.getElementById(list_id);
|
||||
var styles = tinyMCE.getParam('theme_advanced_styles', false);
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/**
|
||||
* $RCSfile: mclayer.js,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2006/02/06 20:11:09 $
|
||||
*
|
||||
* Moxiecode floating layer script.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
function MCLayer(id) {
|
||||
this.id = id;
|
||||
this.settings = new Array();
|
||||
this.blockerElement = null;
|
||||
this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
|
||||
this.events = false;
|
||||
this.autoHideCallback = null;
|
||||
}
|
||||
|
||||
MCLayer.prototype = {
|
||||
moveRelativeTo : function(re, p, a) {
|
||||
var rep = this.getAbsPosition(re);
|
||||
var w = parseInt(re.offsetWidth);
|
||||
var h = parseInt(re.offsetHeight);
|
||||
var x, y;
|
||||
|
||||
switch (p) {
|
||||
case "tl":
|
||||
break;
|
||||
|
||||
case "tr":
|
||||
x = rep.absLeft + w;
|
||||
y = rep.absTop;
|
||||
break;
|
||||
|
||||
case "bl":
|
||||
break;
|
||||
|
||||
case "br":
|
||||
break;
|
||||
}
|
||||
|
||||
this.moveTo(x, y);
|
||||
},
|
||||
|
||||
moveBy : function(dx, dy) {
|
||||
var e = this.getElement();
|
||||
var x = parseInt(e.style.left);
|
||||
var y = parseInt(e.style.top);
|
||||
|
||||
e.style.left = (x + dx) + "px";
|
||||
e.style.top = (y + dy) + "px";
|
||||
|
||||
this.updateBlocker();
|
||||
},
|
||||
|
||||
moveTo : function(x, y) {
|
||||
var e = this.getElement();
|
||||
|
||||
e.style.left = x + "px";
|
||||
e.style.top = y + "px";
|
||||
|
||||
this.updateBlocker();
|
||||
},
|
||||
|
||||
show : function() {
|
||||
MCLayer.visibleLayer = this;
|
||||
|
||||
this.getElement().style.display = 'block';
|
||||
this.updateBlocker();
|
||||
},
|
||||
|
||||
hide : function() {
|
||||
this.getElement().style.display = 'none';
|
||||
this.updateBlocker();
|
||||
},
|
||||
|
||||
setAutoHide : function(s, cb) {
|
||||
this.autoHideCallback = cb;
|
||||
this.registerEventHandlers();
|
||||
},
|
||||
|
||||
getElement : function() {
|
||||
return document.getElementById(this.id);
|
||||
},
|
||||
|
||||
updateBlocker : function() {
|
||||
if (!this.isMSIE)
|
||||
return;
|
||||
|
||||
var e = this.getElement();
|
||||
var b = this.getBlocker();
|
||||
var x = this.parseInt(e.style.left);
|
||||
var y = this.parseInt(e.style.top);
|
||||
var w = this.parseInt(e.offsetWidth);
|
||||
var h = this.parseInt(e.offsetHeight);
|
||||
|
||||
b.style.left = x + 'px';
|
||||
b.style.top = y + 'px';
|
||||
b.style.width = w + 'px';
|
||||
b.style.height = h + 'px';
|
||||
b.style.display = e.style.display;
|
||||
},
|
||||
|
||||
getBlocker : function() {
|
||||
if (!this.blockerElement) {
|
||||
var d = document, b = d.createElement("iframe");
|
||||
|
||||
b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
|
||||
b.src = 'javascript:false;';
|
||||
b.frameBorder = '0';
|
||||
b.scrolling = 'no';
|
||||
|
||||
d.body.appendChild(b);
|
||||
this.blockerElement = b;
|
||||
}
|
||||
|
||||
return this.blockerElement;
|
||||
},
|
||||
|
||||
getAbsPosition : function(n) {
|
||||
var p = {absLeft : 0, absTop : 0};
|
||||
|
||||
while (n) {
|
||||
p.absLeft += n.offsetLeft;
|
||||
p.absTop += n.offsetTop;
|
||||
n = n.offsetParent;
|
||||
}
|
||||
|
||||
return p;
|
||||
},
|
||||
|
||||
registerEventHandlers : function() {
|
||||
if (!this.events) {
|
||||
var d = document;
|
||||
|
||||
this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
|
||||
|
||||
this.events = true;
|
||||
}
|
||||
},
|
||||
|
||||
addEvent : function(o, n, h) {
|
||||
if (o.attachEvent)
|
||||
o.attachEvent("on" + n, h);
|
||||
else
|
||||
o.addEventListener(n, h, false);
|
||||
},
|
||||
|
||||
onMouseDown : function(e) {
|
||||
e = typeof(e) == "undefined" ? window.event : e;
|
||||
var b = document.body;
|
||||
var l = MCLayer.visibleLayer;
|
||||
|
||||
if (l) {
|
||||
var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
|
||||
var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
|
||||
var el = l.getElement();
|
||||
var x = parseInt(el.style.left);
|
||||
var y = parseInt(el.style.top);
|
||||
var w = parseInt(el.offsetWidth);
|
||||
var h = parseInt(el.offsetHeight);
|
||||
|
||||
if (!(mx > x && mx < x + w && my > y && my < y + h)) {
|
||||
MCLayer.visibleLayer = null;
|
||||
|
||||
if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
|
||||
return true;
|
||||
|
||||
l.hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addCSSClass : function(e, c) {
|
||||
this.removeCSSClass(e, c);
|
||||
var a = this.explode(' ', e.className);
|
||||
a[a.length] = c;
|
||||
e.className = a.join(' ');
|
||||
},
|
||||
|
||||
removeCSSClass : function(e, c) {
|
||||
var a = this.explode(' ', e.className), i;
|
||||
|
||||
for (i=0; i<a.length; i++) {
|
||||
if (a[i] == c)
|
||||
a[i] = '';
|
||||
}
|
||||
|
||||
e.className = a.join(' ');
|
||||
},
|
||||
|
||||
explode : function(d, s) {
|
||||
var ar = s.split(d);
|
||||
var oar = new Array();
|
||||
|
||||
for (var i = 0; i<ar.length; i++) {
|
||||
if (ar[i] != "")
|
||||
oar[oar.length] = ar[i];
|
||||
}
|
||||
|
||||
return oar;
|
||||
},
|
||||
|
||||
parseInt : function(s) {
|
||||
if (s == null || s == '')
|
||||
return 0;
|
||||
|
||||
return parseInt(s);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* $RCSfile: mctabs.js,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2005/08/01 18:36:35 $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2006/02/06 20:11:09 $
|
||||
*
|
||||
* Moxiecode DHTML Tabs script.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved.
|
||||
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
function MCTabs() {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* $RCSfile: validate.js,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2005/08/13 12:20:37 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2006/02/06 20:11:09 $
|
||||
*
|
||||
* Various form validation methods.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved.
|
||||
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
function testRegExp(form_name, element_name, re) {
|
||||
|
||||
Reference in New Issue
Block a user