<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,7 @@ PolyPage Change Log
 - A public event API for triggering page state changes and being notified of them.
 - The plugin now is a real JS object so theoretically you could have several PolyPage's co-existing on one html page.
 - PolyPage now follows the jQuery standard and is fully chainable, and scoped, in most cases $(document).polypage() is fine.
+- The nav bar is now 100% independent of the polypage functionality. You can now run polypage with no GUI or DOM injection at all.
 
 0.7
 </diff>
      <filename>changelog.txt</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,13 @@
         $(this).data('polypage', new $.polypage(this, opts)); 
     });
   };
+  
+  $.fn.polypageNavBar = function(opts) {
+    return this.each(function() {
+      (opts = opts || {}).bindTo = opts.bindTo || this;
+      $(this).data('polypageNavBar', new $.polypage.navBar(this, opts)); 
+    });
+  };
 
   $.polypage = function(scope, options) {
     this.scope = $(scope);
@@ -29,8 +36,7 @@
   
   $.polypage.DEFAULTS = {
     prefix: 'pp',
-    separator: '_',
-    label: &quot;Page States:&quot;
+    separator: '_'
   };
   
   $.polypage.prototype = {
@@ -132,7 +138,7 @@
       return $(&quot;*[class*='&quot;+this.options.prefix+this.options.separator+&quot;']&quot;, this.scope);
     },
     
-    pageHasPPElements: function() {
+    hasElements: function() {
       return this.findAll().length&gt;0
     },
 
@@ -157,11 +163,13 @@
       return eval(str);
     },
     
-    // alphabeticalStateNames: function(){
-    //   var ret = [];
-    //   for(var state in this.states) {  ret.push(state); };
-    //   return ret.sort();
-    // },
+    alphabeticalStates: function(){
+      var alphaStates = [], ret = [];
+      for(var state in this.states) { alphaStates.push(state) }
+      alphaStates = alphaStates.sort();
+      for(var state in alphaStates) { ret.push({name:alphaStates[state], value:this.states[alphaStates[state]]}); };
+      return ret
+    },
 
     // buildOptionsBar: function(elems){
     //   if(!this.pageHasPPElements()) return;
@@ -195,7 +203,63 @@
     //     }
     //   });
     // }
-
+  };
+  
+  $.polypage.navBar = function(scope, options) {
+    this.scope = $(scope);
+    this.options = $.extend($.polypage.navBar.DEFAULTS, options||{});
+    this.init();
+  };
+  
+  $.polypage.navBar.DEFAULTS = {
+    className: 'pp_options',
+    label: &quot;Page States:&quot;
+  };
+  
+  $.polypage.navBar.prototype = {
+    init: function(){
+      this.bindWithPolypage();
+      this.redraw();
+    },
+    
+    bindWithPolypage: function(){
+      this.polypage = $(this.options.bindTo).data('polypage');
+      if(this.polypage===undefined)
+        throw &quot;A polypage nav bar must be bound to a polypage enabled element, try setting the 'bindTo' option.&quot;;
+    },
+    
+    redraw: function(){
+      this.undraw();
+      if(!this.needsOptionBar()) return;
+      this.draw();
+    },
+    
+    draw: function(){
+      this.scope.append('&lt;div id=&quot;'+this.options.className+'&quot;&gt;&lt;p&gt;'+this.options.label+'&lt;/p&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;');
+      var states = this.states();
+      for(var index in states) {
+        var state = states[index];
+        var humanStateName = state.name.replace(this.separator(),' ');
+        var className = state.value ? 'on' : 'off'
+        $('#pp_options ul').append('&lt;li&gt;&lt;a href=&quot;#'+state.name+'&quot; id=&quot;pp_state_switch_'+state.name+'&quot; class=&quot;'+className+'&quot;&gt;'+humanStateName+'&lt;/a&gt;&lt;/li&gt;');
+      }
+    },
+    
+    undraw: function(){
+      this.scope.find('.'+this.options.className).remove();
+    },
+    
+    needsOptionBar: function(){
+      return this.polypage.hasElements();
+    },
+    
+    states: function(){
+      return this.polypage.alphabeticalStates();
+    },
+    
+    separator: function(){
+      return this.polypage.options.separator;
+    },
   };
   
 })(jQuery);</diff>
      <filename>lib/polypage.jquery.js</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@ body div#pp_options li {
 body div#pp_options li a {
 	color: #999;
 }
-body div#pp_options li a.active {
+body div#pp_options li a.on {
 	color: #000;
 	background: #d4fb78;
 }
\ No newline at end of file</diff>
      <filename>skins/default.css</filename>
    </modified>
    <modified>
      <diff>@@ -33,6 +33,6 @@ body div#pp_options li {
 body div#pp_options li a {
   color: #999;
 }
-body div#pp_options li a.active {
+body div#pp_options li a.on {
   color: #000;
 }</diff>
      <filename>skins/plain.css</filename>
    </modified>
    <modified>
      <diff>@@ -58,6 +58,7 @@
   &lt;!-- Setup --&gt;
   &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
       $('#dom').polypage();
+      $('body').polypageNavBar({bindTo:'#dom'});
   &lt;/script&gt;
   
   &lt;!-- Specs --&gt;</diff>
      <filename>spec/index.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>25e94d17fedf35be441789be5731ebe8f7beb94c</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </author>
  <url>http://github.com/andykent/polypage/commit/202a5c4248310d2caf4ef2ee2069c14d61e78436</url>
  <id>202a5c4248310d2caf4ef2ee2069c14d61e78436</id>
  <committed-date>2009-03-07T16:14:39-08:00</committed-date>
  <authored-date>2009-03-07T16:14:39-08:00</authored-date>
  <message>The nav bar is now 100% independent of the polypage functionality. You can now run polypage with no GUI or DOM injection at all.</message>
  <tree>6f26394b61cc9901061840adbecb0ea0a4563912</tree>
  <committer>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </committer>
</commit>
