mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
FoxToPhone 1.2.3, updated translations, removal of min.us option, internal change on the handling of additional protocols.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const Cc = Components.classes;
|
||||||
|
const Ci = Components.interfaces;
|
||||||
|
|
||||||
let foxToPhonePreferences =
|
let foxToPhonePreferences =
|
||||||
{
|
{
|
||||||
load: function()
|
load: function()
|
||||||
@@ -14,10 +17,6 @@ let foxToPhonePreferences =
|
|||||||
fileserverMenuList.value = fileServerUrl;
|
fileserverMenuList.value = fileServerUrl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'http://min.us':
|
|
||||||
fileserverMenuList.value = fileServerUrl;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fileserverMenuList.value = 'Custom';
|
fileserverMenuList.value = 'Custom';
|
||||||
break;
|
break;
|
||||||
@@ -53,8 +52,8 @@ let foxToPhonePreferences =
|
|||||||
while (accountsList.getRowCount() >0)
|
while (accountsList.getRowCount() >0)
|
||||||
accountsList.removeItemAt(0);
|
accountsList.removeItemAt(0);
|
||||||
|
|
||||||
this.prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
this.prefs = Cc["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Components.interfaces.nsIPrefService)
|
.getService(Ci.nsIPrefService)
|
||||||
.getBranch("extensions.sendtophone.") ;
|
.getBranch("extensions.sendtophone.") ;
|
||||||
|
|
||||||
var accounts = this.prefs.getCharPref("accounts").split(";");
|
var accounts = this.prefs.getCharPref("accounts").split(";");
|
||||||
@@ -73,8 +72,8 @@ let foxToPhonePreferences =
|
|||||||
{
|
{
|
||||||
if (!this.strings)
|
if (!this.strings)
|
||||||
{
|
{
|
||||||
this.strings = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
this.strings = Cc["@mozilla.org/intl/stringbundle;1"]
|
||||||
.getService(Components.interfaces.nsIStringBundleService)
|
.getService(Ci.nsIStringBundleService)
|
||||||
.createBundle("chrome://sendtophone/locale/overlay.properties");
|
.createBundle("chrome://sendtophone/locale/overlay.properties");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +97,8 @@ let foxToPhonePreferences =
|
|||||||
n++;
|
n++;
|
||||||
|
|
||||||
var input = {value:"Phone " + n};
|
var input = {value:"Phone " + n};
|
||||||
if (Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
if (Cc["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
.getService(Components.interfaces.nsIPromptService)
|
.getService(Ci.nsIPromptService)
|
||||||
.prompt( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptAdd"), input, null, {value: false}))
|
.prompt( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptAdd"), input, null, {value: false}))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -118,8 +117,8 @@ let foxToPhonePreferences =
|
|||||||
{
|
{
|
||||||
var item = accountsList.selectedItems[i],
|
var item = accountsList.selectedItems[i],
|
||||||
input = {value:item.label},
|
input = {value:item.label},
|
||||||
ok = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
ok = Cc["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
.getService(Components.interfaces.nsIPromptService)
|
.getService(Ci.nsIPromptService)
|
||||||
.prompt( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptRename"), input, null, {value: false});
|
.prompt( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptRename"), input, null, {value: false});
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
@@ -140,8 +139,8 @@ let foxToPhonePreferences =
|
|||||||
{
|
{
|
||||||
var item = accountsList.selectedItems[i],
|
var item = accountsList.selectedItems[i],
|
||||||
title = item.label;
|
title = item.label;
|
||||||
if (!Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
if (!Cc["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
.getService(Components.interfaces.nsIPromptService)
|
.getService(Ci.nsIPromptService)
|
||||||
.confirm( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptRemove") + "\r\n" + title))
|
.confirm( null, this.getString("SendToPhoneTitle"), this.getString("PhoneAccountPromptRemove") + "\r\n" + title))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,6 @@
|
|||||||
<menulist id="extensionsSendToPhoneFileServer">
|
<menulist id="extensionsSendToPhoneFileServer">
|
||||||
<menupopup>
|
<menupopup>
|
||||||
<menuitem value="" label="&sendtophoneFileServer.None;" />
|
<menuitem value="" label="&sendtophoneFileServer.None;" />
|
||||||
<menuitem value="http://min.us" label="Min.us" />
|
|
||||||
<menuitem value="Custom" label="&sendtophoneFileServer.Custom;" />
|
<menuitem value="Custom" label="&sendtophoneFileServer.Custom;" />
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menulist>
|
</menulist>
|
||||||
|
|||||||
@@ -27,3 +27,8 @@
|
|||||||
<!ENTITY sendtophoneFileServer.None "Ниједан">
|
<!ENTITY sendtophoneFileServer.None "Ниједан">
|
||||||
<!ENTITY sendtophoneFileServer.Custom "Прилагођени">
|
<!ENTITY sendtophoneFileServer.Custom "Прилагођени">
|
||||||
<!ENTITY sendtophoneFileServer.Disclaimer "Напомена: ми, аутори додатка FoxToPhone, нсимо повезани ни са једним хостингом наведеним овде. Требало би да прочитате њихове услове коришћења пре него што их почнете користити.">
|
<!ENTITY sendtophoneFileServer.Disclaimer "Напомена: ми, аутори додатка FoxToPhone, нсимо повезани ни са једним хостингом наведеним овде. Требало би да прочитате њихове услове коришћења пре него што их почнете користити.">
|
||||||
|
<!ENTITY sendtophonePhoneAccounts.label "Налози у телефону">
|
||||||
|
<!ENTITY sendtophonePhoneAccounts.description "Ако на својим уређајима користите више налога за Google сервере, можете да се пребацујете између њих, када их једном направите овде.">
|
||||||
|
<!ENTITY sendtophonePhoneAccounts.add "Додај нови">
|
||||||
|
<!ENTITY sendtophonePhoneAccounts.rename "Преименуј">
|
||||||
|
<!ENTITY sendtophonePhoneAccounts.remove "Уклони">
|
||||||
|
|||||||
@@ -21,3 +21,6 @@ qrContextMenu=Пошаљи „%s” у Андроид
|
|||||||
FileUploadsDisabled=Није могуће слати слике на телефон.
|
FileUploadsDisabled=Није могуће слати слике на телефон.
|
||||||
FileTooBig=Датотека је превелика.
|
FileTooBig=Датотека је превелика.
|
||||||
videoTitle=Веза до видео снимка
|
videoTitle=Веза до видео снимка
|
||||||
|
PhoneAccountPromptAdd=Унесите назив новог налога
|
||||||
|
PhoneAccountPromptRename=Унесите ново име овог налога
|
||||||
|
PhoneAccountPromptRemove=Желите ли да избришете овај налог?
|
||||||
|
|||||||
@@ -12,23 +12,23 @@
|
|||||||
<!ENTITY sendtophoneContextLogout.accesskey "L">
|
<!ENTITY sendtophoneContextLogout.accesskey "L">
|
||||||
<!ENTITY sendtophoneOptions.title "Fox To Phone Seçenekleri">
|
<!ENTITY sendtophoneOptions.title "Fox To Phone Seçenekleri">
|
||||||
<!ENTITY sendtophoneProtocols.label "Protokoller">
|
<!ENTITY sendtophoneProtocols.label "Protokoller">
|
||||||
<!ENTITY sendtophoneContextSendFile.label "Dosya Gönder">
|
<!ENTITY sendtophoneContextSendFile.label "Dosyaya Gönder">
|
||||||
<!ENTITY sendtophoneContextSendFile.accesskey "S">
|
<!ENTITY sendtophoneContextSendFile.accesskey "S">
|
||||||
<!ENTITY sendtophoneContextSendFolder.label "Klasör Gönder">
|
<!ENTITY sendtophoneContextSendFolder.label "Klasöre Gönder">
|
||||||
<!ENTITY sendtophoneContextSendFolder.accesskey "F">
|
<!ENTITY sendtophoneContextSendFolder.accesskey "F">
|
||||||
<!ENTITY sendtophoneContextQrImage.label "Android için çözümlenmiş QR Link Gönder">
|
<!ENTITY sendtophoneContextQrImage.label "Çözümlenmiş QR Bağlantısını Android'e Gönder">
|
||||||
<!ENTITY sendtophoneContextQrImage.accesskey "Q">
|
<!ENTITY sendtophoneContextQrImage.accesskey "Q">
|
||||||
<!ENTITY sendtophoneContextSendClipboard.label "Panoya Gönder">
|
<!ENTITY sendtophoneContextSendClipboard.label "Panoya Gönder">
|
||||||
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
|
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
|
||||||
<!ENTITY sendtophoneContextVideo.label "Androide video gönder">
|
<!ENTITY sendtophoneContextVideo.label "Videoyu Andoid'e Gönder">
|
||||||
<!ENTITY sendtophoneContextVideo.accesskey "V">
|
<!ENTITY sendtophoneContextVideo.accesskey "V">
|
||||||
<!ENTITY sendtophoneFileTransfers.label "Dosya transferleri">
|
<!ENTITY sendtophoneFileTransfers.label "Dosya aktarımları">
|
||||||
<!ENTITY sendtophoneFileServer.label "Sunucu">
|
<!ENTITY sendtophoneFileServer.label "Sunucu">
|
||||||
<!ENTITY sendtophoneFileServer.None "Hiç">
|
<!ENTITY sendtophoneFileServer.None "Hiç">
|
||||||
<!ENTITY sendtophoneFileServer.Custom "Özel">
|
<!ENTITY sendtophoneFileServer.Custom "Özel">
|
||||||
<!ENTITY sendtophoneFileServer.Disclaimer "Yasal Uyarı: Biz (FoxToPhone geliştiriciler) burada listelenen üçüncü taraf barındırma hizmetleri ile bağlantılı değildir. Siz bunları kullanmadan önce Hizmet Şartlarını okumalısınız.">
|
<!ENTITY sendtophoneFileServer.Disclaimer "Yasal Uyarı: Bizim (FoxToPhone geliştiricileri) burada listelenen üçüncü taraf barındırma hizmetleriyle bağlantımız yoktur. Bunları kullanmadan önce servisin kendi koşullarını okumalısınız.">
|
||||||
<!ENTITY sendtophonePhoneAccounts.label "Telefon hesapları">
|
<!ENTITY sendtophonePhoneAccounts.label "Telefon hesapları">
|
||||||
<!ENTITY sendtophonePhoneAccounts.description "Cihazınızda birden fazla Google hesabı kullanıyorsanız,bu hesapları burada oluşturdktan sonra aralarında geçiş yapabilirsiniz.">
|
<!ENTITY sendtophonePhoneAccounts.description "Eğer cihazınızda birkaç Google hesabı kullanıyorsanız, burada oluşturduktan sonra bunlar arasında geçiş yapabilirsiniz.">
|
||||||
<!ENTITY sendtophonePhoneAccounts.add "Yeni ekle">
|
<!ENTITY sendtophonePhoneAccounts.add "Yeni ekle">
|
||||||
<!ENTITY sendtophonePhoneAccounts.rename "Yeniden adlandır">
|
<!ENTITY sendtophonePhoneAccounts.rename "Yeniden adlandır">
|
||||||
<!ENTITY sendtophonePhoneAccounts.remove "Sil">
|
<!ENTITY sendtophonePhoneAccounts.remove "Kaldır">
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
extensions.sendtophone@martinezdelizarrondo.com.description=Var olan sayfayı telefona gönderir
|
extensions.sendtophone@martinezdelizarrondo.com.description=Geçerli sayfayı Android telefonunuza gönderir
|
||||||
SendToPhoneTitle=Fox To Phone
|
SendToPhoneTitle=Fox To Phone
|
||||||
InvalidScheme=Geçersiz şema, sadece http:// veya https:// bağlantılar gönderebilirsiniz.
|
InvalidScheme=Geçersiz düzen,lütfen sadece http:// veya https:// bağlantısı gönderin.
|
||||||
InfoSent=Bağlantı telefona gönderildi.
|
InfoSent=Bağlantı telefonunuza gönderildi.
|
||||||
ErrorOnSend=Gönderimde bir hata oluştu:
|
ErrorOnSend=Gönderirken bir hata oluştu:
|
||||||
LoginRequired=Bağlantıyı göndermek için giriş gerekli
|
LoginRequired=Bağlantı göndermek için giriş gerekli.
|
||||||
LoginSuccessful=Giriş yaptınız.
|
LoginSuccessful=Giriş yaptınız.
|
||||||
DeviceNotRegistered=Bu GMail hesabına kayıtlı chrometophone.apk dosyasını telefonunuza yüklemeniz gerekiyor.
|
DeviceNotRegistered=GMail hesabına kayıtlı telefonunuza chrometophone.apk yüklemeniz gerekir.
|
||||||
LogoutSuccessful=Çıkış yaptınız.
|
LogoutSuccessful=Çıkış yaptınız
|
||||||
marketLink=Market Bağlantısı
|
marketLink=Market Bağlantısı
|
||||||
smsLink=SMS Numarası
|
smsLink=SMS Numarası
|
||||||
smstoLink=SMS Numarası
|
smstoLink=SMS Numarası
|
||||||
telLink=Telefon Numarası
|
telLink=Telefon Numarası
|
||||||
InvalidFile=Geçerli bir dosya değil
|
InvalidFile=Geçersiz dosya
|
||||||
SendFileToPhone=Dosyaları telefona gönder
|
SendFileToPhone=Telefona dosya gönder.
|
||||||
SendFolderToPhone=Klasörleri telefona gönder
|
SendFolderToPhone=Telefona klasör gönder.
|
||||||
qrTitle=QR Görüntü Bağlantısı
|
qrTitle=QR Görüntü Bağlantısı
|
||||||
ConfirmQR=Bir QR görüntüsü tespit edildin"%s"n Bunu göndermek istiyor musunuz?
|
ConfirmQR=Bir QR görüntüsü tespit edildi\n"%s"\nSayfanın yerine bunu göndermek istiyor musunuz?
|
||||||
RememberMyDecision=Seçimimi hatırla
|
RememberMyDecision=Seçimlerimi hatırla
|
||||||
qrContextMenu="% s" yi Android'e gönder
|
qrContextMenu="%s" Android'e gönder
|
||||||
FileUploadsDisabled=Bu dosyaları telefona yüklemek mümkün değil.
|
FileUploadsDisabled=Bu telefona dosya yüklemek mümkün değil.
|
||||||
FileTooBig=Dosya çok büyük.
|
FileTooBig=Dosya çok büyük.
|
||||||
videoTitle=Video Bağlantısı
|
videoTitle=Video Bağlantısı
|
||||||
PhoneAccountPromptAdd=Yeni hesap için lütfen bir isim yazın
|
PhoneAccountPromptAdd=Lütfen, yeni hesabın adını yazın
|
||||||
PhoneAccountPromptRename=Bu hesap için lütfen bir isim yazın
|
PhoneAccountPromptRename=Lütfen, bu hesap için yeni bir ad yazın
|
||||||
PhoneAccountPromptRemove=Bu hesabı silmek istediğinizden emin misiniz?
|
PhoneAccountPromptRemove=Bu hesabı silmek istediğinizden emin misiniz?
|
||||||
|
|||||||
7
third_party/firefox_sendtophone/install.rdf
vendored
7
third_party/firefox_sendtophone/install.rdf
vendored
@@ -4,7 +4,7 @@
|
|||||||
<em:id>sendtophone@martinezdelizarrondo.com</em:id>
|
<em:id>sendtophone@martinezdelizarrondo.com</em:id>
|
||||||
<em:type>2</em:type>
|
<em:type>2</em:type>
|
||||||
<em:name>Fox To Phone</em:name>
|
<em:name>Fox To Phone</em:name>
|
||||||
<em:version>1.2.2</em:version>
|
<em:version>1.2.3</em:version>
|
||||||
<em:creator>Alfonso & Patrick</em:creator>
|
<em:creator>Alfonso & Patrick</em:creator>
|
||||||
<em:description>Send links to your Android 2.2 phone using the new C2DM service. Based on the ChromeToPhone extension.</em:description>
|
<em:description>Send links to your Android 2.2 phone using the new C2DM service. Based on the ChromeToPhone extension.</em:description>
|
||||||
|
|
||||||
@@ -26,12 +26,13 @@
|
|||||||
<em:contributor>Michał Jakubowski :: revanmj (Polish)</em:contributor>
|
<em:contributor>Michał Jakubowski :: revanmj (Polish)</em:contributor>
|
||||||
<em:contributor>Fırat Avcı, omrakin (Turkish)</em:contributor>
|
<em:contributor>Fırat Avcı, omrakin (Turkish)</em:contributor>
|
||||||
<em:contributor>Jose Sun (Chinese traditional)</em:contributor>
|
<em:contributor>Jose Sun (Chinese traditional)</em:contributor>
|
||||||
|
<em:contributor>antonio.cat (Catalan)</em:contributor>
|
||||||
|
|
||||||
<em:targetApplication>
|
<em:targetApplication>
|
||||||
<Description>
|
<Description>
|
||||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
|
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
|
||||||
<em:minVersion>3.6</em:minVersion>
|
<em:minVersion>3.6</em:minVersion>
|
||||||
<em:maxVersion>9.*</em:maxVersion>
|
<em:maxVersion>16.*</em:maxVersion>
|
||||||
</Description>
|
</Description>
|
||||||
</em:targetApplication>
|
</em:targetApplication>
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
<!-- SeaMonkey -->
|
<!-- SeaMonkey -->
|
||||||
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
|
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
|
||||||
<em:minVersion>2.1</em:minVersion>
|
<em:minVersion>2.1</em:minVersion>
|
||||||
<em:maxVersion>2.3.*</em:maxVersion>
|
<em:maxVersion>2.6.*</em:maxVersion>
|
||||||
</Description>
|
</Description>
|
||||||
</em:targetApplication>
|
</em:targetApplication>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ var EXPORTED_SYMBOLS = [];
|
|||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
|
|
||||||
|
//XXXgijs: Because necko is annoying and doesn't expose this error flag, we
|
||||||
|
// define our own constant for it. Throwing something else will show
|
||||||
|
// ugly errors instead of seeminly doing nothing.
|
||||||
|
const NS_ERROR_MODULE_NETWORK_BASE = 0x804b0000;
|
||||||
|
const NS_ERROR_NO_CONTENT = NS_ERROR_MODULE_NETWORK_BASE + 17;
|
||||||
|
|
||||||
|
|
||||||
var manager = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
var manager = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
var strings = Cc["@mozilla.org/intl/stringbundle;1"]
|
var strings = Cc["@mozilla.org/intl/stringbundle;1"]
|
||||||
.getService(Ci.nsIStringBundleService)
|
.getService(Ci.nsIStringBundleService)
|
||||||
@@ -14,10 +21,10 @@ var strings = Cc["@mozilla.org/intl/stringbundle;1"]
|
|||||||
// Utility function to handle the preferences
|
// Utility function to handle the preferences
|
||||||
// https://developer.mozilla.org/en/Code_snippets/Preferences
|
// https://developer.mozilla.org/en/Code_snippets/Preferences
|
||||||
function PrefListener(branchName, func) {
|
function PrefListener(branchName, func) {
|
||||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
var prefService = Cc["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Ci.nsIPrefService);
|
.getService(Ci.nsIPrefService);
|
||||||
var branch = prefService.getBranch(branchName);
|
var branch = prefService.getBranch(branchName);
|
||||||
branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
branch.QueryInterface(Ci.nsIPrefBranch2);
|
||||||
|
|
||||||
this.register = function() {
|
this.register = function() {
|
||||||
branch.addObserver("", this, false);
|
branch.addObserver("", this, false);
|
||||||
@@ -60,28 +67,20 @@ function SendToPhone_ProtocolWrapper( properties )
|
|||||||
// nsIProtocolHandler implementation:
|
// nsIProtocolHandler implementation:
|
||||||
|
|
||||||
// default attributes
|
// default attributes
|
||||||
protocolFlags : Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
|
protocolFlags : Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE | Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
|
||||||
defaultPort : -1,
|
defaultPort : -1,
|
||||||
|
|
||||||
newURI : function(aSpec, aCharset, aBaseURI)
|
newURI : function(aSpec, aCharset, aBaseURI)
|
||||||
{
|
{
|
||||||
var uri = Components.classes["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
|
var uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
|
||||||
uri.spec = aSpec;
|
uri.spec = aSpec;
|
||||||
return uri;
|
return uri;
|
||||||
},
|
},
|
||||||
|
|
||||||
newChannel : function(aURI)
|
newChannel : function(aURI)
|
||||||
{
|
{
|
||||||
var myURI = decodeURI(aURI.spec);
|
// Use our channel implementation
|
||||||
|
return new BogusChannel(aURI, this.linkTitle);
|
||||||
// Core functions loaded on demand
|
|
||||||
if (typeof sendtophoneCore == "undefined")
|
|
||||||
Components.utils.import("resource://sendtophone/sendtophone.js");
|
|
||||||
|
|
||||||
sendtophoneCore.send(this.linkTitle, myURI, "")
|
|
||||||
|
|
||||||
// return a fake empty channel so current window doesn't change
|
|
||||||
return Components.classes[ "@mozilla.org/network/input-stream-channel;1" ].createInstance(Ci.nsIChannel);
|
|
||||||
},
|
},
|
||||||
scheme : properties.scheme,
|
scheme : properties.scheme,
|
||||||
classDescription : "SendToPhone handler for " + properties.scheme,
|
classDescription : "SendToPhone handler for " + properties.scheme,
|
||||||
@@ -93,6 +92,78 @@ function SendToPhone_ProtocolWrapper( properties )
|
|||||||
return myHandler;
|
return myHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* bogus nsiChannel copied from Chatzilla */
|
||||||
|
function BogusChannel(URI, linkTitle)
|
||||||
|
{
|
||||||
|
this.URI = URI;
|
||||||
|
this.linkTitle = linkTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
BogusChannel.prototype.QueryInterface =
|
||||||
|
function bc_QueryInterface(iid)
|
||||||
|
{
|
||||||
|
if (!iid.equals(Ci.nsIChannel) && !iid.equals(Ci.nsIRequest) &&
|
||||||
|
!iid.equals(Ci.nsISupports))
|
||||||
|
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nsIChannel */
|
||||||
|
BogusChannel.prototype.loadAttributes = null;
|
||||||
|
BogusChannel.prototype.contentLength = 0;
|
||||||
|
BogusChannel.prototype.owner = null;
|
||||||
|
BogusChannel.prototype.loadGroup = null;
|
||||||
|
BogusChannel.prototype.notificationCallbacks = null;
|
||||||
|
BogusChannel.prototype.securityInfo = null;
|
||||||
|
|
||||||
|
BogusChannel.prototype.open =
|
||||||
|
BogusChannel.prototype.asyncOpen =
|
||||||
|
function bc_open(observer, ctxt)
|
||||||
|
{
|
||||||
|
// Core functions are loaded on demand
|
||||||
|
if (typeof sendtophoneCore == "undefined")
|
||||||
|
Components.utils.import("resource://sendtophone/sendtophone.js");
|
||||||
|
|
||||||
|
sendtophoneCore.send(this.linkTitle, decodeURI(this.URI.spec), "")
|
||||||
|
|
||||||
|
|
||||||
|
// We don't throw this (a number, not a real 'resultcode') because it
|
||||||
|
// upsets xpconnect if we do (error in the js console).
|
||||||
|
Components.returnCode = NS_ERROR_NO_CONTENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
BogusChannel.prototype.asyncRead =
|
||||||
|
function bc_asyncRead(listener, ctxt)
|
||||||
|
{
|
||||||
|
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nsIRequest */
|
||||||
|
BogusChannel.prototype.isPending =
|
||||||
|
function bc_isPending()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BogusChannel.prototype.status = Components.results.NS_OK;
|
||||||
|
|
||||||
|
BogusChannel.prototype.cancel =
|
||||||
|
function bc_cancel(status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
BogusChannel.prototype.suspend =
|
||||||
|
BogusChannel.prototype.resume =
|
||||||
|
function bc_suspres()
|
||||||
|
{
|
||||||
|
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
/* /bogus nsiChannel */
|
||||||
|
|
||||||
// This function takes care of register/unregister the protocol handlers as requested
|
// This function takes care of register/unregister the protocol handlers as requested
|
||||||
// It's called when the preferences change.
|
// It's called when the preferences change.
|
||||||
function toggleProtocolHandler(branch, name)
|
function toggleProtocolHandler(branch, name)
|
||||||
@@ -137,3 +208,11 @@ var sendToPhoneProtocols = {
|
|||||||
// Listen for changes in the preferences and register the protocols as needed.
|
// Listen for changes in the preferences and register the protocols as needed.
|
||||||
var preferencesListener = new PrefListener("extensions.sendtophone.protocols.", toggleProtocolHandler);
|
var preferencesListener = new PrefListener("extensions.sendtophone.protocols.", toggleProtocolHandler);
|
||||||
preferencesListener.register();
|
preferencesListener.register();
|
||||||
|
|
||||||
|
// Outputs log message to the console
|
||||||
|
function log( text )
|
||||||
|
{
|
||||||
|
Cc["@mozilla.org/consoleservice;1"]
|
||||||
|
.getService(Ci.nsIConsoleService)
|
||||||
|
.logStringMessage( "foxtophone prococolHandler: " + text );
|
||||||
|
}
|
||||||
@@ -466,12 +466,6 @@ var sendtophoneCore = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( uri == "http://min.us" )
|
|
||||||
{
|
|
||||||
Minus.SendFile(nsFile, callback);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sendFileXHR( nsFile, callback, uri, 'upload', function(target, uploadName)
|
this.sendFileXHR( nsFile, callback, uri, 'upload', function(target, uploadName)
|
||||||
{
|
{
|
||||||
var body = target.responseXML,
|
var body = target.responseXML,
|
||||||
@@ -614,45 +608,6 @@ var sendtophoneCore = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// http://min.us/
|
|
||||||
var Minus = {
|
|
||||||
prefix: 'http://min.us/api/',
|
|
||||||
|
|
||||||
SendFile : function(nsFile, callback) {
|
|
||||||
// Create a gallery
|
|
||||||
sendtophoneCore.processXHR( Minus.prefix + 'CreateGallery', 'GET', null, null, function(req) {
|
|
||||||
var body = req.responseText;
|
|
||||||
|
|
||||||
if (body.substring(0, 1) != '{')
|
|
||||||
{
|
|
||||||
sendtophoneCore.alert(sendtophoneCore.getString("ErrorOnSend") + ' (status ' + req.status + ')\r\n' + body);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var gallery = JSON.parse( body );
|
|
||||||
// Send the file
|
|
||||||
sendtophoneCore.sendFileXHR(nsFile, callback, Minus.prefix +
|
|
||||||
'UploadItem?editor_id=' + gallery.editor_id + '&key=OK&filename=' + encodeURIComponent(nsFile.leafName), 'file',
|
|
||||||
function(target, uploadName)
|
|
||||||
{
|
|
||||||
var body = target.responseText;
|
|
||||||
if (body.substring(0, 1) != '{')
|
|
||||||
{
|
|
||||||
sendtophoneCore.alert(sendtophoneCore.getString("ErrorOnSend") + ' (status ' + req.status + ')\r\n' + body);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var file = JSON.parse( body );
|
|
||||||
// var url = "http://k.min.us/j" + file.id;
|
|
||||||
var url = "http://min.us/m" + gallery.reader_id;
|
|
||||||
sendtophoneCore.send(uploadName, url, "");
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Zipping functions */
|
/* Zipping functions */
|
||||||
const PR_RDONLY = 0x01;
|
const PR_RDONLY = 0x01;
|
||||||
const PR_WRONLY = 0x02;
|
const PR_WRONLY = 0x02;
|
||||||
|
|||||||
Reference in New Issue
Block a user