0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-25 18:13:48 +01:00

Text and style tweaks

This commit is contained in:
peteruithoven 2014-05-01 11:37:25 +02:00
parent f3f001c31e
commit 5f6ff93492
4 changed files with 52 additions and 35 deletions

View File

@ -42,7 +42,7 @@ var BoxPage = (function (w) {
console.log(" _boxData: ",_boxData); console.log(" _boxData: ",_boxData);
_title.text(_boxData.wifiboxid); _title.text(_boxData.wifiboxid);
_intro.text(""); setNetworkStatus(NetworkAPI.STATUS.CONNECTED);
var drawLink = (_boxData.link)? _boxData.link : boxURL; var drawLink = (_boxData.link)? _boxData.link : boxURL;
_page.find("#drawItem a").attr("href",drawLink); _page.find("#drawItem a").attr("href",drawLink);
@ -62,7 +62,7 @@ var BoxPage = (function (w) {
//console.log(" networkPanel ",_element[0]," parent: ",_element.parent()[0]); //console.log(" networkPanel ",_element[0]," parent: ",_element.parent()[0]);
// ToDo: update _currentNetwork when available // ToDo: update _currentNetwork when available
setNetworkStatus(data.status,data); setNetworkStatus(data.status);
/*// Keep checking for updates? /*// Keep checking for updates?
switch(data.status) { switch(data.status) {
@ -80,9 +80,10 @@ var BoxPage = (function (w) {
}); });
} }
function setNetworkStatus(status,data) { function setNetworkStatus(status) {
console.log("setNetworkStatus: ",status,data); console.log("setNetworkStatus: ",status);
console.log(" _updateItem: ",_updateItem); console.log(" _updateItem: ",_updateItem);
var introText = "";
if(status === NetworkAPI.STATUS.CONNECTED) { // online if(status === NetworkAPI.STATUS.CONNECTED) { // online
console.log("online"); console.log("online");
_drawItem.find("a").text("Draw"); _drawItem.find("a").text("Draw");
@ -93,9 +94,11 @@ var BoxPage = (function (w) {
_updateItem.toggleClass("ui-screen-hidden",false); _updateItem.toggleClass("ui-screen-hidden",false);
// ToDo: retrieve update information // ToDo: retrieve update information
_joinNetworkItem.toggleClass("ui-screen-hidden",true);
} else { // offline } else { // offline
console.log("offline"); console.log("offline");
_intro.text("Please connect your WiFi-Box to the internet. You can also use it offline but then you aren't able to update."); introText = "Please connect your WiFi-Box to the internet. You can also use it offline, but then you won't be able to update.";
_joinNetworkItem.toggleClass("ui-screen-hidden",false); _joinNetworkItem.toggleClass("ui-screen-hidden",false);
@ -110,10 +113,13 @@ var BoxPage = (function (w) {
// ToDo: Control // ToDo: Control
} }
_intro.text(introText);
_intro.toggleClass("ui-screen-hidden",(introText === ""));
// ToDo: update footer with network info // ToDo: update footer with network info
_list.listview('refresh'); // jQuery mobile enhance content _list.listview('refresh'); // jQuery mobile enhance content
_networkStatus = data.status; _networkStatus = status;
} }
// to get to the box data we need the url // to get to the box data we need the url

View File

@ -79,9 +79,9 @@
var actionText = ""; var actionText = "";
switch(data.status) { switch(data.status) {
case NetworkAPI.STATUS.CONNECTING: case NetworkAPI.STATUS.CONNECTING:
statusText = "Connecting to network "; statusText = "Connecting to "+_pageData.ssid+"...";
//actionText = "Please reconnect yourself to <b>"+_pageData.ssid+"</b>. Once you are connected return to this page."; //actionText = "Please reconnect yourself to <b>"+_pageData.ssid+"</b>. Once you are connected return to this page.";
actionText = "Please reconnect yourself to <b>"+_pageData.ssid+"</b>. Once connected return to this page."; actionText = "Please reconnect yourself to <b>"+_pageData.ssid+"</b>. Once you are connected return to this page.";
_actionField.attr("class","notice"); _actionField.attr("class","notice");
break; break;
case NetworkAPI.STATUS.CONNECTING_FAILED: case NetworkAPI.STATUS.CONNECTING_FAILED:
@ -89,6 +89,11 @@
actionText = "Please check password and try again"; actionText = "Please check password and try again";
_actionField.attr("class","error"); _actionField.attr("class","error");
break; break;
case NetworkAPI.STATUS.CONNECTED:
statusText = "Connected to "+_pageData.ssid;
actionText = "Please reconnect yourself to <b>"+_pageData.ssid+"</b>. Once you are connected return to this page.";
_actionField.attr("class","notice");
break;
default: default:
actionText = "Something went wrong, please try again"; actionText = "Something went wrong, please try again";
_actionField.attr("class","error"); _actionField.attr("class","error");

View File

@ -1,5 +1,6 @@
body { body.ui-mobile-viewport {
margin: 0 auto;
max-width: 1024px;
} }
#logo { #logo {
@ -10,39 +11,41 @@ body {
margin: 10px 5px 5px 5px; margin: 10px 5px 5px 5px;
max-width: 200px; max-width: 200px;
} }
#slogan {
.ui-content ul { text-align: center;
padding: 0 0 0 1em;
}
.ui-content ul.ui-listview {
padding: 0;
} }
.ui-content {
ul {
padding: 0 0 0 1em;
}
ul.ui-listview {
padding: 0;
}
.intro {
margin: 0 0 2em 0;
}
img {
max-width: 100%;
}
}
#action { #action {
margin: 0 -1em; margin: 0 -1em;
padding: 1em; padding: 1em;
color: #fff; color: #fff;
text-shadow: 0px 1px 0px #999; text-shadow: 0px 1px 0px #999;
} &.error {
#action.error {
background: #EB313C; background: #EB313C;
text-shadow: 0px 1px 0px #333; text-shadow: 0px 1px 0px #333;
} }
#action.warning { &.warning {
background: #E9A86E; background: #E9A86E;
} }
#action.notice { &.notice {
background: #93CAF4; background: #93CAF4;
} }
#action.info { &.info {
background: #97DD8A; background: #97DD8A;
}
@media only screen and (min-width: 768px) {
body {
padding-left: 20em;
padding-right: 20em;
} }
} }

View File

@ -27,7 +27,10 @@
<div data-role="page" id="boxes"> <div data-role="page" id="boxes">
<a href="#boxes" id="logo"><img src="img/logo_full.png"></a> <a href="#boxes" id="logo"><img src="img/logo_full.png"></a>
<p>makes 3D printing very easy</p> <p id="slogan">makes 3D printing very easy</p>
<div data-role="header">
<h1>WiFi-Boxes</h1>
</div><!-- /header -->
<!-- <p>Please select your Doodle3D WiFi-Box to connect or press search to add your box to this list.</p> --> <!-- <p>Please select your Doodle3D WiFi-Box to connect or press search to add your box to this list.</p> -->
<div role="main" class="ui-content"> <div role="main" class="ui-content">
<ul data-role="listview" id="boxeslist"> <ul data-role="listview" id="boxeslist">
@ -164,7 +167,7 @@
<h1>Connecting...</h1> <h1>Connecting...</h1>
</div><!-- /header --> </div><!-- /header -->
<div role="main" class="ui-content"> <div role="main" class="ui-content">
<img id="logo" src="img/Connect to home.png"> <img src="img/Connect to home.png">
<h3 id="status"></h3> <h3 id="status"></h3>
<p id="action"></p> <p id="action"></p>
</div><!-- /content --> </div><!-- /content -->