diff --git a/third_party/firefox_sendtophone/chrome/content/ff-overlay.js b/third_party/firefox_sendtophone/chrome/content/ff-overlay.js index f985977..935f328 100644 --- a/third_party/firefox_sendtophone/chrome/content/ff-overlay.js +++ b/third_party/firefox_sendtophone/chrome/content/ff-overlay.js @@ -84,7 +84,7 @@ sendtophone.onOptionsShowing= function(popup) sendtophone.showFirefoxContextMenu = function(event) { // show or hide the menuitem based on what the context menu is on // see http://kb.mozillazine.org/Adding_items_to_menus - var mediaURL = gContextMenu.imageURL || gContextMenu.mediaURL; + var mediaURL = gContextMenu.mediaURL; gContextMenu.showItem("context-sendtophone-link", gContextMenu.onLink); gContextMenu.showItem("context-sendtophone-image", false); @@ -103,10 +103,11 @@ sendtophone.showFirefoxContextMenu = function(event) { else gContextMenu.showItem("context-sendtophone-image", true); } - - if(mediaURL.match(/.(webm|mp4|m4v)$/i)){ + /* TBC + if(mediaURL.match(/.webm$/i)){ gContextMenu.showItem("context-sendtophone-video", true); } + */ gContextMenu.showItem("context-sendtophone-text", gContextMenu.isTextSelected || (gContextMenu.onTextInput && gContextMenu.target.selectionEnd > gContextMenu.target.selectionStart) ); diff --git a/third_party/firefox_sendtophone/chrome/content/overlay.js b/third_party/firefox_sendtophone/chrome/content/overlay.js index 7f70636..0813f68 100644 --- a/third_party/firefox_sendtophone/chrome/content/overlay.js +++ b/third_party/firefox_sendtophone/chrome/content/overlay.js @@ -73,17 +73,17 @@ var sendtophone = { break; case 'image': title = gContextMenu.target.title || gContextMenu.target.alt; - url = gContextMenu.imageURL || gContextMenu.mediaURL; + url = gContextMenu.mediaURL; break; case 'video': title = gContextMenu.target.title || gContextMenu.target.alt; - url = gContextMenu.imageURL || gContextMenu.mediaURL; + url = gContextMenu.mediaURL; if(!title) title=this.getString("videoTitle"); break; case 'qr': title = gContextMenu.target.title || gContextMenu.target.alt; - url = gContextMenu.imageURL; + url = gContextMenu.mediaURL; var data = this.detectQR(url); if (this.validURI(data)) diff --git a/third_party/firefox_sendtophone/defaults/preferences/prefs.js b/third_party/firefox_sendtophone/defaults/preferences/prefs.js index d0da42e..eea0548 100644 --- a/third_party/firefox_sendtophone/defaults/preferences/prefs.js +++ b/third_party/firefox_sendtophone/defaults/preferences/prefs.js @@ -1,8 +1,8 @@ pref("extensions.sendtophone.installedButton", false); pref("extensions.sendtophone.appUrl", "https://chrometophone.appspot.com"); -pref("extensions.sendtophone.proxyUrl", "http://foxtophone.com/?ml="); -pref("extensions.sendtophone.fileServerUrl", "http://martinezdelizarrondo.com/sendtophone.php"); +pref("extensions.sendtophone.proxyUrl", "http://foxtophone.com/"); +pref("extensions.sendtophone.fileServerUrl", ""); pref("extensions.sendtophone.fileUploadMaxKb", 50000); pref("extensions.sendtophone.SearchQR", 0); // 0: search and prompt, 1: search and launch automatically, 2: don't search diff --git a/third_party/firefox_sendtophone/modules/sendtophone.js b/third_party/firefox_sendtophone/modules/sendtophone.js index 01e93ba..41594f1 100644 --- a/third_party/firefox_sendtophone/modules/sendtophone.js +++ b/third_party/firefox_sendtophone/modules/sendtophone.js @@ -26,6 +26,7 @@ var sendtophoneCore = { loggedInUrl : "http://code.google.com/p/chrometophone/logo?login", loggedOutUrl : "http://code.google.com/p/chrometophone/logo?logout", apkUrl : "http://code.google.com/p/chrometophone/wiki/AndroidApp", + retryCount : 0, init: function() { @@ -134,7 +135,8 @@ var sendtophoneCore = { if (req.status==500 && body.substr(0,27) =="ERROR (Unable to send link)"){ sendtophoneCore.openTab( "http://www.foxtophone.com/status500/" ); } - else if (req.status==400){ + else if (req.status==400&&this.retryCount<4){ + this.retryCount++; this.processXHR(this.sendUrl, 'POST', this.pendingMessage, this.processSentData); } else @@ -192,9 +194,10 @@ var sendtophoneCore = { if (!(/^(https?):/i).test( url )) { // Rewrite the URI so it's send first to the proxy - var proxyUrl = this.prefs.getCharPref( "proxyUrl" ); + var proxyUrl; + this.prefs.getCharPref( "fileServerUrl" ) ? proxyUrl = this.prefs.getCharPref( "fileServerUrl" ) :proxyUrl = this.prefs.getCharPref( "proxyUrl" ); if (proxyUrl) - url = proxyUrl + encodeURIComponent( url); + url = proxyUrl + "?ml=" + encodeURIComponent( url); } var data = 'title=' + encodeURIComponent(title) + @@ -211,6 +214,7 @@ var sendtophoneCore = { if (body.substring(0, 2) == 'OK') { delete this.pendingMessage; + this.retryCount=0; this.popupNotification(this.getString("InfoSent")); return; }