Created
January 30, 2014 20:06
-
-
Save MarcoGomesr/8717655 to your computer and use it in GitHub Desktop.
demo STP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){$().socialTrafficPop({timeout:90,title:"Compartir esta pagina",message:"Comparte esta pagina en las redes sociales!",google_url:"http://como-ganar-dinero-con-gatwin.blogspot/",fb_url:"http://como-ganar-dinero-con-gatwin.blogspot/",closeable:!0,advancedClose:!0,google_on:!0,twitter_on:!0,linkedin_on:!0,linkedin_url:"http://como-ganar-dinero-con-gatwin.blogspot/",opacity:"0.45",twitter_method:"tweet",tweet_url:"http://como-ganar-dinero-con-gatwin.blogspot",tweet_text:"Gana dinero sin invertir absolutamente nada con gatwin!",onClick:"stp-open"})});(function(e){e.fn.socialTrafficPop=function(t){var n={title:"Social Traffic Pop",message:"Share Social Traffic Pop with your friends and see what happens!",closeable:!0,advancedClose:!0,opacity:"0.3",onClick:"stp-open",facebook_on:!0,google_on:!0,twitter_on:!0,linkedin_on:!0,google_url:"http://tyler.tc",google_annotation:"bubble",google_size:"medium",fb_url:"http://codecanyon.net/item/social-traffic-pop-for-wordpress/309705",fb_layout:"button_count",fb_showfaces:!1,fb_color_scheme:"light",twitter_user:"TylerColwell7",twitter_method:"tweet",tweet_url:null,tweet_text:null,tweet_count:"horizontal",tweeted_by:!1,linkedin_url:"http://tyler.tc/",timeout:25,wait:0,delay:0};t=e.extend(n,t);if(700<=e(window).width()){n.delay*=1e3;stp_createCookie=function(e,t,n){if(n){var r=new Date;r.setTime(r.getTime()+864e5*n);n="; expires="+r.toGMTString()}else n="";document.cookie=e+"="+t+n+"; path=/"};stp_readCookie=function(e){e+="=";for(var t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(e))return r.substring(e.length,r.length)}return null};stp_createWait=function(e,t,n){if(n){var r=new Date;r.setTime(r.getTime()+6e4*n);n="; expires="+r.toGMTString()}else n="";document.cookie=e+"="+t+n+"; path=/"};stp_recenter=function(){var t=e("#stp-main"),n=document.documentElement.clientWidth,r=document.documentElement.clientHeight,i=t.outerHeight(),s=t.width();t.css({top:(r-i)/2+"px",left:n/2-s/2});e("#stp-bg").css({height:r})};e(window).resize(function(){stp_recenter()});stp_flush=function(t){!0==t&&stp_createCookie("stpshow","true",30);jQuery("#stp-bg").fadeOut("slow");jQuery("#stp-main").fadeOut("slow");e("#stp-count").countdown("destroy")};stp_linkedin=function(t){e("#stp-linkedin").append('<script src="//platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="'+t+'" data-counter="right" data-onsuccess="stp_linkedinCB"></script>')};stp_cleanpage=function(){window.location.reload(!0)};stp_display=function(){stp_recenter();e("#stp-bg").css({opacity:n.opacity});e("#stp-bg").fadeIn("slow");e("#stp-main").fadeIn("slow");stp_linkedin(n.linkedin_url);"0"==n.timeout?e("#stp-counter").hide():e("#stp-count").countdown({until:"+"+n.timeout+"s",format:"S",compact:!0,description:"",onExpiry:stp_flush});"0"==n.wait?r=!1:stp_createCookie("stpwait","true",n.wait);FB.XFBML.parse()};getPopHTML=function(){var e="",t="",r=0;!0==n.closeable&&(e='<a href="#" id="stp-close">X<a/>');!0==n.facebook_on&&(t=t+'<div class="stp-button"><fb:like id="stplike" href="'+n.fb_url+'" send="false" layout="'+n.fb_layout+'" width="50" show_faces="'+n.fb_showfaces+'" colorscheme="'+n.fb_color_scheme+'"></fb:like></div>',r++);!0==n.google_on&&(t=t+'<div class="stp-button"><g:plusone size="'+n.google_size+'" annotation="'+n.google_annotation+'" href="'+n.google_url+'" callback="stp_googleCB"></g:plusone></div>',r++);if(!0==n.twitter_on){var i="follow"==n.twitter_method?'<div class="stp-button"><a id="spTwitter" href="http://twitter.com/'+n.twitter_user+'" class="twitter-follow-button" data-show-count="false">Follow @'+n.twitter_user+"</a></div>":'<div class="stp-button"><a href="https://twitter.com/share" class="twitter-share-button" '+(null!=n.tweet_url?'data-url="'+n.tweet_url+'"':"")+" "+(null!=n.tweet_text?'data-text="'+n.tweet_text+'"':"")+" "+(!0==n.tweeted_by&&""!=n.twitter_user?'data-via="'+n.tweeted_by+'"':"")+' data-count="'+n.tweet_count+'">Tweet</a></div>';r++;t+=i}!0==n.linkedin_on&&(t+='<div class="stp-button" id="stp-linkedin"></div>',r++);var e='<div id="stp-bg"></div><div id="stp-main"><div id="stp-title">'+e+""+n.title+'</div><div id="stp-msg">',i=n.message,s=document.createElement("div");s.innerHTML=i;return e+(0===s.childNodes.length?"":s.childNodes[0].nodeValue)+'</div><div id="stp-buttons" class="stp-buttons-'+r+'">'+t+'<br class="step-clear" /></div><div id="stp-bottom"><div id="stp-counter">Comparte o espera <span id="stp-count"></span> segundos.<br><a id="stp-pb" href="http://goo.gl/44Zcw" target="_blank">Desarrollado por STP</a></div></div></div>'};t=getPopHTML();e("body").append(t);t=stp_readCookie("stpshow");var r=stp_readCookie("stpwait");"true"!=t&&"true"!=r&&setTimeout(function(){stp_display()},n.delay);e("#stp-close").click(function(e){e.stopPropagation();e.preventDefault();stp_flush(!1)});!0==n.advancedClose&&(e(document).keyup(function(e){27==e.keyCode&&stp_flush(!1)}),e("body").click(function(){stp_flush(!1)}),e("#stp-main").click(function(e){e.stopPropagation()}));e("."+n.onClick).on("click",function(e){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();stp_display()});stp_googleCB=function(e){"on"==e.state&&setTimeout(stp_flush(!0),2500)};stp_linkedinCB=function(){stp_flush(!0)};FB.Event.subscribe("edge.create",function(t,n){"stplike"==e("#"+n.dom.id).attr("id")&&stp_flush(!0)});stp_twitterCB=function(){stp_flush(!0)};twttr.events.bind("tweet",stp_twitterCB);twttr.events.bind("follow",stp_twitterCB)}return!0}})(jQuery);(function(e){function t(){this.regional=[];this.regional[""]={labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,timeSeparator:":",isRTL:false};this._defaults={until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:false,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1};e.extend(this._defaults,this.regional[""]);this._serverSyncs=[]}function l(t,n){e.extend(t,n);for(var r in n){if(n[r]==null){t[r]=null}}return t}var n="countdown";var r=0;var i=1;var s=2;var o=3;var u=4;var a=5;var f=6;e.extend(t.prototype,{markerClassName:"hasCountdown",_timer:setInterval(function(){e.countdown._updateTargets()},980),_timerTargets:[],setDefaults:function(e){this._resetExtraLabels(this._defaults,e);l(this._defaults,e||{})},UTCDate:function(e,t,n,r,i,s,o,u){if(typeof t=="object"&&t.constructor==Date){u=t.getMilliseconds();o=t.getSeconds();s=t.getMinutes();i=t.getHours();r=t.getDate();n=t.getMonth();t=t.getFullYear()}var a=new Date;a.setUTCFullYear(t);a.setUTCDate(1);a.setUTCMonth(n||0);a.setUTCDate(r||1);a.setUTCHours(i||0);a.setUTCMinutes((s||0)-(Math.abs(e)<30?e*60:e));a.setUTCSeconds(o||0);a.setUTCMilliseconds(u||0);return a},periodsToSeconds:function(e){return e[0]*31557600+e[1]*2629800+e[2]*604800+e[3]*86400+e[4]*3600+e[5]*60+e[6]},_settingsCountdown:function(t,r){if(!r){return e.countdown._defaults}var i=e.data(t,n);return r=="all"?i.options:i.options[r]},_attachCountdown:function(t,r){var i=e(t);if(i.hasClass(this.markerClassName)){return}i.addClass(this.markerClassName);var s={options:e.extend({},r),_periods:[0,0,0,0,0,0,0]};e.data(t,n,s);this._changeCountdown(t)},_addTarget:function(e){if(!this._hasTarget(e)){this._timerTargets.push(e)}},_hasTarget:function(t){return e.inArray(t,this._timerTargets)>-1},_removeTarget:function(t){this._timerTargets=e.map(this._timerTargets,function(e){return e==t?null:e})},_updateTargets:function(){for(var e=this._timerTargets.length-1;e>=0;e--){this._updateCountdown(this._timerTargets[e])}},_updateCountdown:function(t,r){var i=e(t);r=r||e.data(t,n);if(!r){return}i.html(this._generateHTML(r));i[(this._get(r,"isRTL")?"add":"remove")+"Class"]("countdown_rtl");var s=this._get(r,"onTick");if(s){var o=r._hold!="lap"?r._periods:this._calculatePeriods(r,r._show,this._get(r,"significant"),new Date);var u=this._get(r,"tickInterval");if(u==1||this.periodsToSeconds(o)%u==0){s.apply(t,[o])}}var a=r._hold!="pause"&&(r._since?r._now.getTime()<r._since.getTime():r._now.getTime()>=r._until.getTime());if(a&&!r._expiring){r._expiring=true;if(this._hasTarget(t)||this._get(r,"alwaysExpire")){this._removeTarget(t);var f=this._get(r,"onExpiry");if(f){f.apply(t,[])}var l=this._get(r,"expiryText");if(l){var c=this._get(r,"layout");r.options.layout=l;this._updateCountdown(t,r);r.options.layout=c}var h=this._get(r,"expiryUrl");if(h){window.location=h}}r._expiring=false}else if(r._hold=="pause"){this._removeTarget(t)}e.data(t,n,r)},_changeCountdown:function(t,r,i){r=r||{};if(typeof r=="string"){var s=r;r={};r[s]=i}var o=e.data(t,n);if(o){this._resetExtraLabels(o.options,r);l(o.options,r);this._adjustSettings(t,o);e.data(t,n,o);var u=new Date;if(o._since&&o._since<u||o._until&&o._until>u){this._addTarget(t)}this._updateCountdown(t,o)}},_resetExtraLabels:function(e,t){var n=false;for(var r in t){if(r!="whichLabels"&&r.match(/[Ll]abels/)){n=true;break}}if(n){for(var r in e){if(r.match(/[Ll]abels[0-9]/)){e[r]=null}}}},_adjustSettings:function(e,t){var n;var r=this._get(t,"serverSync");var i=0;var s=null;for(var o=0;o<this._serverSyncs.length;o++){if(this._serverSyncs[o][0]==r){s=this._serverSyncs[o][1];break}}if(s!=null){i=r?s:0;n=new Date}else{var u=r?r.apply(e,[]):null;n=new Date;i=u?n.getTime()-u.getTime():0;this._serverSyncs.push([r,i])}var a=this._get(t,"timezone");a=a==null?-n.getTimezoneOffset():a;t._since=this._get(t,"since");if(t._since!=null){t._since=this.UTCDate(a,this._determineTime(t._since,null));if(t._since&&i){t._since.setMilliseconds(t._since.getMilliseconds()+i)}}t._until=this.UTCDate(a,this._determineTime(this._get(t,"until"),n));if(i){t._until.setMilliseconds(t._until.getMilliseconds()+i)}t._show=this._determineShow(t)},_destroyCountdown:function(t){var r=e(t);if(!r.hasClass(this.markerClassName)){return}this._removeTarget(t);r.removeClass(this.markerClassName).empty();e.removeData(t,n)},_pauseCountdown:function(e){this._hold(e,"pause")},_lapCountdown:function(e){this._hold(e,"lap")},_resumeCountdown:function(e){this._hold(e,null)},_hold:function(t,r){var i=e.data(t,n);if(i){if(i._hold=="pause"&&!r){i._periods=i._savePeriods;var s=i._since?"-":"+";i[i._since?"_since":"_until"]=this._determineTime(s+i._periods[0]+"y"+s+i._periods[1]+"o"+s+i._periods[2]+"w"+s+i._periods[3]+"d"+s+i._periods[4]+"h"+s+i._periods[5]+"m"+s+i._periods[6]+"s");this._addTarget(t)}i._hold=r;i._savePeriods=r=="pause"?i._periods:null;e.data(t,n,i);this._updateCountdown(t,i)}},_getTimesCountdown:function(t){var r=e.data(t,n);return!r?null:!r._hold?r._periods:this._calculatePeriods(r,r._show,this._get(r,"significant"),new Date)},_get:function(t,n){return t.options[n]!=null?t.options[n]:e.countdown._defaults[n]},_determineTime:function(t,n){var r=function(e){var t=new Date;t.setTime(t.getTime()+e*1e3);return t};var i=function(t){t=t.toLowerCase();var n=new Date;var r=n.getFullYear();var i=n.getMonth();var s=n.getDate();var o=n.getHours();var u=n.getMinutes();var a=n.getSeconds();var f=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var l=f.exec(t);while(l){switch(l[2]||"s"){case"s":a+=parseInt(l[1],10);break;case"m":u+=parseInt(l[1],10);break;case"h":o+=parseInt(l[1],10);break;case"d":s+=parseInt(l[1],10);break;case"w":s+=parseInt(l[1],10)*7;break;case"o":i+=parseInt(l[1],10);s=Math.min(s,e.countdown._getDaysInMonth(r,i));break;case"y":r+=parseInt(l[1],10);s=Math.min(s,e.countdown._getDaysInMonth(r,i));break}l=f.exec(t)}return new Date(r,i,s,o,u,a,0)};var s=t==null?n:typeof t=="string"?i(t):typeof t=="number"?r(t):t;if(s)s.setMilliseconds(0);return s},_getDaysInMonth:function(e,t){return 32-(new Date(e,t,32)).getDate()},_normalLabels:function(e){return e},_generateHTML:function(t){var n=this._get(t,"significant");t._periods=t._hold?t._periods:this._calculatePeriods(t,t._show,n,new Date);var l=false;var c=0;var h=n;var p=e.extend({},t._show);for(var d=r;d<=f;d++){l|=t._show[d]=="?"&&t._periods[d]>0;p[d]=t._show[d]=="?"&&!l?null:t._show[d];c+=p[d]?1:0;h-=t._periods[d]>0?1:0}var v=[false,false,false,false,false,false,false];for(var d=f;d>=r;d--){if(t._show[d]){if(t._periods[d]){v[d]=true}else{v[d]=h>0;h--}}}var m=this._get(t,"compact");var g=this._get(t,"layout");var y=m?this._get(t,"compactLabels"):this._get(t,"labels");var b=this._get(t,"whichLabels")||this._normalLabels;var w=this._get(t,"timeSeparator");var E=this._get(t,"description")||"";var x=function(n){var r=e.countdown._get(t,"compactLabels"+b(t._periods[n]));return p[n]?t._periods[n]+(r?r[n]:y[n])+" ":""};var T=function(r){var i=e.countdown._get(t,"labels"+b(t._periods[r]));return!n&&p[r]||n&&v[r]?'<span class="countdown_section"><span class="countdown_amount">'+t._periods[r]+"</span><br/>"+(i?i[r]:y[r])+"</span>":""};return g?this._buildLayout(t,p,g,m,n,v):(m?'<span class="countdown_row countdown_amount'+(t._hold?" countdown_holding":"")+'">'+x(r)+x(i)+x(s)+x(o)+(p[u]?this._minDigits(t._periods[u],2):"")+(p[a]?(p[u]?w:"")+this._minDigits(t._periods[a],2):"")+(p[f]?(p[u]||p[a]?w:"")+this._minDigits(t._periods[f],2):""):'<span class="countdown_row countdown_show'+(n||c)+(t._hold?" countdown_holding":"")+'">'+T(r)+T(i)+T(s)+T(o)+T(u)+T(a)+T(f))+"</span>"+(E?'<span class="countdown_row countdown_descr">'+E+"</span>":"")},_buildLayout:function(t,n,l,c,h,p){var d=this._get(t,c?"compactLabels":"labels");var v=this._get(t,"whichLabels")||this._normalLabels;var m=function(n){return(e.countdown._get(t,(c?"compactLabels":"labels")+v(t._periods[n]))||d)[n]};var g=function(e,t){return Math.floor(e/t)%10};var y={desc:this._get(t,"description"),sep:this._get(t,"timeSeparator"),yl:m(r),yn:t._periods[r],ynn:this._minDigits(t._periods[r],2),ynnn:this._minDigits(t._periods[r],3),y1:g(t._periods[r],1),y10:g(t._periods[r],10),y100:g(t._periods[r],100),y1000:g(t._periods[r],1e3),ol:m(i),on:t._periods[i],onn:this._minDigits(t._periods[i],2),onnn:this._minDigits(t._periods[i],3),o1:g(t._periods[i],1),o10:g(t._periods[i],10),o100:g(t._periods[i],100),o1000:g(t._periods[i],1e3),wl:m(s),wn:t._periods[s],wnn:this._minDigits(t._periods[s],2),wnnn:this._minDigits(t._periods[s],3),w1:g(t._periods[s],1),w10:g(t._periods[s],10),w100:g(t._periods[s],100),w1000:g(t._periods[s],1e3),dl:m(o),dn:t._periods[o],dnn:this._minDigits(t._periods[o],2),dnnn:this._minDigits(t._periods[o],3),d1:g(t._periods[o],1),d10:g(t._periods[o],10),d100:g(t._periods[o],100),d1000:g(t._periods[o],1e3),hl:m(u),hn:t._periods[u],hnn:this._minDigits(t._periods[u],2),hnnn:this._minDigits(t._periods[u],3),h1:g(t._periods[u],1),h10:g(t._periods[u],10),h100:g(t._periods[u],100),h1000:g(t._periods[u],1e3),ml:m(a),mn:t._periods[a],mnn:this._minDigits(t._periods[a],2),mnnn:this._minDigits(t._periods[a],3),m1:g(t._periods[a],1),m10:g(t._periods[a],10),m100:g(t._periods[a],100),m1000:g(t._periods[a],1e3),sl:m(f),sn:t._periods[f],snn:this._minDigits(t._periods[f],2),snnn:this._minDigits(t._periods[f],3),s1:g(t._periods[f],1),s10:g(t._periods[f],10),s100:g(t._periods[f],100),s1000:g(t._periods[f],1e3)};var b=l;for(var w=r;w<=f;w++){var E="yowdhms".charAt(w);var x=new RegExp("\\{"+E+"<\\}(.*)\\{"+E+">\\}","g");b=b.replace(x,!h&&n[w]||h&&p[w]?"$1":"")}e.each(y,function(e,t){var n=new RegExp("\\{"+e+"\\}","g");b=b.replace(n,t)});return b},_minDigits:function(e,t){e=""+e;if(e.length>=t){return e}e="0000000000"+e;return e.substr(e.length-t)},_determineShow:function(e){var t=this._get(e,"format");var n=[];n[r]=t.match("y")?"?":t.match("Y")?"!":null;n[i]=t.match("o")?"?":t.match("O")?"!":null;n[s]=t.match("w")?"?":t.match("W")?"!":null;n[o]=t.match("d")?"?":t.match("D")?"!":null;n[u]=t.match("h")?"?":t.match("H")?"!":null;n[a]=t.match("m")?"?":t.match("M")?"!":null;n[f]=t.match("s")?"?":t.match("S")?"!":null;return n},_calculatePeriods:function(t,n,l,c){t._now=c;t._now.setMilliseconds(0);var h=new Date(t._now.getTime());if(t._since){if(c.getTime()<t._since.getTime()){t._now=c=h}else{c=t._since}}else{h.setTime(t._until.getTime());if(c.getTime()>t._until.getTime()){t._now=c=h}}var p=[0,0,0,0,0,0,0];if(n[r]||n[i]){var d=e.countdown._getDaysInMonth(c.getFullYear(),c.getMonth());var v=e.countdown._getDaysInMonth(h.getFullYear(),h.getMonth());var m=h.getDate()==c.getDate()||h.getDate()>=Math.min(d,v)&&c.getDate()>=Math.min(d,v);var g=function(e){return(e.getHours()*60+e.getMinutes())*60+e.getSeconds()};var y=Math.max(0,(h.getFullYear()-c.getFullYear())*12+h.getMonth()-c.getMonth()+(h.getDate()<c.getDate()&&!m||m&&g(h)<g(c)?-1:0));p[r]=n[r]?Math.floor(y/12):0;p[i]=n[i]?y-p[r]*12:0;c=new Date(c.getTime());var b=c.getDate()==d;var w=e.countdown._getDaysInMonth(c.getFullYear()+p[r],c.getMonth()+p[i]);if(c.getDate()>w){c.setDate(w)}c.setFullYear(c.getFullYear()+p[r]);c.setMonth(c.getMonth()+p[i]);if(b){c.setDate(w)}}var E=Math.floor((h.getTime()-c.getTime())/1e3);var x=function(e,t){p[e]=n[e]?Math.floor(E/t):0;E-=p[e]*t};x(s,604800);x(o,86400);x(u,3600);x(a,60);x(f,1);if(E>0&&!t._since){var T=[1,12,4.3482,7,24,60,60];var N=f;var C=1;for(var k=f;k>=r;k--){if(n[k]){if(p[N]>=C){p[N]=0;E=1}if(E>0){p[k]++;E=0;N=k;C=1}}C*=T[k]}}if(l){for(var k=r;k<=f;k++){if(l&&p[k]){l--}else if(!l){p[k]=0}}}return p}});e.fn.countdown=function(t){var n=Array.prototype.slice.call(arguments,1);if(t=="getTimes"||t=="settings"){return e.countdown["_"+t+"Countdown"].apply(e.countdown,[this[0]].concat(n))}return this.each(function(){if(typeof t=="string"){e.countdown["_"+t+"Countdown"].apply(e.countdown,[this].concat(n))}else{e.countdown._attachCountdown(this,t)}})};e.countdown=new t})(jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment