Skip to content

Commit

Permalink
Basically break all Javascript rules by changing lang variables and a…
Browse files Browse the repository at this point in the history
…dding spaces and brackets to them
  • Loading branch information
Maingron committed Sep 12, 2021
1 parent 7c6750b commit 7febad1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 41 deletions.
33 changes: 15 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<title>Custom Clock</title>
<link rel="stylesheet" href="css/style.css">



<script src="js/config.js"></script>
<script src="js/lang.js"></script>
</head>
Expand All @@ -22,57 +20,57 @@


<fieldset class="designer" id="designer" disabled="disabled">
<label for="designer-fontcolor">Fontcolor</label>
<label for="designer-fontcolor"><lang>Font color</lang></label>
<input type="color" id="designer-fontcolor" onchange="designer('color', this.value)">

<label hidden for="designer-scale">Scale</label>
<label hidden for="designer-scale"><lang>Scaling</lang></label>
<input hidden type="number" min="0" max="8" id="designer-scale" onchange="designer('scale', this.value)">

<label for="designer-fontsize">Font Size (rem)</label>
<label for="designer-fontsize"><lang>Font Size (rem)</lang></label>
<input type="number" min="0" max="8" id="designer-fontsize" onchange="designer('fontsize', this.value + 'rem')">

<label for="designer-block">Block Type</label>
<label for="designer-block"><lang>Block Type</lang></label>
<select id="designer-block" onchange="designer('block', this.value)">
</select>
</fieldset>


<!-- Template section -->
<template id="block-hours" description="lang.DisplaysthecurrentHour">
<template id="block-hours" description="lang.Displays the current Hour">
|hours|
</template>
<template id="block-minutes" description="lang.DisplaysthecurrentMinute">
<template id="block-minutes" description="lang.Displays the current Minute">
|minutes|
</template>
<template id="block-seconds" description="lang.DisplaysthecurrentSecond">
<template id="block-seconds" description="lang.Displays the current Second">
|seconds|
</template>
<template id="block-milliseconds" description="lang.DisplaysthecurrentMillisecond">
<template id="block-milliseconds" description="lang.Displays the current Millisecond">
|milliseconds|
</template>
<template id="block-fullclock" description="lang.DisplaysanentireClock">
<template id="block-fullclock" description="lang.Displays an entire Clock">
|hours|:|minutes|:|seconds|
</template>


<template id="block-timezoneName" description="lang.DisplaystheNameofyourTimezone">
<template id="block-timezoneName" description="lang.Displays the Name of your Timezone">
|timezoneName|
</template>


<template id="block-day" description="lang.DisplaysthecurrentDay">
<template id="block-day" description="lang.Displays the current Day">
|day|
</template>
<template id="block-month" description="lang.DisplaysthecurrentMonth">
<template id="block-month" description="lang.Displays the current Month">
|month|
</template>
<template id="block-year" description="lang.DisplaysthecurrentYear">
<template id="block-year" description="lang.Displays the current Year">
|year|
</template>
<template id="block-weekdayName" description="lang.DisplaystheNameofToday">
<template id="block-weekdayName" description="lang.Displays the Name of Today">
|weekdayName|
</template>
<template id="block-fulldate" description="lang.DisplaystheentireDate">
<template id="block-fulldate" description="lang.Displays the entire Date">
|block-year|-|block-month|-|block-day|
</template>

Expand All @@ -88,7 +86,6 @@
</div>
</template>


<script src="js/scripts.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ function saveConfig(which, value) {
// Ignore any parameters for now
// TODO: Don't ignore parameters
localStorage.setItem("config1", JSON.stringify(config));
}
}
52 changes: 30 additions & 22 deletions js/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ if(config.lang == "de") {
"Friday": "Freitag",
"Saturday": "Samstag",
"Sunday": "Sonntag",
"DisplaysthecurrentHour": "Zeigt die aktuelle Stunde an",
"DisplaysthecurrentMinute": "Zeigt die aktuelle Minute an",
"DisplaysthecurrentSecond": "Zeigt die aktuelle Sekunde an",
"DisplaysthecurrentMillisecond": "Zeigt die aktuelle Millisekunde an",
"DisplaysanentireClock": "Zeigt eine gesamte Uhr an",
"DisplaysthecurrentDay": "Zeigt den aktuellen Tag an",
"DisplaysthecurrentMonth": "Zeigt den aktuellen Monat an",
"DisplaysthecurrentYear": "Zeigt das aktuelle Jahr an",
"DisplaystheNameofToday": "Zeigt den Wochentag an",
"DisplaystheentireDate": "Zeigt das gesamte Datum an",
"DisplaystheNameofyourTimezone": "Zeigt den Namen " + germanFreundlich("deiner") + " Zeitzone an",
"Displays the current Hour": "Zeigt die aktuelle Stunde an",
"Displays the current Minute": "Zeigt die aktuelle Minute an",
"Displays the current Second": "Zeigt die aktuelle Sekunde an",
"Displays the current Millisecond": "Zeigt die aktuelle Millisekunde an",
"Displays an entire Clock": "Zeigt eine gesamte Uhr an",
"Displays the current Day": "Zeigt den aktuellen Tag an",
"Displays the current Month": "Zeigt den aktuellen Monat an",
"Displays the current Year": "Zeigt das aktuelle Jahr an",
"Displays the Name of Today": "Zeigt den Wochentag an",
"Displays the entire Date": "Zeigt das gesamte Datum an",
"Displays the Name of your Timezone": "Zeigt den Namen " + germanFreundlich("deiner") + " Zeitzone an",
"Font color": "Schriftfarbe",
"Scaling": "Skalierung",
"Font Size (rem)": "Schriftgröße (rem)",
"Block Type": "Block Typ"
}
} else {
var lang = { // English / Fallback
Expand All @@ -52,16 +56,20 @@ if(config.lang == "de") {
"Friday": "Friday",
"Saturday": "Saturday",
"Sunday": "Sunday",
"DisplaysthecurrentHour": "Displays the current Hour",
"DisplaysthecurrentMinute": "Displays the current Minute",
"DisplaysthecurrentSecond": "Displays the current Second",
"DisplaysthecurrentMillisecond": "Displays the current Millisecond",
"DisplaysanentireClock": "Displays an entire Clock",
"DisplaysthecurrentDay": "Displays the current Day",
"DisplaysthecurrentMonth": "Displays the current Month",
"DisplaysthecurrentYear": "Displays the current Year",
"DisplaystheNameofToday": "Displays the Name of Today",
"DisplaystheentireDate": "Displays the entire Date",
"DisplaystheNameofyourTimezone": "Displays the Name of your Timezone",
"Displays the current Hour": "Displays the current Hour",
"Displays the current Minute": "Displays the current Minute",
"Displays the current Second": "Displays the current Second",
"Displays the current Millisecond": "Displays the current Millisecond",
"Displays an entire Clock": "Displays an entire Clock",
"Displays the current Day": "Displays the current Day",
"Displays the current Month": "Displays the current Month",
"Displays the current Year": "Displays the current Year",
"Displays the Name of Today": "Displays the Name of Today",
"Displays the entire Date": "Displays the entire Date",
"Displays the Name of your Timezone": "Displays the Name of your Timezone",
"Font color": "Font color",
"Scaling": "Scaling",
"Font Size (rem)": "Font Size (rem)",
"Block Type": "Block Type"
}
}

0 comments on commit 7febad1

Please sign in to comment.