erster schritt, layout-dropdown dynamisch zu laden
This commit is contained in:
		
							parent
							
								
									66283e3424
								
							
						
					
					
						commit
						bb60117dcf
					
				
					 2 changed files with 17 additions and 3 deletions
				
			
		|  | @ -38,6 +38,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||||
| 		<option value="en">English</option> | 		<option value="en">English</option> | ||||||
| 	</select> | 	</select> | ||||||
| 	<p id="disclaimer">Created by fritteli, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. | 	<p id="disclaimer">Created by fritteli, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. | ||||||
|  | 	<script type="text/javascript" src="uhr-de_CH.js"></script> | ||||||
|  | 	<script type="text/javascript" src="uhr-de.js"></script> | ||||||
|  | 	<script type="text/javascript" src="uhr-en.js"></script> | ||||||
| 	<script type="text/javascript"> | 	<script type="text/javascript"> | ||||||
| 		var uhr = new Uhr($('#uhr'), $('#theme')); | 		var uhr = new Uhr($('#uhr'), $('#theme')); | ||||||
| 		$(document).ready(function() { | 		$(document).ready(function() { | ||||||
|  | @ -74,8 +77,5 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
| 	</script> | 	</script> | ||||||
| 	<script type="text/javascript" src="uhr-de_CH.js"></script> |  | ||||||
| 	<script type="text/javascript" src="uhr-de.js"></script> |  | ||||||
| 	<script type="text/javascript" src="uhr-en.js"></script> |  | ||||||
| </body> | </body> | ||||||
| </html> | </html> | ||||||
|  |  | ||||||
							
								
								
									
										14
									
								
								uhr.js
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								uhr.js
									
										
									
									
									
								
							|  | @ -21,6 +21,7 @@ function Uhr(clockarea, themeElement) { | ||||||
| 	this.id = Uhr.id++; | 	this.id = Uhr.id++; | ||||||
| 	this.clockarea = this.initClockarea(clockarea); | 	this.clockarea = this.initClockarea(clockarea); | ||||||
| 	this.toggleSwitch = this.initToggleSwitch(); | 	this.toggleSwitch = this.initToggleSwitch(); | ||||||
|  | 	this.layoutSwitch = this.initLayoutSwitch(); | ||||||
| 	this.letterarea = clockarea.find('.letterarea'); | 	this.letterarea = clockarea.find('.letterarea'); | ||||||
| 	this.themeElement = themeElement; | 	this.themeElement = themeElement; | ||||||
| 	this.timer = null; | 	this.timer = null; | ||||||
|  | @ -165,6 +166,19 @@ Uhr.prototype.initToggleSwitch = function() { | ||||||
| 	this.clockarea.after(toggleSwitch); | 	this.clockarea.after(toggleSwitch); | ||||||
| 	return toggleSwitch; | 	return toggleSwitch; | ||||||
| } | } | ||||||
|  | Uhr.prototype.initLayoutSwitch = function() { | ||||||
|  | 	var layoutSwitch = $('<select id="layoutswitcher' + this.id + '"></select>') | ||||||
|  | 	for (var code in Uhr.layouts) { | ||||||
|  | 		if (Uhr.layouts.hasOwnProperty(code)) { | ||||||
|  | 			console.log(code); | ||||||
|  | 			var layout = Uhr.layouts[code]; | ||||||
|  | 			console.log(layout); | ||||||
|  | 			console.log(layout.language); | ||||||
|  | 			// TODO fill select with options
 | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	return layoutSwitch; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| Uhr.register('undefined', { | Uhr.register('undefined', { | ||||||
| 	language: 'Undefined', | 	language: 'Undefined', | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue