1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 23:07:59 +01:00

Replace asciidoc with native XSLT transforms.

--HG--
branch : xslt
rename : common/Makefile.common => common/Makefile
rename : vimperator/components/about-handler.js => common/components/about-handler.js
rename : vimperator/components/chrome-data.js => common/components/chrome-data.js
rename : vimperator/components/commandline-handler.js => common/components/commandline-handler.js
This commit is contained in:
Kris Maglione
2009-10-21 04:46:29 -04:00
parent 2add32c3f2
commit 0d44d919bc
75 changed files with 7363 additions and 5466 deletions

View File

@@ -1,17 +1,22 @@
// Copyright (c) 2009 by Kris Maglione <maglione.k at Gmail>
// Copyright (c) 2009 by Kris Maglione <kris@vimperator.org>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
const win = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher)
.activeWindow;
const liberator = win.liberator;
function checkFragment()
{
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;
var frag = document.location.hash.substr(1);
var elem = document.getElementById(frag);
if (elem)
window.content.scrollTo(0, window.content.scrollY + elem.getBoundingClientRect().top - 10); // 10px context
}
let page = liberator.findHelp(decodeURIComponent(document.location.search.substr(1)));
let url = page ? "chrome://liberator/locale/" + page : content.history.previous;
win.getBrowser().loadURIWithFlags(url, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null);
document.addEventListener("load", checkFragment, true);
window.addEventListener("message", function (event) {
if (event.data == "fragmentChange")
checkFragment();
}, true);
// vim: set fdm=marker sw=4 ts=4 et: