You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
!function(){vart=function(){vart={limit:window.sr_post_titles.limit,bootstrap:function(){this.el=document.getElementById("titlewrap"),this.submitBtn=document.getElementById("publish"),this.postForm=document.getElementById("post"),this.el&&this.appendCounter()},appendCounter:function(){this.counter=document.createElement("span"),this.counter.appendChild(document.createTextNode("")),this.counter.id="sr-title-limiter",this.el.appendChild(this.counter),this.titleInput=this.el.getElementsByTagName("input")[0],this.run()},setCounter:function(){this.counter.childNodes[0].nodeValue=this.getLength(),this.setClasses()},setClasses:function(){parseInt(this.getLength(),10)<0?(this.counter.style.color="red",this.submitBtn.className="button button-primary-disabled button-large"):(this.counter.style.color="#999",this.submitBtn.className="button button-primary button-large")},getLength:function(){returnthis.limit-this.titleInput.value.length},checkLimit:function(t){returnthis.getLength()<1?(window.alert("Your title must be below "+this.limit+" characters."),t.stopImmediatePropagation(),t.preventDefault(),!1):void0},run:function(){this.setCounter(),this.titleInput.addEventListener("keyup",this.setCounter.bind(this)),this.submitBtn.addEventListener("click",this.checkLimit.bind(this)),this.postForm.addEventListener("submit",this.checkLimit.bind(this))}};this.init=function(){t.bootstrap()}};document.addEventListener("DOMContentLoaded",function(){vare=newt;e.init()})}();