Return-Path: Delivered-To: apmail-incubator-roller-commits-archive@www.apache.org Received: (qmail 14877 invoked from network); 8 Oct 2006 21:27:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Oct 2006 21:27:00 -0000 Received: (qmail 68666 invoked by uid 500); 8 Oct 2006 21:27:00 -0000 Delivered-To: apmail-incubator-roller-commits-archive@incubator.apache.org Received: (qmail 68636 invoked by uid 500); 8 Oct 2006 21:26:58 -0000 Mailing-List: contact roller-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: roller-dev@incubator.apache.org Delivered-To: mailing list roller-commits@incubator.apache.org Received: (qmail 68625 invoked by uid 99); 8 Oct 2006 21:26:58 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Oct 2006 14:26:58 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:53005] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 5C/14-01505-E6C59254 for ; Sun, 08 Oct 2006 13:15:43 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 744451A9880; Sun, 8 Oct 2006 12:54:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r454197 [23/29] - in /incubator/roller/trunk/web: WEB-INF/classes/ roller-ui/authoring/editors/ roller-ui/authoring/editors/xinha/ roller-ui/authoring/editors/xinha/conf/ roller-ui/authoring/editors/xinha/contrib/ roller-ui/authoring/editor... Date: Sun, 08 Oct 2006 19:54:16 -0000 To: roller-commits@incubator.apache.org From: snoopdave@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061008195439.744451A9880@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang-marks.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang-marks.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang-marks.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang-marks.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,121 @@ +// Mask Language plugin for HTMLArea +// Implementation by Udo Schmal +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function LangMarks(editor, args) { + this.editor = editor; + var cfg = editor.config; + var self = this; + var options = {}; + options[this._lc("— language —")] = ""; + options[this._lc("Greek")] = "el"; + options[this._lc("English")] = "en"; + options[this._lc("French")] = "fr"; + options[this._lc("Latin")] = "la"; + + cfg.registerDropdown({ + id : "langmarks", + tooltip : this._lc("language select"), + options : options, + action : function(editor) { self.onSelect(editor, this); }, + refresh : function(editor) { self.updateValue(editor, this); } + }); + cfg.addToolbarElement("langmarks", "inserthorizontalrule", 1); +} + +LangMarks._pluginInfo = { + name : "LangMarks", + version : "1.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath NeueMedien", + license : "htmlArea" +}; + +LangMarks.prototype._lc = function(string) { + return HTMLArea._lc(string, 'LangMarks'); +}; + +LangMarks.prototype.onGenerate = function() { + var style_id = "LM-style" + var style = this.editor._doc.getElementById(style_id); + if (style == null) { + style = this.editor._doc.createElement("link"); + style.id = style_id; + style.rel = 'stylesheet'; + style.href = _editor_url + 'plugins/LangMarks/lang-marks.css'; + this.editor._doc.getElementsByTagName("HEAD")[0].appendChild(style); + } +}; + +LangMarks.prototype.onSelect = function(editor, obj, context, updatecontextclass) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var className = tbobj.element.value; + + // retrieve parent element of the selection + var parent = editor.getParentElement(); + var surround = true; + + var is_span = (parent && parent.tagName.toLowerCase() == "span"); + var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context); + + if (update_parent) { + parent.className = className; + parent.lang = className; + editor.updateToolbar(); + return; + } + + if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) { + while (parent.firstChild) { + parent.parentNode.insertBefore(parent.firstChild, parent); + } + parent.parentNode.removeChild(parent); + editor.updateToolbar(); + return; + } + + if (is_span) { + // maybe we could simply change the class of the parent node? + if (parent.childNodes.length == 1) { + parent.className = className; + parent.lang = className; + surround = false; + // in this case we should handle the toolbar updation + // ourselves. + editor.updateToolbar(); + } + } + + // Other possibilities could be checked but require a lot of code. We + // can't afford to do that now. + if (surround) { + // shit happens ;-) most of the time. this method works, but + // it's dangerous when selection spans multiple block-level + // elements. + editor.surroundHTML('', ''); + } +}; + +LangMarks.prototype.updateValue = function(editor, obj) { + var select = editor._toolbarObjects[obj.id].element; + var parent = editor.getParentElement(); + if (typeof parent.className != "undefined" && /\S/.test(parent.className)) { + var options = select.options; + var value = parent.className; + for (var i = options.length; --i >= 0;) { + var option = options[i]; + if (value == option.value) { + select.selectedIndex = i; + return; + } + } + } + select.selectedIndex = 0; +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/de.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/de.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/de.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/de.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "language select": "Sprachauswahl", + "— language —": "— Sprache —", + "Greek": "griechisch", + "English": "englisch", + "French": "französisch", + "Latin": "lateinisch" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/fr.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/fr.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/fr.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/fr.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "language select": "Sélection de la langue", + "— language —": "— Langue —", + "Greek": "grec", + "English": "anglais", + "French": "français", + "Latin": "latin" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nb.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nb.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nb.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nb.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "language select": "SprÃ¥kvalg", + "— language —": "— SprÃ¥k —", + "Greek": "grekisk", + "English": "engelsk", + "French": "fransk", + "Latin": "latin" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nl.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nl.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nl.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/nl.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "language select": "Taalkeuze", + "— language —": "— taal —", + "Greek": "Grieks", + "English": "Engels", + "French": "Frans", + "Latin": "Latijns" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/no.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/no.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/no.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/LangMarks/lang/no.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "language select": "SprÃ¥kvalg", + "— language —": "— SprÃ¥k —", + "Greek": "grekisk", + "English": "engelsk", + "French": "fransk", + "Latin": "latin" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/api.html URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/api.html?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/api.html (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/api.html Sun Oct 8 12:53:13 2006 @@ -0,0 +1,252 @@ + + + + + + Destroydrop » Javascripts » Tree » Api + + + + + + + + +
+ +
+ + + + +
+ +
+ + +

Overview

+
+
+ + + +
+ + +

Functions

+
+
+ + +

add()

+

Adds a node to the tree.
Can only be called before the tree is drawn.

+

id, pid and name are required.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idNumberUnique identity number.
pidNumberNumber refering to the parent node. The value for the root node has to be -1.
nameStringText label for the node.
urlStringUrl for the node.
titleStringTitle for the node.
targetStringTarget for the node.
iconStringImage file to use as the icon. Uses default if not specified.
iconOpenStringImage file to use as the open icon. Uses default if not specified.
openBooleanIs the node open.
+
+ + +

Example

+

mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');

+
+ + +

openAll()

+

Opens all the nodes.
Can be called before and after the tree is drawn.

+

Example

+

mytree.openAll();

+
+ + + +

closeAll()

+

Closes all the nodes.
Can be called before and after the tree is drawn.

+

Example

+

mytree.closeAll();

+
+ + + +

openTo()

+

Opens the tree to a certain node and can also select the node.
+ Can only be called after the tree is drawn.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
NameTypeDescription
idNumberIdentity number for the node.
selectBooleanShould the node be selected.
+ +

Example

+

mytree.openTo(4, true);

+ +
+ + +

Configuration

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeDefaultDescription
targetStringtrueTarget for all the nodes.
folderLinksBooleantrueShould folders be links.
useSelectionBooleantrueNodes can be selected(highlighted).
useCookiesBooleantrueThe tree uses cookies to rember it's state.
useLinesBooleantrueTree is drawn with lines.
useIconsBooleantrueTree is drawn with icons.
useStatusTextBooleanfalseDisplays node names in the statusbar instead of the url.
closeSameLevelBooleanfalseOnly one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.
inOrderBooleanfalseIf parent nodes are always added before children, setting this to true speeds up the tree.
+ +

Example

+

mytree.config.target = "mytarget";

+ +
+ +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.css URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.css?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.css (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.css Sun Oct 8 12:53:13 2006 @@ -0,0 +1,39 @@ +/*--------------------------------------------------| +| dTree 2.05 | www.destroydrop.com/javascript/tree/ | +|---------------------------------------------------| +| Copyright (c) 2002-2003 Geir Landr? | +|--------------------------------------------------*/ + +.dtree { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #666; + white-space: nowrap; +} +.dtree img { + border: 0px; + vertical-align: middle; +} +.dtree a,.dtree a:visited { + color: #333; + text-decoration: none; +} +.dtree a.node, .dtree a.nodeSel { + white-space: nowrap; + padding: 1px 2px 1px 2px; + /*padding: 0px 1px 0px 1px;*/ +} +.dtree a.node:hover, .dtree a.nodeSel:hover { + color: #333; + text-decoration: underline; +} +.dtree a.nodeSel { + background-color: #c0d2ec; + /* + -moz-border-radius : 4px; + border:1px dotted #333; + */ +} +.dtree .clip { + overflow: hidden; +} \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/dtree.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,722 @@ +/*--------------------------------------------------| + +| dTree 2.05 | www.destroydrop.com/javascript/tree/ | + +|---------------------------------------------------| + +| Copyright (c) 2002-2003 Geir Landr? | + +| | + +| This script can be used freely as long as all | + +| copyright messages are intact. | + +| | + +| Updated: 17.04.2003 | + +|--------------------------------------------------*/ + + + +// Node object + +function Node(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.id = id; + + this.pid = pid; + + this.name = name; + + this.url = url; + + this.title = title; + + this.target = target; + + this.icon = icon; + + this.iconOpen = iconOpen; + + this._io = open || false; + + this._is = false; + + this._ls = false; + + this._hc = false; + + this._ai = 0; + + this._p; + +} + + + +// Tree object + +function dTree(objName, baseDir) { + + this.config = { + + target : null, + + folderLinks : true, + + useSelection : true, + + useCookies : true, + + useLines : true, + + useIcons : true, + + useStatusText : false, + + closeSameLevel : false, + + inOrder : false + + }; + + this.icon = { + + root : baseDir + 'img/base.gif', + + folder : baseDir + 'img/folder.gif', + + folderOpen : baseDir + 'img/folderopen.gif', + + node : baseDir + 'img/page.gif', + + empty : baseDir + 'img/empty.gif', + + line : baseDir + 'img/line.gif', + + join : baseDir + 'img/join.gif', + + joinBottom : baseDir + 'img/joinbottom.gif', + + plus : baseDir + 'img/plus.gif', + + plusBottom : baseDir + 'img/plusbottom.gif', + + minus : baseDir + 'img/minus.gif', + + minusBottom : baseDir + 'img/minusbottom.gif', + + nlPlus : baseDir + 'img/nolines_plus.gif', + + nlMinus : baseDir + 'img/nolines_minus.gif' + + }; + + this.obj = objName; + + this.aNodes = []; + + this.aIndent = []; + + this.root = new Node(-1); + + this.selectedNode = null; + + this.selectedFound = false; + + this.completed = false; + +} + + + +// Adds a new node to the node array + +dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); + +}; + + + +// Open/close all nodes + +dTree.prototype.openAll = function() { + + this.oAll(true); + +}; + +dTree.prototype.closeAll = function() { + + this.oAll(false); + +}; + + + +// Outputs the tree to the page + +dTree.prototype.toString = function() { + this.setCS_All(); + var str = '
\n'; + + if (document.getElementById) { + + if (this.config.useCookies) this.selectedNode = this.getSelected(); + + str += this.addNode(this.root); + + } else str += 'Browser not supported.'; + + str += '
'; + + if (!this.selectedFound) this.selectedNode = null; + + this.completed = true; + + return str; + +}; + + + +// Creates the tree structure + +dTree.prototype.addNode = function(pNode) { + + var str = ''; + + var n=0; + + if (this.config.inOrder) n = pNode._ai; + + for (n; n'; + + } + + if (node.url) { + + str += ''; + + str += node.name; + + if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; + + str += ''; + + if (node._hc) { + + str += '
'; + + str += this.addNode(node); + + str += '
'; + + } + + this.aIndent.pop(); + + return str; + +}; + + + +// Adds the empty and line icons + +dTree.prototype.indent = function(node, nodeId) { + + var str = ''; + + if (this.root.id != node.pid) { + + for (var n=0; n'; + + (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); + + if (node._hc) { + + str += ''; + + } else str += ''; + + } + + return str; + +}; + + + +// Checks if a node has any children and if it is the last sibling + +dTree.prototype.setCS = function(node) { + + var lastId; + + for (var n=0; n { _hc: haschildren, _ls_is: lastsibling} + + for(var n = 0; n < this.aNodes.length; n++) + { + var node = this.aNodes[n]; + if(!ids[node.pid]) + { + ids[node.pid] = { _hc: true, _ls_is: node.id }; + } + else + { + ids[node.pid]._hc = true; + ids[node.pid]._ls_is = node.id; + } + + if(!ids[node.id]) + { + ids[node.id] = { _hc: false, _ls_is: null } + } + } + + for(var n = 0; n < this.aNodes.length; n++) + { + var node = this.aNodes[n]; + node._ls = ids[node.pid]._ls_is == node.id ? true : false; + node._hc = ids[node.id]._hc; + } +}; + +// Returns the selected node + +dTree.prototype.getSelected = function() { + + var sn = this.getCookie('cs' + this.obj); + + return (sn) ? sn : null; + +}; + + + +// Highlights the selected node + +dTree.prototype.s = function(id) { + + if (!this.config.useSelection) return; + + var cn = this.aNodes[id]; + + if (cn._hc && !this.config.folderLinks) return; + + if (this.selectedNode != id) { + + if (this.selectedNode || this.selectedNode==0) { + + eOld = document.getElementById("s" + this.obj + this.selectedNode); + + eOld.className = "node"; + + } + + eNew = document.getElementById("s" + this.obj + id); + + eNew.className = "nodeSel"; + + this.selectedNode = id; + + if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id); + + } + +}; + + + +// Toggle Open or close + +dTree.prototype.o = function(id) { + + var cn = this.aNodes[id]; + + this.nodeStatus(!cn._io, id, cn._ls); + + cn._io = !cn._io; + + if (this.config.closeSameLevel) this.closeLevel(cn); + + if (this.config.useCookies) this.updateCookie(); + +}; + + + +// Open or close all nodes + +dTree.prototype.oAll = function(status) { + + for (var n=0; n + + + + + Destroydrop » Javascripts » Tree + + + + + + + + +

Destroydrop » Javascripts » Tree

+ +

Example

+ +
+ +

open all | close all

+ + + +
+ +

©2002-2003 Geir Landrö

+ + + + \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/base.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/base.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/base.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/cd.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/cd.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/cd.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/copy.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/copy.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/copy.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/empty.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/empty.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/empty.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folder.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folder.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folder.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folderopen.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folderopen.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/folderopen.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/globe.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/globe.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/globe.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/imgfolder.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/imgfolder.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/imgfolder.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/join.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/join.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/join.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/joinbottom.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/joinbottom.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/joinbottom.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/line.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/line.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/line.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minus.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minus.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minus.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minusbottom.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minusbottom.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/minusbottom.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/move.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/move.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/move.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/musicfolder.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/musicfolder.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/musicfolder.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_minus.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_minus.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_minus.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_plus.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_plus.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/nolines_plus.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/offline.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/page.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/page.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/page.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plus.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plus.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plus.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plusbottom.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plusbottom.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/plusbottom.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/question.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/question.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/question.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/trash.gif URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/trash.gif?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dTree/img/trash.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dialog.html URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dialog.html?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dialog.html (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/dialog.html Sun Oct 8 12:53:13 2006 @@ -0,0 +1,107 @@ +

Insert/Modify Link

+
+
(the dTree goes in here)
+
+
+ + + + + + + + + + +
Target: +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Size:x (px)
Name:
Menu Bar:Toolbar:
Location Bar:Status Bar:
Scrollbars:Resizeable:
+
+
+
+
+
+ + + + + + + + + + + + + + +
+
+ +
+ + + + + + +
+ +
+
+ +
+ + + +
+
+
\ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/de.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/de.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/de.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/de.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,20 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "You must select some text before making a new link.": "Sie müssen einen Text markieren um einen Link zu erstellen", + "Are you sure you wish to remove this link?": "Wollen Sie diesen Link wirklich entfernen?", + "REMOVE LINK": "LINK ENTFERNEN", + "CANCEL": "ABBRECHEN", + "URL Link": "URL Adresse", + "Ordinary Link": "Standard Link", + "Same Window (jump out of frames)": "Selbes Fenster (ganzer Bereich)", + "New Window": "Neues Fenster", + "Popup Window": "Pop-Up Fenster", + "Email Link": "Email Link", + "Email Address:": "Email Adresse", + "Subject:": "Betreff:", + "Message Template:": "Nachrichten Vorlage:", + "Size:": "Größe:", + "Name:": "Name:" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/fr.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/fr.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/fr.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/fr.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,19 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "You must select some text before making a new link.": "Vous devez sélectionner un texte avant de créer un nouveau lien", + "Are you sure you wish to remove this link?": "Confirmez-vous la suppression de ce lien ?", + "REMOVE LINK": "Supprimer", + "CANCEL": "Annuler", + "URL Link": "Lien URL", + "Ordinary Link": "Lien standard", + "Same Window (jump out of frames)": "Même fenêtre (sort des frames)", + "New Window": "Nouvelle fenêtre", + "Popup Window": "Fenêtre popup", + "Email Link": "Lien email", + "Email Address:": "Adresse email", + "Subject:": "Sujet", + "Message Template:": "Message", + "Size:": "Taille", + "Name:": "Nom" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/nb.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/nb.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/nb.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/nb.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "You must select some text before making a new link.": "Du må markere tekst eller et bilde før du kan lage en lenke.", + "Are you sure you wish to remove this link?": "Er du sikker på at du vil fjerne lenken?" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/no.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/no.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/no.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/no.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "You must select some text before making a new link.": "Du må markere tekst eller et bilde før du kan lage en lenke.", + "Are you sure you wish to remove this link?": "Er du sikker på at du vil fjerne lenken?" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/pl.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/pl.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/pl.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/lang/pl.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,20 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "You must select some text before making a new link.": "Zaznacz tekst przed dodaniem odnośnika.", + "Are you sure you wish to remove this link?": "Na pewno chcesz usunąć odnośnik?", + "REMOVE LINK": "USUŃ ODNOŚNIK", + "CANCEL": "ANULUJ", + "URL Link": "Adres URL", + "Ordinary Link": "Zwykły odnośnik", + "Same Window (jump out of frames)": "To samo okno (wyskocz z ramek)", + "New Window": "Nowe okno", + "Popup Window": "Okienko pop-up", + "Email Link": "Link do e-maila", + "Email Address:": "Adres e-mail", + "Subject:": "Temat:", + "Message Template:": "Szablon wiadmości:", + "Size:": "Rozmiar:", + "Name:": "Nazwa:" +}; \ No newline at end of file Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/linker.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/linker.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/linker.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/Linker/linker.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,566 @@ +/** htmlArea - James' Fork - Linker Plugin **/ +Linker._pluginInfo = +{ + name : "Linker", + version : "1.0", + developer: "James Sleeman", + developer_url: "http://www.gogo.co.nz/", + c_owner : "Gogo Internet Services", + license : "htmlArea", + sponsor : "Gogo Internet Services", + sponsor_url : "http://www.gogo.co.nz/" +}; + +HTMLArea.loadStyle('dTree/dtree.css', 'Linker'); + +HTMLArea.Config.prototype.Linker = +{ + 'backend' : _editor_url + 'plugins/Linker/scan.php', + 'backend_data' : null, + 'files' : null +}; + + +function Linker(editor, args) +{ + this.editor = editor; + this.lConfig = editor.config.Linker; + + var linker = this; + if(editor.config.btnList.createlink) + { + editor.config.btnList.createlink[3] + = function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); }; + } + else + { + editor.config.registerButton( + 'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false, + function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); } + ); + } + + // See if we can find 'createlink' + editor.config.addToolbarElement("createlink", "createlink", 0); +} + +Linker.prototype._lc = function(string) +{ + return HTMLArea._lc(string, 'Linker'); +}; + +Linker.prototype._createLink = function(a) +{ + if(!a && this.editor._selectionEmpty(this.editor._getSelection())) + { + alert(this._lc("You must select some text before making a new link.")); + return false; + } + + var inputs = + { + type: 'url', + href: 'http://www.example.com/', + target: '', + p_width: '', + p_height: '', + p_options: ['menubar=no','toolbar=yes','location=no','status=no','scrollbars=yes','resizeable=yes'], + to: 'alice@example.com', + subject: '', + body: '', + anchor: '' + }; + + if(a && a.tagName.toLowerCase() == 'a') + { + var href =this.editor.fixRelativeLinks(a.getAttribute('href')); + var m = href.match(/^mailto:(.*@[^?&]*)(\?(.*))?$/); + var anchor = href.match(/^#(.*)$/); + + if(m) + { + // Mailto + inputs.type = 'mailto'; + inputs.to = m[1]; + if(m[3]) + { + var args = m[3].split('&'); + for(var x = 0; x]*)(\?[^<]*)?$/i.test(a.innerHTML)) + { + a.innerHTML = RegExp.$1; + } + } + } + } + else + { + if(!atr.href) return true; + + // Insert a link, we let the browser do this, we figure it knows best + var tmp = HTMLArea.uniq('http://www.example.com/Link'); + linker.editor._doc.execCommand('createlink', false, tmp); + + // Fix them up + var anchors = linker.editor._doc.getElementsByTagName('a'); + for(var i = 0; i < anchors.length; i++) + { + var anchor = anchors[i]; + if(anchor.href == tmp) + { + // Found one. + if (!a) a = anchor; + for(var j in atr) + { + anchor.setAttribute(j, atr[j]); + } + } + } + } + linker.editor.selectNodeContents(a); + linker.editor.updateToolbar(); + }; + + this._dialog.show(inputs, doOK); + +}; + +Linker.prototype._getSelectedAnchor = function() +{ + var sel = this.editor._getSelection(); + var rng = this.editor._createRange(sel); + var a = this.editor._activeElement(sel); + if(a != null && a.tagName.toLowerCase() == 'a') + { + return a; + } + else + { + a = this.editor._getFirstAncestor(sel, 'a'); + if(a != null) + { + return a; + } + } + return null; +}; + +Linker.prototype.onGenerate = function() +{ + this._dialog = new Linker.Dialog(this); +}; +// Inline Dialog for Linker + +Linker.Dialog_dTrees = [ ]; + + +Linker.Dialog = function (linker) +{ + var lDialog = this; + this.Dialog_nxtid = 0; + this.linker = linker; + this.id = { }; // This will be filled below with a replace, nifty + + this.ready = false; + this.files = false; + this.html = false; + this.dialog = false; + + // load the dTree script + this._prepareDialog(); + +}; + +Linker.Dialog.prototype._prepareDialog = function() +{ + var lDialog = this; + var linker = this.linker; + + // We load some stuff up int he background, recalling this function + // when they have loaded. This is to keep the editor responsive while + // we prepare the dialog. + if(typeof dTree == 'undefined') + { + HTMLArea._loadback(_editor_url + 'plugins/Linker/dTree/dtree.js', + function() {lDialog._prepareDialog(); } + ); + return; + } + + if(this.files == false) + { + if(linker.lConfig.backend) + { + //get files from backend + HTMLArea._postback(linker.lConfig.backend, + linker.lConfig.backend_data, + function(txt) { + try { + eval('lDialog.files = '+txt); + } catch(Error) { + lDialog.files = [ {url:'',title:Error.toString()} ]; + } + lDialog._prepareDialog(); }); + } + else if(linker.lConfig.files != null) + { + //get files from plugin-config + lDialog.files = linker.lConfig.files; + lDialog._prepareDialog(); + } + return; + } + var files = this.files; + + if(this.html == false) + { + HTMLArea._getback(_editor_url + 'plugins/Linker/dialog.html', function(txt) { lDialog.html = txt; lDialog._prepareDialog(); }); + return; + } + var html = this.html; + + // Now we have everything we need, so we can build the dialog. + var dialog = this.dialog = new HTMLArea.Dialog(linker.editor, this.html, 'Linker'); + var dTreeName = HTMLArea.uniq('dTree_'); + + this.dTree = new dTree(dTreeName, _editor_url + 'plugins/Linker/dTree/'); + eval(dTreeName + ' = this.dTree'); + + this.dTree.add(this.Dialog_nxtid++, -1, document.location.host, null, document.location.host); + this.makeNodes(files, 0); + + // Put it in + var ddTree = this.dialog.getElementById('dTree'); + //ddTree.innerHTML = this.dTree.toString(); + ddTree.innerHTML = ''; + ddTree.style.position = 'absolute'; + ddTree.style.left = 1 + 'px'; + ddTree.style.top = 0 + 'px'; + ddTree.style.overflow = 'auto'; + this.ddTree = ddTree; + this.dTree._linker_premade = this.dTree.toString(); + + var options = this.dialog.getElementById('options'); + options.style.position = 'absolute'; + options.style.top = 0 + 'px'; + options.style.right = 0 + 'px'; + options.style.width = 320 + 'px'; + options.style.overflow = 'auto'; + + // Hookup the resizer + this.dialog.onresize = function() + { + var h = parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight; + var w = parseInt(dialog.width) - 322 ; + // An error is thrown with IE when trying to set a negative width or a negative height + // But perhaps a width / height of 0 is not the minimum required we need to set + if (w<0) w = 0; + if (h<0) h = 0; + options.style.height = ddTree.style.height = h + 'px'; + ddTree.style.width = w + 'px'; + } + + this.ready = true; +}; + +Linker.Dialog.prototype.makeNodes = function(files, parent) +{ + for(var i = 0; i < files.length; i++) + { + if(typeof files[i] == 'string') + { + this.dTree.add(Linker.nxtid++, parent, + files[i].replace(/^.*\//, ''), + 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);', + files[i]); + } + else if(files[i].length) + { + var id = this.Dialog_nxtid++; + this.dTree.add(id, parent, files[i][0].replace(/^.*\//, ''), null, files[i][0]); + this.makeNodes(files[i][1], id); + } + else if(typeof files[i] == 'object') + { + if(files[i].children) { + var id = this.Dialog_nxtid++; + } else { + var id = Linker.nxtid++; + } + + if(files[i].title) var title = files[i].title; + else if(files[i].url) var title = files[i].url.replace(/^.*\//, ''); + else var title = "no title defined"; + if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);'; + else var link = ''; + + this.dTree.add(id, parent, title, link, title); + if(files[i].children) { + this.makeNodes(files[i].children, id); + } + } + } +}; + +Linker.Dialog.prototype._lc = Linker.prototype._lc; + +Linker.Dialog.prototype.show = function(inputs, ok, cancel) +{ + if(!this.ready) + { + var lDialog = this; + window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100); + return; + } + + if(this.ddTree.innerHTML == '') + { + this.ddTree.innerHTML = this.dTree._linker_premade; + } + + if(inputs.type=='url') + { + this.dialog.getElementById('urltable').style.display = ''; + this.dialog.getElementById('mailtable').style.display = 'none'; + this.dialog.getElementById('anchortable').style.display = 'none'; + } + else if(inputs.type=='anchor') + { + this.dialog.getElementById('urltable').style.display = 'none'; + this.dialog.getElementById('mailtable').style.display = 'none'; + this.dialog.getElementById('anchortable').style.display = ''; + } + else + { + this.dialog.getElementById('urltable').style.display = 'none'; + this.dialog.getElementById('mailtable').style.display = ''; + this.dialog.getElementById('anchortable').style.display = 'none'; + } + + if(inputs.target=='popup') + { + this.dialog.getElementById('popuptable').style.display = ''; + } + else + { + this.dialog.getElementById('popuptable').style.display = 'none'; + } + + var anchor = this.dialog.getElementById('anchor'); + for(var i=anchor.length;i>=0;i--) { + anchor[i] = null; + } + + var html = this.linker.editor.getHTML(); + var anchors = new Array(); + + var m = html.match(/]+name="([^"]+)"/gi); + if(m) + { + for(i=0;i$url, 'children'=>$subdir); + } + } + elseif(is_file($path)) + { + if(($include && !preg_match($include, $url)) || ($exclude && preg_match($exclude, $url))) continue; + $files[] = array('url'=>$url); + } + + } + } + @closedir($dh); + return dirsort($files); + } + + function dirsort($files) + { + usort($files, 'dircomp'); + return $files; + } + + function dircomp($a, $b) + { + if(is_array($a)) $a = array_shift($a); + if(is_array($b)) $b = array_shift($b); + return strcmp(strtolower($a), strtolower($b)); + } + + echo xinha_to_js(scan($dir)); +?> Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/ListType.css URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/ListType.css?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/ListType.css (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/ListType.css Sun Oct 8 12:53:13 2006 @@ -0,0 +1,43 @@ +.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); +} Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/circle.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/circle.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/circle.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/decimal.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/decimal.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/decimal.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/disc.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/disc.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/disc.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-alpha.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-alpha.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-alpha.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-roman.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-roman.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/lower-roman.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/none.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/none.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/none.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/square.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/square.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/square.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-alpha.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-alpha.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-alpha.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-roman.png URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-roman.png?view=auto&rev=454197 ============================================================================== Binary file - no diff available. Propchange: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/img/upper-roman.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/de.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/de.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/de.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/de.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Raimund Meyer xinha@ray-of-light.org +{ + "Decimal numbers": "Zahlen", + "Lower roman numbers": "Römisch klein", + "Upper roman numbers": "Römisch groß", + "Lower latin letters": "Zeichen klein", + "Upper latin letters": "Zeichen groß", + "Lower greek letters": "Griechisch", + "Choose list style type (for ordered lists)": "Wählen Sie einen Typ für die Nummerierung aus" +}; Added: incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/fr.js URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/fr.js?view=auto&rev=454197 ============================================================================== --- incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/fr.js (added) +++ incubator/roller/trunk/web/roller-ui/authoring/editors/xinha/plugins/ListType/lang/fr.js Sun Oct 8 12:53:13 2006 @@ -0,0 +1,11 @@ +// 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)" +}; \ No newline at end of file