Lowercase

This commit is contained in:
Ivanq 2017-12-30 17:45:19 +03:00
parent 7121a96ebd
commit f2c76c0a3b
2 changed files with 37 additions and 1 deletions

View File

@ -429,7 +429,7 @@ class UiWebsocketPlugin(object):
<div class='flex'>
<input type='text' class='text' value="content.json" id='input-contents'/>
<span href='#Sign-and-Publish' class='button' id='button-sign-publish'>
{_[Sign and Publish]}
{_[Sign and publish]}
<span id='button-sign-publish-arrow'>v</span>
<div id='button-sign-publish-menu'>
<a href='#Sign' class='button' id='button-sign'>{_[Sign]}</a><br>

View File

@ -617,6 +617,42 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#button-sign-publish").off("click touchend").on("click touchend", (function(_this) {
return function() {
var inner_path;
inner_path = _this.tag.find("#input-contents").val();
wrapper.ws.cmd("fileRules", {
inner_path: inner_path
}, function(res) {
var ref;
if (wrapper.site_info.privatekey || (ref = wrapper.site_info.auth_address, indexOf.call(res.signers, ref) >= 0)) {
return wrapper.ws.cmd("sitePublish", {
privatekey: "stored",
inner_path: inner_path,
sign: true
}, function(res) {
if (res === "ok") {
return wrapper.notifications.add("sign", "done", inner_path + " Signed and published!", 5000);
}
});
} else {
return wrapper.displayPrompt("Enter your private key:", "password", "Sign", "", function(privatekey) {
return wrapper.ws.cmd("sitePublish", {
privatekey: privatekey,
inner_path: inner_path,
sign: true
}, function(res) {
if (res === "ok") {
return wrapper.notifications.add("sign", "done", inner_path + " Signed and published!", 5000);
}
});
});
}
});
_this.tag.find("#button-sign-publish-menu").removeClass("visible");
return false;
};
})(this));
this.tag.find("#button-sign").off("click touchend").on("click touchend", (function(_this) {
return function() {
var inner_path;