src/View/Requirements_Backend.php
public function themedJavascript($name, $type = null)
    {
        $path = ThemeResourceLoader::inst()->findThemedJavascript($name, SSViewer::get_themes());
        if ($path) {
            $opts = [];
            if ($type) {
                $opts['type'] = $type;
            }
            $this->javascript($path, $opts);
        } else {
            throw new InvalidArgumentException(
                "The javascript file doesn't exist. Please check if the file $name.js exists in any "
                . "context or search for themedJavascript references calling this file in your templates."
            );
        }
    }
public function themedJavascript($name, $type = null)
    {
        $path = ThemeResourceLoader::inst()->findThemedJavascript($name, SSViewer::get_themes());
        if ($path) {
            $opts = [];
            if ($type) {
                $opts['type'] = $type;
            }
            $this->javascript($path, $opts);
        } else {
            throw new InvalidArgumentException(
                "The javascript file doesn't exist. Please check if the file $name.js exists in any "
                . "context or search for themedJavascript references calling this file in your templates."
            );
        }
    }
public function themedJavascript ( $ name , $ type = null ) { $ path = ThemeResourceLoader :: inst ( ) -> findThemedJavascript ( $ name , SSViewer :: get_themes ( ) ) ; if ( $ path ) { $ opts = [ ] ; if ( $ type ) { $ opts [ 'type' ] = $ type ; } $ this -> javascript ( $ path , $ opts ) ; } else { throw new InvalidArgumentException ( "The javascript file doesn't exist. Please check if the file $name.js exists in any " . "context or search for themedJavascript references calling this file in your templates." ) ; } }
Registers the given themeable javascript as required.

A javascript file in the current theme path name 'themename/javascript/$name.js' is first searched for,
and it that doesn't exist and the module parameter is set then a javascript file with that name in
the module is used.

@param string $name The name of the file - eg '/js/File.js' would have the name 'File'
@param string $type Comma-separated list of types to use in the script tag
(e.g. 'text/javascript,text/ecmascript')
Registers the given themeable javascript as required .