renamed _id to id
This commit is contained in:
parent
ec9b44427c
commit
60e68ffeaf
1 changed files with 14 additions and 14 deletions
28
js/uhr.js
28
js/uhr.js
|
@ -97,7 +97,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
var setTheme = function setTheme(theme) {
|
||||
if (theme !== this.options.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;
|
||||
setCookie(this, 'uhr-theme', theme);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
// private interface methods
|
||||
var create = function create() {
|
||||
this._id = uhrGlobals.id++;
|
||||
this.id = uhrGlobals.id++;
|
||||
this.timer = null;
|
||||
this._currentMinute = -1;
|
||||
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) {
|
||||
// on/off switch
|
||||
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('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + uhr._id + '">'
|
||||
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('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + uhr.id + '">'
|
||||
+ '<div class="onoffswitch-inner"></div>'
|
||||
+ '<div class="onoffswitch-switch"></div>'
|
||||
+ '</label>');
|
||||
|
@ -161,7 +161,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
// language chooser
|
||||
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++) {
|
||||
var language = uhrGlobals.languages[i];
|
||||
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
|
||||
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++) {
|
||||
var theme = uhrGlobals.themes[i];
|
||||
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) {
|
||||
|
||||
// on/off switch
|
||||
var toggleSwitch = $('#uhr-onoffswitch-checkbox' + uhr._id);
|
||||
var toggleSwitch = $('#uhr-onoffswitch-checkbox' + uhr.id);
|
||||
toggleSwitch.on('click', function () {
|
||||
uhr.toggle();
|
||||
});
|
||||
var status = $.cookie('uhr-status' + uhr._id);
|
||||
var status = $.cookie('uhr-status' + uhr.id);
|
||||
if (status === undefined || uhr.options.force) {
|
||||
status = uhr.options.status;
|
||||
}
|
||||
|
@ -199,11 +199,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
}
|
||||
|
||||
// language chooser
|
||||
var languageChooser = $('#uhr-languagechooser' + uhr._id);
|
||||
var languageChooser = $('#uhr-languagechooser' + uhr.id);
|
||||
languageChooser.on('change', function () {
|
||||
uhr.language(this.value);
|
||||
});
|
||||
var selectedLanguage = $.cookie('uhr-language' + uhr._id);
|
||||
var selectedLanguage = $.cookie('uhr-language' + uhr.id);
|
||||
if (selectedLanguage === undefined || uhr.options.force) {
|
||||
selectedLanguage = uhr.options.language;
|
||||
}
|
||||
|
@ -230,11 +230,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
uhr.language(selectedLanguage);
|
||||
|
||||
// theme chooser
|
||||
var themeChooser = $('#uhr-themechooser' + uhr._id);
|
||||
var themeChooser = $('#uhr-themechooser' + uhr.id);
|
||||
themeChooser.on('change', function () {
|
||||
uhr.theme(this.value);
|
||||
});
|
||||
var selectedTheme = $.cookie('uhr-theme' + uhr._id);
|
||||
var selectedTheme = $.cookie('uhr-theme' + uhr.id);
|
||||
if (selectedTheme === undefined || uhr.options.force) {
|
||||
selectedTheme = uhr.options.theme;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
} else {
|
||||
options = {expires: 365};
|
||||
}
|
||||
$.cookie(cookieName + uhr._id, cookieValue, options);
|
||||
$.cookie(cookieName + uhr.id, cookieValue, options);
|
||||
};
|
||||
|
||||
// business logic
|
||||
|
|
Loading…
Reference in a new issue