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/fullpage.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (fix)
(clean up)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
// Enables full-page mode (like full-screen, but only in-browser)
 
 
jQuery(function($){
 
jQuery(function($){
var show=function(){$('body').children().not('.mw-body').show(200);$('.mw-body').css({width:'', margin:''})};
+
  var show = function() {
var hide=function(){$('body').children().not('.mw-body').hide(200);$('.mw-body').animate({width:'100%', margin:0}, 200)};
+
    $('.fullpage-hidden').show(200);$('.mw-body').css({width:'', margin:'', padding:''});
var toggle=function(){if(hidden)show();else hide();hidden=!hidden;}
+
  };
var count=0, hidden=false;
+
  var hide = function() {
$(window).keydown(function(e){if(e.keyCode==18){count++;if(count>=3){toggle();count=0}}else count=0;});
+
    $('body').children().not('.mw-body').filter(':visible').hide(200).addClass('fullpage-hidden');
 +
    $('.mw-body').animate({width:'100%', margin:0, padding:0}, 200);
 +
  };
 +
  var toggle=function() {
 +
    if (hidden) show();
 +
    else hide();
 +
    hidden = !hidden;
 +
  };
 +
  var count = 0, hidden = false;
 +
  $(window).keydown(function(e) {
 +
    if (e.keyCode==18) {
 +
      count++;
 +
      if(count>=3) {
 +
        toggle();
 +
        count = 0;
 +
      }
 +
    }
 +
    else
 +
      count = 0;
 +
  });
 
});
 
});

Latest revision as of 21:56, 8 June 2014

jQuery(function($){
  var show = function() {
    $('.fullpage-hidden').show(200);$('.mw-body').css({width:'', margin:'', padding:''});
  };
  var hide = function() {
    $('body').children().not('.mw-body').filter(':visible').hide(200).addClass('fullpage-hidden');
    $('.mw-body').animate({width:'100%', margin:0, padding:0}, 200);
  };
  var toggle=function() {
    if (hidden) show();
    else hide();
    hidden = !hidden;
  };
  var count = 0, hidden = false;
  $(window).keydown(function(e) {
    if (e.keyCode==18) {
      count++;
      if(count>=3) {
        toggle();
        count = 0;
      }
    }
    else
      count = 0;
  });
});