public function theme_footer() { if ($this->has_spoilers) { // Load jQuery, if it's not already loaded if (!Stack::has('template_header_javascript', 'jquery')) { Stack::add('template_footer_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery', array('jquery')); } Stack::add('template_footer_javascript', URL::get_from_filesystem(__FILE__) . '/spoilers.js', 'spoilers', array('jquery')); Stack::add('template_stylesheet', array(URL::get_from_filesystem(__FILE__) . '/spoilers.css', 'screen'), 'spoilers', array()); } }
public function theme_footer($theme) { if (count(self::$handler_vars) === 0) { self::$handler_vars = Controller::get_handler_vars(); } // If 'slug' exists, then it must be single, don't do anything if (!isset(self::$handler_vars['slug'])) { // If jQuery is loaded in header, then do not load it again if (!Stack::has('template_header_javascript', 'jquery')) { Stack::add('template_footer_javascript', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', 'jquery'); } $params = new SuperGlobal($this->config); $params = $params->merge(self::$handler_vars); Stack::add('template_footer_javascript', URL::get('display_pageless_js', array('config' => md5(serialize($params)))), 'jquery.pageless', 'jquery'); } }