/* file:jscripts/tiny_mce/classes/tinymce.js */ var tinymce = { majorVersion : '3', minorVersion : '0rc2', releaseDate : '2008-01-xx', _init : function() { var t = this, ua = navigator.userAgent, i, nl, n, base; // Browser checks t.isOpera = window.opera && opera.buildNumber; t.isWebKit = /WebKit/.test(ua); t.isOldWebKit = t.isWebKit && !window.getSelection().getRangeAt; t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(navigator.appName); t.isIE6 = t.isIE && /MSIE [56]/.test(ua); t.isGecko = !t.isWebKit && /Gecko/.test(ua); // t.isGecko3 = t.isGecko && /(Firefox|Minefield)\/[3-9]/.test(ua); t.isMac = ua.indexOf('Mac') != -1; // TinyMCE .NET webcontrol might be setting the values for TinyMCE if (window.tinyMCEPreInit) { t.suffix = tinyMCEPreInit.suffix; t.baseURL = tinyMCEPreInit.base; return; } // Get suffix and base t.suffix = ''; // If base element found, add that infront of baseURL nl = document.getElementsByTagName('base'); for (i=0; i : s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name // Create namespace for new class ns = t.createNS(s[3].replace(/\.\w+$/, '')); // Class already exists if (ns[cn]) return; // Make pure static class if (s[2] == 'static') { ns[cn] = p; if (this.onCreate) this.onCreate(s[2], s[3], ns[cn]); return; } // Create default constructor if (!p[cn]) { p[cn] = function() {}; de = 1; } // Add constructor and methods ns[cn] = p[cn]; t.extend(ns[cn].prototype, p); // Extend if (s[5]) { sp = t.resolve(s[5]).prototype; scn = s[5].match(/\.(\w+)$/i)[1]; // Class name // Extend constructor c = ns[cn]; if (de) { // Add passthrough constructor ns[cn] = function() { return sp[scn].apply(this, arguments); }; } else { // Add inherit constructor ns[cn] = function() { this.parent = sp[scn]; return c.apply(this, arguments); }; } ns[cn].prototype[cn] = ns[cn]; // Add super methods t.each(sp, function(f, n) { if (n != scn) ns[cn].prototype[n] = sp[n]; }); // Add overridden methods t.each(p, function(f, n) { // Extend methods if needed if (sp[n]) { ns[cn].prototype[n] = function() { this.parent = sp[n]; return f.apply(this, arguments); }; } else { if (n != cn) ns[cn].prototype[n] = f; } }); } // Add static methods t.each(p['static'], function(f, n) { ns[cn][n] = f; }); if (this.onCreate) this.onCreate(s[2], s[3], ns[cn].prototype); }, walk : function(o, f, n, s) { s = s || this; if (o) { if (n) o = o[n]; tinymce.each(o, function(o, i) { if (f.call(s, o, i, n) === false) return false; tinymce.walk(o, f, n, s); }); } }, createNS : function(n, o) { var i, v; o = o || window; n = n.split('.'); for (i=0; i= items.length) { for (i = 0; i < base.length; i++) { if (i >= items.length || base[i] != items[i]) { bp = i + 1; break; } } } if (base.length < items.length) { for (i = 0; i < items.length; i++) { if (i >= base.length || base[i] != items[i]) { bp = i + 1; break; } } } if (bp == 1) return path; for (i = 0; i < base.length - (bp - 1); i++) out += "../"; for (i = bp - 1; i < items.length; i++) { if (i != bp - 1) out += "/" + items[i]; else out += items[i]; } return out; }, toAbsPath : function(base, path) { var i, nb = 0, o = []; // Split paths base = base.split('/'); path = path.split('/'); // Remove empty chunks each(base, function(k) { if (k) o.push(k); }); base = o; // Merge relURLParts chunks for (i = path.length - 1, o = []; i >= 0; i--) { // Ignore empty or . if (path[i].length == 0 || path[i] == ".") continue; // Is parent if (path[i] == '..') { nb++; continue; } // Move up if (nb > 0) { nb--; continue; } o.push(path[i]); } i = base.length - nb; // If /a/b/c or / if (i <= 0) return '/' + o.reverse().join('/'); return '/' + base.slice(0, i).join('/') + '/' + o.reverse().join('/'); }, getURI : function(nh) { var s, t = this; // Rebuild source if (!t.source || nh) { s = ''; if (!nh) { if (t.protocol) s += t.protocol + '://'; if (t.userInfo) s += t.userInfo + '@'; if (t.host) s += t.host; if (t.port) s += ':' + t.port; } if (t.path) s += t.path; if (t.query) s += '?' + t.query; if (t.anchor) s += '#' + t.anchor; t.source = s; } return t.source; } }); })(); /* file:jscripts/tiny_mce/classes/util/Cookie.js */ (function() { var each = tinymce.each; tinymce.create('static tinymce.util.Cookie', { getHash : function(n) { var v = this.get(n), h; if (v) { each(v.split('&'), function(v) { v = v.split('='); h = h || {}; h[unescape(v[0])] = unescape(v[1]); }); } return h; }, setHash : function(n, v, e, p, d, s) { var o = ''; each(v, function(v, k) { o += (!o ? '' : '&') + escape(k) + '=' + escape(v); }); this.set(n, o, e, p, d, s); }, get : function(n) { var c = document.cookie, e, p = n + "=", b; // Strict mode if (!c) return; b = c.indexOf("; " + p); if (b == -1) { b = c.indexOf(p); if (b != 0) return null; } else b += 2; e = c.indexOf(";", b); if (e == -1) e = c.length; return unescape(c.substring(b + p.length, e)); }, set : function(n, v, e, p, d, s) { document.cookie = n + "=" + escape(v) + ((e) ? "; expires=" + e.toGMTString() : "") + ((p) ? "; path=" + escape(p) : "") + ((d) ? "; domain=" + d : "") + ((s) ? "; secure" : ""); }, remove : function(n, p) { var d = new Date(); d.setTime(d.getTime() - 1000); this.set(n, '', d, p, d); } }); })(); /* file:jscripts/tiny_mce/classes/util/JSON.js */ tinymce.create('static tinymce.util.JSON', { serialize : function(o) { var i, v, s = tinymce.util.JSON.serialize, t; if (o == null) return 'null'; t = typeof o; if (t == 'string') { v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g, function(a, b) { i = v.indexOf(b); if (i + 1) return '\\' + v.charAt(i + 1); a = b.charCodeAt().toString(16); return '\\u' + '0000'.substring(a.length) + a; }) + '"'; } if (t == 'object') { if (o instanceof Array) { for (i=0, v = '['; i 0 ? ',' : '') + s(o[i]); return v + ']'; } v = '{'; for (i in o) v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; return v + '}'; } return '' + o; }, parse : function(s) { try { return eval('(' + s + ')'); } catch (ex) { // Ignore } } }); /* file:jscripts/tiny_mce/classes/util/XHR.js */ tinymce.create('static tinymce.util.XHR', { send : function(o) { var x, t, w = window, c = 0; // Default settings o.scope = o.scope || this; o.success_scope = o.success_scope || o.scope; o.error_scope = o.error_scope || o.scope; o.async = o.async === false ? false : true; o.data = o.data || ''; function get(s) { x = 0; try { x = new ActiveXObject(s); } catch (ex) { } return x; }; x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); if (x) { if (x.overrideMimeType) x.overrideMimeType(o.content_type); x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); if (o.content_type) x.setRequestHeader('Content-Type', o.content_type); x.send(o.data); // Wait for response, onReadyStateChange can not be used since it leaks memory in IE t = w.setInterval(function() { if (x.readyState == 4 || c++ > 10000) { w.clearInterval(t); if (o.success && c < 10000 && x.status == 200) o.success.call(o.success_scope, '' + x.responseText, x, o); else if (o.error) o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); x = null; } }, 10); } } }); /* file:jscripts/tiny_mce/classes/util/JSONRequest.js */ (function() { var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; tinymce.create('tinymce.util.JSONRequest', { JSONRequest : function(s) { this.settings = extend({ }, s); this.count = 0; }, send : function(o) { var ecb = o.error, scb = o.success; o = extend(this.settings, o); o.success = function(c, x) { c = JSON.parse(c); if (typeof(c) == 'undefined') { c = { error : 'JSON Parse error.' }; } if (c.error) ecb.call(o.error_scope || o.scope, c.error, x); else scb.call(o.success_scope || o.scope, c.result); }; o.error = function(ty, x) { ecb.call(o.error_scope || o.scope, ty, x); }; o.data = JSON.serialize({ id : o.id || 'c' + (this.count++), method : o.method, params : o.params }); XHR.send(o); }, 'static' : { sendRPC : function(o) { return new tinymce.util.JSONRequest().send(o); } } }); }()); /* file:jscripts/tiny_mce/classes/dom/DOMUtils.js */ (function() { // Shorten names var each = tinymce.each, is = tinymce.is; var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE; tinymce.create('tinymce.dom.DOMUtils', { doc : null, root : null, files : null, listeners : {}, pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, cache : {}, idPattern : /^#[\w]+$/, elmPattern : /^[\w_*]+$/, elmClassPattern : /^([\w_]*)\.([\w_]+)$/, DOMUtils : function(d, s) { var t = this; t.doc = d; t.files = {}; t.cssFlicker = false; t.counter = 0; t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; this.settings = s = tinymce.extend({ keep_values : false, hex_colors : 1 }, s); // Fix IE6SP2 flicker and check it failed for pre SP2 if (tinymce.isIE6) { try { d.execCommand('BackgroundImageCache', false, true); } catch (e) { t.cssFlicker = true; } } tinymce.addUnload(function() { t.doc = t.root = null; }); }, getRoot : function() { var t = this, s = t.settings; return (s && t.get(s.root_element)) || t.doc.body; }, getViewPort : function(w) { var d, b; w = !w ? window : w; d = w.document; b = this.boxModel ? d.documentElement : d.body; // Returns viewport size excluding scrollbars return { x : w.pageXOffset || b.scrollLeft, y : w.pageYOffset || b.scrollTop, w : w.innerWidth || b.clientWidth, h : w.innerHeight || b.clientHeight }; }, getRect : function(e) { var p, t = this, w, h; e = t.get(e); p = t.getPos(e); w = t.getStyle(e, 'width'); h = t.getStyle(e, 'height'); // Non pixel value, then force offset/clientWidth if (w.indexOf('px') === -1) w = 0; // Non pixel value, then force offset/clientWidth if (h.indexOf('px') === -1) h = 0; return { x : p.x, y : p.y, w : parseInt(w) || e.offsetWidth || e.clientWidth, h : parseInt(h) || e.offsetHeight || e.clientHeight }; }, getParent : function(n, f, r) { var na, se = this.settings; n = this.get(n); if (se.strict_root) r = r || this.getRoot(); // Wrap node name as func if (is(f, 'string')) { na = f.toUpperCase(); f = function(n) { var s = false; // Any element if (n.nodeType == 1 && na === '*') { s = true; return false; } each(na.split(','), function(v) { if (n.nodeType == 1 && ((se.strict && n.nodeName.toUpperCase() == v) || n.nodeName == v)) { s = true; return false; // Break loop } }); return s; }; } while (n) { if (n == r) return null; if (f(n)) return n; n = n.parentNode; } return null; }, get : function(e) { if (typeof(e) == 'string') return this.doc.getElementById(e); return e; }, // #if !jquery select : function(pa, s) { var t = this, cs, c, pl, o = [], x, i, l, n; s = t.get(s) || t.doc; if (t.settings.strict) { function get(s, n) { return s.getElementsByTagName(n.toLowerCase()); }; } else { function get(s, n) { return s.getElementsByTagName(n); }; } // Simple element pattern. For example: "p" or "*" if (t.elmPattern.test(pa)) { x = get(s, pa); for (i = 0, l = x.length; i= 0; i--) cs += '}, ' + (i ? 'n' : 's') + ');'; cs += '})'; // Compile CSS pattern function t.cache[pa] = cs = eval(cs); } // Run selector function cs(isIE ? collectIE : collect, s); }); // Cleanup each(o, function(n) { if (isIE) n.removeAttribute('mce_save'); else delete n.mce_save; }); return o; }, // #endif add : function(p, n, a, h, c) { var t = this; return this.run(p, function(p) { var e, k; e = is(n, 'string') ? t.doc.createElement(n) : n; if (a) { for (k in a) { if (a.hasOwnProperty(k) && !is(a[k], 'object')) t.setAttrib(e, k, '' + a[k]); } if (a.style && !is(a.style, 'string')) { each(a.style, function(v, n) { t.setStyle(e, n, v); }); } } if (h) { if (h.nodeType) e.appendChild(h); else e.innerHTML = h; } return !c ? p.appendChild(e) : e; }); }, create : function(n, a, h) { return this.add(this.doc.createElement(n), n, a, h, 1); }, createHTML : function(n, a, h) { var o = '', t = this, k; o += '<' + n; for (k in a) { if (a.hasOwnProperty(k)) o += ' ' + k + '="' + t.encode(a[k]) + '"'; } if (tinymce.is(h)) return o + '>' + h + ''; return o + ' />'; }, remove : function(n, k) { return this.run(n, function(n) { var p; p = n.parentNode; if (!p) return null; if (k) { each (n.childNodes, function(c) { p.insertBefore(c.cloneNode(true), n); }); } return p.removeChild(n); }); }, // #if !jquery setStyle : function(n, na, v) { var t = this; return t.run(n, function(e) { var s, i; s = e.style; // Camelcase it, if needed na = na.replace(/-(\D)/g, function(a, b){ return b.toUpperCase(); }); // Default px suffix on these if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) v += 'px'; switch (na) { case 'opacity': // IE specific opacity if (isIE) { s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; if (!n.currentStyle || !n.currentStyle.hasLayout) s.display = 'inline-block'; } // Fix for older browsers s['-moz-opacity'] = s['-khtml-opacity'] = v; break; case 'float': isIE ? s.styleFloat = v : s.cssFloat = v; break; } s[na] = v || ''; // Force update of the style data if (t.settings.update_styles) t.setAttrib(e, 'mce_style'); }); }, getStyle : function(n, na, c) { n = this.get(n); if (!n) return false; // Gecko if (this.doc.defaultView && c) { // Remove camelcase na = na.replace(/[A-Z]/g, function(a){ return '-' + a; }); try { return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); } catch (ex) { // Old safari might fail return null; } } // Camelcase it, if needed na = na.replace(/-(\D)/g, function(a, b){ return b.toUpperCase(); }); if (na == 'float') na = isIE ? 'styleFloat' : 'cssFloat'; // IE & Opera if (n.currentStyle && c) return n.currentStyle[na]; return n.style[na]; }, setStyles : function(e, o) { var t = this, s = t.settings, ol; ol = s.update_styles; s.update_styles = 0; each(o, function(v, n) { t.setStyle(e, n, v); }); // Update style info s.update_styles = ol; if (s.update_styles) t.setAttrib(e, s.cssText); }, setAttrib : function(e, n, v) { var t = this; // Strict XML mode if (t.settings.strict) n = n.toLowerCase(); return this.run(e, function(e) { var s = t.settings; switch (n) { case "style": if (s.keep_values) { if (v) e.setAttribute('mce_style', v, 2); else e.removeAttribute('mce_style', 2); } e.style.cssText = v; break; case "class": e.className = v; break; case "src": case "href": if (s.keep_values) { if (s.url_converter) v = s.url_converter.call(s.url_converter_scope || t, v, n, e); t.setAttrib(e, 'mce_' + n, v, 2); } break; } if (is(v) && v !== null && v.length !== 0) e.setAttribute(n, '' + v, 2); else e.removeAttribute(n, 2); }); }, setAttribs : function(e, o) { var t = this; return this.run(e, function(e) { each(o, function(v, n) { t.setAttrib(e, n, v); }); }); }, // #endif getAttrib : function(e, n, dv) { var v, t = this; e = t.get(e); if (!e) return false; if (!is(dv)) dv = ""; // Try the mce variant for these if (/^(src|href|style)$/.test(n)) { v = e.getAttribute("mce_" + n); if (v) return v; } v = e.getAttribute(n, 2); if (!v) { switch (n) { case 'class': v = e.className; break; default: v = e.attributes[n]; v = v && is(v.nodeValue) ? v.nodeValue : v; } } switch (n) { case 'style': v = v || e.style.cssText; if (v) { v = t.serializeStyle(t.parseStyle(v)); if (t.settings.keep_values) e.setAttribute('mce_style', v); } break; } // Remove Apple and WebKit stuff if (isWebKit && n === "class" && v) v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); // Handle IE issues if (isIE) { switch (n) { case 'rowspan': case 'colspan': // IE returns 1 as default value if (v === 1) v = ''; break; case 'size': // IE returns +0 as default value for size if (v === '+0') v = ''; break; case 'hspace': // IE returns -1 as default value if (v === -1) v = ''; break; case 'tabindex': // IE returns 32768 as default value if (v === 32768) v = ''; break; default: // IE has odd anonymous function for event attributes if (n.indexOf('on') === 0 && v) v = ('' + v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/, '$1'); } } return (v && v != '') ? '' + v : dv; }, getPos : function(n) { var t = this, x = 0, y = 0, e, d = t.doc; n = t.get(n); // Use getBoundingClientRect on IE, Opera has it but it's not perfect if (n && isIE) { n = n.getBoundingClientRect(); e = t.boxModel ? d.documentElement : d.body; x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; n.top += window.self != window.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; } while (n) { x += n.offsetLeft || 0; y += n.offsetTop || 0; x -= n.scrollLeft || 0; y -= n.scrollTop || 0; n = n.offsetParent; } return {x : x, y : y}; }, parseStyle : function(st) { var t = this, s = t.settings, o = {}; if (!st) return o; function compress(p, s, ot) { var t, r, b, l; // Get values and check it it needs compressing t = o[p + '-top' + s]; if (!t) return; r = o[p + '-right' + s]; if (t != r) return; b = o[p + '-bottom' + s]; if (r != b) return; l = o[p + '-left' + s]; if (b != l) return; // Compress o[ot] = l; delete o[p + '-top' + s]; delete o[p + '-right' + s]; delete o[p + '-bottom' + s]; delete o[p + '-left' + s]; }; function compress2(ta, a, b, c) { var t; t = o[a]; if (!t) return; t = o[b]; if (!t) return; t = o[c]; if (!t) return; // Compress o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; delete o[a]; delete o[b]; delete o[c]; }; each(st.split(';'), function(v) { var sv, ur = []; if (v) { v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); v = v.split(':'); sv = tinymce.trim(v[1]); sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { return t.toHex(v); }); if (s.url_converter) { sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null)) + ')'; }); } o[tinymce.trim(v[0]).toLowerCase()] = sv; } }); compress("border", "", "border"); compress("border", "-width", "border-width"); compress("border", "-color", "border-color"); compress("border", "-style", "border-style"); compress("padding", "", "padding"); compress("margin", "", "margin"); compress2('border', 'border-width', 'border-style', 'border-color'); return o; }, serializeStyle : function(o) { var s = ''; each(o, function(v, k) { if (k && v) { switch (k) { case 'color': case 'background-color': v = v.toLowerCase(); break; } s += (s ? ' ' : '') + k + ': ' + v + ';'; } }); return s; }, loadCSS : function(u) { var t = this, d = this.doc; if (!u) u = ''; each(u.split(','), function(u) { if (t.files[u]) return; t.files[u] = true; if (!d.createStyleSheet) t.add(t.select('head')[0], 'link', {rel : 'stylesheet', href : u}); else d.createStyleSheet(u); }); }, // #if !jquery addClass : function(e, c) { return this.run(e, function(e) { var o; if (!c) return 0; if (this.hasClass(e, c)) return e.className; o = this.removeClass(e, c); return e.className = (o != '' ? (o + ' ') : '') + c; }); }, removeClass : function(e, c) { var t = this, re; return t.run(e, function(e) { var v; if (t.hasClass(e, c)) { if (!re) re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); v = e.className.replace(re, ' '); return e.className = tinymce.trim(v != ' ' ? v : ''); } return e.className; }); }, hasClass : function(n, c) { n = this.get(n); if (!n || !c) return false; return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; }, show : function(e) { return this.setStyle(e, 'display', 'block'); }, hide : function(e) { return this.setStyle(e, 'display', 'none'); }, isHidden : function(e) { e = this.get(e); return e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; }, // #endif uniqueId : function(p) { return (!p ? 'mce_' : p) + (this.counter++); }, setHTML : function(e, h) { var t = this; return this.run(e, function(e) { var r; h = t.processHTML(h); if (isIE) { e.innerHTML = '
' + h; e.removeChild(e.firstChild); } else e.innerHTML = h; return h; }); }, processHTML : function(h) { var t = this, s = t.settings; // Convert strong and em to b and i in FF since it can't handle them if (tinymce.isGecko) { h = h.replace(/<(\/?)strong>|]+)>/gi, '<$1b$2>'); h = h.replace(/<(\/?)em>|]+)>/gi, '<$1i$2>'); } // Fix some issues h = h.replace(/<(a)([^>]*)\/>/gi, '<$1$2>'); // Force open // Store away src and href in mce_src and mce_href since browsers mess them up if (s.keep_values) { // Wrap scripts in comments for serialization purposes if (h.indexOf('/g, '