Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2010
Embed
What would you like to do?
// 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