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:Lethosor/outdated warning.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(fix (add) namespace detection)
m (actually fix)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
// Warning when visiting an outdated page from an external site (e.g. Google)
 
// Warning when visiting an outdated page from an external site (e.g. Google)
if(document.referrer && document.referrer.indexOf(document.domain) == -1 && 'v0.31 40d 23a'.indexOf(wgCanonicalNamespace)!=-1){
+
if((document.referrer && document.referrer.indexOf(document.domain) == -1
   $('<div>').attr('class','usermessage').css({borderColor:'red', backgroundColor:'#fdb',fontWeight:'normal'}).html('This page is about an <strong>older version</strong> of Dwarf Fortress. Click the v0.34.11 link in the box below to view the current version of this page.').prependTo('#bodyContent')
+
    && 'v0.31 40d 23a'.split(' ').indexOf(wgCanonicalNamespace)!=-1 && !wgUserName)
 +
    || window.location.hash == '#outdated'){
 +
   $('<div>').attr('class','usermessage').css({borderColor:'red', backgroundColor:'#fdb', fontWeight:'normal', fontSize: '120%', color:'#900'})
 +
  .html('This page is about an <strong style="color:#f00">older version</strong> of Dwarf Fortress. Click the v0.34.11 link in the box below to view the current version of this page.').prependTo('#bodyContent')
 
}
 
}

Latest revision as of 19:00, 5 May 2014

// Warning when visiting an outdated page from an external site (e.g. Google)
if((document.referrer && document.referrer.indexOf(document.domain) == -1
    && 'v0.31 40d 23a'.split(' ').indexOf(wgCanonicalNamespace)!=-1 && !wgUserName)
    || window.location.hash == '#outdated'){
  $('<div>').attr('class','usermessage').css({borderColor:'red', backgroundColor:'#fdb', fontWeight:'normal', fontSize: '120%', color:'#900'})
  .html('This page is about an <strong style="color:#f00">older version</strong> of Dwarf Fortress. Click the v0.34.11 link in the box below to view the current version of this page.').prependTo('#bodyContent')
}