code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
// I18N constants // LANG: "ru", ENCODING: UTF-8 // Author: Andrei Blagorazumov, a@fnr.ru { "Decimal numbers": "Десятичные числа", "Lower roman numbers": "Строчные романские числа", "Upper roman numbers": "Заглавные романские числа", "Lower latin letters": "Строчные латинские символы", "Upper latin letters": "Заглавные латинские символы", "Lower greek letters": "Строчные греческие символы", "Choose list style type (for ordered lists)": "Выберите стиль списков (для упорядоченных списков)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/ru.js
JavaScript
art
699
// I18N constants // LANG: "sv" (Swedish), ENCODING: UTF-8 // translated: Erik Dalén, <dalen@jpl.se> { "Decimal numbers": "Desimaltal", "Lower roman numbers": "Små romerska siffror", "Upper roman numbers": "Stora romerska siffror", "Lower latin letters": "Små latinska bokstäver", "Upper latin letters": "Stora latinska bokstäver", "Lower greek letters": "Små grekiska bokstäver", "Choose list style type (for ordered lists)": "Välj listtyp (för numrerade listor)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/sv.js
JavaScript
art
506
// I18N constants // LANG: "fr", ENCODING: UTF-8 { "Decimal numbers": "Nombres décimaux", "Lower roman numbers": "Nombres romains minuscule", "Upper roman numbers": "Nombres romains majuscule", "Lower latin letters": "Lettres latines minuscule", "Upper latin letters": "Lettres latines majuscule", "Lower greek letters": "Lettres grecques minuscule", "Choose list style type (for ordered lists)": "Choisissez le style de liste (pour les listes ordonnées)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/fr.js
JavaScript
art
474
// I18N constants // LANG: "ja", ENCODING: UTF-8 { "Decimal numbers": "10進数", "Lower roman numbers": "ローマ数字(小文字)", "Upper roman numbers": "ローマ数字(大文字)", "Lower latin letters": "アルファベット(小文字)", "Upper latin letters": "アルファベット(大文字)", "Lower greek letters": "ギリシャ文字(小文字)", "Choose list style type (for ordered lists)": "リスト形式の選択(順序付けリスト用)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/ja.js
JavaScript
art
477
// I18N constants // LANG: "nb", ENCODING: UTF-8 // translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com { "Decimal numbers": "Desimaltall", "Lower roman numbers": "Lower roman numbers", "Upper roman numbers": "Upper roman numbers", "Lower latin letters": "Lower latin letters", "Upper latin letters": "Upper latin letters", "Lower greek letters": "Lower greek letters", "Choose list style type (for ordered lists)": "Velg listetype (for nummererte lister)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/nb.js
JavaScript
art
506
// I18N constants // LANG: "es", ENCODING: UTF-8 // translated: Derick Leony <dleony@gmail.com> { "Decimal numbers": "Números", "Lower roman numbers": "Números romanos en minúsculas", "Upper roman numbers": "Números romanos en mayúsculas", "Lower latin letters": "Letras minúsculas", "Upper latin letters": "Letras mayúsculas", "Lower greek letters": "Letras griegas minúsculas", "Choose list style type (for ordered lists)": "Seleccionar estilo de lista (para listas ordenadas)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/es.js
JavaScript
art
505
// I18N constants // // LANG: "pt_br", ENCODING: UTF-8 // Portuguese Brazilian Translation // // Author: Marcio Barbosa, <marcio@mpg.com.br> // MSN: tomarshall@msn.com - ICQ: 69419933 // Site: http://www.mpg.com.br // // Last revision: 06 september 2007 // Please don´t remove this information // If you modify any source, please insert a comment with your name and e-mail // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). { "Decimal numbers": "Números decimais", "Lower roman numbers": "Números romanos inferiores", "Upper roman numbers": "Números romanos superiores", "Lower latin letters": "Letras latinas inferiores", "Upper latin letters": "Letras latinas superiores", "Lower greek letters": "Letras gregas inferiores", "Choose list style type (for ordered lists)": "Escolha um tipo de lista (para lista ordenada)" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/lang/pt_br.js
JavaScript
art
912
.ListType { } .ListType a { display:block; float:left; margin:2px 0 0 5px; padding:0; width:50px; height:40px; border:1px solid #9c96a5; } .ListType a:hover { border:1px solid #ffd760; } .ListType a.active { border:1px solid #000084; } .ListType a.circle { background:url(img/circle.png); } .ListType a.disc { background:url(img/disc.png); } .ListType a.square { background:url(img/square.png); } .ListType a.decimal { background:url(img/decimal.png); } .ListType a.lower-alpha { background:url(img/lower-alpha.png); } .ListType a.upper-alpha { background:url(img/upper-alpha.png); } .ListType a.lower-roman { background:url(img/lower-roman.png); } .ListType a.upper-roman { background:url(img/upper-roman.png); } .ListType a.none { background:url(img/none.png); }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ListType/ListType.css
CSS
art
844
{ "&iexcl;" : "¡", "&cent;" : "¢", "&pound;" : "£", "&curren;" : "¤", "&yen;" : "¥", "&brvbar;" : "¦", "&sect;" : "§", "&uml;" : "¨", "&copy;" : "©", "&ordf;" : "ª", "&laquo;" : "«", "&not;" : "¬", "&reg;" : "®", "&macr;" : "¯", "&deg;" : "°", "&plusmn;" : "±", "&sup2;" : "²", "&sup3;" : "³", "&acute;" : "´", "&micro;" : "µ", "&para;" : "¶", "&middot;" : "·", "&cedil;" : "¸", "&sup1;" : "¹", "&ordm;" : "º", "&raquo;" : "»", "&frac14;" : "¼", "&frac12;" : "½", "&frac34;" : "¾", "&iquest;" : "¿", "&Agrave;" : "À", "&Aacute;" : "Á", "&Acirc;" : "Â", "&Atilde;" : "Ã", "&Auml;" : "Ä", "&Aring;" : "Å", "&AElig;" : "Æ", "&Ccedil;" : "Ç", "&Egrave;" : "È", "&Eacute;" : "É", "&Ecirc;" : "Ê", "&Euml;" : "Ë", "&Igrave;" : "Ì", "&Iacute;" : "Í", "&Icirc;" : "Î", "&Iuml;" : "Ï", "&ETH;" : "Ð", "&Ntilde;" : "Ñ", "&Ograve;" : "Ò", "&Oacute;" : "Ó", "&Ocirc;" : "Ô", "&Otilde;" : "Õ", "&Ouml;" : "Ö", "&times;" : "×", "&Oslash;" : "Ø", "&Ugrave;" : "Ù", "&Uacute;" : "Ú", "&Ucirc;" : "Û", "&Uuml;" : "Ü", "&Yacute;" : "Ý", "&THORN;" : "Þ", "&szlig;" : "ß", "&agrave;" : "à", "&aacute;" : "á", "&acirc;" : "â", "&atilde;" : "ã", "&auml;" : "ä", "&aring;" : "å", "&aelig;" : "æ", "&ccedil;" : "ç", "&egrave;" : "è", "&eacute;" : "é", "&ecirc;" : "ê", "&euml;" : "ë", "&igrave;" : "ì", "&iacute;" : "í", "&icirc;" : "î", "&iuml;" : "ï", "&eth;" : "ð", "&ntilde;" : "ñ", "&ograve;" : "ò", "&oacute;" : "ó", "&oacute;" : "ó", "&ocirc;" : "ô", "&otilde;" : "õ", "&ouml;" : "ö", "&divide;" : "÷", "&oslash;" : "ø", "&ugrave;" : "ù", "&uacute;" : "ú", "&ucirc;" : "û", "&uuml;" : "ü", "&yacute;" : "ý", "&thorn;" : "þ", "&yuml;" : "ÿ", "&fnof;" : "ƒ", "&Alpha;" : "Α", "&Beta;" : "Β", "&Gamma;" : "Γ", "&Delta;" : "Δ", "&Epsilon;" : "Ε", "&Zeta;" : "Ζ", "&Eta;" : "Η", "&Theta;" : "Θ", "&Iota;" : "Ι", "&Kappa;" : "Κ", "&Lambda;" : "Λ", "&Mu;" : "Μ", "&Nu;" : "Ν", "&Xi;" : "Ξ", "&Omicron;" : "Ο ", "&Pi;" : "Π", "&Rho;" : "Ρ", "&Sigma;" : "Σ", "&Tau;" : "Τ", "&Upsilon;" : "Υ", "&Phi;" : "Φ", "&Chi;" : "Χ", "&Psi;" : "Ψ", "&Omega;" : "Ω", "&alpha;" : "α", "&beta;" : "β", "&gamma;" : "γ", "&delta;" : "δ", "&epsilon;" : "ε", "&zeta;" : "ζ", "&eta;" : "η", "&theta;" : "θ", "&iota;" : "ι", "&kappa;" : "κ", "&lambda;" : "λ", "&mu;" : "μ", "&nu;" : "ν", "&xi;" : "ξ", "&omicron;" : "ο", "&pi;" : "π", "&rho;" : "ρ", "&sigmaf;" : "ς", "&sigma;" : "σ", "&tau;" : "τ", "&upsilon;" : "υ", "&phi;" : "φ", "&omega;" : "ω", "&bull;" : "•", "&hellip;" : "…", "&prime;" : "′", "&Prime;" : "″", "&oline;" : "‾", "&frasl;" : "⁄", "&trade;" : "™", "&larr;" : "←", "&uarr;" : "↑", "&rarr;" : "→", "&darr;" : "↓", "&harr;" : "↔", "&rArr;" : "⇒", "&part;" : "∂", "&prod;" : "∏", "&sum;" : "∑", "&minus;" : "−", "&radic;" : "√", "&infin;" : "∞", "&cap;" : "∩", "&int;" : "∫", "&asymp;" : "≈", "&ne;" : "≠", "&equiv;" : "≡", "&le;" : "≤", "&ge;" : "≥", "&loz;" : "◊", "&spades;" : "♠", "&clubs;" : "♣", "&hearts;" : "♥", "&diams;" : "♦", "&OElig;" : "Œ", "&oelig;" : "œ", "&Scaron;" : "Š", "&scaron;" : "š", "&Yuml;" : "Ÿ", "&circ;" : "ˆ", "&tilde;" : "˜", "&ndash;" : "–", "&mdash;" : "—", "&lsquo;" : "‘", "&rsquo;" : "’", "&sbquo;" : "‚", "&ldquo;" : "“", "&rdquo;" : "”", "&bdquo;" : "„", "&dagger;" : "†", "&Dagger;" : "‡", "&permil;" : "‰", "&lsaquo;" : "‹", "&rsaquo;" : "›", "&euro;" : "€", // \x22 means '"' -- we use hex reprezentation so that we don't disturb // JS compressors (well, at least mine fails.. ;) "&nbsp;" : "\xA0", "&#8804;" : String.fromCharCode(0x2264), "&#8805;" : String.fromCharCode(0x2265) }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/HtmlEntities/Entities.js
JavaScript
art
3,743
{ "&fnof;" : "ƒ", "&Alpha;" : "Α", "&Beta;" : "Β", "&Gamma;" : "Γ", "&Delta;" : "Δ", "&Epsilon;" : "Ε", "&Zeta;" : "Ζ", "&Eta;" : "Η", "&Theta;" : "Θ", "&Iota;" : "Ι", "&Kappa;" : "Κ", "&Lambda;" : "Λ", "&Mu;" : "Μ", "&Nu;" : "Ν", "&Xi;" : "Ξ", "&Omicron;" : "Ο ", "&Pi;" : "Π", "&Rho;" : "Ρ", "&Sigma;" : "Σ", "&Tau;" : "Τ", "&Upsilon;" : "Υ", "&Phi;" : "Φ", "&Chi;" : "Χ", "&Psi;" : "Ψ", "&Omega;" : "Ω", "&alpha;" : "α", "&beta;" : "β", "&gamma;" : "γ", "&delta;" : "δ", "&epsilon;" : "ε", "&zeta;" : "ζ", "&eta;" : "η", "&theta;" : "θ", "&iota;" : "ι", "&kappa;" : "κ", "&lambda;" : "λ", "&mu;" : "μ", "&nu;" : "ν", "&xi;" : "ξ", "&omicron;" : "ο", "&pi;" : "π", "&rho;" : "ρ", "&sigmaf;" : "ς", "&sigma;" : "σ", "&tau;" : "τ", "&upsilon;" : "υ", "&phi;" : "φ", "&omega;" : "ω", "&bull;" : "•", "&hellip;" : "…", "&prime;" : "′", "&Prime;" : "″", "&oline;" : "‾", "&frasl;" : "⁄", "&trade;" : "™", "&larr;" : "←", "&uarr;" : "↑", "&rarr;" : "→", "&darr;" : "↓", "&harr;" : "↔", "&rArr;" : "⇒", "&part;" : "∂", "&prod;" : "∏", "&sum;" : "∑", "&minus;" : "−", "&radic;" : "√", "&infin;" : "∞", "&cap;" : "∩", "&int;" : "∫", "&asymp;" : "≈", "&ne;" : "≠", "&equiv;" : "≡", "&le;" : "≤", "&ge;" : "≥", "&loz;" : "◊", "&spades;" : "♠", "&clubs;" : "♣", "&hearts;" : "♥", "&diams;" : "♦", "&OElig;" : "Œ", "&oelig;" : "œ", "&Scaron;" : "Š", "&scaron;" : "š", "&Yuml;" : "Ÿ", "&circ;" : "ˆ", "&tilde;" : "˜", "&ndash;" : "–", "&mdash;" : "—", "&lsquo;" : "‘", "&rsquo;" : "’", "&sbquo;" : "‚", "&ldquo;" : "“", "&rdquo;" : "”", "&bdquo;" : "„", "&dagger;" : "†", "&Dagger;" : "‡", "&permil;" : "‰", "&lsaquo;" : "‹", "&rsaquo;" : "›", "&euro;" : "€", // \x22 means '"' -- we use hex reprezentation so that we don't disturb // JS compressors (well, at least mine fails.. ;) "&nbsp;" : "\xA0", "&#8804;" : String.fromCharCode(0x2264), "&#8805;" : String.fromCharCode(0x2265) }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/HtmlEntities/iso-8859-1.js
JavaScript
art
2,026
/*------------------------------------------*\ HtmlEntities for Xinha ____________________ Intended to faciliate the use of special characters with ISO 8 bit encodings. Using the conversion map provided by mharrisonline in ticket #127 If you want to adjust the list, e.g. to except the characters that are available in the used charset, edit Entities.js. You may save it under a different name using the xinha_config.HtmlEntities.EntitiesFile variable ISO-8859-1 preset is default, set xinha_config.HtmlEntities.Encoding = null; if you want all special characters to be converted or want to load a custom file \*------------------------------------------*/ function HtmlEntities(editor) { this.editor = editor; } HtmlEntities._pluginInfo = { name : "HtmlEntities", version : "1.0", developer : "Raimund Meyer", developer_url : "http://x-webservice.net", c_owner : "Xinha community", sponsor : "", sponsor_url : "", license : "HTMLArea" } Xinha.Config.prototype.HtmlEntities = { Encoding : 'iso-8859-1', EntitiesFile : Xinha.getPluginDir("HtmlEntities") + "/Entities.js" } HtmlEntities.prototype.onGenerate = function() { var e = this.editor; var url = (e.config.HtmlEntities.Encoding) ? Xinha.getPluginDir("HtmlEntities") + "/"+e.config.HtmlEntities.Encoding+".js" : e.config.HtmlEntities.EntitiesFile; var callback = function (getback) { var specialReplacements = e.config.specialReplacements; eval("var replacements =" + getback); for (var i in replacements) { specialReplacements[i] = replacements[i]; } } Xinha._getback(url,callback); }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/HtmlEntities/HtmlEntities.js
JavaScript
art
1,663
/*------------------------------------------*\ GenericPlugin for Xinha _______________________ Democase for plugin event handlers \*------------------------------------------*/ GenericPlugin._pluginInfo = { name : "GenericPlugin", version : "1.0", developer : "Xinha Developer Team", developer_url : "http://xinha.org", sponsor : "", sponsor_url : "", license : "htmlArea" } function GenericPlugin(editor) { this.editor = editor; } GenericPlugin.prototype.onGenerate = function () { } GenericPlugin.prototype.onGenerateOnce = function () { } GenericPlugin.prototype.inwardHtml = function(html) { return html; } GenericPlugin.prototype.outwardHtml = function(html) { return html; } GenericPlugin.prototype.onUpdateToolbar = function () { return false; } GenericPlugin.prototype.onExecCommand = function ( cmdID, UI, param ) { return false; } GenericPlugin.prototype.onKeyPress = function ( event ) { return false; } GenericPlugin.prototype.onMouseDown = function ( event ) { return false; } GenericPlugin.prototype.onBeforeSubmit = function () { return false; } GenericPlugin.prototype.onBeforeUnload = function () { return false; } GenericPlugin.prototype.onBeforeResize = function (width, height) { return false; } GenericPlugin.prototype.onResize = function (width, height) { return false; } /** * * @param {String} action one of 'add', 'remove', 'hide', 'show', 'multi_hide', 'multi_show' * @param {DOMNode|Array} panel either the panel itself or an array like ['left','right','top','bottom'] */ GenericPlugin.prototype.onPanelChange = function (action, panel) { return false; } /** * * @param {String} mode either 'textmode' or 'wysiwyg' */ GenericPlugin.prototype.onMode = function (mode) { return false; } /** * * @param {String} mode either 'textmode' or 'wysiwyg' */ GenericPlugin.prototype.onBeforeMode = function (mode) { return false; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/GenericPlugin/GenericPlugin.js
JavaScript
art
1,941
.hasid { background-image: url(img/set-id.gif); background-repeat: no-repeat; background-position: left top; padding-left: 19px; border: 1px dotted blue; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/set-id.css
CSS
art
173
// I18N constants // LANG: "nl", ENCODING: UTF-8 // Author: Maarten Molenschot, maarten@nrgmm.nl { "Set Id and Name": "ID en Naam instellen", "Name/Id": "Naam/ID", "Delete": "Verwijderen", "Set ID/Name": "ID/Naam instellen", "ID/Name:": "ID/Naam:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/lang/nl.js
JavaScript
art
269
// I18N constants // LANG: "de", ENCODING: UTF-8 // translated: Raimund Meyer xinha@ray-of-light.org { "Set Id and Name": "Objekt ID und Name einfügen", "Name/Id": "Name (ID)", "Delete": "Löschen" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/lang/de.js
JavaScript
art
208
// I18N constants // LANG: "ja", ENCODING: UTF-8 { "Set Id and Name": "IDと名前の設定", "Name/Id": "名前/ID", "Delete": "削除", "Set ID/Name": "IDと名前の設定", "ID/Name:": "ID/名前:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/lang/ja.js
JavaScript
art
214
// I18N constants // LANG: "nb", ENCODING: UTF-8 // translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com { "Set Id and Name": "Sett ID og navn", "Name/Id": "Navn (ID)", "Delete": "Slett" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/lang/nb.js
JavaScript
art
215
// I18N constants // // LANG: "pt_br", ENCODING: UTF-8 // Portuguese Brazilian Translation // // Author: Marcio Barbosa, <marcio@mpg.com.br> // MSN: tomarshall@msn.com - ICQ: 69419933 // Site: http://www.mpg.com.br // // Last revision: 06 september 2007 // Please don´t remove this information // If you modify any source, please insert a comment with your name and e-mail // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). { "Cancel": "Cancelar", "Delete": "Apagar", "ID/Name:": "ID/Nome:", "OK": "OK", "Set ID/Name": "Definir ID/Nome", "Set Id and Name": "Definir Id e Nome", "Set Id/Name": "Definir Id/Nome", "Name/Id": "Nome/Id" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/lang/pt_br.js
JavaScript
art
723
function SetId(editor) { this.editor = editor; var cfg = editor.config; var self = this; // register the toolbar buttons provided by this plugin cfg.registerButton({ id : "setid", tooltip : this._lc("Set Id and Name"), image : editor.imgURL("set-id.gif", "SetId"), textMode : false, action : function(editor) { self.buttonPress(editor); } }); cfg.addToolbarElement("setid", "createlink", 1); } SetId._pluginInfo = { name : "SetId", version : "2.0", developer : "Udo Schmal", developer_url : "http://www.schaffrath-neuemedien.de", c_owner : "Udo Schmal", sponsor : "L.N.Schaffrath NeueMedien", sponsor_url : "http://www.schaffrath-neuemedien.de", license : "htmlArea" }; SetId.prototype._lc = function(string) { return Xinha._lc(string, 'SetId'); }; SetId.prototype.onGenerate = function() { this.editor.addEditorStylesheet(Xinha.getPluginDir("SetId") + '/set-id.css'); }; SetId.prototype.buttonPress = function(editor) { var outparam = null; var html = editor.getSelectedHTML(); var sel = editor._getSelection(); var range = editor._createRange(sel); var node = editor._activeElement(sel); if (node) outparam = { name : node.id }; else outparam = { name : '' }; editor._popupDialog( "plugin://SetId/set_id", function( param ) { if ( param ) { var name = param["name"]; if (name == "" || name == null) { if (node) { node.removeAttribute("name"); node.removeAttribute("id"); node.removeAttribute("title"); if (node.className == "hasid") { node.removeAttribute("class"); } } return; } try { var doc = editor._doc; if (!node) { node = doc.createElement("span"); node.id = name; node.name = name; node.title = name; node.className = "hasid"; node.innerHTML = html; if (Xinha.is_ie) { range.pasteHTML(node.outerHTML); } else { editor.insertNodeAtSelection(node); } } else { node.id = name; node.name = name; node.title = name; node.className = "hasid"; } } catch (e) { } } }, outparam); };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/SetId.js
JavaScript
art
2,460
<html> <head> <title>Set Id/Name</title> <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" /> <script type="text/javascript" src="../../../popups/popup.js"></script> <script type="text/javascript"> window.resizeTo(350, 100); function Init() { __dlg_translate("SetId"); __dlg_init(); var param = window.dialogArguments; if (param) { document.getElementById("name").value = param["name"]; } document.getElementById("name").focus(); } function onOK() { // pass data back to the calling window var param = new Object(); param["name"] = document.getElementById("name").value; __dlg_close(param); return false; } function onDelete() { // pass data back to the calling window var param = new Object(); param["name"] = ""; __dlg_close(param); return false; } function onCancel() { __dlg_close(null); return false; } </script> </head> <body class="dialog" onload="Init()"> <div class="title">Set ID/Name</div> <form> <table border="0" style="width: 300px;"> <tr> <td class="label">ID/Name:</td> <td><input type="text" id="name" style="width: 200px" /></td> </tr> </table> <div id="buttons"> <button type="submit" name="ok" onclick="return onOK();">OK</button> <button type="button" name="delete" onclick="return onDelete();">Delete</button> <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> </div> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/SetId/popups/set_id.html
HTML
art
1,436
<?php /** * ExtendedFileManager editorframe.php file. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 21-06-2006 by Krzysztof Kotowicz * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); require_once('../ImageManager/Classes/ImageEditor.php'); $manager = new ExtendedFileManager($IMConfig,$insertMode); $editor = new ImageEditor($manager); $imageInfo = $editor->processImage(); ?> <html> <head> <title></title> <link href="<?php print $IMConfig['base_url'];?>assets/editorFrame.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/wz_jsgraphics.js"></script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/EditorContent.js"></script> <script type="text/javascript"> var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; if(window.top) Xinha = window.top.Xinha; function i18n(str) { return Xinha._lc(str, 'ImageManager'); } var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; var fileSize = "<?php echo (round($imageInfo['filesize'] / 1024,1)).' KB' ?>"; <?php if ($editor->isFileSaved() == 1) { ?> alert(i18n('File saved.')); window.parent.opener.parent.refresh(); window.parent.opener.selectImage ( '<?php echo $imageInfo['saveFile'] ?>', '<?php echo $imageInfo['saveFile'] ?>'.replace(/^.*\/?([^\/]*)$/, '$1'), <?php echo $imageInfo['width'] ?>, <?php echo $imageInfo['height'] ?> ); window.parent.close(); <?php } else if ($editor->isFileSaved() == -1) { ?> alert(i18n('File was not saved.')); <?php } ?> </script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editorFrame.js"></script> </head> <body> <div id="status"></div> <div id="ant" class="selection" style="visibility:hidden"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div> <?php if ($editor->isGDEditable() == -1) { ?> <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div> <?php } ?> <table height="100%" width="100%"> <tr> <td> <?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?> <span id="imgCanvas" class="crop"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span> <?php } else { ?> <span class="error">No Image Available</span> <?php } ?> </td> </tr> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/editorFrame.php
PHP
art
3,086
/** * An input field File Picker utilising the Xinha ExtendedFileManager. * * Hijack the Xinha ExtendedFileManager plugin to provide a file URL picker * for any form input field in the form of a "Browse" button to the * right of the field, in the same manner as a file type input field * except it opens the familiar ExtendedFileManager dialog to upload/select * a file and returns the URL of the file to the field's value. * * Example Usage: * * <script type="text/javascript">_editor_url = '/url/to/xinha';</script> * <script type="text/javascript" src="file-picker.js" /> * <script type="text/javascript"> * <?php require_once('/path/to/xinha/contrib/php-xinha.php'); ?> * with(FilePicker.prototype) * { * <?php * $Conf = array * ( * 'files_dir' => '/path/to/downloads', * 'files_url' => '/url/to/downloads', * 'show_full_options' => false, // Full options are not useful as a URL picker * // See ExtendedFileManager for more configuration options ! * ); * xinha_pass_to_php_backend($Conf); * ?> * } * * window.onload = function() { new FilePicker(document.getElementById('idOfTheInputField')); } * </script> * * * @author $Author$ * @version $Id$ * @package ImageManager */ function FilePicker(field) { this.field = field; var picker = this; var but = document.createElement('input'); but.type = 'button'; but.value = 'Browse'; but.onclick = function() { picker.popup_picker(); } field.parentNode.insertBefore(but,field.nextSibling); field.size = '20'; field.style.textAlign = 'right'; }; FilePicker.prototype.backend = _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&'; FilePicker.prototype.backend_data = null; FilePicker.prototype.append_query_string = true; FilePicker.prototype.popup_picker = function() { var picker = this; // closure for later var outparam = null; if(picker.field.value) { outparam = { f_href : picker.field.value, f_title : '', f_target : '', f_usetarget : false, baseHref: null }; } var manager = this.backend + '__function=manager&mode=link'; if(this.backend_config != null) { manager += '&backend_config=' + encodeURIComponent(this.backend_config); manager += '&backend_config_hash=' + encodeURIComponent(this.backend_config_hash); manager += '&backend_config_secret_key_location=' + encodeURIComponent(this.backend_config_secret_key_location); } if(this.backend_data != null) { for ( var i in this.backend_data ) { manager += '&' + i + '=' + encodeURIComponent(this.backend_data[i]); } } Dialog(manager, function(param) { if (!param) { // user must have pressed Cancel return false; } picker.field.value = param.f_href; }, outparam); } // Dialog is part of Xinha, but we'll provide it here incase Xinha's not being // loaded. if(typeof Dialog == 'undefined') { // htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003-2004 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: dialog.js 183 2005-05-20 06:11:44Z gogo $ // Though "Dialog" looks like an object, it isn't really an object. Instead // it's just namespace for protecting global symbols. function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } var dlg = window.open(url, "hadialog", "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=yes,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } Dialog._modal = null; }; Dialog._modal.focus(); }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; } // Deprecated method for passing config, use above instead! //--------------------------------------------------------- FilePicker.prototype.backend_config = null; FilePicker.prototype.backend_config_hash = null; FilePicker.prototype.backend_config_secret_key_location = 'Xinha:ExtendedFileManager'; //---------------------------------------------------------
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/file-picker.js
JavaScript
art
4,932
<?php /** * On the fly Thumbnail generation. * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg * relative to the base_dir given in config.inc.php * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 21-06-2006 by Krzysztof Kotowicz * Package: ExtendedFileManager (EFM 1.1.1) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); require_once('../ImageManager/Classes/Thumbnail.php'); //check for img parameter in the url if(!isset($_GET['img'])) exit(); $manager = new ExtendedFileManager($IMConfig,$insertMode); //get the image and the full path to the image $image = rawurldecode($_GET['img']); $fullpath = Files::makeFile($manager->getImagesDir(),$image); //not a file, so exit if(!is_file($fullpath)) exit(); $imgInfo = @getImageSize($fullpath); //Not an image, send default thumbnail if(!is_array($imgInfo)) { //show the default image, otherwise we quit! $default = $manager->getDefaultThumb(); if($default) { header('Location: '.$default); exit(); } } //if the image is less than the thumbnail dimensions //send the original image as thumbnail if ($imgInfo[0] <= $IMConfig['thumbnail_width'] && $imgInfo[1] <= $IMConfig['thumbnail_height']) { header('Location: '.$manager->getFileURL($image)); exit(); } //Check for thumbnails $thumbnail = $manager->getThumbName($fullpath); if(is_file($thumbnail)) { //if the thumbnail is newer, send it if(filemtime($thumbnail) >= filemtime($fullpath)) { header('Location: '.$manager->getThumbURL($image)); exit(); } } //creating thumbnails $thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']); $thumbnailer->createThumbnail($fullpath, $thumbnail); //Check for NEW thumbnails if(is_file($thumbnail)) { //send the new thumbnail header('Location: '.$manager->getThumbURL($image)); exit(); } else { //show the default image, otherwise we quit! $default = $manager->getDefaultThumb(); if($default) header('Location: '.$default); } ?>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/thumbs.php
PHP
art
2,292
/** * ExtendedFileManager extended-file-manager.js file. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Modified by: Krzysztof Kotowicz <koto@webworkers.pl> * Version: Updated on 08-01-2005 by Afru * Version: Modified on 20-06-2006 by Krzysztof Kotowicz * Version: Updated on 29-10-2006 by Raimund Meyer * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) */ /** * For installation details see Readme.txt in the plugin folder * */ function ExtendedFileManager(editor) { this.editor = editor; var cfg = editor.config; var toolbar = cfg.toolbar; var self = this; if (cfg.ExtendedFileManager.use_linker) { cfg.registerButton({ id : "linkfile", tooltip : Xinha._lc("Insert File Link",'ExtendedFileManager'), image : Xinha.getPluginDir('ExtendedFileManager') + '/img/ed_linkfile.gif', textMode : false, action : function(editor) { editor._linkFile(); } }); cfg.addToolbarElement("linkfile", "createlink", 1); }; var manager = editor.config.ExtendedFileManager.backend + '__function=manager'; if(cfg.ExtendedFileManager.backend_config != null) { manager += '&backend_config=' + encodeURIComponent(cfg.ExtendedFileManager.backend_config); manager += '&backend_config_hash=' + encodeURIComponent(cfg.ExtendedFileManager.backend_config_hash); manager += '&backend_config_secret_key_location=' + encodeURIComponent(cfg.ExtendedFileManager.backend_config_secret_key_location); } if(cfg.ExtendedFileManager.backend_data != null) { for ( var i in cfg.ExtendedFileManager.backend_data ) { manager += '&' + i + '=' + encodeURIComponent(cfg.ExtendedFileManager.backend_data[i]); } } cfg.ExtendedFileManager.manager = manager; } ExtendedFileManager._pluginInfo = { name : "ExtendedFileManager", version : "1.4", developer : "Afru, Krzysztof Kotowicz, Raimund Meyer", developer_url : "http://xinha.org", license : "htmlArea" }; Xinha.Config.prototype.ExtendedFileManager = { 'use_linker': true, 'backend' : Xinha.getPluginDir('ExtendedFileManager') + '/backend.php?__plugin=ExtendedFileManager&', 'backend_data' : null, // deprecated keys, use passing data through e.g. xinha_pass_to_php_backend() 'backend_config' : null, 'backend_config_hash': null, 'backend_config_secret_key_location': 'Xinha:ExtendedFileManager' }; // Over ride the _insertImage function in htmlarea.js. // Open up the ExtendedFileManger script instead. if(typeof ImageManager == 'undefined') { Xinha.prototype._insertImage = function(image) { var editor = this; // for nested functions var outparam = {"editor" : this, param : null}; if (typeof image == "undefined") { image = this.getParentElement(); if (image && !/^img$/i.test(image.tagName)) image = null; } if (image) { outparam.param = { f_url : Xinha.is_ie ? image.src : image.getAttribute("src"), f_alt : image.alt, f_title : image.title, f_border : image.style.borderWidth ? image.style.borderWidth : image.border, f_align : image.align, f_width : image.width, f_height : image.height, f_padding: image.style.padding, f_margin : image.style.margin, f_backgroundColor: image.style.backgroundColor, f_borderColor: image.style.borderColor, baseHref: editor.config.baseHref }; // compress 'top right bottom left' syntax into one value if possible outparam.param.f_border = shortSize(outparam.param.f_border); outparam.param.f_padding = shortSize(outparam.param.f_padding); outparam.param.f_margin = shortSize(outparam.param.f_margin); // convert rgb() calls to rgb hex outparam.param.f_backgroundColor = convertToHex(outparam.param.f_backgroundColor); outparam.param.f_borderColor = convertToHex(outparam.param.f_borderColor); } Dialog(this.config.ExtendedFileManager.manager, function(param){ if (!param) { // user must have pressed Cancel return false; } var img = image; if (!img) { if ( !param.f_url ) return false; if (Xinha.is_ie) { var sel = editor.getSelection(); var range = editor.createRange(sel); editor._doc.execCommand("insertimage", false, param.f_url); img = range.parentElement(); // wonder if this works... if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else { img = document.createElement('img'); img.src = param.f_url; editor.insertNodeAtSelection(img); } } else { if ( !param.f_url ) { // delete the image if empty url passed img.parentNode.removeChild(img); editor.updateToolbar(); return false; } else { img.src = param.f_url; } } img.alt = img.alt ? img.alt : ''; for (field in param) { var value = param[field]; switch (field) { case "f_alt" : img.alt = value; break; case "f_title" : img.title = value; break; case "f_border" : if (value) { img.style.borderWidth = /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') : ''; if(img.style.borderWidth && !img.style.borderStyle) { img.style.borderStyle = 'solid'; } else if (!img.style.borderWidth) { img.style.border = ''; } } break; case "f_borderColor": img.style.borderColor = value; break; case "f_backgroundColor": img.style.backgroundColor = value; break; case "f_align" : img.align = value; break; case "f_width" : if ( parseInt( value ) > 0 ) { img.width = parseInt(value); } break; case "f_height" : if ( parseInt( value ) > 0 ) { img.height = parseInt(value); } break; case "f_padding": img.style.padding = /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; case "f_margin": img.style.margin = /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; } } }, outparam); }; } Xinha.prototype._linkFile = function(link) { var editor = this; var outparam = {"editor" : this, param : null}; if (typeof link == "undefined") { link = this.getParentElement(); if (link) { if (/^img$/i.test(link.tagName)) link = link.parentNode; if (!/^a$/i.test(link.tagName)) link = null; } } if (!link) { var sel = editor.getSelection(); var range = editor.createRange(sel); var compare = 0; if (Xinha.is_ie) { if ( sel.type == "Control" ) compare = range.length; else compare = range.compareEndPoints("StartToEnd", range); } else { compare = range.compareBoundaryPoints(range.START_TO_END, range); } if (compare == 0) { alert(Xinha._lc("You must select some text before making a new link.", 'ExtendedFileManager')); return; } outparam.param = { f_href : '', f_title : '', f_target : '', f_usetarget : editor.config.makeLinkShowsTarget, baseHref: editor.config.baseHref }; } else outparam.param = { f_href : Xinha.is_ie ? link.href : link.getAttribute("href"), f_title : link.title, f_target : link.target, f_usetarget : editor.config.makeLinkShowsTarget, baseHref: editor.config.baseHref }; Dialog(this.config.ExtendedFileManager.manager+'&mode=link', function(param){ if (!param) return false; var a = link; if (!a) try { editor._doc.execCommand("createlink", false, param.f_href); a = editor.getParentElement(); var sel = editor.getSelection(); var range = editor.createRange(sel); if (!Xinha.is_ie) { a = range.startContainer; if (!/^a$/i.test(a.tagName)) { a = a.nextSibling; if (a == null) a = range.startContainer.parentNode; } } } catch(e) {} else { var href = param.f_href.trim(); editor.selectNodeContents(a); if (href == "") { editor._doc.execCommand("unlink", false, null); editor.updateToolbar(); return false; } else { a.href = href; } } if (!(a && /^a$/i.test(a.tagName))) return false; a.target = param.f_target.trim(); a.title = param.f_title.trim(); editor.selectNodeContents(a); editor.updateToolbar(); }, outparam); }; function shortSize(cssSize) { if(/ /.test(cssSize)) { var sizes = cssSize.split(' '); var useFirstSize = true; for(var i = 1; i < sizes.length; i++) { if(sizes[0] != sizes[i]) { useFirstSize = false; break; } } if(useFirstSize) cssSize = sizes[0]; } return cssSize; } function convertToHex(color) { if (typeof color == "string" && /, /.test.color) color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b) if (typeof color == "string" && / /.test.color) { // multiple values var colors = color.split(' '); var colorstring = ''; for (var i = 0; i < colors.length; i++) { colorstring += Xinha._colorToRgb(colors[i]); if (i + 1 < colors.length) colorstring += " "; } return colorstring; } return Xinha._colorToRgb(color); }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/ExtendedFileManager.js
JavaScript
art
11,408
<?php /** * Unified backend for ExtendedFileManager - copied from ImageManager * * Image Manager was originally developed by: * Xiang Wei Zhuo, email: xiangweizhuo(at)hotmail.com Wei Shou. * * Unified backend sponsored by DTLink Software, http://www.dtlink.com * Implementation by Yermo Lamers, http://www.formvista.com * * (c) DTLink, LLC 2005. * Distributed under the same terms as Xinha itself. * This notice MUST stay intact for use (see license.txt). * * DESCRIPTION: * * Instead of using separate URL's for each function, ImageManager now * routes all requests to the server through this single, replaceable, * entry point. backend.php expects at least two URL variable parameters: * * __plugin=ImageManager for future expansion; identify the plugin being requested. * __function=thumbs|images|editorFrame|editor|manager function being called. * * Having a single entry point that strictly adheres to a defined interface will * make the backend code much easier to maintain and expand. It will make it easier * on integrators, not to mention it'll make it easier to have separate * implementations of the backend in different languages (Perl, Python, ASP, etc.) * * @see config.inc.php */ /** * ImageManager configuration */ require_once('config.inc.php'); // Strip slashes if MQGPC is on set_magic_quotes_runtime(0); if(get_magic_quotes_gpc()) { $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); while(count($to_clean)) { $cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))]; unset($to_clean[array_pop($junk = array_keys($to_clean))]); foreach(array_keys($cleaning) as $k) { if(is_array($cleaning[$k])) { $to_clean[] =& $cleaning[$k]; } else { $cleaning[$k] = stripslashes($cleaning[$k]); } } } } /** * ImageManager configuration */ $formVars = empty($_POST) ? $_GET : $_POST; // make sure the request is for us (this gives us the ability to eventually organize // a backend event handler system) For an include file the return doesn't make alot of // sense but eventually we'll want to turn all of this into at least functions // separating out all the presentation HTML from the logic. (Right now all the HTML // used by ImageManager is in the same files as the PHP code ...) if ( @$formVars[ "__plugin" ] != "ExtendedFileManager" ) { // not for us. return true; } // so we don't have to re-engineer the entire thing right now, since it's probably // going to get rewritten anyway, we just include the correct file based on the // function request. switch ( @$formVars[ "__function" ] ) { case "editor": case "editorFrame": case "manager": case "images": case "thumbs": case "resizer": include_once $IMConfig['base_dir'] . '/' . $formVars['__function'] . '.php' ; exit(); break; default: break; } // end of switch. return false ; // END ?>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/backend.php
PHP
art
2,905
<?php /** * ExtendedFileManager configuration file. * Authors: Wei Zhuo, Afru * Version: Updated on 08-01-2005 by Afru * Version 1.1.2: Updated on 04-07-2006 by Krzysztof Kotowicz <koto@webworkers.pl> * Package: ExtendedFileManager * http://www.afrusoft.com/htmlarea */ /* Configuration file usage: * There are two insertModes for this filemanager. * One is "image" and another is "link". * So you can assign config values as below * * if($insertMode=="image") $IMConfig['property']=somevalueforimagemode; * else if($insertMode=="link") $IMConfig['property']=somevalueforlinkmode; * * (or) you can directly as $IMConfig['property']=somevalueforbothmodes; * * Best of Luck :) Afru. */ /* * Getting the mode for further differentiation */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; /** * Default backend URL * * URL to use for unified backend. * * The ?__plugin=ExtendedFileManager& is required. */ $IMConfig['backend_url'] = "backend.php?__plugin=ExtendedFileManager&"; /** * Backend Installation Directory * * location of backend install; these are used to link to css and js * assets because we may have the front end installed in a different * directory than the backend. (i.e. nothing assumes that the frontend * and the backend are in the same directory) */ $IMConfig['base_dir'] = getcwd(); $IMConfig['base_url'] = ''; /* File system path to the directory you want to manage the images for multiple user systems, set it dynamically. NOTE: This directory requires write access by PHP. That is, PHP must be able to create files in this directory. Able to create directories is nice, but not necessary. */ $IMConfig['images_dir'] = 'demo_images'; //You may set a different directory for the link mode; if you don't, the above setting will be used for both modes //$IMConfig['files_dir'] = 'demo_files'; /* The URL to the above path, the web browser needs to be able to see it. Please remove scripting capabilities in this directory for this directory (i.e. disable PHP, Perl, CGI; see .htaccess file in demo_images folder). */ $IMConfig['images_url'] = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['images_dir']; //$IMConfig['files_url'] = 'url/to/files_dir'; /* Format of the Date Modified in list view. It has to be a string understood by the PHP date() function (for possible values see http://http://php.net/manual/en/function.date.php) */ $IMConfig['date_format'] = "d.m.y H:i"; /* Possible values: true, false TRUE - If PHP on the web server is in safe mode, set this to true. SAFE MODE restrictions: directory creation will not be possible, only the GD library can be used, other libraries require Safe Mode to be off. FALSE - Set to false if PHP on the web server is not in safe mode. */ $IMConfig['safe_mode'] = false; /* This specifies whether any image library is available to resize and edit images.TRUE - Thumbnails will be resized by image libraries and if there is no library, default thumbnail will be shown. FALSE - Thumbnails will be resized by browser ignoring image libraries. */ $IMConfig['img_library'] = true; /* View type when the File manager is in insert image mode. Valid values are "thumbview" and "listview". */ if ($insertMode == 'image') $IMConfig['view_type'] = "thumbview"; else if($insertMode == "link") $IMConfig['view_type'] = "listview"; $IMConfig['insert_mode'] = $insertMode; /* Possible values: 'GD', 'IM', or 'NetPBM' The image manipulation library to use, either GD or ImageMagick or NetPBM. If you have safe mode ON, or don't have the binaries to other packages, your choice is 'GD' only. Other packages require Safe Mode to be off. */ define('IMAGE_CLASS', 'GD'); /* After defining which library to use, if it is NetPBM or IM, you need to specify where the binary for the selected library are. And of course your server and PHP must be able to execute them (i.e. safe mode is OFF). GD does not require the following definition. */ define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); //define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); /* The prefix for thumbnail files, something like .thumb will do. The thumbnails files will be named as "prefix_imagefile.ext", that is, prefix + orginal filename. */ $IMConfig['thumbnail_prefix'] = 't_'; /* Thumbnail can also be stored in a directory, this directory will be created by PHP. If PHP is in safe mode, this parameter is ignored, you can not create directories. If you do not want to store thumbnails in a directory, set this to false or empty string ''; */ $IMConfig['thumbnail_dir'] = 't'; /** * Resize files, or not. If the dimensions for an image are changed * this will control if the image is actually resized. * * Usually you want this true, unless you are very disk space concious. */ $IMConfig['resize_files'] = true; /** * Resized prefix * * The prefix for resized files, something like .resized will do. The * resized files will be named <prefix>_<width>x<height>_<original> * resized files are created when one changes the dimensions of an image * in the image manager selection dialog - the image is scaled when the * user clicks the ok button. */ $IMConfig['resized_prefix'] = '.resized'; // ------------------------------------------------------------------------- /** * Resized Directory * * Resized images may also be stored in a directory, except in safe mode. */ $IMConfig['resized_dir'] = ''; /* Possible values: true, false TRUE - Allow the user to create new sub-directories in the $IMConfig['images_dir']/$IMConfig['files_dir']. FALSE - No directory creation. NOTE: If $IMConfig['safe_mode'] = true, this parameter is ignored, you can not create directories */ $IMConfig['allow_new_dir'] = true; /* Possible values: true, false TRUE - Allow the user to edit image by image editor. FALSE - No edit icon will be displayed. NOTE: If $IMConfig['img_library'] = false, this parameter is ignored, you can not edit images. */ $IMConfig['allow_edit_image'] = true; /* Possible values: true, false TRUE - Allow the user to rename files and folders. FALSE - No rename icon will be displayed. */ $IMConfig['allow_rename'] = true; /* Possible values: true, false TRUE - Allow the user to perform cut/copy/paste actions. FALSE - No cut/copy/paste icons will be displayed. */ $IMConfig['allow_cut_copy_paste'] = true; /* Possible values: true, false TRUE - Allow the user to delete files and folders. FALSE - No delete icon will be displayed. */ $IMConfig['allow_delete'] = true; /* Possible values: true, false TRUE - Display color pickers for image background / border colors FALSE - Don't display color pickers */ $IMConfig['use_color_pickers'] = true; /* Possible values: true, false TRUE - Allow the user to set alt (alternative text) attribute. FALSE - No input field for alt attribute will be displayed. NOTE: The alt attribute is _obligatory_ for images, so <img alt="" /> will be inserted if 'images_enable_alt' is set to false */ $IMConfig['images_enable_alt'] = true; /* Possible values: true, false TRUE - Allow the user to set title attribute (usually displayed when mouse is over element). FALSE - No input field for title attribute will be displayed. */ $IMConfig['images_enable_title'] = false; /* Possible values: true, false TRUE - Allow the user to set align attribute. FALSE - No selection box for align attribute will be displayed. */ $IMConfig['images_enable_align'] = true; /* Possible values: true, false TRUE - Allow the user to set margin, padding, and border styles for the image FALSE - No styling input fields will be displayed. */ $IMConfig['images_enable_styling'] = true; /* Possible values: true, false TRUE - Allow the user to set target attribute for link (the window in which the link will be opened). FALSE - No selection box for target attribute will be displayed. */ $IMConfig['link_enable_target'] = true; /* Possible values: true, false TRUE - Allow the user to upload files. FALSE - No uploading allowed. */ $IMConfig['allow_upload'] = false; /* Maximum upload file size Possible values: number, "max" number - maximum size in Kilobytes. "max" - the maximum allowed by the server (the value is retrieved from the server configuration). */ $IMConfig['max_filesize_kb_image'] = 200; $IMConfig['max_filesize_kb_link'] = 5000; /* Maximum upload folder size in Megabytes. Use 0 to disable limit */ $IMConfig['max_foldersize_mb'] = 0; /* Allowed extensions that can be shown and allowed to upload. Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip" -Changed by AFRU. */ $IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp"); $IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls","doc"); /* The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown. */ $IMConfig['default_thumbnail'] = 'icons/def.gif'; $IMConfig['default_listicon'] = 'icons/def_small.gif'; /* Only files with these extensions will be shown as thumbnails. All other files will be shown as icons. */ $IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp"); /* Thumbnail dimensions. */ $IMConfig['thumbnail_width'] = 84; $IMConfig['thumbnail_height'] = 84; /* Image Editor temporary filename prefix. */ $IMConfig['tmp_prefix'] = '.editor_'; // Standard PHP Backend Data Passing // if data was passed using xinha_pass_to_php_backend() we merge the items // provided into the Config require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); if($passed_data = xinha_read_passed_data()) { $IMConfig = array_merge($IMConfig, $passed_data); $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; } // Deprecated config passing, don't use this way any more! elseif(isset($_REQUEST['backend_config'])) { if(get_magic_quotes_gpc()) { $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']); } if($_REQUEST['backend_config_secret_key_location'] !== 'Xinha:ExtendedFileManager') { trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data. The special backend configuration has been ignored. To resolve this, you should edit plugins/ExtendedFileManager/config.php and change the default key location from "Xinha:ExtendedFileManager" to your desired non default. See: http://trac.xinha.org/ticket/1518', E_USER_ERROR); } else { // Config specified from front end, check that it's valid session_start(); if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION)) die("Backend security error."); $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']]; if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret)) { die("Backend security error."); } $to_merge = unserialize($_REQUEST['backend_config']); if(!is_array($to_merge)) { die("Backend config syntax error."); } $IMConfig = array_merge($IMConfig, $to_merge); // changed config settings keys in relation to ImageManager $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&'; $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&'; $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&'; } } if ($IMConfig['max_filesize_kb_link'] == "max") { $IMConfig['max_filesize_kb_link'] = upload_max_filesize_kb(); } if ($IMConfig['max_filesize_kb_image'] == "max") { $IMConfig['max_filesize_kb_image'] = upload_max_filesize_kb(); } // END ?>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/config.inc.php
PHP
art
12,598
// I18N constants // LANG: "nl", ENCODING: UTF-8 // Author: Maarten Molenschot, maarten@nrgmm.nl { "File Manager": "Bestandsbeheer", "Insert Image": "Beeld invoegen", "Directory": "Map", "Directory Up": "Bovenliggende map", "New Folder": "Nieuw map", "Trash": "Prullenbak", "Edit": "Bewerken", "Image File": "Beeldbestand", "Upload": "Upload", "Upload:": "Upload:", "Width": "Breed", "Height": "Hoog", "Constrain Proportions": "Proportie behouden", "Border": "Kader", "Margin": "Inspringen", "Padding": "Uitvullen", "Refresh": "Vernieuwen", "Uploading...": "Uploaden...", "Uploading": "Uploaden", "Crop": "Uitsneden", "Resize": "Formaat wijzigen", "Rotate": "Draaien", "Measure": "Opmeten", "Marker": "Markeren", "Save": "Opslaan", "Filename:": "Bestandsnaam:", "Image Format": "Beeldformaat:", "Quality:": "Kwaliteit", "JPEG High": "JPEG hoog", "JPEG Medium": "JPEG midden", "JPEG Low": "JPEG laag", "File saved.": "Bestand opgeslagen.", "File was not saved.": "Bestand niet opgeslagen.", "Start X:": "Start X", "Start Y:": "Start Y", "Lock": "Op-slot", "Flip Image": "Beeld spiegelen", "Flip Horizontal": "hor. spiegelen", "Flip Vertical": "ver. spiegelen", "Rotate Image": "Beeld draaien", "Rotate 180 °": "Draai 180° om", "Rotate 90 ° CW": "Draai rechts om 90°", "Rotate 90 ° CCW": "Draai links om 90°", "Angle:": "Hoek:", "W:": "W:", "Clear": "Wissen", "Loading": "Laden", "Invalid base directory:": "Ongeldig pad:", 'Delete file "$file"?': 'Bestand "$file" verwijderen?', "Please delete all files/folders inside the folder you wish to delete first.": "Vewijder alle onderliggende bestanden/mappen eerst.", 'Delete folder "$dir"?': 'Wis map "$dir"?', "Folder Name:": "Map naam", "No Files Found": "Geen bestaand gevonden", "Invalid folder name, please choose another folder name.": "Ongeldig map naam, kies een andere naam s.v.p..", "GIF format is not supported, image editing not supported.": "GIF-format niet ondersteund, beeldbewerking niet ondersteund.", "No Image Available": "Geen beeld beschikbaar", "No Image selected.": "Geen beeld geselecteerd.", "Description:": "Beschrijving:", "Align": "Uitlijnen", "Description:": "Beschrijving:", "Margin": "Inspringen", "Padding": "Uitvullen", "Border": "Kader", "Color:": "Kleur:", "Border Color:": "Kaderkleur:", "Upload:": "Upload:", "Alt": "Alt", "Alt": "Alt", "File Name": "Bestandsnaam", "Thumbnail View": "Miniaturen", "List View": "Lijst", "Title (tooltip)": "Titel (tooltip)", "Target Window": "Doel venster", "Name": "Naam", "Size": "Grootte", "Date Modified": "Datum aangepast", "Total Size": "Totaalgrootte", "Free Space": "Vrije ruimte", "Positioning of this image" : "Uitlijnen van dit beeld", "Insert File Link": "Hypelink van bestandinvoegen", "Untitled": "Geen titel", 'Please enter name for new folder...': "Naam van nieuwe map...", "You must select some text before making a new link.": "Eerst tekst selecteren.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Map is niet leeg. Verwijder eerst alle bestanden en onderliggendemappen.", "Image Size": "Beeld afmetingen", "Other" : "Andere...", "Rename": "Naam wijzigen", "Please enter new name for this file...": "Nieuwe bestandsnaam...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Hernoemen niet mogelijk. Bestand bestaat al of\nmap heeft geen schrijf toestemming.", "Cancelled rename.": "Hernoemen geannuleerd.", 'File "$file" successfully uploaded.': '"$file" bestand upload voltooid.', "Cannot upload. Maximum folder size reached.": "Uploaden is niet mogelijk. De doel map is vol.", "Maximum file size [$max_size KB] exceeded.": "Maximale bestandgrootte [$max_size KB] overschreden.", "Cannot upload $extension Files. Permission denied.": "Het is niet mogelijk om $extension bestanden te uploaden.", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.": "Bestands upload niet mogelijk.\nMaximale bestandsgrootte [$max_size KB] overtreden\nof de map heeft geen schrijf toestemming.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Totaalgrootte: $max_foldersize_mb MB, nog vrij: $free_space", "Please enter new name for this folder...":"Geef een nieuwe naam voor deze map...", "Cut":"Knippen", "Copy":"Kopiëren", "Paste":"Plakken", 'Copy "$file" from "$dir" here': 'Kopieer "$file" van "$dir" naar', 'Copy folder "$file" from "$dir" here' : 'Kopieer map "$file" van "$dir" naar', 'Move "$file" from "$dir" here':'Verplaats "$file" van "$dir" naar', 'Move folder "$file" from "$dir" here':'Verplaats map "$file" van "$dir" naar', "Source file/folder not found.":"Bron bestand/map niet gevonden.", "Paste failed.\nMaybe folder doesn't have write permission.": "Plakken mislukt..\nDe map heeft mogelijk niet de juiste schrijfrechten.", "Could not create destination folder.":"Bestemmings map kon niet worden gemaakt..", "Destination file/folder already exists.":"Bestemmings bestand/map bestaat al." };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/nl.js
JavaScript
art
5,340
// I18N constants // LANG: "de", ENCODING: UTF-8 // translated: sven schomacker, http://www.hilope.de, mail@hilope.de { "File Manager": "Dateimanager", "Insert Image": "Bild einfügen", "Directory": "Verzeichnis", "Directory Up": "Aufwärts", "New Folder": "Neues Verzeichnis erstellen", "Trash": "Papierkorb", "Edit": "Bearbeiten", "Image File": "Bilddatei", "Upload": "Hochladen", "Width": "Breite", "Height": "Höhe", "Width:": "Breite:", "Height:": "Höhe:", "Constrain Proportions": "Proportionen beibehalten", "Border": "Rahmen", "Margin": "Aussenabstand", "Padding": "Innenabstand", "Refresh": "Aktualisieren", "Uploading...": "Lade hoch...", "Uploading": "Hochladen", "Crop": "Beschneiden", "Resize": "Größe ändern", "Rotate": "Drehen", "Measure": "Maße", "Marker": "Rahmen", "Toggle marker color" : "Farbe der Markierung umschalten", "Save": "Speichern", "Filename:": "Dateiname:", "Image Format": "Bildformat:", "Quality:": "Qualität", "JPEG High": "JPEG hoch", "JPEG Medium": "JPEG mittel", "JPEG Low": "JPEG niedrig", "File saved.": "Datei gespeichert.", "File was not saved.": "Datei wurde nicht gespeichert.", "Start X:": "Start X", "Start Y:": "Start Y", "Lock": "Feststellen", "Flip Image": "Bild spiegeln", "Flip Horizontal": "hor. spiegeln", "Flip Vertical": "ver. spiegeln", "Rotate Image": "Bild drehen", "Rotate 180 °": "Drehung um 180°", "Rotate 90 ° CW": "Drehung um 90° im Uhrzeigersinn", "Rotate 90 ° CCW": "Drehung um 90° gegen Uhrzeigersinn", "Angle:": "Winkel:", "W:": "W:", "Clear": "Löschen", "Loading": "Laden", "Invalid base directory:": "Ungültiges Basisverzeichnis:", 'Delete file "$file"?': 'Datei "$file" löschen?', "Please delete all files/folders inside the folder you wish to delete first.": "Bitte zuerst alle untergeordneten Ordner löschen.", 'Delete folder "$dir"?': 'Verzeichnis "$dir" löschen?', "Folder Name:": "Verzeichnisname", "No Files Found": "Keine Dateien gefunden", "Invalid folder name, please choose another folder name.": "Ungültiger Verzeichnisname - bitte neu wählen.", "GIF format is not supported, image editing not supported.": "GIF-Format nicht unterstützt, bearbeiten nicht möglich.", "No Image Available": "Kein Bild verfügbar", "No Image selected.": "Kein Bild ausgewählt.", "Description:": "Beschreibung:", "Align": "Anordnung", "Margin": "Aussenabstand", "Padding": "Innenabstand", "Border": "Rahmen", "Color": "Farbe", "Border Color": "Rahmenfarbe", "Upload": "Hochladen", "Alt": "Alt", "File Name": "Dateiname", "Thumbnail View": "Miniaturansicht", "List View": "Listenansicht", "Title (tooltip)": "Titel (Tooltip)", "Target Window": "Zielfenster", "Name": "Name", "Size": "Größe", "Date Modified": "Datum letzte Änderung", "Total Size": "Gesamtgröße", "Free Space": "Freier Speicher", "Positioning of this image" : "Anordnung dieses Bildes", "Insert File Link": "Dateilink einfügen", "Untitled": "Unbetitelt", 'Please enter name for new folder...': "Bitte Namen für neuen Ordner eingeben...", "You must select some text before making a new link.": "Bitte zuerst Text markieren.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Verzeichnis ist nicht leer. Bitte zuerst alle Unterordner und Dateien löschen.", "Image Size": "Bildgröße", "Other" : "Andere...", "Rename": "Umbenennen", "Please enter new name for this file...": "Bitte neuen Namen für diese Datei eingeben...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Umbenennen nicht möglich. Evtl. Dateiname schon vorhanden oder keine Schreibrechte.", "Cancelled rename.": "Umbenennen abgebrochen.", 'File "$file" successfully uploaded.': 'Datei "$file" erfolgreich hochgeladen.', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"Die maximale Ordnergröße ist erreicht. Bitte löschen Sie Dateien, die Sie nicht mehr benötigen.", "Maximum file size [$max_size KB] exceeded.":"Maximale Dateigröße [$max_size KB] überschritten.", "Cannot upload $extension Files. Permission denied.": "$extension Dateien dürfen nicht hochgeladen werden.", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"Konnte Datei nicht hochladen.\nEntweder die maximale Dateigröße [$max_size KB] ist überschritten\noder das Verzeichnis hat keine Schreibrechte.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Max. Ordergröße: $max_foldersize_mb MB, noch frei: $free_space", "Please enter new name for this folder...":"Bitte neuen Namen für diesen Ordner eingeben...", "Cut":"Ausschneiden", "Copy":"Kopieren", "Paste":"Einfügen", 'Copy "$file" from "$dir" here': '"$file" aus Ordner "$dir" hierher kopieren', 'Copy folder "$file" from "$dir" here' : '"Ordner $file" aus "$dir" hierher kopieren', 'Move "$file" from "$dir" here':'"$file" aus Ordner "$dir" hierher verschieben', 'Move folder "$file" from "$dir" here':'Ordner "$file" aus "$dir" hierher verschieben', "Source file/folder not found.":"Quelldatei/-ordner nicht gefunden", "Paste failed.\nMaybe folder doesn't have write permission.": "Einfügen fehlgeschlagen.\nMöglicherweise hat der Ordner keine Schreibberechtigung.", "Could not create destination folder.":"Konnte Zielordner nicht erstellen.", "Destination file/folder already exists.":"Zieldatei/-ordner existiert bereits", "File pasted OK.": "File pasted OK.", "Filesize:" : "Dateigröße:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/de.js
JavaScript
art
5,690
// I18N constants // LANG: "pl", ENCODING: UTF-8 // translated: Krzysztof Kotowicz, http://www.web.eskot.pl, koto@webworkers.pl { "File Manager": "Menedżer plików", "Insert Image": "Wstaw obrazek", "Directory": "Katalog", "Directory Up": "Katalog wyżej", "New Folder": "Nowy katalog", "Trash": "Usuń", "Edit": "Edytuj", "Image File": "Plik obrazka", "Upload": "Wgraj", "Width": "Szerokość", "Height": "Wysokość", "Width:": "Szerokość:", "Height:": "Wysokość:", "Constrain Proportions": "Zachowaj proporcje", "Border": "Ramka", "Margin": "Odstęp", "Padding": "Wcięcie", "Refresh": "Odśwież", "Uploading...": "Wgrywanie...", "Uploading": "Wgrywam", "Crop": "Przytnij", "Resize": "Przeskaluj", "Rotate": "Obróć", "Measure": "Zmierz", "Marker": "Zaznacz", "Save": "Zapisz", "Filename:": "Nazwa pliku:", "Image Format": "Format pliku:", "Quality:": "Jakość", "JPEG High": "JPEG wysoka", "JPEG Medium": "JPEG średnia", "JPEG Low": "JPEG niska", "File saved.": "Zapisano plik.", "File was not saved.": "Nie zapisano pliku.", "Start X:": "Początek X:", "Start Y:": "Początek Y:", "Lock": "Zablokuj", "Flip Image": "Odwróć", "Flip Horizontal": "Odwróć poziomo", "Flip Vertical": "Odwróć pionowo", "Rotate Image": "Obróć", "Rotate 180 °": "Obróć 180°", "Rotate 90 ° CW": "Obróć 90° w prawo", "Rotate 90 ° CCW": "Obróć 90° w lewo", "Angle:": "Kąt:", "W:": "L:", "Clear": "Wyczyść", "Loading": "Ładowanie", "Invalid base directory:": "Nieprawidłowy katalog bazowy:", 'Delete file "$file"?': "$file\n\nUsunąć plik?", "Please delete all files/folders inside the folder you wish to delete first.": "Najpierw usuń wszystkie pliki i podkatalogi katalogu.", 'Delete folder "$dir"?': "$dir\n\nUsunąć katalog ?", "No Files Found": "Nie znaleziono plików", "Invalid folder name, please choose another folder name.": "Nieprawidłowa nazwa katalogu, wybierz inną.", "GIF format is not supported, image editing not supported.": "Brak obsługi plików GIF, edycja jest niemożliwa.", "No Image Available": "Obrazek niedostępny", "No Image selected.": "Nie zaznaczono obrazka.", "Align": "Wyrównanie", "Color": "Kolor", "Border Color": "Kolor ramki", "Alt": "Alt", "File Name": "Nazwa pliku", "Thumbnail View": "Miniaturki", "List View": "Lista", "Title (tooltip)": "Tytuł", "Target Window": "Docelowe okno", "Name": "Nazwa", "Size": "Rozmiar", "Date Modified": "Data ost.modyf.", "Total Size": "Miejsce na serwerze", "Free Space": "Pozostało", "Positioning of this image" : "Wyrównanie tego obrazka na stronie", "Insert File Link": "Wstaw odnośnik do pliku na serwerze", "Untitled": "Bez_nazwy", 'Please enter name for new folder...': "Podaj nazwę nowego folderu...", "You must select some text before making a new link.": "Zaznacz tekst przed dodaniem odnośnika.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Folder nie jest pusty. Najpierw usuń wszystkie pliki i podfoldery tego folderu.", "Image Size": "Wymiary", "Other" : "Inne...", "Rename": "Zmień nazwę", "Please enter new name for this file...": "Podaj nową nazwę dla tego pliku...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Nie mogłem zmienić nazwy pliku. Plik o nowej nazwie już istnieje\nlub prak praw zapisu do katalogu.", "Cancelled rename.": "Anulowano zmianę nazwy pliku.", 'File "$file" successfully uploaded.': 'Plik "$file" wgrano na serwer.', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"Wgrywanie nie powiodło się.\n\nPrzekroczono dozwolony limit miejsca. Usuń niechciane pliki i spróbuj ponownie.", "Maximum file size [$max_size KB] exceeded.":"Wgrywanie nie powiodło się.\n\nPrzekroczono maksymalny rozmiar pliku [$max_size KB].", "Cannot upload $extension Files. Permission denied.": "Nie można było wgrać pliku.\n\nNiedozwolone rozszerzenie pliku [$extension].", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"Wgrywanie nie powiodło się.\n\nPrzekroczono maksymalny rozmiar pliku [$max_size KB] lub nie ma ustawionych praw zapisu do folderu.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Dostępny limit: $max_foldersize_mb MB, Wolne: $free_space", "Please enter new name for this folder...":"Podaj nową nazwę dla tego folderu...", "Cut":"Wytnij", "Copy":"Kopiuj", "Paste":"Wklej", 'Copy "$file" from "$dir" here': 'Skopiuj "$file" z "$dir" tutaj', 'Copy folder "$file" from "$dir" here' : 'Skopiuj folder "$file" z "$dir" tutaj', 'Move "$file" from "$dir" here':'Przenieś "$file" z "$dir" tutaj', 'Move folder "$file" from "$dir" here':'Przenieś folder "$file" z "$dir" tutaj', "Source file/folder not found.":"Nie znaleziono pliku/folderu źródłowego.", "Paste failed.\nMaybe folder doesn't have write permission.": "Wklejenie nie powiodło się.\nPrawdopodobnie nie masz praw zapisu w tym folderze.", "Could not create destination folder.":"Nie można było utworzyć folderu docelowego.", "Destination file/folder already exists.":"Plik/folder docelowy już istnieje.", "File pasted OK.": "Wklejono plik." };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/pl.js
JavaScript
art
5,387
// LANG: "fr", ENCODING: UTF-8 // translated: Kevin Huppert - Créabilis, http://www.creabilis.com, kevin.huppert@worldonline.fr { "File Manager": "Gestionnaire de fichiers", "Insert Image": "Insérer une image", "Directory": "Répertoire", "Directory Up": "Remonter", "New Folder": "Nouveau dossier", "Trash": "Corbeille", "Edit": "Modifier", "Image File": "Fichier image", "Upload": "Envoyer", "Width": "Largeur", "Height": "Hauteur", "Width:": "Largeur:", "Height:": "Hauteur:", "Constrain Proportions": "Maintenir les proportions", "Border": "Bordure", "Margin": "Marge", "Padding": "Marge intérieure", "Refresh": "Actualiser", "Uploading...": "Envoi en cours...", "Uploading": "Envoi", "Crop": "Recadrer", "Resize": "Redimen.", "Rotate": "Pivoter", "Measure": "Règle", "Marker": "Marqueur", "Toggle marker color" : "Changer la couleur du marqueur", "Save": "Enregistrer", "Filename:": "Nom du fichier:", "Image Format": "Format d\'image:", "Quality:": "Qualité:", "JPEG High": "JPEG haut", "JPEG Medium": "JPEG moyen", "JPEG Low": "JPEG bas", "File saved.": "Fichier enregistré.", "File was not saved.": "Le fichier n\'a pas été enregistré.", "Start X:": "Départ X", "Start Y:": "Départ Y", "Lock": "Verrouiller", "Flip Image": "Symétrie", "Flip Horizontal": "Symétrie hor.", "Flip Vertical": "Symétrie ver.", "Rotate Image": "Pivoter l\'image", "Rotate 180 °": "Rotation à 180°", "Rotate 90 ° CW": "Rotation à 90° horaire", "Rotate 90 ° CCW": "Rotation à 90° antihoraire", "Angle:": "Angle:", "W:": "W:", "Clear": "Effacer", "Loading": "Chargement", "Invalid base directory:": "Dossier racine invalide:", 'Delete file "$file"?': 'Effacer le fichier "$file" ?', "Please delete all files/folders inside the folder you wish to delete first.": "Effacez s\'il vous plaît tous les fichiers/dossiers dans le dossier que vous souhaitez effacer d\'abord.", 'Delete folder "$dir"?': 'Effacer le dossier "$dir" ?', "Folder Name:": "Nom du dossier:", "No Files Found": "Aucun fichier", "Invalid folder name, please choose another folder name.": "Nom de dossier invalide - choisissez un autre nomd de dossier.", "GIF format is not supported, image editing not supported.": "Le format GIF n\'est pas supporté, édition d\'image impossible.", "No Image Available": "Aucune image disponible", "No Image selected.": "Aucune image sélectionnée.", "Description:": "Description:", "Align": "Alignement", "Margin": "Marge", "Padding": "Marge intérieure", "Border": "Bordure", "Color": "Couleur", "Border Color": "Couleur de la bordure", "Upload": "Envoyer", "Alt": "Alt", "File Name": "Nom du fichier", "Thumbnail View": "Vue miniatures", "List View": "Vue liste", "Title (tooltip)": "Tooltip", "Target Window": "Fenêtre cible", "Name": "Nom", "Size": "Taille", "Date Modified": "Date de modification", "Total Size": "Taille totale", "Free Space": "Espace libre", "Positioning of this image" : "Position de cette image", "Insert File Link": "Insérer un lien vers fichier", "Untitled": "Sans titre", 'Please enter name for new folder...': "Entrez un nom pour le nouveau dossier...", "You must select some text before making a new link.": "Vous devez sélectionner du texte avant de faire un nouveau lien.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Le dossier n\'est pas vide. Effacez tous les fichiers et sous-dossiers qu\'il contient.", "Image Size": "Dimensions de l\'image", "Other" : "Autre...", "Rename": "Renommer", "Please enter new name for this file...": "Entrez un nouveau nom pour ce fichier...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Impossible de renommer le fichier. \n Un fichier de même nom existe déjà ou l\'écriture est impossible.", "Cancelled rename.": "Renommage annulé.", 'File "$file" successfully uploaded.': 'Fichier "$file" envoyé.', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"La taille maximale pour le dossier est atteinte. Vous devez effacer des fichiers pour libérer de la place", "Maximum file size [$max_size KB] exceeded.":"Taille de fichier [$max_size Ko] dépassée.", "Cannot upload $extension Files. Permission denied.": "Impossible d\'envoyer des fichiers $extension.", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"Impossible d'envoyer le fichier.\nSoit la taille maximale [$max_size Ko] est dépassée\nsoit le dossier ne possède pas les droits d\'écriture.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Taille maximale: $max_foldersize_mb Mo, libre: $free_space", "Please enter new name for this folder...":"Entrez un nouveau nom pour ce dossier...", "Cut":"Couper", "Copy":"Copier", "Paste":"Coller", 'Copy "$file" from "$dir" here': 'Copier "$file" du dossier "$dir" ici', 'Copy folder "$file" from "$dir" here' : 'Copier le dossier "$file" de "$dir" ici', 'Move "$file" from "$dir" here':'Déplacer "$file" du dossier "$dir" ici', 'Move folder "$file" from "$dir" here':'Déplacer le dossier "$file" de "$dir" ici', "Source file/folder not found.":"Dossier ou fichier source introuvable.", "Paste failed.\nMaybe folder doesn't have write permission.": "Echec lors du coller.\nLe dossier n\'à peut être pas les droits d\'écriture.", "Could not create destination folder.":"Impossible de créer le dossier de destination.", "Destination file/folder already exists.":"Fichier/dossier déjà existant.", "File pasted OK.": "Fichier correctement collé.", "Filesize:" : "Taille du fichier:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/fr.js
JavaScript
art
5,819
// I18N constants // LANG: "ja", ENCODING: UTF-8 { "File Manager": "ファイルマネージャ", "Insert Image": "画像の挿入", "Directory": "ディレクトリ", "Directory Up": "親ディレクトリへ", "New Folder": "新規フォルダ", "Trash": "削除", "Edit": "編集", "Image File": "画像ファイル", "Upload": "アップロード", "Width": "幅", "Height": "高さ", "Width:": "幅:", "Height:": "高さ:", "Constrain Proportions": "縦横比を固定", "Border": "ボーダー", "Margin": "間隔", "Padding": "余白", "Refresh": "更新", "Uploading...": "アップロード中...", "Uploading": "アップロード中", "Crop": "切り抜き", "Resize": "サイズ変更", "Rotate": "回転", "Measure": "計測", "Marker": "マーカー", "Save": "保存", "Filename:": "ファイル名:", "Image Format": "画像形式", "Quality:": "画質:", "JPEG High": "JPEG 高画質", "JPEG Medium": "JPEG 標準", "JPEG Low": "JPEG 低画質", "File saved.": "ファイルを保存しました。", "File was not saved.": "ファイルを保存できませんでした。", "Start X:": "開始 X", "Start Y:": "開始 Y", "Lock": "ロック", "Flip Image": "画像を反転", "Flip Horizontal": "左右反転", "Flip Vertical": "上下反転", "Rotate Image": "画像を回転", "Rotate 180 °": "180°", "Rotate 90 ° CW": "90° 時計回り", "Rotate 90 ° CCW": "90° 反時計回り", "Angle:": "角度:", "W:": "W:", "Clear": "クリア", "Loading": "ロード中", "Invalid base directory:": "無効なディレクトリ:", 'Delete file "$file"?': 'ファイル "$file" を削除しますか?', "Please delete all files/folders inside the folder you wish to delete first.": "削除したいフォルダ内のファイルとフォルダを全て削除しておいてください。", 'Delete folder "$dir"?': 'フォルダ "$dir" を削除しますか?', "Folder Name:": "フォルダ名:", "No Files Found": "ファイルがありません", "Invalid folder name, please choose another folder name.": "無効なフォルダ名です。別のフォルダ名を選んでください。", "GIF format is not supported, image editing not supported.": "GIF形式はサポートされていないため、画像編集できません。", "No Image Available": "画像がありません", "No Image selected.": "画像が選択されていません。", "Description:": "詳細:", "Align": "行揃え", "Description:": "説明:", "Margin:": "間隔:", "Padding:": "余白:", "Border:": "境界線:", "Color:": "色:", "Border Color:": "境界色:", "Upload:": "アップロード:", "Alt": "Alt", "Alt": "Alt", "File Name": "ファイル名", "Thumbnail View": "サムネール表示", "List View": "一覧表示", "Title (tooltip)": "タイトル", "Target Window": "ターゲット", "Name": "名前", "Size": "サイズ", "Date Modified": "更新日", "Total Size": "合計サイズ", "Free Space": "空き容量", "Positioning of this image" : "この画像の配置", "Insert File Link": "ファイルへのリンクを挿入", "Untitled": "無題", 'Please enter name for new folder...': "新規フォルダの名前を入力してください...", "You must select some text before making a new link.": "リンクを作成するにはテキストを選択する必要があります。", "Folder is not empty. Please delete all Files and Subfolders inside.": "フォルダは空ではありません。中のファイルとサブフォルダをすべて削除してください。", "Image Size": "画像サイズ", "Other" : "その他", "Rename": "名前の変更", "Please enter new name for this file...": "ファイルの新しい名前を入力してください...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "ファイル名を変更できません。同名のファイルが存在するか、\nフォルダに書き込み権限がありません。", "Cancelled rename.": "名前変更を中止しました。", 'File "$file" successfully uploaded.': 'ファイル "$file" のアップロードに成功しました。', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"アップロードできません。フォルダ容量の上限に達しました。不要なファイルを削除して、再試行してください。", "Maximum file size [$max_size KB] exceeded.":"ファイルサイズ上限 [$max_size KB] を超えています。", "Cannot upload $extension Files. Permission denied.": "$extension ファイルをアップロードできません。操作は禁止されています。", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"ファイルをアップロードできません。\nファイルサイズ上限 [$max_size KB] を超えているか、\nフォルダに書き込み権限がありません。", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "合計サイズ: $max_foldersize_mb MB, 空き容量: $free_space", "Please enter new name for this folder...":"このフォルダの新しい名前を入力してください...", "Cut":"切り取り", "Copy":"コピー", "Paste":"貼り付け", 'Copy "$file" from "$dir" here': '"$file" を "$dir" からここにコピー', 'Copy folder "$file" from "$dir" here' : 'フォルダ "$file" を "$dir" からここにコピー', 'Move "$file" from "$dir" here':'"$file" を "$dir" からここに移動', 'Move folder "$file" from "$dir" here':'フォルダ "$file" を "$dir" からここに移動', "Source file/folder not found.":"転送元ファイル/フォルダが見つかりません。", "Paste failed.\nMaybe folder doesn't have write permission.": "貼り付けに失敗しました。\nフォルダに書き込み権限がない可能性があります。", "Could not create destination folder.":"転送先フォルダを作成できませんでした。", "Destination file/folder already exists.":"転送先ファイル/フォルダはすでに存在します。", "File pasted OK.": "ファイルの貼り付けに成功しました。" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/ja.js
JavaScript
art
6,378
// I18N constants // LANG: "de", ENCODING: UTF-8 // translated: Bjarke M. Lauridsen, http://www.detailx.dk, detailx@gmail.com { "File Manager": "Fil Manager", "Insert Image": "Indsæt billede", "Directory": "Mappe", "Directory Up": "Mappe op", "New Folder": "Ny mappe", "Trash": "Papirkurv", "Edit": "Rediger", "Image File": "Billedfil", "Upload": "Upload", "Width": "Bredde", "Height": "Højde", "Width:": "Bredde:", "Height:": "Højde:", "Constrain Proportions": "Korrekt størrelsesforhold", "Border": "Ramme", "Margin": "Margen", "Padding": "Spaltefyld", "Refresh": "Opdater", "Uploading...": "Uploader...", "Uploading": "Uploader", "Crop": "Beskær", "Resize": "Ændre størrelse", "Rotate": "Rotere", "Measure": "Målebånd", "Marker": "Markør", "Toggle marker color" : "Skift markørfarve", "Save": "Gem", "Filename:": "Filnavn:", "Image Format": "Billedformat:", "Quality:": "Kvalitet", "JPEG High": "JPEG høj", "JPEG Medium": "JPEG mellem", "JPEG Low": "JPEG lav", "File saved.": "Filen blev gemt.", "File was not saved.": "Filen blev ikke gemt.", "Start X:": "Start X", "Start Y:": "Start Y", "Lock": "Lås", "Flip Image": "Vend billede", "Flip Horizontal": "Vend vandret", "Flip Vertical": "Vend lodret", "Rotate Image": "Drej billede", "Rotate 180 °": "Drej 180°", "Rotate 90 ° CW": "Drej 90° med uret", "Rotate 90 ° CCW": "Drej 90° mod uret", "Angle:": "Vinkel:", "W:": "W:", "Clear": "Fortryd", "Loading": "Henter", "Invalid base directory:": "Ugyldig base mappe:", 'Delete file "$file"?': 'Slet filen "$file"?', "Please delete all files/folders inside the folder you wish to delete first.": "Slet venligst alle filer/mapper i mappen før den slettes.", 'Delete folder "$dir"?': 'Slet mappen "$dir"?', "Folder Name:": "Mappenavn", "No Files Found": "Ingen filer fundet", "Invalid folder name, please choose another folder name.": "Ugyldigt mappenavn, vælg venligst et andet navn.", "GIF format is not supported, image editing not supported.": "GIF-Format ikke understøttet - kan ikke redigeres.", "No Image Available": "Ingen billeder tilgængelig", "No Image selected.": "Ingen billeder valgt.", "Description:": "Beskrivelse:", "Align": "Placering", "Margin": "Margen", "Padding": "Spaltefyld", "Border": "Ramme", "Color": "Farve", "Border Color": "Rammefarve", "Upload": "Upload", "Alt": "Alt", "File Name": "Filnavn", "Thumbnail View": "Miniatureportræt", "List View": "Listevisning", "Title (tooltip)": "Titel (Tooltip)", "Target Window": "Mål", "Name": "Navn", "Size": "Størrelse", "Date Modified": "Dato for redigering", "Total Size": "Samlet størrelse", "Free Space": "Fri plads", "Positioning of this image" : "Billedets position", "Insert File Link": "Indsæt fil-link", "Untitled": "Ubetitlet", 'Please enter name for new folder...': "Indtast venligst navn på ny mappe...", "You must select some text before making a new link.": "Vælg venligst noget tekst før du laver et nyt link.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Mappen er ikke tom. Slet venligst alle filer og undermappermapper i mappen først.", "Image Size": "Billedstørrelse", "Other" : "Andre...", "Rename": "Omdøb", "Please enter new name for this file...": "Indtast venligst et nyt navn til denne fil...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Filen kan ikke omdøbes. En fil med samme navn eksisterer allerede, \neller mappen har ikke skriverettigheder.", "Cancelled rename.": "Fortryd omdøbning.", 'File "$file" successfully uploaded.': 'Filen "$file" blev uploadet.', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"Kan ikke uploade. Den maksimale mappestørrelse er nået. Slet uønskede filer og prøv igen.", "Maximum file size [$max_size KB] exceeded.":"Maksimal filstørrelse [$max_size KB] overskredet.", "Cannot upload $extension Files. Permission denied.": "Kan ikke uploade $extension. Tilladelse nægtet.", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"Ikke muligt at uploade filen.\nEnten er den maksimale filstørrelse på [$max_size KB] nået\neller mappen har ikke skriverettigheder.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Maks størrelse: $max_foldersize_mb MB, Fri plads: $free_space", "Please enter new name for this folder...":"Indtast venligst et nyt navn til denne mappe...", "Cut":"Klip", "Copy":"Kopier", "Paste":"Sæt ind", 'Copy "$file" from "$dir" here': 'Kopier "$file" fra "$dir" her', 'Copy folder "$file" from "$dir" here' : 'Kopier mappe "$file" fra "$dir" her', 'Move "$file" from "$dir" here':'Flyt "$file" fra "$dir" her', 'Move folder "$file" from "$dir" here':'Flyt mappe "$file" fra "$dir" her', "Source file/folder not found.":"Kilde- fil/mappe ikke fundet", "Paste failed.\nMaybe folder doesn't have write permission.": "Sæt ind fejlede.\nMåske har mappen ikke skriverettigheder.", "Could not create destination folder.":"Kunne ikke lave destinationsmappe.", "Destination file/folder already exists.":"Destinations- fil/mappe findes allerede", "File pasted OK.": "File pasted OK.", "Filesize:" : "Filstørrelse:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/da.js
JavaScript
art
5,559
// I18N constants // LANG: "nb", ENCODING: UTF-8 // translated: Kim Steinhaug, http://www.easycms.no/, kim@easycms.no { "File Manager": "Filbehandler", "Insert Image": "Sett inn bilde", "Directory": "Mappe", "Directory Up": "Opp et nivå", "New Folder": "Ny mappe", "Trash": "Søppel", "Edit": "Rediger", "Image File": "Bildefil", "Upload": "Last opp", "Upload:": "Last opp:", "Width": "Bredde", "Height": "Høyde", "Constrain Proportions": "Beholde proposjoner", "Border": "Ramme", "Margin": "Marg", "Padding": "Innvendig marg", "Refresh": "Oppfrisk side", "Uploading...": "Laster opp...", "Uploading": "Laster opp", "Crop": "Beskjær", "Resize": "Endre størrelse", "Rotate": "Roter", "Measure": "Mål", "Marker": "Markør", "Save": "Lagre", "Filename:": "Filnavn:", "Image Format": "Bildeformat:", "Quality:": "Kvalitet", "JPEG High": "JPEG høy", "JPEG Medium": "JPEG middels", "JPEG Low": "JPEG lav", "File saved.": "Fil er lagret.", "File was not saved.": "Filen ble ikke lagret.", "Start X:": "Start X", "Start Y:": "Start Y", "Lock": "Lås", "Flip Image": "Vend bilde", "Flip Horizontal": "Vend horisontal", "Flip Vertical": "Vend vertikal", "Rotate Image": "Roter bilde", "Rotate 180 °": "Roter 180°", "Rotate 90 ° CW": "Roter 90° med klokka", "Rotate 90 ° CCW": "Roter 90° mot klokka", "Angle:": "Vinkel:", "W:": "L:", "Clear": "Tøm", "Loading": "Laster", "Invalid base directory:": "Ugyldig sti til mappe:", 'Delete file "$file"?': "$file\n\nSlette fil?", "Please delete all files/folders inside the folder you wish to delete first.": "Vennligst slett alle filer og mapper i mappen du ønsker å slette først!", 'Delete folder "$dir"?': "$dir\n\nSlette mappe?", "Folder Name:": "Mappe navn", "No Files Found": "Ingen filer funnet", "Invalid folder name, please choose another folder name.": "Ugyldig mappenavn, vennligst velg et annet mappenavn", "GIF format is not supported, image editing not supported.": "GIF format er ikke støttet og bilderedigering er derfor ikke tilgjengelig.", "No Image Available": "Inget bilde tilgjengelig.", "No Image selected.": "Inget bilde valgt.", "Description:": "Beskrivelse:", "Align": "Juster", "Color:": "Farge:", "Border Color:": "Ramme farge:", "Alt": "Alt", "File Name": "Filnavn", "Thumbnail View": "Miniatyrbilde", "List View": "Liste", "Title (tooltip)": "Tittel (tooltip)", "Target Window": "Mål", "Name": "Navn", "Size": "Størrelse", "Date Modified": "Siste endret", "Total Size": "Total størrelse", "Free Space": "Ledig plass", "Positioning of this image" : "Bildepossisjon", "Insert File Link": "Sett inn lenke til fil", "Untitled": "Uten navn", 'Please enter name for new folder...': "Skriv inn navn for ny mappe...", "You must select some text before making a new link.": "Du må velge noe tekst før du kan lage en ny lenke.", "Folder is not empty. Please delete all Files and Subfolders inside.": "Mappen er ikke tom. Du må slette alle filer og mapper i mappen først.", "Image Size": "Bilde størrelse", "Other" : "Andre...", "Rename": "Nytt navn", "Please enter new name for this file...": "Vennligst skriv inn nytt navn for denne fil...", "Unable to rename file. File of the same name already exists or\nfolder doesn't have write permission.": "Kan ikke omdøpe fil. En fil har allerede samme navn eller\nmappen har ikke skriverettigheter.", "Cancelled rename.": "Omdøping av filnavn avbrutt.", 'File "$file" successfully uploaded.': 'File "$file" successfully uploaded.', "Cannot upload. Maximum folder size reached. Delete unwanted files and try again.":"Cannot upload. Maximum folder size reached. Delete unwanted files and try again.", "Maximum file size [$max_size KB] exceeded.":"Maximum file size [$max_size KB] exceeded.", "Cannot upload $extension Files. Permission denied.": "Cannot upload $extension Files. Permission denied.", "Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.":"Unable to upload File. \nEither Maximum file size [$max_size KB] exceeded or\nFolder doesn\'t have write permission.", "Total Size : $max_foldersize_mb MB, Free Space: $free_space": "Total Size : $max_foldersize_mb MB, Free Space: $free_space", "Please enter new name for this folder...":"Please enter new name for this folder...", "Cut":"Cut", "Copy":"Copy", "Paste":"Paste", 'Copy "$file" from "$dir" here': 'Copy "$file" from "$dir" here', 'Copy folder "$file" from "$dir" here' : 'Copy folder "$file" from "$dir" here', 'Move "$file" from "$dir" here':'Move "$file" from "$dir" here', 'Move folder "$file" from "$dir" here':'Move folder "$file" from "$dir" here', "Source file/folder not found.":"Source file/folder not found.", "Paste failed.\nMaybe folder doesn't have write permission.": "Paste failed.\nMaybe folder doesn't have write permission.", "Could not create destination folder.":"Could not create destination folder.", "Destination file/folder already exists.":"Destination file/folder already exists.", "File pasted OK.": "File pasted OK."
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/nb.js
JavaScript
art
5,211
// I18N constants // LANG: "es", ENCODING: UTF-8 // translated: michael Hauptmnn (mhauptma73) , http://www.azahost.com/, miguel@azalorea.com { "Image Manager": "Editor de imágenes", "Insert Image": "insertar imagen", "Directory": "Directorio", "Directory Up": "Directorio superior", "New Folder": "Crear directorio", "Trash": "Basura", "Edit": "editar", "Image File": "Fichero", "Upload": "Subir", "Width": "Ancho", "Height": "Alto", "Width:": "Ancho:", "Height:": "Alto:", "Constrain Proportions": "Proporcional", "Border": "Borde", "V Space": "espacio vertical", "H Space": "espacio horizontal", "Refresh": "Actualizar", "Uploading...": "Subir...", "Crop": "Recortar", "Resize": "Cambiar tamaño", "Rotate": "Girar", "Measure": "Dimensiones", "Marker": "Marcador", "Save": "Guardar", "Filename:": "Nombre del fichero:", "Image Format": "Formato:", "Quality:": "Calidad", "JPEG High": "JPEG alto", "JPEG Medium": "JPEG medio", "JPEG Low": "JPEG bajo", "File saved.": "Fichero guardado.", "File was not saved.": "el fichero no ha sido guardado.", "Start X:": "Inicio X", "Start Y:": "Inicio Y", "Lock": "Bloquear", "Flip Image": "invertir imagen", "Flip Horizontal": "invertir horizontalmente", "Flip Vertical": "invertir verticalmente", "Rotate Image": "Girar imagen", "Rotate 180 °": "Girar 180º", "Rotate 90 ° CW": "Girar 90º sentido reloj", "Rotate 90 ° CCW": "Girar 90º sentido contrareloj", "Angle:": "Ángulo:", "W:": "B:", "Clear": "Eliminar", "Loading": "Cargar", "Invalid base directory:": "Directorio de inicio inválido:", "Delete file?": "¿Borrar fichero?", "Please delete all files/folders inside the folder you wish to delete first.": "Primero tiene que borrar todoas los ficheros de este directorio.", "Delete folder?": "¿Borrar directorio?", "Folder Name:": "Nombre del directorio:", "No Images Found": "No se ha encontrado imagen", "Invalid folder name, please choose another folder name.": "Nombre de directorio inválido... por favor elija otro nombre.", "GIF format is not supported, image editing not supported.": "No hay soporte para imágenes en formato GIF.", "No Image Available": "No hay imagen", "No Image selected.": "No ha seleccionado imagen.", "Description:": "Descripción:", "Align:": "Alineado:", "Description:": "Descripción:", "Margin:": "Margen exterior:", "Padding:": "Margen interior:", "Border:": "Borde:", "Color:": "Color:", "Upload:": "Subir:" };
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/es.js
JavaScript
art
2,530
// I18N constants // LANG: "pt_br", ENCODING: UTF-8 // Portuguese Brazilian Translation // Author: Marcio Barbosa, <marcio@mpg.com.br> // MSN: tomarshall@msn.com - ICQ: 69419933 // Site: http://www.mpg.com.br // Last revision: 05 september 2007 // Please don´t remove this information // If you modify any source, please insert a comment with your name and e-mail // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). { ">List View": ">Lista", ">Thumbnail View": ">Miniaturas", "A:": "A:", "Absbottom": "Inferior absoluto", "Absmiddle": "Meio absoluto", "Align": "Alinhamento", "Alt": "Alt", "Angle:": "Angulo:", "Baseline": "Linha de base", "Border": "Borda", "Border Color": "Côr da Borda", "Bottom": "Inferior", "Cancel": "Cancelar", "Clear": "Limpar", "Color": "Côr", "Constrain Proportions": "Manter Proporcionalidade", "Copy": "Copiar", "Crop": "Recortar", "Cut": "Cortar", "Directory": "Diretório", "Directory Up": "Diretório Acima", "Edit": "Editar", "File List": "Lista de Arquivos", "File Manager": "Gerenciador de Arquivos", "Filename:": "Nome do Arquivo:", "Flip Horizontal": "Espelhar Horizontalmente", "Flip Image": "Espelhar Imagem", "Flip Vertical": "Espelhar Verticalmente", "Folder": "Pasta", "GIF format is not supported, image editing not supported.": "Formato GIF não é suportado, não é possível editar imagem.", "H:": "A:", "Height": "Altura", "Height:": "Altura:", "Image Editor": "Editor de Imagem", "Image Format": "Formato da Imagem", "Image Selection": "Seleção de Imagem", "Insert File Link": "Inserir Link de Arquivo", "Invalid base directory:": "Diretório base inválido", "JPEG High": "JPEG Alto", "JPEG Low": "JPEG Baixo", "JPEG Medium": "JPEG Médio", "Left": "Esquerda", "Loading": "Carregando", "Lock": "Travar", "Margin": "Margem", "Marker": "Marcar", "Maximum folder size limit reached. Upload disabled.": "Atingido o limite máximo da pasta. Envio desativado.", "Measure": "Medida:", "Middle": "Meio", "New Folder": "Nova Pasta", "New window (_blank)": "Nova janela (_blank)", "No Files Found": "Nenhum Arquivo Encontrado", "No Image Available": "Nenhuma Imagem Disponível", "None (use implicit)": "Nenhum (uso implícito)", "Not set": "Não definido", "Padding": "Espaçamento Interno", "Please enter value": "Por favor, entre o valor", "Positioning of this image": "Posicionamento desta imagem", "Quality:": "Qualidade:", "Refresh": "Atualizar", "Rename": "Renomear", "Resize": "Redimencionar", "Right": "Direita(o)", "Rotate": "Rotacionar", "Rotate 180 &deg;": "Rotacionar 180 &deg;", "Rotate 90 &deg; CCW": "Rotacionar 90 &deg; anti-horário", "Rotate 90 &deg; CW": "Rotacionar 90 &deg; horário", "Rotate Image": "Rotacionar Imagem", "Same frame (_self)": "Mesma frame (_self)", "Save": "Gravar", "Start X:": "Início X:", "Start Y:": "Início Y", "Target Window": "Janela Destino", "Texttop": "Texto no topo", "Title (tooltip)": "Título (tooltip)", "Top": "Topo", "Top frame (_top)": "Frame do topo (_top)", "Trash": "Lixo", "Upload": "Enviar", "W:": "L:", "Width": "Largura", "Width:": "Largura:", "X:": "X:", "Y:": "Y:", "You must select some text before making a new link.": "Você precisa selecionar um texto antes de criar um novo link." }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/lang/pt_br.js
JavaScript
art
3,442
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <script type="text/javascript" src="../../popups/popup.js"></script> <style type="text/css"> /*<![CDATA[*/ html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} body { padding: 5px; } .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} select, input, button { font: 11px Tahoma,Verdana,sans-serif; } .buttons { width: 70px; text-align: center; } form { padding: 0px; margin: 0;} form .elements{ padding: 10px; text-align: center; } /*]]>*/ </style> <script type="text/javascript" src="../../popups/popup.js"></script> <script type="text/javascript"> /*<![CDATA[*/ if(window.opener) HTMLArea = window.opener.HTMLArea; init = function () { __dlg_translate('ImageManager'); var param = opener.Dialog._arguments; if ( param ) { if ( param.title ) { document.title = param.title; document.getElementById("title").innerHTML = param.title; } if ( param.prompt ) { document.getElementById("prompt").innerHTML = param.prompt; } if ( param.value ) { document.getElementById("f_input").value = param.value; } } document.getElementById("f_input").focus(); __xinha_dlg_init(); }; function onCancel() { __dlg_close(null); return false; } function onOK() { // pass data back to the calling window __dlg_close({value:document.getElementById("f_input").value}); return false; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', init); //--> </script> </head> <body > <div class="title" id="title" style="white-space:nowrap">Please enter value</div> <form action=""> <div class="elements"> <label for="f_input" id="prompt"></label> <input type="text" id="f_input" style="width:50%"/> </div> <div style="text-align: right;"> <hr /> <button type="button" class="buttons" onclick="return onOK();">OK</button> <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> </div> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/prompt.html
HTML
art
2,604
<?php header('Content-Type: text/javascript; charset=UTF-8'); /** * Resize images to a given size, and saving in a new file. * resize.php?img=/relative/path/to/image.jpg&width=<pixels>&height=<pixels>[&to=/relative/path/to/newimage.jpg] * relative to the base_dir given in config.inc.php * This is pretty much just thumbs.php with some mods, I'm too lazy to do it properly * @author $Author:ray $ * @version $Id:resizer.php 922 2007-12-30 14:35:46Z ray $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); require_once('../ImageManager/Classes/Thumbnail.php'); function js_fail($message) { echo 'alert(\'ha ' . $message . '\'); false'; exit; } function js_success($resultFile) { echo '\'' . $resultFile . '\''; exit; } //check for img parameter in the url if(!isset($_GET['img']) || !isset($_GET['width']) || !isset($_GET['height'])) { js_fail('Missing parameter.'); } if($IMConfig['resize_files'] == FALSE) { js_success($_GET['img']); } $manager = new ExtendedFileManager($IMConfig); //get the image and the full path to the image $image = $_GET['img']; $fullpath = Files::makeFile($manager->getImagesDir(),$image); //not a file, so exit if(!is_file($fullpath)) { js_fail("File {$fullpath} does not exist."); } $imgInfo = @getImageSize($fullpath); //Not an image, bail out. if(!is_array($imgInfo)) { js_fail("File {$fullpath} is not an image."); } if(!isset($_GET['to'])) { $resized = $manager->getResizedName($fullpath,$_GET['width'],$_GET['height']); $_GET['to'] = $manager->getResizedName($image,$_GET['width'],$_GET['height'], FALSE); } else { $resized = Files::makeFile($manager->getImagesDir(),$_GET['to']); } // Check to see if it already exists if(is_file($resized)) { // And is newer if(filemtime($resized) >= filemtime($fullpath)) { js_success($_GET['to']); } } // resize (thumbnailer will do this for us just fine) $thumbnailer = new Thumbnail($_GET['width'],$_GET['height']); $thumbnailer->proportional = FALSE; $thumbnailer->createThumbnail($fullpath, $resized); // did it work? if(is_file($resized)) { js_success($_GET['to']); } else { js_fail("Resize Failed."); } ?>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/resizer.php
PHP
art
2,286
<?php /** * The main GUI for the ExtendedFileManager. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Version: Updated on 08-01-2005 by Afru * Version: Updated on 04-07-2006 by Krzysztof Kotowicz * Version: Updated on 29-10-2006 by Raimund Meyer * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); $manager = new ExtendedFileManager($IMConfig); $dirs = $manager->getDirs(); // calculate number of table rows to span for the preview cell $num_rows = 4; // filename & upload & disk info message & width+margin if ($insertMode=='image') { if ($IMConfig['images_enable_styling'] === false) { $hidden_fields[] = 'f_margin'; $hidden_fields[] = 'f_padding'; $hidden_fields[] = 'f_border'; $hidden_fields[] = 'f_backgroundColor'; $hidden_fields[] = 'f_borderColor'; $num_rows +=2; } else if ($IMConfig['use_color_pickers'] === false) { $hidden_fields[] = 'f_backgroundColor'; $hidden_fields[] = 'f_borderColor'; $num_rows +=2; } if ($IMConfig['images_enable_align'] === false) { $hidden_fields[] = 'f_align'; } if ($IMConfig['images_enable_alt']) { $num_rows++; } else { $hidden_fields[] = 'f_alt'; } if ($IMConfig['images_enable_title']) { $num_rows++; } else { $hidden_fields[] = 'f_title'; } } if ($insertMode == 'link') { if ($IMConfig['link_enable_target'] === false) { $hidden_fields[] = 'f_target'; } $num_rows +=2; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Insert <?php echo ($insertMode == 'image' ? 'Image' : 'File Link') ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="<?php print $IMConfig['base_url'];?>assets/manager.css" rel="stylesheet" type="text/css" /> <link href="../../popups/popup.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../popups/popup.js"></script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script> <?php if (!empty($IMConfig['use_color_pickers'])) { ?><script type="text/javascript" src="../../modules/ColorPicker/ColorPicker.js"></script><?php } ?> <script type="text/javascript"> /* <![CDATA[ */ if(window.opener) Xinha = window.opener.Xinha; var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>"; var base_url = "<?php echo $manager->getImagesURL(); ?>"; var _backend_url = "<?php print $IMConfig['backend_url']; ?>"; var _resized_prefix = "<?php echo $IMConfig['resized_prefix']; ?>"; var _resized_dir = "<?php echo $IMConfig['resized_dir']; ?>"; var manager_show_target = <?php echo ($insertMode == 'link' && $IMConfig['link_enable_target'] ? 'true' : 'false') ?>; <?php if(isset($_REQUEST['mode'])) { echo 'var manager_mode="'.$_REQUEST['mode'].'";'; } else { echo 'var manager_mode="image";'; } //IE doesn't like a relative URL when changing a window's location $iframe_url = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['backend_url']; ?> var iframeUrl = '<?php print $iframe_url ?>__function=images&mode=<?php echo $insertMode;?>&viewtype=<?php echo $IMConfig['view_type'] ?>'; /* ]]> */ </script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/manager.js"></script> </head> <body class="dialog" > <div class="title">Insert <?php echo ($insertMode == 'image' ? 'Image' : 'File Link') ?></div> <form action="<?php print htmlspecialchars($IMConfig['backend_url']); ?>" id="uploadForm" method="post" enctype="multipart/form-data"> <input type="hidden" name="__plugin" value="ExtendedFileManager" /> <input type="hidden" name="__function" value="images" /> <input type="hidden" name="mode" value="<?php echo $insertMode; ?>" /> <input type="hidden" id="manager_mode" value="<?php echo $insertMode;?>" /> <fieldset><legend>File Manager</legend> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td nowrap="nowrap" style="padding:10px;"> <label for="dirPath">Directory</label> <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)"> <option value="/">/</option> <?php foreach($dirs as $relative=>$fullpath) { ?> <option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option> <?php } ?> </select> <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="<?php print $IMConfig['base_url'];?>img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a> <?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?> <a href="#" onclick="newFolder();" title="New Folder"><img src="<?php print $IMConfig['base_url'];?>img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a> <?php } ?> <span id="pasteBtn"></span> <select name="viewtype" id="viewtype" onchange="updateView()"> <option value="thumbview" <?php if($IMConfig['view_type']=="thumbview") echo 'selected="selected"';?> >Thumbnail View</option> <option value="listview" <?php if($IMConfig['view_type']=="listview") echo 'selected="selected"';?> >List View</option> </select> </td> </tr> <tr><td style="padding:10px; padding-top:0px;"> <div id="messages"><span id="message">Loading</span><img src="<?php print $IMConfig['base_url'];?>img/dots.gif" width="22" height="12" alt="..." /></div> <iframe src="about:blank" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> </td></tr> </table> </fieldset> <!-- image properties --> <div id="controls"> <table class="inputTable"> <tr> <td style="text-align: right;" nowrap="nowrap"><label for="f_url"><?php if($insertMode=='image') echo 'File Name'; else echo 'URL';?></label></td> <td colspan="5"><input type="text" id="<?php if($insertMode=='image') echo 'f_url'; else echo 'f_href';?>" class="largelWidth" value="" /></td> <td rowspan="<?php echo $num_rows ?>" colspan="2" style="vertical-align: top; text-align: center;"><?php if($insertMode=='image') { ?> <div style="padding:4px;background-color:#CCC;border:1px inset;width: 100px; height: 100px;"> <img src="<?php print $IMConfig['base_url'];?>img/1x1_transparent.gif" alt="" id="f_preview" /> </div> <?php } else if($insertMode=="link" && $IMConfig['link_enable_target'] !== false) {?><label for="f_align" id="f_target_label">Target Window</label> <select id="f_target" style="width:125px;"> <option value="">None (use implicit)</option> <option value="_blank">New window (_blank)</option> <option value="_self">Same frame (_self)</option> <option value="_top">Top frame (_top)</option> </select><br /><br /> <input type="text" name="f_other_target" id="f_other_target" style="visibility:hidden; width:120px;" /> <?php } ?></td> </tr> <?php if($insertMode == 'image' && $IMConfig['images_enable_alt']) { ?> <tr> <td style="text-align: right;"><label for="f_alt">Alt</label></td> <td colspan="5"><input type="text" id="f_alt" class="largelWidth" value="" /></td> </tr> <?php } if ($insertMode == 'link' || $IMConfig['images_enable_title']) { ?> <tr> <td style="text-align: right;"><label for="f_title">Title (tooltip)</label></td> <td colspan="5"><input type="text" id="f_title" class="largelWidth" value="" /></td> </tr> <?php } ?> <tr> <?php if (!empty($IMConfig['max_foldersize_mb']) && Files::dirSize($manager->getImagesDir()) > ($IMConfig['max_foldersize_mb']*1048576)) { ?> <td colspan="6" style="text-align: right;">Maximum folder size limit reached. Upload disabled.</td> <?php } else if($IMConfig['allow_upload']) { ?> <td style="text-align: right;"><label for="upload">Upload</label></td> <td colspan="5"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max = (($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] )*1024); ?>" /> <input type="file" name="upload" id="upload" /></td> <td><button type="submit" name="submit" onclick="doUpload();">Upload</button>(<?php echo $max/1024 . 'KB'?> max.)</td> </tr> </table> </td> <?php } else { ?> <td colspan="6"></td> <?php } ?> </tr> <tr> <td><?php if (!empty($hidden_fields)) foreach ($hidden_fields as $hf) echo "<input type=\"hidden\" id=\"{$hf}\" name=\"{$hf}\" value=\"\" />"; ?></td> <td colspan="5"><span id="diskmesg"></span></td> </tr> <tr> <td style="text-align: right;"><?php if($insertMode=='image') { ?> <label for="f_width">Width</label><?php }?></td> <td><?php if($insertMode=='image') { ?> <input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/><?php } else echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";?></td> <td rowspan="2"><?php if($insertMode=='image') { ?><img src="<?php print $IMConfig['base_url'];?>img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /> <input type="hidden" id="orginal_width" /> <input type="hidden" id="orginal_height" /> <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" value="on" /><br /> <label for="constrain_prop">Constrain Proportions</label><?php }?> </td> <td rowspan="3" style="text-align: right;"></td> <td style="text-align: right;"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_margin">Margin</label><?php }?></td> <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_margin" class="smallWidth" value="" /><?php } ?></td> </tr> <tr> <td style="text-align: right;"><?php if($insertMode=='image') { ?><label for="f_height">Height</label><?php }?></td> <td class="smallWidth"><?php if($insertMode=='image') { ?><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/><?php }?></td> <td style="text-align: right;"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_padding">Padding</label><?php }?></td> <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_padding" class="smallWidth" value="" /> <?php }?></td> <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) && $IMConfig['images_enable_styling'] !== false) { ?> <td style="text-align: left;">Color</td> <td> <input name="f_backgroundColor" type="text" id="f_backgroundColor" size="7" /> </td> <?php } ?> </tr> <tr> <td style="text-align: right;"><?php if($insertMode=='image' && $IMConfig['images_enable_align'] !== false) { ?><label for="f_align">Align</label><?php }?></td> <td colspan="2"><?php if($insertMode=='image' && $IMConfig['images_enable_align'] !== false) { ?> <select size="1" id="f_align" title="Positioning of this image"> <option value="" selected="selected" >Not set</option> <option value="left" >Left</option> <option value="right" >Right</option> <option value="texttop" >Texttop</option> <option value="absmiddle" >Absmiddle</option> <option value="baseline" >Baseline</option> <option value="absbottom" >Absbottom</option> <option value="bottom" >Bottom</option> <option value="middle" >Middle</option> <option value="top" >Top</option> </select><?php } ?> </td> <td style="text-align: right;"><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><label for="f_border">Border</label><?php }?></td> <td><?php if($insertMode=='image' && $IMConfig['images_enable_styling'] !== false) { ?><input type="text" id="f_border" class="smallWidth" value="" /><?php }?></td> <?php if($insertMode=='image' && !empty($IMConfig['use_color_pickers']) && $IMConfig['images_enable_styling'] !== false) { ?> <td style="text-align: left;">Border Color</td> <td><input name="f_borderColor" type="text" id="f_borderColor" size="7" /></td> <?php } ?> </tr> </table> <!--// image properties --> <div style="text-align: right;"> <hr /> <button type="button" class="buttons" onclick="return refresh();">Refresh</button> <button type="button" class="buttons" onclick="return onOK();">OK</button> <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> </div> </div> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/manager.php
PHP
art
13,527
<?php /** * ExtendedFileManager, list images, directories, and thumbnails. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Version: Updated on 08-01-2005 by Afru * Version: Updated on 04-07-2006 by Krzysztof Kotowicz * Version: Updated on 29-10-2006 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.1.3) * http://www.afrusoft.com/htmlarea */ /** * We use classes from ImageManager to avoid code duplication */ require_once '../ImageManager/Classes/Files.php'; /** * ExtendedFileManager Class. * @author Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * @version $Id: ExtendedFileManager.php 1171 2009-03-19 22:06:09Z ray $ */ class ExtendedFileManager { /** * Configuration array. */ var $config; /** * Array of directory information. */ var $dirs; /** * Manager mode - image | link */ var $mode; /** * Constructor. Create a new Image Manager instance. * @param array $config configuration array, see config.inc.php */ function ExtendedFileManager($config, $mode = null) { $this->config = $config; $this->mode = empty($mode) ? (empty($config['insert_mode']) ? 'image' : $config['insert_mode']): $mode; } /** * Get the base directory. * @return string base dir, see config.inc.php */ function getImagesDir() { if ($this->mode == 'link' && isset($this->config['files_dir'])) Return $this->config['files_dir']; else Return $this->config['images_dir']; } /** * Get the base URL. * @return string base url, see config.inc.php */ function getImagesURL() { if ($this->mode == 'link' && isset($this->config['files_url'])) Return $this->config['files_url']; else Return $this->config['images_url']; } function isValidBase() { return is_dir($this->getImagesDir()); } /** * Get the tmp file prefix. * @return string tmp file prefix. */ function getTmpPrefix() { Return $this->config['tmp_prefix']; } /** * Get the sub directories in the base dir. * Each array element contain * the relative path (relative to the base dir) as key and the * full path as value. * @return array of sub directries * <code>array('path name' => 'full directory path', ...)</code> */ function getDirs() { if(is_null($this->dirs)) { $dirs = $this->_dirs($this->getImagesDir(),'/'); ksort($dirs); $this->dirs = $dirs; } return $this->dirs; } /** * Recursively travese the directories to get a list * of accessable directories. * @param string $base the full path to the current directory * @param string $path the relative path name * @return array of accessiable sub-directories * <code>array('path name' => 'full directory path', ...)</code> */ function _dirs($base, $path) { $base = Files::fixPath($base); $dirs = array(); if($this->isValidBase() == false) return $dirs; $d = @dir($base); while (false !== ($entry = $d->read())) { //If it is a directory, and it doesn't start with // a dot, and if is it not the thumbnail directory if(is_dir($base.$entry) && substr($entry,0,1) != '.' && $this->isThumbDir($entry) == false) { $relative = Files::fixPath($path.$entry); $fullpath = Files::fixPath($base.$entry); $dirs[$relative] = $fullpath; $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative)); } } $d->close(); Return $dirs; } /** * Get all the files and directories of a relative path. * @param string $path relative path to be base path. * @return array of file and path information. * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code> * fileinfo array: <code>array('url'=>'full url', * 'relative'=>'relative to base', * 'fullpath'=>'full file path', * 'image'=>imageInfo array() false if not image, * 'stat' => filestat)</code> */ function getFiles($path) { $files = array(); $dirs = array(); $valid_extensions = $this->mode == 'image' ? $this->config['allowed_image_extensions'] : $this->config['allowed_link_extensions']; if($this->isValidBase() == false) return array($files,$dirs); $path = Files::fixPath($path); $base = Files::fixPath($this->getImagesDir()); $fullpath = Files::makePath($base,$path); $d = @dir($fullpath); while (false !== ($entry = $d->read())) { //not a dot file or directory if(substr($entry,0,1) != '.') { if(is_dir($fullpath.$entry) && $this->isThumbDir($entry) == false) { $relative = Files::fixPath($path.$entry); $full = Files::fixPath($fullpath.$entry); $count = $this->countFiles($full); $dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count, 'stat'=>stat($fullpath.$entry)); } else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false) { $afruext = strtolower(substr(strrchr($entry, "."), 1)); if(in_array($afruext,$valid_extensions)) { $file['url'] = Files::makePath($this->config['base_url'],$path).$entry; $file['relative'] = $path.$entry; $file['fullpath'] = $fullpath.$entry; $img = $this->getImageInfo($fullpath.$entry); if(!is_array($img)) $img[0]=$img[1]=0; $file['image'] = $img; $file['stat'] = stat($fullpath.$entry); $file['ext'] = $afruext; $files[$entry] = $file; } } } } $d->close(); ksort($dirs); ksort($files); Return array($dirs, $files); } /** * Count the number of files and directories in a given folder * minus the thumbnail folders and thumbnails. */ function countFiles($path) { $total = 0; if(is_dir($path)) { $d = @dir($path); while (false !== ($entry = $d->read())) { //echo $entry."<br>"; if(substr($entry,0,1) != '.' && $this->isThumbDir($entry) == false && $this->isTmpFile($entry) == false && $this->isThumb($entry) == false) { $total++; } } $d->close(); } return $total; } /** * Get image size information. * @param string $file the image file * @return array of getImageSize information, * false if the file is not an image. */ function getImageInfo($file) { Return @getImageSize($file); } /** * Check if the file contains the thumbnail prefix. * @param string $file filename to be checked * @return true if the file contains the thumbnail prefix, false otherwise. */ function isThumb($file) { $len = strlen($this->config['thumbnail_prefix']); if(substr($file,0,$len)==$this->config['thumbnail_prefix']) Return true; else Return false; } /** * Check if the given directory is a thumbnail directory. * @param string $entry directory name * @return true if it is a thumbnail directory, false otherwise */ function isThumbDir($entry) { if($this->config['thumbnail_dir'] == false || strlen(trim($this->config['thumbnail_dir'])) == 0) Return false; else Return ($entry == $this->config['thumbnail_dir']); } /** * Check if the given file is a tmp file. * @param string $file file name * @return boolean true if it is a tmp file, false otherwise */ function isTmpFile($file) { $len = strlen($this->config['tmp_prefix']); if(substr($file,0,$len)==$this->config['tmp_prefix']) Return true; else Return false; } /** * For a given image file, get the respective thumbnail filename * no file existence check is done. * @param string $fullpathfile the full path to the image file * @return string of the thumbnail file */ function getThumbName($fullpathfile) { $path_parts = pathinfo($fullpathfile); $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename']; if($this->config['safe_mode'] == true || strlen(trim($this->config['thumbnail_dir'])) == 0) { Return Files::makeFile($path_parts['dirname'],$thumbnail); } else { if(strlen(trim($this->config['thumbnail_dir'])) > 0) { $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']); if(!is_dir($path)) Files::createFolder($path); Return Files::makeFile($path,$thumbnail); } else //should this ever happen? { //error_log('ExtendedFileManager: Error in creating thumbnail name'); } } } /** * Similar to getThumbName, but returns the URL, base on the * given base_url in config.inc.php * @param string $relative the relative image file name, * relative to the base_dir path * @return string the url of the thumbnail */ function getThumbURL($relative) { $path_parts = pathinfo($relative); $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename']; if($path_parts['dirname']=='\\') $path_parts['dirname']='/'; if($this->config['safe_mode'] == true || strlen(trim($this->config['thumbnail_dir'])) == 0) { Return Files::makeFile($this->getImagesURL(),$thumbnail); } else { if(strlen(trim($this->config['thumbnail_dir'])) > 0) { $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']); $url_path = Files::makePath($this->getImagesURL(), $path); Return Files::makeFile($url_path,$thumbnail); } else //should this ever happen? { //error_log('ExtendedFileManager: Error in creating thumbnail url'); } } } /** * For a given image file, get the respective resized filename * no file existence check is done. * @param string $fullpathfile the full path to the image file * @param integer $width the intended width * @param integer $height the intended height * @param boolean $mkDir whether to attempt to make the resized_dir if it doesn't exist * @return string of the resized filename */ function getResizedName($fullpathfile, $width, $height, $mkDir = TRUE) { $path_parts = pathinfo($fullpathfile); $thumbnail = $this->config['resized_prefix']."_{$width}x{$height}_{$path_parts['basename']}"; if( strlen(trim($this->config['resized_dir'])) == 0 || $this->config['safe_mode'] == true ) { Return Files::makeFile($path_parts['dirname'],$thumbnail); } else { $path = Files::makePath($path_parts['dirname'],$this->config['resized_dir']); if($mkDir && !is_dir($path)) Files::createFolder($path); Return Files::makeFile($path,$thumbnail); } } /** * Check if the given path is part of the subdirectories * under the base_dir. * @param string $path the relative path to be checked * @return boolean true if the path exists, false otherwise */ function validRelativePath($path) { $dirs = $this->getDirs(); if($path == '/') Return true; //check the path given in the url against the //list of paths in the system. for($i = 0; $i < count($dirs); $i++) { $key = key($dirs); //we found the path if($key == $path) Return true; next($dirs); } Return false; } /** * Process uploaded files, assumes the file is in * $_FILES['upload'] and $_POST['dir'] is set. * The dir must be relative to the base_dir and exists. * @return null */ function processUploads() { if($this->isValidBase() == false) return; $relative = null; if(isset($_POST['dir'])) $relative = rawurldecode($_POST['dir']); else return; //check for the file, and must have valid relative path if(isset($_FILES['upload']) && $this->validRelativePath($relative)) { Return $this->_processFiles($relative, $_FILES['upload']); } } /** * Process upload files. The file must be an * uploaded file. Any duplicate * file will be renamed. See Files::copyFile for details * on renaming. * @param string $relative the relative path where the file * should be copied to. * @param array $file the uploaded file from $_FILES * @return boolean true if the file was processed successfully, * false otherwise */ function _processFiles($relative, $file) { if($file['error']!=0) { Return false; } if(!is_uploaded_file($file['tmp_name'])) { Files::delFile($file['tmp_name']); Return false; } $valid_extensions = $this->mode == 'image' ? $this->config['allowed_image_extensions'] : $this->config['allowed_link_extensions']; $max_size = $this->mode == 'image' ? $this->config['max_filesize_kb_image'] : $this->config['max_filesize_kb_link']; $afruext = strtolower(substr(strrchr($file['name'], "."), 1)); if(!in_array($afruext, $valid_extensions)) { Files::delFile($file['tmp_name']); Return 'Cannot upload $extension='.$afruext.'$ Files. Permission denied.'; } if($file['size']>($max_size*1024)) { Files::delFile($file['tmp_name']); Return 'Unble to upload file. Maximum file size [$max_size='.$max_size.'$ KB] exceeded.'; } if(!empty($this->config['max_foldersize_mb']) && (Files::dirSize($this->getImagesDir()))+$file['size']> ($this->config['max_foldersize_mb']*1048576)) { Files::delFile($file['tmp_name']); Return ("Cannot upload. Maximum folder size reached. Delete unwanted files and try again."); } //now copy the file $path = Files::makePath($this->getImagesDir(),$relative); $result = Files::copyFile($file['tmp_name'], $path, $file['name']); //no copy error if(!is_int($result)) { Files::delFile($file['tmp_name']); Return 'File "$file='.$file['name'].'$" successfully uploaded.'; } //delete tmp files. Files::delFile($file['tmp_name']); Return false; } function getDiskInfo() { if (empty($this->config['max_foldersize_mb'])) return ''; $tmpFreeSize=($this->config['max_foldersize_mb']*1048576)-Files::dirSize($this->getImagesDir()); if(!is_numeric($tmpFreeSize) || $tmpFreeSize<0) $tmpFreeSize=0; Return 'Total Size : $max_foldersize_mb='.$this->config['max_foldersize_mb'].'$ MB, Free Space: $free_space='.Files::formatSize($tmpFreeSize).'$'; } /** * Get the URL of the relative file. * basically appends the relative file to the * base_url given in config.inc.php * @param string $relative a file the relative to the base_dir * @return string the URL of the relative file. */ function getFileURL($relative) { Return Files::makeFile($this->getImagesURL(),$relative); } /** * Get the fullpath to a relative file. * @param string $relative the relative file. * @return string the full path, .ie. the base_dir + relative. */ function getFullPath($relative) { Return Files::makeFile($this->getImagesDir(),$relative);; } /** * Get the default thumbnail. * @return string default thumbnail, empty string if * the thumbnail doesn't exist. */ function getDefaultThumb() { if(is_file($this->config['default_thumbnail'])) Return $this->config['default_thumbnail']; else Return ''; } /** * Checks image size. If the image size is less than default size * returns the original size else returns default size to display thumbnail */ function checkImageSize($relative) { $fullpath = Files::makeFile($this->getImagesDir(),$relative); $afruext = strtolower(substr(strrchr($relative, "."), 1)); if(!in_array($afruext,$this->config['thumbnail_extensions'])) { $imgInfo=array(0,0); Return $imgInfo; } else { $imgInfo = @getImageSize($fullpath); //not an image if(!is_array($imgInfo)) { $imgInfo=array(0,0); Return $imgInfo; } else { if($imgInfo[0] > $this->config['thumbnail_width']) $imgInfo[0] = $this->config['thumbnail_width']; if($imgInfo[1] > $this->config['thumbnail_height']) $imgInfo[1] = $this->config['thumbnail_height']; Return $imgInfo; } } } /** * Get the thumbnail url to be displayed. * If the thumbnail exists, and it is up-to-date * the thumbnail url will be returns. If the * file is not an image, a default image will be returned. * If it is an image file, and no thumbnail exists or * the thumbnail is out-of-date (i.e. the thumbnail * modified time is less than the original file) * then a thumbs.php?img=filename.jpg is returned. * The thumbs.php url will generate a new thumbnail * on the fly. If the image is less than the dimensions * of the thumbnails, the image will be display instead. * @param string $relative the relative image file. * @return string the url of the thumbnail, be it * actually thumbnail or a script to generate the * thumbnail on the fly. */ function getThumbnail($relative) { global $IMConfig; $fullpath = Files::makeFile($this->getImagesDir(),$relative); //not a file??? if(!is_file($fullpath)) Return $this->getDefaultThumb(); $afruext = strtolower(substr(strrchr($relative, "."), 1)); if(!in_array($afruext,$this->config['thumbnail_extensions'])) { if(is_file('icons/'.$afruext.'.gif')) Return('icons/'.$afruext.'.gif'); else Return $this->getDefaultThumb(); } $imgInfo = @getImageSize($fullpath); //not an image if(!is_array($imgInfo)) Return $this->getDefaultThumb(); //Returning original image as thumbnail without Image Library by Afru if(!$this->config['img_library']) Return $this->getFileURL($relative); //the original image is smaller than thumbnails, //so just return the url to the original image. if ($imgInfo[0] <= $this->config['thumbnail_width'] && $imgInfo[1] <= $this->config['thumbnail_height']) Return $this->getFileURL($relative); $thumbnail = $this->getThumbName($fullpath); //check for thumbnails, if exists and // it is up-to-date, return the thumbnail url if(is_file($thumbnail)) { if(filemtime($thumbnail) >= filemtime($fullpath)) Return $this->getThumbURL($relative); } //well, no thumbnail was found, so ask the thumbs.php //to generate the thumbnail on the fly. Return $IMConfig['backend_url'] . '__function=thumbs&img='.rawurlencode($relative)."&mode=$this->mode"; } /** * Delete and specified files. * @return boolean true if delete, false otherwise */ function deleteFiles() { if(isset($_GET['delf'])) return $this->_delFile(rawurldecode($_GET['delf'])); return false; } /** * Delete and specified directories. * @return boolean true if delete, false otherwise */ function deleteDirs() { if(isset($_GET['deld'])) return $this->_delDir(rawurldecode($_GET['deld'])); else Return false; } /** * Delete the relative file, and any thumbnails. * @param string $relative the relative file. * @return boolean true if deleted, false otherwise. */ function _delFile($relative) { $fullpath = Files::makeFile($this->getImagesDir(),$relative); $afruext = strtolower(substr(strrchr($relative, "."), 1)); $valid_extensions = $this->mode == 'image' ? $this->config['allowed_image_extensions'] : $this->config['allowed_link_extensions']; if(!in_array($afruext,$valid_extensions)) { return false; } //check that the file is an image if(is_array($this->getImageInfo($fullpath))) { $thumbnail = $this->getThumbName($fullpath); Files::delFile($thumbnail); } Return Files::delFile($fullpath); } /** * Delete directories recursively. * @param string $relative the relative path to be deleted. * @return boolean true if deleted, false otherwise. */ function _delDir($relative) { $fullpath = Files::makePath($this->getImagesDir(),$relative); // if($this->countFiles($fullpath) <= 0) return Files::delFolder($fullpath,true); //delete recursively. //else //Return false; } /** * Create new directories. * If in safe_mode, nothing happens. * @return boolean true if created, false otherwise. */ function processNewDir() { if($this->config['safe_mode'] == true) Return false; if(isset($_GET['newDir']) && isset($_GET['dir'])) { $newDir = rawurldecode($_GET['newDir']); $dir = rawurldecode($_GET['dir']); $path = Files::makePath($this->getImagesDir(),$dir); $fullpath = Files::makePath($path, Files::escape($newDir)); if(is_dir($fullpath)) Return false; Return Files::createFolder($fullpath); } } /** * Renames files if certain GET variables are set * @return bool */ function processRenames() { if(!empty($_GET['rename']) && !empty($_GET['renameTo'])) { // new file name (without path and extension) $newName = Files::escape(rawurldecode($_GET['renameTo'])); $newName = str_replace('.', '', $newName); // path to file (from base images directory) $oldName = rawurldecode($_GET['rename']); // strip parent dir ("..") to avoid escaping from base directiory $oldName = preg_replace('#\.\.#', '', $oldName); if (is_dir($oldPath = Files::makeFile($this->getImagesDir(), $_GET['dir'].$oldName))) { $newPath = Files::makeFile($this->getImagesDir(), $_GET['dir'].$newName); return Files::rename($oldPath,$newPath); } else { // path to old file $oldPath = Files::makeFile($this->getImagesDir(), $oldName); $ret = Files::renameFile($oldPath, $newName); if ($ret === true) { // delete old thumbnail Files::delFile($this->getThumbname($oldPath)); } } return $ret; } return null; } function processPaste() { switch ($_GET['paste']) { case 'copyFile': $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'].$_GET['file']); $file = $_GET['file']; $dest = Files::makeFile($this->getImagesDir(), $_GET['dir']); return Files::copyFile($src,$dest,$file); break; case 'copyDir': $basePath = $this->getImagesDir(); $src = $_GET['srcdir'].$_GET['file']; $dest = $_GET['dir'].$_GET['file']; return Files::copyDir($basePath,$src,$dest); break; case 'moveFile': $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'].$_GET['file']); $dest = Files::makeFile($this->getImagesDir(), $_GET['dir'].$_GET['file']); return Files::rename($src,$dest); break; case 'moveDir': $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'].$_GET['file']); $dest = Files::makeFile($this->getImagesDir(), $_GET['dir'].$_GET['file']); return Files::rename($src,$dest); break; } } } ?>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/Classes/ExtendedFileManager.php
PHP
art
22,208
<?php /** * ExtendedFileManager editor.php file. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 21-06-2006 by Krzysztof Kotowicz * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); require_once('../ImageManager/Classes/ImageEditor.php'); $manager = new ExtendedFileManager($IMConfig,$insertMode); $editor = new ImageEditor($manager); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Xinha Image Editor</title> <link href="<?php print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/slider.js"></script> <script type="text/javascript" src="../../popups/popup.js"></script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> <script type="text/javascript"> /*<![CDATA[*/ var _backend_url = "<?php print $IMConfig['backend_url']."&mode=$insertMode"; ?>&"; if(window.opener) Xinha = window.opener.Xinha; /*]]>*/ </script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editor.js"></script> </head> <body> <table style="width:100%"> <tr> <td id="indicator"> <img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt=""/> </td> <td id="tools"> <div id="tools_crop" style="display:none;"> <div class="tool_inputs"> <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/> <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/> <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/> <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript:void(0);" onclick="editor.doSubmit('crop');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript:void(0);" onclick="editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_scale" style="display:none;"> <div class="tool_inputs"> <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> <a href="javascript:void(0);" onclick="toggleConstraints();" title="Lock"><img src="<?php print $IMConfig['base_url'];?>img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> <label for="constProp">Constrain Proportions</label> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript:void(0);" onclick="editor.doSubmit('scale');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript:void(0);" onclick="zoom();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_rotate" style="display:none;"> <div class="tool_inputs"> <select id="rotate_sub_action" name="rotate_sub_action" onchange="rotateSubActionSelect(this)" style="margin-left: 10px; vertical-align: middle;"> <option selected="selected" value="rotate">Rotate Image</option> <option value="flip">Flip Image</option> </select> <select id="rotate_preset_select" name="rotate_preset_select" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;"> <option>Preset</option> <option value="180">Rotate 180 &deg;</option> <option value="90">Rotate 90 &deg; CW</option> <option value="-90">Rotate 90 &deg; CCW</option> </select> <select id="flip" name="flip" style="margin-left: 20px; vertical-align: middle;display:none"> <option value="hoz">Flip Horizontal</option> <option value="ver">Flip Vertical</option> </select> <label for="ra">Angle:<input type="text" id="ra" class="textInput" /></label> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript:void(0);" onclick="editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript:void(0);" onclick="editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_measure" style="display:none;"> <div class="tool_inputs"> <label>X:</label><input type="text" class="measureStats" id="sx" /> <label>Y:</label><input type="text" class="measureStats" id="sy" /> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> <label>W:</label><input type="text" class="measureStats" id="mw" /> <label>H:</label><input type="text" class="measureStats" id="mh" /> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> <label>A:</label><input type="text" class="measureStats" id="ma" /> <label>D:</label><input type="text" class="measureStats" id="md" /> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> <button type="button" onclick="editor.reset();" >Clear</button> </div> </div> <div id="tools_save" style="display:none;"> <div class="tool_inputs"> <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/> <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> <option value="jpeg,85">JPEG High</option> <option value="jpeg,60">JPEG Medium</option> <option value="jpeg,35">JPEG Low</option> <option value="png">PNG</option> <?php if($editor->isGDGIFAble() != -1) { ?> <option value="gif">GIF</option> <?php } ?> </select> <div id="slider" style="display:inline"> <label>Quality:</label> <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0"> <tr> <td> <div id="slidercasing"> <div id="slidertrack" style="width:100px"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track" /></div> <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track" /></div> </div> </td> </tr> </table> <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> </div> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> <div style="display:inline;font-size:10px"> <span>Filesize:</span> <span id="filesize"></span> </div> <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <button type="button" style="float:left;margin:17px 5px 0 ;" onclick="editor.doSubmit('preview')">Preview</button> <button type="button" style="float:left;margin-top:17px;" onclick="editor.doSubmit('save');">Save</button> </div> </td> </tr> <tr> <td id="toolbar"> <a href="javascript:void(0);" onclick="toggle('crop')" id="icon_crop" title="Crop"><img src="<?php print $IMConfig['base_url'];?>img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> <a href="javascript:void(0);" onclick="toggle('scale')" id="icon_scale" title="Resize"><img src="<?php print $IMConfig['base_url'];?>img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> <a href="javascript:void(0);" onclick="toggle('rotate')" id="icon_rotate" title="Rotate"><img src="<?php print $IMConfig['base_url'];?>img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> <a href="javascript:void(0);" onclick="toggle('measure')" id="icon_measure" title="Measure"><img src="<?php print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> <a href="javascript:void(0);" onclick="toggleMarker();" title="Toggle marker color"><img id="markerImg" src="<?php print $IMConfig['base_url'];?>img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> <a href="javascript:void(0);" onclick="toggle('save')" id="icon_save" title="Save"><img src="<?php print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> <div style="margin-top:10px">Zoom</div> <select id="zoom" onchange="zoom(this.value)"> <option value="10">10%</option> <option value="25">25%</option> <option value="50">50%</option> <option value="75">75%</option> <option value="100" selected="selected">100%</option> <option value="200">200%</option> </select> </td> <td id="contents"> <?php $iframe_src = $IMConfig['backend_url'].'__function=editorFrame&img='.((isset($_GET['img'])) ? rawurlencode($_GET['img']) : '').'&mode='. $insertMode; ?> <iframe src="<?php print htmlspecialchars($iframe_src) ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> </td> </tr> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/editor.php
PHP
art
10,648
<?php /** * ExtendedFileManager images.php file. Shows folders and files. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Version: Updated on 08-01-2005 by Afru * Version: Updated on 04-07-2006 by Krzysztof Kotowicz * Version: Updated on 29-10-2006 by Raimund Meyer * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; if(!isset($insertMode)) $insertMode="image"; require_once('config.inc.php'); require_once('Classes/ExtendedFileManager.php'); $backend_url_enc = htmlspecialchars( $IMConfig['backend_url'] ); //default path is / $relative = '/'; $manager = new ExtendedFileManager($IMConfig, $insertMode); //process any file uploads $uploadStatus=$manager->processUploads(); //process any file renames $renameStatus=$manager->processRenames(); //process paste $pasteStatus = (isset($_GET['paste'])) ? $manager->processPaste() : false; $refreshFile = ($IMConfig['allow_delete'] && $manager->deleteFiles()) ? true : false; $refreshDir = false; //process any directory functions if(($IMConfig['allow_delete'] && $manager->deleteDirs()) || $manager->processNewDir() || $pasteStatus || $renameStatus ) $refreshDir = true; $diskInfo=$manager->getDiskInfo(); //check for any sub-directory request //check that the requested sub-directory exists //and valid if(isset($_REQUEST['dir'])) { $path = rawurldecode($_REQUEST['dir']); if($manager->validRelativePath($path)) $relative = $path; } $afruViewType = (isset($_REQUEST['viewtype'])) ? $afruViewType=$_REQUEST['viewtype'] : ''; if($afruViewType!="thumbview" && $afruViewType!="listview") { $afruViewType=$IMConfig['view_type']; } //get the list of files and directories $list = $manager->getFiles($relative); /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ /** * Draw folders and files. Changed by Afru */ function drawDirs_Files($list, &$manager) { global $relative, $afruViewType, $IMConfig, $insertMode,$backend_url_enc; switch ($afruViewType) { case 'listview': $maxNameLength = 30; ?> <table class="listview" id="listview"> <thead> <tr><th>Name</th><th>Size</th><th>Image Size</th><th>Date Modified</th><th>&nbsp;</th></tr></thead> <tbody> <?php // start of foreach for draw listview folders . foreach($list[0] as $path => $dir) { ?> <tr> <td><span style="width:20px;"><img src="<?php print $IMConfig['base_url'];?>icons/folder_small.gif" alt="" /></span> <a href="<?php print $backend_url_enc; ?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo rawurlencode($path); ?>&amp;viewtype=<?php echo $afruViewType; ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"> <?php if(strlen($dir['entry'])>$maxNameLength) echo substr($dir['entry'],0,$maxNameLength)."..."; else echo $dir['entry']; ?> </a></td> <td colspan="2" >Folder</td> <td ><?php echo date($IMConfig['date_format'],$dir['stat']['mtime']); ?></td> <td class="actions" > <?php if($IMConfig['allow_delete']) { ?> <a href="<?php print $backend_url_enc; ?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>&amp;viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);" style="border:0px;"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" border="0" /></a> <?php } ?> <?php if ($IMConfig['allow_rename']) { ?> <a href="#" title="Rename" onclick="renameDir('<?php echo rawurlencode($dir['entry']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> <?php } ?> <?php if ($IMConfig['allow_cut_copy_paste']) { ?> <a href="#" title="Cut" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> <a href="#" title="Copy" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> <?php } ?> </td> </tr> <?php } // end of foreach for draw listview folders . clearstatcache(); // start of foreach for draw listview files . foreach($list[1] as $entry => $file) { ?> <tr> <td> <a href="#" class="thumb" style="cursor: pointer;vertical-align:middle;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" <?php if ($insertMode == 'image') { ?> onmouseover="showPreview('<?php echo $file['relative'];?>')" onmouseout="showPreview(window.parent.document.getElementById('f_url').value)" <?php } ?> > <span style="width:20px;vertical-align:middle;"><img src="<?php print $IMConfig['base_url']; if(is_file('icons/'.$file['ext'].'_small.gif')) echo "icons/".$file['ext']."_small.gif"; else echo $IMConfig['default_listicon']; ?>" alt="" style="border:none;" /></span><span style="vertical-align:middle;"> <?php if(strlen($entry)>$maxNameLength) echo substr($entry,0,$maxNameLength)."..."; else echo $entry; ?></span> </a></td> <td><?php echo Files::formatSize($file['stat']['size']); ?></td> <td><?php if($file['image'][0] > 0){ echo $file['image'][0].'x'.$file['image'][1]; } ?></td> <td ><?php echo date($IMConfig['date_format'],$file['stat']['mtime']); ?></td> <td class="actions"> <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0) { ?> <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit" border="0" /></a> <?php } ?> <?php if($IMConfig['allow_delete']) { ?> <a href="<?php print $backend_url_enc; ?>__function=images&amp;dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>&amp;mode=<?php echo $insertMode;?>&amp;viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" border="0" /></a> <?php } ?> <?php if ($IMConfig['allow_rename']) { ?> <a href="#" title="Rename" onclick="renameFile('<?php echo rawurlencode($file['relative']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> <?php } ?> <?php if ($IMConfig['allow_cut_copy_paste']) { ?> <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> <?php } ?> </td> </tr> <?php }//end of foreach of draw listview files ?> </tbody> </table> <?php break; case 'thumbview': // thumbview is default default: $maxFileNameLength=16; $maxFolderNameLength=16; // start of foreach for draw thumbview folders. foreach($list[0] as $path => $dir) { ?> <div class="dir_holder"> <a class="dir" href="<?php print $backend_url_enc;?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo rawurlencode($path); ?>&amp;viewtype=<?php echo $afruViewType; ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="<?php print $IMConfig['base_url'];?>img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a> <div class="fileName"> <?php if(strlen($dir['entry']) > $maxFolderNameLength) echo substr($dir['entry'], 0, $maxFolderNameLength) . "..."; else echo $dir['entry']; ?> </div> <div class="edit"> <?php if($IMConfig['allow_delete']) { ?> <a href="<?php print $backend_url_enc;?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>&amp;viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" /></a> <?php } ?> <?php if ($IMConfig['allow_rename']) { ?> <a href="#" title="Rename" onclick="renameDir('<?php echo rawurlencode($dir['entry']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> <?php } ?> <?php if ($IMConfig['allow_cut_copy_paste']) { ?> <a href="#" title="Cut" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> <a href="#" title="Copy" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> <?php } ?> </div> </div> <?php } // end of foreach for draw thumbview folders. // start of foreach for draw thumbview files. foreach($list[1] as $entry => $file) { $afruimgdimensions=$manager->checkImageSize($file['relative']); $thisFileNameLength = $maxFileNameLength; ?> <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> <a href="#" class="thumb" style="cursor: pointer;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" /> </a> <div class="fileName"> <?php if(strlen($entry) > $thisFileNameLength + 3) echo strtolower(substr($entry,0,$thisFileNameLength))."..."; else echo $entry; ?> </div> <div class="edit"> <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0 ) { ?> <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit" /></a> <?php $thisFileNameLength -= 3; } ?> <?php if($IMConfig['allow_delete']) { ?> <a href="<?php print $backend_url_enc; ?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>&amp;viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" /></a> <?php } ?> <?php if ($IMConfig['allow_rename']) { ?> <a href="#" title="Rename" onclick="renameFile('<?php echo rawurlencode($file['relative']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" /></a> <?php $thisFileNameLength -= 3; } ?> <?php if ($IMConfig['allow_cut_copy_paste']) { ?> <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> <?php $thisFileNameLength -= 6; } ?> </div> </div> <?php }//end of foreach of draw thumbview files } }//end of function drawDirs_Files /** * No directories and no files. */ function drawNoResults() { ?> <div class="noResult">No Files Found</div> <?php } /** * No directories and no files. */ function drawErrorBase(&$manager) { ?> <div class="error"><span>Invalid base directory:</span> <?php echo $manager->getImagesDir(); ?></div> <?php } /** * Utility to convert ascii string to hex */ function asc2hex ($temp) { $data = ''; $len = strlen($temp); for ($i=0; $i<$len; $i++) $data.=sprintf("%02x",ord(substr($temp,$i,1))); return $data; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>File List</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="<?php print $IMConfig['base_url'];?>assets/imagelist.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script> <script type="text/javascript"> /*<![CDATA[*/ var _backend_url = "<?php print $IMConfig['backend_url']; ?>"; if(window.top) Xinha = window.top.Xinha; function hideMessage() { var topDoc = window.top.document; var messages = topDoc.getElementById('messages'); if (messages) { messages.style.display = "none"; } //window.parent.resize(); } init = function() { __dlg_translate('ExtendedFileManager'); hideMessage(); <?php if ($afruViewType == 'listview') print "var d = new dragTableCols('listview');"; if(isset($uploadStatus) && !is_numeric($uploadStatus) && !is_bool($uploadStatus)) echo "alert(i18n('$uploadStatus'));"; else if(isset($uploadStatus) && $uploadStatus==false) echo 'alert(i18n("Unable to upload File. \nEither Maximum file size [$max_size='.($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] ).'$ KB] exceeded or\nFolder doesn\'t have write permission."));'; ?> <?php if(isset($renameStatus) && !is_numeric($renameStatus) && !is_bool($renameStatus)) echo 'alert(i18n("'.$renameStatus.'"));'; else if(isset($renameStatus) && $renameStatus===false) echo 'alert(i18n("Unable to rename file. File of the same name already exists or\nfolder doesn\'t have write permission."));'; ?> <?php if (isset($pasteStatus) && is_numeric($pasteStatus)) { switch ($pasteStatus) { case 100 : $pasteStatus = 'Source file/folder not found.'; break; case 101 : $pasteStatus = 'Copy failed.\nMaybe folder doesn\'t have write permission.'; break; case 102 : $pasteStatus = 'Could not create destination folder.'; break; case 103 : $pasteStatus = 'File pasted OK.'; break; case 104 : $pasteStatus = 'Destination file/folder already exists.'; break; } } if(isset($pasteStatus) && !is_bool($pasteStatus)) { echo 'alert(i18n("'.$pasteStatus.'"));'; } ?> var topDoc = window.top.document; <?php //we need to refesh the drop directory list //save the current dir, delete all select options //add the new list, re-select the saved dir. if($refreshDir) { $dirs = $manager->getDirs(); ?> var selection = topDoc.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; while(selection.length > 0) { selection.remove(0); } selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>"); <?php foreach($dirs as $relative=>$fullpath) { ?> selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>"); <?php } ?> for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == currentDir) { selection.selectedIndex = i; break; } } <?php } ?> } function editImage(image) { var url = "<?php print $IMConfig['backend_url']; ?>__function=editor&img="+image+"&mode=<?php print $insertMode ?>"; Dialog(url, function(param) { if (!param) { // user must have pressed Cancel return false; } else { return true; } }, null); } /*]]>*/ </script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/images.js"></script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> <script type="text/javascript"> <!-- // Koto: why emptying? commented out //if(window.top.document.getElementById('manager_mode').value=="image") //emptyProperties(); <?php if(isset($diskInfo)) echo 'updateDiskMesg(i18n(\''.$diskInfo.'\'));'; ?> //--> </script> <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dragTableCols.js"></script> </head> <body> <?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> <?php drawDirs_Files($list, $manager); ?> <?php } else { drawNoResults(); } ?> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/images.php
PHP
art
19,259
body { margin: 0; padding: 0; font: 11px Tahoma,Verdana,sans-serif; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } #indicator { width: 20px; height: 20px; background-color: #eef; padding: 15px 20px; } * html #indicator { padding: 14px 22px; } #tools { background-color: #eef; padding: 0; border-left: 1px solid white; border-bottom: 1px solid white; } #toolbar { background-color: #eef; text-align: center; padding: 5px; border-top: 1px solid white; border-right: 1px solid white; vertical-align: top; width:50px; } #contents { position: relative; } #editor { width: 100%; height: 100%; } #toolbar a { padding: 5px; width: 40px; display: block; border: 1px solid #eef; text-align: center; text-decoration: none; color: #669; margin: 5px 0; } #toolbar a:hover { background-color: #F9F9FF; border-color: #669; } #toolbar a.iconActive { border-color: #669; } #toolbar a span { display: block; text-decoration: none; } #toolbar a img { border: 0 none; } #tools .textInput { width: 3em; vertical-align: 0px; } * html #tools .textInput { vertical-align: middle; } #tools .measureStats { width: 4.5em; border: 0 none; background-color: #eef; vertical-align: 0px; } * html #tools .measureStats { vertical-align: middle; } #tools label { margin: 0 2px 0 5px; } #tools input { vertical-align: middle; } #tools .tool_inputs { padding-top: 10px; float: left; } #tools .div { vertical-align: middle; margin: 0 5px; } #tools img { border: 0 none; } #tools a.buttons { margin-top: 10px; border: 1px solid #eef; display: block; float: left; } #tools a.buttons:hover { background-color: #F9F9FF; border-color: #669; } #slidercasing { /*border:1px solid #CCCCCC; background-color:#FFFFFF;*/ width:100px; height:5px; position:relative; z-index:4; padding:10px; top: 6px; margin: 0 -5px 0 -10px; } #slidertrack { position:relative; border:1px solid #CCCCCC; background-color:#FFFFCC; z-index:5; height:5px; } #sliderbar { position:absolute; z-index:6; border:1px solid #CCCCCC; background-color:#DDDDDD; width:15px; padding:0px; height:20px; cursor: pointer; top:2px; } * html #slidercasing { top:0; } #bottom { position: relative; top: 490px; } #save_filename {width: 100px;}
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/editor.css
CSS
art
2,803
body { margin: 0; padding: 0;} .edit,.dir_holder .fileName, .thumb_holder .fileName { font-size: 8pt; font-family: small-caption, sans-serif; padding-top: 3px;} .edit a { border: none; padding: 0; text-decoration:none; } .edit a:hover { background-color: ButtonHighlight; } .edit a img { border: none; vertical-align: bottom; } .noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif; text-align: center; padding-top: 60px; } .error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center; padding-top: 65px;} .dir_holder, .thumb_holder { width:106px; height:132px; float:left; margin:6px 4px; background-color:ButtonFace; border: 1px outset; } .thumb_holder.active { background:Highlight; color:HighlightText; border:1px dashed Highlight; } .dir_holder a.dir, .thumb_holder a.thumb { height:85px; display:block; text-align:center; padding:5px; text-decoration:none; overflow:hidden; } .thumb_holder a.thumb img { border:1px solid black; } .dir_holder a.dir img { border:none; } .listview { width:100%; } .listview td, .listview th { text-align:left; font-size:small; } .listview td.actions { text-align: right;width:111px } .listview td.actions img { border:0; } .listview thead th {background-color: ButtonFace; border: 1px solid threedface; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; padding-top:2px; padding-bottom:2px; padding-left: 5px; padding-right: 5px; font-size: 9pt; font-family: "MS Sans Serif", "Bitstream Vera Sans", Geneva, Sans, sans-serif;font-weight:normal} .listview tbody td, .listview tbody th {overflow:hidden; padding-top:2px; padding-left: 3px; font-size: 9pt; font-family: "MS Sans Serif", "Bitstream Vera Sans", Geneva, Sans, sans-serif;} .listview tbody a, listview tbody a:visited { font-weight: normal; text-decoration: none; color: #000; border:0px; padding:2px;} .listview tbody a:hover { background-color:#0B256B; color:#fff;} .listview tbody tr:hover {background-color: rgb(221,221,255)};
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/imagelist.css
CSS
art
2,145
/** * ImageEditor slider file. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 20-06-2006 by Krzysztof Kotowicz * Package: ExtendedFileManager (EFM 1.1.1) * http://www.afrusoft.com/htmlarea */ var ie=document.all; var ns6=document.getElementById&&!document.all; document.onmouseup = captureStop; var currentSlider = null,sliderField = null; var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0; function getMouseXY(e) { //alert('hello'); x = ns6? e.clientX: event.clientX y = ns6? e.clientY: event.clientY if (sx < 0) sx = x; if (sy < 0) sy = y; var dx = initX +(x-sx); if (dx <= rangeMin) dx = rangeMin; else if (dx >= rangeMax) dx = rangeMax; var range = (dx-rangeMin)/(rangeMax - rangeMin)*100; if (currentSlider != null) currentSlider.style.left = dx+"px"; if (sliderField != null) { sliderField.value = parseInt(range); } return false; } function initSlider() { if (currentSlider == null) currentSlider = document.getElementById('sliderbar'); if (sliderField == null) sliderField = document.getElementById('quality'); if (rangeMin == null) rangeMin = 3 if (rangeMax == null) { var track = document.getElementById('slidertrack'); rangeMax = parseInt(track.style.width); } } function updateSlider(value) { initSlider(); var newValue = parseInt(value)/100*(rangeMax-rangeMin); if (newValue <= rangeMin) newValue = rangeMin; else if (newValue >= rangeMax) newValue = rangeMax; if (currentSlider != null) currentSlider.style.left = newValue+"px"; var range = newValue/(rangeMax - rangeMin)*100; if (sliderField != null) sliderField.value = parseInt(range); } function captureStart() { initSlider(); initX = parseInt(currentSlider.style.left); if (initX > rangeMax) initX = rangeMax; else if (initX < rangeMin) initX = rangeMin; document.onmousemove = getMouseXY; return false; } function captureStop() { sx = -1; sy = -1; document.onmousemove = null; return false; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/slider.js
JavaScript
art
2,234
/*********************************************************************** ** Filename......: wz_jsgraphics.js ** Last changed..: 2 November 2007 by Raimund Meyer updated to new version ** Notes.........: Modified by Xiang Wei ZHUO <wei@zhuo.org> for Image Editor, added extra commands l. 690-740 **/ /* This notice must be untouched at all times. wz_jsgraphics.js v. 3.02 The latest version is available at http://www.walterzorn.com or http://www.devira.com or http://www.walterzorn.de Copyright (c) 2002-2004 Walter Zorn. All rights reserved. Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) Last modified: 26. 10. 2007 Performance optimizations for Internet Explorer by Thomas Frank and John Holdsworth. fillPolygon method implemented by Matthieu Haller. High Performance JavaScript Graphics Library. Provides methods - to draw lines, rectangles, ellipses, polygons with specifiable line thickness, - to fill rectangles, polygons, ellipses and arcs - to draw text. NOTE: Operations, functions and branching have rather been optimized to efficiency and speed than to shortness of source code. LICENSE: LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or see http://www.gnu.org/copyleft/lesser.html */ var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz; function _chkDHTM(x, i) { x = document.body || null; jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && document.createElement; jg_dom = (x && !jg_ie && typeof x.appendChild != "undefined" && typeof document.createRange != "undefined" && typeof (i = document.createRange()).setStartBefore != "undefined" && typeof i.createContextualFragment != "undefined"); jg_fast = jg_ie && document.all && !window.opera; jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; jg_ok = !!(jg_ie || jg_dom); } function _pntCnvDom() { var x = this.wnd.document.createRange(); x.setStartBefore(this.cnv); x = x.createContextualFragment(jg_fast? this._htmRpc() : this.htm); if(this.cnv) this.cnv.appendChild(x); this.htm = ""; } function _pntCnvIe() { if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this._htmRpc() : this.htm); this.htm = ""; } function _pntDoc() { this.wnd.document.write(jg_fast? this._htmRpc() : this.htm); this.htm = ''; } function _pntN() { ; } function _mkDiv(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'background-color:' + this.color + (!jg_moz? ';overflow:hidden' : '')+ ';"><\/div>'; } function _mkDivIe(x, y, w, h) { this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; } function _mkDivPrt(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'border-left:' + w + 'px solid ' + this.color + ';'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:0px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'background-color:' + this.color + (!jg_moz? ';overflow:hidden' : '')+ ';"><\/div>'; } var _regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; function _htmRpc() { return this.htm.replace( _regex, '<div style="overflow:hidden;position:absolute;background-color:'+ '$1;left:$2;top:$3;width:$4;height:$5"></div>\n'); } function _htmPrtRpc() { return this.htm.replace( _regex, '<div style="overflow:hidden;position:absolute;background-color:'+ '$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n'); } function _mkLin(x1, y1, x2, y2) { if(x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1; if(dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx, ox = x; while(dx > 0) {--dx; ++x; if(p > 0) { this._mkDiv(ox, y, x-ox, 1); y += yIncr; p += pru; ox = x; } else p += pr; } this._mkDiv(ox, y, x2-ox+1, 1); } else { var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy, oy = y; if(y2 <= y1) { while(dy > 0) {--dy; if(p > 0) { this._mkDiv(x++, y, 1, oy-y+1); y += yIncr; p += pru; oy = y; } else { y += yIncr; p += pr; } } this._mkDiv(x2, y2, 1, oy-y2+1); } else { while(dy > 0) {--dy; y += yIncr; if(p > 0) { this._mkDiv(x++, oy, 1, y-oy); p += pru; oy = y; } else p += pr; } this._mkDiv(x2, oy, 1, y2-oy+1); } } } function _mkLin2D(x1, y1, x2, y2) { if(x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1; var s = this.stroke; if(dx >= dy) { if(dx > 0 && s-3 > 0) { var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; } else var _s = s; var ad = Math.ceil(s/2); var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx, ox = x; while(dx > 0) {--dx; ++x; if(p > 0) { this._mkDiv(ox, y, x-ox+ad, _s); y += yIncr; p += pru; ox = x; } else p += pr; } this._mkDiv(ox, y, x2-ox+ad+1, _s); } else { if(s-3 > 0) { var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; } else var _s = s; var ad = Math.round(s/2); var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy, oy = y; if(y2 <= y1) { ++ad; while(dy > 0) {--dy; if(p > 0) { this._mkDiv(x++, y, _s, oy-y+ad); y += yIncr; p += pru; oy = y; } else { y += yIncr; p += pr; } } this._mkDiv(x2, y2, _s, oy-y2+ad); } else { while(dy > 0) {--dy; y += yIncr; if(p > 0) { this._mkDiv(x++, oy, _s, y-oy+ad); p += pru; oy = y; } else p += pr; } this._mkDiv(x2, oy, _s, y2-oy+ad+1); } } } function _mkLinDott(x1, y1, x2, y2) { if(x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1, drw = true; if(dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx; while(dx > 0) {--dx; if(drw) this._mkDiv(x, y, 1, 1); drw = !drw; if(p > 0) { y += yIncr; p += pru; } else p += pr; ++x; } } else { var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy; while(dy > 0) {--dy; if(drw) this._mkDiv(x, y, 1, 1); drw = !drw; y += yIncr; if(p > 0) { ++x; p += pru; } else p += pr; } } if(drw) this._mkDiv(x, y, 1, 1); } function _mkOv(left, top, width, height) { var a = (++width)>>1, b = (++height)>>1, wod = width&1, hod = height&1, cx = left+a, cy = top+b, x = 0, y = b, ox = 0, oy = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, st = (aa2>>1)*(1-(b<<1)) + bb2, tt = (bb2>>1) - aa2*((b<<1)-1), w, h; while(y > 0) { if(st < 0) { st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) { st += bb2*((x<<1)+3) - aa4*(y-1); tt += bb4*(++x) - aa2*(((y--)<<1)-3); w = x-ox; h = oy-y; if((w&2) && (h&2)) { this._mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod); this._mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod); } else this._mkOvQds(cx, cy, x-1, oy, w, h, wod, hod); ox = x; oy = y; } else { tt -= aa2*((y<<1)-3); st -= aa4*(--y); } } w = a-ox+1; h = (oy<<1)+hod; y = cy-oy; this._mkDiv(cx-a, y, w, h); this._mkDiv(cx+ox+wod-1, y, w, h); } function _mkOv2D(left, top, width, height) { var s = this.stroke; width += s+1; height += s+1; var a = width>>1, b = height>>1, wod = width&1, hod = height&1, cx = left+a, cy = top+b, x = 0, y = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, st = (aa2>>1)*(1-(b<<1)) + bb2, tt = (bb2>>1) - aa2*((b<<1)-1); if(s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) { var ox = 0, oy = b, w, h, pxw; while(y > 0) { if(st < 0) { st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) { st += bb2*((x<<1)+3) - aa4*(y-1); tt += bb4*(++x) - aa2*(((y--)<<1)-3); w = x-ox; h = oy-y; if(w-1) { pxw = w+1+(s&1); h = s; } else if(h-1) { pxw = s; h += 1+(s&1); } else pxw = h = s; this._mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod); ox = x; oy = y; } else { tt -= aa2*((y<<1)-3); st -= aa4*(--y); } } this._mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); this._mkDiv(cx+a+wod-s, cy-oy, s, (oy<<1)+hod); } else { var _a = (width-(s<<1))>>1, _b = (height-(s<<1))>>1, _x = 0, _y = _b, _aa2 = (_a*_a)<<1, _aa4 = _aa2<<1, _bb2 = (_b*_b)<<1, _bb4 = _bb2<<1, _st = (_aa2>>1)*(1-(_b<<1)) + _bb2, _tt = (_bb2>>1) - _aa2*((_b<<1)-1), pxl = new Array(), pxt = new Array(), _pxb = new Array(); pxl[0] = 0; pxt[0] = b; _pxb[0] = _b-1; while(y > 0) { if(st < 0) { pxl[pxl.length] = x; pxt[pxt.length] = y; st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) { pxl[pxl.length] = x; st += bb2*((x<<1)+3) - aa4*(y-1); tt += bb4*(++x) - aa2*(((y--)<<1)-3); pxt[pxt.length] = y; } else { tt -= aa2*((y<<1)-3); st -= aa4*(--y); } if(_y > 0) { if(_st < 0) { _st += _bb2*((_x<<1)+3); _tt += _bb4*(++_x); _pxb[_pxb.length] = _y-1; } else if(_tt < 0) { _st += _bb2*((_x<<1)+3) - _aa4*(_y-1); _tt += _bb4*(++_x) - _aa2*(((_y--)<<1)-3); _pxb[_pxb.length] = _y-1; } else { _tt -= _aa2*((_y<<1)-3); _st -= _aa4*(--_y); _pxb[_pxb.length-1]--; } } } var ox = -wod, oy = b, _oy = _pxb[0], l = pxl.length, w, h; for(var i = 0; i < l; i++) { if(typeof _pxb[i] != "undefined") { if(_pxb[i] < _oy || pxt[i] < oy) { x = pxl[i]; this._mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod); ox = x; oy = pxt[i]; _oy = _pxb[i]; } } else { x = pxl[i]; this._mkDiv(cx-x, cy-oy, 1, (oy<<1)+hod); this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); ox = x; oy = pxt[i]; } } this._mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); } } function _mkOvDott(left, top, width, height) { var a = (++width)>>1, b = (++height)>>1, wod = width&1, hod = height&1, hodu = hod^1, cx = left+a, cy = top+b, x = 0, y = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, st = (aa2>>1)*(1-(b<<1)) + bb2, tt = (bb2>>1) - aa2*((b<<1)-1), drw = true; while(y > 0) { if(st < 0) { st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) { st += bb2*((x<<1)+3) - aa4*(y-1); tt += bb4*(++x) - aa2*(((y--)<<1)-3); } else { tt -= aa2*((y<<1)-3); st -= aa4*(--y); } if(drw && y >= hodu) this._mkOvQds(cx, cy, x, y, 1, 1, wod, hod); drw = !drw; } } function _mkRect(x, y, w, h) { var s = this.stroke; this._mkDiv(x, y, w, s); this._mkDiv(x+w, y, s, h); this._mkDiv(x, y+h, w+s, s); this._mkDiv(x, y+s, s, h-s); } function _mkRectDott(x, y, w, h) { this.drawLine(x, y, x+w, y); this.drawLine(x+w, y, x+w, y+h); this.drawLine(x, y+h, x+w, y+h); this.drawLine(x, y, x, y+h); } function jsgFont() { this.PLAIN = 'font-weight:normal;'; this.BOLD = 'font-weight:bold;'; this.ITALIC = 'font-style:italic;'; this.ITALIC_BOLD = this.ITALIC + this.BOLD; this.BOLD_ITALIC = this.ITALIC_BOLD; } var Font = new jsgFont(); function jsgStroke() { this.DOTTED = -1; } var Stroke = new jsgStroke(); function jsGraphics(cnv, wnd) { this.setColor = function(x) { this.color = x.toLowerCase(); }; this.setStroke = function(x) { this.stroke = x; if(!(x+1)) { this.drawLine = _mkLinDott; this._mkOv = _mkOvDott; this.drawRect = _mkRectDott; } else if(x-1 > 0) { this.drawLine = _mkLin2D; this._mkOv = _mkOv2D; this.drawRect = _mkRect; } else { this.drawLine = _mkLin; this._mkOv = _mkOv; this.drawRect = _mkRect; } }; this.setPrintable = function(arg) { this.printable = arg; if(jg_fast) { this._mkDiv = _mkDivIe; this._htmRpc = arg? _htmPrtRpc : _htmRpc; } else this._mkDiv = arg? _mkDivPrt : _mkDiv; }; this.setFont = function(fam, sz, sty) { this.ftFam = fam; this.ftSz = sz; this.ftSty = sty || Font.PLAIN; }; this.drawPolyline = this.drawPolyLine = function(x, y) { for (var i=x.length - 1; i;) {--i; this.drawLine(x[i], y[i], x[i+1], y[i+1]); } }; /************** Xinha added *******************************************/ this.setColor = new Function('arg', 'this.color = arg;'); this.getColor = new Function('return this.color'); this.fillRect = function(x, y, w, h) { this._mkDiv(x, y, w, h); }; this.fillRectPattern = function(x, y, w, h, url) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;'+ //'background-color:' + this.color + ';'+ "background-image: url('" + url + "');"+ "layer-background-image: url('" + url + "');"+ 'z-index:100;"><\/div>'; //alert(this.htm); }; this.drawHandle = function(x, y, w, h, cursor) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'padding: 2px;overflow:hidden;'+ "cursor: '" + cursor + "';"+ '" class="handleBox" id="' + cursor + '" ><\/div>'; }; this.drawHandleBox = function(x, y, w, h, cursor) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+ 'overflow:hidden; border: solid 1px '+ this.color+';'+ "cursor: '" + cursor + "';"+ '" class="handleBox" id="' + cursor + '" ><\/div>'; }; /************** end Xinha added *******************************************/ this.drawPolygon = function(x, y) { this.drawPolyline(x, y); this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]); }; this.drawEllipse = this.drawOval = function(x, y, w, h) { this._mkOv(x, y, w, h); }; this.fillEllipse = this.fillOval = function(left, top, w, h) { var a = w>>1, b = h>>1, wod = w&1, hod = h&1, cx = left+a, cy = top+b, x = 0, y = b, oy = b, aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, st = (aa2>>1)*(1-(b<<1)) + bb2, tt = (bb2>>1) - aa2*((b<<1)-1), xl, dw, dh; if(w) while(y > 0) { if(st < 0) { st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) { st += bb2*((x<<1)+3) - aa4*(y-1); xl = cx-x; dw = (x<<1)+wod; tt += bb4*(++x) - aa2*(((y--)<<1)-3); dh = oy-y; this._mkDiv(xl, cy-oy, dw, dh); this._mkDiv(xl, cy+y+hod, dw, dh); oy = y; } else { tt -= aa2*((y<<1)-3); st -= aa4*(--y); } } this._mkDiv(cx-a, cy-oy, w, (oy<<1)+hod); }; this.fillArc = function(iL, iT, iW, iH, fAngA, fAngZ) { var a = iW>>1, b = iH>>1, iOdds = (iW&1) | ((iH&1) << 16), cx = iL+a, cy = iT+b, x = 0, y = b, ox = x, oy = y, aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, st = (aa2>>1)*(1-(b<<1)) + bb2, tt = (bb2>>1) - aa2*((b<<1)-1), // Vars for radial boundary lines xEndA, yEndA, xEndZ, yEndZ, iSects = (1 << (Math.floor((fAngA %= 360.0)/180.0) << 3)) | (2 << (Math.floor((fAngZ %= 360.0)/180.0) << 3)) | ((fAngA >= fAngZ) << 16), aBndA = new Array(b+1), aBndZ = new Array(b+1); // Set up radial boundary lines fAngA *= Math.PI/180.0; fAngZ *= Math.PI/180.0; xEndA = cx+Math.round(a*Math.cos(fAngA)); yEndA = cy+Math.round(-b*Math.sin(fAngA)); _mkLinVirt(aBndA, cx, cy, xEndA, yEndA); xEndZ = cx+Math.round(a*Math.cos(fAngZ)); yEndZ = cy+Math.round(-b*Math.sin(fAngZ)); _mkLinVirt(aBndZ, cx, cy, xEndZ, yEndZ); while(y > 0) { if(st < 0) // Advance x { st += bb2*((x<<1)+3); tt += bb4*(++x); } else if(tt < 0) // Advance x and y { st += bb2*((x<<1)+3) - aa4*(y-1); ox = x; tt += bb4*(++x) - aa2*(((y--)<<1)-3); this._mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); oy = y; } else // Advance y { tt -= aa2*((y<<1)-3); st -= aa4*(--y); if(y && (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1])) { this._mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); ox = x; oy = y; } } } this._mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); if(iOdds >> 16) // Odd height { if(iSects >> 16) // Start-angle > end-angle { var xl = (yEndA <= cy || yEndZ > cy)? (cx - x) : cx; this._mkDiv(xl, cy, x + cx - xl + (iOdds & 0xffff), 1); } else if((iSects & 0x01) && yEndZ > cy) this._mkDiv(cx - x, cy, x, 1); } }; /* fillPolygon method, implemented by Matthieu Haller. This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. C source of GD 1.8.4 found at http://www.boutell.com/gd/ THANKS to Kirsten Schulz for the polygon fixes! The intersection finding technique of this code could be improved by remembering the previous intertersection, and by using the slope. That could help to adjust intersections to produce a nice interior_extrema. */ this.fillPolygon = function(array_x, array_y) { var i; var y; var miny, maxy; var x1, y1; var x2, y2; var ind1, ind2; var ints; var n = array_x.length; if(!n) return; miny = array_y[0]; maxy = array_y[0]; for(i = 1; i < n; i++) { if(array_y[i] < miny) miny = array_y[i]; if(array_y[i] > maxy) maxy = array_y[i]; } for(y = miny; y <= maxy; y++) { var polyInts = new Array(); ints = 0; for(i = 0; i < n; i++) { if(!i) { ind1 = n-1; ind2 = 0; } else { ind1 = i-1; ind2 = i; } y1 = array_y[ind1]; y2 = array_y[ind2]; if(y1 < y2) { x1 = array_x[ind1]; x2 = array_x[ind2]; } else if(y1 > y2) { y2 = array_y[ind1]; y1 = array_y[ind2]; x2 = array_x[ind1]; x1 = array_x[ind2]; } else continue; // Modified 11. 2. 2004 Walter Zorn if((y >= y1) && (y < y2)) polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); else if((y == maxy) && (y > y1) && (y <= y2)) polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); } polyInts.sort(_CompInt); for(i = 0; i < ints; i+=2) this._mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); } }; this.drawString = function(txt, x, y) { this.htm += '<div style="position:absolute;white-space:nowrap;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'font-family:' + this.ftFam + ';'+ 'font-size:' + this.ftSz + ';'+ 'color:' + this.color + ';' + this.ftSty + '">'+ txt + '<\/div>'; }; /* drawStringRect() added by Rick Blommers. Allows to specify the size of the text rectangle and to align the text both horizontally (e.g. right) and vertically within that rectangle */ this.drawStringRect = function(txt, x, y, width, halign) { this.htm += '<div style="position:absolute;overflow:hidden;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:'+width +'px;'+ 'text-align:'+halign+';'+ 'font-family:' + this.ftFam + ';'+ 'font-size:' + this.ftSz + ';'+ 'color:' + this.color + ';' + this.ftSty + '">'+ txt + '<\/div>'; }; this.drawImage = function(imgSrc, x, y, w, h, a) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;">'+ '<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+ '<\/div>'; }; this.clear = function() { this.htm = ""; if(this.cnv) this.cnv.innerHTML = ""; }; this._mkOvQds = function(cx, cy, x, y, w, h, wod, hod) { var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h; if(xr > xl+w) { this._mkDiv(xr, yt, w, h); this._mkDiv(xr, yb, w, h); } else w = xr - xl + w; this._mkDiv(xl, yt, w, h); this._mkDiv(xl, yb, w, h); }; this._mkArcDiv = function(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects) { var xrDef = cx + x + (iOdds & 0xffff), y2, h = oy - y, xl, xr, w; if(!h) h = 1; x = cx - x; if(iSects & 0xff0000) // Start-angle > end-angle { y2 = cy - y - h; if(iSects & 0x00ff) { if(iSects & 0x02) { xl = Math.max(x, aBndZ[y]); w = xrDef - xl; if(w > 0) this._mkDiv(xl, y2, w, h); } if(iSects & 0x01) { xr = Math.min(xrDef, aBndA[y]); w = xr - x; if(w > 0) this._mkDiv(x, y2, w, h); } } else this._mkDiv(x, y2, xrDef - x, h); y2 = cy + y + (iOdds >> 16); if(iSects & 0xff00) { if(iSects & 0x0100) { xl = Math.max(x, aBndA[y]); w = xrDef - xl; if(w > 0) this._mkDiv(xl, y2, w, h); } if(iSects & 0x0200) { xr = Math.min(xrDef, aBndZ[y]); w = xr - x; if(w > 0) this._mkDiv(x, y2, w, h); } } else this._mkDiv(x, y2, xrDef - x, h); } else { if(iSects & 0x00ff) { if(iSects & 0x02) xl = Math.max(x, aBndZ[y]); else xl = x; if(iSects & 0x01) xr = Math.min(xrDef, aBndA[y]); else xr = xrDef; y2 = cy - y - h; w = xr - xl; if(w > 0) this._mkDiv(xl, y2, w, h); } if(iSects & 0xff00) { if(iSects & 0x0100) xl = Math.max(x, aBndA[y]); else xl = x; if(iSects & 0x0200) xr = Math.min(xrDef, aBndZ[y]); else xr = xrDef; y2 = cy + y + (iOdds >> 16); w = xr - xl; if(w > 0) this._mkDiv(xl, y2, w, h); } } }; this.setStroke(1); this.setFont("verdana,geneva,helvetica,sans-serif", "12px", Font.PLAIN); this.color = "#000000"; this.htm = ""; this.wnd = wnd || window; if(!jg_ok) _chkDHTM(); if(jg_ok) { if(cnv) { if(typeof(cnv) == "string") this.cont = document.all? (this.wnd.document.all[cnv] || null) : document.getElementById? (this.wnd.document.getElementById(cnv) || null) : null; else if(cnv == window.document) this.cont = document.getElementsByTagName("body")[0]; // If cnv is a direct reference to a canvas DOM node // (option suggested by Andreas Luleich) else this.cont = cnv; // Create new canvas inside container DIV. Thus the drawing and clearing // methods won't interfere with the container's inner html. // Solution suggested by Vladimir. this.cnv = this.wnd.document.createElement("div"); this.cnv.style.fontSize=0; this.cont.appendChild(this.cnv); this.paint = jg_dom? _pntCnvDom : _pntCnvIe; } else this.paint = _pntDoc; } else this.paint = _pntN; this.setPrintable(false); } function _mkLinVirt(aLin, x1, y1, x2, y2) { var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1), x = x1, y = y1, xIncr = (x1 > x2)? -1 : 1, yIncr = (y1 > y2)? -1 : 1, p, i = 0; if(dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1); p = pr-dx; while(dx > 0) {--dx; if(p > 0) // Increment y { aLin[i++] = x; y += yIncr; p += pru; } else p += pr; x += xIncr; } } else { var pr = dx<<1, pru = pr - (dy<<1); p = pr-dy; while(dy > 0) {--dy; y += yIncr; aLin[i++] = x; if(p > 0) // Increment x { x += xIncr; p += pru; } else p += pr; } } for(var len = aLin.length, i = len-i; i;) aLin[len-(i--)] = x; }; function _CompInt(x, y) { return(x - y); }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/wz_jsgraphics.js
JavaScript
art
25,744
/** * Functions for the image listing, used by images.php only * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Version: Updated on 08-01-2005 by Afru * Version: Updated on 04-07-2006 by Krzysztof Kotowicz * Version: Updated on 17-11-2006 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.1.3) * http://www.afrusoft.com/htmlarea */ function i18n(str) { return Xinha._lc(str, 'ExtendedFileManager'); } function changeDir(newDir) { showMessage('Loading'); var mode=window.top.document.getElementById('manager_mode').value; var selection = window.top.document.getElementById('viewtype'); var viewtype = selection.options[selection.selectedIndex].value; location.href = _backend_url + "__function=images&mode="+mode+"&dir="+newDir+"&viewtype="+viewtype; document.cookie = "EFMStartDir" + mode + "="+newDir; } function newFolder(dir, newDir) { var mode=window.top.document.getElementById('manager_mode').value; var selection = window.top.document.getElementById('viewtype'); var viewtype = selection.options[selection.selectedIndex].value; location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&newDir="+newDir+"&viewtype="+viewtype; } function renameFile(oldPath) { // strip directory and extension var oldName=oldPath.replace(/.*%2F/,'').replace(/\..*$/,''); var rename = function (newName) { if(newName == '' || newName == null || newName == oldName) { alert(i18n('Cancelled rename.')); return false; } var mode=window.top.document.getElementById('manager_mode').value; var selection = window.top.document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; selection = window.top.document.getElementById('viewtype'); var viewtype = selection.options[selection.selectedIndex].value; location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&rename="+oldPath+"&renameTo="+newName+"&viewtype="+viewtype; } // IE7 has crippled the prompt() if ( Xinha.ie_version > 6 ) { popupPrompt(i18n("Please enter new name for this file..."), oldName, rename, i18n("Rename")); } else { var newName = prompt(i18n('Please enter new name for this file...'), oldName); rename(newName); } } function renameDir(oldName) { // strip directory and extension function rename(newName) { if(newName == '' || newName == null || newName == oldName) { alert(i18n('Cancelled rename.')); return false; } var mode=window.top.document.getElementById('manager_mode').value; var selection = window.top.document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; selection = window.top.document.getElementById('viewtype'); var viewtype = selection.options[selection.selectedIndex].value; location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&rename="+oldName+"&renameTo="+newName+"&viewtype="+viewtype; } // IE7 has crippled the prompt() if ( Xinha.ie_version > 6 ) { popupPrompt(i18n('Please enter new name for this folder...'), oldName, rename, i18n("Rename")); } else { var newName = prompt(i18n('Please enter new name for this folder...'), oldName); rename(newName); } } function copyFile(file,action) { var selection = window.top.document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; window.top.pasteButton({'dir':dir,'file':file,'action':action+'File'}); } function copyDir(dirToCopy,action) { var selection = window.top.document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; window.top.pasteButton({'dir':dir,'file':dirToCopy,'action':action+'Dir'}); } function paste(action) { var mode=window.top.document.getElementById('manager_mode').value; var selection = window.top.document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; selection = window.top.document.getElementById('viewtype'); var viewtype = selection.options[selection.selectedIndex].value; location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&paste="+action.action+"&srcdir="+action.dir+"&file="+action.file+"&viewtype="+viewtype; } //update the dir list in the parent window. function updateDir(newDir) { var mode = window.top.document.getElementById('manager_mode').value; document.cookie = "EFMStartDir" + mode + "="+newDir; var selection = window.top.document.getElementById('dirPath'); if(selection) { for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == newDir) { selection.selectedIndex = i; showMessage('Loading'); break; } } } } function emptyProperties() { toggleImageProperties(false); var topDoc = window.top.document; topDoc.getElementById('f_url').value = ''; topDoc.getElementById('f_alt').value = ''; topDoc.getElementById('f_title').value = ''; topDoc.getElementById('f_width').value = ''; topDoc.getElementById('f_margin').value = ''; topDoc.getElementById('f_height').value = ''; topDoc.getElementById('f_padding').value = ''; topDoc.getElementById('f_border').value = ''; topDoc.getElementById('f_borderColor').value = ''; topDoc.getElementById('f_backgroundColor').value = ''; } function toggleImageProperties(val) { var topDoc = window.top.document; if(val==true) { topDoc.getElementById('f_width').value = ''; topDoc.getElementById('f_margin').value = ''; topDoc.getElementById('f_height').value = ''; topDoc.getElementById('f_padding').value = ''; topDoc.getElementById('f_border').value = ''; topDoc.getElementById('f_borderColor').value = ''; topDoc.getElementById('f_backgroundColor').value = ''; } topDoc.getElementById('f_width').disabled = val; topDoc.getElementById('f_margin').disabled = val; topDoc.getElementById('f_height').disabled = val; topDoc.getElementById('f_padding').disabled = val; topDoc.getElementById('f_align').disabled = val; topDoc.getElementById('f_border').disabled = val; topDoc.getElementById('f_borderColor').value = ''; topDoc.getElementById('f_backgroundColor').value = ''; topDoc.getElementById('constrain_prop').disabled = val; } function selectImage(filename, alt, width, height) { var topDoc = window.top.document; if(topDoc.getElementById('manager_mode').value=="image") { var obj = topDoc.getElementById('f_url'); obj.value = filename; obj = topDoc.getElementById('f_alt'); obj.value = alt; obj = topDoc.getElementById('f_title'); obj.value = alt; if(width==0 && height==0) toggleImageProperties(true); else { toggleImageProperties(false); var obj = topDoc.getElementById('f_width'); obj.value = width; var obj = topDoc.getElementById('f_height'); obj.value = height; var obj = topDoc.getElementById('orginal_width'); obj.value = width; var obj = topDoc.getElementById('orginal_height'); obj.value = height; update_selected(); } } else if (topDoc.getElementById('manager_mode').value=="link") { var obj = topDoc.getElementById('f_href'); obj.value = filename; var obj = topDoc.getElementById('f_title'); obj.value = alt; } return false; } var _current_selected = null; function update_selected() { var topDoc = window.top.document; if(_current_selected) { _current_selected.className = _current_selected.className.replace(/(^| )active( |$)/, '$1$2'); _current_selected = null; } // Grab the current file, and highlight it if we have it var c_file = topDoc.getElementById('f_url').value; var selection = topDoc.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; var dRe = new RegExp('^(' + currentDir.replace(/([\/\^$*+?.()|{}[\]])/g, '\\$1') + ')([^/]*)$'); if(dRe.test(c_file)) { var holder = document.getElementById('holder_' + asc2hex(RegExp.$2)); if(holder) { _current_selected = holder; holder.className += ' active'; } } showPreview(c_file); } function asc2hex(str) { var hexstr = ''; for(var i = 0; i < str.length; i++) { var hex = (str.charCodeAt(i)).toString(16); if(hex.length == 1) hex = '0' + hex; hexstr += hex; } return hexstr; } function showMessage(newMessage) { var topDoc = window.top.document; var message = topDoc.getElementById('message'); var messages = topDoc.getElementById('messages'); if(message && messages) { if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(topDoc.createTextNode(i18n(newMessage))); messages.style.display = "block"; } } function updateDiskMesg(newMessage) { var topDoc = window.top.document; var diskmesg = topDoc.getElementById('diskmesg'); if(diskmesg) { if(diskmesg.firstChild) diskmesg.removeChild(diskmesg.firstChild); diskmesg.appendChild(topDoc.createTextNode(newMessage)); } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function confirmDeleteFile(file) { if(confirm(i18n('Delete file "$file=' + file +'$"?'))) return true; return false; } function confirmDeleteDir(dir, count) { /* if(count > 0) { alert(i18n("Folder is not empty. Please delete all Files and Subfolders inside.")); return false; }*/ if(confirm(i18n('Delete folder "$dir=' + dir +'$"?'))) return true; return false; } function showPreview(f_url) { window.parent.document.getElementById('f_preview').src = f_url ? window.parent._backend_url + '__function=thumbs&img=' + f_url :window.parent.opener.Xinha.getPluginDir('ExtendedFileManager')+'/img/1x1_transparent.gif'; } addEvent(window, 'load', init);
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/images.js
JavaScript
art
10,756
/** makes the columns of a given table resizable with the mouse * @author Raimund Meyer * @param id {String} the id of the table */ function dragTableCols (id) { this.table = document.getElementById(id); var ths = this.table.rows[0].cells; this.ths = ths; var self = this; var c; for (var j = 0; j < this.table.rows.length; j++) { for (var i = 0; i < this.table.rows[j].cells.length; i++) { c = this.table.rows[j].cells[i]; c._i = i; dragTableCols.addEvent(c, 'mousemove', function(e) { self.cellMouseMove(e); }); dragTableCols.addEvent(c, 'mouseover', function(e) { e = e ? e : window.event; var t = e.target || e.srcElement; t._pos = dragTableCols.getElementTopLeft(t); }); } } function deactivate () { self.drag = false; self._col = null; document.body.style.cursor = ''; } dragTableCols.addEvent(document.body, 'mousemove',function (e) { self.bodyMouseMove(e); }); dragTableCols.addEvent(document.body, 'mouseup',deactivate); } dragTableCols.prototype.cellMouseMove = function (e) { e = e ? e : window.event; var t = e.target || e.srcElement; if ( typeof dragTableCols == 'undefined' ) return;// sometimes happens, no idea why if (!t._pos) { t._pos = dragTableCols.getElementTopLeft(t); return; } if (t.tagName.toLowerCase() != 'td' && t.tagName.toLowerCase() != 'th') return; var self = this; function activate (e) { e = e ? e : window.event; self.drag = true; self.startX = t._pos.left + t.offsetWidth; self._col = t; var offsetWidth = t.offsetWidth; self.startWidth = (t.width) ? parseInt(t.width, 10) : t.offsetWidth; t.style.width = self.startWidth + 'px'; self.offset = t.offsetWidth - offsetWidth; //padding + border; t.style.width = self.startWidth - self.offset+ 'px'; } // activate right side if (t._pos.left + t.offsetWidth - dragTableCols.getPageX (e) < 5 && t != t.parentNode.cells[t.parentNode.cells.length -1] ) { t.style.cursor = 'e-resize'; dragTableCols.addEvent(t,'mousedown', activate); } else { t.style.cursor = ''; dragTableCols.removeEvent(t,'mousedown', activate); } } dragTableCols.prototype.bodyMouseMove = function (e) { if (!this.drag) return true; e = e ? e : window.event; var mouseX = dragTableCols.getPageX (e); var delta = mouseX - this.startX; document.body.style.cursor = (delta < 0) ? 'e-resize' : 'w-resize'; var newWidth = this.startWidth + delta - this.offset; this._col.style.width = ((newWidth > 10 ) ? newWidth : 10 ) + 'px'; return true; } dragTableCols.addEvent = function (obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); } else if (obj.attachEvent) { obj.attachEvent("on"+evType, fn);} else { return false; } } dragTableCols.removeEvent = function (obj, evType, fn) { if (obj.addEventListener) { obj.removeEventListener(evType, fn, true); } else if (obj.detachEvent) { obj.detachEvent("on"+evType, fn); } else { return false; } } dragTableCols.getElementTopLeft = function(element) { var curleft = 0; var curtop = 0; if (element.offsetParent) { curleft = element.offsetLeft curtop = element.offsetTop while (element = element.offsetParent) { curleft += element.offsetLeft curtop += element.offsetTop } } return { top:curtop, left:curleft }; } dragTableCols.getPageX = function (e) { if ( e.pageX ) return e.pageX; else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict { return document.documentElement.scrollLeft + e.clientX; } else if (document.body) // all other Explorers { return document.body.scrollLeft + e.clientX; } }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/dragTableCols.js
JavaScript
art
3,677
// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: popup.js 1084 2008-10-12 17:42:42Z ray $ function __dlg_onclose() { if(opener.Dialog._return) opener.Dialog._return(null); } function __dlg_init( bottom, win_dim ) { __xinha_dlg_init(win_dim); } function __xinha_dlg_init( win_dim ) { if(window.__dlg_init_done) return true; if(window.opener._editor_skin) { var head = document.getElementsByTagName("head")[0]; var link = document.createElement("link"); link.type = "text/css"; link.href = window.opener._editor_url + 'skins/' + window.opener._editor_skin + '/skin.css'; link.rel = "stylesheet"; head.appendChild(link); } if (!window.dialogArguments && opener.Dialog._arguments) { window.dialogArguments = opener.Dialog._arguments; } Xinha.addDom0Event(document.body, 'keypress', __dlg_close_on_esc); window.__dlg_init_done = true; } function __dlg_translate(context) { var types = ["span", "option", "td", "th", "button", "div", "label", "a","img", "legend"]; for (var type = 0; type < types.length; type++) { var spans = document.getElementsByTagName(types[type]); for (var i = spans.length; --i >= 0;) { var span = spans[i]; if (span.firstChild && span.firstChild.data) { var txt = Xinha._lc(span.firstChild.data, context); if (txt) span.firstChild.data = txt; } if (span.title) { var txt = Xinha._lc(span.title, context); if (txt) span.title = txt; } if (span.alt) { var txt = Xinha._lc(span.alt, context); if (txt) span.alt = txt; } } } document.title = Xinha._lc(document.title, context); } // closes the dialog and passes the return info upper. function __dlg_close(val) { opener.Dialog._return(val); window.close(); } function popupPrompt( prompt, value, handler, title) { Dialog("prompt.html", function(param) { if (!param) // user must have pressed Cancel { return false; } else { handler (param.value); } }, {prompt:prompt,value:value,title:title}); }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/popup.js
JavaScript
art
2,717
html, body, .dialog { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} body { padding: 5px; } fieldset { padding: 0;} .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} form { padding: 0px; margin: 0 auto; width: 100%;} /*.dirWidth { width: 60%; }*/ a { padding: 5px; border: 1px solid ButtonFace; } a img { border: 0; } a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } .dirs { padding: 1em; } .imageFrame { overflow-x:hidden; width: 100%; height: 155px; margin:0px; background-color: #fff;} .smallWidth{ width: 4em; } .largelWidth{ width: 30em; } .extralargelWidth{ width: 100%; } .inputTable { margin: 1em auto 1em 0;width:100%} select, input, button { font: 11px Tahoma,Verdana,sans-serif; } .buttons { width: 70px; text-align: center; } .clearboth{ clear: both; } #messages {opacity:0.8;filter:Alpha(opacity=85);position:relative;height:20px;margin-bottom:-30px;background-color: white; border: none; text-align: center; padding: 5px; } #message { font-size: 15px; font-weight: bold; color: #69c; } iframe { border:1px inset; border-right:none; border-left:none; border-bottom:none; } #controls {padding-bottom:10px;} table { margin-top:10px; } th, td { padding-right:3px; text-align:left; font-family:small-caption,helvetica,sans-serif; } .dirWidth {width: 59%} .buttonColor { width :1em; margin-left: 2px; cursor: default; } .buttonColor .chooser, .buttonColor .nocolor { height: 0.6em; border: 1px solid; padding: 0px 1em; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } .buttonColor .buttonClick { border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; } .buttonColor .buttonColor-hilite { border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; } .buttonColor .nocolor { padding: 0px; } .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/manager.css
CSS
art
2,132
/** * Functions for the ImageEditor interface, used by editor.php only * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 20-06-2006 by Krzysztof Kotowicz * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) */ var current_action = null; var actions = ['crop', 'scale', 'rotate', 'measure', 'save']; var orginal_width = null, orginal_height=null; function toggle(action) { if(current_action != action) { for (var i in actions) { if(actions[i] != action) { var tools = document.getElementById('tools_'+actions[i]); tools.style.display = 'none'; var icon = document.getElementById('icon_'+actions[i]); icon.className = ''; } } current_action = action; var tools = document.getElementById('tools_'+action); tools.style.display = 'block'; var icon = document.getElementById('icon_'+action); icon.className = 'iconActive'; var indicator = document.getElementById('indicator_image'); indicator.src = 'img/'+action+'.gif'; editor.setMode(current_action); //constraints on the scale, //code by Frédéric Klee <fklee@isuisse.com> if(action == 'scale') { var theImage = editor.window.document.getElementById('theImage'); orginal_width = theImage._width ; orginal_height = theImage._height; var w = document.getElementById('sw'); w.value = orginal_width ; var h = document.getElementById('sh') ; h.value = orginal_height ; } if ( action == 'save' ) { var formatSelect = document.getElementById('save_format'); var format = document.getElementById('save_filename').value.match(/\.(gif|png|jpe?g)/i)[1].toLowerCase(); switch ( format ) { case 'png': formatSelect.selectedIndex = '3'; break; case 'gif': formatSelect.selectedIndex = '4'; break; default: formatSelect.selectedIndex = '0'; break; } formatSelect.onchange(); } } } function toggleMarker() { var marker = document.getElementById("markerImg"); if(marker != null && marker.src != null) { if(marker.src.indexOf("t_black.gif") >= 0) marker.src = "img/t_white.gif"; else marker.src = "img/t_black.gif"; editor.toggleMarker(); } } //Togggle constraints, by Frédéric Klee <fklee@isuisse.com> function toggleConstraints() { var lock = document.getElementById("scaleConstImg"); var checkbox = document.getElementById("constProp"); if(lock != null && lock.src != null) { if(lock.src.indexOf("unlocked2.gif") >= 0) { lock.src = "img/islocked2.gif"; checkbox.checked = true; checkConstrains('width'); } else { lock.src = "img/unlocked2.gif"; checkbox.checked = false; } } } //check the constraints, by Frédéric Klee <fklee@isuisse.com> function checkConstrains(changed) { var constrained = document.getElementById('constProp'); if(constrained.checked) { var w = document.getElementById('sw') ; var width = w.value ; var h = document.getElementById('sh') ; var height = h.value ; if(orginal_width > 0 && orginal_height > 0) { if(changed == 'width' && width > 0) h.value = parseInt((width/orginal_width)*orginal_height); else if(changed == 'height' && height > 0) w.value = parseInt((height/orginal_height)*orginal_width); } } updateMarker('scale') ; } function updateMarker(mode) { if (mode == 'crop') { var t_cx = document.getElementById('cx'); var t_cy = document.getElementById('cy'); var t_cw = document.getElementById('cw'); var t_ch = document.getElementById('ch'); editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value)); } else if(mode == 'scale') { var s_sw = document.getElementById('sw'); var s_sh = document.getElementById('sh'); editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value)); } } function rotateSubActionSelect(selection) { var value = selection.options[selection.selectedIndex].value; var rotate_preset_select = document.getElementById('rotate_preset_select'); var flip = document.getElementById('flip'); var angle = document.getElementById('ra').parentNode; switch (value) { case 'rotate': rotate_preset_select.style.display = ''; flip.style.display = 'none'; angle.style.display = ''; break; case 'flip': rotate_preset_select.style.display = 'none'; flip.style.display = ''; angle.style.display = 'none'; break; } } function rotatePreset(selection) { var value = selection.options[selection.selectedIndex].value; if(value.length > 0 && parseInt(value) != 0) { var ra = document.getElementById('ra'); ra.value = parseInt(value); } } function updateFormat(selection) { var selected = selection.options[selection.selectedIndex].value; var values = selected.split(","); if ( values[0] != 'jpeg' ) document.getElementById('slider').style.display = 'none'; else document.getElementById('slider').style.display = 'inline'; if(values.length >1) { updateSlider(parseInt(values[1])); } } function zoom() { var theImage = editor.window.document.getElementById('theImage'); var value = document.getElementById('zoom').value; theImage.width = theImage._width * parseInt( value, 10 ) / 100; theImage.height = theImage._height * parseInt( value, 10 )/ 100; editor.reset(); editor.pic_width = null; editor.pic_height = null; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } var init = function() { if(window.opener) { __xinha_dlg_init(); __dlg_translate('ExtendedFileManager'); } addEvent(window, 'resize', winOnResize); try { window.moveTo(0,0); } catch (e) {} window.resizeTo(window.screen.availWidth,window.screen.availHeight); winOnResize(); } function winOnResize () { if ( typeof editor.reset == 'function' && typeof editor.ant != 'undefined' ) editor.reset(); var win = Xinha.viewportSize(window); document.getElementById("contents").style.height = win.y - parseInt(document.getElementById("indicator").offsetHeight,10) - 5 + 'px'; } Xinha.addOnloadHandler( init, window );
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/editor.js
JavaScript
art
7,066
body { margin: 0; padding: 0; background-color: #eee; } table { width: 100%; } table td { text-align: center; } .crop{cursor:crosshair;} .selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; } .selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; } .handleBox{ z-index:105; } .error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; } #n-resize {cursor: n-resize } #s-resize {cursor: s-resize } #w-resize {cursor: w-resize } #e-resize {cursor: e-resize } #nw-resize {cursor: nw-resize } #sw-resize {cursor: sw-resize } #ne-resize {cursor: ne-resize } #se-resize {cursor: se-resize }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/editorFrame.css
CSS
art
716
// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003-2004 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: dialog.js 1084 2008-10-12 17:42:42Z ray $ // Though "Dialog" looks like an object, it isn't really an object. Instead // it's just namespace for protecting global symbols. function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } if (typeof window.showModalDialog == 'function') { Dialog._return = action; var r = window.showModalDialog(url, init, "dialogheight=10;dialogwidth=10;resizable=yes"); } else { Dialog._geckoOpenModal(url, action, init); } } Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); if (Dialog._modal && !Dialog._modal.closed) { Dialog._stopEvent(ev); } }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; Dialog._geckoOpenModal = function(url, action, init) { //var urlLink = "hadialog"+url.toString(); var myURL = "hadialog"+url; var regObj = /\W/g; myURL = myURL.replace(regObj,'_'); var dlg = window.open(url, myURL, "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // capture some window's events function capwin(w) { Dialog._addEvent(w, "click", Dialog._parentEvent); Dialog._addEvent(w, "mousedown", Dialog._parentEvent); Dialog._addEvent(w, "focus", Dialog._parentEvent); }; // release the captured events function relwin(w) { Dialog._removeEvent(w, "click", Dialog._parentEvent); Dialog._removeEvent(w, "mousedown", Dialog._parentEvent); Dialog._removeEvent(w, "focus", Dialog._parentEvent); }; capwin(window); // capture other frames for (var i = 0; i < window.frames.length; capwin(window.frames[i++])); // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } relwin(window); // capture other frames for (var i = 0; i < window.frames.length; relwin(window.frames[i++])); Dialog._modal = null; }; }; // event handling Dialog._addEvent = function(el, evname, func) { if (Dialog.is_ie) { el.attachEvent("on" + evname, func); } else { el.addEventListener(evname, func, true); } }; Dialog._removeEvent = function(el, evname, func) { if (Dialog.is_ie) { el.detachEvent("on" + evname, func); } else { el.removeEventListener(evname, func, true); } }; Dialog._stopEvent = function(ev) { if (Dialog.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } }; Dialog.agt = navigator.userAgent.toLowerCase(); Dialog.is_ie = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/dialog.js
JavaScript
art
3,695
.icons { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; border: 1px solid #EEEEFF; -Moz-Border-Radius: 6px 6px 6px 6px; } body, td, p { font: 11px Tahoma,Verdana,sans-serif; } .iconsOver { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; background-color: #F9F9FF; border: 1px solid #666699; -Moz-Border-Radius: 6px 6px 6px 6px; } .topBar { font: 11px Tahoma,Verdana,sans-serif; color: #666699; } .iconsSel { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; border: 1px solid #666699; -Moz-Border-Radius: 6px 6px 6px 6px; } .iconText { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-decoration: none; text-align: center; } .measureStats{ width: 50px; } #slidercasing { /*border:1px solid #CCCCCC; background-color:#FFFFFF;*/ width:100px; height:5px; position:relative; z-index:4; padding:10px; } #slidertrack { position:relative; border:1px solid #CCCCCC; background-color:#FFFFCC; z-index:5; height:5px; } #sliderbar { position:absolute; z-index:6; border:1px solid #CCCCCC; background-color:#DDDDDD; width:15px; padding:0px; height:20px; cursor: pointer; top:2px; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/ImageEditor.css
CSS
art
1,495
/** * Functions for the ExtendedFileManager, used by manager.php only * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer * Version: Updated on 08-01-2005 by Afru * Version: Updated on 20-06-2006 by Krzysztof Kotowicz * Version: Updated on 17-11-2006 by Raimund Meyer * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ function comboSelectValue(c, val) { var ops = c.getElementsByTagName("option"); for (var i = ops.length; --i >= 0;) { var op = ops[i]; op.selected = (op.value == val); } c.value = val; } //Translation function i18n(str) { return Xinha._lc(str, 'ExtendedFileManager'); } //set the alignment options function setAlign(align) { var selection = document.getElementById('f_align'); for(var i = 0; i < selection.length; i++) { if(selection.options[i].value == align) { selection.selectedIndex = i; break; } } } function onTargetChanged() { var f = document.getElementById("f_other_target"); if (this.value == "_other") { f.style.visibility = "visible"; f.select(); f.focus(); } else f.style.visibility = "hidden"; } function init () { if (typeof imgManager == 'undefined' ) { setTimeout(init,10); // sometimes we are too hasty return; } var w = 650; var h = 600; window.resizeTo(w,h); var page = Xinha.pageSize(window); window.resizeTo(w,h); var dim = Xinha.viewportSize(window); window.resizeBy(0, page.y - dim.y + 5); dim = Xinha.viewportSize(window); if (!Xinha.is_ie) { var x = opener.screenX + (opener.outerWidth - dim.x) / 2; var y = opener.screenY + (opener.outerHeight - dim.x) / 2; } else {//IE does not have window.outer... , so center it on the screen at least var x = (self.screen.availWidth - dim.x) / 2; var y = (self.screen.availHeight - dim.y) / 2; } window.moveTo(x,y); __xinha_dlg_init(); __dlg_translate('ExtendedFileManager'); var uploadForm = document.getElementById('uploadForm'); if(uploadForm) uploadForm.target = 'imgManager'; var editor = window.dialogArguments.editor; var param = window.dialogArguments.param; var startDir = null; if(manager_mode=="image" && param) { var absoluteURL = new RegExp('^https?://'); if (param.f_url.length > 0 && !absoluteURL.test(param.f_url) && typeof param.baseHref == "string") { // URL is not absolute, prepend baseHref param.f_url = param.baseHref + param.f_url; } // strip base_url from url var image_regex = new RegExp( '(https?://[^/]*)?' + base_url.replace(/\/$/, '') ); param.f_url = param.f_url.replace( image_regex, "" ); // The image URL may reference one of the automatically resized images // (when the user alters the dimensions in the picker), clean that up // so it looks right and we get back to a normal f_url var rd = (_resized_dir) ? _resized_dir.replace(Xinha.RE_Specials, '\\$1') + '/' : ''; var rp = _resized_prefix.replace(Xinha.RE_Specials, '\\$1'); var dreg = new RegExp('^(.*/)' + rd + rp + '_([0-9]+)x([0-9]+)_([^/]+)$'); var match = param.f_url.match(dreg); if(dreg.test(param.f_url)) { param.f_url = RegExp.$1 + RegExp.$4; param.f_width = RegExp.$2; param.f_height = RegExp.$3; } document.getElementById("f_url").value = param["f_url"]; document.getElementById("f_alt").value = param["f_alt"]; document.getElementById("f_title").value = param["f_title"]; document.getElementById("f_border").value = param["f_border"]; document.getElementById("f_width").value = param["f_width"]; document.getElementById("f_height").value = param["f_height"]; document.getElementById("f_margin").value = param["f_margin"]; document.getElementById("f_padding").value = param["f_padding"]; document.getElementById("f_borderColor").value = param["f_borderColor"]; document.getElementById("f_backgroundColor").value = param["f_backgroundColor"]; setAlign(param["f_align"]); document.getElementById("f_url").focus(); document.getElementById("orginal_width").value = param["f_width"]; document.getElementById("orginal_height").value = param["f_height"]; // Locate to the correct directory var dreg = new RegExp('^(.*/)([^/]+)$'); if (dreg.test(param['f_url'])) { startDir = RegExp.$1; } document.getElementById('f_preview').src = _backend_url + '__function=thumbs&img=' + param.f_url; } else if(manager_mode=="link" && param) { var target_select = document.getElementById("f_target"); var absoluteURL = new RegExp('^https?://'); if (param.f_href.length > 0 && !absoluteURL.test(param.f_href) && typeof param.baseHref == "string") { // URL is not absolute, prepend baseHref param.f_href = param.baseHref + param.f_href; } // strip base_url from href var href_regex = new RegExp( '(https?://[^/]*)?' + base_url.replace(/\/$/, '') ); param.f_href = param.f_href.replace( href_regex, "" ); // Locate to the correct directory var dreg = new RegExp('^(.*/)([^/]+)$'); if (dreg.test(param['f_href'])) { startDir = RegExp.$1; } else { startDir = document.cookie.match(/EFMStartDirlink=(.*?)(;|$)/); if (startDir) startDir = startDir[1]; } if (param) { if ( typeof param["f_href"] != "undefined" ) { document.getElementById("f_href").value = param["f_href"]; document.getElementById("f_title").value = param["f_title"]; comboSelectValue(target_select, param["f_target"]); if (target_select.value != param.f_target) { var opt = document.createElement("option"); opt.value = param.f_target; opt.innerHTML = opt.value; target_select.appendChild(opt); opt.selected = true; } } } if ( param["f_usetarget"] == false || manager_show_target != false) { document.getElementById("f_target_label").style.visibility = "hidden"; document.getElementById("f_target").style.visibility = "hidden"; document.getElementById("f_other_target").style.visibility = "hidden"; } if (target_select && param["f_usetarget"] && manager_show_target != false) { var opt = document.createElement("option"); opt.value = "_other"; opt.innerHTML = i18n("Other"); target_select.appendChild(opt); target_select.onchange = onTargetChanged; } document.getElementById("f_href").focus(); } else if (!param) { startDir = document.cookie.match(new RegExp ("EFMStartDir" + manager_mode + "=(.*?)(;|$)")); if (startDir) { startDir = startDir[1]; } } if ( startDir ) { iframeUrl += '&dir=' + startDir; var dirPath = document.getElementById('dirPath'); for(var i = 0; i < dirPath.options.length; i++) { if(dirPath.options[i].value == encodeURIComponent(startDir)) { dirPath.options[i].selected = true; break; } } }; imgManager.location.replace(iframeUrl); if (manager_mode == 'image' && typeof Xinha.colorPicker != "undefined" && document.getElementById('f_backgroundColor') && document.getElementById('f_backgroundColor').type == 'text') { // Hookup color pickers var pickerConfig = { cellsize:editor.config.colorPickerCellSize, granularity:editor.config.colorPickerGranularity, websafe:editor.config.colorPickerWebSafe, savecolors:editor.config.colorPickerSaveColors }; new Xinha.colorPicker.InputBinding(document.getElementById('f_backgroundColor'),pickerConfig); new Xinha.colorPicker.InputBinding(document.getElementById('f_borderColor'),pickerConfig); } setTimeout(function() { resize();addEvent(window, 'resize', resize); }, 500); } function pasteButton(action) { var buttonHolder = document.getElementById('pasteBtn'); if (!buttonHolder.firstChild) { var a = document.createElement('a'); a.href = "javascript:void(0);"; var img = document.createElement('img'); img.src = window.opener.Xinha.getPluginDir('ExtendedFileManager')+'/img/edit_paste.gif'; img.alt = i18n('Paste'); a.appendChild(img); buttonHolder.appendChild(a); } buttonHolder.onclick = function() { if(typeof imgManager != 'undefined') imgManager.paste(action); if (action.action == 'moveFile' || action.action == 'moveDir' ) { this.onclick = null; this.removeChild(this.firstChild) } } switch (action.action) { case 'copyFile': buttonHolder.firstChild.title = i18n('Copy "$file='+action.file+'$" from "$dir='+decodeURIComponent(action.dir)+'$" here'); break; case 'copyDir': buttonHolder.firstChild.title = i18n('Copy folder "$file='+action.file+'$" from "$dir='+decodeURIComponent(action.dir)+'$" here'); break; case 'moveFile': buttonHolder.firstChild.title = i18n('Move "$file='+action.file+'$" from "$dir='+decodeURIComponent(action.dir)+'$" here'); break; break; case 'moveDir': buttonHolder.firstChild.title = i18n('Move folder "$file='+action.file+'$" from "$dir='+decodeURIComponent(action.dir)+'$" here'); break; } } function onCancel() { __dlg_close(null); return false; } function onOK() { if(manager_mode=="image") { // pass data back to the calling window var fields = ["f_url", "f_alt", "f_title", "f_align", "f_border", "f_margin", "f_padding", "f_height", "f_width", "f_borderColor", "f_backgroundColor"]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); if(id == "f_url" && el.value.indexOf('://') < 0 && el.value ) param[id] = makeURL(base_url,el.value); else param[id] = el.value; } // See if we need to resize the image var origsize = { w:document.getElementById('orginal_width').value, h:document.getElementById('orginal_height').value } if( (origsize.w != param.f_width) || (origsize.h != param.f_height) ) { // Yup, need to resize var resized = Xinha._geturlcontent(window.opener.Xinha.getPluginDir('ExtendedFileManager') + '/' + _backend_url + '&__function=resizer&img=' + encodeURIComponent(document.getElementById('f_url').value) + '&width=' + param.f_width + '&height=' + param.f_height); // alert(resized); resized = eval(resized); if(resized) { param.f_url = makeURL(base_url, resized); } } __dlg_close(param); return false; } else if(manager_mode=="link") { var required = { // f_href shouldn't be required or otherwise removing the link by entering an empty // url isn't possible anymore. // "f_href": i18n("You must enter the URL where this link points to") }; for (var i in required) { var el = document.getElementById(i); if (!el.value) { alert(required[i]); el.focus(); return false; } } // pass data back to the calling window var fields = ["f_href", "f_title", "f_target" ]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); if(id == "f_href" && el.value.indexOf('://') < 0 ) param[id] = makeURL(base_url,el.value); else param[id] = el.value; } if (param.f_target == "_other") param.f_target = document.getElementById("f_other_target").value; // alert(param.f_target); __dlg_close(param); return false; } } //similar to the Files::makeFile() in Files.php function makeURL(pathA, pathB) { if(pathA.substring(pathA.length-1) != '/') pathA += '/'; if(pathB.charAt(0) == '/'); pathB = pathB.substring(1); return pathA+pathB; } function updateDir(selection) { var newDir = selection.options[selection.selectedIndex].value; changeDir(newDir); } function goUpDir() { var selection = document.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; if(currentDir.length < 2) return false; var dirs = currentDir.split('/'); var search = ''; for(var i = 0; i < dirs.length - 2; i++) { search += dirs[i]+'/'; } for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == search) { selection.selectedIndex = i; var newDir = selection.options[i].value; changeDir(newDir); break; } } } function changeDir(newDir) { if(typeof imgManager != 'undefined') imgManager.changeDir(newDir); } function updateView() { refresh(); } function toggleConstrains(constrains) { var lockImage = document.getElementById('imgLock'); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { lockImage.src = "img/locked.gif"; checkConstrains('width') } else { lockImage.src = "img/unlocked.gif"; } } function checkConstrains(changed) { //alert(document.form1.constrain_prop); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { var obj = document.getElementById('orginal_width'); var orginal_width = parseInt(obj.value); var obj = document.getElementById('orginal_height'); var orginal_height = parseInt(obj.value); var widthObj = document.getElementById('f_width'); var heightObj = document.getElementById('f_height'); var width = parseInt(widthObj.value); var height = parseInt(heightObj.value); if(orginal_width > 0 && orginal_height > 0) { if(changed == 'width' && width > 0) { heightObj.value = parseInt((width/orginal_width)*orginal_height); } if(changed == 'height' && height > 0) { widthObj.value = parseInt((height/orginal_height)*orginal_width); } } } } function showMessage(newMessage) { var message = document.getElementById('message'); var messages = document.getElementById('messages'); if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(document.createTextNode(i18n(newMessage))); messages.style.display = "block"; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function doUpload() { var uploadForm = document.getElementById('uploadForm'); if(uploadForm) showMessage('Uploading'); } function refresh() { var selection = document.getElementById('dirPath'); updateDir(selection); } function newFolder() { function createFolder(folder) { var selection = document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; if(folder == thumbdir) { alert(i18n('Invalid folder name, please choose another folder name.')); return false; } if (folder && folder != '' && typeof imgManager != 'undefined') { imgManager.newFolder(dir, encodeURI(folder)); } } // IE7 has crippled the prompt() if ( Xinha.ie_version > 6 ) { popupPrompt(i18n('Please enter name for new folder...'), i18n('Untitled'), createFolder, i18n("New Folder")); } else { var folder = prompt(i18n('Please enter name for new folder...'), i18n('Untitled')); createFolder(folder); } } function resize() { var win = Xinha.viewportSize(window); var m = document.getElementById('messages'); var messagesHeight = (m && m.style.display != 'none' ) ? parseInt( document.getElementById('messages').offsetHeight, 10 ) : 0; document.getElementById('imgManager').style.height = parseInt( win.y - 130 - document.getElementById('controls').offsetHeight, 10 ) - messagesHeight + 'px'; return true; } Xinha.addOnloadHandler( init, window );
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/manager.js
JavaScript
art
17,574
/** * ImageEditor Interface file. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 20-06-2006 by Krzysztof Kotowicz * Version: Updated on 04-11-2007 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } var pic_x, pic_y; function P7_Snap() { //v2.62 by PVII var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a); for (k=0; k<(args.length-3); k+=4) if ((g=MM_findObj(args[k]))!=null) { el=eval(MM_findObj(args[k+1])); a=parseInt(args[k+2]);b=parseInt(args[k+3]); x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']"; if(document.getElementById) { d="document.getElementsByName('"+args[k]+"')[0]"; if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}} }else if(document.all) {d=da;} if (document.all || document.getElementById) { while (tx==1) {p+=".offsetParent"; if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop")); }else{tx=0;}} ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy; if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) { ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top); }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10; a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b; //alert(event.clientX); if (event == null) x=document.body.scrollLeft + bx; else x=document.body.scrollLeft + event.clientX + bx; if (event == null) y=document.body.scrollTop; else y=document.body.scrollTop + event.clientY;}} }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd=""; for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name; if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}} if(el) {e=(document.layers)?el:el.style; var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b); if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";} if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){ xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin); xx+="px";yy+="px";}e.left=xx;e.top=yy;} pic_x = parseInt(xx); pic_y = parseInt(yy); } } var ie=document.all; var ns6=document.getElementById&&!document.all; var dragapproved=false; var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2; function init_resize() { //if(mode == "scale") //{ P7_Snap('theImage','ant',0,0); if (canvas == null) canvas = MM_findObj("imgCanvas"); if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } if (ant == null) ant = MM_findObj("ant"); ant.style.left = pic_x; ant.style.top = pic_y; ant.style.width = pic_width; ant.style.height = pic_height; ant.style.visibility = "visible"; drawBoundHandle(); jg_doc.paint(); //} } initEditor = function () { init_crop(); init_resize(); var markerImg = MM_findObj('markerImg', window.top.document); if (markerImg.src.indexOf("img/t_white.gif")>0) toggleMarker() ; var theImage = document.getElementById('theImage'); theImage._width = theImage.width; theImage._height = theImage.height; } function init_crop() { //if(mode == "crop") { P7_Snap('theImage','ant',0,0); //} } function setMode(newMode) { mode = newMode; reset(); } function reset() { if (ant == null) ant = MM_findObj("ant"); ant.style.visibility = "hidden"; ant.style.left = 0; ant.style.top = 0; ant.style.width = 0; ant.style.height = 0; mx2 = null; my2 = null; jg_doc.clear(); if(mode != 'measure') showStatus(); if(mode == "scale") { init_resize(); } P7_Snap('theImage','ant',0,0); } function toggleMarker() { if (ant == null) ant = MM_findObj("ant"); if(ant.className=="selection") ant.className="selectionWhite"; else ant.className="selection"; if (jg_doc.getColor() == "#000000") jg_doc.setColor("#FFFFFF"); else jg_doc.setColor("#000000"); drawBoundHandle jg_doc.paint(); } function move(e) { if (dragapproved) { var w = ns6? temp1+e.pageX - x : temp1+event.clientX + document.body.scrollLeft- x; var h = ns6? temp2+e.pageY - y : temp2+event.clientY + document.body.scrollTop - y; if (ant != null) { if (w >= 0) { ant.style.left = x; ant.style.width = w; } else { ant.style.left = x+w; ant.style.width = -1*w; } if (h >= 0) { ant.style.top = y; ant.style.height = h; } else { ant.style.top = y+h; ant.style.height = -1*h } } showStatus(); return false } } function moveContent(e) { if (dragapproved) { var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y ant.style.left = dx; ant.style.top = dy; showStatus(); return false; } } //Code add for constraints by Frédéric Klee <fklee@isuisse.com> function moveHandle(e) { if (dragapproved) { var w = ns6? e.clientX - x : event.clientX - x; var h = ns6? e.clientY - y : event.clientY - y; var constrained = MM_findObj('constProp', window.top.document); var orginal_height = document.theImage.height ; var orginal_width = document.theImage.width ; rapp = orginal_width/orginal_height ; rapp_inv = orginal_height / orginal_width ; switch(resizeHandle) { case "s-resize": if (oa_h + h >= 0) { ant.style.height = oa_h + h; if(constrained.checked) { ant.style.width = rapp * (oa_h + h) ; ant.style.left = oa_x - rapp * h/2; } } break; case "e-resize": if(oa_w + w >= 0) { ant.style.width = oa_w + w; if(constrained.checked) { ant.style.height = rapp_inv * (oa_w + w) ; ant.style.top = oa_y - rapp_inv * w/2; } } break; case "n-resize": if (oa_h - h >= 0) { ant.style.top = oa_y + h; ant.style.height = oa_h - h; if(constrained.checked) { ant.style.width = rapp * (oa_h - h) ; ant.style.left = oa_x + rapp * h/2; } } break; case "w-resize": if(oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; if(constrained.checked) { ant.style.height = rapp_inv * (oa_w - w) ; ant.style.top = oa_y + rapp_inv * w/2; } }break; case "nw-resize": if(oa_h - h >= 0 && oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; ant.style.top = oa_y + h; if(constrained.checked) ant.style.height = rapp_inv * (oa_w - w) ; else ant.style.height = oa_h - h; } break; case "ne-resize": if (oa_h - h >= 0 && oa_w + w >= 0){ ant.style.top = oa_y + h; ant.style.width = oa_w + w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w + w) ; else ant.style.height = oa_h - h; } break; case "se-resize": if (oa_h + h >= 0 && oa_w + w >= 0) { ant.style.width = oa_w + w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w + w) ; else ant.style.height = oa_h + h; } break; case "sw-resize": if (oa_h + h >= 0 && oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w - w) ; else ant.style.height = oa_h + h; } } showStatus(); return false; } } function drags(e) { if (!ie&&!ns6) return var firedobj=ns6? e.target : event.srcElement var topelement=ns6? "HTML" : "BODY" while (firedobj.tagName!=topelement&& !(firedobj.className=="crop" || firedobj.className=="handleBox" || firedobj.className=="selection" || firedobj.className=="selectionWhite")) { firedobj=ns6? firedobj.parentNode : firedobj.parentElement } if(firedobj.className=="handleBox") { if(content != null) { if(content.width != null && content.height != null) { content.width = 0; content.height = 0; } } resizeHandle = firedobj.id; x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY oa_w = parseInt(ant.style.width); oa_h = parseInt(ant.style.height); oa_x = parseInt(ant.style.left); oa_y = parseInt(ant.style.top); dragapproved=true document.onmousemove=moveHandle; return false; } else if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") { x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY oa_x = parseInt(ant.style.left); oa_y = parseInt(ant.style.top); dragapproved=true document.onmousemove=moveContent; return false; } else if (firedobj.className=="crop" && mode == "crop") { if(content != null) { if(content.width != null && content.height != null) { content.width = 0; content.height = 0; } } if (status == null) status = MM_findObj("status"); if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); if(content == null) { content = MM_findObj("cropContent"); } if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } ant.style.visibility = "visible"; obj = firedobj; dragapproved=true z=firedobj temp1=parseInt(z.style.left+0) temp2=parseInt(z.style.top+0) x=ns6? e.pageX: event.clientX + document.body.scrollLeft y=ns6? e.pageY: event.clientY + document.body.scrollTop document.onmousemove=move return false } else if(firedobj.className=="crop" && mode == "measure") { if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); x=ns6? e.pageX: event.clientX + document.body.scrollLeft y=ns6? e.pageY: event.clientY + document.body.scrollTop dragapproved=true document.onmousemove=measure return false } } function measure(e) { if (dragapproved) { mx2 = ns6? e.pageX : event.clientX + document.body.scrollLeft; my2 = ns6? e.pageY : event.clientY + document.body.scrollTop; jg_doc.clear(); jg_doc.setStroke(Stroke.DOTTED); jg_doc.drawLine(x,y,mx2,my2); jg_doc.paint(); showStatus(); return false; } } function setMarker(nx,ny,nw,nh) { if (isNaN(nx)) nx = 0; if (isNaN(ny)) ny = 0; if (isNaN(nw)) nw = 0; if (isNaN(nh)) nh = 0; if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); if(content == null) { content = MM_findObj("cropContent"); } if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } ant.style.visibility = "visible"; nx = pic_x + nx; ny = pic_y + ny; if (nw >= 0) { ant.style.left = nx; ant.style.width = nw; } else { ant.style.left = nx+nw; ant.style.width = -1*nw; } if (nh >= 0) { ant.style.top = ny; ant.style.height = nh; } else { ant.style.top = ny+nh; ant.style.height = -1*nh } } function max(x,y) { if(y > x) return x; else return y; } function drawBoundHandle() { if(ant == null || ant.style == null) return false; var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle } function showStatus() { if(ant == null || ant.style == null) { return false; } var zoom = 100 / parseInt( window.parent.document.getElementById('zoom').value, 10 ); if(mode == "measure") { mx1 = x - pic_x; my1 = y - pic_y; mw = mx2 - x; mh = my2 - y; md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100; ma = (Math.atan(-1*mh/mw)/Math.PI)*180; if(mw < 0 && mh < 0) ma = ma+180; if (mw <0 && mh >0) ma = ma - 180; ma = parseInt(ma*100)/100; if (m_sx != null && !isNaN(mx1)) m_sx.value = mx1 * zoom +"px"; if (m_sy != null && !isNaN(my1)) m_sy.value = my1 * zoom+"px"; if(m_w != null && !isNaN(mw)) m_w.value = mw * zoom + "px"; if(m_h != null && !isNaN(mh)) m_h.value = mh * zoom + "px"; if(m_d != null && !isNaN(md)) m_d.value = md * zoom + "px"; if(m_a != null && !isNaN(ma)) m_a.value = ma + ""; if(r_ra != null &&!isNaN(ma)) r_ra.value = ma; return false; } var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); var cx = ax-pic_x<0?0:ax-pic_x; var cy = ay-pic_y<0?0:ay-pic_y; cx = cx>pic_width?pic_width:cx; cy = cy>pic_height?pic_height:cy; var cw = ax-pic_x>0?aw:aw-(pic_x-ax); var ch = ay-pic_y>0?ah:ah-(pic_y-ay); ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height); cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width); ch = ch<0?0:ch; cw = cw<0?0:cw; if (ant.style.visibility == "hidden") { cx = ""; cy = ""; cw=""; ch=""; } if(mode == 'crop') { if(t_cx != null) t_cx.value = cx * zoom ; if (t_cy != null) t_cy.value = cy * zoom ; if(t_cw != null) t_cw.value = cw * zoom ; if (t_ch != null) t_ch.value = ch * zoom ; } else if(mode == 'scale') { var sw = aw, sh = ah; if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0) { sw = cw/pic_width; sh = ch/pic_height; } if (s_sw != null) s_sw.value = sw * zoom ; if (s_sh != null) s_sh.value = sh * zoom ; } } function dragStopped() { dragapproved=false; if(ant == null || ant.style == null) { return false; } if(mode == "measure") { jg_doc.drawLine(x-4,y,x+4,y); jg_doc.drawLine(x,y-4,x,y+4); jg_doc.drawLine(mx2-4,my2,mx2+4,my2); jg_doc.drawLine(mx2,my2-4,mx2,my2+4); jg_doc.paint(); showStatus(); return false; } var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); jg_doc.clear(); if(content != null) { if(content.width != null && content.height != null) { content.width = aw-1; content.height = ah-1; } } if(mode == "crop") { //alert(pic_y); jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern); var h1 = ah; var y1 = ay; if (ah+ay >= pic_height+pic_y) h1 = pic_height+pic_y-ay; else if (ay <= pic_y) { h1 = ay+ah-pic_y; y1 = pic_y; } jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern); jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern); jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern); } else if(mode == "scale") { document.theImage.height = ah; document.theImage.width = aw; document.theImage.style.height = ah+" px"; document.theImage.style.width = aw+" px"; P7_Snap('theImage','ant',0,0); } drawBoundHandle(); jg_doc.paint(); showStatus(); return false; } document.onmousedown=drags; document.onmouseup=dragStopped;
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/EditorContent.js
JavaScript
art
20,209
/** * Javascript used by the editorFrame.php, it basically initializes the frame. * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 20-06-2006 by Krzysztof Kotowicz * Version: Updated on 20-01-2008 by Raimund Meyer * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ var topDoc = window.top.document; var t_cx = topDoc.getElementById('cx'); var t_cy = topDoc.getElementById('cy'); var t_cw = topDoc.getElementById('cw'); var t_ch = topDoc.getElementById('ch'); var m_sx = topDoc.getElementById('sx'); var m_sy = topDoc.getElementById('sy'); var m_w = topDoc.getElementById('mw'); var m_h = topDoc.getElementById('mh'); var m_a = topDoc.getElementById('ma'); var m_d = topDoc.getElementById('md'); var s_sw = topDoc.getElementById('sw'); var s_sh = topDoc.getElementById('sh'); var r_ra = topDoc.getElementById('ra'); var pattern = "img/2x2.gif"; function doSubmit(action) { if (action == 'crop') { var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=crop&params="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value); //alert(url); location.href = url; //location.reload(); } else if (action == 'scale') { var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=scale&params="+parseInt(s_sw.value)+','+parseInt(s_sh.value); //alert(url); location.href = url; } else if (action == 'rotate') { var rotate_sub_action = topDoc.getElementById('rotate_sub_action'); if(rotate_sub_action.value == 'flip') location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=flip&params="+topDoc.getElementById('flip').value; else if (isNaN(parseFloat(r_ra.value))==false) location.href = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=rotate&params="+parseFloat(r_ra.value); } else if(action == 'save') { var s_file = topDoc.getElementById('save_filename'); var s_format = topDoc.getElementById('save_format'); var s_quality = topDoc.getElementById('quality'); var format = s_format.value.split(","); if(s_file.value.length <= 0) { alert(i18n('Please enter a filename to save.')); } else { var filename = encodeURI(s_file.value); var quality = parseInt(s_quality.value); var format = s_format.value.split(","); var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=save&params="+format[0]+","+quality+"&file="+filename; location.href = url; } } else if (action == 'preview') { var s_format = topDoc.getElementById('save_format'); var s_quality = topDoc.getElementById('quality'); var quality = parseInt(s_quality.value); var format = s_format.value.split(","); var url = _backend_url + "__function=editorFrame&img="+currentImageFile+"&action=preview&params="+format[0]+","+quality+"&file="+filename; location.href = url; } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } var jg_doc; init = function() { jg_doc = new jsGraphics("imgCanvas"); // draw directly into document jg_doc.setColor("#000000"); // black initEditor(); if (window.parent.document.getElementById('zoom').value != '100') window.parent.zoom(); reset(); window.parent.document.getElementById('filesize').innerHTML = fileSize; }; addEvent(window, 'load', init);
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/plugins/ExtendedFileManager/assets/editorFrame.js
JavaScript
art
3,914
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Xinha Newbie Guide</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="../XinhaLoader.js?lang=en&skin=silva"></script> <script type="text/javascript"> _editor_icons = "Tango" // You can pass arguments via the script URL or embed them here. </script> <script type="text/javascript" src="XinhaConfig.js"></script> </head> <body> <form action=""> <div> <textarea id="myTextArea" name="myTextArea" rows="25" cols="50" style="width: 100%"></textarea> </div> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/Newbie.html
HTML
art
755
xinha_editors = null; xinha_init = null; xinha_config = null; xinha_plugins = null; // This contains the names of textareas we will make into Xinha editors xinha_init = xinha_init ? xinha_init : function() { /** STEP 1 *************************************************************** * First, specify the textareas that shall be turned into Xinhas. * For each one add the respective id to the xinha_editors array. * I you want add more than on textarea, keep in mind that these * values are comma seperated BUT there is no comma after the last value. * If you are going to use this configuration on several pages with different * textarea ids, you can add them all. The ones that are not found on the * current page will just be skipped. ************************************************************************/ xinha_editors = xinha_editors ? xinha_editors : [ 'myTextArea', 'anotherOne' ]; /** STEP 2 *************************************************************** * Now, what are the plugins you will be using in the editors on this * page. List all the plugins you will need, even if not all the editors * will use all the plugins. * * The list of plugins below is a good starting point, but if you prefer * a simpler editor to start with then you can use the following * * xinha_plugins = xinha_plugins ? xinha_plugins : [ ]; * * which will load no extra plugins at all. ************************************************************************/ xinha_plugins = xinha_plugins ? xinha_plugins : [ 'CharacterMap', 'ContextMenu', 'SmartReplace', 'Stylist', 'ExtendedFileManager', 'Linker', 'SuperClean', 'TableOperations' ]; // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; /** STEP 3 *************************************************************** * We create a default configuration to be used by all the editors. * If you wish to configure some of the editors differently this will be * done in step 5. * * If you want to modify the default config you might do something like this. * * xinha_config = new Xinha.Config(); * xinha_config.width = '640px'; * xinha_config.height = '420px'; * * * For a list of the available configuration options, see: * http://trac.xinha.org/wiki/Documentation/ConfigVariablesList * *************************************************************************/ xinha_config = xinha_config ? xinha_config() : new Xinha.Config(); //this is the standard toolbar, feel free to remove buttons as you like xinha_config.toolbar = [ ["popupeditor"], ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"], ["separator","forecolor","hilitecolor","textindicator"], ["separator","subscript","superscript"], ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"], ["separator","insertorderedlist","insertunorderedlist","outdent","indent"], ["separator","inserthorizontalrule","createlink","insertimage","inserttable"], ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]), ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"], ["separator","htmlmode","showhelp","about"] ]; // To adjust the styling inside the editor, we can load an external stylesheet like this // NOTE : YOU MUST GIVE AN ABSOLUTE URL xinha_config.pageStyleSheets = [ _editor_url + "examples/files/full_example.css" ]; //if you're using Stylist, import a stylesheet like this xinha_config.stylistLoadStylesheet(_editor_url + "examples/files/stylist.css"); /** STEP 4 *************************************************************** * We first create editors for the textareas. * * You can do this in two ways, either * * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); * * if you want all the editor objects to use the same set of plugins, OR; * * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); * xinha_editors.myTextArea.registerPlugins(['Stylist']); * xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']); * * if you want to use a different set of plugins for one or more of the * editors. ************************************************************************/ xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); /** STEP 5 *************************************************************** * If you want to change the configuration variables of any of the * editors, this is the place to do that, for example you might want to * change the width and height of one of the editors, like this... * * xinha_editors.myTextArea.config.width = '640px'; * xinha_editors.myTextArea.config.height = '480px'; * ************************************************************************/ /** STEP 6 *************************************************************** * Finally we "start" the editors, this turns the textareas into * Xinha editors. ************************************************************************/ Xinha.startEditors(xinha_editors); } Xinha.addOnloadHandler(xinha_init); // this executes the xinha_init function on page load // and does not interfere with window.onload properties set by other scripts
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/XinhaConfig.js
JavaScript
art
5,677
<html> <head><title>Xinha Extended Example</title></head> <!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- -- Xinha example frameset. -- -- $HeadURL: http://svn.xinha.org/trunk/examples/ExtendedDemo.html $ -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ -- $LastChangedRevision: 1084 $ -- $LastChangedBy: ray $ ---------------------------------------------------------------------------> <frameset cols="240,*"> <frame src="files/ext_example-menu.php" name="menu" id="menu"> <frame src="about:blank" name="body" id="body"> </frameset> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/ExtendedDemo.html
HTML
art
657
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Simple example of Xinha</title> <script type="text/javascript"> var _editor_url = document.location.href.replace(/examples\/simple_example\.html.*/, '') var _editor_lang = "en"; </script> <!-- Load up the actual editor core --> <script type="text/javascript" src="../XinhaCore.js"></script> <script type="text/javascript"> var xinha_plugins = [ 'Linker' ]; var xinha_editors = [ 'myTextArea', 'anotherOne' ]; function xinha_init() { if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; var xinha_config = new Xinha.Config(); xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); Xinha.startEditors(xinha_editors); } Xinha.addOnloadHandler(xinha_init); </script> </head> <body> <form onsubmit="alert(this.myTextArea.value); return false;"> <textarea id="myTextArea" name="myTextArea" rows="25" cols="80"> &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique ante elementum turpis. Aliquam nisl. Nulla posuere neque non tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. Curabitur pharetra bibendum lectus.&lt;/p&gt; </textarea> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/simple_example.html
HTML
art
1,526
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- -- Xinha example usage. This file shows how a developer might make use of -- Xinha, it forms the primary example file for the entire Xinha project. -- This file can be copied and used as a template for development by the -- end developer who should simply removed the area indicated at the bottom -- of the file to remove the auto-example-generating code and allow for the -- use of the file as a boilerplate. -- -- $HeadURL: http://svn.xinha.org/trunk/examples/testbed.html $ -- $LastChangedDate: 2009-11-08 17:36:46 +1300 (Sun, 08 Nov 2009) $ -- $LastChangedRevision: 1197 $ -- $LastChangedBy: gogo $ ---------------------------------------------------------------------------> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Example of Xinha</title> <link rel="stylesheet" href="files/full_example.css" /> <script type="text/javascript"> // You must set _editor_url to the URL (including trailing slash) where // where xinha is installed, it's highly recommended to use an absolute URL // eg: _editor_url = "/path/to/xinha/"; // You may try a relative URL if you wish] // eg: _editor_url = "../"; // in this example we do a little regular expression to find the absolute path. _editor_url = document.location.href.replace(/examples\/.*/, '') _editor_lang = "en"; // And the language we need to use in the editor. </script> <!-- Load up the actual editor core --> <script type="text/javascript" src="../XinhaCore.js"></script> <script type="text/javascript"> xinha_editors = null; xinha_init = null; xinha_config = null; xinha_plugins = null; // This contains the names of textareas we will make into Xinha editors xinha_init = xinha_init ? xinha_init : function() { /** STEP 1 *************************************************************** * First, what are the plugins you will be using in the editors on this * page. List all the plugins you will need, even if not all the editors * will use all the plugins. ************************************************************************/ xinha_plugins = xinha_plugins ? xinha_plugins : [ 'CharacterMap', 'SpellChecker', 'Linker', 'ContextMenu' ]; // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; /** STEP 2 *************************************************************** * Now, what are the names of the textareas you will be turning into * editors? ************************************************************************/ xinha_editors = xinha_editors ? xinha_editors : [ 'myTextArea' ]; /** STEP 3 *************************************************************** * We create a default configuration to be used by all the editors. * If you wish to configure some of the editors differently this will be * done in step 4. * * If you want to modify the default config you might do something like this. * * xinha_config = new Xinha.Config(); * xinha_config.width = 640; * xinha_config.height = 420; * *************************************************************************/ xinha_config = xinha_config ? xinha_config : new Xinha.Config(); xinha_config.fullPage = true; xinha_config.CharacterMap.mode = 'panel'; xinha_config.ContextMenu.customHooks = { 'a': [ ['Label', function() { alert('Action'); }, 'Tooltip', '/xinha/images/ed_copy.gif' ] ] } /* // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL // otherwise it won't work! xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'files/stylist.css')); // Or we can load styles directly xinha_config.stylistLoadStyles('p.red_text { color:red }'); // If you want to provide "friendly" names you can do so like // (you can do this for stylistLoadStylesheet as well) xinha_config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'}); */ /** STEP 3 *************************************************************** * We first create editors for the textareas. * * You can do this in two ways, either * * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); * * if you want all the editor objects to use the same set of plugins, OR; * * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); * xinha_editors['myTextArea'].registerPlugins(['Stylist']); * xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']); * * if you want to use a different set of plugins for one or more of the * editors. ************************************************************************/ xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); /** STEP 4 *************************************************************** * If you want to change the configuration variables of any of the * editors, this is the place to do that, for example you might want to * change the width and height of one of the editors, like this... * * xinha_editors.myTextArea.config.width = 640; * xinha_editors.myTextArea.config.height = 480; * ************************************************************************/ /** STEP 5 *************************************************************** * Finally we "start" the editors, this turns the textareas into * Xinha editors. ************************************************************************/ Xinha.startEditors(xinha_editors); window.onload = null; } window.onload = xinha_init; </script> </head> <body> <form action="javascript:void(0);" id="editors_here" onsubmit="alert(this.myTextArea.value);"> <div> <textarea id="myTextArea" name="myTextArea" style="width:100%;height:320px;"> &lt;html&gt; &lt;head&gt; &lt;title&gt;Hello&lt;/title&gt; &lt;style type="text/css"&gt; li { color:red; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt;&lt;span style="color:purple"&gt; &lt;img src="../images/xinha_logo.gif" usemap="#m1"&gt; &lt;map name="m1"&gt; &lt;area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"&gt; &lt;/map&gt; &lt;p&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique ante elementum turpis. &lt;span style="color:green"&gt;Aliquam &lt;/span&gt; nisl. Nulla posuere neque non tellus. Morbi vel nibh. &lt;font face="Arial"&gt;&lt;font color="#009933"&gt;Cum sociis natoque&lt;/font&gt;&lt;/font&gt; penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. Curabitur pharetra bibendum lectus. &lt;/p&gt; &lt;ul&gt; &lt;li style="color:green"&gt; Phasellus et massa sed diam viverra semper. &lt;/li&gt; &lt;li&gt; Mauris tincidunt felis in odio. &lt;/li&gt; &lt;li&gt; Nulla placerat nunc ut pede. &lt;/li&gt; &lt;li&gt; Vivamus ultrices mi sit amet urna. &lt;/li&gt; &lt;li&gt; Quisque sed augue quis nunc laoreet volutpat.&lt;/li&gt; &lt;li&gt; Nunc sit amet metus in tortor semper mattis. &lt;/li&gt; &lt;/ul&gt; &lt;/span&gt;&lt;/body&gt; &lt;/html&gt; </textarea> <input type="submit" /> <input type="reset" /> </div> </form> <script type="text/javascript"> document.write(document.compatMode); </script> <div> <a href="#" onclick="xinha_editors.myTextArea.hidePanels();">Hide</a> <a href="#" onclick="xinha_editors.myTextArea.showPanels();">Show</a> </div> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/testbed.html
HTML
art
8,587
/*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- -- Xinha example CSS file. This is ripped from Trac ;) -- -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/files/full_example.css $ -- $LastChangedDate:2008-02-04 01:43:21 +0100 (Mo, 04 Feb 2008) $ -- $LastChangedRevision:962 $ -- $LastChangedBy:ray $ --------------------------------------------------------------------------*/ body { background: #fff; color: #000; margin: 10px; } body, th, td { font: normal 13px verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif; } h1, h2, h3, h4 { font-family: arial,verdana,'Bitstream Vera Sans',helvetica,sans-serif; font-weight: bold; letter-spacing: -0.018em; } h1 { font-size: 21px; margin: .15em 1em 0 0 } h2 { font-size: 16px; margin: 2em 0 .5em; } h3 { font-size: 14px; margin: 1.5em 0 .5em; } hr { border: none; border-top: 1px solid #ccb; margin: 2em 0; } address { font-style: normal } img { border: none } :link, :visited { text-decoration: none; color: #b00; border-bottom: 1px dotted #bbb; } :link:hover, :visited:hover { background-color: #eee; color: #555; } h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited, h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited { color: inherit; } .area_holder { margin:10px; } label {font-size: 11px;} .navi_links { width: 177px; margin: 0; padding: 0px; list-style:none; border: none; } .navi_links li { margin:0 0 3px 0; } .navi_links li a { font-size: 13px; line-height: 16px; height: 16px; display:block; color:#000; text-decoration: none; font-weight: bold; background-color: #fff; cursor: pointer; border: 2px solid white; } .Link1 { background-color: #DF1D1F !important; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/files/full_example.css
CSS
art
1,854
<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN"> <html> <head> <!-- --------------------------------------------------------------------- -- $HeadURL: http://svn.xinha.org/trunk/examples/files/ext_example-body.html $ -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ -- $LastChangedRevision: 1084 $ -- $LastChangedBy: ray $ ------------------------------------------------------------------------ --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Example of Xinha</title> <link rel="stylesheet" type="text/css" href="full_example.css" /> <script type="text/javascript"> function showError( sMsg, sUrl, sLine){ document.getElementById('errors').value += 'Error: ' + sMsg + '\n' + 'Source File: ' + sUrl + '\n' + 'Line: ' + sLine + '\n'; return false; } // You must set _editor_url to the URL (including trailing slash) where // where xinha is installed, it's highly recommended to use an absolute URL // eg: _editor_url = "/path/to/xinha/"; // You may try a relative URL if you wish] // eg: _editor_url = "../"; // in this example we do a little regular expression to find the absolute path. _editor_url = document.location.href.replace(/examples\/files\/ext_example-body\.html.*/, '') //moved _editor_lang & _editor_skin to init function because of error thrown when frame document not ready </script> <!-- Load up the actual editor core --> <script type="text/javascript" src="../../XinhaCore.js"></script> <script type="text/javascript"> xinha_editors = null; xinha_init = null; xinha_config = null; xinha_plugins = null; xinha_init = xinha_init ? xinha_init : function() { window.onerror = showError; document.onerror = showError; var f = top.frames["menu"].document.forms["fsettings"]; _editor_lang = f.lang[f.lang.selectedIndex].value; // the language we need to use in the editor. _editor_skin = f.skin[f.skin.selectedIndex].value; // the skin we use in the editor // What are the plugins you will be using in the editors on this page. // List all the plugins you will need, even if not all the editors will use all the plugins. xinha_plugins = [ ]; for(var x = 0; x < f.plugins.length; x++) { if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value); } // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; // What are the names of the textareas you will be turning into editors? var num = 1; num = parseInt(f.num.value); if(isNaN(num)) { num = 1; f.num.value = 1; } var dest = document.getElementById("editors_here"); var lipsum = window.parent.menu.document.getElementById('myTextarea0').value; xinha_editors = [ ] for(var x = 0; x < num; x++) { var ta = 'myTextarea' + x; xinha_editors.push(ta); var div = document.createElement('div'); div.className = 'area_holder'; var txta = document.createElement('textarea'); txta.id = ta; txta.name = ta; txta.value = lipsum; txta.style.width="100%"; txta.style.height="420px"; div.appendChild(txta); dest.appendChild(div); } // Create a default configuration to be used by all the editors. settings = top.frames["menu"].settings; xinha_config = new Xinha.Config(); xinha_config.width = settings.width; xinha_config.height = settings.height; xinha_config.sizeIncludesBars = settings.sizeIncludesBars; xinha_config.sizeIncludesPanels = settings.sizeIncludesPanels; xinha_config.statusBar = settings.statusBar; xinha_config.htmlareaPaste = settings.htmlareaPaste; xinha_config.mozParaHandler = settings.mozParaHandler; xinha_config.getHtmlMethod = settings.getHtmlMethod; xinha_config.undoSteps = settings.undoSteps; xinha_config.undoTimeout = settings.undoTimeout; xinha_config.changeJustifyWithDirection = settings.changeJustifyWithDirection; xinha_config.fullPage = settings.fullPage; xinha_config.pageStyle = settings.pageStyle; xinha_config.baseHref = settings.baseHref; xinha_config.expandRelativeUrl = settings.expandRelativeUrl; xinha_config.stripBaseHref = settings.stripBaseHref; xinha_config.stripSelfNamedAnchors = settings.stripSelfNamedAnchors; xinha_config.only7BitPrintablesInURLs = settings.only7BitPrintablesInURLs; xinha_config.sevenBitClean = settings.sevenBitClean; xinha_config.killWordOnPaste = settings.killWordOnPaste; xinha_config.makeLinkShowsTarget = settings.makeLinkShowsTarget; xinha_config.flowToolbars = settings.flowToolbars; xinha_config.stripScripts = settings.stripScripts; xinha_config.flowToolbars = settings.flowToolbars; xinha_config.showLoading = settings.showLoading; xinha_config.pageStyleSheets = ["full_example.css"]; // Create a default configuration for the plugins if (typeof CharCounter != 'undefined') { xinha_config.CharCounter.showChar = settings.showChar; xinha_config.CharCounter.showWord = settings.showWord; xinha_config.CharCounter.showHtml = settings.showHtml; } if(typeof CharacterMap != 'undefined') xinha_config.CharacterMap.mode = settings.CharacterMapMode; if(typeof ListType != 'undefined') xinha_config.ListType.mode = settings.ListTypeMode; if(typeof CSS != 'undefined') xinha_config.pageStyle = xinha_config.pageStyle + "\n" + "@import url(custom.css);"; if(typeof DynamicCSS != 'undefined') xinha_config.pageStyle = "@import url(dynamic.css);"; if(typeof Filter != 'undefined') xinha_config.Filters = ["Word", "Paragraph"]; if(typeof Stylist != 'undefined') { // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL // otherwise it won't work! xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); // Or we can load styles directly xinha_config.stylistLoadStyles('p.red_text { color:red }'); // If you want to provide "friendly" names you can do so like // (you can do this for stylistLoadStylesheet as well) xinha_config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'}); } if(typeof InsertWords != 'undefined') { // Register the keyword/replacement list var keywrds1 = new Object(); var keywrds2 = new Object(); keywrds1['-- Dropdown Label --'] = ''; keywrds1['onekey'] = 'onevalue'; keywrds1['twokey'] = 'twovalue'; keywrds1['threekey'] = 'threevalue'; keywrds2['-- Insert Keyword --'] = ''; keywrds2['Username'] = '%user%'; keywrds2['Last login date'] = '%last_login%'; xinha_config.InsertWords = { combos : [ { options: keywrds1, context: "body" }, { options: keywrds2, context: "li" } ] } } // First create editors for the textareas. // You can do this in two ways, either // xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); // if you want all the editor objects to use the same set of plugins, OR; // xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); // xinha_editors['myTextarea0'].registerPlugins(['Stylist']); // xinha_editors['myTextarea1'].registerPlugins(['CSS','SuperClean']); // if you want to use a different set of plugins for one or more of the editors. xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); // If you want to change the configuration variables of any of the editors, // this is the place to do that, for example you might want to // change the width and height of one of the editors, like this... // xinha_editors['myTextarea0'].config.width = '640px'; // xinha_editors['myTextarea0'].config.height = '480px'; // Finally we "start" the editors, this turns the textareas into Xinha editors. Xinha.startEditors(xinha_editors); } // javascript submit handler // this shows how to create a javascript submit button that works with the htmleditor. submitHandler = function(formname) { var form = document.getElementById(formname); // in order for the submit to work both of these methods have to be called. form.onsubmit(); window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value; form.submit(); return true; } window.onload = xinha_init; // window.onunload = Xinha.collectGarbageForIE; </script> </head> <body> <form id="to_submit" name="to_submit" method="post" action="ext_example-dest.php"> <div id="editors_here"></div> <button type="button" onclick="submitHandler('to_submit');">Submit</button> <textarea id="errors" name="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;" --> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/files/ext_example-body.html
HTML
art
9,496
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Example of Xinha</title> <link rel="stylesheet" href="full_example.css" /> </head> <body> <?php if (get_magic_quotes_gpc()) { $_REQUEST = array_map('stripslashes',$_REQUEST); } // or in php.ini //; Magic quotes for incoming GET/POST/Cookie data. //magic_quotes_gpc = Off foreach($_REQUEST as $key=>$value){ if(substr($key,0,10) == 'myTextarea') { echo '<h3 style="border-bottom:1px solid black;">'.$key.'(source):</h3><xmp style="border:1px solid black; width: 100%; height: 200px; overflow: auto;">'.$value.'</xmp><br/>'; echo '<h3 style="border-bottom:1px solid black;">'.$key.'(preview):</h3>'.$value; } } ?> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/files/ext_example-dest.php
PHP
art
751
<html> <head> <title>Settings</title> <link rel="stylesheet" type="text/css" href="../../popups/popup.css" /> <script type="text/javascript"> function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; function getSelectedValue(el) { if(!el) return ""; return el[el.selectedIndex].value; } function setSelectedValue(el, val) { if(!el) return ""; var ops = el.getElementsByTagName("option"); for (var i = ops.length; --i >= 0;) { var op = ops[i]; op.selected = (op.value == val); } el.value = val; } function getCheckedValue(el) { if(!el) return ""; var radioLength = el.length; if(radioLength == undefined) if(el.checked) return el.value; else return "false"; for(var i = 0; i < radioLength; i++) { if(el[i].checked) { return el[i].value; } } return ""; } function setCheckedValue(el, val) { if(!el) return; var radioLength = el.length; if(radioLength == undefined) { el.checked = (el.value == val.toString()); return; } for(var i = 0; i < radioLength; i++) { el[i].checked = false; if(el[i].value == val.toString()) { el[i].checked = true; } } } function __dlg_onclose() { opener.Dialog._return(null); }; // closes the dialog and passes the return info upper. function __dlg_close(val) { opener.Dialog._return(val); window.close(); }; function __dlg_close_on_esc(ev) { ev || (ev = window.event); if (ev.keyCode == 27) { window.close(); return false; } return true; }; function __dlg_init(bottom) { var body = document.body; var body_height = 0; if (typeof bottom == "undefined") { var div = document.createElement("div"); body.appendChild(div); var pos = getAbsolutePos(div); body_height = pos.y; } else { var pos = getAbsolutePos(bottom); body_height = pos.y + bottom.offsetHeight; } if (!window.dialogArguments && opener.Dialog._arguments) { window.dialogArguments = opener.Dialog._arguments; } if (!document.all) { window.sizeToContent(); window.sizeToContent(); // for reasons beyond understanding, // only if we call it twice we get the // correct size. window.addEventListener("unload", __dlg_onclose, true); window.innerWidth = body.offsetWidth + 5; window.innerHeight = body_height + 2; // center on parent var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; window.moveTo(x, y); } else { // window.dialogHeight = body.offsetHeight + 50 + "px"; // window.dialogWidth = body.offsetWidth + "px"; window.resizeTo(body.offsetWidth, body_height); var ch = body.clientHeight; var cw = body.clientWidth; window.resizeBy(body.offsetWidth - cw, body_height - ch); var W = body.offsetWidth; var H = 2 * body_height - ch; var x = (screen.availWidth - W) / 2; var y = (screen.availHeight - H) / 2; window.moveTo(x, y); } document.body.onkeypress = __dlg_close_on_esc; }; function placeFocus() { var bFound = false; // for each form for (f=0; f < document.forms.length; f++) { // for each element in each form for(i=0; i < document.forms[f].length; i++) { // if it's not a hidden element if (document.forms[f][i].type != "hidden") { // and it's not disabled if (document.forms[f][i].disabled != true) { // set the focus to it document.forms[f][i].focus(); var bFound = true; } } // if found in this element, stop looking if (bFound == true) break; } // if found in this form, stop looking if (bFound == true) break; } } function Init() { __dlg_init(); var param = window.dialogArguments; if(param) { var el; for (var field in param) { //alert(field + '="' + param[field] + '"'); el = document.getElementById(field); if (el.tagName.toLowerCase()=="input"){ if ((el.type.toLowerCase()=="radio") || (el.type.toLowerCase()=="checkbox")){ setCheckedValue(el, param[field]); } else { el.value = param[field]; } } else if (el.tagName.toLowerCase()=="select"){ setSelectedValue(el, param[field]); } else if (el.tagName.toLowerCase()=="textarea"){ el.value = param[field]; } } } placeFocus(); }; // pass data back to the calling window function onOK() { var param = new Object(); var el = document.getElementsByTagName('input'); for (var i=0; i<el.length;i++){ if ((el[i].type.toLowerCase()=="radio") || (el[i].type.toLowerCase()=="checkbox")){ if (getCheckedValue(el[i])!=''){ param[el[i].id] = getCheckedValue(el[i]); } } else { param[el[i].id] = el[i].value; } } el = document.getElementsByTagName('select'); for (var i=0; i<el.length;i++){ param[el[i].id] = getSelectedValue(el[i]); } el = document.getElementsByTagName('textarea'); for (var i=0; i<el.length;i++){ param[el[i].id] = el[i].value; } __dlg_close(param); return false; }; function onCancel() { __dlg_close(null); return false; }; </script> <style type="text/css"> label { width: 16em; float: left; padding: 2px 5px; text-align: right; } br { clear: both; } </style> </head> <body class="dialog" onload="Init(); window.resizeTo(420, 820);"> <div class="title">Settings</div> <form action="" method="get"> <fieldset> <legend>Xinha options</legend> <label for="width">Editor width:</label> <input type="text" name="width" id="width" title="Allowed values are 'auto', 'toolbar' or a numeric value followed by 'px'." /><br /> <label for="height">Editor height:</label> <input type="text" name="height" id="height" title="Allowed values are 'auto' or a numeric value followed by 'px'." /><br /> <label for="sizeIncludesBars">Size includes bars</label> <input type="checkbox" name="sizeIncludesBars" id="sizeIncludesBars" value="true" title="Specifies whether the toolbar should be included in the size, or are extra to it." /><br /> <label for="sizeIncludesPanels">Size includes panels</label> <input type="checkbox" name="sizeIncludesPanels" id="sizeIncludesPanels" value="true" title="Specifies whether the panels should be included in the size, or are extra to it." /><br /> <label for="statusBar">Status Bar</label> <input type="checkbox" name="statusBar" id="statusBar" value="true" title="Enable creation of the status bar?" /><br /> <label for="htmlareaPaste">Htmlarea Paste</label> <input type="checkbox" name="htmlareaPaste" id="htmlareaPaste" value="true" title="Intercept ^V and use the Xinha paste command" /><br /> <label for="mozParaHandler">Mozilla Parameter Handler:</label> <select name="mozParaHandler" id="mozParaHandler" title="Gecko only: Let the built-in routine for handling the return key decide if to enter br or p tags or use a custom implementation."> <option value="built-in">built-in</option> <option value="dirty">dirty</option> <option value="best">best</option> </select><br /> <label for="getHtmlMethod">GetHtml Method:</label> <select name="getHtmlMethod" id="getHtmlMethod" title="This determines the method how the HTML output is generated."> <option value="DOMwalk">DOMwalk</option> <option value="TransformInnerHTML">TransformInnerHTML</option> </select><br /> <label for="undoSteps">Undo steps:</label> <input type="text" name="undoSteps" id="undoSteps" title="Maximum size of the undo queue." /><br /> <label for="undoTimeout">Undo Timeout:</label> <input type="text" name="undoTimeout" id="undoTimeout" title="The time interval at which undo samples are taken, default: 500 (1/2 sec)." /><br /> <label for="changeJustifyWithDirection">change justify with direction</label> <input type="checkbox" name="changeJustifyWithDirection" id="changeJustifyWithDirection" value="true" title="Set this to true if you want to explicitly right-justify when setting the text direction to right-to-left" /><br /> <label for="fullPage">full Page</label> <input type="checkbox" name="fullPage" id="fullPage" value="true" title="If true then Xinha will retrieve the full HTML, starting with the HTML-tag." /><br /> <label for="pageStyle">Page style:</label> <textarea name="pageStyle" id="pageStyle" title="Raw style definitions included in the edited document"></textarea> <!-- pageStyleSheets --> <label for="baseHref">Base href:</label> <input type="text" name="baseHref" id="baseHref" title="specify a base href for relative links" /><br /> <label for="expandRelativeUrl">expand relative Url</label> <input type="checkbox" name="expandRelativeUrl" id="expandRelativeUrl" value="true" title="If true, relative URLs (../) will be made absolute"/><br /> <label for="stripBaseHref">Strip base href</label> <input type="checkbox" name="stripBaseHref" id="stripBaseHref" value="true" title="We can strip the server part out of URL to make/leave them semi-absolute" /><br /> <label for="stripSelfNamedAnchors">Strip self named anchors</label> <input type="checkbox" name="stripSelfNamedAnchors" id="stripSelfNamedAnchors" value="true" title="We can strip the url of the editor page from named links" /><br /> <label for="only7BitPrintablesInURLs">only 7bit printables in URLs</label> <input type="checkbox" name="only7BitPrintablesInURLs" id="only7BitPrintablesInURLs" value="true" title="In URLs all characters above ASCII value 127 have to be encoded using % codes" /><br /> <label for="sevenBitClean">7bit Clean</label> <input type="checkbox" name="sevenBitClean" id="sevenBitClean" value="true" title="If you are putting the HTML written in Xinha into an email you might want it to be 7-bit characters only." /><br /> <label for="killWordOnPaste">kill Word on paste</label> <input type="checkbox" name="killWordOnPaste" id="killWordOnPaste" value="true" title="Set to true if you want Word code to be cleaned upon Paste." /><br /> <label for="makeLinkShowsTarget">make Link Shows Target</label> <input type="checkbox" name="makeLinkShowsTarget" id="makeLinkShowsTarget" value="true" title="Enable the 'Target' field in the Make Link dialog." /><br /> <label for="flowToolbars">flow toolbars</label> <input type="checkbox" name="flowToolbars" id="flowToolbars" value="true" /><br /> <label for="stripScripts">strip Scripts</label> <input type="checkbox" name="stripScripts" id="stripScripts" value="true" title="Set to false if you want to allow JavaScript in the content" /><br /> <label for="showLoading">show loading</label> <input type="checkbox" name="showLoading" id="showLoading" value="true" /><br /> </fieldset> <fieldset id="CharacterMapOptions" class="options"> <legend>CharacterMap options</legend> <label for="CharacterMapMode">Mode :</label> <select id="CharacterMapMode" name="CharacterMapMode"> <option value="popup">popup</option> <option value="panel">panel</option> </select> </fieldset> <fieldset id="ListTypeOptions" class="options"> <legend>ListType options</legend> <label class="ListTypeMode">Mode :</label> <select id="ListTypeMode" name="ListTypeMode"> <option value="toolbar">toolbar</option> <option value="panel">panel</option> </select> </fieldset> <fieldset id="CharCounterOptions" class="options"> <legend>CharCounter options</legend> <label for="showChar">show Char :</label> <input type="checkbox" name="showChar" id="showChar" value="true" /><br /> <label for="showWord">show Word :</label> <input type="checkbox" name="showWord" id="showWord" value="true" /><br /> <label for="showHtml">show Html :</label> <input type="checkbox" name="showHtml" id="showHtml" value="true" /><br /> </fieldset> <br /> <div id="buttons"> <button type="submit" name="ok" onclick="return onOK();">OK</button> <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> </div> </form> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/files/Extended.html
HTML
art
12,652
<?php $LocalPluginPath = dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'plugins'; $LocalSkinPath = dirname(dirname(dirname(__File__))).DIRECTORY_SEPARATOR.'skins'; ?> <html> <head> <!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- -- Xinha example menu. This file is used by full_example.html within a -- frame to provide a menu for generating example editors using -- full_example-body.html, and full_example.js. -- -- $HeadURL: http://svn.xinha.org/trunk/examples/files/ext_example-menu.php $ -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ -- $LastChangedRevision: 1084 $ -- $LastChangedBy: ray $ ---------------------------------------------------------------------------> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Example of Xinha</title> <link rel="stylesheet" href="full_example.css" /> <style type="text/css"> h1 {font: bold 22px "Staccato222 BT", cursive;} form, p {margin: 0px; padding: 0px;} label { display:block;} </style> <script language="JavaScript" type="text/javascript"> var settings = null; settings = { width: "auto", height: "auto", sizeIncludesBars: true, sizeIncludesPanels: true, statusBar: true, htmlareaPaste: false, mozParaHandler: "best", getHtmlMethod: "DOMwalk", undoSteps: 20, undoTimeout: 500, changeJustifyWithDirection: false, fullPage: false, pageStyle: "", baseHref: null, expandRelativeUrl: true, stripBaseHref: true, stripSelfNamedAnchors: true, only7BitPrintablesInURLs: true, sevenBitClean: false, killWordOnPaste: true, makeLinkShowsTarget: true, flowToolbars: true, stripScripts: false, CharacterMapMode: "popup", ListTypeMode: "toolbar", showLoading: false, showChar: true, showWord: true, showHtml: true }; function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function getCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function setCookie (name, value) { var argv = setCookie.arguments; var argc = setCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function _onResize() { var sHeight; if (window.innerHeight) sHeight = window.innerHeight; else if (document.body && document.body.offsetHeight) sHeight = document.body.offsetHeight; else return; if (sHeight>270) { sHeight = sHeight - 245; } else { sHeight = 30 } var div = document.getElementById("div_plugins"); div.style.height = sHeight + "px"; } function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } if (typeof window.showModalDialog == 'function') { Dialog._return = action; var r = window.showModalDialog(url, init, "dialogheight=10;dialogheight=10;scroll=yes;resizable=yes"); } else { Dialog._geckoOpenModal(url, action, init); } }; Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); if (Dialog._modal && !Dialog._modal.closed) { agt = navigator.userAgent.toLowerCase(); is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); if (is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } } }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; Dialog._geckoOpenModal = function(url, action, init) { var dlg = window.open(url, "hadialog", "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // capture some window's events function capwin(w) { // Xinha._addEvent(w, "click", Dialog._parentEvent); // Xinha._addEvent(w, "mousedown", Dialog._parentEvent); // Xinha._addEvent(w, "focus", Dialog._parentEvent); }; // release the captured events function relwin(w) { // Xinha._removeEvent(w, "click", Dialog._parentEvent); // Xinha._removeEvent(w, "mousedown", Dialog._parentEvent); // Xinha._removeEvent(w, "focus", Dialog._parentEvent); }; capwin(window); // capture other frames for (var i = 0; i < window.frames.length; capwin(window.frames[i++])); // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } relwin(window); // capture other frames for (var i = 0; i < window.frames.length; relwin(window.frames[i++])); Dialog._modal = null; }; }; function fExtended () { Dialog("Extended.html", function(param) { if(param) { settings.width = param["width"]; settings.height = param["height"]; settings.sizeIncludesBars = (param["sizeIncludesBars"]=="true"); settings.sizeIncludesPanels = (param["sizeIncludesPanels"]=="true"); settings.statusBar = (param["statusBar"]=="true"); settings.htmlareaPaste = (param["htmlareaPaste"]=="true"); settings.mozParaHandler = param["mozParaHandler"]; settings.getHtmlMethod = param["getHtmlMethod"]; settings.undoSteps = param["undoSteps"]; settings.undoTimeout = param["undoTimeout"]; settings.changeJustifyWithDirection = (param["changeJustifyWithDirection"]=="true"); settings.fullPage = (param["fullPage"]=="true"); settings.pageStyle = param["pageStyle"]; settings.baseHref = param["baseHref"]; settings.expandRelativeUrl = (param["expandRelativeUrl"]=="true"); settings.stripBaseHref = (param["stripBaseHref"]=="true"); settings.stripSelfNamedAnchors = (param["stripSelfNamedAnchors"]=="true"); settings.only7BitPrintablesInURLs = (param["only7BitPrintablesInURLs"]=="true"); settings.sevenBitClean = (param["sevenBitClean"]=="true"); settings.killWordOnPaste = (param["killWordOnPaste"]=="true"); settings.makeLinkShowsTarget = (param["makeLinkShowsTarget"]=="true"); settings.flowToolbars = (param["flowToolbars"]=="true"); settings.stripScripts = (param["stripScripts"]=="true"); settings.CharacterMapMode = param["CharacterMapMode"]; settings.ListTypeMode = param["ListTypeMode"]; settings.showLoading = (param["showLoading"]=="true"); settings.showChar = (param["showChar"]=="true"); settings.showWord = (param["showWord"]=="true"); settings.showHtml = (param["showHtml"]=="true"); } }, settings ); } function init(){ var co = getCookie('co_ext_Xinha'); if(co!=null){ var co_values; var co_entries = co.split('###'); for (var i in co_entries) { co_values = co_entries[i].split('='); if(co_values[0]=='plugins') { for(var x = 0; x < document.forms[0].plugins.length; x++) { if(co_values[1].indexOf(document.forms[0].plugins[x].value)!=-1) { document.forms[0].plugins[x].checked = true; } } } else if(co_values[0]!='') { document.getElementById(co_values[0]).value = co_values[1]; } } } _onResize(); }; window.onresize = _onResize; window.onload = init; </script> </head> <body> <form action="ext_example-body.html" target="body" name="fsettings" id="fsettings"> <h1>Xinha Example</h1> <fieldset> <legend>Settings</legend> <label> Number of Editors: <input type="text" name="num" id="num" value="1" style="width:25;" maxlength="2"/> </label> <label> Language: <select name="lang" id="lang"> <option value="en">English</option> <option value="de">German</option> <option value="fr">French</option> <option value="it">Italian</option> <option value="no">Norwegian</option> <option value="pl">Polish</option> <option value="ja">Japanese</option> </select> </label> <label> Skin: <select name="skin" id="skin"> <option value="">-- no skin --</option> <?php $d = @dir($LocalSkinPath); while (false !== ($entry = $d->read())) //not a dot file or directory { if(substr($entry,0,1) != '.') { echo '<option value="' . $entry . '"> ' . $entry . '</option>'."\n"; } } $d->close(); ?> </select> </label> <center><input type="button" value="extended Settings" onClick="fExtended();" /></center> </fieldset> <fieldset> <legend>Plugins</legend> <div id="div_plugins" style="width:100%; overflow:auto"> <?php $d = @dir($LocalPluginPath); $dir_array = array(); while (false !== ($entry = $d->read())) //not a dot file or directory { if(substr($entry,0,1) != '.') { $dir_array[] = $entry; } } $d->close(); sort($dir_array); foreach ($dir_array as $entry) { echo '<label><input type="checkbox" name="plugins" id="plugins" value="' . $entry . '"> ' . $entry . '</label>'."\n"; } ?> </div> </fieldset> <center><button type="submit">reload editor</button></center> <textarea id="myTextarea0" style="display:none"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique ante elementum turpis. Aliquam nisl. Nulla posuere neque non tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. Curabitur pharetra bibendum lectus.</p> <ul> <li> Phasellus et massa sed diam viverra semper. </li> <li> Mauris tincidunt felis in odio. </li> <li> Nulla placerat nunc ut pede. </li> <li> Vivamus ultrices mi sit amet urna. </li> <li> Quisque sed augue quis nunc laoreet volutpat.</li> <li> Nunc sit amet metus in tortor semper mattis. </li> </ul> </textarea> </form> <script type="text/javascript"> top.frames["body"].location.href = document.location.href.replace(/ext_example-menu\.php.*/, 'ext_example-body.html') var _oldSubmitHandler = null; if (document.forms[0].onsubmit != null) { _oldSubmitHandler = document.forms[0].onsubmit; } function frame_onSubmit(){ var thenewdate = new Date (); thenewdate.setTime(thenewdate.getTime() + (5*24*60*60*1000)); var co_value = 'skin=' + document.getElementById('skin').options[document.getElementById('skin').selectedIndex].value + '###' + 'lang=' + document.getElementById('lang').options[document.getElementById('lang').selectedIndex].value + '###' + 'num=' + document.getElementById('num').value + '###'; var s_value=''; for(var x = 0; x < document.forms[0].plugins.length; x++) { if(document.forms[0].plugins[x].checked) s_value += document.forms[0].plugins[x].value + '/'; } if(s_value!='') { co_value += 'plugins=' + s_value + '###' } setCookie('co_ext_Xinha', co_value, thenewdate); if (_oldSubmitHandler != null) { _oldSubmitHandler(); } } document.forms[0].onsubmit = frame_onSubmit; </script> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/examples/files/ext_example-menu.php
PHP
art
12,719
var Xinha = {}; // Auto detect _editor_url if it's not set. if (!window._editor_url) { (function() // wrap this in an ad-hoc function to avoid unecessary pollution of global namespace { // Because of the way the DOM is loaded, this is guaranteed to always pull our script tag. var scripts = document.getElementsByTagName('script'); var this_script = scripts[scripts.length - 1]; // We'll allow two ways to specify arguments. We'll accept them in the // argument of the script, or we'll accept them embedded into our script tag. var args = this_script.src.split('?'); args = args.length == 2 ? args[1].split('&') : ''; for (var index = 0; index < args.length; ++index) { var arg = args[index].split('='); if (arg.length == 2) { switch (arg[0]) { case 'lang': case 'icons': case 'skin': case 'url': window['_editor_' + arg[0]] = arg[1]; break; } } } // We can grab the script innerHTML and execute that to cut down on script // tags. Thanks John Resig! // http://ejohn.org/blog/degrading-script-tags/ if (this_script.innerHTML.replace(/\s+/, '')) { eval(this_script.innerHTML); } // Default values _editor_lang = window._editor_lang || 'en'; // Chop off any query string. Chop the filename off of the URL. _editor_url = window._editor_url || this_script.src.split('?')[0].split('/').slice(0, -1).join('/'); })() } _editor_url = _editor_url.replace(/\x2f*$/, '/'); Xinha.agt = navigator.userAgent.toLowerCase(); Xinha.is_ie = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); Xinha.ie_version= parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5)); Xinha.is_opera = (Xinha.agt.indexOf("opera") != -1); Xinha.is_khtml = (Xinha.agt.indexOf("khtml") != -1); Xinha.is_webkit = (Xinha.agt.indexOf("applewebkit") != -1); Xinha.is_safari = (Xinha.agt.indexOf("safari") != -1); Xinha.opera_version = navigator.appVersion.substring(0, navigator.appVersion.indexOf(" "))*1; Xinha.is_mac = (Xinha.agt.indexOf("mac") != -1); Xinha.is_mac_ie = (Xinha.is_ie && Xinha.is_mac); Xinha.is_win_ie = (Xinha.is_ie && !Xinha.is_mac); Xinha.is_gecko = (navigator.product == "Gecko" && !Xinha.is_safari); // Safari lies! Xinha.isRunLocally = document.URL.toLowerCase().search(/^file:/) != -1; Xinha.is_designMode = (typeof document.designMode != 'undefined' && !Xinha.is_ie); // IE has designMode, but we're not using it Xinha.isSupportedBrowser = Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5 || Xinha.is_safari; Xinha.loadPlugins = function(plugins, callbackIfNotReady) { if ( !Xinha.isSupportedBrowser ) return; Xinha.loadStyle(typeof _editor_css == "string" ? _editor_css : "Xinha.css","XinhaCoreDesign"); Xinha.createLoadingMessages(xinha_editors); var loadingMessages = Xinha.loadingMessages; Xinha._loadback(_editor_url + "XinhaCore.js",function () { Xinha.removeLoadingMessages(xinha_editors); Xinha.createLoadingMessages(xinha_editors); callbackIfNotReady() }); return false; } Xinha._loadback = function(Url, Callback, Scope, Bonus) { var T = !Xinha.is_ie ? "onload" : 'onreadystatechange'; var S = document.createElement("script"); S.type = "text/javascript"; S.src = Url; if ( Callback ) { S[T] = function() { if ( Xinha.is_ie && ( ! ( /loaded|complete/.test(window.event.srcElement.readyState) ) ) ) { return; } Callback.call(Scope ? Scope : this, Bonus); S[T] = null; }; } document.getElementsByTagName("head")[0].appendChild(S); }; Xinha.getElementTopLeft = function(element) { var curleft = 0; var curtop = 0; if (element.offsetParent) { curleft = element.offsetLeft curtop = element.offsetTop while (element = element.offsetParent) { curleft += element.offsetLeft curtop += element.offsetTop } } return { top:curtop, left:curleft }; } // find X position of an element Xinha.findPosX = function(obj) { var curleft = 0; if ( obj.offsetParent ) { return Xinha.getElementTopLeft(obj).left; } else if ( obj.x ) { curleft += obj.x; } return curleft; }; // find Y position of an element Xinha.findPosY = function(obj) { var curtop = 0; if ( obj.offsetParent ) { return Xinha.getElementTopLeft(obj).top; } else if ( obj.y ) { curtop += obj.y; } return curtop; }; Xinha.createLoadingMessages = function(xinha_editors) { if ( Xinha.loadingMessages || !Xinha.isSupportedBrowser ) { return; } Xinha.loadingMessages = []; for (var i=0;i<xinha_editors.length;i++) { if (!document.getElementById(xinha_editors[i])) { continue; } Xinha.loadingMessages.push(Xinha.createLoadingMessage(document.getElementById(xinha_editors[i]))); } } Xinha.createLoadingMessage = function(textarea,text) { if ( document.getElementById("loading_" + textarea.id) || !Xinha.isSupportedBrowser) { return; } // Create and show the main loading message and the sub loading message for details of loading actions // global element var loading_message = document.createElement("div"); loading_message.id = "loading_" + textarea.id; loading_message.className = "loading"; loading_message.style.left = (Xinha.findPosX(textarea) + textarea.offsetWidth / 2) - 106 + 'px'; loading_message.style.top = (Xinha.findPosY(textarea) + textarea.offsetHeight / 2) - 50 + 'px'; // main static message var loading_main = document.createElement("div"); loading_main.className = "loading_main"; loading_main.id = "loading_main_" + textarea.id; loading_main.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait!"))); // sub dynamic message var loading_sub = document.createElement("div"); loading_sub.className = "loading_sub"; loading_sub.id = "loading_sub_" + textarea.id; text = text ? text : Xinha._lc("Loading Core"); loading_sub.appendChild(document.createTextNode(text)); loading_message.appendChild(loading_main); loading_message.appendChild(loading_sub); document.body.appendChild(loading_message); return loading_sub; } Xinha.loadStyle = function(style, id) { var url = _editor_url || ''; url += style; var head = document.getElementsByTagName("head")[0]; var link = document.createElement("link"); link.rel = "stylesheet"; link.href = url; if (id) link.id = id; head.appendChild(link); }; Xinha._lc = function(string) {return string;} Xinha._addEvent = function(el, evname, func) { if ( document.addEventListener ) { el.addEventListener(evname, func, true); } else { el.attachEvent("on" + evname, func); } } Xinha.addOnloadHandler = function (func) { // Dean Edwards/Matthias Miller/John Resig // http://dean.edwards.name/weblog/2006/06/again/ // IE part from jQuery var init = function () { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (Xinha.onloadTimer) clearInterval(Xinha.onloadTimer); func.call(); } if (Xinha.is_ie) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", function(){ if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", arguments.callee ); init(); } }); if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){ if (arguments.callee.done) return; try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions init(); })(); } else if (/WebKit/i.test(navigator.userAgent)) { Xinha.onloadTimer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { init(); // call the onload handler } }, 10); } else /* for Mozilla/Opera9 */ { document.addEventListener("DOMContentLoaded", init, false); } }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/XinhaLoader.js
JavaScript
art
8,515
<html><body onload="window.xinhaReadyToRoll = true;"></body></html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/popups/blank.html
HTML
art
67
html, body, .dialog { background: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0px; padding: 0px; } body { padding: 5px; } form { padding: 0px; margin: 0px; } form p { margin-top: 5px; margin-bottom: 5px; } table { font: 11px Tahoma,Verdana,sans-serif; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } button { width: 70px; } table .label { text-align: right; width: 8em; } .fl { width: 9em; float: left; padding: 2px 5px; text-align: right; } .fr { width: 7em; float: left; padding: 2px 5px; text-align: right; } fieldset { padding: 0px 10px 5px 5px; } .space { padding: 2px; } .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px; } .buttonColor { padding: 1px; cursor: default; border: 1px solid; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } #buttons { margin-top: 1em; border-top: 1px solid #999; padding: 1em; text-align: right; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/popups/popup.css
CSS
art
1,080
// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id:popup.js 929 2008-01-09 21:10:59Z ray $ if(typeof Xinha == 'undefined') Xinha = window.opener.Xinha; // Backward compatibility will be removed some time or not? HTMLArea = Xinha; function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; } function comboSelectValue(c, val) { var ops = c.getElementsByTagName("option"); for (var i = ops.length; --i >= 0;) { var op = ops[i]; op.selected = (op.value == val); } c.value = val; } function __dlg_onclose() { opener.Dialog._return(null); } // ray: I mark this on deprecated, because bottom is never used function __dlg_init( bottom, win_dim ) { __xinha_dlg_init(win_dim); } function __xinha_dlg_init( win_dim ) { if(window.__dlg_init_done) return true; if(window.opener._editor_skin) { var head = document.getElementsByTagName("head")[0]; var link = document.createElement("link"); link.type = "text/css"; link.href = window.opener._editor_url + 'skins/' + window.opener._editor_skin + '/skin.css'; link.rel = "stylesheet"; head.appendChild(link); } if (!window.dialogArguments && opener.Dialog._arguments) { window.dialogArguments = opener.Dialog._arguments; } var page = Xinha.pageSize(window); if ( !win_dim ) { win_dim = {width:page.x, height: page.y}; } window.resizeTo(win_dim.width, win_dim.height); var dim = Xinha.viewportSize(window); window.resizeBy(0, page.y - dim.y); if(win_dim.top && win_dim.left) { window.moveTo(win_dim.left,win_dim.top); } else { if (!Xinha.is_ie) { var x = opener.screenX + (opener.outerWidth - win_dim.width) / 2; var y = opener.screenY + (opener.outerHeight - win_dim.height) / 2; } else {//IE does not have window.outer... , so center it on the screen at least var x = (self.screen.availWidth - win_dim.width) / 2; var y = (self.screen.availHeight - win_dim.height) / 2; } window.moveTo(x,y); } Xinha.addDom0Event(document.body, 'keypress', __dlg_close_on_esc); window.__dlg_init_done = true; } function __dlg_translate(context) { var types = ["input", "select", "legend", "span", "option", "td", "th", "button", "div", "label", "a", "img"]; for (var type = 0; type < types.length; ++type) { var spans = document.getElementsByTagName(types[type]); for (var i = spans.length; --i >= 0;) { var span = spans[i]; if (span.firstChild && span.firstChild.data) { var txt = Xinha._lc(span.firstChild.data, context); if (txt) { span.firstChild.data = txt; } } if (span.title) { var txt = Xinha._lc(span.title, context); if (txt) { span.title = txt; } } if (span.tagName.toLowerCase() == 'input' && (/^(button|submit|reset)$/i.test(span.type))) { var txt = Xinha._lc(span.value, context); if (txt) { span.value = txt; } } } } document.title = Xinha._lc(document.title, context); } // closes the dialog and passes the return info upper. function __dlg_close(val) { opener.Dialog._return(val); window.close(); } function __dlg_close_on_esc(ev) { ev || (ev = window.event); if (ev.keyCode == 27) { __dlg_close(null); return false; } return true; }
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/popups/popup.js
JavaScript
art
3,716
<html> <head> <title>Editor Help</title> <script type="text/javascript" src="popup.js"></script> <link rel="stylesheet" type="text/css" href="popup.css" /> <script type="text/javascript"> window.resizeTo(400, 480); Xinha = window.opener.Xinha; function Init() { __dlg_translate('Xinha'); __dlg_init(); } function onCancel() { __dlg_close(null); return false; } </script> </head> <body class="dialog" onload="Init()"> <div class="title">Editor Help</div> <table width="100%" style="background: white none repeat scroll 0%;"> <thead style="border: 1px solid gray; background: silver none repeat scroll 0%;"> <tr> <th colspan="2"> <span style="text-align:center">Keyboard shortcuts</span><br /> <span>The editor provides the following key combinations:</span> </th> </tr> </thead> <tbody> <tr><td>ENTER</td><td><span>new paragraph</span>(&lt;P&gt;)</td></tr> <tr><td>SHIFT-ENTER</td><td><span>insert linebreak</span>(&lt;BR&gt;)</td></tr> <tr><td>CTRL-A</td><td><span>Select all</span></td></tr> <tr><td>CTRL-B</td><td><span>Bold</span></td></tr> <tr><td>CTRL-I</td><td><span>Italic</span></td></tr> <tr><td>CTRL-U</td><td><span>Underline</span></td></tr> <tr><td>CTRL-S</td><td><span>Strikethrough</span></td></tr> <tr><td>CTRL-L</td><td><span>Justify Left</span></td></tr> <tr><td>CTRL-E</td><td><span>Justify Center</span></td></tr> <tr><td>CTRL-R</td><td><span>Justify Right</span></td></tr> <tr><td>CTRL-J</td><td><span>Justify Full</span></td></tr> <tr><td>CTRL-Z</td><td><span>Undoes your last action</span></td></tr> <tr><td>CTRL-Y</td><td><span>Redoes your last action</span></td></tr> <tr><td>CTRL-N</td><td><span>Set format to paragraph</span></td></tr> <tr><td>CTRL-0 (zero)</td><td><span>Clean content pasted from Word</span></td></tr> <tr><td>CTRL-1 .. CTRL-6</td><td><span>Headings</span> (&lt;h1&gt; .. &lt;h6&gt;)</td></tr> <tr><td>CTRL-X</td><td><span>Cut selection</span></td></tr> <tr><td>CTRL-C</td><td><span>Copy selection</span></td></tr> <tr><td>CTRL-V</td><td><span>Paste from clipboard</span></td></tr> </tbody> </table> <div id="buttons"> <button type="button" name="cancel" onclick="return onCancel();">Close</button> </div> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/popups/editor_help.html
HTML
art
2,261
<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">--> <html><head><title>Select Color</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="popup.js"></script> <script type="text/javascript"> window.resizeTo(240, 182); // run on page load function Init() { __dlg_translate('Xinha'); __dlg_init(); Xinha.addDom0Event(document, 'keypress', __dlg_close_on_esc); var color = window.dialogArguments; color = ValidateColor(color) || '000000'; View(color); } // preview color function View(color) { document.getElementById("ColorPreview").style.backgroundColor = '#' + color; document.getElementById("ColorHex").value = '#' + color; } // select color function Set(string) { var color = ValidateColor(string); if (color == null) { alert("Invalid color code: " + string); } else { View(color); __dlg_close(color); } } // return valid color code function ValidateColor(string) { string = string || ''; string = string + ""; string = string.toUpperCase(); var chars = '0123456789ABCDEF'; var out = ''; // remove invalid color chars for (var i=0; i<string.length; i++) { var schar = string.charAt(i); if (chars.indexOf(schar) != -1) out += schar; } // check length if (out.length != 6) return null; return out; } </script> <style type="text/css"> body { background:buttonface; margin:0; padding:0; } form { margin:0; padding:0; } #containerpreview td { background:buttonface; } #preview { background-color:#000000; padding:1px; height:21px; width:50px; } #ColorPreview { height:100%; width:100%; } #ColorHex { font-size:12px; background:buttonface; border:0; } #palettecolor { cursor:pointer; } #palettecolor td { width:10px; height:10px; } </style> </head> <body class="dialog" onload="Init()"> <form action="#" method="get" onsubmit="Set(document.getElementById('ColorHex').value); return false;"> <table border="0" cellspacing="0" cellpadding="4" width="100%" id="containerpreview"> <tr> <td style="vertical-align: middle;"><div id="preview"><div id="ColorPreview"></div></div></td> <td style="vertical-align: middle;" width="100%"><input type="text" name="ColorHex" id="ColorHex" value="" size=15></td> </tr> </table> </form> <table id="palettecolor" border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#000000"> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#003300" onmouseover="View('003300')" onclick="Set('003300')"></td> <td bgcolor="#006600" onmouseover="View('006600')" onclick="Set('006600')"></td> <td bgcolor="#009900" onmouseover="View('009900')" onclick="Set('009900')"></td> <td bgcolor="#00CC00" onmouseover="View('00CC00')" onclick="Set('00CC00')"></td> <td bgcolor="#00FF00" onmouseover="View('00FF00')" onclick="Set('00FF00')"></td> <td bgcolor="#330000" onmouseover="View('330000')" onclick="Set('330000')"></td> <td bgcolor="#333300" onmouseover="View('333300')" onclick="Set('333300')"></td> <td bgcolor="#336600" onmouseover="View('336600')" onclick="Set('336600')"></td> <td bgcolor="#339900" onmouseover="View('339900')" onclick="Set('339900')"></td> <td bgcolor="#33CC00" onmouseover="View('33CC00')" onclick="Set('33CC00')"></td> <td bgcolor="#33FF00" onmouseover="View('33FF00')" onclick="Set('33FF00')"></td> <td bgcolor="#660000" onmouseover="View('660000')" onclick="Set('660000')"></td> <td bgcolor="#663300" onmouseover="View('663300')" onclick="Set('663300')"></td> <td bgcolor="#666600" onmouseover="View('666600')" onclick="Set('666600')"></td> <td bgcolor="#669900" onmouseover="View('669900')" onclick="Set('669900')"></td> <td bgcolor="#66CC00" onmouseover="View('66CC00')" onclick="Set('66CC00')"></td> <td bgcolor="#66FF00" onmouseover="View('66FF00')" onclick="Set('66FF00')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#333333" onmouseover="View('333333')" onclick="Set('333333')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000033" onmouseover="View('000033')" onclick="Set('000033')"></td> <td bgcolor="#003333" onmouseover="View('003333')" onclick="Set('003333')"></td> <td bgcolor="#006633" onmouseover="View('006633')" onclick="Set('006633')"></td> <td bgcolor="#009933" onmouseover="View('009933')" onclick="Set('009933')"></td> <td bgcolor="#00CC33" onmouseover="View('00CC33')" onclick="Set('00CC33')"></td> <td bgcolor="#00FF33" onmouseover="View('00FF33')" onclick="Set('00FF33')"></td> <td bgcolor="#330033" onmouseover="View('330033')" onclick="Set('330033')"></td> <td bgcolor="#333333" onmouseover="View('333333')" onclick="Set('333333')"></td> <td bgcolor="#336633" onmouseover="View('336633')" onclick="Set('336633')"></td> <td bgcolor="#339933" onmouseover="View('339933')" onclick="Set('339933')"></td> <td bgcolor="#33CC33" onmouseover="View('33CC33')" onclick="Set('33CC33')"></td> <td bgcolor="#33FF33" onmouseover="View('33FF33')" onclick="Set('33FF33')"></td> <td bgcolor="#660033" onmouseover="View('660033')" onclick="Set('660033')"></td> <td bgcolor="#663333" onmouseover="View('663333')" onclick="Set('663333')"></td> <td bgcolor="#666633" onmouseover="View('666633')" onclick="Set('666633')"></td> <td bgcolor="#669933" onmouseover="View('669933')" onclick="Set('669933')"></td> <td bgcolor="#66CC33" onmouseover="View('66CC33')" onclick="Set('66CC33')"></td> <td bgcolor="#66FF33" onmouseover="View('66FF33')" onclick="Set('66FF33')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#666666" onmouseover="View('666666')" onclick="Set('666666')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000066" onmouseover="View('000066')" onclick="Set('000066')"></td> <td bgcolor="#003366" onmouseover="View('003366')" onclick="Set('003366')"></td> <td bgcolor="#006666" onmouseover="View('006666')" onclick="Set('006666')"></td> <td bgcolor="#009966" onmouseover="View('009966')" onclick="Set('009966')"></td> <td bgcolor="#00CC66" onmouseover="View('00CC66')" onclick="Set('00CC66')"></td> <td bgcolor="#00FF66" onmouseover="View('00FF66')" onclick="Set('00FF66')"></td> <td bgcolor="#330066" onmouseover="View('330066')" onclick="Set('330066')"></td> <td bgcolor="#333366" onmouseover="View('333366')" onclick="Set('333366')"></td> <td bgcolor="#336666" onmouseover="View('336666')" onclick="Set('336666')"></td> <td bgcolor="#339966" onmouseover="View('339966')" onclick="Set('339966')"></td> <td bgcolor="#33CC66" onmouseover="View('33CC66')" onclick="Set('33CC66')"></td> <td bgcolor="#33FF66" onmouseover="View('33FF66')" onclick="Set('33FF66')"></td> <td bgcolor="#660066" onmouseover="View('660066')" onclick="Set('660066')"></td> <td bgcolor="#663366" onmouseover="View('663366')" onclick="Set('663366')"></td> <td bgcolor="#666666" onmouseover="View('666666')" onclick="Set('666666')"></td> <td bgcolor="#669966" onmouseover="View('669966')" onclick="Set('669966')"></td> <td bgcolor="#66CC66" onmouseover="View('66CC66')" onclick="Set('66CC66')"></td> <td bgcolor="#66FF66" onmouseover="View('66FF66')" onclick="Set('66FF66')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#999999" onmouseover="View('999999')" onclick="Set('999999')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#000099" onmouseover="View('000099')" onclick="Set('000099')"></td> <td bgcolor="#003399" onmouseover="View('003399')" onclick="Set('003399')"></td> <td bgcolor="#006699" onmouseover="View('006699')" onclick="Set('006699')"></td> <td bgcolor="#009999" onmouseover="View('009999')" onclick="Set('009999')"></td> <td bgcolor="#00CC99" onmouseover="View('00CC99')" onclick="Set('00CC99')"></td> <td bgcolor="#00FF99" onmouseover="View('00FF99')" onclick="Set('00FF99')"></td> <td bgcolor="#330099" onmouseover="View('330099')" onclick="Set('330099')"></td> <td bgcolor="#333399" onmouseover="View('333399')" onclick="Set('333399')"></td> <td bgcolor="#336699" onmouseover="View('336699')" onclick="Set('336699')"></td> <td bgcolor="#339999" onmouseover="View('339999')" onclick="Set('339999')"></td> <td bgcolor="#33CC99" onmouseover="View('33CC99')" onclick="Set('33CC99')"></td> <td bgcolor="#33FF99" onmouseover="View('33FF99')" onclick="Set('33FF99')"></td> <td bgcolor="#660099" onmouseover="View('660099')" onclick="Set('660099')"></td> <td bgcolor="#663399" onmouseover="View('663399')" onclick="Set('663399')"></td> <td bgcolor="#666699" onmouseover="View('666699')" onclick="Set('666699')"></td> <td bgcolor="#669999" onmouseover="View('669999')" onclick="Set('669999')"></td> <td bgcolor="#66CC99" onmouseover="View('66CC99')" onclick="Set('66CC99')"></td> <td bgcolor="#66FF99" onmouseover="View('66FF99')" onclick="Set('66FF99')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#CCCCCC" onmouseover="View('CCCCCC')" onclick="Set('CCCCCC')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#0000CC" onmouseover="View('0000CC')" onclick="Set('0000CC')"></td> <td bgcolor="#0033CC" onmouseover="View('0033CC')" onclick="Set('0033CC')"></td> <td bgcolor="#0066CC" onmouseover="View('0066CC')" onclick="Set('0066CC')"></td> <td bgcolor="#0099CC" onmouseover="View('0099CC')" onclick="Set('0099CC')"></td> <td bgcolor="#00CCCC" onmouseover="View('00CCCC')" onclick="Set('00CCCC')"></td> <td bgcolor="#00FFCC" onmouseover="View('00FFCC')" onclick="Set('00FFCC')"></td> <td bgcolor="#3300CC" onmouseover="View('3300CC')" onclick="Set('3300CC')"></td> <td bgcolor="#3333CC" onmouseover="View('3333CC')" onclick="Set('3333CC')"></td> <td bgcolor="#3366CC" onmouseover="View('3366CC')" onclick="Set('3366CC')"></td> <td bgcolor="#3399CC" onmouseover="View('3399CC')" onclick="Set('3399CC')"></td> <td bgcolor="#33CCCC" onmouseover="View('33CCCC')" onclick="Set('33CCCC')"></td> <td bgcolor="#33FFCC" onmouseover="View('33FFCC')" onclick="Set('33FFCC')"></td> <td bgcolor="#6600CC" onmouseover="View('6600CC')" onclick="Set('6600CC')"></td> <td bgcolor="#6633CC" onmouseover="View('6633CC')" onclick="Set('6633CC')"></td> <td bgcolor="#6666CC" onmouseover="View('6666CC')" onclick="Set('6666CC')"></td> <td bgcolor="#6699CC" onmouseover="View('6699CC')" onclick="Set('6699CC')"></td> <td bgcolor="#66CCCC" onmouseover="View('66CCCC')" onclick="Set('66CCCC')"></td> <td bgcolor="#66FFCC" onmouseover="View('66FFCC')" onclick="Set('66FFCC')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#FFFFFF" onmouseover="View('FFFFFF')" onclick="Set('FFFFFF')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#0000FF" onmouseover="View('0000FF')" onclick="Set('0000FF')"></td> <td bgcolor="#0033FF" onmouseover="View('0033FF')" onclick="Set('0033FF')"></td> <td bgcolor="#0066FF" onmouseover="View('0066FF')" onclick="Set('0066FF')"></td> <td bgcolor="#0099FF" onmouseover="View('0099FF')" onclick="Set('0099FF')"></td> <td bgcolor="#00CCFF" onmouseover="View('00CCFF')" onclick="Set('00CCFF')"></td> <td bgcolor="#00FFFF" onmouseover="View('00FFFF')" onclick="Set('00FFFF')"></td> <td bgcolor="#3300FF" onmouseover="View('3300FF')" onclick="Set('3300FF')"></td> <td bgcolor="#3333FF" onmouseover="View('3333FF')" onclick="Set('3333FF')"></td> <td bgcolor="#3366FF" onmouseover="View('3366FF')" onclick="Set('3366FF')"></td> <td bgcolor="#3399FF" onmouseover="View('3399FF')" onclick="Set('3399FF')"></td> <td bgcolor="#33CCFF" onmouseover="View('33CCFF')" onclick="Set('33CCFF')"></td> <td bgcolor="#33FFFF" onmouseover="View('33FFFF')" onclick="Set('33FFFF')"></td> <td bgcolor="#6600FF" onmouseover="View('6600FF')" onclick="Set('6600FF')"></td> <td bgcolor="#6633FF" onmouseover="View('6633FF')" onclick="Set('6633FF')"></td> <td bgcolor="#6666FF" onmouseover="View('6666FF')" onclick="Set('6666FF')"></td> <td bgcolor="#6699FF" onmouseover="View('6699FF')" onclick="Set('6699FF')"></td> <td bgcolor="#66CCFF" onmouseover="View('66CCFF')" onclick="Set('66CCFF')"></td> <td bgcolor="#66FFFF" onmouseover="View('66FFFF')" onclick="Set('66FFFF')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#FF0000" onmouseover="View('FF0000')" onclick="Set('FF0000')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#990000" onmouseover="View('990000')" onclick="Set('990000')"></td> <td bgcolor="#993300" onmouseover="View('993300')" onclick="Set('993300')"></td> <td bgcolor="#996600" onmouseover="View('996600')" onclick="Set('996600')"></td> <td bgcolor="#999900" onmouseover="View('999900')" onclick="Set('999900')"></td> <td bgcolor="#99CC00" onmouseover="View('99CC00')" onclick="Set('99CC00')"></td> <td bgcolor="#99FF00" onmouseover="View('99FF00')" onclick="Set('99FF00')"></td> <td bgcolor="#CC0000" onmouseover="View('CC0000')" onclick="Set('CC0000')"></td> <td bgcolor="#CC3300" onmouseover="View('CC3300')" onclick="Set('CC3300')"></td> <td bgcolor="#CC6600" onmouseover="View('CC6600')" onclick="Set('CC6600')"></td> <td bgcolor="#CC9900" onmouseover="View('CC9900')" onclick="Set('CC9900')"></td> <td bgcolor="#CCCC00" onmouseover="View('CCCC00')" onclick="Set('CCCC00')"></td> <td bgcolor="#CCFF00" onmouseover="View('CCFF00')" onclick="Set('CCFF00')"></td> <td bgcolor="#FF0000" onmouseover="View('FF0000')" onclick="Set('FF0000')"></td> <td bgcolor="#FF3300" onmouseover="View('FF3300')" onclick="Set('FF3300')"></td> <td bgcolor="#FF6600" onmouseover="View('FF6600')" onclick="Set('FF6600')"></td> <td bgcolor="#FF9900" onmouseover="View('FF9900')" onclick="Set('FF9900')"></td> <td bgcolor="#FFCC00" onmouseover="View('FFCC00')" onclick="Set('FFCC00')"></td> <td bgcolor="#FFFF00" onmouseover="View('FFFF00')" onclick="Set('FFFF00')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#00FF00" onmouseover="View('00FF00')" onclick="Set('00FF00')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#990033" onmouseover="View('990033')" onclick="Set('990033')"></td> <td bgcolor="#993333" onmouseover="View('993333')" onclick="Set('993333')"></td> <td bgcolor="#996633" onmouseover="View('996633')" onclick="Set('996633')"></td> <td bgcolor="#999933" onmouseover="View('999933')" onclick="Set('999933')"></td> <td bgcolor="#99CC33" onmouseover="View('99CC33')" onclick="Set('99CC33')"></td> <td bgcolor="#99FF33" onmouseover="View('99FF33')" onclick="Set('99FF33')"></td> <td bgcolor="#CC0033" onmouseover="View('CC0033')" onclick="Set('CC0033')"></td> <td bgcolor="#CC3333" onmouseover="View('CC3333')" onclick="Set('CC3333')"></td> <td bgcolor="#CC6633" onmouseover="View('CC6633')" onclick="Set('CC6633')"></td> <td bgcolor="#CC9933" onmouseover="View('CC9933')" onclick="Set('CC9933')"></td> <td bgcolor="#CCCC33" onmouseover="View('CCCC33')" onclick="Set('CCCC33')"></td> <td bgcolor="#CCFF33" onmouseover="View('CCFF33')" onclick="Set('CCFF33')"></td> <td bgcolor="#FF0033" onmouseover="View('FF0033')" onclick="Set('FF0033')"></td> <td bgcolor="#FF3333" onmouseover="View('FF3333')" onclick="Set('FF3333')"></td> <td bgcolor="#FF6633" onmouseover="View('FF6633')" onclick="Set('FF6633')"></td> <td bgcolor="#FF9933" onmouseover="View('FF9933')" onclick="Set('FF9933')"></td> <td bgcolor="#FFCC33" onmouseover="View('FFCC33')" onclick="Set('FFCC33')"></td> <td bgcolor="#FFFF33" onmouseover="View('FFFF33')" onclick="Set('FFFF33')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#0000FF" onmouseover="View('0000FF')" onclick="Set('0000FF')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#990066" onmouseover="View('990066')" onclick="Set('990066')"></td> <td bgcolor="#993366" onmouseover="View('993366')" onclick="Set('993366')"></td> <td bgcolor="#996666" onmouseover="View('996666')" onclick="Set('996666')"></td> <td bgcolor="#999966" onmouseover="View('999966')" onclick="Set('999966')"></td> <td bgcolor="#99CC66" onmouseover="View('99CC66')" onclick="Set('99CC66')"></td> <td bgcolor="#99FF66" onmouseover="View('99FF66')" onclick="Set('99FF66')"></td> <td bgcolor="#CC0066" onmouseover="View('CC0066')" onclick="Set('CC0066')"></td> <td bgcolor="#CC3366" onmouseover="View('CC3366')" onclick="Set('CC3366')"></td> <td bgcolor="#CC6666" onmouseover="View('CC6666')" onclick="Set('CC6666')"></td> <td bgcolor="#CC9966" onmouseover="View('CC9966')" onclick="Set('CC9966')"></td> <td bgcolor="#CCCC66" onmouseover="View('CCCC66')" onclick="Set('CCCC66')"></td> <td bgcolor="#CCFF66" onmouseover="View('CCFF66')" onclick="Set('CCFF66')"></td> <td bgcolor="#FF0066" onmouseover="View('FF0066')" onclick="Set('FF0066')"></td> <td bgcolor="#FF3366" onmouseover="View('FF3366')" onclick="Set('FF3366')"></td> <td bgcolor="#FF6666" onmouseover="View('FF6666')" onclick="Set('FF6666')"></td> <td bgcolor="#FF9966" onmouseover="View('FF9966')" onclick="Set('FF9966')"></td> <td bgcolor="#FFCC66" onmouseover="View('FFCC66')" onclick="Set('FFCC66')"></td> <td bgcolor="#FFFF66" onmouseover="View('FFFF66')" onclick="Set('FFFF66')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#FFFF00" onmouseover="View('FFFF00')" onclick="Set('FFFF00')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#990099" onmouseover="View('990099')" onclick="Set('990099')"></td> <td bgcolor="#993399" onmouseover="View('993399')" onclick="Set('993399')"></td> <td bgcolor="#996699" onmouseover="View('996699')" onclick="Set('996699')"></td> <td bgcolor="#999999" onmouseover="View('999999')" onclick="Set('999999')"></td> <td bgcolor="#99CC99" onmouseover="View('99CC99')" onclick="Set('99CC99')"></td> <td bgcolor="#99FF99" onmouseover="View('99FF99')" onclick="Set('99FF99')"></td> <td bgcolor="#CC0099" onmouseover="View('CC0099')" onclick="Set('CC0099')"></td> <td bgcolor="#CC3399" onmouseover="View('CC3399')" onclick="Set('CC3399')"></td> <td bgcolor="#CC6699" onmouseover="View('CC6699')" onclick="Set('CC6699')"></td> <td bgcolor="#CC9999" onmouseover="View('CC9999')" onclick="Set('CC9999')"></td> <td bgcolor="#CCCC99" onmouseover="View('CCCC99')" onclick="Set('CCCC99')"></td> <td bgcolor="#CCFF99" onmouseover="View('CCFF99')" onclick="Set('CCFF99')"></td> <td bgcolor="#FF0099" onmouseover="View('FF0099')" onclick="Set('FF0099')"></td> <td bgcolor="#FF3399" onmouseover="View('FF3399')" onclick="Set('FF3399')"></td> <td bgcolor="#FF6699" onmouseover="View('FF6699')" onclick="Set('FF6699')"></td> <td bgcolor="#FF9999" onmouseover="View('FF9999')" onclick="Set('FF9999')"></td> <td bgcolor="#FFCC99" onmouseover="View('FFCC99')" onclick="Set('FFCC99')"></td> <td bgcolor="#FFFF99" onmouseover="View('FFFF99')" onclick="Set('FFFF99')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#00FFFF" onmouseover="View('00FFFF')" onclick="Set('00FFFF')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#9900CC" onmouseover="View('9900CC')" onclick="Set('9900CC')"></td> <td bgcolor="#9933CC" onmouseover="View('9933CC')" onclick="Set('9933CC')"></td> <td bgcolor="#9966CC" onmouseover="View('9966CC')" onclick="Set('9966CC')"></td> <td bgcolor="#9999CC" onmouseover="View('9999CC')" onclick="Set('9999CC')"></td> <td bgcolor="#99CCCC" onmouseover="View('99CCCC')" onclick="Set('99CCCC')"></td> <td bgcolor="#99FFCC" onmouseover="View('99FFCC')" onclick="Set('99FFCC')"></td> <td bgcolor="#CC00CC" onmouseover="View('CC00CC')" onclick="Set('CC00CC')"></td> <td bgcolor="#CC33CC" onmouseover="View('CC33CC')" onclick="Set('CC33CC')"></td> <td bgcolor="#CC66CC" onmouseover="View('CC66CC')" onclick="Set('CC66CC')"></td> <td bgcolor="#CC99CC" onmouseover="View('CC99CC')" onclick="Set('CC99CC')"></td> <td bgcolor="#CCCCCC" onmouseover="View('CCCCCC')" onclick="Set('CCCCCC')"></td> <td bgcolor="#CCFFCC" onmouseover="View('CCFFCC')" onclick="Set('CCFFCC')"></td> <td bgcolor="#FF00CC" onmouseover="View('FF00CC')" onclick="Set('FF00CC')"></td> <td bgcolor="#FF33CC" onmouseover="View('FF33CC')" onclick="Set('FF33CC')"></td> <td bgcolor="#FF66CC" onmouseover="View('FF66CC')" onclick="Set('FF66CC')"></td> <td bgcolor="#FF99CC" onmouseover="View('FF99CC')" onclick="Set('FF99CC')"></td> <td bgcolor="#FFCCCC" onmouseover="View('FFCCCC')" onclick="Set('FFCCCC')"></td> <td bgcolor="#FFFFCC" onmouseover="View('FFFFCC')" onclick="Set('FFFFCC')"></td> </tr> <tr> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#FF00FF" onmouseover="View('FF00FF')" onclick="Set('FF00FF')"></td> <td bgcolor="#000000" onmouseover="View('000000')" onclick="Set('000000')"></td> <td bgcolor="#9900FF" onmouseover="View('9900FF')" onclick="Set('9900FF')"></td> <td bgcolor="#9933FF" onmouseover="View('9933FF')" onclick="Set('9933FF')"></td> <td bgcolor="#9966FF" onmouseover="View('9966FF')" onclick="Set('9966FF')"></td> <td bgcolor="#9999FF" onmouseover="View('9999FF')" onclick="Set('9999FF')"></td> <td bgcolor="#99CCFF" onmouseover="View('99CCFF')" onclick="Set('99CCFF')"></td> <td bgcolor="#99FFFF" onmouseover="View('99FFFF')" onclick="Set('99FFFF')"></td> <td bgcolor="#CC00FF" onmouseover="View('CC00FF')" onclick="Set('CC00FF')"></td> <td bgcolor="#CC33FF" onmouseover="View('CC33FF')" onclick="Set('CC33FF')"></td> <td bgcolor="#CC66FF" onmouseover="View('CC66FF')" onclick="Set('CC66FF')"></td> <td bgcolor="#CC99FF" onmouseover="View('CC99FF')" onclick="Set('CC99FF')"></td> <td bgcolor="#CCCCFF" onmouseover="View('CCCCFF')" onclick="Set('CCCCFF')"></td> <td bgcolor="#CCFFFF" onmouseover="View('CCFFFF')" onclick="Set('CCFFFF')"></td> <td bgcolor="#FF00FF" onmouseover="View('FF00FF')" onclick="Set('FF00FF')"></td> <td bgcolor="#FF33FF" onmouseover="View('FF33FF')" onclick="Set('FF33FF')"></td> <td bgcolor="#FF66FF" onmouseover="View('FF66FF')" onclick="Set('FF66FF')"></td> <td bgcolor="#FF99FF" onmouseover="View('FF99FF')" onclick="Set('FF99FF')"></td> <td bgcolor="#FFCCFF" onmouseover="View('FFCCFF')" onclick="Set('FFCCFF')"></td> <td bgcolor="#FFFFFF" onmouseover="View('FFFFFF')" onclick="Set('FFFFFF')"></td> </tr> </table> </body></html>
zzh-simple-hr
ZJs/webapp/html-editor/XinHa/popups/select_color.html
HTML
art
22,989
body { font-family: Arial; color: #000000; font-weight: normal; font-size: 13px; background-color: #EEEEEE; } td { font-family: Arial; color: #000000; font-weight: normal; font-size: 13px; } h1 { font-family: Tahoma; color: #444444; font-weight: bold; font-size: 16px; margin: 0px; } h2 { font-family: Tahoma; color: #444444; font-weight: bold; font-size: 14px; margin: 0px; text-decoration: underline; } h3 { font-family: Tahoma; color: #444444; font-weight: bold; font-size: 12px; margin: 0px; text-decoration: underline; } .headline { border-bottom: 1px solid #FF3300; font-weight: bold; } .naviblock { width:280px; text-align:center; border: 1px solid #AAAAAA; padding:5px; background-color:#FFFFFF; } a.navi { font-family: Tahoma; color: #444444; font-weight: bold; font-size: 13px; text-decoration: none; } a.navi:hover { text-decoration: underline; } a { color: #333333; } .codeblock { background-color: #FFFFEE; font-family: courier new; font-size: 12px; padding: 5px; width: 90%; border: 1px solid #AAAAAA; margin-left: 10px; margin-top: 5px; } .codeblock td { font-family: courier new; font-size: 12px; vertical-align: top; color: #000088; } .list { line-height: 20px; } .red { color: #FF3300; } .blue { color: #0000FF; } .green { color: #008080; } .darkblue { color: #000088; } .info { color: #EE0000; font-size:10px; }
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/docs/style.css
CSS
art
1,545
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr style="vertical-align: top;"> <td> <a href="http://www.openwebware.com" target="_blank"> <img src="images/logo.gif" border="0"> </a> </td> <td style="text-align:right;"> <font class="naviblock"> <a href="doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="addons.html" class="navi" title="Addons">ADDONS</a> | <a href="../example.html" class="navi" title="Examples">EXAMPLES</a> </font> </td> </tr> <tr> <td colspan="2"> <br> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr> <td class="headline"> <h1>Documentation</h1> </td> </tr> <tr> <td class="info"> Copyright (c) 2006 openWebWare.com </td> </tr> <tr> <td style=""> <br> <h2>Setup the openWYSIWYG editor</h2> <p> Include the javascript files like the following: <br> <div class="codeblock"> <span class="blue">&lt;script language=</span><span class="green">"JavaScript"</span> <span class="blue">type=</span><span class="green">"text/javascript"</span> <span class="blue">src=</span><span class="green">"<span class="red">scripts</span>/wysiwyg.js"</span><span class="blue">&gt;&lt;/script&gt;</span> <br> <span class="blue">&lt;script language=</span><span class="green">"JavaScript"</span> <span class="blue">type=</span><span class="green">"text/javascript"</span> <span class="blue">src=</span><span class="green">"<span class="red">scripts</span>/wysiwyg-settings.js"</span><span class="blue">&gt;&lt;/script&gt;<span class="green"> // optional</span></span> </div> <br> Note: You might need to change the src path (red), depending on where you put the files. </p> <p>Now you have to attach the openWYSIWYG editor to all or to defined textareas of your page.<br> <div class="codeblock"> <span class="blue"></span><span class="blue">&#060;script language=</span><span class="green">"javascript1.2"</span><span class="blue">&gt;<br>&nbsp;&nbsp; </span><span class="darkblue"><span class="green">// attach the editor to all textareas of your page.</span></span><br> &nbsp;&nbsp;&nbsp;<span class="darkblue">WYSIWYG.<strong>attach</strong>('all'); <br>&nbsp;&nbsp; <br></span><span class="darkblue">&nbsp;&nbsp; <span class="green">// attach the editor to the textarea with the identifier 'textarea1'.</span></span><br><span class="darkblue">&nbsp;&nbsp; WYSIWYG.<strong>attach</strong>('textarea1');<br></span><span class="darkblue"></span> <span class="blue">&#060;/script&#062;</span> </div> <br> Now try it out! <br><br> If you don't see any images on the toolbar then you have to change the image path.<br> Have a look at the customize section. <br><br> If you need to display contents of textarea's with HTML output support, but without the editing possibilities, you can use a function called display. <div class="codeblock"> <span class="blue"></span><span class="blue">&#060;script language=</span><span class="green">"javascript1.2"</span><span class="blue">&gt;<br>&nbsp;&nbsp; </span><span class="darkblue"><span class="green">// display iframes instead of textareas. It apply's to all textareas of your page.</span></span><br> &nbsp;&nbsp;&nbsp;<span class="darkblue">WYSIWYG.<strong>display</strong>('all'); <br>&nbsp;&nbsp; <br></span><span class="darkblue">&nbsp;&nbsp; <span class="green">// display an iframe instead of the textarea with the identifier 'textarea1'</span></span><br><span class="darkblue">&nbsp;&nbsp; WYSIWYG.<strong>display</strong>('textarea1');<br></span><span class="darkblue"></span> <span class="blue">&#060;/script&#062;</span> </div> </p> <br><br> </td> </tr> <tr> <td> <h2> Customize the openWYSIWYG </h2> This section describe how you can customize the openWYSIWYG editor.<br><br> <h3>The Settings object:</h3><br> You can create a new instance of the settings object. This object will be used to customize your editor. <div class="codeblock"> <span class="darkblue">var <span class="red">mysettings</span> = new WYSIWYG.Settings();</span> </div> <br>Now attach the editor to all or to defined textareas of your page.<br> <div class="codeblock"> <span class="darkblue">WYSIWYG.<b>attach</b>(</span><span class="green">'all'</span><span class="darkblue">, <span class="red">mysettings</span><span class="darkblue">);</span><br> </div> <br><br> <h3>Properties of the Settings object:</h3> <br> Here is a list of all properties you can change to customize the look and feel of your editor. <br> <table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%"> <colgroup> <col width="35%"> <col width="65%"> </colgroup> <tbody> <tr> <td><span class="red">mysettings</span>.<b>ImagesDir</b> = "&lt;path&gt;";</td> <td><span class="green">The path where your images are located (default: 'images/')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>PopupsDir</b> = "&lt;path&gt;"; </td> <td><span class="green">The path where your popup htmls are located (default: 'popups/')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>CSSFile</b> = "&lt;path&gt;"; </td> <td><span class="green">The path + file where your stylesheet file is located (default: 'styles/wysiwyg.css')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>Width</b> = "&lt;width&gt;"; </td> <td><span class="green">The width of the editor window (valid units are px and %) (default: '500px')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>Height</b> = "&lt;height&gt;"; </td> <td><span class="green">The height of the editor window (valid units are px and %) (default: '200px')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>DefaultStyle</b> = "&lt;stylesheet&gt;"; </td> <td><span class="green">The default stylesheet of the editor window <br>(default: 'font-family: Arial; font-size: 12px; background-color: #FFFFFF')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>DisabledStyle</b> = "&lt;stylesheet&gt;"; </td> <td><span class="green">The style which appears if the editor is disabled<br> (default: 'font-family: Arial; font-size: 12px; background-color: #EEEEEE')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>ReplaceLineBreaks</b> = &lt;true/false&gt;; </td> <td><span class="green">Replace line breaks (\n) with html line breaks &lt;br&gt; (used for none html content) (default: false)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>PreviewWidth</b> = &lt;width&gt;; </td> <td><span class="green">The width of the preview popup (default: 500)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>PreviewHeight</b> = &lt;height&gt;; </td> <td><span class="green">The height of the preview popup (default: 400)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>RemoveFormatConfMessage</b> = "&lt;text&gt;"; </td> <td><span class="green">Text which appears if the MS word clean up button is pressed (default: 'Clean HTML inserted by MS Word ?')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>NoValidBrowserMessage</b> = "&lt;text&gt;"; </td> <td><span class="green">Text which appears if the browser is not supported by openWYSIWYG (default: 'openWYSIWYG does not support your browser.')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>AnchorPathToStrip</b> = "&lt;url&gt;"; </td> <td><span class="green">The url which is striped off on anchors (only IE, recommended: auto) (default: 'auto')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>ImagePathToStrip</b> = "&lt;url&gt;"; </td> <td><span class="green">The url which is striped off on images (only IE, recommended: auto) (default: 'auto')</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>ContextMenu</b> = &lt;true/false&gt;;</td> <td><span class="green">Enable / disable the custom context menu (default: true)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>StatusBarEnabled</b> = &lt;true/false&gt;;</td> <td><span class="green">Enable / disable the status bar (default: true)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>InvertIELineBreaks</b> = &lt;true/false&gt;;</td> <td><span class="green">Enable / disable invert of line break capability in IE (default: false)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>InsertImagePopup</b> = &lt;path/file&gt;;</td> <td><span class="green">If you use another implementation like an image library written in PHP, then you can use this setting to customize the location of the implementation file. No need to edit the main javascript file.<br>(It's used for future upcoming image library addons)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>InsertImageWith</b> = &lt;width&gt;;</td> <td><span class="green">Width of the image popup window. (Default: 400)</span></td> </tr> <tr> <td><span class="red">mysettings</span>.<b>InsertImageWith</b> = &lt;height&gt;;</td> <td><span class="green">Height of the image popup window. (Default: 210)</span></td> </tr> </tbody> </table> <br> <h3>Methods of the Settings object:</h3> <br> There are three methods to customize the toolbar elements. (Recommended if you newly to javascript) <br> <table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%"> <colgroup> <col width="50%"> <col width="50%"> </colgroup> <tbody> <tr> <td><span class="red">mysettings</span>.<b>addToolbarElement</b>("&lt;element&gt;", &lt;toolbar&gt;, &lt;position&gt;);</td> <td> <span class="green"> Add the given &lt;element&gt; to the defined &lt;toolbar&gt; on the defined &lt;position&gt;.<br><br> Valid elements are:<br> <i>font, fontsize, bold, italic, underline, forecolor, backcolor, justifyleft, justifycenter, justifyright, unorderedlist, orderedlist, outdent, indent, subscript, superscript, cut, copy, paste, removeformat, undo, redo, inserttable, insertimage, createlink, seperator, undo, redo, seperator, preview, print, viewSource, help</i> <br><br> The element <i>seperator</i> adds a line seperator between elements <br><br> &lt;toolbar&gt; is an integer starts with 1. <br> &lt;position&gt; is an integer starts with 1. <br><br> Example: </span> <span color="darkblue"> mysettings.addToolbarElement("bold", 1, 1);</span> <br><br> </td> </tr> <tr> <td><span class="red">mysettings</span>.<b>removeToolbarElement</b>("&lt;element&gt;");</td> <td> <span class="green"> Removes the given &lt;element&gt; on the toolbar.<br><br> Valid elements are:<br> <i>font, fontsize, bold, italic, underline, forecolor, backcolor, justifyleft, justifycenter, justifyright, unorderedlist, orderedlist, outdent, indent, subscript, superscript, cut, copy, paste, removeformat, undo, redo, inserttable, insertimage, createlink, seperator, undo, redo, seperator, preview, print, viewSource, help</i> <br><br> You can not remove the element <i>seperator</i> only overriding with the function addToolbarElement() <br><br> Example: </span> <span color="darkblue"> mysettings.removeToolbarElement("bold");</span> <br><br> </td> </tr> <tr> <td><span class="red">mysettings</span>.<b>clearToolbar</b>(&lt;toolbar&gt;);</td> <td> <span class="green"> Clears the given &lt;toolbar&gt;. If the element &lt;toolbar&gt; is not defined then the functions clear all existing toolbars.<br><br> <br><br> &lt;toolbar&gt; is an integer starts with 1. <br><br> Example: </span> <span color="darkblue"> mysettings.clearToolbar(1);</span> </td> </tr> </tbody> </table> <br><br> <br> <h3>Array of the Settings object:</h3> <br> There are some arrays within the Settings object you can define directly. So let`s show how does it works. <br> <br> <table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%"> <colgroup> <col width="50%"> <col width="50%"> </colgroup> <tbody> <tr> <td><span class="red">mysettings</span>.<b>Toolbar</b>[&lt;toolbar index&gt;][&lt;element index&gt;] = "&lt;element&gt;";</td> <td> <span class="green"> The toolbar array is defined in two dimensions, the first dimension is the toolbar index, the second the element index. If you want to define an element in toolbar 2 on position 3 then you have to do this: </span> <span class="darkblue"> mysettings.Toolbar[1][2] = "bold"; </span> <br><br> <span class="green"> Valid elements can be found on addToolbarElement(). </span> <br><br> </td> </tr> <tr> <td><span class="red">mysettings</span>.<b>Fonts</b>[&lt;element index&gt;] = "&lt;element&gt;";</td> <td> <span class="green"> You have the posibility to change the font families by setting the Fonts array of the Settings object. If you want to add Arial on the second position then you have to do this: </span> <span class="darkblue"> mysettings.Fonts[1] = "Arial"; </span> <br><br> <span class=green> Valid elements are:<br> All font family elements (look at a stylesheet description of the tag font-family) </span> <br><br> </td> </tr> <tr> <td><span class="red">mysettings</span>.<b>Fontsizes</b>[&lt;element index&gt;] = "&lt;size&gt;";</td> <td> <span class="green"> You can also change the font size which you can use on the editor. If you want to add the font size 5 on the first position of drop down box, then you have to do this: </span> <span class="darkblue"> mysettings.Fontsizes[0] = "5"; </span> <br><br> <span class=green> Valid sizes are:<br> 1 - ... (i dont know if the size attribute is limit) </span> </td> </tr> </tbody> </table> <br><br><br><br> </td> </tr> <tr> <td> <h2> Change Log </h2> <p> <b>v1.4.7 (Released: September 9, 2007)</b><br> Addresses the following: <br></p> <ul> <li>added - Possibilty to maximize the editor window</li> <li>fixed - Correct relative image path on preview, now it works for all images</li> <li>added - Table highlighting possibility</li> <li>added - Possiblity to assign headings (crashed)</li> <li>changed - Code improvments to tons of functions</li> <li>changed - WYSIWYG.formatText() function renamed to WYSIWYG.execCommand()</li> <li>changed - WYSIWYG.findParentTag() renamed to WYSIWYG.findParent()</li> <li>added - WYSIWYG_Core.findParentNode(tagName, node) function which finds a parent node by tag name starts on the given node</li> <li>fixed - Implement function WYSIWYG_Core.getAttribute which solve the problem while getting the style attribute on IE</li> <li>changed - Getting style attribute while editing a link</li> <li>added - WYSIWYG_Table object, which is used for improving table editing</li> <li>changed - New icons print and preview (thx sweb)</li> <li>added - Save and return button on toolbar, the return button is disabled by default. (thx sweb)</li> <li>added - Table function improvments</li> <li>added - New WYSIWYG_Color object, which handels the color choosing</li> <li>added - Full justify text (code by tim)</li> </ul> <p> <b>v1.4.6c (Released: December 25, 2006)</b><br> Addresses the following: <br></p> <ul> <li>fixed - Solved issue with backcolor command on IE</li> <li>changed - Add parameter value to WYSIWYG_Core.execCommand() function</li> </ul> <b>v1.4.6b (Released: December 23, 2006)</b><br> Addresses the following: <br></p> <ul> <li>changed - Debug code on context menu removed</li> <li>fixed - Add "px" to left and top style information on context menu</li> <li>changed - Correct comment of wyswiwyg-settings.js</li> </ul> <b>v1.4.6a (Released: December 21, 2006)</b><br> Addresses the following: <br></p> <ul> <li>fixed - bad class name on mouse over of toolbar buttons fixed</li> <li>changed - Rewritten function to get the current position of an element (iframe)</li> <li>fixed - Context menu position issue solved</li> <li>fixed - Wrong variable call fixed</li> <li>fixed - Problem while removing elements with the context menu solved</li> </ul> <b>v1.4.6 (Released: December 17, 2006)</b><br> Addresses the following: <br></p> <ul> <li>changed - Modification changed to be the official version of openWYSIWYG</li> <li>fixed - Child nodes will be copied to the parent if a node is removed</li> <li>changed - Complete rewritten context menu</li> <li>changed - Behaviours of the context menu dependents on selection</li> <li>added - Copy/Cut/Paste to context menu</li> <li>changed - Code structure changes</li> <li>added - wysiwyg-popup.js which holds popup specific functions</li> <li>added - new object WYSIWYG_Core added, which holds all core functions</li> <li>added - addEvent() and removeEvent() core function added</li> <li>added - attach() and attachAll() functions which used to attach the editor to textareas</li> <li>changed - Complete rewritten insertLink function, now it works with tags like img, h1 etc</li> <li>added - Override width and height of the editor with size given by the style attributes width and height of the textarea</li> <li>added - New function includeCSS() in Core object, which includes a given stylesheet file on the head tag of the current page</li> <li>fixed - Solved problem if you want to attach the editor to all textareas</li> <li>changed - Include of stylesheet files changed, now using the includeCSS function</li> <li>changed - Complete rewritten display function, now you can use it like like function attach()</li> </ul> <b>Modification v0.4.5 (Released: November 12, 2006)</b><br> Addresses the following: </p><ul> <li>added - openImageLibrary addon (for now PHP only)</li> <li>fixed - correct relative anchor and image path on preview</li> <li>changed - various javascript code changes</li> </ul> <b>Modification v0.4.4 (Released: November 11, 2006)</b><br /> Addresses the following: <ul> <li>added - capability of using image library addons</li> <li>fixed - corrupt font + font size selection html</li> </ul> <b>Modification v0.4.3 (Released: October 20, 2006)</b><br /> Addresses the following: <ul> <li>added - Possibility to invert the line break print outs of IE (ENTER = &lt;br&gt;, SHIFT + ENTER = &lt;p&gt;)</li> <li>fixed - Replace of &lt;p&gt; with &lt;br&gt; on carriage return prevented the IE to set ordered and unordered lists.</li> <li>added - Settings object to customize the Editor</li> <li>fixed - Solve javascript error on example.html</li> <li>fixed - Change html layout of the editor to solve the minimum width problem on dynamic editor size.</li> <li>added - Enable/disable possibilty of the context menu</li> <li>added - A general remove function, so it is possible to remove each html element</li> <li>added - Adding an option 'Remove Node' to the context menu</li> <li>added - Adding the possibilty to add the font + font size selection to toolbar2 or placing them where ever you want on the toolbars</li> <li>changed - Removing the vars EnableFontSelection and EnableFontSizeSelection because font + font size selection goes to ToolBar Array like all other buttons.</li> <li>changed - Removing vars EditorMinimumWidth and EditorMinimumHeight after solving the minimum width problem on IE. No more use.</li> <li>added - New Function addToolbarElement() and removeToolbarElement within the settings object</li> <li>added - Possibility to select a html node using the status bar node structure </li> <li>changed - Complete redesign of the toolbar implementation</li> <li>changed - Remove function removeImage() and removeLink(), because function removeNode() do it for all</li> <li>added - Two new functions getEditorOffsetY() and getEditorOffsetX() to get the offsets of the editor window to the body if the the page</li> <li>fixed - broken image path on toolbar button text view</li> <li>added - New function enable(), now you can enable/display the editor on the fly</li> </ul> <b>Modification v0.4.2 (Released: October 16, 2006)</b><br /> Addresses the following: <ul> <li>added - Converting decimal colors to hex colors within style attributes</li> <li>changed - Rename getParentTag() to findParentTag(), the function finds a tag by a given tag name</li> <li>changed - Improving function findParentTag(), now it finds IMG tags and do not return #tags but the parent tag</li> <li>added - Reimplementing function getTag(). The function gets the current selected tag</li> <li>added - New Function getParent(). Returns the parent node of the given element</li> <li>added - New Function getNodeTree(). The function returns a tree of nodes as array, beginning with the current selected element (node) and ending with the HTML node (element).</li> <li>added - New status bar implemented. It's shown the element structure, beginning with the current selected element and ending with the HTML element.</li> <li>added - New Function updateStatusBar(). Updates the status bar with the element structure.</li> <li>changed - Possibility of setting dynamic width and height of the editor</li> <li>fixed - Solving bug while setting style attribute on links</li> </ul> <p><b>Modification v0.4.1 (Released: October 14, 2006)</b><br /> Addresses the following: <ul> <li>added - Custom context menu for images and links</li> <li>added - Remove option for images and links on the context menu</li> <li>added - New functions removeLink() and removeImages() <li>added - New function $() implemented, its a replacement for document.getElementById()</li> <li>changed - Some small other code changes</li> </ul> <p><b>Modification v0.4 (Released: October 12, 2006)</b><br /> Addresses the following: <ul> <li>fixed - Dublicated id attribute in color chooser popup</li> <li>fixed - Preventing IE to insert &lt;p&gt; tags on carriage return. IE will insert a normal &lt;br&gt; instead. (Thx to richyrich)</li> <li>fixed - Crappy layout of hyperlink popup on IE (fields: class and name)</li> <li>fixed - With multiple editors on one form, the global var viewTextMode is not unique for each editor. Used an Array instead to set the var for each editor individually</li> <li>fixed - Submitting the editor while in text mode then it will submit escaped html (&lt;br&gt; -> submit -> &amp;lt;br&amp;gt;). Auto switch to HTML Mode if submit</li> <li>fixed - Validate objects on hideFonts() and hideFontSizes() function</li> <li>changed - Improvements on closing font + font size selection. Add a unique event listener for each selection.</li> </ul> <p><b>Modification v0.3.2a (Released: October 11, 2006)</b><br /> Addresses the following: <ul> <li>added - Improvements on font and font size selection, now the drop downs will be closed if you go through the editor.</li> <li>fixed - Opera bug in insertNodeAtSelection() function solved. That's why the table popup won`t close if you submit it.</li> <li>fixed - CSS file problem in table popup. There was a hard coded path to the CSS file. I changed it so the path to the CSS file will be dynamically inserted.</li> <li>added - Improvements to the color selection menus on table popup, now the button "pick" has a toggle function (open/close the color selections).</li> </ul> <p><b>Modification v0.3.2a (Released: October 11, 2006)</b><br /> Addresses the following: <ul> <li>fixed - Font and font size selection fixed. I improved the closing a little bit, so if you choose font and then click an font size the font menue will be closed before.</li> <li>added - Added a select field to the hyperlink popup which holds the default targets _blank, _self, _parent, _top. On change the select field updates the 'target' text field.</li> </ul> <p><b>Modification v0.3.1 (Released: October 10, 2006)</b><br /> Addresses the following: <ul> <li>fixed - Solve the habit of IE to convert relative urls into absolute. Now you can set two vars AnchorPathToStrip and ImagePathToStrip which holds an url that will be stripped off the href and src attributes. If you set the vars to "auto" then the url will automatically get of the current document. I recommend that you use the "auto" methode. </li> </ul> <p><b>Modification v0.3 (Released: October 9, 2006)</b><br /> Addresses the following: <ul> <li>added - Default style now also applies to the preview window</li> <li>added - Print button + function</li> <li>fixed - A little mistake within the function setAttribute, attr.toLowerCase -&gt; attr.toLowerCase() it prevented the script to apply the styles in IE correctly</li> <li>fixed - Problem while replacing \n with &lt;br&gt; after submitting data in IE solved.</li> <li>fixed - Complete rewritten function insertLink + insertImage. Improving edit capabiltity on both links and images. </li> </ul> <p><b>Modification v0.2 (Released: October 8, 2006)</b><br /> Addresses the following: <ul> <li>added - New function insertLink(), now you can insert and edit links. New available attributes are target, styleclass, name and style. (IE has some limitations, getting style attribute doesn`t work, hope i can solve this problem)</li> <li>fixed - Stripping MS Word HTML (removed some bugs within the regex)</li> <li>changed - Complete rewritten source code, now all functions + var are within a var WYSIWYG. (ex. WYSIWYG.generate('textarea1', 500, 200); )</li> <li>fixed - Replace &lt;div&gt; with &lt;span&gt; while insert html on none IE Browsers, this solve the new line problem after the &lt;div&gt; tag.</li> <li>added - New function insertImage(), now you can insert and editing images</li> <li>added - Validation of browser versions (thx to TIM) </li> </ul> <p><b>Modification v0.1 (Released: October 6, 2006)</b><br /> Addresses the following: <ul> <li>added - Possibility to replace \n with &lt;br&gt; to be compatible with previous content coming from a database, for example.</li> <li>added - Button to strip any HTML added by word</li> <li>changed - Modified generate_wysiwyg() method (added width and height to customize size of each editor, width and height are optional parameter)</li> <li>added - Possibility to set the default font family, font size and font color of the editor area</li> <li>added - New function disable_wysiwyg() to disable a editor area</li> <li>changed - Some changes were made to toolbar1 and toolbar2. now toolbar2 is hidden if no elements are assigned.</li> <li>changed - Now you can add the viewSource button to toolbar1</li> <li>added - A new function display_wysiwyg() only for displaying an iframe with content of a textarea (without any editable features)</li> <li>added - A style-class for the iframe to customize the background-color (useful in firefox, because firefox use the background of the parent element)</li> <li>added - Preview button + function (thx to Korvo), now it works in Firefox and use the innerHTML of the iframe instead of the texteare value</li> <li>fixed - Some code improvements for better compatibility with Firefox + IE</li> <li>changed - The var cssDir changed to cssFile, now it includes the complete file path (ex. styles/wysiwyg.css)</li> <li>added - new stylesheet classes, check the css file</li> <li>added - Possibility to enable/disable font + font size selection</li> <li>fixed - Firefox BackColor problem fixed (thx to Merk), no hilite button needed only solve the problem on firefox </li> </ul> </p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/docs/doc.html
HTML
art
31,926
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr style="vertical-align: top;"> <td> <a href="http://www.openwebware.com" target="_blank"> <img src="images/logo.gif" border="0"> </a> </td> <td style="text-align:right;"> <font class="naviblock"> <a href="doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="addons.html" class="navi" title="Addons">ADDONS</a> | <a href="../example.html" class="navi" title="Examples">EXAMPLES</a> </font> </td> </tr> <tr> <td colspan="2"> <br> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr> <td class="headline"> <h1>Addons</h1> </td> </tr> <tr> <td class="info"> Copyright (c) 2006 openWebWare.com </td> </tr> <tr> <td style=""> <br> <h2>openImageLibrary addon (PHP)<br></h2> <p> Here we want to explain how you can use the openImageLibrary addon (for now PHP only) to let your users uploading, browsing and selecting images on your webserver.<br> First you have to download the latest version of the openWYSIWYG modification, which includes the openImageLibrary addon.<br> You will find a directory called <i>addons</i> in the root of the openWYSIWYG directory. If it not there you do not have the latest version of the openWYSIWYG editor.<br><br> To enable the openImageLibrary addon you have to customize the insert image popup implementation of the openWYSIWYG.<br> The following shows how you change the implementation of the insert image popup. <div class="codeblock"> <span class="darkblue">var <span class="red">mysettings</span> = new WYSIWYG.Settings();</span> <br><br> <span class="green">// define the location of the openImageLibrary addon</span><br> <span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupFile</b> = "addons/imagelibrary/insert_image.php";</span> <br> <span class="green">// define the width of the insert image popup</span><br> <span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupWidth</b> = 600;</span> <br> <span class="green">// define the height of the insert image popup</span><br> <span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupHeight</b> = 245;</span> <br> </div> <br>Attach the editor on the textarea with the previously defined <span class="red"><i>mysettings</i></span> object. <div class="codeblock"> <span class="blue"></span><span class="blue">&#060;script language=</span><span class="green">"javascript1.2"</span><span class="blue">&#062;</span><br> &nbsp;&nbsp;&nbsp;<span class="darkblue">WYSIWYG.<b>attach</b>('textareaID', <span class="red">mysettings</span><span class="darkblue">);</span><br> <span class="blue">&#060;/script&#062;</span> </div> <br> Now try it out! <br> </p> <br><br> </td> </tr> <tr> <td> <h2> Customize the openImageLibrary addon </h2> This section describe how you can customize the openImageLibrary addon.<br><br> <h3>Settings of the openImageLibrary addon:</h3> <br> The following settings can be modified within the config file <i>(addons/imagelibrary/config.inc.php)</i> <br> <table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%"> <colgroup> <col width="35%"> <col width="65%"> </colgroup> <tbody> <tr> <td> <b>$imagebasedir</b> = '../../uploads'; </td> <td> <span class="green"> Path to a directory which holds the images. </span> </td> </tr> <tr> <td> <b>$imagebaseurl</b> = 'uploads'; </td> <td> <span class="green"> An absolute or relative URL to the image folder. This url is used to generate the source of the image. </span> </td> </tr> <tr> <td> <b>$browsedirs</b> = true; </td> <td> <span class="green"> Allow your users to browse the subdir of the defined basedir. </span> </td> </tr> <tr> <td> <b>$allowuploads</b> = true; </td> <td> <span class="green"> If enabled users will be able to upload files to any viewable directory. You should really only enable this if the area this script is in is already password protected. </span> </td> </tr> <tr> <td> <b>$overwrite</b> = false; </td> <td> <span class="green"> If a user uploads a file with the same name as an existing file do you want the existing file to be overwritten ? </span> </td> </tr> <tr> <td> <b>$supportedextentions</b> = array(&lt;file extensions&gt;); </td> <td> <span class="green"> Define the extentions you want to show within the directory listing.<br> The extensions also limit the files the user can upload to your image folders. </span> </td> </tr> <tr> <td> <b>$filetypes</b> = array (&lt;extension&gt; => &lt;filename&gt;) </td> <td> <span class="green"> If you want to add your own special file icons use this section below. Each entry relates to the extension of the given file, in the form &lt;extension&gt; => &lt;filename&gt;. <br> These files must be located within the dlf directory. </span> </td> </tr> </tbody> </table> <br> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/docs/addons.html
HTML
art
6,574
/******************************************************************** * openWYSIWYG stylesheet file Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg.css,v 1.2 2007/01/29 19:19:49 xhaggi Exp $ ********************************************************************/ /* Toolbar */ .toolbar1 { height: 26px; background-image: url(../images/background_silver.jpg); } /*.toolbar1 { height: 26px; background-color: #F4F4F4; border-bottom:1px solid #C9C9C9; }*/ /* Command Buttons */ .buttonEditor { width: 20px; height: 20px; border: 0px solid transparent; margin: 1px; padding: 0px; background: transparent; } .buttonEditorOver { width: 20px; height: 20px; border: 1px solid #999999; margin: 0; padding: 0px; } /* Table Textarea */ .tableTextareaEditor { border: 1px solid #888888; } .iframeText { background-color: #FFFFFF; } /* Status Bar */ .wysiwyg-statusbar {font-family: Arial; font-size: 9px; background-color: #EEEEEE;} a.wysiwyg-statusbar {font-family: Arial; font-size: 9px; color: #000000; text-decoration:none;} a.wysiwyg-statusbar:hover {font-family: Arial; font-size: 9px; color: #000000; text-decoration:underline;} /* Font Type and Size Drop Down */ .dropdown { background-color: #FFFFFF; border: 1px solid #333333; height: 140px; overflow: auto; padding: 1px;} button.mouseOver { background-color: #EEEEEE; border: 1px solid #CCCCCC; padding: 3px; cursor: default; text-align: left;} button.mouseOut { background-color: #FFFFFF; border: 1px solid #FFFFFF; padding: 3px; cursor: default; text-align: left;} /* Context Menu */ .wysiwyg-context-menu-div { background-color:#F4F4F4; border: 1px solid #C9C9C9; width:170px; } .wysiwyg-context-menu { font-family: Arial; font-size:11px; color:#000000; width:100%;} .wysiwyg-context-menu .icon {background-color:#EEEEEE;} .wysiwyg-context-menu .disabled { font-family: Arial; font-size:11px; color:#999999; text-decoration:none; padding-left: 3px; } .wysiwyg-context-menu a { font-family: Arial; font-size:11px; color:#000000; text-decoration:none; padding-left: 3px;} .wysiwyg-context-menu .mouseover {background-color: #EEEEEE;} /* CREATE TABLE POPUP */ /* Select Border Width/Type */ .on { background-color: #EEEEEE; border: 1px solid #CCCCCC; padding: 6px; width: 140px; cursor: default; height: 5px;} .off { background-color: #FFFFFF; border: 1px solid #FFFFFF; padding: 6px; width: 140px; cursor: default; height: 5px;} /* Select Shading/Border Color */ .wysiwyg-color-picker-table { border: 1px solid #7E7E81; background-color: #F7F7F7; padding: 1px; } .wysiwyg-color-picker-div { font-size: 1px; height:12px; width:12px; } .selectColorBorder { border: 1px solid #F7F7F7; } .selectColorOn { border: 1px solid #999999; background-color: #CCCCCC; } .selectColorOff { border: 1px solid #F7F7F7; background-color: #F7F7F7; }
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/styles/wysiwyg.css
CSS
art
2,977
<?php /******************************************************************** * openImageLibrary addon Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. ********************************************************************/ require('config.inc.php'); error_reporting(0); // get the identifier of the editor $wysiwyg = $_GET['wysiwyg']; // set image dir $leadon = $rootdir.$imagebasedir; if($leadon=='.') $leadon = ''; if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/'; $startdir = $leadon; // validate the directory $_GET['dir'] = $_POST['dir'] ? $_POST['dir'] : $_GET['dir']; if($_GET['dir']) { if(substr($_GET['dir'], -1, 1)!='/') { $_GET['dir'] = $_GET['dir'] . '/'; } $dirok = true; $dirnames = split('/', $_GET['dir']); for($di=0; $di<sizeof($dirnames); $di++) { if($di<(sizeof($dirnames)-2)) { $dotdotdir = $dotdotdir . $dirnames[$di] . '/'; } } if(substr($_GET['dir'], 0, 1)=='/') { $dirok = false; } if($_GET['dir'] == $leadon) { $dirok = false; } if($dirok) { $leadon = $_GET['dir']; } } // upload file if($allowuploads && $_FILES['file']) { $upload = true; if(!$overwrite) { if(file_exists($leadon.$_FILES['file']['name'])) { $upload = false; } } $ext = strtolower(substr($_FILES['file']['name'], strrpos($_FILES['file']['name'], '.')+1)); if(!in_array($ext, $supportedextentions)) { $upload = false; } if($upload) { move_uploaded_file($_FILES['file']['tmp_name'], $leadon . $_FILES['file']['name']); } } if($allowuploads) { $phpallowuploads = (bool) ini_get('file_uploads'); $phpmaxsize = ini_get('upload_max_filesize'); $phpmaxsize = trim($phpmaxsize); $last = strtolower($phpmaxsize{strlen($phpmaxsize)-1}); switch($last) { case 'g': $phpmaxsize *= 1024; case 'm': $phpmaxsize *= 1024; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Insert Image</title> <script type="text/javascript" src="../../scripts/wysiwyg-popup.js"></script> <script language="JavaScript" type="text/javascript"> /* ---------------------------------------------------------------------- *\ Function : insertImage() Description : Inserts image into the WYSIWYG. \* ---------------------------------------------------------------------- */ function insertImage() { var n = WYSIWYG_Popup.getParam('wysiwyg'); // get values from form fields var src = document.getElementById('src').value; var alt = document.getElementById('alt').value; var width = document.getElementById('width').value var height = document.getElementById('height').value var border = document.getElementById('border').value var align = document.getElementById('align').value var vspace = document.getElementById('vspace').value var hspace = document.getElementById('hspace').value // insert image WYSIWYG.insertImage(src, width, height, align, border, alt, hspace, vspace, n); window.close(); } /* ---------------------------------------------------------------------- *\ Function : loadImage() Description : load the settings of a selected image into the form fields \* ---------------------------------------------------------------------- */ function loadImage() { var n = WYSIWYG_Popup.getParam('wysiwyg'); // get selection and range var sel = WYSIWYG.getSelection(n); var range = WYSIWYG.getRange(sel); // the current tag of range var img = WYSIWYG.findParent("img", range); // if no image is defined then return if(img == null) return; // assign the values to the form elements for(var i = 0;i < img.attributes.length;i++) { var attr = img.attributes[i].name.toLowerCase(); var value = img.attributes[i].value; //alert(attr + " = " + value); if(attr && value && value != "null") { switch(attr) { case "src": // strip off urls on IE if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false); document.getElementById('src').value = value; break; case "alt": document.getElementById('alt').value = value; break; case "align": selectItemByValue(document.getElementById('align'), value); break; case "border": document.getElementById('border').value = value; break; case "hspace": document.getElementById('hspace').value = value; break; case "vspace": document.getElementById('vspace').value = value; break; case "width": document.getElementById('width').value = value; break; case "height": document.getElementById('height').value = value; break; } } } // get width and height from style attribute in none IE browsers if(!WYSIWYG_Core.isMSIE && document.getElementById('width').value == "" && document.getElementById('width').value == "") { document.getElementById('width').value = img.style.width.replace(/px/, ""); document.getElementById('height').value = img.style.height.replace(/px/, ""); } } /* ---------------------------------------------------------------------- *\ Function : selectItem() Description : Select an item of an select box element by value. \* ---------------------------------------------------------------------- */ function selectItemByValue(element, value) { if(element.options.length) { for(var i=0;i<element.options.length;i++) { if(element.options[i].value == value) { element.options[i].selected = true; } } } } </script> </head> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadImage();"> <table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"> <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?wysiwyg=<?php echo $wysiwyg; ?>" enctype="multipart/form-data"> <input type="hidden" id="dir" name="dir" value=""> <tr> <td style="vertical-align:top;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Image:</span> <table width="380" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <?php if($allowuploads) { if($phpallowuploads) { ?> <tr> <td style="padding-top: 0px;padding-bottom: 0px; font-family: arial, verdana, helvetica; font-size: 11px;width:80px;">Upload:</td> <td style="padding-top: 0px;padding-bottom: 0px;width:300px;"><input type="file" name="file" size="30" style="font-size: 10px; width: 100%;" /></td> </tr> <tr> <td style="padding-top: 0px;padding-bottom: 2px;font-family: tahoma; font-size: 9px;">&nbsp;</td> <td style="padding-top: 0px;padding-bottom: 2px;font-family: tahoma; font-size: 9px;">(Max Filesize: <?php echo $phpmaxsize; ?>KB)</td> </tr> <?php } else { ?> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" colspan="2"> File uploads are disabled in your php.ini file. Please enable them. </td> </tr> <?php } } ?> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="80">Image URL:</td> <td style="padding-bottom: 2px; padding-top: 0px;" width="300"><input type="text" name="src" id="src" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Alternate Text:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="alt" id="alt" value="" style="font-size: 10px; width: 100%;"></td> </tr> </table> <table width="380" border="0" cellpadding="0" cellspacing="0"><tr><td style="vertical-align:top;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Layout:</span> <table width="180" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Width:</td> <td style="width:60px;padding-bottom: 2px; padding-top: 0px;"><input type="text" name="width" id="width" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Height:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="height" id="height" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Border:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="border" id="border" value="0" style="font-size: 10px; width: 100%;"></td> </tr> </table> </td> <td width="10">&nbsp;</td> <td style="vertical-align:top;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">&nbsp;</span> <table width="200" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="width: 115px;padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="100">Alignment:</td> <td style="width: 85px;padding-bottom: 2px; padding-top: 0px;"> <select name="align" id="align" style="font-family: arial, verdana, helvetica; font-size: 11px; width: 100%;"> <option value="">Not Set</option> <option value="left">Left</option> <option value="right">Right</option> <option value="texttop">Texttop</option> <option value="absmiddle">Absmiddle</option> <option value="baseline">Baseline</option> <option value="absbottom">Absbottom</option> <option value="bottom">Bottom</option> <option value="middle">Middle</option> <option value="top">Top</option> </select> </td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Horizontal Space:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="hspace" id="hspace" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Vertical Space:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="vspace" id="vspace" value="" style="font-size: 10px; width: 100%;"></td> </tr> </table> </td> </tr> </table> </td> <td style="vertical-align: top;width: 150px; padding-left: 5px;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Select Image:</span> <iframe id="chooser" frameborder="0" style="height:165px;width: 180px;border: 2px solid #FFFFFF; padding: 5px;" src="select_image.php?dir=<?php echo $leadon; ?>"></iframe> </td> </tr> <tr> <td colspan="2" align="right" style="padding-top: 5px;"> <input type="submit" value=" Submit " onclick="insertImage();return false;" style="font-size: 12px;"> <?php if ( $allowuploads ) { ?> <input type="submit" value=" Upload " style="font-size: 12px;"> <?php } ?> <input type="button" value=" Cancel " onclick="window.close();" style="font-size: 12px;"> </td> </tr> </form> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/addons/imagelibrary/insert_image.php
PHP
art
11,646
<?php /******************************************************************** * openImageLibrary addon Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. ********************************************************************/ require('config.inc.php'); error_reporting(0); if((substr($imagebaseurl, -1, 1)!='/') && $imagebaseurl!='') $imagebaseurl = $imagebaseurl . '/'; if((substr($imagebasedir, -1, 1)!='/') && $imagebasedir!='') $imagebasedir = $imagebasedir . '/'; $leadon = $imagebasedir; if($leadon=='.') $leadon = ''; if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/'; $startdir = $leadon; if($_GET['dir']) { if(substr($_GET['dir'], -1, 1)!='/') { $_GET['dir'] = $_GET['dir'] . '/'; } $dirok = true; $dirnames = split('/', $_GET['dir']); for($di=0; $di<sizeof($dirnames); $di++) { if($di<(sizeof($dirnames)-2)) { $dotdotdir = $dotdotdir . $dirnames[$di] . '/'; } } if(substr($_GET['dir'], 0, 1)=='/') { $dirok = false; } if($_GET['dir'] == $leadon) { $dirok = false; } if($dirok) { $leadon = $_GET['dir']; } } $opendir = $leadon; if(!$leadon) $opendir = '.'; if(!file_exists($opendir)) { $opendir = '.'; $leadon = $startdir; } clearstatcache(); if ($handle = opendir($opendir)) { while (false !== ($file = readdir($handle))) { //first see if this file is required in the listing if ($file == "." || $file == "..") continue; if (@filetype($leadon.$file) == "dir") { if(!$browsedirs) continue; $n++; if($_GET['sort']=="date") { $key = @filemtime($leadon.$file) . ".$n"; } else { $key = $n; } $dirs[$key] = $file . "/"; } else { $n++; if($_GET['sort']=="date") { $key = @filemtime($leadon.$file) . ".$n"; } elseif($_GET['sort']=="size") { $key = @filesize($leadon.$file) . ".$n"; } else { $key = $n; } $files[$key] = $file; } } closedir($handle); } //sort our files if($_GET['sort']=="date") { @ksort($dirs, SORT_NUMERIC); @ksort($files, SORT_NUMERIC); } elseif($_GET['sort']=="size") { @natcasesort($dirs); @ksort($files, SORT_NUMERIC); } else { @natcasesort($dirs); @natcasesort($files); } //order correctly if($_GET['order']=="desc" && $_GET['sort']!="size") {$dirs = @array_reverse($dirs);} if($_GET['order']=="desc") {$files = @array_reverse($files);} $dirs = @array_values($dirs); $files = @array_values($files); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Select Image</title> <style type="text/css"> body { margin: 0px; } a { font-family: Arial, verdana, helvetica; font-size: 11px; color: #000000; text-decoration: none; } a:hover { text-decoration: underline; } </style> <script type="text/javascript"> function selectImage(url) { if(parent) { parent.document.getElementById("src").value = url; } } if(parent) { parent.document.getElementById("dir").value = '<?php echo $leadon; ?>'; } </script> </head> <body> <table border="0"> <tbody> <?php $breadcrumbs = split('/', str_replace($basedir."/", "", $leadon)); if(($bsize = sizeof($breadcrumbs)) > 0) { if(($bsize-1) > 0) { echo "<tr><td>"; $sofar = ''; for($bi=0;$bi<($bsize-1);$bi++) { $sofar = $sofar . $breadcrumbs[$bi] . '/'; echo '<a href="'.$_SERVER['PHP_SELF'].'?dir='.urlencode($sofar).'" style="font-size:10px;font-family:Tahoma;">&raquo; '.$breadcrumbs[$bi].'</a><br>'; } echo "</td></tr>"; } } ?> <tr> <td> <?php $class = 'b'; if($dirok) { ?> <a href="<?php echo $_SERVER['PHP_SELF'].'?dir='.urlencode($dotdotdir); ?>"><img src="images/dirup.png" alt="Folder" border="0" /> <strong>..</strong></a><br> <?php if($class=='b') $class='w'; else $class = 'b'; } $arsize = sizeof($dirs); for($i=0;$i<$arsize;$i++) { $dir = substr($dirs[$i], 0, strlen($dirs[$i]) - 1); ?> <a href="<?php echo $_SERVER['PHP_SELF'].'?dir='.urlencode($leadon.$dirs[$i]); ?>"><img src="images/folder.png" alt="<?php echo $dir; ?>" border="0" /> <strong><?php echo $dir; ?></strong></a><br> <?php if($class=='b') $class='w'; else $class = 'b'; } $arsize = sizeof($files); for($i=0;$i<$arsize;$i++) { $icon = 'unknown.png'; $ext = strtolower(substr($files[$i], strrpos($files[$i], '.')+1)); if(in_array($ext, $supportedextentions)) { $thumb = ''; if($filetypes[$ext]) { $icon = $filetypes[$ext]; } $filename = $files[$i]; if(strlen($filename)>43) { $filename = substr($files[$i], 0, 40) . '...'; } $fileurl = $leadon . $files[$i]; $filedir = str_replace($imagebasedir, "", $leadon); ?> <a href="javascript:void(0)" onclick="selectImage('<?php echo $imagebaseurl.$filedir.$filename; ?>');"><img src="images/<?php echo $icon; ?>" alt="<?php echo $files[$i]; ?>" border="0" /> <strong><?php echo $filename; ?></strong></a><br> <?php if($class=='b') $class='w'; else $class = 'b'; } } ?> </td> </tr> </tbody> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/addons/imagelibrary/select_image.php
PHP
art
5,445
<?php /******************************************************************** * openImageLibrary addon v0.2.2 Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: config.inc.php,v 1.7 2006/12/17 21:34:28 xhaggi Exp $ * * An open source image library addon for the openWYSIWYG. * This library gives you the possibility to upload, browse and select * images on your webserver. * * Requirements: * - PHP 4.1.x or later * - openWYSIWYG v1.4.6 or later ********************************************************************/ /* * Path to a directory which holds the images. */ $imagebasedir = '../../uploads'; /* * An absolute or relative URL to the image folder. * This url is used to generate the source of the image. */ $imagebaseurl = 'uploads'; /* * Allow your users to browse the subdir of the defined basedir. */ $browsedirs = true; /* * If enabled users will be able to upload * files to any viewable directory. You should really only enable * this if the area this script is in is already password protected. */ $allowuploads = true; /* * If a user uploads a file with the same * name as an existing file do you want the existing file * to be overwritten? */ $overwrite = false; /* * Define the extentions you want to show within the * directory listing. The extensions also limit the * files the user can upload to your image folders. */ $supportedextentions = array( 'gif', 'png', 'jpeg', 'jpg', 'bmp' ); /* * If you want to add your own special file icons use * this section below. Each entry relates to the extension of the * given file, in the form <extension> => <filename>. * These files must be located within the dlf directory. */ $filetypes = array ( 'png' => 'jpg.gif', 'jpeg' => 'jpg.gif', 'bmp' => 'jpg.gif', 'jpg' => 'jpg.gif', 'gif' => 'gif.gif', 'psd' => 'psd.gif', ); ?>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/addons/imagelibrary/config.inc.php
PHP
art
2,021
/******************************************************************** * openWYSIWYG settings file Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg-settings.js,v 1.4 2007/01/22 23:05:57 xhaggi Exp $ ********************************************************************/ /* * Full featured setup used the openImageLibrary addon */ var full = new WYSIWYG.Settings(); //full.ImagesDir = "images/"; //full.PopupsDir = "popups/"; //full.CSSFile = "styles/wysiwyg.css"; full.Width = "85%"; full.Height = "250px"; // customize toolbar buttons full.addToolbarElement("font", 3, 1); full.addToolbarElement("fontsize", 3, 2); full.addToolbarElement("headings", 3, 3); // openImageLibrary addon implementation full.ImagePopupFile = "addons/imagelibrary/insert_image.php"; full.ImagePopupWidth = 600; full.ImagePopupHeight = 245; /* * Small Setup Example */ var small = new WYSIWYG.Settings(); small.Width = "350px"; small.Height = "100px"; small.DefaultStyle = "font-family: Arial; font-size: 12px; background-color: #AA99AA"; small.Toolbar[0] = new Array("font", "fontsize", "bold", "italic", "underline"); // small setup for toolbar 1 small.Toolbar[1] = ""; // disable toolbar 2 small.StatusBarEnabled = false;
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/scripts/wysiwyg-settings.js
JavaScript
art
1,340
/******************************************************************** * openWYSIWYG v1.47 Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg.js,v 1.22 2007/09/08 21:45:57 xhaggi Exp $ * $Revision: 1.22 $ * * An open source WYSIWYG editor for use in web based applications. * For full source code and docs, visit http://www.openwebware.com * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License along * with this library; if not, write to the Free Software Foundation, Inc., 59 * Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************************/ var WYSIWYG = { /** * Settings class, holds all customizeable properties */ Settings: function() { // Images Directory this.ImagesDir = "images/"; // Popups Directory this.PopupsDir = "popups/"; // CSS Directory File this.CSSFile = "styles/wysiwyg.css"; // Default WYSIWYG width and height (use px or %) this.Width = "500px"; this.Height = "200px"; // Default stylesheet of the WYSIWYG editor window this.DefaultStyle = "font-family: Arial; font-size: 12px; background-color: #FFFFFF"; // Stylesheet if editor is disabled this.DisabledStyle = "font-family: Arial; font-size: 12px; background-color: #EEEEEE"; // Width + Height of the preview window this.PreviewWidth = 500; this.PreviewHeight = 400; // Confirmation message if you strip any HTML added by word this.RemoveFormatConfMessage = "Clean HTML inserted by MS Word ?"; // Nofication if browser is not supported by openWYSIWYG, leave it blank for no message output. this.NoValidBrowserMessage = "openWYSIWYG does not support your browser."; // Anchor path to strip, leave it blank to ignore // or define auto to strip the path where the editor is placed // (only IE) this.AnchorPathToStrip = "auto"; // Image path to strip, leave it blank to ignore // or define auto to strip the path where the editor is placed // (only IE) this.ImagePathToStrip = "auto"; // Enable / Disable the custom context menu this.ContextMenu = true; // Enabled the status bar update. Within the status bar // node tree of the actually selected element will build this.StatusBarEnabled = true; // If enabled than the capability of the IE inserting line breaks will be inverted. // Normal: ENTER = <p> , SHIFT + ENTER = <br> // Inverted: ENTER = <br>, SHIFT + ENTER = <p> this.InvertIELineBreaks = false; // Replace line breaks with <br> tags this.ReplaceLineBreaks = false; // Page that opened the WYSIWYG (Used for the return command) this.Opener = "admin.asp"; // Insert image implementation this.ImagePopupFile = ""; this.ImagePopupWidth = 0; this.ImagePopupHeight = 0; // Holds the available buttons displayed // on the toolbar of the editor this.Toolbar = new Array(); this.Toolbar[0] = new Array( "font", "fontsize", "headings", "bold", "italic", "underline", "strikethrough", "seperator", "forecolor", "backcolor", "seperator", "justifyfull", "justifyleft", "justifycenter", "justifyright", "seperator", "unorderedlist", "orderedlist", "outdent", "indent" ); this.Toolbar[1] = new Array( "save", // "return", // return button disabled by default "seperator", "subscript", "superscript", "seperator", "cut", "copy", "paste", "removeformat", "seperator", "undo", "redo", "seperator", "inserttable", "insertimage", "createlink", "seperator", "preview", "print", "seperator", "viewSource", "maximize", "seperator", "help" ); // DropDowns this.DropDowns = new Array(); // Fonts this.DropDowns['font'] = { id: "fonts", command: "FontName", label: "<font style=\"font-family:{value};font-size:12px;\">{value}</font>", width: "90px", elements: new Array( "Arial", "Sans Serif", "Tahoma", "Verdana", "Courier New", "Georgia", "Times New Roman", "Impact", "Comic Sans MS" ) }; // Font sizes this.DropDowns['fontsize'] = { id: "fontsizes", command: "FontSize", label: "<font size=\"{value}\">Size {value}</font>", width: "54px", elements: new Array( "1", "2", "3", "4", "5", "6", "7" ) }; // Headings this.DropDowns['headings'] = { id: "headings", command: "FormatBlock", label: "<{value} style=\"margin:0px;text-decoration:none;font-family:Arial\">{value}</{value}>", width: "74px", elements: new Array( "H1", "H2", "H3", "H4", "H5", "H6" ) }; // Add the given element to the defined toolbar // on the defined position this.addToolbarElement = function(element, toolbar, position) { if(element != "seperator") {this.removeToolbarElement(element);} if(this.Toolbar[toolbar-1] == null) { this.Toolbar[toolbar-1] = new Array(); } this.Toolbar[toolbar-1].splice(position+1, 1, element); }; // Remove an element from the toolbar this.removeToolbarElement = function(element) { if(element == "seperator") {return;} // do not remove seperators for(var i=0;i<this.Toolbar.length;i++) { if(this.Toolbar[i]) { var toolbar = this.Toolbar[i]; for(var j=0;j<toolbar.length;j++) { if(toolbar[j] != null && toolbar[j] == element) { this.Toolbar[i].splice(j,1); } } } } }; // clear all or a given toolbar this.clearToolbar = function(toolbar) { if(typeof toolbar == "undefined") { this.Toolbar = new Array(); } else { this.Toolbar[toolbar+1] = new Array(); } }; }, /* ---------------------------------------------------------------------- *\ !! Do not change something below or you know what you are doning !! \* ---------------------------------------------------------------------- */ // List of available block formats (not in use) //BlockFormats: new Array("Address", "Bulleted List", "Definition", "Definition Term", "Directory List", "Formatted", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Heading 5", "Heading 6", "Menu List", "Normal", "Numbered List"), // List of available actions and their respective ID and images ToolbarList: { //Name buttonID buttonTitle buttonImage buttonImageRollover "bold": ['Bold', 'Bold', 'bold.gif', 'bold_on.gif'], "italic": ['Italic', 'Italic', 'italics.gif', 'italics_on.gif'], "underline": ['Underline', 'Underline', 'underline.gif', 'underline_on.gif'], "strikethrough": ['Strikethrough', 'Strikethrough', 'strikethrough.gif', 'strikethrough_on.gif'], "seperator": ['', '', 'seperator.gif', 'seperator.gif'], "subscript": ['Subscript', 'Subscript', 'subscript.gif', 'subscript_on.gif'], "superscript": ['Superscript', 'Superscript', 'superscript.gif', 'superscript_on.gif'], "justifyleft": ['Justifyleft', 'Justifyleft', 'justify_left.gif', 'justify_left_on.gif'], "justifycenter": ['Justifycenter', 'Justifycenter', 'justify_center.gif', 'justify_center_on.gif'], "justifyright": ['Justifyright', 'Justifyright', 'justify_right.gif', 'justify_right_on.gif'], "justifyfull": ['Justifyfull', 'Justifyfull', 'justify_justify.gif', 'justify_justify_on.gif'], "unorderedlist": ['InsertUnorderedList', 'Insert Unordered List', 'list_unordered.gif', 'list_unordered_on.gif'], "orderedlist": ['InsertOrderedList', 'Insert Ordered List', 'list_ordered.gif', 'list_ordered_on.gif'], "outdent": ['Outdent', 'Outdent', 'indent_left.gif', 'indent_left_on.gif'], "indent": ['Indent', 'Indent', 'indent_right.gif', 'indent_right_on.gif'], "cut": ['Cut', 'Cut', 'cut.gif', 'cut_on.gif'], "copy": ['Copy', 'Copy', 'copy.gif', 'copy_on.gif'], "paste": ['Paste', 'Paste', 'paste.gif', 'paste_on.gif'], "forecolor": ['ForeColor', 'Fore Color', 'forecolor.gif', 'forecolor_on.gif'], "backcolor": ['BackColor', 'Back Color', 'backcolor.gif', 'backcolor_on.gif'], "undo": ['Undo', 'Undo', 'undo.gif', 'undo_on.gif'], "redo": ['Redo', 'Redo', 'redo.gif', 'redo_on.gif'], "inserttable": ['InsertTable', 'Insert Table', 'insert_table.gif', 'insert_table_on.gif'], "insertimage": ['InsertImage', 'Insert Image', 'insert_picture.gif', 'insert_picture_on.gif'], "createlink": ['CreateLink', 'Create Link', 'insert_hyperlink.gif', 'insert_hyperlink_on.gif'], "viewSource": ['ViewSource', 'View Source', 'view_source.gif', 'view_source_on.gif'], "viewText": ['ViewText', 'View Text', 'view_text.gif', 'view_text_on.gif'], "help": ['Help', 'Help', 'help.gif', 'help_on.gif'], "fonts": ['Fonts', 'Select Font', 'select_font.gif', 'select_font_on.gif'], "fontsizes": ['Fontsizes', 'Select Size', 'select_size.gif', 'select_size_on.gif'], "headings": ['Headings', 'Select Size', 'select_heading.gif', 'select_heading_on.gif'], "preview": ['Preview', 'Preview', 'preview.gif', 'preview_on.gif'], "print": ['Print', 'Print', 'print.gif', 'print_on.gif'], "removeformat": ['RemoveFormat', 'Strip Word HTML', 'remove_format.gif', 'remove_format_on.gif'], "delete": ['Delete', 'Delete', 'delete.gif', 'delete_on.gif'], "save": ['Save', 'Save document', 'save.gif', 'save_on.gif'], "return": ['Return', 'Return without saving', 'return.gif', 'return_on.gif'], "maximize": ['Maximize', 'Maximize the editor', 'maximize.gif', 'maximize_on.gif'] }, // stores the different settings for each textarea // the textarea identifier is used to store the settings object config: new Array(), // Create viewTextMode global variable and set to 0 // enabling all toolbar commands while in HTML mode viewTextMode: new Array(), // maximized maximized: new Array(), /** * Get the range of the given selection * * @param {Selection} sel Selection object * @return {Range} Range object */ getRange: function(sel) { return sel.createRange ? sel.createRange() : sel.getRangeAt(0); }, /** * Return the editor div element * * @param {String} n Editor identifier * @return {HtmlDivElement} Iframe object */ getEditorDiv: function(n) { return $("wysiwyg_div_" + n); }, /** * Return the editor table element * * @param {String} n Editor identifier * @return {HtmlTableElement} Iframe object */ getEditorTable: function(n) { return $("wysiwyg_table_" + n); }, /** * Get the iframe object of the WYSIWYG editor * * @param {String} n Editor identifier * @return {HtmlIframeElement} Iframe object */ getEditor: function(n) { return $("wysiwyg" + n); }, /** * Get editors window element * * @param {String} n Editor identifier * @return {HtmlWindowElement} Html window object */ getEditorWindow: function(n) { return this.getEditor(n).contentWindow; }, /** * Attach the WYSIWYG editor to the given textarea element * * @param {String} id Textarea identifier (all = all textareas) * @param {Settings} settings the settings which will be applied to the textarea */ attach: function(id, settings) { if(id != "all") { this.setSettings(id, settings); WYSIWYG_Core.includeCSS(this.config[id].CSSFile); WYSIWYG_Core.addEvent(window, "load", function generateEditor() {WYSIWYG._generate(id, settings);}); } else { WYSIWYG_Core.addEvent(window, "load", function generateEditor() {WYSIWYG.attachAll(settings);}); } }, /** * Attach the WYSIWYG editor to all textarea elements * * @param {Settings} settings Settings to customize the look and feel */ attachAll: function(settings) { var areas = document.getElementsByTagName("textarea"); for(var i=0;i<areas.length;i++) { var id = areas[i].getAttribute("id"); if(id == null || id == "") continue; this.setSettings(id, settings); WYSIWYG_Core.includeCSS(this.config[id].CSSFile); WYSIWYG._generate(id, settings); } }, /** * Display an iframe instead of the textarea. * It's used as textarea replacement to display HTML. * * @param id Textarea identifier (all = all textareas) * @param settings the settings which will be applied to the textarea */ display: function(id, settings) { if(id != "all") { this.setSettings(id, settings); WYSIWYG_Core.includeCSS(this.config[id].CSSFile); WYSIWYG_Core.addEvent(window, "load", function displayIframe() {WYSIWYG._display(id, settings);}); } else { WYSIWYG_Core.addEvent(window, "load", function displayIframe() {WYSIWYG.displayAll(settings);}); } }, /** * Display an iframe instead of the textarea. * It's apply the iframe to all textareas found in the current document. * * @param settings Settings to customize the look and feel */ displayAll: function(settings) { var areas = document.getElementsByTagName("textarea"); for(var i=0;i<areas.length;i++) { var id = areas[i].getAttribute("id"); if(id == null || id == "") continue; this.setSettings(id, settings); WYSIWYG_Core.includeCSS(this.config[id].CSSFile); WYSIWYG._display(id, settings); } }, /** * Set settings in config array, use the textarea id as identifier * * @param n Textarea identifier (all = all textareas) * @param settings the settings which will be applied to the textarea */ setSettings: function(n, settings) { if(typeof(settings) != "object") { this.config[n] = new this.Settings(); } else { this.config[n] = settings; } }, /** * Insert or modify an image * * @param {String} src Source of the image * @param {Integer} width Width * @param {Integer} height Height * @param {String} align Alignment of the image * @param {String} border Border size * @param {String} alt Alternativ Text * @param {Integer} hspace Horizontal Space * @param {Integer} vspace Vertical Space * @param {String} n The editor identifier (the textarea's ID) */ insertImage: function(src, width, height, align, border, alt, hspace, vspace, n) { // get editor var doc = this.getEditorWindow(n).document; // get selection and range var sel = this.getSelection(n); var range = this.getRange(sel); // the current tag of range var img = this.findParent("img", range); // element is not a link var update = (img == null) ? false : true; if(!update) { img = doc.createElement("img"); } // set the attributes WYSIWYG_Core.setAttribute(img, "src", src); WYSIWYG_Core.setAttribute(img, "style", "width:" + width + ";height:" + height); if(align != "") { WYSIWYG_Core.setAttribute(img, "align", align); } else { img.removeAttribute("align"); } WYSIWYG_Core.setAttribute(img, "border", border); WYSIWYG_Core.setAttribute(img, "alt", alt); WYSIWYG_Core.setAttribute(img, "hspace", hspace); WYSIWYG_Core.setAttribute(img, "vspace", vspace); img.removeAttribute("width"); img.removeAttribute("height"); // on update exit here if(update) { return; } // Check if IE or Mozilla (other) if (WYSIWYG_Core.isMSIE) { range.pasteHTML(img.outerHTML); } else { this.insertNodeAtSelection(img, n); } }, /** * Insert or modify a link * * @param {String} href The url of the link * @param {String} target Target of the link * @param {String} style Stylesheet of the link * @param {String} styleClass Stylesheet class of the link * @param {String} name Name attribute of the link * @param {String} n The editor identifier (the textarea's ID) */ insertLink: function(href, target, style, styleClass, name, n) { // get editor var doc = this.getEditorWindow(n).document; // get selection and range var sel = this.getSelection(n); var range = this.getRange(sel); var lin = null; // get element from selection if(WYSIWYG_Core.isMSIE) { if(sel.type == "Control" && range.length == 1) { range = this.getTextRange(range(0)); range.select(); } } // find a as parent element lin = this.findParent("a", range); // check if parent is found var update = (lin == null) ? false : true; if(!update) { lin = doc.createElement("a"); } // set the attributes WYSIWYG_Core.setAttribute(lin, "href", href); WYSIWYG_Core.setAttribute(lin, "class", styleClass); WYSIWYG_Core.setAttribute(lin, "className", styleClass); WYSIWYG_Core.setAttribute(lin, "target", target); WYSIWYG_Core.setAttribute(lin, "name", name); WYSIWYG_Core.setAttribute(lin, "style", style); // on update exit here if(update) { return; } // Check if IE or Mozilla (other) if (WYSIWYG_Core.isMSIE) { range.select(); lin.innerHTML = range.htmlText; range.pasteHTML(lin.outerHTML); } else { var node = range.startContainer; var pos = range.startOffset; if(node.nodeType != 3) { node = node.childNodes[pos]; } if(node.tagName) lin.appendChild(node); else lin.innerHTML = sel; this.insertNodeAtSelection(lin, n); } }, /** * Strips any HTML added by word * * @param {String} n The editor identifier (the textarea's ID) */ removeFormat: function(n) { if ( !confirm(this.config[n].RemoveFormatConfMessage) ) { return; } var doc = this.getEditorWindow(n).document; var str = doc.body.innerHTML; str = str.replace(/<span([^>])*>(&nbsp;)*\s*<\/span>/gi, ''); str = str.replace(/<span[^>]*>/gi, ''); str = str.replace(/<\/span[^>]*>/gi, ''); str = str.replace(/<p([^>])*>(&nbsp;)*\s*<\/p>/gi, ''); str = str.replace(/<p[^>]*>/gi, ''); str = str.replace(/<\/p[^>]*>/gi, ''); str = str.replace(/<h([^>])[0-9]>(&nbsp;)*\s*<\/h>/gi, ''); str = str.replace(/<h[^>][0-9]>/gi, ''); str = str.replace(/<\/h[^>][0-9]>/gi, ''); str = str.replace (/<B [^>]*>/ig, '<b>'); // var repl_i1 = /<I[^>]*>/ig; // str = str.replace (repl_i1, '<i>'); str = str.replace (/<DIV[^>]*>/ig, ''); str = str.replace (/<\/DIV>/gi, ''); str = str.replace (/<[\/\w?]+:[^>]*>/ig, ''); str = str.replace (/(&nbsp;){2,}/ig, '&nbsp;'); str = str.replace (/<STRONG>/ig, ''); str = str.replace (/<\/STRONG>/ig, ''); str = str.replace (/<TT>/ig, ''); str = str.replace (/<\/TT>/ig, ''); str = str.replace (/<FONT [^>]*>/ig, ''); str = str.replace (/<\/FONT>/ig, ''); str = str.replace (/STYLE=\"[^\"]*\"/ig, ''); str = str.replace(/<([\w]+) class=([^ |>]*)([^>]*)/gi, '<$1$3'); str = str.replace(/<([\w]+) style="([^"]*)"([^>]*)/gi, '<$1$3'); str = str.replace(/width=([^ |>]*)([^>]*)/gi, ''); str = str.replace(/classname=([^ |>]*)([^>]*)/gi, ''); str = str.replace(/align=([^ |>]*)([^>]*)/gi, ''); str = str.replace(/valign=([^ |>]*)([^>]*)/gi, ''); str = str.replace(/<\\?\??xml[^>]>/gi, ''); str = str.replace(/<\/?\w+:[^>]*>/gi, ''); str = str.replace(/<st1:.*?>/gi, ''); str = str.replace(/o:/gi, ''); str = str.replace(/<!--([^>])*>(&nbsp;)*\s*<\/-->/gi, ''); str = str.replace(/<!--[^>]*>/gi, ''); str = str.replace(/<\/--[^>]*>/gi, ''); doc.body.innerHTML = str; }, /** * Display an iframe instead of the textarea. * * @private * @param {String} n The editor identifier (the textarea's ID) * @param {Object} settings Object which holds the settings */ _display: function(n, settings) { // Get the textarea element var textarea = $(n); // Validate if textarea exists if(textarea == null) { alert("No textarea found with the given identifier (ID: " + n + ")."); return; } // Validate browser compatiblity if(!WYSIWYG_Core.isBrowserCompatible()) { if(this.config[n].NoValidBrowserMessage != "") { alert(this.config[n].NoValidBrowserMessage); } return; } // Load settings in config array, use the textarea id as identifier if(typeof(settings) != "object") { this.config[n] = new this.Settings(); } else { this.config[n] = settings; } // Hide the textarea textarea.style.display = "none"; // Override the width and height of the editor with the // size given by the style attributes width and height if(textarea.style.width) { this.config[n].Width = textarea.style.width; } if(textarea.style.height) { this.config[n].Height = textarea.style.height } // determine the width + height var currentWidth = this.config[n].Width; var currentHeight = this.config[n].Height; // Calculate the width + height of the editor var ifrmWidth = "100%"; var ifrmHeight = "100%"; if(currentWidth.search(/%/) == -1) { ifrmWidth = currentWidth; ifrmHeight = currentHeight; } // Create iframe which will be used for rich text editing var iframe = '<table cellpadding="0" cellspacing="0" border="0" style="width:' + currentWidth + '; height:' + currentHeight + ';" class="tableTextareaEditor"><tr><td valign="top">\n' + '<iframe frameborder="0" id="wysiwyg' + n + '" class="iframeText" style="width:' + ifrmWidth + ';height:' + ifrmHeight + ';"></iframe>\n' + '</td></tr></table>\n'; // Insert after the textArea both toolbar one and two textarea.insertAdjacentHTML("afterEnd", iframe); // Pass the textarea's existing text over to the content variable var content = textarea.value; var doc = this.getEditorWindow(n).document; // Replace all \n with <br> if(this.config[n].ReplaceLineBreaks) { content = content.replace(/(\r\n)|(\n)/ig, "<br>"); } // Write the textarea's content into the iframe doc.open(); doc.write(content); doc.close(); // Set default style of the editor window WYSIWYG_Core.setAttribute(doc.body, "style", this.config[n].DefaultStyle); }, /** * Replace the given textarea with wysiwyg editor * * @private * @param {String} n The editor identifier (the textarea's ID) * @param {Object} settings Object which holds the settings */ _generate: function(n, settings) { // Get the textarea element var textarea = $(n); // Validate if textarea exists if(textarea == null) { alert("No textarea found with the given identifier (ID: " + n + ")."); return; } // Validate browser compatiblity if(!WYSIWYG_Core.isBrowserCompatible()) { if(this.config[n].NoValidBrowserMessage != "") { alert(this.config[n].NoValidBrowserMessage); } return; } // Hide the textarea textarea.style.display = 'none'; // Override the width and height of the editor with the // size given by the style attributes width and height if(textarea.style.width) { this.config[n].Width = textarea.style.width; } if(textarea.style.height) { this.config[n].Height = textarea.style.height } // determine the width + height var currentWidth = this.config[n].Width; var currentHeight = this.config[n].Height; // Calculate the width + height of the editor var toolbarWidth = currentWidth; var ifrmWidth = "100%"; var ifrmHeight = "100%"; if(currentWidth.search(/%/) == -1) { toolbarWidth = currentWidth.replace(/px/gi, ""); toolbarWidth = (parseFloat(toolbarWidth) + 2) + "px"; ifrmWidth = currentWidth; ifrmHeight = currentHeight; } // Generate the WYSIWYG Table // This table holds the toolbars and the iframe as the editor var editor = ""; editor += '<div id="wysiwyg_div_' + n + '" style="width:' + currentWidth +';">'; editor += '<table border="0" cellpadding="0" cellspacing="0" class="tableTextareaEditor" id="wysiwyg_table_' + n + '" style="width:' + currentWidth + '; height:' + currentHeight + ';">'; editor += '<tr><td style="height:22px;vertical-align:top;">'; // Output all command buttons that belong to toolbar one for (var j = 0; j < this.config[n].Toolbar.length;j++) { if(this.config[n].Toolbar[j] && this.config[n].Toolbar[j].length > 0) { var toolbar = this.config[n].Toolbar[j]; // Generate WYSIWYG toolbar one editor += '<table border="0" cellpadding="0" cellspacing="0" class="toolbar1" style="width:100%;" id="toolbar' + j + '_' + n + '">'; editor += '<tr><td style="width:6px;"><img src="' + this.config[n].ImagesDir + 'seperator2.gif" alt="" hspace="3"></td>'; // Interate over the toolbar element for (var i = 0; i < toolbar.length;i++) { var id = toolbar[i]; if (toolbar[i]) { if(typeof (this.config[n].DropDowns[id]) != "undefined") { var dropdown = this.config[n].DropDowns[id]; editor += '<td style="width: ' + dropdown.width + ';">'; // write the drop down content editor += this.writeDropDown(n, id); editor += '</td>'; } else { // Get the values of the Button from the global ToolbarList object var buttonObj = this.ToolbarList[toolbar[i]]; if(buttonObj) { var buttonID = buttonObj[0]; var buttonTitle = buttonObj[1]; var buttonImage = this.config[n].ImagesDir + buttonObj[2]; var buttonImageRollover = this.config[n].ImagesDir + buttonObj[3]; if (toolbar[i] == "seperator") { editor += '<td style="width: 12px;" align="center">'; editor += '<img src="' + buttonImage + '" border=0 unselectable="on" width="2" height="18" hspace="2" unselectable="on">'; editor += '</td>'; } // View Source button else if (toolbar[i] == "viewSource"){ editor += '<td style="width: 22px;">'; editor += '<span id="HTMLMode' + n + '"><img src="' + buttonImage + '" border="0" unselectable="on" title="' + buttonTitle + '" id="' + buttonID + '" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\'' + buttonImageRollover + '\';" onmouseout="this.className=\'buttonEditor\'; this.src=\'' + buttonImage + '\';" onclick="WYSIWYG.execCommand(\'' + n + '\', \'' + buttonID + '\');" unselectable="on" width="20" height="20"></span>'; editor += '<span id="textMode' + n + '"><img src="' + this.config[n].ImagesDir + 'view_text.gif" border="0" unselectable="on" title="viewText" id="ViewText" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\'' + this.config[n].ImagesDir + 'view_text_on.gif\';" onmouseout="this.className=\'buttonEditor\'; this.src=\'' + this.config[n].ImagesDir + 'view_text.gif\';" onclick="WYSIWYG.execCommand(\'' + n + '\',\'ViewText\');" unselectable="on" width="20" height="20"></span>'; editor += '</td>'; } else { editor += '<td style="width: 22px;">'; editor += '<img src="' + buttonImage + '" border=0 unselectable="on" title="' + buttonTitle + '" id="' + buttonID + '" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\'' + buttonImageRollover + '\';" onmouseout="this.className=\'buttonEditor\'; this.src=\'' + buttonImage + '\';" onclick="WYSIWYG.execCommand(\'' + n + '\', \'' + buttonID + '\');" unselectable="on" width="20" height="20">'; editor += '</td>'; } } } } } editor += '<td>&nbsp;</td></tr></table>'; } } editor += '</td></tr><tr><td valign="top">\n'; // Create iframe which will be used for rich text editing editor += '<iframe frameborder="0" id="wysiwyg' + n + '" class="iframeText" style="width:100%;height:' + currentHeight + ';"></iframe>\n' + '</td></tr>'; // Status bar HTML code if(this.config[n].StatusBarEnabled) { editor += '<tr><td class="wysiwyg-statusbar" style="height:10px;" id="wysiwyg_statusbar_' + n + '">&nbsp;</td></tr>'; } editor += '</table>'; editor += '</div>'; // Insert the editor after the textarea textarea.insertAdjacentHTML("afterEnd", editor); // Hide the "Text Mode" button // Validate if textMode Elements are prensent if($("textMode" + n)) { $("textMode" + n).style.display = 'none'; } // Pass the textarea's existing text over to the content variable var content = textarea.value; var doc = this.getEditorWindow(n).document; // Replace all \n with <br> if(this.config[n].ReplaceLineBreaks) { content = content.replace(/\n\r|\n/ig, "<br>"); } // Write the textarea's content into the iframe doc.open(); doc.write(content); doc.close(); // Make the iframe editable in both Mozilla and IE // Improve compatiblity for IE + Mozilla if (doc.body.contentEditable) { doc.body.contentEditable = true; } else { doc.designMode = "on"; } // Set default font style WYSIWYG_Core.setAttribute(doc.body, "style", this.config[n].DefaultStyle); // Enable table highlighting WYSIWYG_Table.refreshHighlighting(n); // Event Handling // Update the textarea with content in WYSIWYG when user submits form for (var idx=0; idx < document.forms.length; idx++) { WYSIWYG_Core.addEvent(document.forms[idx], "submit", function xxx_aa() { WYSIWYG.updateTextArea(n); }); } // close font selection if mouse moves over the editor window WYSIWYG_Core.addEvent(doc, "mouseover", function xxx_bb() { WYSIWYG.closeDropDowns(n);}); // If it's true invert the line break capability of IE if(this.config[n].InvertIELineBreaks) { WYSIWYG_Core.addEvent(doc, "keypress", function xxx_cc() { WYSIWYG.invertIELineBreakCapability(n); }); } // status bar update if(this.config[n].StatusBarEnabled) { WYSIWYG_Core.addEvent(doc, "mouseup", function xxx_dd() { WYSIWYG.updateStatusBar(n); }); } // custom context menu if(this.config[n].ContextMenu) { WYSIWYG_ContextMenu.init(n); } // init viewTextMode var this.viewTextMode[n] = false; }, /** * Disable the given WYSIWYG Editor Box * * @param {String} n The editor identifier (the textarea's ID) */ disable: function(n) { // get the editor window var editor = this.getEditorWindow(n); // Validate if editor exists if(editor == null) { alert("No editor found with the given identifier (ID: " + n + ")."); return; } if(editor) { // disable design mode or content editable feature if(editor.document.body.contentEditable) { editor.document.body.contentEditable = false; } else { editor.document.designMode = "Off"; } // change the style of the body WYSIWYG_Core.setAttribute(editor.document.body, "style", this.config[n].DisabledStyle); // hide the status bar this.hideStatusBar(n); // hide all toolbars this.hideToolbars(n); } }, /** * Enables the given WYSIWYG Editor Box * * @param {String} n The editor identifier (the textarea's ID) */ enable: function(n) { // get the editor window var editor = this.getEditorWindow(n); // Validate if editor exists if(editor == null) { alert("No editor found with the given identifier (ID: " + n + ")."); return; } if(editor) { // disable design mode or content editable feature if(editor.document.body.contentEditable){ editor.document.body.contentEditable = true; } else { editor.document.designMode = "On"; } // change the style of the body WYSIWYG_Core.setAttribute(editor.document.body, "style", this.config[n].DefaultStyle); // hide the status bar this.showStatusBar(n); // hide all toolbars this.showToolbars(n); } }, /** * Returns the node structure of the current selection as array * * @param {String} n The editor identifier (the textarea's ID) */ getNodeTree: function(n) { var sel = this.getSelection(n); var range = this.getRange(sel); // get element of range var tag = this.getTag(range); if(tag == null) { return; } // get parent of element var node = this.getParent(tag); // init the tree as array with the current selected element var nodeTree = new Array(tag); // get all parent nodes var ii = 1; while(node != null && node.nodeName != "#document") { nodeTree[ii] = node; node = this.getParent(node); ii++; } return nodeTree; }, /** * Removes the current node of the selection * * @param {String} n The editor identifier (the textarea's ID) */ removeNode: function(n) { // get selection and range var sel = this.getSelection(n); var range = this.getRange(sel); // the current tag of range var tag = this.getTag(range); var parent = tag.parentNode; if(tag == null || parent == null) { return; } if(tag.nodeName == "HTML" || tag.nodeName == "BODY") { return; } // copy child elements of the node to the parent element before remove the node var childNodes = new Array(); for(var i=0; i < tag.childNodes.length;i++) childNodes[i] = tag.childNodes[i]; for(var i=0; i < childNodes.length;i++) parent.insertBefore(childNodes[i], tag); // remove node parent.removeChild(tag); // validate if parent is a link and the node is only // surrounded by the link, then remove the link too if(parent.nodeName == "A" && !parent.hasChildNodes()) { if(parent.parentNode) { parent.parentNode.removeChild(parent); } } // update the status bar this.updateStatusBar(n); }, /** * Get the selection of the given editor * * @param {String} n The editor identifier (the textarea's ID) */ getSelection: function(n) { var ifrm = this.getEditorWindow(n); var doc = ifrm.document; var sel = null; if(ifrm.getSelection){ sel = ifrm.getSelection(); } else if (doc.getSelection) { sel = doc.getSelection(); } else if (doc.selection) { sel = doc.selection; } return sel; }, /** * Updates the status bar with the current node tree * * @param {String} n The editor identifier (the textarea's ID) */ updateStatusBar: function(n) { // get the node structure var nodeTree = this.getNodeTree(n); if(nodeTree == null) { return; } // format the output var outputTree = ""; var max = nodeTree.length - 1; for(var i=max;i>=0;i--) { if(nodeTree[i].nodeName != "HTML" && nodeTree[i].nodeName != "BODY") { outputTree += '<a class="wysiwyg-statusbar" href="javascript:WYSIWYG.selectNode(\'' + n + '\',' + i + ');">' + nodeTree[i].nodeName + '</a>'; } else { outputTree += nodeTree[i].nodeName; } if(i > 0) { outputTree += " > "; } } // update the status bar var statusbar = $("wysiwyg_statusbar_" + n); if(statusbar){ statusbar.innerHTML = outputTree; } }, /** * Execute a command on the editor document * * @param {String} command The execCommand (e.g. Bold) * @param {String} n The editor identifier * @param {String} value The value when applicable */ execCommand: function(n, cmd, value) { // When user clicks toolbar button make sure it always targets its respective WYSIWYG this.getEditorWindow(n).focus(); // When in Text Mode these execCommands are enabled var textModeCommands = new Array("ViewText", "Print"); // Check if in Text mode and a disabled command execute var cmdValid = false; for (var i = 0; i < textModeCommands.length; i++) { if (textModeCommands[i] == cmd) { cmdValid = true; } } if(this.viewTextMode[n] && !cmdValid) { alert("You are in TEXT Mode. This feature has been disabled."); return; } // rbg to hex convertion implementation dependents on browser var toHexColor = WYSIWYG_Core.isMSIE ? WYSIWYG_Core._dec_to_rgb : WYSIWYG_Core.toHexColor; // popup screen positions var popupPosition = {left: parseInt(window.screen.availWidth / 3), top: parseInt(window.screen.availHeight / 3)}; // Check the insert image popup implementation var imagePopupFile = this.config[n].PopupsDir + 'insert_image.html'; var imagePopupWidth = 400; var imagePopupHeight = 210; if(typeof this.config[n].ImagePopupFile != "undefined" && this.config[n].ImagePopupFile != "") { imagePopupFile = this.config[n].ImagePopupFile; } if(typeof this.config[n].ImagePopupWidth && this.config[n].ImagePopupWidth > 0) { imagePopupWidth = this.config[n].ImagePopupWidth; } if(typeof this.config[n].ImagePopupHeight && this.config[n].ImagePopupHeight > 0) { imagePopupHeight = this.config[n].ImagePopupHeight; } // switch which action have to do switch(cmd) { case "Maximize": this.maximize(n); break; case "FormatBlock": WYSIWYG_Core.execCommand(n, cmd, "<" + value + ">"); break; // ForeColor and case "ForeColor": var rgb = this.getEditorWindow(n).document.queryCommandValue(cmd); var currentColor = rgb != '' ? toHexColor(this.getEditorWindow(n).document.queryCommandValue(cmd)) : "000000"; window.open(this.config[n].PopupsDir + 'select_color.html?color=' + currentColor + '&command=' + cmd + '&wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,width=210,height=165,top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // BackColor case "BackColor": var currentColor = toHexColor(this.getEditorWindow(n).document.queryCommandValue(cmd)); window.open(this.config[n].PopupsDir + 'select_color.html?color=' + currentColor + '&command=' + cmd + '&wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,width=210,height=165,top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // InsertImage case "InsertImage": window.open(imagePopupFile + '?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=' + imagePopupWidth + ',height=' + imagePopupHeight + ',top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // Remove Image case "RemoveImage": this.removeImage(n); break; // Remove Link case "RemoveLink": this.removeLink(n); break; // Remove a Node case "RemoveNode": this.removeNode(n); break; // Create Link case "CreateLink": window.open(this.config[n].PopupsDir + 'insert_hyperlink.html?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=350,height=160,top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // InsertTable case "InsertTable": window.open(this.config[n].PopupsDir + 'create_table.html?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=500,height=260,top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // ViewSource case "ViewSource": this.viewSource(n); break; // ViewText case "ViewText": this.viewText(n); break; // Help case "Help": window.open(this.config[n].PopupsDir + 'about.html?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=400,height=350,top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // Strip any HTML added by word case "RemoveFormat": this.removeFormat(n); break; // Preview thx to Korvo case "Preview": window.open(this.config[n].PopupsDir + 'preview.html?wysiwyg=' + n,'popup', 'location=0,status=0,scrollbars=1,resizable=1,width=' + this.config[n].PreviewWidth + ',height=' + this.config[n].PreviewHeight + ',top=' + popupPosition.top + ',left=' + popupPosition.left).focus(); break; // Print case "Print": this.print(n); break; // Save case "Save": WYSIWYG.updateTextArea(n); var form = WYSIWYG_Core.findParentNode("FORM", this.getEditor(n)); if(form == null) { alert("Can not submit the content, because no form element found."); return; } form.submit(); break; // Return case "Return": location.replace(this.config[n].Opener); break; default: WYSIWYG_Core.execCommand(n, cmd, value); } // hide node the font + font size selection this.closeDropDowns(n); }, /** * Maximize the editor instance * * @param {String} n The editor identifier */ maximize: function(n) { var divElm = this.getEditorDiv(n); var tableElm = this.getEditorTable(n); var editor = this.getEditor(n); var setting = this.config[n]; var size = WYSIWYG_Core.windowSize(); size.width -= 5; if(this.maximized[n]) { WYSIWYG_Core.setAttribute(divElm, "style", "position:static;z-index:9998;top:0px;left:0px;width:" + setting.Width + ";height:100%;"); WYSIWYG_Core.setAttribute(tableElm, "style", "width:" + setting.Width + ";height:" + setting.Height + ";"); WYSIWYG_Core.setAttribute(editor, "style", "width:100%;height:" + setting.Height + ";"); this.maximized[n] = false; } else { WYSIWYG_Core.setAttribute(divElm, "style", "position:absolute;z-index:9998;top:0px;left:0px;width:" + size.width + "px;height:" + size.height + "px;"); WYSIWYG_Core.setAttribute(tableElm, "style", "width:100%;height:100%;"); WYSIWYG_Core.setAttribute(editor, "style", "width:100%;height:100%;"); this.maximized[n] = true; } }, /** * Insert HTML into WYSIWYG in rich text * * @param {String} html The HTML being inserted (e.g. <b>hello</b>) * @param {String} n The editor identifier */ insertHTML: function(html, n) { if (WYSIWYG_Core.isMSIE) { this.getEditorWindow(n).document.selection.createRange().pasteHTML(html); } else { var span = this.getEditorWindow(n).document.createElement("span"); span.innerHTML = html; this.insertNodeAtSelection(span, n); } }, /* ---------------------------------------------------------------------- *\ Function : insertNodeAtSelection() Description : insert HTML into WYSIWYG in rich text (mozilla) Usage : WYSIWYG.insertNodeAtSelection(insertNode, n) Arguments : insertNode - The HTML being inserted (must be innerHTML inserted within a div element) n - The editor identifier that the HTML will be inserted into (the textarea's ID) \* ---------------------------------------------------------------------- */ insertNodeAtSelection: function(insertNode, n) { // get editor document var doc = this.getEditorWindow(n).document; // get current selection var sel = this.getSelection(n); // get the first range of the selection // (there's almost always only one range) var range = sel.getRangeAt(0); // deselect everything sel.removeAllRanges(); // remove content of current selection from document range.deleteContents(); // get location of current selection var container = range.startContainer; var pos = range.startOffset; // make a new range for the new selection range = doc.createRange(); if (container.nodeType==3 && insertNode.nodeType==3) { // if we insert text in a textnode, do optimized insertion container.insertData(pos, insertNode.data); // put cursor after inserted text range.setEnd(container, pos+insertNode.length); range.setStart(container, pos+insertNode.length); } else { var afterNode; var beforeNode; if (container.nodeType==3) { // when inserting into a textnode // we create 2 new textnodes // and put the insertNode in between var textNode = container; container = textNode.parentNode; var text = textNode.nodeValue; // text before the split var textBefore = text.substr(0,pos); // text after the split var textAfter = text.substr(pos); beforeNode = document.createTextNode(textBefore); afterNode = document.createTextNode(textAfter); // insert the 3 new nodes before the old one container.insertBefore(afterNode, textNode); container.insertBefore(insertNode, afterNode); container.insertBefore(beforeNode, insertNode); // remove the old node container.removeChild(textNode); } else { // else simply insert the node afterNode = container.childNodes[pos]; container.insertBefore(insertNode, afterNode); } try { range.setEnd(afterNode, 0); range.setStart(afterNode, 0); } catch(e) { alert(e); } } sel.addRange(range); }, /** * Prints the content of the WYSIWYG editor area * * @param {String} n The editor identifier (textarea ID) */ print: function(n) { if(document.all && navigator.appVersion.substring(22,23)==4) { var doc = this.getEditorWindow(n).document; doc.focus(); var OLECMDID_PRINT = 6; var OLECMDEXECOPT_DONTPROMPTUSER = 2; var OLECMDEXECOPT_PROMPTUSER = 1; var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; doc.body.insertAdjacentHTML('beforeEnd',WebBrowser); WebBrowser.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER); WebBrowser.outerHTML = ''; } else { this.getEditorWindow(n).print(); } }, /** * Writes the content of an drop down * * @param {String} n The editor identifier (textarea ID) * @param {String} id Drop down identifier * @return {String} Drop down HTML */ writeDropDown: function(n, id) { var dropdown = this.config[n].DropDowns[id]; var toolbarObj = this.ToolbarList[dropdown.id]; var image = this.config[n].ImagesDir + toolbarObj[2]; var imageOn = this.config[n].ImagesDir + toolbarObj[3]; dropdown.elements.sort(); var output = ""; output += '<table border="0" cellpadding="0" cellspacing="0"><tr>'; output += '<td onMouseOver="$(\'img_' + dropdown.id + '_' + n + '\').src=\'' + imageOn + '\';" onMouseOut="$(\'img_' + dropdown.id + '_' + n + '\').src=\'' + image + '\';">'; output += '<img src="' + image + '" id="img_' + dropdown.id + '_' + n + '" height="20" onClick="WYSIWYG.openDropDown(\'' + n + '\',\'' + dropdown.id + '\');" unselectable="on" border="0"><br>'; output += '<span id="elm_' + dropdown.id + '_' + n + '" class="dropdown" style="width: 145px;display:none;">'; for (var i = 0; i < dropdown.elements.length;i++) { if (dropdown.elements[i]) { var value = dropdown.elements[i]; var label = dropdown.label.replace(/{value}/gi, value); // output output += '<button type="button" onClick="WYSIWYG.execCommand(\'' + n + '\',\'' + dropdown.command + '\',\'' + value + '\')\;" onMouseOver="this.className=\'mouseOver\'" onMouseOut="this.className=\'mouseOut\'" class="mouseOut" style="width: 120px;">'; output += '<table cellpadding="0" cellspacing="0" border="0"><tr>'; output += '<td align="left">' + label + '</td>'; output += '</tr></table></button><br>'; } } output += '</span></td></tr></table>'; return output; }, /** * Close all drop downs. You can define a exclude dropdown id * * @param {String} n The editor identifier (textarea ID) * @param {String} exid Excluded drop down identifier */ closeDropDowns: function(n, exid) { if(typeof(exid) == "undefined") exid = ""; var dropdowns = this.config[n].DropDowns; for(var id in dropdowns) { var dropdown = dropdowns[id]; if(dropdown.id != exid) { var divId = "elm_" + dropdown.id + "_" + n; if($(divId)) $(divId).style.display = 'none'; } } }, /** * Open a defined drop down * * @param {String} n The editor identifier (textarea ID) * @param {String} id Drop down identifier */ openDropDown: function(n, id) { var divId = "elm_" + id + "_" + n; if($(divId).style.display == "none") { $(divId).style.display = "block"; } else { $(divId).style.display = "none"; } $(divId).style.position = "absolute"; this.closeDropDowns(n, id); }, /** * Shows the HTML source code generated by the WYSIWYG editor * * @param {String} n The editor identifier (textarea ID) */ viewSource: function(n) { // document var doc = this.getEditorWindow(n).document; // Enable table highlighting WYSIWYG_Table.disableHighlighting(n); // View Source for IE if (WYSIWYG_Core.isMSIE) { var iHTML = doc.body.innerHTML; // strip off the absolute urls iHTML = this.stripURLPath(n, iHTML); // replace all decimal color strings with hex decimal color strings iHTML = WYSIWYG_Core.replaceRGBWithHexColor(iHTML); doc.body.innerText = iHTML; } // View Source for Mozilla/Netscape else { // replace all decimal color strings with hex decimal color strings var html = WYSIWYG_Core.replaceRGBWithHexColor(doc.body.innerHTML); html = document.createTextNode(html); doc.body.innerHTML = ""; doc.body.appendChild(html); } // Hide the HTML Mode button and show the Text Mode button // Validate if Elements are present if($('HTMLMode' + n)) { $('HTMLMode' + n).style.display = 'none'; } if($('textMode' + n)) { $('textMode' + n).style.display = 'block'; } // set the font values for displaying HTML source doc.body.style.fontSize = "12px"; doc.body.style.fontFamily = "Courier New"; this.viewTextMode[n] = true; }, /** * Shows the HTML source code generated by the WYSIWYG editor * * @param {String} n The editor identifier (textarea ID) */ viewText: function(n) { // get document var doc = this.getEditorWindow(n).document; // View Text for IE if (WYSIWYG_Core.isMSIE) { var iText = doc.body.innerText; // strip off the absolute urls iText = this.stripURLPath(n, iText); // replace all decimal color strings with hex decimal color strings iText = WYSIWYG_Core.replaceRGBWithHexColor(iText); doc.body.innerHTML = iText; } // View Text for Mozilla/Netscape else { var html = doc.body.ownerDocument.createRange(); html.selectNodeContents(doc.body); // replace all decimal color strings with hex decimal color strings html = WYSIWYG_Core.replaceRGBWithHexColor(html.toString()); doc.body.innerHTML = html; } // Enable table highlighting WYSIWYG_Table.refreshHighlighting(n); // Hide the Text Mode button and show the HTML Mode button // Validate if Elements are present if($('textMode' + n)) { $('textMode' + n).style.display = 'none'; } if($('HTMLMode' + n)) { $('HTMLMode' + n).style.display = 'block'; } // reset the font values (changed) WYSIWYG_Core.setAttribute(doc.body, "style", this.config[n].DefaultStyle); this.viewTextMode[n] = false; }, /* ---------------------------------------------------------------------- *\ Function : stripURLPath() Description : Strips off the defined image and the anchor urls of the given content. It also can strip the document URL automatically if you define auto. Usage : WYSIWYG.stripURLPath(content) Arguments : content - Content on which the stripping applies \* ---------------------------------------------------------------------- */ stripURLPath: function(n, content, exact) { // parameter exact is optional if(typeof exact == "undefined") { exact = true; } var stripImgageUrl = null; var stripAnchorUrl = null; // add url to strip of anchors to array if(this.config[n].AnchorPathToStrip == "auto") { stripAnchorUrl = WYSIWYG_Core.getDocumentUrl(document); } else if(this.config[n].AnchorPathToStrip != "") { stripAnchorUrl = this.config[n].AnchorPathToStrip; } // add strip url of images to array if(this.config[n].ImagePathToStrip == "auto") { stripImgageUrl = WYSIWYG_Core.getDocumentUrl(document); } else if(this.config[n].ImagePathToStrip != "") { stripImgageUrl = this.config[n].ImagePathToStrip; } var url; var regex; var result; // strip url of image path if(stripImgageUrl) { // escape reserved characters to be a valid regex url = WYSIWYG_Core.stringToRegex(WYSIWYG_Core.getDocumentPathOfUrl(stripImgageUrl)); // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(src=\")(" + url + ")([^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } // strip absolute urls without a heading slash ("images/print.gif") result = WYSIWYG_Core.getDocumentPathOfUrl(stripImgageUrl).match(/.+[\/]{2,3}[^\/]*/,""); if(result) { url = WYSIWYG_Core.stringToRegex(result[0]); // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(src=\")(" + url + ")([^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } } } // strip url of image path if(stripAnchorUrl) { // escape reserved characters to be a valid regex url = WYSIWYG_Core.stringToRegex(WYSIWYG_Core.getDocumentPathOfUrl(stripAnchorUrl)); // strip absolute urls with a heading slash ("/product/index.html") // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(href=\")(" + url + ")([^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } // strip absolute urls without a heading slash ("product/index.html") result = WYSIWYG_Core.getDocumentPathOfUrl(stripAnchorUrl).match(/.+[\/]{2,3}[^\/]*/,""); if(result) { url = WYSIWYG_Core.stringToRegex(result[0]); // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(href=\")(" + url + ")([^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } } // stip off anchor links with #name url = WYSIWYG_Core.stringToRegex(stripAnchorUrl); // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(href=\")(" + url + ")(#[^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } // stip off anchor links with #name (only for local system) url = WYSIWYG_Core.getDocumentUrl(document); var pos = url.lastIndexOf("/"); if(pos != -1) { url = url.substring(pos + 1, url.length); url = WYSIWYG_Core.stringToRegex(url); // exact replacing of url. regex: src="<url>" if(exact) { regex = eval("/(href=\")(" + url + ")(#[^\"]*)/gi"); content = content.replace(regex, "$1$3"); } // not exect replacing of url. regex: <url> else { regex = eval("/(" + url + ")(.+)/gi"); content = content.replace(regex, "$2"); } } } return content; }, /* ---------------------------------------------------------------------- *\ Function : updateTextArea() Description : Updates the text area value with the HTML source of the WYSIWYG Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ updateTextArea: function(n) { // on update switch editor back to html mode if(this.viewTextMode[n]) { this.viewText(n); } // get inner HTML var content = this.getEditorWindow(n).document.body.innerHTML; // strip off defined URLs on IE content = this.stripURLPath(n, content); // replace all decimal color strings with hex color strings content = WYSIWYG_Core.replaceRGBWithHexColor(content); // remove line breaks before content will be updated if(this.config[n].ReplaceLineBreaks) { content = content.replace(/(\r\n)|(\n)/ig, ""); } // set content back in textarea $(n).value = content; }, /* ---------------------------------------------------------------------- *\ Function : hideToolbars() Description : Hide all toolbars Usage : WYSIWYG.hideToolbars(n) Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ hideToolbars: function(n) { for(var i=0;i<this.config[n].Toolbar.length;i++) { var toolbar = $("toolbar" + i + "_" + n); if(toolbar) { toolbar.style.display = "none"; } } }, /* ---------------------------------------------------------------------- *\ Function : showToolbars() Description : Display all toolbars Usage : WYSIWYG.showToolbars(n) Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ showToolbars: function(n) { for(var i=0;i<this.config[n].Toolbar.length;i++) { var toolbar = $("toolbar" + i + "_" + n); if(toolbar) { toolbar.style.display = ""; } } }, /* ---------------------------------------------------------------------- *\ Function : hideStatusBar() Description : Hide the status bar Usage : WYSIWYG.hideStatusBar(n) Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ hideStatusBar: function(n) { var statusbar = $('wysiwyg_statusbar_' + n); if(statusbar) { statusbar.style.display = "none"; } }, /* ---------------------------------------------------------------------- *\ Function : showStatusBar() Description : Display the status bar Usage : WYSIWYG.showStatusBar(n) Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ showStatusBar: function(n) { var statusbar = $('wysiwyg_statusbar_' + n); if(statusbar) { statusbar.style.display = ""; } }, /** * Finds the node with the given tag name in the given range * * @param {String} tagName Parent tag to find * @param {Range} range Current range */ findParent: function(parentTagName, range){ parentTagName = parentTagName.toUpperCase(); var rangeWorking; var elmWorking = null; try { if(!WYSIWYG_Core.isMSIE) { var node = range.startContainer; var pos = range.startOffset; if(node.nodeType != 3) { node = node.childNodes[pos]; } return WYSIWYG_Core.findParentNode(parentTagName, node); } else { elmWorking = (range.length > 0) ? range.item(0): range.parentElement(); elmWorking = WYSIWYG_Core.findParentNode(parentTagName, elmWorking); if(elmWorking != null) return elmWorking; rangeWorking = range.duplicate(); rangeWorking.collapse(true); rangeWorking.moveEnd("character", 1); if (rangeWorking.text.length>0) { while (rangeWorking.compareEndPoints("EndToEnd", range) < 0){ rangeWorking.move("Character"); if (null != this.findParentTag(parentTagName, rangeWorking)){ return this.findParentTag(parentTagName, rangeWorking); } } } return null; } } catch(e) { return null; } }, /** * Get the acutally tag of the given range * * @param {Range} range Current range */ getTag: function(range) { try { if(!WYSIWYG_Core.isMSIE) { var node = range.startContainer; var pos = range.startOffset; if(node.nodeType != 3) { node = node.childNodes[pos]; } if(node.nodeName && node.nodeName.search(/#/) != -1) { return node.parentNode; } return node; } else { if(range.length > 0) { return range.item(0); } else if(range.parentElement()) { return range.parentElement(); } } return null; } catch(e) { return null; } }, /** * Get the parent node of the given node * * @param {DOMElement} element - Element which parent will be returned */ getParent: function(element) { if(element.parentNode) { return element.parentNode; } return null; }, /* ---------------------------------------------------------------------- *\ Function : getTextRange() Description : Get the text range object of the given element Usage : WYSIWYG.getTextRange(element) Arguments : element - An element of which you get the text range object \* ---------------------------------------------------------------------- */ getTextRange: function(element){ var range = element.parentTextEdit.createTextRange(); range.moveToElementText(element); return range; }, /* ---------------------------------------------------------------------- *\ Function : invertIELineBreakCapability() Description : Inverts the line break capability of IE (Thx to richyrich) Normal: ENTER = <p> , SHIFT + ENTER = <br> Inverted: ENTER = <br>, SHIFT + ENTER = <p> Usage : WYSIWYG.invertIELineBreakCapability(n) Arguments : n - The editor identifier (the textarea's ID) \* ---------------------------------------------------------------------- */ invertIELineBreakCapability: function(n) { var editor = this.getEditorWindow(n); var sel; // validate if the press key is the carriage return key if (editor.event.keyCode==13) { if (!editor.event.shiftKey) { sel = this.getRange(this.getSelection(n)); sel.pasteHTML("<br>"); editor.event.cancelBubble = true; editor.event.returnValue = false; sel.select(); sel.moveEnd("character", 1); sel.moveStart("character", 1); sel.collapse(false); return false; } else { sel = this.getRange(this.getSelection(n)); sel.pasteHTML("<p>"); editor.event.cancelBubble = true; editor.event.returnValue = false; sel.select(); sel.moveEnd("character", 1); sel.moveStart("character", 1); sel.collapse(false); return false; } } }, /* ---------------------------------------------------------------------- *\ Function : selectNode() Description : Select a node within the current editor Usage : WYSIWYG.selectNode(n, level) Arguments : n - The editor identifier (the textarea's ID) level - identifies the level of the element which will be selected \* ---------------------------------------------------------------------- */ selectNode: function(n, level) { var sel = this.getSelection(n); var range = this.getRange(sel); var parentnode = this.getTag(range); var i = 0; for (var node=parentnode; (node && (node.nodeType == 1)); node=node.parentNode) { if (i == level) { this.nodeSelection(n, node); } i++; } this.updateStatusBar(n); }, /* ---------------------------------------------------------------------- *\ Function : nodeSelection() Description : Do the node selection Usage : WYSIWYG.nodeSelection(n, node) Arguments : n - The editor identifier (the textarea's ID) node - The node which will be selected \* ---------------------------------------------------------------------- */ nodeSelection: function(n, node) { var doc = this.getEditorWindow(n).document; var sel = this.getSelection(n); var range = this.getRange(sel); if(!WYSIWYG_Core.isMSIE) { if (node.nodeName == "BODY") { range.selectNodeContents(node); } else { range.selectNode(node); } /* if (endNode) { try { range.setStart(node, startOffset); range.setEnd(endNode, endOffset); } catch(e) { } } */ if (sel) { sel.removeAllRanges(); } if (sel) { sel.addRange(range); } } else { // MSIE may not select everything when BODY is selected - // start may be set to first text node instead of first non-text node - // no known workaround if ((node.nodeName == "TABLE") || (node.nodeName == "IMG") || (node.nodeName == "INPUT") || (node.nodeName == "SELECT") || (node.nodeName == "TEXTAREA")) { try { range = doc.body.createControlRange(); range.addElement(node); range.select(); } catch(e) { } } else { range = doc.body.createTextRange(); if (range) { range.collapse(); if (range.moveToElementText) { try { range.moveToElementText(node); range.select(); } catch(e) { try { range = doc.body.createTextRange(); range.moveToElementText(node); range.select(); } catch(e) {} } } else { try { range = doc.body.createTextRange(); range.moveToElementText(node); range.select(); } catch(e) {} } } } } } } /******************************************************************** * openWYSIWYG core functions Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg.js,v 1.22 2007/09/08 21:45:57 xhaggi Exp $ ********************************************************************/ var WYSIWYG_Core = { /** * Holds true if browser is MSIE, otherwise false */ isMSIE: navigator.appName == "Microsoft Internet Explorer" ? true : false, /** * Holds true if browser is Firefox (Mozilla) */ isFF: !document.all && document.getElementById && !this.isOpera, /** * Holds true if browser is Opera, otherwise false */ isOpera: navigator.appName == "Opera" ? true : false, /** * Trims whitespaces of the given string * * @param str String * @return Trimmed string */ trim: function(str) { return str.replace(/^\s*|\s*$/g,""); }, /** * Determine if the given parameter is defined * * @param p Parameter * @return true/false dependents on definition of the parameter */ defined: function(p) { return typeof p == "undefined" ? false : true; }, /** * Determine if the browser version is compatible * * @return true/false depending on compatiblity of the browser */ isBrowserCompatible: function() { // Validate browser and compatiblity if ((navigator.userAgent.indexOf('Safari') != -1 ) || !document.getElementById || !document.designMode){ //no designMode (Safari lies) return false; } return true; }, /** * Set the style attribute of the given element. * Private method to solve the IE bug while setting the style attribute. * * @param {DOMElement} node The element on which the style attribute will affect * @param {String} style Stylesheet which will be set */ _setStyleAttribute: function(node, style) { if(style == null) return; var styles = style.split(";"); var pos; for(var i=0;i<styles.length;i++) { var attributes = styles[i].split(":"); if(attributes.length == 2) { try { var attr = WYSIWYG_Core.trim(attributes[0]); while((pos = attr.search(/-/)) != -1) { var strBefore = attr.substring(0, pos); var strToUpperCase = attr.substring(pos + 1, pos + 2); var strAfter = attr.substring(pos + 2, attr.length); attr = strBefore + strToUpperCase.toUpperCase() + strAfter; } var value = WYSIWYG_Core.trim(attributes[1]).toLowerCase(); node.style[attr] = value; } catch (e) { alert(e); } } } }, /** * Fix's the issue while getting the attribute style on IE * It's return an object but we need the style string * * @private * @param {DOMElement} node Node element * @return {String} Stylesheet */ _getStyleAttribute: function(node) { if(this.isMSIE) { return node.style['cssText'].toLowerCase(); } else { return node.getAttribute("style"); } }, /** * Set an attribute's value on the given node element. * * @param {DOMElement} node Node element * @param {String} attr Attribute which is set * @param {String} value Value of the attribute */ setAttribute: function(node, attr, value) { if(value == null || node == null || attr == null) return; if(attr.toLowerCase() == "style") { this._setStyleAttribute(node, value); } else { node.setAttribute(attr, value); } }, /** * Removes an attribute on the given node * * @param {DOMElement} node Node element * @param {String} attr Attribute which will be removed */ removeAttribute: function(node, attr) { node.removeAttribute(attr, false); }, /** * Get the vale of the attribute on the given node * * @param {DOMElement} node Node element * @param {String} attr Attribute which value will be returned */ getAttribute: function(node, attr) { if(node == null || attr == null) return; if(attr.toLowerCase() == "style") { return this._getStyleAttribute(node); } else { return node.getAttribute(attr); } }, /** * Get the path out of an given url * * @param {String} url The url with is used to get the path */ getDocumentPathOfUrl: function(url) { var path = null; // if local file system, convert local url into web url url = url.replace(/file:\/\//gi, "file:///"); url = url.replace(/\\/gi, "\/"); var pos = url.lastIndexOf("/"); if(pos != -1) { path = url.substring(0, pos + 1); } return path; }, /** * Get the documents url, convert local urls to web urls * * @param {DOMElement} doc Document which is used to get the url */ getDocumentUrl: function(doc) { // if local file system, convert local url into web url var url = doc.URL; url = url.replace(/file:\/\//gi, "file:///"); url = url.replace(/\\/gi, "\/"); return url; }, /** * Find a parent node with the given name, of the given start node * * @param {String} tagName - Tag name of the node to find * @param {DOMElement} node - Node element */ findParentNode: function(tagName, node) { while (node.tagName != "HTML") { if (node.tagName == tagName){ return node; } node = node.parentNode; } return null; }, /** * Cancel the given event. * * @param e Event which will be canceled */ cancelEvent: function(e) { if (!e) return false; if (this.isMSIE) { e.returnValue = false; e.cancelBubble = true; } else { e.preventDefault(); e.stopPropagation && e.stopPropagation(); } return false; }, /** * Converts a RGB color string to hex color string. * * @param color RGB color string * @param Hex color string */ toHexColor: function(color) { color = color.replace(/^rgb/g,''); color = color.replace(/\(/g,''); color = color.replace(/\)/g,''); color = color.replace(/ /g,''); color = color.split(','); var r = parseFloat(color[0]).toString(16).toUpperCase(); var g = parseFloat(color[1]).toString(16).toUpperCase(); var b = parseFloat(color[2]).toString(16).toUpperCase(); if (r.length<2) { r='0'+r; } if (g.length<2) { g='0'+g; } if (b.length<2) { b='0'+b; } return r + g + b; }, /** * Converts a decimal color to hex color string. * * @param Decimal color * @param Hex color string */ _dec_to_rgb: function(value) { var hex_string = ""; for (var hexpair = 0; hexpair < 3; hexpair++) { var myByte = value & 0xFF; // get low byte value >>= 8; // drop low byte var nybble2 = myByte & 0x0F; // get low nybble (4 bits) var nybble1 = (myByte >> 4) & 0x0F; // get high nybble hex_string += nybble1.toString(16); // convert nybble to hex hex_string += nybble2.toString(16); // convert nybble to hex } return hex_string.toUpperCase(); }, /** * Replace RGB color strings with hex color strings within a string. * * @param {String} str RGB String * @param {String} Hex color string */ replaceRGBWithHexColor: function(str) { if(str == null) return ""; // find all decimal color strings var matcher = str.match(/rgb\([0-9 ]+,[0-9 ]+,[0-9 ]+\)/gi); if(matcher) { for(var j=0; j<matcher.length;j++) { var regex = eval("/" + WYSIWYG_Core.stringToRegex(matcher[j]) + "/gi"); // replace the decimal color strings with hex color strings str = str.replace(regex, "#" + this.toHexColor(matcher[j])); } } return str; }, /** * Execute the given command on the given editor * * @param n The editor's identifier * @param cmd Command which is execute */ execCommand: function(n, cmd, value) { if(typeof(value) == "undefined") value = null; // firefox BackColor problem fixed if(cmd == 'BackColor' && WYSIWYG_Core.isFF) cmd = 'HiliteColor'; // firefox cut, paste and copy if(WYSIWYG_Core.isFF && (cmd == "Cut" || cmd == "Paste" || cmd == "Copy")) { try { WYSIWYG.getEditorWindow(n).document.execCommand(cmd, false, value); } catch(e) { if(confirm("Copy/Cut/Paste is not available in Mozilla and Firefox\nDo you want more information about this issue?")) { window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html'); } } } else { WYSIWYG.getEditorWindow(n).document.execCommand(cmd, false, value); } }, /** * Parse a given string to a valid regular expression * * @param {String} string String to be parsed * @return {RegEx} Valid regular expression */ stringToRegex: function(string) { string = string.replace(/\//gi, "\\/"); string = string.replace(/\(/gi, "\\("); string = string.replace(/\)/gi, "\\)"); string = string.replace(/\[/gi, "\\["); string = string.replace(/\]/gi, "\\]"); string = string.replace(/\+/gi, "\\+"); string = string.replace(/\$/gi, "\\$"); string = string.replace(/\*/gi, "\\*"); string = string.replace(/\?/gi, "\\?"); string = string.replace(/\^/gi, "\\^"); string = string.replace(/\\b/gi, "\\\\b"); string = string.replace(/\\B/gi, "\\\\B"); string = string.replace(/\\d/gi, "\\\\d"); string = string.replace(/\\B/gi, "\\\\B"); string = string.replace(/\\D/gi, "\\\\D"); string = string.replace(/\\f/gi, "\\\\f"); string = string.replace(/\\n/gi, "\\\\n"); string = string.replace(/\\r/gi, "\\\\r"); string = string.replace(/\\t/gi, "\\\\t"); string = string.replace(/\\v/gi, "\\\\v"); string = string.replace(/\\s/gi, "\\\\s"); string = string.replace(/\\S/gi, "\\\\S"); string = string.replace(/\\w/gi, "\\\\w"); string = string.replace(/\\W/gi, "\\\\W"); return string; }, /** * Add an event listener * * @param obj Object on which the event will be attached * @param ev Kind of event * @param fu Function which is execute on the event */ addEvent: function(obj, ev, fu) { if (obj.attachEvent) obj.attachEvent("on" + ev, fu); else obj.addEventListener(ev, fu, false); }, /** * Remove an event listener * * @param obj Object on which the event will be attached * @param ev Kind of event * @param fu Function which is execute on the event */ removeEvent: function(obj, ev, fu) { if (obj.attachEvent) obj.detachEvent("on" + ev, fu); else obj.removeEventListener(ev, fu, false); }, /** * Includes a javascript file * * @param file Javascript file path and name */ includeJS: function(file) { var script = document.createElement("script"); this.setAttribute(script, "type", "text/javascript"); this.setAttribute(script, "src", file); var heads = document.getElementsByTagName("head"); for(var i=0;i<heads.length;i++) { heads[i].appendChild(script); } }, /** * Includes a stylesheet file * * @param file Stylesheet file path and name */ includeCSS: function(path) { var link = document.createElement("link"); this.setAttribute(link, "rel", "stylesheet"); this.setAttribute(link, "type", "text/css"); this.setAttribute(link, "href", path); var heads = document.getElementsByTagName("head"); for(var i=0;i<heads.length;i++) { heads[i].appendChild(link); } }, /** * Get the screen position of the given element. * * @param {HTMLObject} elm1 Element which position will be calculate * @param {HTMLObject} elm2 Element which is the last one before calculation stops * @param {Object} Left and top position of the given element */ getElementPosition: function(elm1, elm2) { var top = 0, left = 0; while (elm1 && elm1 != elm2) { left += elm1.offsetLeft; top += elm1.offsetTop; elm1 = elm1.offsetParent; } return {left : left, top : top}; }, /** * Get the window size * @private */ windowSize: function() { if (window.innerWidth) { return {width: window.innerWidth, height: window.innerHeight}; } else if (document.body && document.body.offsetWidth) { return {width: document.body.offsetWidth, height: document.body.offsetHeight}; } else { return {width: 0, height: 0}; } } } /** * Context menu object */ var WYSIWYG_ContextMenu = { html: "", contextMenuDiv: null, /** * Init function * * @param {String} n Editor identifier */ init: function(n) { var doc = WYSIWYG.getEditorWindow(n).document; // create context menu div this.contextMenuDiv = document.createElement("div"); this.contextMenuDiv.className = "wysiwyg-context-menu-div"; this.contextMenuDiv.setAttribute("class", "wysiwyg-context-menu-div"); this.contextMenuDiv.style.display = "none"; this.contextMenuDiv.style.position = "absolute"; this.contextMenuDiv.style.zIndex = 9999; this.contextMenuDiv.style.left = "0"; this.contextMenuDiv.style.top = "0"; this.contextMenuDiv.unselectable = "on"; document.body.insertBefore(this.contextMenuDiv, document.body.firstChild); // bind event listeners WYSIWYG_Core.addEvent(doc, "contextmenu", function context(e) { WYSIWYG_ContextMenu.show(e, n); }); WYSIWYG_Core.addEvent(doc, "click", function context(e) { WYSIWYG_ContextMenu.close(); }); WYSIWYG_Core.addEvent(doc, "keydown", function context(e) { WYSIWYG_ContextMenu.close(); }); WYSIWYG_Core.addEvent(document, "click", function context(e) { WYSIWYG_ContextMenu.close(); }); }, /** * Show the context menu * * @param e Event * @param n Editor identifier */ show: function(e, n) { if(this.contextMenuDiv == null) return false; var ifrm = WYSIWYG.getEditor(n); var doc = WYSIWYG.getEditorWindow(n).document; // set the context menu position var pos = WYSIWYG_Core.getElementPosition(ifrm); var x = WYSIWYG_Core.isMSIE ? pos.left + e.clientX : pos.left + (e.pageX - doc.body.scrollLeft); var y = WYSIWYG_Core.isMSIE ? pos.top + e.clientY : pos.top + (e.pageY - doc.body.scrollTop); this.contextMenuDiv.style.left = x + "px"; this.contextMenuDiv.style.top = y + "px"; this.contextMenuDiv.style.visibility = "visible"; this.contextMenuDiv.style.display = "block"; // call the context menu, mozilla needs some time window.setTimeout("WYSIWYG_ContextMenu.output('" + n + "')", 10); WYSIWYG_Core.cancelEvent(e); return false; }, /** * Output the context menu items * * @param n Editor identifier */ output: function (n) { // get selection var sel = WYSIWYG.getSelection(n); var range = WYSIWYG.getRange(sel); // get current selected node var tag = WYSIWYG.getTag(range); if(tag == null) { return; } // clear context menu this.clear(); // Determine kind of nodes var isImg = (tag.nodeName == "IMG") ? true : false; var isLink = (tag.nodeName == "A") ? true : false; // Selection is an image or selection is a text with length greater 0 var len = 0; if(WYSIWYG_Core.isMSIE) len = (document.selection && range.text) ? range.text.length : 0; else len = range.toString().length; var sel = len != 0 || isImg; // Icons var iconLink = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["createlink"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["createlink"][2]}; var iconImage = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["insertimage"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["insertimage"][2]}; var iconDelete = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["delete"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["delete"][2]}; var iconCopy = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["copy"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["copy"][2]}; var iconCut = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["cut"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["cut"][2]}; var iconPaste = { enabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["paste"][3], disabled: WYSIWYG.config[n].ImagesDir + WYSIWYG.ToolbarList["paste"][2]}; // Create context menu html this.html += '<table class="wysiwyg-context-menu" border="0" cellpadding="0" cellspacing="0">'; // Add items this.addItem(n, 'Copy', iconCopy, 'Copy', sel); this.addItem(n, 'Cut', iconCut, 'Cut', sel); this.addItem(n, 'Paste', iconPaste, 'Paste', true); this.addSeperator(); this.addItem(n, 'InsertImage', iconImage, 'Modify Image Properties...', isImg); this.addItem(n, 'CreateLink', iconLink, 'Create or Modify Link...', sel || isLink); this.addItem(n, 'RemoveNode', iconDelete, 'Remove', true); this.html += '</table>'; this.contextMenuDiv.innerHTML = this.html; }, /** * Close the context menu */ close: function() { this.contextMenuDiv.style.visibility = "hidden"; this.contextMenuDiv.style.display = "none"; }, /** * Clear context menu */ clear: function() { this.contextMenuDiv.innerHTML = ""; this.html = ""; }, /** * Add context menu item * * @param n editor identifier * @param cmd Command * @param icon Icon which is diabled * @param title Title of the item * @param disabled If item is diabled */ addItem: function(n, cmd, icon, title, disabled) { var item = ''; if(disabled) { item += '<tr>'; item += '<td class="icon"><a href="javascript:WYSIWYG.execCommand(\'' + n + '\',\'' + cmd + '\', null);"><img src="' + icon.enabled + '" border="0"></a></td>'; item += '<td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'" onclick="WYSIWYG.execCommand(\'' + n + '\', \'' + cmd + '\', null);WYSIWYG_ContextMenu.close();"><a href="javascript:void(0);">' + title + '</a></td>'; item += '</tr>'; } else { item += '<tr>'; item += '<td class="icon"><img src="' + icon.disabled + '" border="0"></td>'; item += '<td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'"><span class="disabled">' + title + '</span></td>'; item += '</tr>'; } this.html += item; }, /** * Add seperator to context menu */ addSeperator: function() { var output = ''; output += '<tr>'; output += '<td colspan="2" style="text-align:center;"><hr size="1" color="#C9C9C9" width="95%"></td>'; output += '</tr>'; this.html += output; } } /** * Table object */ var WYSIWYG_Table = { /** * */ create: function(n, tbl) { // get editor var doc = WYSIWYG.getEditorWindow(n).document; // get selection and range var sel = WYSIWYG.getSelection(n); var range = WYSIWYG.getRange(sel); var table = null; // get element from selection if(WYSIWYG_Core.isMSIE) { if(sel.type == "Control" && range.length == 1) { range = WYSIWYG.getTextRange(range(0)); range.select(); } } // find a parent TABLE element //table = WYSIWYG.findParent("table", range); // check if parent is found //var update = (table == null) ? false : true; //if(!update) table = tbl; table = tbl; // add rows and cols var rows = WYSIWYG_Core.getAttribute(tbl, "tmprows"); var cols = WYSIWYG_Core.getAttribute(tbl, "tmpcols"); WYSIWYG_Core.removeAttribute(tbl, "tmprows"); WYSIWYG_Core.removeAttribute(tbl, "tmpcols"); for(var i=0;i<rows;i++) { var tr = doc.createElement("tr"); for(var j=0;j<cols;j++){ var td = createTD(); tr.appendChild(td); } table.appendChild(tr); } // on update exit here //if(update) { return; } // Check if IE or Mozilla (other) if (WYSIWYG_Core.isMSIE) { range.pasteHTML(table.outerHTML); } else { WYSIWYG.insertNodeAtSelection(table, n); } // refresh table highlighting this.refreshHighlighting(n); // functions function createTD() { var td = doc.createElement("td"); td.innerHTML = "&nbsp;"; return td; } }, /** * Enables the table highlighting * * @param {String} n The editor identifier (the textarea's ID) */ refreshHighlighting: function(n) { var doc = WYSIWYG.getEditorWindow(n).document; var tables = doc.getElementsByTagName("table"); for(var i=0;i<tables.length;i++) { this._enableHighlighting(tables[i]); } var tds = doc.getElementsByTagName("td"); for(var i=0;i<tds.length;i++) { this._enableHighlighting(tds[i]); } }, /** * Enables the table highlighting * * @param {String} n The editor identifier (the textarea's ID) */ disableHighlighting: function(n) { var doc = WYSIWYG.getEditorWindow(n).document; var tables = doc.getElementsByTagName("table"); for(var i=0;i<tables.length;i++) { this._disableHighlighting(tables[i]); } var tds = doc.getElementsByTagName("td"); for(var i=0;i<tds.length;i++) { this._disableHighlighting(tds[i]); } }, /** * @private */ _enableHighlighting: function(node) { var style = WYSIWYG_Core.getAttribute(node, "style"); if(style == null) style = " "; //alert("ENABLE: ELM = " + node.tagName + "; STYLE = " + style); WYSIWYG_Core.removeAttribute(node, "prevstyle"); WYSIWYG_Core.setAttribute(node, "prevstyle", style); WYSIWYG_Core.setAttribute(node, "style", "border:1px dashed #AAAAAA;"); }, /** * @private */ _disableHighlighting: function(node) { var style = WYSIWYG_Core.getAttribute(node, "prevstyle"); //alert("DISABLE: ELM = " + node.tagName + "; STYLE = " + style); // if no prevstyle is defined, the table is not in highlighting mode if(style == null || style == "") { this._enableHighlighting(node); return; } WYSIWYG_Core.removeAttribute(node, "prevstyle"); WYSIWYG_Core.removeAttribute(node, "style"); WYSIWYG_Core.setAttribute(node, "style", style); } } /** * Get an element by it's identifier * * @param id Element identifier */ function $(id) { return document.getElementById(id); } /** * Emulates insertAdjacentHTML(), insertAdjacentText() and * insertAdjacentElement() three functions so they work with Netscape 6/Mozilla * by Thor Larholm me@jscript.dk */ if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){ HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) { switch (where){ case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this); break; case 'afterBegin': this.insertBefore(parsedNode,this.firstChild); break; case 'beforeEnd': this.appendChild(parsedNode); break; case 'afterEnd': if (this.nextSibling) { this.parentNode.insertBefore(parsedNode,this.nextSibling); } else { this.parentNode.appendChild(parsedNode); } break; } }; HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var parsedHTML = r.createContextualFragment(htmlStr); this.insertAdjacentElement(where,parsedHTML); }; HTMLElement.prototype.insertAdjacentText = function (where,txtStr) { var parsedText = document.createTextNode(txtStr); this.insertAdjacentElement(where,parsedText); }; }
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/scripts/wysiwyg.js
JavaScript
art
91,981
/******************************************************************** * openWYSIWYG color chooser Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg-color.js,v 1.1 2007/01/29 19:19:49 xhaggi Exp $ ********************************************************************/ function WYSIWYG_Color() { // colors var COLORS = new Array( "#000000","#993300","#333300","#003300","#003366","#000080", "#333399","#333333","#800000","#FF6600","#808000","#008000", "#008080","#0000FF","#666699","#808080","#FF0000","#FF9900", "#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999", "#FF00FF","#FFCC00","#FFFF00","#00FF00","#00CCFF","#993366", "#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF", "#99CCFF","#666699","#777777","#999999","#EEEEEE","#FFFFFF" ); // div id of the color table var CHOOSER_DIV_ID = "colorpicker-div"; /** * Init the color picker */ this.init = function() { var div = document.createElement("DIV"); div.id = CHOOSER_DIV_ID; div.style.position = "absolute"; div.style.visibility = "hidden"; document.body.appendChild(div); }; /** * Open the color chooser to choose a color. * * @param {String} element Element identifier */ this.choose = function(element) { var div = document.getElementById(CHOOSER_DIV_ID); if(div == null) { alert("Initialisation of color picker failed."); return; } // writes the content of the color picker write(element); // Display color picker var x = window.event.clientX + document.body.scrollLeft; var y = window.event.clientY + document.body.scrollTop; var winsize = windowSize(); if(x + div.offsetWidth > winsize.width) x = winsize.width - div.offsetWidth - 5; if(y + div.offsetHeight > winsize.height) y = winsize.height - div.offsetHeight - 5; div.style.left = x + "px"; div.style.top = y + "px"; div.style.visibility = "visible"; }; /** * Set the color in the given field * * @param {String} n Element identifier * @param {String} color HexColor String */ this.select = function(n, color) { var div = document.getElementById(CHOOSER_DIV_ID); var elm = document.getElementById(n); elm.value = color; elm.style.color = color; elm.style.backgroundColor = color; div.style.visibility = "hidden"; } /** * Write the color table * @param {String} n Element identifier * @private */ function write(n) { var div = document.getElementById(CHOOSER_DIV_ID); var output = ""; output += '<table border="1" cellpadding="0" cellspacing="0" class="wysiwyg-color-picker-table"><tr>'; for(var i = 0; i < COLORS.length;i++) { var color = COLORS[i]; output += '<td class="selectColorBorder" '; output += 'onmouseover="this.className=\'selectColorOn\';" '; output += 'onmouseout="this.className=\'selectColorOff\';" '; output += 'onclick="WYSIWYG_ColorInst.select(\'' + n + '\', \'' + color + '\');"> '; output += '<div style="background-color:' + color + ';" class="wysiwyg-color-picker-div">&nbsp;</div> '; output += '</td>'; if(((i+1) % Math.round(Math.sqrt(COLORS.length))) == 0) { output += "</tr><tr>"; } } output += '</tr></table>'; // write to div element div.innerHTML = output; }; /** * Set the window.event on Mozilla Browser * @private */ function _event_tracker(event) { if (!document.all && document.getElementById) { window.event = event; } } document.onmousedown = _event_tracker; /** * Get the window size * @private */ function windowSize() { if (window.innerWidth) { return {width: window.innerWidth, height: window.innerHeight}; } else if (document.body && document.body.offsetWidth) { return {width: document.body.offsetWidth, height: document.body.offsetHeight}; } else { return {width: 0, height: 0}; } } } var WYSIWYG_ColorInst = new WYSIWYG_Color();
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/scripts/wysiwyg-color.js
JavaScript
art
4,124
/******************************************************************** * openWYSIWYG popup functions Copyright (c) 2006 openWebWare.com * Contact us at devs@openwebware.com * This copyright notice MUST stay intact for use. * * $Id: wysiwyg-popup.js,v 1.2 2007/01/22 23:45:30 xhaggi Exp $ ********************************************************************/ var WYSIWYG_Popup = { /** * Return the value of an given URL parameter. * * @param param Parameter * @return Value of the given parameter */ getParam: function(param) { var query = window.location.search.substring(1); var parms = query.split('&'); for (var i=0; i<parms.length; i++) { var pos = parms[i].indexOf('='); if (pos > 0) { var key = parms[i].substring(0,pos).toLowerCase(); var val = parms[i].substring(pos+1); if(key == param.toLowerCase()) return val; } } return null; } } // close the popup if the opener does not hold the WYSIWYG object if(!window.opener) window.close(); // bind objects on local vars var WYSIWYG = window.opener.WYSIWYG; var WYSIWYG_Core = window.opener.WYSIWYG_Core; var WYSIWYG_Table = window.opener.WYSIWYG_Table;
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/scripts/wysiwyg-popup.js
JavaScript
art
1,230
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG</title> <link rel="stylesheet" href="docs/style.css" type="text/css"> <!-- Include the WYSIWYG javascript files --> <script type="text/javascript" src="scripts/wysiwyg.js"></script> <script type="text/javascript" src="scripts/wysiwyg-settings.js"></script> <!-- Attach the editor on the textareas --> <script type="text/javascript"> // Use it to attach the editor to all textareas with full featured setup //WYSIWYG.attach('all', full); // Use it to attach the editor directly to a defined textarea WYSIWYG.attach('textarea1'); // default setup WYSIWYG.attach('textarea2', full); // full featured setup WYSIWYG.attach('textarea3', small); // small setup // Use it to display an iframes instead of a textareas //WYSIWYG.display('all', full); </script> </head> <body> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr style="vertical-align: top;"> <td> <a href="http://www.openwebware.com" target="_blank"> <img src="docs/images/logo.gif" border="0"> </a> </td> <td style="text-align: right;"> <font class="naviblock"> <a href="docs/doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="docs/addons.html" class="navi" title="Addons">ADDONS</a> | <a href="example.html" class="navi" title="Examples">EXAMPLES</a> </font> </td> </tr> <tr> <td colspan="2"> <br> <table border="0" cellpadding="2" cellspacing="0" style="width:100%;"> <tbody> <tr> <td class="headline"> <h1>Examples</h1> </td> </tr> <tr> <td class="info"> Copyright (c) 2006 openWebWare.com </td> </tr> <tr> <td> <br> <form name="exampleForm" action="example.html" method="post"> <!-- Default settings --> <h2> Default setup applied to this editor: </h2> <br> <textarea id="textarea1" name="test1" style="width:560px;height:200px;"> <table border="0" cellpadding="0" cellspacing="0" style="margin-left: 10px;"> <tr> <td style="padding: 0 10 10 0;"> <a href="http://www.openwebware.com/products/openwysiwyg/"> <img src="http://www.openwebware.com/images/openwysiwyg/logo9060.gif" border="0" height="60" width="90" alt="openWYSIWYG - Cross-browser WYSIWYG editor"> </a> </td> <td style="font-family: verdana; font-size: 11px; line-height: 130%; color: #494949;" valign="top"> <b> <a href="http://www.openwebware.com/products/openwysiwyg/" style="font-family: arial; font-size: 12px; color: #055F92;">openWYSIWYG - Cross-browser WYSIWYG editor</a> </b> <br /> </td> </tr> </table> </textarea> <br /> <br /> <!-- Three toolbars and dynamicly width applied to this editor --> <h2> Customized toolbar and openImageLibrary addon applied to this editor: </h2> <br> <textarea id="textarea2" name="test2" style="width:80%;height:200px;"> <h1>GNU Lesser General Public License</h1> <tt> <p>Version 2.1, February 1999</p> <blockquote> <p>Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p> <p>[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]</p> </blockquote> <h3>Preamble</h3> <p>The licenses for most software are designed to take away your freedom to share and change it.</p></tt> </textarea> <br /> <br /> <!-- A really small setup applied to this editor --> <h2> A really small setup applied to this editor: </h2> <br> <textarea id="textarea3" name="test3"> A small editor...can come in handy when you just need font size, bold, italic, etc. </textarea> </form> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/example.html
HTML
art
4,218
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Create or Modify Link</title> </head> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript"> /* ---------------------------------------------------------------------- *\ Function : insertHyperLink() (changed) Description : Insert the link into the iframe html area \* ---------------------------------------------------------------------- */ function insertHyperLink() { var n = WYSIWYG_Popup.getParam('wysiwyg'); // get values from form fields var href = document.getElementById('linkUrl').value; var target = document.getElementById('linkTarget').value; var style = document.getElementById('linkStyle').value; var styleClass = document.getElementById('linkClass').value; var name = document.getElementById('linkName').value; // insert link WYSIWYG.insertLink(href, target, style, styleClass, name, n); window.close(); } /* ---------------------------------------------------------------------- *\ Function : loadLink() (new) Description : Load the link attributes to the form \* ---------------------------------------------------------------------- */ function loadLink() { // get params var n = WYSIWYG_Popup.getParam('wysiwyg'); // get selection and range var sel = WYSIWYG.getSelection(n); var range = WYSIWYG.getRange(sel); var lin = null; if(WYSIWYG_Core.isMSIE) { if(sel.type == "Control" && range.length == 1) { range = WYSIWYG.getTextRange(range(0)); range.select(); } if (sel.type == 'Text' || sel.type == 'None') { sel = WYSIWYG.getSelection(n); range = WYSIWYG.getRange(sel); // find a as parent element lin = WYSIWYG.findParent("a", range); } } else { // find a as parent element lin = WYSIWYG.findParent("a", range); } // if no link as parent found exit here if(lin == null) return; // set form elements with attribute values for(var i=0; i<lin.attributes.length; i++) { var attr = lin.attributes[i].name.toLowerCase(); var value = lin.attributes[i].value; if(attr && value && value != "null") { switch (attr) { case "href": // strip off urls on IE if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false); document.getElementById('linkUrl').value = value; break; case "target": document.getElementById('linkTarget').value = value; selectItemByValue(document.getElementById('linkTargetChooser'), value); break; case "name": document.getElementById('linkName').value = value; break; case "class": document.getElementById('linkClass').value = value; break; case "className": document.getElementById('linkClass').value = value; break; } } } // Getting style attribute of the link separately, because IE interprets the // style attribute is an complex object, and do not return a text stylesheet like Mozilla. document.getElementById('linkStyle').value = WYSIWYG_Core.replaceRGBWithHexColor(WYSIWYG_Core.getAttribute(lin, "style")); } /* ---------------------------------------------------------------------- *\ Function : updateTarget() (new) Description : Updates the target text field Arguments : value - Value to be set \* ---------------------------------------------------------------------- */ function updateTarget(value) { document.getElementById('linkTarget').value = value; } /* ---------------------------------------------------------------------- *\ Function : selectItem() Description : Select an item of an select box element by value. \* ---------------------------------------------------------------------- */ function selectItemByValue(element, value) { if(element.options.length) { for(var i=0;i<element.options.length;i++) { if(element.options[i].value == value) { element.options[i].selected = true; return; } } element.options[(element.options.length-1)].selected = true; } } </script> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadLink();"> <table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"><tr><td> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Hyperlink:</span> <table width="330" border="0" cellpadding="1" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">URL:</td> <td style="padding-bottom: 2px; padding-top: 0px;" colspan="3"> <input type="text" name="linkUrl" id="linkUrl" value="http://" style="font-size: 10px; width: 100%;"> </td> </tr> <tr> <td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Target:</td> <td style="padding-bottom: 2px;" colspan="3"> <input type="text" name="linkTarget" id="linkTarget" value="" style="font-size: 10px; width: 65%;"> &nbsp; <select name="linkTargetChooser" id="linkTargetChooser" style="font-size: 10px; width: 30%;" onchange="updateTarget(this.value);"> <option value="" selected>no target</option> <option value="_blank">_blank</option> <option value="_self">_self</option> <option value="_parent">_parent</option> <option value="_top">_top</option> <option value="">custom</option> </select> </td> </tr> <tr> <td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Style:</td> <td style="padding-bottom: 2px;" colspan="3"> <input type="text" name="linkStyle" id="linkStyle" value="" style="font-size: 10px; width: 100%;"> </td> </tr> <tr> <td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Class:</td> <td style="padding-bottom: 2px;"> <input type="text" name="linkClass" id="linkClass" value="" style="font-size: 10px; width: 90%;"> </td> <td style="padding-bottom: 2px; width: 30px; font-family: arial, verdana, helvetica; font-size: 11px;">Name:</td> <td style="padding-bottom: 2px; width: 120px;"> <input type="text" name="linkName" id="linkName" value="" style="font-size: 10px; width: 100%;"> </td> </tr> </table> <div align="right" style="padding-top: 5px;"><input type="submit" value=" Submit " onClick="insertHyperLink();" style="font-size: 12px;" >&nbsp;<input type="submit" value=" Cancel " onClick="window.close();" style="font-size: 12px;" ></div> </td></tr></table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/insert_hyperlink.html
HTML
art
6,793
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Create or Modify Table</title> <style type="text/css"> body, td { font-family: arial, verdana, helvetica; font-size: 11px; } select, input, button { font-size: 10px; } .table-settings { background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px; } </style> </head> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript" src="../scripts/wysiwyg-color.js"></script> <script type="text/javascript"> var n = WYSIWYG_Popup.getParam('wysiwyg'); // add stylesheet file if(n) document.write('<link rel="stylesheet" type="text/css" href="../' + WYSIWYG.config[n].CSSFile +'">\n'); /* ---------------------------------------------------------------------- *\ Function : buildTable() Description : Builds a table and inserts it into the WYSIWYG. \* ---------------------------------------------------------------------- */ function buildTable() { var WYSIWYG_Table = window.opener.WYSIWYG_Table; var doc = WYSIWYG.getEditorWindow(n).document; // create a table object var table = doc.createElement("TABLE"); // set cols and rows WYSIWYG_Core.setAttribute(table, "tmpcols", document.getElementById("cols").value); WYSIWYG_Core.setAttribute(table, "tmprows", document.getElementById("rows").value); // alignment if(document.getElementById("alignment").value != "") WYSIWYG_Core.setAttribute(table, "align", document.getElementById("alignment").value); // style attributes var style = ""; // padding style += "padding:" + document.getElementById("padding").value + "px;"; // width style += "width:" + document.getElementById("width").value + document.getElementById("widthType").value + ";"; // border style += "border:" + document.getElementById("border").value + "px;"; // borderstyle if(document.getElementById("borderstyle").value != "none") style += "border-style:" + document.getElementById("borderstyle").value + ";"; // border-color if(document.getElementById("bordercolor").value != "none") style += "border-color:" + document.getElementById("bordercolor").value + ";"; // border-collapse var collapse = document.getElementById("bordercollapse").checked ? "true" : "separate"; style += "border-collapse:" + collapse + ";"; // background-color if(document.getElementById("backgroundcolor").value != "none") style += "background-color:" + document.getElementById("backgroundcolor").value + ";"; WYSIWYG_Core.setAttribute(table, "style", style); WYSIWYG_Table.create(n, table); window.close(); return; // Checks if the table border will use the BORDER-COLLAPSE CSS attribute var collapse; if (document.getElementById('borderCollapse').checked == true) { collapse = document.getElementById('borderCollapse').value; } else { collapse = "separate"; } // Builds a table based on the data input into the form var table = '<table border="0" cellpadding="0" cellspacing="0" style="'; table += 'BORDER-COLLAPSE: ' + collapse + ';'; table += ' border: ' + document.getElementById('borderWidth').value + ' ' + document.getElementById('borderStyle').value + ' ' + document.getElementById('borderColor').value + ';'; table += ' width: ' + document.getElementById('tableWidth').value + document.getElementById('widthType').value + ';'; table += ' background-color: ' + document.getElementById('shadingColor').value + ';"'; table += ' alignment="' + document.getElementById('alignment').value + '">\n'; // Creates the number of rows and cols the table will have for (var i = 0; i < document.getElementById('rows').value; i++) { table += '<tr>\n'; for (var j = 0; j < document.getElementById('cols').value; j++) { table += '<td style="border: ' + document.getElementById('borderWidth').value + ' ' + document.getElementById('borderStyle').value + ' ' + document.getElementById('borderColor').value + '; padding: ' + document.getElementById('padding').value + ';">&nbsp;</td>\n'; } table += '</tr>\n'; } table += '</table>\n'; // Inserts the table code into the WYSIWYG editor WYSIWYG.insertHTML(table, n); window.close(); } </script> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onload="WYSIWYG_ColorInst.init();"> <table border="0" cellpadding="0" cellspacing="0" style="width:100%;padding: 10px;"> <tr> <td> <span style=" font-weight: bold;">Table Properties:</span> <table style="width:100%;" border="0" cellpadding="1" cellspacing="0" class="table-settings"> <tr> <td style="width: 20%;"> Rows: </td> <td style="width: 25%;"> <input type="text" size="4" id="rows" name="rows" value="2" style="width: 50px;"> </td> <td style="width: 25%;"> Width: </td> <td style="width: 30%;"> <input type="text" name="width" id="width" value="100" size="10" style="width: 50px;"> <select name="widthType" id="widthType" style="margin-right: 10px; font-size: 10px;"> <option value="%">%</option> <option value="px">px</option> </select> </td> </tr> <tr> <td> Cols: </td> <td> <input type="text" size="4" id="cols" name="cols" value="2" style="width: 50px;"> </td> <td> Alignment: </td> <td> <select name="alignment" id="alignment" style="margin-right: 10px; width: 95px;"> <option value="">Not Set</option> <option value="left">Left</option> <option value="right">Right</option> <option value="center">Center</option> </select> </td> </tr> <tr> <td> Padding: </td> <td> <input type="text" id="padding" name="padding" value="2" style="width: 50px;"> </td> <td> Background-Color: </td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="25"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <input type="text" name="backgroundcolor" id="backgroundcolor" value="none" style="width:50px;"> </td> </tr> </table> </td> <td> <button style="margin-left: 2px;" onClick="WYSIWYG_ColorInst.choose('backgroundcolor');"> Choose </button> </td> </tr> </table> </td> </tr> <tr> <td> Border-Size: </td> <td> <input type="text" size="4" id="border" name="border" value="0" style="width: 50px;"> </td> <td> Border-Color: </td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="25"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <input type="text" name="bordercolor" id="bordercolor" value="none" style="width:50px;"> </td> </tr> </table> </td> <td> <button style="margin-left: 2px;" onClick="WYSIWYG_ColorInst.choose('bordercolor');"> Choose </button> </td> </tr> </table> </td> </tr> <tr> <td> Border-Style: </td> <td> <select id="borderstyle" name="borderstyle" style="width: 80px;"> <option value="none">none</option> <option value="solid">solid</option> <option value="double">double</option> <option value="dotted">dotted</option> <option value="dashed">dashed</option> <option value="groove">groove</option> <option value="ridge">ridge</option> <option value="inset">inset</option> <option value="outset">outset</option> </select> </td> <td> Border-Collapse: </td> <td> <input type="checkbox" name="bordercollapse" id="bordercollapse"> </td> </tr> </table> </td> </tr> </table> <div align="right"> <input type="submit" value=" Submit " onClick="buildTable();" style="font-size: 12px;"> &nbsp; <input type="submit" value=" Cancel " onClick="window.close();" style="font-size: 12px; margin-right: 15px;"> </div> </td> </tr> </table> </div> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/create_table.html
HTML
art
8,896
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | License</title> </head> <body style="font-family: arial, verdana, helvetia, sans serif; font-size: 12px; background-color: #F7F7F7;"> <h1>GNU Lesser General Public License</h1> <p>Version 2.1, February 1999</p> <blockquote> <p>Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p> <p>[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]</p></blockquote> <h3>Preamble</h3> <p> The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. </p> <p>This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. </p> <p> When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.</p> <p>To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. </p> <p> For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. </p> <p>We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. </p> <p>To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. </p> <p> Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. </p> <p>Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. </p> <p>When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. </p> <p>We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. </p> <p>For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. </p> <p>In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. </p> <p> Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. </p> <p>The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. </p> <h3>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</h3> <p><strong>0.</strong> This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".</p> <p> A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. </p> <p> The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) </p> <p> "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.</p> <p>Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. </p> <p><strong>1.</strong> You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. </p> <p> You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. </p> <p><strong>2.</strong> You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: </p> <blockquote> <p>a) The modified work must itself be a software library. </p> <p>b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.</p> <p>c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. </p> <p>d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. </p> <p> (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) </p> <p> These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. </p> <p>Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. </p> <p> In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. </p></blockquote> <p><strong>3.</strong> You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. </p> <p>Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. </p> <p> This option is useful when you wish to copy part of the code of the Library into a program that is not a library. </p> <p><strong>4.</strong> You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. </p> <p>If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.</p> <p><strong>5.</strong> A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. </p> <p> However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. </p> <p> When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. </p> <p> If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) </p> <p>Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. </p> <p><strong>6.</strong> As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. </p> <p> You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: </p> <blockquote><p>a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) </p> <p>b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. </p> <p> c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. </p> <p>d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. </p> <p>e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.</p> </blockquote> <p>For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. </p> <p> It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. </p> <p><strong>7.</strong> You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: </p> <blockquote> <p>a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. </p> <p>b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.</p></blockquote> <p><strong>8.</strong> You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p> <p> <strong>9.</strong> You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. </p> <p> <strong>10.</strong> Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. </p> <p><strong>11.</strong> If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. </p> <p> If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. </p> <p>It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. </p> <p>This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. </p> <p> <strong>12.</strong> If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. </p> <p> <strong>13.</strong> The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.</p> <p>Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. </p> <p> <strong>14.</strong> If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. </p> <p> NO WARRANTY </p> <p> <strong>15. </strong>BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. </p> <p> <strong>16.</strong> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. </p> <h3><strong>END OF TERMS AND CONDITIONS</strong></h3> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/license.html
HTML
art
25,365
<html> <head> <title>openWYSIWYG | About</title> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript"> var n = WYSIWYG_Popup.getParam('wysiwyg'); </script> </head> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"> <tr> <td> <table width="380" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="border-bottom: 2px solid #FFFFFF;" rowspan="2"> <script type="text/javascript"> document.write('<img src="../' + window.opener.WYSIWYG.config[n].ImagesDir + 'logo.gif" alt="openWebWare: openWYSIWYG">'); </script> </td> <td colspan="4" style="height: 50px;"> &nbsp; </td> </tr> <tr> <td width="60" style="background-color: #F7F7F7;"> <table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #DDDDDD; border: 2px solid #FFFFFF; padding: 2px;"> <tr> <td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;"> <script type="text/javascript"> document.write('<a href="about.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">About</a>'); </script> </td> </tr> </table> </td> <td width="5" style="border-bottom: 2px solid #FFFFFF;"> &nbsp; </td> <td width="60" style="background-color: #F7F7F7;"> <table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border-width: 2 2 0 2; border-style: solid; border-color: #FFFFFF; border-bottom: 2px solid #F7F7F7; padding: 2px;"> <tr> <td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;"> <script type="text/javascript"> document.write('<a href="about_license.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">License</a>'); </script> </td> </tr> </table> </td> <td width="5" style="border-bottom: 2px solid #FFFFFF;"> &nbsp; </td> </tr> </table> <table width="380" border="0" cellpadding="0" cellspacing="0" style="height: 260px; background-color: #F7F7F7; border-width: 0 2 2 2; border-style: solid; border-color: #FFFFFF; padding: 5px;"> <tr> <td> <iframe style="width: 360px; height: 244px; border: none;" src="license.html"></iframe> </td> </tr> </table> </td> </tr> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/about_license.html
HTML
art
2,823
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Insert or Modify Image</title> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script language="JavaScript" type="text/javascript"> /* ---------------------------------------------------------------------- *\ Function : insertImage() Description : Inserts image into the WYSIWYG. \* ---------------------------------------------------------------------- */ function insertImage() { var n = WYSIWYG_Popup.getParam('wysiwyg'); // get values from form fields var src = document.getElementById('src').value; var alt = document.getElementById('alt').value; var width = document.getElementById('width').value var height = document.getElementById('height').value var border = document.getElementById('border').value var align = document.getElementById('align').value var vspace = document.getElementById('vspace').value var hspace = document.getElementById('hspace').value // insert image WYSIWYG.insertImage(src, width, height, align, border, alt, hspace, vspace, n); window.close(); } /* ---------------------------------------------------------------------- *\ Function : loadImage() Description : load the settings of a selected image into the form fields \* ---------------------------------------------------------------------- */ function loadImage() { var n = WYSIWYG_Popup.getParam('wysiwyg'); // get selection and range var sel = WYSIWYG.getSelection(n); var range = WYSIWYG.getRange(sel); // the current tag of range var img = WYSIWYG.findParent("img", range); // if no image is defined then return if(img == null) return; // assign the values to the form elements for(var i = 0;i < img.attributes.length;i++) { var attr = img.attributes[i].name.toLowerCase(); var value = img.attributes[i].value; //alert(attr + " = " + value); if(attr && value && value != "null") { switch(attr) { case "src": // strip off urls on IE if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false); document.getElementById('src').value = value; break; case "alt": document.getElementById('alt').value = value; break; case "align": selectItemByValue(document.getElementById('align'), value); break; case "border": document.getElementById('border').value = value; break; case "hspace": document.getElementById('hspace').value = value; break; case "vspace": document.getElementById('vspace').value = value; break; case "width": document.getElementById('width').value = value; break; case "height": document.getElementById('height').value = value; break; } } } // get width and height from style attribute in none IE browsers if(!WYSIWYG_Core.isMSIE && document.getElementById('width').value == "" && document.getElementById('width').value == "") { document.getElementById('width').value = img.style.width.replace(/px/, ""); document.getElementById('height').value = img.style.height.replace(/px/, ""); } } /* ---------------------------------------------------------------------- *\ Function : selectItem() Description : Select an item of an select box element by value. \* ---------------------------------------------------------------------- */ function selectItemByValue(element, value) { if(element.options.length) { for(var i=0;i<element.options.length;i++) { if(element.options[i].value == value) { element.options[i].selected = true; } } } } </script> </head> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadImage();"> <table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"><tr><td> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Image:</span> <table width="380" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="80">Image URL:</td> <td style="padding-bottom: 2px; padding-top: 0px;" width="300"><input type="text" name="src" id="src" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Alternate Text:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="alt" id="alt" value="" style="font-size: 10px; width: 100%;"></td> </tr> </table> <table width="380" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px;"><tr><td style="vertical-align:top;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Layout:</span> <table width="180" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Width:</td> <td style="width:60px;padding-bottom: 2px; padding-top: 0px;"><input type="text" name="width" id="width" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Height:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="height" id="height" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Border:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="border" id="border" value="0" style="font-size: 10px; width: 100%;"></td> </tr> </table> </td> <td width="10">&nbsp;</td> <td style="vertical-align:top;"> <span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">&nbsp;</span> <table width="200" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;"> <tr> <td style="width: 115px;padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="100">Alignment:</td> <td style="width: 85px;padding-bottom: 2px; padding-top: 0px;"> <select name="align" id="align" style="font-family: arial, verdana, helvetica; font-size: 11px; width: 100%;"> <option value="">Not Set</option> <option value="left">Left</option> <option value="right">Right</option> <option value="texttop">Texttop</option> <option value="absmiddle">Absmiddle</option> <option value="baseline">Baseline</option> <option value="absbottom">Absbottom</option> <option value="bottom">Bottom</option> <option value="middle">Middle</option> <option value="top">Top</option> </select> </td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Horizontal Space:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="hspace" id="hspace" value="" style="font-size: 10px; width: 100%;"></td> </tr> <tr> <td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Vertical Space:</td> <td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="vspace" id="vspace" value="" style="font-size: 10px; width: 100%;"></td> </tr> </table> </td></tr></table> <div align="right" style="padding-top: 5px;"><input type="submit" value=" Submit " onClick="insertImage();" style="font-size: 12px;" >&nbsp;<input type="submit" value=" Cancel " onClick="window.close();" style="font-size: 12px;" ></div> </td></tr></table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/insert_image.html
HTML
art
8,080
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Preview</title> </head> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript"> function preview() { // get params var n = WYSIWYG_Popup.getParam('wysiwyg'); // set default styles WYSIWYG_Core.setAttribute(document.body, "style", WYSIWYG.config[n].DefaultStyle); // get content WYSIWYG_Table.disableHighlighting(n); var content = WYSIWYG.getEditorWindow(n).document.body.innerHTML; WYSIWYG_Table.refreshHighlighting(n); content = content.replace(/src="([^/|^http|^https])/gi, "src=\"../$1"); // correct relative image path content = content.replace(/href="([^/|^http|^https|^ftp])/gi, "href=\"../$1"); // correct relative anchor path // set content document.body.innerHTML = content; } </script> <body onLoad="preview();"> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/preview.html
HTML
art
919
<html> <head> <title>openWYSIWYG | About</title> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript"> var n = WYSIWYG_Popup.getParam('wysiwyg'); </script> </head> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"> <tr> <td> <table width="380" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="border-bottom: 2px solid #FFFFFF;" rowspan="2"> <script type="text/javascript"> document.write('<img src="../' + window.opener.WYSIWYG.config[n].ImagesDir + 'logo.gif" alt="openWebWare: openWYSIWYG">'); </script> </td> <td colspan="4" style="height: 50px;"> &nbsp; </td> </tr> <tr> <td width="60" style="background-color: #F7F7F7;"> <table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border-width: 2 2 0 2; border-style: solid; border-color: #FFFFFF; border-bottom: 2px solid #F7F7F7; padding: 2px;"> <tr> <td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;"> <script type="text/javascript"> document.write('<a href="about.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">About</a>'); </script> </td> </tr> </table> </td> <td width="5" style="border-bottom: 2px solid #FFFFFF;"> &nbsp; </td> <td width="60" style="background-color: #F7F7F7;"> <table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #DDDDDD; border: 2px solid #FFFFFF; padding: 2px;"> <tr> <td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;"> <script type="text/javascript"> document.write('<a href="about_license.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">License</a>'); </script> </td> </tr> </table> </td> <td width="5" style="border-bottom: 2px solid #FFFFFF;"> &nbsp; </td> </tr> </table> <table width="380" border="0" cellpadding="0" cellspacing="0" style="height: 260px; background-color: #F7F7F7; border-width: 0 2 2 2; border-style: solid; border-color: #FFFFFF; padding: 5px;"> <tr> <td style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;"> An open source cross-browser WYSIWYG editor.<br><br> Version 1.4.7<br> Copyright &copy 2006 <a href="http://www.openwebware.com/" target="_blank">openWebWare.com</a> <br> All Rights Reserved <br> <br> <br> <b style="font-size: 12px;">Resources:</b> <ul> <li> <a href="http://www.openwebware.com/" target="_blank">openWebWare.com Website</a> - open source applications and developer tools. </li> <li style="margin-top: 3px;"> <a href="http://www.openwebware.com/products/openwysiwyg/" target="_blank">openWYSIWYG Homepage</a> - cross browser &lt;textarea&gt; replacelemt. </li> <li style="margin-top: 3px;"> <a href="http://www.openwebware.com/forum/viewforum.php?f=1" target="_blank">User Forums</a> - trade openWYSIWYG tips and tricks with other developers. </li> <!-- <li style="margin-top: 3px;"> <a href="http://www.openwebware.com/products/openwysiwyg/docs/" target="_blank">Online Documentation</a> - user documentation. </li> --> </ul> </td> </tr> </table> </td> </tr> </table> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/about.html
HTML
art
3,970
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>openWYSIWYG | Select Color</title> </head> <script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script> <script type="text/javascript"> /** * Loads the color in the form field */ function loadColor() { document.getElementById('enterColor').value = "#" + WYSIWYG_Popup.getParam('color'); } /* ---------------------------------------------------------------------- *\ Function : selectColor() Description : Selects the color and inserts it into the WYSIWYG \* ---------------------------------------------------------------------- */ function selectColor(color) { // get params var n = WYSIWYG_Popup.getParam('wysiwyg'); var cmd = WYSIWYG_Popup.getParam('command'); var doc = WYSIWYG.getEditorWindow(n).document; // execute command WYSIWYG_Core.execCommand(n, cmd, color); // close window window.close(); } /* ---------------------------------------------------------------------- *\ Function : previewColor() Description : Updates the preview pane as the user mouses over different colors \* ---------------------------------------------------------------------- */ function previewColor(color) { document.getElementById('enterColor').value = color; document.getElementById('PreviewColor').style.backgroundColor = color; } </script> <body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadColor();"> <center> <table border="0" cellspacing="0" cellpadding="4" width="100%"> <form onSubmit="selectColor(document.getElementById('enterColor').value);"> <tr> <td valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="PreviewColor" style="height: 100%; width: 100%"></div></div></td> <td valign=center><input type="text" size="15" name="enterColor" id="enterColor" style="font-size: 10px;"></td> <td width="100%"></td> </tr> </form> </table> <table border=0 cellspacing=1 cellpadding=0 bgcolor="#000000" style="cursor: hand;" > <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#003300" onMouseOver="previewColor('#003300')" onClick="selectColor('#003300')" height="10" width="10"></td> <td bgcolor="#006600" onMouseOver="previewColor('#006600')" onClick="selectColor('#006600')" height="10" width="10"></td> <td bgcolor="#009900" onMouseOver="previewColor('#009900')" onClick="selectColor('#009900')" height="10" width="10"></td> <td bgcolor="#00CC00" onMouseOver="previewColor('#00CC00')" onClick="selectColor('#00CC00')" height="10" width="10"></td> <td bgcolor="#00FF00" onMouseOver="previewColor('#00FF00')" onClick="selectColor('#00FF00')" height="10" width="10"></td> <td bgcolor="#330000" onMouseOver="previewColor('#330000')" onClick="selectColor('#330000')" height="10" width="10"></td> <td bgcolor="#333300" onMouseOver="previewColor('#333300')" onClick="selectColor('#333300')" height="10" width="10"></td> <td bgcolor="#336600" onMouseOver="previewColor('#336600')" onClick="selectColor('#336600')" height="10" width="10"></td> <td bgcolor="#339900" onMouseOver="previewColor('#339900')" onClick="selectColor('#339900')" height="10" width="10"></td> <td bgcolor="#33CC00" onMouseOver="previewColor('#33CC00')" onClick="selectColor('#33CC00')" height="10" width="10"></td> <td bgcolor="#33FF00" onMouseOver="previewColor('#33FF00')" onClick="selectColor('#33FF00')" height="10" width="10"></td> <td bgcolor="#660000" onMouseOver="previewColor('#660000')" onClick="selectColor('#660000')" height="10" width="10"></td> <td bgcolor="#663300" onMouseOver="previewColor('#663300')" onClick="selectColor('#663300')" height="10" width="10"></td> <td bgcolor="#666600" onMouseOver="previewColor('#666600')" onClick="selectColor('#666600')" height="10" width="10"></td> <td bgcolor="#669900" onMouseOver="previewColor('#669900')" onClick="selectColor('#669900')" height="10" width="10"></td> <td bgcolor="#66CC00" onMouseOver="previewColor('#66CC00')" onClick="selectColor('#66CC00')" height="10" width="10"></td> <td bgcolor="#66FF00" onMouseOver="previewColor('#66FF00')" onClick="selectColor('#66FF00')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#333333" onMouseOver="previewColor('#333333')" onClick="selectColor('#333333')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000033" onMouseOver="previewColor('#000033')" onClick="selectColor('#000033')" height="10" width="10"></td> <td bgcolor="#003333" onMouseOver="previewColor('#003333')" onClick="selectColor('#003333')" height="10" width="10"></td> <td bgcolor="#006633" onMouseOver="previewColor('#006633')" onClick="selectColor('#006633')" height="10" width="10"></td> <td bgcolor="#009933" onMouseOver="previewColor('#009933')" onClick="selectColor('#009933')" height="10" width="10"></td> <td bgcolor="#00CC33" onMouseOver="previewColor('#00CC33')" onClick="selectColor('#00CC33')" height="10" width="10"></td> <td bgcolor="#00FF33" onMouseOver="previewColor('#00FF33')" onClick="selectColor('#00FF33')" height="10" width="10"></td> <td bgcolor="#330033" onMouseOver="previewColor('#330033')" onClick="selectColor('#330033')" height="10" width="10"></td> <td bgcolor="#333333" onMouseOver="previewColor('#333333')" onClick="selectColor('#333333')" height="10" width="10"></td> <td bgcolor="#336633" onMouseOver="previewColor('#336633')" onClick="selectColor('#336633')" height="10" width="10"></td> <td bgcolor="#339933" onMouseOver="previewColor('#339933')" onClick="selectColor('#339933')" height="10" width="10"></td> <td bgcolor="#33CC33" onMouseOver="previewColor('#33CC33')" onClick="selectColor('#33CC33')" height="10" width="10"></td> <td bgcolor="#33FF33" onMouseOver="previewColor('#33FF33')" onClick="selectColor('#33FF33')" height="10" width="10"></td> <td bgcolor="#660033" onMouseOver="previewColor('#660033')" onClick="selectColor('#660033')" height="10" width="10"></td> <td bgcolor="#663333" onMouseOver="previewColor('#663333')" onClick="selectColor('#663333')" height="10" width="10"></td> <td bgcolor="#666633" onMouseOver="previewColor('#666633')" onClick="selectColor('#666633')" height="10" width="10"></td> <td bgcolor="#669933" onMouseOver="previewColor('#669933')" onClick="selectColor('#669933')" height="10" width="10"></td> <td bgcolor="#66CC33" onMouseOver="previewColor('#66CC33')" onClick="selectColor('#66CC33')" height="10" width="10"></td> <td bgcolor="#66FF33" onMouseOver="previewColor('#66FF33')" onClick="selectColor('#66FF33')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#666666" onMouseOver="previewColor('#666666')" onClick="selectColor('#666666')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000066" onMouseOver="previewColor('#000066')" onClick="selectColor('#000066')" height="10" width="10"></td> <td bgcolor="#003366" onMouseOver="previewColor('#003366')" onClick="selectColor('#003366')" height="10" width="10"></td> <td bgcolor="#006666" onMouseOver="previewColor('#006666')" onClick="selectColor('#006666')" height="10" width="10"></td> <td bgcolor="#009966" onMouseOver="previewColor('#009966')" onClick="selectColor('#009966')" height="10" width="10"></td> <td bgcolor="#00CC66" onMouseOver="previewColor('#00CC66')" onClick="selectColor('#00CC66')" height="10" width="10"></td> <td bgcolor="#00FF66" onMouseOver="previewColor('#00FF66')" onClick="selectColor('#00FF66')" height="10" width="10"></td> <td bgcolor="#330066" onMouseOver="previewColor('#330066')" onClick="selectColor('#330066')" height="10" width="10"></td> <td bgcolor="#333366" onMouseOver="previewColor('#333366')" onClick="selectColor('#333366')" height="10" width="10"></td> <td bgcolor="#336666" onMouseOver="previewColor('#336666')" onClick="selectColor('#336666')" height="10" width="10"></td> <td bgcolor="#339966" onMouseOver="previewColor('#339966')" onClick="selectColor('#339966')" height="10" width="10"></td> <td bgcolor="#33CC66" onMouseOver="previewColor('#33CC66')" onClick="selectColor('#33CC66')" height="10" width="10"></td> <td bgcolor="#33FF66" onMouseOver="previewColor('#33FF66')" onClick="selectColor('#33FF66')" height="10" width="10"></td> <td bgcolor="#660066" onMouseOver="previewColor('#660066')" onClick="selectColor('#660066')" height="10" width="10"></td> <td bgcolor="#663366" onMouseOver="previewColor('#663366')" onClick="selectColor('#663366')" height="10" width="10"></td> <td bgcolor="#666666" onMouseOver="previewColor('#666666')" onClick="selectColor('#666666')" height="10" width="10"></td> <td bgcolor="#669966" onMouseOver="previewColor('#669966')" onClick="selectColor('#669966')" height="10" width="10"></td> <td bgcolor="#66CC66" onMouseOver="previewColor('#66CC66')" onClick="selectColor('#66CC66')" height="10" width="10"></td> <td bgcolor="#66FF66" onMouseOver="previewColor('#66FF66')" onClick="selectColor('#66FF66')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#999999" onMouseOver="previewColor('#999999')" onClick="selectColor('#999999')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#000099" onMouseOver="previewColor('#000099')" onClick="selectColor('#000099')" height="10" width="10"></td> <td bgcolor="#003399" onMouseOver="previewColor('#003399')" onClick="selectColor('#003399')" height="10" width="10"></td> <td bgcolor="#006699" onMouseOver="previewColor('#006699')" onClick="selectColor('#006699')" height="10" width="10"></td> <td bgcolor="#009999" onMouseOver="previewColor('#009999')" onClick="selectColor('#009999')" height="10" width="10"></td> <td bgcolor="#00CC99" onMouseOver="previewColor('#00CC99')" onClick="selectColor('#00CC99')" height="10" width="10"></td> <td bgcolor="#00FF99" onMouseOver="previewColor('#00FF99')" onClick="selectColor('#00FF99')" height="10" width="10"></td> <td bgcolor="#330099" onMouseOver="previewColor('#330099')" onClick="selectColor('#330099')" height="10" width="10"></td> <td bgcolor="#333399" onMouseOver="previewColor('#333399')" onClick="selectColor('#333399')" height="10" width="10"></td> <td bgcolor="#336699" onMouseOver="previewColor('#336699')" onClick="selectColor('#336699')" height="10" width="10"></td> <td bgcolor="#339999" onMouseOver="previewColor('#339999')" onClick="selectColor('#339999')" height="10" width="10"></td> <td bgcolor="#33CC99" onMouseOver="previewColor('#33CC99')" onClick="selectColor('#33CC99')" height="10" width="10"></td> <td bgcolor="#33FF99" onMouseOver="previewColor('#33FF99')" onClick="selectColor('#33FF99')" height="10" width="10"></td> <td bgcolor="#660099" onMouseOver="previewColor('#660099')" onClick="selectColor('#660099')" height="10" width="10"></td> <td bgcolor="#663399" onMouseOver="previewColor('#663399')" onClick="selectColor('#663399')" height="10" width="10"></td> <td bgcolor="#666699" onMouseOver="previewColor('#666699')" onClick="selectColor('#666699')" height="10" width="10"></td> <td bgcolor="#669999" onMouseOver="previewColor('#669999')" onClick="selectColor('#669999')" height="10" width="10"></td> <td bgcolor="#66CC99" onMouseOver="previewColor('#66CC99')" onClick="selectColor('#66CC99')" height="10" width="10"></td> <td bgcolor="#66FF99" onMouseOver="previewColor('#66FF99')" onClick="selectColor('#66FF99')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#CCCCCC" onMouseOver="previewColor('#CCCCCC')" onClick="selectColor('#CCCCCC')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#0000CC" onMouseOver="previewColor('#0000CC')" onClick="selectColor('#0000CC')" height="10" width="10"></td> <td bgcolor="#0033CC" onMouseOver="previewColor('#0033CC')" onClick="selectColor('#0033CC')" height="10" width="10"></td> <td bgcolor="#0066CC" onMouseOver="previewColor('#0066CC')" onClick="selectColor('#0066CC')" height="10" width="10"></td> <td bgcolor="#0099CC" onMouseOver="previewColor('#0099CC')" onClick="selectColor('#0099CC')" height="10" width="10"></td> <td bgcolor="#00CCCC" onMouseOver="previewColor('#00CCCC')" onClick="selectColor('#00CCCC')" height="10" width="10"></td> <td bgcolor="#00FFCC" onMouseOver="previewColor('#00FFCC')" onClick="selectColor('#00FFCC')" height="10" width="10"></td> <td bgcolor="#3300CC" onMouseOver="previewColor('#3300CC')" onClick="selectColor('#3300CC')" height="10" width="10"></td> <td bgcolor="#3333CC" onMouseOver="previewColor('#3333CC')" onClick="selectColor('#3333CC')" height="10" width="10"></td> <td bgcolor="#3366CC" onMouseOver="previewColor('#3366CC')" onClick="selectColor('#3366CC')" height="10" width="10"></td> <td bgcolor="#3399CC" onMouseOver="previewColor('#3399CC')" onClick="selectColor('#3399CC')" height="10" width="10"></td> <td bgcolor="#33CCCC" onMouseOver="previewColor('#33CCCC')" onClick="selectColor('#33CCCC')" height="10" width="10"></td> <td bgcolor="#33FFCC" onMouseOver="previewColor('#33FFCC')" onClick="selectColor('#33FFCC')" height="10" width="10"></td> <td bgcolor="#6600CC" onMouseOver="previewColor('#6600CC')" onClick="selectColor('#6600CC')" height="10" width="10"></td> <td bgcolor="#6633CC" onMouseOver="previewColor('#6633CC')" onClick="selectColor('#6633CC')" height="10" width="10"></td> <td bgcolor="#6666CC" onMouseOver="previewColor('#6666CC')" onClick="selectColor('#6666CC')" height="10" width="10"></td> <td bgcolor="#6699CC" onMouseOver="previewColor('#6699CC')" onClick="selectColor('#6699CC')" height="10" width="10"></td> <td bgcolor="#66CCCC" onMouseOver="previewColor('#66CCCC')" onClick="selectColor('#66CCCC')" height="10" width="10"></td> <td bgcolor="#66FFCC" onMouseOver="previewColor('#66FFCC')" onClick="selectColor('#66FFCC')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#FFFFFF" onMouseOver="previewColor('#FFFFFF')" onClick="selectColor('#FFFFFF')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#0000FF" onMouseOver="previewColor('#0000FF')" onClick="selectColor('#0000FF')" height="10" width="10"></td> <td bgcolor="#0033FF" onMouseOver="previewColor('#0033FF')" onClick="selectColor('#0033FF')" height="10" width="10"></td> <td bgcolor="#0066FF" onMouseOver="previewColor('#0066FF')" onClick="selectColor('#0066FF')" height="10" width="10"></td> <td bgcolor="#0099FF" onMouseOver="previewColor('#0099FF')" onClick="selectColor('#0099FF')" height="10" width="10"></td> <td bgcolor="#00CCFF" onMouseOver="previewColor('#00CCFF')" onClick="selectColor('#00CCFF')" height="10" width="10"></td> <td bgcolor="#00FFFF" onMouseOver="previewColor('#00FFFF')" onClick="selectColor('#00FFFF')" height="10" width="10"></td> <td bgcolor="#3300FF" onMouseOver="previewColor('#3300FF')" onClick="selectColor('#3300FF')" height="10" width="10"></td> <td bgcolor="#3333FF" onMouseOver="previewColor('#3333FF')" onClick="selectColor('#3333FF')" height="10" width="10"></td> <td bgcolor="#3366FF" onMouseOver="previewColor('#3366FF')" onClick="selectColor('#3366FF')" height="10" width="10"></td> <td bgcolor="#3399FF" onMouseOver="previewColor('#3399FF')" onClick="selectColor('#3399FF')" height="10" width="10"></td> <td bgcolor="#33CCFF" onMouseOver="previewColor('#33CCFF')" onClick="selectColor('#33CCFF')" height="10" width="10"></td> <td bgcolor="#33FFFF" onMouseOver="previewColor('#33FFFF')" onClick="selectColor('#33FFFF')" height="10" width="10"></td> <td bgcolor="#6600FF" onMouseOver="previewColor('#6600FF')" onClick="selectColor('#6600FF')" height="10" width="10"></td> <td bgcolor="#6633FF" onMouseOver="previewColor('#6633FF')" onClick="selectColor('#6633FF')" height="10" width="10"></td> <td bgcolor="#6666FF" onMouseOver="previewColor('#6666FF')" onClick="selectColor('#6666FF')" height="10" width="10"></td> <td bgcolor="#6699FF" onMouseOver="previewColor('#6699FF')" onClick="selectColor('#6699FF')" height="10" width="10"></td> <td bgcolor="#66CCFF" onMouseOver="previewColor('#66CCFF')" onClick="selectColor('#66CCFF')" height="10" width="10"></td> <td bgcolor="#66FFFF" onMouseOver="previewColor('#66FFFF')" onClick="selectColor('#66FFFF')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#FF0000" onMouseOver="previewColor('#FF0000')" onClick="selectColor('#FF0000')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#990000" onMouseOver="previewColor('#990000')" onClick="selectColor('#990000')" height="10" width="10"></td> <td bgcolor="#993300" onMouseOver="previewColor('#993300')" onClick="selectColor('#993300')" height="10" width="10"></td> <td bgcolor="#996600" onMouseOver="previewColor('#996600')" onClick="selectColor('#996600')" height="10" width="10"></td> <td bgcolor="#999900" onMouseOver="previewColor('#999900')" onClick="selectColor('#999900')" height="10" width="10"></td> <td bgcolor="#99CC00" onMouseOver="previewColor('#99CC00')" onClick="selectColor('#99CC00')" height="10" width="10"></td> <td bgcolor="#99FF00" onMouseOver="previewColor('#99FF00')" onClick="selectColor('#99FF00')" height="10" width="10"></td> <td bgcolor="#CC0000" onMouseOver="previewColor('#CC0000')" onClick="selectColor('#CC0000')" height="10" width="10"></td> <td bgcolor="#CC3300" onMouseOver="previewColor('#CC3300')" onClick="selectColor('#CC3300')" height="10" width="10"></td> <td bgcolor="#CC6600" onMouseOver="previewColor('#CC6600')" onClick="selectColor('#CC6600')" height="10" width="10"></td> <td bgcolor="#CC9900" onMouseOver="previewColor('#CC9900')" onClick="selectColor('#CC9900')" height="10" width="10"></td> <td bgcolor="#CCCC00" onMouseOver="previewColor('#CCCC00')" onClick="selectColor('#CCCC00')" height="10" width="10"></td> <td bgcolor="#CCFF00" onMouseOver="previewColor('#CCFF00')" onClick="selectColor('#CCFF00')" height="10" width="10"></td> <td bgcolor="#FF0000" onMouseOver="previewColor('#FF0000')" onClick="selectColor('#FF0000')" height="10" width="10"></td> <td bgcolor="#FF3300" onMouseOver="previewColor('#FF3300')" onClick="selectColor('#FF3300')" height="10" width="10"></td> <td bgcolor="#FF6600" onMouseOver="previewColor('#FF6600')" onClick="selectColor('#FF6600')" height="10" width="10"></td> <td bgcolor="#FF9900" onMouseOver="previewColor('#FF9900')" onClick="selectColor('#FF9900')" height="10" width="10"></td> <td bgcolor="#FFCC00" onMouseOver="previewColor('#FFCC00')" onClick="selectColor('#FFCC00')" height="10" width="10"></td> <td bgcolor="#FFFF00" onMouseOver="previewColor('#FFFF00')" onClick="selectColor('#FFFF00')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#00FF00" onMouseOver="previewColor('#00FF00')" onClick="selectColor('#00FF00')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#990033" onMouseOver="previewColor('#990033')" onClick="selectColor('#990033')" height="10" width="10"></td> <td bgcolor="#993333" onMouseOver="previewColor('#993333')" onClick="selectColor('#993333')" height="10" width="10"></td> <td bgcolor="#996633" onMouseOver="previewColor('#996633')" onClick="selectColor('#996633')" height="10" width="10"></td> <td bgcolor="#999933" onMouseOver="previewColor('#999933')" onClick="selectColor('#999933')" height="10" width="10"></td> <td bgcolor="#99CC33" onMouseOver="previewColor('#99CC33')" onClick="selectColor('#99CC33')" height="10" width="10"></td> <td bgcolor="#99FF33" onMouseOver="previewColor('#99FF33')" onClick="selectColor('#99FF33')" height="10" width="10"></td> <td bgcolor="#CC0033" onMouseOver="previewColor('#CC0033')" onClick="selectColor('#CC0033')" height="10" width="10"></td> <td bgcolor="#CC3333" onMouseOver="previewColor('#CC3333')" onClick="selectColor('#CC3333')" height="10" width="10"></td> <td bgcolor="#CC6633" onMouseOver="previewColor('#CC6633')" onClick="selectColor('#CC6633')" height="10" width="10"></td> <td bgcolor="#CC9933" onMouseOver="previewColor('#CC9933')" onClick="selectColor('#CC9933')" height="10" width="10"></td> <td bgcolor="#CCCC33" onMouseOver="previewColor('#CCCC33')" onClick="selectColor('#CCCC33')" height="10" width="10"></td> <td bgcolor="#CCFF33" onMouseOver="previewColor('#CCFF33')" onClick="selectColor('#CCFF33')" height="10" width="10"></td> <td bgcolor="#FF0033" onMouseOver="previewColor('#FF0033')" onClick="selectColor('#FF0033')" height="10" width="10"></td> <td bgcolor="#FF3333" onMouseOver="previewColor('#FF3333')" onClick="selectColor('#FF3333')" height="10" width="10"></td> <td bgcolor="#FF6633" onMouseOver="previewColor('#FF6633')" onClick="selectColor('#FF6633')" height="10" width="10"></td> <td bgcolor="#FF9933" onMouseOver="previewColor('#FF9933')" onClick="selectColor('#FF9933')" height="10" width="10"></td> <td bgcolor="#FFCC33" onMouseOver="previewColor('#FFCC33')" onClick="selectColor('#FFCC33')" height="10" width="10"></td> <td bgcolor="#FFFF33" onMouseOver="previewColor('#FFFF33')" onClick="selectColor('#FFFF33')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#0000FF" onMouseOver="previewColor('#0000FF')" onClick="selectColor('#0000FF')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#990066" onMouseOver="previewColor('#990066')" onClick="selectColor('#990066')" height="10" width="10"></td> <td bgcolor="#993366" onMouseOver="previewColor('#993366')" onClick="selectColor('#993366')" height="10" width="10"></td> <td bgcolor="#996666" onMouseOver="previewColor('#996666')" onClick="selectColor('#996666')" height="10" width="10"></td> <td bgcolor="#999966" onMouseOver="previewColor('#999966')" onClick="selectColor('#999966')" height="10" width="10"></td> <td bgcolor="#99CC66" onMouseOver="previewColor('#99CC66')" onClick="selectColor('#99CC66')" height="10" width="10"></td> <td bgcolor="#99FF66" onMouseOver="previewColor('#99FF66')" onClick="selectColor('#99FF66')" height="10" width="10"></td> <td bgcolor="#CC0066" onMouseOver="previewColor('#CC0066')" onClick="selectColor('#CC0066')" height="10" width="10"></td> <td bgcolor="#CC3366" onMouseOver="previewColor('#CC3366')" onClick="selectColor('#CC3366')" height="10" width="10"></td> <td bgcolor="#CC6666" onMouseOver="previewColor('#CC6666')" onClick="selectColor('#CC6666')" height="10" width="10"></td> <td bgcolor="#CC9966" onMouseOver="previewColor('#CC9966')" onClick="selectColor('#CC9966')" height="10" width="10"></td> <td bgcolor="#CCCC66" onMouseOver="previewColor('#CCCC66')" onClick="selectColor('#CCCC66')" height="10" width="10"></td> <td bgcolor="#CCFF66" onMouseOver="previewColor('#CCFF66')" onClick="selectColor('#CCFF66')" height="10" width="10"></td> <td bgcolor="#FF0066" onMouseOver="previewColor('#FF0066')" onClick="selectColor('#FF0066')" height="10" width="10"></td> <td bgcolor="#FF3366" onMouseOver="previewColor('#FF3366')" onClick="selectColor('#FF3366')" height="10" width="10"></td> <td bgcolor="#FF6666" onMouseOver="previewColor('#FF6666')" onClick="selectColor('#FF6666')" height="10" width="10"></td> <td bgcolor="#FF9966" onMouseOver="previewColor('#FF9966')" onClick="selectColor('#FF9966')" height="10" width="10"></td> <td bgcolor="#FFCC66" onMouseOver="previewColor('#FFCC66')" onClick="selectColor('#FFCC66')" height="10" width="10"></td> <td bgcolor="#FFFF66" onMouseOver="previewColor('#FFFF66')" onClick="selectColor('#FFFF66')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#FFFF00" onMouseOver="previewColor('#FFFF00')" onClick="selectColor('#FFFF00')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#990099" onMouseOver="previewColor('#990099')" onClick="selectColor('#990099')" height="10" width="10"></td> <td bgcolor="#993399" onMouseOver="previewColor('#993399')" onClick="selectColor('#993399')" height="10" width="10"></td> <td bgcolor="#996699" onMouseOver="previewColor('#996699')" onClick="selectColor('#996699')" height="10" width="10"></td> <td bgcolor="#999999" onMouseOver="previewColor('#999999')" onClick="selectColor('#999999')" height="10" width="10"></td> <td bgcolor="#99CC99" onMouseOver="previewColor('#99CC99')" onClick="selectColor('#99CC99')" height="10" width="10"></td> <td bgcolor="#99FF99" onMouseOver="previewColor('#99FF99')" onClick="selectColor('#99FF99')" height="10" width="10"></td> <td bgcolor="#CC0099" onMouseOver="previewColor('#CC0099')" onClick="selectColor('#CC0099')" height="10" width="10"></td> <td bgcolor="#CC3399" onMouseOver="previewColor('#CC3399')" onClick="selectColor('#CC3399')" height="10" width="10"></td> <td bgcolor="#CC6699" onMouseOver="previewColor('#CC6699')" onClick="selectColor('#CC6699')" height="10" width="10"></td> <td bgcolor="#CC9999" onMouseOver="previewColor('#CC9999')" onClick="selectColor('#CC9999')" height="10" width="10"></td> <td bgcolor="#CCCC99" onMouseOver="previewColor('#CCCC99')" onClick="selectColor('#CCCC99')" height="10" width="10"></td> <td bgcolor="#CCFF99" onMouseOver="previewColor('#CCFF99')" onClick="selectColor('#CCFF99')" height="10" width="10"></td> <td bgcolor="#FF0099" onMouseOver="previewColor('#FF0099')" onClick="selectColor('#FF0099')" height="10" width="10"></td> <td bgcolor="#FF3399" onMouseOver="previewColor('#FF3399')" onClick="selectColor('#FF3399')" height="10" width="10"></td> <td bgcolor="#FF6699" onMouseOver="previewColor('#FF6699')" onClick="selectColor('#FF6699')" height="10" width="10"></td> <td bgcolor="#FF9999" onMouseOver="previewColor('#FF9999')" onClick="selectColor('#FF9999')" height="10" width="10"></td> <td bgcolor="#FFCC99" onMouseOver="previewColor('#FFCC99')" onClick="selectColor('#FFCC99')" height="10" width="10"></td> <td bgcolor="#FFFF99" onMouseOver="previewColor('#FFFF99')" onClick="selectColor('#FFFF99')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#00FFFF" onMouseOver="previewColor('#00FFFF')" onClick="selectColor('#00FFFF')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#9900CC" onMouseOver="previewColor('#9900CC')" onClick="selectColor('#9900CC')" height="10" width="10"></td> <td bgcolor="#9933CC" onMouseOver="previewColor('#9933CC')" onClick="selectColor('#9933CC')" height="10" width="10"></td> <td bgcolor="#9966CC" onMouseOver="previewColor('#9966CC')" onClick="selectColor('#9966CC')" height="10" width="10"></td> <td bgcolor="#9999CC" onMouseOver="previewColor('#9999CC')" onClick="selectColor('#9999CC')" height="10" width="10"></td> <td bgcolor="#99CCCC" onMouseOver="previewColor('#99CCCC')" onClick="selectColor('#99CCCC')" height="10" width="10"></td> <td bgcolor="#99FFCC" onMouseOver="previewColor('#99FFCC')" onClick="selectColor('#99FFCC')" height="10" width="10"></td> <td bgcolor="#CC00CC" onMouseOver="previewColor('#CC00CC')" onClick="selectColor('#CC00CC')" height="10" width="10"></td> <td bgcolor="#CC33CC" onMouseOver="previewColor('#CC33CC')" onClick="selectColor('#CC33CC')" height="10" width="10"></td> <td bgcolor="#CC66CC" onMouseOver="previewColor('#CC66CC')" onClick="selectColor('#CC66CC')" height="10" width="10"></td> <td bgcolor="#CC99CC" onMouseOver="previewColor('#CC99CC')" onClick="selectColor('#CC99CC')" height="10" width="10"></td> <td bgcolor="#CCCCCC" onMouseOver="previewColor('#CCCCCC')" onClick="selectColor('#CCCCCC')" height="10" width="10"></td> <td bgcolor="#CCFFCC" onMouseOver="previewColor('#CCFFCC')" onClick="selectColor('#CCFFCC')" height="10" width="10"></td> <td bgcolor="#FF00CC" onMouseOver="previewColor('#FF00CC')" onClick="selectColor('#FF00CC')" height="10" width="10"></td> <td bgcolor="#FF33CC" onMouseOver="previewColor('#FF33CC')" onClick="selectColor('#FF33CC')" height="10" width="10"></td> <td bgcolor="#FF66CC" onMouseOver="previewColor('#FF66CC')" onClick="selectColor('#FF66CC')" height="10" width="10"></td> <td bgcolor="#FF99CC" onMouseOver="previewColor('#FF99CC')" onClick="selectColor('#FF99CC')" height="10" width="10"></td> <td bgcolor="#FFCCCC" onMouseOver="previewColor('#FFCCCC')" onClick="selectColor('#FFCCCC')" height="10" width="10"></td> <td bgcolor="#FFFFCC" onMouseOver="previewColor('#FFFFCC')" onClick="selectColor('#FFFFCC')" height="10" width="10"></td> </tr> <tr> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#FF00FF" onMouseOver="previewColor('#FF00FF')" onClick="selectColor('#FF00FF')" height="10" width="10"></td> <td bgcolor="#000000" onMouseOver="previewColor('#000000')" onClick="selectColor('#000000')" height="10" width="10"></td> <td bgcolor="#9900FF" onMouseOver="previewColor('#9900FF')" onClick="selectColor('#9900FF')" height="10" width="10"></td> <td bgcolor="#9933FF" onMouseOver="previewColor('#9933FF')" onClick="selectColor('#9933FF')" height="10" width="10"></td> <td bgcolor="#9966FF" onMouseOver="previewColor('#9966FF')" onClick="selectColor('#9966FF')" height="10" width="10"></td> <td bgcolor="#9999FF" onMouseOver="previewColor('#9999FF')" onClick="selectColor('#9999FF')" height="10" width="10"></td> <td bgcolor="#99CCFF" onMouseOver="previewColor('#99CCFF')" onClick="selectColor('#99CCFF')" height="10" width="10"></td> <td bgcolor="#99FFFF" onMouseOver="previewColor('#99FFFF')" onClick="selectColor('#99FFFF')" height="10" width="10"></td> <td bgcolor="#CC00FF" onMouseOver="previewColor('#CC00FF')" onClick="selectColor('#CC00FF')" height="10" width="10"></td> <td bgcolor="#CC33FF" onMouseOver="previewColor('#CC33FF')" onClick="selectColor('#CC33FF')" height="10" width="10"></td> <td bgcolor="#CC66FF" onMouseOver="previewColor('#CC66FF')" onClick="selectColor('#CC66FF')" height="10" width="10"></td> <td bgcolor="#CC99FF" onMouseOver="previewColor('#CC99FF')" onClick="selectColor('#CC99FF')" height="10" width="10"></td> <td bgcolor="#CCCCFF" onMouseOver="previewColor('#CCCCFF')" onClick="selectColor('#CCCCFF')" height="10" width="10"></td> <td bgcolor="#CCFFFF" onMouseOver="previewColor('#CCFFFF')" onClick="selectColor('#CCFFFF')" height="10" width="10"></td> <td bgcolor="#FF00FF" onMouseOver="previewColor('#FF00FF')" onClick="selectColor('#FF00FF')" height="10" width="10"></td> <td bgcolor="#FF33FF" onMouseOver="previewColor('#FF33FF')" onClick="selectColor('#FF33FF')" height="10" width="10"></td> <td bgcolor="#FF66FF" onMouseOver="previewColor('#FF66FF')" onClick="selectColor('#FF66FF')" height="10" width="10"></td> <td bgcolor="#FF99FF" onMouseOver="previewColor('#FF99FF')" onClick="selectColor('#FF99FF')" height="10" width="10"></td> <td bgcolor="#FFCCFF" onMouseOver="previewColor('#FFCCFF')" onClick="selectColor('#FFCCFF')" height="10" width="10"></td> <td bgcolor="#FFFFFF" onMouseOver="previewColor('#FFFFFF')" onClick="selectColor('#FFFFFF')" height="10" width="10"></td> </tr> </table> </center> </body> </html>
zzh-simple-hr
ZJs/webapp/html-editor/openwysiwyg/popups/select_color.html
HTML
art
33,830
/* this is a dummy webfxlayout file to be used in download zip files */ /* Do includes */ if (window.pathToRoot == null) pathToRoot = "./"; document.write('<link type="text/css" rel="stylesheet" href="local/webfxlayout.css">'); webfxMenuDefaultImagePath = pathToRoot + "images/"; /* end includes */ /* set up browser checks and add a simple emulation for IE4 */ // check browsers var op = /opera 5|opera\/5/i.test(navigator.userAgent); var ie = !op && /msie/i.test(navigator.userAgent); // preventing opera to be identified as ie var mz = !op && /mozilla\/5/i.test(navigator.userAgent); // preventing opera to be identified as mz if (ie && document.getElementById == null) { // ie4 document.getElementById = function(sId) { return document.all[sId]; }; } /* end browser checks */ webfxLayout = { writeTitle : function (s, s2) { document.write("<div id='webfx-title-background'></div>"); if (op) { document.write("<h1 id='webfx-title' style='top:9px;'>" + s + "</h1>"); } else { document.write("<h1 id='webfx-title'>" + s + "</h1>"); } if (s2 == null) s2 = "WebFX - What you never thought possible!"; if (op) { document.write("<span id='webfx-sub-title' style='top:46px;'>" + s2 + "</span>"); } else { document.write("<span id='webfx-sub-title'>" + s2 + "</span>"); } }, writeMainTitle : function () { this.writeTitle("WebFX", "What you never thought possible!"); }, writeTopMenuBar : function () { document.write("<div id='webfx-menu-bar-1'></div>"); if (op) { document.write("<style>.webfx-menu-bar a {padding-top:3px;}</style>"); document.write("<div id='webfx-menu-bar-2' style='height:2px;'></div>"); } else document.write("<div id='webfx-menu-bar-2'></div>"); document.write("<div id='webfx-menu-bar'>");// div is closed in writeBottomMenuBar }, writeBottomMenuBar : function () { document.write("</div>"); if (op) document.write("<div id='webfx-menu-bar-3' style='height:0px;'></div>"); else document.write("<div id='webfx-menu-bar-3'></div>"); document.write("<div id='webfx-menu-bar-4'></div>"); document.write("<div id='webfx-menu-bar-5'></div>"); }, writeMenu : function () { this.writeTopMenuBar(); //document.write(webfxMenuBar); document.write("<div class='webfx-menu-bar'><a href='http://webfx.eae.net'>WebFX Home</a></div>"); this.writeBottomMenuBar(); }, writeDesignedByEdger : function () { if (ie && document.body.currentStyle.writingMode != null) document.write("<div id='webfx-about'>Page designed and maintained by " + "<a href='mailto:erik@eae.net'>Erik Arvidsson</a> &amp; " + "<a href='mailto:eae@eae.net'>Emil A Eklund</a>.</div>"); } }; if (ie && window.attachEvent) { window.attachEvent("onload", function () { var scrollBorderColor = "rgb(120,172,255)"; var scrollFaceColor = "rgb(234,242,255)"; with (document.body.style) { scrollbarDarkShadowColor = scrollBorderColor; scrollbar3dLightColor = scrollBorderColor; scrollbarArrowColor = "black"; scrollbarBaseColor = scrollFaceColor; scrollbarFaceColor = scrollFaceColor; scrollbarHighlightColor = scrollFaceColor; scrollbarShadowColor = scrollFaceColor; scrollbarTrackColor = "white"; } }); } /* we also need some dummy constructors */ webfxMenuBar = { add : function () {} }; function WebFXMenu() { this.add = function () {}; } function WebFXMenuItem() {} function WebFXMenuSeparator() {} function WebFXMenuButton() {}
zzh-simple-hr
ZJs/webapp/tree/xtree/local/webfxlayout.js
JavaScript
art
3,588
/* bright: rgb(234,242,255); normal: rgb(120,172,255); dark: rgb(0,66,174); */ /* import menu css */ /* @import "dhtml/xmenu/xmenu.css"; */ #webfx-about { position: absolute; background: white; top: 102px; right: 10px; width: 20px; writing-mode: tb-rl; filter: flipH() flipV() alpha(opacity=50); } /* headers css */ #webfx-title { position: absolute; left: 90px; top: -5px; color: black; background: transparent; border: 0; padding: 0; margin: 0; font-family: Arial Black, Verdana, Helvetica, Sans-Serif; font-weight: bold; font-style: italic; font-size: 45px; letter-spacing: -5px; } #webfx-title-background { width: 100%; height: 67px; background: white no-repeat;/*rgb(100,100,100) no-repeat;*/ background-image: url("images/title-background.png"); background-position: 0 0; } #webfx-sub-title { position: absolute; left: 96px; top: 45px; color: black; background: transparent; padding: 0; margin: 0; border: 0; font-family: Verdana, Helvetica, Sans-Serif; font-size: 11px; } #webfx-menu-bar-1, #webfx-menu-bar-2, #webfx-menu-bar-3, #webfx-menu-bar-4, #webfx-menu-bar-5 { height: 2px; font-size: 0; overflow: hidden; background: rgb(120,172,255);/*#ff8800;*/ padding: 0; } #webfx-menu-bar-1 { background: rgb(0,66,174);/*rgb(120,172,255);/*black;/*rgb(234,242,255);*/ height: 1px; } #webfx-menu-bar-2 { background: rgb(120,172,255);/*#ff8800;*/ height: 1px; } #webfx-menu-bar-3 { background: rgb(120,172,255);/*#ff8800;*/ height: 1px; } #webfx-menu-bar-4 { background: rgb(0,66,174); height: 1px; } #webfx-menu-bar-5 { background: #dddddd; height: 3px; } /* headers css end */ html, body { height: 100%; margin: 0; padding: 0; background: url("images/background-shadow.gif") repeat-y white; color: black; font-size: 13px; font-family: "Verdana", "Tahoma", "Helvetica", "Sans-Serif"; } .webfx-main-body { margin-left: 100px; width: 500px; border-left: 1px solid rgb(120,172,255); } /* h1 only used in header */ h2,h3,h4,h5,h6 { margin-top: 10px; margin-left: 10px; margin-right: 10px; padding: 2px 10px 2px 10px; background: rgb(234,242,255); border-bottom: 1px solid rgb(120,172,255); } h1,h2 { font-weight: normal; } h3,h4,h5,h6 { font-weight: bold; } h1 { font-size: 50px; } h2 { font-size: 20px; } h3 { font-size: 15px; } h4 { font-size: 12px; } p { margin: 10px; font-size: 13px; color: black; text-align: justify; } td { font-size: 13px; font-family: "Verdana", "Tahoma", "Helvetica", "Sans-Serif"; } pre { margin: 20px; margin-right: 10px; background: #eeeeee; padding: 10px; border: 1px solid #dddddd; color: black; } code { background: #eeeeee; border: 1px solid #dddddd; color: black; } a { text-decoration:underline; color: rgb(0,66,174); } a:hover {/*rgb(0,66,174)*/ color: rgb(0,66,174); background: rgb(234,242,255); } a:visited { color: rgb(120,172,255); } a:visited:hover { color: rgb(0,66,174); } hr { margin-left: 10px; margin-right: 10px; padding: 0; text-align: left; height: 1px; color: rgb(120,172,255); background-color: rgb(120,172,255); border-bottom: 1px solid rgb(120,172,255); border: 0; } h2 a, h3 a { display: block; text-decoration: none; width: expression("100%"); } table { margin: 10px; font-size: 13px; color: black; } thead td { background: rgb(234,242,255); border-bottom: 1px solid rgb(120,172,255); font-weight: bold; } .author { margin-top: 50px; font-style: italic; } .date { color: rgb(0,66,174); } .warning, .warning a { color: red; } .warning a:visited, .warning a:hover { color: red; } .warning a:hover { background: rgb(255,230,230); } /* copied from xmenu.css */ .webfx-menu-bar { background: rgb(120,172,255);/*rgb(255,128,0);*/ padding: 2px; font-family: Verdana, Helvetica, Sans-Serif; font-size: 11px; } .webfx-menu-bar a, .webfx-menu-bar a:visited { color: black; border: 1px solid rgb(120,172,255);/*rgb(255,128,0);*/ text-decoration: none; padding: 1px; padding-left: 5px; padding-right: 5px; } .webfx-menu-bar a:hover { color: black; background: rgb(120,172,255); border-left: 1px solid rgb(234,242,255);/*#ffcc88;*/ border-right: 1px solid rgb(0,66,174);/*#884400;*/ border-top: 1px solid rgb(234,242,255);/*#ffcc88;*/ border-bottom: 1px solid rgb(0,66,174);/*#884400;*/ } .webfx-menu-bar a .arrow { border: 0; float: none; /* float: right; width: 6px; height: 16px; margin-right: 2px; background: red; */ } .webfx-menu-bar a:active, .webfx-menu-bar a:focus { -moz-outline: none; outline: none; } /* end xmenu.css copy */
zzh-simple-hr
ZJs/webapp/tree/xtree/local/webfxlayout.css
CSS
art
5,059
/* * This script is used for WebFX Api pages * * It defines one funtion and includes helptip.js, helptip.css and webfxapi.css */ document.write( "<script type='text/javascript' src='local/helptip.js'><\/script>" ); document.write( "<link type='text/css' rel='stylesheet' href='local/helptip.css' />" ); document.write( "<link type='text/css' rel='stylesheet' href='local/webfxapi.css' />" ); function toggleMethodArguments( e, a ) { if ( a && a.nextSibling && typeof a.nextSibling.innerHTML != "undefined" && typeof showHelpTip != "undefined" ) { showHelpTip( e, a.nextSibling.innerHTML ); } }
zzh-simple-hr
ZJs/webapp/tree/xtree/local/webfxapi.js
JavaScript
art
634
/* This style sheet is used for WebFX Api pages */ a.helpLink, a.helpLink:hover { color: rgb(0,66,174); border-bottom-color:rgb(0,66,174); } .help-tooltip { width: auto; } .help-tooltip h4, .help-tooltip table, .help-tooltip p { width: auto; } .methodContainer { display: none; } .methodInfo h4, .methodInfo thead td { font-size: 13px; background: none; border-bottom: 0; } .methodInfo h4, .methodInfo p, .methodInfo table { margin: 5px; padding: 0; } td { vertical-align: top; } td code { white-space: nowrap; } code a:visited, code a:hover { color: rgb(0,66,174); background: transparent; }
zzh-simple-hr
ZJs/webapp/tree/xtree/local/webfxapi.css
CSS
art
666
/* * This script was created by Erik Arvidsson (erik(at)eae.net) * for WebFX (http://webfx.eae.net) * Copyright 2001 * * For usage see license at http://webfx.eae.net/license.html * * Version: 1.0 * Created: 2001-09-27 * Updated: 2001-11-25 Added a resize to the tooltip if the document width is too small * * Dependencies: helptip.css (To set up the CSS of the help-tooltip class) * * Usage: * * <script type="text/javascript" src="helptip.js"></script> * <link type="text/css" rel="StyleSheet" href="helptip.css" /> * * <a class="helpLink" href="?" onclick="showHelp(event, 'String to show'); return false">Help</a> * */ function showHelpTip(e, s) { // find anchor element var el = e.target ? e.target : e.srcElement; while (el.tagName != "A") el = el.parentNode; // is there already a tooltip? If so, remove it if (el._helpTip) { document.body.removeChild(el._helpTip); el._helpTip = null; el.onblur = null; return; } // create element and insert last into the body var d = document.createElement("DIV"); d.className = "help-tooltip"; document.body.appendChild(d); d.innerHTML = s; // Allow clicks on A elements inside tooltip d.onmousedown = function (e) { if (!e) e = event; var t = e.target ? e.target : e.srcElement; while (t.tagName != "A" && t != d) t = t.parentNode; if (t == d) return; el._onblur = el.onblur; el.onblur = null; }; d.onmouseup = function () { el.onblur = el._onblur; el.focus(); }; // position tooltip var dw = document.width ? document.width : document.documentElement.offsetWidth - 25; if (d.offsetWidth >= dw) d.style.width = dw - 10 + "px"; else d.style.width = ""; var scroll = getScroll(); if (e.clientX > dw - d.offsetWidth) d.style.left = dw - d.offsetWidth + scroll.x + "px"; else d.style.left = e.clientX - 2 + scroll.x + "px"; d.style.top = e.clientY + 18 + scroll.y + "px"; // add a listener to the blur event. When blurred remove tooltip and restore anchor el.onblur = function () { document.body.removeChild(d); el.onblur = null; el._helpTip = null; }; // store a reference to the tooltip div el._helpTip = d; } // returns the scroll left and top for the browser viewport. function getScroll() { if (document.all && document.body.scrollTop != undefined) { // IE model var ieBox = document.compatMode != "CSS1Compat"; var cont = ieBox ? document.body : document.documentElement; return {x : cont.scrollLeft, y : cont.scrollTop}; } else { return {x : window.pageXOffset, y : window.pageYOffset}; } }
zzh-simple-hr
ZJs/webapp/tree/xtree/local/helptip.js
JavaScript
art
2,572
/* Notice that IE has a display problem if the help link is on the last line of a container with no padding. If this is the case increase the padding bottom to at least 1px */ a.helpLink { color: Green; text-decoration: none; border-bottom: 1px dashed Green; } a.helpLink:hover { color: Red; text-decoration: none; border-bottom: 1px dashed Red; } .help-tooltip { position: absolute; width: 250px; border: 1px Solid WindowFrame; background: Infobackground; color: InfoText; font: StatusBar; font: Status-Bar; padding: 3px; filter: progid:DXImageTransform.Microsoft.Shadow(color="#777777", Direction=135, Strength=3); z-index: 10000; } .help-tooltip a, .help-tooltip a:hover { color: blue !important; background: none; }
zzh-simple-hr
ZJs/webapp/tree/xtree/local/helptip.css
CSS
art
761
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>xTree (WebFX)</title> <!-- WebFX Layout Include --> <script type="text/javascript" src="local/webfxlayout.js"></script> <!-- end WebFX Layout Includes --> <style type="text/css"> table { width: 500px; } td { vertical-align: top; } </style> </head> <body> <!-- WebFX Layout Include --> <script type="text/javascript"> var articleMenu= new WebFXMenu; articleMenu.left = 384; articleMenu.top = 86; articleMenu.width = 140; articleMenu.add(new WebFXMenuItem("History & Introduction", "index.html")); articleMenu.add(new WebFXMenuItem("Usage", "usage.html")); articleMenu.add(new WebFXMenuItem("API", "api.html")); articleMenu.add(new WebFXMenuItem("Implementation", "implementation.html")); articleMenu.add(new WebFXMenuItem("Demo", "javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);")); articleMenu.add(new WebFXMenuSeparator); articleMenu.add(new WebFXMenuItem("Download", "http://webfx.eae.net/download/xtree117.zip")); webfxMenuBar.add(new WebFXMenuButton("Article Menu", null, null, articleMenu)); webfxLayout.writeTitle("xTree"); webfxLayout.writeMenu(); webfxLayout.writeDesignedByEdger(); </script> <div class="webfx-main-body"> <!-- end WebFX Layout Includes --> <p> <span class="date">(2006-05-26)</span> Changed license to Apache Software License 2.0.<br /> <span class="date">(2003-03-16)</span> Version 1.17 - Added target property.<br /> <span class="date">(2003-02-15)</span> Version 1.16 - The selected node can now be distinguished even when the tree control loses focus.<br /> <span class="date">(2002-10-29)</span> Version 1.15 - This version is based on 1.13 and fixes the bugs 1.14 were supposed to fix.<br /> <span class="date">(2002-10-23)</span> Version 1.14 - Minor fix for a case where the plus icon used wrong image.<br /> <span class="date">(2002-08-20)</span> Version 1.13 - Added <code>usePersistence</code> flag to allow disable the usage of cookies.<br /> <span class="date">(2002-06-13)</span> Version 1.12 - Various bug fixes.<br /> <span class="date">(2002-01-27)</span> Version 1.11 - Bug fixes and improved mozilla support.<br /> <span class="date">(2001-09-23)</span> Version 1.1 - New features included keyboard navigation (ie) and the ability to add and remove nodes dynamically and some other small tweaks and fixes.<br /> <span class="date">(2001-03-18)</span> Added getSelected and get/setBehavior that can make it behave more like the windows explorer<br>(check usage for more information about it).<br /> <span class="date">(2001-01-10)</span> Original Version Posted. </p> <p> An object based tree widget with persistence using cookies that works in ie5 and mozilla. </p> <h2>History</h2> <p> Among the first things I created with DHTML was a tree view, that was over four years ago (spring 1997), since then a lot has happened in the browser market, and also with my skills in JavaScript and DHTML. Today I give you the third version of this tree view widget. The idea behind it is the same as in the first version, to emulate the tree widget found in many modern graphical operation environments, such as Microsoft Windows, and so is the basic idea of how to accomplish this, to toggle the display property of elements depending on the expanded state of their parents. However the similarities stop there. Another thing I can mention from a historical point of view is that this is the first complex script that I have created that works under two different browsers without the use of browser detection, the same code is actually used for ie5 and mozilla. :o) </p> <h2>Introduction</h2> <p> This new version is based on objects, so you do not create the actual html code for the tree yourself, you create an object (the tree's root folder) and then you add child items to this. Once you're done adding items the actual html code is generated and inserted into the page. This makes it very easy to create and update the content of the tree (or to dynamically generate it). If you've seen Erik's new xMenu you will notice that it's working in similar way. </p> <h3>Persistence</h3> <p> This script also features persistence using per session cookies. So now if you go to a page using this tree widget, expand a few folders and then leave the page again (by following a link or by typing a new url manually) it will store the state of each folder in a cookie so when you go back to the page it will remember what folders you last had opened and open them for you. This could be very useful if you use this for site navigation etc. </p> <h3>Limitations</h3> <p> The persistence functionality is using the node creation order to remember the state of each node, this works fine for static trees, but not for dynamic ones since adding and/or deleting nodes will change the original order numbering. </p> <p> <a href="index.html">History & Introduction</a><br /> <a href="usage.html">Usage</a><br /> <a href="api.html">API</a><br /> <a href="implementation.html">Implementation</a><br /> <a href="javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);">Demo</a><br /> <a href="http://webfx.eae.net/download/xtree117.zip">Download</a> </p> <p class="author">Author: Emil A Eklund</p> <!-- end webfx-main-body --> </div> </body> </html>
zzh-simple-hr
ZJs/webapp/tree/xtree/index.html
HTML
art
5,628
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>xTree Usage (WebFX)</title> <!-- WebFX Layout Include --> <script type="text/javascript" src="local/webfxlayout.js"></script> <!-- end WebFX Layout Includes --> <style type="text/css"> table { width: 500px; } td { vertical-align: top; } </style> </head> <body> <!-- WebFX Layout Include --> <script type="text/javascript"> var articleMenu= new WebFXMenu; articleMenu.left = 384; articleMenu.top = 86; articleMenu.width = 140; articleMenu.add(new WebFXMenuItem("History & Introduction", "index.html")); articleMenu.add(new WebFXMenuItem("Usage", "usage.html")); articleMenu.add(new WebFXMenuItem("API", "api.html")); articleMenu.add(new WebFXMenuItem("Implementation", "implementation.html")); articleMenu.add(new WebFXMenuItem("Demo", "javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);")); articleMenu.add(new WebFXMenuSeparator); articleMenu.add(new WebFXMenuItem("Download", "http://webfx.eae.net/download/xtree117.zip")); webfxMenuBar.add(new WebFXMenuButton("Article Menu", null, null, articleMenu)); webfxLayout.writeTitle("xTree Usage"); webfxLayout.writeMenu(); webfxLayout.writeDesignedByEdger(); </script> <div class="webfx-main-body"> <!-- end WebFX Layout Includes --> <p> This tree widget is based on objects and all html code is generated from a js structure. To create a tree you won't have to write a single line of html however you will have to learn how to to create the tree and treeItem objects. </p> <h2>Usage</h2> <p> The tree(s) needs to be create during the initial load phase of the page. This is accomplished by creating a <code>WebFXTree</code> object and then add <code>WebFXTreeItem</code>s to it. Once all items has been added <code>document.write</code> is used to generate the html code and insert it into the page. </p> <img src="article-images/tree1.png" align="left"> <pre style="margin-left: 82px;"> var tree = new WebFXTree('Root'); tree.add(new WebFXTreeItem('Tree Item 1')); tree.add(new WebFXTreeItem('Tree Item 2')); tree.add(new WebFXTreeItem('Tree Item 3')); document.write(tree); </pre> <h3>Folders</h3> <p> A folder is created by adding a new tree item to a already created tree item. However since we need to keep a reference to this tree item object (so that we can add tree items to it, and make it a folder) we cannot create the new object inside the add method. So instead we first create the new tree item object and then we add it to the tree. </p> <img src="article-images/tree2.png" align="left"> <pre style="margin-left: 82px;"> var tree = new WebFXTree('Root'); <font color="teal">/* Add tree item to tree */</font> tree.add(new WebFXTreeItem('1')); <font color="teal">/* Create a new folder and add it to tree */</font> var folder = new WebFXTreeItem('2') tree.add(folder); <font color="teal">/* Add tree items to folder */</font> folder.add(new WebFXTreeItem('2.1')); folder.add(new WebFXTreeItem('2.2')); folder.add(new WebFXTreeItem('2.3')); <font color="teal">/* Add another tree item to tree */</font> tree.add(new WebFXTreeItem('3')); document.write(tree); </pre> <h3>Explorer behavior</h3> <p> Since I first published this tree control I've been getting a lot of requesters about making it contain only folders. So I added a setBehavior method to it. The example below is an exact copy of the one above, with the one exception that this uses <code>tree.setBehavior('explorer');</code> </p> <img src="article-images/tree3.png" align="left"> <pre style="margin-left: 82px;"> var tree = new WebFXTree('Root'); <font color="teal">/* Change the behavior of the tree */</font> tree.setBehavior('explorer'); <font color="teal">/* Add tree item to tree */</font> tree.add(new WebFXTreeItem('1')); <font color="teal">/* Create a new folder and add it to tree */</font> var folder = new WebFXTreeItem('2') tree.add(folder); <font color="teal">/* Add tree items to folder */</font> folder.add(new WebFXTreeItem('2.1')); folder.add(new WebFXTreeItem('2.2')); folder.add(new WebFXTreeItem('2.3')); <font color="teal">/* Add another tree item to tree */</font> tree.add(new WebFXTreeItem('3')); document.write(tree); </pre> <h3>Custom Icons</h3> <p> Some times you might want to combine the two styles, or make some of the folders/items have a different icon than the default. To achieve that set the <code>object.icon</code> property to an uri, or to a javascript variable containing one. To change the open icons for folders use <code>object.openIcon</code>. </p> <img src="article-images/tree4.png" align="left"> <pre style="margin-left: 82px;"> var tree = new WebFXTree('Root'); tree.setBehavior('explorer'); tree.icon = 'http://webfx.eae.net/images/notepad.gif'; tree.add(new WebFXTreeItem('1')); var folder = new WebFXTreeItem('2') tree.add(folder); var t21 = new WebFXTreeItem('2.1'); <font color="teal">/* Change the icon */</font> t21.icon = webFXTreeConfig.fileIcon; folder.add(t21); var t22 = new WebFXTreeItem('2.2'); <font color="teal">/* Change the icon */</font> t22.icon = webFXTreeConfig.fileIcon; folder.add(t22); var t23 = new WebFXTreeItem('2.3'); <font color="teal">/* Change the icon */</font> t23.icon = webFXTreeConfig.fileIcon; folder.add(t23); tree.add(new WebFXTreeItem('3')); document.write(tree); </pre> <p> <a href="index.html">History & Introduction</a><br /> <a href="usage.html">Usage</a><br /> <a href="api.html">API</a><br /> <a href="implementation.html">Implementation</a><br /> <a href="javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);">Demo</a><br /> <a href="http://webfx.eae.net/download/xtree117.zip">Download</a> </p> <!-- end webfx-main-body --> </div> </body> </html>
zzh-simple-hr
ZJs/webapp/tree/xtree/usage.html
HTML
art
6,142