<?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/"
	>

<channel>
	<title>Mark's World &#187; javascript</title>
	<atom:link href="http://www.digitalspace.ca/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalspace.ca</link>
	<description>GNU Not just another ranting blog</description>
	<lastBuildDate>Thu, 14 Jan 2010 05:35:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>North West Mozilla Development Camp</title>
		<link>http://www.digitalspace.ca/2008/12/01/north-west-mozilla-development-camp</link>
		<comments>http://www.digitalspace.ca/2008/12/01/north-west-mozilla-development-camp#comments</comments>
		<pubDate>Mon, 01 Dec 2008 18:51:44 +0000</pubDate>
		<dc:creator>Mark Lise</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[ActiveState]]></category>
		<category><![CDATA[Flock]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[NorthWestMozDev]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://www.digitalspace.ca/2008/12/01/north-west-mozilla-development-camp</guid>
		<description><![CDATA[<p>&#160; </p>
<p>This past weekend was the NorthWestMozDev meetup.&#160; What is that you say?&#160; Well, the group provides a simple mechanism for developers in the North West
(US/Canada) using Mozilla related technologies to communicate with each
other (Yes I quote that straight from the Google group).</p>
<p>It was the second installment of such meetings, the first was in downtown [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mozilla.org/images/product-firefox-50.png" style="" title="" alt="" />&nbsp; <img src="http://www.mozdev.org/sharedimages/applications/flock.png" style="" title="" alt="" /></p>
<p>This past weekend was the <a href="http://groups.google.ca/group/northwestmozdev">NorthWestMozDev</a> meetup.&nbsp; What is that you say?&nbsp; Well, the group provides a simple mechanism for developers in the North West<br />
(US/Canada) using Mozilla related technologies to communicate with each<br />
other (Yes I quote that straight from the Google group).</p>
<p>It was the second installment of such meetings, the first was in downtown Vancouver at <a href="http://activestate.com/index.mhtml">ActiveState</a>.&nbsp; There were a number of interesting talks &#8211; one I was most interested in was the <a href="http://blog.lizardwrangler.com/2008/09/11/proposed-2010-goals/">Mozilla Labs/2010 Goal discussion</a> put on by <a href="http://commonspace.typepad.com/commonspace/">Mark Surman</a> and <a href="http://ascher.ca/blog/">David Ascher</a>.&nbsp; (You should <a href="http://blog.lizardwrangler.com/2008/09/11/proposed-2010-goals/">check it out</a>)</p>
<p>One of the surprising discussions (for me) from this meetup was somewhat political/activist/social change related.&nbsp; How can Mozilla use it&#8217;s brand and following to encourage more openess on the web, support other non-profits or organizations trying to better &#8220;the greater good&#8221;.</p>
<p>Interesting stuff all around, I&#8217;m glad some <a href="http://www.flock.com/">Flock</a> folk could make it out. <img src='http://www.digitalspace.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalspace.ca/2008/12/01/north-west-mozilla-development-camp/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mozilla Python XPCOM/DOM in Linux</title>
		<link>http://www.digitalspace.ca/2008/01/14/mozilla-python-xpcomdom-in-linux</link>
		<comments>http://www.digitalspace.ca/2008/01/14/mozilla-python-xpcomdom-in-linux#comments</comments>
		<pubDate>Tue, 15 Jan 2008 04:52:00 +0000</pubDate>
		<dc:creator>Mark Lise</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xpcom]]></category>
		<category><![CDATA[xulrunner]]></category>

		<guid isPermaLink="false">http://www.digitalspace.ca/2008/01/14/mozilla-python-xpcomdom-in-linux</guid>
		<description><![CDATA[<p>Recently I&#8217;ve been dabbling in python and I wanted to figure out a way to get it working in xulrunner.  My guide assumes you already know the basics of making a xulrunner application &#8211; see this guide first otherwise.  The two main things to really worry about are:</p>

build the source for xulrunner
build python [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been dabbling in <a href="http://www.python.org/" target="_blank">python</a> and I wanted to figure out a way to get it working in <a href="http://developer.mozilla.org/en/docs/XULRunner" target="_blank">xulrunner</a>.  My guide assumes you already know the basics of making a xulrunner application &#8211; see <a href="http://developer.mozilla.org/en/docs/Getting_started_with_XULRunner">this guide</a> first otherwise.  The two main things to really worry about are:</p>
<ul>
<li>build the source for xulrunner</li>
<li>build python xpcom/dom into xulrunner</li>
</ul>
<p><strong>Step One </strong></p>
<p>Checkout the client script from any directory (for these purposes i&#8217;ll say &#8220;/home/mark/development&#8221;):</p>
<blockquote><p>cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk</p>
<p>This will checkout the client.mk file which will be used to get the mozilla source.  A new directory will be created &#8220;mozilla&#8221; and you&#8217;ll find &#8220;client.mk&#8221; inside.</p></blockquote>
<p><strong>Step Two</strong></p>
<blockquote><p>Once step one is completed, change into the mozilla directory where the client.mk file is and create a new file called &#8220;.mozconfig&#8221;.  It is important to be named exactly how it sounds,dot-mozconfig.  This is the configuration file that will be used to checkout the specific source code that you want (xulrunner) and build it with the appropriate flags enabled.  This is mine:</p></blockquote>
<blockquote>
<blockquote><p>ac_add_options &#8211;disable-optimize &#8211;enable-debug<br />
mk_add_options MOZ_OBJDIR=@topsrcdir@/obj-xulrunner<br />
mk_add_options MOZ_BUILD_PROJECTS=&#8221;xulrunner&#8221;<br />
mk_add_options MOZ_CO_PROJECT=&#8221;xulrunner&#8221;<br />
ac_add_app_options xulrunner &#8211;enable-application=xulrunner<br />
ac_add_options &#8211;enable-default-toolkit=cairo-gtk2<br />
ac_add_options &#8211;disable-javaxpcom<br />
ac_add_options &#8211;enable-extensions=python,default<br />
ac_add_options &#8211;enable-svg<br />
ac_add_options &#8211;enable-xft<br />
ac_add_options &#8211;disable-tests</p></blockquote>
<p>Explanation of some of the key entries:</p>
<blockquote><p>ac_add_options &#8211;enable-extensions=python,default | This tells the build script to checkout and build both the python/xpcom and python/dom code.  You&#8217;re probably wondering what the difference is, and it&#8217;s pretty straightforward &#8211; python/dom is for using python instead of javascript for your xul handling; python/xpcom is to be able to embed python in an xpcom module.</p>
<p>ac_add_options &#8211;enable-default-toolkit=cairo-gtk2 | This is a MUST for linux-based systems.  You&#8217;ll get compile errors if you don&#8217;t!</p></blockquote>
</blockquote>
<p><strong>Step Three</strong></p>
<blockquote><p>Save the .mozconfig file and then execute:</p>
<blockquote><p>make -f client.mk checkout</p></blockquote>
<p>This will checkout all the xulrunner source, python source, and anything else relevant to building based on what you put in the .mozconfig file.  I enabled svg just because I wanted to play around with that too <img src='http://www.digitalspace.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Now, normally at this stage you&#8217;d go on to compiling the source but as a result of a bug you&#8217;ll need get the following patch and apply it before you start the build:</p>
<p><a href="http://svn.openkomodo.com/openkomodo/view/openkomodo/trunk/mozilla/patches-new/HEAD/pyxpcom_pyxultest_make.patch?rev=132">http://svn.openkomodo.com/openkomodo/view/openkomodo/trunk/mozilla/patches-new/HEAD/pyxpcom_pyxultest_make.patch?rev=132</a></p>
<p>Please read <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=392210" target="_blank">mozilla bug #392210</a> for detailed explanation why.  The short and sweet is that the Makefile for linux screws up when trying to build the python object file.</p></blockquote>
<p><strong>Step Four</strong></p>
<blockquote><p>Time to build the source!  Execute the following:</p></blockquote>
<blockquote>
<blockquote><p>make -f client.mk build</p></blockquote>
<p>This may take a while. <img src='http://www.digitalspace.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
<p><strong>Step Five</strong></p>
<blockquote><p>Change into your mozilla object dir &#8211; this was set using:</p>
<blockquote><p>mk_add_options MOZ_OBJDIR=@topsrcdir@/obj-xulrunner</p></blockquote>
<p>In this case it will be &#8220;/home/mark/development/mozilla/obj-xulrunner/xulrunner&#8221;.  Now execute the following command:</p>
<blockquote><p>make package</p></blockquote>
<p>You don&#8217;t really need this to do initial development but I like to do it anyways and then move the whole xulrunner package over to a working project dir so that I can run my application in it&#8217;s own space without relying on my mozilla/obj directory.   This will probably take a while on your computer.</p></blockquote>
<p><strong>Step Six</strong></p>
<blockquote><p>Now you&#8217;ve successfully built xulrunner with python available for scripting!  Copy the dist/xulrunner directory to your project xulrunner directory:</p></blockquote>
<blockquote>
<blockquote><p>cp -a &#8220;/home/mark/development/mozilla/obj-xulrunner/xulrunner/dist/xulrunner&#8221; &#8220;/home/mark/development/my_cool_project/&#8221;</p></blockquote>
<p>You&#8217;ll have a fully encapsulated &#8220;xulrunner&#8221; platform to build your first python xulrunner-based app!   Hold on tho, you&#8217;re not quite done.  You now need to setup some enivronment variables.</p></blockquote>
<p><strong>Step Seven</strong></p>
<blockquote><p>I put the following into a function called &#8220;env_coolproj&#8221; inside my  .bashrc so that when I want to do development on this cool project, I can just execute &#8220;env_coolproj; cd $c&#8221; and it will setup all the environment variables for me nicely and cd&#8217;s me to the main application root directory.   I have setup my project using subversion so I&#8217;ve followed the standard svn repository layout.</p></blockquote>
<blockquote><p>export COOL_PROJECT_DEV_DIR=/home/mark/development/my_cool_project<br />
export PYTHONPATH=$PYTHONPATH:$COOL_PROJECT_DEV_DIR/my_cool_project/xulrunner/python MOZILLA_FIVE_HOME=$COOL_PROJECT_DEV_DIR/trunk/my_cool_project/xulrunner/<br />
export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME<br />
export c=$COOL_PROJECT_DEV_DIR/trunk/my_cool_project</p></blockquote>
<p>Now you&#8217;ve got a setup ready for python development!  The only thing you need to change in your xul to switch from javascript to python scripting is add the script-type=&#8221;application/x-python&#8221; to the window/page element (the first element not including the &lt;?xml/&gt; tags), and add &lt;script type=&#8221;application/x-python&#8221;src=&#8221;chrome://mycoolproj/content/main.py&#8221;/&gt; inside of that element.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalspace.ca/2008/01/14/mozilla-python-xpcomdom-in-linux/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
