<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Fancy status messages using tg_flash</title>
	<atom:link href="http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/</link>
	<description>Bring out the g33k</description>
	<pubDate>Thu, 20 Nov 2008 14:26:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Chris Arndt</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-2993</link>
		<dc:creator>Chris Arndt</dc:creator>
		<pubDate>Sat, 08 Jul 2006 17:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-2993</guid>
		<description>Here's a small improvement for the displayStatusMessage function that allows the user to click on the message to get rid of it and also adds a third parameter for the hide timeout (defaults to 0, i.e. the message stays until user clicks it away).

/*
 * display flash message
 */
function displayStatusMessage(status, msg, timeout) {
    var msg = swapDOM('statusmessage', DIV({'id': 'statusmessage'},
      DIV({'class': status}, msg)));
    if (timeout) {
        msg._hide_cb = callLater(timeout, swapDOM, msg,
            DIV({'id': 'statusmessage'}, null));
    }
    connect(msg, 'onclick',
        function(e) {
            var msg = e.src();
            if (msg._hide_cb) {
                msg._hide_cb.cancel();
            }
            disconnect(msg);
            swapDOM(msg, DIV({'id': 'statusmessage'}, null));
        }
    );
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a small improvement for the displayStatusMessage function that allows the user to click on the message to get rid of it and also adds a third parameter for the hide timeout (defaults to 0, i.e. the message stays until user clicks it away).</p>
<p>/*<br />
 * display flash message<br />
 */<br />
function displayStatusMessage(status, msg, timeout) {<br />
    var msg = swapDOM(&#8217;statusmessage&#8217;, DIV({&#8217;id&#8217;: &#8217;statusmessage&#8217;},<br />
      DIV({&#8217;class&#8217;: status}, msg)));<br />
    if (timeout) {<br />
        msg.<em>hide</em>cb = callLater(timeout, swapDOM, msg,<br />
            DIV({&#8217;id&#8217;: &#8217;statusmessage&#8217;}, null));<br />
    }<br />
    connect(msg, &#8216;onclick&#8217;,<br />
        function(e) {<br />
            var msg = e.src();<br />
            if (msg.<em>hide</em>cb) {<br />
                msg.<em>hide</em>cb.cancel();<br />
            }<br />
            disconnect(msg);<br />
            swapDOM(msg, DIV({&#8217;id&#8217;: &#8217;statusmessage&#8217;}, null));<br />
        }<br />
    );<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splee</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1488</link>
		<dc:creator>Splee</dc:creator>
		<pubDate>Fri, 28 Apr 2006 13:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1488</guid>
		<description>This article was written for use with the TurboGears web framework (http://www.turbogears.org).  However, you can create the messages directly using asp and use the same (or similar) javascript and CSS as I have used here.</description>
		<content:encoded><![CDATA[<p>This article was written for use with the TurboGears web framework (http://www.turbogears.org).  However, you can create the messages directly using asp and use the same (or similar) javascript and CSS as I have used here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asif</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1450</link>
		<dc:creator>Asif</dc:creator>
		<pubDate>Fri, 28 Apr 2006 04:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1450</guid>
		<description>how cani use it with asp.net 2.0 using Visual Studio 2005

Please help the Message Box Seems Preety cool and i would like to use it in my web Pages

Thanks</description>
		<content:encoded><![CDATA[<p>how cani use it with asp.net 2.0 using Visual Studio 2005</p>
<p>Please help the Message Box Seems Preety cool and i would like to use it in my web Pages</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splee</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1183</link>
		<dc:creator>Splee</dc:creator>
		<pubDate>Fri, 16 Dec 2005 16:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1183</guid>
		<description>Tim,

Thanks for pointing out the typos.  As you can see I modified this from the project I'm currently doing, so I changed the names to anonymize it a bit...  it seems I missed a few ;)

As for using jsonify, yes it is a bit superfluous now, but previously there were some issues with passing numbers that weren't integers.  SQLObject was returning long ints for some ID's.  Basically I put the jsonfiy bit in to make sure that if I (or other people) were to pass more info than just a string that json.write wouldn't barf.

I think this has been fixed recently, but I've left it there as a safety net.</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Thanks for pointing out the typos.  As you can see I modified this from the project I&#8217;m currently doing, so I changed the names to anonymize it a bit&#8230;  it seems I missed a few ;)</p>
<p>As for using jsonify, yes it is a bit superfluous now, but previously there were some issues with passing numbers that weren&#8217;t integers.  SQLObject was returning long ints for some ID&#8217;s.  Basically I put the jsonfiy bit in to make sure that if I (or other people) were to pass more info than just a string that json.write wouldn&#8217;t barf.</p>
<p>I think this has been fixed recently, but I&#8217;ve left it there as a safety net.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Diggins</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1181</link>
		<dc:creator>Tim Diggins</dc:creator>
		<pubDate>Fri, 16 Dec 2005 01:44:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1181</guid>
		<description>small point, but the css in your example has one error "#rdsmsg" should be "#statusmessage". (similarly the ajax callback calls "displayRdsmsg" when it should call "displayStatusMessage()"

Also I'm not sure why you need the call to jsonify within the json.write() within the controller code. I'm running tg0.8 and don't have a jsonify - but the json.write seems to do a reasonable job anyway...

Many thanks for the write-up.</description>
		<content:encoded><![CDATA[<p>small point, but the css in your example has one error &#8220;#rdsmsg&#8221; should be &#8220;#statusmessage&#8221;. (similarly the ajax callback calls &#8220;displayRdsmsg&#8221; when it should call &#8220;displayStatusMessage()&#8221;</p>
<p>Also I&#8217;m not sure why you need the call to jsonify within the json.write() within the controller code. I&#8217;m running tg0.8 and don&#8217;t have a jsonify - but the json.write seems to do a reasonable job anyway&#8230;</p>
<p>Many thanks for the write-up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splee</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1168</link>
		<dc:creator>Splee</dc:creator>
		<pubDate>Thu, 24 Nov 2005 08:49:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1168</guid>
		<description>Excellent, thanks for the tips Bob.  I'm not all that hot at JavaScript so these little details are things that I miss.  I'll get that sorted out soon and update the examples.</description>
		<content:encoded><![CDATA[<p>Excellent, thanks for the tips Bob.  I&#8217;m not all that hot at JavaScript so these little details are things that I miss.  I&#8217;ll get that sorted out soon and update the examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Ippolito</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1167</link>
		<dc:creator>Bob Ippolito</dc:creator>
		<pubDate>Thu, 24 Nov 2005 02:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1167</guid>
		<description>Your flash data is technically not valid JSON.  Single quoted strings are not part of the spec.  While it happens to work because of the way it's processed, you should probably fix the example.

Ideally you'd be using an API instead of string mangling to generate the JSON document.  That way formatting it correctly is someone else's problem and it's easier to test that way.

I also have a feeling that your use of Kid interpolation in the script tag is going to have edge cases.  You really shouldn't do that either.. what I do is I make a hidden input field with the value as the data, and just grab it out from the script.  That way, you don't have any generated code at all and the escaping behavior is definitely already correct since it'd be normal HTML attribute value escaping.</description>
		<content:encoded><![CDATA[<p>Your flash data is technically not valid JSON.  Single quoted strings are not part of the spec.  While it happens to work because of the way it&#8217;s processed, you should probably fix the example.</p>
<p>Ideally you&#8217;d be using an API instead of string mangling to generate the JSON document.  That way formatting it correctly is someone else&#8217;s problem and it&#8217;s easier to test that way.</p>
<p>I also have a feeling that your use of Kid interpolation in the script tag is going to have edge cases.  You really shouldn&#8217;t do that either.. what I do is I make a hidden input field with the value as the data, and just grab it out from the script.  That way, you don&#8217;t have any generated code at all and the escaping behavior is definitely already correct since it&#8217;d be normal HTML attribute value escaping.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splee</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1166</link>
		<dc:creator>Splee</dc:creator>
		<pubDate>Wed, 23 Nov 2005 19:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1166</guid>
		<description>Yes, passing a CSS class would be handy, but bearing in mind the way tg_flash stores it's data in a cookie that may be difficult to impliment.</description>
		<content:encoded><![CDATA[<p>Yes, passing a CSS class would be handy, but bearing in mind the way tg_flash stores it&#8217;s data in a cookie that may be difficult to impliment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SuperJared</title>
		<link>http://www.splee.co.uk/2005/11/23/fancy-status-messages-using-tg_flash/#comment-1165</link>
		<dc:creator>SuperJared</dc:creator>
		<pubDate>Wed, 23 Nov 2005 18:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/?p=200#comment-1165</guid>
		<description>I like what you've done. This has made the tg_flash that much more dynamic! Though, I'd like to see tg_flash support the passing of a CSS class.</description>
		<content:encoded><![CDATA[<p>I like what you&#8217;ve done. This has made the tg<em>flash that much more dynamic! Though, I&#8217;d like to see tg</em>flash support the passing of a CSS class.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
