renamed _id to id

This commit is contained in:
Manuel Friedli 2014-07-03 21:18:27 +02:00
parent ec9b44427c
commit 60e68ffeaf

View file

@ -97,7 +97,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
var setTheme = function setTheme(theme) { var setTheme = function setTheme(theme) {
if (theme !== this.options.theme) { if (theme !== this.options.theme) {
this.element.removeClass(this.options.theme).addClass(theme); this.element.removeClass(this.options.theme).addClass(theme);
$('#uhr-onoffswitch' + this._id).removeClass(this.options.theme).addClass(theme); $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
this.options.theme = theme; this.options.theme = theme;
setCookie(this, 'uhr-theme', theme); setCookie(this, 'uhr-theme', theme);
} }
@ -117,7 +117,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// private interface methods // private interface methods
var create = function create() { var create = function create() {
this._id = uhrGlobals.id++; this.id = uhrGlobals.id++;
this.timer = null; this.timer = null;
this._currentMinute = -1; this._currentMinute = -1;
var userTime = this.options.time; var userTime = this.options.time;
@ -151,9 +151,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
if (uhr.options.controls) { if (uhr.options.controls) {
// on/off switch // on/off switch
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + uhr._id + '"></div>'); var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + uhr.id + '"></div>');
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + uhr._id + '" checked="checked" />'); toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + uhr.id + '" checked="checked" />');
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + uhr._id + '">' toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + uhr.id + '">'
+ '<div class="onoffswitch-inner"></div>' + '<div class="onoffswitch-inner"></div>'
+ '<div class="onoffswitch-switch"></div>' + '<div class="onoffswitch-switch"></div>'
+ '</label>'); + '</label>');
@ -161,7 +161,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// language chooser // language chooser
if (uhrGlobals.languages.length > 1) { if (uhrGlobals.languages.length > 1) {
var languageChooser = $('<select id="uhr-languagechooser' + uhr._id + '"></select>'); var languageChooser = $('<select id="uhr-languagechooser' + uhr.id + '"></select>');
for (var i = 0; i < uhrGlobals.languages.length; i++) { for (var i = 0; i < uhrGlobals.languages.length; i++) {
var language = uhrGlobals.languages[i]; var language = uhrGlobals.languages[i];
languageChooser.append('<option value="' + language.code + '">' + language.language + '</option>'); languageChooser.append('<option value="' + language.code + '">' + language.language + '</option>');
@ -171,7 +171,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// theme chooser // theme chooser
if (uhrGlobals.themes.length > 1) { if (uhrGlobals.themes.length > 1) {
var themeChooser = $('<select id="uhr-themechooser' + uhr._id + '"></select>'); var themeChooser = $('<select id="uhr-themechooser' + uhr.id + '"></select>');
for (var i = 0; i < uhrGlobals.themes.length; i++) { for (var i = 0; i < uhrGlobals.themes.length; i++) {
var theme = uhrGlobals.themes[i]; var theme = uhrGlobals.themes[i];
themeChooser.append('<option value="' + theme.styleClass + '">' + theme.name + '</option>'); themeChooser.append('<option value="' + theme.styleClass + '">' + theme.name + '</option>');
@ -183,11 +183,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
var wireFunctionality = function wireFunctionality(uhr) { var wireFunctionality = function wireFunctionality(uhr) {
// on/off switch // on/off switch
var toggleSwitch = $('#uhr-onoffswitch-checkbox' + uhr._id); var toggleSwitch = $('#uhr-onoffswitch-checkbox' + uhr.id);
toggleSwitch.on('click', function () { toggleSwitch.on('click', function () {
uhr.toggle(); uhr.toggle();
}); });
var status = $.cookie('uhr-status' + uhr._id); var status = $.cookie('uhr-status' + uhr.id);
if (status === undefined || uhr.options.force) { if (status === undefined || uhr.options.force) {
status = uhr.options.status; status = uhr.options.status;
} }
@ -199,11 +199,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} }
// language chooser // language chooser
var languageChooser = $('#uhr-languagechooser' + uhr._id); var languageChooser = $('#uhr-languagechooser' + uhr.id);
languageChooser.on('change', function () { languageChooser.on('change', function () {
uhr.language(this.value); uhr.language(this.value);
}); });
var selectedLanguage = $.cookie('uhr-language' + uhr._id); var selectedLanguage = $.cookie('uhr-language' + uhr.id);
if (selectedLanguage === undefined || uhr.options.force) { if (selectedLanguage === undefined || uhr.options.force) {
selectedLanguage = uhr.options.language; selectedLanguage = uhr.options.language;
} }
@ -230,11 +230,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
uhr.language(selectedLanguage); uhr.language(selectedLanguage);
// theme chooser // theme chooser
var themeChooser = $('#uhr-themechooser' + uhr._id); var themeChooser = $('#uhr-themechooser' + uhr.id);
themeChooser.on('change', function () { themeChooser.on('change', function () {
uhr.theme(this.value); uhr.theme(this.value);
}); });
var selectedTheme = $.cookie('uhr-theme' + uhr._id); var selectedTheme = $.cookie('uhr-theme' + uhr.id);
if (selectedTheme === undefined || uhr.options.force) { if (selectedTheme === undefined || uhr.options.force) {
selectedTheme = uhr.options.theme; selectedTheme = uhr.options.theme;
} }
@ -262,7 +262,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} else { } else {
options = {expires: 365}; options = {expires: 365};
} }
$.cookie(cookieName + uhr._id, cookieValue, options); $.cookie(cookieName + uhr.id, cookieValue, options);
}; };
// business logic // business logic