Rev932, Skip news event from future, Disable siteSetOwned and setAutodownloadoptional when multiuser plugin enabled, Fix sidebar double click handlers, Log peer sent commands, Send modification to less peer if have enought peers, Close peers if more than 10 per site

This commit is contained in:
HelloZeroNet 2016-03-03 21:12:16 +01:00
parent 5b821c46e5
commit 3f6f273fb1
7 changed files with 78 additions and 28 deletions

View file

@ -225,31 +225,31 @@ class Sidebar extends Class
), 300
# Site limit button
@tag.find("#button-sitelimit").on "click", =>
@tag.find("#button-sitelimit").off("click").on "click", =>
wrapper.ws.cmd "siteSetLimit", $("#input-sitelimit").val(), =>
wrapper.notifications.add "done-sitelimit", "done", "Site storage limit modified!", 5000
@updateHtmlTag()
return false
# Owned checkbox
@tag.find("#checkbox-owned").on "click", =>
@tag.find("#checkbox-owned").off("click").on "click", =>
wrapper.ws.cmd "siteSetOwned", [@tag.find("#checkbox-owned").is(":checked")]
# Owned checkbox
@tag.find("#checkbox-autodownloadoptional").on "click", =>
@tag.find("#checkbox-autodownloadoptional").off("click").on "click", =>
wrapper.ws.cmd "siteSetAutodownloadoptional", [@tag.find("#checkbox-autodownloadoptional").is(":checked")]
# Change identity button
@tag.find("#button-identity").on "click", =>
@tag.find("#button-identity").off("click").on "click", =>
wrapper.ws.cmd "certSelect"
return false
# Owned checkbox
@tag.find("#checkbox-owned").on "click", =>
@tag.find("#checkbox-owned").off("click").on "click", =>
wrapper.ws.cmd "siteSetOwned", [@tag.find("#checkbox-owned").is(":checked")]
# Save settings
@tag.find("#button-settings").on "click", =>
@tag.find("#button-settings").off("click").on "click", =>
wrapper.ws.cmd "fileGet", "content.json", (res) =>
data = JSON.parse(res)
data["title"] = $("#settings-title").val()
@ -264,7 +264,7 @@ class Sidebar extends Class
return false
# Sign content.json
@tag.find("#button-sign").on "click", =>
@tag.find("#button-sign").off("click").on "click", =>
inner_path = @tag.find("#select-contents").val()
if wrapper.site_info.privatekey
@ -282,7 +282,7 @@ class Sidebar extends Class
return false
# Publish content.json
@tag.find("#button-publish").on "click", =>
@tag.find("#button-publish").off("click").on "click", =>
inner_path = @tag.find("#select-contents").val()
@tag.find("#button-publish").addClass "loading"
wrapper.ws.cmd "sitePublish", {"inner_path": inner_path, "sign": false}, =>

View file

@ -404,7 +404,7 @@ window.initScrollable = function () {
}), 300);
};
})(this));
this.tag.find("#button-sitelimit").on("click", (function(_this) {
this.tag.find("#button-sitelimit").off("click").on("click", (function(_this) {
return function() {
wrapper.ws.cmd("siteSetLimit", $("#input-sitelimit").val(), function() {
wrapper.notifications.add("done-sitelimit", "done", "Site storage limit modified!", 5000);
@ -413,28 +413,28 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#checkbox-owned").on("click", (function(_this) {
this.tag.find("#checkbox-owned").off("click").on("click", (function(_this) {
return function() {
return wrapper.ws.cmd("siteSetOwned", [_this.tag.find("#checkbox-owned").is(":checked")]);
};
})(this));
this.tag.find("#checkbox-autodownloadoptional").on("click", (function(_this) {
this.tag.find("#checkbox-autodownloadoptional").off("click").on("click", (function(_this) {
return function() {
return wrapper.ws.cmd("siteSetAutodownloadoptional", [_this.tag.find("#checkbox-autodownloadoptional").is(":checked")]);
};
})(this));
this.tag.find("#button-identity").on("click", (function(_this) {
this.tag.find("#button-identity").off("click").on("click", (function(_this) {
return function() {
wrapper.ws.cmd("certSelect");
return false;
};
})(this));
this.tag.find("#checkbox-owned").on("click", (function(_this) {
this.tag.find("#checkbox-owned").off("click").on("click", (function(_this) {
return function() {
return wrapper.ws.cmd("siteSetOwned", [_this.tag.find("#checkbox-owned").is(":checked")]);
};
})(this));
this.tag.find("#button-settings").on("click", (function(_this) {
this.tag.find("#button-settings").off("click").on("click", (function(_this) {
return function() {
wrapper.ws.cmd("fileGet", "content.json", function(res) {
var data, json_raw;
@ -454,7 +454,7 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#button-sign").on("click", (function(_this) {
this.tag.find("#button-sign").off("click").on("click", (function(_this) {
return function() {
var inner_path;
inner_path = _this.tag.find("#select-contents").val();
@ -474,7 +474,7 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#button-publish").on("click", (function(_this) {
this.tag.find("#button-publish").off("click").on("click", (function(_this) {
return function() {
var inner_path;
inner_path = _this.tag.find("#select-contents").val();