mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 19:17:59 +01:00
Add :dia errorconsole.
This commit is contained in:
@@ -15,7 +15,12 @@
|
|||||||
* @instance buffer
|
* @instance buffer
|
||||||
*/
|
*/
|
||||||
var Buffer = Module("buffer", {
|
var Buffer = Module("buffer", {
|
||||||
init: function init() {
|
init: function init(win) {
|
||||||
|
if (win)
|
||||||
|
this.win = win;
|
||||||
|
else
|
||||||
|
this.__defineGetter__("win", function () content);
|
||||||
|
|
||||||
this.pageInfo = {};
|
this.pageInfo = {};
|
||||||
|
|
||||||
this.addPageInfoSection("e", "Search Engines", function (verbose) {
|
this.addPageInfoSection("e", "Search Engines", function (verbose) {
|
||||||
@@ -297,28 +302,28 @@ var Buffer = Module("buffer", {
|
|||||||
/**
|
/**
|
||||||
* @property {nsIURI} The current top-level document.
|
* @property {nsIURI} The current top-level document.
|
||||||
*/
|
*/
|
||||||
get doc() window.content.document,
|
get doc() this.win.document,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {nsIURI} The current top-level document's URI.
|
* @property {nsIURI} The current top-level document's URI.
|
||||||
*/
|
*/
|
||||||
get uri() util.newURI(content.location.href),
|
get uri() util.newURI(this.win.location.href),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {nsIURI} The current top-level document's URI, sans any
|
* @property {nsIURI} The current top-level document's URI, sans any
|
||||||
* fragment identifier.
|
* fragment identifier.
|
||||||
*/
|
*/
|
||||||
get documentURI() let (doc = content.document) doc.documentURIObject || util.newURI(doc.documentURI),
|
get documentURI() this.doc.documentURIObject || util.newURI(this.doc.documentURI),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {string} The current top-level document's URL.
|
* @property {string} The current top-level document's URL.
|
||||||
*/
|
*/
|
||||||
get URL() update(new String(content.location.href), util.newURI(content.location.href)),
|
get URL() update(new String(this.win.location.href), util.newURI(this.win.location.href)),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {number} The buffer's height in pixels.
|
* @property {number} The buffer's height in pixels.
|
||||||
*/
|
*/
|
||||||
get pageHeight() content.innerHeight,
|
get pageHeight() this.win.innerHeight,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {number} The current browser's zoom level, as a
|
* @property {number} The current browser's zoom level, as a
|
||||||
@@ -337,7 +342,7 @@ var Buffer = Module("buffer", {
|
|||||||
/**
|
/**
|
||||||
* @property {string} The current document's title.
|
* @property {string} The current document's title.
|
||||||
*/
|
*/
|
||||||
get title() content.document.title,
|
get title() this.doc.title,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {number} The buffer's horizontal scroll percentile.
|
* @property {number} The buffer's horizontal scroll percentile.
|
||||||
@@ -387,7 +392,7 @@ var Buffer = Module("buffer", {
|
|||||||
if (true || frame.document.body instanceof HTMLBodyElement)
|
if (true || frame.document.body instanceof HTMLBodyElement)
|
||||||
frames.push(frame);
|
frames.push(frame);
|
||||||
Array.forEach(frame.frames, rec);
|
Array.forEach(frame.frames, rec);
|
||||||
})(win || content);
|
})(win || this.win);
|
||||||
if (focusedFirst)
|
if (focusedFirst)
|
||||||
return frames.filter(function (f) f === buffer.focusedFrame).concat(
|
return frames.filter(function (f) f === buffer.focusedFrame).concat(
|
||||||
frames.filter(function (f) f !== buffer.focusedFrame));
|
frames.filter(function (f) f !== buffer.focusedFrame));
|
||||||
@@ -399,7 +404,7 @@ var Buffer = Module("buffer", {
|
|||||||
*/
|
*/
|
||||||
get focusedFrame() {
|
get focusedFrame() {
|
||||||
let frame = this.localStore.focusedFrame;
|
let frame = this.localStore.focusedFrame;
|
||||||
return frame && frame.get() || content;
|
return frame && frame.get() || this.win;
|
||||||
},
|
},
|
||||||
set focusedFrame(frame) {
|
set focusedFrame(frame) {
|
||||||
this.localStore.focusedFrame = Cu.getWeakReference(frame);
|
this.localStore.focusedFrame = Cu.getWeakReference(frame);
|
||||||
@@ -814,7 +819,7 @@ var Buffer = Module("buffer", {
|
|||||||
* Find the best candidate scrollable frame in the current buffer.
|
* Find the best candidate scrollable frame in the current buffer.
|
||||||
*/
|
*/
|
||||||
findScrollableWindow: function findScrollableWindow() {
|
findScrollableWindow: function findScrollableWindow() {
|
||||||
win = window.document.commandDispatcher.focusedWindow;
|
let win = window.document.commandDispatcher.focusedWindow;
|
||||||
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
|
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
|
||||||
return win;
|
return win;
|
||||||
|
|
||||||
@@ -822,7 +827,7 @@ var Buffer = Module("buffer", {
|
|||||||
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
|
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
|
||||||
return win;
|
return win;
|
||||||
|
|
||||||
win = content;
|
win = this.win;
|
||||||
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
||||||
return win;
|
return win;
|
||||||
|
|
||||||
@@ -879,7 +884,7 @@ var Buffer = Module("buffer", {
|
|||||||
* count skips backwards.
|
* count skips backwards.
|
||||||
*/
|
*/
|
||||||
shiftFrameFocus: function shiftFrameFocus(count) {
|
shiftFrameFocus: function shiftFrameFocus(count) {
|
||||||
if (!(content.document instanceof HTMLDocument))
|
if (!(this.doc instanceof HTMLDocument))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let frames = this.allFrames();
|
let frames = this.allFrames();
|
||||||
@@ -904,7 +909,7 @@ var Buffer = Module("buffer", {
|
|||||||
|
|
||||||
// focus next frame and scroll into view
|
// focus next frame and scroll into view
|
||||||
dactyl.focus(frames[next]);
|
dactyl.focus(frames[next]);
|
||||||
if (frames[next] != content)
|
if (frames[next] != this.win)
|
||||||
DOM(frames[next].frameElement).scrollIntoView();
|
DOM(frames[next].frameElement).scrollIntoView();
|
||||||
|
|
||||||
// add the frame indicator
|
// add the frame indicator
|
||||||
@@ -940,8 +945,8 @@ var Buffer = Module("buffer", {
|
|||||||
showPageInfo: function showPageInfo(verbose, sections) {
|
showPageInfo: function showPageInfo(verbose, sections) {
|
||||||
// Ctrl-g single line output
|
// Ctrl-g single line output
|
||||||
if (!verbose) {
|
if (!verbose) {
|
||||||
let file = content.location.pathname.split("/").pop() || _("buffer.noName");
|
let file = this.win.location.pathname.split("/").pop() || _("buffer.noName");
|
||||||
let title = content.document.title || _("buffer.noTitle");
|
let title = this.win.document.title || _("buffer.noTitle");
|
||||||
|
|
||||||
let info = template.map(sections || options["pageinfo"],
|
let info = template.map(sections || options["pageinfo"],
|
||||||
function (opt) template.map(buffer.pageInfo[opt].action(), util.identity, ", "),
|
function (opt) template.map(buffer.pageInfo[opt].action(), util.identity, ", "),
|
||||||
@@ -1182,7 +1187,7 @@ var Buffer = Module("buffer", {
|
|||||||
scrollEnd: deprecated("buffer.scrollToPercent", function scrollEnd() buffer.scrollToPercent(100, null)),
|
scrollEnd: deprecated("buffer.scrollToPercent", function scrollEnd() buffer.scrollToPercent(100, null)),
|
||||||
scrollColumns: deprecated("buffer.scrollHorizontal", function scrollColumns(cols) buffer.scrollHorizontal("columns", cols)),
|
scrollColumns: deprecated("buffer.scrollHorizontal", function scrollColumns(cols) buffer.scrollHorizontal("columns", cols)),
|
||||||
scrollPages: deprecated("buffer.scrollHorizontal", function scrollPages(pages) buffer.scrollVertical("pages", pages)),
|
scrollPages: deprecated("buffer.scrollHorizontal", function scrollPages(pages) buffer.scrollVertical("pages", pages)),
|
||||||
scrollTo: deprecated("Buffer.scrollTo", function scrollTo(x, y) content.scrollTo(x, y)),
|
scrollTo: deprecated("Buffer.scrollTo", function scrollTo(x, y) this.win.scrollTo(x, y)),
|
||||||
textZoom: deprecated("buffer.zoomValue/buffer.fullZoom", function textZoom() config.browser.markupDocumentViewer.textZoom * 100)
|
textZoom: deprecated("buffer.zoomValue/buffer.fullZoom", function textZoom() config.browser.markupDocumentViewer.textZoom * 100)
|
||||||
}, {
|
}, {
|
||||||
PageInfo: Struct("PageInfo", "name", "title", "action")
|
PageInfo: Struct("PageInfo", "name", "title", "action")
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ var DOM = Class("DOM", {
|
|||||||
else if ("length" in val)
|
else if ("length" in val)
|
||||||
for (let i = 0; i < val.length; i++)
|
for (let i = 0; i < val.length; i++)
|
||||||
this[length++] = val[i];
|
this[length++] = val[i];
|
||||||
else if ("__iterator__" in val)
|
else if ("__iterator__" in val || isinstance(val, ["Iterator", "Generator"]))
|
||||||
for (let elem in val)
|
for (let elem in val)
|
||||||
this[length++] = elem;
|
this[length++] = elem;
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@
|
|||||||
- Added 'passkeys' option. [b3]
|
- Added 'passkeys' option. [b3]
|
||||||
- Added 'passunknown' option. [b7]
|
- Added 'passunknown' option. [b7]
|
||||||
- Changed 'urlseparator' default value to "|". [b3]
|
- Changed 'urlseparator' default value to "|". [b3]
|
||||||
- Added "passwords" and "venkman" dialogs to :dialog. [b2]
|
- Added "errorconsole", "passwords", and "venkman" dialogs to :dialog. [b2][b8]
|
||||||
- Added 'spelllang' option. [b8]
|
- Added 'spelllang' option. [b8]
|
||||||
- Make 'showmode' a [stringlist] option. [b7]
|
- Make 'showmode' a [stringlist] option. [b7]
|
||||||
- Added 'wildanchor' option. [b2]
|
- Added 'wildanchor' option. [b2]
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ var Config = Module("config", ConfigBase, {
|
|||||||
function () "inspectDOMDocument" in window],
|
function () "inspectDOMDocument" in window],
|
||||||
downloads: ["Manage Downloads",
|
downloads: ["Manage Downloads",
|
||||||
function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
|
function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
|
||||||
|
errorconsole: ["Error Console",
|
||||||
|
function () { window.toErrorConsole(); }],
|
||||||
history: ["List your history",
|
history: ["List your history",
|
||||||
function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }],
|
function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }],
|
||||||
import: ["Import Preferences, Bookmarks, History, etc. from other browsers",
|
import: ["Import Preferences, Bookmarks, History, etc. from other browsers",
|
||||||
|
|||||||
Reference in New Issue
Block a user