From 6cf964d0dc008621fb30fd2da28e2c44f29c6364 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 27 Jan 2005 10:21:18 +0000 Subject: DHTML progress bar for glacial rate adding and editing, closes: Bug#1100 --- httemplate/elements/qlib/label.js | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 httemplate/elements/qlib/label.js (limited to 'httemplate/elements/qlib/label.js') diff --git a/httemplate/elements/qlib/label.js b/httemplate/elements/qlib/label.js new file mode 100644 index 000000000..2d8b1e710 --- /dev/null +++ b/httemplate/elements/qlib/label.js @@ -0,0 +1,72 @@ +/** + * QLIB 1.0 Text Label + * Copyright (C) 2002 2003, Quazzle.com Serge Dolgov + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * http://qlib.quazzle.com + */ + +function QLabel_set_ie(value) { + this.label.innerText = (this.value = value) || "\xA0"; +} + +function QLabel_set_dom2(value) { + with (this.label) { + replaceChild(this.document.createTextNode((this.value = value) || "\xA0"), firstChild); + } +} + +function QLabel_set_ns4(value) { + this.value = value || ""; + with (this) { + document.open(); + document.write('
' + (clickable ? '' + value + '' : value) + '
'); + document.close(); + } +} + +function QLabel_doEvent() { + this.onClick(this.value, this.tag); + return false; +} + +function QLabel(parent, name, value, clickable, tooltip) { + this.init(parent, name); + this.value = value || ""; + this.clickable = clickable || false; + this.tooltip = tooltip || ""; + this.doEvent = QLabel_doEvent; + this.onClick = QControl.event; + with (this) { + if (document.getElementById || document.all) { + document.write(clickable ? '
' + + (value || ' ') + '
' : '
' + + (value || ' ') + '
'); + this.label = document.getElementById ? document.getElementById(id) : + (document.all.item ? document.all.item(id) : document.all[id]); + this.set = (label && (label.innerText ? QLabel_set_ie : + (label.replaceChild && QLabel_set_dom2))) || QControl.nop; + } else if (document.layers) { + var suffix = ""; + for (var j=value.length; j
' + + (clickable ? '' + value + suffix + '' : + value + suffix) + '
'); + this.label = (this.label = document.layers["i" + id]) && label.document.layers[id]; + this.document = label && label.document; + this.set = (label && document) ? QLabel_set_ns4 : QControl.nop; + } else { + document.write("Object is not supported"); + } + } +} +QLabel.prototype = new QControl(); +QLabel.TEXTQUOTA = 50; -- cgit v1.2.1