<?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>Cameron McKay &#187; web</title>
	<atom:link href="http://cdmckay.org/blog/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://cdmckay.org/blog</link>
	<description>Programming and Game Development</description>
	<lastBuildDate>Tue, 11 Oct 2011 05:05:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JSS in Action</title>
		<link>http://cdmckay.org/blog/2009/06/29/jss-in-action/</link>
		<comments>http://cdmckay.org/blog/2009/06/29/jss-in-action/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 07:05:15 +0000</pubDate>
		<dc:creator>cdmckay</dc:creator>
				<category><![CDATA[JSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[reneelung]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://couchware.ca/blogs/cam/?p=598</guid>
		<description><![CDATA[The first page to use JSS in the wild has recently been launched: reneelung.ca. The page was designed by my fiancee Renee Lung and programmed by me. You&#8217;ll notice if you look at the source that there is no JavaScript in the traditional sense. The page consists of three JavaScript files: the jQuery library, the [...]]]></description>
			<content:encoded><![CDATA[<p>The first page to use JSS in the wild has recently been launched: <a href="http://reneelung.ca">reneelung.ca</a>.</p>
<p>The page was designed by my fiancee Renee Lung and programmed by me.  You&#8217;ll notice if you look at the source that there is no JavaScript in the traditional sense.  The page consists of three JavaScript files: the jQuery library, the JSS plugin, and a JSS stylesheet.</p>
<p>I hope this gives people an idea of the power of JSS.  Read on for an annotated version of the JSS stylesheet used on that site (as of June 29th 2009).</p>
<p><span id="more-598"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">jss</span>.<span style="color: #660066;">declare</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Fades the background in on each page.</span>
<span style="color: #006600; font-style: italic;">// You'll notice the square bracket notation.  This is used to </span>
<span style="color: #006600; font-style: italic;">// attach multiple JSS commands to a single event property.  </span>
<span style="color: #006600; font-style: italic;">// They run in the order they are declared.</span>
<span style="color: #3366CC;">&quot;.background&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  setup<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span> 
    <span style="color: #3366CC;">&quot;set-css (.background) display none&quot;</span><span style="color: #339933;">,</span> 
    <span style="color: #3366CC;">&quot;fade-in (.background) normal&quot;</span> 
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
<span style="color: #006600; font-style: italic;">// This block only runs on the front page.</span>
<span style="color: #006600; font-style: italic;">// It is used to show a different button mouse-over </span>
<span style="color: #006600; font-style: italic;">// image on the frontpage.</span>
<span style="color: #3366CC;">&quot;.front .button&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  setup<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span> 
    <span style="color: #006600; font-style: italic;">// This saves the name of mouseover image </span>
    <span style="color: #006600; font-style: italic;">// to the element so that the mouseover code</span>
    <span style="color: #006600; font-style: italic;">// (down further) can use it.</span>
    <span style="color: #006600; font-style: italic;">// The {id} is an attribute getter.</span>
    <span style="color: #006600; font-style: italic;">// Thus, if the id for one of the buttons is</span>
    <span style="color: #006600; font-style: italic;">// &quot;portfolio&quot;, then the class-over variable</span>
    <span style="color: #006600; font-style: italic;">// will be &quot;front-portfolio-over&quot;.</span>
    <span style="color: #3366CC;">&quot;set-data class-over front-{id}-over&quot;</span><span style="color: #339933;">,</span>       
    <span style="color: #3366CC;">&quot;preload-image gfx/buttons/front-{link-to}-over.png&quot;</span>
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// This block runs on any page except the front page.</span>
<span style="color: #3366CC;">&quot;#window:not(.front) .button&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  setup<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span> 
    <span style="color: #3366CC;">&quot;set-data class-over {id}-over&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;preload-image gfx/buttons/{link-to}-over.png&quot;</span>
  <span style="color: #009900;">&#93;</span>  
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
<span style="color: #006600; font-style: italic;">// This the code that is used to transition</span>
<span style="color: #006600; font-style: italic;">// between pages.</span>
<span style="color: #3366CC;">&quot;.button&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>    
  <span style="color: #006600; font-style: italic;">// This is the rollover code.  Pretty simple eh?</span>
  hover<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;toggle-class [class-over] | toggle-class [class-over]&quot;</span><span style="color: #339933;">,</span>
  click<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span>
    <span style="color: #006600; font-style: italic;">// This make the background fade out </span>
    <span style="color: #006600; font-style: italic;">// and then links the user to the link</span>
    <span style="color: #006600; font-style: italic;">// provided in the HTML.</span>
    <span style="color: #3366CC;">&quot;fade-out (.background) normal !then-link-to {@link-to}.html&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;fade-out (#portfolio-window) normal&quot;</span>
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// This a custom user function.  They can</span>
<span style="color: #006600; font-style: italic;">// be tagged on to most JSS commands</span>
<span style="color: #006600; font-style: italic;">// (in cases where you'd have things like</span>
<span style="color: #006600; font-style: italic;">// a callback for an animation).</span>
<span style="color: #3366CC;">&quot;then-link-to&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>link_target<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>  
  <span style="color: #003366; font-weight: bold;">var</span> event <span style="color: #339933;">=</span> $.<span style="color: #660066;">Event</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  event.<span style="color: #660066;">data</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> arguments<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> link_target <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;link-to&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// This is the code that handles making the </span>
<span style="color: #006600; font-style: italic;">// the images on the portfolio page &quot;glow&quot;</span>
<span style="color: #006600; font-style: italic;">// when you mouseover them.</span>
<span style="color: #3366CC;">&quot;div.artwork img&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// This &quot;setup&quot; event property is used</span>
  <span style="color: #006600; font-style: italic;">// to basically create a variable...</span>
  setup<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span> 
    <span style="color: #3366CC;">&quot;set-data opacity-off 0.3&quot;</span><span style="color: #339933;">,</span> 
    <span style="color: #3366CC;">&quot;set-css opacity [opacity-off]&quot;</span>
  <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// ... that is then used by the &quot;hover&quot;</span>
  <span style="color: #006600; font-style: italic;">// event property to set the opacity.</span>
  hover<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;fade-to 1 | fade-to [opacity-off]&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// The next block as well as the </span>
<span style="color: #006600; font-style: italic;">// two following #link-page-n classes are</span>
<span style="color: #006600; font-style: italic;">// an admittedly hack way of making pages,</span>
<span style="color: #006600; font-style: italic;">// but get the job done for a relatively simple</span>
<span style="color: #006600; font-style: italic;">// page.  If you were dealing with anymore</span>
<span style="color: #006600; font-style: italic;">// than a couple pages, this method would </span>
<span style="color: #006600; font-style: italic;">// quickly get unwieldly.</span>
&nbsp;
<span style="color: #3366CC;">&quot;#pager a&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  click<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span> 
    <span style="color: #3366CC;">&quot;set-css (.portfolio-window) display none&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;set-css (#pager a) font-weight normal&quot;</span>
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #3366CC;">&quot;#link-page-1&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  font_weight<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;bold&quot;</span><span style="color: #339933;">,</span>
  click<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span>
    <span style="color: #3366CC;">&quot;set-css (#portfolio-page-1) display block&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;set-css font-weight bold&quot;</span>
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #3366CC;">&quot;#link-page-2&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  click<span style="color: #339933;">:</span> 
  <span style="color: #009900;">&#91;</span>
    <span style="color: #3366CC;">&quot;set-css (#portfolio-page-2) display block&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;set-css font-weight bold&quot;</span>
  <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// This is using JSS to make an image</span>
<span style="color: #006600; font-style: italic;">// into a hyperlink.</span>
<span style="color: #3366CC;">&quot;#pdf-button&quot;</span><span style="color: #339933;">:</span>
<span style="color: #009900;">&#123;</span>
  click<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;link-to {resume-link}&quot;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://cdmckay.org/blog/2009/06/29/jss-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSS 1.0.0-beta2 released!</title>
		<link>http://cdmckay.org/blog/2009/05/24/jss-100-beta-2-released/</link>
		<comments>http://cdmckay.org/blog/2009/05/24/jss-100-beta-2-released/#comments</comments>
		<pubDate>Mon, 25 May 2009 04:20:08 +0000</pubDate>
		<dc:creator>cdmckay</dc:creator>
				<category><![CDATA[JSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[1.0.0-beta2]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://couchware.ca/blogs/cam/?p=591</guid>
		<description><![CDATA[I&#8217;m proud to announce the release of JSS 1.0.0-beta2. Here are the changes: Fixed the way that {attributes} are handled when not using a selector. They should now properly grab the attribute from element that fired the event. Made it so each time a declaration block is applied, all the event handlers bound by JSS [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce the release of <a href="http://javascript-stylesheets.googlecode.com/files/jquery.jss-1.0.0-beta2.js">JSS 1.0.0-beta2</a>.  Here are the changes:</p>
<ul>
<li>Fixed the way that {attributes} are handled when not using a selector.  They should now properly grab the attribute from element that fired the event.</li>
<li>Made it so each time a declaration block is applied, all the event handlers bound by JSS to the elements returned by that selector are unbound.</li>
<li>Fixed the semantics of the {@attr} syntax.  It now means that the eventTarget should always be used, regardless of whether or not a selector is defined.  In order to access the attributes of a selector use {@attr} now.</li>
<li>Added two new commands: set-data and remove-data.  These commands use the jQuery functions data() and removeData().  They are similar to set-attr and remove-attr except instead of storing the information in an attribute, they are stored in a table.  Data is accessed by using [data] syntax, similar to the {attr} syntax.</li>
<li>Added new event property: setup.  This event is fired when the JSS stylesheet is loaded (setup).  This is useful in certain cases where the user wants to setup some variables using set-data.</li>
<li>Made it so you can now set scroll-top and scroll-left via the set-attr command.</li>
<li>Added trigger command.  It can be used to trigger event properties on elements.</li>
<li>Fixed bug where you could put a string | in a binary command due to the<br />
simplistic implementation.  The new version requires any | to be escaped with \|.</li>
<li>Added fade-to command, based on the jQuery.fadeTo() command.</li>
<li>Added show and hide commands.</li>
<li>Fixed issue with data and attribute replacements not working correctly (i.e. the first event would replace them for all events).</li>
<li>Callbacks may now take string parameters.  For example, &#8220;fade-out (#target) normal !callback str1 str2&#8243;.</li>
</ul>
<p>I&#8217;ve also started writing documentation for the <a href="http://cdmckay.org/blog/jss/command-reference/">JSS commands</a>.  It is only partially completed but can still be helpful.  Check out the <a href="http://cdmckay.org/blog/jss">JSS homepage</a> for other documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://cdmckay.org/blog/2009/05/24/jss-100-beta-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

