From e0a66f24a163019f82ce2b432ce14831b2d3ed7c Mon Sep 17 00:00:00 2001 From: amla70 Date: Mon, 18 Jul 2011 14:22:43 +0000 Subject: [PATCH] FoxToPhone 1.2b2.Compatibility with Https Everywhere, updated translations. Reset max version to a valid one. --- .../chrome/content/ff-overlay.js | 8 ++++++ .../chrome/content/uploads.js | 26 ++++++++----------- .../chrome/content/uploads.xul | 4 ++- .../chrome/locale/cs/overlay.dtd | 5 ++++ .../chrome/locale/nl/overlay.dtd | 5 ++++ .../chrome/locale/ru/overlay.dtd | 5 ++++ .../chrome/locale/sr/overlay.dtd | 5 ++++ .../chrome/skin/uploads.css | 8 +++++- third_party/firefox_sendtophone/install.rdf | 4 +-- .../modules/sendtophone.js | 2 +- 10 files changed, 52 insertions(+), 20 deletions(-) diff --git a/third_party/firefox_sendtophone/chrome/content/ff-overlay.js b/third_party/firefox_sendtophone/chrome/content/ff-overlay.js index efb3d2c..31c198c 100644 --- a/third_party/firefox_sendtophone/chrome/content/ff-overlay.js +++ b/third_party/firefox_sendtophone/chrome/content/ff-overlay.js @@ -25,6 +25,14 @@ sendtophone.init = function() document.getElementById("contentAreaContextMenu"). addEventListener("popupshowing", function (e){ sendtophone.showFirefoxContextMenu(e); }, false); + + // Hide URL bar and other chrome on the uploads window + var prevFunc = XULBrowserWindow.hideChromeForLocation; + + XULBrowserWindow.hideChromeForLocation = function(aLocation) { + return (aLocation=='chrome://sendtophone/content/uploads.xul') || prevFunc.apply(XULBrowserWindow, [aLocation]); + } + } sendtophone.installToolbarButton = function() diff --git a/third_party/firefox_sendtophone/chrome/content/uploads.js b/third_party/firefox_sendtophone/chrome/content/uploads.js index f403925..7cf7b17 100644 --- a/third_party/firefox_sendtophone/chrome/content/uploads.js +++ b/third_party/firefox_sendtophone/chrome/content/uploads.js @@ -1,14 +1,10 @@ "use strict"; -let Cc = Components.classes; -let Ci = Components.interfaces; -let Cu = Components.utils; +Components.utils.import("resource://gre/modules/DownloadUtils.jsm"); +Components.utils.import("resource://gre/modules/PluralForm.jsm"); +Components.utils.import("resource://sendtophone/uploadsManager.js"); -Cu.import("resource://gre/modules/DownloadUtils.jsm"); -Cu.import("resource://gre/modules/PluralForm.jsm"); -Cu.import("resource://sendtophone/uploadsManager.js"); - -let gUploadListener = { +let FoxToPhoneUploadListener = { UploadsView: null, fileAdded: function(data) @@ -36,8 +32,8 @@ let gUploadListener = { // Use a 0 ms timeout to avoid flicker while compress -> upload a folder // The trick won't work if in order to upload the file itself we have to perform an extra request before // (like creating a gallery in min.us) - let checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); - checkTimer.initWithCallback( this.checkTimerEvent, 0, Ci.nsITimer.TYPE_ONE_SHOT ); + let checkTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); + checkTimer.initWithCallback( this.checkTimerEvent, 0, Components.interfaces.nsITimer.TYPE_ONE_SHOT ); }, checkTimerEvent : @@ -46,7 +42,7 @@ let gUploadListener = { { if (!sendtophoneUploadsManager.isWindowNeeded(true)) { - if (gUploadListener.UploadsView.children.length==0) + if (FoxToPhoneUploadListener.UploadsView.children.length==0) window.close(); } } @@ -83,17 +79,17 @@ let FoxToPhoneUploadWindow = { { this.UploadManager = sendtophoneUploadsManager; - gUploadListener.UploadsView = document.getElementById("UploadsBox"); + FoxToPhoneUploadListener.UploadsView = document.getElementById("UploadsBox"); - this.UploadManager.addListener(gUploadListener); + this.UploadManager.addListener(FoxToPhoneUploadListener); for (let id in this.UploadManager.uploads) - gUploadListener.addFile( this.UploadManager.uploads[id] ); + FoxToPhoneUploadListener.addFile( this.UploadManager.uploads[id] ); }, Shutdown: function() { - this.UploadManager.removeListener(gUploadListener); + this.UploadManager.removeListener(FoxToPhoneUploadListener); }, performCancelCommand: function(aItem) diff --git a/third_party/firefox_sendtophone/chrome/content/uploads.xul b/third_party/firefox_sendtophone/chrome/content/uploads.xul index ac81e9a..fb3eb6c 100644 --- a/third_party/firefox_sendtophone/chrome/content/uploads.xul +++ b/third_party/firefox_sendtophone/chrome/content/uploads.xul @@ -8,7 +8,9 @@ + onclose="return closeWindow(false);" + title="Fox To Phone - &sendtophoneFileTransfers.label;" + >