From 1a536369dec8b54511bd80bdbad208f577b25ecd Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Mon, 16 May 2016 22:29:55 +0200 Subject: [PATCH] Merged sidebar all.js, ignore globe if js not loaded yet --- plugins/Sidebar/media/Sidebar.coffee | 2 +- plugins/Sidebar/media/all.js | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index 01337435..ed34b4c0 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -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"} ) diff --git a/plugins/Sidebar/media/all.js b/plugins/Sidebar/media/all.js index 8ff26922..9b41d0bd 100644 --- a/plugins/Sidebar/media/all.js +++ b/plugins/Sidebar/media/all.js @@ -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/"