forked from GNUsocial/gnu-social
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user