Commits

Stefan Scherfke  committed d11c30b

Icon and Bugfixes

  • Participants
  • Parent commits d05137c

Comments (0)

Files changed (4)

File Icon.png

Old
Old image
New
New image
 	<key>MainHTML</key>
 	<string>TeaTimer.html</string>
 	<key>CloseBoxInsetX</key>
-	<integer>16</integer>
+	<integer>15</integer>
 	<key>CloseBoxInsetY</key>
-	<integer>14</integer>
+	<integer>15</integer>
 	<key>Width</key>
 	<string>320</string>
 	<key>Height</key>
 • Auto-update
 • I18N
 • Icon
-• Default.Png
+• Default.Png
+* Choose icon (pizza, tea, …)
  * @param displayId: The id of the corresponding display container.
  */
 function setText(editorId, displayId) {
-	if (timerInterval)
-		clearInterval(timerInterval);
 	editor = document.getElementById(editorId);
 	display = document.getElementById(displayId);
-	if (editor.value.length < 1) {
-		if (editorId == 'timerTargetInput')
-			editor.value = 'Irgendwas';
-		else
-			editor.value = '00';
+	if (editor.style.visibility == 'visible') {
+		if (timerInterval)
+			clearInterval(timerInterval);
+		if (editor.value.length < 1) {
+			if (editorId == 'timerTargetInput')
+				editor.value = 'Irgendwas';
+			else
+				editor.value = '00';
+		}
+		display.firstChild.data = editorId == 'timerTargetInput'
+				? editor.value
+				: formatTwoDigits(editor.value);
+		display.style.visibility = 'visible';
+		editor.style.visibility = 'hidden';
 	}
-	display.firstChild.data = editorId == 'timerTargetInput'
-			? editor.value
-			: formatTwoDigits(editor.value);
-	display.style.visibility = 'visible';
-	editor.style.visibility = 'hidden';
 }
 
 /**
  * displayed target time.
  */
 function startOrPauseTimer() {
+	setText('timerTargetInput', 'timerTarget');
+	setText('hoursInput', 'hours');
+	setText('minutesInput', 'minutes');
+	setText('secondsInput', 'seconds');
 	if (timerInterval) {
 		clearInterval(timerInterval);
 		timerInterval = null;
 			setStartButton(false, false);
 			timerInterval = setInterval('runTimer()', 1000);
 		}
-		else
+		else {
 			resetDisplay();
 			setStartButton(true, false);
+		}
 	}
 }