PageSourceSearch

http://www.survivalistdaily.com/wp-content/themes/allegro-theme/js/theme-scripts.js?ver=1.5.19

js survivalistdaily.com collected 2026-10-06 22:40:09 UTC 9,198 bytes, 278 lines download raw bytes

1
2
3var supports = (function() {
4  var div = document.createElement('div'),
5    vendors = 'Khtml Ms O Moz Webkit'.split(' '),
6    len = vendors.length;
7
8  return function(prop) {
9    if ( prop in div.style ) return true;
10
11    prop = prop.replace(/^[a-z]/, function(val) {
12       return val.toUpperCase();
13    });
14
15    while(len--) {
16       if ( vendors[len] + prop in div.style ) {
17          return true;
18       } 
19    }
20    return false;
21  };
22})();
23
24if ( supports('perspective') ) {
25   jQuery(".the-menu").addClass("transition-active");
26}else{
27   jQuery(".the-menu").removeClass("transition-active");
28}
29
30
31jQuery(window).scroll(function() {
32  jQuery(".main-menu.sticky").each(function() {
33    var thisel = jQuery(this);
34    var offset = thisel.offset();
35    var offsetz = thisel.children(".wrapper").offset();
36    var addpoint = 0;
37    if(jQuery("body").hasClass("admin-bar")){
38      addpoint = 28;
39    }
40    if(jQuery(window).scrollTop()+addpoint >= offset.top){
41      thisel.css("height", thisel.height()+"px");
42      thisel.children(".wrapper").css("left", offsetz.left+"px").css("position", "fixed").css("top", addpoint+"px");
43    }else{
44      thisel.css("height", "auto");
45      thisel.children(".wrapper").css("position", "inherit").css("top", "0px").css("left", "auto");
46    }
47  });
48});
49
50
51function playhover() {
52
53  jQuery(".hover-effect").each(function() {
54    var thisel = jQuery(this);
55
56    if(thisel.has("img").length > 0 && !thisel.hasClass("delegate")){
57      var fontsize = (parseInt(thisel.children("img").height()) <= 120)?20:(parseInt(thisel.children("img").height())/6);
58      thisel.children("img").wrap("<span class='cover' style='font-size:"+ fontsize +"px;'></span>").parent().prepend("<i></i>");
59      thisel.addClass("delegate");
60    }
61
62  });
63
64}
65
66var anihappening = false;
67
68jQuery(document).ready(function() {
69
70  playhover();
71
72  jQuery(".gallery-widget ul").each(function() {
73    var thisel = jQuery(this);
74    var licount = thisel.children("li").length;
75    thisel.attr("rel", licount);
76  });
77
78  jQuery(".gallery-photo > a.slide-right").click(function() {
79    if(anihappening)return false;
80    var thisel = jQuery(this).parent().children("ul");
81    var phwidth = parseInt(jQuery(this).parent().width());
82    if(((thisel.attr("rel")-1)*phwidth) > Math.abs(parseInt(thisel.css("margin-left")))){
83      anihappening = true;
84      thisel.animate({'margin-left' : '-='+phwidth}, 400, function () {
85        anihappening = false;
86      });
87    }
88    return false;
89  });
90
91  jQuery(".gallery-photo > a.slide-left").click(function() {
92    if(anihappening)return false;
93    var thisel = jQuery(this).parent().children("ul");
94    var phwidth = parseInt(jQuery(this).parent().width());
95    if(Math.abs(parseInt(thisel.css("margin-left"))) > 0){
96      anihappening = true;
97      thisel.animate({'margin-left' : '+='+phwidth}, 400, function () {
98        anihappening = false;
99      });
100    }
101    return false;
102  });
103  
104
105  // Tabbed blocks
106  jQuery(".tabs").each(function() {
107    var thisel = jQuery(this);
108    thisel.children("div").css("min-height", (parseInt(thisel.css("height"))-30)+"px");
109    thisel.children("div").eq(0).addClass("active");
110    thisel.children("ul").children("li").eq(0).addClass("active");
111  });
112
113  jQuery(".tabs > ul > li a").click(function() {
114    var thisel = jQuery(this).parent();
115    thisel.siblings(".active").removeClass("active");
116    thisel.addClass("active");
117    thisel.parent().siblings("div.active").removeClass("active");
118    thisel.parent().siblings("div").eq(thisel.index()).addClass("active");
119    return false;
120  });
121
122
123  // Alert box close
124  jQuery('a[href="#close-alert"]').click(function() {
125    jQuery(this).parent().animate({
126      opacity: 0,
127      padding: "0px 13px",
128      margin: "0px",
129      height: "0px"
130    }, 300, function() {
131      // Animation complete.
132    });
133    return false;
134  });
135
136
137  // Accordion blocks
138  jQuery(".accordion > div > a").click(function() {
139    var thisel = jQuery(this).parent();
140    if(thisel.hasClass("active")){
141      thisel.removeClass("active");
142      return false;
143    }
144    thisel.siblings("div").removeClass("active");
145    thisel.addClass("active");
146    return false;
147  });
148
149  jQuery(".header > .wrapper").prepend('<a href="#dat-menu" class="mobile-menu icon-text">&#9776;</a>');
150
151  jQuery(".lightbox").click(function () {
152    jQuery(".lightbox").css('overflow', 'hidden');
153    jQuery("body").css('overflow', 'auto');
154    jQuery(".lightbox .lightcontent").fadeOut('fast');
155    jQuery(".lightbox").fadeOut('slow');
156  }).children().click(function(e) {
157    return false;
158  });
159
160});
161
162
163function lightboxclose(){
164  jQuery(".lightbox").css('overflow', 'hidden');
165  jQuery(".lightbox .lightcontent").fadeOut('fast');
166  jQuery(".lightbox").fadeOut('slow');
167  jQuery("body").css('overflow', 'auto');
168}
169
170
171 (function($)
172   {
173     var methods = 
174       {
175         init : function( options ) 
176         {
177           return this.each(function()
178             {
179               var _this=$(this);
180                   _this.data('marquee',options);
181               var _li=$('>li',_this);
182                   
183                   _this.wrap('<div class="slide_container"></div>')
184                        .height(_this.height())
185                       .hover(function(){if($(this).data('marquee').stop){$(this).stop(true,fal
185se);}},
186                              function(){if($(this).data('marquee').stop){$(this).marquee('slide');}})
187                        .parent()
188                        .css({position:'relative',overflow:'hidden','height':$('>li',_this).height()})
189                        .find('>ul')
190                        .css({width:screen.width*2,position:'absolute'});
191           
192                   for(var i=0;i<Math.ceil((screen.width*3)/_this.width());++i)
193                   {
194                     _this.append(_li.clone());
195                   } 
196             
197               _this.marquee('slide');});
198         },
199      
200         slide:function()
201         {
202           var $this=this;
203           $this.animate({'left':$('>li',$this).width()*-1},
204                         $this.data('marquee').duration,
205                         'swing',
206                         function()
207                         {
208                           $this.css('left',0).append($('>li:first',$this));
209                           $this.delay($this.data('marquee').delay).marquee('slide');
210             
211                         }
212                        );
213                             
214         }
215       };
216   
217     $.fn.marquee = function(m) 
218     {
219       var settings={
220                     'delay':4000,
221                     'duration':2000,
222                     'stop':false
223                    };
224       
225       if(typeof m === 'object' || ! m)
226       {
227         if(m){ 
228         $.extend( settings, m );
229       }
230 
231         return methods.init.apply( this, [settings] );
232       }
233       else
234       {
235         return methods[m].apply( this);
236       }
237     };
238   }
239 )( jQuery );
240 
241
242 jQuery(document).ready(
243   function(){jQuery('.breaking-news ul').marquee({delay:3000});}
244 );
245
246
247
248
249function printArticle() {
250  var html = jQuery(".block-content .shortcode-content").html();
251  var htmltitle = jQuery(".article-title h1").html();
252  if(jQuery(".main-article-content .article-photo img").size() > 0){var htmlphoto = "<img src='"+jQuery(".main-article-content .article-photo img").attr("src")+"' alt='' style='max-width: 600px;'/>";}else{var htmlphoto = "";}
253  if(jQuery(".logo-footer img").size() > 0){var htmllogo = '<div class="logo-image">'+jQuery(".logo-footer").html()+'</div>';var logotext = false;}else{var htmllogo = '<div class="logo-text">'+jQuery(".header-logo h1").html()+'</div>';var logotext = true;}
254  var htmlcopy = jQuery(".footer .wrapper > p").html();
255  var htmlauthor = jQuery(".article-title .author .a-content b").html();
256  var htmldate = jQuery(".article-title .author .a-content > span.meta").html();
257  
258  top.consoleRef=window.open('','articleprint',
259    'width=680,height=800'
260    +',menubar=0'
261    +',toolbar=1'
262    +',status=0'
263    +',scrollbars=1'
264    +',resizable=1');
265  top.consoleRef.document.writeln(
266    '<html><head><title>'+jQuery(document).attr('title')+'</title><link type="text/css" rel="stylesheet" href="css/reset.css" /><link type="text/css" rel="stylesheet" href="css/main-stylesheet.css?'+Date()+'" /><link type="text/css" rel="stylesheet" href="css/print.css?'+Date()+'" /><link type="text/css" rel="stylesheet" href="css/shortcode.css?'+Date()+'" /></head>'
267    +'<body onLoad="self.focus()"><div class="wrapper">'
268    +htmllogo
269    +'<h2>'+htmltitle+'</h2>'
270    +'<div class="smallinfo"><strong>'+htmlauthor+'</strong><span>'+htmldate+'</span><a href="'+jQuery(location).attr('href')+'">'+jQuery(location).attr('href')+'</a></div>'
271    +'<div class="article-main-content shortcode-content">'+htmlphoto+''+html+'</div>'
272    +htmlcopy
273    +'</div></body></html>'
274    );
275  top.consoleRef.document.close();
276}
277
278

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.