mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Opera to Phone v1.3.4
This commit is contained in:
2
third_party/operatophone/config.xml
vendored
2
third_party/operatophone/config.xml
vendored
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget xmlns="http://www.w3.org/ns/widgets" id="https://addons.opera.com/addons/extensions/details/opera-to-phone/" version="1.3.3">
|
||||
<widget xmlns="http://www.w3.org/ns/widgets" id="https://addons.opera.com/addons/extensions/details/opera-to-phone/" version="1.3.4">
|
||||
<name>Opera to Phone</name>
|
||||
<access origin="https://chrometophone.appspot.com"/>
|
||||
<icon src="icon_64x64.png"/>
|
||||
|
||||
24
third_party/operatophone/index.html
vendored
24
third_party/operatophone/index.html
vendored
@@ -5,7 +5,7 @@
|
||||
<script type="text/javascript" src="send_logic.js"></script>
|
||||
<script>
|
||||
var UIItemProperties = { // options for the button
|
||||
disabled: false,
|
||||
disabled: true,
|
||||
title: "Opera to Phone",
|
||||
icon: "icon_18x18.png",
|
||||
popup: {
|
||||
@@ -74,6 +74,28 @@ function onMessage( message ) {
|
||||
}
|
||||
|
||||
opera.extension.addEventListener( 'message' , onMessage, false );
|
||||
|
||||
function enableButton() {
|
||||
var tab = opera.extension.tabs.getFocused();
|
||||
if (tab) {
|
||||
operaBtn.disabled = false;
|
||||
}
|
||||
else {
|
||||
operaBtn.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Enable the button when a tab is ready.
|
||||
opera.extension.addEventListener( 'connect', function() {
|
||||
enableButton();
|
||||
}, false );
|
||||
opera.extension.tabs.addEventListener( 'focus', function() {
|
||||
enableButton();
|
||||
}, false );
|
||||
opera.extension.tabs.addEventListener( 'blur', function() {
|
||||
enableButton();
|
||||
}, false );
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user