mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Opera to Phone v1.3.1
This commit is contained in:
4
third_party/operatophone/config.xml
vendored
4
third_party/operatophone/config.xml
vendored
@@ -1,8 +1,8 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget xmlns="http://www.w3.org/ns/widgets" id="https://addons.opera.com/addons/extensions/details/operatophone/" version="1.3">
|
||||
<widget xmlns="http://www.w3.org/ns/widgets" id="https://addons.opera.com/addons/extensions/details/operatophone/" version="1.3.1">
|
||||
<name>Opera to Phone</name>
|
||||
<description>Seamlessly push links, maps, youtube videos, phone numbers and text directly to your Android device. Requires a mobile phone running Android 2.2+ and the 'Chrome to Phone' application.</description>
|
||||
<author email="rich.tibbett@gmail.com">Rich Tibbett</author>
|
||||
<author href="http://my.opera.com/richtr/blog/2010/12/13/opera-to-phone-extension-support-page">Rich Tibbett</author>
|
||||
<access origin="https://chrometophone.appspot.com"/>
|
||||
<icon src="icon_64.png"/>
|
||||
<license>
|
||||
|
||||
4
third_party/operatophone/constants.js
vendored
4
third_party/operatophone/constants.js
vendored
@@ -8,9 +8,9 @@ var apiVersion = 5;
|
||||
var baseUrl = 'https://chrometophone.appspot.com';
|
||||
var sendUrl = baseUrl + '/send?ver=' + apiVersion;
|
||||
var signInUrl = baseUrl + '/signin?extret=' +
|
||||
encodeURIComponent('http://code.google.com/p/chrometophone/logo') + '?login&ver=' + apiVersion;;
|
||||
encodeURIComponent('http://code.google.com/p/chrometophone/logo') + '?login&ver=' + apiVersion;
|
||||
var signOutUrl = baseUrl + '/signout?extret=' +
|
||||
encodeURIComponent('http://code.google.com/p/chrometophone/logo') + '?logout&ver=' + apiVersion;;
|
||||
encodeURIComponent('http://code.google.com/p/chrometophone/logo') + '?logout&ver=' + apiVersion;
|
||||
var registerUrl = baseUrl + '/register?ver=' + apiVersion;
|
||||
var apkUrl = 'http://code.google.com/p/chrometophone/wiki/AndroidApp';
|
||||
|
||||
|
||||
2
third_party/operatophone/index.html
vendored
2
third_party/operatophone/index.html
vendored
@@ -60,7 +60,7 @@ function onMessage( message ) {
|
||||
case ACTION_OPEN_TAB:
|
||||
if(message.data.data && message.data.data.url) {
|
||||
var tabData = {
|
||||
url: message.data.data.url,
|
||||
url: message.data.data.url,
|
||||
focused: true
|
||||
};
|
||||
opera.extension.tabs.create( tabData );
|
||||
|
||||
6
third_party/operatophone/o2p_help.html
vendored
6
third_party/operatophone/o2p_help.html
vendored
File diff suppressed because one or more lines are too long
29
third_party/operatophone/popup.html
vendored
29
third_party/operatophone/popup.html
vendored
@@ -26,29 +26,26 @@ function loadHandler() {
|
||||
opera.extension.postMessage({
|
||||
action: ACTION_OPEN_TAB,
|
||||
data: {
|
||||
url: '/o2p_help.html'
|
||||
url: '/o2p_help.html?' + Math.floor(Math.random()*1e10) // to prevent caching issue
|
||||
}
|
||||
});
|
||||
closeWindow();
|
||||
}, false );
|
||||
signOutLink.href = signOutUrl;
|
||||
signOutLink.addEventListener( 'click', closeWindow, false );
|
||||
|
||||
// Callback from the background process
|
||||
opera.extension.addEventListener( 'message', function( message ) {
|
||||
var msgRcvd = false;
|
||||
switch(message.data.action) {
|
||||
case STATUS_SUCCESS:
|
||||
msg.innerHTML = "Sent to phone."
|
||||
setSignoutVisibility(true);
|
||||
window.setTimeout(function() {
|
||||
window.close();
|
||||
}, 3000);
|
||||
msgRcvd = true;
|
||||
break;
|
||||
case STATUS_LOGIN_REQUIRED:
|
||||
var signinLink = '<a id="signin" href="' + signInUrl + '" target="_o2pTab">sign in</a>';
|
||||
var signinLink = '<a href="' + signInUrl + '" target="_o2pTab_ext">sign in</a>';
|
||||
msg.innerHTML = "Please " + signinLink + " to Opera to Phone.";
|
||||
document.getElementById('signin').addEventListener( 'click', closeWindow, false );
|
||||
setSignoutVisibility(false);
|
||||
msgRcvd = true;
|
||||
break;
|
||||
case STATUS_DEVICE_NOT_REGISTERED:
|
||||
opera.extension.postMessage({
|
||||
@@ -59,20 +56,26 @@ function loadHandler() {
|
||||
});
|
||||
msg.innerHTML = "Device not registered for user.";
|
||||
setSignoutVisibility(true);
|
||||
msgRcvd = true;
|
||||
break;
|
||||
case STATUS_NO_TAB_ACCESS:
|
||||
msg.innerHTML = "Cannot access the current tab.";
|
||||
msgRcvd = true;
|
||||
break;
|
||||
case STATUS_GENERAL_ERROR:
|
||||
msg.innerHTML = "Error sending to phone: " + message.data.action;
|
||||
setSignoutVisibility(false);
|
||||
msgRcvd = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(msgRcvd) {
|
||||
window.setTimeout(function() {
|
||||
window.close();
|
||||
}, 3000);
|
||||
}
|
||||
}, false);
|
||||
|
||||
function closeWindow() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function setSignoutVisibility(visible) {
|
||||
signOutLink.style.visibility = visible ? 'visible' : 'hidden';
|
||||
signOutLink.style.color = visible ? 'blue' : 'gray';
|
||||
@@ -94,7 +97,7 @@ window.addEventListener("load", loadHandler, false);
|
||||
<td valign="middle">
|
||||
<b><div id="msg">Sending to phone...</div></b>
|
||||
<p><a id="help" href="#">Help</a> <span id="sep" style="visibility:hidden;">|</span>
|
||||
<a id="signout" target="_blank" style="color: gray; visibility: hidden;">Sign out</a></p>
|
||||
<a id="signout" href="#" target="_o2ptab_ext" style="color: gray; visibility: hidden;">Sign out</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user