5
$.userMode = (function(){
12
testDiv = testDiv || $('<div></div>').css({position: 'absolute', left: '-999em', top: '-999px', width: '0px', height: '0px'}).appendTo('body');
13
var black = $.curCSS( testDiv.css({backgroundColor: '#000000'})[0], 'backgroundColor', true),
14
white = $.curCSS( testDiv.css({backgroundColor: '#ffffff'})[0], 'backgroundColor', true),
15
newBgStatus = (black === white || white === 'transparent');
16
if(newBgStatus != userBg){
18
$.event.trigger('_internalusermode');
25
timer = setInterval(testBg, 3000);
34
$.event.special.usermode = {
36
(!boundEvents && init());
39
.bind('_internalusermode', $.event.special.usermode.handler);
41
setTimeout(function(){
42
jElem.triggerHandler('_internalusermode');
48
(!boundEvents && stop());
49
$(this).unbind('_internalusermode', $.event.special.usermode.handler);
56
return jQuery.event.handle.apply(this, arguments);
66
$.fn.userMode = function(fn){
67
return this[(fn) ? 'bind' : 'trigger']('usermode', fn);
71
$('html').userMode(function(e){
72
$('html')[e.enabled ? 'addClass' : 'removeClass']('hcm');