Skip to content

Commit 196ece5

Browse files
committed
Safari display fixes, Show update button by clicking on topright version text
1 parent 8950864 commit 196ece5

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

css/ZeroHello.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body { background-color: #D2CECD; color: #393837; margin: 10px; padding: 0px; font-family: 'Roboto', sans-serif; padding-bottom: 50px; backface-visibility: hidden } /*#AF3FBB*/
2-
h1, h2, h3, h4 { font-family: 'Roboto', sans-serif; font-weight: normal; font-size: 100px; margin: 0px; padding: 0px }
2+
h1, h2, h3, h4 { font-family: 'Roboto', Arial, sans-serif; font-weight: normal; font-size: 100px; margin: 0px; padding: 0px }
33
h1 { font-family: 'Text Me One', sans-serif;; padding-bottom: 30px; line-height: 100px }
44
h2 { font-size: 35px }
55
h3 { font-size: 23px }
@@ -63,7 +63,7 @@ ul, li { margin: 0px; padding: 0px; list-style-type: none }
6363
.served { background-color: #AF3BFF; display: inline-block; padding: 10px; margin-left: -25px; color: white }
6464

6565

66-
.site-category { margin-top: -54px; float: left; padding-left: 20px; width: 370px; width: 90% }
66+
.site-category { margin-top: -54px; float: left; padding-left: 20px; width: 370px; height: 0px }
6767

6868

6969
/* Site */

css/all.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<div class="plugin-multiuser">Current user: <a class='identicon' href='#Show+Private+key' title='Show private key'></a><a href="#Logout" class="button button-logout">Logout</a></div>
1717
<div class="plugin-uipassword"><a href="#Logout" class="button button-logout">Logout</a></div>
1818
<div class="version current">Version: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">Unknown</a></div>
19-
<div class="version latest new" title="New update available">Latest: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">0.3.1</a></div>
19+
<div class="version latest new" title="New update available">Latest: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">0.3.2</a></div>
2020
<br><a href="#Update" class="button button-update button-submit">Update to new version</a>
21-
<br><span class='broken-autoupdate'>Err, we broke the autoupdate for this version.<br> Please overwrite your current <b>update.py</b> file<br> with the <a href="https://raw.githubusercontent.com/HelloZeroNet/ZeroNet/master/update.py" target="_top">latest one from github</a>, run it and restart ZeroNet.<br>Sorry for the troubles!</span>
21+
<br><span class='broken-autoupdate'></span>
2222
</div>
2323

2424

js/ZeroHello.coffee

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class ZeroHello extends ZeroFrame
1313
$(".broken-autoupdate").css("display", "block").html "Please run update.py manually<br>if ZeroNet doesn't comes back within 1 minute."
1414
@cmd "serverUpdate", {}
1515

16+
$(".version.current").on "click", =>
17+
#$(".version.latest").css "display", "inline-block"
18+
$(".button-update").css "display", "inline-block"
19+
1620

1721
# Wrapper websocket connection ready
1822
onOpenWebsocket: (e) =>
@@ -174,6 +178,9 @@ class ZeroHello extends ZeroFrame
174178

175179
if site.address == @address and site.peers > 0 then $("#peers").text(site.peers) # Update servedby text
176180

181+
# Background color based on address
182+
# elem.find(".site").css("border", "4px solid "+@toColor(site.address))
183+
177184
return elem
178185

179186

@@ -275,8 +282,11 @@ class ZeroHello extends ZeroFrame
275282
$(".plugin-uipassword .button-logout").on "click", =>
276283
@cmd "uiLogout", []
277284

278-
279-
285+
toColor: (text) ->
286+
hash = 0
287+
for i in [0..text.length-1]
288+
hash += text.charCodeAt(i)*i
289+
return "hsl(" + (hash % 360) + ",30%,50%)";
280290

281291

282292
# - Site commands -

js/all.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,13 +922,18 @@ jQuery.extend( jQuery.easing,
922922
return _this.local_storage = res;
923923
};
924924
})(this));
925-
return $(".button-update").on("click", (function(_this) {
925+
$(".button-update").on("click", (function(_this) {
926926
return function() {
927927
$(".button-update").addClass("loading");
928928
$(".broken-autoupdate").css("display", "block").html("Please run update.py manually<br>if ZeroNet doesn't comes back within 1 minute.");
929929
return _this.cmd("serverUpdate", {});
930930
};
931931
})(this));
932+
return $(".version.current").on("click", (function(_this) {
933+
return function() {
934+
return $(".button-update").css("display", "inline-block");
935+
};
936+
})(this));
932937
};
933938

934939
ZeroHello.prototype.onOpenWebsocket = function(e) {
@@ -1251,6 +1256,15 @@ jQuery.extend( jQuery.easing,
12511256
})(this));
12521257
};
12531258

1259+
ZeroHello.prototype.toColor = function(text) {
1260+
var hash, i, _i, _ref;
1261+
hash = 0;
1262+
for (i = _i = 0, _ref = text.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {
1263+
hash += text.charCodeAt(i) * i;
1264+
}
1265+
return "hsl(" + (hash % 360) + ",30%,50%)";
1266+
};
1267+
12541268
ZeroHello.prototype.siteUpdate = function(address) {
12551269
return this.cmd("siteUpdate", {
12561270
"address": address

0 commit comments

Comments
 (0)