From 5f6ff93492c3848edf183a5dd9d8eeb9dc1e60fb Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 1 May 2014 11:37:25 +0200 Subject: [PATCH] Text and style tweaks --- js/BoxPage.js | 18 ++++++++---- js/ConnectingToNetworkPage.js | 9 ++++-- less/styles.less | 53 ++++++++++++++++++----------------- www/index.html | 7 +++-- 4 files changed, 52 insertions(+), 35 deletions(-) diff --git a/js/BoxPage.js b/js/BoxPage.js index b11d75b..f7c7b78 100644 --- a/js/BoxPage.js +++ b/js/BoxPage.js @@ -42,7 +42,7 @@ var BoxPage = (function (w) { console.log(" _boxData: ",_boxData); _title.text(_boxData.wifiboxid); - _intro.text(""); + setNetworkStatus(NetworkAPI.STATUS.CONNECTED); var drawLink = (_boxData.link)? _boxData.link : boxURL; _page.find("#drawItem a").attr("href",drawLink); @@ -62,7 +62,7 @@ var BoxPage = (function (w) { //console.log(" networkPanel ",_element[0]," parent: ",_element.parent()[0]); // ToDo: update _currentNetwork when available - setNetworkStatus(data.status,data); + setNetworkStatus(data.status); /*// Keep checking for updates? switch(data.status) { @@ -80,9 +80,10 @@ var BoxPage = (function (w) { }); } - function setNetworkStatus(status,data) { - console.log("setNetworkStatus: ",status,data); + function setNetworkStatus(status) { + console.log("setNetworkStatus: ",status); console.log(" _updateItem: ",_updateItem); + var introText = ""; if(status === NetworkAPI.STATUS.CONNECTED) { // online console.log("online"); _drawItem.find("a").text("Draw"); @@ -93,9 +94,11 @@ var BoxPage = (function (w) { _updateItem.toggleClass("ui-screen-hidden",false); // ToDo: retrieve update information + _joinNetworkItem.toggleClass("ui-screen-hidden",true); + } else { // 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); @@ -110,10 +113,13 @@ var BoxPage = (function (w) { // ToDo: Control } + _intro.text(introText); + _intro.toggleClass("ui-screen-hidden",(introText === "")); + // ToDo: update footer with network info _list.listview('refresh'); // jQuery mobile enhance content - _networkStatus = data.status; + _networkStatus = status; } // to get to the box data we need the url diff --git a/js/ConnectingToNetworkPage.js b/js/ConnectingToNetworkPage.js index b91cc7d..78ea18f 100644 --- a/js/ConnectingToNetworkPage.js +++ b/js/ConnectingToNetworkPage.js @@ -79,9 +79,9 @@ var actionText = ""; switch(data.status) { case NetworkAPI.STATUS.CONNECTING: - statusText = "Connecting to network "; + statusText = "Connecting to "+_pageData.ssid+"..."; //actionText = "Please reconnect yourself to "+_pageData.ssid+". Once you are connected return to this page."; - actionText = "Please reconnect yourself to "+_pageData.ssid+". Once connected return to this page."; + actionText = "Please reconnect yourself to "+_pageData.ssid+". Once you are connected return to this page."; _actionField.attr("class","notice"); break; case NetworkAPI.STATUS.CONNECTING_FAILED: @@ -89,6 +89,11 @@ actionText = "Please check password and try again"; _actionField.attr("class","error"); break; + case NetworkAPI.STATUS.CONNECTED: + statusText = "Connected to "+_pageData.ssid; + actionText = "Please reconnect yourself to "+_pageData.ssid+". Once you are connected return to this page."; + _actionField.attr("class","notice"); + break; default: actionText = "Something went wrong, please try again"; _actionField.attr("class","error"); diff --git a/less/styles.less b/less/styles.less index 1b636be..9fd37b0 100644 --- a/less/styles.less +++ b/less/styles.less @@ -1,5 +1,6 @@ -body { - +body.ui-mobile-viewport { + margin: 0 auto; + max-width: 1024px; } #logo { @@ -10,39 +11,41 @@ body { margin: 10px 5px 5px 5px; max-width: 200px; } - -.ui-content ul { - padding: 0 0 0 1em; -} -.ui-content ul.ui-listview { - padding: 0; +#slogan { + text-align: center; } +.ui-content { + ul { + padding: 0 0 0 1em; + } + ul.ui-listview { + padding: 0; + } + .intro { + margin: 0 0 2em 0; + } + img { + max-width: 100%; + } +} #action { margin: 0 -1em; padding: 1em; color: #fff; text-shadow: 0px 1px 0px #999; -} - -#action.error { + &.error { background: #EB313C; text-shadow: 0px 1px 0px #333; -} -#action.warning { + } + &.warning { background: #E9A86E; } -#action.notice { - background: #93CAF4; -} -#action.info { - background: #97DD8A; -} - -@media only screen and (min-width: 768px) { - body { - padding-left: 20em; - padding-right: 20em; + &.notice { + background: #93CAF4; } -} + &.info { + background: #97DD8A; + } +} \ No newline at end of file diff --git a/www/index.html b/www/index.html index 2d82b9a..85dfb07 100644 --- a/www/index.html +++ b/www/index.html @@ -27,7 +27,10 @@
-

makes 3D printing very easy

+

makes 3D printing very easy

+
+

WiFi-Boxes

+
    @@ -164,7 +167,7 @@

    Connecting...

- +