<commit_before><?php
/***********************************************************
  ..

  Reference:
  http://agiletoolkit.org/doc/ref

==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
=====================================================ATK4=*/
class Form_Field_Slider extends Form_Field_Number {
    public $min = 0;
    public $max = 10;
    public $step = 1;
    public $left = 'Min';
    public $right = 'Max';
    
    function setStep($n){
        $this->step = $n;
        return $this;
    }
    function setLabels($left,$right){
        $this->left = $left;
        $this->right = $right;
        return $this;
    }
    function getInput(){
        $s = $this->name.'_slider';
        $this->js(true)->_selector('#'.$s)->slider(array(
                    'min' => $this->min,
                    'max' => $this->max,
                    'step' => $this->step,
                    'value' => $this->js()->val(),
                    'change' => $this->js()->_enclose()->val(
                        $this->js()->_selector('#'.$s)->slider('value')
                        )->change()
                    ));
        $this->setAttr('style','display: none');
        
        return '<table width="100%" border="0"><tr>'.
            '<td align="left">'.$this->left.'</td>'.
            '<td align="right">'.$this->right.'</td>'.
            '</tr><tr>'.
            '<td colspan=2>'.parent::getInput().'<div id="'.$s.'"></div></td>'.
            '</tr></table>';
    }
}<commit_msg>Use ATK styles for slider<commit_after><?php
/***********************************************************
  ..

  Reference:
  http://agiletoolkit.org/doc/ref

==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
=====================================================ATK4=*/
class Form_Field_Slider extends Form_Field_Number {
    public $min = 0;
    public $max = 10;
    public $step = 1;
    public $left = 'Min';
    public $right = 'Max';

    function setStep($n){
        $this->step = $n;
        return $this;
    }
    function setLabels($left,$right){
        $this->left = $left;
        $this->right = $right;
        return $this;
    }
    function getInput(){
        $s = $this->name.'_slider';
        $this->js(true)->_selector('#'.$s)->slider(array(
                    'min' => $this->min,
                    'max' => $this->max,
                    'step' => $this->step,
                    'value' => $this->js()->val(),
                    'change' => $this->js()->_enclose()->val(
                        $this->js()->_selector('#'.$s)->slider('value')
                        )->change()
                    ));
        $this->setAttr('style','display: none');

        return '<div class="atk-cells"><div class="atk-cell atk-align-left">'.
            $this->left.'</div>'.
            '<div class="atk-cell atk-align-right">'.$this->right.'</div>'.
            '</div>'.
            ''.parent::getInput().'<div id="'.$s.'"></div>'.
            '';
    }
}
{'fraction_non_alphanumeric': 0.2663230240549828, 'fraction_numerical': 0.010595647193585338, 'mean_word_length': 2.074823943661972, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4860182', 'n_tokens_mistral': 1039, 'n_tokens_neox': 992, 'n_words': 207}