WME Data Store

Store objects when panning the map to compile lists for export (i.e. cities, places, segments, URs)

  1. // ==UserScript==
  2. // @name WME Data Store
  3. // @author davielde
  4. // @description Store objects when panning the map to compile lists for export (i.e. cities, places, segments, URs)
  5. // @include https://www.waze.com/editor/*
  6. // @include https://www.waze.com/*/editor/*
  7. // @include https://editor-beta.waze.com/*
  8. // @version 0.7.2
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/5252
  11. // ==/UserScript==
  12.  
  13.  
  14. function bootstrapDS()
  15. {
  16. var bGreasemonkeyServiceDefined = false;
  17. try {
  18. bGreasemonkeyServiceDefined = (typeof Components.interfaces.gmIGreasemonkeyService === "object");
  19. }
  20. catch (err) { /* Ignore */ }
  21. if (typeof unsafeWindow === "undefined" || ! bGreasemonkeyServiceDefined) {
  22. unsafeWindow = ( function () {
  23. var dummyElem = document.createElement('p');
  24. dummyElem.setAttribute('onclick', 'return window;');
  25. return dummyElem.onclick();
  26. }) ();
  27. }
  28. setTimeout(initializeDS, 2000);
  29.  
  30. }
  31.  
  32. function replaceCommas(commaString){
  33. var noCommaString = "";
  34. (commaString == null ? "" : noCommaString = commaString.replace(/,/g, '.')); //commas with period
  35. var fullyFilteredString = noCommaString.replace(/[\n\r]/g, ' '); //new lines and carriage returns with space
  36. return fullyFilteredString;
  37. }
  38.  
  39. function epsg900913to4326(init900913){
  40. var transformedTo4326 = init900913.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326"));
  41. return transformedTo4326;
  42. }
  43.  
  44. function prepURs(exportType,WDS_URLabel,WDS_editorCode,WDS_editorVersion){
  45. var center900913 = Waze.map.getCenter();
  46. var center4326 = epsg900913to4326(center900913);
  47. var urData = ['UpdateRequestID','Type','Severity','Open','Resolution','Comment',
  48. 'DriveDate','ResolvedDate','ResolvedTime','ResolvedByName','ResolvedByRank',
  49. //'Problem',
  50. 'Permalink'
  51. ];
  52. try{
  53. var currentURs = Waze.model.mapUpdateRequests.additionalInfo.clone();
  54. for(i=0; i<currentURs.length; i++)
  55. {
  56. var urResolution = '';
  57. var urID = currentURs[i].attributes.id;
  58. var urTypeText = currentURs[i].attributes.typeText;
  59. var urSeverity = currentURs[i].attributes.severity;
  60. var urOpen = currentURs[i].attributes.open;
  61. switch(currentURs[i].attributes.open){
  62. case true:
  63. urResolution = 'Open';
  64. break;
  65. case false:
  66. switch(currentURs[i].attributes.resolution){
  67. case 0:
  68. urResolution = 'Solved';
  69. break;
  70. case 1:
  71. urResolution = 'Not Identified';
  72. break;
  73. };
  74. break;
  75. };
  76. var urHasComments = currentURs[i].attributes.hasComments;
  77. var urDriveDateTime = new Date(parseInt(currentURs[i].attributes.driveDate));
  78. var urDriveDate = urDriveDateTime.toLocaleDateString();
  79. var urResolvedOn = new Date(parseInt(currentURs[i].attributes.resolvedOn));
  80. var urResolvedOnDate = ((currentURs[i].attributes.resolvedOn === null) ? null : urResolvedOn.toLocaleDateString());
  81. var urResolvedOnTime = ((currentURs[i].attributes.resolvedOn === null) ? null : urResolvedOn.toLocaleTimeString());
  82. var urResolvedByUserObj = ((currentURs[i].attributes.resolvedOn === null) ? null : Waze.model.users.get(currentURs[i].attributes.resolvedBy));
  83. var urResolvedByName = ((typeof urResolvedByUserObj == 'undefined' || urResolvedByUserObj == null) ? "" : replaceCommas(urResolvedByUserObj.userName));
  84. var urResolvedByRank = ((typeof urResolvedByUserObj == 'undefined' || urResolvedByUserObj == null) ? "" : urResolvedByUserObj.rank + 1);
  85. var urDescription = replaceCommas(currentURs[i].attributes.description);
  86. var urGeometry = new OpenLayers.Geometry.Point(currentURs[i].attributes.geometry.x,currentURs[i].attributes.geometry.y).transform(Waze.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));
  87. console.log(urGeometry);
  88. var urPermalink = WDS_editorVersion + '?env=' + WDS_editorCode + '&lon=' + urGeometry.x + '&lat=' + urGeometry.y +'&zoom=6&mapUpdateRequest=' + currentURs[i].attributes.id;
  89.  
  90. urData.push('\n'+urID,urTypeText,urSeverity,urOpen,urResolution,urHasComments,
  91. urDriveDate,urResolvedOnDate,urResolvedOnTime,urResolvedByName,urResolvedByRank,
  92. //urDescription,
  93. urPermalink
  94. );
  95. }
  96. if(exportType == 'csv'){
  97. $('#WDS_URs').each(function(){
  98. this.href = 'data:text/csv;base64,' + btoa(urData);
  99. this.download = 'URs_' + center4326.lon + '_' + center4326.lat + '.csv';
  100. });
  101. }
  102. }
  103. catch(e){
  104. console.log('WME Data Store: unable to process UR list, ' + e);
  105. }
  106. }
  107.  
  108. function prepCities(exportType,WDS_cityLabel,WDS_editorCode,WDS_editorVersion){
  109. var center900913 = Waze.map.getCenter();
  110. var center4326 = epsg900913to4326(center900913);
  111. var cityData = ['CountryID','Country','StateID','State','CityID',
  112. 'CityName','CityEnglishName','IsEmpty','Permalink'
  113. ];
  114. try{
  115. var currentCities = Waze.model.cities.additionalInfo.clone();
  116. for(i=0; i<currentCities.length; i++)
  117. {
  118. var stateObj = Waze.model.states.get(currentCities[i].stateID);
  119. var stateName = replaceCommas(stateObj.name);
  120. var countryObj = Waze.model.countries.get(currentCities[i].countryID);
  121. var countryName = replaceCommas(countryObj.name);
  122. var cityPermalink = WDS_editorVersion + '?env=' + WDS_editorCode + '&lon=' + center4326.lon + '&lat=' + center4326.lat +'&zoom=0';
  123.  
  124. cityData.push('\n'+currentCities[i].countryID,countryName,currentCities[i].stateID,stateName,
  125. currentCities[i].id,currentCities[i].name,currentCities[i].englishName,currentCities[i].isEmpty,cityPermalink
  126. );
  127. }
  128. if(exportType == 'csv'){
  129. $('#WDS_'+WDS_cityLabel).each(function(){
  130. this.href = 'data:text/csv;base64,' + btoa(cityData);
  131. this.download = WDS_cityLabel + '_' + center4326.lon + '_' + center4326.lat + '.csv';
  132. });
  133. }
  134. }
  135. catch(e){
  136. console.log('WME Data Store: unable to process city list, ' + e);
  137. }
  138. }
  139.  
  140. function prepVenues(exportType,WDS_venueLabel,WDS_editorCode,WDS_editorVersion){
  141. var center900913 = Waze.map.getCenter();
  142. var center4326 = epsg900913to4326(center900913);
  143. var venueImageBucketUrl = Waze.Config.venues.image_bucket_url;
  144. var venueData = ['PlaceID','PlaceName','FirstAltName','Brand','Lock','PrimaryCategory','Type','PublicOrPrivate','PlaceApproved',
  145. 'Description','Phone','Website','UpdateRequestCount','CountryName','StateName','CityName','StreetName','HouseNumber','NumHours','NumServices',
  146. 'CreateDate','CreatedByName','CreatedByRank','UpdateDate','UpdatedByName','UpdatedByRank','Permalink',
  147. 'ImageCount','PrimaryImageThumbnail','ImageApproved','ImageUserName','ImageUserRank','ImageDate'
  148. ];
  149. try{
  150. var currentVenues = Waze.model.venues.additionalInfo.clone();
  151. var wdsVenueDataObj = {};
  152. var wdsVenueDataArray = [];
  153. if(currentVenues.length>0){
  154. for(i=0; i<currentVenues.length; i++)
  155. {
  156. var venueType = '';
  157. var venueID = currentVenues[i].attributes.id;
  158. var venueName = ((typeof currentVenues[i].attributes.name == 'undefined' || currentVenues[i].attributes.name == null) ? "" :replaceCommas(currentVenues[i].attributes.name));
  159. if(currentVenues[i].attributes.geometry.CLASS_NAME == 'OpenLayers.Geometry.Point'){venueType = 'Point';}else{venueType = 'Area';}
  160. var venueLockRank = currentVenues[i].attributes.lockRank + 1;
  161. var venueApproved = currentVenues[i].attributes.approved;
  162. var venueDescription = ((typeof currentVenues[i].attributes.description == 'undefined' || currentVenues[i].attributes.description == null) ? "" : replaceCommas(currentVenues[i].attributes.description.substring(0,100))); //limit to 100 characters
  163. var venueUpdateRequest = ((currentVenues[i].attributes.venueUpdateRequests[0] == null) ? 0 : currentVenues[i].attributes.venueUpdateRequests.length);
  164. var venueBrand = currentVenues[i].attributes.brand;
  165. var venuePrimaryCategory = I18n.translations[I18n.locale].venues.categories[currentVenues[i].attributes.categories[0]];
  166. var venueResidential = ((currentVenues[i].attributes.residential == false) ? 'Public' : 'Private');
  167. var venuePhoneNumber = currentVenues[i].attributes.phone;
  168. var venueWebsite = currentVenues[i].attributes.url;
  169. var venueNumAlternateNames = currentVenues[i].attributes.aliases.length;
  170. var venueFirstAlternateName = currentVenues[i].attributes.aliases[0];
  171. var venueNumHours = currentVenues[i].attributes.openingHours.length;
  172. var venueNumServices = currentVenues[i].attributes.services.length;
  173. var venueAddressNumber = ((typeof currentVenues[i].attributes.houseNumber == 'undefined') ? "" : currentVenues[i].attributes.houseNumber);
  174. var venueStreetObj = ((typeof currentVenues[i].attributes.streetID == 'undefined' || currentVenues[i].attributes.streetID == null) ? "" : Waze.model.streets.get(currentVenues[i].attributes.streetID));
  175. var venueStreetName = ((typeof venueStreetObj == 'undefined' || currentVenues[i].attributes.streetID == null) ? "" : replaceCommas(venueStreetObj.name));
  176. var venueCityObj = ((venueStreetObj == null) ? null : Waze.model.cities.get(venueStreetObj.cityID));
  177. var venueCityName = ((typeof venueCityObj == 'undefined' || venueCityObj == null) ? "" : replaceCommas(venueCityObj.name));
  178. var venueStateObj = ((venueCityObj == null) ? null : Waze.model.states.get(venueCityObj.stateID));
  179. var venueStateName = ((typeof venueStateObj == 'undefined' || venueStateObj == null) ? "" : replaceCommas(venueStateObj.name));
  180. var venueCountryObj = ((venueStateObj == null) ? null : Waze.model.countries.get(venueCityObj.countryID));
  181. var venueCountryName = ((typeof venueCountryObj == 'undefined' || venueCountryObj == null) ? "" : replaceCommas(venueCountryObj.name));
  182. var venueCreatedOn = new Date(parseInt(currentVenues[i].attributes.createdOn));
  183. var venueCreatedOnDate = venueCreatedOn.toLocaleDateString();
  184. var venueCreatedOnTime = venueCreatedOn.toLocaleTimeString();
  185. var venueCreatedByUserObj = Waze.model.users.get(currentVenues[i].attributes.createdBy);
  186. var venueCreatedByName = ((typeof venueCreatedByUserObj == 'undefined' || venueCreatedByUserObj == null) ? "" : venueCreatedByUserObj.userName);
  187. var venueCreatedByRank = ((typeof venueCreatedByUserObj == 'undefined' || venueCreatedByUserObj == null) ? "" : venueCreatedByUserObj.rank + 1);
  188. var venueUpdatedOn = ((typeof currentVenues[i].attributes.updatedOn == 'undefined' || currentVenues[i].attributes.updatedOn == null) ? "" : new Date(parseInt(currentVenues[i].attributes.updatedOn)));
  189. var venueUpdatedOnDate = (venueUpdatedOn == "" ? "" : venueUpdatedOn.toLocaleDateString());
  190. var venueUpdatedOnTime = (venueUpdatedOn == "" ? "" : venueUpdatedOn.toLocaleTimeString());
  191. var venueUpdatedByUserObj = ((typeof currentVenues[i].attributes.updatedOn == 'undefined' || currentVenues[i].attributes.updatedOn == null) ? null : Waze.model.users.get(currentVenues[i].attributes.updatedBy));
  192. var venueUpdatedByName = ((typeof venueUpdatedByUserObj == 'undefined' || venueUpdatedByUserObj == null) ? "" : replaceCommas(venueUpdatedByUserObj.userName));
  193. var venueUpdatedByRank = ((typeof venueUpdatedByUserObj == 'undefined' || venueUpdatedByUserObj == null) ? "" : venueUpdatedByUserObj.rank + 1);
  194. var venueCentroid = epsg900913to4326(currentVenues[i].attributes.geometry.getCentroid());
  195. var venuePermalink = WDS_editorVersion + '?env=' + WDS_editorCode + '&lon=' + venueCentroid.x + '&lat=' + venueCentroid.y +'&zoom=6&venues=' + venueID;
  196. var venueImage = ((currentVenues[i].attributes.images[0] == null) ? 0 : currentVenues[i].attributes.images.length);
  197. var venuePrimaryImageID = ((currentVenues[i].attributes.images[0] == null) ? null : currentVenues[i].attributes.images[0].attributes.id);
  198. var venuePrimaryImageApproved = ((currentVenues[i].attributes.images[0] == null) ? null : currentVenues[i].attributes.images[0].attributes.approved);
  199. var venuePrimaryImageLink = ((currentVenues[i].attributes.images[0] == null) ? "" : venueImageBucketUrl + 'thumbs/thumb347_' + venuePrimaryImageID);
  200. var venuePrimaryImageUserObj = ((currentVenues[i].attributes.images[0] == null) ? null : Waze.model.users.get(currentVenues[i].attributes.images[0].attributes.creatorUserId));
  201. var venuePrimaryImageUserName = ((venuePrimaryImageUserObj == null) ? "" : replaceCommas(venuePrimaryImageUserObj.userName));
  202. var venuePrimaryImageUserRank = ((venuePrimaryImageUserObj == null) ? "" : venuePrimaryImageUserObj.rank + 1);
  203. var venuePrimaryImageDateTime = ((currentVenues[i].attributes.images[0] == null) ? "" : new Date(parseInt(currentVenues[i].attributes.images[0].attributes.date)));
  204. var venuePrimaryImageDate = (venuePrimaryImageDateTime == "" ? "" : venuePrimaryImageDateTime.toLocaleDateString());
  205. venueData.push('\n'+venueID,venueName,venueFirstAlternateName,venueBrand,venueLockRank,venuePrimaryCategory,venueType,venueResidential,venueApproved,
  206. venueDescription,venuePhoneNumber,venueWebsite,venueUpdateRequest,venueCountryName,venueStateName,venueCityName,venueStreetName,venueAddressNumber,venueNumHours,venueNumServices,
  207. venueCreatedOnDate,venueCreatedByName,venueCreatedByRank,venueUpdatedOnDate,venueUpdatedByName,venueUpdatedByRank,venuePermalink,
  208. venueImage,venuePrimaryImageLink,venuePrimaryImageApproved,venuePrimaryImageUserName,venuePrimaryImageUserRank,venuePrimaryImageDate
  209. );
  210. }
  211. if(exportType == 'csv'){
  212. $('#WDS_'+WDS_venueLabel).each(function(){
  213. this.href = 'data:text/csv;base64,' + btoa(venueData);
  214. this.download = WDS_venueLabel + '_' + center4326.lon + '_' + center4326.lat + '.csv';
  215. });
  216. }
  217. }
  218. }
  219. catch(e){
  220. console.log('WME Data Store: unable to process venue list, ' + e);
  221. }
  222. }
  223.  
  224. function prepSegments(exportType,WDS_segmentLabel,WDS_editorCode,WDS_editorVersion){
  225. var center900913 = Waze.map.getCenter();
  226. var center4326 = epsg900913to4326(center900913);
  227. var segmentData = ['SegmentID','CountryName','StateName','CityName','PrimaryStreetName','RoadType','RoadTypeName',
  228. 'FwdToll','ReverseToll','FwdDirection','ReverseDirection','Elevation','Rank','LengthInMeters','ClosureCount',
  229. 'CreateDate','CreatedByName','CreatedByRank','UpdateDate','UpdatedByName','UpdatedByRank','Permalink'
  230. ];
  231. if(Waze.map.zoom < 3){
  232. alert('WME Data Store: Zoom must increase to 3+ to load primary segments or 4+ to load all segments','WME Data Store');
  233. }
  234. else{
  235. try{
  236. var currentSegments = Waze.model.segments.additionalInfo.clone();
  237. var statsSegMaxUpdate = '';
  238. var statsDistinctEditors = {};
  239. var wdsSegmentDataObj = {};
  240. var wdsSegmentDataArray = [];
  241. if(currentSegments.length>0){
  242. for(i=0; i<currentSegments.length; i++)
  243. {
  244. var segmentID = currentSegments[i].attributes.id;
  245. var primaryStreetObj = Waze.model.streets.get(currentSegments[i].attributes.primaryStreetID);
  246. var primaryStreetName = ((typeof primaryStreetObj == 'undefined' || primaryStreetObj.name == null) ? "" : replaceCommas(primaryStreetObj.name));
  247. var segCityObj = ((primaryStreetObj == null) ? null : Waze.model.cities.get(primaryStreetObj.cityID));
  248. var segCityName = ((typeof segCityObj == 'undefined' || segCityObj.name == null) ? "" : replaceCommas(segCityObj.name));
  249. var segStateObj = ((segCityObj == null) ? null : Waze.model.states.get(segCityObj.stateID));
  250. var segStateName = ((typeof segStateObj == 'undefined' || segStateObj.name == null) ? "" : replaceCommas(segStateObj.name));
  251. var segCountryObj = ((segCityObj == null) ? null : Waze.model.countries.get(segCityObj.countryID));
  252. var segCountryName = ((typeof segCountryObj == 'undefined' || segCountryObj.name == null) ? "" : replaceCommas(segCountryObj.name));
  253. var segRoadType = currentSegments[i].attributes.roadType;
  254. var segRoadTypeName = I18n.translations[I18n.locale].segment.road_types[segRoadType];
  255. var segCreatedOn = new Date(parseInt(currentSegments[i].attributes.createdOn));
  256. var segCreatedOnDate = segCreatedOn.toLocaleDateString();
  257. var segCreatedOnTime = segCreatedOn.toLocaleTimeString();
  258. var segCreatedByUserObj = Waze.model.users.get(currentSegments[i].attributes.createdBy);
  259. var segCreatedByName = ((segCreatedByUserObj == null) ? "" : replaceCommas(segCreatedByUserObj.userName));
  260. var segCreatedByRank = ((segCreatedByUserObj == null) ? "" : segCreatedByUserObj.rank + 1);
  261. var segUpdatedOn = ((currentSegments[i].attributes.updatedOn == null) ? "" : new Date(parseInt(currentSegments[i].attributes.updatedOn))); //segments with no updates will throw errors
  262. var segUpdatedOnDate = (segUpdatedOn == "" ? "" : segUpdatedOn.toLocaleDateString());
  263. var segUpdatedOnTime = (segUpdatedOn == "" ? "" : segUpdatedOn.toLocaleTimeString());
  264. var segUpdatedByUserObj = ((currentSegments[i].attributes.updatedOn == null) ? "" : Waze.model.users.get(currentSegments[i].attributes.updatedBy));
  265. var segUpdatedByName = ((segUpdatedByUserObj == "") ? "" : replaceCommas(segUpdatedByUserObj.userName));
  266. var segUpdatedByRank = ((currentSegments[i].attributes.updatedOn == null) ? "" : segUpdatedByUserObj.rank + 1);
  267. var segFwdToll = currentSegments[i].attributes.fwdToll;
  268. var segRevToll = currentSegments[i].attributes.revToll;
  269. var segFwdDirection = currentSegments[i].attributes.fwdDirection;
  270. var segRevDirection = currentSegments[i].attributes.revDirection;
  271. var segElevation = currentSegments[i].attributes.level;
  272. var segRank = currentSegments[i].attributes.lockRank + 1;
  273. var segLength = currentSegments[i].attributes.length;
  274. var segClosures = currentSegments[i].attributes.closuresCount;
  275. var segCentroid = epsg900913to4326(currentSegments[i].geometry.getCentroid());
  276. var segPermalink = WDS_editorVersion + '?env=' + WDS_editorCode + '&lon=' + segCentroid.x + '&lat=' + segCentroid.y +'&zoom=5&segments=' + segmentID;
  277. segmentData.push('\n'+segmentID,segCountryName,segStateName,segCityName,primaryStreetName,segRoadType,segRoadTypeName,
  278. segFwdToll,segRevToll,segFwdDirection,segRevDirection,segElevation,segRank,segLength,segClosures,
  279. segCreatedOnDate,segCreatedByName,segCreatedByRank,segUpdatedOnDate,segUpdatedByName,segUpdatedByRank,segPermalink
  280. );
  281. }
  282. if(exportType == 'csv'){
  283. $('#WDS_'+WDS_segmentLabel).each(function(){
  284. this.href = 'data:text/csv;base64,' + btoa(segmentData);
  285. this.download = WDS_segmentLabel + '_' + center4326.lon + '_' + center4326.lat + '.csv';
  286. });
  287. }
  288. }
  289. }
  290. catch(e){
  291. console.log('WME Data Store: unable to process segment list, ' + e);
  292. }
  293. }
  294. }
  295.  
  296.  
  297. function initializeDS(){
  298.  
  299. var WDS_cityLabel = I18n.translations[I18n.locale].layers.name.cities;
  300. var WDS_venueLabel = I18n.translations[I18n.locale].layers.name.landmarks;
  301. var WDS_segmentLabel = I18n.translations[I18n.locale].layers.name.segments;
  302. var WDS_urLabel = I18n.translations[I18n.locale].layers.name.update_requests;
  303. var WDS_editorCode = Waze.location.code;
  304. var WDS_editorVersion = '';
  305.  
  306. if(I18n.locale == 'en' && Waze.Config.api_base == "/Descartes-beta/app"){
  307. WDS_editorVersion = 'https://editor-beta.waze.com/editor/';
  308. }
  309. else if(I18n.locale == 'en'){
  310. WDS_editorVersion = 'https://www.waze.com/editor/';
  311. }
  312. else if(Waze.Config.api_base == "/Descartes-beta/app"){
  313. WDS_editorVersion = 'https://editor-beta.waze.com/' + I18n.locale + '/editor/';
  314. }
  315. else{
  316. WDS_editorVersion = 'https://www.waze.com/' + I18n.locale + '/editor/';
  317. }
  318. //WDS artifacts
  319. $(document.body).append('<div id="WDS_menu"/>');
  320. $('#WDS_menu').css({
  321. position:'absolute',
  322. bottom:'35px',
  323. left:'425px',
  324. text:'white',
  325. backgroundColor:'transparent',
  326. borderWidth:'2px',
  327. borderStyle:'groove',
  328. boxShadow:'1px 1px 1px Grey',
  329. padding:'1px',
  330. color:'#F8F8F8'
  331. });
  332. $('#WDS_menu').append('<img id="WDS_icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAhCAYAAABa+rIoAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJ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3upbx5HfQSeEvQV6eno20InztVmtKaRvobSuIUb23m9Lr0J/EtZsKnwv0uXT/e79NkP9f2jmhlrw/9Q7Mr7+z3gPtdYjDe4fchU8ZIQ6BUwAAAAASUVORK5CYII=" />');
  333. $('#WDS_menu').append('<a id="WDS_' + WDS_cityLabel + '" download="" href=""/>');
  334. $('#WDS_menu').append('<a id="WDS_' + WDS_venueLabel + '"/>');
  335. $('#WDS_menu').append('<a id="WDS_' + WDS_segmentLabel + '"/>');
  336. $('#WDS_menu').append('<a id="WDS_URs"/>');
  337. $('#WDS_'+WDS_cityLabel).text(WDS_cityLabel+' ').css({color:'#F8F8F8',cursor:'pointer'});
  338. $('#WDS_'+WDS_venueLabel).text(WDS_venueLabel+' ').css({color:'#F8F8F8',cursor:'pointer'});
  339. $('#WDS_'+WDS_segmentLabel).text(WDS_segmentLabel+' ').css({color:'#F8F8F8',cursor:'pointer'});
  340. $('#WDS_URs').text('URs'+' ').css({color:'#F8F8F8',cursor:'pointer'});
  341. $('#WDS_'+WDS_cityLabel).click(function(){
  342. prepCities('csv',WDS_cityLabel,WDS_editorCode,WDS_editorVersion);
  343. });
  344. $('#WDS_'+WDS_venueLabel).click(function(){
  345. prepVenues('csv',WDS_venueLabel,WDS_editorCode,WDS_editorVersion);
  346. });
  347. $('#WDS_'+WDS_segmentLabel).click(function(){
  348. prepSegments('csv',WDS_segmentLabel,WDS_editorCode,WDS_editorVersion);
  349. });
  350. $('#WDS_URs').click(function(){
  351. prepURs('csv',WDS_urLabel,WDS_editorCode,WDS_editorVersion);
  352. });
  353.  
  354. console.log('WME Data Store: ready');
  355.  
  356. }
  357.  
  358. bootstrapDS();