reactivating js for class 'today' as hourly built is disfunctional and last built known per page in footers

This commit is contained in:
vv01f 2015-10-20 14:34:48 +02:00
parent d9c8658485
commit 52a1c40434
2 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,23 @@
function hilight_today() {
var now = new Date();
var ClassName = 'today';
var today = document.getElementById( "calendar-" +
now.getFullYear() + "-" +
(now.getMonth() + 1) + "-" +
now.getDate() );
var oldtoday = document.getElementById( document.getElementsByClassName(ClassName)[0].id );
/* Has document fetching completed enough? */
if (today) {
oldtoday.className = oldtoday.className.replace(/\btoday\b/,'');
var td = today.parentNode;
var klass = td.getAttribute('class');
klass = (klass || "") + ' ' + ClassName;
td.setAttribute('class', klass);
} else {
/* Not in calendar yet, retry later: */
window.setTimeout(hilight_today, 100);
}
}
window.setTimeout(hilight_today, 1);

View File

@ -43,10 +43,10 @@
&lt;script src="<xsl:value-of select="$baseurl"/>script/ie-html5.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;![endif]</xsl:comment>
<xsl:if test="/page/calendar-summary">
<!-- vv01f: todo: build tags for existing files only -->
<!-- <xsl:call-template name="make-script-tag">
<!-- vv01f: todo: build tags for existing files only -->
<xsl:call-template name="make-script-tag">
<xsl:with-param name="name" select="'calendar'"/>
</xsl:call-template>-->
</xsl:call-template>
</xsl:if>
<xsl:call-template name="make-script-tag">
<xsl:with-param name="name" select="'jquery-1.8.3.min'"/>