Rev3224, Small cosmetic changes on sidebar Sign and publish button
This commit is contained in:
parent
acfe4deacf
commit
9c4093dc7c
7 changed files with 36 additions and 20 deletions
|
@ -417,6 +417,14 @@ class UiWebsocketPlugin(object):
|
||||||
"""))
|
"""))
|
||||||
|
|
||||||
# Choose content you want to sign
|
# Choose content you want to sign
|
||||||
|
body.append(_(u"""
|
||||||
|
<div class='flex'>
|
||||||
|
<input type='text' class='text' value="content.json" id='input-contents'/>
|
||||||
|
<a href='#Sign-and-Publish' id='button-sign-publish' class='button'>{_[Sign and publish]}</a>
|
||||||
|
<a href='#Sign-or-Publish' id='menu-sign-publish'>\u22EE</a>
|
||||||
|
</div>
|
||||||
|
"""))
|
||||||
|
|
||||||
contents = ["content.json"]
|
contents = ["content.json"]
|
||||||
contents += site.content_manager.contents.get("content.json", {}).get("includes", {}).keys()
|
contents += site.content_manager.contents.get("content.json", {}).get("includes", {}).keys()
|
||||||
body.append(_(u"<div class='contents'>{_[Choose]}: "))
|
body.append(_(u"<div class='contents'>{_[Choose]}: "))
|
||||||
|
@ -424,17 +432,7 @@ class UiWebsocketPlugin(object):
|
||||||
content = cgi.escape(content, True)
|
content = cgi.escape(content, True)
|
||||||
body.append(_("<a href='#{content}' onclick='$(\"#input-contents\").val(\"{content}\"); return false'>{content}</a> "))
|
body.append(_("<a href='#{content}' onclick='$(\"#input-contents\").val(\"{content}\"); return false'>{content}</a> "))
|
||||||
body.append("</div>")
|
body.append("</div>")
|
||||||
|
body.append("</li>")
|
||||||
body.append(_(u"""
|
|
||||||
<div class='flex'>
|
|
||||||
<input type='text' class='text' value="content.json" id='input-contents'/>
|
|
||||||
<span id='wrapper-sign-publish' class='button'>
|
|
||||||
<a href='#Sign-and-Publish' id='button-sign-publish'>{_[Sign and publish]}</a>
|
|
||||||
<a href='#Sign-and-Publish' id='menu-sign-publish'>\u22EE</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
"""))
|
|
||||||
|
|
||||||
def actionSidebarGetHtmlTag(self, to):
|
def actionSidebarGetHtmlTag(self, to):
|
||||||
site = self.site
|
site = self.site
|
||||||
|
|
|
@ -10,9 +10,12 @@ class Menu
|
||||||
@hide()
|
@hide()
|
||||||
else
|
else
|
||||||
button_pos = @button.offset()
|
button_pos = @button.offset()
|
||||||
@elem.css({"top": button_pos.top+@button.outerHeight(), "left": button_pos.left})
|
left = button_pos.left
|
||||||
|
@elem.css({"top": button_pos.top+@button.outerHeight(), "left": left})
|
||||||
@button.addClass("menu-active")
|
@button.addClass("menu-active")
|
||||||
@elem.addClass("visible")
|
@elem.addClass("visible")
|
||||||
|
if @elem.position().left + @elem.width() + 20 > window.innerWidth
|
||||||
|
@elem.css("left", window.innerWidth - @elem.width() - 20)
|
||||||
if window.visible_menu then window.visible_menu.hide()
|
if window.visible_menu then window.visible_menu.hide()
|
||||||
window.visible_menu = @
|
window.visible_menu = @
|
||||||
|
|
||||||
|
|
|
@ -359,7 +359,8 @@ class Sidebar extends Class
|
||||||
@tag.find("#button-sign-publish-menu").removeClass("visible")
|
@tag.find("#button-sign-publish-menu").removeClass("visible")
|
||||||
@tag.find(".contents + .flex").removeClass("sign-publish-flex")
|
@tag.find(".contents + .flex").removeClass("sign-publish-flex")
|
||||||
|
|
||||||
menu = new Menu(@tag.find("#wrapper-sign-publish"))
|
menu = new Menu(@tag.find("#menu-sign-publish"))
|
||||||
|
menu.elem.css("margin-top", "-130px") # Open upwards
|
||||||
menu.addItem "Sign", =>
|
menu.addItem "Sign", =>
|
||||||
inner_path = @tag.find("#input-contents").val()
|
inner_path = @tag.find("#input-contents").val()
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
.globe.error { text-align: center; padding-top: 156px; box-sizing: border-box; opacity: 0.2; }
|
.globe.error { text-align: center; padding-top: 156px; box-sizing: border-box; opacity: 0.2; }
|
||||||
|
|
||||||
/* Sign publish */
|
/* Sign publish */
|
||||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; }
|
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; margin-top: 10px }
|
||||||
.contents a { color: white }
|
.contents a { color: white }
|
||||||
.contents a:active { background-color: #6B6B6B }
|
.contents a:active { background-color: #6B6B6B }
|
||||||
|
|
||||||
|
@ -145,7 +145,11 @@
|
||||||
}
|
}
|
||||||
#menu-sign-publish {
|
#menu-sign-publish {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
color: #AAA;
|
||||||
|
padding: 7px;
|
||||||
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
#menu-sign-publish:hover { color: white }
|
||||||
|
|
||||||
/* Small screen */
|
/* Small screen */
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
|
|
|
@ -202,7 +202,7 @@
|
||||||
.globe.error { text-align: center; padding-top: 156px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; opacity: 0.2; }
|
.globe.error { text-align: center; padding-top: 156px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; opacity: 0.2; }
|
||||||
|
|
||||||
/* Sign publish */
|
/* Sign publish */
|
||||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; }
|
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; margin-top: 10px }
|
||||||
.contents a { color: white }
|
.contents a { color: white }
|
||||||
.contents a:active { background-color: #6B6B6B }
|
.contents a:active { background-color: #6B6B6B }
|
||||||
|
|
||||||
|
@ -223,7 +223,11 @@
|
||||||
}
|
}
|
||||||
#menu-sign-publish {
|
#menu-sign-publish {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
color: #AAA;
|
||||||
|
padding: 7px;
|
||||||
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
#menu-sign-publish:hover { color: white }
|
||||||
|
|
||||||
/* Small screen */
|
/* Small screen */
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
|
|
|
@ -73,18 +73,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu.prototype.show = function() {
|
Menu.prototype.show = function() {
|
||||||
var button_pos;
|
var button_pos, left;
|
||||||
if (window.visible_menu && window.visible_menu.button[0] === this.button[0]) {
|
if (window.visible_menu && window.visible_menu.button[0] === this.button[0]) {
|
||||||
window.visible_menu.hide();
|
window.visible_menu.hide();
|
||||||
return this.hide();
|
return this.hide();
|
||||||
} else {
|
} else {
|
||||||
button_pos = this.button.offset();
|
button_pos = this.button.offset();
|
||||||
|
left = button_pos.left;
|
||||||
this.elem.css({
|
this.elem.css({
|
||||||
"top": button_pos.top + this.button.outerHeight(),
|
"top": button_pos.top + this.button.outerHeight(),
|
||||||
"left": button_pos.left
|
"left": left
|
||||||
});
|
});
|
||||||
this.button.addClass("menu-active");
|
this.button.addClass("menu-active");
|
||||||
this.elem.addClass("visible");
|
this.elem.addClass("visible");
|
||||||
|
if (this.elem.position().left + this.elem.width() + 20 > window.innerWidth) {
|
||||||
|
this.elem.css("left", window.innerWidth - this.elem.width() - 20);
|
||||||
|
}
|
||||||
if (window.visible_menu) {
|
if (window.visible_menu) {
|
||||||
window.visible_menu.hide();
|
window.visible_menu.hide();
|
||||||
}
|
}
|
||||||
|
@ -313,7 +317,8 @@ window.initScrollable = function () {
|
||||||
@logStart("Preloading")
|
@logStart("Preloading")
|
||||||
wrapper.ws.cmd "sidebarGetHtmlTag", {}, (res) =>
|
wrapper.ws.cmd "sidebarGetHtmlTag", {}, (res) =>
|
||||||
@logEnd("Preloading")
|
@logEnd("Preloading")
|
||||||
@preload_html = res */
|
@preload_html = res
|
||||||
|
*/
|
||||||
this.fixbutton.on("mousedown touchstart", (function(_this) {
|
this.fixbutton.on("mousedown touchstart", (function(_this) {
|
||||||
return function(e) {
|
return function(e) {
|
||||||
if (e.button > 0) {
|
if (e.button > 0) {
|
||||||
|
@ -692,7 +697,8 @@ window.initScrollable = function () {
|
||||||
return _this.tag.find(".contents + .flex").removeClass("sign-publish-flex");
|
return _this.tag.find(".contents + .flex").removeClass("sign-publish-flex");
|
||||||
};
|
};
|
||||||
})(this));
|
})(this));
|
||||||
menu = new Menu(this.tag.find("#wrapper-sign-publish"));
|
menu = new Menu(this.tag.find("#menu-sign-publish"));
|
||||||
|
menu.elem.css("margin-top", "-130px");
|
||||||
menu.addItem("Sign", (function(_this) {
|
menu.addItem("Sign", (function(_this) {
|
||||||
return function() {
|
return function() {
|
||||||
var inner_path;
|
var inner_path;
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.6.1"
|
self.version = "0.6.1"
|
||||||
self.rev = 3223
|
self.rev = 3224
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.config_file = "zeronet.conf"
|
self.config_file = "zeronet.conf"
|
||||||
|
|
Loading…
Reference in a new issue