/** * Register asset files for the template admin * * @return void */ public function registerAssets() { // Load required asset files for Joomla 2.5 if (version_compare($this->version->getShortVersion(), '3.0', '<')) { $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery/jquery-1.8.2.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/bootstrap/css/bootstrap.min.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/bootstrap/js/bootstrap.min.js'); } elseif (version_compare($this->version->getShortVersion(), '3.2', '>=')) { $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery/jquery-1.8.2.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/bootstrap/css/bootstrap.min.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/bootstrap/js/bootstrap.min.js'); } //$this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css'); //$this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-ui/js/jquery-ui-1.9.1.custom.min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-ui/css/ui-bootstrap-1.10.0/jquery-ui-1.10.0.custom.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-ui/js/jquery-ui-1.10.4.custom.min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-dynatree/skin/ui.dynatree.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-dynatree/jquery.dynatree.min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-tipsy/tipsy.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-tipsy/jquery.tipsy.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/chosen/chosen.min.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/chosen/chosen.jquery.min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/bxslider/jquery.bxslider.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/bxslider/jquery.bxslider.min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/colorbox/colorbox.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/colorbox/jquery.colorbox-min.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/font-icomoon/css/icomoon.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-layout/jquery.layout.min.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-ck/jquery.ck.js'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-gui.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-admin.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-fonticomoon.css'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/media.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/sample-data.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/update.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/upgrade.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/quickstart.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/core.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/font.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/layout.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/maintenance.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/social-integration.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/validate.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/width-type.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/modal.js'); $templateEdition = JSNTplHelper::getTemplateEdition($this->data->template); $jversion = new JVersion(); if (version_compare($jversion->getShortVersion(), "3.0", ">=")) { $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-megamenu-backend.css'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/megamenu/handle-settings.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/megamenu/handle.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/megamenu/layout.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/megamenu/megamenu.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/megamenu/placeholder.js'); } $templateName = JText::_($this->data->template); $this->doc->addScriptDeclaration("!function (\$) {\n\t\t\t\t\"use strict\";\n\n\t\t\t\t\$(function () {\n\t\t\t\t\tnew \$.JSNTPLFrameworkCore({\n\t\t\t\t\t\ttemplate: '{$this->data->template}',\n\t\t\t\t\t\ttemplateName: '{$templateName}',\n\t\t\t\t\t\tedition: '{$templateEdition}',\n\t\t\t\t\t\tstyleId : '{$this->data->id}'\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}(jQuery);"); }
/** * Attach css, javascript files to document * @return void */ private function _addAssets() { $this->_getDefaultStyles(); $file = dirname(__FILE__) . '/assets/js/supports/' . $this->_defaultStyles['admin']->template . '.js'; if (!is_file($file)) { return; } require_once JPATH_ADMINISTRATOR . '/components/com_poweradmin/helpers/poweradmin.php'; $currentVersion = PoweradminHelper::getVersion(); $config = $this->_getJSConfiguration(); $language = $this->_getJSLanguage(); $uri = JUri::root(true); $template = $this->_defaultStyles['admin']->template; $this->_document->addStyleSheet(JSN_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-bootstrap.css'); $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.css?v=' . $currentVersion); $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/window.css?v=' . $currentVersion); $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/print.css?v=' . $currentVersion, 'text/css', 'print'); if (in_array($template, array('minima', 'aplite'))) { $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.menu.css?v=' . $currentVersion); } if ($template == 'hathor') { $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.hathor.css?v=' . $currentVersion); } $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/jquery.noconflict.js?v=' . $currentVersion); if (file_exists('../media/system/js/mootools-core.js')) { $this->_document->addScript($uri . '/media/system/js/mootools-core.js'); $this->_document->addScript($uri . '/media/system/js/core.js'); $this->_document->addScript($uri . '/media/system/js/mootools-more.js'); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootool.conflict.js?v=' . $currentVersion); } else { JHtml::_('behavior.framework', true); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootool.conflict.js?v=' . $currentVersion); } $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootools/mooml.js?v=' . $currentVersion); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/scrollbar.js?v=' . $currentVersion); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/window.js?v=' . $currentVersion); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/supports/' . $template . '.js?v=' . $currentVersion); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/adminbar.js?v=' . $currentVersion); $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/history.js?v=' . $currentVersion); $this->_document->addScriptDeclaration("\n\t\t\tif (JoomlaShine === undefined) { var JoomlaShine = {}; }\n\t\t\tif (typeof(jQuery) !== 'undefined') { jQuery.noConflict(); }\n\n\t\t\tJoomlaShine.language = {$language};\n\t\t\twindow.addEvent('domready', function () {\n\t\t\t\tif(!document.getElementById('jsn-adminbar-wrapper')){\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tnew JSNAdminBar({$config});\n\t\t\t\t\t\t\tnew JSNHistory();\n\t\t\t\t\t\t}, 500);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t});\n\t\t"); }
/** * Register asset files for the template admin * * @return void */ public function registerAssets() { // Specified asset files for joomla 2.5 if (version_compare($this->version->getShortVersion(), '3.0', '<')) { $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/bootstrap/css/bootstrap.min.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery/jquery-1.8.2.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/bootstrap/js/bootstrap.min.js'); } $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-dynatree/skin/ui.dynatree.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/jquery-tipsy/tipsy.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/font-icomoon/css/icomoon.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/3rd-party/chosen/chosen.min.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-gui.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-admin.css'); $this->doc->addStyleSheet($this->baseAssetUrl . '/joomlashine/css/jsn-fonticomoon.css'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-ui/js/jquery-ui-1.9.1.custom.min.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-dynatree/jquery.dynatree.min.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-layout/jquery.layout.min.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-ck/jquery.ck.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/jquery-tipsy/jquery.tipsy.js'); $this->doc->addScript($this->baseAssetUrl . '/3rd-party/chosen/chosen.jquery.min.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/media.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/sample-data.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/update.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/upgrade.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/quickstart.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/core.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/font.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/layout.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/maintenance.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/social-integration.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/validate.js'); $this->doc->addScript($this->baseAssetUrl . '/joomlashine/js/width-type.js'); $templateEdition = JSNTplHelper::getTemplateEdition($this->data->template); $templateName = JText::_($this->data->template); $this->doc->addScriptDeclaration("\n\t\t\t!function (\$) {\n\t\t\t\t\"use strict\";\n\n\t\t\t\t\$(function () {\n\t\t\t\t\tnew \$.JSNTPLFrameworkCore({\n\t\t\t\t\t\ttemplate: '{$this->data->template}',\n\t\t\t\t\t\ttemplateName: '{$templateName}',\n\t\t\t\t\t\tedition: '{$templateEdition}',\n\t\t\t\t\t\tstyleId : '{$this->data->id}'\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}(jQuery);\n\t\t"); }
/** * @param string $js * * @return JDocument|null */ public function addInlineScript($js = '') { if (defined('GANTRY_FINALIZED')) { return $this->document; } return $this->document->addScriptDeclaration($js); }
/** * {@inheritdoc} */ public function jsCode($code) { $this->_doc->addScriptDeclaration($code); }
/** * Add script to document * @param string $script */ public function addScript($script) { if (!$this->app->jbrequest->isAjax()) { $this->_document->addScriptDeclaration("\n" . $script); } }