diff options
| author | Kristian Lyngstol <kly@kly.no> | 2019-01-08 23:07:22 +0100 | 
|---|---|---|
| committer | Kristian Lyngstol <kly@kly.no> | 2019-01-08 23:07:22 +0100 | 
| commit | b16c52166de02766007f8ba8d458bf1d20c00afc (patch) | |
| tree | aad21b25df1b9881d46f01b7fee015a5b14f6bd8 /web/js/nms-oplog.js | |
| parent | 435da6f11d41896c16ee7aedb0c41c33eb259e89 (diff) | |
Re-introduce the use-name-box and tweak style
Turns out the style-diff was because the old implementation with hard-coded
HTML had indentation == white space, which rendered as white-space between the
elements.... This SHOULD be a CSS fix, but in the meanwhile....
Diffstat (limited to 'web/js/nms-oplog.js')
| -rw-r--r-- | web/js/nms-oplog.js | 30 | 
1 files changed, 20 insertions, 10 deletions
| diff --git a/web/js/nms-oplog.js b/web/js/nms-oplog.js index c49a980..42452ff 100644 --- a/web/js/nms-oplog.js +++ b/web/js/nms-oplog.js @@ -38,30 +38,40 @@ class nmsOplog2 {  		this.full.attach("oplog-parent")  		this.mini.show()  		this.full.show() +		this._username = new nmsBox("p", {html:{className: "navbar-text navbar-right"}}); +		if (nms.user) { +			this._username.html.textContent = nms.user +		} +		this._username.attach("navbar"); +		this._username.show()  		nmsData.addHandler("oplog", "nmsOplogHandler", this.updateComments,this);  	}  	updateComments(x) { +		if (nms.user && x._username.user != nms.user) { +			x._username.user = nms.user; +			x._username.html.textContent = nms.user +		}  		x.mini.update()  		x.full.update()  	}  }  class nmsOplogInput extends nmsBox {  	constructor() { -		super("div",{html:{className: "navbar-form", classList:["navbar-form","navbar-right","gondul-is-private"]}}) -		var systemParent = new nmsBox("div",{html:{className:"form-group",classList:["form-group"]}}); -		this._systems = new nmsBox("input", {html:{className:"form-control",classList:["form-control"],type:"text",size:"8",placeholder:"System(s)"}}); +		super("div",{html:{className:"navbar-form form-inline navbar-right gondul-is-private"}}) +		this._systems = new nmsBox("input", {html:{className:"form-control",type:"text",size:"8",placeholder:"System(s)"}});  		this._systems.searchbox = document.getElementById("searchbox")   		this._systems.html.oninput = function(e) {  			this.nmsBox.searchbox.value = this.value;  			this.nmsBox.searchbox.oninput();  		} -		systemParent.add(this._systems) -		this.add(systemParent) -		var entryParent = new nmsBox("div",{html:{className:"form-group",classList:["form-group"]}}); -		this._entry = new nmsBox("input", {html:{className:"form-control",classList:["form-control"],type:"text",size:"30",placeholder:"Log entry"}}); -		entryParent.add(this._entry) -		this.add(entryParent) -		var button = new nmsBox("button",{html:{classList:["btn","btn-default"],type:"button"}}); +		this.add(this._systems) +		// This is to provide spacing.... should probably be solved in CSS. +		// If this annoys you, then fix it. +		this.add(new nmsBox("p",{html:{textContent:" ",style:{display: "inline"}}})) +		this._entry = new nmsBox("input", {html:{className:"form-control",type:"text",size:"30",placeholder:"Log entry"}}); +		this.add(this._entry) +		this.add(new nmsBox("p",{html:{textContent:" ",style:{display: "inline"}}})) +		var button = new nmsBox("button",{html:{className:"btn btn-default",type:"button"}});  		button.html.textContent = "Log";  		button.container = this;  		button.html.onclick = function(element) { | 
