1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-18 22:55:45 +01:00

1 Commits

Author SHA1 Message Date
Doug Kearns
42e7c2c512 Bump max version. 2017-01-24 23:24:09 +11:00
12 changed files with 49 additions and 103 deletions

View File

@@ -1,57 +0,0 @@
Pentadactyl for Pale Moon
=========================
This is a port of one of the best XUL-based Firefox extensions, targeting [Pale Moon](https://www.palemoon.org/) 27. The goal of this project is to make Pentadactyl compatible with Pale Moon, while staying as close to the upstream as possible.
Install
-------
The recommended way to install is via the download button at the Pale Moon Addons website [page](https://addons.palemoon.org/extensions/pentadactyl/). Installed this way, the extension could be updated automatically by the browser.
Alternatively, you can always find XPI files and source code of all releases at the [Releases](https://github.com/madand/pentadactyl-pm/releases) page.
Reporting issues
----------------
This repo is intended only to fix Pale Moon specific compatibility issues. If you have a general feature request or found a non-PaleMoon-specific bug, please report them [upstream](https://github.com/5digits/dactyl).
Development
-----------
### Build XPI from sources ###
``` shell
git clone --depth 1000 https://github.com/madand/pentadactyl-pm.git
cd pentadactyl-pm/
make -C pentadactyl xpi
```
This resulting XPI will be placed in the `downloads/` folder.
#### Build dependencies ####
* zip
* gmake
* Standard POSIX commands: awk, echo, sed, sh
While most developers use a Unix-like operating system, you can also build Pentadactyl on Windows with the help of MinGW's MSYS, Cygwin, or SFU.
### Install without XPI ###
As creating and installing a new XPI file after each update is cumbersome, most developers run Pentadactyl directly from their working copies. This is achieved with [Firefox extension proxy file][1], which is a plain text file named after the extension ID and its contents is just a path to the extension source directory.
Assuming you use the `default` profile, the following command will create the proxy file:
``` shell
cd /path/to/cloned/pentadactyl-pm/
# On clean profile, ensure that 'extensions' directory exists inside of the profile directory.
echo "$(pwd)/pentadactyl" >~/'.moonchild productions/pale moon'/*.default/extensions/pentadactyl@addons.palemoon.org
```
Once you installed Pentadactyl via the proxy file, restart the browser. Afterwards, you can use `:rehash` command to reload the extension without further browser restarts. Moreover, you can bind it to a key chord in your `~/.pentadactylrc`:
``` viml
nmap -ex <C-r> :rehash
```
[1]: https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file

View File

@@ -17,12 +17,18 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
this.progressListener);
util.addObserver(this);
this._unoverlay = overlay.overlayObject(FullZoom, {
get siteSpecific() { return false; },
set siteSpecific(val) {}
});
config.tabbrowser.addTabsProgressListener(this.tabsProgressListener);
},
destroy: function () {
this.cleanupProgressListener();
this.observe.unregister();
this._unoverlay();
config.tabbrowser.removeTabsProgressListener(this.tabsProgressListener);
},

View File

@@ -1932,7 +1932,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
dactyl.log(_("dactyl.modulesLoaded"), 3);
userContext.DOM = Class("DOM", DOM, {
init: function init(sel, ctxt) {
init(sel, ctxt) {
return DOM(sel, ctxt || buffer.focusedFrame.document);
}
});
@@ -2069,6 +2069,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
statusline.update();
dactyl.log(_("dactyl.initialized", config.appName), 0);
dactyl.initialized = true;
util.delay(() => {
if (services.focus.activeWindow === window)
overlay.activeWindow = window;
util.flushLateMethods(dactyl);
});
}
});

View File

@@ -618,6 +618,9 @@ var Events = Module("events", {
util.trapErrors("addEditActionListener",
DOM(elem).editor, editor);
if (elem == window)
overlay.activeWindow = window;
overlay.setData(elem, "had-focus", true);
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
if (Events.isHidden(elem, true))
@@ -870,12 +873,6 @@ var Events = Module("events", {
autocommands.trigger("Fullscreen", { url: this._fullscreen ? "on" : "off", state: this._fullscreen });
}
statusline.updateZoomLevel();
},
activate: function onActivate(event) {
if (event.target === window) {
overlay.activeWindow = window;
}
}
},

View File

@@ -7,7 +7,7 @@
"use strict";
var MOW = Module("mow", {
init: function init() {
init() {
let proxy = new Proxy(this, {
get(target, prop, receiver) {
if (prop in target)
@@ -49,10 +49,10 @@ var MOW = Module("mow", {
events.listen(window, this, "windowEvents");
modules.mow = this;
let fontSize = DOM(document.documentElement).style.fontSize;
//let fontSize = DOM(document.documentElement).style.fontSize;
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
"body { font-size: " + fontSize + "; } \
html|html > xul|scrollbar { visibility: collapse !important; }",
// "body { font-size: " + fontSize + "; } \
"html|html > xul|scrollbar { visibility: collapse !important; }",
true);
overlay.overlayWindow(window, {

View File

@@ -36,6 +36,8 @@ var StatusLine = Module("statusline", {
]
});
config.tabbrowser.getStatusPanel().hidden = true;
if (this.statusBar.localName == "toolbar") {
styles.system.add("addon-bar", config.styleableChrome, String.raw`
#status-bar, #dactyl-status-bar { margin-top: 0 !important; }

View File

@@ -1815,7 +1815,7 @@ update(iter, {
});
var Iter = Class("Iter", {
init: function (iter) {
init(iter) {
this.iter = iter;
if (!(Symbol.iterator in iter) && "__iterator__" in iter)
this.iter = iter.__iterator__();
@@ -1826,9 +1826,9 @@ var Iter = Class("Iter", {
};
},
next: function () { return this.iter.next() },
next() { return this.iter.next() },
send: function () { return apply(this.iter, "send", arguments) },
send() { return apply(this.iter, "send", arguments) },
"@@iterator": function () { return this.iter },

View File

@@ -1737,8 +1737,10 @@ var Buffer = Module("Buffer", {
let timers = new WeakMap;
return function smoothScrollTo(node, x, y) {
let time = overlay.activeModules["scrolltime"];
let steps = overlay.activeModules["scrollsteps"];
let { options } = overlay.activeModules;
let time = options["scrolltime"];
let steps = options["scrollsteps"];
let elem = Buffer.Scrollable(node);
@@ -2418,13 +2420,7 @@ var Buffer = Module("Buffer", {
let elements = Array.from(frames)
.flatMap(win => DOM.XPath(xpath, win.document))
.flatMap(elems => {
var _tmp=[];
for(var i=0; i<elems.snapshotLength; i++) {
_tmp.push(elems.snapshotItem(i));
}
return _tmp;
}).filter(elem => {
.filter(elem => {
if (isinstance(elem, [Ci.nsIDOMHTMLFrameElement,
Ci.nsIDOMHTMLIFrameElement]))
@@ -2432,7 +2428,7 @@ var Buffer = Module("Buffer", {
elem = DOM(elem);
if (!elem || !elem.length || elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable)
if (elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable)
return false;
let style = elem.style;

View File

@@ -476,7 +476,7 @@ var Ex = Module("Ex", {
commands: null,
init: function () {
init() {
let proxy = new Proxy(this, {
get(target, prop, receiver) {
if (prop === "isProxy")
@@ -494,7 +494,7 @@ var Ex = Module("Ex", {
return proxy;
},
_args: function(cmd, args) {
_args(cmd, args) {
args = Array.slice(args);
let res = cmd.newArgs({ context: this.context });
@@ -522,7 +522,7 @@ var Ex = Module("Ex", {
return res;
},
_complete: function (cmd) {
_complete(cmd) {
return (context, func, obj, args) => {
args = this._args(cmd, args);
args.completeArg = args.length - 1;
@@ -531,7 +531,7 @@ var Ex = Module("Ex", {
};
},
_run: function (name) {
_run(name) {
const self = this;
let cmd = this.commands.get(name);
util.assert(cmd, _("command.noSuch"));
@@ -627,7 +627,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
extra.hive = this;
extra.parsedSpecs = Command.parseSpecs(specs);
let names = extra.parsedSpecs;
let names = extra.parsedSpecs.flatMap();
let name = names[0];
if (this.name != "builtin") {

View File

@@ -56,15 +56,10 @@ function NetError(orig, error) {
function RedirectChannel(to, orig, time, message) {
let html = DOM.toXML(
["html", {},
["head", {},
["script", {},
"setTimeout(function () { window.location = '"
+ to
+ "'; }, "
+ ((time || 0) * 1000)
+ ");"]],
["body", {},
["h2", { style: "text-align: center" }, message || ""]]]);
["head", {},
["meta", { "http-equiv": "Refresh", content: (time || 0) + ";" + to }]],
["body", {},
["h2", { style: "text-align: center" }, message || ""]]]);
return StringChannel(html, "text/html", services.io.newURI(to, null, null));
}

View File

@@ -64,7 +64,8 @@ var Config = Module("config", ConfigBase, {
},
get toolbars() {
return Array.from(DOM.XPath("//*[@toolbarname]", window.document));
let navbar = window.document.getElementById("nav-bar");
return window.getTogglableToolbars().concat(navbar);
},
removeTab: function removeTab(tab) {

View File

@@ -2,11 +2,11 @@
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest"
em:id="pentadactyl@addons.palemoon.org"
em:id="pentadactyl@dactyl.googlecode.com"
em:type="2"
em:name="Pentadactyl"
em:version="1.2pre-pm-4"
em:description="Pale Moon for Vim and Links addicts"
em:version="1.2pre"
em:description="Firefox for Vim and Links addicts"
em:homepageURL="http://5digits.org/pentadactyl"
em:bootstrap="true"
em:multiprocessCompatible="false"
@@ -16,7 +16,6 @@
<em:developer>Kris Maglione</em:developer>
<em:developer>Doug Kearns</em:developer>
<em:contributor>Andriy Kmit' (Андрій Кміть)</em:contributor>
<em:contributor>anekos</em:contributor>
<em:contributor>teramako</em:contributor>
<em:contributor>Viktor Kojouharov (Виктор Кожухаров)</em:contributor>
@@ -32,9 +31,9 @@
<em:targetApplication>
<Description
em:id="{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
em:minVersion="27.0"
em:maxVersion="50.*"/>
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="38.0"
em:maxVersion="51.*"/>
</em:targetApplication>
</Description>
</RDF>