-/* $Id$ */
+var debug=false;
+
+/* for debugging purposes */
+function plc_timestamp () {
+ var now = new Date();
+ return now.getMinutes() + ':' + now.getSeconds() + '.' + now.getMilliseconds() ;
+}
+
+function plc_message (message) {
+ console.log ( plc_timestamp() + ' : ' + message);
+}
/* when a table gets paginated, displays context info */
function plekit_table_paginator (opts,table_id) {
// Extract actual text from a DOM node (remove internal tags and so on)
function getInnerText(node) {
- var result = '';
- if (Node.TEXT_NODE == node.nodeType)
- return node.nodeValue;
- if (Node.ELEMENT_NODE != node.nodeType)
- return '';
- for (var index = 0; index < node.childNodes.length; ++index)
- result += getInnerText(node.childNodes.item(index));
- return result;
+ if (node==undefined) return "";
+ var result = '';
+ if (Node.TEXT_NODE == node.nodeType)
+ return node.nodeValue;
+ if (Node.ELEMENT_NODE != node.nodeType)
+ return '';
+ for (var index = 0; index < node.childNodes.length; ++index)
+ result += getInnerText(node.childNodes.item(index));
+ return result;
} // getInnerText
// cache in the <tr> node the concatenation of the innerTexts of its cells
}
function plekit_lazy_table_filter (table_id,pattern_id,and_id) {
+
+ if (debug) plc_message ('entering plekit_lazy_table_filter');
+
var table=$(table_id);
var css='#'+table_id+'>tbody';
var rows = $$(css)[0].rows;
return;
}
+ if (debug) plc_message ('inside plekit_lazy_table_filter');
+
var searches=new Array();
var patterns=new Array();
if (pattern_text.length > 0) {
var end=(new Date).getTime();
var match_ms=end-start;
+ if (debug) plc_message ('almost at end of plekit_lazy_table_filter');
+
// optimize useless calls to init, by comparing # of matching entries
var previous_matching=table['previous_matching'];
if (matching_entries == previous_matching) {
tablePaginater.init(table_id);
var end2=(new Date).getTime();
var paginate_ms=end2-end;
-
+
+ if (debug) plc_message ('exiting plekit_lazy_table_filter with paginate_ms=' + paginate_ms);
+
}
function plekit_table_filter_reset (table_id, pattern_id,and_id) {