Marketcircle    Forums  Hop To Forum Categories  Daylite  Hop To Forums  Share Zone    HUD Notes Widget v2.0
Page 1 2 3 4 
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Pro
Picture of Andy Warwick
Posted
A 2.0 version of the ‘HUD Notes Widget’ is now available for comments.

As requested, rather than keying on a complete title ‘HUD’, this version now searches for a string within the title (initially set to ‘{HUD}‘) and returns the Notes that have that—stripping it out to avoid showing it in the HUD.

So, for example, if you had a Note entitled ‘Important Info {HUD}‘ it would be picked up and displayed in the HUD as ‘Important Info ‘.

HUD Notes Widget v2.0

Simply download, unzip, place in the appropriate folder (~/Library/Application Support/DayLite/HUDTemplates/)—replacing the old version if you have it—and re-start Daylite.

You can now go back and re-name your old HUD notes with better titles to get them to display again…

You can also edit the ’Template.html‘ file in Textedit if you want to change the search string to something more suitable.

(I‘ve placed the curly brackets around the search string to avoid it triggering on those three letters in any other context by accident.)

The Widget can be applied to Contacts, Organizations, Projects, Groups and Opportunities.


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
Fantastic! cool

This is great Andy!

I've come up with an interesting situation - the widget seems to work great on most of the Contacts I've tested, but I've got one Contact for whom nothing shows up in the HUD, not even "No HUD Note found" - it's just blank. I've tried adding {HUD} to existing notes for her, and adding new notes with {HUD} and it's the same every time, just blank.

Any ideas what I should look for to trouble-shoot?

Thanks,
Scott
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
That's odd.

Does it, by any chance, have an Email attached from DMI?

I've just noticed one of my Contacts doing the same, and the only other thing attached is a single Email, auto-attached from DMI.

Why that should cause an issue I don't know…


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
Nope.

The contact in question does not have any DMI email notes.

I just checked a contact that DOES have a DMI email note, and the HUD is working fine displaying another note for him with {HUD} in it.

Then I added {HUD} to the DMI note, and it displays fine in the HUD now too.

So, that's not it, at least in my case. And so far, still just that one contact is afflicted (of course, I haven't checked every contact!

[EDIT]: I should add, the DMI note displays, but it needs to scroll to see it all, and there's no scrolling possible - so I can see it's there, but I can't read most of it since the email headers take up most of the HUD space.
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
I've updated the download to version 2.1; see if that fixes your problem.

HUD Notes Widget v2.1


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
The 2.1 version above deliberately excludes those Notes that are internally marked as Emails (have come via DMI?) by the ’isEmail’ tag.

It looks like the issue is when something in the content of the Note causes the parser to choke, perhaps related to line endings or HTML entities. This is because I’m loading the contents into a Javascript variable, rather than just outputting it, and something, somewhere gets confused.

Without being able to see what the parsed version looks like, I'm struggling to establish exactly what.

So, for now, it looks like you can use the 2.0 version and live with the fact that if there are any other Notes/Emails attached to the Object that cause the parser to choke, you won’t see anything at all; or use the 2.1 version which auto-excludes Emails, which appear to be the worst offenders.

I’ll continue to look into it, but it’s hard to tell what’s going on behind the scenes.

If you can narrow it down to a minimum test-case that would be helpful, but hopefully someone at MC will jump in with a solution.

[EDIT] In your instance, of course, it's possible something else in one of the Notes attached to the problem Contact is causing a parsing error; it’s just that Emails seem to be the worst offenders, and thus the 2.1 version that excludes them.

To solve your particular error, you'll have to take a close look at any Notes attached to the problem Contact, and see if there is anything in particular within the content that might cause a parse error.


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
In the case of my problem Contact, it's definitely not DMI (isEmail) related, since all of the Notes for this person were created in DL. So far I haven't been able to find what might be causing it to choke - but I'll play around with it for a while.

I did find that all of her notes were also linked to her Organization and/or various Projects - so, to test, I removed all those links, but still no joy.

I'm going to go into her notes and check formatting to see if there's something there (even though they were all created within DL, some might have included pasted text from emails (pre-DMI days).
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
It's most likely to be an odd line-feed or quote character, or something ‘invisible’ to the naked eye, as it’s outside the range of printable characters.

Sounds like you’ll be okay with the 2.0 version, assuming you can find what’s causing the choke.

Do let me know if you figure out what it is, as I might be able to work around it.


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
I found the culprit (unlinked one note at a time from the contact) -- once I unlinked the "right" note, the HUD Widget worked for that Contact.

The one thing I can see in that note is that the font is different than all other notes - even when I edited it to remove/redo line endings etc. within DL, it was still a problem for the HUD - and I can't seem to change the font (selecting all and changing "Style" to default did nothing).

I don't know if that's helpful for diagnosing the problem further.
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
quote:
Originally posted by Scott McCulloch:
and I can't seem to change the font (selecting all and changing "Style" to default did nothing).


Nevermind - mild mindgap on that one. rolleyes

Changing the font to be the same as all other notes did nothing to help the problem. So, I have to agree that it must be something 'invisible' to the naked eye.
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
Got it! And it was actually 'visible' afterall...

One of the words buried in the middle of the Note was in quotations - once I removed the quotation marks, it worked fine.

So, is there a way to "strip quotes" in the javascript?
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
Possibly smile

That would make sense, as the presence of the quotes would make the code think that that particular note had finished.

I'll look into the code and see if there is anyway to escape or encode the quote characters and avoid the issue.


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Pro
Picture of Scott McCulloch
Posted Hide Post
Quick follow-up - single quotes do not cause it to choke (although they are not displayed in the HUD) - double-quotes cause it to choke.
 
Posts: 180 | Location: San Jose, CA | Registered: June 14, 2006Reply With QuoteReport This Post
Pro
Picture of Andy Warwick
Posted Hide Post
It seems that the problem is this line of code here:

noteContents["<$note.noteID$>"] = "<$note.plainTextRepresentation.htmlSafe.rtfSafe$>"


Because of the way the merge system works (as I understand it), by the time the merge keys have been replaced, it’s too late to run any sort of code to replace the quotes, as the Javascript mistakenly thinks the string has been closed. That’s why single quotes pass through okay; they don’t close the string prematurely,

I could single quote the code, thus:

noteContents["<$note.noteID$>"] = '<$note.plainTextRepresentation.htmlSafe.rtfSafe$>'


which would mean that double quotes wouldn’t choke the parser, but single quotes then would…

Catch-22 frowne

Without knowing exactly what ‘htmlSafe’ and ‘rtfSafe’ are doing, it’s hard to tell if there’s a workaround that would enable the quotes to be dealt with as the merge key is replaced, and then re-escaped by the Javascript into a suitable form.

This isn’t a problem normally, because you aren’t quoting the merge keys, but simply writing them out straight into the HTML.

Ideally, their would be another function (‘quotedSafe’?) to deal with the stray quotes as required when the merge key is within quotes itself.

As a work-around, you can replace the quotes in your Notes with the correct ‘smart quotes’:

" -> “ or ”
' -> ‘ or ’

Which should allow the content to get written out regardless of how the Javascript itself is quoted.

The call to use version 2.0 or 2.1 then solely comes down to whether you want to forcibly ignore ‘email’ Notes* from being parsed (2.1) or not (2.0).

*Notes with ‘isEmail’ field set.


--
Andy Warwick
www.creed.co.uk
 
Posts: 221 | Location: Nottingham, UK | Registered: June 22, 2006Reply With QuoteReport This Post
Journeyman
Posted Hide Post
HUD 1.0 works just fine for me but cannot get version 2.0 or 2.1 to work. I use same installation procedure & go back to HUD 1.0 & all is well. Any thoughts?
 
Posts: 70 | Location: Brisbane, Australia | Registered: June 29, 2006Reply With QuoteReport This Post
  Powered by Social Strata Page 1 2 3 4  
 

Marketcircle    Forums  Hop To Forum Categories  Daylite  Hop To Forums  Share Zone    HUD Notes Widget v2.0

classes
In Store Demos
In Store Demos