From b0a91b1c738f82d22abc3bdd6f959c8436159039 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 2 Dec 2008 19:24:37 -0500 Subject: [PATCH] Fix vimperator's logo in help pages. --- liberator/content/style.js | 3 +++ vimperator/content/config.js | 20 ++++++++++++++++++++ vimperator/locale/en-US/asciidoc.conf | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/liberator/content/style.js b/liberator/content/style.js index f153a4b1..a3d7b12e 100644 --- a/liberator/content/style.js +++ b/liberator/content/style.js @@ -416,6 +416,9 @@ const highlight = storage.newObject("highlight", Highlights, false); highlight.CSS = Highlights.prototype.CSS; highlight.reload(); +liberator.triggerObserver("load_styles", "styles"); +liberator.triggerObserver("load_highlight", "highlight"); + liberator.registerObserver("load_commands", function () { // TODO: :colo default needs :hi clear diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 60572f04..26ba578e 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -140,6 +140,8 @@ const config = { //{{{ } // load Vimperator specific modules + // FIXME: Why aren't these listed in config.scripts? + // FIXME: Why isn't this automatic? liberator.loadModule("search", Search); liberator.loadModule("bookmarks", Bookmarks); liberator.loadModule("history", History); @@ -148,6 +150,24 @@ const config = { //{{{ liberator.loadModule("quickmarks", QuickMarks); liberator.loadModule("hints", Hints); + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// STYLES ////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + let img = Image(); + img.src = "chrome://vimperator/content/vimperator.png"; + img.onload = function () { + styles.addSheet("logo", "chrome://liberator/locale/*", + ".vimperator-logo {" + <> + display: inline-block; + width: {img.width}; + height: {img.height}; + + "}" + + ".vimperator-logo::after { content: url(chrome://vimperator/content/vimperator.png) }", + true); + delete img; + } + //////////////////////////////////////////////////////////////////////////////// ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ diff --git a/vimperator/locale/en-US/asciidoc.conf b/vimperator/locale/en-US/asciidoc.conf index a16a4283..e51f372c 100644 --- a/vimperator/locale/en-US/asciidoc.conf +++ b/vimperator/locale/en-US/asciidoc.conf @@ -20,8 +20,8 @@ email=stubenschrott@gmx.net # [replacements] -LOGO=
image:chrome://liberator2/content/vimperator.png[Vimperator]
-HEADER=
image:chrome://liberator2/content/vimperator.png[Vimperator] +LOGO=
+HEADER=
\[count\]=[count] \[args\]=[args] \[arg\]=[arg]