Update of /var/cvs/applications/searchrelate/templates
In directory james.mmbase.org:/tmp/cvs-serv6190
Modified Files:
Searcher.js.jsp
Log Message:
made the search function accept both a form, and simply a search value
See also: http://cvs.mmbase.org/viewcvs/applications/searchrelate/templates
Index: Searcher.js.jsp
===================================================================
RCS file: /var/cvs/applications/searchrelate/templates/Searcher.js.jsp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- Searcher.js.jsp 21 Apr 2008 10:54:14 -0000 1.11
+++ Searcher.js.jsp 21 Apr 2008 11:11:10 -0000 1.12
@@ -11,7 +11,7 @@
*
* @author Michiel Meeuwissen
- * @version $Id: Searcher.js.jsp,v 1.11 2008/04/21 10:54:14 michiel Exp $
+ * @version $Id: Searcher.js.jsp,v 1.12 2008/04/21 11:11:10 michiel Exp $
*/
$(document).ready(function(){
@@ -26,7 +26,7 @@
*
*/
function MMBaseLogger(area) {
- this.logEnabled = true;
+ this.logEnabled = false;
/*this.traceEnabled = false;*/
this.logarea = area;
}
@@ -346,8 +346,12 @@
* Feeded are 'id' 'offset' and 'search'.
* The actual query is supposed to be on the user's session, and will be
picked up in page.jspx.
*/
-MMBaseSearcher.prototype.search = function(form, offset) {
- var newSearch = $(form).find("input").val();
+MMBaseSearcher.prototype.search = function(val, offset) {
+ if (val.tagName == "FORM") {
+ val = $(val).find("input").val();
+ }
+
+ var newSearch = val;
if (newSearch != this.value) {
this.searchResults = {};
this.value = newSearch;
@@ -413,7 +417,7 @@
self.logger.debug(newNode);
var tr = self.getTr(newNode);
self.relater.relate(tr);
- self.search(null, self.offset);
+ self.search(newNode, self.offset);
}
};
$(rep).find("form.mm_form").ajaxForm(options);
@@ -490,7 +494,6 @@
self.logger.debug("navigating " + anchor);
var id = anchor.href.substring(anchor.href.indexOf("#") + 1,
anchor.href.lastIndexOf("_"));
- self.logger.debug("Found id " + id);
return self.search(document.getElementById(id), anchor.name);
});
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs