[Mapbender-commits] r10331 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Nov 16 03:31:15 PST 2019


Author: armin11
Date: 2019-11-16 03:31:15 -0800 (Sat, 16 Nov 2019)
New Revision: 10331

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.js
Log:
Allow external invocation of loadwmc js module.

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2019-11-16 11:29:38 UTC (rev 10330)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2019-11-16 11:31:15 UTC (rev 10331)
@@ -213,6 +213,7 @@
 	};
 
 	this.hide = function () {
+
 		if($wmcPopup && $wmcPopup.size() > 0) {
 			$wmcPopup.dialog('destroy');
 			$wmcPopup.remove();
@@ -219,7 +220,7 @@
 		}
 		that.hideDependendWindows();
 	};
-
+//TODO: try to allocate invoking dialog, if the wmc loader is integrated in some dialog created by mb_button.js and destroy it!
 	this.hideDependendWindows = function () {
 		that.hideWmcXml();
 		that.hideOpenLayers();
@@ -478,7 +479,7 @@
 	 * args.parameters
 	 * args.message
 	 */
-	var executeJavaScript = function (args) {
+	this.executeJavaScript = function (args) {
 		var req = new Mapbender.Ajax.Request({
 			url: serverSideFileName,
 			method: args.method,
@@ -492,6 +493,7 @@
 					if (args.method === "deleteWmc" || args.method === "setWMCPublic"){
 						return;
 					}
+					//things that have been done to load wmc
 					if (obj.javascript && typeof(obj.javascript) == "object") {
 						for (var j = 0; j < obj.javascript.length; j++) {
 							//TODO: prohibit multiple maprequests when load wmc, cause on maprequests the wmc maybe stored to session :-(
@@ -547,11 +549,11 @@
 	var loadMergeAppendCallback = function(args){
 		if (constraintCheckRequired()) {
 			checkConstraints(args, function(args){
-				executeJavaScript(args);
+				that.executeJavaScript(args);
 			});
 			return;
 		}
-		executeJavaScript(args);
+		that.executeJavaScript(args);
 	};
 
 	var createTableCell = function (args, callback) {
@@ -664,7 +666,7 @@
 					id: wmc.id
 				}
 			}),
-			executeJavaScript
+			that.executeJavaScript
 		);
 	};
 
@@ -728,7 +730,7 @@
 			}),
 			function(args){
 				if (!wmc.disabled && confirm(Mapbender.sprintf(translatedI18nObject.confirmDelete, wmc.title))) {
-					executeJavaScript(args);
+					that.executeJavaScript(args);
 					var aPos = wmcTable.fnGetPosition($deleteTd.get(0));
 					wmcTable.fnDeleteRow(aPos[0]);
 				}
@@ -842,7 +844,7 @@
 						new Mb_exception(message);
 						alert(message);
 					}
-					executeJavaScript({
+					that.executeJavaScript({
 						method: "loadWmcFromFile",
 						parameters: {
 							filename: filename,



More information about the Mapbender_commits mailing list