Add js or get all js.

@param null $js

@return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
343262
public static function js($js = null)
    {
        if (!is_null($js)) {
            return self::$js = array_merge(self::$js, (array) $js);
        }

        if (!$js = static::getMinifiedJs()) {
            $js = array_merge(static::baseJs(), static::$js);
        }

        $js = array_filter(array_unique($js));

        return view('admin::partials.js', compact('js'));
    }
421795
public function minifyJS() {
      $js_dir = './js';
      if (is_dir($js_dir)) {
         foreach (glob("$js_dir/*.js") as $js_file) {
            if (!$this->endsWith($js_file, 'min.js')) {
               $this->taskMinify($js_file)
                  ->to(str_replace('.js', '.min.js', $js_file))
                  ->type('js')
                  ->run();
            }
         }
      }
      return $this;
   }
1096008
public function buildJavaScriptSyntax(array $vars)
    {
        $js = $this->buildNamespaceDeclaration();
        foreach ($vars as $key => $value) {
            $js .= $this->buildVariableInitialization($key, $value);
        }

        return $js;
    }
784051
public static function headerJs($js = null)
    {
        if (!is_null($js)) {
            return self::$headerJs = array_merge(self::$headerJs, (array) $js);
        }

        return view('admin::partials.js', ['js' => array_unique(static::$headerJs)]);
    }
9098
public function send($js)
    {
        $this->_output_bypass = true;
        $this->sse->send($js);
        $this->_output_bypass = false;

        return $this;
    }
429301
public function compile(JsUtils $js=NULL, &$view=NULL) {
		if ($this->autoActive) {
			$this->setActive();
		}
		$count=$this->count();
		for($i=1; $i < $count; $i++) {
			$this->content[$i]->wrap($this->getContentDivider($i - 1));
		}
		return parent::compile($js, $view);
	}
500228
public function js()
    {
        $args = [];
        $args = func_get_args();

        if (isset($args[1])) {
            $args[1] = array_merge($args[1], ['type' => 'static']);
        } else {
            $args[1] = ['type' => 'static'];
        }

        return call_user_func_array([new static($this->container), 'script'], $args);
    }
136958
public function addJs($js)
    {
        $js = str_ireplace(['<script>', '</script>'], '', $js);

        $this->js[++$this->js_sequence] = $js;

        return $this;
    }
214927
public function bind($js)
    {
        foreach ($this->views as $view) {
            $this->event->listen("composing: {$view}", function () use ($js) {
                echo "<script>{$js}</script>";
            });
        }
    }
950671
public function getJavascripts()
    {
        $self = $this;
        $parse_javascripts = function ($params, $javascripts) use ($self) {
            foreach ($params as $js) {

                if (is_string($js)) {
                    $js = array(
                        'path'  => $js,
                    );
                } elseif (isset($js['route'])) {
                    $js = array(
                        'path'  => $self->getGenerator()
                                        ->getContainer()
                                        ->get('router')
                                        ->generate($js['route'], $js['routeparams'])
                    );
                }

                $javascripts[] = $js;
            }

            return $javascripts;
        };

        // From config.yml
        $javascripts = $parse_javascripts(
            $this->getGenerator()->getContainer()
                 ->getParameter('admingenerator.javascripts', array()), array()
        );

        // From generator.yml
        $javascripts = $parse_javascripts(
            $this->getVariable('javascripts', array()), $javascripts
        );

        return $javascripts;
    }
1313338
public function getJS($method) {
        $array_js = parent::getJS($method);
		$select_js1 = JS::getPath("11-ui.multiselect.js");
		$select_js2 = JS::getPath("12-ui-multiselect-es.js");
		$array_js[] = $select_js1;
		$array_js[] = $select_js2;
		return $array_js;
	}
1176500
public function renderJs()
    {
        $javascriptType      = $this->getJavascriptType();
        $conditionJavascript = $this->getCondition()->renderJs();
        $fieldName           = $this->getField()->getName();
        $formName            = $this->getForm()->getName();

        return sprintf("new GFormDependency(GFormDependency.%s, '%s.%s', %s)",
            $javascriptType,
            $formName,
            $fieldName,
            $conditionJavascript
        );
    }
46158
public function getJS()
	{
		if (!isset($this->jsRegexp))
		{
			$this->jsRegexp = RegexpConvertor::toJS($this->regexp, $this->isGlobal);
		}

		return $this->jsRegexp;
	}
606169
public function escapeJs($js)
    {
        $js = $this->toUtf8($js);
        
        if ($js === '' || ctype_digit($js)) {
            return $js;
        }

        $result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $js);
        
        return $this->fromUtf8($result);
    }
845142
public function run(JsUtils $js) {
		$this->_bsComponent=$js->bootstrap()->generic("#".$this->identifier);
		if (array_key_exists("data-toggle", $this->properties)) {
			$this->_bsComponent->addCode("$.fn.toggled=function(){return this.hasClass('active');};");
		}
		$this->addEventsOnRun($js);
		return $this->_bsComponent;
	}
647882
public function put()
    {
        $js = $this->constructJavaScript($this->normalizeInput(func_get_args()));

        $this->viewBinder->bind($js);

        return $js;
    }
1133653
protected function compileJs()
    {
        $base = $this->path . "js" . DIRECTORY_SEPARATOR;
        if ($this->debug || !file_exists($base . $this->hash . ".js")) {
            $data = '';
            if (0 < count($this->files)) {
                $minifier = new JS();
                foreach ($this->files as $file) {
                    $pathParts = explode("/", $file);
                    if (file_exists($file)) {
                        if ($this->debug) {
                            $data = $this->putDebugJs($pathParts, $base, $file);
                        } elseif (!file_exists($base . $this->hash . ".js")) {
                            $minifier->add($file);
                            //$data = $this->putProductionJs($base, $file, $data);
                        }
                    }
                }
                if($this->debug) {
                    $this->storeContents($base . $this->hash . ".js", $data);
                } else {
                    ini_set('max_execution_time', -1);
                    ini_set('memory_limit', -1);
                    GeneratorHelper::createDir($base);
                    $minifier->minify($base . $this->hash . ".js");
                    ini_restore('memory_limit');
                    ini_restore('max_execution_time');
                }
                unset($minifier);
            }
        }
        return $this;
    }