<commit_before><?php
/**
 * Created by PhpStorm.
 * User: rutger
 * Date: 7/7/2015
 * Time: 16:50
 */

namespace MyCademy\BootstrapTour;


use yii\base\Widget;
use yii\helpers\Json;

class Tour extends Widget
{
    /**
     * @var string
     */
    public $name = 'tour';

    /**
     * @var string force the start of the tour
     */
    public $forceStart = false;

    /**
     * @var array the options for the underlying Bootstrap Tour JS plugin.
     * Please refer to the corresponding [Bootstrap Toor plugin API](http://bootstraptour.com/api/) for possible options.
     */
    public $clientOptions = [];

    /**
     * Renders the widget.
     */
    public function run()
    {
        $this->registerPlugin($this->name);
    }

    /**
     * Registers a specific Bootstrap plugin and the related events
     * @param string $name the name of the Bootstrap plugin
     */
    protected function registerPlugin($name)
    {
        $view = $this->getView();
        BootstrapTourPluginAsset::register($view);
        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
            $js = "var $name = new Tour($options);\n";
            $js .= "tour.init();\n";
            $js .= "tour.start({$this->forceStart});\n";
            $view->registerJs($js);
        }
        $this->registerClientEvents();
    }
}<commit_msg>Removed obsolete registerClientEvents call<commit_after><?php
/**
 * Created by PhpStorm.
 * User: rutger
 * Date: 7/7/2015
 * Time: 16:50
 */

namespace MyCademy\BootstrapTour;


use yii\base\Widget;
use yii\helpers\Json;

class Tour extends Widget
{
    /**
     * @var string
     */
    public $name = 'tour';

    /**
     * @var string force the start of the tour
     */
    public $forceStart = false;

    /**
     * @var array the options for the underlying Bootstrap Tour JS plugin.
     * Please refer to the corresponding [Bootstrap Toor plugin API](http://bootstraptour.com/api/) for possible options.
     */
    public $clientOptions = [];

    /**
     * Renders the widget.
     */
    public function run()
    {
        $this->registerPlugin($this->name);
    }

    /**
     * Registers a specific Bootstrap plugin and the related events
     * @param string $name the name of the Bootstrap plugin
     */
    protected function registerPlugin($name)
    {
        $view = $this->getView();
        BootstrapTourPluginAsset::register($view);
        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
            $js = "var $name = new Tour($options);\n";
            $js .= "tour.init();\n";
            $js .= "tour.start({$this->forceStart});\n";
            $view->registerJs($js);
        }
    }
}
{'fraction_non_alphanumeric': 0.14427157001414428, 'fraction_numerical': 0.007072135785007072, 'mean_word_length': 2.2819025522041763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '150024', 'n_tokens_mistral': 865, 'n_tokens_neox': 824, 'n_words': 220}