<?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>UnearthedMedia&#187; Programming</title>
	<atom:link href="http://unearthedmedia.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://unearthedmedia.com</link>
	<description>Business &#38; Technology</description>
	<lastBuildDate>Thu, 15 Apr 2010 18:46:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Singleton Theory with javascript and prototype</title>
		<link>http://unearthedmedia.com/2010/02/02/singleton-theory-with-javascript-and-prototype/</link>
		<comments>http://unearthedmedia.com/2010/02/02/singleton-theory-with-javascript-and-prototype/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 14:42:22 +0000</pubDate>
		<dc:creator>Kevin Harris</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[prototypejs]]></category>
		<category><![CDATA[dispatch]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[prototype javascript]]></category>
		<category><![CDATA[singleton theory]]></category>

		<guid isPermaLink="false">http://unearthedmedia.com/?p=101</guid>
		<description><![CDATA[I was searching for a way in javascript to handle classes dispatching events and listening for events. Generally javascript only has event methods for elements and not objects. Then I stumbbled onto http://www.truerwords.net where he has developed some event classes to mix-in to your own objects that give them the ability to listen and dispatch [...]]]></description>
			<content:encoded><![CDATA[<p>I was searching for a way in javascript to handle classes dispatching events and listening for events. Generally javascript only has event methods for elements and not objects. Then I stumbbled onto<span id="more-101"></span> <a href="http://www.truerwords.net/articles/web-tech/custom_events.html" target="_blank">http://www.truerwords.net</a> where he has developed some event classes to mix-in to your own objects that give them the ability to listen and dispatch events.  You must be using the <a title="prototype javascript library" href="http://www.prototypejs.org/" target="_blank">prototype javascript library</a> for these to work as that is what they were wrote with as well. Its pretty straight forward to use. Basically you include the event  js file  <code>&lt;script src="js/Events/event_mixins.js"&gt;&lt;/script&gt;</code> after this you will setup your classes as such</p>
<pre>
<pre class="brush: javascript">
var classObj= Class.create();

Object.extend(classObj.prototype, {

     events: [&#039;communicationTab&#039;, &#039;generalTab&#039;, &#039;scheduleTab&#039;, &#039;billingTab&#039;, &#039;financialAidTab&#039;, &#039;repositoryTab&#039;, &#039;sendEmail&#039;],//events fire from this class

     initialize: function() {
          //add listeners for this object
          this.listenForEvent( classListeningForEventFrom, &#039;loadData&#039;, true );
     },
      //this makes the class able to dispatch events
      onLoadData: function(evt) {}
});

//this makes the class able to listen for events Object.extend( classObj.prototype, , Event.Listener );
Object.extend( classObj.prototype, , Event.Publisher );
//To dispatch an event from this class its rather simple. All events that this class can dispatch should be set in your events array (more about this later).
this.dispatchEvent(&#039;sendEmail&#039;, {emailTo:me@here.com});
</pre>
<p>the second parameter in the dispatchEvent is data you want to pass to the receiving listener.  For a class to be a listener you must put the listenForEvent on the object. This does not have to be in the constructor but if the class is always listening for these events I would recommend putting it. By default the listener class will try to call a method in the listening class the same name as the event being listened for except it adds &#8220;on&#8221; to the event. So if you listening for the event &#8220;loadData&#8221; then your method in the class should be &#8220;onLoadData&#8221;  This is a fantastic approach to the issue with javascript and events. I don&#8217;t know why other libraries don&#8217;t incorporate something like this for their events. If you want to have a global listener so you don&#8217;t have to specify a specific class that your class is listening for I highly recommend looking at the Event Broker he has wrote.</p>
<p><br/><br/><script type="text/javascript"><!--
google_ad_client = "pub-9330786219612313";
/* post ads at bottom */
google_ad_slot = "4246337469";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://unearthedmedia.com/2010/02/02/singleton-theory-with-javascript-and-prototype/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A new start, a new blog</title>
		<link>http://unearthedmedia.com/2009/01/02/a-new-start-a-new-blog/</link>
		<comments>http://unearthedmedia.com/2009/01/02/a-new-start-a-new-blog/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 01:49:13 +0000</pubDate>
		<dc:creator>Kevin Harris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[king college]]></category>
		<category><![CDATA[MBA]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Typo3]]></category>

		<guid isPermaLink="false">http://unearthedmedia.com/?p=4</guid>
		<description><![CDATA[I am getting  a new start on life, at least that&#8217;s the way I am seeing it. In the middle of all the economic chaos God has blessed my wife and I with the ability to be able to sell our house and move closer to the center of the tri cities. On top of [...]]]></description>
			<content:encoded><![CDATA[<p>I am getting  a new start on life, at least that&#8217;s the way I am seeing it. In the middle of all the economic chaos God has blessed my wife and I with the ability to be able to sell our house and move closer to the center of the tri cities. On top of this I will be starting a sixteen month MBA program at <a title="King College Bristol, TN" href="http://www.king.edu" target="_blank">King College</a> where I work .</p>
<p>Since I won&#8217;t be busy enough working full-time and attending the MBA program full-time, I figured why not restart your blog! In reality I thought this would be a great place for me to explain and discuss ideas and theories I will be discovering while attending the business program, but at the same time I don&#8217;t want to completely focus on business and economics and leave out my passion for technology, particularly programming and design. You might not think that business and programming go together but they go together like peanut butter and jelly. </p>
<p>I don&#8217;t know exactly what business topics we will be discussed yet but as I continue my journey through the MBA I am sure there will be many topics of interest. As for the programming/technology I know I will be posting hints and helpful tips on TYPO3. I am trying to convience the powers to be that this would be a wise system to convert our websites too so I have dove in head first over this christmas break to see how the system works and what it will take to convert our current websites to work in the TYPO3 system.</p>
<p>Please feel free to comment and ask questions on this blog. I will do my best to answer and comment back but as you can see my time might be limited.</p>
<p>Thanks for reading and I hope you enjoy.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://unearthedmedia.com/2009/01/02/a-new-start-a-new-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
