Set custom Javascript files

@param array $jsFiles
@return $this
505821
public function setJsFiles(array $jsFiles)
    {
        $this->jsFiles = ArrayUtils::merge($this->jsFiles, $jsFiles);
        return $this;
    }
321895
public function setJs($script, array $options = array())
    {
        $options['type'] = 'js';
        $options['asset'] = $script;

        return $this->asset->set($options);
    }
603016
public function setPaths($paths)
    {
        $paths = (array)$paths;
        //Append framework's view path
        $paths[] = realpath(__DIR__ . '/../../views');

        $this->paths = $paths;
        return $this;
    }
1263491
public function setElements(array $elements)
    {
        if (($content = $this->getContent()) instanceof ElementsInterface) {
            $content->setElements($elements);
        }

        return $this;
    }
1299490
public static function AppendJS($sFilenameJS){
            $oThis = self::CreateInstanceIfNotExists();

            if(file_exists($sFilenameJS))
                $oThis->aJS[] = file_get_contents($sFilenameJS);
        }
1239174
public function js(array $files, $outputFile)
    {
        if ($this->production) {
            return '<script src="' . $outputFile . '"></script>';
        }

        $this->minify($files, $outputFile, $this->jsMinifiers);

        $scripts = [];

        foreach ($files as $file) {
            $scripts[] = '<script src="' . $file . '"></script>';
        }

        return implode("\n", $scripts);
    }
522603
protected function setJavascriptFile($jsFileName, $hostsWithoutCDNrq = null)
    {
        if (is_null($hostsWithoutCDNrq)) {
            $hostsWithoutCDNrq = [];
        }
        if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) {
            return '<script type="text/javascript" src="' . filter_var($jsFileName, FILTER_SANITIZE_STRING)
                . '"></script>';
        }
        $patternFound = $this->setJavascriptFileCDN($jsFileName);
        return '<script type="text/javascript" src="' . $patternFound[1] . '"></script>' . $patternFound[2];
    }
505609
public function setFormats($formats)
    {
        if (is_array($formats)) {
            $formats = json_encode($formats);
        }

        $this->formats = $formats;

        return $this;
    }
114274
public function setFileData(array $files)
    {
        $files = $this->deflateFilesArray($files);

        $this->fileUploads = [];

        foreach ($files as $key => $fileData) {
            $uploadObj = FileUpload::createFromFileArray($fileData);

            if (!empty($uploadObj)) {
                $this->fileUploads[$key] = $uploadObj;
            }
        }

        return $this;
    }
501910
protected function setJsTranslation(array $scripts)
    {
        if (!empty($this->langcode) && !is_file($this->translation->getContextJsFile())) {
            foreach ($scripts as $key => $script) {
                if (strpos($key, 'system/modules/') === 0
                    && strpos($key, '/vendor/') === false
                    && !empty($script['file'])) {
                    $string = file_get_contents($script['file']);
                    $this->translation->createJsTranslation($string);
                }
            }
        }
    }
750217
public function addJs($js)
    {
        if (is_array($js)) {
            foreach ($js as $script) {
                $this->addJs($script);
            }

            return $this;
        }

        $this->js->push($js);

        return $this;
    }
1357369
function setfs( $paths ) {
		if ( ! is_array($paths) )
			$paths = explode( "\n", $paths );

		$paths = array_filter( array_map( 'trim', $paths ) );

		foreach ( $paths as $path ) {
			// Allow for comments
			if ( '#' == $path[0] )
				continue;

			// Directories
			if ( '/' == $path[ strlen($path) -1 ] )
				$this->mkdir( $path );
			else // Files (with dummy content for now)
				$this->put_contents( $path, 'This is a test file' );
		}

	}
596250
protected function setJavascriptFileCDN($jsFileName)
    {
        $onlyFileName = pathinfo($jsFileName)['basename'];
        $patternFound = null;
        if (in_array($onlyFileName, ['jquery.placeholder.min.js', 'jquery.easing.1.3.min.js'])) {
            $patternFound = $this->setJavascriptFileCDNjQueryLibs($jsFileName);
        } elseif (strpos($onlyFileName, '-') !== false) {
            $patternFound = $this->setJavascriptFileCDNbyPattern($jsFileName);
        }
        if (is_null($patternFound)) {
            $patternFound = [false, $this->sanitizeString($jsFileName), ''];
        }
        return $patternFound;
    }
448973
public function addJs($pFile, $pFooter = false)
	{
		if (! $pFooter) {
			$this->_js[self::JS_MARKER_HEADER][] = $pFile;
		} else {
			$this->_js[self::JS_MARKER_FOOTER][] = $pFile;
		}

		return $this;
	}
394470
public function setButtons(array $buttons): self
    {
        $this->isValidArray($buttons, 1);

        $this->buttons = $buttons;

        return $this;
    }
250391
public static function js_files(array $files) {
        if (empty($files)) {
            return '';
        }

        $compressed = array();
        foreach ($files as $file) {
            $content = file_get_contents($file);
            if ($content === false) {
                $compressed[] = "\n\n// Cannot read JS file ".basename(dirname(dirname($file))).'/'.basename(dirname($file)).'/'.basename($file)."\n\n";
                continue;
            }
            $compressed[] = self::js($content);
        }

        return implode(";\n", $compressed);
    }
410163
public function registerAssetJs($jsFile, $position = CClientScript::POS_END)
    {
        Yii::app()->getClientScript()->registerScriptFile($this->getAssetsUrl() . "/js/{$jsFile}", $position);
        return $this;
    }