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

Fix zoom level display for fractional percentages.

This commit is contained in:
Kris Maglione
2011-01-14 23:32:27 -05:00
parent 74ae88b10f
commit 67e2a23c5a
4 changed files with 4 additions and 14 deletions

11
common/bootstrap.js vendored
View File

@@ -31,17 +31,6 @@ function httpGet(url) {
return xmlhttp; return xmlhttp;
} }
function writeFile(file, buf) {
let fstream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
let stream = Cc["@mozilla.org/intl/converter-output-stream;1"].createInstance(Ci.nsIConverterOutputStream);
fstream.init(file, 0x02 | 0x08 | 0x20, parseInt("0644", 8), 0);
stream.init(fstream, "UTF-8", 0, "?");
stream.writeString(buf);
stream.close();
fstream.close();
}
let initialized = false; let initialized = false;
let addon = null; let addon = null;
let basePath = null; let basePath = null;

View File

@@ -31,7 +31,7 @@ var AutoCommands = Module("autocommands", {
*/ */
add: function (events, regexp, cmd) { add: function (events, regexp, cmd) {
events.forEach(function (event) { events.forEach(function (event) {
this._store.push(AutoCommand(event, Option.parse.regexplist(regexp), cmd)); this._store.push(AutoCommand(event, Option.parse.regexplist(regexp.source || regexp), cmd));
}, this); }, this);
}, },

View File

@@ -1181,8 +1181,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
*/ */
reportError: function reportError(error, echo) { reportError: function reportError(error, echo) {
if (error instanceof FailedAssertion || error.message === "Interrupted") { if (error instanceof FailedAssertion || error.message === "Interrupted") {
let prefix = io.sourcing ? io.sourcing.file + ":" + io.sourcing.line + ": " : "";
if (error.message) if (error.message)
dactyl.echoerr(template.linkifyHelp(error.message)); dactyl.echoerr(template.linkifyHelp(prefix + error.message));
else else
dactyl.beep(); dactyl.beep();
return; return;

View File

@@ -309,7 +309,7 @@ var StatusLine = Module("statusline", {
if (percent == 100) if (percent == 100)
this.widgets.zoomlevel.value = ""; this.widgets.zoomlevel.value = "";
else { else {
percent = (" " + percent).substr(-3); percent = (" " + Math.round(percent)).substr(-3);
if (full) if (full)
this.widgets.zoomlevel.value = " [" + percent + "%]"; this.widgets.zoomlevel.value = " [" + percent + "%]";
else else