Send URL encoded in a QR image created by the Google Charts API

This commit is contained in:
patrick.oreilly
2010-08-06 22:36:10 +00:00
parent d2632102ca
commit a1c780b6e6
14 changed files with 47 additions and 10 deletions

View File

@@ -54,6 +54,29 @@ var sendtophone = {
title = gContextMenu.target.title || gContextMenu.target.alt;
url = gContextMenu.imageURL;
selection = '';
// Detect images of QR codes generated by the Google Charts API
// Extract the URI if valid and sendtophone
var qrPref = this.prefs.getBoolPref( "qrlink" ) ;
var chartType="cht=qr";
var chartLink="chl=";
var chartUrl="http://chart.apis.google.com/chart?";
if(!url.indexOf(chartUrl)&&url.match(chartType)&&qrPref){
qrUrl=url.replace(chartUrl, '');
qrArray = qrUrl.split("&");
for(qrI=0;qrI<qrArray.length;qrI++){
if(!qrArray[qrI].indexOf(chartLink)){
//Decode and Unescape any URL encoded in the QR Image Link
qrUrl=decodeURI(unescape(qrArray[qrI].replace(chartLink, '')));
if(this.validURI(qrUrl)){
url=qrUrl;
}
}
}
if(!title){
title=this.strings.getString("qrTitle");
}
}
break;
case 'text':
title = "Selection";

View File

@@ -15,3 +15,4 @@ mmstoLink=MMS-Nummer
telLink=Telefonnummer
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -16,3 +16,4 @@ telLink=Telephone Number
InvalidFile=Not a valid file
SendFileToPhone=Send files to your phone.
SendFolderToPhone=Send a folder to your phone.
qrTitle=QR Image Link

View File

@@ -16,3 +16,4 @@ telLink=Número de teléfono
InvalidFile=Solo se puede enviar un fichero cada vez.
SendFileToPhone=Envía ficheros al teléfono.
SendFolderToPhone=Envía una carpeta al teléfono.
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=Nombre MMS
telLink=Numéro de téléphone
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=Uimhir MMS
telLink=Uimhir Theileafóin
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=एमएमएस संख्या
telLink=टेलीफोन नंबर
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=Numero di MMS
telLink=Numero di telefono
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=MMSの数
telLink=電話番号
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=MMS-nummer
telLink=Telefoonnummer
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=Количество MMS
telLink=номер телефона
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=MMS nummer
telLink=Telefonnummer
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -15,3 +15,4 @@ mmstoLink=彩信号码
telLink=电话号码
InvalidFile=Not a valid file
SendFileToPhone=Send a file to your phone
qrTitle=QR Image Link

View File

@@ -11,5 +11,7 @@ pref("extensions.sendtophone.protocols.mms", false); // conflicts with http://en
pref("extensions.sendtophone.protocols.mmsto", true);
pref("extensions.sendtophone.protocols.tel", true);
pref("extensions.sendtophone.qrlink", true);
// https://developer.mozilla.org/en/Localizing_extension_descriptions
pref("extensions.sendtophone@martinezdelizarrondo.com.description", "chrome://sendtophone/locale/overlay.properties");