Marketcircle    Forums  Hop To Forum Categories  Daylite  Hop To Forums  Share Zone    HUD Notes Widget - displaying creation date/time
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Pro
Picture of Scott McCulloch
Posted
In response to a couple of other threads, I took a look at Andy's HUD Notes Widget to see whether I could figure out how to include the creation date and time for the notes displayed. It turns out that adding/changing a few lines of code in the widget's template.html file appears to do the trick. The following changes may or may not make it directly into a future release of Andy's widget, but here they are for those who'd like to alter the current version for themselves in the meantime:

In the widget's template.html file, change this:

 	/* Create Objects to hold an associative array of Note titles and contents  */

	var noteTitles = new Object() ;
	var noteContents = new Object() ;
 



to this:

 	/* Create Objects to hold an associative array of Note titles and contents  */

	var noteTitles = new Object() ;
	var noteDates = new Object();
	var noteContents = new Object() ;
 



change this:

 /* Load the Objects by writing out each Note's details using the standard merge keys  */

	<$foreach note model.notesSortedByCreateDateDescending do$>
			<$if note.isEmail != "1"$>
				noteTitles["<$note.noteID$>"] = "<$note.title$>" ;
				noteContents["<$note.noteID$>"] = "<$note.plainTextRepresentation.htmlSafe.rtfSafe$>" ;
			<$endif$>
	<$endforeach do$>	 



to this:

 /* Load the Objects by writing out each Note's details using the standard merge keys  */

	<$foreach note model.notesSortedByCreateDateDescending do$>
			<$if note.isEmail != "1"$>
				noteTitles["<$note.noteID$>"] = "<$note.title$>" ;
				noteDates["<$note.noteID$>"] = "<$note.createDate.shortDateTime$>";
				noteContents["<$note.noteID$>"] = "<$note.plainTextRepresentation.htmlSafe.rtfSafe$>" ;
			<$endif$>
	<$endforeach do$>	 



and change this:

 '<thead><tr><th colspan="2">' + noteTitles[id].removeSearchString() + '</th></tr></thead>' + 


to this:

 '<thead><tr><th colspan="2">' + noteTitles[id].removeSearchString() + noteDates[id] + '</th></tr></thead>' + 


In my (limited) testing this seems to work fine, and adds the date and time of the Notes' creation immediately after their titles in the HUD Notes Widget. There are no other changes to how the widget operates - only notes with "{HUD}" (without quotes) in the title will show up in the widget space.

Please note, as these changes/additions are not part of Andy's HUD Notes Widget current release, the alterations are done at your own risk.
 
Posts: 160 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Marketcircle    Forums  Hop To Forum Categories  Daylite  Hop To Forums  Share Zone    HUD Notes Widget - displaying creation date/time

© Copyright 2006 Marketcircle Inc. All rights reserved.