PageSourceSearch

https://purenintendo.com/wp-content/plugins/themewich-shortcodes/js/themewich.shortcodes.js?ver=1.4.1

js purenintendo.com collected 2026-10-02 03:00:31 UTC 5,091 bytes, 210 lines download raw bytes

1jQuery.noConflict(); // Set jQuery to NoConflict Mode
2
3/**
4 * Plugin Javascript
5 */
6(function( $ ){
7	"use strict";
8
9	/**
10	 * All lightbox functions for the plugin
11	 * @since v1.3
12	 * (c) Copyright 2013 Andre Gagnon - http://themewich.com
13	 */
14	$.fn.themewichLightBox = function(options) {
15
16		if(this.length == 0) return this; // if nothing supplied
17
18		var defaults = {
19			notimages: true
20		}
21
22		// create a namespace
23		var lightbox 	= {};
24
25		var el = this;
26		lightbox.el = this;
27
28		// merge supplied options with the defaults
29		lightbox.settings = $.extend({}, defaults, options);
30		
31		lightbox.el.imageselectors = $(lightbox.el.selector + '[href*=".jpg"]')
32			.add(lightbox.el.selector + '[href*="jpeg"]')
33			.add(lightbox.el.selector + '[href*=".png"]')
34			.add(lightbox.el.selector + '[href*=".gif"]');
35
36		if (lightbox.settings.notimages) {
37			lightbox.el.inlineselectors = lightbox.el.not(lightbox.el.imageselectors);
38		}
39
40		// Lightbox popups
41		lightbox.el.imageselectors.magnificPopup({
42			type:'image', 
43			closeBtnInside: true,
44			mainClass: 'mfp-zoom-in',
45			tLoading: '<div class="tw-loading"></div>',
46			removalDelay: 500, //delay removal by X to allow out-animation
47			image: {
48				tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
49				titleSrc: function(item) {
50				  return item.el.find('img').attr('title');				  
51				},
52				 markup: '<div class="mfp-figure">'+
53	            '<div class="mfp-close"></div>'+
54	            '<div class="mfp-img"></div>'+
55	            '<div class="mfp-bottom-bar">'+
56	              '<div class="mfp-title-wrapper"><div class="mfp-title"></div></div>'+
57	              '<div class="mfp-counter"></div>'+
58	            '</div>'+
59	          '</div>' // Popup HTML markup. `.mfp-img` div will be replaced with img tag, `.mfp-close` by close button
60			},
61
62			callbacks: {
63				imageLoadComplete: function() {
64				  var self = this;
65				  setTimeout(function() {
66				    self.wrap.addClass('mfp-image-loaded');
67				  }, 16);
68				},
69				close: function() {
70				  this.wrap.removeClass('mfp-image-loaded');
71				}
72			},
73			closeOnContentClick: true,
74			midClick: true
75		});
76
77		// Inline popups
78	    lightbox.el.inlineselectors.magnificPopup({
79	      disableOn: 700,
80	      closeBtnInside: true,
81	      tLoading: '<div class="tw-loading"></div>',
82	      type: 'iframe',
83	      mainClass: 'mfp-fade',
84	      removalDelay: 160,
85	      preloader: false,
86	      fixedContentPos: false
87	    });
88	}
89
90	/**
91	 * Isotope function for the plugin
92	 * @since v1.3
93	 * (c) Copyright 2013 Andre Gagnon - http://themewich.com
94	 */
95	$.fn.themewichIsotope = function() {
96
97		if(this.length == 0) return this; // if nothing supplied
98
99		$(this).each(function(){
100
101			var $this 			= $(this),
102	  	 	 	columnNumber 	= $this.attr('data-value'),
103	  	 	 	isoBrick 		= $this.find('.isobrick'),
104	  	 	 	colnum 			= 2;
105
106	  	 	// Remove margins
107			isoBrick.css({
108				'margin-left': 0,
109				'margin-right': 0 
110			});
111	 
112
113			function setColNumber() {
114				// Calculate column number
115				if ($(window).width() < 767) {
116					colnum = 2;
117				} else { 
118					colnum = columnNumber;
119				}
120				return colnum;
121			}
122
123			function runIsotope() {
124				colnum = setColNumber();
125
126				if (columnNumber != '1') {
127					$this.isotope({
128						masonry: {
129					    	columnWidth: $this.width() / colnum
130					    },
131					    itemSelector : '.isobrick',
132					    layoutMode : 'masonry'
133					});
134				}
135			}
136
137			runIsotope(); // run on document.ready
138
139			$(window).resize(function () {
140				runIsotope(); // Run on window resize
141			});
142			// layout Isotope again after all images have loaded
143			$this.imagesLoaded( function() {
144			  runIsotope();
145			});
146		});
147	};
148
149	$.fn.themewichParallax = function() {
150		var $this = $(this);
151
152		function setWidth() {
153			var postWidth 	= $this.outerWidth(),
154				windowWidth = $(window).width(),
155				padding 	= (windowWidth - postWidth)/2;
156
157			$('.tw-full-bg-image').css({
158				'margin-left': -padding + 'px',
159				'margin-right': -padding + 'px',
160				'padding-left' : padding + 'px',
161				'padding-right' : padding + 'px'
162			});
163		}
164
165		setWidth();
166
167		$(window).resize(function(){
168			setWidth();
169		});
170	};
171
172	// Instantiate the plugins
173    $(document).ready(function(){
174    	if ($.fn.magnificPopup) {
175			$('a.tw-lightbox').themewichLightBox();
176		}
177		$( ".tw-tabs-shortcode" ).tabs({
178			heightStyle: "content" // Each panel will be only as tall as its content
179		});
180		if ($.fn.isotope) {
181			$('.tw-postshortcode .isotopecontainer').themewichIsotope();
182		}
183		if ($.fn.accordion) {
184			$('.tw-accordion').accordion({heightStyle: 'content'});
185		}
186		$('.tw-toggle-trigger').click(function(){
187			$(this).toggleClass('active').next().slideToggle('fast');
188			return false;
189		});
190		if ($.fn.themewichParallax) {
191			$('.tw-post-break').themewichParallax();
192		}
193
194		// redraw
195		jQuery.fn.redraw = function() {
196			return this.hide(0, function() {
197				$(this).show();
198			});
199		};
200
201		// redraw on load
202		$('.chrome .tw-parallax-scroll').redraw();
203
204		// force chrome to re-render on scroll
205		$(window).scroll(function() {
206			$('.chrome .tw-parallax-scroll').redraw();
207		});
208	});
209
210})(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.