<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>js/jquery.livequery.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,7 @@ JSS Change Log
 * Adds support for css triggers, this allows you to provide a JS callback for a CSS selector, a simple use case would be to provide rounded corners to IE. [Thanks go to Angelo Berios for this idea]
 * support for a custom list of rel tags , this is mostly useful to stop JSS from snooping in rel=&quot;styleshet&quot; includes
 * minor performance tweaks
+* Added experimental support for live page updates using the livequery plugin
 
 0.5
 </diff>
      <filename>changelog.txt</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,6 @@
 // TODO @import support
 // TODO IE conditional comments support
 // FIXME Safari 3 bug with media types not always being loaded correctly.
-// TODO Add livequery support where available for when adding new DOM elements when ever the DOM is modified. Will need to cache selectors and properties for this to work, should be optional, off by default $.jss.liveUpdates = true
 // TODO add basic :hover support
 
 (function($) {
@@ -44,6 +43,8 @@ $.jss = {
 	
 	relTypes: ['stylesheet', 'jss-stylesheet'], // types that jss will lookout for in html rel tags
 	
+	liveUpdates: false, // this option requires the livequery plugin, is Alpha and has a serious effect on performance
+	
 	apply: function(content) {
 		var selectors = [];
 		var jss = this;
@@ -62,7 +63,7 @@ $.jss = {
 			};
 		});
 		if(content) selectors.concat(this.parse(content)); // parse any passed in styles
-		this.applyBehaviors(selectors); // apply callbacks if any exist
+		this.applyBehaviors(selectors); // apply behaviors before filters
 		selectors = this.filterSelectors(selectors);
 		this.applySelectors(selectors);
 	},
@@ -123,20 +124,26 @@ $.jss = {
 		var result = null;
 		$.each(selectors, function(){ // load each of the matched selectors
 			if(jss.isUnderstoodSelector(this.selector)) return; // skip applying the selector if the browser already understands it.
-			if(jss.disableCaching) return $(this.selector).css(this.attributes); // cache is turned off so just apply styles
+			if(jss.disableCaching) return jss.applyStyles($(this.selector), this.attributes); // cache is turned off so just apply styles
 			if(jss.cache[this.selector]){ // check the cache
 				jss.debug('HIT',this.selector)
-				jss.cache[this.selector].css(this.attributes); // direct cache hit
+				jss.applyStyles(jss.cache[this.selector], this.attributes); // direct cache hit
 			} else if( result=jss.scanCache(this.selector) ) {
 				jss.debug('PARTIAL',result,result[0].find(result[1]))
-				result[0].find(result[1]).css(this.attributes); // partial cache hit
+				jss.applyStyles(result[0].find(result[1]), this.attributes); // partial cache hit
 			}	else {
 				jss.debug('MISS',this.selector)
-				jss.cache[this.selector] = $(this.selector).css(this.attributes); // cache miss
+				jss.cache[this.selector] = jss.applyStyles($(this.selector), this.attributes); // cache miss
 			};
 		});
 	},
 	
+	applyStyles: function($els,styles) {
+		if(this.livequery) $els.livequery(function() { $(this).css(styles); });
+		else $els.css(styles);
+		return $els;
+	},
+	
 	applyBehaviors: function(selectors){
 		if(this.behaviors.length==0) return;
 		var jss = this;</diff>
      <filename>js/jquery.jss.js</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,12 @@ only selectors that match one of these rules will be
 processed by JSS. This can greatly improve performance
 if you only have one or two selectors that need applying.
 
+$.jss.liveUpdates - Boolean - false
+Turn this option on to live update css styles as the page
+changes. You will need the livequery plugin installed to
+use this option. NOTE: this option is a significant 
+performance hit and should be considered an Alpha feature.
+
 $.jss.addBehavior('property', behaviourFunction('selector', 'value'))
 This function can be used to add callbacks to a css
 property, whenever the css property is found the callback is fired</diff>
      <filename>readme.txt</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@
 	&lt;title&gt;Speed Test&lt;/title&gt;
 	
 	&lt;script src=&quot;js/jquery.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+	&lt;script src=&quot;js/jquery.livequery.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
 	&lt;script src=&quot;js/jquery.jss.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
 
 	&lt;link rel=&quot;stylesheet&quot; href=&quot;styles/test.css&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
@@ -18,6 +19,7 @@
 		$(document).ready(function() {
 			$.jss.disableCaching=0;
 			$.jss.debugMode=0;
+			$.jss.liveUpdates=1;
 			$.jss.addBehavior('alert', function(selector, value) { alert(value+' from '+selector); });
 			start = (new Date()).getTime();
 			$.jss.apply();</diff>
      <filename>test.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3460812a9075b1ffe04fb32fc32ea523e8562040</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </author>
  <url>http://github.com/andykent/jss/commit/2a4fe2c6c66f0189c03cc5b7b22a7fcb7fc604c0</url>
  <id>2a4fe2c6c66f0189c03cc5b7b22a7fcb7fc604c0</id>
  <committed-date>2008-11-30T07:13:41-08:00</committed-date>
  <authored-date>2008-11-30T07:13:41-08:00</authored-date>
  <message>added live update support via livequery</message>
  <tree>7e4e231cf36b46c47491629d24d6ec1d214091ad</tree>
  <committer>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </committer>
</commit>
