summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-06 15:26:13 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-06 15:26:13 -0400
commit932d1fb7ce06081c788ea088171fd69ef03cd394 (patch)
treebfcf28ea8ecb27ad028e6e97a8ff5aa339bb338b
parent380c48662673d64214e64766f38014c6057d3142 (diff)
Move inline javascript to a separate js file
-rw-r--r--plugins/InfiniteScroll/InfiniteScrollPlugin.php18
-rw-r--r--plugins/InfiniteScroll/infinitescroll.js12
2 files changed, 13 insertions, 17 deletions
diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
index 7e942550a..1e4a03e4f 100644
--- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php
+++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
@@ -41,22 +41,6 @@ class InfiniteScrollPlugin extends Plugin
function onEndShowScripts($action)
{
$action->script('plugins/InfiniteScroll/jquery.infinitescroll.min.js');
- $loading_image = common_path('plugins/InfiniteScroll/ajax-loader.gif');
- $js_string = <<<EOT
-<script type="text/javascript">
-jQuery(document).ready(function($){
- $('notices_primary').infinitescroll({
- nextSelector : "li.nav_next a",
- loadingImg : "$loading_image",
- text : "<em>Loading the next set of posts...</em>",
- donetext : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
- navSelector : "div.pagination",
- contentSelector : "#notices_primary",
- itemSelector : "ol.notices"
- });
-});
-</script>
-EOT;
- $action->raw($js_string);
+ $action->script('plugins/InfiniteScroll/infinitescroll.js');
}
}
diff --git a/plugins/InfiniteScroll/infinitescroll.js b/plugins/InfiniteScroll/infinitescroll.js
new file mode 100644
index 000000000..b80bd4ec5
--- /dev/null
+++ b/plugins/InfiniteScroll/infinitescroll.js
@@ -0,0 +1,12 @@
+jQuery(document).ready(function($){
+ $('notices_primary').infinitescroll({
+ nextSelector : "li.nav_next a",
+ loadingImg : $('address .url')[0].href+'plugins/InfiniteScroll/ajax-loader.gif',
+ text : "<em>Loading the next set of posts...</em>",
+ donetext : "<em>Congratulations, you\'ve reached the end of the Internet.</em>",
+ navSelector : "div.pagination",
+ contentSelector : "#notices_primary",
+ itemSelector : "ol.notices"
+ });
+});
+