Merge branch 'develop'

This commit is contained in:
Manuel Friedli 2013-12-01 16:45:05 +01:00
commit 994e120c9b
4 changed files with 17 additions and 18 deletions

5
README
View File

@ -32,7 +32,7 @@ Erstelle ein leeres <div> mit einer ID:
3. Uhr per Javascript konfigurieren
Initialisiere die Uhr mit einer einzigen Zeile Javascript:
new Uhr($('#meineuhr'));
new Uhr(jQuery('#meineuhr'));
Als Parameter wird ein jQuery-gewrapptes HTML-Element erwartet.
@ -46,7 +46,7 @@ Wie du diese Optionen ändern kannst, verrät der nächte Abschnitt
4. Weitere Optionen
Der Uhr()-Methode kann ein Options-Objekt mitgegeben werden:
new Uhr($('#uhrcontainer'), {
new Uhr(jQuery('#uhrcontainer'), {
status: 'on', // 'on' oder 'off'
theme: 'red', // 'black', 'red', 'blue', 'green' oder 'white'
layout: 'en', // 'de_EC', 'de' oder 'en' (je nach eingebundenen Sprachdateien
@ -69,4 +69,3 @@ 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/>.

View File

@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<script type="text/javascript" src="uhr-de.js"></script>
<script type="text/javascript" src="uhr-en.js"></script>
<script type="text/javascript">
new Uhr($('#uhr'), {
new Uhr(jQuery('#uhr'), {
layout: 'de_CH',
theme: 'black',
status: 'on',

View File

@ -1,5 +1,5 @@
CACHE MANIFEST
# 3.0.5
# 3.0.6
COPYING
index.html

26
uhr.js
View File

@ -42,7 +42,7 @@ Uhr.prototype.start = function() {
var uhr = this;
this.timer = window.setInterval(function() {uhr.update();}, 1000);
this.update();
$.cookie('status' + this.id, 'on', {expires: 365, path: '/'});
jQuery.cookie('status' + this.id, 'on', {expires: 365, path: '/'});
}
}
Uhr.prototype.stop = function() {
@ -50,7 +50,7 @@ Uhr.prototype.stop = function() {
window.clearInterval(this.timer);
this.timer = null;
this.update();
$.cookie('status' + this.id, 'off', {expires: 365, path: '/'});
jQuery.cookie('status' + this.id, 'off', {expires: 365, path: '/'});
}
}
Uhr.prototype.isOn = function() {
@ -62,7 +62,7 @@ Uhr.prototype.setLayout = function(locale) {
this.currentLayout = newLayout;
var renderer = new UhrRenderer(this.currentLayout, this.letterarea);
renderer.render(this);
$.cookie('layout' + this.id, locale, {expires: 365, path: '/'});
jQuery.cookie('layout' + this.id, locale, {expires: 365, path: '/'});
}
}
Uhr.prototype.setTheme = function(theme) {
@ -72,7 +72,7 @@ Uhr.prototype.setTheme = function(theme) {
this.clockarea.addClass(theme);
this.toggleSwitch.addClass(theme);
this.currentTheme = theme;
$.cookie('theme' + this.id, theme, {expires: 365, path: '/'});
jQuery.cookie('theme' + this.id, theme, {expires: 365, path: '/'});
}
}
Uhr.prototype.update = function() {
@ -174,8 +174,8 @@ Uhr.prototype.createClockarea = function(clockarea, width) {
this.clockarea = clockarea
}
Uhr.prototype.createToggleSwitch = function() {
this.toggleSwitch = $('<div class="onoffswitch"></div>');
var input = $('<input type="checkbox" name="onoffswitch' + this.id + '" class="onoffswitch-checkbox" id="onoffswitch' + this.id + '" checked="checked" />');
this.toggleSwitch = jQuery('<div class="onoffswitch"></div>');
var input = jQuery('<input type="checkbox" name="onoffswitch' + this.id + '" class="onoffswitch-checkbox" id="onoffswitch' + this.id + '" checked="checked" />');
this.toggleSwitch.append(input);
this.toggleSwitch.append('<label class="onoffswitch-label" for="onoffswitch' + this.id + '">'
+ '<div class="onoffswitch-inner"></div>'
@ -184,18 +184,18 @@ Uhr.prototype.createToggleSwitch = function() {
this.clockarea.after(this.toggleSwitch);
}
Uhr.prototype.createLayoutSwitch = function () {
this.layoutSwitch = $('<select></select>')
this.layoutSwitch = jQuery('<select></select>')
for (var code in Uhr.layouts) {
if (Uhr.layouts.hasOwnProperty(code)) {
var layout = Uhr.layouts[code];
var option = $('<option value="' + code + '">' + layout.language + '</option>')
var option = jQuery('<option value="' + code + '">' + layout.language + '</option>')
this.layoutSwitch.append(option);
}
}
this.clockarea.after(this.layoutSwitch);
}
Uhr.prototype.createThemeSwitch = function () {
this.themeSwitch = $('<select></select>');
this.themeSwitch = jQuery('<select></select>');
this.themeSwitch.append('<option value="black">Schwarz</option>');
this.themeSwitch.append('<option value="red">Rot</option>');
this.themeSwitch.append('<option value="blue">Blau</option>');
@ -204,12 +204,12 @@ Uhr.prototype.createThemeSwitch = function () {
this.clockarea.after(this.themeSwitch);
}
Uhr.prototype.initToggleSwitch = function(defaultValue, overrideCookie) {
var input = $('#onoffswitch' + this.id);
var input = jQuery('#onoffswitch' + this.id);
var uhr = this;
input.on('click', function() {
uhr.toggle();
});
var status = $.cookie('status' + this.id);
var status = jQuery.cookie('status' + this.id);
if (status == undefined || (overrideCookie && (defaultValue != undefined))) {
status = defaultValue;
}
@ -229,7 +229,7 @@ Uhr.prototype.initLayoutSwitch = function(defaultValue, overrideCookie) {
this.layoutSwitch.on('change', function() {
uhr.setLayout(this.value);
});
var selectedLayout = $.cookie('layout' + this.id);
var selectedLayout = jQuery.cookie('layout' + this.id);
if (selectedLayout == undefined || (overrideCookie && (defaultValue != undefined))) {
selectedLayout = defaultValue;
}
@ -245,7 +245,7 @@ Uhr.prototype.initThemeSwitch = function(defaultValue, overrideCookie) {
this.themeSwitch.on('change', function() {
uhr.setTheme(this.value);
});
var selectedTheme = $.cookie('theme' + this.id);
var selectedTheme = jQuery.cookie('theme' + this.id);
if (selectedTheme == undefined || (overrideCookie && (defaultValue != undefined))) {
selectedTheme = defaultValue;
}