1/*! iOSBadge v0.1.0 (c) 2012 Krister Kari; Licensed MIT */ 2 3(function(e,t,n){"use strict";var r,i;i=function(e){return typeof e=="string"||typeof e=="number"?isNaN(parseInt(e,10))?!1:!0:!1},r=function(e){return typeof e},t.IOSBadge=function(){function e(t,n){if(!(this instanceof e))return new e(t,n);if(!t||!t.nodeType||t.nodeType!==1)throw new Error("You need to pass an element as the first argument to iOSBadge");this.element=t,this.settings=n,t.length&&t.length>1&&(this.element=t[0]),n&&typeof n=="object"?(this.content=n.content||1,this.size=n.size||20,this.position=n.position||"top-right",this.namespace=n.namespace||"iosb",this.theme=n.theme||"red"):(this.content=1,this.size=20,this.position="top-right",this.namespace="iosb",this.theme="red"),this._generate()}return e.prototype._generate=function(){this.type=r(this.content),this.badgeElem=n.createElement("div"),this.badgeInner=n.createElement("div"),this.badgeContent=n.createElement("div"),this._setContent(this.content),this._setClasses(this.position,this.size,this.type,this.theme),this.badgeInner.appendChild(this.badgeContent),this.badgeElem.appendChild(this.badgeInner),this.element.appendChild(this.badgeElem)},e.prototype._setOptions=function(e){e&&typeof e=="object"?(e.content!=null&&this.setContent(e.content),e.position!=null&&this.setPosition(e.position),e.theme!=null&&this.setTheme(e.theme),e.size!=null&&this.setSize(e.size),e.hide&&e.hide===!0?this.hide():e.show&&e.show===!0&&this.show()):typeof e=="string"&&(e.toLowerCase()==="showbadge"?this.show():e.toLowerCase()==="hidebadge"?this.hide():this.setContent(e))},e.prototype._setContent=function(e){this.content=e,this.badgeContent.innerHTML=e},e.prototype._setClasses=function(e,t,n,r){var i;i=this.namespace,this.badgeElem.className=""+i+" "+i+"-"+t+" "+i+"-"+e,this.badgeInner.className=""+i+"-inner "+i+"-"+r,this.badgeContent.className=""+i+"-content "+i+"-"+n},e.prototype.getContent=function(){var e,t;return e=this.badgeContent.innerHTML,t=parseInt(e,10),isNaN(t)?e:t},e.prototype.setContent=function(e){var t,n,s;e==null&&(e=1),s=r(e);if(s==="object"||s==="function")return this;this.badgeElem.style.display==="none"&&this.show();if(s==="string"){n=e.charAt(0),t=+e.substring(1)||0;if(e==="")return this._setContent(""),this.hide(),this;if(n==="+")return this.increaseBy(t),this;if(n==="-")return this.decreaseBy(t),this;i(e)?s="number":s="string"}else s="number";return this.type=s,this._setClasses(this.position,this.size,s,this.theme),this._setContent(e),this},e.prototype.setPosition=function(e){return typeof e=="string"&&(this.position=e,this._setClasses(e,this.size,this.type,this.theme)),this},e.prototype.setTheme=function(e){return typeof e=="string"&&(this.theme=e,this._setClasses(this.position,this.size,this.type,e)),this},e.prototype.setSize=function(e){return i(e)&&(this.size=parseInt(e,10),this._setClasses(this.position,this.size,this.type,this.theme)),this},e.prototype.decreaseBy=function(e){return i(e)&&(this.type="number",this._setClasses(this.position,this.size,this.type,this.theme),this._setContent((parseInt(this.content,10)||0)-parseInt(e,10))),this},e.prototype.increaseBy=function(e){return i(e)&&(this.type="number",this._setClasses(this.position,this.size,this.type,this.theme),this._setContent((parseInt(this.content,10)||0)+parseInt(e,10))),this},e.prototype.hide=function(){return this.badgeElem.style.display="none",this},e.prototype.show=function(){return this.badgeElem.style.display="block",this},e}(),typeof e=="function"&&(e.fn.iosbadge=function(n){var r;return r="iosbadge",typeof n=="string"&&n.toLowerCase()==="getcontent"&&this.data(r)?this.data(r).getContent():this.each(function(){var i,s,o;o=this,i=e(o),s=i.data(r),s?s._setOptions(n):i.data(r,new t.IOSBadge(o,n))})})})(window.jQuery||window.Zepto,window,window.document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.