1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-10 14:04:11 +01:00

Merge branch 'master' of kmaglione@git.vimperator.org:/git/vimperator/liberator

This commit is contained in:
Kris Maglione
2008-12-09 22:05:03 -05:00
5 changed files with 52 additions and 55 deletions

View File

@@ -220,7 +220,7 @@ const config = { //{{{
"Open homepage in a new tab",
function ()
{
var homepages = gHomeButton.getHomePage();
let homepages = gHomeButton.getHomePage();
liberator.open(homepages, /\bhomepage\b/.test(options["activate"]) ?
liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
});
@@ -233,22 +233,21 @@ const config = { //{{{
{
if (/^file:\/|^\//.test(url))
{
//var strippedFilename = url.replace(/^(file:\/\/)?(.*)/, "$2");
var file = io.getFile(url);
if (!file.exists() || !file.isDirectory())
return false;
else
return true;
let file = io.getFile(url);
return file.exists() && file.isDirectory();
}
else
{
// for all other locations just check if the URL ends with /
return /\/$/.test(url);
}
// for all other locations just check if the URL ends with /
return /\/$/.test(url);
}
if (count < 1)
count = 1;
var url = buffer.URL;
// XXX
let url = buffer.URL;
for (let i = 0; i < count; i++)
{
if (isDirectory(url))
@@ -259,11 +258,9 @@ const config = { //{{{
url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end
if (url == buffer.URL)
{
liberator.beep();
return;
}
liberator.open(url);
else
liberator.open(url);
},
{ flags: Mappings.flags.COUNT });
@@ -271,7 +268,7 @@ const config = { //{{{
"Go to the root of the website",
function ()
{
var uri = content.document.location;
let uri = content.document.location;
if (/(about|mailto):/.test(uri.protocol)) // exclude these special protocols for now
{
liberator.beep();
@@ -321,7 +318,7 @@ const config = { //{{{
"Redraw the screen",
function ()
{
var wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
let wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.redraw();
modes.show();
@@ -401,8 +398,8 @@ const config = { //{{{
{
setter: function (value)
{
var ioService = Components.classes['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService2);
const ioService = Components.classes['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService2);
ioService.offline = !value;
gPrefService.setBoolPref("browser.offline", ioService.offline);
@@ -424,7 +421,7 @@ const config = { //{{{
{
try
{
var id = config.mainWindowID || "main-window";
let id = config.mainWindowID || "main-window";
document.getElementById(id).setAttribute("titlemodifier", value);
if (window.content.document.title.length > 0)
document.title = window.content.document.title + " - " + value;