add: addAlarmNode( xmlDocument, eventNode, calendarEvent.alarmLength, calendarEvent.alarmUnits ); addRRuleNode( xmlDocument, eventNode );  
context: function makeXmlNode( xmlDocument, calendarEvent ){   // Adds a property node to a event node   //  do not add empty properties, valueType is optional   var addPropertyNode = function( xmlDocument, eventNode, name, value, valueType )   {      if(!value)         return;      var propertyNode = xmlDocument.createElement( "property" );      propertyNode.setAttribute( "name", name );      var valueNode = xmlDocument.createElement( "value" );      var textNode  = xmlDocument.createTextNode( value );      if( valueType )         valueNode.setAttribute( "value", valueType );      valueNode.appendChild( textNode );      propertyNode.appendChild( valueNode );      eventNode.appendChild( propertyNode );   }     var checkString = function( str )    {        if( typeof( str ) == "string" )            return str;        else            return ""    }    var checkNumber = function( num )    {        if( typeof( num ) == "undefined" || num == null )            return "";        else            return num    }    var checkBoolean = function( bool )    {        if( bool == "false")            return "false"        else if( bool )      // this is false for: false, 0, undefined, null, ""            return "true";        else            return "false"    }    // create a string in the iCalendar format, UTC time '20020412T121314Z'    var checkDate = function ( dt, isDate )    {   var dateObj = new Date( dt.getTime() );        var result = "";        result += dateObj.getUTCFullYear();        if( dateObj.getMonth() + 1 < 10 )           result += "0";        result += dateObj.getUTCMonth() + 1;        if( dateObj.getUTCDate() < 10 )           result += "0";        result += dateObj.getUTCDate();        if( !isDate )        {           result += "T"           if( dateObj.getUTCHours() < 10 )              result += "0";           result += dateObj.getUTCHours();           if( dateObj.getUTCMinutes() < 10 )              result += "0";           result += dateObj.getUTCMinutes();                   if( dateObj.getUTCSeconds() < 10 )              result += "0";           result += dateObj.getUTCSeconds();           result += "Z";        }           return result;    }    // make the event tag    var calendarNode = xmlDocument.createElement( "component" );    calendarNode.setAttribute( "name", "VCALENDAR" );    addPropertyNode( xmlDocument, calendarNode, "PRODID", "-//Mozilla.org/NONSGML Mozilla Calendar V 1.0 //EN" );    addPropertyNode( xmlDocument, calendarNode, "VERSION", "2.0" );    if(calendarEvent.method == calendarEvent.ICAL_METHOD_PUBLISH)       addPropertyNode( xmlDocument, calendarNode, "METHOD", "PUBLISH" );    else if(calendarEvent.method == calendarEvent.ICAL_METHOD_REQUEST )       addPropertyNode( xmlDocument, calendarNode, "METHOD", "REQUEST" );    var eventNode = xmlDocument.createElement( "component" );    eventNode.setAttribute( "name", "VEVENT" );    addPropertyNode( xmlDocument, eventNode, "UID", calendarEvent.id );    addPropertyNode( xmlDocument, eventNode, "SUMMARY", checkString( calendarEvent.title ) );    addPropertyNode( xmlDocument, eventNode, "DTSTAMP", checkDate( calendarEvent.stamp ) );    if( calendarEvent.allDay )       addPropertyNode( xmlDocument, eventNode, "DTSTART", checkDate( calendarEvent.start, true ), "DATE" );    else    {       addPropertyNode( xmlDocument, eventNode, "DTSTART", checkDate( calendarEvent.start ) );       addPropertyNode( xmlDocument, eventNode, "DTEND", checkDate( calendarEvent.end ) );    }    addPropertyNode( xmlDocument, eventNode, "DESCRIPTION", checkString( calendarEvent.description ) );    addPropertyNode( xmlDocument, eventNode, "CATEGORIES", checkString( calendarEvent.categories ) );    addPropertyNode( xmlDocument, eventNode, "LOCATION", checkString( calendarEvent.location ) );    addPropertyNode( xmlDocument, eventNode, "PRIVATEEVENT", checkString( calendarEvent.privateEvent ) );    addPropertyNode( xmlDocument, eventNode, "URL", checkString( calendarEvent.url ) );    addPropertyNode( xmlDocument, eventNode, "PRIORITY", checkNumber( calendarEvent.priority ) );    calendarNode.appendChild( eventNode );    return calendarNode;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/70dd64cc23f19f07b46d7c846d4050fc37f7ca1f/importExport.js/buggy/calendar/resources/content/importExport.js