Author: michiel Date: 2010-03-09 11:13:53 +0100 (Tue, 09 Mar 2010) New Revision: 41305
Modified: mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp Log: added a bunch of ; Modified: mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp =================================================================== --- mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp 2010-03-09 10:13:35 UTC (rev 41304) +++ mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp 2010-03-09 10:13:53 UTC (rev 41305) @@ -1,10 +1,10 @@ -// -*- mode: javascript; -*- +/* <%...@page contentType="text/javascript; charset=UTF-8" %><%...@taglib uri="http://www.mmbase.org/mmbase-taglib-2.0" prefix="mm" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><fmt:bundle basename="org.mmbase.searchrelate.resources.searchrelate"> <mm:content type="text/javascript" expires="0"> - + */ /** * This javascript binds to a div.list. It happens on document.ready on every div.list in the document. You can also call {...@link #init} manually, e.g. after an AJAX load. * @@ -269,7 +269,7 @@ $(el).find("div.list:last").each(function() { l.seq = $(this).find("input[name = 'seq']")[0].value; }); -} +}; /** * All List instances are collected staticly @@ -283,7 +283,7 @@ return $(element).closest("div.list").filter(function() { return this.id == self.div.id;}).length > 0; -} +}; /** * Recalculates this.valid and calls mmsrValidateHook on the form (if there is a form) */ @@ -324,7 +324,7 @@ $(this.form).trigger("mmsrValidateHook", [self, totalValid, totalReason, self.form]); } else { } -} +}; List.prototype.log = function(msg) { if (this.logEnabled) { @@ -353,7 +353,7 @@ } else { return $(parent).find("not(.list").find(elname + "." + clazz); } -} +}; /** * This methods does not find anything in _nested_ lists. @@ -410,7 +410,7 @@ } } return $(result); -} +}; @@ -429,7 +429,7 @@ this.tabIndex = i; i++; }); -} +}; List.prototype.bindCreate = function(a) { @@ -455,7 +455,7 @@ }); return false; }); -} +}; /** * Adds an item to the list. This item can be found using a searcher, or created using the create button. @@ -515,17 +515,17 @@ list.executeCallBack("create", r); // I think this may be deprecated. Custom events are nicer $(list.div).trigger("mmsrCreated", [r]); // like this. -} +}; List.prototype.incSize = function() { this.cursize++; this.checkForSize(); -} +}; List.prototype.decSize = function() { this.cursize--; this.checkForSize(); -} +}; /** @@ -549,19 +549,19 @@ } }); return $(result); -} +}; List.prototype.sizeValid = function() { return this.cursize <= this.max && this.cursize >= this.min; -} +}; List.prototype.setValidInForm = function() { if (this.form != null) { var validationValid = this.validator.invalidElements == 0; this.form.valids[this.rid] = validationValid; } -} +}; /** * Arrange some stuff after the change of list changed. @@ -600,7 +600,7 @@ }); this.triggerValidateHook(); -} +}; /** @@ -647,7 +647,7 @@ return false; }); -} +}; List.prototype.executeCallBack = function(type, element) { if (this.callBack != null) { @@ -655,13 +655,13 @@ } else { } -} +}; List.prototype.needsCommit = function() { //console.log("lch " + this.lastChange + " lc: " + this.lastCommit); return this.lastCommit.getTime() < this.lastChange.getTime(); -} +}; List.prototype.status = function(message, fadeout) { this.find("status", "span").each(function() { @@ -674,18 +674,18 @@ $(this).fadeTo(4000, 0.1, function() { $(p).empty(); $(p).append(p.originalTextContent); } ); } }); -} +}; List.prototype.loader = function() { this.status("<img class='loader icon' src='${mm:link('/mmbase/style/ajax-loader.gif')}' />"); -} +}; List.prototype.getListParameters = function() { var params = {}; params.rid = this.rid; return params; -} +}; /** @@ -783,7 +783,7 @@ } return result; -} +}; /** * All registered 'rid's as a comma seperated list, probably for use as an url parameter. @@ -798,7 +798,7 @@ rids += r; } return rids; -} +}; /** @@ -820,7 +820,7 @@ requestids += r; } return requestids; -} +}; List.prototype.allInstancesLeftPage = function() { for (r in List.prototype.instances) { @@ -829,7 +829,7 @@ } } return true; -} +}; List.prototype.leavePage = function() { $(self.div).trigger("mmsrLeavePage", [self]); @@ -842,7 +842,7 @@ $.ajax({ type: "GET", async: false, data: params, url: "${mm:link('/mmbase/searchrelate/list/leavePage.jspx')}" }); } $(self.div).trigger("mmsrAfterLeavePage", [self]); -} +}; @@ -863,7 +863,7 @@ order += self.getNodeForLi(this); }); return order; -} +}; @@ -884,7 +884,7 @@ }); //console.log(order); -} +}; List.prototype.relate = function(event, relate, relater) { var list = this; @@ -906,7 +906,7 @@ } }); -} +}; /** @@ -918,7 +918,7 @@ } catch (ex) { this.log(ex); } -} +}; /** @@ -932,7 +932,7 @@ return null; } -} +}; /** * The 'original' position of an item in a list - so the position before the user made any changes - is stored in a css @@ -948,8 +948,8 @@ } } // No original position found? That's an error. - alert(li); -} + throw("No original position found for " + $(li).text()); +}; List.prototype.afterPost = function() { this.log("posted!" + this.order); @@ -1000,7 +1000,7 @@ //console.log("No need to save order for " + self.rid + " " + order + " " + originalOrder); } } -} +}; /** * The method is meant to be used in the 'setup' configuration handler ot tinyMCE. @@ -1024,7 +1024,7 @@ prev.empty().append(textarea.val()); prev.css("display", "inline-block"); - } + }; // called on entrance of an editor. // removes the possibly previous active editor, and set activeEditor var activate = function(ed) { @@ -1034,7 +1034,7 @@ activeEditor = ed; } - } + }; // tinyMCE does not provide an actual blur event. // It is emulated by 'mousedown' on the entire page to detect blur @@ -1058,7 +1058,7 @@ //This triggers MMBaseValidator $("#" + ed.editorId).trigger("paste"); }); -} +}; /** * Binds the events to a text-area to make it editable via tinyMCE. @@ -1079,6 +1079,8 @@ self.tinymce(tinyMceConfiguration); }); - } + }; +/* </mm:content> </fmt:bundle> +*/ \ No newline at end of file _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs