diff options
| author | Phil Crosby | 2010-01-22 22:43:25 -0800 |
|---|---|---|
| committer | Phil Crosby | 2010-01-22 23:26:34 -0800 |
| commit | 0dfae3a050b4201d54f2558483521b6688691bf6 (patch) | |
| tree | 6cc385b7deb33aac55ce901d9f3208c4f119b257 /background_page.html | |
| parent | 893eaeb5c96ff5a324bc886f77c624aea4854947 (diff) | |
| download | vimium-0dfae3a050b4201d54f2558483521b6688691bf6.tar.bz2 | |
Move the link hints CSS to the background page, and create a setting for user-definable CSS.
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/background_page.html b/background_page.html index 5d93186a..84f06cf3 100644 --- a/background_page.html +++ b/background_page.html @@ -9,9 +9,33 @@ var defaultSettings = { scrollStepSize: 60, defaultZoomLevel: 100, - linkHintCharacters: "sadfjklewcmp" + linkHintCharacters: "sadfjklewcmp", + userDefinedLinkHintCss: + ".vimiumHintMarker {\n\n}\n" + + ".vimiumHintMarker > .matchingCharacter {\n\n}" }; + // This is the base internal link hints CSS. It's combined with the userDefinedLinkHintCss before + // being sent to the frontend. + var linkHintCss = + '.internalVimiumHintMarker {' + + 'background-color:yellow;' + + 'color:black;' + + 'font-weight:bold;' + + 'font-size:12px;' + + 'padding:0 1px;' + + 'line-height:100%;' + + 'width:auto;' + + 'display:block;' + + 'border:1px solid #E3BE23;' + + 'z-index:99999999;' + + 'font-family:"Helvetica Neue", "Helvetica", "Arial", "Sans";' + + '}' + + '.internalVimiumHintMarker > .matchingCharacter {' + + 'color:#C79F0B;' + + '}'; + + // Port handler mapping var portHandlers = { keyDown: handleKeyDown, @@ -24,7 +48,8 @@ }; var sendRequestHandlers = { - getCompletionKeys: getCompletionKeys + getCompletionKeys: getCompletionKeys, + getLinkHintCss: getLinkHintCss }; // Event handlers @@ -111,6 +136,13 @@ } /* + * Returns the core CSS used for link hints, along with any user-provided overrides. + */ + function getLinkHintCss(request) { + return { linkHintCss: linkHintCss + (localStorage['userDefinedLinkHintCss'] || "") }; + } + + /* * Used by the content scripts to get settings from the local storage. */ function getSetting(args, port) { |
