Merge branch 'develop' into feature/new-splashscreen

Conflicts:
	index.html
This commit is contained in:
Manuel Friedli 2014-08-26 18:25:46 +02:00
commit 851c5cbddd
25 changed files with 1151 additions and 1007 deletions

View file

@ -7,16 +7,7 @@
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
"rhino" : false,
"couch" : false,
"wsh" : true, // Windows Scripting Host.
"jquery" : true,
"ender" : true,
"prototypejs" : false,
"mootools" : false,
"dojo" : false,
"predef" : [
"suite",
@ -28,16 +19,13 @@
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
"devel" : true, // Allow developments statements e.g. `console.log();`.
// ECMAScript 5.
"es5" : true, // Allow ECMAScript 5 syntax.
"strict" : true, // Require `use strict` pragma in every file.
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
// The Good Parts.
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"curly" : true, // Require {} for every new block or scope.
@ -50,8 +38,6 @@
"latedef" : true, // Prohipit variable use before definition.
"loopfunc" : false, // Allow functions to be defined within loops.
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
"scripturl" : true, // Tolerate script-targeted URLs.
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
@ -67,6 +53,6 @@
"plusplus" : false, // Prohibit use of `++` & `--`.
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
"trailing" : true, // Prohibit trailing whitespaces.
"white" : true, // Check against strict whitespace and indentation rules.
"white" : false, // Check against strict whitespace and indentation rules.
"indent" : 0 // Specify indentation spacing
}

View file

@ -1 +1 @@
6.3
6.3.1

View file

@ -15,14 +15,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.black {
background-color: #111;
}
.black .onoffswitch-inner:before {
background-color: #111;
}
.uhr.black .dot:not(.active) {
border-color: rgba(255,255,255,0.1);
box-shadow: 0 0 0.1em rgba(255,255,255,0.1);
border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
.uhr.black .letter:not(.active) {
color: rgba(255,255,255,0.1);
text-shadow: 0 0 0.1em rgba(255,255,255,0.1);
color: rgba(255, 255, 255, 0.1);
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}

View file

@ -15,14 +15,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.blue {
background-color: #00a;
}
.blue .onoffswitch-inner:before {
background-color: #00a;
}
.uhr.blue .dot:not(.active) {
border-color: rgba(255,255,255,0.1);
box-shadow: 0 0 0.1em rgba(255,255,255,0.1);
border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
.uhr.blue .letter:not(.active) {
color: rgba(255,255,255,0.1);
text-shadow: 0 0 0.1em rgba(255,255,255,0.1);
color: rgba(255, 255, 255, 0.1);
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}

View file

@ -15,14 +15,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.green {
background-color: #0c0;
}
.green .onoffswitch-inner:before {
background-color: #0c0;
}
.uhr.green .dot:not(.active) {
border-color: rgba(0,0,0,0.1);
box-shadow: 0 0 0.1em rgba(0,0,0,0.1);
border-color: rgba(0, 0, 0, 0.1);
box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
}
.uhr.green .letter:not(.active) {
color: rgba(0,0,0,0.1);
text-shadow: 0 0 0.1em rgba(0,0,0,0.1);
color: rgba(0, 0, 0, 0.1);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
}

View file

@ -15,22 +15,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.pink {
background-color: #f0a;
}
.uhr.pink .dot.active{
.uhr.pink .dot.active {
border-color: #fff;
box-shadow: 0 0 0.1em #fff;
}
.uhr.pink .letter.active{
.uhr.pink .letter.active {
color: #fff;
text-shadow: 0 0 0.1em #fff;
}
.pink .onoffswitch-inner:before {
background-color: #f0a;
}
.uhr.pink .dot:not(.active) {
border-color: rgba(255,255,255,0.1);
box-shadow: 0 0 0.1em rgba(255,255,255,0.1);
border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
.uhr.pink .letter:not(.active) {
color: rgba(255,255,255,0.1);
text-shadow: 0 0 0.1em rgba(255,255,255,0.1);
color: rgba(255, 255, 255, 0.1);
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}

View file

@ -15,14 +15,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.red {
background-color: #700;
}
.red .onoffswitch-inner:before {
background-color: #700;
}
.uhr.red .dot:not(.active){
border-color: rgba(255,255,255,0.1);
box-shadow: 0 0 0.1em rgba(255,255,255,0.1);
.uhr.red .dot:not(.active) {
border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
.uhr.red .letter:not(.active) {
color: rgba(255,255,255,0.1);
text-shadow: 0 0 0.1em rgba(255,255,255,0.1);
color: rgba(255, 255, 255, 0.1);
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}

View file

@ -15,22 +15,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.white {
background-color: #ccc;
}
.uhr.white .dot.active{
.uhr.white .dot.active {
border-color: #fff;
box-shadow: 0 0 0.1em #fff;
}
.uhr.white .letter.active{
.uhr.white .letter.active {
color: #fff;
text-shadow: 0 0 0.1em #fff;
}
.white .onoffswitch-inner:before {
background-color: #ccc;
}
.uhr.white .dot:not(.active) {
border-color: rgba(0,0,0,0.1);
box-shadow: 0 0 0.1em rgba(0,0,0,0.1);
border-color: rgba(0, 0, 0, 0.1);
box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
}
.uhr.white .letter:not(.active) {
color: rgba(0,0,0,0.1);
text-shadow: 0 0 0.1em rgba(0,0,0,0.1);
color: rgba(0, 0, 0, 0.1);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
}

View file

@ -15,22 +15,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.uhr.yellow {
background-color: #fd0;
}
.uhr.yellow .dot.active{
.uhr.yellow .dot.active {
border-color: #fff;
box-shadow: 0 0 0.1em #fff;
}
.uhr.yellow .letter.active{
.uhr.yellow .letter.active {
color: #fff;
text-shadow: 0 0 0.1em #fff;
}
.yellow .onoffswitch-inner:before {
background-color: #fd0;
}
.uhr.yellow .dot:not(.active) {
border-color: rgba(0,0,0,0.05);
box-shadow: 0 0 0.1em rgba(0,0,0,0.05);
border-color: rgba(0, 0, 0, 0.05);
box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
}
.uhr.yellow .letter:not(.active) {
color: rgba(0,0,0,0.05);
text-shadow: 0 0 0.1em rgba(0,0,0,0.05);
color: rgba(0, 0, 0, 0.05);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
}

View file

@ -16,14 +16,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
font-family: 'Uhrenfont';
src: url('../resources/uhr.woff') format('woff');
}
body {
font-family: 'Uhrenfont', sans-serif;
}
.uhr {
position: relative;
margin: 0;
transition: background-color 0.5s;
}
.uhr .reflection {
position: absolute;
top: 0;
@ -34,8 +37,10 @@ body {
display: block;
margin: 0.15em;
}
#themeswitcher {
}
.uhr .letterarea {
display: block;
position: absolute;
@ -46,9 +51,11 @@ body {
overflow: hidden;
font-size: 200%;
}
.item {
transition: box-shadow 0.5s, text-shadow 0.5s, border-color 0.5s, color 0.5s;
}
.dot {
position: absolute;
display: block;
@ -57,26 +64,32 @@ body {
border: 0.2em solid;
border-radius: 1em;
}
.dot.active {
border-color: #eee;
box-shadow: 0 0 0.2em #eee;
}
.dot1 {
top: 3.75%;
left: 3.75%;
}
.dot2 {
top: 3.75%;
right: 3.75%;
}
.dot3 {
bottom: 3.75%;
right: 3.75%;
}
.dot4 {
bottom: 3.75%;
left: 3.75%;
}
.letter {
height: 10%;
width: 9.0909%;
@ -86,21 +99,25 @@ body {
text-align: center;
line-height: 160%;
}
.letter.active {
color: #eee;
text-shadow: 0 0 0.2em #eee;
}
.onoffswitch {
position: relative;
width: 86px;
margin: 1em;
-webkit-user-select:none;
-moz-user-select:none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block;
overflow: hidden;
@ -108,6 +125,7 @@ body {
border: 2px solid #999;
border-radius: 50px;
}
.onoffswitch-inner {
width: 200%;
margin-left: -100%;
@ -116,6 +134,7 @@ body {
-o-transition: margin 0.3s ease-in 0s;
transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
float: left;
width: 50%;
@ -129,12 +148,14 @@ body {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.onoffswitch-inner:before {
content: "EIN";
padding-left: 12px;
color: #eee;
transition: background-color 0.5s;
}
.onoffswitch-inner:after {
content: "AUS";
padding-right: 12px;
@ -175,34 +196,39 @@ a.uhr-configlink {
display: inline-block;
margin: 2px;
}
.uhr-controlpanel {
background-color: rgba(0,0,0,0.5);
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
@media (max-width: 400px) {
.uhr-controlpanel .content {
height: 100%;
}
}
@media (min-width: 401px) {
.uhr-controlpanel .content {
margin-left: auto;
margin-right: auto;
width: 10em;
top : 1em;
top: 1em;
border-radius: 0.5em;
box-shadow: 0 0 1em black;
}
}
.uhr-controlpanel .content {
background-color: #fff;
padding: 2em;
position: relative;
}
a.uhr-closecontrolpanel {
cursor: pointer;
display: inline-block;
@ -213,9 +239,11 @@ a.uhr-closecontrolpanel {
height: 24px;
background: url("../resources/close.png") no-repeat;
}
#disclaimer {
font-size: 0.5em;
}
#disclaimer a {
color: #444;
text-decoration: underline;

View file

@ -15,26 +15,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<html manifest="manifest.appcache">
<head>
<title>Bärneruhr - Die Zeit im Wort</title>
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png" />
<link rel="apple-touch-startup-image" href="startup-320x460.png" media="screen and (max-device-width : 320px)" />
<link rel="apple-touch-startup-image" href="startup-640x920.png" media="(max-device-width : 480px) and (-webkit-min-device-pixel-ratio : 2)" />
<link rel="apple-touch-startup-image" href="startup-640x1096.png" media="(max-device-width : 548px) and (-webkit-min-device-pixel-ratio : 2)">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Bärneruhr" />
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1" />
<link rel="stylesheet" type="text/css" href="css/uhr.css" />
<link rel="stylesheet" type="text/css" href="css/uhr-black.css" data-class="black" data-name="Schwarz" />
<link rel="stylesheet" type="text/css" href="css/uhr-white.css" data-class="white" data-name="Weiss" />
<link rel="stylesheet" type="text/css" href="css/uhr-red.css" data-class="red" data-name="Rot" />
<link rel="stylesheet" type="text/css" href="css/uhr-yellow.css" data-class="yellow" data-name="Gelb" />
<link rel="stylesheet" type="text/css" href="css/uhr-green.css" data-class="green" data-name="Grün" />
<link rel="stylesheet" type="text/css" href="css/uhr-blue.css" data-class="blue" data-name="Blau" />
<link rel="stylesheet" type="text/css" href="css/uhr-pink.css" data-class="pink" data-name="Pink" />
<link rel="shortcut icon" type="image/png" href="resources/favicon.png" />
<link rel="apple-touch-icon-precomposed" href="resources/apple-touch-icon-precomposed.png" />
<title>Bärneruhr - Die Zeit im Wort</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="apple-mobile-web-app-title" content="Bärneruhr"/>
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="css/uhr.css"/>
<link rel="stylesheet" type="text/css" href="css/uhr-black.css" data-class="black" data-name="Schwarz"/>
<link rel="stylesheet" type="text/css" href="css/uhr-white.css" data-class="white" data-name="Weiss"/>
<link rel="stylesheet" type="text/css" href="css/uhr-red.css" data-class="red" data-name="Rot"/>
<link rel="stylesheet" type="text/css" href="css/uhr-yellow.css" data-class="yellow" data-name="Gelb"/>
<link rel="stylesheet" type="text/css" href="css/uhr-green.css" data-class="green" data-name="Grün"/>
<link rel="stylesheet" type="text/css" href="css/uhr-blue.css" data-class="blue" data-name="Blau"/>
<link rel="stylesheet" type="text/css" href="css/uhr-pink.css" data-class="pink" data-name="Pink"/>
<link rel="shortcut icon" type="image/png" href="resources/favicon.png"/>
<link rel="apple-touch-icon-precomposed" href="resources/apple-touch-icon-precomposed.png"/>
<script type="text/javascript" src="lib/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="lib/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript" src="lib/jquery-cookie-1.4.0.js"></script>
@ -48,20 +48,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<script type="text/javascript" src="js/uhr-it.js"></script>
</head>
<body style="padding:0;margin:0;">
<div id="uhr"></div>
<p id="disclaimer">Created by <a href="http://www.fritteli.ch/">fritteli</a>, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. <a href="info/">Read more!</a> - <a href="showcase">View full showcase!</a></p>
<script type="text/javascript">
<div id="uhr"></div>
<p id="disclaimer">Created by <a href="http://www.fritteli.ch/">fritteli</a>, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. <a
href="info/">Read more!</a> - <a href="showcase">View full showcase!</a></p>
<script type="text/javascript">
(function($) {
var width = $(window).width();
var height = $(window).height();
var size = Math.min(width, height) + 'px';
$('#uhr').uhr({
width: size,
color: 'black',
language: 'de_CH',
controls: true
width: size
});
})(jQuery);
</script>
</script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -1,24 +1,48 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
body {
font-size: 120%;
}
code {
white-space: pre-line;
display: inline-block;
}
code.inline {
display: inline;
}
ol {
counter-reset: item;
padding-left: 1em;
}
ol li {
display: block;
}
ol li:before {
content: counters(item, ".") ". ";
counter-increment: item;
}
a.toclink {
font-size: 25%;
}
a.toclink:before {
content: "▲ ";
}

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var es_ist = {1: [1, 2, 4, 5, 6]};
var uhr = {10: [9, 10, 11]};

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var vorne0 = {
3: [2, 3, 4],
@ -239,7 +239,7 @@
"58": [vorne5, hinten8],
"59": [vorne5, hinten9]
},
"getDotMinute": function (time) {
"getDotMinute": function() {
return 0;
}
};

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
// hilfsvariablen
var es_isch = {1: [1, 2, 4, 5, 6, 7]};

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var es_isch = {1: [1, 2, 4, 5, 6, 7]};
var genau = {3: [7, 8, 9, 10, 11]};

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var it_is = {1: [1, 2, 4, 5]};
var half = {4: [1, 2, 3, 4]};
@ -69,7 +69,7 @@
"10,22": {10: [1, 2, 3]},
"11,23": {8: [6, 7, 8, 9, 10, 11]}
},
"getHour": function (date) {
"getHour": function(date) {
var hour = date.getHours();
if (date.getMinutes() >= 35) {
return (hour + 1) % 24;

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var il_est = {1: [1, 2, 4, 5, 6]};
var et = {8: [1, 2]};
@ -57,20 +57,53 @@
},
"hours": {
"0": {5: [6, 7, 8, 9, 10, 11]},
"1,13": [{3: [5, 6, 7]}, heures],
"2,14": [{1: [8, 9, 10, 11]}, heures],
"3,15": [{2: [7, 8, 9, 10, 11]}, heures],
"4,16": [{2: [1, 2, 3, 4, 5, 6]}, heures],
"5,17": [{4: [8, 9, 10, 11]}, heures],
"6,18": [{4: [5, 6, 7]}, heures],
"7,19": [{3: [8, 9, 10, 11]}, heures],
"8,20": [{4: [1, 2, 3, 4]}, heures],
"9,21": [{3: [1, 2, 3, 4]}, heures],
"10,22": [{5: [3, 4, 5]}, heures],
"11,23": [{6: [1, 2, 3, 4]}, heures],
"1,13": [
{3: [5, 6, 7]},
heures
],
"2,14": [
{1: [8, 9, 10, 11]},
heures
],
"3,15": [
{2: [7, 8, 9, 10, 11]},
heures
],
"4,16": [
{2: [1, 2, 3, 4, 5, 6]},
heures
],
"5,17": [
{4: [8, 9, 10, 11]},
heures
],
"6,18": [
{4: [5, 6, 7]},
heures
],
"7,19": [
{3: [8, 9, 10, 11]},
heures
],
"8,20": [
{4: [1, 2, 3, 4]},
heures
],
"9,21": [
{3: [1, 2, 3, 4]},
heures
],
"10,22": [
{5: [3, 4, 5]},
heures
],
"11,23": [
{6: [1, 2, 3, 4]},
heures
],
"12": {5: [1, 2, 3, 4]}
},
"getHour": function (date) {
"getHour": function(date) {
var hour = date.getHours();
if (date.getMinutes() >= 35) {
return (hour + 1) % 24;

View file

@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function () {
(function() {
'use strict';
var sono_le = {1: [1, 2, 3, 4, 6, 7]};
var e_l = {2: [1, 3, 4]};
@ -68,7 +68,7 @@
"10,22": [sono_le, {4: [1, 2, 3, 4, 5]}],
"11,23": [sono_le, {4: [6, 7, 8, 9, 10, 11]}]
},
"getHour": function (date) {
"getHour": function(date) {
var hour = date.getHours();
if (date.getMinutes() >= 35) {
return (hour + 1) % 24;

View file

@ -12,16 +12,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function ($) {
(function($) {
'use strict';
var uhrGlobals = {
"id": 0,
"languages": [],
"themes": [],
registerLanguage: function registerLanguage(code, language) {
var alreadyExists = uhrGlobals.languages.some(function (element) {
var alreadyExists = uhrGlobals.languages.some(function(element) {
if (code === element.code) {
console.error("Error: Language code '" + code + "' cannot be registered for language '" + language.language + "' because it is already registered for language '" + element.language + "'!");
console.error("Error: Language code '" + code + "' cannot be registered for language '" + language.language +
"' because it is already registered for language '" + element.language + "'!");
return true;
}
return false;
@ -34,7 +35,7 @@
};
// auto-detect themes
$('link[rel=stylesheet]').each(function (index, item) {
$('link[rel=stylesheet]').each(function(index, item) {
var styleSheet = $(item);
var styleClass = styleSheet.attr('data-class');
if (styleClass !== undefined) {
@ -53,7 +54,7 @@
// public interface methods (exported later)
var start = function start() {
if (!isOn.bind(this)()) {
this.timer = window.setInterval(function () {
this.timer = window.setInterval(function() {
this.options.time = new Date();
update.bind(this)();
}.bind(this), 1000);
@ -80,7 +81,7 @@
if (languageKey !== this.options.language) {
this.options.language = languageKey;
var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
renderer.render.bind(this)(function () {
renderer.render.bind(this)(function() {
this.currentMinute = -1;
update.bind(this)();
}.bind(this));
@ -152,7 +153,7 @@
if (this.options.controls) {
var configlink = $('<a class="uhr-configlink" id="uhr-configlink' + this.id + '"></a>');
configlink.on('click', function () {
configlink.on('click', function() {
showConfigScreen.bind(this)();
}.bind(this));
e.after(configlink);
@ -161,17 +162,16 @@
controlpanel.append(content);
// on/off switch
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + this.id + '"></div>');
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this.id + '" checked="checked" />');
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this.id + '">'
+ '<div class="onoffswitch-inner"></div>'
+ '<div class="onoffswitch-switch"></div>'
+ '</label>');
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this.id +
'" checked="checked" />');
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this.id + '">' +
'<div class="onoffswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' + '</label>');
content.append(toggleSwitch);
// language chooser
if (uhrGlobals.languages.length > 1) {
var languageChooser = $('<select id="uhr-languagechooser' + this.id + '"></select>');
uhrGlobals.languages.forEach(function (item) {
uhrGlobals.languages.forEach(function(item) {
languageChooser.append('<option value="' + item.code + '">' + item.language + '</option>');
});
content.append(languageChooser);
@ -180,13 +180,13 @@
// theme chooser
if (uhrGlobals.themes.length > 1) {
var themeChooser = $('<select id="uhr-themechooser' + this.id + '"></select>');
uhrGlobals.themes.forEach(function (item) {
uhrGlobals.themes.forEach(function(item) {
themeChooser.append('<option value="' + item.styleClass + '">' + item.name + '</option>');
});
content.append(themeChooser);
}
var closebutton = $('<a class="uhr-closecontrolpanel" id="uhr-closecontrolpanel' + this.id + '"></a>');
closebutton.on('click', function () {
closebutton.on('click', function() {
$('#uhr-controlpanel' + this.id).fadeOut('fast');
}.bind(this));
content.append(closebutton);
@ -197,7 +197,7 @@
var wireFunctionality = function wireFunctionality() {
// on/off switch
var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
toggleSwitch.on('click', function () {
toggleSwitch.on('click', function() {
this.toggle();
}.bind(this));
var status = $.cookie('uhr-status' + this.id);
@ -213,7 +213,7 @@
// language chooser
var languageChooser = $('#uhr-languagechooser' + this.id);
languageChooser.on('change', function () {
languageChooser.on('change', function() {
var languageKey = $('#uhr-languagechooser' + this.id).val();
this.language(languageKey);
}.bind(this));
@ -221,7 +221,7 @@
if (selectedLanguage === undefined || this.options.force) {
selectedLanguage = this.options.language;
}
var found = uhrGlobals.languages.some(function (item) {
var found = uhrGlobals.languages.some(function(item) {
return selectedLanguage === item.code;
});
if (!found) {
@ -240,7 +240,7 @@
// theme chooser
var themeChooser = $('#uhr-themechooser' + this.id);
themeChooser.on('change', function () {
themeChooser.on('change', function() {
var themeKey = $('#uhr-themechooser' + this.id).val();
this.theme(themeKey);
}.bind(this));
@ -248,7 +248,7 @@
if (selectedTheme === undefined || this.options.force) {
selectedTheme = this.options.theme;
}
found = uhrGlobals.themes.some(function (item) {
found = uhrGlobals.themes.some(function(item) {
return selectedTheme === item.styleClass;
});
if (!found) {
@ -260,7 +260,7 @@
this.options.theme = "";
this.theme(selectedTheme);
if (this.options.autoresize) {
$(window).on('resize', function () {
$(window).on('resize', function() {
var $e = this.element;
var $parent = $e.parent();
var $window = $(window);
@ -353,7 +353,7 @@
};
var language = function language() {
var matchingLanguages = uhrGlobals.languages.filter(function (element) {
var matchingLanguages = uhrGlobals.languages.filter(function(element) {
return (element.code === this.options.language);
}, this);
if (matchingLanguages.length > 0) {
@ -405,10 +405,10 @@
}
}
var letters = layout.parsed;
renderarea.fadeOut('fast', function () {
renderarea.fadeOut('fast', function() {
renderarea.empty();
letters.forEach(function (line, index, array) {
line.forEach(function (letter) {
letters.forEach(function(line, index, array) {
line.forEach(function(letter) {
renderarea.append(letter.toString());
});
if (index < array.length - 1) {
@ -427,7 +427,7 @@
function parseArrayOrObject(letters, styleClass, input) {
if (typeof input !== 'undefined' && input !== null) {
if (Array.isArray(input)) {
input.forEach(function (item) {
input.forEach(function(item) {
parseObject(letters, styleClass, item);
});
} else {
@ -438,9 +438,9 @@
function parseObject(letters, styleClass, object) {
if (typeof object !== 'undefined' && object !== null) {
Object.keys(object).forEach(function (y) {
Object.keys(object).forEach(function(y) {
var highlightLetters = object[y];
highlightLetters.forEach(function (x) {
highlightLetters.forEach(function(x) {
letters[y - 1][x - 1].addStyle(styleClass);
});
});
@ -449,10 +449,10 @@
function parseTimeDefinition(letters, styleClass, definition) {
if (typeof definition !== 'undefined' && definition !== null) {
Object.keys(definition).forEach(function (listString) {
Object.keys(definition).forEach(function(listString) {
var array = listString.split(',');
var highlightLetters = definition[listString];
array.forEach(function (item) {
array.forEach(function(item) {
parseArrayOrObject(letters, styleClass + item, highlightLetters);
});
});
@ -461,7 +461,7 @@
this.parse = function parse() {
var letters = [];
layout.letters.forEach(function (string) {
layout.letters.forEach(function(string) {
var line = [];
for (var c = 0; c < string.length; c++) {
var character = new Letter(string[c]);
@ -485,14 +485,14 @@
function Letter(value, style) {
var myValue = value;
var myStyle = style || '';
this.addStyle = function (style) {
this.addStyle = function(style) {
if (myStyle === '') {
myStyle = style;
} else {
myStyle += ' ' + style;
}
};
this.toString = function () {
this.toString = function() {
return '<span class="item letter ' + myStyle + '">' + myValue + '</span>';
};
}

View file

@ -1,5 +1,5 @@
CACHE MANIFEST
# 6.3
# 6.3.1
css/uhr.css
css/uhr-black.css

View file

@ -16,37 +16,37 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<html manifest="../manifest.appcache">
<head>
<title>Bärneruhr - Die Zeit im Wort: Showcase</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Bärneruhr" />
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1" />
<link rel="stylesheet" type="text/css" href="../css/uhr.css" />
<link rel="stylesheet" type="text/css" href="../css/uhr-black.css" data-class="black" data-name="Schwarz" />
<link rel="stylesheet" type="text/css" href="../css/uhr-white.css" data-class="white" data-name="Weiss" />
<link rel="stylesheet" type="text/css" href="../css/uhr-red.css" data-class="red" data-name="Rot" />
<link rel="stylesheet" type="text/css" href="../css/uhr-green.css" data-class="green" data-name="Grün" />
<link rel="stylesheet" type="text/css" href="../css/uhr-yellow.css" data-class="yellow" data-name="Gelb" />
<link rel="stylesheet" type="text/css" href="../css/uhr-blue.css" data-class="blue" data-name="Blau" />
<link rel="stylesheet" type="text/css" href="../css/uhr-pink.css" data-class="pink" data-name="Pink" />
<link rel="shortcut icon" type="image/png" href="../resources/favicon.png" />
<link rel="apple-touch-icon-precomposed" href="../resources/apple-touch-icon-precomposed.png" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="apple-mobile-web-app-title" content="Bärneruhr"/>
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="../css/uhr.css"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-black.css" data-class="black" data-name="Schwarz"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-white.css" data-class="white" data-name="Weiss"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-red.css" data-class="red" data-name="Rot"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-green.css" data-class="green" data-name="Grün"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-yellow.css" data-class="yellow" data-name="Gelb"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-blue.css" data-class="blue" data-name="Blau"/>
<link rel="stylesheet" type="text/css" href="../css/uhr-pink.css" data-class="pink" data-name="Pink"/>
<link rel="shortcut icon" type="image/png" href="../resources/favicon.png"/>
<link rel="apple-touch-icon-precomposed" href="../resources/apple-touch-icon-precomposed.png"/>
<script type="text/javascript" src="../lib/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="../lib/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript" src="../lib/jquery-cookie-1.4.0.js"></script>
<script type="text/javascript" src="../js/uhr.js"></script>
</head>
<body style="padding:0;margin:0;">
<div id="uhr"></div>
<p ><a href="..">Go back to the main page</a></p>
<script type="text/javascript" src="../js/uhr-de_CH.js"></script>
<script type="text/javascript" src="../js/uhr-de_CH_genau.js"></script>
<script type="text/javascript" src="../js/uhr-de_CH-seconds.js"></script>
<script type="text/javascript" src="../js/uhr-de.js"></script>
<script type="text/javascript" src="../js/uhr-en.js"></script>
<script type="text/javascript" src="../js/uhr-fr.js"></script>
<script type="text/javascript" src="../js/uhr-it.js"></script>
<script type="text/javascript">
<div id="uhr"></div>
<p><a href="..">Go back to the main page</a></p>
<script type="text/javascript" src="../js/uhr-de_CH.js"></script>
<script type="text/javascript" src="../js/uhr-de_CH_genau.js"></script>
<script type="text/javascript" src="../js/uhr-de_CH-seconds.js"></script>
<script type="text/javascript" src="../js/uhr-de.js"></script>
<script type="text/javascript" src="../js/uhr-en.js"></script>
<script type="text/javascript" src="../js/uhr-fr.js"></script>
<script type="text/javascript" src="../js/uhr-it.js"></script>
<script type="text/javascript">
(function($) {
var width = $(window).width();
var height = $(window).height() - 150;
@ -59,6 +59,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
language: 'de_CH'
});
})(jQuery);
</script>
</script>
</body>
</html>

View file

@ -22,7 +22,7 @@
<script>
mocha.checkLeaks();
mocha.run();
// $('#u').uhr({'width':'200px'});
// $('#u').uhr({'width':'200px'});
</script>
</body>
</html>

View file

@ -1,8 +1,5 @@
/**
* Created by u203395 on 04.07.2014.
*/
suite('Bärneruhr', function () {
suite('Bärneruhr', function() {
"use strict";
test('dummy', function () {
test('dummy', function() {
});
});