| 
									
										
										
										
											2016-10-04 20:39:20 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-09 18:00:04 -08:00
										 |  |  | // helper script that will read out the url parameters
 | 
					
						
							|  |  |  | // and store them in appropriate form fields on the page
 | 
					
						
							|  |  |  | (function() { | 
					
						
							|  |  |  |   var regex = /(\w+)=(\w+)/g; | 
					
						
							|  |  |  |   var search = decodeURIComponent(location.search); | 
					
						
							|  |  |  |   while (match = regex.exec(search)) { | 
					
						
							|  |  |  |     var name = match[1]; | 
					
						
							|  |  |  |     var value = match[2]; | 
					
						
							| 
									
										
										
										
											2016-10-04 20:39:20 -07:00
										 |  |  |     var els = document.querySelectorAll('input[name="' + name + '"]'); | 
					
						
							| 
									
										
										
										
											2015-01-15 10:51:47 -08:00
										 |  |  |     var el; | 
					
						
							| 
									
										
										
										
											2016-10-04 20:39:20 -07:00
										 |  |  |     for (var i = 0; i < els.length; i++) { | 
					
						
							| 
									
										
										
										
											2015-01-15 10:51:47 -08:00
										 |  |  |       el = els[i]; | 
					
						
							|  |  |  |       if (el.type === 'radio' || el.type === 'checkbox') { | 
					
						
							|  |  |  |         el.checked = el.value === value; | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         el.value = value; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2015-01-09 18:00:04 -08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | })(); |