Display and change per-site bigfile autodownload with sidebar

This commit is contained in:
shortcutme 2018-03-10 02:01:49 +01:00
parent bbb54d6a6a
commit dd924f389f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
4 changed files with 35 additions and 13 deletions

View file

@ -249,7 +249,7 @@ class Sidebar extends Class
@scrollable()
# Re-calculate height when site admin opened or closed
@tag.find("#checkbox-owned").off("click touchend").on "click touchend", =>
@tag.find("#checkbox-owned, #checkbox-autodownloadoptional").off("click touchend").on "click touchend", =>
setTimeout (=>
@scrollable()
), 300
@ -262,6 +262,14 @@ class Sidebar extends Class
@updateHtmlTag()
return false
# Site autodownload limit button
@tag.find("#button-autodownload_bigfile_size_limit").off("click touchend").on "click touchend", =>
@wrapper.ws.cmd "siteSetAutodownloadBigfileLimit", $("#input-autodownload_bigfile_size_limit").val(), (res) =>
if res == "ok"
@wrapper.notifications.add "done-bigfilelimit", "done", "Site bigfile auto download limit modified!", 5000
@updateHtmlTag()
return false
# Database reload
@tag.find("#button-dbreload").off("click touchend").on "click touchend", =>
@wrapper.ws.cmd "dbReload", [], =>
@ -327,10 +335,6 @@ class Sidebar extends Class
@wrapper.ws.cmd "certSelect"
return false
# Owned checkbox
@tag.find("#checkbox-owned").off("click touchend").on "click touchend", =>
@wrapper.ws.cmd "siteSetOwned", [@tag.find("#checkbox-owned").is(":checked")]
# Save settings
@tag.find("#button-settings").off("click touchend").on "click touchend", =>
@wrapper.ws.cmd "fileGet", "content.json", (res) =>

View file

@ -118,6 +118,12 @@
#checkbox-owned ~ .settings-owned { opacity: 0; max-height: 0px; transition: all 0.3s linear; overflow: hidden }
#checkbox-owned:checked ~ .settings-owned { opacity: 1; max-height: 420px }
/* Settings autodownload */
.settings-autodownloadoptional { clear: both; box-sizing: border-box; padding-top: 0px; }
#checkbox-autodownloadoptional ~ .settings-autodownloadoptional { opacity: 0; max-height: 0px; transition: all 0.3s ease-in-out; overflow: hidden; }
#checkbox-autodownloadoptional:checked ~ .settings-autodownloadoptional { opacity: 1; max-height: 120px; padding-top: 30px; }
/* Globe */
.globe { width: 360px; height: 360px }
.globe.loading { background: url(/uimedia/img/loading-circle.gif) center center no-repeat }
@ -154,4 +160,4 @@
/* Small screen */
@media screen and (max-width: 600px) {
.sidebar .close { display: block }
}
}

View file

@ -197,6 +197,12 @@
#checkbox-owned ~ .settings-owned { opacity: 0; max-height: 0px; -webkit-transition: all 0.3s linear; -moz-transition: all 0.3s linear; -o-transition: all 0.3s linear; -ms-transition: all 0.3s linear; transition: all 0.3s linear ; overflow: hidden }
#checkbox-owned:checked ~ .settings-owned { opacity: 1; max-height: 420px }
/* Settings autodownload */
.settings-autodownloadoptional { clear: both; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; padding-top: 0px; }
#checkbox-autodownloadoptional ~ .settings-autodownloadoptional { opacity: 0; max-height: 0px; -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out ; overflow: hidden; }
#checkbox-autodownloadoptional:checked ~ .settings-autodownloadoptional { opacity: 1; max-height: 120px; padding-top: 30px; }
/* Globe */
.globe { width: 360px; height: 360px }
.globe.loading { background: url(/uimedia/img/loading-circle.gif) center center no-repeat }
@ -233,4 +239,4 @@
/* Small screen */
@media screen and (max-width: 600px) {
.sidebar .close { display: block }
}
}

View file

@ -555,7 +555,7 @@ window.initScrollable = function () {
var menu;
this.log("Opened");
this.scrollable();
this.tag.find("#checkbox-owned").off("click touchend").on("click touchend", (function(_this) {
this.tag.find("#checkbox-owned, #checkbox-autodownloadoptional").off("click touchend").on("click touchend", (function(_this) {
return function() {
return setTimeout((function() {
return _this.scrollable();
@ -573,6 +573,17 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#button-autodownload_bigfile_size_limit").off("click touchend").on("click touchend", (function(_this) {
return function() {
_this.wrapper.ws.cmd("siteSetAutodownloadBigfileLimit", $("#input-autodownload_bigfile_size_limit").val(), function(res) {
if (res === "ok") {
_this.wrapper.notifications.add("done-bigfilelimit", "done", "Site bigfile auto download limit modified!", 5000);
}
return _this.updateHtmlTag();
});
return false;
};
})(this));
this.tag.find("#button-dbreload").off("click touchend").on("click touchend", (function(_this) {
return function() {
_this.wrapper.ws.cmd("dbReload", [], function() {
@ -653,11 +664,6 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#checkbox-owned").off("click touchend").on("click touchend", (function(_this) {
return function() {
return _this.wrapper.ws.cmd("siteSetOwned", [_this.tag.find("#checkbox-owned").is(":checked")]);
};
})(this));
this.tag.find("#button-settings").off("click touchend").on("click touchend", (function(_this) {
return function() {
_this.wrapper.ws.cmd("fileGet", "content.json", function(res) {