src/LiveDevelopment/Agents/GotoAgent.js
function open(url, location, noFlash) {
        console.assert(url.substr(0, 7) === "file://", "Cannot open non-file URLs");

        var result = new $.Deferred();

        url = _urlWithoutQueryString(url);
        // Extract the path, also strip the third slash when on Windows
        var path = url.slice(brackets.platform === "win" ? 8 : 7);
        // URL-decode the path ('%20' => ' ')
        path = decodeURI(path);
        var promise = CommandManager.execute(Commands.FILE_OPEN, {fullPath: path});
        promise.done(function onDone(doc) {
            if (location) {
                openLocation(location, noFlash);
            }
            result.resolve();
        });
        promise.fail(function onErr(err) {
            console.error(err);
            result.reject(err);
        });

        return result.promise();
    }
function open(url, location, noFlash) {
        console.assert(url.substr(0, 7) === "file://", "Cannot open non-file URLs");

        var result = new $.Deferred();

        url = _urlWithoutQueryString(url);
        // Extract the path, also strip the third slash when on Windows
        var path = url.slice(brackets.platform === "win" ? 8 : 7);
        // URL-decode the path ('%20' => ' ')
        path = decodeURI(path);
        var promise = CommandManager.execute(Commands.FILE_OPEN, {fullPath: path});
        promise.done(function onDone(doc) {
            if (location) {
                openLocation(location, noFlash);
            }
            result.resolve();
        });
        promise.fail(function onErr(err) {
            console.error(err);
            result.reject(err);
        });

        return result.promise();
    }
function open ( url , location , noFlash ) { console . assert ( url . substr ( 0 , 7 ) === "file://" , "Cannot open non-file URLs" ) ; var result = new $ . Deferred ( ) ; url = _urlWithoutQueryString ( url ) ; // Extract the path, also strip the third slash when on Windows var path = url . slice ( brackets . platform === "win" ? 8 : 7 ) ; // URL-decode the path ('%20' => ' ') path = decodeURI ( path ) ; var promise = CommandManager . execute ( Commands . FILE_OPEN , { fullPath : path } ) ; promise . done ( function onDone ( doc ) { if ( location ) { openLocation ( location , noFlash ) ; } result . resolve ( ) ; } ) ; promise . fail ( function onErr ( err ) { console . error ( err ) ; result . reject ( err ) ; } ) ; return result . promise ( ) ; }
Open the editor at the given url and editor location
@param {string} url
@param {integer} optional location in file
Open the editor at the given url and editor location