/** * Loads our namespaced jQuery, accessible through akeeba.jQuery */ public static function jQuery() { if (self::isCli()) { return; } $jQueryLoad = self::getPreference('jquery_load', 'auto'); if (!in_array($jQueryLoad, array('auto', 'full', 'namespace', 'none'))) { $jQueryLoad = 'auto'; } self::$_includedJQuery = true; if ($jQueryLoad == 'none') { return; } elseif ($jQueryLoad == 'auto') { if (version_compare(JVERSION, '3.0', 'gt')) { $jQueryLoad = 'namespace'; JHtml::_('jquery.framework'); } else { $jQueryLoad = 'full'; } } if ($jQueryLoad == 'full') { // Joomla! 2.5 and earlier, load our own library self::$scriptURLs[] = FOFTemplateUtils::parsePath('media://akeeba_strapper/js/akeebajq.js'); } else { self::$scriptURLs[] = FOFTemplateUtils::parsePath('media://akeeba_strapper/js/namespace.js'); } }
/** * Loads our namespaced jQuery, accessible through akeeba.jQuery */ public static function jQuery() { if (self::isCli()) { return; } // Load jQuery only once if (self::$_includedJQuery) { return; } $jQueryLoad = self::getPreference('jquery_load', 'auto'); if (!in_array($jQueryLoad, array('auto', 'full', 'namespace', 'none'))) { $jQueryLoad = 'auto'; } self::$_includedJQuery = true; if ($jQueryLoad == 'none') { return; } elseif ($jQueryLoad == 'auto') { if (version_compare(JVERSION, '3.0', 'gt')) { $jQueryLoad = 'namespace'; JHtml::_('jquery.framework'); } else { $jQueryLoad = 'full'; } } if ($jQueryLoad == 'full') { self::addJSfile('media://akeeba_strapper/js/akeebajq.js', AKEEBASTRAPPER_MEDIATAG); self::addJSfile('media://akeeba_strapper/js/akjqmigrate.js', AKEEBASTRAPPER_MEDIATAG); } else { self::addJSfile('media://akeeba_strapper/js/namespace.js', AKEEBASTRAPPER_MEDIATAG); } }