plugins/org.symbian.tools.tmw.previewer/preview/script/lib/console.js
author Eugene Ostroukhov <eugeneo@symbian.org>
Thu, 19 Aug 2010 17:48:04 -0700
changeset 470 d4809db37847
parent 416 org.symbian.tools.wrttools.previewer/preview/script/lib/console.js@461da1f79f43
permissions -rw-r--r--
Changed repository layout and renamed project files. This revision is untested and may not run.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     1
/**
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     2
 * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     3
 * All rights reserved.
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     4
 * This component and the accompanying materials are made available
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     6
 * which accompanies this distribution, and is available
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     8
 *
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     9
 * Initial Contributors:
273
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    10
 * Nokia Corporation - initial contribution.
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    11
 * 
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    12
 * Contributors:
273
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    13
 * 
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    14
 * Description:
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    15
 * 
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    16
 */
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    17
37
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    18
//	for console support
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    19
	window.console = {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    20
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    21
			sprintf: function(args){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    22
				if (typeof args == 'undefined') {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    23
					return null;
416
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 273
diff changeset
    24
				} else if (typeof args == 'string') {
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 273
diff changeset
    25
					return args;
37
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    26
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    27
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    28
				if (args.length < 1) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    29
					return null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    30
				};
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    31
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    32
				if (typeof args[0] != 'string') {
416
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 273
diff changeset
    33
					return this.sprintf(String(args[0]));
37
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    34
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    35
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    36
				if (typeof RegExp == 'undefined') {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    37
					return null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    38
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    39
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    40
				if (args.length == 1) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    41
					return args[0];
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    42
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    43
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    44
				
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    45
				var str = args[0];
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    46
				var newString = args[0];
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    47
				var arr = new Array();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    48
				var exp = new RegExp(/[^%](%)([a-zA-Z])/g);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    49
				var match = null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    50
				var lastMatch = 0;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    51
				var argPos = 1;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    52
				while (match = exp.exec(str) && argPos < args.length) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    53
					if (str[exp.lastIndex - 1] == "%") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    54
						
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    55
					}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    56
					else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    57
						if (str[exp.lastIndex - 1] == "d") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    58
							arr.push(str.substring(lastMatch, exp.lastIndex - 2));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    59
							arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    60
						}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    61
						else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    62
							if (str[exp.lastIndex - 1] == "i") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    63
								arr.push(str.substring(lastMatch, exp.lastIndex - 2));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    64
								arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    65
							}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    66
							else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    67
								if (str[exp.lastIndex - 1] == "f") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    68
									arr.push(str.substring(lastMatch, exp.lastIndex - 2));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    69
									arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    70
								}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    71
								else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    72
									if (str[exp.lastIndex - 1] == "s") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    73
										arr.push(str.substring(lastMatch, exp.lastIndex - 2));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    74
										arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    75
									}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    76
									else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    77
										if (str[exp.lastIndex - 1] != "%") {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    78
											arr.push(str.substring(lastMatch, exp.lastIndex - 2));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    79
											arr.push("\"");
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    80
											arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    81
											arr.push("\"");
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    82
										}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    83
					lastMatch = exp.lastIndex;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    84
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    85
				if (lastMatch < str.length) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    86
					arr.push(str.substring(lastMatch, str.length));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    87
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    88
				while (argPos < args.length) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    89
					arr.push(" ");
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    90
					arr.push(args[argPos++]);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    91
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    92
				return arr.join("").replace(/\%\%/g,"%");
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    93
			},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    94
		error: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    95
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    96
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    97
				_BRIDGE_REF.nokia.layout.log('error', errorStr);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    98
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    99
		},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   100
		info: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   101
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   102
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   103
				_BRIDGE_REF.nokia.layout.log('info', errorStr);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   104
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   105
		},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   106
		warn: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   107
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   108
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   109
				_BRIDGE_REF.nokia.layout.log('warn', errorStr);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   110
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   111
		},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   112
		log: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   113
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   114
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   115
				_BRIDGE_REF.nokia.layout.log('log', errorStr);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   116
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   117
		},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   118
		debug: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   119
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   120
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   121
				_BRIDGE_REF.nokia.layout.log('debug', errorStr);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   122
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   123
		},
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   124
		assert: function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   125
			var errorStr = console.sprintf(arguments);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   126
			if (errorStr) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   127
				//	@todo
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   128
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   129
		}
416
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 273
diff changeset
   130
	};
37
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   131
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   132
	//	enable the Console.
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   133
	_BRIDGE_REF.nokia.layout._console_enabled = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   134
	_BRIDGE_REF.nokia.layout.render();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   135
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   136
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   137
//	make TRUE console.js script loaded
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   138
window.parent.NOKIA.scriptsLoaded.console = true;