الكود:
[size=14][b][/b][/size]
[size=14][b][/b][/size]
(function() {[size=14][b][/b][/size]
'DEVELOPED BY ANGE TUTEUR';[size=14][b][/b][/size]
'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';[size=14][b][/b][/size]
'ORIGIN : http://fmdesign.forumotion.com/t444-night-mode#3675';[size=14][b][/b][/size]
[size=14][b][/b][/size]
if (/msie/i.test(window.n.....تمنع روابط التحميل الغير قانوني......gator.userAgent)) return; // browser exclusion[size=14][b][/b][/size]
if (!window.fa_night_mode && typeof document.getElementsByTagName('HEAD')[0].style.pointerEvents === 'string') {[size=14][b][/b][/size]
[size=14][b][/b][/size]
window.fa_night_mode = {[size=14][b][/b][/size]
targets : ['page-footer', 'pun-foot', 'ipbwrapper'], // target node that the dimmer will be attached to[size=14][b][/b][/size]
[size=14][b][/b][/size]
// executed when the dimmer is changed[size=14][b][/b][/size]
dimLight : function() {[size=14][b][/b][/size]
var val = +fa_night_mode.dimmer.value;[size=14][b][/b][/size]
fa_night_mode.shade.style.backgroundColor = 'rgba(0, 0, 0, ' + val / 100 + ')';[size=14][b][/b][/size]
fa_night_mode.counter.innerHTML = ( val / 90 * 100 ).toFixed() + '%';[size=14][b][/b][/size]
my_setcookie('fa_night_level', val);[size=14][b][/b][/size]
}[size=14][b][/b][/size]
};[size=14][b][/b][/size]
[size=14][b][/b][/size]
// startup variables[size=14][b][/b][/size]
var dimmer = document.createElement('INPUT'),[size=14][b][/b][/size]
container = document.createElement('DIV'),[size=14][b][/b][/size]
counter = document.createElement('SPAN'),[size=14][b][/b][/size]
cookie = my_getcookie('fa_night_level'); // cookies <3[size=14][b][/b][/size]
[size=14][b][/b][/size]
// set the night shade and styles[size=14][b][/b][/size]
document.write('<style type="text/css">#fa_night_shade { font-size:0; position:fixed; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:999999999; } #fa_night_dimmer { margin:0 6px; vertical-align:middle; cursor:pointer; } #fa_night_container { font-size:12px; font-family:arial, sans-serif; background:#EEE; border:1px solid #CCC; border-radius:3px; display:inline-block; padding:3px; margin:1px; }</style>');[size=14][b][/b][/size]
fa_night_mode.shade = $('<div id="fa_night_shade" style="background-color:rgba(0, 0, 0, ' + ( cookie ? cookie / 100 : 0 ) + ');"></div>')[0];[size=14][b][/b][/size]
[size=14][b][/b][/size]
fa_night_mode.interval = window.setInterval(function() {[size=14][b][/b][/size]
if (document.body) {[size=14][b][/b][/size]
document.body.appendChild(fa_night_mode.shade);[size=14][b][/b][/size]
window.clearInterval(fa_night_mode.interval);[size=14][b][/b][/size]
}[size=14][b][/b][/size]
}, 1);[size=14][b][/b][/size]
[size=14][b][/b][/size]
// dimmer attributes[size=14][b][/b][/size]
dimmer.id = 'fa_night_dimmer';[size=14][b][/b][/size]
dimmer.type = 'range';[size=14][b][/b][/size]
dimmer.min = 0;[size=14][b][/b][/size]
dimmer.max = 90;[size=14][b][/b][/size]
dimmer.value = cookie || 0;[size=14][b][/b][/size]
dimmer[/trident/i.test(window.n.....تمنع روابط التحميل الغير قانوني......gator.userAgent) ? 'onchange' : 'oninput'] = fa_night_mode.dimLight; // IE11 cannot use oninput[size=14][b][/b][/size]
[size=14][b][/b][/size]
// percentage counter[size=14][b][/b][/size]
counter.id = 'fa_night_counter';[size=14][b][/b][/size]
counter.innerHTML = ( cookie ? cookie / 90 * 100 : 0 ).toFixed() + '%';[size=14][b][/b][/size]
[size=14][b][/b][/size]
// container contents[size=14][b][/b][/size]
container.id = 'fa_night_container';[size=14][b][/b][/size]
container.innerHTML = '<span>وضوح الشاشة :</span>';[size=14][b][/b][/size]
$(container).append([dimmer, counter]);[size=14][b][/b][/size]
[size=14][b][/b][/size]
// cache nodes to the global object[size=14][b][/b][/size]
fa_night_mode.dimmer = dimmer;[size=14][b][/b][/size]
fa_night_mode.counter = counter;[size=14][b][/b][/size]
[size=14][b][/b][/size]
[size=14][b][/b][/size]
// stuff to do when the document is ready[size=14][b][/b][/size]
$(function() {[size=14][b][/b][/size]
// find one ( AND ONLY ONE ) of the targets to attach the dimmer[size=14][b][/b][/size]
for (var i = 0, j = fa_night_mode.targets.length, footer; i < j; i++) {[size=14][b][/b][/size]
footer = document.getElementById(fa_night_mode.targets[i]);[size=14][b][/b][/size]
if (footer) {[size=14][b][/b][/size]
footer.appendChild(container);[size=14][b][/b][/size]
break;[size=14][b][/b][/size]
}[size=14][b][/b][/size]
}[size=14][b][/b][/size]
[size=14][b][/b][/size]
if (!footer) {[size=14][b][/b][/size]
document.body.appendChild(container); // fallback if footer cannot be found[size=14][b][/b][/size]
}[size=14][b][/b][/size]
});[size=14][b][/b][/size]
}[size=14][b][/b][/size]
}());
جميع الحقوق محفوظة لدليل الاشهار العربي