v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Emi/monobook.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Line 1: Line 1:
function liveClock()
+
function collapseSiteAnnounce()
{
+
{
if (typeof(UTCLiveClockConfig)=='undefined') UTCLiveClockConfig = {};
+
    var tableIndex = 0;
var portletId = UTCLiveClockConfig.portletId || 'p-personal';
+
    var NavigationBoxes = new Object();
var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById(UTCLiveClockConfig.nextNodeId) : undefined;
+
    var Tables = document.getElementsByTagName( "table" );
liveClock.node = addPortletLink( portletId, wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', '', 'utcdate', undefined, undefined, nextNode );
 
 
   
 
   
showTime();
+
    for ( var i = 0; i < Tables.length; i++ ) {
}
+
        if ( hasClass( Tables[i], "collapsible" ) ) {
addOnloadHook(liveClock)
+
              tableIndex++;
 +
        }
 +
    }
 
   
 
   
function showTime()
+
    for ( var i = 0;  i < tableIndex; i++ ) {
{
+
        if ( NavigationBoxes[i].getAttribute("id") == "siteannounce" ) {
+
            collapseTable( i );
var dateNode = liveClock.node;
+
        }
if( !dateNode ) {
+
    }
return;
+
  }
}
 
var now = new Date();
 
var hh = now.getUTCHours();
 
var mm = now.getUTCMinutes();
 
var ss = now.getUTCSeconds();
 
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
 
dateNode.firstChild.replaceChild( document.createTextNode( time + "  " ), dateNode.firstChild.firstChild );
 
   
 
window.setTimeout(showTime, 1000);
 
}
 

Revision as of 21:27, 2 April 2010

function collapseSiteAnnounce()
 {
     var tableIndex = 0;
     var NavigationBoxes = new Object();
     var Tables = document.getElementsByTagName( "table" );
 
     for ( var i = 0; i < Tables.length; i++ ) {
         if ( hasClass( Tables[i], "collapsible" ) ) {
              tableIndex++;
         }
     }
 
     for ( var i = 0;  i < tableIndex; i++ ) {
         if ( NavigationBoxes[i].getAttribute("id") == "siteannounce" ) {
             collapseTable( i );
         }
     }
 }