var howmany_text = this.worker.matches.length > 0 ? this.worker.matches.length + " replaced :" : "Nothing was replaced."; this.dom_output.empty().appendChild( document.createSimpleElement("div",this.desc_again.next(), document.createTextNode(howmany_text)) ); this.dom_output.setOpacity(1); 
var howmany_text = this.worker.matches.length > 0 ? this.worker.matches.length + " replaced." : "Nothing was replaced."; this.dom_output_count.empty().appendChild( document.createSimpleElement("div",this.desc_again.next(), document.createTextNode(howmany_text)) ); this.dom_output_count.show(); 
Regexpresso.prototype.onSubmit = function(){	console.debug(this,".onSubmit()");	// makes sure the pattern used will be the one in the current tab even if its content has not changed	console.debug("switch(",this.tabs_regex.tabs[this.tabs_regex.now],")");	switch ( this.tabs_regex.now )	{		case 0:			this.onFieldUpdate( this.widget_search[0] );			this.onFieldUpdate( this.widget_search['i'] );			this.onFieldUpdate( this.widget_search['g'] );			this.onFieldUpdate( this.widget_search['m'] );			break;		case 1:			this.onFieldUpdate( this.widget_replace[0] );			this.onFieldUpdate( this.widget_replace[1] );			this.onFieldUpdate( this.widget_replace['i'] );			this.onFieldUpdate( this.widget_replace['g'] );			this.onFieldUpdate( this.widget_replace['m'] );			break;		case 2:			this.onFieldUpdate(this.widget_expert);			break;	}	try	{		// the following operation can take time if the input text is big		this.worker = new RegexWorker( this.dom_subject.value, this.dom_regex.value );		switch ( RegExp.explainPerlRegexPattern(this.worker.pattern).action )		{			case 'm':			case '':			{				// first, prints the number of matches				if ( this.options['showCount'] )				{					var howmany_text = "No match.";					if ( this.worker.matches.length > 0 )					{						if ( this.worker.matches.length == 1 )							howmany_text = "1 match";						else							howmany_text = this.worker.matches.length + " matches";					}					// TODO : a special div for the count and/or a special tab with stats					this.dom_output.empty().appendChild( document.createSimpleElement("div",this.desc_again.next(), document.createTextNode(howmany_text)) );					this.dom_output.setOpacity(1);				}				else				{					// hides this section if required					this.dom_output.setOpacity(0);				}				// then outputs the different kind of available representations				// the following operations can take time if the input text is big				// TODO : implement addTab in the following code				this.dom_output.innerHTML = "<pre>" + this.worker.asRawHTML(this.options) + "</pre>";				/*if ( this.options['showResults'] && this.worker.matches.length > 0 )				{					this.dom_output.addTab( "output_text", this.worker.asHTML() );					this.dom_output.addTab( "output_table", this.worker.asTable() );				}*/			}			break;			case 's':			{				// first, prints the number of matches				if ( this.options['showCount'] )				{					var howmany_text = this.worker.matches.length > 0 ? this.worker.matches.length + " replaced :" : "Nothing was replaced.";					this.dom_output.empty().appendChild( document.createSimpleElement("div",this.desc_again.next(), document.createTextNode(howmany_text)) );					this.dom_output.setOpacity(1);				}				else				{					// hides this section if required					this.dom_output.setOpacity(0);				}				// then outputs the different kind of available representations				// the following operations can take time if the input text is big				/*if ( this.options['showResults'] )				{				this.dom_output.addTab( "output_text", this.worker.asHTML() );				this.dom_output.addTab( "output_text", this.worker.asText() );				}*/			}			break;		}		// in all cases, make sure to show the results		this.accordion.showSection(1);	}	catch ( e )	{		if( console != null )			console.debug(e);		// @see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jslrfJScriptErrorsTOC.asp		if ( MSInternetExplorer.version() > 0 )		{			switch ( e.number & 0xFFFF )			{				case 5017:	// Syntax error in regular expression				case 5018:	// Unexpected quantifier				case 5019:	// Expected ']' in regular expression				case 5020:	// Expected ')' in regular expression				case 5021:	// Invalid range in character set					dom_output.appendChild( createSimpleElement("pre","error",document.createTextNode(e.description)) );					break;				default:					throw e;					break;			}		}		else if ( e instanceof SyntaxError )		{			this.dom_output.innerHTML = document.createSimpleElement("pre","error",document.createTextNode(e.message));		}		else		{			//throw e;			return false;	// disable this line when debug is finished		}	}	return false;	}
10215	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10215/f0d579503235174beaebf17e2c0ec27687e01865/regexpresso.js/buggy/trunk/src/regexpresso.js