PageSourceSearch

https://www.malwareremovalguides.info/wp-content/plugins/floating-social-bar/js/fsb.js?ver=1.1.7

js malwareremovalguides.info collected 2026-09-24 19:16:12 UTC 9,495 bytes, 115 lines download raw bytes

1/*!
2 * Socialite v1.0
3 * http://socialitejs.com
4 * Copyright (c) 2011 David Bushell
5 * Dual-licensed under the BSD or MIT licenses: http://socialitejs.com/license.txt
6 */
7;window.Socialite=(function(i,j,e){var f={},c={},l={},h={},b={},g={},a={},k=i.setTimeout,m=encodeURIComponent,d=typeof j.getElementsByClassName==="function";c.appendScript=function(n,q,p){if(h[n]||b[n]===e){return false}var o=h[n]=j.createElement("script");o.async=true;o.src=b[n];o.onload=o.onreadystatechange=function(){if(c.hasLoaded(n)){return}var r=o.readyState;if(!r||r==="loaded"||r==="complete"){g[n]=true;o.onload=o.onreadystatechange=null;if(p!==e){if(typeof p==="function"){p()}}else{c.activateCache(n)}}};if(q){o.id=q}j.body.appendChild(o);return true};c.hasLoaded=function(n){return(typeof n!=="string")?false:g[n]===true};c.removeScript=function(n){if(!c.hasLoaded(n)){return false}j.body.removeChild(h[n]);h[n]=g[n]=false;return true};c.createIframe=function(p,n){var o=j.createElement("iframe");o.style.cssText="overflow: hidden; border: none;";o.setAttribute("allowtransparency","true");o.setAttribute("frameborder","0");o.setAttribute("scrolling","no");o.setAttribute("src",p);if(n!==e){o.onload=o.onreadystatechange=function(){var q=o.readyState;if(!q||q==="loaded"||q==="complete"){o.onload=o.onreadystatechange=null;c.activateInstance(n)}}}return o};c.activateInstance=function(n){if(n.loaded){return}n.loaded=true;n.container.className+=" socialite-loaded"};c.activateCache=function(o){if(a[o]!==e){for(var n=0;n<a[o].length;n++){c.activateInstance(a[o][n])}}};c.copyDataAttributes=function(s,r){var p,n=s.attributes;for(p=0;p<n.length;p++){var o=n[p].name,q=n[p].value;if(o.indexOf("data-")===0&&q.length){r.setAttribute(o,q)}}};c.getDataAttributes=function(t,v,n){var q,s="",p={},r=t.attributes;for(q=0;q<r.length;q++){var u=r[q].name,o=r[q].value;if(u.indexOf("data-")===0&&o.length){if(v===true){u=u.substring(5)}if(n){p[u]=o}else{s+=m(u)+"="+m(o)+"&"}}}return n?p:s};c.getElements=function(s,q){if(d){return s.getElementsByClassName(q)}var r=0,o=[],t=s.getElementsByTagName("*"),n=t.length;for(r=0;r<n;r++){var p=" "+t[r].className+" ";if(p.indexOf(" "+q+" ")!==-1){o.push(t[r])}}return o};f.activate=function(o,n){f.load(null,o,n)};
7f.load=function(p,r,s){p=(typeof p==="object"&&p!==null&&p.nodeType===1)?p:j;if(r===e||r===null){var y=c.getElements(p,"socialite"),o=y,q=y.length;if(!q){return}if(typeof o.item!==e){o=[];for(var w=0;w<q;w++){o[w]=y[w]}}f.load(p,o,s);return}if(typeof r==="object"&&r.length){for(var v=0;v<r.length;v++){f.load(p,r[v],s)}return}if(typeof r!=="object"||r.nodeType!==1){return}if(typeof s!=="string"||l[s]===e){s=null;var t=r.className.split(" ");for(var u=0;u<t.length;u++){if(l[t[u]]!==e){s=t[u];break}}if(typeof s!=="string"){return}}if(typeof l[s]==="string"){s=l[s]}if(typeof l[s]!=="function"){return}var n=j.createElement("div"),x=j.createElement("div");n.className="socialised "+s;x.className="socialite-button";var z=r.parentNode;if(z===null){z=(p===j)?j.body:p;z.appendChild(n)}else{z.insertBefore(n,r)}n.appendChild(x);x.appendChild(r);r.className=r.className.replace(/\bsocialite\b/,"");if(a[s]===e){a[s]=[]}var A={elem:r,button:x,container:n,parent:z,loaded:false};a[s].push(A);l[s](A,c)};f.extend=function(o,q,p){if(typeof o!=="string"||typeof q!=="function"){return false}o=(o.indexOf(" ")>0)?o.split(" "):[o];if(l[o[0]]!==e){return false}for(var n=1;n<o.length;n++){l[o[n]]=o[0]}if(p!==e&&typeof p==="string"){b[o[0]]=p}l[o[0]]=q;return true};return f})(window,window.document);(function(c,a,b,d){b.extend("googleplus",function(e,h){var f=e.elem,g=a.createElement("div");g.className="g-plusone";h.copyDataAttributes(f,g);e.button.replaceChild(g,f);if(typeof c.gapi==="object"&&typeof c.gapi.plusone==="object"&&typeof gapi.plusone.render==="function"){c.gapi.plusone.render(e.button,h.getDataAttributes(g,true,true));h.activateInstance(e)}else{if(!h.hasLoaded("googleplus")){h.appendScript("googleplus")}}},"//apis.google.com/js/plusone.js");b.extend("facebook",function(e,j){var f=e.elem,h=a.createElement("div"),i=a.getElementById("fb-root");if(!i&&!j.hasLoaded("facebook")){i=a.createElement("div");i.id="fb-root";a.body.appendChild(i);h.className="fb-like";j.copyDataAttributes(f,h);e.button.replaceChild(h,f);j.appendScript("facebook","facebook-jssdk")}else{var k="//www.facebook.com/plugins/like.php?";k+=j.getDataAttributes(f,true);var g=j.createIframe(k,e);e.button.replaceChild(g,f)}},"//connect.facebook.net/en_US/all.js#xfbml=1")})(window,window.document,window.Socialite);
8
9/* ==========================================================
10 * fsb.js v1.0.0
11 * ==========================================================
12 * Copyright 2013 WPBeginner.
13 *
14 * Licensed under the GPL License, Version 2.0 or later (the "License");
15 * you may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 * http://www.gnu.org/licenses/gpl-2.0.html
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 * ========================================================== */
26(function($){
27	$(function(){
28		// Run our ajax request to handle updating the stats counters if needed.
29		$(document.body).find('.fsb-social-bar').each(function(){
30			// Prepare the data variable.
31			var data = {
32				action: 'fsb_load_stats',
33				nonce:  fsb.nonce,
34				postid: $(this).data('post-id'),
35			},
36				services = {},
37				$this 	 = $(this);
38
39			// Add in all the services attached to the social bar.
40			$(this).find('div a').each(function(i, el){
41				services[i] = $(this).data('fsb-service');
42			});
43
44			// Add in the services to the data variable.
45			data.services = services;
46
47			// Make the AJAX request to update the stats.
48			$.post(fsb.ajax, data, function(res){
49				// If the response is empty, do nothing.
50				if ( res.length === 0 ) return;
51
52				// Loop through each response and update the visible counter and styling.
53				$.each(res, function(k, v){
54					// Pass over any items that still do not have any shares.
55					if ( 0 === parseInt(v) ) return;
56
57					// Update the visible share count and animate the class removal.
58					$this.find('[data-service="' + k + '"] .fsb-count').text(v).parent().parent().removeClass('fsb-hide-count');
59				});
60			}, 'json');
61		});
62
63	    // Load Socialite when hovering over the social bar.
64	    $('.fsb-social-bar').one('mouseenter', function(e){
65	    	// Only load Socialite if the user has not defined a variable to prevent it.
66	        if ( true === $(this).data('socialite') ) {
67		    	Socialite.load($(this));
68		    	$('.fsb-share-facebook, .fsb-share-google').removeClass('fsb-hide-count');
69		    }
70	    });
71
72	    // Declare variables.
73	    var fsb_top = $('.fsb-social-bar').offset().top;
74
75	    // Attach to the scroll event to determine when to load items.
76        $(window).scroll(function(){
77            var y    = $(this).scrollTop(),
78                maxY = $('#respond, #disqus_thread, #livefyre, .fb-comments, #comment-form, .i
78dc-new, #comment-respond, #comments, #comment, #footer, .site-footer'), // Attempt to target as many comment systems as possible.
79                nofo = false; // Flag if no div is found in the maxY var.
80
81			// If for some reason one of our divs does not exist or it's height is zero, use the parent div as a scroll helper and set the nofo var to true.
82			if ( $(maxY).eq(0).length === 0 || 0 === $(maxY).height() ) {
83				maxY = $('.fsb-social-bar').parent();
84				nofo = true;
85			}
86
87            // If we should not float or the height of the maxY var is equal to zero, don't do anything.
88            if ( $('.fsb-social-bar').hasClass('fsb-no-float') || 0 === $(maxY).height() )
89                return;
90
91            // Get the offset of our respond helper.
92            var offset = ( true === nofo ) ? fsb_top + $(maxY).height() + 50 : $(maxY).eq(0).offset().top;
93
94            // If we are below the bar but above comments, set a fixed position.
95            if ( y > fsb_top && y < offset )
96              $('.fsb-social-bar').addClass('fsb-fixed').css('width', $('.fsb-social-bar').parent().width()).fadeIn();
97            else if ( y >= offset )
98              $('.fsb-social-bar').removeClass('fsb-fixed').css('display', 'none');
99            else if ( y < fsb_top )
100              $('.fsb-social-bar').show().removeClass('fsb-fixed');
101        });
102
103        // Open up the social services in a popup window.
104        $('.fsb-facebook, .fsb-twitter, .fsb-google, .fsb-linkedin, .fsb-pinterest').on('click', function(e){
105        	e.preventDefault();
106        	switch ( $(this).data('fsb-service') ) {
107				case 'facebook'  : window.open( $(this).attr('href'), 'fsbfacebook', 'menubar=1,resizable=1,width=600,height=400' ); return;
108				case 'twitter' 	 : window.open( $(this).attr('href'), 'fsbtwitter', 'menubar=1,resizable=1,width=600,height=350' ); return;
109				case 'google' 	 : window.open( $(this).attr('href'), 'fsbgoogle', 'menubar=1,resizable=1,width=600,height=600' ); return;
110				case 'linkedin'  : window.open( $(this).attr('href'), 'fsblinkedin', 'menubar=1,resizable=1,width=580,height=450' ); return;
111				case 'pinterest' : window.open( $(this).attr('href'), 'fsbpinterest', 'menubar=1,resizable=1,width=760,height=360' ); return;
112        	}
113        });
114	});
115}(jQuery));

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.