help() {
        let helpData = getHelpData();
        let keywords = Object.keys(helpData.keywords);
        let ids      = null;
        this._help = this._help.toUpperCase();
        for (let i = 0; i < keywords.length; i++) {
            if (keywords[i].toUpperCase().indexOf(this._help) !== -1) {
                ids = helpData.keywords[keywords[i]];
            }
        }
        if (!ids) {
            return;
        }
        let id   = ids[0];
        let item = null;
        if (id in helpData.subjectById) {
            item = helpData.subjectById[id];
        } else if (id in helpData.sectionById) {
            item = helpData.sectionById[id];
        }
        if (!item) {
            return;
        }
        dispatcher.dispatch(
            'Dialog.Help.Show',
            {
                keyword:   this._help,
                fileIndex: item.fileIndex
            }
        );
    }
/**
     * Todo: Move this help code out of this class...
    **/
Move this help code out of this class
Move this help code out of this class
help() {
        let helpData = getHelpData();
        let keywords = Object.keys(helpData.keywords);
        let ids      = null;
        this._help = this._help.toUpperCase();
        for (let i = 0; i < keywords.length; i++) {
            if (keywords[i].toUpperCase().indexOf(this._help) !== -1) {
                ids = helpData.keywords[keywords[i]];
            }
        }
        if (!ids) {
            return;
        }
        let id   = ids[0];
        let item = null;
        if (id in helpData.subjectById) {
            item = helpData.subjectById[id];
        } else if (id in helpData.sectionById) {
            item = helpData.sectionById[id];
        }
        if (!item) {
            return;
        }
        dispatcher.dispatch(
            'Dialog.Help.Show',
            {
                keyword:   this._help,
                fileIndex: item.fileIndex
            }
        );
    }
help ( ) { let helpData = getHelpData ( ) ; let keywords = Object . keys ( helpData . keywords ) ; let ids = null ; this . _help = this . _help . toUpperCase ( ) ; for ( let i = 0 ; i < keywords . length ; i ++ ) { if ( keywords [ i ] . toUpperCase ( ) . indexOf ( this . _help ) !== - 1 ) { ids = helpData . keywords [ keywords [ i ] ] ; } } if ( ! ids ) { return ; } let id = ids [ 0 ] ; let item = null ; if ( id in helpData . subjectById ) { item = helpData . subjectById [ id ] ; } else if ( id in helpData . sectionById ) { item = helpData . sectionById [ id ] ; } if ( ! item ) { return ; } dispatcher . dispatch ( 'Dialog.Help.Show' , { keyword : this . _help , fileIndex : item . fileIndex } ) ; }
Todo: Move this help code out of this class...
Todo : Move this help code out of this class ...