. ‘; } Else {var TPOP = ‘
. ‘;
}
// Return the pop up markup
return TPOP;
};
// Create a variable to hold the markup (Needed For IE 8 6 + 7)
var markup = getPopHTML ();
// Prepend the popup into the body of the page
$ Jx (document.body) .append (markup);
// Get cookie to see if They already clicked like
var = readCookie cook (‘fblikepop’);
// Get wait cookie
var = waitCook readCookie (‘fblikepopwait’);
// Only show the pop up if the user has not clicked like already
if (cook = ‘true’ & amp;! & amp;! waitCook = ‘true’) {
// Get width and height window to center the pop up
var = WindowWidth document.documentElement.clientWidth;
var = WindowHeight document.documentElement.clientHeight;
var popupHeight = 500;
var popupWidth = jx $ (“# fblikepop”) width ().;
// Simple division will let us make sure the box is centered on all screen resolutions
Jx $ (“# fblikepop”) css ({“top”: “50px”, “left”: 525});.
Jx $ (“# fblikebg”) css ({“height”: WindowHeight});.
// Check if the closeable is Set to true
if (defaults.closeable == true) {
// If so, display a close button for the pop up
Jx $ (“# closeable”) html (” + tstrings.closeable [defaults.lang] + ‘x.’);
};
// Set the background shadow active – higher opactity = darker background shadow
Jx $ (“# fblikebg”) css ({“opacity”: defaults.opacity});.
// Fade in the background shadow
Jx $ (“# fblikebg”) fadeIn (“slow.”);
// Fade in the popup box
Jx $ (“# fblikepop”) fadeIn (“slow.”);
// Check if timer is Set to zero
if (defaults.timeout == ’0′) {
// Is so hide the counter
Jx $ (“# counter-display”) hide ().;
} Else {// Otherwise start it …
// Initiate the timer (more documentation on the countdown timer here: http://keith-wood.name/countdownRef.html)
Jx $ (‘# counter’) countdown ({until: ‘+’ + defaults.timeout + ‘s’ format: ‘S’, compact: true description: ” OnExpiry: fbLikeDump}.);
}; // End if timer = 0
// Check if the script shouldnt wait between popups
if (defaults.wait! = 0) {
// If so, Sept. the wait cookie so it does not pop up Constantly
createWait (‘fblikepopwait’, ‘true’, defaults.wait);
};
// Parse Final check to Ensure Like button Appears on all browsers of all speeds
FB.XFBML.parse ();
} // End if
} Defaults.delay); // End delay
// Start escape key + click to close outside if true
if (defaults.advancedClose == true) {
// Detect key up
Jx $ (document) .keyup (function (e) {
// Of escape key
if (e.keyCode == 27) {
// Dump the popup, but dont Set the cookie!
fbLikeDump (false);
} // End if escape key
}); // End key up event
// Detect click in body and dump the popup
Jx $ (‘body’). Click (function () {
fbLikeDump (false);
}); // End body detect
// Detect the click in the popup area to Prevent it from closing
Jx $ (‘# fblikepop’). Click (function (event) {
// Strop prop. of close event
event.stopPropagation ();
}); // End popup click detection
} // End click to close + escape key to close
return true;
}; // End Main Function
}) (JQuery); // End Plugin
// This is our listener to check wether or not the user clicks the button like.
FB.Event.subscribe (‘edge.create’, function (href) {
// If They did, close the pop up
fbLikeDump (true);
});
fbLikeDump1 function (action) {
// If so, Sept. the wait cookie so it does not pop up Constantly
createWait (‘fblikepopwait’, ‘true’, 4);
// Fade out the background shadow
Jx $ (“# fblikebg”) fadeOut (“slow.”);
// Fade out the pop up itself
Jx $ (“# fblikepop”) fadeOut (“slow.”);
};
// Function to remove the pop up from the screen
fbLikeDump function (action) {
// Check if the user completed the like or if the timer ran out in October
if (action == true) {
// Create the cookie to remember the user clicked like, 30 is the number of days it will expire in.
createCookie (‘fblikepop’, ‘true’, 30);
}; // End if
// Fade out the background shadow
Jx $ (“# fblikebg”) fadeOut (“slow.”);
// Fade out the pop up itself
Jx $ (“# fblikepop”) fadeOut (“slow.”);
};
// Begin counter code – for documentation visit: http://keith-wood.name/countdownRef.html
(Function ($ ) {function Countdown(){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};$ .extend (this._defaults, this.regional ['']); this._serverSyncs = []} var w = ‘countdown’; var y = 0; var O = 1; var w = 2; var D = 3; var H = 4; var M = 5; var S = 6; $ .extend (Countdown.prototype, {markerClassName: ‘hasCountdown’ _ timer: setInterval (function () {$ .countdown._updateTargets()},980),_timerTargets:[],setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b==’object’&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d = new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)-1)},_removeTarget:function(b){this._timerTargets=$ .map (this._timerTargets, function (a) {return (a == b null: a)})}, _ updateTargets: function () {for (var i=this._timerTargets.length-1;i>=0;i–){this._updateCountdown(this._timerTargets[i])}},_updateCountdown:function(a,b){var $ c = (a); b = b || $ .data(a,w);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class'](‘countdown_rtl’);var d = this._get (b, ‘onTick’); if (d) {var e = b._hold = ‘lap’ b._periods:? this._calculatePeriods (b, b._show, this._get (b, ‘Significant’), new Date ()); var f = this._get (b, ‘tickInterval’); if (f == 1 || this.periodsToSeconds (e)% f == 0) {d.apply ( a, [and])}} var g=b._hold!=’pause’&&(b._since?b._now.getTime()
‘+(b?b[a]:m[a])+’‘:”)};return(l?this._buildLayout(c,h,l,k,d,j):((k?’‘+q(Y)+q(O)+q(W)+q(D)+(h[H]?this._minDigits(c._periods[H],2):”)+(h[M]?(h[H]?o:”)+this._minDigits(c._periods[M],2):”)+(h[S]?(h[H]||h[M]?o:”)+this._minDigits(c._periods[S],2):”):’ ‘+ r (Y) + r (O) + r (W) + r (D ) + r (H) + r (M) + r (S)) + ‘‘ + (p ‘‘ + p + ‘‘: ” )))} _ buildLayout: function (c, d, e, f, g, h) {var this._get j = (c (f ‘compactLabels’: ‘labels’)); k = var this._get (c, ‘whichLabels’) || this._normalLabels; var l = function (a) {return ($ .countdown._get (c, (f ‘compactLabels’ ‘labels’) + k (c._periods [a? ])) || j) [a]}; var m = function (a, b) {return Math.floor (a / b) 10%}; var o={desc:this._get(c,’description’),sep:this._get(c,’timeSeparator’),yl:l(Y),yn:c._periods[Y],ynn:this._minDigits(c._periods[Y],2),ynnn:this._minDigits(c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:c._periods[O],onn:this._minDigits(c._periods[O],2),onnn:this._minDigits(c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:c._periods[W],wnn:this._minDigits(c._periods[W],2),wnnn:this._minDigits(c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:c._periods[D],dnn:this._minDigits(c._periods[D],2),dnnn:this._minDigits(c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:c._periods[H],hnn:this._minDigits(c._periods[H],2),hnnn:this._minDigits(c._periods[H],3),h1:m( c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:c._periods[M],mnn:this._minDigits(c._periods[M],2),mnnn:this._minDigits(c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:c._periods[S],snn:this._minDigits(c._periods[S],2),snnn:this._minDigits(c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p = e, for (var i = Y; i } ‘,’ g ‘); p = p.replace (r ((g & amp;! & amp; D [i]) || (g & amp; & amp; h [ i]) ‘$ 1′, ”))} $ .each (the, function (n, v) {var a = new RegExp (‘ {‘ + n + ‘}’, ‘g’); p? p.replace = (a, v)}); return p}, _ minDigits: function (a, b) = {a ‘+ a; if (a.length & gt; = b) {return a} =’ 0000000000 ‘ + a; return a.substr (a.length-b)} _ determineShow: function (a) {var this._get b = (a ‘format’); var c=[];c[Y]=(b.match(‘y’)?’?’:(b.match(‘Y’)?’!’:null));c[O]=(b.match(‘o’)?’?’:(b.match(‘O’)?’!’:null));c[W]=(b.match(‘w’)?’?’:(b.match(‘W’)?’!’:null));c[D]=(b.match(‘d’)?’?’:(b.match(‘D’)?’!’:null));c[H]=(b.match(‘h’)?’?’:(b.match(‘H’)?’!’:null));c[M]=(b.match(‘m’)?’?’:(b.match(‘M’)?’!’:null));c[S]=(b.match(‘s’)?’?’:(b.match(‘S’)?’!’:null));return c}, _ calculatePeriods: function (c, d, e, f) = {f c._now; c._now.setMilliseconds (0); var g = new Date(c._now.getTime());if(c._since){if(f.getTime()
No comments:
Post a Comment