rhmessaging commits: r3870 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-22 10:00:07 -0400 (Mon, 22 Mar 2010)
New Revision: 3870
Modified:
mgmt/trunk/cumin/python/cumin/formats.py
Log:
Added fmt_bytes(bytes) and fmt_bits(bits)
Modified: mgmt/trunk/cumin/python/cumin/formats.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/formats.py 2010-03-12 18:07:37 UTC (rev 3869)
+++ mgmt/trunk/cumin/python/cumin/formats.py 2010-03-22 14:00:07 UTC (rev 3870)
@@ -1,5 +1,6 @@
from datetime import datetime
from random import random
+from math import floor
from util import *
from wooly import Writer
@@ -158,3 +159,20 @@
writer.write(html % (show_key, str(value[key])))
writer.write("</table>")
return writer.to_string()
+
+def fmt_bytes(num, base="B"):
+ sizes = ("", "K", "M", "G", "T", "P", "Y")
+ k = 1024
+ which_size = 0
+ b = num
+
+ while b >= k:
+ b /= k
+ which_size += 1
+
+ if which_size < len(sizes):
+ return "%.0d%s%s" % (floor(b), sizes[which_size], base)
+ return str(num)
+
+def fmt_bits(bits):
+ return fmt_bytes(bits, base="b")
14 years, 9 months
rhmessaging commits: r3869 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-12 13:07:37 -0500 (Fri, 12 Mar 2010)
New Revision: 3869
Added:
mgmt/trunk/cumin/resources/incrementalSearch.js
Modified:
mgmt/trunk/cumin/resources/app.js
Log:
Added "No Matches" to incremental search dropdown
Moved incremental search code to it's own file
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2010-03-11 14:45:03 UTC (rev 3868)
+++ mgmt/trunk/cumin/resources/app.js 2010-03-12 18:07:37 UTC (rev 3869)
@@ -475,120 +475,11 @@
}
}
-
-//+ Jonas Raoni Soares Silva
-//@ http://jsfromhell.com/dhtml/incremental-search [rev. #4]
-
-IncrementalSearch = function(input, callback, className, listObjectID, maxEntries){
- var i, thisObject = this;
- thisObject.listObjectID = listObjectID;
- thisObject.maxEntries = maxEntries;
- (thisObject.input = input).autocomplete = "off", thisObject.callback = callback || function(){},
- thisObject.className = className || "", thisObject.hide(), thisObject.visible = 0;
- for(i in {keydown: 0, focus: 0, blur: 0, keyup: 0, keypress: 0})
- this.addEvent(input, i, thisObject._handler, thisObject);
-};
-with({p: IncrementalSearch.prototype}){
- //+ Carlos R. L. Rodrigues
- //@ http://jsfromhell.com/geral/event-listener [rev. #5]
- p.addEvent = function(o, e, f, s){
- var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
- r[r.length] = [f, s || o], o[e] = function(e){
- try{
- (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
- e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
- e.target || (e.target = e.srcElement || null);
- e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
- }catch(f){}
- for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
- return e = null, !!d;
- }
- };
-
- p.show = function(){
- for(var thisObject = this, s = thisObject.c.style, o = thisObject.input, x = o.offsetLeft,
- y = o.offsetTop + o.offsetHeight; o = o.offsetParent; x += o.offsetLeft, y += o.offsetTop);
- s.left = x + "px", s.top = y + "px",
- thisObject.l.length ? (s.display = "block", !thisObject.visible && (thisObject._callEvent("onshow"), ++thisObject.visible), thisObject.highlite(0)) : s.display = "none";
- };
- p.hide = function(){
- var thisObject = this, d = document, s = (thisObject.c && thisObject.c.parentNode.removeChild(thisObject.c),
- thisObject.c = d.body.appendChild(d.createElement("div"))).style;
- //thisObject.c.width = thisObject.input.offsetwidth + "px";
- thisObject.l = [], thisObject.i = -1, thisObject.c.className = thisObject.className, s.position = "absolute", s.display = "none";
- thisObject._old = null, thisObject.visible && (thisObject._callEvent("onhide"), --thisObject.visible);
- };
- p.add = function(s, x, data){
- var thisObject = this, l = 0, d = document, i = thisObject.l.length, v = thisObject.input.value.length,
- o = (thisObject.l[i] = [s, data, thisObject.c.appendChild(d.createElement("div"))])[2];
- if(i >= thisObject.maxEntries)
- return;
- if(x instanceof Array || (x = [x]), o.i = i, o.className = "normal", !isNaN(x[0]))
- for(var j = -1, k = x.length; ++j < k; o.appendChild(d.createTextNode(
- s.substring(l, x[j]))).parentNode.appendChild(d.createElement(
- "span")).appendChild(d.createTextNode(s.substring(x[j],
- l = x[j] + v))).parentNode.className = "highlited");
- for(x in o.appendChild(d.createTextNode(s.substr(l))), {click: 0, mouseover: 0})
- p.addEvent(o, x, thisObject._handler, thisObject);
- };
- p.highlite = function(i){
- var thisObject = this;
- thisObject._invalid(i) || (thisObject._invalid(thisObject.i) || (thisObject.l[thisObject.i][2].className = "normal"),
- thisObject.l[thisObject.i = i][2].className += " selected", thisObject._callEvent("onhighlite", thisObject.l[i][0], thisObject.l[i][1]));
- };
- p.select = function(i){
- var thisObject = this;
- thisObject._invalid(i = isNaN(i) ? thisObject.i : i) || (thisObject._callEvent("onselect",
- thisObject.input.value = thisObject.l[thisObject.i][0], thisObject.l[i][1]), thisObject.hide());
- };
- p.next = function(){
- var thisObject = (thisObject = this, thisObject.highlite((thisObject.i + 1) % thisObject.l.length));
- };
- p.previous = function(){
- var thisObject = (thisObject = this, thisObject.highlite((!thisObject.i ? thisObject.l.length : thisObject.i) - 1));
- };
- p._fadeOut = function(){
- var f = (f = function(){arguments.callee.x.hide();}, f.x = this, setTimeout(f, 200));
- };
- p._handler = function(e){
- var thisObject = this, t = e.type, k = e.key;
- t == "focus" || t == "keyup" ? k != 40 && k != 38 && k != 13 && thisObject._old != thisObject.input.value && (thisObject.hide(), thisObject.callback(thisObject, thisObject.input.value))
- : t == "keydown" ? k == 40 ? thisObject.next() : k == 38 ? thisObject.previous() : thisObject._old = thisObject.input.value
- : t == "keypress" ? k == 13 && (e.preventDefault(), thisObject.select())
- : t == "blur" ? thisObject._fadeOut() : t == "click" ? thisObject.select()
- : thisObject.highlite((/span/i.test((e = e.target).tagName) ? e.parentNode : e).i);
- };
- p._invalid = function(i){
- return isNaN(i) || i < 0 || i >= this.l.length;
- }
- p._callEvent = function(e){
- var thisObject = this;
- return thisObject[e] instanceof Function ? thisObject[e].apply(thisObject, [].slice.call(arguments, 1)) : undefined;
- };
+function addJavascript(jsname, pos) {
+ var th = document.getElementsByTagName(pos)[0];
+ var s = document.createElement('script');
+ s.setAttribute('type','text/javascript');
+ s.setAttribute('src',jsname);
+ th.appendChild(s);
}
-//-- Searches for multiple matches ----
-function Inc_CIAnywhere(o, search){
- if(search = search.toLowerCase()) {
- var ul = $(o.listObjectID);
- var list = ul.getElements("li");
- for(var i = -1, l = list.length; ++i < l;){
- /*searches all the matches of "search" and adds the indexes in an array */
- for(var j = 0, indices = []; j = list[i].firstChild.nodeValue.toLowerCase().indexOf(search, j) + 1;
- indices[indices.length] = j - 1);
- /*if any ocurrence was found, adds the item and pass the position of the matches*/
- if(indices.length)
- o.add(list[i].firstChild.nodeValue, indices);
- }
- }
- o.show();
-}
-function Inc_CIBeginning(o, search) {
- if (search = search.toLowerCase()) {
- var ul = $(o.listObjectID);
- var list = ul.getElements("li");
- for(var i = -1, l = list.length; ++i < l;)
- if( list[i].firstChild.nodeValue.toLowerCase().indexOf(search) == 0)
- o.add(list[i].firstChild.nodeValue, 0);
- }
- o.show();
-}
+addJavascript('resource?name=incrementalSearch.js', 'head');
Added: mgmt/trunk/cumin/resources/incrementalSearch.js
===================================================================
--- mgmt/trunk/cumin/resources/incrementalSearch.js (rev 0)
+++ mgmt/trunk/cumin/resources/incrementalSearch.js 2010-03-12 18:07:37 UTC (rev 3869)
@@ -0,0 +1,125 @@
+
+//+ Jonas Raoni Soares Silva
+//@ http://jsfromhell.com/dhtml/incremental-search [rev. #4]
+
+IncrementalSearch = function(input, callback, className, listObjectID, maxEntries){
+ var i, thisObject = this;
+ thisObject.listObjectID = listObjectID;
+ thisObject.maxEntries = maxEntries;
+ (thisObject.input = input).autocomplete = "off", thisObject.callback = callback || function(){},
+ thisObject.className = className || "", thisObject.hide(), thisObject.visible = 0;
+ for(i in {keydown: 0, focus: 0, blur: 0, keyup: 0, keypress: 0})
+ this.addEvent(input, i, thisObject._handler, thisObject);
+};
+with({p: IncrementalSearch.prototype}){
+ //+ Carlos R. L. Rodrigues
+ //@ http://jsfromhell.com/geral/event-listener [rev. #5]
+ p.addEvent = function(o, e, f, s){
+ var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
+ r[r.length] = [f, s || o], o[e] = function(e){
+ try{
+ (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
+ e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
+ e.target || (e.target = e.srcElement || null);
+ e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
+ }catch(f){}
+ for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
+ return e = null, !!d;
+ }
+ };
+
+ p.show = function(){
+ for(var thisObject = this, s = thisObject.c.style, o = thisObject.input, x = o.offsetLeft,
+ y = o.offsetTop + o.offsetHeight; o = o.offsetParent; x += o.offsetLeft, y += o.offsetTop);
+ s.left = x + "px", s.top = y + "px",
+ thisObject.l.length ? (s.display = "block", !thisObject.visible && (thisObject._callEvent("onshow"), ++thisObject.visible), thisObject.highlite(0)) : s.display = "none";
+ };
+ p.hide = function(){
+ var thisObject = this, d = document, s = (thisObject.c && thisObject.c.parentNode.removeChild(thisObject.c),
+ thisObject.c = d.body.appendChild(d.createElement("div"))).style;
+ //thisObject.c.width = thisObject.input.offsetwidth + "px";
+ thisObject.l = [], thisObject.i = -1, thisObject.c.className = thisObject.className, s.position = "absolute", s.display = "none";
+ thisObject._old = null, thisObject.visible && (thisObject._callEvent("onhide"), --thisObject.visible);
+ };
+ p.add = function(s, x, data){
+ var thisObject = this, l = 0, d = document, i = thisObject.l.length, v = thisObject.input.value.length,
+ o = (thisObject.l[i] = [s, data, thisObject.c.appendChild(d.createElement("div"))])[2];
+ if(i >= thisObject.maxEntries)
+ return;
+ if ( x == -1) {
+ o.appendChild(d.createTextNode( s ));
+ } else {
+ if(x instanceof Array || (x = [x]), o.i = i, o.className = "normal", !isNaN(x[0]))
+ for(var j = -1, k = x.length; ++j < k; o.appendChild(d.createTextNode(
+ s.substring(l, x[j]))).parentNode.appendChild(d.createElement(
+ "span")).appendChild(d.createTextNode(s.substring(x[j],
+ l = x[j] + v))).parentNode.className = "highlited");
+
+ for(x in o.appendChild(d.createTextNode(s.substr(l))), {click: 0, mouseover: 0})
+ p.addEvent(o, x, thisObject._handler, thisObject);
+ }
+ };
+ p.highlite = function(i){
+ var thisObject = this;
+ thisObject._invalid(i) || (thisObject._invalid(thisObject.i) || (thisObject.l[thisObject.i][2].className = "normal"),
+ thisObject.l[thisObject.i = i][2].className += " selected", thisObject._callEvent("onhighlite", thisObject.l[i][0], thisObject.l[i][1]));
+ };
+ p.select = function(i){
+ var thisObject = this;
+ thisObject._invalid(i = isNaN(i) ? thisObject.i : i) || (thisObject._callEvent("onselect",
+ thisObject.input.value = thisObject.l[thisObject.i][0], thisObject.l[i][1]), thisObject.hide());
+ };
+ p.next = function(){
+ var thisObject = (thisObject = this, thisObject.highlite((thisObject.i + 1) % thisObject.l.length));
+ };
+ p.previous = function(){
+ var thisObject = (thisObject = this, thisObject.highlite((!thisObject.i ? thisObject.l.length : thisObject.i) - 1));
+ };
+ p._fadeOut = function(){
+ var f = (f = function(){arguments.callee.x.hide();}, f.x = this, setTimeout(f, 200));
+ };
+ p._handler = function(e){
+ var thisObject = this, t = e.type, k = e.key;
+ t == "focus" || t == "keyup" ? k != 40 && k != 38 && k != 13 && thisObject._old != thisObject.input.value && (thisObject.hide(), thisObject.callback(thisObject, thisObject.input.value))
+ : t == "keydown" ? k == 40 ? thisObject.next() : k == 38 ? thisObject.previous() : thisObject._old = thisObject.input.value
+ : t == "keypress" ? k == 13 && (e.preventDefault(), thisObject.select())
+ : t == "blur" ? thisObject._fadeOut() : t == "click" ? thisObject.select()
+ : thisObject.highlite((/span/i.test((e = e.target).tagName) ? e.parentNode : e).i);
+ };
+ p._invalid = function(i){
+ return isNaN(i) || i < 0 || i >= this.l.length;
+ }
+ p._callEvent = function(e){
+ var thisObject = this;
+ return thisObject[e] instanceof Function ? thisObject[e].apply(thisObject, [].slice.call(arguments, 1)) : undefined;
+ };
+}
+//-- Searches for multiple matches ----
+function Inc_CIAnywhere(o, search){
+ if(search = search.toLowerCase()) {
+ var ul = $(o.listObjectID);
+ var list = ul.getElements("li");
+ for(var i = -1, l = list.length; ++i < l;){
+ /*searches all the matches of "search" and adds the indexes in an array */
+ for(var j = 0, indices = []; j = list[i].firstChild.nodeValue.toLowerCase().indexOf(search, j) + 1;
+ indices[indices.length] = j - 1);
+ /*if any ocurrence was found, adds the item and pass the position of the matches*/
+ if(indices.length)
+ o.add(list[i].firstChild.nodeValue, indices);
+ }
+ }
+ o.show();
+}
+function Inc_CIBeginning(o, search) {
+ if (search = search.toLowerCase()) {
+ var ul = $(o.listObjectID);
+ var list = ul.getElements("li");
+ for(var i = -1, l = list.length; ++i < l;)
+ if( list[i].firstChild.nodeValue.toLowerCase().indexOf(search) == 0)
+ o.add(list[i].firstChild.nodeValue, 0);
+ }
+ if ((o.l.length == 0) && (search.length > 0)) {
+ o.add("No Matches", -1);
+ }
+ o.show();
+}
14 years, 9 months
rhmessaging commits: r3868 - store/trunk/cpp/tests/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-03-11 09:45:03 -0500 (Thu, 11 Mar 2010)
New Revision: 3868
Modified:
store/trunk/cpp/tests/jrnl/jhexdump
Log:
Minor bugfix for the jhexdump utility - did not handle spaces in paths correctly
Modified: store/trunk/cpp/tests/jrnl/jhexdump
===================================================================
--- store/trunk/cpp/tests/jrnl/jhexdump 2010-03-10 20:21:21 UTC (rev 3867)
+++ store/trunk/cpp/tests/jrnl/jhexdump 2010-03-11 14:45:03 UTC (rev 3868)
@@ -21,7 +21,7 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
-if [ -z $1 ]; then
+if [ -z "$1" ]; then
echo "No directory specified."
exit
fi
@@ -31,11 +31,11 @@
rm -f j*.txt
-if [ -d ${JDIR} ]; then
+if [ -d "${JDIR}" ]; then
n=0
- for f in ${JDIR}/*.jdat; do
+ for f in "${JDIR}"/*.jdat; do
echo "$f -> j$n.txt"
- hexdump -C $f > j$n.txt
+ hexdump -C "$f" > j$n.txt
(( n += 1 ))
done
else
14 years, 9 months
rhmessaging commits: r3867 - mgmt/trunk/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-10 15:21:21 -0500 (Wed, 10 Mar 2010)
New Revision: 3867
Modified:
mgmt/trunk/cumin/python/cumin/messaging/queue.py
Log:
Switch from radio buttons to incremental search for destination queue on move messages form
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2010-03-10 20:20:05 UTC (rev 3866)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2010-03-10 20:21:21 UTC (rev 3867)
@@ -770,12 +770,12 @@
def __init__(self, app, name, form):
super(QueueSelectField, self).__init__(app, name)
- self.param = QueueParameter(app, "param")
+ self.queue_set = self.QueueSearchInputSet(app, "queue_set")
+ self.add_child(self.queue_set)
+
+ self.param = self.QueueStringParameter(app, "param", self.queue_set)
self.add_parameter(self.param)
- self.queue_set = self.QueueInputSet(app, "queue_set", self.param)
- self.add_child(self.queue_set)
-
def get(self, session):
return self.param.get(session)
@@ -785,7 +785,7 @@
def render_inputs(self, session):
return self.queue_set.render(session)
- class QueueInputSet(RadioInputSet):
+ class QueueSearchInputSet(IncrementalSearchInput):
def do_get_items(self, session):
queue = self.form.queue.get(session) # XXX
queue_list_full = sorted_by(list(queue.vhost.queues))
@@ -797,16 +797,23 @@
queue_list.append(_queue)
return queue_list
- def render_item_value(self, session, queue):
- return queue.id
-
def render_item_content(self, session, queue):
return queue.name or "<em>Default</em>"
- def render_item_checked_attr(self, session, queue):
- return queue is self.param.get(session) \
- and "checked=\"checked\"" or None
+ class QueueStringParameter(Parameter):
+ def __init__(self, app, name, queue_string):
+ super(QueueSelectField.QueueStringParameter, self).__init__(app, name)
+ self.queue_string = queue_string
+
+ def get(self, session):
+ queue_string = self.queue_string.get(session)
+ queue_where = "name = '%s'" % queue_string
+ try:
+ return Queue.select(queue_where)[0]
+ except IndexError:
+ return None
+
class MoveMessagesForm(FieldSubmitForm):
def __init__(self, app, name, task):
super(MoveMessagesForm, self).__init__(app, name)
@@ -835,7 +842,7 @@
elif scount == "top":
count = 1
elif scount == "N":
- count = self.move_qty.top_n.get_n_value(session)
+ count = self.count.top_n.get_n_value(session)
else:
raise Exception("Wrong Value")
14 years, 9 months
rhmessaging commits: r3866 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-10 15:20:05 -0500 (Wed, 10 Mar 2010)
New Revision: 3866
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Base class for incremental search edit box
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2010-03-10 20:18:53 UTC (rev 3865)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2010-03-10 20:20:05 UTC (rev 3866)
@@ -1527,3 +1527,10 @@
return ": ".join((description, status))
import cumin.account.model
+
+class IncrementalSearchInput(StringInput, ItemSet):
+ def do_get_items(self, session):
+ return ()
+
+ def render_item_class(self, session, item):
+ return "list_item"
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2010-03-10 20:18:53 UTC (rev 3865)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2010-03-10 20:20:05 UTC (rev 3866)
@@ -893,3 +893,21 @@
margin: 0.5em auto 1em auto;
width: 80%;
}
+
+[IncrementalSearchInput.css]
+div.IncrementalSearchInput ul {
+ display: none;
+}
+
+[IncrementalSearchInput.html]
+<div class="IncrementalSearchInput">
+<input id="{id}" type="text" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr} size="{size}" autocomplete="off"/>
+<ul id="{id}.list">{items}</ul>
+</div>
+<script type="text/javascript">
+//<![CDATA[
+window.addEvent("domready", function () {
+ new IncrementalSearch($("{id}"), Inc_CIBeginning, "autocomplete", "{id}.list", 8); });
+//]]>
+</script>
+
14 years, 9 months
rhmessaging commits: r3865 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-10 15:18:53 -0500 (Wed, 10 Mar 2010)
New Revision: 3865
Modified:
mgmt/trunk/cumin/resources/app.css
mgmt/trunk/cumin/resources/app.js
Log:
Javascript and css for incremental search edit box
Modified: mgmt/trunk/cumin/resources/app.css
===================================================================
--- mgmt/trunk/cumin/resources/app.css 2010-03-10 20:16:43 UTC (rev 3864)
+++ mgmt/trunk/cumin/resources/app.css 2010-03-10 20:18:53 UTC (rev 3865)
@@ -586,3 +586,15 @@
position: absolute;
z-index: 1000;
}
+.autocomplete{
+ cursor: pointer;
+ border: 1px solid #999;
+ border-top: none;
+ background: #fff;
+ z-index: 2;
+ padding: 0 0.25em;
+}
+.autocomplete .normal{border-top: 1px solid #fefefe;}
+.autocomplete .selected{background: #ddf;}
+.autocomplete .highlited{font-weight: bold; color: #008;}
+
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2010-03-10 20:16:43 UTC (rev 3864)
+++ mgmt/trunk/cumin/resources/app.js 2010-03-10 20:18:53 UTC (rev 3865)
@@ -473,4 +473,122 @@
selinput.focus();
selinput.selectRange(0, selinput.value.length);
}
-}
\ No newline at end of file
+}
+
+
+//+ Jonas Raoni Soares Silva
+//@ http://jsfromhell.com/dhtml/incremental-search [rev. #4]
+
+IncrementalSearch = function(input, callback, className, listObjectID, maxEntries){
+ var i, thisObject = this;
+ thisObject.listObjectID = listObjectID;
+ thisObject.maxEntries = maxEntries;
+ (thisObject.input = input).autocomplete = "off", thisObject.callback = callback || function(){},
+ thisObject.className = className || "", thisObject.hide(), thisObject.visible = 0;
+ for(i in {keydown: 0, focus: 0, blur: 0, keyup: 0, keypress: 0})
+ this.addEvent(input, i, thisObject._handler, thisObject);
+};
+with({p: IncrementalSearch.prototype}){
+ //+ Carlos R. L. Rodrigues
+ //@ http://jsfromhell.com/geral/event-listener [rev. #5]
+ p.addEvent = function(o, e, f, s){
+ var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
+ r[r.length] = [f, s || o], o[e] = function(e){
+ try{
+ (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
+ e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
+ e.target || (e.target = e.srcElement || null);
+ e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
+ }catch(f){}
+ for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
+ return e = null, !!d;
+ }
+ };
+
+ p.show = function(){
+ for(var thisObject = this, s = thisObject.c.style, o = thisObject.input, x = o.offsetLeft,
+ y = o.offsetTop + o.offsetHeight; o = o.offsetParent; x += o.offsetLeft, y += o.offsetTop);
+ s.left = x + "px", s.top = y + "px",
+ thisObject.l.length ? (s.display = "block", !thisObject.visible && (thisObject._callEvent("onshow"), ++thisObject.visible), thisObject.highlite(0)) : s.display = "none";
+ };
+ p.hide = function(){
+ var thisObject = this, d = document, s = (thisObject.c && thisObject.c.parentNode.removeChild(thisObject.c),
+ thisObject.c = d.body.appendChild(d.createElement("div"))).style;
+ //thisObject.c.width = thisObject.input.offsetwidth + "px";
+ thisObject.l = [], thisObject.i = -1, thisObject.c.className = thisObject.className, s.position = "absolute", s.display = "none";
+ thisObject._old = null, thisObject.visible && (thisObject._callEvent("onhide"), --thisObject.visible);
+ };
+ p.add = function(s, x, data){
+ var thisObject = this, l = 0, d = document, i = thisObject.l.length, v = thisObject.input.value.length,
+ o = (thisObject.l[i] = [s, data, thisObject.c.appendChild(d.createElement("div"))])[2];
+ if(i >= thisObject.maxEntries)
+ return;
+ if(x instanceof Array || (x = [x]), o.i = i, o.className = "normal", !isNaN(x[0]))
+ for(var j = -1, k = x.length; ++j < k; o.appendChild(d.createTextNode(
+ s.substring(l, x[j]))).parentNode.appendChild(d.createElement(
+ "span")).appendChild(d.createTextNode(s.substring(x[j],
+ l = x[j] + v))).parentNode.className = "highlited");
+ for(x in o.appendChild(d.createTextNode(s.substr(l))), {click: 0, mouseover: 0})
+ p.addEvent(o, x, thisObject._handler, thisObject);
+ };
+ p.highlite = function(i){
+ var thisObject = this;
+ thisObject._invalid(i) || (thisObject._invalid(thisObject.i) || (thisObject.l[thisObject.i][2].className = "normal"),
+ thisObject.l[thisObject.i = i][2].className += " selected", thisObject._callEvent("onhighlite", thisObject.l[i][0], thisObject.l[i][1]));
+ };
+ p.select = function(i){
+ var thisObject = this;
+ thisObject._invalid(i = isNaN(i) ? thisObject.i : i) || (thisObject._callEvent("onselect",
+ thisObject.input.value = thisObject.l[thisObject.i][0], thisObject.l[i][1]), thisObject.hide());
+ };
+ p.next = function(){
+ var thisObject = (thisObject = this, thisObject.highlite((thisObject.i + 1) % thisObject.l.length));
+ };
+ p.previous = function(){
+ var thisObject = (thisObject = this, thisObject.highlite((!thisObject.i ? thisObject.l.length : thisObject.i) - 1));
+ };
+ p._fadeOut = function(){
+ var f = (f = function(){arguments.callee.x.hide();}, f.x = this, setTimeout(f, 200));
+ };
+ p._handler = function(e){
+ var thisObject = this, t = e.type, k = e.key;
+ t == "focus" || t == "keyup" ? k != 40 && k != 38 && k != 13 && thisObject._old != thisObject.input.value && (thisObject.hide(), thisObject.callback(thisObject, thisObject.input.value))
+ : t == "keydown" ? k == 40 ? thisObject.next() : k == 38 ? thisObject.previous() : thisObject._old = thisObject.input.value
+ : t == "keypress" ? k == 13 && (e.preventDefault(), thisObject.select())
+ : t == "blur" ? thisObject._fadeOut() : t == "click" ? thisObject.select()
+ : thisObject.highlite((/span/i.test((e = e.target).tagName) ? e.parentNode : e).i);
+ };
+ p._invalid = function(i){
+ return isNaN(i) || i < 0 || i >= this.l.length;
+ }
+ p._callEvent = function(e){
+ var thisObject = this;
+ return thisObject[e] instanceof Function ? thisObject[e].apply(thisObject, [].slice.call(arguments, 1)) : undefined;
+ };
+}
+//-- Searches for multiple matches ----
+function Inc_CIAnywhere(o, search){
+ if(search = search.toLowerCase()) {
+ var ul = $(o.listObjectID);
+ var list = ul.getElements("li");
+ for(var i = -1, l = list.length; ++i < l;){
+ /*searches all the matches of "search" and adds the indexes in an array */
+ for(var j = 0, indices = []; j = list[i].firstChild.nodeValue.toLowerCase().indexOf(search, j) + 1;
+ indices[indices.length] = j - 1);
+ /*if any ocurrence was found, adds the item and pass the position of the matches*/
+ if(indices.length)
+ o.add(list[i].firstChild.nodeValue, indices);
+ }
+ }
+ o.show();
+}
+function Inc_CIBeginning(o, search) {
+ if (search = search.toLowerCase()) {
+ var ul = $(o.listObjectID);
+ var list = ul.getElements("li");
+ for(var i = -1, l = list.length; ++i < l;)
+ if( list[i].firstChild.nodeValue.toLowerCase().indexOf(search) == 0)
+ o.add(list[i].firstChild.nodeValue, 0);
+ }
+ o.show();
+}
14 years, 9 months
rhmessaging commits: r3864 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-10 15:16:43 -0500 (Wed, 10 Mar 2010)
New Revision: 3864
Modified:
mgmt/trunk/wooly/python/wooly/widgets.strings
Log:
Add id to propertyset table to allow of background update
Modified: mgmt/trunk/wooly/python/wooly/widgets.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/widgets.strings 2010-03-09 14:13:02 UTC (rev 3863)
+++ mgmt/trunk/wooly/python/wooly/widgets.strings 2010-03-10 20:16:43 UTC (rev 3864)
@@ -175,7 +175,7 @@
}
[PropertySet.html]
-<table class="PropertySet">
+<table class="PropertySet" id="{id}">
<thead>
<tr>
<th style="width: 50%;">Name</th>
14 years, 9 months
rhmessaging commits: r3863 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-03-09 09:13:02 -0500 (Tue, 09 Mar 2010)
New Revision: 3863
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/jexception.hpp
store/trunk/cpp/tests/cluster/cluster_tests_env.sh
store/trunk/cpp/tests/cluster/run_cpp_cluster_tests
store/trunk/cpp/tests/cluster/run_python_cluster_tests
Log:
Some tidy up; logging statements added for BZ492334.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-03-03 21:02:49 UTC (rev 3862)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-03-09 14:13:02 UTC (rev 3863)
@@ -345,12 +345,15 @@
tplStorePtr.reset(new TplJournalImpl("TplStore", getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout, agent));
txn.commit();
} catch (const journal::jexception& e) {
+ QPID_LOG(error, "Journal Exception occurred while initializing store: " << e);
txn.abort();
THROW_STORE_EXCEPTION_2("Error opening tplStore instance", e.what());
} catch (const DbException& e) {
+ QPID_LOG(error, "BDB exception occurred while initializing store: " << e.what());
txn.abort();
THROW_STORE_EXCEPTION_2("Error opening databases", e);
} catch (...) {
+ QPID_LOG(error, "Unknown exception occurred while initializing store.");
txn.abort();
throw;
}
Modified: store/trunk/cpp/lib/jrnl/jexception.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jexception.hpp 2010-03-03 21:02:49 UTC (rev 3862)
+++ store/trunk/cpp/lib/jrnl/jexception.hpp 2010-03-09 14:13:02 UTC (rev 3863)
@@ -60,6 +60,8 @@
throw jexception(jerrno::JERR__MALLOC, oss.str(), cls, fn); \
}
+// TODO: The following is a temporary bug-tracking aid which forces a core.
+// Replace with the commented out version below when BZ484048 is resolved.
#define PTHREAD_CHK(err, pfn, cls, fn) if(err != 0) { \
std::ostringstream oss; \
oss << cls << "::" << fn << "(): " << pfn; \
@@ -67,6 +69,13 @@
::perror(oss.str().c_str()); \
::abort(); \
}
+/*
+#define PTHREAD_CHK(err, pfn, cls, fn) if(err != 0) { \
+ std::ostringstream oss; \
+ oss << pfn << " failed: " << FORMAT_SYSERR(err); \
+ throw jexception(jerrno::JERR__PTHREAD, oss.str(), cls, fn); \
+ }
+*/
#define ASSERT(cond, msg) if(cond == 0) { \
std::cerr << msg << std::endl; \
Modified: store/trunk/cpp/tests/cluster/cluster_tests_env.sh
===================================================================
--- store/trunk/cpp/tests/cluster/cluster_tests_env.sh 2010-03-03 21:02:49 UTC (rev 3862)
+++ store/trunk/cpp/tests/cluster/cluster_tests_env.sh 2010-03-09 14:13:02 UTC (rev 3863)
@@ -50,7 +50,7 @@
func_check_clustering ()
-#----------------
+#-----------------------
# Check openAIS/corosync is running and user has correct privileges
# Params: None
# Returns: 0 if openAIS/corosync is running, 1 otherwise
Modified: store/trunk/cpp/tests/cluster/run_cpp_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cpp_cluster_tests 2010-03-03 21:02:49 UTC (rev 3862)
+++ store/trunk/cpp/tests/cluster/run_cpp_cluster_tests 2010-03-09 14:13:02 UTC (rev 3863)
@@ -23,6 +23,7 @@
. `dirname $0`/cluster_tests_env.sh
+echo "Running C++ cluster tests..."
if test $COROSYNC; then
${CPP_CLUSTER_EXEC}
RETCODE=$?
Modified: store/trunk/cpp/tests/cluster/run_python_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_python_cluster_tests 2010-03-03 21:02:49 UTC (rev 3862)
+++ store/trunk/cpp/tests/cluster/run_python_cluster_tests 2010-03-09 14:13:02 UTC (rev 3863)
@@ -40,8 +40,6 @@
sg ais -c "$TEST_CMD"
RETCODE=$?
fi
-#sg ais -c "${PYTHON_DIR}/qpid-python-test -m cluster_tests ${CLUSTER_TESTS_IGNORE} ${CLUSTER_TESTS} -DOUTDIR=$OUTDIR"
-#RETCODE=$?
if test x${RETCODE} != x0; then
exit 1;
14 years, 10 months
rhmessaging commits: r3862 - mgmt/trunk/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-03-03 16:02:49 -0500 (Wed, 03 Mar 2010)
New Revision: 3862
Modified:
mgmt/trunk/cumin/python/cumin/messaging/binding.strings
Log:
Move the bindings field set into place so expanding xml exchange doesn't overflow the form.
Modified: mgmt/trunk/cumin/python/cumin/messaging/binding.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/binding.strings 2010-03-01 15:12:49 UTC (rev 3861)
+++ mgmt/trunk/cumin/python/cumin/messaging/binding.strings 2010-03-03 21:02:49 UTC (rev 3862)
@@ -112,6 +112,11 @@
</table></td></tr>
[ExchangeKeysField.css]
+table.FormFieldSet div.inputs {
+ position: relative;
+ left: -4em;
+}
+
td.exchange_type {
font-style: italic;
}
14 years, 10 months
rhmessaging commits: r3861 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-03-01 10:12:49 -0500 (Mon, 01 Mar 2010)
New Revision: 3861
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
Handle missing referent classes
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2010-02-26 19:02:26 UTC (rev 3860)
+++ mgmt/trunk/mint/python/mint/update.py 2010-03-01 15:12:49 UTC (rev 3861)
@@ -161,8 +161,12 @@
name = name[:-3]
className = name[0].upper() + name[1:]
- otherClass = getattr(mint, className)
+ try:
+ otherClass = getattr(mint, className)
+ except AttributeError:
+ return
+
foreignKey = name + "_id"
object_id = str(QmfObjectId(oid.first, oid.second))
14 years, 10 months