PageSourceSearch

https://stonemaiergames.com/wp-content/plugins/wp-google-maps/js/v…?ver=10.1.09%2Bpro-10.1.05

js stonemaiergames.com collected 2026-09-24 15:30:49 UTC 4,100 bytes, 180 lines download raw bytes

1/**
2 * @namespace WPGMZA
3 * @module AdminMarkerDataTable
4 * @requires WPGMZA.DataTable
5 */
6jQuery(function($) {
7	
8	WPGMZA.AdminMarkerDataTable = function(element)
9	{
10		var self = this;
11		
12		this.preventCaching = true;
13		
14		WPGMZA.DataTable.call(this, element);
15		
16		// NB: Pro marker panel currently manages edit marker buttons
17		
18		$(element).on("click", "[data-delete-marker-id]", function(event) {
19			self.onDeleteMarker(event);
20		});
21		
22		$(element).find(".wpgmza.select_all_markers").on("click", function(event) {
23			self.onSelectAll(event);
24		});
25		
26		$(element).find(".wpgmza.bulk_delete").on("click", function(event) {
27			self.onBulkDelete(event);
28		});
29
30		$(element).on("click", "[data-center-marker-id]", function(event) {
31			self.onCenterMarker(event);
32		});
33	}
34	
35	WPGMZA.AdminMarkerDataTable.prototype = Object.create(WPGMZA.DataTable.prototype);
36	WPGMZA.AdminMarkerDataTable.prototype.constructor = WPGMZA.AdminMarkerDataTable;
37	
38	WPGMZA.AdminMarkerDataTable.createInstance = function(element)
39	{
40		return new WPGMZA.AdminMarkerDataTable(element);
41	}
42	
43	WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings = function()
44	{
45		var self = this;
46		var options = WPGMZA.DataTable.prototype.getDataTableSettings.call(this);
47		
48		options.createdRow = function(row, data, index)
49		{
50			var meta = self.lastResponse.meta[index];
51			row.wpgmzaMarkerData = meta;
52		}
53		
54		return options;
55	}
56	
57	WPGMZA.AdminMarkerDataTable.prototype.onEditMarker = function(event)
58	{
59		WPGMZA.animatedScroll("#wpgmaps_tabs_markers");
60	}
61	
62	WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker = function(event)
63	{
64		var self	= this;
65		var id		= $(event.currentTarget).attr("data-delete-marker-id");
66		
67		var data	= {
68			action: 'delete_marker',
69			security: WPGMZA.legacyajaxnonce,
70			map_id: WPGMZA.mapEditPage.map.id,
71			marker_id: id
72		};
73		
74		$.post(ajaxurl, data, function(response) {
75			
76			WPGMZA.mapEditPage.map.removeMarkerByID(id);
77			self.reload();
78			
79		});
80	}
81	
82	// NB: Move this to UGM
83	WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker = function(event)
84	{
85		var self	= this;
86		var cur_id	= $(this).attr("id");
87		
88		var data = {
89			action:		'approve_marker',
90			security:	WPGMZA.legacyajaxnonce,
91			map_id:		WPGMZA.mapEditPage.map.id,
92			marker_id:	cur_id
93		};
94		$.post(ajaxurl, data, function (response) {
95			
96			
97			wpgmza_InitMap();
98			wpgmza_reinitialisetbl();
99
100		});
101	}
102	
103	WPGMZA.AdminMarkerDataTable.prototype.onSelectAll = function(event)
104	{
105		$(this.element).find("input[name='mark']").prop("checked", true);
106	}
107	
108	WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete = function(event)
109	{
110		var self = this;
111		var ids = [];
112		var map = WPGMZA.maps[0];
113		
114		$(this.element).find("input[name='mark']:checked").each(function(index, el) {
115			var row = $(el).closest("tr")[0];
116			ids.push(row.wpgmzaMarkerData.id);
117		});
118		
119		ids.forEach(function(marker_id) {
120			var marker = map.getMarkerByID(marker_id);
121			
122			if(marker)
123				map.removeMarker(marker);
124		});
125		
126		WPGMZA.restAPI.call("/markers/", {
127			method: "DELETE",
128			data: {
129				ids: ids
130			},
131			complete: function() {
132				self.reload();
133			}
134		});
135	}
136
137	WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker = function(event)
138	{
139		var id;
140
141		//Check if we have selected the center on marker button or called this function elsewhere 
142		if(event.currentTarget == undefined)
143		{
144			id = event;
145		}
146		else{
147			id = $(event.currentTarget).attr("data-center-marker-id");
148		}
149
150		var marker = WPGMZA.mapEditPage.map.getMarkerByID(id);
151		
152		if(marker){
153			var latLng = new WPGMZA.LatLng({
154				lat: marker.lat,
155				lng: marker.lng
156			});
157			
158			//Set a static zoom level
159			var zoom_value = 6;
160			WPGMZA.mapEditPage.map.setCenter(latLng);
161			WPGMZA.mapEditPage.map.setZoom(zoom_value);
162
163			if(WPGMZA.InternalEngine.isLegacy()){
164				/* Only applies to legacy */
165				WPGMZA.animateScroll("#wpgmaps_tabs_markers");
166			}
167		}
168
169
170	}
171	
172	/*$(document).ready(function(event) {
173		
174		$("[data-wpgmza-admin-marker-datatable]").each(function(index, el) {
175			WPGMZA.adminMarkerDataTable = WPGMZA.AdminMarkerDataTable.createInstance(el);
176		});
177		
178	});*/
179	
180});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.