PageSourceSearch

https://canadatattooshows.com/cms2t/res/js/mw.common.js

js canadatattooshows.com collected 2026-10-09 22:41:14 UTC 9,622 bytes, 305 lines download raw bytes

1/*--------------------------------------------------------------------------------*\
2|	updateDimensions
3|----------------------------------------------------------------------------------
4| Updates current dimensions setting for future use.
5| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6|	Params:
7|		NONE
8|	Return:
9|		NULL
10\*--------------------------------------------------------------= by Mr.V!T =-----*/
11function updateDimensions () {
12
13	var wnd			= screenSize();
14	var desktop_height	= wnd.height - jQuery('#HintBarContainer').height() - jQuery('#NavigationContainer').height(); 
15
16	setCookie('mwWorkSpaceWidth', wnd.width);
17	setCookie('mwWorkSpaceHeight', desktop_height);
18
19} //FUNC updateDimensions
20
21/*--------------------------------------------------------------------------------*\
22|	setCloudItem
23|----------------------------------------------------------------------------------
24| Sets cloud item state.
25| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
26|	Params:
27|		item	object	- Item to sec.
28|	Return:
29|			bool	- Result state.
30\*--------------------------------------------------------------= by Mr.V!T =-----*/
31function setCloudItem (item, state) {
32	
33	var input 	= jQuery('input[type="checkbox"]', item).get(0);
34	var value 	= input.value;
35	input.checked	= state;
36	
37	jQuery(item).removeClass('Selected');
38	
39	if ( state ) {
40		jQuery(item).addClass('Selected');
41	} else { //IF selected
42	
43	} //IF unselected
44	
45	return state;
46} //FUNC setCloudItem
47
48/*--------------------------------------------------------------------------------*\
49|	CloudItemClick
50|----------------------------------------------------------------------------------
51| Processes CloidItem click operation.
52| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53|	Params:
54|		item	Object	- Cloud Item itself.
55|		control	string	- Control Field ID.
56|	Return:
57|			bool	- Always FALSE.
58\*--------------------------------------------------------------= by Mr.V!T =-----*/
59function CloudItemClick (item, control) {
60	
61	var input 	= jQuery('input[type="checkbox"]', item).get(0);
62	var state	= setCloudItem(item, !input.checked);
63	
64	if ( !control ) return false;
65	
66	var value 	= input.value;
67	
68	var control_value	= jQuery('#'+control).val();
69	var control_tags	= control_value.split(/\s*[,|]\s*/);
70	
71	var tmp = control_tags.indexOf(value);
72	
73	if ( state ) {
74		if ( tmp < 0 ) control_tags.push(value);
75	} else { //IF selected
76		if ( tmp >= 0 ) control_tags.splice(tmp, 1);
77	} //IF unselected
78	
79	control_value = control_tags.join(', ');
80	jQuery('#'+control).val(control_value);
81	
82	return false;
83} //FUNC CloudItemClick
84
85/*--------------------------------------------------------------------------------*\
86|	updateCloud
87|----------------------------------------------------------------------------------
88| Refreches given cloud from control.
89| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
90|	Params:
91|		id	string	- Cloud ID.
92|	Return:
93|			bool	- Always FALSE.
94\*--------------------------------------------------------------= by Mr.V!T =-----*/
95function updateCloud (id, control) {
96
97	id += '_cloud';
98
99	var control_value	= jQuery('#'+control).val();
100	var control_tags	= control_value.split(/\s*[,|]\s*/);
101	
102	jQuery('#' + id + ' input[type="checkbox"]').each(
103		function (index) {
104			var tmp = control_tags.indexOf(this.value);
105			setCloudItem(this.parentNode, (tmp >=0 ) );
106		} //FUNC each callback
107	); //jQuery
108	
109	return false;	
110} //FUNC updateCloud
111
112/*/
113function initLTRows () {
114	jQuery('.ListingTable TR:even').addClass('Even');
115} //FUNC initLTRows
116/**/
117
118/*--------------------------------------------------------------------------------*\
119|	pulseAncor
120|----------------------------------------------------------------------------------
121| Pulsates given block.
122| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
123|	Params:
124|		ancor	string	- Block name to pulsate.
125|	Return:
126|			bool	- Always FALSE.
127\*--------------------------------------------------------------= by Mr.V!T =-----*/
128function pulseAncor (ancor) {
129
130	// DEPRECATED, left just as dummy
131	return false;
132	
133	if ( !ancor ) 
134		return false;
135
136	jQuery('A[name='+ancor+']').effect('pulsate');
137	
138	return false;
139} //FUNC pulseAncor
140
141/*--------------------------------------------------------------------------------*\
142|	initDatePicker
143|----------------------------------------------------------------------------------
144| Initiates DatePickers on page.
145| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
146|	Params:
147|		NONE
148|	Return:
149|		bool	- Always false.
150\*--------------------------------------------------------------= by Mr.V!T =-----*/
151function initDatePicker () {
152	
153	Date.format = 'yyyy-mm-dd';
154	
155	jQuery('INPUT.Date').each( function () {
156
157		var el = jQuery(this);
158
159		el.datePicker({clickInput:true, createButton:false, startDate: '2000-01-01'});
160	//	el.dpSetSelected(el.val());
161		
162	}); //jQuery each 
163	
164	return false;
165} //FUNC initDatePicker
166
167/*--------------------------------------------------------------------------------*\
168|	updateAjaxLinks
169|----------------------------------------------------------------------------------
170| Updates page links wich should be loaded using AJAX.
171| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
172|	Params:
173|		NONE
174|	Return:
175|		bool	- Always FALSE.
176\*--------------------------------------------------------------= by Mr.V!T =-----*/
177function updateAjaxLinks () {
178	jQuery('A.ajax').each( function () {
179		this.onload	= this.onclick;
180		this.onclick	= '';
181	});
182	jQuery('A.ajax').unbind('click');
183	jQuery('A.ajax').click( function() {
184		return pageAjax(this);
185	}); //FUNC click
186	
187} //FUNC updateAjaxLinks
188
189/*--------------------------------------------------------------------------------*\
190|	goURL
191|----------------------------------------------------------------------------------
192| Proceses to url.
193| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
194|	Params:
195|		NONE
196|	Return:
197|		NULL
198\*--------------------------------------------------------------= by Mr.V!T =-----*/
199function goURL (url) {
200	
201	if ( !url || (url.indexOf('#') == url.length-1) ) return false;
202	
203	PageLoadStart(function () {
204		//window.location.href = url;
205	}); //FUNC PageLoadStart
206	
207} //FUNC goURL
208
209var mwPerson = {
210	
211	/** //** ----= getTitle	 	 =----------------------------------------------\**//** \
212	*
213	* 	Attempts to retrieve person title name to show in dialogs.
214	*
215	*	@param	object	person		- Person data object.
216	*	@param	string	[template]	- Custom template to use.
217	*
218	*	@return string			- Contact title.
219	*
220	\**//** ------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/
221	getTitle		: function (person, template) {
222		
223		template = template || '{name} {first_name} {last_name} {firstname} {lastname}';
224		
225		return parseVariables(template, person).multiClean().trim();
226	}, //FUNC getName
227
228	/** //** ----= getEmail	 	 =----------------------------------------------\**//** \
229	*
230	* 	Attempts to retrieve person email to show in dialogs.
231	*
232	*	@param	object	person		- Person data object.
233	*
234	*	@return string			- Contact title.
235	*
236	\**//** ------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/
237	getEmail	: function (person) {
238		return arraySelectValue(person, ['email', 'mail'], '').trim();
239	} //FUNC getName
240	
241} //OBJECT mwPerson
242
243/** //** ----= mwUpdateStates	=--------------------------------------------------------------------------------------\**//** \
244*
245* 	Updates states selector, showing only states for selected country
246*
247*	@param	jQuery	[$el]		- Host element in country/state input.
248*	@param	strin	[$stateValue]	- Default state value. Blank if omited
249*
250\**//** ---------------------------------------------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/
251function mwUpdateStates	($el, $stateValue) {
252
253	$stateValue	= $stateValue || '';
254
255	// If no element provided - trying to search for default one
256	if ( !$el )
257		$el = jQuery('#country');
258
259	// Making sure it's jQuery, if provided
260	$el = _jq($el);
261	
262	// Event can be triggered somwhere inside complex input, so better to research all fast
263	var $parent	= $el.closest('.mwRegionInput');
264
265	// Shortcuts for elements
266	var $country	= $parent.find('SELECT[data-region=country]');		// Countries selector
267	var $state	= $parent.find('SELECT[data-region=state]');		// States selector
268	var $states	= $parent.find('SELECT[data-region=states]');		// States list selector to use as source
269	
270// ---- OPTIONS ----	
271	
272	// Need to get real abbreviation: in some custom cases value != abbr
273	// In custom cases - additinal data is added for abbreviation
274	var $o		= $country.find('OPTION:selected');
275	var $abbr	= $o.attr('data-abbr') || $o.attr('value');
276	
277	// Cleaning values and coppying only necessary, searching them in source list
278	$state.find('OPTION:not(.empty)').remove();
279	
280	// Abbr can became empty (default "Please select options")
281	// In this case - should deselect states
282	if ( $abbr ) {
283		var $new = $states.find('.' + $abbr).clone();
284		$new.appendTo($state);
285	} //IF abbreviation found
286	
287	// Zeroing value
288	$state.val($stateValue).change();
289
290// ---- DISPLAY ----
291
292	// Depending on options hiding or showing state
293	if ( $abbr && $new.length ) {
294		
295		$parent.find('.Cell-Country').width('50%');
296		$parent.find('.Cell-State').show();
297		
298	} else { //IF showing
299
300		$parent.find('.Cell-Country').width('100%');
301		$parent.find('.Cell-State').hide();
302		
303	} //IF hiding
304
305} //FUNC mwUpdateStates

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.