Repository navigation
Expand file tree
/
Copy pathcommon.coffee
More file actions
43 lines (41 loc) · 1.91 KB
/
Copy pathcommon.coffee
File metadata and controls
43 lines (41 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
jQuery ($) ->
$('[data-i18n-key]').each (idx, elem) ->
elem = $(elem)
key = elem.attr('data-i18n-key')
method = elem.attr('data-i18n-method') || 'text'
translated = chrome.i18n.getMessage(key)
elem[method](translated || "translation missing: #{key}")
behaviors = JSON.parse(localStorage.behaviors || '{}')
shortcuts = JSON.parse(localStorage.shortcuts || '{}')
font = JSON.parse(localStorage.font || '{}')
window.options =
width: parseInt(localStorage.width) || 300
height: parseInt(localStorage.height) || 400
font:
fontFace: font.fontFace || 'inherit'
fontSize: font.fontSize || '80%'
customStyle: localStorage.customStyle || ''
behaviors:
bookmark:
left: behaviors.bookmark?.left || 'openInNewTab'
middle: behaviors.bookmark?.middle || 'openInCurrentTab'
right: behaviors.bookmark?.right || 'openInBackgroundTab'
directory:
left: behaviors.directory?.left || 'toggle'
middle: behaviors.directory?.middle || 'openAllInCurrentWindow'
right: behaviors.directory?.right || 'openAllInNewWindow'
shortcuts:
disable: shortcuts.disable
openBookmarkTreeInNewTab:
modifier: shortcuts.openBookmarkTreeInNewTab?.modifier || 'alt'
key: shortcuts.openBookmarkTreeInNewTab?.key || 'b'
openBookmarkTreeInNewWindow:
modifier: shortcuts.openBookmarkTreeInNewWindow?.modifier || 'alt'
key: shortcuts.openBookmarkTreeInNewWindow?.key || 'w'
rememberOpenedDirectory: localStorage.rememberOpenedDirectory == 'true'
hideScrollbar: localStorage.hideScrollbar == 'true'
closePopupAfterOpenBookmark: localStorage.closePopupAfterOpenBookmark == 'true'
moveDirectoriesToListTop: localStorage.moveDirectoriesToListTop == 'true'
sortBy: localStorage.sortBy || 'index'
rootDirectory: localStorage.rootDirectory || '0'
window.delay = (callback) -> setTimeout(callback, 10)