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:Briess/hideAnnouncements.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(disable, since announcements are gone and this causes a JS error)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
addOnloadHook(
+
/*addOnloadHook(
 
     function () {
 
     function () {
       if (SiteAnnounce != get_cookie('dfannounce')){
+
       if (document.getElementById('siteannounce').innerHTML == get_cookie('dfannounce')){
        set_cookie ( "dfannounce", SiteAnnounce, 2020, 01, 01);
 
      }else{
 
 
         collapseTable(0); // the announcements table is assumed to be collapsableTable0 in this case.  This could be different depending on skin.
 
         collapseTable(0); // the announcements table is assumed to be collapsableTable0 in this case.  This could be different depending on skin.
 
       }
 
       }
 
     }
 
     }
);
+
);*/
 
 
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
 
{
 
  var cookie_string = name + "=" + escape ( value );
 
 
 
  if ( exp_y )
 
  {
 
    var expires = new Date ( exp_y, exp_m, exp_d );
 
    cookie_string += "; expires=" + expires.toGMTString();
 
  }
 
 
 
  if ( path )
 
        cookie_string += "; path=" + escape ( path );
 
 
 
  if ( domain )
 
        cookie_string += "; domain=" + escape ( domain );
 
 
 
  if ( secure )
 
        cookie_string += "; secure";
 
 
 
  document.cookie = cookie_string;
 
}
 
 
 
function get_cookie ( cookie_name )
 
{
 
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
 
 
 
  if ( results )
 
    return ( unescape ( results[2] ) );
 
  else
 
    return null;
 
}
 

Latest revision as of 19:18, 28 December 2013

/*addOnloadHook(
    function () {
      if (document.getElementById('siteannounce').innerHTML == get_cookie('dfannounce')){
        collapseTable(0); // the announcements table is assumed to be collapsableTable0 in this case.  This could be different depending on skin.
      }
    }
);*/