public static function include_jquery($extension = '', $framework = false, $relative = true) { if (version_compare(JVERSION, '3.0.0', '>=')) { JHtmlJquery::framework(); } else { $doc = JFactory::getDocument(); if (!isset($doc->jquery_loaded)) { if (JHtml::script('jquery.min.js', $framework, $relative, $pathonly = true)) { JHtml::script('jquery.min.js', $framework, $relative); JHtml::script('jquery.noconflict.js', $framework, $relative); $doc->jquery_loaded = true; return; } else { if (!empty($extension)) { $jquery = $extension . '/jquery.min.js'; $jqueryNC = $extension . '/jquery.noconflict.js'; // should be locate as jquery.min.js if (JHtml::script($jquery, $framework, $relative, $pathonly = true)) { JHtml::script($jquery, $framework, $relative); JHtml::script($jqueryNC, $framework, $relative); $doc->jquery_loaded = true; } } } } } }
/** * Tests the framework method. * * @return void * * @since 3.1 */ public function testFramework() { // Initialise the Bootstrap JS framework JHtmlJquery::framework(); // Get the document instance $document = JFactory::getDocument(); $this->assertArrayHasKey('/media/jui/js/jquery.min.js', $document->_scripts, 'Verify that the jQuery JS is loaded'); }
/** * Include Backbone. Note this library may not support old IE browser. * * Please see: http://backbonejs.org/ * * @param boolean $noConflict * * @return void */ public static function backbone($noConflict = false) { $asset = static::getAsset(); if (!static::inited(__METHOD__)) { // Dependency \JHtmlJquery::framework(true); static::underscore(); $asset->addJS('core/backbone.js'); } if (!static::inited(__METHOD__, (bool) $noConflict) && $noConflict) { $asset->internalJS('var backbone = Backbone.noConflict();'); } }
/** * Include Backbone. Note this library may not support old IE browser. * * Please see: http://backbonejs.org/ * * @param boolean $noConflict * * @return void */ public static function backbone($noConflict = false) { if (!empty(static::$initialised['backbone'])) { return; } // Dependency \JHtmlJquery::framework(true); static::underscore(); $asset = $asset = static::getHelper(); $asset->addJs('backbone.js'); if ($noConflict) { $asset->internalJS(';var backbone = Backbone.noConflict();'); } static::$initialised['backbone'] = true; }
/** * Method to load the jQuery JavaScript framework into the document head * * If debugging mode is on an uncompressed version of jQuery is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * @param boolean $migrate True to enable the jQuery Migrate plugin * * @return AssetManager Return self to support chaining. */ public function jquery($debug = null, $migrate = true) { \JHtmlJquery::framework(true, $debug, $migrate); return $this; }
/** * jquery * * @param boolean $noConflict * @param boolean $debug * @param boolean $migrate */ public static function core($noConflict = true, $debug = null, $migrate = true) { \JHtmlJquery::framework($noConflict, $debug, $migrate); }
<?php /** * @package Bookpro * @author Ngo Van Quan * @link http://joombooking.com * @copyright Copyright (C) 2011 - 2012 Ngo Van Quan * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html * @version $Id$ **/ defined('_JEXEC') or die('Restricted access'); JHtmlJquery::framework(); $config = JBFactory::getConfig(); AImporter::helper('tour', 'currency'); AImporter::js('footable'); AImporter::css('footable.core'); $total = 0; if (count($displayData) > 0) { ?> <script type="text/javascript"> jQuery(function () { jQuery('.footable').footable(); }); </script> <div class="box-heading"> <?php