src/extensions/default/NavigationAndHistory/main.js
function _createMROFDisplayList(refresh) {
        var $def = $.Deferred();
        
        var $mrofList, $link, $newItem;

        /**
         * Clears the MROF list in memory and pop over but retains the working set entries
         * @private
         */
        function _purgeAllExceptWorkingSet() {
            _mrofList = _createMROFList();
            $mrofList.empty();
            _createMROFDisplayList(true);
            $currentContext = null;
            PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true);
        }

        if (!refresh) {
            // Call hide first to make sure we are not creating duplicate lists
            _hideMROFList();
            $mrofContainer = $(Mustache.render(htmlTemplate, {Strings: Strings})).appendTo('body');
            $("#mrof-list-close").one("click", _hideMROFList);
            // Attach clear list handler to the 'Clear All' button
            $("#mrof-container .footer > div#clear-mrof-list").on("click", _purgeAllExceptWorkingSet);
            $(window).on("keydown", _handleArrowKeys);
            $(window).on("keyup", _hideMROFListOnEscape);
        }
        
        $mrofList = $mrofContainer.find("#mrof-list");
        
        /**
         * Focus handler for the link in list item 
         * @private
         */
        function _onFocus(event) {
            var $scope = $(event.target).parent();
            $("#mrof-container #mrof-list > li.highlight").removeClass("highlight");
            $(event.target).parent().addClass("highlight");
            $mrofContainer.find("#recent-file-path").text($scope.data("path"));
            $mrofContainer.find("#recent-file-path").attr('title', ($scope.data("path")));
            $currentContext = $scope;
        }
        
        /**
         * Click handler for the link in list item 
         * @private
         */
        function _onClick(event) {
            var $scope = $(event.delegateTarget).parent();
            _openEditorForContext({
                path: $scope.data("path"),
                paneId: $scope.data("paneId"),
                cursor: $scope.data("cursor"),
                hideOnOpenFile: true
            });
        }

        var data, fileEntry;
        
        _syncWithFileSystem().always(function () {
            _mrofList = _mrofList.filter(function (e) {return e; });
            _createFileEntries($mrofList);
            var $fileLinks = $("#mrof-container #mrof-list > li > a.mroitem");
            // Handlers for mouse events on the list items
            $fileLinks.on("focus", _onFocus);
            $fileLinks.on("click", _onClick);
            $fileLinks.on("select", _onClick);

            // Put focus on the Most recent file link in the list
            $fileLinks.first().trigger("focus");

            $def.resolve();
        });

        return $def.promise();
    }
function _createMROFDisplayList(refresh) {
        var $def = $.Deferred();
        
        var $mrofList, $link, $newItem;

        /**
         * Clears the MROF list in memory and pop over but retains the working set entries
         * @private
         */
        function _purgeAllExceptWorkingSet() {
            _mrofList = _createMROFList();
            $mrofList.empty();
            _createMROFDisplayList(true);
            $currentContext = null;
            PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true);
        }

        if (!refresh) {
            // Call hide first to make sure we are not creating duplicate lists
            _hideMROFList();
            $mrofContainer = $(Mustache.render(htmlTemplate, {Strings: Strings})).appendTo('body');
            $("#mrof-list-close").one("click", _hideMROFList);
            // Attach clear list handler to the 'Clear All' button
            $("#mrof-container .footer > div#clear-mrof-list").on("click", _purgeAllExceptWorkingSet);
            $(window).on("keydown", _handleArrowKeys);
            $(window).on("keyup", _hideMROFListOnEscape);
        }
        
        $mrofList = $mrofContainer.find("#mrof-list");
        
        /**
         * Focus handler for the link in list item 
         * @private
         */
        function _onFocus(event) {
            var $scope = $(event.target).parent();
            $("#mrof-container #mrof-list > li.highlight").removeClass("highlight");
            $(event.target).parent().addClass("highlight");
            $mrofContainer.find("#recent-file-path").text($scope.data("path"));
            $mrofContainer.find("#recent-file-path").attr('title', ($scope.data("path")));
            $currentContext = $scope;
        }
        
        /**
         * Click handler for the link in list item 
         * @private
         */
        function _onClick(event) {
            var $scope = $(event.delegateTarget).parent();
            _openEditorForContext({
                path: $scope.data("path"),
                paneId: $scope.data("paneId"),
                cursor: $scope.data("cursor"),
                hideOnOpenFile: true
            });
        }

        var data, fileEntry;
        
        _syncWithFileSystem().always(function () {
            _mrofList = _mrofList.filter(function (e) {return e; });
            _createFileEntries($mrofList);
            var $fileLinks = $("#mrof-container #mrof-list > li > a.mroitem");
            // Handlers for mouse events on the list items
            $fileLinks.on("focus", _onFocus);
            $fileLinks.on("click", _onClick);
            $fileLinks.on("select", _onClick);

            // Put focus on the Most recent file link in the list
            $fileLinks.first().trigger("focus");

            $def.resolve();
        });

        return $def.promise();
    }
function _createMROFDisplayList ( refresh ) { var $def = $ . Deferred ( ) ; var $mrofList , $link , $newItem ; /**
         * Clears the MROF list in memory and pop over but retains the working set entries
         * @private
         */ function _purgeAllExceptWorkingSet ( ) { _mrofList = _createMROFList ( ) ; $mrofList . empty ( ) ; _createMROFDisplayList ( true ) ; $currentContext = null ; PreferencesManager . setViewState ( OPEN_FILES_VIEW_STATE , _mrofList , _getPrefsContext ( ) , true ) ; } if ( ! refresh ) { // Call hide first to make sure we are not creating duplicate lists _hideMROFList ( ) ; $mrofContainer = $ ( Mustache . render ( htmlTemplate , { Strings : Strings } ) ) . appendTo ( 'body' ) ; $ ( "#mrof-list-close" ) . one ( "click" , _hideMROFList ) ; // Attach clear list handler to the 'Clear All' button $ ( "#mrof-container .footer > div#clear-mrof-list" ) . on ( "click" , _purgeAllExceptWorkingSet ) ; $ ( window ) . on ( "keydown" , _handleArrowKeys ) ; $ ( window ) . on ( "keyup" , _hideMROFListOnEscape ) ; } $mrofList = $mrofContainer . find ( "#mrof-list" ) ; /**
         * Focus handler for the link in list item 
         * @private
         */ function _onFocus ( event ) { var $scope = $ ( event . target ) . parent ( ) ; $ ( "#mrof-container #mrof-list > li.highlight" ) . removeClass ( "highlight" ) ; $ ( event . target ) . parent ( ) . addClass ( "highlight" ) ; $mrofContainer . find ( "#recent-file-path" ) . text ( $scope . data ( "path" ) ) ; $mrofContainer . find ( "#recent-file-path" ) . attr ( 'title' , ( $scope . data ( "path" ) ) ) ; $currentContext = $scope ; } /**
         * Click handler for the link in list item 
         * @private
         */ function _onClick ( event ) { var $scope = $ ( event . delegateTarget ) . parent ( ) ; _openEditorForContext ( { path : $scope . data ( "path" ) , paneId : $scope . data ( "paneId" ) , cursor : $scope . data ( "cursor" ) , hideOnOpenFile : true } ) ; } var data , fileEntry ; _syncWithFileSystem ( ) . always ( function ( ) { _mrofList = _mrofList . filter ( function ( e ) { return e ; } ) ; _createFileEntries ( $mrofList ) ; var $fileLinks = $ ( "#mrof-container #mrof-list > li > a.mroitem" ) ; // Handlers for mouse events on the list items $fileLinks . on ( "focus" , _onFocus ) ; $fileLinks . on ( "click" , _onClick ) ; $fileLinks . on ( "select" , _onClick ) ; // Put focus on the Most recent file link in the list $fileLinks . first ( ) . trigger ( "focus" ) ; $def . resolve ( ) ; } ) ; return $def . promise ( ) ; }
Shows the current MROF list
@private
Shows the current MROF list