From 58110b8fd90c9261c7ae06e02253722b220e9e0c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 20 Jan 2007 23:30:32 +0000 Subject: r20925: Rename file following naming qooxdoo's convention (This used to be commit eca5d7f2935112841d467c8967f08a0b46512b0f) --- .../class/swat/module/ldbbrowse/LdifViewer.js | 84 ++++++++++++++++++++++ .../class/swat/module/ldbbrowse/ldifViewer.js | 84 ---------------------- 2 files changed, 84 insertions(+), 84 deletions(-) create mode 100644 webapps/swat/source/class/swat/module/ldbbrowse/LdifViewer.js delete mode 100644 webapps/swat/source/class/swat/module/ldbbrowse/ldifViewer.js (limited to 'webapps/swat/source') diff --git a/webapps/swat/source/class/swat/module/ldbbrowse/LdifViewer.js b/webapps/swat/source/class/swat/module/ldbbrowse/LdifViewer.js new file mode 100644 index 0000000000..61f04bd3e1 --- /dev/null +++ b/webapps/swat/source/class/swat/module/ldbbrowse/LdifViewer.js @@ -0,0 +1,84 @@ +/* + * Copyright:: + * (C) 2006 by Simo Sorce + * + * License: + * GPL v2 or later + */ + +/** + * Swat LDB Browser class graphical user interface + */ + +qx.OO.defineClass("swat.module.ldbbrowse.ldifViewer", qx.ui.embed.HtmlEmbed, +function() +{ + qx.ui.embed.HtmlEmbed.call(this, ""); + + this.setStyleProperty("whiteSpace", "nowrap"); + this.setStyleProperty("textOverflow", "ellipsis"); + + this.setOverflow("auto"); + this.setSelectable(true); + + this.innerText = ""; +}); + +//qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "???" }); + +qx.OO.addProperty({ name : "innerText", type : "string" }); + +swat.module.ldbbrowse.ldifViewer.empty = { + html : "", + innerText : "" +} + +qx.Proto.reset = function() { + this.innerText = ""; + this.setHtml(""); +} + +qx.Proto._update = function() { + this.setHtml("
" + this.innerText + "
"); +} + +qx.Proto.appendComment = function(aText) { + this.innerText = this.innerText + "# " + a Text + "\n\n"; + this._update(); +} + +qx.Proto.appendObject = function(o) { + + // First print the Object name as comment + // TODO: Prettify it later + var ldifRecord = "# " + o["dn"] + "\n"; + + // Now the dn + ldifRecord = ldifRecord + "dn: " + o["dn"] + "\n"; + + // Now the attributes; + for (var field in o) + { + + // If it's multi-valued (type is an array)... + if (typeof(o[field]) == "object") + { + // ... then add each value with same name + var a = o[field]; + for (var i = 0; i < a.length; i++) + { + ldifRecord = ldifRecord + field + ": " + a[i] + "\n"; + } + } + else // single-valued + { + ldifRecord = ldifRecord + field + ": " + o[field] + "\n"; + } + } + + // Terminate the record with an empty line + ldifRecord = ldifRecord + "\n"; + + this.innerText = this.innerText + ldifRecord; + this._update(); +} diff --git a/webapps/swat/source/class/swat/module/ldbbrowse/ldifViewer.js b/webapps/swat/source/class/swat/module/ldbbrowse/ldifViewer.js deleted file mode 100644 index 61f04bd3e1..0000000000 --- a/webapps/swat/source/class/swat/module/ldbbrowse/ldifViewer.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright:: - * (C) 2006 by Simo Sorce - * - * License: - * GPL v2 or later - */ - -/** - * Swat LDB Browser class graphical user interface - */ - -qx.OO.defineClass("swat.module.ldbbrowse.ldifViewer", qx.ui.embed.HtmlEmbed, -function() -{ - qx.ui.embed.HtmlEmbed.call(this, ""); - - this.setStyleProperty("whiteSpace", "nowrap"); - this.setStyleProperty("textOverflow", "ellipsis"); - - this.setOverflow("auto"); - this.setSelectable(true); - - this.innerText = ""; -}); - -//qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "???" }); - -qx.OO.addProperty({ name : "innerText", type : "string" }); - -swat.module.ldbbrowse.ldifViewer.empty = { - html : "", - innerText : "" -} - -qx.Proto.reset = function() { - this.innerText = ""; - this.setHtml(""); -} - -qx.Proto._update = function() { - this.setHtml("
" + this.innerText + "
"); -} - -qx.Proto.appendComment = function(aText) { - this.innerText = this.innerText + "# " + a Text + "\n\n"; - this._update(); -} - -qx.Proto.appendObject = function(o) { - - // First print the Object name as comment - // TODO: Prettify it later - var ldifRecord = "# " + o["dn"] + "\n"; - - // Now the dn - ldifRecord = ldifRecord + "dn: " + o["dn"] + "\n"; - - // Now the attributes; - for (var field in o) - { - - // If it's multi-valued (type is an array)... - if (typeof(o[field]) == "object") - { - // ... then add each value with same name - var a = o[field]; - for (var i = 0; i < a.length; i++) - { - ldifRecord = ldifRecord + field + ": " + a[i] + "\n"; - } - } - else // single-valued - { - ldifRecord = ldifRecord + field + ": " + o[field] + "\n"; - } - } - - // Terminate the record with an empty line - ldifRecord = ldifRecord + "\n"; - - this.innerText = this.innerText + ldifRecord; - this._update(); -} -- cgit