<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Snippets code from my daily experience &#187; openkomodo</title>
	<atom:link href="http://dafizilla.wordpress.com/category/openkomodo/feed/" rel="self" type="application/rss+xml" />
	<link>http://dafizilla.wordpress.com</link>
	<description>Just another unnecessary code resource blog</description>
	<lastBuildDate>Sun, 20 Dec 2009 10:00:19 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dafizilla.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/635b338f35d7304cae2e1b31926d3592?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Snippets code from my daily experience &#187; openkomodo</title>
		<link>http://dafizilla.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dafizilla.wordpress.com/osd.xml" title="Snippets code from my daily experience" />
		<item>
		<title>Colored file tabs for Komodo</title>
		<link>http://dafizilla.wordpress.com/2009/04/01/colored-file-tabs-for-komodo/</link>
		<comments>http://dafizilla.wordpress.com/2009/04/01/colored-file-tabs-for-komodo/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 12:37:43 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[openkomodo]]></category>
		<category><![CDATA[xul]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=568</guid>
		<description><![CDATA[A couple of months ago I wrote a Komodo macro allowing the editor view tabs to be colored based on user defined color schemes, when the macro became stable I published it on Komodo community forum.
Amazingly the macro received more feedback so I decided to &#8216;convert&#8217; it to an XUL extension.
Komodo macros are fantastic but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=568&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A couple of months ago I wrote a Komodo macro allowing the editor view tabs to be colored based on user defined color schemes, when the macro became stable I published it on <a href="http://community.activestate.com/forum/color-tab-language">Komodo community forum</a>.</p>
<p>Amazingly the macro received more feedback so I decided to &#8216;convert&#8217; it to an XUL extension.</p>
<p>Komodo macros are fantastic but they don&#8217;t allow to create complex UIs so moving them to XPI become a necessary step.</p>
<p>Now <a href="http://dafizilla.sourceforge.net/colortab/">ColorTab</a> is ready and can be downloaded from <a href="http://dafizilla.sourceforge.net/colortab/">here</a>.</p>
<p>The original name was KolorTab, the &#8216;K&#8217; letter used to remember Komodo but I&#8217;ve decided to use a more tradictional name <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="ColorTab look&amp;feel" src="http://apps.sourceforge.net/mediawiki/dafizilla/nfs/project/d/da/dafizilla/7/78/Colortab.png" alt="ColorTab look&amp;feel" width="500" height="280" /><p class="wp-caption-text">ColorTab look&amp;feel</p></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/568/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=568&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2009/04/01/colored-file-tabs-for-komodo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>

		<media:content url="http://apps.sourceforge.net/mediawiki/dafizilla/nfs/project/d/da/dafizilla/7/78/Colortab.png" medium="image">
			<media:title type="html">ColorTab look&#38;feel</media:title>
		</media:content>
	</item>
		<item>
		<title>Komodo maintenant parle Français (Komodo now speaks French)</title>
		<link>http://dafizilla.wordpress.com/2009/03/25/komodo-maintenaint-parle-francais-komodo-now-speaks-french/</link>
		<comments>http://dafizilla.wordpress.com/2009/03/25/komodo-maintenaint-parle-francais-komodo-now-speaks-french/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 17:25:52 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[babelzilla]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[openkomodo]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=562</guid>
		<description><![CDATA[The Babelzilla Team is proud to present the (unofficial) Komodo French localization.
Komodo 5.1 has been released, it contains many cool features and the Babelzilla guys have completed the FIRST localization, the first one.
You can find further details at French Mozilla blog and the installation instructions at BabelWiki
A special thanks goes to Goofy that coordinated the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=562&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <a href="http://www.babelzilla.org/forum/index.php?act=portal">Babelzilla</a> Team is proud to present the (unofficial) Komodo French localization.</p>
<p><a href="http://trentm.com/blog/archives/2009/03/24/komodo51/">Komodo 5.1 has been released</a>, it contains many cool features and the <a href="http://www.babelzilla.org/forum/index.php?act=portal">Babelzilla</a> guys have completed the <strong><span style="color:#ff0000;">FIRST</span></strong> localization, the first one.</p>
<p>You can find further details at <a href="http://blog.frenchmozilla.fr/index/post/2009/03/25/Komodo-Edit-51-est-disponible-en-francais-aussi2">French Mozilla blog</a> and the installation instructions at <a href="http://babelwiki.babelzilla.org/index.php?title=OpenKomodo_fr">BabelWiki</a></p>
<p>A special thanks goes to Goofy that coordinated the L10N work.</p>
<p>Thanks guys, you made the world a better place without linguistic barrier.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/562/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/562/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/562/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/562/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/562/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/562/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/562/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/562/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/562/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/562/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=562&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2009/03/25/komodo-maintenaint-parle-francais-komodo-now-speaks-french/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding CSS Color Preview Tooltip to Komodo</title>
		<link>http://dafizilla.wordpress.com/2009/03/01/adding-css-color-preview-tooltip-to-komodo/</link>
		<comments>http://dafizilla.wordpress.com/2009/03/01/adding-css-color-preview-tooltip-to-komodo/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 11:36:12 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[komodo]]></category>
		<category><![CDATA[nsIDOMCSSPrimitiveValue]]></category>
		<category><![CDATA[openkomodo]]></category>
		<category><![CDATA[scintilla]]></category>
		<category><![CDATA[xul]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=545</guid>
		<description><![CDATA[Do you know Firebug? Uh no? Well please make a jump in twentieth century then return here  
Firebug has many great features but I love the color preview tooltip, from CSS Tab moving the mouse over a CSS color expression you will see a little box filled with the color found under the mouse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=545&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Do you know <a href="http://getfirebug.com/">Firebug</a>? Uh no? Well please make a jump in twentieth century then return here <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Firebug has many great features but I love the <a href="http://getfirebug.com/css.html">color preview tooltip</a>, from CSS Tab moving the mouse over a CSS color expression you will see a little box filled with the color found under the mouse pointer.</p>
<p>Every time I edit CSS (and HTML) files from Komodo subconsciously I move mouse over a color waiting to see the tooltip but nothing happens <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I&#8217;ve realized a macro can do this job so I&#8217;ve written <a href="http://dafizilla.sourceforge.net/stuff/macros/ColorInfoTip.kpz">ColorInfoTip</a> that adds to Komodo the ability to show colored tooltip.</p>
<p><img class="aligncenter" src="http://apps.sourceforge.net/mediawiki/dafizilla/nfs/project/d/da/dafizilla/b/bd/ColorInfoTipPreview.jpg" alt="" width="402" height="148" /></p>
<h3>Some technical detail</h3>
<p><em>This is a macro! No need to create extensions, the Komodo macro <strong>ecosystem</strong> is very cool and powerful.</em></p>
<p>The tooltip is a scintilla <a href="http://www.scintilla.org/ScintillaDoc.html#CallTips">Call tip</a> accessible from Komodo API.</p>
<p>The CSS color string can be written using many <a href="http://www.w3.org/TR/CSS2/syndata.html#color-units">syntaxes</a> like #RRGGBB or rgb(R,G,B) instead of reinventing the wheel and write the parser I&#8217;ve used the <a href="http://www.xulplanet.com/references/objref/CSSPrimitiveValue.html#method_getRGBColorValue">getRGBColorValue</a> standard DOM method.</p>
<p>I discovered <a href="http://www.scintilla.org/ScintillaDoc.html">Scintilla</a> uses BBGGRR color format instead of RRGGBB so the <a href="http://www.xulplanet.com/references/objref/CSSRGBColor.html">CSSRGBColor</a> components have been converted to be Scintilla compliant.</p>
<h3>Known problems</h3>
<p>The macro isn&#8217;t perfect and any help is welcomed</p>
<ul>
<li>Sometimes the tooltip doesn&#8217;t close especially changing editor view</li>
<li><span style="text-decoration:line-through;">Moving mouse quickly doesn&#8217;t update the color</span> (fixed)</li>
<li>fill here the bug you found</li>
</ul>
<h3>ColorInfoTip.kpz</h3>
<p>You can download the macro from <a href="http://dafizilla.sourceforge.net/stuff/macros/ColorInfoTip.kpz">ColorInfoTip.kpz</a> then open the file from Komodo to install</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/545/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/545/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/545/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/545/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/545/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/545/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/545/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/545/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/545/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/545/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=545&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2009/03/01/adding-css-color-preview-tooltip-to-komodo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>

		<media:content url="http://apps.sourceforge.net/mediawiki/dafizilla/nfs/project/d/da/dafizilla/b/bd/ColorInfoTipPreview.jpg" medium="image" />
	</item>
		<item>
		<title>Komodo ViewAbout</title>
		<link>http://dafizilla.wordpress.com/2008/11/21/komodo-viewabout/</link>
		<comments>http://dafizilla.wordpress.com/2008/11/21/komodo-viewabout/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 17:42:53 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[openkomodo]]></category>
		<category><![CDATA[xul]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=341</guid>
		<description><![CDATA[After reading ViewAbout post written by Gary Kwong I was curious to see what Komodo should have shown.
Komodo doesn&#8217;t require to write an extension to implement a similar feature, it is sufficient to write a macro  
So I&#8217;ve written the code that adds a popup menu inside Help menu and amazing it worked immediately [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=341&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After reading <a href="http://www.rumblingedge.com/2008/11/21/viewabout/">ViewAbout</a> post written by <a href="http://www.rumblingedge.com/">Gary Kwong</a> I was curious to see what Komodo should have shown.</p>
<p>Komodo doesn&#8217;t require to write an extension to implement a similar feature, it is sufficient to write a macro <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So I&#8217;ve written the code that adds a popup menu inside Help menu and amazing it worked immediately <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>The macro can be triggered at startup but the menu will be added only on first open window because Komodo doesn&#8217;t have a &#8220;on open new window&#8221; macro event but it can be easily simulated adding a listener.</p>
<p>The code shown below is the complete Komodo Javascript macro, nothing else is necessary. (<span style="color:#ff0000;">EDIT</span> Thanks to Mook to point me how to remove the hardcoded <em>abouts</em> list)</p>
<p><span style="color:#781f87;"><a href="http://dafizilla.files.wordpress.com/2008/11/aboutview.jpg"><img class="aligncenter size-full wp-image-345" title="aboutview" src="http://dafizilla.files.wordpress.com/2008/11/aboutview.jpg?w=500&#038;h=305" alt="aboutview" width="500" height="305" /></a></span></p>
<pre><span style="font-size:12px;">
<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">abouts</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span style="color:#781f87;">[];</span>
<span style="color:#871f78;">for</span><span class="default">&nbsp;</span><span style="color:#781f87;">(</span><span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">c</span><span class="default">&nbsp;</span><span style="color:#871f78;">in</span><span class="default">&nbsp;</span><span class="identifiers">Components</span><span style="color:#781f87;">.</span><span class="identifiers">classes</span><span style="color:#781f87;">)</span><span class="default">&nbsp;</span><span style="color:#781f87;">{</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">m</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">c</span><span style="color:#781f87;">.</span><span class="identifiers">split</span><span style="color:#781f87;">(</span><span style="color:#c86400;">/=/</span><span style="color:#781f87;">);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">if</span><span class="default">&nbsp;</span><span style="color:#781f87;">(</span><span class="identifiers">m</span><span style="color:#781f87;">[</span><span style="color:#8b0000;">0</span><span style="color:#781f87;">]</span><span class="default">&nbsp;</span><span style="color:#781f87;">==</span><span class="default">&nbsp;</span><span style="color:#23238e;">"@mozilla.org/network/protocol/about;1?what"</span><span style="color:#781f87;">)</span><span class="default">&nbsp;</span><span style="color:#781f87;">{</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">if</span><span class="default">&nbsp;</span><span style="color:#781f87;">(</span><span class="identifiers">m</span><span style="color:#781f87;">[</span><span style="color:#8b0000;">1</span><span style="color:#781f87;">])</span><span class="default">&nbsp;</span><span style="color:#781f87;">{</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">abouts</span><span style="color:#781f87;">.</span><span class="identifiers">push</span><span style="color:#781f87;">(</span><span class="identifiers">m</span><span style="color:#781f87;">[</span><span style="color:#8b0000;">1</span><span style="color:#781f87;">]);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">}</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">}</span>
<span style="color:#781f87;">}</span>

<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">menuAbouts</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">document</span><span style="color:#781f87;">.</span><span class="identifiers">createElement</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"menu"</span><span style="color:#781f87;">);</span>
<span class="identifiers">menuAbouts</span><span style="color:#781f87;">.</span><span class="identifiers">setAttribute</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"label"</span><span style="color:#781f87;">,</span><span class="default">&nbsp;</span><span style="color:#23238e;">"All&nbsp;abouts:"</span><span style="color:#781f87;">);</span>

<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">menuAboutsPopup</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">document</span><span style="color:#781f87;">.</span><span class="identifiers">createElement</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"menupopup"</span><span style="color:#781f87;">);</span>
<span class="identifiers">menuAbouts</span><span style="color:#781f87;">.</span><span class="identifiers">appendChild</span><span style="color:#781f87;">(</span><span class="identifiers">menuAboutsPopup</span><span style="color:#781f87;">);</span>

<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">helpMenuSeparator</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">document</span><span style="color:#781f87;">.</span><span class="identifiers">getElementById</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"menu_helpShowKeybindings"</span><span style="color:#781f87;">).</span><span class="identifiers">nextSibling</span><span style="color:#781f87;">;</span>
<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">helpMenu</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">helpMenuSeparator</span><span style="color:#781f87;">.</span><span class="identifiers">parentNode</span><span style="color:#781f87;">;</span>
<span class="identifiers">helpMenu</span><span style="color:#781f87;">.</span><span class="identifiers">insertBefore</span><span style="color:#781f87;">(</span><span class="identifiers">menuAbouts</span><span style="color:#781f87;">,</span><span class="default">&nbsp;</span><span class="identifiers">helpMenuSeparator</span><span style="color:#781f87;">);</span>

<span style="color:#871f78;">for</span><span class="default">&nbsp;</span><span style="color:#781f87;">(</span><span class="identifiers">i</span><span class="default">&nbsp;</span><span style="color:#871f78;">in</span><span class="default">&nbsp;</span><span class="identifiers">abouts</span><span style="color:#781f87;">)</span><span class="default">&nbsp;</span><span style="color:#781f87;">{</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">menuitem</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">document</span><span style="color:#781f87;">.</span><span class="identifiers">createElement</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"menuitem"</span><span style="color:#781f87;">);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">menuitem</span><span style="color:#781f87;">.</span><span class="identifiers">id</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">abouts</span><span style="color:#781f87;">[</span><span class="identifiers">i</span><span style="color:#781f87;">];</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">menuitem</span><span style="color:#781f87;">.</span><span class="identifiers">openAbout</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">openAbout</span><span style="color:#781f87;">;</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">menuitem</span><span style="color:#781f87;">.</span><span class="identifiers">setAttribute</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"label"</span><span style="color:#781f87;">,</span><span class="default">&nbsp;</span><span class="identifiers">abouts</span><span style="color:#781f87;">[</span><span class="identifiers">i</span><span style="color:#781f87;">]);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">menuitem</span><span style="color:#781f87;">.</span><span class="identifiers">setAttribute</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"oncommand"</span><span style="color:#781f87;">,</span><span class="default">&nbsp;</span><span style="color:#23238e;">"this.openAbout('"</span><span class="default">&nbsp;</span><span style="color:#781f87;">+</span><span class="default">&nbsp;</span><span class="identifiers">abouts</span><span style="color:#781f87;">[</span><span class="identifiers">i</span><span style="color:#781f87;">]</span><span class="default">&nbsp;</span><span style="color:#781f87;">+</span><span class="default">&nbsp;</span><span style="color:#23238e;">"')"</span><span style="color:#781f87;">);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">menuAboutsPopup</span><span style="color:#781f87;">.</span><span class="identifiers">appendChild</span><span style="color:#781f87;">(</span><span class="identifiers">menuitem</span><span style="color:#781f87;">);</span>
<span style="color:#781f87;">}</span>

<span style="color:#871f78;">function</span><span class="default">&nbsp;</span><span class="identifiers">openAbout</span><span style="color:#781f87;">(</span><span class="identifiers">about</span><span style="color:#781f87;">)</span><span class="default">&nbsp;</span><span style="color:#781f87;">{</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">docSvc</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">Components</span><span style="color:#781f87;">.</span><span class="identifiers">classes</span><span style="color:#781f87;">[</span><span style="color:#23238e;">'@activestate.com/koDocumentService;1'</span><span style="color:#781f87;">]</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">.</span><span class="identifiers">getService</span><span style="color:#781f87;">(</span><span class="identifiers">Components</span><span style="color:#781f87;">.</span><span class="identifiers">interfaces</span><span style="color:#781f87;">.</span><span class="identifiers">koIDocumentService</span><span style="color:#781f87;">);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">doc</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">docSvc</span><span style="color:#781f87;">.</span><span class="identifiers">createDocumentFromURI</span><span style="color:#781f87;">(</span><span style="color:#23238e;">"about:"</span><span class="default">&nbsp;</span><span style="color:#781f87;">+</span><span class="default">&nbsp;</span><span class="identifiers">about</span><span style="color:#781f87;">);</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="identifiers">ko</span><span style="color:#781f87;">.</span><span class="identifiers">views</span><span style="color:#781f87;">.</span><span class="identifiers">manager</span><span style="color:#781f87;">.</span><span class="identifiers">topView</span><span style="color:#781f87;">.</span><span class="identifiers">createViewFromDocument</span><span style="color:#781f87;">(</span><span class="identifiers">doc</span><span style="color:#781f87;">,</span><span class="default">&nbsp;</span><span style="color:#23238e;">"browser"</span><span style="color:#781f87;">);</span>
<span style="color:#781f87;">}</span>

</span></pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/341/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=341&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/11/21/komodo-viewabout/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>

		<media:content url="http://dafizilla.files.wordpress.com/2008/11/aboutview.jpg" medium="image">
			<media:title type="html">aboutview</media:title>
		</media:content>
	</item>
		<item>
		<title>Simplify Mozilla profiles usage</title>
		<link>http://dafizilla.wordpress.com/2008/10/27/simplify-mozilla-profiles-usage/</link>
		<comments>http://dafizilla.wordpress.com/2008/10/27/simplify-mozilla-profiles-usage/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 13:00:34 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[flock]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[openkomodo]]></category>
		<category><![CDATA[songbird]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=33</guid>
		<description><![CDATA[I use many applications written using Mozilla technologies, these applications support the so called profiles allowing users to run multiple instances of same application but using different &#8220;configuration&#8221; environments.
As developer I use profiles to test extensions without compromise the integrity of my main env.
Running multiple profiles is described in million of places so I don&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=33&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I use many applications written using Mozilla technologies, these applications support the so called <em>profiles</em> allowing users to run multiple instances of same application but using different &#8220;configuration&#8221; environments.</p>
<p>As developer I use profiles to test extensions without compromise the integrity of my main env.</p>
<p><a href="http://support.mozilla.com/en-US/kb/Profiles">Running multiple profiles is described in million of places</a> so I don&#8217;t annoy you but I describe my own solution based on a <a href="http://www.gnu.org/software/bash/">bash</a> script that hides details.</p>
<p>Creating bash scripts to run separated application profiles requires only a bit of shell programming experience but it is a repetitive task and can be boring when you need to run different version for example firefox 2 and firefox 3, you manually must write the same script modifing only the application path.</p>
<p>My approach allow to configure applications to run in a single file and then create automatically the necessary scripts.</p>
<p>Suppose you want to run a new songbird profile, using my script you can write:</p>
<pre>dave@dafihome:~$ sb</pre>
<p>The sb script creates a new separated profile on a configured directory with a default name, but suppose you need a second (third and so on) songbird profile you can pass your preferred name</p>
<pre>dave@dafihome:~$ sb testVSW</pre>
<p>Now you need to test also Firefox 2.x and Firefox 3.x profiles, simply write</p>
<pre>dave@dafihome:~$ ff20 testVSW
dave@dafihome:~$ ff30 testVSW</pre>
<p>So you have three <strong>separated</strong> profiles with same name testVSW, how they don&#8217;t clash? The real name created by script uses the application prefix so the directories names are</p>
<ul>
<li><span style="color:#ff0000;">sb</span>testVSW</li>
<li><span style="color:#ff0000;">ff20</span>testVSW</li>
<li> <span style="color:#ff0000;">ff30</span>testVSW</li>
</ul>
<p>Do you need Komodo 4.4.x and 5.x profiles? Again</p>
<pre>dave@dafihome:~$ ko4
dave@dafihome:~$ ko5 italian-locale</pre>
<h3>Configuring applications</h3>
<p>The names sb, ff20, ff30, ko4 and ko5 are configured in &#8216;~/.moz_profilerc&#8217;</p>
<p>The file format is very similar to <a href="http://en.wikipedia.org/wiki/Fstab">fstab</a> and contains three columns describing applications.</p>
<p>The first column contains the type of application.</p>
<p>At this time it can be set to mozapp or komodo, this is necessary because mozilla apps uses MOZ_NO_REMOTE env variable to run separated profiles instead komodo uses KOMODO_USERDATADIR.</p>
<p>The second column is the script name user runs from command line (and is also the prefix added to profile directory names)</p>
<p>The third column contains the application absolute path</p>
<p>Below is shown my configuration</p>
<pre>mozapp     ff30          /opt/devel/mozilla/ff30/firefox
mozapp     ff30en        /opt/devel/mozilla/ff30en/firefox
# ff20 refers to installed firefox
mozapp     ff20          /usr/bin/firefox</pre>
<pre>mozapp     flock         /opt/devel/mozilla/flock/flock

mozapp     komp          /opt/devel/mozilla/kompozer/kompozer</pre>
<pre>mozapp     sb            /opt/devel/mozilla/Songbird/songbird
mozapp     mccoy         /opt/devel/mozilla/mccoy/mccoy</pre>
<pre>komodo     ko5           /opt/devel/mozilla/ko5/bin/komodo
komodo     ko4           /opt/devel/mozilla/Komodo-Edit-4/bin/komodo</pre>
<h3>Profile destination directories</h3>
<p>I group profiles by extension, for example inside ViewSourceWith source directory I have a &#8216;profile&#8217; subdirectory where all profiles are written, this is specified in &#8216;~/.moz_profilerc&#8217;</p>
<pre># Directory where profiles will be created, inside profile present on current directory
profileDir      $PWD/profile

# If true create profileDir silently, otherwise generate error
profileDirCreateSilently    false</pre>
<p>It is possible to write <strong>all</strong> profiles inside a specific directory setting profileDir</p>
<pre>profileDir      /devel/mozapp/profiles</pre>
<h3>Scripts destination directories</h3>
<p>The scripts sb, ff20, ff30, ko4, ko5 are symbolic links, they are generally created inside a directory present on $PATH env variable.</p>
<p>I prefer to add them inside /usr/local/bin (this should require to be root)</p>
<pre># Directory where links will be created, generally resides in env PATH
linkDestDir     /usr/local/bin</pre>
<h3>The script moz_profile.sh</h3>
<p>All operations are done using the script moz_profile.sh that allows to edit configuration file and create applications scripts.</p>
<p>Editing configuration (it opens the editor set on $VISUAL or $EDITOR env)</p>
<pre>dave@dafihome:~$ moz_profile.sh -e</pre>
<p>Creating scripts</p>
<pre>dave@dafihome:~$ moz_profile.sh -c</pre>
<p>This script greatly simplifies switching from profiles, obviously occupied disk space grows but after a profile is no more needed you can delete it without risks</p>
<p>The script, that works also on <a href="http://www.cygwin.com/">Cygwin</a>, is present on SVN repo at <a href="http://dafizilla.svn.sourceforge.net/viewvc/dafizilla/trunk/common/moz_profile_switcher/moz_profile.sh?revision=114&amp;view=markup">moz_profile.sh</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=33&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/10/27/simplify-mozilla-profiles-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>Komodo 5: how to detect when a document is attached to an existing view</title>
		<link>http://dafizilla.wordpress.com/2008/10/13/komodo-5-how-to-detect-when-a-document-is-attached-to-an-existing-view/</link>
		<comments>http://dafizilla.wordpress.com/2008/10/13/komodo-5-how-to-detect-when-a-document-is-attached-to-an-existing-view/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 13:14:15 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[openkomodo]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=187</guid>
		<description><![CDATA[Komodo 5 in under construction but developers can start to appreciate the new features working with alphas and SVN sources&#8230;
Another weapon is available to Komodo extension developer, version 5 make easier to be informed when the document attached to a view changes.
A couple of new events (remember notifications are no more supported for view operations) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=187&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="color:#808080;"><em>Komodo 5 in under construction but </em></span><span style="color:#808080;"><em>developers can start to appreciate the new features </em></span><span style="color:#808080;"><em>working with alphas and SVN sources&#8230;</em></span></p>
<p>Another <em>weapon</em> is available to Komodo extension developer, version 5 make easier to be informed when the document attached to a view changes.</p>
<p>A couple of new events (remember <a href="http://dafizilla.wordpress.com/2008/08/24/migrating-komodo-4x-to-komodo-5x/">notifications are no more supported for view operations</a>) are finally available</p>
<ul>
<li>view_document_attached</li>
<li>view_document_detaching</li>
</ul>
<p>Both events put into event.originalTarget the view involved and the view.document object is never null.</p>
<p>Obviously can be null the view.document.file property, for example when user chooses File|New File&#8230; from menu.</p>
<p>The code shown below creates a new document and attaches it to the current view, developer doesn&#8217;t need to notify using its own code but it is sufficient to listen the standard view_document_attached</p>
<pre><span style="font-size:12px;">
<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">uri</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span style="color:#23238e;">".."</span><span style="color:#781f87;">;</span>
<span style="color:#871f78;">var</span><span class="default">&nbsp;</span><span class="identifiers">newDoc</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">Components</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">.</span><span class="identifiers">classes</span><span style="color:#781f87;">[</span><span style="color:#23238e;">"@activestate.com/koDocumentService;1"</span><span style="color:#781f87;">]</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">.</span><span class="identifiers">getService</span><span style="color:#781f87;">(</span><span class="identifiers">Components</span><span style="color:#781f87;">.</span><span class="identifiers">interfaces</span><span style="color:#781f87;">.</span><span class="identifiers">koIDocumentService</span><span style="color:#781f87;">)</span>
<span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#781f87;">.</span><span class="identifiers">createDocumentFromURI</span><span style="color:#781f87;">(</span><span class="identifiers">uri</span><span style="color:#781f87;">);</span>

<span class="identifiers">newDoc</span><span style="color:#781f87;">.</span><span class="identifiers">load</span><span style="color:#781f87;">();</span>

<span style="color:#696969;font-style:italic;">//&nbsp;At&nbsp;this&nbsp;time&nbsp;Komodo&nbsp;5&nbsp;fires&nbsp;the&nbsp;view_document_attached&nbsp;event
</span><span class="identifiers">ko</span><span style="color:#781f87;">.</span><span class="identifiers">views</span><span style="color:#781f87;">.</span><span class="identifiers">manager</span><span style="color:#781f87;">.</span><span class="identifiers">currentView</span><span style="color:#781f87;">.</span><span class="identifiers">document</span><span class="default">&nbsp;</span><span style="color:#781f87;">=</span><span class="default">&nbsp;</span><span class="identifiers">newDoc</span><span style="color:#781f87;">;</span></span></pre>
<h3>view_opened bug fix</h3>
<p>The well known 4.4.x notification/event view_opened has been fixed on Komodo 5 to have the document property correctly set.</p>
<p>Prior Komodo 5 the view sent during notification had (amazingly!) the document set to null <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_eek.gif' alt='8O' class='wp-smiley' /> </p>
<p>The view_opened and view_document_attached are strictly related, when a file is opened the view receives both events.</p>
<p><a href="http://dafizilla.sourceforge.net/klint/screenshots.php">Klint</a> will use view_document_attached to disable syntax checking based on file path regular expressions (eg disable syntax checker for all &#8220;.*log&#8221; files)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=187&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/10/13/komodo-5-how-to-detect-when-a-document-is-attached-to-an-existing-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating Komodo 4.x to Komodo 5.x</title>
		<link>http://dafizilla.wordpress.com/2008/08/24/migrating-komodo-4x-to-komodo-5x/</link>
		<comments>http://dafizilla.wordpress.com/2008/08/24/migrating-komodo-4x-to-komodo-5x/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 08:11:07 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[openkomodo]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=110</guid>
		<description><![CDATA[ActiveState has released Komodo 5.0.0 alpha 1 with many exciting enhancements.
The new features, for example the multi-window, have impact on existing code that requires modifications to continue to work.
The new model based on DOM events instead of global notifications requires only few lines of new code.
All notifications changed in events are shown below, remember they [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=110&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>ActiveState has <a href="http://aspn.activestate.com/ASPN/Mail/Message/komodo-discuss/3658029">released</a> Komodo 5.0.0 alpha 1 with many exciting <a href="http://community.activestate.com/node/2680">enhancements</a>.</p>
<p>The new features, for example the <a href="http://community.activestate.com/node/2680#comment-6296">multi-window</a>, have impact on existing code that requires modifications to continue to work.</p>
<p>The <a href="http://community.activestate.com/forum-topic/5-0-changes-will-affect-macros-and-extensions">new model</a> based on DOM events instead of global notifications requires only few lines of new code.</p>
<p>All notifications changed in events are shown below, <strong>remember they are no more usable as notifications</strong>!</p>
<ul>
<li>codeintel_activated_window</li>
<li>codeintel_deactivated_window</li>
<li>current_view_changed</li>
<li>current_view_check_status</li>
<li>current_view_encoding_changed</li>
<li>current_view_language_changed</li>
<li>current_view_linecol_changed</li>
<li>view_closed</li>
<li>view_list_closed</li>
<li>view_opened</li>
</ul>
<h3>How to write new code</h3>
<p>New code must be written using the window.<a href="http://developer.mozilla.org/It/DOM:element.addEventListener">addEventListener</a> method, well known by Firefox (or Thunderbird) extensions developers.</p>
<h3>Event handlers</h3>
<p>The addEventListener method requires as parameter a callback function receiving the event object, the event&#8217;s <a href="http://developer.mozilla.org/En/DOM:event.originalTarget">originalTarget</a> attribute contains (when applicable) the <a href="http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/views/koIViews.idl#126">koIViews</a> associated with event.</p>
<h3>Removing listeners</h3>
<p>When a window is closed every resource associated to it must be released so you must call the <a href="http://developer.mozilla.org/En/DOM:element.removeEventListener">removeEventListener</a> for every added listener.</p>
<p>The best place to remove listeners is inside the function associated to <a href="http://developer.mozilla.org/index.php?title=En/DOM/Window.onunload&amp;highlight=unload">unload</a> event.</p>
<h3>Accessing to <strong>&#8216;this&#8217;</strong> javascript object</h3>
<p>When addEventListener is called from a prototyped object or simply from a namedspace method we must be sure the callback works with correct javascript &#8216;this&#8217; object.</p>
<p>The Komodo code uses a well known approach; it declares a nested function and passes it to addEventListener</p>
<p><span style="color:#871f78;">var</span> moreKomodo = {<br />
addListeners : <span style="color:#871f78;">function() {</span><br />
<span style="color:#871f78;">var</span> self = <span style="color:#871f78;">this;</span></p>
<p><span style="color:#871f78;"> this</span>.handle_current_view_changed_setup<span style="color:#871f78;"> = function(</span>event<span style="color:#871f78;">) {</span><br />
self.onCurrentViewChanged<span style="color:#871f78;">(</span>event<span style="color:#871f78;">);</span><br />
<span style="color:#871f78;">};</span></p>
<p>window.addEventListener(<span style="color:#23238e;">&#8216;current_view_changed&#8217;</span>,<br />
<span style="color:#871f78;"> this</span>.handle_current_view_changed_setup, false<span style="color:#871f78;">);<br />
},</span></p>
<p>_updateLockEdit<span style="color:#871f78;"> : function(</span>view<span style="color:#871f78;">) {</span><br />
&#8230;<br />
<span style="color:#871f78;"> },<br />
};</span></p>
<p>So the onCurrentViewChanged method can continue to work with the moreKomodo (this) instance</p>
<p>onCurrentViewChanged <span style="color:#871f78;">: function(</span>event) {<br />
<span style="color:#871f78;"> var</span> currView <span style="color:#871f78;">=</span> event.originalTarget<span style="color:#871f78;">;</span></p>
<p><span style="color:#871f78;">this</span>._updateLockEdit<span style="color:#871f78;">(</span>currView<span style="color:#871f78;">);</span><br />
<span style="color:#871f78;">},</span></p>
<h3>How to dispatch events</h3>
<p>Should be necessary to dispatch events, for example <a href="http://dafizilla.sourceforge.net/morekomodo/index.php">MoreKomodo</a> after renaming/moving a file requests to refresh title bar sending a current_view_changed.</p>
<p><a href="http://developer.mozilla.org/index.php?title=En/DOM/Element.dispatchEvent">Dispatching</a> DOM events is easy but under Komodo developers can use the helper class domutils that contains the fireEvent utility method.</p>
<p>The xul file must contain the xtk inclusion</p>
<p><span style="color:#0032ff;">&lt;script</span> <span style="color:#871f78;">src=</span><span style="color:#23238e;">&#8220;chrome://xtk/content/xtk.js&#8221;</span> <span style="color:#871f78;">type=</span><span style="color:#23238e;">&#8220;application/x-javascript;version=1.7&#8243;</span><span style="color:#0032ff;">/&gt;</span></p>
<p>Then the js file must contain the domutil inclusion</p>
<p>xtk.include(<span style="color:#23238e;">&#8220;domutils&#8221;</span>);</p>
<p>Then you can call the fireEvent</p>
<p><span style="color:#871f78;">if (typeof(</span>xtk.domutils.fireEvent<span style="color:#871f78;">) !=</span> <span style="color:#23238e;">&#8220;undefined&#8221;</span><span style="color:#871f78;">) {</span><br />
xtk.domutils.fireEvent<span style="color:#871f78;">(</span>view, <span style="color:#23238e;">&#8216;current_view_changed&#8217;</span><span style="color:#871f78;">);</span><br />
<span style="color:#871f78;">}</span></p>
<p>If you want to write code compatible with 4.4.x version you need to test the fireEvent existence as shown above</p>
<h3>Benefits from Gecko 1.9</h3>
<p>Komodo 5 uses the Firefox 3 Gecko version and this is immediately visibile, a faster startup but most important many bugs resolved.</p>
<p>The <a href="http://community.activestate.com/forum-topic/toolbar-buttons-tooltip-problems">tooltip problem</a> on MoreKomodo finally disappeared <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I don&#8217;t know if related to Gecko 1.9 but finally the mouse scroll wheel works on file tab.</p>
<h3>Conclusion</h3>
<p>I like very much the new Komodo, developers should be hurted from these refactoring but they are simple and easy to do also on complex extensions.</p>
<p>I&#8217;ve made <a href="http://dafizilla.sourceforge.net/morekomodo/index.php">MoreKomodo</a>, <a href="http://dafizilla.sourceforge.net/tabswitcher/">TabSwitcher</a> and <a href="http://dafizilla.sourceforge.net/klint/index.php">Klint</a> compatible in about two hours <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dafizilla.wordpress.com/110/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dafizilla.wordpress.com/110/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=110&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/08/24/migrating-komodo-4x-to-komodo-5x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>Alea iacta est: OpenKomodo localized</title>
		<link>http://dafizilla.wordpress.com/2008/08/07/alea-iacta-est-openkomodo-localized/</link>
		<comments>http://dafizilla.wordpress.com/2008/08/07/alea-iacta-est-openkomodo-localized/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 16:59:01 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[babelzilla]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[openkomodo]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=96</guid>
		<description><![CDATA[Alea iacta est the first OpenKomodo lang pack has landed.
I&#8217;ve already spoken about KomodoEdit localization and now the french Babelzilla team has terminated the first version, the official announcement has posted at Mozilla Europe site.
I&#8217;m very happy, I&#8217;ve developed macros to simplify lang pack testing and created a simple webapp to convert babelzilla locale tarballs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=96&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://en.wikipedia.org/wiki/Alea_iacta_est">Alea iacta est</a> the first OpenKomodo lang pack has landed.</p>
<p>I&#8217;ve already spoken about <a href="http://dafizilla.wordpress.com/2008/07/12/komodoedit-localization/">KomodoEdit localization</a> and now the french <a href="http://www.babelzilla.org/">Babelzilla</a> team has terminated the first version, the <a href="http://blogs.mozilla-europe.org/?post/2008/08/05/Open-Komodo-first-localized-langpack">official announcement</a> has posted at <a href="http://blogs.mozilla-europe.org">Mozilla Europe</a> site.</p>
<p>I&#8217;m very happy, I&#8217;ve developed <a href="http://www.babelzilla.org/forum/index.php?s=&amp;showtopic=4480&amp;view=findpost&amp;p=43070">macros</a> to simplify lang pack testing and created a simple <a href="http://dafizilla.sourceforge.net/bz2kolangpack/">webapp</a> to convert babelzilla locale tarballs to installable xpi langpacks.</p>
<p>Maybe ActiveState guys hate me because the translation <a href="http://community.activestate.com/forum-topic/localizing-komodo-using-babelzilla-dream-team">idea started from me</a>, but I believe localized (and open) softwares are simpler to use in schools, poor information environments and any low profile educational eco-systems.</p>
<p>The italian lang pack is coming soon, I will be very proud to use KomodoEdit in my mother tongue.</p>
<p>I hope other localizations can arrive very soon</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dafizilla.wordpress.com/96/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dafizilla.wordpress.com/96/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=96&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/08/07/alea-iacta-est-openkomodo-localized/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>KomodoEdit localization</title>
		<link>http://dafizilla.wordpress.com/2008/07/12/komodoedit-localization/</link>
		<comments>http://dafizilla.wordpress.com/2008/07/12/komodoedit-localization/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 06:01:23 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[babelzilla]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[openkomodo]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=63</guid>
		<description><![CDATA[I&#8217;ve asked to babelzilla community if they are interested to translating KomodoEdit and immediately they reply to me that this is possible.
So I&#8217;ve posted into Komodo forum to understand if ActiveState is interested, too.
Well, all is ready and I&#8217;m glad to have started this process.
I don&#8217;t know what this experiment will produce but I&#8217;m happy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=63&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve asked to <a href="http://www.babelzilla.org/">babelzilla</a> community if they are interested to translating KomodoEdit and immediately they reply to me that this is possible.</p>
<p>So I&#8217;ve <a href="http://community.activestate.com/forum-topic/localizing-komodo-using-babelzilla-dream-team">posted</a> into Komodo forum to understand if ActiveState is interested, too.</p>
<p>Well, all is ready and I&#8217;m glad to have started this process.</p>
<p>I don&#8217;t know what this experiment will produce but I&#8217;m happy to see collaborations between so different communities.</p>
<p>I hope to see very soon the first KomodoEdit in non english language <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dafizilla.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dafizilla.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=63&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/07/12/komodoedit-localization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
		<item>
		<title>Komodo and readonly behavior</title>
		<link>http://dafizilla.wordpress.com/2008/03/15/komodo-and-readonly-behavior/</link>
		<comments>http://dafizilla.wordpress.com/2008/03/15/komodo-and-readonly-behavior/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 10:30:03 +0000</pubDate>
		<dc:creator>dafi</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[komodo]]></category>
		<category><![CDATA[morekomodo]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[openkomodo]]></category>
		<category><![CDATA[scintilla]]></category>

		<guid isPermaLink="false">http://dafizilla.wordpress.com/?p=44</guid>
		<description><![CDATA[Komodo editor handles read-only in a incomplete manner, at least for me.
The truly question is &#8220;what read-only means?&#8221; A file can be read-only but also an editor buffer can be read-only.
Komodo handles read-only files is a smart way, it opens file and shows a little lock on editor tab but user can edit the text [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=44&subd=dafizilla&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Komodo editor handles <i>read-only</i> in a incomplete manner, at least for me.</p>
<p>The truly question is &#8220;what <i>read-only</i> means?&#8221; A file can be read-only but also an editor buffer can be read-only.</p>
<p>Komodo handles read-only files is a smart way, it opens file and shows a little lock on editor tab but user can edit the text buffer, it isn&#8217;t marked as read-only.</p>
<p>If user tries to save a warning message pops up allowing to choose if saving must be forced or cancelled.</p>
<p>Cool sure but I want to mark editor buffer as temporary read-only irrespective to file flag, this feature is missing on Komodo but scintilla has a readonly property.</p>
<p>I&#8217;ve added to <a href="http://dafizilla.sourceforge.net/morekomodo/">MoreKomodo</a> the ability to mark editor buffers as &#8220;edit locked&#8221;.</p>
<p>I think &#8220;edit locked&#8221; sounds good then &#8220;buffer read-only&#8221;.</p>
<p>The code is straightforward, simply sent the scintilla readonly property as shown below</p>
<pre>     onToogleLockEdit : function() {
        var view = ko.views.manager.currentView;
        view.scintilla.scimoz.readOnly = !view.scintilla.scimoz.readOnly;
    }</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dafizilla.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dafizilla.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dafizilla.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dafizilla.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dafizilla.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dafizilla.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dafizilla.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dafizilla.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dafizilla.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dafizilla.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dafizilla.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dafizilla.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dafizilla.wordpress.com&blog=887576&post=44&subd=dafizilla&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dafizilla.wordpress.com/2008/03/15/komodo-and-readonly-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5759d7f64a710425e4ab730ba7a8311e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dafi</media:title>
		</media:content>
	</item>
	</channel>
</rss>