Index: trunk/extensions/VisualEditor/modules/parser/ext.core.QuoteTransformer.js |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | }; |
123 | 123 | |
124 | 124 | QuoteTransformer.prototype.onAny = function ( token, frame, prevToken ) { |
125 | | - //console.log('qt onAny: ' + JSON.stringify(token, null, 2)); |
| 125 | + //console.warn('qt onAny: ' + JSON.stringify(token, null, 2)); |
126 | 126 | this.currentChunk.push( token ); |
127 | 127 | return {}; |
128 | 128 | }; |
— | — | @@ -139,9 +139,9 @@ |
140 | 140 | |
141 | 141 | token.rank = this.quoteAndNewlineRank; |
142 | 142 | |
143 | | - //console.log('chunks: ' + JSON.stringify( this.chunks, null, 2 ) ); |
| 143 | + //console.warn('chunks: ' + JSON.stringify( this.chunks, null, 2 ) ); |
144 | 144 | |
145 | | - //console.log("onNewLine: " + this.italics.length + 'i/b' + this.bolds.length); |
| 145 | + //console.warn("onNewLine: " + this.italics.length + 'i/b' + this.bolds.length); |
146 | 146 | // balance out tokens, convert placeholders into tags |
147 | 147 | if (this.italics.length % 2 && this.bolds.length % 2) { |
148 | 148 | var firstsingleletterword = -1, |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | firstspace = -1; |
151 | 151 | for (var j = 0; j < this.bolds.length; j++) { |
152 | 152 | var ctx = this.bolds[j][0]; |
153 | | - //console.log("balancing!" + JSON.stringify(ctx.prevToken, null, 2)); |
| 153 | + //console.warn("balancing!" + JSON.stringify(ctx.prevToken, null, 2)); |
154 | 154 | if (ctx.prevToken) { |
155 | 155 | if (ctx.prevToken.constructor === String) { |
156 | 156 | var lastchar = prevToken[ctx.prevToken.length - 1], |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | this.currentChunk.push( token ); |
197 | 197 | this._startNewChunk(); |
198 | 198 | |
199 | | - //console.log('chunks: ' + JSON.stringify( this.chunks, null, 2 ) ); |
| 199 | + //console.warn('chunks: ' + JSON.stringify( this.chunks, null, 2 ) ); |
200 | 200 | |
201 | 201 | // return all collected tokens including the newline |
202 | 202 | res = { tokens: [].concat.apply([], this.chunks) }; |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | QuoteTransformer.prototype.convertBold = function ( i ) { |
216 | 216 | var chunk = this.bolds[i], |
217 | 217 | textToken = "'"; |
218 | | - //console.log('convertbold!'); |
| 218 | + //console.warn('convertbold!'); |
219 | 219 | if ( chunk.pos ) { |
220 | 220 | this.chunks[chunk.pos - 1].push( textToken ); |
221 | 221 | } else { |
— | — | @@ -237,9 +237,9 @@ |
238 | 238 | out = []; |
239 | 239 | |
240 | 240 | for (j = 0; j < chunks.length; j++) { |
241 | | - //console.log( 'quotesToTags ' + name + ': ' + JSON.stringify( chunks, null, 2 ) ); |
| 241 | + //console.warn( 'quotesToTags ' + name + ': ' + JSON.stringify( chunks, null, 2 ) ); |
242 | 242 | t = chunks[j][0].token; |
243 | | - //console.log( 'quotesToTags t: ' + JSON.stringify( t, null, 2)); |
| 243 | + //console.warn( 'quotesToTags t: ' + JSON.stringify( t, null, 2)); |
244 | 244 | |
245 | 245 | if(toggle) { |
246 | 246 | chunks[j][0] = new TagTk( name, t.attribs ); |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.HTML5TreeBuilder.node.js |
— | — | @@ -34,20 +34,20 @@ |
35 | 35 | }; |
36 | 36 | |
37 | 37 | FauxHTML5.TreeBuilder.prototype.onChunk = function ( tokens ) { |
38 | | - //console.log( 'chunk: ' + JSON.stringify( tokens, null, 2 ) ); |
| 38 | + //console.warn( 'chunk: ' + JSON.stringify( tokens, null, 2 ) ); |
39 | 39 | for (var i = 0, length = tokens.length; i < length; i++) { |
40 | 40 | this.processToken(tokens[i]); |
41 | 41 | } |
42 | 42 | }; |
43 | 43 | |
44 | 44 | FauxHTML5.TreeBuilder.prototype.onEnd = function ( ) { |
45 | | - //console.log('Fauxhtml5 onEnd'); |
| 45 | + //console.warn('Fauxhtml5 onEnd'); |
46 | 46 | // FIXME HACK: For some reason the end token is not processed sometimes, |
47 | 47 | // which normally fixes the body reference up. |
48 | 48 | var document = this.parser.document; |
49 | 49 | document.body = document.getElementsByTagName('body')[0]; |
50 | 50 | |
51 | | - //console.log( 'onEnd: ' + document.body.innerHTML ); |
| 51 | + //console.warn( 'onEnd: ' + document.body.innerHTML ); |
52 | 52 | |
53 | 53 | this.emit( 'document', document ); |
54 | 54 | |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | //this.emit('document', this.document); |
130 | 130 | break; |
131 | 131 | default: |
132 | | - console.log("Unhandled token: " + JSON.stringify(token)); |
| 132 | + console.warn("Unhandled token: " + JSON.stringify(token)); |
133 | 133 | break; |
134 | 134 | } |
135 | 135 | break; |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js |
— | — | @@ -214,12 +214,12 @@ |
215 | 215 | ts = ts.concat(tagts); |
216 | 216 | ts.sort( this._cmpTransformations ); |
217 | 217 | } |
218 | | - //console.log(JSON.stringify(ts, null, 2)); |
| 218 | + //console.warn(JSON.stringify(ts, null, 2)); |
219 | 219 | if ( ts ) { |
220 | 220 | for ( i = 0, l = ts.length; i < l; i++ ) { |
221 | 221 | transformer = ts[i]; |
222 | 222 | if ( res.token.rank && transformer.rank < res.token.rank ) { |
223 | | - //console.log( 'SKIPPING' + JSON.stringify( token, null, 2 ) + |
| 223 | + //console.warn( 'SKIPPING' + JSON.stringify( token, null, 2 ) + |
224 | 224 | // '\ntransform:\n' + JSON.stringify( transformer, null, 2 ) ); |
225 | 225 | // skip transformation, was already applied. |
226 | 226 | continue; |
— | — | @@ -360,7 +360,7 @@ |
361 | 361 | * first stage of the pipeline, and 'last' pointing to the last stage. |
362 | 362 | */ |
363 | 363 | AsyncTokenTransformManager.prototype.newChildPipeline = function ( inputType, args, title ) { |
364 | | - //console.log( 'newChildPipeline: ' + JSON.stringify( args ) ); |
| 364 | + //console.warn( 'newChildPipeline: ' + JSON.stringify( args ) ); |
365 | 365 | var pipe = this.childFactories.input( inputType, args ); |
366 | 366 | |
367 | 367 | // now set up a few things on the child AsyncTokenTransformManager. |
— | — | @@ -406,7 +406,7 @@ |
407 | 407 | // eventize: bend to event emitter callback |
408 | 408 | this.tokenCB = this._returnTokens.bind( this ); |
409 | 409 | this.prevToken = undefined; |
410 | | - //console.log( 'AsyncTokenTransformManager args ' + JSON.stringify( args ) ); |
| 410 | + //console.warn( 'AsyncTokenTransformManager args ' + JSON.stringify( args ) ); |
411 | 411 | if ( ! args ) { |
412 | 412 | this.args = {}; // no arguments at the top level |
413 | 413 | } else { |
— | — | @@ -470,7 +470,7 @@ |
471 | 471 | */ |
472 | 472 | AsyncTokenTransformManager.prototype.transformTokens = function ( tokens, parentCB ) { |
473 | 473 | |
474 | | - //console.log('AsyncTokenTransformManager.transformTokens: ' + JSON.stringify(tokens) ); |
| 474 | + //console.warn('AsyncTokenTransformManager.transformTokens: ' + JSON.stringify(tokens) ); |
475 | 475 | |
476 | 476 | var res, |
477 | 477 | phaseEndRank = 2, // XXX: parametrize! |
— | — | @@ -538,7 +538,7 @@ |
539 | 539 | i--; |
540 | 540 | } |
541 | 541 | } else if ( res.async ) { |
542 | | - //console.log( 'tokens returned' ); |
| 542 | + //console.warn( 'tokens returned' ); |
543 | 543 | // The child now switched to activeAccum, we have to create a new |
544 | 544 | // accumulator for the next potential child. |
545 | 545 | activeAccum = accum; |
— | — | @@ -577,7 +577,7 @@ |
578 | 578 | this.emit( 'chunk', tokens ); |
579 | 579 | |
580 | 580 | if ( ! notYetDone ) { |
581 | | - //console.log('AsyncTokenTransformManager._returnTokens done. tokens:' + |
| 581 | + //console.warn('AsyncTokenTransformManager._returnTokens done. tokens:' + |
582 | 582 | // JSON.stringify( tokens, null, 2 ) + ', listeners: ' + |
583 | 583 | // JSON.stringify( this.listeners( 'chunk' ), null, 2 ) ); |
584 | 584 | // signal our done-ness to consumers. |
— | — | @@ -758,7 +758,7 @@ |
759 | 759 | //this.pipe.process( |
760 | 760 | var pipe, |
761 | 761 | ref; |
762 | | - //console.log( 'AttributeTransformManager.process: ' + JSON.stringify( attributes ) ); |
| 762 | + //console.warn( 'AttributeTransformManager.process: ' + JSON.stringify( attributes ) ); |
763 | 763 | |
764 | 764 | // transform each argument (key and value), and handle asynchronous returns |
765 | 765 | for ( var i = 0, l = attributes.length; i < l; i++ ) { |
— | — | @@ -767,7 +767,7 @@ |
768 | 768 | var cur = attributes[i]; |
769 | 769 | |
770 | 770 | if ( ! cur ) { |
771 | | - console.log( JSON.stringify( attributes ) ); |
| 771 | + console.warn( JSON.stringify( attributes ) ); |
772 | 772 | console.trace(); |
773 | 773 | continue; |
774 | 774 | } |
— | — | @@ -801,7 +801,7 @@ |
802 | 802 | pipe.addListener( 'end', |
803 | 803 | this.onEnd.bind( this, this._returnAttributeValue.bind( this, i ) ) |
804 | 804 | ); |
805 | | - //console.log('starting attribute transform of ' + JSON.stringify( attributes[i].v ) ); |
| 805 | + //console.warn('starting attribute transform of ' + JSON.stringify( attributes[i].v ) ); |
806 | 806 | pipe.process( cur.v.concat([{type:'END'}]) ); |
807 | 807 | } else { |
808 | 808 | kv.value = cur.v; |
— | — | @@ -855,7 +855,7 @@ |
856 | 856 | * Callback for async argument value expansions |
857 | 857 | */ |
858 | 858 | AttributeTransformManager.prototype._returnAttributeValue = function ( ref, tokens, notYetDone ) { |
859 | | - //console.log( 'check _returnAttributeValue: ' + JSON.stringify( tokens ) + |
| 859 | + //console.warn( 'check _returnAttributeValue: ' + JSON.stringify( tokens ) + |
860 | 860 | // ' notYetDone:' + notYetDone ); |
861 | 861 | this.kvs[ref].value = this.kvs[ref].value.concat( tokens ); |
862 | 862 | if ( ! notYetDone ) { |
— | — | @@ -871,7 +871,7 @@ |
872 | 872 | * Callback for async argument key expansions |
873 | 873 | */ |
874 | 874 | AttributeTransformManager.prototype._returnAttributeKey = function ( ref, tokens, notYetDone ) { |
875 | | - //console.log( 'check _returnAttributeKey: ' + JSON.stringify( tokens ) + |
| 875 | + //console.warn( 'check _returnAttributeKey: ' + JSON.stringify( tokens ) + |
876 | 876 | // ' notYetDone:' + notYetDone ); |
877 | 877 | this.kvs[ref].key = this.kvs[ref].key.concat( tokens ); |
878 | 878 | if ( ! notYetDone ) { |
— | — | @@ -932,7 +932,7 @@ |
933 | 933 | this.outstanding--; |
934 | 934 | } |
935 | 935 | |
936 | | - //console.log( 'TokenAccumulator._returnTokens' ); |
| 936 | + //console.warn( 'TokenAccumulator._returnTokens' ); |
937 | 937 | if ( reference === 'child' ) { |
938 | 938 | tokens = tokens.concat( this.accum ); |
939 | 939 | this.manager.env.dp('TokenAccumulator._returnTokens child: ' + |
— | — | @@ -979,7 +979,7 @@ |
980 | 980 | * Mark the sibling as done (normally at the tail of a chain). |
981 | 981 | */ |
982 | 982 | TokenAccumulator.prototype.siblingDone = function () { |
983 | | - //console.log( 'TokenAccumulator.siblingDone: ' ); |
| 983 | + //console.warn( 'TokenAccumulator.siblingDone: ' ); |
984 | 984 | this._returnTokens ( 'sibling', [], false ); |
985 | 985 | }; |
986 | 986 | |
— | — | @@ -1035,12 +1035,12 @@ |
1036 | 1036 | // XXX: set limit really low for testing! |
1037 | 1037 | if ( this.depth > maxDepth ) { |
1038 | 1038 | // too deep |
1039 | | - //console.log( 'Loopcheck: ' + JSON.stringify( this, null, 2 ) ); |
| 1039 | + //console.warn( 'Loopcheck: ' + JSON.stringify( this, null, 2 ) ); |
1040 | 1040 | return 'Error: Expansion depth limit exceeded at '; |
1041 | 1041 | } |
1042 | 1042 | var elem = this; |
1043 | 1043 | do { |
1044 | | - //console.log( 'loop check: ' + title + ' vs ' + elem.title ); |
| 1044 | + //console.warn( 'loop check: ' + title + ' vs ' + elem.title ); |
1045 | 1045 | if ( elem.title === title ) { |
1046 | 1046 | // Loop detected |
1047 | 1047 | return 'Error: Expansion loop detected at '; |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.DOMConverter.js |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | type: 'blockquote' |
127 | 127 | }; |
128 | 128 | default: |
129 | | - console.log( 'HTML to Wiki DOM conversion warning: Unknown node name ' + |
| 129 | + console.warn( 'HTML to Wiki DOM conversion warning: Unknown node name ' + |
130 | 130 | nodeName ); |
131 | 131 | return { |
132 | 132 | handler: this._convertHTMLBranch, |
— | — | @@ -168,7 +168,7 @@ |
169 | 169 | return 'object/includeonly'; // XXX |
170 | 170 | default: |
171 | 171 | if ( warn ) { |
172 | | - console.log( 'HTML to Wiki DOM conversion warning: Unsupported html annotation ' + name ); |
| 172 | + console.warn( 'HTML to Wiki DOM conversion warning: Unsupported html annotation ' + name ); |
173 | 173 | } |
174 | 174 | return undefined; |
175 | 175 | } |
— | — | @@ -217,10 +217,10 @@ |
218 | 218 | newPara(); |
219 | 219 | } |
220 | 220 | res = this._convertHTMLAnnotation( cnode, offset, annotationtype ); |
221 | | - //console.log( 'res leaf: ' + JSON.stringify(res, null, 2)); |
| 221 | + //console.warn( 'res leaf: ' + JSON.stringify(res, null, 2)); |
222 | 222 | offset += res.text.length; |
223 | 223 | parNode.content.text += res.text; |
224 | | - //console.log( 'res annotations: ' + JSON.stringify(res, null, 2)); |
| 224 | + //console.warn( 'res annotations: ' + JSON.stringify(res, null, 2)); |
225 | 225 | parNode.content.annotations = parNode.content.annotations |
226 | 226 | .concat( res.annotations ); |
227 | 227 | } else { |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | // add a comment node. |
249 | 249 | break; |
250 | 250 | default: |
251 | | - console.log( "HTML to Wiki DOM conversion error. Unhandled node " + |
| 251 | + console.warn( "HTML to Wiki DOM conversion error. Unhandled node " + |
252 | 252 | cnode.innerHTML ); |
253 | 253 | break; |
254 | 254 | } |
— | — | @@ -277,7 +277,7 @@ |
278 | 278 | annotations: [] |
279 | 279 | } |
280 | 280 | }; |
281 | | - //console.log( 'res wnode: ' + JSON.stringify(wnode, null, 2)); |
| 281 | + //console.warn( 'res wnode: ' + JSON.stringify(wnode, null, 2)); |
282 | 282 | for ( var i = 0, l = children.length; i < l; i++ ) { |
283 | 283 | var cnode = children[i]; |
284 | 284 | switch ( cnode.nodeType ) { |
— | — | @@ -286,10 +286,10 @@ |
287 | 287 | var annotationtype = this._getWikiDomAnnotationType( cnode, true ); |
288 | 288 | if ( annotationtype ) { |
289 | 289 | var res = this._convertHTMLAnnotation( cnode, offset, annotationtype ); |
290 | | - //console.log( 'res leaf: ' + JSON.stringify(res, null, 2)); |
| 290 | + //console.warn( 'res leaf: ' + JSON.stringify(res, null, 2)); |
291 | 291 | offset += res.text.length; |
292 | 292 | wnode.content.text += res.text; |
293 | | - //console.log( 'res annotations: ' + JSON.stringify(res, null, 2)); |
| 293 | + //console.warn( 'res annotations: ' + JSON.stringify(res, null, 2)); |
294 | 294 | wnode.content.annotations = wnode.content.annotations |
295 | 295 | .concat( res.annotations ); |
296 | 296 | } |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | // add a comment annotation? |
305 | 305 | break; |
306 | 306 | default: |
307 | | - console.log( "HTML to Wiki DOM conversion error. Unhandled node " + |
| 307 | + console.warn( "HTML to Wiki DOM conversion error. Unhandled node " + |
308 | 308 | cnode.innerHTML ); |
309 | 309 | break; |
310 | 310 | } |
— | — | @@ -344,7 +344,7 @@ |
345 | 345 | var annotationtype = this._getWikiDomAnnotationType(cnode, true); |
346 | 346 | if ( annotationtype ) { |
347 | 347 | var res = this._convertHTMLAnnotation( cnode, offset, annotationtype ); |
348 | | - //console.log( 'res annotations 2: ' + JSON.stringify(res, null, 2)); |
| 348 | + //console.warn( 'res annotations 2: ' + JSON.stringify(res, null, 2)); |
349 | 349 | text += res.text; |
350 | 350 | offset += res.text.length; |
351 | 351 | annotations = annotations.concat( res.annotations ); |
— | — | @@ -359,7 +359,7 @@ |
360 | 360 | // add a comment annotation? |
361 | 361 | break; |
362 | 362 | default: |
363 | | - console.log( "HTML to Wiki DOM conversion error. Unhandled node " + |
| 363 | + console.warn( "HTML to Wiki DOM conversion error. Unhandled node " + |
364 | 364 | cnode.innerHTML ); |
365 | 365 | break; |
366 | 366 | } |
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | return this['pf_#time']( 'm', [], {} ); |
109 | 109 | }; |
110 | 110 | ParserFunctions.prototype['pf_currentmonthname'] = function ( target, argList, argDict ) { |
111 | | - return this['pf_#time']( 'J', [], {} ); |
| 111 | + return this['pf_#time']( 'F', [], {} ); |
112 | 112 | }; |
113 | 113 | ParserFunctions.prototype['pf_currentmonthabbrev'] = function ( target, argList, argDict ) { |
114 | 114 | return this['pf_#time']( 'M', [], {} ); |
— | — | @@ -299,7 +299,7 @@ |
300 | 300 | this.manager.env.normalizeTitle( target ) + '&' + |
301 | 301 | argList.map( |
302 | 302 | function( kv ) { |
303 | | - //console.log( JSON.stringify( kv ) ); |
| 303 | + //console.warn( JSON.stringify( kv ) ); |
304 | 304 | return (kv.v !== '' && kv.k + '=' + kv.v ) || kv.k; |
305 | 305 | } |
306 | 306 | ).join('&') |
Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | /* Fixme: use static functions to separate module! Unfortunately, this |
13 | 13 | * does not work: |
14 | 14 | * var tu = require('./mediawiki.tokenizer.utils.js'); |
15 | | - * console.log(tu.flatten([])); |
| 15 | + * console.warn(tu.flatten([])); |
16 | 16 | * Using exports in the module gets a bit further, but accesses to |
17 | 17 | * tu.flatten in productions still fail. Thus, I just moved the functions |
18 | 18 | * here until a solution is found: |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | // Debug print with global switch |
84 | 84 | var dp = function ( msg ) { |
85 | 85 | if ( false ) { |
86 | | - console.log(msg); |
| 86 | + console.warn(msg); |
87 | 87 | } |
88 | 88 | }; |
89 | 89 | |
— | — | @@ -293,13 +293,13 @@ |
294 | 294 | // end is passed inline as a token, as well as a separate event for now. |
295 | 295 | |
296 | 296 | // this does not work yet. |
297 | | - //console.log('about to emit' + pp(self)); |
| 297 | + //console.warn('about to emit' + pp(self)); |
298 | 298 | //self._tokenizer.emit('chunk', [ { type: 'END' } ] ); |
299 | 299 | //self._tokenizer.emit('end'); |
300 | 300 | // Append the end (for obvious reasons this should not |
301 | 301 | // be part of a stream, only when tokenizing complete |
302 | 302 | // texts) |
303 | | - //console.log( pp( flatten ( e ) ) ); |
| 303 | + //console.warn( pp( flatten ( e ) ) ); |
304 | 304 | cache = {}; |
305 | 305 | __parseArgs[2]( [ new EOFTk( ) ] ); |
306 | 306 | return []; //flatten(e); |
— | — | @@ -476,7 +476,7 @@ |
477 | 477 | = r:( ts:(!inline_breaks t:[^=<>{\n\r&'"\t ] {return t})+ { return ts.join(''); } |
478 | 478 | / directive |
479 | 479 | / !inline_breaks [&%] )* { |
480 | | - //console.log('prep'); |
| 480 | + //console.warn('prep'); |
481 | 481 | return flatten_string ( r ); |
482 | 482 | } |
483 | 483 | attribute_preprocessor_text_single |
— | — | @@ -489,7 +489,7 @@ |
490 | 490 | = r:( t:[^{&"]+ { return t.join(''); } |
491 | 491 | / directive |
492 | 492 | / !inline_breaks [{&] )* { |
493 | | - //console.log( 'double:' + pp(r) ); |
| 493 | + //console.warn( 'double:' + pp(r) ); |
494 | 494 | return flatten_string ( r ); |
495 | 495 | } |
496 | 496 | |
— | — | @@ -510,7 +510,7 @@ |
511 | 511 | bs.dataAttribs = {}; |
512 | 512 | } |
513 | 513 | bs.dataAttribs.sourcePos = [blockStart, pos]; |
514 | | - //console.log( 'toplevelblock: ' + pp( bs )); |
| 514 | + //console.warn( 'toplevelblock: ' + pp( bs )); |
515 | 515 | } |
516 | 516 | |
517 | 517 | // Emit tokens for this toplevelblock. This feeds a chunk to the parser |
— | — | @@ -594,11 +594,11 @@ |
595 | 595 | / & { return syntaxFlags['linkdesc']; } link_end { return true; } |
596 | 596 | / & { return syntaxFlags['h']; } '='+ space* newline { return true; } |
597 | 597 | / & { return syntaxFlags['template']; } ('|' / '}}' ) { |
598 | | - //console.log( 'template break @' + pos + input.substr(pos-1, 4) ); |
| 598 | + //console.warn( 'template break @' + pos + input.substr(pos-1, 4) ); |
599 | 599 | return true; |
600 | 600 | } |
601 | 601 | / & { return syntaxFlags['equal']; } '=' { |
602 | | - //console.log( 'equal stop @' + pos + input.substr(pos-1, 4) ); |
| 602 | + //console.warn( 'equal stop @' + pos + input.substr(pos-1, 4) ); |
603 | 603 | return true; |
604 | 604 | } |
605 | 605 | |
— | — | @@ -624,7 +624,7 @@ |
625 | 625 | if (text.length) { |
626 | 626 | out.push( text.join('') ); |
627 | 627 | } |
628 | | - //console.log('inline out:' + pp(out)); |
| 628 | + //console.warn('inline out:' + pp(out)); |
629 | 629 | return out; |
630 | 630 | } |
631 | 631 | |
— | — | @@ -760,7 +760,7 @@ |
761 | 761 | ] ), |
762 | 762 | ].concat( text |
763 | 763 | , [ new EndTagTk( 'a' )]); |
764 | | - //console.log( JSON.stringify( res, null, 2 ) ); |
| 764 | + //console.warn( JSON.stringify( res, null, 2 ) ); |
765 | 765 | return res; |
766 | 766 | } |
767 | 767 | / "[" & { clearFlag('extlink'); return false; } |
— | — | @@ -838,7 +838,7 @@ |
839 | 839 | // again. |
840 | 840 | params.unshift( { k: '', v: flatten( target ) } ); |
841 | 841 | var obj = new SelfclosingTagTk( 'template', params ); |
842 | | - //console.log( 'tokenizer template ' + JSON.stringify( target )); |
| 842 | + //console.warn( 'tokenizer template ' + JSON.stringify( target )); |
843 | 843 | return obj; |
844 | 844 | } |
845 | 845 | |
— | — | @@ -854,16 +854,16 @@ |
855 | 855 | name = flatten( name ); |
856 | 856 | params.unshift( { k: '', v: name } ); |
857 | 857 | var obj = new SelfclosingTagTk( 'templatearg', params ); |
858 | | - //console.log( 'tokenizer tplarg ' + JSON.stringify( obj, null, 2 )); |
| 858 | + //console.warn( 'tokenizer tplarg ' + JSON.stringify( obj, null, 2 )); |
859 | 859 | return obj; |
860 | 860 | } |
861 | 861 | |
862 | 862 | template_param |
863 | 863 | = name:template_param_name space* |
864 | 864 | value:( s0:"=" s1:space* |
865 | | - //& { console.log( 'entering value' ); return true } |
| 865 | + //& { console.warn( 'entering value' ); return true } |
866 | 866 | s2:template_param_text { return [s0, s1, s2] } )? { |
867 | | - //console.log( 'named template_param matched' + pp([name, value ]) ); |
| 867 | + //console.warn( 'named template_param matched' + pp([name, value ]) ); |
868 | 868 | if ( value !== '' ) { |
869 | 869 | return new KV(name, flatten( value[2] ) || []); |
870 | 870 | } else { |
— | — | @@ -880,7 +880,7 @@ |
881 | 881 | tpt:template_param_text |
882 | 882 | { |
883 | 883 | clearFlag( 'equal' ); |
884 | | - //console.log( 'template param name matched: ' + pp( tpt ) ); |
| 884 | + //console.warn( 'template param name matched: ' + pp( tpt ) ); |
885 | 885 | return tpt; |
886 | 886 | } |
887 | 887 | |
— | — | @@ -891,7 +891,7 @@ |
892 | 892 | = & { return setFlag('template') } |
893 | 893 | il:inline { |
894 | 894 | clearFlag('template'); |
895 | | - //console.log( 'tpt match: ' + pp (il)); |
| 895 | + //console.warn( 'tpt match: ' + pp (il)); |
896 | 896 | return il; |
897 | 897 | } |
898 | 898 | / & { return clearFlag('template'); } |
— | — | @@ -927,7 +927,7 @@ |
928 | 928 | textTokens = $.extend(true, [], target); |
929 | 929 | } |
930 | 930 | } |
931 | | - //console.log( "XXX:" + pp([obj].concat(textTokens, [new EndTagTk( 'a' )])) ); |
| 931 | + //console.warn( "XXX:" + pp([obj].concat(textTokens, [new EndTagTk( 'a' )])) ); |
932 | 932 | return [obj].concat(textTokens, [new EndTagTk( 'a' )]); |
933 | 933 | } |
934 | 934 | |
— | — | @@ -948,7 +948,7 @@ |
949 | 949 | // '=' here. |
950 | 950 | hs:( '=' inline)? |
951 | 951 | { |
952 | | - //console.log('link_text' + pp(h) + pp(hs)); |
| 952 | + console.warn('link_text' + pp(h) + pp(hs)); |
953 | 953 | clearFlag('linkdesc'); |
954 | 954 | if( hs !== '' ) { |
955 | 955 | return h.concat(hs); |
— | — | @@ -993,7 +993,7 @@ |
994 | 994 | / !"</pre>" t2:. { return t2 })+ |
995 | 995 | ("</pre>" / eof) { |
996 | 996 | // return nowiki tags as well? |
997 | | - //console.log('inpre'); |
| 997 | + //console.warn('inpre'); |
998 | 998 | return [ new TagTk( 'pre', attribs ) ] |
999 | 999 | .concat(ts, [ new EndTagTk( 'pre' ) ]); |
1000 | 1000 | } |
— | — | @@ -1001,31 +1001,31 @@ |
1002 | 1002 | |
1003 | 1003 | nowiki |
1004 | 1004 | = "<nowiki>" nc:nowiki_content "</nowiki>" { |
1005 | | - //console.log( 'full nowiki return: ' + pp(nc)); |
| 1005 | + //console.warn( 'full nowiki return: ' + pp(nc)); |
1006 | 1006 | return nc; |
1007 | 1007 | } |
1008 | 1008 | / "<nowiki>" { |
1009 | | - //console.log('nowiki fallback'); |
| 1009 | + //console.warn('nowiki fallback'); |
1010 | 1010 | return ['<nowiki>']; |
1011 | 1011 | } |
1012 | 1012 | / "</nowiki>" { |
1013 | | - //console.log('nowiki end fallback'); |
| 1013 | + //console.warn('nowiki end fallback'); |
1014 | 1014 | return ['</nowiki>']; |
1015 | 1015 | } |
1016 | 1016 | |
1017 | 1017 | nowiki_content |
1018 | 1018 | = ts:( t:[^<]+ { return t.join('') } |
1019 | 1019 | / "<pre" p0:space* p1:[^>]* ">" p2:nowiki_content "</pre>" { |
1020 | | - //console.log('nested pre in nowiki'); |
| 1020 | + //console.warn('nested pre in nowiki'); |
1021 | 1021 | return ["<pre"].concat(p0, p1, [">"], p2, ["</pre>"]).join(''); |
1022 | 1022 | } |
1023 | 1023 | / (!("</"( "nowiki>" / "pre>")) c:. { |
1024 | | - //console.log('nowiki: single char' + c); |
| 1024 | + //console.warn('nowiki: single char' + c); |
1025 | 1025 | return c; |
1026 | 1026 | }) |
1027 | 1027 | )* { |
1028 | 1028 | // return nowiki tags as well? |
1029 | | - //console.log('nowiki_content: return' + pp(ts)); |
| 1029 | + //console.warn('nowiki_content: return' + pp(ts)); |
1030 | 1030 | return [ts.join('')]; |
1031 | 1031 | } |
1032 | 1032 | |
— | — | @@ -1211,7 +1211,7 @@ |
1212 | 1212 | tl:table_line |
1213 | 1213 | tls:( s:sol tl2:table_line { return s.concat(tl2); } )* { |
1214 | 1214 | clearFlag('table'); |
1215 | | - //console.log('table_lines: ' + pp(tl.concat(tls))); |
| 1215 | + //console.warn('table_lines: ' + pp(tl.concat(tls))); |
1216 | 1216 | return tl.concat( tls ); |
1217 | 1217 | } |
1218 | 1218 | / & { return clearFlag('table'); } |
— | — | @@ -1248,7 +1248,7 @@ |
1249 | 1249 | |
1250 | 1250 | |
1251 | 1251 | table_row_tag |
1252 | | - = //& { console.log("table row enter"); return true; } |
| 1252 | + = //& { console.warn("table row enter"); return true; } |
1253 | 1253 | "|-" |
1254 | 1254 | a:generic_attribute* |
1255 | 1255 | space* |
— | — | @@ -1277,7 +1277,7 @@ |
1278 | 1278 | = //& { dp("table_data enter, pos=" + pos + input.substr(pos,10)); return true; } |
1279 | 1279 | ! [}+-] |
1280 | 1280 | a:table_cell_args? |
1281 | | - //& { console.log("past attrib, pos=" + pos + input.substr(pos,10)); return true; } |
| 1281 | + //& { console.warn("past attrib, pos=" + pos + input.substr(pos,10)); return true; } |
1282 | 1282 | // use inline_breaks to break on tr etc |
1283 | 1283 | td:( !inline_breaks |
1284 | 1284 | //& { dp("table_data 2, pos=" + pos + input.substr(pos,10)); return true; } |
Index: trunk/extensions/VisualEditor/modules/parser/ext.Cite.js |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | // fall through for further processing! |
136 | 136 | } else { |
137 | 137 | // Inside ref block: Collect all other tokens in refTokens and abort |
138 | | - //console.log(JSON.stringify(tokenCTX.token, null, 2)); |
| 138 | + //console.warn(JSON.stringify(tokenCTX.token, null, 2)); |
139 | 139 | this.refTokens.push(tokenCTX.token); |
140 | 140 | tokenCTX.token = null; |
141 | 141 | return tokenCTX; |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | |
206 | 206 | var arrow = '↑'; |
207 | 207 | var renderLine = function( ref ) { |
208 | | - //console.log('reftokens: ' + JSON.stringify(ref.tokens, null, 2)); |
| 208 | + //console.warn('reftokens: ' + JSON.stringify(ref.tokens, null, 2)); |
209 | 209 | var out = [{ |
210 | 210 | type: 'TAG', |
211 | 211 | name: 'li', |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.tokenizer.peg.js |
— | — | @@ -31,10 +31,10 @@ |
32 | 32 | if ( !this.parser ) { |
33 | 33 | // Only create a single parser, as parse() is a static method. |
34 | 34 | var parserSource = PEG.buildParser(this.src).toSource(); |
35 | | - //console.log( parserSource ); |
| 35 | + //console.warn( parserSource ); |
36 | 36 | parserSource = parserSource.replace( 'parse: function(input, startRule) {', |
37 | 37 | 'parse: function(input, startRule) { var __parseArgs = arguments;' ); |
38 | | - //console.log( parserSource ); |
| 38 | + //console.warn( parserSource ); |
39 | 39 | PegTokenizer.prototype.parser = eval( parserSource ); |
40 | 40 | // add reference to this for event emission |
41 | 41 | // XXX: pass a cb into parse() instead, but need to modify pegjs a bit |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | //PegTokenizer.prototype.parser._tokenizer = undefined; |
44 | 44 | |
45 | 45 | // Print the generated parser source |
46 | | - //console.log(this.parser.toSource()); |
| 46 | + //console.warn(this.parser.toSource()); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // some normalization |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.DOMPostProcessor.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | for(var i = 0, length = cnodes.length; i < length; i++) { |
30 | 30 | var child = cnodes[i - deleted], |
31 | 31 | ctype = child.nodeType; |
32 | | - //console.log(child + ctype); |
| 32 | + //console.warn(child + ctype); |
33 | 33 | if ((ctype === 3 && (inParagraph || !isElementContentWhitespace( child ))) || |
34 | 34 | (ctype === Node.COMMENT_NODE && inParagraph ) || |
35 | 35 | (ctype !== Node.TEXT_NODE && |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | this.treeBuilder = new FauxHTML5.TreeBuilder(); |
92 | 92 | this.treeBuilder.listenForTokensFrom( this.tokenPostProcessor ); |
93 | 93 | //this.tokenPostProcessor.on('chunk', function( c ) { |
94 | | - // console.log( JSON.stringify( c, null, 2 )); |
| 94 | + // console.warn( JSON.stringify( c, null, 2 )); |
95 | 95 | //} ); |
96 | 96 | |
97 | 97 | /** |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | ParserPipeline.prototype.makeInputPipeline = function ( inputType, args, isNoInclude ) { |
147 | 147 | switch ( inputType ) { |
148 | 148 | case 'text/wiki': |
149 | | - //console.log( 'makeInputPipeline ' + JSON.stringify( args ) ); |
| 149 | + //console.warn( 'makeInputPipeline ' + JSON.stringify( args ) ); |
150 | 150 | if ( this.pipelineCache['text/wiki'].input.length ) { |
151 | 151 | var pipe = this.pipelineCache['text/wiki'].input.pop(); |
152 | 152 | pipe.last.args = args; |
— | — | @@ -309,7 +309,7 @@ |
310 | 310 | * Feed input tokens to the first pipeline stage |
311 | 311 | */ |
312 | 312 | CachedTokenPipeline.prototype.process = function ( chunk ) { |
313 | | - //console.log( 'CachedTokenPipeline::process: ' + chunk ); |
| 313 | + //console.warn( 'CachedTokenPipeline::process: ' + chunk ); |
314 | 314 | this.first.process( chunk ); |
315 | 315 | }; |
316 | 316 | |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | * Forward chunks to our listeners |
320 | 320 | */ |
321 | 321 | CachedTokenPipeline.prototype.forwardChunk = function ( chunk ) { |
322 | | - //console.log( 'CachedTokenPipeline.forwardChunk: ' + |
| 322 | + //console.warn( 'CachedTokenPipeline.forwardChunk: ' + |
323 | 323 | // JSON.stringify( chunk, null, 2 ) |
324 | 324 | // ); |
325 | 325 | |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | * the given pipeline stage and returns it to a cache. |
333 | 333 | */ |
334 | 334 | CachedTokenPipeline.prototype.forwardEndAndRecycleSelf = function ( ) { |
335 | | - //console.log( 'CachedTokenPipeline.forwardEndAndRecycleSelf: ' + |
| 335 | + //console.warn( 'CachedTokenPipeline.forwardEndAndRecycleSelf: ' + |
336 | 336 | // JSON.stringify( this.listeners( 'chunk' ), null, 2 ) ); |
337 | 337 | // first, forward the event |
338 | 338 | this.emit( 'end' ); |
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.TemplateHandler.js |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | * processes the template. |
56 | 56 | */ |
57 | 57 | TemplateHandler.prototype.onTemplate = function ( token, frame, cb ) { |
58 | | - //console.log('onTemplate! ' + JSON.stringify( token, null, 2 ) + |
| 58 | + //console.warn('onTemplate! ' + JSON.stringify( token, null, 2 ) + |
59 | 59 | // ' args: ' + JSON.stringify( this.manager.args )); |
60 | 60 | |
61 | 61 | |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | * target were expanded. |
145 | 145 | */ |
146 | 146 | TemplateHandler.prototype._expandTemplate = function ( tplExpandData ) { |
147 | | - //console.log('TemplateHandler.expandTemplate: ' + |
| 147 | + //console.warn('TemplateHandler.expandTemplate: ' + |
148 | 148 | // JSON.stringify( tplExpandData, null, 2 ) ); |
149 | 149 | var res; |
150 | 150 | |
— | — | @@ -293,7 +293,7 @@ |
294 | 294 | // Could also encapsulate the template tokens here, if that turns out |
295 | 295 | // better for the editor. |
296 | 296 | |
297 | | - //console.log( 'TemplateHandler._onEnd: ' + JSON.stringify( res, null, 2 ) ); |
| 297 | + //console.warn( 'TemplateHandler._onEnd: ' + JSON.stringify( res, null, 2 ) ); |
298 | 298 | |
299 | 299 | if ( tplExpandData.overallAsync ) { |
300 | 300 | this.manager.env.dp( 'TemplateHandler._onEnd: calling back with res:' + |
— | — | @@ -371,11 +371,11 @@ |
372 | 372 | |
373 | 373 | if ( token.resultTokens !== false ) { |
374 | 374 | // synchronous return |
375 | | - //console.log( 'synchronous attribute expand: ' + JSON.stringify( token.resultTokens ) ); |
| 375 | + //console.warn( 'synchronous attribute expand: ' + JSON.stringify( token.resultTokens ) ); |
376 | 376 | |
377 | 377 | return { tokens: token.resultTokens }; |
378 | 378 | } else { |
379 | | - //console.log( 'asynchronous attribute expand: ' + JSON.stringify( token, null, 2 ) ); |
| 379 | + //console.warn( 'asynchronous attribute expand: ' + JSON.stringify( token, null, 2 ) ); |
380 | 380 | // asynchronous return |
381 | 381 | token.resultTokens = []; |
382 | 382 | return { async: true }; |
— | — | @@ -383,12 +383,12 @@ |
384 | 384 | }; |
385 | 385 | |
386 | 386 | TemplateHandler.prototype._returnArgAttributes = function ( token, cb, frame, attributes ) { |
387 | | - //console.log( '_returnArgAttributes: ' + JSON.stringify( attributes )); |
| 387 | + //console.warn( '_returnArgAttributes: ' + JSON.stringify( attributes )); |
388 | 388 | var argName = this.manager.env.tokensToString( attributes[0].v ).trim(), |
389 | 389 | res; |
390 | 390 | if ( argName in this.manager.args ) { |
391 | 391 | // return tokens for argument |
392 | | - //console.log( 'templateArg found: ' + argName + |
| 392 | + //console.warn( 'templateArg found: ' + argName + |
393 | 393 | // ' vs. ' + JSON.stringify( this.manager.args ) ); |
394 | 394 | res = this.manager.args[argName]; |
395 | 395 | } else { |
— | — | @@ -437,7 +437,7 @@ |
438 | 438 | } |
439 | 439 | }, |
440 | 440 | function (error, response, body) { |
441 | | - //console.log( 'response for ' + title + ' :' + body + ':' ); |
| 441 | + //console.warn( 'response for ' + title + ' :' + body + ':' ); |
442 | 442 | if(error) { |
443 | 443 | manager.env.dp(error); |
444 | 444 | self.emit('src', 'Page/template fetch failure for title ' + title, title); |
— | — | @@ -446,14 +446,14 @@ |
447 | 447 | data, |
448 | 448 | normalizedTitle; |
449 | 449 | try { |
450 | | - //console.log( 'body: ' + body ); |
| 450 | + //console.warn( 'body: ' + body ); |
451 | 451 | data = JSON.parse( body ); |
452 | 452 | } catch(e) { |
453 | | - console.log( "Error: while parsing result. Error was: " ); |
454 | | - console.log( e ); |
455 | | - console.log( "Response that didn't parse was:"); |
456 | | - console.log( "------------------------------------------\n" + body ); |
457 | | - console.log( "------------------------------------------" ); |
| 453 | + console.warn( "Error: while parsing result. Error was: " ); |
| 454 | + console.warn( e ); |
| 455 | + console.warn( "Response that didn't parse was:"); |
| 456 | + console.warn( "------------------------------------------\n" + body ); |
| 457 | + console.warn( "------------------------------------------" ); |
458 | 458 | } |
459 | 459 | try { |
460 | 460 | $.each( data.query.pages, function(i, page) { |
— | — | @@ -463,10 +463,10 @@ |
464 | 464 | } |
465 | 465 | }); |
466 | 466 | } catch ( e2 ) { |
467 | | - console.log( 'Did not find page revisions in the returned body:' + body ); |
| 467 | + console.warn( 'Did not find page revisions in the returned body:' + body ); |
468 | 468 | src = ''; |
469 | 469 | } |
470 | | - //console.log( 'Page ' + title + ': got ' + src ); |
| 470 | + //console.warn( 'Page ' + title + ': got ' + src ); |
471 | 471 | manager.env.tp( 'Retrieved ' + title ); |
472 | 472 | manager.env.pageCache[title] = src; |
473 | 473 | self.emit( 'src', src, title ); |
— | — | @@ -493,7 +493,7 @@ |
494 | 494 | titles: title |
495 | 495 | }, |
496 | 496 | success: function(data, statusString, xhr) { |
497 | | - console.log( 'Page ' + title + ' success ' + JSON.stringify( data ) ); |
| 497 | + console.warn( 'Page ' + title + ' success ' + JSON.stringify( data ) ); |
498 | 498 | var src = null, title = null; |
499 | 499 | $.each(data.query.pages, function(i, page) { |
500 | 500 | if (page.revisions && page.revisions.length) { |
— | — | @@ -502,17 +502,17 @@ |
503 | 503 | } |
504 | 504 | }); |
505 | 505 | if (typeof src !== 'string') { |
506 | | - console.log( 'Page ' + title + 'not found! Got ' + src ); |
| 506 | + console.warn( 'Page ' + title + 'not found! Got ' + src ); |
507 | 507 | callback( 'Page ' + title + ' not found' ); |
508 | 508 | } else { |
509 | 509 | // Add to cache |
510 | | - console.log( 'Page ' + title + ': got ' + src ); |
| 510 | + console.warn( 'Page ' + title + ': got ' + src ); |
511 | 511 | this.manager.env.pageCache[title] = src; |
512 | 512 | callback(src, title); |
513 | 513 | } |
514 | 514 | }, |
515 | 515 | error: function(xhr, msg, err) { |
516 | | - console.log( 'Page/template fetch failure for title ' + |
| 516 | + console.warn( 'Page/template fetch failure for title ' + |
517 | 517 | title + ', url=' + url + JSON.stringify(xhr) + ', err=' + err ); |
518 | 518 | callback('Page/template fetch failure for title ' + title); |
519 | 519 | }, |
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.PostExpandParagraphHandler.js |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | }; |
34 | 34 | |
35 | 35 | PostExpandParagraphHandler.prototype.reset = function ( token, frame, cb ) { |
36 | | - //console.log( 'PostExpandParagraphHandler.reset ' + JSON.stringify( this.tokens ) ); |
| 36 | + //console.warn( 'PostExpandParagraphHandler.reset ' + JSON.stringify( this.tokens ) ); |
37 | 37 | if ( this.newLines ) { |
38 | 38 | return { tokens: this._finish() }; |
39 | 39 | } else { |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | // Handle NEWLINE tokens, which trigger the actual quote analysis on the |
58 | 58 | // collected quote tokens so far. |
59 | 59 | PostExpandParagraphHandler.prototype.onNewLine = function ( token, frame, cb ) { |
60 | | - //console.log( 'PostExpandParagraphHandler.onNewLine: ' + JSON.stringify( token, null , 2 ) ); |
| 60 | + //console.warn( 'PostExpandParagraphHandler.onNewLine: ' + JSON.stringify( token, null , 2 ) ); |
61 | 61 | var res; |
62 | 62 | this.tokens.push( token ); |
63 | 63 | |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | |
74 | 74 | PostExpandParagraphHandler.prototype.onAny = function ( token, frame, cb ) { |
75 | | - //console.log( 'PostExpandParagraphHandler.onAny' ); |
| 75 | + //console.warn( 'PostExpandParagraphHandler.onAny' ); |
76 | 76 | this.tokens.push( token ); |
77 | 77 | if ( token.type === 'COMMENT' || |
78 | 78 | ( token.constructor === String && token.match( /^[\t ]+$/ ) ) |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | // XXX: Only open paragraph if inline token follows! |
85 | 85 | |
86 | 86 | // None of the tokens we are interested in, so abort processing.. |
87 | | - //console.log( 'PostExpandParagraphHandler.onAny: ' + JSON.stringify( this.tokens, null , 2 ) ); |
| 87 | + //console.warn( 'PostExpandParagraphHandler.onAny: ' + JSON.stringify( this.tokens, null , 2 ) ); |
88 | 88 | if ( this.newLines >= 2 && ! u.isBlockToken( token ) ) { |
89 | | - //console.log( 'insert p:' + JSON.stringify( token, null, 2 ) ); |
| 89 | + //console.warn( 'insert p:' + JSON.stringify( token, null, 2 ) ); |
90 | 90 | return { tokens: [ new TagTk( 'p' ) ].concat( this._finish() ) }; |
91 | 91 | } else { |
92 | 92 | return { tokens: this._finish() }; |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | |
38 | 38 | MWParserEnvironment.prototype.KVtoHash = function ( kvs ) { |
39 | 39 | if ( ! kvs ) { |
40 | | - console.log( "Invalid kvs!: " + JSON.stringify( kvs, null, 2 ) ); |
| 40 | + console.warn( "Invalid kvs!: " + JSON.stringify( kvs, null, 2 ) ); |
41 | 41 | return {}; |
42 | 42 | } |
43 | 43 | var res = {}; |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | res[key] = kv.v; |
49 | 49 | } |
50 | 50 | } |
51 | | - //console.log( 'KVtoHash: ' + JSON.stringify( res )); |
| 51 | + //console.warn( 'KVtoHash: ' + JSON.stringify( res )); |
52 | 52 | return res; |
53 | 53 | } |
54 | 54 | |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | |
122 | 122 | MWParserEnvironment.prototype.tokensToString = function ( tokens ) { |
123 | 123 | var out = []; |
124 | | - //console.log( 'MWParserEnvironment.tokensToString, tokens: ' + JSON.stringify( tokens ) ); |
| 124 | + //console.warn( 'MWParserEnvironment.tokensToString, tokens: ' + JSON.stringify( tokens ) ); |
125 | 125 | // XXX: quick hack, track down non-array sources later! |
126 | 126 | if ( ! $.isArray( tokens ) ) { |
127 | 127 | tokens = [ tokens ]; |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | //out.push( tstring ); |
147 | 147 | } |
148 | 148 | } |
149 | | - //console.log( 'MWParserEnvironment.tokensToString result: ' + out.join('') ); |
| 149 | + //console.warn( 'MWParserEnvironment.tokensToString result: ' + out.join('') ); |
150 | 150 | return out.join(''); |
151 | 151 | }; |
152 | 152 | |
— | — | @@ -156,9 +156,9 @@ |
157 | 157 | MWParserEnvironment.prototype.dp = function ( ) { |
158 | 158 | if ( this.debug ) { |
159 | 159 | if ( arguments.length > 1 ) { |
160 | | - console.log( JSON.stringify( arguments, null, 2 ) ); |
| 160 | + console.warn( JSON.stringify( arguments, null, 2 ) ); |
161 | 161 | } else { |
162 | | - console.log( arguments[0] ); |
| 162 | + console.warn( arguments[0] ); |
163 | 163 | } |
164 | 164 | } |
165 | 165 | }; |
— | — | @@ -169,9 +169,9 @@ |
170 | 170 | MWParserEnvironment.prototype.tp = function ( ) { |
171 | 171 | if ( this.debug || this.trace ) { |
172 | 172 | if ( arguments.length > 1 ) { |
173 | | - console.log( JSON.stringify( arguments, null, 2 ) ); |
| 173 | + console.warn( JSON.stringify( arguments, null, 2 ) ); |
174 | 174 | } else { |
175 | | - console.log( arguments[0] ); |
| 175 | + console.warn( arguments[0] ); |
176 | 176 | } |
177 | 177 | } |
178 | 178 | }; |