function updateWorkspace()
{
    var v = "";
    var rawContents ;
    if( doCodePress ) {
	rawContents =  document.getElementById("rawContents_cp").previousSibling;	// IE (too) 
	rawContents.editor.syntaxHighlight();
	v = rawContents.getCode();
    }
    else {
	rawContents =  document.getElementById("rawContents");
	v = rawContents.value;
    }

    var t = v.replace(/^\s+|\s+$/, '');

    if( t == "" ) {
	alert("nothing specified!");
	return;
    }

    var oldContents = "" + theSongView.getModel().getRawContents();
    if( v == oldContents ) {
	// nothing changed.
	return;
    }

    var r = Song.prototype.fromRawText(t, true);
    if( r == null || r.fResult == null ) {
	if( r.fLine >= 0 ) {
	    alert( "Line # " + r.fLine + ": " + r.fFailureReason );
	    if( !doCodePress ) {
	    	gotoTextAreaLine(rawContents, r.fLine);

	    }
	}
	else
	    alert( r.fFailureReason );

	return;
    }

    var song = r.fResult;

    // delete current view
    var c = theSongView.getContents();
    if( c != null )
	c.parentNode.removeChild(c);
    createSong(editorWorkspace, song, false);
}
/**
 * update the contents of the workspace from the current contents of the command area
 */
update the contents of the workspace from the current contents of the command area
update the contents of the workspace from the current contents of the command area
function updateWorkspace()
{
    var v = "";
    var rawContents ;
    if( doCodePress ) {
	rawContents =  document.getElementById("rawContents_cp").previousSibling;	
	rawContents.editor.syntaxHighlight();
	v = rawContents.getCode();
    }
    else {
	rawContents =  document.getElementById("rawContents");
	v = rawContents.value;
    }
    var t = v.replace(/^\s+|\s+$/, '');
    if( t == "" ) {
	alert("nothing specified!");
	return;
    }
    var oldContents = "" + theSongView.getModel().getRawContents();
    if( v == oldContents ) {
	return;
    }
    var r = Song.prototype.fromRawText(t, true);
    if( r == null || r.fResult == null ) {
	if( r.fLine >= 0 ) {
	    alert( "Line # " + r.fLine + ": " + r.fFailureReason );
	    if( !doCodePress ) {
	    	gotoTextAreaLine(rawContents, r.fLine);
	    }
	}
	else
	    alert( r.fFailureReason );
	return;
    }
    var song = r.fResult;
    var c = theSongView.getContents();
    if( c != null )
	c.parentNode.removeChild(c);
    createSong(editorWorkspace, song, false);
}
function updateWorkspace ( ) { var v = "" ; var rawContents ; if ( doCodePress ) { rawContents = document . getElementById ( "rawContents_cp" ) . previousSibling ; rawContents . editor . syntaxHighlight ( ) ; v = rawContents . getCode ( ) ; } else { rawContents = document . getElementById ( "rawContents" ) ; v = rawContents . value ; } var t = v . replace ( / ^\s+|\s+$ / , '' ) ; if ( t == "" ) { alert ( "nothing specified!" ) ; return ; } var oldContents = "" + theSongView . getModel ( ) . getRawContents ( ) ; if ( v == oldContents ) { return ; } var r = Song . prototype . fromRawText ( t , true ) ; if ( r == null || r . fResult == null ) { if ( r . fLine >= 0 ) { alert ( "Line # " + r . fLine + ": " + r . fFailureReason ) ; if ( ! doCodePress ) { gotoTextAreaLine ( rawContents , r . fLine ) ; } } else alert ( r . fFailureReason ) ; return ; } var song = r . fResult ; var c = theSongView . getContents ( ) ; if ( c != null ) c . parentNode . removeChild ( c ) ; createSong ( editorWorkspace , song , false ) ; }
update the contents of the workspace from the current contents of the command area
update the contents of the workspace from the current contents of the command area
// IE (too) 
 // nothing changed.
 // delete current view
