PageSourceSearch

https://profitsistems.ru/templates/jm-modern-hika-store/js/scripts.js

js profitsistems.ru collected 2026-10-08 06:38:05 UTC 4,033 bytes, 121 lines download raw bytes

1/*--------------------------------------------------------------
2# Copyright (C) joomla-monster.com
3# License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
4# Website: http://www.joomla-monster.com
5# Support: [email protected]
6---------------------------------------------------------------*/
7
8//Set Module's Height script
9
10function setModulesHeight() {
11	var regexp = new RegExp("_mod([0-9]+)$");
12
13	if ($$('.jm-module')) {
14		var modules = $$('.jm-module');
15		modules.each(function(element) {
16			var match = regexp.exec(element.className);
17			if (match) {
18				var modHeight = parseInt(match[1]);
19				var module_in = element.getElement('.jm-module-in');
20				if (module_in) {
21					module_in.setStyle('height', modHeight);
22				}
23			}
24		});
25	}
26
27}
28
29window.addEvent('domready', function() {
30	setModulesHeight();
31});
32
33//jQuery 'Back to Top' script
34
35jQuery(document).ready(function(){
36    // hide #jm-back-top first
37    jQuery("#jm-back-top").hide();
38    // fade in #jm-back-top
39    jQuery(function () {
40        jQuery(window).scroll(function () {
41            if (jQuery(this).scrollTop() > 100) {
42                jQuery('#jm-back-top').fadeIn();
43            } else {
44                jQuery('#jm-back-top').fadeOut();
45            }
46        });
47        // scroll body to 0px on click
48        jQuery('#jm-back-top a').click(function () {
49            jQuery('body,html').animate({
50                scrollTop: 0
51            }, 800);
52            return false;
53        });
54    });
55    
56    jQuery('.hikashop_product_contact_main .hikabtn').addClass('hikashop_cart_input_button');
57    
58});
59
60//Document Text Resizer script (May 14th, 08'): By JavaScript Kit: http://www.javascriptkit.com
61
62var documenttextsizer = {
63
64	prevcontrol : '', //remember last control clicked on/ selected
65	existingclasses : '',
66
67	setpageclass : function(control, newclass) {
68		if (this.prevcontrol != '')
69			this.css(this.prevcontrol, 'selectedtoggler', 'remove')
70		//de-select previous control, by removing 'selectedtoggler' from it
71		document.documentElement.className = this.existingclasses + ' ' + newclass//apply new class to document
72		this.css(control, 'selectedtoggler', 'add')//select current control
73		this.setCookie('pagesetting', newclass, 5)//remember new class added to document for 5 days
74		this.prevcontrol = control
75	},
76
77	css : function(el, targetclass, action) {
78		var needle = new RegExp("(^|\\s+)" + targetclass + "($|\\s+)", "ig")
79		if (action == "check")
80			return needle.test(el.className)
81		else if (action == "remove")
82			el.className = el.className.replace(needle, "")
83		else if (action == "add")
84			el.className += " " + targetclass
85	},
86
87	getCookie : function(Name) {
88		var re = new RegExp(Name + "=[^;]+", "i");
89		//construct RE to search for target name/value pair
90		if (document.cookie.match(re))//if cookie found
91			return document.cookie.match(re)[0].split("=")[1]
92		//return its value
93		return null
94	},
95
96	setCookie : function(name, value, days) {
97		if ( typeof days != "undefined") {//if set persistent cookie
98			var expireDate = new Date()
99			var expstring = expireDate.setDate(expireDate.getDate() + days)
100			document.cookie = name + "=" + value + "; path=/; expires=" + expireDate.toGMTString()
101		} else//else if this is a session only cookie
102			document.cookie = name + "=" + value
103	},
104
105	setup : function(targetclass) {
106		this.existingclasses = document.documentElement.className//store existing CSS classes on HTML element, if any
107		var persistedsetting = this.getCookie('pagesetting')
108		var alllinks = document.getElementsByTagName("a")
109		for (var i = 0; i < alllinks.length; i++) {
110			if (this.css(alllinks[i], targetclass, "check")) {
111				if (alllinks[i].getAttribute("rel") == persistedsetting)//if this control's rel attribute matches persisted doc CSS class name
112					this.setpageclass(alllinks[i], alllinks[i].getAttribute("rel"))
113				//apply persisted class to document
114				alllinks[i].onclick = function() {
115					documenttextsizer.setpageclass(this, this.getAttribute("rel"))
116					return false
117				}
118			}
119		}
120	}
121}

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.