Skip to content

Commit ef9dccd

Browse files
committed
Tor status, Topright fadein on hover
1 parent 5d94a95 commit ef9dccd

File tree

6 files changed

+51
-32
lines changed

6 files changed

+51
-32
lines changed

content.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"size": 2700
3333
},
3434
"js/all.js": {
35-
"sha512": "9eb0331718696fa28a4a0e3deabca0d85496a54ca0826f3c91a0d37daa28e098",
36-
"size": 128969
35+
"sha512": "d2dea1d04750a1cd80fd859751e41aba844fa6c23d065405391e65be1a1968a8",
36+
"size": 130828
3737
},
3838
"test/jquery.min.js": {
3939
"sha512": "eda31b5c7d371d4b3acced51fa92f27a417515317cf437aae09a47c3acc8a36b",
@@ -53,10 +53,10 @@
5353
}
5454
},
5555
"ignore": "(js|css)/(?!all.(js|css))",
56-
"modified": 1449780690.029,
56+
"modified": 1450206105.502,
5757
"sign": [
58-
42358599513687854655700957130861396358086955517123500015244897460190619166669,
59-
27200718880115340847505557693050839493998194776739787970383068787553748692290
58+
51257551727086594000582199816561591646916335532896571336997247307418689992883,
59+
94018707298280014245012871574013121361285296769815448052134087753541882097536
6060
],
6161
"signers_sign": null,
6262
"signs_required": 1,

css/ZeroHello.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,30 @@ ul, li { margin: 0px; padding: 0px; list-style-type: none }
4040

4141

4242
/* Version info */
43-
.topright { float: right; margin-right: 80px; margin-top: 2px; text-align: right; font-size: 12px; text-transform: uppercase; color: #A99D9B; opacity: 0; transition: all 1s }
43+
.topright { float: right; margin-right: 80px; margin-top: 2px; text-align: right; font-size: 12px; text-transform: uppercase; color: #6F6B6B; opacity: 0; transition: all 1s }
44+
.topright:hover { opacity: 1 !important }
45+
.topright a { color: #6F6B6B; transition: all 0.3s }
4446
.version.latest, .version.current { padding: 2px 5px }
45-
.version a { color: #A99D9B; text-transform: none }
47+
.version a { color: #6F6B6B; text-transform: none }
4648
.version.latest { display: inline-block }
4749
.version.latest.new { background-color: #FFF85F; margin-right: -3px; display: none }
4850

49-
.port { padding: 5px }
51+
.status { padding: 5px }
52+
5053
.port a { transition: all 1s; background-position: -20px center }
51-
.port.closed a { color: #C58276 }
52-
.port.opened a { color: #24A26E }
54+
.port.closed a { color: #DC4F36 }
55+
.port.opened a, .status .ok { color: #00B16A }
5356
.port.loading a { color: rgba(0,0,0,0); background: transparent url(../img/loading.gif) no-repeat center center }
5457

5558
.donate { padding: 5px; }
56-
.donate a { color: #A99D9B }
5759
.donate .heart { color: #DA3D32; font-family: Tahoma, Arial }
5860

5961
.plugin-multiuser { display: none }
6062
.plugin-uipassword { display: none }
6163
.identicon { width: 24px; height: 24px; display: inline-block; vertical-align: middle; margin-bottom: 2px; margin-right: 10px; margin-left: 5px; border: 1px solid #F0F0F0 }
6264
.button-logout { margin-top: -2px }
6365
.button-logout:hover { color: black }
64-
.button-update { margin-top: 10px; color: black; display: none }
66+
.button-update { margin-top: 10px; color: black !important; display: none }
6567
.broken-autoupdate { display: inline-block; padding-top: 5px; color: #666; display: none }
6668
.broken-autoupdate a { color: black }
6769

@@ -99,7 +101,7 @@ ul, li { margin: 0px; padding: 0px; list-style-type: none }
99101
.site .notify.success { background-color: #00B16A }
100102

101103
.site h3 { font-size: 50px; line-height: 47px; padding-bottom: 7px; overflow: hidden; text-overflow: ellipsis; clear: both; }
102-
.site h3.long { font-size: 40px }
104+
.site h3.long { font-size: 24px; line-height: 29px }
103105
.site .bottom { bottom: 8px }
104106
.site .description { overflow: hidden; text-overflow: ellipsis; max-height: 2.5em; }
105107

css/all.css

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

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
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="donate"><span class='heart'></span> <a href="http://zeronet.readthedocs.org/en/latest/help_zeronet/donate/" target="_blank">Help to keep this project alive</a></div>
19-
<div class="port closed" style="display: none">Port: <a href="#Re+check">Closed</a></div>
19+
<div class='status'>
20+
<span class="port closed" style="display: none">Port: <a href="#Re+check" title='Re-check'>Closed</a></span>
21+
<span class="tor disabled" style="display: none">Tor: <span>Disabled</span></span>
22+
</div>
2023
<div class="version current">Version: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">Unknown</a></div>
21-
<div class="version latest new" title="New update available">Latest: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">0.3.4</a></div>
24+
<div class="version latest new" title="New update available">Latest: <a href="https://github.com/HelloZeroNet/ZeroNet" target="_top">0.3.5</a></div>
2225
<br><a href="#Update" class="button button-update button-submit">Update to new version</a>
2326
<br><span class='broken-autoupdate'></span>
2427
</div>

js/ZeroHello.coffee

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ class ZeroHello extends ZeroFrame
241241
reloadServerInfo: ->
242242
@cmd "serverInfo", {}, (server_info) =>
243243
@server_info = server_info
244+
$(".topright").css("opacity", 0.5)
244245

245246
# Check verion info
246247
version = server_info.version
@@ -251,6 +252,7 @@ class ZeroHello extends ZeroFrame
251252
$(".version.latest").css "display", "none"
252253
$(".button-update").css "display", "none"
253254
else
255+
$(".topright").css("opacity", 1)
254256
$(".version.latest").css "display", "inline-block"
255257
$(".button-update").css "display", "inline-block"
256258
if parseInt(version.replace(/[^0-9]/g, "0")) == 207 # Auto update broken
@@ -260,15 +262,14 @@ class ZeroHello extends ZeroFrame
260262
$(".broken-autoupdate").css "display", "block"
261263
$(".broken-autoupdate").html "It's possible that ZeroNet will not comes back automatically<br>after the update process. In this case please start it manually."
262264

263-
$(".topright").css("opacity", 1)
264265

265266
# Port info
266267
if server_info.ip_external
267268
$(".port").removeClass("closed").addClass("opened")
268269
$(".port a").text("opened")
269270
else
270-
$(".port").removeClass("opened").addClass("closed").css("display", "block")
271-
$(".port a").text("closed")
271+
$(".port").removeClass("opened").addClass("closed").css("display", "initial")
272+
$(".port a").text("closed").attr("title", "(Re-check port #{server_info.fileserver_port})")
272273
$(".port a").off("click").on "click", =>
273274
$(".port").addClass("loading")
274275
@cmd "serverPortcheck", [], (res) =>
@@ -278,6 +279,12 @@ class ZeroHello extends ZeroFrame
278279
@log "Port open result:", res
279280
@reloadServerInfo()
280281

282+
# Tor status
283+
if server_info.tor_status
284+
$(".tor").css("display", "initial")
285+
title = server_info.tor_status.replace(/.*\((.*)\)/, "$1")
286+
$(".tor span").html server_info.tor_status.replace(/\(.*\)/, "").replace("OK", "<span class='ok' title='#{title}'>OK</span>")
287+
281288
# Multiuser info
282289
if server_info.multiuser
283290
$(".plugin-multiuser").css("display", "block")

js/all.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
}).call(this);
8383

8484

85-
8685
/* ---- data/1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr/js/lib/Utils.coffee ---- */
8786

8887

@@ -1288,8 +1287,9 @@ jQuery.extend( jQuery.easing,
12881287
ZeroHello.prototype.reloadServerInfo = function() {
12891288
return this.cmd("serverInfo", {}, (function(_this) {
12901289
return function(server_info) {
1291-
var imagedata, rev, version;
1290+
var imagedata, rev, title, version;
12921291
_this.server_info = server_info;
1292+
$(".topright").css("opacity", 0.5);
12931293
version = server_info.version;
12941294
if (!version) {
12951295
version = "Unknown, please update";
@@ -1304,6 +1304,7 @@ jQuery.extend( jQuery.easing,
13041304
$(".version.latest").css("display", "none");
13051305
$(".button-update").css("display", "none");
13061306
} else {
1307+
$(".topright").css("opacity", 1);
13071308
$(".version.latest").css("display", "inline-block");
13081309
$(".button-update").css("display", "inline-block");
13091310
if (parseInt(version.replace(/[^0-9]/g, "0")) === 207) {
@@ -1314,13 +1315,12 @@ jQuery.extend( jQuery.easing,
13141315
$(".broken-autoupdate").html("It's possible that ZeroNet will not comes back automatically<br>after the update process. In this case please start it manually.");
13151316
}
13161317
}
1317-
$(".topright").css("opacity", 1);
13181318
if (server_info.ip_external) {
13191319
$(".port").removeClass("closed").addClass("opened");
13201320
$(".port a").text("opened");
13211321
} else {
1322-
$(".port").removeClass("opened").addClass("closed").css("display", "block");
1323-
$(".port a").text("closed");
1322+
$(".port").removeClass("opened").addClass("closed").css("display", "initial");
1323+
$(".port a").text("closed").attr("title", "(Re-check port " + server_info.fileserver_port + ")");
13241324
}
13251325
$(".port a").off("click").on("click", function() {
13261326
$(".port").addClass("loading");
@@ -1333,6 +1333,11 @@ jQuery.extend( jQuery.easing,
13331333
return _this.reloadServerInfo();
13341334
});
13351335
});
1336+
if (server_info.tor_status) {
1337+
$(".tor").css("display", "initial");
1338+
title = server_info.tor_status.replace(/.*\((.*)\)/, "$1");
1339+
$(".tor span").html(server_info.tor_status.replace(/\(.*\)/, "").replace("OK", "<span class='ok' title='" + title + "'>OK</span>"));
1340+
}
13361341
if (server_info.multiuser) {
13371342
$(".plugin-multiuser").css("display", "block");
13381343
imagedata = new Identicon(server_info["master_address"], 25).toString();
@@ -1419,4 +1424,4 @@ jQuery.extend( jQuery.easing,
14191424

14201425
window.zero_hello = new ZeroHello();
14211426

1422-
}).call(this);
1427+
}).call(this);

0 commit comments

Comments
 (0)