PageSourceSearch

https://canadatattooshows.com/cms2t/res/vit-lib/debug.js

js canadatattooshows.com collected 2026-10-09 22:41:34 UTC 24,683 bytes, 747 lines download raw bytes

1/** ************************************************************************************************************************ **\
2* 
3*	Set of classes and functions that will help debug code and dump variables.
4* 
5* 	@package	VIT-Lib
6* 	@subpackage	Debug
7*
8* 	@license	MIT License
9*			Permission  is  hereby  granted,  free  of  charge, to any person obtaining a copy of this software and
10*			associated documentation files (the "Software"), to deal in the Software without restriction, including
11*			without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12*			copies  of  the  Software, and to permit persons to whom the Software is furnished to do so, subject to
13*			the following conditions:
14*			
15*			The  above  copyright  notice and this permission notice shall be included in all copies or substantial
16*			portions of the Software.
17*			
18*			THE  SOFTWARE  IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
19*			LIMITED  TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
20*			NO  EVENT  SHALL  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21*			WHETHER  IN  AN  ACTION  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22*			SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*
24*	@author		Victor Denisenkov aka Mr.V!T
25*	@copyright	Copyright (c) 2008 - 2012 Victor Denisenkov aka Mr.V!T
26*	@version	1.0
27* 
28\** ************************************************************************************************************************ **/
29
30/** //** ----= OBJECT vDump	=--------------------------------------------------------------------------------------\**//** \
31*
32* 	Variable dumper with highlighter.
33*
34* 	@package	VIT-Lib
35* 	@subpackage	Debug
36* 	@category	Helper
37*
38\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
39function vDump ($options) {
40
41return setObjectOptions({
42	
43	useHtml		: true,		// Allows to use highlight html, 
44					// otherwise will compile plain strings for alert()
45					
46	br		: '\n',		// Line break sequence
47		
48	dumpFunctions	: true,		// Whether or not dump functions in objects
49	dumpTypes	: true,		// Allow or not add types to dump
50	autoTypes	: true,		// If set to TRUE - force types dumping, otherwise will be dumped only when necessary
51	
52	recursionLevel	: 0,		// Current recursion level
53	maxRecursion	: 10,		// Maximum level of recursion allowed
54	collapseLevel	: 2,		// Level starting from where non-scalar variables will collapse dumps
55	
56	limitStrings	: 100,		// String will be collapsed if longer than this limit (either to limit or first line break)
57			
58// ==== Wrappers ===============================================================================================================
59
60	/** //** ----= getStyles	=------------------------------------------------------------------------------\**//** \
61	*
62	* 	Returns class styles, to use in force styles mod. Wraps with style="" attribute if found.
63	* 	Relies on own styles sheet, to be intependent from searate css. I.E. Allows colored dumping without 
64	* 	attaching any extenral css sheet.
65	*
66	*	@param	string	$class		- Class to seek.
67	* 	@param	string	[$styles]	- Additional styles to add.
68	* 
69	*	@return string			- Set of class styles.
70	* 
71	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
72	getStyles	: function ($class, $styles) {
73		
74		$styles = $styles || '';
75		
76		// Defining classes
77		var $Classes	= {
78			'TABLE'	: [
79				'border-collapse: collapse'
80			],
81			
82			'TH'	: [
83				'min-width: 100px',
84				'text-align: left',
85				'vertical-align: top'
86			],
87
88			'TD'	: [
89				'text-align: left',
90				'vertical-align: top'
91			]
92		}; //OBJECT $classes
93		
94		// Trimming possible semicolons, will add own anyway
95		// Doing this to do not require semicolons
96		if ( $styles )
97			$styles = $styles.trim('; ') + '; ';
98		
99		// Checking class styles if necessary
100		if ( $Classes[$class] )
101			$styles += $Classes[$class].join('; ');
102		
103		// Wrapping as attribute if got smth
104		if ( $styles )
105			$styles = ' style="' + $styles + '"';
106		
107		return $styles;
108	}, //FUNC getStyles
109
110	/** //** ----= wrap	=--------------------------------------------------------------------------------------\**//** \
111	*
112	* 	Wraps given code with certain class.
113	*
114	*	@param	string	$code		- Code to wrap.
115	*	@param	string	$class		- Class to apply to wrapping tag.
116	*	@param	string	[$styles]	- Styles to use.
117	*	@param	string	[$tag]		- Tag to use for wrapping.
118	* 
119	*	@return string			- HTML code.
120	* 
121	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
122	wrap	: function ($code, $class, $styles, $tag) {
123
124		if ( !this.useHtml )
125			return $code;
126		
127		$styles	= $styles || '';
128		$tag	= $tag || 'span';
129
130		if ( $styles )
131			$styles = ' style="' + $styles + '"';
132
133		return '<' + $tag + ' class="' + $class + '"' + $styles + '>' + $code + '</' + $tag + '>';		
134	}, //FUNC wrap
135	
136	/** //** ----= wrapType	=--------------------------------------------------------------------------------------\**//** \
137	*
138	* 	Special case of wrap. Common type wrapper.
139	*
140	*	@param	string	$type	- Type to wrap.
141	*	@param	string	[$sub]	- Subtype to wrap (e.g. length for array, or object instance).
142	* 
143	*	@return string		- Wrapped type code.
144	* 
145	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
146	wrapType	: function ($type, $sub) {
147		
148		var $res = '';
149		
150		if ( !this.dumpTypes )
151			return '';
152		
153		if ( $sub !== undefined && $sub !== '' )
154			$res = this.wrap($sub+'', isInt($sub)? 'Type' : 'Type' );
155
156		if ( this.autoTypes && !$res )
157			return '';
158
159		// Fancy space
160		if ( !this.autoTypes && $res )
161			$res = ' ' + $res;
162
163		if ( !this.autoTypes )
164			$res	= this.wrap($type, 'Type') + $res;
165
166		if ( !$res )
167			return '';
168
169		return this.wrap(' (' + $res + ')', 'Symbol');		
170	}, //FUNC wrapType
171
172	/** //** ----= wrapSpoiler	=------------------------------------------------------------------------------\**//** \
173	*
174	* 	Wraps given code with spoiler.
175	*
176	*	@param	string	$code		- Code to wrap.
177	*	@param	string	$head		- Spoiler header.
178	*	@param	bool	[$expanded]	- Set TRUE to be expanded by default.
179	* 
180	*	@return string			- Final code.
181	* 
182	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
183	wrapSpoiler	: function ($code, $head, $expanded) {
184		
185		if ( !this.useHtml )
186			return $head + $code;
187		
188	 	var $sn = 'S' + randomString();
189	 	
190		// Drawing spoiler button
191		var $res = '<span class="spoilerButton" id="sb_' + $sn + '" onclick="vDumpToggle(\'' + $sn + '\')">' + ($expanded ? '-' : '+') + '</span>';
192		
193		// Head is always visible
194		$res += ' ' + $head;
195		
196		// Using negative margin trick, to save space for deep levels
197		var $style = ''; 
198		
199		$style += (this.recursionLevel > 0 ? 'margin-left: -60px;' : '');
200		$style += ($expanded ? '' : ' display: none;');
201		
202		if ( $style )
203			$style = ' style="' + $style + '"';
204		
205		// Wrapping code with spoiler div
206		$res += '<div id="splr_' + $sn + '"' + $style + '>' + $code + '</div>';
207		
208		return $res;
209	}, //FUNC wrapSpoiler
210	
211	/** //** ----= wrapRoot	=--------------------------------------------------------------------------------------\**//** \
212	*
213	* 	Special case of wrap. Does final wrap for whole dump.
214	*
215	*	@param	string	$code	- Code to wrap.
216	* 
217	*	@return string		- Final code.
218	* 
219	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
220	wrapRoot	: function ($code) {
221		return this.wrap($code, 'vSyntax', '', 'code');
222	}, //FUNC wrapRoot
223
224// ==== Type Dumpers ===========================================================================================================
225
226	/** //** ----= dumpVar	=--------------------------------------------------------------------------------------\**//** \
227	*
228	* 	Generates dump code for given variable, depending on variable types.
229	*
230	*	@param	MIXED	$var	- Variable to dump.
231	* 
232	*	@return string		- Dump code.
233	* 
234	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
235	dumpVar	: function ($var) {
236		
237		var $type = typeof($var);
238		var $func = 'dump' + $type.toLowerCase().ucfirst();
239
240	// ---- Special types ----
241
242		var $res = this.dumpSpecials($var);
243		if ( $res )
244			return $res;
245
246	// ---- Common types ----
247		
248		// Checking for type dumper
249		if ( this[$func] )
250			return this[$func]($var);
251			
252		// If no proper dumper - that's smth unusual
253		// Trying to dump using native stringify
254
255		// Determining instance name
256		$stype = instanceName($var);
257		
258		return this.wrap($var + '', 'Error') + this.wrapType($type, $stype);
259	}, //FUNC dumpVar
260
261	/** //** ----= dumpTable	=------------------------------------------------------------------------------\**//** \
262	*
263	* 	Generates table view to any enumerable variable type. Used as helper for arrays/ojects dumps.
264	*	Does not uses recursion protection, though count recursion levels. Can wrap with spoiler if header provided.
265	*
266	*	@param	MIXED	$var	- Variable to dump.
267	*	@param	string	[$head]	- Header to use for spoiler.
268	* 
269	*	@return string		- Dump code.
270	* 
271	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
272	dumpTable	: function ($var, $head) {
273		
274		$head = $head || '';
275		
276		// Going deep, so should increase recursion level
277		this.recursionLevel++;
278		
279		var $body = '';
280		
281		var $th = this.getStyles('TH');
282		var $td = this.getStyles('TD');
283		
284		for ( var $i in $var ) {
285			
286			// Skipping functions at all if don't need them 
287			if ( !this.dumpFunctions && isFunction($var[$i]) )
288				continue;
289			
290			if ( this.useHtml ) {
291			
292				$body += '<tr>';
293				
294				$body += '<th' + $th + '>[' + this.wrap($i, 'Property') + ']</th>';
295				$body += '<td' + $td + '>&nbsp;=&nbsp;</td>';
296				$body += '<td' + $td + '>' + this.dumpVar($var[$i]) + '</td>';
297				
298				$body += '</tr>';
299			
300			} else { //IF html allowed
301			
302				// Padding with tabs
303				$body += strRepeat('\t', this.recursionLevel) + '[' + $i + ']\t= ' + this.dumpVar($var[$i]) + this.br;
304				
305			} //IF plain echo
306			
307		} //FOR each property
308		
309		$body = $body.trim(this.br);
310		
311		// Finalizing body
312		$body = this.wrap($body, 'Symbol', 'border-collapse: collapse', 'table');
313
314		// Returning recursion level
315		this.recursionLevel--;
316
317		if ( !$head )
318			return $body;
319
320		return this.wrapSpoiler($body, $head, this.recursionLevel < this.collapseLevel);
321	}, //FUNC dumpTable
322	
323	/** //** ----= dumpSpecials	=------------------------------------------------------------------------------\**//** \
324	*
325	* 	Returns special variables dump. Checks for DOM objects, jQuery and such. 
326	*	If none matched - returns empty string.
327	*
328	*	@param	string	$var	- Variable to dump.
329	* 
330	*	@return string		- Dump code.
331	* 
332	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
333	dumpSpecials	: function ($var) {
334		
335		if ( isObject($var) ) {
336		
337			// jQuery, showing selector and length
338			if ( isJQ($var) ) {
339				return this.wrap( this.wrap('jQuery', 'Identifier') + '(' + this.wrap($var.selector || "''", 'String') + ', ' + this.wrap($var.length, 'Type') + ')', 'Symbol');
340			} //IF jQuery object
341	
342			// Input descedants - nodeName.type and name/ID/class
343			if ( $var instanceof HTMLInputElement ) {
344				
345				// Supressing types to dump input value
346				var $dt = this.dumpTypes;
347				this.dumpTypes = false;
348				
349				var $res = this.wrap( this.wrap(instanceName($var), 'Identifier') + '(' + this.wrap($var.nodeName + '.' + $var.type , 'String') + ': ' + this.wrap($var.name || $var.id || $var.className, 'String') + ', ' + this.dumpVar($var.value) + ')', 'Symbol'); 
350	
351				// Restoring dumpTypes state
352				this.dumpTypes = $dt;
353	
354				return $res;
355			} //If input descedant
356	
357			// DOMNode descedants - nodeName and ID/name/class if set
358			if ( $var instanceof Node ) {
359				return this.wrap( this.wrap(instanceName($var), 'Identifier') + '(' + this.wrap($var.nodeName , 'String') + ': ' + this.wrap($var.id || $var.className || $var.name, 'String') + ')', 'Symbol'); 
360			} //If node descedant
361
362		} //IF object given
363		
364		return '';
365	}, //FUNC dumpSpecials
366	
367	/** //** ----= dumpUndefined	=------------------------------------------------------------------------------\**//** \
368	*
369	* 	Returns undefined variable dump.
370	*
371	*	@param	string	$var	- Variable to dump.
372	* 
373	*	@return string		- Dump code.
374	* 
375	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
376	dumpUndefined	: function ($var) {
377		return this.wrap($var + '', 'Error') + this.wrapType('undefined');
378	}, //FUNC dumpUndefined
379	
380	/** //** ----= dumpString	=------------------------------------------------------------------------------\**//** \
381	*
382	* 	Returns string variable dump.
383	*
384	*	@param	string	$var	- Variable to dump.
385	* 
386	*	@return string		- Dump code.
387	* 
388	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
389	dumpString	: function ($var) {
390
391		var $limit = this.limitStrings;
392		
393		// Regular dump for short strings, collapsed for long strings
394		if ( !this.useHtml || $var.length <= $limit || this.recursionLevel == 0 ) {
395
396			var $res = '';
397			$res += this.wrap("'" + (this.useHtml ? escapeHtmlTags($var) : $var) + "'", 'String');
398			$res += this.wrapType('string', $var.length);
399
400			return $res;
401	
402		} //IF short string
403
404		// Computing head, but first line break or just limit
405		var $pos = $var.indexOf('\n');
406		if ( $pos != -1 && $pos < $limit )
407			$limit = $pos;
408		
409		var $head = ''; 
410
411		$head = $var.limit($limit+2, '...').trim();
412		$head = escapeHtmlTags($head);
413		$head = this.wrap("'" + $head + "'", 'String') + this.wrapType('string', $var.length);
414		 
415		return this.wrapSpoiler( this.wrap("'" + escapeHtmlTags($var) + "'", 'String'), $head, false);		
416	}, //FUNC dumpString
417
418	/** //** ----= dumpBoolean	=------------------------------------------------------------------------------\**//** \
419	*
420	* 	Returns boolean variable dump.
421	*
422	*	@param	string	$var	- Variable to dump.
423	* 
424	*	@return string		- Dump code.
425	* 
426	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
427	dumpBoolean	: function ($var) {
428		return this.wrap($var + '', 'Boolean') + this.wrapType('boolean');
429	}, //FUNC dumpBoolean
430
431	/** //** ----= dumpNumber	=------------------------------------------------------------------------------\**//** \
432	*
433	* 	Returns number variable dump.
434	*
435	*	@param	string	$var	- Variable to dump.
436	* 
437	*	@return string		- Dump code.
438	* 
439	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
440	dumpNumber	: function ($var) {
441		
442		var $type = '';
443		
444		if ( isInt($var) )
445			$type = 'integer';
446		else if ( isFloat($var) )
447			$type = 'float';
448		else
449			$type = 'number';
450		
451		return this.wrap($var + '', isFloat($var)? 'Float' : 'Numeric') + this.wrapType($type);
452	}, //FUNC dumpNumber
453
454	/** //** ----= dumpFunction	=------------------------------------------------------------------------------\**//** \
455	*
456	* 	Returns function variable dump.
457	*
458	*	@param	string	$var	- Variable to dump.
459	* 
460	*	@return string		- Dump code.
461	* 
462	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
463	dumpFunction	: function ($var) {
464		
465		if ( !this.dumpFunctions )
466			return '';
467		
468		// Listing arguments
469		var $f		= $var.toString();
470		
471		// Looking for opening body bracket
472		var $bodypos	= $f.indexOf('{');
473
474		// Arguments will be all before it
475		var $args	= $f.substr(0, $bodypos);
476
477		// Function body starts with bracket		
478		$body		= escapeHtmlTags($f.substr($bodypos));
479		$body		= this.wrap($body, 'Identifier', '', 'pre');
480
481		// Coloring things 
482		$args		= $args.replace('function ', this.wrap('function ', 'Keyword'));
483		$args		= $args.replace('(', this.wrap('(', 'Symbol'));
484		$args		= $args.replace(')', this.wrap(')', 'Symbol'));
485		$args		= $args.replace(/,/g, this.wrap(',', 'Symbol'));
486
487		$args		= this.wrap($args, 'Identifier');
488
489		return this.wrapSpoiler($body, $args, false);
490	}, //FUNC dumpFunction
491
492	/** //** ----= dumpArray, dumpObject	=----------------------------------------------------------------------\**//** \
493	*
494	* 	Returns array/object variable dump.
495	*
496	*	@param	string	$var	- Variable to dump.
497	* 
498	*	@return string		- Dump code.
499	* 
500	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
501	dumpArray	: function ($var) { return this.dumpObject($var); },
502	dumpObject	: function ($var) {
503	
504	// ---- NULL ----
505		
506		// Fast check for NULLs
507		if ( $var === null )
508			return this.wrap(($var + '').toUpperCase(), 'Null') + this.wrapType('NULL');
509
510		// Saving items count		
511		var $ln = isArray($var) ? $var.length : Object.keys($var).length;
512
513	// ---- Scalar arrays ----
514
515		// Special case for non-empty scalar arrays if no need to dump types
516		if ( $ln && (!this.dumpTypes || this.autoTypes) && isScalarArray($var, true) ) {
517
518			// Supressing types inside array Dump, for readability
519			var $dt = this.dumpTypes;
520			this.dumpTypes = false;
521
522			// Going to collect all variables into result			
523			var $res = [];
524			for ( var $i = 0; $i < $var.length; $i++ )
525				$res.push(this.dumpVar($var[$i]));
526				
527			// Restoring dumpTypes state
528			this.dumpTypes = $dt;
529				
530			return this.wrap('[' + $res.join(', ') + ']', 'Symbol') + this.wrapType('array', $var.length);
531		} //IF scalar array given
532
533	// ---- Object Table Head ----
534
535		// Compiling title header
536		var $head = '';
537		
538		if ( isArray($var) ) {
539		
540			$head = this.wrap('array', 'Keyword') + '(' + this.wrap($var.length, 'Type') + ')'; 
541			
542		} else { //IF array given
543		
544			// Checking instanceName, to do not output basic object name
545			var $instance = instanceName($var);
546			if ( $instance == 'Object' )
547				$instance = '';
548			else
549				$instance = this.wrap($instance, 'Identifier') + ', ';
550
551			$head = this.wrap('object', 'Specials') + '(' + $instance + this.wrap(Object.keys($var).length, 'Type') + ')'; 
552			
553		} //IF object given
554		
555		$head = this.wrap($head, 'Symbol') + this.br;
556
557		// If can't go deeper - only head shown
558		// Adding spoiler dummy to lineup contents
559		if ( !$ln || this.recursionLevel > this.maxRecursion )
560			if ( this.useHtml )
561				return '<span class="spoilerButton"> </span> ' + $head;
562			else
563				return $head;
564
565	// ---- Object Table Body ----
566
567		return this.dumpTable($var, $head);
568
569	}, //FUNC dumpObject
570
571// ==== Dumpers ================================================================================================================
572
573	/** //** ----= _dump	=--------------------------------------------------------------------------------------\**//** \
574	*
575	* 	General dumper helper. Dumps multiple variables passed as array. Usefull to call with func_get_args() 
576	* 	from wrappers.
577	*
578	*	@param	array	$vars		- Variables to dump.
579	* 	@param	bool	[$inline]	- Set TRUE for inline mode, will avoid adding line breaks where possible.
580	* 					  Types are not dumped for inline mode.
581	* 
582	*	@return string			- HTML code.
583	* 
584	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
585	_dump : function ($vars, $inline) {
586
587		$vars = $vars || {};
588
589		// Resetting recursion level, and saving dumpTypes setting
590		this.recursionLevel = 0;
591		var $dt = this.dumpTypes;
592		
593		// Types are disabled for inline mode
594		if ( $inline )
595			this.dumpTypes = false;
596
597		// Compiling result
598		var $res	= [];
599		for ( var $i in $vars ) {
600			$res.push( this.dumpVar($vars[$i]) );
601		} //FOR each argument
602		
603		// Imploding with separator
604		$res = $res.join($inline ? ', ' : this.br);
605
606		// Restoring types setting
607		this.dumpTypes = $dt;
608
609		return this.wrap($res, 'Symbol');
610	}, //FUNC _dump
611
612	/** //** ----= dump	=--------------------------------------------------------------------------------------\**//** \
613	*
614	* 	Generates dump code for given variables, depending on variables types.
615	*
616	*	@param	MIXED	*	- Variables to dump.
617	* 
618	*	@return string		- HTML code.
619	* 
620	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
621	dump	: function () {
622		return this.wrapRoot( this._dump(arguments) );
623	}, //FUNC dump
624
625	/** //** ----= dumpCap	=--------------------------------------------------------------------------------------\**//** \
626	*
627	* 	Generates inline dump code for given variables, precending with given caption.
628	*
629	*	@param	string	$cap	- Caption to use.
630	*	@param	MIXED	*	- Variables to dump.
631	* 
632	*	@return string		- HTML code.
633	* 
634	\**//** --------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
635	dumpCap	: function ($cap) {
636
637		// Unsetting first argument to do not dump cap		
638		delete(arguments[0]);
639
640		var $res = this.wrap($cap + ':\t', 'Property') + this._dump(arguments, true) + this.br;
641
642		return this.wrapRoot($res);
643	} //FUNC dumpCap
644	
645}, $options); //OBJECT vDump
646
647} //FUNC CONSTRUCTOR
648
649/** //** ----= vDumpToggle	=--------------------------------------------------------------------------------------\**//** \
650*
651* 	vDumo spoiler toggle helper.
652*
653*	@param	string	$sn	- Spoiler SN.
654* 
655\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
656function vDumpToggle ($sn) {
657
658	// Getting spoiler state
659	var $state = document.getElementById('splr_' + $sn).style.display == 'none';
660	
661	if ( $state ) {
662		document.getElementById('splr_' + $sn).style.display = 'block';
663		document.getElementById('sb_' + $sn).firstChild.nodeValue = '-';
664	} else { //IF closed
665		document.getElementById('splr_' + $sn).style.display = 'none';
666		document.getElementById('sb_' + $sn).firstChild.nodeValue = '+';
667	} //IF opened
668
669} //FUNC vDumpToggle
670
671/** //** ----= __	=----------------------------------------------------------------------------------------------\**//** \
672*
673*	Dumps given variables depending on their types.
674*
675*	@param		MIXED	*	- Variables to dump.
676*
677\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
678function __() {
679	
680	var $d = vDump({'useHtml' : false, 'dumpFunctions' : false});
681
682	// Running vDump, passing own argument as dumper arguments	
683	var $res = $d.dump.apply($d, arguments);
684	
685	alert($res);
686	
687} //FUNC __
688
689/** //** ----= ___	=----------------------------------------------------------------------------------------------\**//** \
690*
691*	Shortcut to console.log()
692*
693*	@param		MIXED	*	- Variables to dump.
694*
695\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
696function ___() {
697	
698	console.log.apply(console, arguments);
699	
700	/*/
701	for ( var $i = 0, $l = arguments.length; $i < $l; $i++)
702		console.log(arguments[$i]);
703	/**/
704} //FUNC ___
705
706/** //** ----= __i	=----------------------------------------------------------------------------------------------\**//** \
707*
708*	Shortcut to console.info()
709*
710*	@param		MIXED	*	- Variables to dump.
711*
712\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
713function __i() {
714	
715	for ( var $i = 0, $l = arguments.length; $i < $l; $i++)
716		console.info(arguments[$i]);
717	
718} //FUNC __i
719
720/** //** ----= __w	=----------------------------------------------------------------------------------------------\**//** \
721*
722*	Shortcut to console.warn()
723*
724*	@param		MIXED	*	- Variables to dump.
725*
726\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
727function __w() {
728	
729	for ( var $i = 0, $l = arguments.length; $i < $l; $i++)
730		console.warn(arguments[$i]);
731	
732} //FUNC __w
733
734/** //** ----= __e	=----------------------------------------------------------------------------------------------\**//** \
735*
736*	Shortcut to console.error()
737*
738*	@param		MIXED	*	- Variables to dump.
739*
740\**//** ----------------------------------------------------------------------------------------------= by Mr.V!T =----/** //**/
741function __e() {
742	
743	for ( var $i = 0, $l = arguments.length; $i < $l; $i++)
744		console.error(arguments[$i]);
745	
746} //FUNC __e
747

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.