/*********************************************************************/ var KEYBOARD_CONFIG = { 'Global bindings': { doc: 'NOTE: binding priority is the same as the order of sections '+ 'on this page.', pattern: '*', F4: { alt: doc('Close viewer', function(){ if(window.require != null){ require('nw.gui') .Window.get().close() return false } }), }, F5: doc('Full reload viewer', function(){ if(window.require != null){ require('nw.gui') .Window.get().reload() return false } }), F12: doc('Show devTools', function(){ if(window.require != null){ require('nw.gui') .Window.get().showDevTools() return false } }), }, '.overlay': { title: 'Overlay mode.', doc: '', ignore: '*', Esc: function(){ removeOverlay() return false }, }, '.editor:not(.inline-editor-mode)': { title: 'Editor mode.', doc: '', '0': function(){ var n = getPageNumber() if(togglePageView('?') == 'on'){ setMagazineScale(getPageTargetScale(1)) } else { setMagazineScale(getPageTargetScale(PAGES_IN_RIBBON)) } setCurrentPage(n) }, Esc: '0', '=': function(){ var n = getPageNumber() setMagazineScale(Math.min( getMagazineScale() * 1.2, getPageTargetScale(1))) setCurrentPage(n) }, '-': function(){ var n = getPageNumber() setMagazineScale(Math.max( getMagazineScale() * 0.8, getPageTargetScale(PAGES_IN_RIBBON*2))) setCurrentPage(n) }, 'O': { // load... // XXX needs testing... 'ctrl': function(){ showInOverlay('

Open Issue

'+ '') }, }, 'S': { // save... // XXX needs testing... 'ctrl': function(){ showInOverlay('

Save Issue

'+ '

NOTE: this download will not include the actual '+ 'images. at this point, images should be added manually.

'+ '

Download

') // setup the data... $(generateMagazineDownload) }, }, // ? '/': function(){ showInOverlay('

Controls

'+ '

NOTE: this section is a stub.

'+ ''+ ''+ ''+ ''+ ''+ '
C-O Load issue from file.
C-S Save issue to file.
- / + Zoom out/in.
0 Set default zoom level.
') }, }, // ignore all keys except Esc here... '.inline-editor-mode': { title: 'Inline editor mode.', doc: '', //ignore: '*' Esc: function(){ $(':focus').blur() return false }, }, '.chrome:not(.inline-editor-mode)': { title: 'Global bindings.', doc: '', Esc: function(){ if(toggleEditor('?') == 'on'){ toggleEditor('off') } else { togglePageView('off') } }, Home: firstPage, End: lastPage, Left: { default: function(){ prevPage() }, shift: prevBookmark, ctrl: prevArticle, }, Right: { default: function(){ nextPage() }, shift: nextBookmark, ctrl: nextArticle, }, Space: { default: 'Right', shift: 'Left' }, //Tab: 'Space', Tab: function(){ return false }, Enter: function(){ togglePageView('on') }, // combined navigation with actions.. Up: function(){ togglePageView() }, Down: function(){ togglePageView() }, F: function(){ togglePageFitMode() }, B: { default: function(){ toggleBookmark() }, ctrl: function(){ toggleThemes() }, }, // XXX this should not be in the production viewer... E: function(){ toggleEditor() }, }, } /*********************************************************************/ // vim:set ts=4 sw=4 nowrap :