Added context menu option to highlight an email address in a page and send to phone as a mailto link. (issue 187)

Updated German locale.
Version number bump.
This commit is contained in:
patrick.oreilly
2010-08-29 19:45:10 +00:00
parent 672f83fd75
commit c20a12cee5
22 changed files with 84 additions and 29 deletions

View File

@@ -111,7 +111,10 @@ sendtophone.showFirefoxContextMenu = function(event) {
gContextMenu.showItem("context-sendtophone-text", gContextMenu.isTextSelected ||
(gContextMenu.onTextInput && gContextMenu.target.selectionEnd > gContextMenu.target.selectionStart) );
gContextMenu.showItem("context-sendtophone-email", (gContextMenu.isTextSelected ||
(gContextMenu.onTextInput && gContextMenu.target.selectionEnd > gContextMenu.target.selectionStart))&&
this.detectEmail(this.selectText())
);
gContextMenu.showItem("context-sendtophone-page", !( gContextMenu.inDirList || gContextMenu.isContentSelected || gContextMenu.onTextInput || gContextMenu.onLink || gContextMenu.onImage ));
};

View File

@@ -61,6 +61,11 @@
accesskey="&sendtophoneContextText.accesskey;"
insertafter="context-searchselect"
oncommand="sendtophone.onMenuItemCommand(event, 'text')"/>
<menuitem id="context-sendtophone-email" label="&sendtophoneContextEmail.label;"
class="menuitem-iconic"
accesskey="&sendtophoneContextEmail.accesskey;"
insertafter="context-searchselect"
oncommand="sendtophone.onMenuItemCommand(event, 'email')"/>
<menuitem id="context-sendtophone-page" label="&sendtophoneContextPage.label;"
class="menuitem-iconic"
accesskey="&sendtophoneContextPage.accesskey;"

View File

@@ -62,6 +62,26 @@ var sendtophone = {
}
},
detectEmail: function ( email ){
var exEmail=/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
return email.match(exEmail);
},
selectText: function (){
var input = gContextMenu.target;
if (gContextMenu.onTextInput && input && input.value)
{
selectedText = input.value.substring(input.selectionStart, input.selectionEnd);
}
else
{
// Get the selection from the correct iframe
var focusedWindow = document.commandDispatcher.focusedWindow;
selectedText = focusedWindow.getSelection().toString();
}
return selectedText;
},
onMenuItemCommand: function(e, type)
{
var title, url, selection = '';
@@ -99,17 +119,12 @@ var sendtophone = {
case 'text':
title = "Selection";
url = 'http://google.com/';
var input = gContextMenu.target;
if (gContextMenu.onTextInput && input && input.value)
{
selection = input.value.substring(input.selectionStart, input.selectionEnd);
}
else
{
// Get the selection from the correct iframe
var focusedWindow = document.commandDispatcher.focusedWindow;
selection = focusedWindow.getSelection().toString();
}
selection = this.selectText();
case 'email':
title = "Selected EMail Address";
url = "mailto:"+this.selectText();
selection = "";
break;
case 'pageButton':

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Odeslat video do telefonu">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -1,4 +1,4 @@
<!ENTITY sendtophoneToolbarButton.label "Fox to Phone">
<!ENTITY sendtophoneToolbarButton.label "Fox To Phone">
<!ENTITY sendtophoneToolbarButton.tooltip "Diese Seite auf Ihr Android Gerät schicken.">
<!ENTITY sendtophoneContext.label "Link auf Android senden">
<!ENTITY sendtophoneContext.accesskey "A">
@@ -10,15 +10,18 @@
<!ENTITY sendtophoneContextPage.accesskey "A">
<!ENTITY sendtophoneContextLogout.label "Abmelden">
<!ENTITY sendtophoneContextLogout.accesskey "L">
<!ENTITY sendtophoneOptions.title "Send To Phone Einstellungen">
<!ENTITY sendtophoneOptions.title "Fox To Phone Einstellungen">
<!ENTITY sendtophoneProtocols.label "Protokolle">
<!ENTITY sendtophoneContextSendFile.label "Send files...">
<!ENTITY sendtophoneContextSendFile.label "Dateien senden ...">
<!ENTITY sendtophoneContextSendFile.accesskey "S">
<!ENTITY sendtophoneContextSendFolder.label "Send folder...">
<!ENTITY sendtophoneContextSendFolder.label "Send Ordner ...">
<!ENTITY sendtophoneContextSendFolder.accesskey "F">
<!ENTITY sendtophoneContextQrImage.label "Send decoded QR Link to Android">
<!ENTITY sendtophoneContextQrImage.label "Send dekodiert QR Link zum Android">
<!ENTITY sendtophoneContextQrImage.accesskey "Q">
<!ENTITY sendtophoneContextSendClipboard.label "Send Clipboard">
<!ENTITY sendtophoneContextSendClipboard.label "Send Merkzettel">
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.label "Senden Video zum Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Senden Email zum Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -11,13 +11,13 @@ marketLink=Market Link
smsLink=SMS-Nummer
smstoLink=SMS-Nummer
telLink=Telefonnummer
InvalidFile=Not a valid file
SendFileToPhone=Send files to your phone.
SendFolderToPhone=Send a folder to your phone.
qrTitle=QR Image Link
ConfirmQR=A QR image has been detected\n"%s"\nDo you want to send that instead of the page?
InvalidFile=Nicht eine gültige Datei
SendFileToPhone=Senden Sie Dateien auf Ihr Handy.
SendFolderToPhone=Senden Sie einen Ordner auf Ihrem Telefon.
qrTitle=QR-Bild Link
ConfirmQR=Ein QR-Bild wurde erkannt\n"%s"\nMöchten Sie senden möchten, dass anstelle der Seite?
RememberMyDecision=Auswahl merken
qrContextMenu=Send "%s" to Android
FileUploadsDisabled=It's not possible to upload files to the phone.
FileTooBig=The file is too big.
qrContextMenu=Senden "%s" auf Android
FileUploadsDisabled=Es ist nicht möglich, Dateien auf das Telefon laden.
FileTooBig=Die Datei ist zu groß.
videoTitle=Video Link

View File

@@ -1 +1 @@
<!ENTITY compressing.label "Compressing folder">
<!ENTITY compressing.label "Komprimieren von Ordner">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Enviar video a Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Seol Video chun Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Seol riomhpost chun Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Videó küldése az Androidra">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -18,3 +18,5 @@
<!ENTITY sendtophoneContextSendFolder.accesskey "F">
<!ENTITY sendtophoneContextQrImage.label "Send decoded QR Link to Android">
<!ENTITY sendtophoneContextQrImage.accesskey "Q">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "Т">
<!ENTITY sendtophoneContextVideo.label "Пошаљи видео на Андроид">
<!ENTITY sendtophoneContextVideo.accesskey "Д">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -0,0 +1 @@
<!ENTITY compressing.label "Compressing folder">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -22,3 +22,5 @@
<!ENTITY sendtophoneContextSendClipboard.accesskey "C">
<!ENTITY sendtophoneContextVideo.label "Send Video to Android">
<!ENTITY sendtophoneContextVideo.accesskey "V">
<!ENTITY sendtophoneContextEmail.label "Send this email to Android">
<!ENTITY sendtophoneContextEmail.accesskey "E">

View File

@@ -4,7 +4,7 @@
<em:id>sendtophone@martinezdelizarrondo.com</em:id>
<em:type>2</em:type>
<em:name>Fox To Phone</em:name>
<em:version>1.1</em:version>
<em:version>1.2</em:version>
<em:creator>Alfonso &amp; 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>