RequireHelper::js()

@param mixed $name
@param bool $cdn
@return void
333294
public function js($name,$version = false) {
		$cdn = false;
		if ($name[0] === '>') {
			$name[0] = '';
			$name = trim($name);
			$cdn = true;		
		}
		if(strpos($name, '::')=== false){
			$name .='::';
		} 
		list($name,$ver) = explode('::',$name); 
		
		
		
		$name = call_user_func(RitaTools::libRepo($name),$cdn, $name[1]);
	
		pr($name);	
	
		//	return LibRepo::$name(RitaTools::inLocalhost(),$version);	
	}
95916
public function javascript($name, Closure $callback = null)
    {
        return $this->add($name, function($asset) use ($callback)
        {
            $asset->setGroup('javascripts');

            is_callable($callback) and call_user_func($callback, $asset);
        });
    }
641941
public function startAttribute($name, $value)
    {
        $this->checkStartAttribute($name);

        $this->json->{'_' . $name} = $value;
    }
180093
public function inlineScript($name, $source = null, $dependencies = [], $attributes = [], $replaces = [])
    {
        $this->register('inline', $name, $source, $dependencies, $attributes, $replaces);
    }
902439
public function addJs($name, $attributes = [])
    {
        if (is_array($name)) {
            $name = $this->combineAssets($name, $this->getLocalPath($this->assetPath));
        }

        $jsPath = $this->getAssetPath($name);

        if (isset($this->controller)) {
            $this->controller->addJs($jsPath, $attributes);
        }

        if (is_string($attributes)) {
            $attributes = ['build' => $attributes];
        }

        $jsPath = $this->getAssetScheme($jsPath);

        if (!in_array($jsPath, $this->assets['js'])) {
            $this->assets['js'][] = ['path' => $jsPath, 'attributes' => $attributes];
        }
    }
895703
public function outputJavascriptGlobal(string $name, array $data)
    {
        $output = "<script type=\"text/javascript\">\n\r";
        $output .= "/* <![CDATA[ */\n\r";
        $output .= "var {$name} = {\n\r";

        if (! empty($data) && is_array($data)) {
            foreach ($data as $key => $value) {
                $output .= $key.': '.json_encode($value).",\n\r";
            }
        }

        $output .= "};\n\r";
        $output .= "/* ]]> */\n\r";
        $output .= '</script>';

        return $output;
    }
124759
public function loadExtra($name)
    {
        $useCurrent = ZenValidator::config()->use_current;
        $parsleyFolder = 'parsley';
        if($useCurrent) {
            $parsleyFolder = 'parsley_current';
        }
        Requirements::javascript(ZENVALIDATOR_PATH . '/javascript/'.$parsleyFolder.'/extra/validator/' . $name . '.js');

        $lang = i18n::get_lang_from_locale(i18n::get_locale());
        Requirements::javascript(ZENVALIDATOR_PATH . '/javascript/'.$parsleyFolder.'/i18n/' . $lang . '.extra.js');
    }
1109342
private static function _boolean($data, $name)
    {
        $value = '';
        if ($data == false) {
            $value = "FALSE";
        } elseif ($data == true) {
            $value = "TRUE";
        }

        $html = '<li class="krumo-child">
            <div class="krumo-element" onMouseOver="krumo.over(this);" onMouseOut="krumo.out(this);">
            <a class="krumo-name">%s</a> <em class="krumo-type">Boolean</em>
            %s<strong class="krumo-boolean">%s</strong>
            </div></li>';

        $html = sprintf($html, $name, static::get_separator(), $value);

        echo $html;
    }
548141
public static function needed($include, $className = true)
    {
        if ($className && (class_exists($include, false) || interface_exists($include, false))) {
            return true;
        }

        self::fireEvent('Atomik::Needed', array(&$include, &$className, &$dirs));
        if ($include === null) {
            return false;
        }

        $includeDirs = (array) self::get('atomik.dirs.includes', array());
        if ($filename = self::resolveIncludePath($include, $includeDirs, $className)) {
            return include($filename);
        }
        return false;
    }
948545
public function addComponent($componentName): bool
    {
        if (is_array($componentName)) {
            foreach ($componentName as $cn) {
                $this->addComponent($cn);
            }

            return true;
        }
        $componentFile = 'app/components/' . Inflector::underscore($componentName) . '.js';

        if (file_exists(JS . DS . $componentFile)) {
            $this->_addDependency($componentFile);

            return true;
        }

        return false;
    }
1179
public function registerHelper($name, $helper = false)
    {
        if (is_array($name)) {
            foreach ($name as $n => $helper) {
                $this->registerHelper($n, $helper);
            }
        } elseif (is_object($name)) {
            $this->registerJavascriptObject('helper', $this->wrapHelperObject($name));
        } elseif ($helper === false) {
            $this->registerJavascriptObject('helper', $name);
        } elseif (is_callable($helper)) {
            $this->registerJavascriptFunction('helper', $name, $this->wrapHelperCallable($name, $helper));
        } else {
            $this->registerJavascriptFunction('helper', $name, $helper);
        }
    }
565704
public function addOption($name, $defaultValue, $necessary=false){
		$this->defValues[$name] = $defaultValue;
		if($necessary)
			$this->necessary[$name] = true;
	}
1373117
public function build($name = null, array $attributes = [], $callback = null)
    {
        if (!isset($attributes['response-container'])) {
            array_set($attributes, 'response-container', 'test-response');
        }
        if (!isset($attributes['form-container'])) {
            array_set($attributes, 'form-container', 'tester-form');
        }
        $script    = is_null($name) ? 'round' : $name;
        $container = app('antares.asset')->container('antares/foundation::scripts');
        $container->inlineScript($script, $this->generateScripts($attributes));
        if ($callback instanceof Closure) {
            call_user_func($callback, $container);
        }
    }
519396
function enable(string $name) {
        if (!isset($this->_formulaList[$name])) {
            Console::warning("Formula \"$name\" do not exist.");
            return;
        }
        $this->_enableList = $this->_enableList + [$name];
    }
1036377
protected function registerPlugin($name)
    {
        $view = $this->getView();

        BootstrapPluginAsset::register($view);

        $id = $this->options['id'];

        $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
        $js = "jQuery('#$id').$name($options);";
        $view->registerJs($js);
    }
206127
public function enable($name)
    {
        if ($this->isEnabled($name)) {
            return;
        }

        $extension = $this->getExtension($name);

        $this->dispatcher->dispatch(new Enabling($extension));

        $enabled = $this->getEnabled();

        $enabled[] = $name;

        $this->migrate($extension);

        $this->publishAssets($extension);

        $this->setEnabled($enabled);

        $extension->enable($this->app);

        $this->dispatcher->dispatch(new Enabled($extension));
    }
402976
private function checkIncludeJavascript() {
        $request = $this->requestStack->getCurrentRequest();
        $rtn = !$request->attributes->has($this::JS_INCLUDE_KEY);
        if (!$rtn) {
            $request->attributes->set($this::JS_INCLUDE_KEY, true);
        }
        return $rtn;
    }