diff --git a/js/Messages.js b/js/Messages.js index 154d09618..4c21bc7f3 100644 --- a/js/Messages.js +++ b/js/Messages.js @@ -8,15 +8,15 @@ function getMessageDiv() if(!msgArea) return null; if(!msgArea.hasChildNodes()) { - var btn = createTiddlyButton(createTiddlyElement(msgArea,"div",null,"messageArea__toolbar messageToolbar"), - '', - config.messages.messageClose.tooltip, - clearMessage, + var toolbar = createTiddlyElement(msgArea,"div",null,"messageArea__toolbar messageToolbar"); + var btn = createTiddlyButton(toolbar, '', config.messages.messageClose.tooltip, clearMessage, "button messageToolbar__button"); + btn.innerHTML = ''+ ' '+ ' '+ ''; + // inline SVG is unsupported in old FireFox if(window.HTMLUnknownElement && btn.firstChild instanceof window.HTMLUnknownElement) { btn.innerHTML = config.messages.messageClose.text; } else { @@ -27,19 +27,17 @@ function getMessageDiv() return createTiddlyElement(msgArea,"div",null,"messageArea__text"); } -function displayMessage(text,linkText) +function displayMessage(text, link) { var e = getMessageDiv(); if(!e) { alert(text); return; } - if(linkText) { - var link = createTiddlyElement(e,"a",null,null,text); - link.href = linkText; - link.target = "_blank"; - } else { + if(!link) { e.appendChild(document.createTextNode(text)); + } else { + createTiddlyElement(e,"a",null,null,text,{ href: link, target: "_blank" }); } }