Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cache string for better compression

  • Loading branch information...
commit 5f46660361a68805177e6469d6024dd0ce4d36b2 1 parent c598af1
Rick Waldron authored September 15, 2011

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. 14  src/mediagroup.js
14  src/mediagroup.js
@@ -6,7 +6,7 @@
6 6
  *
7 7
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#assigning-a-media-controller-declaratively
8 8
  */
9  
-(function( window, document ) {
  9
+(function( window, document, mediagroup ) {
10 10
 
11 11
 	var requestAnimFrame = (function( window ) {
12 12
 		var suffix = "equestAnimationFrame",
@@ -115,7 +115,7 @@
115 115
 		elements.forEach(function( elem ) {
116 116
 
117 117
 			// Set the actual element IDL property `mediaGroup`
118  
-			elem.mediaGroup = elem.getAttribute( "mediagroup" );
  118
+			elem.mediaGroup = elem.getAttribute( mediagroup );
119 119
 
120 120
 			elem.addEventListener( "canplay", canPlay, false );
121 121
 		});
@@ -128,7 +128,7 @@
128 128
 		// filtereds: object whose properties are the value of a `mediagroup` attribute,
129 129
 		//            with values that are arrays of corresponding elements
130 130
 		// mediagroups: unique array of each mediagroup name
131  
-		var nodelist = document.querySelectorAll( selector || "[mediagroup]" ),
  131
+		var nodelist = document.querySelectorAll( selector || "[" + mediagroup + "]" ),
132 132
 			elements = Array.from( nodelist ),
133 133
 			filtereds = {},
134 134
 			mediagroups;
@@ -140,11 +140,11 @@
140 140
 
141 141
 			// Filter for groupnames
142 142
 			mediagroups = elements.map(function( elem ) {
143  
-				return elem.getAttribute( "mediagroup" );
  143
+				return elem.getAttribute( mediagroup );
144 144
 			}).filter(function( val, i, array ) {
145 145
 				if ( !filtereds[ val ] ) {
146 146
 					filtereds[ val ] = elements.filter(function( elem ) {
147  
-						return elem.getAttribute( "mediagroup" ) === val;
  147
+						return elem.getAttribute( mediagroup ) === val;
148 148
 					});
149 149
 					return true;
150 150
 				}
@@ -178,7 +178,7 @@
178 178
 					(element.controls || element.getAttribute("controls") === "true") ) {
179 179
 
180 180
 				window.setTimeout(function() {
181  
-					mediaGroupSetup( "[mediagroup='" + element.getAttribute("mediagroup") + "']" );
  181
+					mediaGroupSetup( "[" + mediagroup + "='" + element.getAttribute( mediagroup ) + "']" );
182 182
 				}, 100 );
183 183
 			}
184 184
 		});
@@ -199,4 +199,4 @@
199 199
 
200 200
 	// TODO: How to ensure that new nodes with mediagroup attrs are recognized
201 201
 
202  
-})( this, this.document );
  202
+})( this, this.document, "mediagroup" );

0 notes on commit 5f46660

Please sign in to comment.
Something went wrong with that request. Please try again.