Tip: Quick Escape Quotes
Here's a tip you might find a little more useful than the daily movements of people in Orlando.
Whenever I see something I like on a webpage and I want to recreate it in Domino the first thing I do is view-source and paste the links to the required files in to the HTML Head Content of a new form, like so:
You now have the job of escaping all the "s with \s, which might not take that long but is a boring tedious task. An easier way is to enclose the whole lot in {}s. like so:
Now, save and close the form. When you re-open it you'll see the job's been done for you:
If you want to tidy things up all you need to do is put some new lines in:
Thanks for that one, it's always the little simple things that usually are the most useful and save the time.
Hey, that's really usefull! Thanks!
You managed to show this feature in a positive light. All who accused you of slamming Domino should take note of that.
Personally, I always rather considered the curly brackets to be broken. After all, there's no value in itself to escaping each and every quote. It would be a heck of a lot easier if Notes would simply keep the curly brackets instead of converting the whole string.
But for whatever reason, that only works in comments.
FYI. You don't need to save and close the form...just moving the focus from the developer pane to a different field or form event, then go back to the field, form HTMLHead, field, computed text etc, will make designer put escape quotes in.
Thanks Nick. For some reason I thought I'd tried that and found it never worked. Just tried again and it did. Weird.
Nice post. Very useful. I especially like the first line...
Cool. That is really handy. Thanks Jake.
You can save yourself some typing entirely if the js is filed in the Shared Code - Script Libraries section. In the form's code pane for JS Header, right click and select 'Insert Resource'. You end up with a nicely labelled button versus the 'no tool tip' icon if you inserted the resource in the page directly.
I usually use a shared field titled HTMLHEAD and just enter that into the form's HTML Head Content.
btw... you can use the right-click method for the HTML Header Content and insert a css reference which leaves a button as well.
I totally forgot about this feature. Good tip!
"btw... you can use the right-click method for the HTML Header Content and insert a css reference which leaves a button as well."
Plus, this generates valid HTML, contrary to inserting the CSS resource as an "icon" in the form ...
Jake,
You can simplify it further by using formula language permulated operations.
@Implode({<script type='text/javascript' src="} *+ "yahoo.js" : "event.js" : "dom.js" *+{"></script>};@NewLine)
@Adibabu
I guess that depends on your definition of simplicity. Don't hold back, go all the way:
@Implode({<script type='text/javascript' src="} *+ "yahoo" : "event" : "dom"+".js" *+{"></script>};@NewLine)
Clearly the end of my nightmare. Working with some DXL forms and was a pain in scenarios like these. Thanks!
1) Cool - that saves me from silly stuff like ctrl+H in Notepad
2) Cool - Something to read that isn't the semi-functional, yet always bringing my browsers (FF, IE, Opera) to it's knees, lotusPherelive.com (emphasis on the Pee they used in building that site).
I do have to agree w/ Fabian - I sometimes wish this functioned more like LS. I'm not sure why, but I find it easier to count double pipes than double-double quotes:
|| vs. ""
{<tag attribute="value"></tag>} seems clean enough to me.. especially when the value has slashes or other escaped characters.
@Michael - if you're going to go that far, you may as well put a checkbox field on the form that lists JS files in a view, and then @implode the results... would make per-page JS quite easy to pull off. but then, that was probably obvious (why else would I have thought of it?)
It is a nice tip. And the opposite also happens. I realized about that a while ago: If you have a piece of code like "<script text =\"text/javascript\" src=\"prototype.js\"></script>" in your $$HTMLHeadContent field (for example), and you want to coment it out with REM ...it also does the job for you and removes the backslashes. Then, if you want to uncomment, you have 2 choices:
- 1. Remove the REM, {} and add the lost backslashes.
- 2. Just remove the REM :)
being not very daily moves interested myself, I sincerely enjoyed reading {Link}
and
wissel.net (as each year).
impressively useful for daily work.