public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
        $id = TbArray::getValue('id', $this->htmlOptions, $this->getId());

        $jsFile = !empty($this->scales)
            ? 'jQAllRangeSliders-withRuler-min.js'
            : 'jQAllRangeSliders-min.js';

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $cs->registerCoreScript('jquery');
        $cs->registerCoreScript('jquery.ui');
        $this->getYiiWheels()->registerAssetJs('jquery.mousewheel.min.js', CClientScript::POS_HEAD);

        $cs->registerCssFile($assetsUrl . '/css/' . $this->theme . '.css');
        $cs->registerScriptFile($assetsUrl . '/js/' . $jsFile);

        $options = !empty($this->options) ? CJavaScript::encode($this->options) : '';

        $inputValSet = "$('#{$id}').val(data.values.min+','+data.values.max);";

        //inserting trigger
        if (isset($this->events['valuesChanged'])) {
            $orig = $this->events['valuesChanged'];
            if (strpos($orig, 'js:') === 0) {
                $orig = substr($orig, 3);
            }
            $orig = "\n($orig).apply(this, arguments);";
        } else {
            $orig = '';
        }
        $this->events['valuesChanged'] = "js: function(id, data) {
			$inputValSet $orig
		}";

        ob_start();
        echo "jQuery('#slider_{$id}').{$this->type}Slider({$options})";
        foreach ($this->events as $event => $handler) {
            echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
        }

        $cs->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
    }
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);
        $id = TbArray::getValue('id', $this->htmlOptions, $this->getId());

        $jsFile = !empty($this->scales)
            ? 'jQAllRangeSliders-withRuler-min.js'
            : 'jQAllRangeSliders-min.js';

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $cs->registerCoreScript('jquery');
        $cs->registerCoreScript('jquery.ui');
        $this->getYiiWheels()->registerAssetJs('jquery.mousewheel.min.js', CClientScript::POS_HEAD);

        $cs->registerCssFile($assetsUrl . '/css/' . $this->theme . '.css');
        $cs->registerScriptFile($assetsUrl . '/js/' . $jsFile);

        $options = !empty($this->options) ? CJavaScript::encode($this->options) : '';

        $inputValSet = "$('#{$id}').val(data.values.min+','+data.values.max);";

        //inserting trigger
        if (isset($this->events['valuesChanged'])) {
            $orig = $this->events['valuesChanged'];
            if (strpos($orig, 'js:') === 0) {
                $orig = substr($orig, 3);
            }
            $orig = "\n($orig).apply(this, arguments);";
        } else {
            $orig = '';
        }
        $this->events['valuesChanged'] = "js: function(id, data) {
			$inputValSet $orig
		}";

        ob_start();
        echo "jQuery('#slider_{$id}').{$this->type}Slider({$options})";
        foreach ($this->events as $event => $handler) {
            echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
        }

        $cs->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
    }
public function registerClientScript ( ) { /* publish assets dir */ $ path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'assets' ; $ assetsUrl = $ this -> getAssetsUrl ( $ path ) ; $ id = TbArray :: getValue ( 'id' , $ this -> htmlOptions , $ this -> getId ( ) ) ; $ jsFile = ! empty ( $ this -> scales ) ? 'jQAllRangeSliders-withRuler-min.js' : 'jQAllRangeSliders-min.js' ; /* @var $cs CClientScript */ $ cs = Yii :: app ( ) -> getClientScript ( ) ; $ cs -> registerCoreScript ( 'jquery' ) ; $ cs -> registerCoreScript ( 'jquery.ui' ) ; $ this -> getYiiWheels ( ) -> registerAssetJs ( 'jquery.mousewheel.min.js' , CClientScript :: POS_HEAD ) ; $ cs -> registerCssFile ( $ assetsUrl . '/css/' . $ this -> theme . '.css' ) ; $ cs -> registerScriptFile ( $ assetsUrl . '/js/' . $ jsFile ) ; $ options = ! empty ( $ this -> options ) ? CJavaScript :: encode ( $ this -> options ) : '' ; $ inputValSet = "$('#{$id}').val(data.values.min+','+data.values.max);" ; //inserting trigger if ( isset ( $ this -> events [ 'valuesChanged' ] ) ) { $ orig = $ this -> events [ 'valuesChanged' ] ; if ( strpos ( $ orig , 'js:' ) === 0 ) { $ orig = substr ( $ orig , 3 ) ; } $ orig = "\n($orig).apply(this, arguments);" ; } else { $ orig = '' ; } $ this -> events [ 'valuesChanged' ] = "js: function(id, data) {
			$inputValSet $orig
		}" ; ob_start ( ) ; echo "jQuery('#slider_{$id}').{$this->type}Slider({$options})" ; foreach ( $ this -> events as $ event => $ handler ) { echo ".on('{$event}', " . CJavaScript :: encode ( $ handler ) . ")" ; } $ cs -> registerScript ( __CLASS__ . '#' . $ this -> getId ( ) , ob_get_clean ( ) . ';' ) ; }
Registers required files and initialization script
Registers required files and initialization script