Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2010 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/417402 to your computer and use it in GitHub Desktop.
Save anonymous/417402 to your computer and use it in GitHub Desktop.
// controller that manages our UX indicators
var indicatorController = {};
(function(c){
// helpers for changing scanner state
var showScannerDomAsScanning = function(dom){
dom.each(function(){$(this).removeClass('state-insecure');});
dom.each(function(){$(this).removeClass('state-good');});
dom.each(function(){$(this).addClass('state-inprogress');});
dom.each(function(){$(this).removeClass('state-caution');});
dom.each(function(){$(this).removeClass('state-fixing');});
};
var showScannerDomAsGood = function(dom){
dom.each(function(){$(this).removeClass('state-insecure');});
dom.each(function(){$(this).addClass('state-good');});
dom.each(function(){$(this).removeClass('state-inprogress');});
dom.each(function(){$(this).removeClass('state-caution');});
dom.each(function(){$(this).removeClass('state-fixing');});
};
var showScannerDomAsInsecure = function(dom){
dom.each(function(){$(this).addClass('state-insecure');});
dom.each(function(){$(this).removeClass('state-good');});
dom.each(function(){$(this).removeClass('state-inprogress');});
dom.each(function(){$(this).removeClass('state-caution');});
dom.each(function(){$(this).removeClass('state-fixing');});
};
var showScannerDomAsCaution = function(dom){
dom.each(function(){$(this).removeClass('state-insecure');});
dom.each(function(){$(this).removeClass('state-good');});
dom.each(function(){$(this).removeClass('state-inprogress');});
dom.each(function(){$(this).addClass('state-caution');});
dom.each(function(){$(this).removeClass('state-fixing');});
};
var showScannerDomAsFixing = function(dom){
dom.each(function(){$(this).removeClass('state-insecure');});
dom.each(function(){$(this).removeClass('state-good');});
dom.each(function(){$(this).removeClass('state-inprogress');});
dom.each(function(){$(this).removeClass('state-caution');});
dom.each(function(){$(this).addClass('state-fixing');});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment