mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 00:07:58 +01:00
rename the 'location' property of vimperator.buffer to 'URL'
This commit is contained in:
@@ -113,9 +113,9 @@ function Buffer() //{{{
|
|||||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
this.__defineGetter__("location", function()
|
this.__defineGetter__("URL", function()
|
||||||
{
|
{
|
||||||
return window.content.document.location.href;
|
return window.content.document.URL;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.__defineGetter__("pageHeight", function()
|
this.__defineGetter__("pageHeight", function()
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ function Commands() //{{{
|
|||||||
{
|
{
|
||||||
if (result.url == null)
|
if (result.url == null)
|
||||||
{
|
{
|
||||||
result.url = vimperator.buffer.location;
|
result.url = vimperator.buffer.URL;
|
||||||
// also guess title if the current url is :bmarked
|
// also guess title if the current url is :bmarked
|
||||||
if (result.title == null)
|
if (result.title == null)
|
||||||
result.title = vimperator.buffer.title;
|
result.title = vimperator.buffer.title;
|
||||||
@@ -355,7 +355,7 @@ function Commands() //{{{
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
if (result.url == null)
|
if (result.url == null)
|
||||||
result.url = vimperator.buffer.location;
|
result.url = vimperator.buffer.URL;
|
||||||
|
|
||||||
var deleted_count = vimperator.bookmarks.remove(result.url);
|
var deleted_count = vimperator.bookmarks.remove(result.url);
|
||||||
vimperator.echo(deleted_count + " bookmark(s) with url `" + result.url + "' deleted");
|
vimperator.echo(deleted_count + " bookmark(s) with url `" + result.url + "' deleted");
|
||||||
@@ -823,7 +823,7 @@ function Commands() //{{{
|
|||||||
if (matches1 && matches1[1])
|
if (matches1 && matches1[1])
|
||||||
vimperator.quickmarks.add(matches1[1], matches1[2]);
|
vimperator.quickmarks.add(matches1[1], matches1[2]);
|
||||||
else if (matches2 && matches2)
|
else if (matches2 && matches2)
|
||||||
vimperator.quickmarks.add(matches2[1], vimperator.buffer.location);
|
vimperator.quickmarks.add(matches2[1], vimperator.buffer.URL);
|
||||||
else
|
else
|
||||||
vimperator.echoerr("E488: Trailing characters");
|
vimperator.echoerr("E488: Trailing characters");
|
||||||
},
|
},
|
||||||
@@ -1245,7 +1245,7 @@ String.prototype.toURLArray = function() // {{{
|
|||||||
|
|
||||||
begin: for (var url = 0; url < urls.length; url++)
|
begin: for (var url = 0; url < urls.length; url++)
|
||||||
{
|
{
|
||||||
var newLocation = vimperator.buffer.location;
|
var newLocation = vimperator.buffer.URL;
|
||||||
|
|
||||||
// FIXME: classic '10 second hack' to fix "gu" foobar//../ problem
|
// FIXME: classic '10 second hack' to fix "gu" foobar//../ problem
|
||||||
newLocation = newLocation.replace(/\/+$/, '');
|
newLocation = newLocation.replace(/\/+$/, '');
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ function Events() //{{{
|
|||||||
vimperator.buffer.updateBufferList();
|
vimperator.buffer.updateBufferList();
|
||||||
|
|
||||||
//update history
|
//update history
|
||||||
var url = vimperator.buffer.location;
|
var url = vimperator.buffer.URL;
|
||||||
var title = vimperator.buffer.title;
|
var title = vimperator.buffer.title;
|
||||||
vimperator.history.add(url, title);
|
vimperator.history.add(url, title);
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ function Mappings() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vimperator.quickmarks.add(arg, vimperator.buffer.location)
|
vimperator.quickmarks.add(arg, vimperator.buffer.URL)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
short_help: "Add new QuickMark for current URL",
|
short_help: "Add new QuickMark for current URL",
|
||||||
@@ -554,7 +554,7 @@ function Mappings() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["O"],
|
addDefaultMap(new Map(vimperator.modes.NORMAL, ["O"],
|
||||||
function() { vimperator.commandline.open(":", "open " + vimperator.buffer.location, vimperator.modes.EX); },
|
function() { vimperator.commandline.open(":", "open " + vimperator.buffer.URL, vimperator.modes.EX); },
|
||||||
{
|
{
|
||||||
short_help: "Open one or more URLs in the current tab, based on current location",
|
short_help: "Open one or more URLs in the current tab, based on current location",
|
||||||
help: "Works like <code class=\"mapping\">o</code>, but preselects current URL in the <code class=\"command\">:open</code> query."
|
help: "Works like <code class=\"mapping\">o</code>, but preselects current URL in the <code class=\"command\">:open</code> query."
|
||||||
@@ -603,7 +603,7 @@ function Mappings() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["T"],
|
addDefaultMap(new Map(vimperator.modes.NORMAL, ["T"],
|
||||||
function() { vimperator.commandline.open(":", "tabopen " + vimperator.buffer.location, vimperator.modes.EX); },
|
function() { vimperator.commandline.open(":", "tabopen " + vimperator.buffer.URL, vimperator.modes.EX); },
|
||||||
{
|
{
|
||||||
short_help: "Open one ore more URLs in a new tab, based on current location",
|
short_help: "Open one ore more URLs in a new tab, based on current location",
|
||||||
help: "Works like <code class=\"mapping\">t</code>, but preselects current URL in the <code class=\"command\">:tabopen</code> query."
|
help: "Works like <code class=\"mapping\">t</code>, but preselects current URL in the <code class=\"command\">:tabopen</code> query."
|
||||||
@@ -620,9 +620,9 @@ function Mappings() //{{{
|
|||||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["y"],
|
addDefaultMap(new Map(vimperator.modes.NORMAL, ["y"],
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
var loc = vimperator.buffer.location;
|
var url = vimperator.buffer.URL;
|
||||||
vimperator.copyToClipboard(loc);
|
vimperator.copyToClipboard(url);
|
||||||
vimperator.echo("Yanked " + loc);
|
vimperator.echo("Yanked " + url);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
short_help: "Yank current location to the clipboard",
|
short_help: "Yank current location to the clipboard",
|
||||||
@@ -867,7 +867,7 @@ function Mappings() //{{{
|
|||||||
function(count)
|
function(count)
|
||||||
{
|
{
|
||||||
var gocmd = "";
|
var gocmd = "";
|
||||||
if (isDirectory(vimperator.buffer.location))
|
if (isDirectory(vimperator.buffer.URL))
|
||||||
gocmd = "../";
|
gocmd = "../";
|
||||||
else
|
else
|
||||||
gocmd = "./";
|
gocmd = "./";
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ function StatusLine() //{{{
|
|||||||
this.updateUrl = function(url)
|
this.updateUrl = function(url)
|
||||||
{
|
{
|
||||||
if (!url || typeof url != "string")
|
if (!url || typeof url != "string")
|
||||||
url = vimperator.buffer.location;
|
url = vimperator.buffer.URL;
|
||||||
|
|
||||||
url_widget.value = url;
|
url_widget.value = url;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user