diff options
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/themes/advanced/js')
7 files changed, 0 insertions, 1309 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js deleted file mode 100644 index 5b3584576..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js +++ /dev/null @@ -1,73 +0,0 @@ -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';
- document.getElementById('help_tab').setAttribute("aria-hidden", "false");
- }
-}
-
-tinyMCEPopup.onInit.add(init);
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js deleted file mode 100644 index 2940db359..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js +++ /dev/null @@ -1,44 +0,0 @@ -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');
- 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, elm, name = document.forms[0].anchorName.value;
-
- if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
- tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
- return;
- }
-
- tinyMCEPopup.restoreSelection();
-
- if (this.action != 'update')
- ed.selection.collapse(1);
-
- elm = ed.dom.getParent(ed.selection.getNode(), 'A');
- if (elm) {
- elm.setAttribute('name', name);
- elm.name = name;
- } else
- // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF'));
-
- tinyMCEPopup.close();
- }
-};
-
-tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js deleted file mode 100644 index bb1869558..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js +++ /dev/null @@ -1,363 +0,0 @@ -/**
- * charmap.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-tinyMCEPopup.requireLangPack();
-
-var charmap = [
- [' ', ' ', true, 'no-break space'],
- ['&', '&', true, 'ampersand'],
- ['"', '"', true, 'quotation mark'],
-// finance
- ['¢', '¢', true, 'cent sign'],
- ['€', '€', true, 'euro sign'],
- ['£', '£', true, 'pound sign'],
- ['¥', '¥', true, 'yen sign'],
-// signs
- ['©', '©', true, 'copyright sign'],
- ['®', '®', true, 'registered sign'],
- ['™', '™', true, 'trade mark sign'],
- ['‰', '‰', true, 'per mille sign'],
- ['µ', 'µ', true, 'micro sign'],
- ['·', '·', true, 'middle dot'],
- ['•', '•', true, 'bullet'],
- ['…', '…', true, 'three dot leader'],
- ['′', '′', true, 'minutes / feet'],
- ['″', '″', true, 'seconds / inches'],
- ['§', '§', true, 'section sign'],
- ['¶', '¶', true, 'paragraph sign'],
- ['ß', 'ß', true, 'sharp s / ess-zed'],
-// quotations
- ['‹', '‹', true, 'single left-pointing angle quotation mark'],
- ['›', '›', true, 'single right-pointing angle quotation mark'],
- ['«', '«', true, 'left pointing guillemet'],
- ['»', '»', true, 'right pointing guillemet'],
- ['‘', '‘', true, 'left single quotation mark'],
- ['’', '’', true, 'right single quotation mark'],
- ['“', '“', true, 'left double quotation mark'],
- ['”', '”', true, 'right double quotation mark'],
- ['‚', '‚', true, 'single low-9 quotation mark'],
- ['„', '„', true, 'double low-9 quotation mark'],
- ['<', '<', true, 'less-than sign'],
- ['>', '>', true, 'greater-than sign'],
- ['≤', '≤', true, 'less-than or equal to'],
- ['≥', '≥', true, 'greater-than or equal to'],
- ['–', '–', true, 'en dash'],
- ['—', '—', true, 'em dash'],
- ['¯', '¯', true, 'macron'],
- ['‾', '‾', true, 'overline'],
- ['¤', '¤', true, 'currency sign'],
- ['¦', '¦', true, 'broken bar'],
- ['¨', '¨', true, 'diaeresis'],
- ['¡', '¡', true, 'inverted exclamation mark'],
- ['¿', '¿', true, 'turned question mark'],
- ['ˆ', 'ˆ', true, 'circumflex accent'],
- ['˜', '˜', true, 'small tilde'],
- ['°', '°', true, 'degree sign'],
- ['−', '−', true, 'minus sign'],
- ['±', '±', true, 'plus-minus sign'],
- ['÷', '÷', true, 'division sign'],
- ['⁄', '⁄', true, 'fraction slash'],
- ['×', '×', true, 'multiplication sign'],
- ['¹', '¹', true, 'superscript one'],
- ['²', '²', true, 'superscript two'],
- ['³', '³', true, 'superscript three'],
- ['¼', '¼', true, 'fraction one quarter'],
- ['½', '½', true, 'fraction one half'],
- ['¾', '¾', true, 'fraction three quarters'],
-// math / logical
- ['ƒ', 'ƒ', true, 'function / florin'],
- ['∫', '∫', true, 'integral'],
- ['∑', '∑', true, 'n-ary sumation'],
- ['∞', '∞', true, 'infinity'],
- ['√', '√', true, 'square root'],
- ['∼', '∼', false,'similar to'],
- ['≅', '≅', false,'approximately equal to'],
- ['≈', '≈', true, 'almost equal to'],
- ['≠', '≠', true, 'not equal to'],
- ['≡', '≡', true, 'identical to'],
- ['∈', '∈', false,'element of'],
- ['∉', '∉', false,'not an element of'],
- ['∋', '∋', false,'contains as member'],
- ['∏', '∏', true, 'n-ary product'],
- ['∧', '∧', false,'logical and'],
- ['∨', '∨', false,'logical or'],
- ['¬', '¬', true, 'not sign'],
- ['∩', '∩', true, 'intersection'],
- ['∪', '∪', false,'union'],
- ['∂', '∂', true, 'partial differential'],
- ['∀', '∀', false,'for all'],
- ['∃', '∃', false,'there exists'],
- ['∅', '∅', false,'diameter'],
- ['∇', '∇', false,'backward difference'],
- ['∗', '∗', false,'asterisk operator'],
- ['∝', '∝', false,'proportional to'],
- ['∠', '∠', false,'angle'],
-// undefined
- ['´', '´', true, 'acute accent'],
- ['¸', '¸', true, 'cedilla'],
- ['ª', 'ª', true, 'feminine ordinal indicator'],
- ['º', 'º', true, 'masculine ordinal indicator'],
- ['†', '†', true, 'dagger'],
- ['‡', '‡', true, 'double dagger'],
-// alphabetical special chars
- ['À', 'À', true, 'A - grave'],
- ['Á', 'Á', true, 'A - acute'],
- ['Â', 'Â', true, 'A - circumflex'],
- ['Ã', 'Ã', true, 'A - tilde'],
- ['Ä', 'Ä', true, 'A - diaeresis'],
- ['Å', 'Å', true, 'A - ring above'],
- ['Æ', 'Æ', true, 'ligature AE'],
- ['Ç', 'Ç', true, 'C - cedilla'],
- ['È', 'È', true, 'E - grave'],
- ['É', 'É', true, 'E - acute'],
- ['Ê', 'Ê', true, 'E - circumflex'],
- ['Ë', 'Ë', true, 'E - diaeresis'],
- ['Ì', 'Ì', true, 'I - grave'],
- ['Í', 'Í', true, 'I - acute'],
- ['Î', 'Î', true, 'I - circumflex'],
- ['Ï', 'Ï', true, 'I - diaeresis'],
- ['Ð', 'Ð', true, 'ETH'],
- ['Ñ', 'Ñ', true, 'N - tilde'],
- ['Ò', 'Ò', true, 'O - grave'],
- ['Ó', 'Ó', true, 'O - acute'],
- ['Ô', 'Ô', true, 'O - circumflex'],
- ['Õ', 'Õ', true, 'O - tilde'],
- ['Ö', 'Ö', true, 'O - diaeresis'],
- ['Ø', 'Ø', true, 'O - slash'],
- ['Œ', 'Œ', true, 'ligature OE'],
- ['Š', 'Š', true, 'S - caron'],
- ['Ù', 'Ù', true, 'U - grave'],
- ['Ú', 'Ú', true, 'U - acute'],
- ['Û', 'Û', true, 'U - circumflex'],
- ['Ü', 'Ü', true, 'U - diaeresis'],
- ['Ý', 'Ý', true, 'Y - acute'],
- ['Ÿ', 'Ÿ', true, 'Y - diaeresis'],
- ['Þ', 'Þ', true, 'THORN'],
- ['à', 'à', true, 'a - grave'],
- ['á', 'á', true, 'a - acute'],
- ['â', 'â', true, 'a - circumflex'],
- ['ã', 'ã', true, 'a - tilde'],
- ['ä', 'ä', true, 'a - diaeresis'],
- ['å', 'å', true, 'a - ring above'],
- ['æ', 'æ', true, 'ligature ae'],
- ['ç', 'ç', true, 'c - cedilla'],
- ['è', 'è', true, 'e - grave'],
- ['é', 'é', true, 'e - acute'],
- ['ê', 'ê', true, 'e - circumflex'],
- ['ë', 'ë', true, 'e - diaeresis'],
- ['ì', 'ì', true, 'i - grave'],
- ['í', 'í', true, 'i - acute'],
- ['î', 'î', true, 'i - circumflex'],
- ['ï', 'ï', true, 'i - diaeresis'],
- ['ð', 'ð', true, 'eth'],
- ['ñ', 'ñ', true, 'n - tilde'],
- ['ò', 'ò', true, 'o - grave'],
- ['ó', 'ó', true, 'o - acute'],
- ['ô', 'ô', true, 'o - circumflex'],
- ['õ', 'õ', true, 'o - tilde'],
- ['ö', 'ö', true, 'o - diaeresis'],
- ['ø', 'ø', true, 'o slash'],
- ['œ', 'œ', true, 'ligature oe'],
- ['š', 'š', true, 's - caron'],
- ['ù', 'ù', true, 'u - grave'],
- ['ú', 'ú', true, 'u - acute'],
- ['û', 'û', true, 'u - circumflex'],
- ['ü', 'ü', true, 'u - diaeresis'],
- ['ý', 'ý', true, 'y - acute'],
- ['þ', 'þ', true, 'thorn'],
- ['ÿ', 'ÿ', true, 'y - diaeresis'],
- ['Α', 'Α', true, 'Alpha'],
- ['Β', 'Β', true, 'Beta'],
- ['Γ', 'Γ', true, 'Gamma'],
- ['Δ', 'Δ', true, 'Delta'],
- ['Ε', 'Ε', true, 'Epsilon'],
- ['Ζ', 'Ζ', true, 'Zeta'],
- ['Η', 'Η', true, 'Eta'],
- ['Θ', 'Θ', true, 'Theta'],
- ['Ι', 'Ι', true, 'Iota'],
- ['Κ', 'Κ', true, 'Kappa'],
- ['Λ', 'Λ', true, 'Lambda'],
- ['Μ', 'Μ', true, 'Mu'],
- ['Ν', 'Ν', true, 'Nu'],
- ['Ξ', 'Ξ', true, 'Xi'],
- ['Ο', 'Ο', true, 'Omicron'],
- ['Π', 'Π', true, 'Pi'],
- ['Ρ', 'Ρ', true, 'Rho'],
- ['Σ', 'Σ', true, 'Sigma'],
- ['Τ', 'Τ', true, 'Tau'],
- ['Υ', 'Υ', true, 'Upsilon'],
- ['Φ', 'Φ', true, 'Phi'],
- ['Χ', 'Χ', true, 'Chi'],
- ['Ψ', 'Ψ', true, 'Psi'],
- ['Ω', 'Ω', true, 'Omega'],
- ['α', 'α', true, 'alpha'],
- ['β', 'β', true, 'beta'],
- ['γ', 'γ', true, 'gamma'],
- ['δ', 'δ', true, 'delta'],
- ['ε', 'ε', true, 'epsilon'],
- ['ζ', 'ζ', true, 'zeta'],
- ['η', 'η', true, 'eta'],
- ['θ', 'θ', true, 'theta'],
- ['ι', 'ι', true, 'iota'],
- ['κ', 'κ', true, 'kappa'],
- ['λ', 'λ', true, 'lambda'],
- ['μ', 'μ', true, 'mu'],
- ['ν', 'ν', true, 'nu'],
- ['ξ', 'ξ', true, 'xi'],
- ['ο', 'ο', true, 'omicron'],
- ['π', 'π', true, 'pi'],
- ['ρ', 'ρ', true, 'rho'],
- ['ς', 'ς', true, 'final sigma'],
- ['σ', 'σ', true, 'sigma'],
- ['τ', 'τ', true, 'tau'],
- ['υ', 'υ', true, 'upsilon'],
- ['φ', 'φ', true, 'phi'],
- ['χ', 'χ', true, 'chi'],
- ['ψ', 'ψ', true, 'psi'],
- ['ω', 'ω', true, 'omega'],
-// symbols
- ['ℵ', 'ℵ', false,'alef symbol'],
- ['ϖ', 'ϖ', false,'pi symbol'],
- ['ℜ', 'ℜ', false,'real part symbol'],
- ['ϑ','ϑ', false,'theta symbol'],
- ['ϒ', 'ϒ', false,'upsilon - hook symbol'],
- ['℘', '℘', false,'Weierstrass p'],
- ['ℑ', 'ℑ', false,'imaginary part'],
-// arrows
- ['←', '←', true, 'leftwards arrow'],
- ['↑', '↑', true, 'upwards arrow'],
- ['→', '→', true, 'rightwards arrow'],
- ['↓', '↓', true, 'downwards arrow'],
- ['↔', '↔', true, 'left right arrow'],
- ['↵', '↵', false,'carriage return'],
- ['⇐', '⇐', false,'leftwards double arrow'],
- ['⇑', '⇑', false,'upwards double arrow'],
- ['⇒', '⇒', false,'rightwards double arrow'],
- ['⇓', '⇓', false,'downwards double arrow'],
- ['⇔', '⇔', false,'left right double arrow'],
- ['∴', '∴', false,'therefore'],
- ['⊂', '⊂', false,'subset of'],
- ['⊃', '⊃', false,'superset of'],
- ['⊄', '⊄', false,'not a subset of'],
- ['⊆', '⊆', false,'subset of or equal to'],
- ['⊇', '⊇', false,'superset of or equal to'],
- ['⊕', '⊕', false,'circled plus'],
- ['⊗', '⊗', false,'circled times'],
- ['⊥', '⊥', false,'perpendicular'],
- ['⋅', '⋅', false,'dot operator'],
- ['⌈', '⌈', false,'left ceiling'],
- ['⌉', '⌉', false,'right ceiling'],
- ['⌊', '⌊', false,'left floor'],
- ['⌋', '⌋', false,'right floor'],
- ['⟨', '〈', false,'left-pointing angle bracket'],
- ['⟩', '〉', false,'right-pointing angle bracket'],
- ['◊', '◊', true, 'lozenge'],
- ['♠', '♠', true, 'black spade suit'],
- ['♣', '♣', true, 'black club suit'],
- ['♥', '♥', true, 'black heart suit'],
- ['♦', '♦', true, 'black diamond suit'],
- [' ', ' ', false,'en space'],
- [' ', ' ', false,'em space'],
- [' ', ' ', false,'thin space'],
- ['‌', '‌', false,'zero width non-joiner'],
- ['‍', '‍', false,'zero width joiner'],
- ['‎', '‎', false,'left-to-right mark'],
- ['‏', '‏', false,'right-to-left mark'],
- ['­', '­', false,'soft hyphen']
-];
-
-tinyMCEPopup.onInit.add(function() {
- tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
- addKeyboardNavigation();
-});
-
-function addKeyboardNavigation(){
- var tableElm, cells, settings;
-
- cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup");
-
- settings ={
- root: "charmapgroup",
- items: cells
- };
- cells[0].tabindex=0;
- tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
- if (tinymce.isGecko) {
- cells[0].focus();
- } else {
- setTimeout(function(){
- cells[0].focus();
- }, 100);
- }
- tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
-}
-
-function renderCharMapHTML() {
- var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
- var html = '<div id="charmapgroup" aria-labelledby="charmap_label" tabindex="0" role="listbox">'+
- '<table role="presentation" border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) +
- '"><tr height="' + tdHeight + '">';
- var cols=-1;
-
- for (i=0; i<charmap.length; i++) {
- var previewCharFn;
-
- if (charmap[i][2]==true) {
- cols++;
- previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
- html += ''
- + '<td class="charmap">'
- + '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" 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] + ' '+ tinyMCEPopup.editor.translate("advanced_dlg.charmap_usage")+'">'
- + 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"> </td>';
- }
-
- html += '</tr></table></div>';
- html = html.replace(/<tr height="20"><\/tr>/g, '');
-
- 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 = '&' + codeA;
- elmA.innerHTML = '&' + codeB;
- elmN.innerHTML = codeN;
-}
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js deleted file mode 100644 index cc891c171..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js +++ /dev/null @@ -1,345 +0,0 @@ -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':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = tinymce.trim(color); - color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' - color = namedLookup[color] || color; - - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); - - if (matches) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else { - matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); - - if (matches) { - red = toInt(matches[1], 16); - green = toInt(matches[2], 16); - blue = toInt(matches[3], 16); - } else { - matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); - - if (matches) { - red = toInt(matches[1] + matches[1], 16); - green = toInt(matches[2] + matches[2], 16); - blue = toInt(matches[3] + matches[3], 16); - } else { - return ''; - } - } - } - - return '#' + hex(red) + hex(green) + hex(blue); -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - var hexColor = toHexColor(color); - - if (hexColor === '') { - var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); - tinyMCEPopup.alert(text + ': ' + color); - } - else { - tinyMCEPopup.restoreSelection(); - - if (f) - f(hexColor); - - tinyMCEPopup.close(); - } -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -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; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" 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();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>'; - } - h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>'; - h += '</a></td>'; - if ((i+1) % 18 == 0) - h += '</tr><tr>'; - } - - h += '</table></div>'; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -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();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">'; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>'; - } - h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>'; - h += '</a>'; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -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, pos = tinyMCEPopup.dom.getPos(e.target); - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.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/library/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js deleted file mode 100644 index bb09e75bf..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js +++ /dev/null @@ -1,253 +0,0 @@ -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', tinyMCEPopup.getParam('external_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 = typeof(l) === 'function' ? 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.replace(/ /g, '%20'),
- 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);
- tinyMCEPopup.editor.execCommand('mceRepaint');
- tinyMCEPopup.editor.focus();
- } else {
- tinymce.each(args, function(value, name) {
- if (value === "") {
- delete args[name];
- }
- });
-
- ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
- ed.undoManager.add();
- }
-
- tinyMCEPopup.close();
- },
-
- updateStyle : function() {
- var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0];
-
- if (tinyMCEPopup.editor.settings.inline_styles) {
- tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) {
- st[key] = value;
- });
-
- // 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), 'img');
- this.styleVal = dom.serializeStyle(st, 'img');
- }
- },
-
- 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/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js deleted file mode 100644 index 53ff409e7..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js +++ /dev/null @@ -1,153 +0,0 @@ -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, href = f.href.value.replace(/ /g, '%20');
-
- tinyMCEPopup.restoreSelection();
- e = ed.dom.getParent(ed.selection.getNode(), 'A');
-
- // Remove element if there is no href
- if (!f.href.value) {
- if (e) {
- b = ed.selection.getBookmark();
- ed.dom.remove(e, 1);
- ed.selection.moveToBookmark(b);
- tinyMCEPopup.execCommand("mceEndUndoLevel");
- tinyMCEPopup.close();
- return;
- }
- }
-
- // Create new anchor elements
- if (e == null) {
- ed.getDoc().execCommand("unlink", false, null);
- tinyMCEPopup.execCommand("mceInsertLink", 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 : href,
- title : f.linktitle.value,
- target : f.target_list ? getSelectValue(f, "target_list") : null,
- 'class' : f.class_list ? getSelectValue(f, "class_list") : null
- });
- }
- });
- } else {
- ed.dom.setAttribs(e, {
- href : href,
- title : f.linktitle.value,
- target : f.target_list ? getSelectValue(f, "target_list") : null,
- 'class' : f.class_list ? getSelectValue(f, "class_list") : 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/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js deleted file mode 100644 index dd5e366fa..000000000 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js +++ /dev/null @@ -1,78 +0,0 @@ -tinyMCEPopup.requireLangPack();
-tinyMCEPopup.onInit.add(onLoadInit);
-
-function saveContent() {
- tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
- 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({source_view : true});
-
- if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
- turnWrapOn();
- 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 setWhiteSpaceCss(value) {
- var el = document.getElementById('htmlSource');
- tinymce.DOM.setStyle(el, 'white-space', value);
-}
-
-function turnWrapOff() {
- if (tinymce.isWebKit) {
- setWhiteSpaceCss('pre');
- } else {
- setWrap('off');
- }
-}
-
-function turnWrapOn() {
- if (tinymce.isWebKit) {
- setWhiteSpaceCss('pre-wrap');
- } else {
- setWrap('soft');
- }
-}
-
-function toggleWordWrap(elm) {
- if (elm.checked) {
- turnWrapOn();
- } else {
- turnWrapOff();
- }
-}
-
-function resizeInputs() {
- var vp = tinyMCEPopup.dom.getViewPort(window), el;
-
- el = document.getElementById('htmlSource');
-
- if (el) {
- el.style.width = (vp.w - 20) + 'px';
- el.style.height = (vp.h - 65) + 'px';
- }
-}
|