/************************************

  here starts second token of a preset,
  which denotes NOTES of a todo,
  or a regular content entry.

*************************************/


function wakaDoTodoContent() {}
         wakaDoTodoContent.prototype = new wakaTodoContent();
         wakaDoTodoContent.prototype.constructor = 
         wakaDoTodoContent;

wakaDoTodoContent.prototype._compile = function()
{
  if (this._nextPreset)
    this._html = this.wf.format( this._data, this._nextPreset );
  else
    this._html = this._data;

  if ((!this._parent || !this._parent.isTodo) && this._data != "")
  {
    // wrap to Editable
    this._editable = new deskDoEditable_simple( this.wf.desk, this.wf.desk.nextId() );
    this._editable.setData( this._data );
    this._html = this._editable.buildWrapper( this._editable.buildViewMode() );
  }
  if (this._parent.isTodo)
  {
    var _css  = this.wf.cssPrefix + "todo-notes" + this.wf.cssPostfix;
    this._html = "<div class='"+_css+"'>"+this._html+"</div>"+
                 "</div>"; // note that is a CLOSING DIV FOR ONCLICK WRAPPER!
  }

  this._compiled = true;
}

// make a break, if exporting to text
wakaDoTodoContent.prototype.toText = function()
{
  var result = "";
  if (this._editable) result = this._editable.getData();
  else                result = this._data;

  result = result.replace( /\s+$/, "");

  if (result == "") return result;
  else              return result + "\n";

}



