Merged sidebar all.js, ignore globe if js not loaded yet

This commit is contained in:
HelloZeroNet 2016-05-16 22:29:55 +02:00
parent 5b35bea489
commit 1a536369de
2 changed files with 12 additions and 4 deletions

View File

@ -372,7 +372,7 @@ class Sidebar extends Class
@globe.scene.remove(@globe.points)
@globe.addData( globe_data, {format: 'magnitude', name: "hello", animated: false} )
@globe.createPoints()
else
else if typeof(DAT) != "undefined"
try
@globe = new DAT.Globe( @tag.find(".globe")[0], {"imgDir": "/uimedia/globe/"} )
@globe.addData( globe_data, {format: 'magnitude', name: "hello"} )

View File

@ -557,12 +557,20 @@ window.initScrollable = function () {
var inner_path;
inner_path = _this.tag.find("#input-contents").val();
if (wrapper.site_info.privatekey) {
wrapper.ws.cmd("siteSign", ["stored", inner_path], function(res) {
wrapper.ws.cmd("siteSign", {
privatekey: "stored",
inner_path: inner_path,
update_changed_files: true
}, function(res) {
return wrapper.notifications.add("sign", "done", inner_path + " Signed!", 5000);
});
} else {
wrapper.displayPrompt("Enter your private key:", "password", "Sign", function(privatekey) {
return wrapper.ws.cmd("siteSign", [privatekey, inner_path], function(res) {
return wrapper.ws.cmd("siteSign", {
privatekey: privatekey,
inner_path: inner_path,
update_changed_files: true
}, function(res) {
if (res === "ok") {
return wrapper.notifications.add("sign", "done", inner_path + " Signed!", 5000);
}
@ -633,7 +641,7 @@ window.initScrollable = function () {
animated: false
});
_this.globe.createPoints();
} else {
} else if (typeof DAT !== "undefined") {
try {
_this.globe = new DAT.Globe(_this.tag.find(".globe")[0], {
"imgDir": "/uimedia/globe/"