1/** 2 * Tabslet | tabs jQuery plugin 3 * 4 * @copyright Copyright 2015, Dimitris Krestos 5 * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) 6 * @link http://vdw.staytuned.gr 7 * @version v1.7.3 8 */ 9 10 /* Sample html structure 11 12 <div class='tabs'> 13 <ul class='horizontal'> 14 <li><a href="#tab-1">Tab 1</a></li> 15 <li><a href="#tab-2">Tab 2</a></li> 16 <li><a href="#tab-3">Tab 3</a></li> 17 </ul> 18 <div id='tab-1'></div> 19 <div id='tab-2'></div> 20 <div id='tab-3'></div> 21 </div> 22 23 OR 24 25 <div class='tabs'> 26 <ul class='horizontal'> 27 <li><a href="#tab-1">Tab 1</a></li> 28 <li><a href="#tab-2">Tab 2</a></li> 29 <li><a href="#tab-3">Tab 3</a></li> 30 </ul> 31 </div> 32 <div id='tabs_container'> 33 <div id='tab-1'></div> 34 <div id='tab-2'></div> 35 <div id='tab-3'></div> 36 </div> 37 38 */ 39 40;(function($, window, undefined) { 41 "use strict"; 42 43 $.fn.tabslet = function(options) { 44 45 var defaults = { 46 mouseevent: 'click', 47 activeclass: 'active', 48 attribute: 'href', 49 animation: false, 50 autorotate: false, 51 deeplinking: false, 52 pauseonhover: true, 53 delay: 2000, 54 active: 1, 55 container: false, 56 controls: { 57 prev: '.prev', 58 next: '.next' 59 } 60 }; 61 62 var options = $.extend(defaults, options); 63 64 return this.each(function() { 65 66 var $this = $(this), _cache_li = [], _cache_div = []; 67 var _container = options.container ? $(options.container) : $this; 68 var _tabs = _container.find('> div'); 69 70 // Caching 71 _tabs.each(function() { _cache_div.push($(this).css('display')); }); 72 73 // Autorotate 74 var elements = $this.find('> ul > li'), i = options.active - 1; // ungly 75 76 if ( !$this.data( 'tabslet-init' ) ) { 77 78 $this.data( 'tabslet-init', true ); 79 80 $this.opts = []; 81 82 $.map( ['mouseevent', 'activeclass', 'attribute', 'animation', 'autorotate', 'deeplinking', 'pauseonhover', 'delay', 'container'], function( val, i ) { 83 $this.opts[val] = $this.data(val) || options[val]; 84 }); 85 86 $this.opts['active'] = $this.opts.deeplinking ? deep_link() : ( $this.data('active') || options.active ) 87 88 _tabs.hide(); 89 90 if ( $this.opts.active ) { 91 _tabs.eq($this.opts.active - 1).show(); 92 elements.eq($this.opts.active - 1).addClass(options.activeclass); 93 } 94 95 var fn = eval( 96 97 function(e, tab) { 98 var _this = tab ? elements.find('a[' + $this.opts.attribute + '="' + tab +'"]').parent() : $(this); 99 100 _this.trigger('_before'); 101 102 elements.removeClass(options.activeclass); 103 _this.addClass(options.activeclass); 104 _tabs.hide(); 105 106 i = elements.index(_this); 107 108 var currentTab = tab || _this.find('a').attr($this.opts.attribute); 109 110 if ($this.opts.deeplinking) location.hash = currentTab; 111 112 if ($this.opts.animation) { 113 114 _container.find(currentTab).animate( { opacity: 'show' }, 'slow', function() { 115 _this.trigger('_after'); 116 }); 117 118 } else { 119 120 _container.find(currentTab).show(); 121 _this.trigger('_after'); 122 123 } 124 125 return false; 126 127 } 128 129 ); 130 131 var init = eval("elements." + $this.opts.mouseevent + "(fn)"); 132 133 init; 134 135 var t; 136 137 var forward = function() { 138 139 i = ++i % elements.length; // wrap around 140 141 $this.opts.mouseevent == 'hover' ? elements.eq(i).trigger('mouseover') : elements.eq(i).click(); 142 143 if ($this.opts.autorotate) { 144 145 clearTimeout(t); 146 147 t = setTimeout(forward, $this.opts.delay); 148 149 $this.mouseover(function () { 150 151 if ($this.opts.pauseonhover) clearTimeout(t); 152 153 }); 154 155 } 156 157 } 158 159 if ($this.opts.autorotate) { 160 161 t = setTimeout(forward, $this.opts.delay); 162 163 $this.hover(function() { 164 165 if ($this.opts.pauseonhover) clearTimeout(t); 166 167 }, function() { 168 169 t = setTimeout(forward, $this.opts.delay); 170 171 }); 172 173 if ($this.opts.pauseonhover) $this.on( "mouseleave", function() { clearTimeout(t); t = setTimeout(forward, $this.opts.delay); }); 174 175 } 176 177 function deep_link() { 178 179 var ids = []; 180 181 elements.find('a').each(function() { ids.push($(this).attr($this.opts.attribute)); }); 182 183 var index = $.inArray(location.hash, ids) 184 185 if (index > -1) { 186 187 return index + 1 188 189 } else { 190 191 return ($this.data('active') || options.active) 192 193 } 194 195 } 196 197 var move = function(direction) { 198
199 if (direction == 'forward') i = ++i % elements.length; // wrap around 200 201 if (direction == 'backward') i = --i % elements.length; // wrap around 202 203 elements.eq(i).click(); 204 205 } 206 207 $this.find(options.controls.next).click(function() { 208 move('forward'); 209 }); 210 211 $this.find(options.controls.prev).click(function() { 212 move('backward'); 213 }); 214 215 $this.on ('show', function(e, tab) { 216 fn(e, tab); 217 }); 218 219 $this.on ('next', function() { 220 move('forward'); 221 }); 222 223 $this.on ('prev', function() { 224 move('backward'); 225 }); 226 227 $this.on ('destroy', function() { 228 $(this) 229 .removeData() 230 .find('> ul li').each( function(i) { 231 $(this).removeClass(options.activeclass); 232 }); 233 _tabs.each( function(i) { 234 $(this).removeAttr('style').css( 'display', _cache_div[i] ); 235 }); 236 }); 237 238 } 239 240 }); 241 242 }; 243 244 $(document).ready(function () { $('[data-toggle="tabslet"]').tabslet(); }); 245 246})(jQuery); 247; 248;(function ($) { 249 $(document).ready(function($) { 250 251 $('.article-dropdown').collapser({ 252 mode: 'block', 253 effect: 'slide', 254 showClass: 'toshow', 255 hideClass: 'tohide', 256 beforeShow: function(){ 257 //console.log( 'Before show' ); 258 }, 259 afterShow: function(){ 260 console.log( 'After show' ); 261 var a = $(this).parent().parent(); 262 a.next().find('.detail a').css("visibility", "visible"); 263 }, 264 beforeHide: function(){ 265 console.log( 'Before hide' ); 266 267 }, 268 afterHide: function(){ 269 console.log( 'After hide' ); 270 var a = $(this).parent().parent(); 271 a.next().find('.detail a').css("visibility", "hidden"); 272 }, 273 }); 274 275 276 277 278 //add some text for search stats 279 $("<li class='hot'>ç±æ</li>").insertBefore('ul.search-api-stats-top-phrases li.first'); 280 $('ul.search-api-stats-top-phrases li.hot').css("color", '#f00') 281 $('ul.search-api-stats-top-phrases li.hot').css("font-size", '13px') 282 283 $('.block .tabs').tabslet({ 284 autorotate: true, 285 animation: true, 286 delay: 3000 287 }); 288 289 $("body.not-logged-in a:not([href=#], [href^=#], [href*=javascript], [href*=mailto], [target=_blank], [class=prev], [class=next], [class=cssmenu-togg]) ").click(function(){ 290 console.log($(this)); 291 console.log('loadingicon'); 292 $('#loadingicon').show(); 293 }); 294 295 296 297 var swiper = new Swiper('#block-dct-lbanner-lbanner-books .swiper-container', { 298 loop: true, 299 slidesPerView: 6, 300 spaceBetween: 5, 301 autoplay: { 302 delay: 2500, 303 disableOnInteraction: false, 304 }, 305 pagination: { 306 el: '.swiper-pagination', 307 clickable: true, 308 renderBullet: function (index, className) { 309 return '<span class="' + className + '">' + '</span>'; 310 }, 311 }, 312 }); 313 314 }); 315 316 $(window).on('load',function() { 317 console.log('load'); 318 $('#page-wrapper').css({"opacity":"1"}); 319 $("#loadingicon").fadeOut(500); 320 321 322 $(window).scroll(function() { 323 if($(this).scrollTop() != 0) { 324 $("#toTop").addClass("show"); 325 } else { 326 $("#toTop").removeClass("show"); 327 } 328 }); 329 330 $("#toTop").click(function() { 331 $("body,html").animate({scrollTop:0},800); 332 }); 333 334 335 }); 336 337})(jQuery); 338;
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.