rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if(/MSIE/.test(navigator.userAgent))
if(/MSIE/.test(navigator.userAgent) && !window.opera)
Element.setOpacity = function(element, value){ element= $(element); if (value == 1){ Element.setStyle(element, { opacity: (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : null }); if(/MSIE/.test(navigator.userAgent)) Element.setStyle(element, {filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); } else { if(value < 0.00001) value = 0; Element.setStyle(element, {opacity: value}); if(/MSIE/.test(navigator.userAgent)) Element.setStyle(element, { filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') + 'alpha(opacity='+value*100+')' }); }}
if (value == 1){ Element.setStyle(element, {opacity: 0.999999});
if (value == 1){ Element.setStyle(element, { opacity: (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : null });
Element.setOpacity = function(element, value){ element= $(element); if (value == 1){ Element.setStyle(element, {opacity: 0.999999}); if(/MSIE/.test(navigator.userAgent)) Element.setStyle(element, {filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); } else { if(value < 0.00001) value = 0; Element.setStyle(element, {opacity: value}); if(/MSIE/.test(navigator.userAgent)) Element.setStyle(element, { filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') + 'alpha(opacity='+value*100+')' }); } }
this.options = {
this.options = Object.extend({
setOptions: function(options) { this.options = { transition: Effect.Transitions.sinoidal, duration: 1.0, // seconds fps: 25.0, // max. 100fps sync: false, // true for combining from: 0.0, to: 1.0 }.extend(options || {}); },
}.extend(options || {});
}, options || {});
setOptions: function(options) { this.options = { transition: Effect.Transitions.sinoidal, duration: 1.0, // seconds fps: 25.0, // max. 100fps sync: false, // true for combining from: 0.0, to: 1.0 }.extend(options || {}); },
contentType: 'application/x-www-form-urlencoded',
setOptions: function(options) { this.options = { method: 'post', asynchronous: true, parameters: '' } Object.extend(this.options, options || {}); },
to: 1.0
to: 1.0, delay: 0.0, queue: 'parallel'
setOptions: function(options) { this.options = Object.extend({ transition: Effect.Transitions.sinoidal, duration: 1.0, // seconds fps: 25.0, // max. 100fps sync: false, // true for combining from: 0.0, to: 1.0 }, options || {}); },
if (option.test('^on[A-Z]') && $type(this.options[option]) == 'function') this.addEvent(option, this.options[option]);
if (($type(this.options[option]) == 'function') && option.test('^on[A-Z]')) this.addEvent(option, this.options[option]);
setOptions: function(defaults, options){ this.options = Object.extend(defaults, options); if (this.addEvent){ for (var option in this.options){ if (option.test('^on[A-Z]') && $type(this.options[option]) == 'function') this.addEvent(option, this.options[option]); } } return this; }
partial_search: true, partial_chars: 2, ignore_case: true, full_search: false,
partialSearch: true, partialChars: 2, ignoreCase: true, fullSearch: false,
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
var ret = new Array(); var partial = new Array(); var entry = instance.getEntry();
var ret = []; var partial = []; var entry = instance.getToken();
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
var found_pos = instance.options.ignore_case ?
var foundPos = instance.options.ignoreCase ?
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) {
while (foundPos != -1) { if (foundPos == 0 && elem.length != entry.length) {
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
} else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>");
} else if (entry.length >= instance.options.partialChars && instance.options.partialSearch && foundPos != -1) { if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" + elem.substr(foundPos, entry.length) + "</strong>" + elem.substr( foundPos + entry.length) + "</li>");
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1);
foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : elem.indexOf(entry, foundPos + 1);
setOptions: function(options) { this.options = Object.extend({ choices: 10, partial_search: true, partial_chars: 2, ignore_case: true, full_search: false, selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || {}); }
}.extend(options || {});
} Object.extend(this.options, options || {});
setOptions: function(options) { this.options = { method: 'post', asynchronous: true, parameters: '' }.extend(options || {}); },
this.setParentBottomOffset = function(poy) { this.poy = poy; };
this.setParentBottomOffset = function(poy) { this.poy = poy; return this;};
this.setParentBottomOffset = function(poy) { this.poy = poy; };
this.setParentRightOffset = function(pox) { this.pox = pox; };
this.setParentRightOffset = function(pox) { this.pox = pox; return this;};
this.setParentRightOffset = function(pox) { this.pox = pox; };
var el = false;
setProperty: function(property, value){ var el = false; switch (property){ case 'class': this.className = value; break; case 'style': this.setStyles(value); break; case 'name': if (window.ie6){ var el = $(document.createElement('<'+this.getTag()+' name="'+value+'" />')); $each(this.attributes, function(attribute){ if (attribute.name != 'name') el.setProperty(attribute.name, attribute.value); }); if (this.parentNode) this.replaceWith(el); break; }; default: this.setAttribute(property, value); } return el || this; },
break; };
return el; }
setProperty: function(property, value){ var el = false; switch (property){ case 'class': this.className = value; break; case 'style': this.setStyles(value); break; case 'name': if (window.ie6){ var el = $(document.createElement('<'+this.getTag()+' name="'+value+'" />')); $each(this.attributes, function(attribute){ if (attribute.name != 'name') el.setProperty(attribute.name, attribute.value); }); if (this.parentNode) this.replaceWith(el); break; }; default: this.setAttribute(property, value); } return el || this; },
return el || this;
return this;
setProperty: function(property, value){ var el = false; switch (property){ case 'class': this.className = value; break; case 'style': this.setStyles(value); break; case 'name': if (window.ie6){ var el = $(document.createElement('<'+this.getTag()+' name="'+value+'" />')); $each(this.attributes, function(attribute){ if (attribute.name != 'name') el.setProperty(attribute.name, attribute.value); }); if (this.parentNode) this.replaceWith(el); break; }; default: this.setAttribute(property, value); } return el || this; },
requestHeaders.push('Connection', 'close',
requestHeaders.push(
setRequestHeaders: function() { var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', 'X-Prototype-Version', Prototype.Version]; if (this.options.method == 'post') requestHeaders.push('Connection', 'close', 'Content-type', 'application/x-www-form-urlencoded'); if (this.options.requestHeaders) requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); for (var i = 0; i < requestHeaders.length; i += 2) this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); },
this.transport.setRequestHeader(requestHeader[i], requestHeader[i+1]);
this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
setRequestHeaders: function() { var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', 'X-Prototype-Version', Prototype.Version]; if (this.options.method == 'post') requestHeaders.push('Connection', 'close', 'Content-type', 'application/x-www-form-urlencoded'); if (this.options.requestHeaders) requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); for (var i = 0; i < requestHeaders.length; i += 2) this.transport.setRequestHeader(requestHeader[i], requestHeader[i+1]); },
requestHeaders.push('Content-type', 'application/x-www-form-urlencoded');
requestHeaders.push('Content-type', this.options.contentType);
setRequestHeaders: function() { var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', 'X-Prototype-Version', Prototype.Version, 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*']; if (this.options.method == 'post') { requestHeaders.push('Content-type', 'application/x-www-form-urlencoded'); /* Force "Connection: close" for Mozilla browsers to work around * a bug where XMLHttpReqeuest sends an incorrect Content-length * header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType) requestHeaders.push('Connection', 'close'); } if (this.options.requestHeaders) requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); for (var i = 0; i < requestHeaders.length; i += 2) this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); },
'X-Prototype-Version', Prototype.Version];
'X-Prototype-Version', Prototype.Version, 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
setRequestHeaders: function() { var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', 'X-Prototype-Version', Prototype.Version]; if (this.options.method == 'post') { requestHeaders.push('Content-type', 'application/x-www-form-urlencoded'); /* Force "Connection: close" for Mozilla browsers to work around * a bug where XMLHttpReqeuest sends an incorrect Content-length * header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType) requestHeaders.push('Connection', 'close'); } if (this.options.requestHeaders) requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); for (var i = 0; i < requestHeaders.length; i += 2) this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); },
requestHeaders.push('Content-type', 'application/x-www-form-urlencoded');
requestHeaders.push('Content-type', this.options.contentType);
setRequestHeaders: function() { var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', 'X-Prototype-Version', Prototype.Version]; if (this.options.method == 'post') { requestHeaders.push('Content-type', 'application/x-www-form-urlencoded'); /* Force "Connection: close" for Mozilla browsers to work around * a bug where XMLHttpReqeuest sends an incorrect Content-length * header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType) requestHeaders.push('Connection', 'close'); } if (this.options.requestHeaders) requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); for (var i = 0; i < requestHeaders.length; i += 2) this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); },
tableContents = suiteTable.ownerDocument.createTextNode(getTestFrame().contentWindow.document.body.innerHTML);
tableContents = suiteTable.ownerDocument.createTextNode(getIframeDocument(getTestFrame()).body.innerHTML);
function setResultsData(suiteTable, row) { // Create a text node of the test table tableContents = suiteTable.ownerDocument.createTextNode(getTestFrame().contentWindow.document.body.innerHTML); new_column = suiteTable.ownerDocument.createElement("td"); new_column.appendChild(tableContents); // Set the column to be invisible new_column.style.cssText = "display: none;"; // Add the invisible column suiteTable.rows[row].appendChild(new_column);}
Rico.Corner.round(this.div, options);
OpenLayers.Rico.Corner.round(this.div, options);
setRicoCorners:function(firstTime) { var corners = this.getCornersToRound(this.relativePosition); var options = {corners: corners, color: this.backgroundColor, bgColor: "transparent", blend: false}; if (firstTime) { Rico.Corner.round(this.div, options); } else { Rico.Corner.reRound(this.contentDiv, options); //set the popup color and opacity this.setBackgroundColor(); this.setOpacity(); } },
Rico.Corner.reRound(this.contentDiv, options);
OpenLayers.Rico.Corner.reRound(this.contentDiv, options);
setRicoCorners:function(firstTime) { var corners = this.getCornersToRound(this.relativePosition); var options = {corners: corners, color: this.backgroundColor, bgColor: "transparent", blend: false}; if (firstTime) { Rico.Corner.round(this.div, options); } else { Rico.Corner.reRound(this.contentDiv, options); //set the popup color and opacity this.setBackgroundColor(); this.setOpacity(); } },
runInterval = this.value;
var runModeOptions = document.forms['controlPanel'].runMode; for (var i = 0; i < runModeOptions.length; i++) { if (runModeOptions[i].checked) { runInterval = runModeOptions[i].value; break; } }
function setRunInterval() { runInterval = this.value;}
function setRunInterval(radio) { runInterval = radio.value;
function setRunInterval() { runInterval = this.value;
function setRunInterval(radio) { runInterval = radio.value; var stepButton = document.getElementById("stepNext"); if (runInterval == -1) { stepButton.style.visibility = ''; } else { stepButton.style.visibility = 'hidden'; }}
this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
this.rgb = OpenLayers.Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
setSaturation: function(s) { // get an HSB model, and set the new hue... var hsb = this.asHSB(); hsb.s = s; // convert back to RGB and set values... this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); },
this.setRicoCorners(!this.rounded); this.rounded = true;
if (this.map) { this.setRicoCorners(!this.rounded); this.rounded = true; }
setSize:function(size) { OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); if (this.contentDiv != null) { var contentSize = this.size.clone(); contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE); contentSize.h -= (2 * this.padding); this.contentDiv.style.height = contentSize.h + "px"; //size has changed - must redo corners this.setRicoCorners(!this.rounded); this.rounded = true; } },
this.div.style.width = this.size.w; this.div.style.height = this.size.h;
this.div.style.width = this.size.w + "px"; this.div.style.height = this.size.h + "px";
setSize:function(size) { if (size != undefined) { this.size = size; } if (this.div != null) { this.div.style.width = this.size.w; this.div.style.height = this.size.h; } },
if (this.contentDiv != null){ this.contentDiv.style.width = this.size.w + "px"; this.contentDiv.style.height = this.size.h + "px"; }
setSize:function(size) { if (size != undefined) { this.size = size; } if (this.div != null) { this.div.style.width = this.size.w + "px"; this.div.style.height = this.size.h + "px"; } },
span.style.height = this.translateToPx(range.end - range.start);
span.style.height = this.translateToPx(range.end - range.start + this.range.start);
setSpan: function(span, range) { if(this.isVertical()) { span.style.top = this.translateToPx(range.start); span.style.height = this.translateToPx(range.end - range.start); } else { span.style.left = this.translateToPx(range.start); span.style.width = this.translateToPx(range.end - range.start); } },
span.style.width = this.translateToPx(range.end - range.start);
span.style.width = this.translateToPx(range.end - range.start + this.range.start);
setSpan: function(span, range) { if(this.isVertical()) { span.style.top = this.translateToPx(range.start); span.style.height = this.translateToPx(range.end - range.start); } else { span.style.left = this.translateToPx(range.start); span.style.width = this.translateToPx(range.end - range.start); } },
for (name in style)
for (var name in style)
setStyle: function(element, style) { element = $(element); for (name in style) element.style[name.camelize()] = style[name]; },
else this.style[property.camelCase()] = value;
else this.style[property.camelCase()] = (value.push) ? value.rgbToHex() : value;
setStyle: function(property, value){ if (property == 'opacity') this.setOpacity(parseFloat(value)); else this.style[property.camelCase()] = value; return this; },
this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b";
this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b"+ctrl('O')+ctrl('U')+ctrl('T')+ctrl('K')+ctrl('P');
function Settingsmenu(){ var width=18; this.items=new Array(); this.xpos=30; this.ypos=2; this.lpadding="\xb3"; this.rpadding="\xb3"; this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b"; this.add(top_bar(width),undefined,undefined,"",""); this.add("|User Configuration","U",width); this.add("Minute |Bank","B",width); this.add(bottom_bar(width),undefined,undefined,"",""); this.timeout=100; this.callback=message_callback;}
this.transforms = this.options.style.parseStyle().map(function(property){ var originalValue = this.element.getStyle(property[0]);
this.transforms = this.style.map(function(pair){ var property = pair[0].underscore().dasherize(), value = pair[1], unit = null; if(value.parseColor('#zzzzzz') != '#zzzzzz') { value = value.parseColor(); unit = 'color'; } else if(property == 'opacity') { value = parseFloat(value); if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); } else if(Element.CSS_LENGTH.test(value)) var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; var originalValue = this.element.getStyle(property);
setup: function(){ function parseColor(color){ if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; color = color.parseColor(); return $R(0,2).map(function(i){ return parseInt( color.slice(i*2+1,i*2+3), 16 ) }); } this.transforms = this.options.style.parseStyle().map(function(property){ var originalValue = this.element.getStyle(property[0]); return $H({ style: property[0], originalValue: property[1].unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: property[1].unit=='color' ? parseColor(property[1].value) : property[1].value, unit: property[1].unit }); }.bind(this)).reject(function(transform){ return ( (transform.originalValue == transform.targetValue) || ( transform.unit != 'color' && (isNaN(transform.originalValue) || isNaN(transform.targetValue)) ) ) }); },
style: property[0], originalValue: property[1].unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: property[1].unit=='color' ? parseColor(property[1].value) : property[1].value, unit: property[1].unit
style: property, originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: unit=='color' ? parseColor(value) : value, unit: unit
setup: function(){ function parseColor(color){ if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; color = color.parseColor(); return $R(0,2).map(function(i){ return parseInt( color.slice(i*2+1,i*2+3), 16 ) }); } this.transforms = this.options.style.parseStyle().map(function(property){ var originalValue = this.element.getStyle(property[0]); return $H({ style: property[0], originalValue: property[1].unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: property[1].unit=='color' ? parseColor(property[1].value) : property[1].value, unit: property[1].unit }); }.bind(this)).reject(function(transform){ return ( (transform.originalValue == transform.targetValue) || ( transform.unit != 'color' && (isNaN(transform.originalValue) || isNaN(transform.targetValue)) ) ) }); },
param_default("firstDay", 0);
param_default("dateText", null); param_default("firstDay", null);
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
if (!(params.flat || params.inputField || params.displayArea || params.button)) {
if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; }
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
if (update && typeof p.onUpdate == "function") p.onUpdate(cal);
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
cal.parseDate(dateEl.value || dateEl.innerHTML);
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
return cal;
Calendar.setup = function (params) { function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; param_default("inputField", null); param_default("displayArea", null); param_default("button", null); param_default("eventName", "click"); param_default("ifFormat", "%Y/%m/%d"); param_default("daFormat", "%Y/%m/%d"); param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined param_default("firstDay", 0); // defaults to "Sunday" first param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); param_default("flat", null); param_default("flatCallback", null); param_default("onSelect", null); param_default("onClose", null); param_default("onUpdate", null); param_default("date", null); param_default("showsTime", false); param_default("timeFormat", "24"); param_default("electric", true); param_default("step", 2); param_default("position", null); param_default("cache", false); param_default("showOthers", false); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { if (typeof params[tmp[i]] == "string") { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } if (!(params.flat || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); else alert("No flatCallback given -- doing nothing."); return false; } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") p.inputField.onchange(); } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); }; if (params.flat != null) { if (typeof params.flat == "string") params.flat = document.getElementById(params.flat); if (!params.flat) { alert("Calendar.setup:\n Flat specified but can't find parent."); return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); cal.create(params.flat); cal.show(); return false; } var triggerEl = params.button || params.displayArea || params.inputField; triggerEl["on" + params.eventName] = function() { var dateEl = params.inputField || params.displayArea; var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect, params.onClose || function(cal) { cal.hide(); }); cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.weekNumbers = params.weekNumbers; mustCreate = true; } else { if (params.date) cal.setDate(params.date); cal.hide(); } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; };};
return parseInt( ((!color || color=='transparent') ? '#ffffff' : color).parseColor().slice(i*2+1,i*2+3), 16 )
return parseInt( ((!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) ? '#ffffff' : color).parseColor().slice(i*2+1,i*2+3), 16 )
setup: function(){ function parseColor(color){ return $R(0,2).map(function(i){ return parseInt( ((!color || color=='transparent') ? '#ffffff' : color).parseColor().slice(i*2+1,i*2+3), 16 ) }); } this.transforms = this.options.style.split(';').map(function(style){ return style.parseStyle().map(function(property){ var originalValue = this.element.getStyle(property[0]); return $H({ style: property[0], originalValue: property[1].unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: property[1].unit=='color' ? parseColor(property[1].value) : property[1].value, unit: property[1].unit }); }.bind(this)); }.bind(this)).flatten(); },
this.commands.push(new Command('assertNotText', 'test', 'regexp:ab[cd]'));
function setUp() { this.formats = new FormatCollection({}); this.commands = []; this.commands.push(new Command('assertTextPresent', 'hello')); this.commands.push(new Command('assertTextNotPresent', 'hello')); this.commands.push(new Command('storeTextPresent', 'test', 'abc')); this.commands.push(new Command('waitForTextPresent', 'test')); this.commands.push(new Command('waitForTextNotPresent', 'test')); this.commands.push(new Command('assertText', 'abc', 'def')); this.commands.push(new Command('assertLocation', 'abc')); this.commands.push(new Command('assertNotLocation', 'abc')); this.commands.push(new Command('type', "theText", "javascript{'abc'}")); this.commands.push(new Command('assertSelectOptions', "theSelect", ",abc,ab\\,c")); this.commands.push(new Command('assertNotLocation', 'abc')); this.commands.push(new Command('storeText', 'abc', 'def')); this.commands.push(new Command('waitForText', 'abc', 'def')); this.commands.push(new Command('waitForNotValue', 'abc', 'regexp:foo.*')); this.commands.push(new Command('waitForNotText', 'abc', 'def')); this.commands.push(new Command('open', 'http://www.google.com/')); this.commands.push(new Command('waitForPageToLoad', '30000')); this.commands.push(new Command('pause', '1000')); this.commands.push(new Comment("line 1\nline 2"));}
var inst = tinyMCE.instances[editor_id];
var inst = tinyMCE.instances[editor_id], i;
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
if (!tinyMCE.isIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
inst.getDoc().body.setAttribute('id', 'mceSpanFonts');
inst.getBody().setAttribute('id', 'mceSpanFonts');
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
if (!tinyMCE.isMSIE)
if (!tinyMCE.isIE)
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
if (tinyMCE.isMSIE) {
if (tinyMCE.isIE) {
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
if (!tinyMCE.isMSIE) {
if (!tinyMCE.isIE) {
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
else { content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi");
else
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
}
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
tinyMCE.selectedInstance = inst;
inst.select();
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); }
if (n.nodeType == 3 || n.nodeType == 8) n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), "");
setupContent : function(editor_id) { var inst = tinyMCE.instances[editor_id]; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; // HTML values get XML encoded in strict mode if (tinyMCE.settings.strict_loading_mode) { content = content.replace(/&lt;/g, '<'); content = content.replace(/&gt;/g, '>'); content = content.replace(/&quot;/g, '"'); content = content.replace(/&amp;/g, '&'); } inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); return; } if (!head) { window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); return; } // Import theme specific content CSS the user specific tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); // Setup keyboard shortcuts if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); } // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; // Add on document element in Mozilla if (!tinyMCE.isMSIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); // Replace new line characters to BRs if (tinyMCE.settings['convert_newlines_to_brs']) { content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); } // Open closed anchors // content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>'); // Call custom cleanup code content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); if (tinyMCE.isMSIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) doc.styleSheets[0].addRule("p", "margin: 0;"); var body = inst.getBody(); body.editorId = editor_id; } content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 if (!tinyMCE.isMSIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); contentElement.innerHTML = content; // Remove weridness! if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) content = content.replace(new RegExp('&lt;&gt;', 'g'), ""); if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); else { // Convert all strong/em to b/i content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi"); content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi"); content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi"); content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi"); content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi"); tinyMCE.setInnerHTML(inst.getBody(), content); } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { if (tinyMCE.settings['cleanup_on_startup']) { tinyMCE._setHTML(inst.getDoc(), content); // Produces permission denied error in MSIE 5.5 eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); } else tinyMCE._setHTML(inst.getDoc(), content); } // Fix for bug #957681 //inst.getDoc().designMode = inst.getDoc().designMode; // Setup element references var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla if (!tinyMCE.isMSIE) tinyMCE.addEventHandlers(inst); // Add blur handler if (tinyMCE.isMSIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 // Workaround for drag drop/copy paste base href bug if (!tinyMCE.isOpera) { tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); } } // Trigger node change, this call locks buttons for tables and so forth tinyMCE.selectedInstance = inst; tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCE.cleanupAnchors(inst.getDoc()); if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(inst.getDoc()); inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); inst.undoRedo.add({ content : inst.startContent }); // Cleanup any mess left from storyAwayURLs if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { if (n.nodeType == 3 || n.nodeType == 8) { n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); } return false; }); } // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); tinyMCE.selectedInstance = inst; tinyMCE.triggerNodeChange(false, true); },
for (var index = 0; index < sourceSelect.options.length; index++) { var sourceOption = sourceSelect.options[index];
for (var sourceIndex = 0, targetIndex = 0; sourceIndex < sourceSelect.options.length; sourceIndex++) { var sourceOption = sourceSelect.options[sourceIndex];
function setupFolderOptions(sourceSelect, targetSelect, selectedOptionValue, excludedOptionValue) { targetSelect.length = 0; for (var index = 0; index < sourceSelect.options.length; index++) { var sourceOption = sourceSelect.options[index]; if (typeof excludedOptionValue == "undefined" || excludedOptionValue == "" || sourceOption.value.indexOf(excludedOptionValue) != 0) { targetSelect.options[index] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[index].className = sourceOption.className; if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[index].value == selectedOptionValue) { targetSelect.options[index].selected = true; } } }}
targetSelect.options[index] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[index].className = sourceOption.className;
targetSelect.options[targetIndex] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[targetIndex].className = sourceOption.className;
function setupFolderOptions(sourceSelect, targetSelect, selectedOptionValue, excludedOptionValue) { targetSelect.length = 0; for (var index = 0; index < sourceSelect.options.length; index++) { var sourceOption = sourceSelect.options[index]; if (typeof excludedOptionValue == "undefined" || excludedOptionValue == "" || sourceOption.value.indexOf(excludedOptionValue) != 0) { targetSelect.options[index] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[index].className = sourceOption.className; if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[index].value == selectedOptionValue) { targetSelect.options[index].selected = true; } } }}
if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[index].value == selectedOptionValue) { targetSelect.options[index].selected = true;
if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[targetIndex].value == selectedOptionValue) { targetSelect.options[targetIndex].selected = true;
function setupFolderOptions(sourceSelect, targetSelect, selectedOptionValue, excludedOptionValue) { targetSelect.length = 0; for (var index = 0; index < sourceSelect.options.length; index++) { var sourceOption = sourceSelect.options[index]; if (typeof excludedOptionValue == "undefined" || excludedOptionValue == "" || sourceOption.value.indexOf(excludedOptionValue) != 0) { targetSelect.options[index] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[index].className = sourceOption.className; if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[index].value == selectedOptionValue) { targetSelect.options[index].selected = true; } } }}
targetIndex++;
function setupFolderOptions(sourceSelect, targetSelect, selectedOptionValue, excludedOptionValue) { targetSelect.length = 0; for (var index = 0; index < sourceSelect.options.length; index++) { var sourceOption = sourceSelect.options[index]; if (typeof excludedOptionValue == "undefined" || excludedOptionValue == "" || sourceOption.value.indexOf(excludedOptionValue) != 0) { targetSelect.options[index] = new Option(sourceOption.text, sourceOption.value); targetSelect.options[index].className = sourceOption.className; if (!(typeof selectedOptionValue == "undefined") && targetSelect.options[index].value == selectedOptionValue) { targetSelect.options[index].selected = true; } } }}
this.moveTo();
this.draw();
setUrl: function(newUrl) { this.url = newUrl; this.moveTo(); },
this.activeHandle = this.handles[handleIdx]; this.activeHandleIdx = handleIdx;
this.activeHandleIdx = handleIdx || 0; this.activeHandle = this.handles[this.activeHandleIdx];
setValue: function(sliderValue, handleIdx){ if(!this.active) { this.activeHandle = this.handles[handleIdx]; this.activeHandleIdx = handleIdx; this.updateStyles(); } handleIdx = handleIdx || this.activeHandleIdx || 0; if(this.initialized && this.restricted) { if((handleIdx>0) && (sliderValue<this.values[handleIdx-1])) sliderValue = this.values[handleIdx-1]; if((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1])) sliderValue = this.values[handleIdx+1]; } sliderValue = this.getNearestValue(sliderValue); this.values[handleIdx] = sliderValue; this.value = this.values[0]; // assure backwards compat this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue); this.drawSpans(); if(!this.dragging || !this.event) this.updateFinished(); },
if(!this.event) this.updateFinished();
if(!this.dragging || !this.event) this.updateFinished();
setValue: function(sliderValue, handleIdx){ if(!this.active) { this.activeHandle = this.handles[handleIdx]; this.activeHandleIdx = handleIdx; this.updateStyles(); } handleIdx = handleIdx || this.activeHandleIdx || 0; if(this.initialized && this.restricted) { if((handleIdx>0) && (sliderValue<this.values[handleIdx-1])) sliderValue = this.values[handleIdx-1]; if((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1])) sliderValue = this.values[handleIdx+1]; } sliderValue = this.getNearestValue(sliderValue); this.values[handleIdx] = sliderValue; this.value = this.values[0]; // assure backwards compat this.handles[handleIdx].style[ this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue); this.drawSpans(); if(!this.event) this.updateFinished(); },
this.updateFinished();
if(!this.event) this.updateFinished();
setValue: function(sliderValue, handleIdx){ if(!this.active) { this.activeHandle = this.handles[handleIdx]; this.activeHandleIdx = handleIdx; this.updateStyles(); } handleIdx = handleIdx || this.activeHandleIdx || 0; if(this.initialized && this.restricted) { if((handleIdx>0) && (sliderValue<this.values[handleIdx-1])) sliderValue = this.values[handleIdx-1]; if((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1])) sliderValue = this.values[handleIdx+1]; } sliderValue = this.getNearestValue(sliderValue); this.values[handleIdx] = sliderValue; this.value = this.values[0]; // assure backwards compat this.handles[handleIdx].style[ this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue); this.drawSpans(); this.updateFinished(); },
setTimeout("reload()", 100);
setTimeout("reload()", 1000);
function setVid(xy){ document.location = "/setVideo?position="+xy; setTimeout("reload()", 100);}
setVisibility: function(visible) {
setVisibility: function(visible, noEvent) {
setVisibility: function(visible) { if (visible != this.getVisibility()) { this.div.style.display = (visible) ? "block" : "none"; if (this.map != null) { if (visible) { var extent = this.map.getExtent(); if (extent != null) { this.moveTo(this.map.getExtent()); } } this.map.events.triggerEvent("changelayer"); } } },
if (this.map != null) { if (visible) { var extent = this.map.getExtent(); if (extent != null) { this.moveTo(this.map.getExtent()); }
if ((visible) && (this.map != null)) { var extent = this.map.getExtent(); if (extent != null) { this.moveTo(this.map.getExtent());
setVisibility: function(visible) { if (visible != this.getVisibility()) { this.div.style.display = (visible) ? "block" : "none"; if (this.map != null) { if (visible) { var extent = this.map.getExtent(); if (extent != null) { this.moveTo(this.map.getExtent()); } } this.map.events.triggerEvent("changelayer"); } } },
} if ((this.map != null) && ((noEvent == null) || (noEvent == false))) {
setVisibility: function(visible) { if (visible != this.getVisibility()) { this.div.style.display = (visible) ? "block" : "none"; if (this.map != null) { if (visible) { var extent = this.map.getExtent(); if (extent != null) { this.moveTo(this.map.getExtent()); } } this.map.events.triggerEvent("changelayer"); } } },
setTimeout("reload()", 100);
setTimeout("reload()", 1000);
function setVol(xy){ document.location = "/setVolume?volume="+xy; setTimeout("reload()", 100);}
parent.update();
headerUpdate();
function setVol(xy){ document.location = "setVolume?volume="+xy; if (window.screen.width < 800) setTimeout("reload()", 1000); else parent.update();}
var s = document.forms[0].htmlSource;
var s = document.getElementById('htmlSource');
function setWrap(val) { var s = document.forms[0].htmlSource; s.wrap = val; if (tinyMCE.isGecko) { var v = s.value; var n = s.cloneNode(false); n.setAttribute("wrap", val); s.parentNode.replaceChild(n, s); n.value = v; }}
new Effect.MoveBy(element, 0, 20, { duration: 0.05, afterFinish: function(effect) {
element = $(element); var oldTop = element.style.top; var oldLeft = element.style.left; return new Effect.MoveBy(element, 0, 20, { duration: 0.05, afterFinishInternal: function(effect) {
Effect.Shake = function(element) { new Effect.MoveBy(element, 0, 20, { duration: 0.05, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -20, { duration: 0.05, afterFinish: function(effect) { }}) }}) }}) }}) }}) }});}
{ duration: 0.1, afterFinish: function(effect) {
{ duration: 0.1, afterFinishInternal: function(effect) {
Effect.Shake = function(element) { new Effect.MoveBy(element, 0, 20, { duration: 0.05, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -20, { duration: 0.05, afterFinish: function(effect) { }}) }}) }}) }}) }}) }});}
{ duration: 0.05, afterFinish: function(effect) {
{ duration: 0.05, afterFinishInternal: function(effect) { Element.undoPositioned(effect.element); effect.element.style.left = oldLeft; effect.element.style.top = oldTop;
Effect.Shake = function(element) { new Effect.MoveBy(element, 0, 20, { duration: 0.05, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, 40, { duration: 0.1, afterFinish: function(effect) { new Effect.MoveBy(effect.element, 0, -20, { duration: 0.05, afterFinish: function(effect) { }}) }}) }}) }}) }}) }});}
theObj.style.left = x; theObj.style.top = y;
theObj.style.left = x+'px'; theObj.style.top = y+'px';
function shiftTo(obj, x, y) { var theObj = getObject(obj); if (isNav4) { theObj.moveTo(x,y); } else if (isNav5) { theObj.style.left = x; theObj.style.top = y; } else { theObj.style.pixelLeft = x; theObj.style.pixelTop = y; }}
else testFailed(_a + " should be " + _bv + ". Was " + _av);
else { testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ")."); }
function shouldBe(_a, _b){ if (typeof _a != "string" || typeof _b != "string") debug("WARN: shouldBe() expects string arguments"); var exception; var _av; try { _av = eval(_a); } catch (e) { exception = e; } var _bv = eval(_b); if (exception) testFailed(_a + " should be " + _bv + ". Threw exception " + exception); else if (_av === _bv) testPassed(_a + " is " + _b); else testFailed(_a + " should be " + _bv + ". Was " + _av);}
testFailed(_a + " should throw exception " + _e + ". Thre exception " + exception + ".");
testFailed(_a + " should throw exception " + _e + ". Threw exception " + exception + ".");
function shouldThrow(_a, _e){ var exception; var _av; try { _av = eval(_a); } catch (e) { exception = e; } var _ev; if (_e) _ev = eval(_e); if (exception) { if (typeof _e == "undefined" || exception == _ev) testPassed(_a + " threw exception " + exception + "."); else testFailed(_a + " should throw exception " + _e + ". Thre exception " + exception + "."); } else if (typeof _av == "undefined") testFailed(_a + " should throw exception " + _e + ". Was undefined."); else testFailed(_a + " should throw exception " + _e + ". Was " + _av + ".");}
testFailed(_a + " should throw exception " + _e + ". Threw exception " + exception + ".");
testFailed(_a + " should throw exception " + _ev + ". Threw exception " + exception + ".");
function shouldThrow(_a, _e){ var exception; var _av; try { _av = eval(_a); } catch (e) { exception = e; } var _ev; if (_e) _ev = eval(_e); if (exception) { if (typeof _e == "undefined" || exception == _ev) testPassed(_a + " threw exception " + exception + "."); else testFailed(_a + " should throw exception " + _e + ". Threw exception " + exception + "."); } else if (typeof _av == "undefined") testFailed(_a + " should throw exception " + _e + ". Was undefined."); else testFailed(_a + " should throw exception " + _e + ". Was " + _av + ".");}
'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(apacity=0);" ' + 'src="javascript:;" frameborder="0" scrolling="no"></iframe>');
'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
show: function() { if(this.update.style.display=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && this.update.style.position=='absolute') { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(apacity=0);" ' + 'src="javascript:;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) { Position.clone(this.update, this.iefix); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); } },
Element.show(this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0)) { new Insertion.Before(this.update, '<iframe id="' + this.update.id + '_iefix" style="display:none;" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
if(this.update.style.display=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && this.update.style.position=='absolute') { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(apacity=0);" ' + 'src="javascript:;" frameborder="0" scrolling="no"></iframe>');
show: function() { Element.show(this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0)) { new Insertion.Before(this.update, '<iframe id="' + this.update.id + '_iefix" style="display:none;" src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); this.iefix.style.position = 'absolute'; this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; } if(this.iefix) { Position.clone(this.update, this.iefix); Element.show(this.iefix); } },
this.iefix.style.position = 'absolute'; this.iefix.style.zIndex = 1; this.update.style.zIndex = 2;
show: function() { Element.show(this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0)) { new Insertion.Before(this.update, '<iframe id="' + this.update.id + '_iefix" style="display:none;" src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); this.iefix.style.position = 'absolute'; this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; } if(this.iefix) { Position.clone(this.update, this.iefix); Element.show(this.iefix); } },
this.iefix.style.zIndex = 1; this.update.style.zIndex = 2;
show: function() { Element.show(this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0)) { new Insertion.Before(this.update, '<iframe id="' + this.update.id + '_iefix" style="display:none;" src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); this.iefix.style.position = 'absolute'; this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; } if(this.iefix) { Position.clone(this.update, this.iefix); Element.show(this.iefix); } },
collapse_link.innerHTML = 'Hide';
collapse_link.innerHTML = gettext('Hide');
show: function(fieldset_index) { var fs = document.getElementsByTagName('fieldset')[fieldset_index]; // Remove the class name that causes the "display: none". fs.className = fs.className.replace(CollapsedFieldsets.collapsed_re, ''); // Toggle the "Show" link to a "Hide" link var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); collapse_link.onclick = new Function('CollapsedFieldsets.hide('+fieldset_index+'); return false;'); collapse_link.innerHTML = 'Hide'; },
if(Droppables.isAffected(point, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { Droppables.activate(drop); throw $break; } }
if(Droppables.isAffected(point, element, drop)) affected.push(drop);
show: function(point, element) { if(!this.drops.length) return; if(this.last_active) this.deactivate(this.last_active); this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { Droppables.activate(drop); throw $break; } } }); },
if(affected.length>0) { drop = Droppables.findDeepestChild(affected); Position.within(drop.element, point[0], point[1]); if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); Droppables.activate(drop); }
show: function(point, element) { if(!this.drops.length) return; if(this.last_active) this.deactivate(this.last_active); this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { Droppables.activate(drop); throw $break; } } }); },
if(this.iefix) { Position.clone(this.update, this.iefix); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); }
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) { Position.clone(this.update, this.iefix); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); } },
if(this.include_scroll_offsets) Position.prepare();
Position.prepare();
show: function(event, element) { if(!this.drops) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); if(this.include_scroll_offsets) Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.is_affected(pX, pY, element, drop)) { if(drop.droppable.onHover) drop.droppable.onHover( element, drop, Position.overlap(drop.droppable.overlap, drop)); if(drop.droppable.greedy) { this.activate(drop); return; } } } while (i--); },
if(this.last_active) this.deactivate(this.last_active);
show: function(event, element) { if(!this.drops.length) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.isAffected(pX, pY, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { this.activate(drop); return; } } } while (i--); },
if(!this.drops) return;
if(!this.drops.length) return;
show: function(event, element) { if(!this.drops) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.isAffected(pX, pY, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { this.activate(drop); return; } } } while (i--); },
var vp, width, height;
var vp, width, height, yo;
show : function(x, y) { var vp, width, height; if (this.html == "") return; var html = ''; html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">'; html += this.html; html += '</table>'; this.contextMenuDiv.innerHTML = html; // Get dimensions this.contextMenuDiv.style.display = "block"; width = this.contextMenuDiv.offsetWidth; height = this.contextMenuDiv.offsetHeight; this.contextMenuDiv.style.display = "none"; if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { // Setup popup and show this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>"; this.pop.document.tinyMCE = tinyMCE; this.pop.document.contextMenu = this; this.pop.show(x, y, width, height); } else { vp = this.getViewPort(); this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px'; this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px'; this.contextMenuDiv.style.display = "block"; } },
this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px'; this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px';
yo = tinyMCE.isMSIE5_0 ? document.body.scrollTop : self.pageYOffset; this.contextMenuDiv.style.left = (x > vp.left + vp.width - width ? vp.left + vp.width - width : x) + 'px'; this.contextMenuDiv.style.top = (y > vp.top + vp.height - height ? vp.top + vp.height - height : y) + 'px';
show : function(x, y) { var vp, width, height; if (this.html == "") return; var html = ''; html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">'; html += this.html; html += '</table>'; this.contextMenuDiv.innerHTML = html; // Get dimensions this.contextMenuDiv.style.display = "block"; width = this.contextMenuDiv.offsetWidth; height = this.contextMenuDiv.offsetHeight; this.contextMenuDiv.style.display = "none"; if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { // Setup popup and show this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>"; this.pop.document.tinyMCE = tinyMCE; this.pop.document.contextMenu = this; this.pop.show(x, y, width, height); } else { vp = this.getViewPort(); this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px'; this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px'; this.contextMenuDiv.style.display = "block"; } },
'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) { Position.clone(this.update, this.iefix); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); } },
if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (Element.getStyle(this.update, 'position')=='absolute')) {
if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (Element.getStyle(this.update, 'position')=='absolute')) {
show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); },
function show(s) { if (!s) return; s.style.display = "block";
HTMLElement.prototype.show = function() { this.style.display = 'block';
function show(s) { if (!s) return; s.style.display = "block";}
this.scrollbar.style.display = null;
this.scrollbar.style.removeProperty("display");
AppleScrollbar.prototype.show = function() { this._track.style.display = "block"; this.scrollbar.style.display = null; if (this.hidden) { this.hidden = false; this.refresh(); } }
if(!this.drops) return;
if(!this.drops.length) return;
show: function(event, element) { if(!this.drops) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.is_affected(pX, pY, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { this.activate(drop); return; } } } while (i--); },
if(this.is_affected(pX, pY, element, drop)) {
if(this.isAffected(pX, pY, element, drop)) {
show: function(event, element) { if(!this.drops) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.is_affected(pX, pY, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { this.activate(drop); return; } } } while (i--); },
if(this.last_active) this.deactivate(this.last_active);
show: function(event, element) { if(!this.drops) return; var pX = Event.pointerX(event); var pY = Event.pointerY(event); Position.prepare(); var i = this.drops.length-1; do { var drop = this.drops[i]; if(this.is_affected(pX, pY, element, drop)) { if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if(drop.greedy) { this.activate(drop); return; } } } while (i--); },