/*
 * ready
 * Watch for when an element becomes available in the DOM
 * @param {String} selector
 * @param {Function} fn
 */

(function(win){
	'use strict';
	
	var listeners = [], 
	doc = win.document, 
	MutationObserver = win.MutationObserver || win.WebKitMutationObserver,
	observer;
	
	function ready(selector, fn){
		// Store the selector and callback to be monitored
		listeners.push({
			selector: selector,
			fn: fn
		});
		if(!observer){
			// Watch for changes in the document
			observer = new MutationObserver(check);
			observer.observe(doc.documentElement, {
				childList: true,
				subtree: true
			});
		}
		// Check if the element is currently in the DOM
		check();
	}
		
	function check(){
		// Check the DOM for elements matching a stored selector
		for(var i = 0, len = listeners.length, listener, elements; i < len; i++){
			listener = listeners[i];
			// Query for elements matching the specified selector
			elements = doc.querySelectorAll(listener.selector);
			for(var j = 0, jLen = elements.length, element; j < jLen; j++){
				element = elements[j];
				// Make sure the callback isn't invoked with the 
				// same element more than once
				if(!element.ready){
					element.ready = true;
					// Invoke the callback with the element
					listener.fn.call(element, element);
				}
			}
		}
	}

	// Expose `ready`
	win.ready = ready;
	    	
})(this);
@@ -136,17 +136,20 @@
 n(win)%7B%0A
-%09
+    
 'use str
@@ -154,19 +154,21 @@
 trict';%0A
-%09%0A%09
+%0A    
 var list
@@ -180,17 +180,20 @@
  = %5B%5D, %0A
-%09
+    
 doc = wi
@@ -205,17 +205,20 @@
 ument, %0A
-%09
+    
 Mutation
@@ -280,17 +280,20 @@
 server,%0A
-%09
+    
 observer
@@ -294,19 +294,21 @@
 server;%0A
-%09%0A%09
+%0A    
 function
@@ -329,18 +329,24 @@
 r, fn)%7B%0A
-%09%09
+        
 // Store
@@ -388,18 +388,24 @@
 nitored%0A
-%09%09
+        
 listener
@@ -413,19 +413,28 @@
 .push(%7B%0A
-%09%09%09
+            
 selector
@@ -449,26 +449,47 @@
 or,%0A
-%09%09%09fn: fn%0A%09%09%7D);%0A%09%09
+            fn: fn%0A        %7D);%0A        
 if(!
@@ -499,19 +499,28 @@
 erver)%7B%0A
-%09%09%09
+            
 // Watch
@@ -548,19 +548,28 @@
 ocument%0A
-%09%09%09
+            
 observer
@@ -600,19 +600,28 @@
 check);%0A
-%09%09%09
+            
 observer
@@ -652,20 +652,32 @@
 ment, %7B%0A
-%09%09%09%09
+                
 childLis
@@ -689,39 +689,72 @@
 ue,%0A
-%09%09%09%09subtree: true%0A%09%09%09%7D);%0A%09%09%7D%0A%09%09
+                subtree: true%0A            %7D);%0A        %7D%0A        
 // C
@@ -797,18 +797,24 @@
 the DOM%0A
-%09%09
+        
 check();
@@ -818,15 +818,19 @@
 ();%0A
-%09%7D%0A%09%09%0A%09
+    %7D%0A%0A    
 func
@@ -843,18 +843,24 @@
 heck()%7B%0A
-%09%09
+        
 // Check
@@ -908,18 +908,24 @@
 elector%0A
-%09%09
+        
 for(var 
@@ -990,19 +990,28 @@
 ; i++)%7B%0A
-%09%09%09
+            
 listener
@@ -1027,19 +1027,28 @@
 ers%5Bi%5D;%0A
-%09%09%09
+            
 // Query
@@ -1093,19 +1093,28 @@
 elector%0A
-%09%09%09
+            
 elements
@@ -1157,19 +1157,28 @@
 ector);%0A
-%09%09%09
+            
 for(var 
@@ -1233,20 +1233,32 @@
 ; j++)%7B%0A
-%09%09%09%09
+                
 element 
@@ -1272,20 +1272,32 @@
 nts%5Bj%5D;%0A
-%09%09%09%09
+                
 // Make 
@@ -1338,20 +1338,32 @@
 th the %0A
-%09%09%09%09
+                
 // same 
@@ -1385,20 +1385,32 @@
 an once%0A
-%09%09%09%09
+                
 if(!elem
@@ -1421,21 +1421,36 @@
 ready)%7B%0A
-%09%09%09%09%09
+                    
 element.
@@ -1463,21 +1463,36 @@
 = true;%0A
-%09%09%09%09%09
+                    
 // Invok
@@ -1527,13 +1527,28 @@
 ent%0A
-%09%09%09%09%09
+                    
 list
@@ -1583,28 +1583,61 @@
 t);%0A
-%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09
+                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    
 // E
@@ -1650,17 +1650,20 @@
 %60ready%60%0A
-%09
+    
 win.read
@@ -1677,14 +1677,20 @@
 dy;%0A
-%09    %09
+            
 %0A%7D)(

Normalize indentation