Hey Steve,
thank you for the 2 tracks to follow.
I am in the 1st case "head template". I totally understand the idea of adding an HTML
<a>
element with its href attribute.
Something like this <a href="https://example.com">Website</a>
. it suits me perfectly.
However my scripting skills suck. Could you please tell me how to add these attributes to this script?
I did read and re-read the help but I am not skilled enough to implement this in the script.
The 2nd track, I find it less relevant in my case. On the other hand very interesting in other situations.
I tried it with this subject and this one
I attach the actual script below
<script id="clockScript1" type="text/javascript">
var clockInterval;
$(function () {
if (clockInterval) return;
//add logo
var div1 = $('<div/>');
var logo = new Image();
logo.src = '/logo-onduleur.png'
logo.height = 50;
div1[0].style.margin = '10px auto';
div1.append(logo);
//add clock
var div2 = $('<div/>');
var p = $('<p/>');
div2.append(p);
div2[0].style.margin = '5px';
function displayTime() {
p.text(new Date().toLocaleString());
}
clockInterval = setInterval(displayTime, 1000);
//add to toolbar when it's available
var addToToolbarTimer;
function addToToolbar() {
var toolbar = $('.md-toolbar-tools');
if(!toolbar.length) return;
toolbar.append(div1);
toolbar.append(div2);
clearInterval(addToToolbarTimer);
}
addToToolbarTimer = setInterval(addToToolbar, 100);
});
</script>