PageSourceSearch

https://dismagazine.com/wp-content/themes/discontinuity-2026/js/article.js?v=2

js dismagazine.com collected 2026-10-02 04:48:42 UTC 3,769 bytes, 137 lines download raw bytes

1
2
3function getPage() {
4  var m = window.location.hash.split('#/page/');
5	return m ? m[1] : null;
6}
7
8function setImgRight() {
9	$('.reveal').each(function() {
10		var imgRight = (800 - $(this).find('img.over:eq(0)').width()) / 2;
11		$(this).find('.img.over:eq(0)').css('right', (imgRight + 'px'));
12		if (imgRight != 0) {
13			$(this).find('.trigger:eq(0)').css('right', ((imgRight - 100) + 'px'));
14		} 
15		$(this).find('.aligcenter').css('right', (imgRight + 'px'));
16	});
17}
18
19function revealUnder() {
20	$('.reveal').each(function() {
21		
22		$(this).append('<span class="trigger">Reveal</span>');
23		setImgRight();
24		
25		$('.trigger').hover(
26			function() {
27				$(this).siblings('img.over').slideUp();
28				$(this).siblings('img.hidden').slideDown();
29			},
30			function() {
31				$(this).siblings('img.over').slideDown();
32				$(this).siblings('img.hidden').slideUp();
33			}
34		);
35	});
36	
37}
38
39jQuery(function( $ ) {
40	
41	var viewHeight = $(window).height();
42	var space = (viewHeight - 600) / 2;
43	var storyView = 223 - space;
44	
45	//if (!$('#horizontal')) {
46		//$(window).scrollTo({top: storyView}, 1600, { easing: 'easeOutElastic'});
47	//}
48	
49	$('#content div.wp-caption p').wrap('<div class="caption-wrapper" />');
50	
51	//Paginated Articles
52	if ($('#paginated')) {
53		$('#paginated #content').serialScroll({
54			items:'.page', // Selector to the items ( relative to the matched elements, '#sections' in this case )
55			prev:'#pagePrev a',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
56			next:'#pageNext a',// Selector to the 'next' button (absolute too)
57			axis:'y',// The default is 'y' scroll on both ways
58			duration:400, // Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
59			cycle: false,
60			onAfter: function() {
61				$('#content div.wp-caption').each(function (i) { 
62					imgWidth = $(this).find('img').outerWidth();
63					capWidth = (imgWidth - 16) + 'px';
64					$(this).find('.caption-wrapper').css( {
65						'width': capWidth
66					} );
67							
68				});
69				
70			}
71		});
72		
73		if (getPage()) {
74			pg = getPage();
75			pg = pg - 1;
76			$('#content').trigger('goto', [pg]);
77		}
78	}
79	
80	
81	//Horizontal articles
82	var pages = $('.page').length;
83	var pagesWidth = 0;
84	$('#horizontal .page').each(function() {
85		pagesWidth += $(this).outerWidth( true );
86	});
87	
88	$('#horizontal #content .post').width(pagesWidth);
89	
90	/*
91	if ($('#horizontal')) {
92		$.scrollTo(storyView, 1000, { easing: 'linear', onAfter: function() {
93				$('#horizontal #content').scrollTo('.page:eq(1)', 1600, { easing: 'easeOutBack', onAfter: function() {
94						$('#horizontal #content').scrollTo('.page:eq(0)', 1600, { easing: 'easeOutBounce' });
95					}
96				});
97			} 
98		});
99	}
100	*/
101			
102	revealUnder();	
103	
104	/*
105	$('.single .entry img, .blogPost img').not('a img, .shortPost img, .category-mixes img, .category-releases img').each(function() {
106		var $el = $(this);
107		if($el.is('.wp-caption img')) {
108			$el.closest('.wp-caption').addClass('pinterest-button');
109		} else {
110			var classes = $el.attr('class');
111			$el.wrap('<span class="pinterest-button ' + classes +'" />');
112		}
113		
114		var $headline = $el.closest('.post').find('h1:eq(0)');
115		if($headline.is('#headline')) {
116			var href = $headline.attr('data-permalink');
117		} else {
118			var href = $headline.find('a:eq(0)').attr('href');
119		}
120		
121		var src = $el.attr('src');
122		src = src.split(/-\d+x\d+\./);
123		if(src.length > 1) {
124		
125			src = src[0] + '.' + src[1];
126		}
127
128		
129		$el.after('<a href="https://pinterest.com/pin/create/button/?url=' + href + '&amp;media=' + src + '&amp;description=' + $headline.text() + 
130			'" class="pin-it-button" count-layout="horizontal" target="_blank"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>');
131		
132		$el.attr('class', '');
133		
134	});*/
135	
136	
137});

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.