summaryrefslogtreecommitdiff
path: root/plugins/Mapstraction/map.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-04 14:31:19 -0500
committerEvan Prodromou <evan@status.net>2009-12-04 14:31:19 -0500
commita92228c713c73b4015766b45eecd4769a57ae232 (patch)
treeef9307bb35cb201c4b7561c991211fa6ca03516a /plugins/Mapstraction/map.php
parent2c07d4a530e2e8ea6a48f08806f5026df1132152 (diff)
Update Mapstraction to properly scrape data from notice-list pages
Refactored the JavaScript for Mapstraction use so it scrapes data from the HTML of the page it's on, if possible, and otherwise generates a JSON array.
Diffstat (limited to 'plugins/Mapstraction/map.php')
-rw-r--r--plugins/Mapstraction/map.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/Mapstraction/map.php b/plugins/Mapstraction/map.php
index 89723f43c..734e48088 100644
--- a/plugins/Mapstraction/map.php
+++ b/plugins/Mapstraction/map.php
@@ -128,12 +128,9 @@ class MapAction extends OwnerDesignAction
}
}
- $this->elementStart('script', array('type' => 'text/javascript'));
- $this->raw('/*<![CDATA[*/'); // XHTML compat for Safari
- $this->raw('var _notices = ' . json_encode($jsonArray).'; ');
- $this->raw('showMapstraction($("#map_canvas"),_notices);');
- $this->raw('/*]]>*/'); // XHTML compat for Safari
- $this->elementEnd('script');
+ $this->inlineScript('$(document).ready(function() { '.
+ ' var _notices = ' . json_encode($jsonArray).'; ' .
+ 'showMapstraction($("#map_canvas"), _notices); });');
return true;
}