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 ui method. * * @return void * * @since 3.1 */ public function testUi() { // Initialise the Bootstrap JS framework JHtmlJquery::ui(array('core', 'sortable')); // Get the document instance $document = JFactory::getDocument(); $this->assertArrayHasKey('/media/jui/js/jquery.min.js', $document->_scripts, 'Verify that the jQuery JS is loaded as well'); $this->assertArrayHasKey('/media/jui/js/jquery.ui.sortable.min.js', $document->_scripts, 'Verify that the jQueryUI sortable script 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; }
/** * ui * * @param array $components * * @return void */ public static function ui(array $components) { static::core(); $asset = static::getAsset(); if (!static::inited(__METHOD__)) { \JHtmlJquery::ui(); } if (!static::inited(__METHOD__, func_get_args())) { $allowedComponents = array('draggable', 'droppable', 'resizable', 'selectable', 'effect'); foreach ((array) $components as $component) { if (in_array($component, $allowedComponents)) { $asset->addJS('jquery/jquery.ui.' . $component . '.min.js'); } } } }
/** * Method to load the jQuery UI JavaScript framework into the document head * * If debugging mode is on an uncompressed version of jQuery UI is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return AssetManager Return self to support chaining. */ public function jqueryUI($debug = null) { \JHtmlJquery::ui(array('core'), $debug); return $this; }
<?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