Adds a file javascript object to the output queue

@param string $url
@param bool $defer
@param bool $is_external

@throws PageException

@return JavascriptObject
762015
public function &file($url, $defer = false, $is_external = false)
    {
        // Do not add files already added
        if (in_array($url, $this->files_used)) {
            Throw new PageException(sprintf('Url "%s" is already set as included js file.', $url));
        }

        $dt = debug_backtrace();

        $this->files_used[$this->filecounter . '-' . $dt[1]['function']] = $url;
        $this->filecounter ++;

        $script = new JavascriptObject();

        $script->setType('file');
        $script->setScript($url);
        $script->setIsExternal($is_external);
        $script->setDefer($defer);

        $this->add($script);

        return $script;
    }
932601
function( name )
	{
		var external = this.externals[ name ];
		return CKEDITOR.getUrl(
				this.getPath( name ) +
				( ( external && ( typeof external.file == 'string' ) ) ? external.file : this.fileName + '.js' ) );
	}
129112
function(url, callback) {
        if (isBrowser) {
            // Browser environments can't pipe, so download the file and add it
            return this.getImageDataFromUrl(url, function(err, data) {
                if (err) {
                    return callback(err);
                }

                this.addImageFromBuffer(data, callback);
            }.bind(this));
        }

        // Pipe the source URL into a POST-request
        request({ uri: url }).pipe(request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', this.getImagesUrl()),
            json: true,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js'
            },
            onComplete: function(err, res, body) {
                callback(err, body ? body.imageIdentifier : null, body, res);
            }
        }));

        return this;
    }
968508
function asyncLoadJs(src) {
  if (!isBrowser()) {
    _logger2.default.error({
      description: 'Document does not exsist to load assets into.',
      func: 'asyncLoadJs', obj: 'dom'
    });
    throw new Error('Document object is required to load assets.');
  }
  var js = window.document.createElement('script');
  js.src = src;
  js.type = 'text/javascript';
  window.document.getElementsByTagName('head')[0].appendChild(js);
  _logger2.default.log({
    description: 'JS was loaded into document.', element: js,
    func: 'asyncLoadJs', obj: 'dom'
  });
  return new Promise(function (resolve) {
    window.setTimeout(resolve, 200);
  });
}
1020203
def add_jsfile(self, src: str) -> None:
        """"""
        self.body.appendChild(Script(src=src))
348519
function (url) {
      return $.Deferred(function (deferred) {
        var $img = $('<img>');

        $img.one('load', function () {
          $img.off('error abort');
          deferred.resolve($img);
        }).one('error abort', function () {
          $img.off('load').detach();
          deferred.reject($img);
        }).css({
          display: 'none'
        }).appendTo(document.body).attr('src', url);
      }).promise();
    }
725603
function get ( url, async, cb, cbError ) {
        var data,
            request = new XMLHttpRequest;

        request.open( 'GET', url, async );

        request.onload = function () {
            if ( this.status >= 200 && this.status < 400 ) {
                // Success!
                data = this.response;
            } else {
                // We reached our target server, but it returned an error. Most likely, the bower.json file is missing.
                // We just return undefined here.
                data = undefined;
            }
            cb( data );
        };

        request.onerror = function ( err ) {
            // There was a connection error of some sort.
            if ( cbError ) cbError( err );
        };

        request.send();
    }
588167
public function parse($refererUrl, $pageUrl)
    {
        $this->setReferer($this->parser->parse($refererUrl, $pageUrl));

        return $this;
    }
679300
public function createPage(
        $refEntityType,
        $pageTitle,
        $locale,
        Node $parentNode = null)
    {
        $user = $this->getAdminUser();

        $newPage = $this->createNewPage($refEntityType, $pageTitle);
        if (null !== $parentNode) {
            $parentNodeTranslation = $parentNode->getNodeTranslation($locale, true);
            $parentNodeVersion = $parentNodeTranslation->getPublicNodeVersion();
            $parentPage = $parentNodeVersion->getRef($this->em);
            $newPage->setParent($parentPage);
        }

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository('KunstmaanNodeBundle:Node')->createNodeFor($newPage, $locale, $user);
        $nodeTranslation = $nodeNewPage->getNodeTranslation($locale, true);
        if (null !== $parentNode) {
            $weight = $this->em->getRepository('KunstmaanNodeBundle:NodeTranslation')->getMaxChildrenWeight(
                    $parentNode,
                    $locale
                ) + 1;
            $nodeTranslation->setWeight($weight);
        }

        if ($newPage->isStructureNode()) {
            $nodeTranslation->setSlug('');
        }

        $this->em->persist($nodeTranslation);
        $this->em->flush();

        $nodeVersion = $nodeTranslation->getPublicNodeVersion();

        $this->eventDispatcher->dispatch(
            Events::ADD_NODE,
            new NodeEvent(
                $nodeNewPage, $nodeTranslation, $nodeVersion, $newPage
            )
        );

        return $nodeTranslation;
    }
1005892
public function addJsUrl(string $url): PageHead
    {
        if (!in_array($url, $this->js_urls, true)) {
            $this->js_urls[++$this->js_sequence] = $url;
        }

        return $this;
    }
130629
function( file ) {
                if ( !(file instanceof WUFile) ) {
    
                    if ( !(file instanceof File) ) {
                        if ( !this._ruid ) {
                            throw new Error('Can\'t add external files.');
                        }
                        file = new File( this._ruid, file );
                    }
    
                    file = new WUFile( file );
                }
    
                return file;
            }
1098435
public function Append ($path = '', $async = FALSE, $defer = FALSE, $doNotMinify = FALSE, $external = FALSE) {
		$item = $this->_completeItem($path, $async, $defer, $doNotMinify, $external);
		$actialGroupItems = & $this->_getScriptsGroupContainer($this->actualGroupName);
		array_push($actialGroupItems, $item);
		return $this;
	}
936874
public static function permanentRedirect($url, $externalRedirect = false) {
		/** @var Response $response */
		$response = new static();
		$response->redirect($url, $externalRedirect, self::HTTP_PERMANENT_REDIRECT);
		return $response;
	}
1241935
public static function temporaryRedirect($url, $externalRedirect = false) {
		/** @var Response $response */
		$response = new static();
		$response->redirect($url, $externalRedirect, self::HTTP_TEMPORARY_REDIRECT);
		return $response;
	}
1130246
public function addAsyncJs($relativeUrl, string $moduleNamespace = null, $prepend = false) {
		if ($moduleNamespace === null) {
			$moduleNamespace = $this->view->getModuleNamespace();
		}
		
		$this->addAsyncJsUrl($this->view->getHttpContext()->getAssetsUrl($moduleNamespace)->ext($relativeUrl), (boolean) $prepend);
		
		return $this;
	}
798090
function insertHTTPFile( $object, $objectVersion, $objectLanguage,
                             $objectAttribute, $httpFile, $mimeData,
                             &$result )
    {
        $result = array( 'errors' => array(),
                         'require_storage' => false );
        $attributeID = $objectAttribute->attribute( 'id' );

        $media = eZMedia::fetch( $attributeID, $objectVersion );
        if ( $media === null )
            $media = eZMedia::create( $attributeID, $objectVersion );

        $httpFile->setMimeType( $mimeData['name'] );
        if ( !$httpFile->store( "original", false, false ) )
        {
            $result['errors'][] = array( 'description' => ezpI18n::tr( 'kernel/classes/datatypes/ezmedia',
                                                        'Failed to store media file %filename. Please contact the site administrator.', null,
                                                        array( '%filename' => $httpFile->attribute( "original_filename" ) ) ) );
            return false;
        }

        $classAttribute = $objectAttribute->contentClassAttribute();
        $player = $classAttribute->attribute( "data_text1" );
        $pluginPage = eZMediaType::pluginPage( $player );

        $media->setAttribute( "contentobject_attribute_id", $attributeID );
        $media->setAttribute( "version", $objectVersion );
        $media->setAttribute( "filename", basename( $httpFile->attribute( "filename" ) ) );
        $media->setAttribute( "original_filename", $httpFile->attribute( "original_filename" ) );
        $media->setAttribute( "mime_type", $mimeData['name'] );

        // Setting width and height to zero means that the browser/player must find the size itself.
        // In the future we will probably analyze the media file and find this information
        $width = $height = 0;
        // Quality is not known, so we don't set any
        $quality = false;
        // Not sure what this is for, set to false
        $controls = false;
        // We want to show controllers by default
        $hasController = true;
        // Don't play automatically
        $isAutoplay = false;
        // Don't loop movie
        $isLoop = false;

        $media->setAttribute( "width", $width );
        $media->setAttribute( "height", $height );
        $media->setAttribute( "quality", $quality );
        $media->setAttribute( "controls", $controls );
        $media->setAttribute( "pluginspage", $pluginPage );
        $media->setAttribute( "is_autoplay", $isAutoplay );
        $media->setAttribute( "has_controller", $hasController );
        $media->setAttribute( "is_loop", $isLoop );

        $filePath = $httpFile->attribute( 'filename' );
        $fileHandler = eZClusterFileHandler::instance();
        $fileHandler->fileStore( $filePath, 'mediafile', true, $mimeData['name'] );


        $media->store();

        $objectAttribute->setContent( $media );
        return true;
    }
673890
public function addJsElixir($filename = 'js/app.js', $dependency = null, $footer = false)
    {
        return $this->addJs($filename, elixir($filename), $dependency, $footer);
    }