PageSourceSearch

https://ferries.com/wp-content/plugins/olevmedia-shortcodes/assets/js/shortcodes.js?ver=1.1.9

js ferries.com collected 2026-10-02 10:45:35 UTC 7,738 bytes, 564 lines download raw bytes

1var omShortcodes = {
2
3	
4
5	init: function(modules) {
6
7		if(typeof(modules) != 'undefined') {
8
9			for(var i = 0; i < modules.length; i++) {
10
11				if(typeof(this.modules[modules[i]]) != 'undefined')
12
13					this.modules[modules[i]].init();
14
15			}
16
17		}
18
19		
20
21	},
22
23	
24
25	modules: { }
26
27};
28
29
30
31omShortcodes.modules.buttons = {
32
33	init: function() {
34
35		jQuery('.omsc-button.omsc-custom-hover').each(function(){
36
37			jQuery(this).data('def-bg-color',jQuery(this).css('background-color'));
38
39			jQuery(this).data('def-text-color',jQuery(this).css('color'));
40
41			jQuery(this).data('def-border-color',jQuery(this).css('border-top-color'));
42
43		}).hover(function(){
44
45			var color;
46
47
48
49			color=jQuery(this).data('hover-bg-color');
50
51			if(color)
52
53				jQuery(this).css('background-color',color);
54
55
56
57			color=jQuery(this).data('hover-text-color');
58
59			if(color)
60
61				jQuery(this).css('color',color);
62
63
64
65			color=jQuery(this).data('hover-border-color');
66
67			if(color)
68
69				jQuery(this).css('border-color',color);
70
71				
72
73		}, function(){
74
75			jQuery(this).css('background-color',jQuery(this).data('def-bg-color'));
76
77			jQuery(this).css('border-color',jQuery(this).data('def-border-color'));
78
79			jQuery(this).css('color',jQuery(this).data('def-text-color'));
80
81		});
82
83		
84
85	}
86
87}
88
89
90
91omShortcodes.modules.tooltips = {
92
93	init: function() {
94
95		
96
97		jQuery('.omsc-add-tooltip').each(function(){
98
99			var text=jQuery(this).data('tooltip');
100
101			if(typeof(text) == 'undefined')
102
103				return;
104
105				
106
107			jQuery(this).mouseenter(function(){
108
109				
110
111				var $tt=jQuery(this).data('omsc-tooltip');
112
113				if($tt) {
114
115					$tt.stop();
116
117				} else {
118
119					var pos=jQuery(this).offset();
120
121					$tt=jQuery('<div class="omsc-tooltip"><div class="omsc-tooltip-inner"></div></div>');
122
123					$tt.find('.omsc-tooltip-inner').text(text);
124
125					jQuery(this).data('omsc-tooltip', $tt);
126
127					$tt.appendTo('body');
128
129					$tt.css('left',pos.left + Math.round(jQuery(this).outerWidth()/2));
130
131					$tt.css('top',pos.top - $tt.outerHeight());
132
133				}
134
135				$tt.show();
136
137				$tt.animate({opacity:1, marginTop: '-13px'}, 200);
138
139			});
140
141	
142
143			jQuery(this).mouseleave(function(){
144
145				var $this=jQuery(this);
146
147				var $tt=$this.data('omsc-tooltip');
148
149				if($tt) {
150
151					$tt.stop().animate({opacity:0, marginTop: '-22px'}, 200, function(){
152
153						jQuery(this).remove();
154
155						$this.data('omsc-tooltip',false);
156
157					});
158
159				}
160
161			});
162
163	
164
165		});
166
167
168
169	}
170
171}
172
173
174
175omShortcodes.modules.toggle = {
176
177	init: function() {
178
179
180
181		jQuery('.omsc-accordion .omsc-toggle').addClass('omsc-in-accordion').find('.omsc-toggle-title').click(function(){
182
183			
184
185			var $toggle=jQuery(this).parent();
186
187			
188
189			if($toggle.hasClass('omsc-expanded')) {
190
191				$toggle.removeClass('omsc-expanded');
192
193				$toggle.find('.omsc-toggle-inner').slideUp(300);
194
195				return false;
196
197			}
198
199	
200
201			var $acc=$toggle.parents('.omsc-accordion');
202
203			if(!$acc.hasClass('omsc-multiopen'))
204
205				$acc.find('.omsc-toggle.omsc-expanded').removeClass('omsc-expanded').find('.omsc-toggle-inner').slideUp(300);
206
207	
208
209			$toggle.find('.omsc-toggle-inner').slideDown(300,function(){
210
211				var h=jQuery(this).parent().height();
212
213				var pos=jQuery(this).parent().find('.omsc-toggle-title').offset();
214
215				var scroll=jQuery(window).scrollTop();
216
217				var wh=jQuery(window).height();
218
219				if(pos.top < scroll || (pos.top > scroll && pos.top+h > scroll+wh))
220
221					jQuery('html,body').animate({ scrollTop: pos.top+'px' }, 200);
222
223			}).find('iframe[src*="maps.google"]').each(function(){
224
225				jQuery(this).attr('src',jQuery(this).attr('src'));
226
227			});
228
229			$toggle.addClass('omsc-expanded');
230
231			
232
233		});
234
235		
236
237		jQuery('.omsc-toggle').not('.in-accordion').find('.omsc-toggle-title').click(function(){
238
239			
240
241			var $toggle=jQuery(this).parent();
242
243			
244
245			var $inner=$toggle.find('.omsc-toggle-inner');
246
247			if(!$inner.length)
248
249				return false;
250
251			if($inner.is(':animated'))
252
253				return false;
254
255			
256
257			$toggle.toggleClass('omsc-expanded');
258
259			$inner.slideToggle(300);
260
261			if($toggle.hasClass('omsc-expanded')) {
262
263				$inner.find('iframe[src*="maps.google"]').each(function(){
264
265					jQuery(this).attr('src',jQuery(this).attr('src'));
266
267				});
268
269			}
270
271			
272
273			return false;
274
275		});
276
277		
278
279	}
280
281}
282
283
284
285omShortcodes.modules.tabs = {
286
287	init: function() {
288
289
290
291		var hash=window.location.hash.replace('#','');
292
293		jQuery('.omsc-tabs').each(function(){
294
295			if(hash != '' && jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab.omsc-'+hash).length ) {
296
297				jQuery(this).find('.omsc-tabs-control a[href$=#'+hash+']').parent().addClass('omsc-active');
298
299				jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab').hide().filter('.omsc-'+hash).addClass('omsc-active').show();
300
301			} else {
302
303				jQuery(this).find('.omsc-tabs-control li:first').addClass('omsc-active');
304
305				jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab:first').addClass('omsc-active').show();
306
307			}
308
309		});
310
311		
312
313		jQuery('.omsc-tabs .omsc-tabs-control a').click(function(){
314
315
316
317			var $tabs=jQuery(this).parents('.omsc-tabs');
318
319			var $tabstabs=$tabs.find('.omsc-tabs-tabs');
320
321			var $li=jQuery(this).parent();
322
323
324
325			if($li.hasClass('omsc-active'))
326
327				return false;
328
329				
330
331			var tabname=jQuery(this).attr('href').split('#');
332
333			tabname=tabname[(tabname.length-1)];
334
335			
336
337			$tabs.find('.omsc-tabs-control li').removeClass('omsc-active');
338
339			$li.addClass('omsc-active');
340
341			
342
343			var $newtab=$tabs.find('.omsc-tabs-tabs .omsc-tabs-tab.omsc-'+tabname);
344
345			
346
347			$tabstabs.stop(true);
348
349			var cur_h=$tabstabs.height();
350
351			$tabstabs.css('height',cur_h+'px');
352
353			
354
355			$tabstabs.find('.omsc-tabs-tab.omsc-active').hide().removeClass('omsc-active');
356
357			$newtab.addClass('omsc-active').fadeIn(300);
358
359			
360
361			$newtab.find('iframe[src*="maps.google"]').each(function(){
362
363				jQuery(this).attr('src',jQuery(this).attr('src'));
364
365			});
366
367	
368
369			var new_h=$newtab.outerHeight();
370
371			if(Math.abs(cur_h - new_h) > 4) {
372
373				$tabstabs.animate({height: new_h + 'px'}, 300, function(){
374
375					jQuery(this).css('height','auto');
376
377				});
378
379			} else {
380
381				$tabstabs.css('height','auto');
382
383			}
384
385			
386
387			
388
389			return false;
390
391		});
392
393		
394
395	}
396
397}
398
399
400
401omShortcodes.modules.responsivebox = {
402
403	init: function() {
404
405
406
407		jQuery('.omsc-responsive-box').each(function(){
408
409			var $obj=jQuery(this).children(':first');
410
411			if($obj.length) {
412
413				var w=parseInt($obj.attr('width'));
414
415				var h=parseInt($obj.attr('height'));
416
417				if(!isNaN(w) && !isNaN(h) && w > 0 && h > 0) {
418
419					var r=h/w;
420
421					jQuery(this).css('padding-bottom',(r*100)+'%');
422
423				}
424
425			}
426
427		});
428
429		
430
431	}
432
433}
434
435
436
437omShortcodes.modules.counter = {
438
439	init: function() {
440
441		
442
443		var interval=30;
444
445		
446
447		function om_tick(args) {
448
449			args.obj.text([args.prefix, args.current, args.suffix].join(''));
450
451			if(args.current < args.count) {
452
453				args.current+=args.step;
454
455				if(args.current > args.count)
456
457					args.current=args.count;
458
459					
460
461				setTimeout(function(){
462
463					om_tick(args);
464
465				}, args.interval);
466
467			}
468
469		}
470
471		
472
473		function om_start_item(obj) {
474
475			var $this=jQuery(obj);
476
477			var count=$this.data('count');
478
479			var duration=$this.data('animation');
480
481			if(count && duration) {
482
483				if(duration > interval) {
484
485					
486
487					var step=Math.ceil( count / (duration/interval) );
488
489					if(step < 1)
490
491						step=1;
492
493					om_tick({
494
495						obj: $this.find('.omsc-counter-number'),
496
497						current: 0,
498
499						count: count,
500
501						step: step,
502
503						interval: interval,
504
505						prefix: $this.data('prefix'),
506
507						suffix: $this.data('suffix')
508
509					});
510
511
512
513				}
514
515			}
516
517		}
518
519		
520
521		
522
523		if(jQuery.waypoints) {
524
525			jQuery('.omsc-counter').each(function(){
526
527	
528
529				jQuery(this).waypoint(function(){
530
531					om_start_item(this);
532
533				},{
534
535					offset: '100%',
536
537					triggerOnce: true
538
539				});			
540
541				
542
543			});
544
545		} else {
546
547			jQuery('.omsc-counter').each(function(){
548
549
550
551				om_start_item(this);
552
553				
554
555			});
556
557		}
558
559		
560
561	}
562
563}
564

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.