mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
UI tweaks
This commit is contained in:
@@ -25,16 +25,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"login_required_message": {
|
"sign_in_required_message": {
|
||||||
"message": "Chrome to Phone requires you to $link$.</a>",
|
"message": "Please $link$ to Chrome to Phone.</a>",
|
||||||
"description": "Notice when login is required.",
|
"description": "Notice when sign in is required.",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"link": {
|
"link": {
|
||||||
"content": "$1",
|
"content": "$1",
|
||||||
"example": "Login link."
|
"example": "Sign in link."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"sign_in_message": {
|
||||||
|
"message": "sign in",
|
||||||
|
"description": "Sign in phrase used in sign_in_required_message."
|
||||||
|
},
|
||||||
"sign_out_message": {
|
"sign_out_message": {
|
||||||
"message": "Sign out",
|
"message": "Sign out",
|
||||||
"description": "Sign out link message."
|
"description": "Sign out link message."
|
||||||
@@ -43,9 +47,9 @@
|
|||||||
"message": "Only http or https pages supported.",
|
"message": "Only http or https pages supported.",
|
||||||
"description": "Notice when user attempt to send a file link."
|
"description": "Notice when user attempt to send a file link."
|
||||||
},
|
},
|
||||||
"about_message": {
|
"help_message": {
|
||||||
"message": "About",
|
"message": "Help",
|
||||||
"description": "The about message."
|
"description": "The help message."
|
||||||
},
|
},
|
||||||
"connectivity_error_message": {
|
"connectivity_error_message": {
|
||||||
"message": "Connection error.",
|
"message": "Connection error.",
|
||||||
|
|||||||
BIN
extension/icon_48.png
Executable file
BIN
extension/icon_48.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_app_name__",
|
"name": "__MSG_app_name__",
|
||||||
"description": "__MSG_app_desc__",
|
"description": "__MSG_app_desc__",
|
||||||
"version": "1.0",
|
"version": "1.0.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"icons": { "128": "icon_128.png" },
|
"icons": { "128": "icon_128.png" },
|
||||||
"options_page": "about.html",
|
"options_page": "help.html",
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_title": "__MSG_app_name__",
|
"default_title": "__MSG_app_name__",
|
||||||
"default_icon": "icon_19.png",
|
"default_icon": "icon_19.png",
|
||||||
|
|||||||
@@ -16,12 +16,17 @@
|
|||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 1px;
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
overflow-x: hidden;
|
overflow: hidden;
|
||||||
|
background-image: -webkit-gradient(radial, 50% 50%, 10, 50% 50%, 280, from(#EEE), to(#FFF));
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
font-family: verdana;
|
font-family: verdana;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: black;
|
color: black;
|
||||||
background-color: white;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -38,7 +43,7 @@ var req = new XMLHttpRequest();
|
|||||||
|
|
||||||
function loadHandler() {
|
function loadHandler() {
|
||||||
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('sending_message');
|
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('sending_message');
|
||||||
document.getElementById('about').innerHTML = chrome.i18n.getMessage('about_message');
|
document.getElementById('help').innerHTML = chrome.i18n.getMessage('help_message');
|
||||||
document.getElementById('signout').innerHTML = chrome.i18n.getMessage('sign_out_message');
|
document.getElementById('signout').innerHTML = chrome.i18n.getMessage('sign_out_message');
|
||||||
|
|
||||||
chrome.tabs.getSelected(null, function(tab) {
|
chrome.tabs.getSelected(null, function(tab) {
|
||||||
@@ -64,9 +69,11 @@ function sendToPhone(title, url, selection) {
|
|||||||
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('sent_message');
|
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('sent_message');
|
||||||
activateSignOutLink();
|
activateSignOutLink();
|
||||||
} else if (body.indexOf('LOGIN_REQUIRED') == 0) {
|
} else if (body.indexOf('LOGIN_REQUIRED') == 0) {
|
||||||
var link = '<a href="#" onclick="chrome.tabs.create({url: \'' + signInUrl + '\'})">login</a>';
|
var link = '<a href="#" onclick="chrome.tabs.create({url: \'' + signInUrl + '\'})">' +
|
||||||
|
chrome.i18n.getMessage('sign_in_message') + '</a>';
|
||||||
document.getElementById('msg').innerHTML =
|
document.getElementById('msg').innerHTML =
|
||||||
chrome.i18n.getMessage('login_required_message', link);
|
chrome.i18n.getMessage('sign_in_required_message', link);
|
||||||
|
setSignOutVisibility(false);
|
||||||
} else if (body.indexOf('DEVICE_NOT_REGISTERED') == 0) {
|
} else if (body.indexOf('DEVICE_NOT_REGISTERED') == 0) {
|
||||||
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('device_not_registered_message');
|
document.getElementById('msg').innerHTML = chrome.i18n.getMessage('device_not_registered_message');
|
||||||
activateSignOutLink();
|
activateSignOutLink();
|
||||||
@@ -98,17 +105,33 @@ chrome.extension.onConnect.addListener(function(port) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function activateSignOutLink() {
|
function activateSignOutLink() {
|
||||||
|
setSignOutVisibility(true);
|
||||||
var signOutLink = document.getElementById('signout');
|
var signOutLink = document.getElementById('signout');
|
||||||
signOutLink.style.color = 'blue';
|
signOutLink.style.color = 'blue';
|
||||||
signOutLink.onclick = function() {
|
signOutLink.onclick = function() {
|
||||||
chrome.tabs.create({url: signOutUrl});
|
chrome.tabs.create({url: signOutUrl});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSignOutVisibility(visible) {
|
||||||
|
var signOutLink = document.getElementById('signout');
|
||||||
|
signOutLink.style.visibility = visible ? 'visible' : 'hidden';
|
||||||
|
var sep = document.getElementById('sep');
|
||||||
|
sep.style.visibility = visible ? 'visible' : 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<body onload="loadHandler()">
|
<body onload="loadHandler()">
|
||||||
<b><div id="msg"></div></b>
|
<table>
|
||||||
<p><a id="about" href="#" onclick="chrome.tabs.create({url: 'about.html'})"></a> |
|
<tr>
|
||||||
<a id="signout" href="#" style="color:gray"></a></p>
|
<td><img src="icon_48.png" style="margin-right: 4px;"/></td>
|
||||||
|
<td width="100%" valign="middle">
|
||||||
|
<b><div id="msg"></div></b>
|
||||||
|
<p><a id="help" href="#" onclick="chrome.tabs.create({url: 'help.html'})"></a> <span id="sep">|</span>
|
||||||
|
<a id="signout" href="#" style="color: gray;"></a></p>
|
||||||
|
</td>
|
||||||
|
<td valign="top"><a href="#" onclick="window.close()"><img src="popup_close.png" style="margin: 2px;"></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
BIN
extension/popup_close.png
Normal file
BIN
extension/popup_close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 271 B |
Reference in New Issue
Block a user