mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 09:27:58 +01:00
Fix zoom level display for fractional percentages.
This commit is contained in:
11
common/bootstrap.js
vendored
11
common/bootstrap.js
vendored
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user