Author: michiel
Date: 2010-02-05 14:33:21 +0100 (Fri, 05 Feb 2010)
New Revision: 40876
Modified:
speeltuin/mihxil/portal/src/main/webapp/mmbase/portal/portal.js.jsp
Log:
added 'parameters' member which can e.g. be used in the mmpClosed event handler
to flush the right oscaches
Modified: speeltuin/mihxil/portal/src/main/webapp/mmbase/portal/portal.js.jsp
===================================================================
--- speeltuin/mihxil/portal/src/main/webapp/mmbase/portal/portal.js.jsp
2010-02-05 09:44:48 UTC (rev 40875)
+++ speeltuin/mihxil/portal/src/main/webapp/mmbase/portal/portal.js.jsp
2010-02-05 13:33:21 UTC (rev 40876)
@@ -11,6 +11,7 @@
this.root = root;
var self = this;
this.edits = 0;
+ this.parameters = {};
this.options = {
autoOpen: false,
modal: true,
@@ -22,8 +23,8 @@
}
}
$(document).ready(function() {
- self.init();
- });
+ self.init();
+ });
}
MMBasePortal.prototype.init = function() {
@@ -70,7 +71,9 @@
$(div).append(a);
$(a).click(function() {
try {
-
+ var index = this.href.indexOf('?');
+ var q = this.href.substring(index);
+ self.parameters = self.parseQueryString(q);
var ift = "<iframe class='mm_portal_iframe' src='" + this.href
+ "'> </iframe>";
var iframe = $(ift);
$("#mm_portal_edit").append(iframe);
@@ -97,6 +100,29 @@
}
+MMBasePortal.prototype.parseQueryString = function (location) {
+ if (location.indexOf("?") == 0) location = location.substring(1);
+ var result = {};
+ var split = location.split("&");
+ for (var i = 0; i < split.length; i++) {
+ var entry = split[i].split("=");
+ result[entry[0]] = entry[1];
+ }
+ return result;
+}
+MMBasePortal.prototype.joinQuery = function(query) {
+ var result = "";
+ for (var k in query) {
+ if (result.length == 0) {
+ result += "?";
+ } else {
+ result += "&";
+ }
+ result += k + "=" + query[k];
+ }
+ return result;
+}
+
</fmt:bundle>
</mm:content>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs