From 8c22a380f749514fdee246163bd4c7355b8f1faa Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 29 Nov 2012 16:05:42 +0000 Subject: minibar: add tool tips to some of the buttons Also move the functions title and attr from editor/editor.js to js/support.js. Also mention recent changes in minibar/about.html. --- src/www/js/support.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/www/js') diff --git a/src/www/js/support.js b/src/www/js/support.js index 47753e768..44c0e3895 100644 --- a/src/www/js/support.js +++ b/src/www/js/support.js @@ -160,12 +160,16 @@ function encodeArgs(args) { function text(s) { return document.createTextNode(s); } function node(tag,as,ds) { - var n=document.createElement(tag); - for(var a in as) n.setAttribute(a,as[a]); + var n=attr(as,document.createElement(tag)); if(ds) for(var i in ds) n.appendChild(ds[i]); return n; } +function attr(as,n) { + for(var a in as) n.setAttribute(a,as[a]); + return n +} + function empty(tag,name,value) { var el=node(tag,{},[]) if(name && value) el.setAttribute(name,value); @@ -221,6 +225,8 @@ function tda(cs) { return node("td",{},cs); } function img(src) { return empty("img","src",src); } +function title(t,n) { return attr({title:t},n) } + /* --- Document modification ------------------------------------------------ */ function clear(el) { replaceInnerHTML(el,""); } -- cgit v1.2.3