2021-07-10 10:55:54 +02:00
|
|
|
import { TAPi18n } from '/imports/i18n';
|
|
|
|
|
2015-05-30 15:50:48 +02:00
|
|
|
Template.headerUserBar.events({
|
2015-06-01 17:56:00 +02:00
|
|
|
'click .js-open-header-member-menu': Popup.open('memberMenu'),
|
2015-09-03 23:12:46 +02:00
|
|
|
'click .js-change-avatar': Popup.open('changeAvatar'),
|
2015-05-30 15:50:48 +02:00
|
|
|
});
|
|
|
|
|
2021-10-29 18:34:03 +02:00
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
onCreated() {
|
|
|
|
Meteor.subscribe('setting');
|
|
|
|
},
|
|
|
|
}).register('memberMenuPopup');
|
|
|
|
|
2019-02-22 22:59:19 +01:00
|
|
|
Template.memberMenuPopup.helpers({
|
|
|
|
templatesBoardId() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
return Meteor.user().getTemplatesBoardId();
|
|
|
|
} else {
|
|
|
|
// No need to getTemplatesBoardId on public board
|
|
|
|
return false;
|
|
|
|
}
|
2019-02-22 22:59:19 +01:00
|
|
|
},
|
|
|
|
templatesBoardSlug() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
return Meteor.user().getTemplatesBoardSlug();
|
|
|
|
} else {
|
|
|
|
// No need to getTemplatesBoardSlug() on public board
|
|
|
|
return false;
|
|
|
|
}
|
2019-02-22 22:59:19 +01:00
|
|
|
},
|
2021-10-29 18:34:03 +02:00
|
|
|
isSameDomainNameSettingValue(){
|
|
|
|
const currSett = Settings.findOne();
|
2021-10-31 19:23:51 +02:00
|
|
|
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
2021-10-29 18:34:03 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
let found = false;
|
|
|
|
for(let i = 0; i < currentUser.emails.length; i++) {
|
2021-10-31 19:23:51 +02:00
|
|
|
if(currentUser.emails[i].address.endsWith(currSett.mailDomainName)){
|
2021-10-29 18:34:03 +02:00
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return found;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
},
|
2021-09-01 11:40:54 +02:00
|
|
|
isNotOAuth2AuthenticationMethod(){
|
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
2021-10-18 15:26:01 +02:00
|
|
|
return currentUser.authenticationMethod.toLowerCase() != 'oauth2';
|
2021-09-01 11:40:54 +02:00
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2019-02-22 22:59:19 +01:00
|
|
|
});
|
|
|
|
|
2015-06-01 17:56:00 +02:00
|
|
|
Template.memberMenuPopup.events({
|
2021-01-01 01:04:53 +02:00
|
|
|
'click .js-my-cards'() {
|
2021-10-21 10:35:16 +02:00
|
|
|
Popup.back();
|
2021-01-01 01:04:53 +02:00
|
|
|
},
|
2021-01-10 18:08:03 +02:00
|
|
|
'click .js-due-cards'() {
|
2021-10-21 10:35:16 +02:00
|
|
|
Popup.back();
|
2021-01-10 18:08:03 +02:00
|
|
|
},
|
2021-01-02 16:39:58 +02:00
|
|
|
'click .js-open-archived-board'() {
|
|
|
|
Modal.open('archivedBoards');
|
|
|
|
},
|
2021-10-29 18:34:03 +02:00
|
|
|
'click .js-invite-people': Popup.open('invitePeople'),
|
2015-06-01 17:56:00 +02:00
|
|
|
'click .js-edit-profile': Popup.open('editProfile'),
|
2016-11-19 19:02:33 +01:00
|
|
|
'click .js-change-settings': Popup.open('changeSettings'),
|
2015-06-01 17:56:00 +02:00
|
|
|
'click .js-change-avatar': Popup.open('changeAvatar'),
|
|
|
|
'click .js-change-password': Popup.open('changePassword'),
|
|
|
|
'click .js-change-language': Popup.open('changeLanguage'),
|
2019-06-28 12:52:09 -05:00
|
|
|
'click .js-logout'(event) {
|
|
|
|
event.preventDefault();
|
2015-06-01 17:56:00 +02:00
|
|
|
|
|
|
|
AccountsTemplates.logout();
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2017-02-24 22:10:38 +08:00
|
|
|
'click .js-go-setting'() {
|
2021-10-21 10:35:16 +02:00
|
|
|
Popup.back();
|
2017-02-24 22:10:38 +08:00
|
|
|
},
|
2015-06-01 17:56:00 +02:00
|
|
|
});
|
|
|
|
|
2021-10-29 18:34:03 +02:00
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
onCreated() {
|
|
|
|
Meteor.subscribe('setting');
|
|
|
|
},
|
|
|
|
}).register('editProfilePopup');
|
|
|
|
|
|
|
|
Template.invitePeoplePopup.events({
|
|
|
|
'click a.js-toggle-board-choose'(event){
|
|
|
|
let target = $(event.target);
|
|
|
|
if (!target.hasClass('js-toggle-board-choose')) {
|
|
|
|
target = target.parent();
|
|
|
|
}
|
|
|
|
const checkboxId = target.attr('id');
|
|
|
|
$(`#${checkboxId} .materialCheckBox`).toggleClass('is-checked');
|
|
|
|
$(`#${checkboxId}`).toggleClass('is-checked');
|
|
|
|
},
|
|
|
|
'click button.js-email-invite'(event){
|
|
|
|
const emails = $('#email-to-invite')
|
|
|
|
.val()
|
|
|
|
.toLowerCase()
|
|
|
|
.trim()
|
|
|
|
.split('\n')
|
|
|
|
.join(',')
|
|
|
|
.split(',');
|
|
|
|
const boardsToInvite = [];
|
|
|
|
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function() {
|
|
|
|
boardsToInvite.push($(this).data('id'));
|
|
|
|
});
|
|
|
|
const validEmails = [];
|
|
|
|
emails.forEach(email => {
|
|
|
|
if (email && SimpleSchema.RegEx.Email.test(email.trim())) {
|
|
|
|
validEmails.push(email.trim());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (validEmails.length) {
|
|
|
|
Meteor.call('sendInvitation', validEmails, boardsToInvite, (_, rc) => {
|
|
|
|
if (rc == 0) {
|
|
|
|
let divInfos = document.getElementById("invite-people-infos");
|
|
|
|
if(divInfos && divInfos !== undefined){
|
|
|
|
divInfos.innerHTML = "<span style='color: green'>" + TAPi18n.__('invite-people-success') + "</span>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
let divInfos = document.getElementById("invite-people-infos");
|
|
|
|
if(divInfos && divInfos !== undefined){
|
|
|
|
divInfos.innerHTML = "<span style='color: red'>" + TAPi18n.__('invite-people-error') + "</span>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Popup.close();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
Template.invitePeoplePopup.helpers({
|
|
|
|
currentSetting() {
|
|
|
|
return Settings.findOne();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2017-08-07 17:40:50 +09:00
|
|
|
Template.editProfilePopup.helpers({
|
|
|
|
allowEmailChange() {
|
2020-01-03 17:02:27 +02:00
|
|
|
Meteor.call('AccountSettings.allowEmailChange', (_, result) => {
|
|
|
|
if (result) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2017-08-07 17:40:50 +09:00
|
|
|
},
|
2018-05-04 16:44:50 -03:00
|
|
|
allowUserNameChange() {
|
2020-01-03 17:02:27 +02:00
|
|
|
Meteor.call('AccountSettings.allowUserNameChange', (_, result) => {
|
|
|
|
if (result) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2018-05-04 16:44:50 -03:00
|
|
|
},
|
2019-07-30 11:57:21 +02:00
|
|
|
allowUserDelete() {
|
2020-01-03 17:02:27 +02:00
|
|
|
Meteor.call('AccountSettings.allowUserDelete', (_, result) => {
|
|
|
|
if (result) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2019-07-30 11:57:21 +02:00
|
|
|
},
|
2017-08-07 17:40:50 +09:00
|
|
|
});
|
|
|
|
|
2015-06-01 17:56:00 +02:00
|
|
|
Template.editProfilePopup.events({
|
2019-06-28 12:52:09 -05:00
|
|
|
submit(event, templateInstance) {
|
|
|
|
event.preventDefault();
|
|
|
|
const fullname = templateInstance.find('.js-profile-fullname').value.trim();
|
|
|
|
const username = templateInstance.find('.js-profile-username').value.trim();
|
|
|
|
const initials = templateInstance.find('.js-profile-initials').value.trim();
|
|
|
|
const email = templateInstance.find('.js-profile-email').value.trim();
|
2017-08-07 17:40:50 +09:00
|
|
|
let isChangeUserName = false;
|
|
|
|
let isChangeEmail = false;
|
2017-12-01 15:04:35 +07:00
|
|
|
Users.update(Meteor.userId(), {
|
|
|
|
$set: {
|
|
|
|
'profile.fullname': fullname,
|
|
|
|
'profile.initials': initials,
|
2017-12-01 15:15:44 +07:00
|
|
|
},
|
2017-12-01 15:04:35 +07:00
|
|
|
});
|
2017-08-07 17:40:50 +09:00
|
|
|
isChangeUserName = username !== Meteor.user().username;
|
2019-06-28 12:52:09 -05:00
|
|
|
isChangeEmail =
|
|
|
|
email.toLowerCase() !== Meteor.user().emails[0].address.toLowerCase();
|
2017-08-07 17:40:50 +09:00
|
|
|
if (isChangeUserName && isChangeEmail) {
|
2019-06-28 12:52:09 -05:00
|
|
|
Meteor.call(
|
|
|
|
'setUsernameAndEmail',
|
|
|
|
username,
|
|
|
|
email.toLowerCase(),
|
|
|
|
Meteor.userId(),
|
|
|
|
function(error) {
|
|
|
|
const usernameMessageElement = templateInstance.$('.username-taken');
|
|
|
|
const emailMessageElement = templateInstance.$('.email-taken');
|
|
|
|
if (error) {
|
|
|
|
const errorElement = error.error;
|
|
|
|
if (errorElement === 'username-already-taken') {
|
|
|
|
usernameMessageElement.show();
|
|
|
|
emailMessageElement.hide();
|
|
|
|
} else if (errorElement === 'email-already-taken') {
|
|
|
|
usernameMessageElement.hide();
|
|
|
|
emailMessageElement.show();
|
|
|
|
}
|
|
|
|
} else {
|
2017-08-07 17:40:50 +09:00
|
|
|
usernameMessageElement.hide();
|
2019-06-28 12:52:09 -05:00
|
|
|
emailMessageElement.hide();
|
|
|
|
Popup.back();
|
2017-08-07 17:40:50 +09:00
|
|
|
}
|
2019-06-28 12:52:09 -05:00
|
|
|
},
|
|
|
|
);
|
2017-08-07 17:40:50 +09:00
|
|
|
} else if (isChangeUserName) {
|
2019-06-28 12:52:09 -05:00
|
|
|
Meteor.call('setUsername', username, Meteor.userId(), function(error) {
|
|
|
|
const messageElement = templateInstance.$('.username-taken');
|
2016-11-18 23:18:16 +01:00
|
|
|
if (error) {
|
2016-11-18 23:23:13 +01:00
|
|
|
messageElement.show();
|
2016-11-18 23:18:16 +01:00
|
|
|
} else {
|
|
|
|
messageElement.hide();
|
|
|
|
Popup.back();
|
|
|
|
}
|
|
|
|
});
|
2017-08-07 17:40:50 +09:00
|
|
|
} else if (isChangeEmail) {
|
2019-06-28 12:52:09 -05:00
|
|
|
Meteor.call('setEmail', email.toLowerCase(), Meteor.userId(), function(
|
|
|
|
error,
|
|
|
|
) {
|
|
|
|
const messageElement = templateInstance.$('.email-taken');
|
2017-08-07 17:40:50 +09:00
|
|
|
if (error) {
|
|
|
|
messageElement.show();
|
|
|
|
} else {
|
|
|
|
messageElement.hide();
|
|
|
|
Popup.back();
|
|
|
|
}
|
|
|
|
});
|
2016-11-18 23:18:16 +01:00
|
|
|
} else Popup.back();
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2019-07-30 11:42:43 +02:00
|
|
|
'click #deleteButton': Popup.afterConfirm('userDelete', function() {
|
2021-10-21 10:35:16 +02:00
|
|
|
Popup.back();
|
2019-07-30 11:42:43 +02:00
|
|
|
Users.remove(Meteor.userId());
|
2019-04-26 17:53:48 +02:00
|
|
|
AccountsTemplates.logout();
|
2019-07-30 11:42:43 +02:00
|
|
|
}),
|
2015-06-01 17:56:00 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// XXX For some reason the useraccounts autofocus isnt working in this case.
|
|
|
|
// See https://github.com/meteor-useraccounts/core/issues/384
|
2019-06-28 12:52:09 -05:00
|
|
|
Template.changePasswordPopup.onRendered(function() {
|
2015-06-01 17:56:00 +02:00
|
|
|
this.find('#at-field-current_password').focus();
|
|
|
|
});
|
|
|
|
|
|
|
|
Template.changeLanguagePopup.helpers({
|
2015-09-03 23:12:46 +02:00
|
|
|
languages() {
|
2021-07-10 10:55:54 +02:00
|
|
|
return TAPi18n.getSupportedLanguages()
|
2022-04-21 19:14:30 +03:00
|
|
|
.map(({ tag, name }) => ({ tag: tag, name }))
|
2021-07-10 10:55:54 +02:00
|
|
|
.sort((a, b) => {
|
|
|
|
if (a.name === b.name) {
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
return a.name > b.name ? 1 : -1;
|
|
|
|
}
|
|
|
|
});
|
2015-05-30 15:50:48 +02:00
|
|
|
},
|
2015-09-03 23:12:46 +02:00
|
|
|
|
|
|
|
isCurrentLanguage() {
|
2015-05-30 15:50:48 +02:00
|
|
|
return this.tag === TAPi18n.getLanguage();
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2015-05-30 15:50:48 +02:00
|
|
|
});
|
|
|
|
|
2015-06-01 17:56:00 +02:00
|
|
|
Template.changeLanguagePopup.events({
|
2019-06-28 12:52:09 -05:00
|
|
|
'click .js-set-language'(event) {
|
2015-05-30 15:50:48 +02:00
|
|
|
Users.update(Meteor.userId(), {
|
|
|
|
$set: {
|
2015-09-03 23:12:46 +02:00
|
|
|
'profile.language': this.tag,
|
|
|
|
},
|
2015-05-30 15:50:48 +02:00
|
|
|
});
|
2021-02-03 12:20:29 +02:00
|
|
|
TAPi18n.setLanguage(this.tag);
|
2019-06-28 12:52:09 -05:00
|
|
|
event.preventDefault();
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2015-05-30 15:50:48 +02:00
|
|
|
});
|
2016-11-19 19:02:33 +01:00
|
|
|
|
|
|
|
Template.changeSettingsPopup.helpers({
|
|
|
|
hiddenSystemMessages() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
if (currentUser) {
|
2019-11-19 14:09:36 +02:00
|
|
|
return (currentUser.profile || {}).hasHiddenSystemMessages;
|
2020-10-28 15:45:37 +02:00
|
|
|
} else if (window.localStorage.getItem('hasHiddenSystemMessages')) {
|
2019-12-17 23:42:30 +02:00
|
|
|
return true;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
} else {
|
2019-12-17 23:42:30 +02:00
|
|
|
return false;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2016-11-19 19:19:24 +01:00
|
|
|
},
|
2016-11-25 21:45:11 +01:00
|
|
|
showCardsCountAt() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
if (currentUser) {
|
|
|
|
return Meteor.user().getLimitToShowCardsCount();
|
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
return window.localStorage.getItem('limitToShowCardsCount');
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2016-11-25 21:45:11 +01:00
|
|
|
},
|
2020-04-22 14:44:08 +02:00
|
|
|
weekDays(startDay) {
|
|
|
|
return [
|
|
|
|
TAPi18n.__('sunday'),
|
|
|
|
TAPi18n.__('monday'),
|
|
|
|
TAPi18n.__('tuesday'),
|
|
|
|
TAPi18n.__('wednesday'),
|
|
|
|
TAPi18n.__('thursday'),
|
|
|
|
TAPi18n.__('friday'),
|
|
|
|
TAPi18n.__('saturday'),
|
|
|
|
].map(function(day, index) {
|
|
|
|
return { name: day, value: index, isSelected: index === startDay };
|
|
|
|
});
|
|
|
|
},
|
|
|
|
startDayOfWeek() {
|
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
return currentUser.getStartDayOfWeek();
|
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
return window.localStorage.getItem('startDayOfWeek');
|
2020-04-22 14:44:08 +02:00
|
|
|
}
|
|
|
|
},
|
2016-11-19 19:02:33 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
Template.changeSettingsPopup.events({
|
2021-02-06 15:25:10 +01:00
|
|
|
'keypress/paste #show-cards-count-at'() {
|
|
|
|
let keyCode = event.keyCode;
|
|
|
|
let charCode = String.fromCharCode(keyCode);
|
2021-02-08 21:11:13 +02:00
|
|
|
let regex = new RegExp('[-0-9]');
|
2021-02-06 15:25:10 +01:00
|
|
|
let ret = regex.test(charCode);
|
|
|
|
return ret;
|
|
|
|
},
|
2019-10-29 19:05:44 +02:00
|
|
|
'click .js-toggle-desktop-drag-handles'() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
Meteor.call('toggleDesktopDragHandles');
|
2020-10-28 15:45:37 +02:00
|
|
|
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
|
|
|
|
window.localStorage.removeItem('showDesktopDragHandles');
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
window.localStorage.setItem('showDesktopDragHandles', 'true');
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2019-10-29 19:05:44 +02:00
|
|
|
},
|
2016-11-19 19:19:24 +01:00
|
|
|
'click .js-toggle-system-messages'() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
if (currentUser) {
|
|
|
|
Meteor.call('toggleSystemMessages');
|
2020-10-28 15:45:37 +02:00
|
|
|
} else if (window.localStorage.getItem('hasHiddenSystemMessages')) {
|
|
|
|
window.localStorage.removeItem('hasHiddenSystemMessages');
|
2019-11-19 14:09:36 +02:00
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
window.localStorage.setItem('hasHiddenSystemMessages', 'true');
|
2019-11-19 14:09:36 +02:00
|
|
|
}
|
2016-11-19 19:02:33 +01:00
|
|
|
},
|
2020-04-22 19:42:10 +02:00
|
|
|
'click .js-apply-user-settings'(event, templateInstance) {
|
2019-06-28 12:52:09 -05:00
|
|
|
event.preventDefault();
|
2021-02-06 15:25:10 +01:00
|
|
|
let minLimit = parseInt(
|
2019-06-28 12:52:09 -05:00
|
|
|
templateInstance.$('#show-cards-count-at').val(),
|
|
|
|
10,
|
|
|
|
);
|
2020-04-22 19:42:10 +02:00
|
|
|
const startDay = parseInt(
|
|
|
|
templateInstance.$('#start-day-of-week').val(),
|
|
|
|
10,
|
|
|
|
);
|
|
|
|
const currentUser = Meteor.user();
|
2021-02-06 15:44:18 +01:00
|
|
|
if (isNaN(minLimit) || minLimit < -1) {
|
|
|
|
minLimit = -1;
|
2021-02-06 15:25:10 +01:00
|
|
|
}
|
2016-11-25 21:45:11 +01:00
|
|
|
if (!isNaN(minLimit)) {
|
2019-11-19 14:09:36 +02:00
|
|
|
if (currentUser) {
|
|
|
|
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
window.localStorage.setItem('limitToShowCardsCount', minLimit);
|
2019-11-19 14:09:36 +02:00
|
|
|
}
|
2016-11-25 21:45:11 +01:00
|
|
|
}
|
2020-04-22 14:44:08 +02:00
|
|
|
if (!isNaN(startDay)) {
|
|
|
|
if (currentUser) {
|
|
|
|
Meteor.call('changeStartDayOfWeek', startDay);
|
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
window.localStorage.setItem('startDayOfWeek', startDay);
|
2020-04-22 14:44:08 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-22 19:42:10 +02:00
|
|
|
Popup.back();
|
2020-04-22 14:44:08 +02:00
|
|
|
},
|
2016-11-19 19:02:33 +01:00
|
|
|
});
|