/** * 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'); }
/** * 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; }