. * * @category Plugin * @package Laconica * @author Craig Andrews * @copyright 2009 Craig Andrews http://candrews.integralblue.com * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/ */ if (!defined('LACONICA')) { exit(1); } class InfiniteScrollPlugin extends Plugin { function __construct() { parent::__construct(); } function onEndShowScripts($action) { $action->script('plugins/InfiniteScroll/jquery.infinitescroll.min.js'); $loading_image = common_path('plugins/InfiniteScroll/ajax-loader.gif'); $js_string = << jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ nextSelector : "li.nav_next a", loadingImg : "$loading_image", text : "Loading the next set of posts...", donetext : "Congratulations, you\'ve reached the end of the Internet.", navSelector : "div.pagination", contentSelector : "#notices_primary", itemSelector : "ol.notices" }); }); EOT; $action->raw($js_string); } }