1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 00:27:57 +01:00

get rid of Cc/Ci, as that's thunderbird incompatible

This commit is contained in:
Martin Stubenschrott
2008-02-01 17:52:41 +00:00
parent e2e42c83c8
commit a994d42a56
6 changed files with 17 additions and 32 deletions

View File

@@ -2,6 +2,7 @@
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me. <b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
2008: 2008:
* Ovidiu Curcan
* Ivo-Jose Jimenez-Ramos * Ivo-Jose Jimenez-Ramos
* Andrew Pantyukhin * Andrew Pantyukhin
* Kurtis Rader * Kurtis Rader

View File

@@ -2281,7 +2281,8 @@ vimperator.Commands = function () //{{{
if (args) if (args)
{ {
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore); var ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
getService(Components.interfaces.nsISessionStore);
var undoItems = eval("(" + ss.getClosedTabData(window) + ")"); var undoItems = eval("(" + ss.getClosedTabData(window) + ")");
for (var i = 0; i < undoItems.length; i++) for (var i = 0; i < undoItems.length; i++)
{ {
@@ -2299,7 +2300,8 @@ vimperator.Commands = function () //{{{
completer: function (filter) completer: function (filter)
{ {
// get closed-tabs from nsSessionStore // get closed-tabs from nsSessionStore
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore); var ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
getService(Components.interfaces.nsISessionStore);
var undoItems = eval("(" + ss.getClosedTabData(window) + ")"); var undoItems = eval("(" + ss.getClosedTabData(window) + ")");
var completions = []; var completions = [];
for (var i = 0; i < undoItems.length; i++) for (var i = 0; i < undoItems.length; i++)
@@ -2328,7 +2330,8 @@ vimperator.Commands = function () //{{{
return; return;
} }
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore); var ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
getService(Components.interfaces.nsISessionStore);
var undoItems = eval("(" + ss.getClosedTabData(window) + ")"); var undoItems = eval("(" + ss.getClosedTabData(window) + ")");
for (var i = 0; i < undoItems.length; i++) for (var i = 0; i < undoItems.length; i++)
undoCloseTab(); // doesn't work with i as the index to undoCloseTab undoCloseTab(); // doesn't work with i as the index to undoCloseTab

View File

@@ -405,7 +405,8 @@ vimperator.Events = function () //{{{
function waitForPageLoaded() function waitForPageLoaded()
{ {
dump("start waiting in loaded state: " + vimperator.buffer.loaded + "\n"); dump("start waiting in loaded state: " + vimperator.buffer.loaded + "\n");
var mainThread = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager).mainThread; var mainThread = Components.classes["@mozilla.org/thread-manager;1"].
getService(Components.interfaces.nsIThreadManager).mainThread;
while (mainThread.hasPendingEvents()) // clear queue while (mainThread.hasPendingEvents()) // clear queue
mainThread.processNextEvent(true); mainThread.processNextEvent(true);

View File

@@ -307,7 +307,8 @@ vimperator.CommandLine = function () //{{{
{ {
// if we are modifing the GUI while we are not in the main thread // if we are modifing the GUI while we are not in the main thread
// Firefox will hang up // Firefox will hang up
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager); var threadManager = Components.classes["@mozilla.org/thread-manager;1"].
getService(Components.interfaces.nsIThreadManager);
if (!threadManager.isMainThread) if (!threadManager.isMainThread)
return false; return false;

View File

@@ -109,30 +109,6 @@ vimperator.util = { //{{{
continue; continue;
} }
// Disabled for now, use gu and GU or O and change the last part
// var newURL = vimperator.buffer.URL;
// // FIXME: not really that good (doesn't handle .. in the middle)
// // check for ./ and ../ (or even .../) to go to a file in the upper directory
// if (matches = urls[url].match(/^(?:\.$|\.\/(\S*))/))
// {
// var tail = matches[1] || "";
// urls[url] = newURL.replace(/(.+\/)[^\/]*/, "$1" + tail); // NOTE: escape / in character sets so as not to break Vim syntax highlighting
// continue;
// }
// else if (matches = urls[url].match(/^(?:\.\.$|\.\.\/(\S*))/))
// {
// var tail = matches[1] || "";
// urls[url] = newURL.replace(/(.+\/)[^\/]*/, "$1../" + tail);
// continue;
// }
// else if (matches = urls[url].match(/^(?:\.\.\.$|\.\.\.\/(\S*))/))
// {
// var location = window.content.document.location;
// var tail = matches[1] || "";
// urls[url] = location.protocol + "//" + location.host + "/" + tail;
// continue;
// }
// if the string doesn't look like a valid URL (i.e. contains a space // if the string doesn't look like a valid URL (i.e. contains a space
// or does not contain any of: .:/) try opening it with a search engine // or does not contain any of: .:/) try opening it with a search engine
// or keyword bookmark // or keyword bookmark

View File

@@ -416,7 +416,8 @@ const vimperator = (function () //{{{
run: function (program, args, blocking) run: function (program, args, blocking)
{ {
var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
const WINDOWS = navigator.platform == "Win32"; const WINDOWS = navigator.platform == "Win32";
if (!args) if (!args)
@@ -454,7 +455,8 @@ const vimperator = (function () //{{{
return -1; return -1;
} }
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); var process = Components.classes["@mozilla.org/process/util;1"].
createInstance(Components.interfaces.nsIProcess);
process.init(file); process.init(file);
var ec = process.run(blocking, args, args.length); var ec = process.run(blocking, args, args.length);
@@ -721,7 +723,8 @@ const vimperator = (function () //{{{
sleep: function (ms) sleep: function (ms)
{ {
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager); var threadManager = Components.classes["@mozilla.org/thread-manager;1"].
getService(Components.interfaces.nsIThreadManager);
var mainThread = threadManager.mainThread; var mainThread = threadManager.mainThread;
var then = new Date().getTime(), now = then; var then = new Date().getTime(), now = then;