Skip to content

Instantly share code, notes, and snippets.

@RyanS
Created December 20, 2010 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanS/748922 to your computer and use it in GitHub Desktop.
Save RyanS/748922 to your computer and use it in GitHub Desktop.
var Admonitor = Admonitor || {};
/**
* @constructor
*/
Admonitor = function(options) {
this.time1 = (new Date()).getTime();
var adFeedbackLinkContainers = this.getAdmonitorDivs();
}
Admonitor.prototype.getAdmonitorDivs = function() {
if (document.getElementsByClassName) return document.getElementsByClassName('admon');
var classElements = [], node = document, tag = 'div',
els = node.getElementsByTagName(tag), elsLen = els.length, pattern = new RegExp("(^|\\s)admon(\\s|$)");
for (var i = 0, j = 0; i < elsLen; i++) {
if (pattern.test(els[i].className)) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
window['Admonitor'] = Admonitor;
(function(){var a=a||{};a=function(){this.a=(new Date).getTime();if(!document.getElementsByClassName)for(var c=document.getElementsByTagName("div"),d=c.length,e=/(^|\s)admon(\s|$)/,b=0,f=0;b<d;b++)e.test(c[b].className)&&f++};window.Admonitor=a;})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment