summaryrefslogtreecommitdiffstats
path: root/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/tinymce/jscripts/tiny_mce/themes/advanced/js')
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js72
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js37
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js325
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js253
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js245
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js155
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js62
7 files changed, 1149 insertions, 0 deletions
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js
new file mode 100644
index 0000000..5cee9ed
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js
@@ -0,0 +1,72 @@
+tinyMCEPopup.requireLangPack();
+
+function init() {
+ var ed, tcont;
+
+ tinyMCEPopup.resizeToInnerSize();
+ ed = tinyMCEPopup.editor;
+
+ // Give FF some time
+ window.setTimeout(insertHelpIFrame, 10);
+
+ tcont = document.getElementById('plugintablecontainer');
+ document.getElementById('plugins_tab').style.display = 'none';
+
+ var html = "";
+ html += '<table id="plugintable">';
+ html += '<thead>';
+ html += '<tr>';
+ html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';
+ html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';
+ html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';
+ html += '</tr>';
+ html += '</thead>';
+ html += '<tbody>';
+
+ tinymce.each(ed.plugins, function(p, n) {
+ var info;
+
+ if (!p.getInfo)
+ return;
+
+ html += '<tr>';
+
+ info = p.getInfo();
+
+ if (info.infourl != null && info.infourl != '')
+ html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';
+ else
+ html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';
+
+ if (info.authorurl != null && info.authorurl != '')
+ html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';
+ else
+ html += '<td width="35%">' + info.author + '</td>';
+
+ html += '<td width="15%">' + info.version + '</td>';
+ html += '</tr>';
+
+ document.getElementById('plugins_tab').style.display = '';
+
+ });
+
+ html += '</tbody>';
+ html += '</table>';
+
+ tcont.innerHTML = html;
+
+ tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
+ tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;
+}
+
+function insertHelpIFrame() {
+ var html;
+
+ if (tinyMCEPopup.getParam('docs_url')) {
+ html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
+ document.getElementById('iframecontainer').innerHTML = html;
+ document.getElementById('help_tab').style.display = 'block';
+ }
+}
+
+tinyMCEPopup.onInit.add(init);
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js
new file mode 100644
index 0000000..b5efd1e
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js
@@ -0,0 +1,37 @@
+tinyMCEPopup.requireLangPack();
+
+var AnchorDialog = {
+ init : function(ed) {
+ var action, elm, f = document.forms[0];
+
+ this.editor = ed;
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
+ v = ed.dom.getAttrib(elm, 'name');
+
+ if (v) {
+ this.action = 'update';
+ f.anchorName.value = v;
+ }
+
+ f.insert.value = ed.getLang(elm ? 'update' : 'insert');
+ },
+
+ update : function() {
+ var ed = this.editor;
+
+ tinyMCEPopup.restoreSelection();
+
+ if (this.action != 'update')
+ ed.selection.collapse(1);
+
+ // Webkit acts weird if empty inline element is inserted so we need to use a image instead
+ if (tinymce.isWebKit)
+ ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
+ else
+ ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));
+
+ tinyMCEPopup.close();
+ }
+};
+
+tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js
new file mode 100644
index 0000000..8467ef6
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js
@@ -0,0 +1,325 @@
+tinyMCEPopup.requireLangPack();
+
+var charmap = [
+ ['&nbsp;', '&#160;', true, 'no-break space'],
+ ['&amp;', '&#38;', true, 'ampersand'],
+ ['&quot;', '&#34;', true, 'quotation mark'],
+// finance
+ ['&cent;', '&#162;', true, 'cent sign'],
+ ['&euro;', '&#8364;', true, 'euro sign'],
+ ['&pound;', '&#163;', true, 'pound sign'],
+ ['&yen;', '&#165;', true, 'yen sign'],
+// signs
+ ['&copy;', '&#169;', true, 'copyright sign'],
+ ['&reg;', '&#174;', true, 'registered sign'],
+ ['&trade;', '&#8482;', true, 'trade mark sign'],
+ ['&permil;', '&#8240;', true, 'per mille sign'],
+ ['&micro;', '&#181;', true, 'micro sign'],
+ ['&middot;', '&#183;', true, 'middle dot'],
+ ['&bull;', '&#8226;', true, 'bullet'],
+ ['&hellip;', '&#8230;', true, 'three dot leader'],
+ ['&prime;', '&#8242;', true, 'minutes / feet'],
+ ['&Prime;', '&#8243;', true, 'seconds / inches'],
+ ['&sect;', '&#167;', true, 'section sign'],
+ ['&para;', '&#182;', true, 'paragraph sign'],
+ ['&szlig;', '&#223;', true, 'sharp s / ess-zed'],
+// quotations
+ ['&lsaquo;', '&#8249;', true, 'single left-pointing angle quotation mark'],
+ ['&rsaquo;', '&#8250;', true, 'single right-pointing angle quotation mark'],
+ ['&laquo;', '&#171;', true, 'left pointing guillemet'],
+ ['&raquo;', '&#187;', true, 'right pointing guillemet'],
+ ['&lsquo;', '&#8216;', true, 'left single quotation mark'],
+ ['&rsquo;', '&#8217;', true, 'right single quotation mark'],
+ ['&ldquo;', '&#8220;', true, 'left double quotation mark'],
+ ['&rdquo;', '&#8221;', true, 'right double quotation mark'],
+ ['&sbquo;', '&#8218;', true, 'single low-9 quotation mark'],
+ ['&bdquo;', '&#8222;', true, 'double low-9 quotation mark'],
+ ['&lt;', '&#60;', true, 'less-than sign'],
+ ['&gt;', '&#62;', true, 'greater-than sign'],
+ ['&le;', '&#8804;', true, 'less-than or equal to'],
+ ['&ge;', '&#8805;', true, 'greater-than or equal to'],
+ ['&ndash;', '&#8211;', true, 'en dash'],
+ ['&mdash;', '&#8212;', true, 'em dash'],
+ ['&macr;', '&#175;', true, 'macron'],
+ ['&oline;', '&#8254;', true, 'overline'],
+ ['&curren;', '&#164;', true, 'currency sign'],
+ ['&brvbar;', '&#166;', true, 'broken bar'],
+ ['&uml;', '&#168;', true, 'diaeresis'],
+ ['&iexcl;', '&#161;', true, 'inverted exclamation mark'],
+ ['&iquest;', '&#191;', true, 'turned question mark'],
+ ['&circ;', '&#710;', true, 'circumflex accent'],
+ ['&tilde;', '&#732;', true, 'small tilde'],
+ ['&deg;', '&#176;', true, 'degree sign'],
+ ['&minus;', '&#8722;', true, 'minus sign'],
+ ['&plusmn;', '&#177;', true, 'plus-minus sign'],
+ ['&divide;', '&#247;', true, 'division sign'],
+ ['&frasl;', '&#8260;', true, 'fraction slash'],
+ ['&times;', '&#215;', true, 'multiplication sign'],
+ ['&sup1;', '&#185;', true, 'superscript one'],
+ ['&sup2;', '&#178;', true, 'superscript two'],
+ ['&sup3;', '&#179;', true, 'superscript three'],
+ ['&frac14;', '&#188;', true, 'fraction one quarter'],
+ ['&frac12;', '&#189;', true, 'fraction one half'],
+ ['&frac34;', '&#190;', true, 'fraction three quarters'],
+// math / logical
+ ['&fnof;', '&#402;', true, 'function / florin'],
+ ['&int;', '&#8747;', true, 'integral'],
+ ['&sum;', '&#8721;', true, 'n-ary sumation'],
+ ['&infin;', '&#8734;', true, 'infinity'],
+ ['&radic;', '&#8730;', true, 'square root'],
+ ['&sim;', '&#8764;', false,'similar to'],
+ ['&cong;', '&#8773;', false,'approximately equal to'],
+ ['&asymp;', '&#8776;', true, 'almost equal to'],
+ ['&ne;', '&#8800;', true, 'not equal to'],
+ ['&equiv;', '&#8801;', true, 'identical to'],
+ ['&isin;', '&#8712;', false,'element of'],
+ ['&notin;', '&#8713;', false,'not an element of'],
+ ['&ni;', '&#8715;', false,'contains as member'],
+ ['&prod;', '&#8719;', true, 'n-ary product'],
+ ['&and;', '&#8743;', false,'logical and'],
+ ['&or;', '&#8744;', false,'logical or'],
+ ['&not;', '&#172;', true, 'not sign'],
+ ['&cap;', '&#8745;', true, 'intersection'],
+ ['&cup;', '&#8746;', false,'union'],
+ ['&part;', '&#8706;', true, 'partial differential'],
+ ['&forall;', '&#8704;', false,'for all'],
+ ['&exist;', '&#8707;', false,'there exists'],
+ ['&empty;', '&#8709;', false,'diameter'],
+ ['&nabla;', '&#8711;', false,'backward difference'],
+ ['&lowast;', '&#8727;', false,'asterisk operator'],
+ ['&prop;', '&#8733;', false,'proportional to'],
+ ['&ang;', '&#8736;', false,'angle'],
+// undefined
+ ['&acute;', '&#180;', true, 'acute accent'],
+ ['&cedil;', '&#184;', true, 'cedilla'],
+ ['&ordf;', '&#170;', true, 'feminine ordinal indicator'],
+ ['&ordm;', '&#186;', true, 'masculine ordinal indicator'],
+ ['&dagger;', '&#8224;', true, 'dagger'],
+ ['&Dagger;', '&#8225;', true, 'double dagger'],
+// alphabetical special chars
+ ['&Agrave;', '&#192;', true, 'A - grave'],
+ ['&Aacute;', '&#193;', true, 'A - acute'],
+ ['&Acirc;', '&#194;', true, 'A - circumflex'],
+ ['&Atilde;', '&#195;', true, 'A - tilde'],
+ ['&Auml;', '&#196;', true, 'A - diaeresis'],
+ ['&Aring;', '&#197;', true, 'A - ring above'],
+ ['&AElig;', '&#198;', true, 'ligature AE'],
+ ['&Ccedil;', '&#199;', true, 'C - cedilla'],
+ ['&Egrave;', '&#200;', true, 'E - grave'],
+ ['&Eacute;', '&#201;', true, 'E - acute'],
+ ['&Ecirc;', '&#202;', true, 'E - circumflex'],
+ ['&Euml;', '&#203;', true, 'E - diaeresis'],
+ ['&Igrave;', '&#204;', true, 'I - grave'],
+ ['&Iacute;', '&#205;', true, 'I - acute'],
+ ['&Icirc;', '&#206;', true, 'I - circumflex'],
+ ['&Iuml;', '&#207;', true, 'I - diaeresis'],
+ ['&ETH;', '&#208;', true, 'ETH'],
+ ['&Ntilde;', '&#209;', true, 'N - tilde'],
+ ['&Ograve;', '&#210;', true, 'O - grave'],
+ ['&Oacute;', '&#211;', true, 'O - acute'],
+ ['&Ocirc;', '&#212;', true, 'O - circumflex'],
+ ['&Otilde;', '&#213;', true, 'O - tilde'],
+ ['&Ouml;', '&#214;', true, 'O - diaeresis'],
+ ['&Oslash;', '&#216;', true, 'O - slash'],
+ ['&OElig;', '&#338;', true, 'ligature OE'],
+ ['&Scaron;', '&#352;', true, 'S - caron'],
+ ['&Ugrave;', '&#217;', true, 'U - grave'],
+ ['&Uacute;', '&#218;', true, 'U - acute'],
+ ['&Ucirc;', '&#219;', true, 'U - circumflex'],
+ ['&Uuml;', '&#220;', true, 'U - diaeresis'],
+ ['&Yacute;', '&#221;', true, 'Y - acute'],
+ ['&Yuml;', '&#376;', true, 'Y - diaeresis'],
+ ['&THORN;', '&#222;', true, 'THORN'],
+ ['&agrave;', '&#224;', true, 'a - grave'],
+ ['&aacute;', '&#225;', true, 'a - acute'],
+ ['&acirc;', '&#226;', true, 'a - circumflex'],
+ ['&atilde;', '&#227;', true, 'a - tilde'],
+ ['&auml;', '&#228;', true, 'a - diaeresis'],
+ ['&aring;', '&#229;', true, 'a - ring above'],
+ ['&aelig;', '&#230;', true, 'ligature ae'],
+ ['&ccedil;', '&#231;', true, 'c - cedilla'],
+ ['&egrave;', '&#232;', true, 'e - grave'],
+ ['&eacute;', '&#233;', true, 'e - acute'],
+ ['&ecirc;', '&#234;', true, 'e - circumflex'],
+ ['&euml;', '&#235;', true, 'e - diaeresis'],
+ ['&igrave;', '&#236;', true, 'i - grave'],
+ ['&iacute;', '&#237;', true, 'i - acute'],
+ ['&icirc;', '&#238;', true, 'i - circumflex'],
+ ['&iuml;', '&#239;', true, 'i - diaeresis'],
+ ['&eth;', '&#240;', true, 'eth'],
+ ['&ntilde;', '&#241;', true, 'n - tilde'],
+ ['&ograve;', '&#242;', true, 'o - grave'],
+ ['&oacute;', '&#243;', true, 'o - acute'],
+ ['&ocirc;', '&#244;', true, 'o - circumflex'],
+ ['&otilde;', '&#245;', true, 'o - tilde'],
+ ['&ouml;', '&#246;', true, 'o - diaeresis'],
+ ['&oslash;', '&#248;', true, 'o slash'],
+ ['&oelig;', '&#339;', true, 'ligature oe'],
+ ['&scaron;', '&#353;', true, 's - caron'],
+ ['&ugrave;', '&#249;', true, 'u - grave'],
+ ['&uacute;', '&#250;', true, 'u - acute'],
+ ['&ucirc;', '&#251;', true, 'u - circumflex'],
+ ['&uuml;', '&#252;', true, 'u - diaeresis'],
+ ['&yacute;', '&#253;', true, 'y - acute'],
+ ['&thorn;', '&#254;', true, 'thorn'],
+ ['&yuml;', '&#255;', true, 'y - diaeresis'],
+ ['&Alpha;', '&#913;', true, 'Alpha'],
+ ['&Beta;', '&#914;', true, 'Beta'],
+ ['&Gamma;', '&#915;', true, 'Gamma'],
+ ['&Delta;', '&#916;', true, 'Delta'],
+ ['&Epsilon;', '&#917;', true, 'Epsilon'],
+ ['&Zeta;', '&#918;', true, 'Zeta'],
+ ['&Eta;', '&#919;', true, 'Eta'],
+ ['&Theta;', '&#920;', true, 'Theta'],
+ ['&Iota;', '&#921;', true, 'Iota'],
+ ['&Kappa;', '&#922;', true, 'Kappa'],
+ ['&Lambda;', '&#923;', true, 'Lambda'],
+ ['&Mu;', '&#924;', true, 'Mu'],
+ ['&Nu;', '&#925;', true, 'Nu'],
+ ['&Xi;', '&#926;', true, 'Xi'],
+ ['&Omicron;', '&#927;', true, 'Omicron'],
+ ['&Pi;', '&#928;', true, 'Pi'],
+ ['&Rho;', '&#929;', true, 'Rho'],
+ ['&Sigma;', '&#931;', true, 'Sigma'],
+ ['&Tau;', '&#932;', true, 'Tau'],
+ ['&Upsilon;', '&#933;', true, 'Upsilon'],
+ ['&Phi;', '&#934;', true, 'Phi'],
+ ['&Chi;', '&#935;', true, 'Chi'],
+ ['&Psi;', '&#936;', true, 'Psi'],
+ ['&Omega;', '&#937;', true, 'Omega'],
+ ['&alpha;', '&#945;', true, 'alpha'],
+ ['&beta;', '&#946;', true, 'beta'],
+ ['&gamma;', '&#947;', true, 'gamma'],
+ ['&delta;', '&#948;', true, 'delta'],
+ ['&epsilon;', '&#949;', true, 'epsilon'],
+ ['&zeta;', '&#950;', true, 'zeta'],
+ ['&eta;', '&#951;', true, 'eta'],
+ ['&theta;', '&#952;', true, 'theta'],
+ ['&iota;', '&#953;', true, 'iota'],
+ ['&kappa;', '&#954;', true, 'kappa'],
+ ['&lambda;', '&#955;', true, 'lambda'],
+ ['&mu;', '&#956;', true, 'mu'],
+ ['&nu;', '&#957;', true, 'nu'],
+ ['&xi;', '&#958;', true, 'xi'],
+ ['&omicron;', '&#959;', true, 'omicron'],
+ ['&pi;', '&#960;', true, 'pi'],
+ ['&rho;', '&#961;', true, 'rho'],
+ ['&sigmaf;', '&#962;', true, 'final sigma'],
+ ['&sigma;', '&#963;', true, 'sigma'],
+ ['&tau;', '&#964;', true, 'tau'],
+ ['&upsilon;', '&#965;', true, 'upsilon'],
+ ['&phi;', '&#966;', true, 'phi'],
+ ['&chi;', '&#967;', true, 'chi'],
+ ['&psi;', '&#968;', true, 'psi'],
+ ['&omega;', '&#969;', true, 'omega'],
+// symbols
+ ['&alefsym;', '&#8501;', false,'alef symbol'],
+ ['&piv;', '&#982;', false,'pi symbol'],
+ ['&real;', '&#8476;', false,'real part symbol'],
+ ['&thetasym;','&#977;', false,'theta symbol'],
+ ['&upsih;', '&#978;', false,'upsilon - hook symbol'],
+ ['&weierp;', '&#8472;', false,'Weierstrass p'],
+ ['&image;', '&#8465;', false,'imaginary part'],
+// arrows
+ ['&larr;', '&#8592;', true, 'leftwards arrow'],
+ ['&uarr;', '&#8593;', true, 'upwards arrow'],
+ ['&rarr;', '&#8594;', true, 'rightwards arrow'],
+ ['&darr;', '&#8595;', true, 'downwards arrow'],
+ ['&harr;', '&#8596;', true, 'left right arrow'],
+ ['&crarr;', '&#8629;', false,'carriage return'],
+ ['&lArr;', '&#8656;', false,'leftwards double arrow'],
+ ['&uArr;', '&#8657;', false,'upwards double arrow'],
+ ['&rArr;', '&#8658;', false,'rightwards double arrow'],
+ ['&dArr;', '&#8659;', false,'downwards double arrow'],
+ ['&hArr;', '&#8660;', false,'left right double arrow'],
+ ['&there4;', '&#8756;', false,'therefore'],
+ ['&sub;', '&#8834;', false,'subset of'],
+ ['&sup;', '&#8835;', false,'superset of'],
+ ['&nsub;', '&#8836;', false,'not a subset of'],
+ ['&sube;', '&#8838;', false,'subset of or equal to'],
+ ['&supe;', '&#8839;', false,'superset of or equal to'],
+ ['&oplus;', '&#8853;', false,'circled plus'],
+ ['&otimes;', '&#8855;', false,'circled times'],
+ ['&perp;', '&#8869;', false,'perpendicular'],
+ ['&sdot;', '&#8901;', false,'dot operator'],
+ ['&lceil;', '&#8968;', false,'left ceiling'],
+ ['&rceil;', '&#8969;', false,'right ceiling'],
+ ['&lfloor;', '&#8970;', false,'left floor'],
+ ['&rfloor;', '&#8971;', false,'right floor'],
+ ['&lang;', '&#9001;', false,'left-pointing angle bracket'],
+ ['&rang;', '&#9002;', false,'right-pointing angle bracket'],
+ ['&loz;', '&#9674;', true,'lozenge'],
+ ['&spades;', '&#9824;', false,'black spade suit'],
+ ['&clubs;', '&#9827;', true, 'black club suit'],
+ ['&hearts;', '&#9829;', true, 'black heart suit'],
+ ['&diams;', '&#9830;', true, 'black diamond suit'],
+ ['&ensp;', '&#8194;', false,'en space'],
+ ['&emsp;', '&#8195;', false,'em space'],
+ ['&thinsp;', '&#8201;', false,'thin space'],
+ ['&zwnj;', '&#8204;', false,'zero width non-joiner'],
+ ['&zwj;', '&#8205;', false,'zero width joiner'],
+ ['&lrm;', '&#8206;', false,'left-to-right mark'],
+ ['&rlm;', '&#8207;', false,'right-to-left mark'],
+ ['&shy;', '&#173;', false,'soft hyphen']
+];
+
+tinyMCEPopup.onInit.add(function() {
+ tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
+});
+
+function renderCharMapHTML() {
+ var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
+ var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+ var cols=-1;
+
+ for (i=0; i<charmap.length; i++) {
+ if (charmap[i][2]==true) {
+ cols++;
+ html += ''
+ + '<td class="charmap">'
+ + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+ + charmap[i][1]
+ + '</a></td>';
+ if ((cols+1) % charsPerRow == 0)
+ html += '</tr><tr height="' + tdHeight + '">';
+ }
+ }
+
+ if (cols % charsPerRow > 0) {
+ var padd = charsPerRow - (cols % charsPerRow);
+ for (var i=0; i<padd-1; i++)
+ html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+ }
+
+ html += '</tr></table>';
+
+ return html;
+}
+
+function insertChar(chr) {
+ tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+ // Refocus in window
+ if (tinyMCEPopup.isWindow)
+ window.focus();
+
+ tinyMCEPopup.editor.focus();
+ tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+ var elmA = document.getElementById('codeA');
+ var elmB = document.getElementById('codeB');
+ var elmV = document.getElementById('codeV');
+ var elmN = document.getElementById('codeN');
+
+ if (codeA=='#160;') {
+ elmV.innerHTML = '__';
+ } else {
+ elmV.innerHTML = '&' + codeA;
+ }
+
+ elmB.innerHTML = '&amp;' + codeA;
+ elmA.innerHTML = '&amp;' + codeB;
+ elmN.innerHTML = codeN;
+}
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js
new file mode 100644
index 0000000..fd9700f
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js
@@ -0,0 +1,253 @@
+tinyMCEPopup.requireLangPack();
+
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
+
+var colors = [
+ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+ "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+ "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+ "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+ "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+ "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+ "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+ "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+ "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+ "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+ "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+ "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+ "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+ "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+ "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+ "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+ "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+ "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+ "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+ "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+ "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+ "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+ "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+ "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+ "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+ "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+ "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+];
+
+var named = {
+ '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
+ '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
+ '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
+ '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
+ '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
+ '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
+ '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
+ '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
+ '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
+ '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
+ '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
+ '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
+ '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
+ '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
+ '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
+ '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
+ '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
+ '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
+ '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
+ '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
+ '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
+ '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
+ '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
+};
+
+function init() {
+ var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));
+
+ tinyMCEPopup.resizeToInnerSize();
+
+ generatePicker();
+
+ if (inputColor) {
+ changeFinalColor(inputColor);
+
+ col = convertHexToRGB(inputColor);
+
+ if (col)
+ updateLight(col.r, col.g, col.b);
+ }
+}
+
+function insertAction() {
+ var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
+
+ tinyMCEPopup.restoreSelection();
+
+ if (f)
+ f(color);
+
+ tinyMCEPopup.close();
+}
+
+function showColor(color, name) {
+ if (name)
+ document.getElementById("colorname").innerHTML = name;
+
+ document.getElementById("preview").style.backgroundColor = color;
+ document.getElementById("color").value = color.toLowerCase();
+}
+
+function convertRGBToHex(col) {
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+ if (!col)
+ return col;
+
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
+ if (rgb.length == 3) {
+ r = parseInt(rgb[0]).toString(16);
+ g = parseInt(rgb[1]).toString(16);
+ b = parseInt(rgb[2]).toString(16);
+
+ r = r.length == 1 ? '0' + r : r;
+ g = g.length == 1 ? '0' + g : g;
+ b = b.length == 1 ? '0' + b : b;
+
+ return "#" + r + g + b;
+ }
+
+ return col;
+}
+
+function convertHexToRGB(col) {
+ if (col.indexOf('#') != -1) {
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+ r = parseInt(col.substring(0, 2), 16);
+ g = parseInt(col.substring(2, 4), 16);
+ b = parseInt(col.substring(4, 6), 16);
+
+ return {r : r, g : g, b : b};
+ }
+
+ return null;
+}
+
+function generatePicker() {
+ var el = document.getElementById('light'), h = '', i;
+
+ for (i = 0; i < detail; i++){
+ h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+ + ' onclick="changeFinalColor(this.style.backgroundColor)"'
+ + ' onmousedown="isMouseDown = true; return false;"'
+ + ' onmouseup="isMouseDown = false;"'
+ + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+ + ' onmouseover="isMouseOver = true;"'
+ + ' onmouseout="isMouseOver = false;"'
+ + '></div>';
+ }
+
+ el.innerHTML = h;
+}
+
+function generateWebColors() {
+ var el = document.getElementById('webcolors'), h = '', i;
+
+ if (el.className == 'generated')
+ return;
+
+ h += '<table border="0" cellspacing="1" cellpadding="0">'
+ + '<tr>';
+
+ for (i=0; i<colors.length; i++) {
+ h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
+ + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'
+ + '</a></td>';
+ if ((i+1) % 18 == 0)
+ h += '</tr><tr>';
+ }
+
+ h += '</table>';
+
+ el.innerHTML = h;
+ el.className = 'generated';
+}
+
+function generateNamedColors() {
+ var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
+
+ if (el.className == 'generated')
+ return;
+
+ for (n in named) {
+ v = named[n];
+ h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
+ }
+
+ el.innerHTML = h;
+ el.className = 'generated';
+}
+
+function dechex(n) {
+ return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
+}
+
+function computeColor(e) {
+ var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
+
+ x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
+ y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
+
+ partWidth = document.getElementById('colors').width / 6;
+ partDetail = detail / 2;
+ imHeight = document.getElementById('colors').height;
+
+ r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
+ g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
+ b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
+
+ coef = (imHeight - y) / imHeight;
+ r = 128 + (r - 128) * coef;
+ g = 128 + (g - 128) * coef;
+ b = 128 + (b - 128) * coef;
+
+ changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
+ updateLight(r, g, b);
+}
+
+function updateLight(r, g, b) {
+ var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
+
+ for (i=0; i<detail; i++) {
+ if ((i>=0) && (i<partDetail)) {
+ finalCoef = i / partDetail;
+ finalR = dechex(255 - (255 - r) * finalCoef);
+ finalG = dechex(255 - (255 - g) * finalCoef);
+ finalB = dechex(255 - (255 - b) * finalCoef);
+ } else {
+ finalCoef = 2 - i / partDetail;
+ finalR = dechex(r * finalCoef);
+ finalG = dechex(g * finalCoef);
+ finalB = dechex(b * finalCoef);
+ }
+
+ color = finalR + finalG + finalB;
+
+ setCol('gs' + i, '#'+color);
+ }
+}
+
+function changeFinalColor(color) {
+ if (color.indexOf('#') == -1)
+ color = convertRGBToHex(color);
+
+ setCol('preview', color);
+ document.getElementById('color').value = color;
+}
+
+function setCol(e, c) {
+ try {
+ document.getElementById(e).style.backgroundColor = c;
+ } catch (ex) {
+ // Ignore IE warning
+ }
+}
+
+tinyMCEPopup.onInit.add(init);
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js
new file mode 100644
index 0000000..4982ce0
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js
@@ -0,0 +1,245 @@
+var ImageDialog = {
+ preInit : function() {
+ var url;
+
+ tinyMCEPopup.requireLangPack();
+
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+ },
+
+ init : function() {
+ var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+ // Setup browse button
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+ if (isVisible('srcbrowser'))
+ document.getElementById('src').style.width = '180px';
+
+ e = ed.selection.getNode();
+
+ this.fillFileList('image_list', 'tinyMCEImageList');
+
+ if (e.nodeName == 'IMG') {
+ f.src.value = ed.dom.getAttrib(e, 'src');
+ f.alt.value = ed.dom.getAttrib(e, 'alt');
+ f.border.value = this.getAttrib(e, 'border');
+ f.vspace.value = this.getAttrib(e, 'vspace');
+ f.hspace.value = this.getAttrib(e, 'hspace');
+ f.width.value = ed.dom.getAttrib(e, 'width');
+ f.height.value = ed.dom.getAttrib(e, 'height');
+ f.insert.value = ed.getLang('update');
+ this.styleVal = ed.dom.getAttrib(e, 'style');
+ selectByValue(f, 'image_list', f.src.value);
+ selectByValue(f, 'align', this.getAttrib(e, 'align'));
+ this.updateStyle();
+ }
+ },
+
+ fillFileList : function(id, l) {
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+ l = window[l];
+
+ if (l && l.length > 0) {
+ lst.options[lst.options.length] = new Option('', '');
+
+ tinymce.each(l, function(o) {
+ lst.options[lst.options.length] = new Option(o[0], o[1]);
+ });
+ } else
+ dom.remove(dom.getParent(id, 'tr'));
+ },
+
+ update : function() {
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
+
+ tinyMCEPopup.restoreSelection();
+
+ if (f.src.value === '') {
+ if (ed.selection.getNode().nodeName == 'IMG') {
+ ed.dom.remove(ed.selection.getNode());
+ ed.execCommand('mceRepaint');
+ }
+
+ tinyMCEPopup.close();
+ return;
+ }
+
+ if (!ed.settings.inline_styles) {
+ args = tinymce.extend(args, {
+ vspace : nl.vspace.value,
+ hspace : nl.hspace.value,
+ border : nl.border.value,
+ align : getSelectValue(f, 'align')
+ });
+ } else
+ args.style = this.styleVal;
+
+ tinymce.extend(args, {
+ src : f.src.value,
+ alt : f.alt.value,
+ width : f.width.value,
+ height : f.height.value
+ });
+
+ el = ed.selection.getNode();
+
+ if (el && el.nodeName == 'IMG') {
+ ed.dom.setAttribs(el, args);
+ } else {
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
+ ed.dom.setAttribs('__mce_tmp', args);
+ ed.dom.setAttrib('__mce_tmp', 'id', '');
+ ed.undoManager.add();
+ }
+
+ tinyMCEPopup.close();
+ },
+
+ updateStyle : function() {
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
+
+ if (tinyMCEPopup.editor.settings.inline_styles) {
+ st = tinyMCEPopup.dom.parseStyle(this.styleVal);
+
+ // Handle align
+ v = getSelectValue(f, 'align');
+ if (v) {
+ if (v == 'left' || v == 'right') {
+ st['float'] = v;
+ delete st['vertical-align'];
+ } else {
+ st['vertical-align'] = v;
+ delete st['float'];
+ }
+ } else {
+ delete st['float'];
+ delete st['vertical-align'];
+ }
+
+ // Handle border
+ v = f.border.value;
+ if (v || v == '0') {
+ if (v == '0')
+ st['border'] = '0';
+ else
+ st['border'] = v + 'px solid black';
+ } else
+ delete st['border'];
+
+ // Handle hspace
+ v = f.hspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-left'] = v + 'px';
+ st['margin-right'] = v + 'px';
+ } else {
+ delete st['margin-left'];
+ delete st['margin-right'];
+ }
+
+ // Handle vspace
+ v = f.vspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-top'] = v + 'px';
+ st['margin-bottom'] = v + 'px';
+ } else {
+ delete st['margin-top'];
+ delete st['margin-bottom'];
+ }
+
+ // Merge
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
+ this.styleVal = dom.serializeStyle(st);
+ }
+ },
+
+ getAttrib : function(e, at) {
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
+
+ if (ed.settings.inline_styles) {
+ switch (at) {
+ case 'align':
+ if (v = dom.getStyle(e, 'float'))
+ return v;
+
+ if (v = dom.getStyle(e, 'vertical-align'))
+ return v;
+
+ break;
+
+ case 'hspace':
+ v = dom.getStyle(e, 'margin-left')
+ v2 = dom.getStyle(e, 'margin-right');
+ if (v && v == v2)
+ return parseInt(v.replace(/[^0-9]/g, ''));
+
+ break;
+
+ case 'vspace':
+ v = dom.getStyle(e, 'margin-top')
+ v2 = dom.getStyle(e, 'margin-bottom');
+ if (v && v == v2)
+ return parseInt(v.replace(/[^0-9]/g, ''));
+
+ break;
+
+ case 'border':
+ v = 0;
+
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
+ sv = dom.getStyle(e, 'border-' + sv + '-width');
+
+ // False or not the same as prev
+ if (!sv || (sv != v && v !== 0)) {
+ v = 0;
+ return false;
+ }
+
+ if (sv)
+ v = sv;
+ });
+
+ if (v)
+ return parseInt(v.replace(/[^0-9]/g, ''));
+
+ break;
+ }
+ }
+
+ if (v = dom.getAttrib(e, at))
+ return v;
+
+ return '';
+ },
+
+ resetImageData : function() {
+ var f = document.forms[0];
+
+ f.width.value = f.height.value = "";
+ },
+
+ updateImageData : function() {
+ var f = document.forms[0], t = ImageDialog;
+
+ if (f.width.value == "")
+ f.width.value = t.preloadImg.width;
+
+ if (f.height.value == "")
+ f.height.value = t.preloadImg.height;
+ },
+
+ getImageData : function() {
+ var f = document.forms[0];
+
+ this.preloadImg = new Image();
+ this.preloadImg.onload = this.updateImageData;
+ this.preloadImg.onerror = this.resetImageData;
+ this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);
+ }
+};
+
+ImageDialog.preInit();
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js
new file mode 100644
index 0000000..2974878
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js
@@ -0,0 +1,155 @@
+tinyMCEPopup.requireLangPack();
+
+var LinkDialog = {
+ preInit : function() {
+ var url;
+
+ if (url = tinyMCEPopup.getParam("external_link_list_url"))
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+ },
+
+ init : function() {
+ var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+ // Setup browse button
+ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');
+ if (isVisible('hrefbrowser'))
+ document.getElementById('href').style.width = '180px';
+
+ this.fillClassList('class_list');
+ this.fillFileList('link_list', 'tinyMCELinkList');
+ this.fillTargetList('target_list');
+
+ if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {
+ f.href.value = ed.dom.getAttrib(e, 'href');
+ f.linktitle.value = ed.dom.getAttrib(e, 'title');
+ f.insert.value = ed.getLang('update');
+ selectByValue(f, 'link_list', f.href.value);
+ selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));
+ selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));
+ }
+ },
+
+ update : function() {
+ var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;
+
+ tinyMCEPopup.restoreSelection();
+ e = ed.dom.getParent(ed.selection.getNode(), 'A');
+
+ // Remove element if there is no href
+ if (!f.href.value) {
+ if (e) {
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+ b = ed.selection.getBookmark();
+ ed.dom.remove(e, 1);
+ ed.selection.moveToBookmark(b);
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ return;
+ }
+ }
+
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+ // Create new anchor elements
+ if (e == null) {
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
+
+ tinymce.each(ed.dom.select("a"), function(n) {
+ if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
+ e = n;
+
+ ed.dom.setAttribs(e, {
+ href : f.href.value,
+ title : f.linktitle.value,
+ target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
+ 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
+ });
+ }
+ });
+ } else {
+ ed.dom.setAttribs(e, {
+ href : f.href.value,
+ title : f.linktitle.value,
+ target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
+ 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
+ });
+ }
+
+ // Don't move caret if selection was image
+ if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {
+ ed.focus();
+ ed.selection.select(e);
+ ed.selection.collapse(0);
+ tinyMCEPopup.storeSelection();
+ }
+
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ },
+
+ checkPrefix : function(n) {
+ if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))
+ n.value = 'mailto:' + n.value;
+
+ if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))
+ n.value = 'http://' + n.value;
+ },
+
+ fillFileList : function(id, l) {
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+ l = window[l];
+
+ if (l && l.length > 0) {
+ lst.options[lst.options.length] = new Option('', '');
+
+ tinymce.each(l, function(o) {
+ lst.options[lst.options.length] = new Option(o[0], o[1]);
+ });
+ } else
+ dom.remove(dom.getParent(id, 'tr'));
+ },
+
+ fillClassList : function(id) {
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+ if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
+ cl = [];
+
+ tinymce.each(v.split(';'), function(v) {
+ var p = v.split('=');
+
+ cl.push({'title' : p[0], 'class' : p[1]});
+ });
+ } else
+ cl = tinyMCEPopup.editor.dom.getClasses();
+
+ if (cl.length > 0) {
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+
+ tinymce.each(cl, function(o) {
+ lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
+ });
+ } else
+ dom.remove(dom.getParent(id, 'tr'));
+ },
+
+ fillTargetList : function(id) {
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v;
+
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');
+
+ if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {
+ tinymce.each(v.split(','), function(v) {
+ v = v.split('=');
+ lst.options[lst.options.length] = new Option(v[0], v[1]);
+ });
+ }
+ }
+};
+
+LinkDialog.preInit();
+tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);
diff --git a/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
new file mode 100644
index 0000000..af2231c
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
@@ -0,0 +1,62 @@
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(onLoadInit);
+
+function saveContent() {
+ tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value);
+ tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+ tinyMCEPopup.resizeToInnerSize();
+
+ // Remove Gecko spellchecking
+ if (tinymce.isGecko)
+ document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
+
+ document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent();
+
+ if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
+ setWrap('soft');
+ document.getElementById('wraped').checked = true;
+ }
+
+ resizeInputs();
+}
+
+function setWrap(val) {
+ var v, n, s = document.getElementById('htmlSource');
+
+ s.wrap = val;
+
+ if (!tinymce.isIE) {
+ v = s.value;
+ n = s.cloneNode(false);
+ n.setAttribute("wrap", val);
+ s.parentNode.replaceChild(n, s);
+ n.value = v;
+ }
+}
+
+function toggleWordWrap(elm) {
+ if (elm.checked)
+ setWrap('soft');
+ else
+ setWrap('off');
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+ var el = document.getElementById('htmlSource');
+
+ if (!tinymce.isIE) {
+ wHeight = self.innerHeight - 65;
+ wWidth = self.innerWidth - 16;
+ } else {
+ wHeight = document.body.clientHeight - 70;
+ wWidth = document.body.clientWidth - 16;
+ }
+
+ el.style.height = Math.abs(wHeight) + 'px';
+ el.style.width = Math.abs(wWidth) + 'px';
+}