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'?>
|
<?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>
|
<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>
|
<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"/>
|
<access origin="https://chrometophone.appspot.com"/>
|
||||||
<icon src="icon_64.png"/>
|
<icon src="icon_64.png"/>
|
||||||
<license>
|
<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 baseUrl = 'https://chrometophone.appspot.com';
|
||||||
var sendUrl = baseUrl + '/send?ver=' + apiVersion;
|
var sendUrl = baseUrl + '/send?ver=' + apiVersion;
|
||||||
var signInUrl = baseUrl + '/signin?extret=' +
|
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=' +
|
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 registerUrl = baseUrl + '/register?ver=' + apiVersion;
|
||||||
var apkUrl = 'http://code.google.com/p/chrometophone/wiki/AndroidApp';
|
var apkUrl = 'http://code.google.com/p/chrometophone/wiki/AndroidApp';
|
||||||
|
|
||||||
|
|||||||
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
25
third_party/operatophone/popup.html
vendored
25
third_party/operatophone/popup.html
vendored
@@ -26,29 +26,26 @@ function loadHandler() {
|
|||||||
opera.extension.postMessage({
|
opera.extension.postMessage({
|
||||||
action: ACTION_OPEN_TAB,
|
action: ACTION_OPEN_TAB,
|
||||||
data: {
|
data: {
|
||||||
url: '/o2p_help.html'
|
url: '/o2p_help.html?' + Math.floor(Math.random()*1e10) // to prevent caching issue
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
closeWindow();
|
|
||||||
}, false );
|
}, false );
|
||||||
signOutLink.href = signOutUrl;
|
signOutLink.href = signOutUrl;
|
||||||
signOutLink.addEventListener( 'click', closeWindow, false );
|
|
||||||
|
|
||||||
// Callback from the background process
|
// Callback from the background process
|
||||||
opera.extension.addEventListener( 'message', function( message ) {
|
opera.extension.addEventListener( 'message', function( message ) {
|
||||||
|
var msgRcvd = false;
|
||||||
switch(message.data.action) {
|
switch(message.data.action) {
|
||||||
case STATUS_SUCCESS:
|
case STATUS_SUCCESS:
|
||||||
msg.innerHTML = "Sent to phone."
|
msg.innerHTML = "Sent to phone."
|
||||||
setSignoutVisibility(true);
|
setSignoutVisibility(true);
|
||||||
window.setTimeout(function() {
|
msgRcvd = true;
|
||||||
window.close();
|
|
||||||
}, 3000);
|
|
||||||
break;
|
break;
|
||||||
case STATUS_LOGIN_REQUIRED:
|
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.";
|
msg.innerHTML = "Please " + signinLink + " to Opera to Phone.";
|
||||||
document.getElementById('signin').addEventListener( 'click', closeWindow, false );
|
|
||||||
setSignoutVisibility(false);
|
setSignoutVisibility(false);
|
||||||
|
msgRcvd = true;
|
||||||
break;
|
break;
|
||||||
case STATUS_DEVICE_NOT_REGISTERED:
|
case STATUS_DEVICE_NOT_REGISTERED:
|
||||||
opera.extension.postMessage({
|
opera.extension.postMessage({
|
||||||
@@ -59,19 +56,25 @@ function loadHandler() {
|
|||||||
});
|
});
|
||||||
msg.innerHTML = "Device not registered for user.";
|
msg.innerHTML = "Device not registered for user.";
|
||||||
setSignoutVisibility(true);
|
setSignoutVisibility(true);
|
||||||
|
msgRcvd = true;
|
||||||
|
break;
|
||||||
case STATUS_NO_TAB_ACCESS:
|
case STATUS_NO_TAB_ACCESS:
|
||||||
msg.innerHTML = "Cannot access the current tab.";
|
msg.innerHTML = "Cannot access the current tab.";
|
||||||
|
msgRcvd = true;
|
||||||
break;
|
break;
|
||||||
case STATUS_GENERAL_ERROR:
|
case STATUS_GENERAL_ERROR:
|
||||||
msg.innerHTML = "Error sending to phone: " + message.data.action;
|
msg.innerHTML = "Error sending to phone: " + message.data.action;
|
||||||
setSignoutVisibility(false);
|
setSignoutVisibility(false);
|
||||||
|
msgRcvd = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, false);
|
|
||||||
|
|
||||||
function closeWindow() {
|
if(msgRcvd) {
|
||||||
|
window.setTimeout(function() {
|
||||||
window.close();
|
window.close();
|
||||||
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
function setSignoutVisibility(visible) {
|
function setSignoutVisibility(visible) {
|
||||||
signOutLink.style.visibility = visible ? 'visible' : 'hidden';
|
signOutLink.style.visibility = visible ? 'visible' : 'hidden';
|
||||||
@@ -94,7 +97,7 @@ window.addEventListener("load", loadHandler, false);
|
|||||||
<td valign="middle">
|
<td valign="middle">
|
||||||
<b><div id="msg">Sending to phone...</div></b>
|
<b><div id="msg">Sending to phone...</div></b>
|
||||||
<p><a id="help" href="#">Help</a> <span id="sep" style="visibility:hidden;">|</span>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user