Esempio n. 1
0
 public static function load_script($module, $params)
 {
     $doc = JFactory::getDocument();
     // Set moduleid
     $module_id = XEFUtility::getModuleId($module, $params);
     // Load jQuery
     XEFUtility::addjQuery($module, $params);
     $animationMode = $params->get('animation_style') == 'animation_h' ? 'false' : 'true';
     $speed = (int) $params->get('animation_speed');
     $repeat = (int) $params->get('repeat') ? 'true' : 'false';
     $keyboardNav = (int) $params->get('keyboard_navigation') ? 'true' : 'false';
     //auto scroll plugin config
     $autoScroll = '';
     if ((int) $params->get('auto_play')) {
         $autoPlay = (int) $params->get('auto_play') ? 'true' : 'false';
         $interval = (int) $params->get('interval');
         $autoPause = (int) $params->get('auto_pause') ? 'true' : 'false';
         $autoScroll = ".autoscroll({ autoplay: {$autoPlay} , interval: {$interval}, autopause:{$autoPause} })";
     }
     //navigator plugin config
     $navigator = '';
     if ($params->get('navigator')) {
         $navigator = ".navigator()";
     }
     $js = "\n            jQuery(document).ready(function(){\n                jQuery('#{$module_id}').scrollable({\n                    vertical: {$animationMode},\n                    speed: {$speed},\n                    circular : {$repeat},\n                    keyboard: {$keyboardNav}\n                }){$autoScroll}{$navigator};\n            });\n        ";
     $doc->addScriptDeclaration($js);
     if (!defined('XPERT_SCROLLER')) {
         //add scroller js file
         $doc->addScript(JURI::root(true) . '/modules/mod_xpertscroller/assets/js/xpertscroller.js');
         $doc->addScript(JURI::root(true) . '/modules/mod_xpertscroller/assets/js/script.js');
         define('XPERT_SCROLLER', 1);
     }
 }
Esempio n. 2
0
 public static function loadScripts($module, $params)
 {
     $doc = JFactory::getDocument();
     // Set moduleid
     $module_id = XEFUtility::getModuleId($module, $params);
     // Load jQuery form framework
     XEFUtility::addjQuery($module, $params);
     $js = "jQuery(#{$module_id}).collapse();";
     //$doc->addScriptDeclaration($js);
     if (!defined('XPERT_ACCORDION')) {
         //add tab engine js file
         $doc->addScript(JURI::root(true) . '/modules/mod_xpertaccordion/assets/js/xpertaccordion.js');
         define('XPERT_ACCORDION', 1);
     }
 }