Bugfix: bootstrap jQuery('#') syntax error

Changed: use ES2015
Changed: gulp uglify to terser
Removed: ChangePassword
Removed: nanoscroll
Removed: JS polyfills
This commit is contained in:
djmaze 2020-03-13 15:30:39 +01:00
parent 9aa0cf92a9
commit aae7883b99
133 changed files with 15 additions and 10295 deletions

View file

@ -65,17 +65,7 @@ export const bSafari = !bChrome && -1 < sUserAgent.indexOf('safari');
/**
* @type {boolean}
*/
export const bMobileDevice =
(/android/i).test(sUserAgent) ||
(/iphone/i).test(sUserAgent) ||
(/ipod/i).test(sUserAgent) ||
(/ipad/i).test(sUserAgent) ||
(/blackberry/i).test(sUserAgent);
/**
* @type {boolean}
*/
export const bDisableNanoScroll = bMobileDevice;
export const bMobileDevice = (/android|iphone|ipod|ipad|blackberry|mobile/i).test(sUserAgent);
/**
* @type {boolean}

16
dev/External/ko.js vendored
View file

@ -711,22 +711,6 @@ ko.bindingHandlers.droppable = {
}
};
ko.bindingHandlers.nano = {
init: (element) => {
const Globals = require('Common/Globals'),
Settings = require('Storage/Settings');
if (!Globals.bDisableNanoScroll && !Settings.appSettingsGet('useNativeScrollbars')) {
$(element)
.addClass('nano')
.nanoScroller({
iOSNativeScrolling: false,
preventPageScrolling: true
});
}
}
};
ko.bindingHandlers.saveTrigger = {
init: (element) => {
const $el = $(element);

View file

@ -721,18 +721,6 @@ class RemoteUserAjax extends AbstractAjaxRemote {
};
}
/**
* @param {?Function} fCallback
* @param {string} prevPassword
* @param {string} newPassword
*/
changePassword(fCallback, prevPassword, newPassword) {
this.defaultRequest(fCallback, 'ChangePassword', {
'PrevPassword': prevPassword,
'NewPassword': newPassword
});
}
/**
* @param {?Function} fCallback
* @param {string} sFolderFullNameRaw

View file

@ -16,7 +16,6 @@ import { ContactsUserSettings } from 'Settings/User/Contacts';
import { AccountsUserSettings } from 'Settings/User/Accounts';
import { FiltersUserSettings } from 'Settings/User/Filters';
import { SecurityUserSettings } from 'Settings/User/Security';
import { ChangePasswordUserSettings } from 'Settings/User/ChangePassword';
import { TemplatesUserSettings } from 'Settings/User/Templates';
import { FoldersUserSettings } from 'Settings/User/Folders';
import { ThemesUserSettings } from 'Settings/User/Themes';
@ -79,15 +78,6 @@ class SettingsUserScreen extends AbstractSettingsScreen {
addSettingsViewModel(SecurityUserSettings, 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
}
if (Settings.settingsGet('ChangePasswordIsAllowed')) {
addSettingsViewModel(
ChangePasswordUserSettings,
'SettingsChangePassword',
'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME',
'change-password'
);
}
if (Settings.capa(Capa.Templates)) {
addSettingsViewModel(
TemplatesUserSettings,

View file

@ -1,104 +0,0 @@
import _ from '_';
import ko from 'ko';
import { StorageResultType, Notification } from 'Common/Enums';
import { getNotificationFromResponse, i18n } from 'Common/Translator';
import Remote from 'Remote/User/Ajax';
import { getApp } from 'Helper/Apps/User';
import { command } from 'Knoin/Knoin';
class ChangePasswordUserSettings {
constructor() {
this.changeProcess = ko.observable(false);
this.errorDescription = ko.observable('');
this.passwordMismatch = ko.observable(false);
this.passwordUpdateError = ko.observable(false);
this.passwordUpdateSuccess = ko.observable(false);
this.currentPassword = ko.observable('');
this.currentPassword.error = ko.observable(false);
this.newPassword = ko.observable('');
this.newPassword2 = ko.observable('');
this.currentPassword.subscribe(() => {
this.passwordUpdateError(false);
this.passwordUpdateSuccess(false);
this.currentPassword.error(false);
});
this.newPassword.subscribe(() => {
this.passwordUpdateError(false);
this.passwordUpdateSuccess(false);
this.passwordMismatch(false);
});
this.newPassword2.subscribe(() => {
this.passwordUpdateError(false);
this.passwordUpdateSuccess(false);
this.passwordMismatch(false);
});
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
}
@command(
(self) =>
!self.changeProcess() && '' !== self.currentPassword() && '' !== self.newPassword() && '' !== self.newPassword2()
)
saveNewPasswordCommand() {
if (this.newPassword() !== this.newPassword2()) {
this.passwordMismatch(true);
this.errorDescription(i18n('SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH'));
} else {
this.changeProcess(true);
this.passwordUpdateError(false);
this.passwordUpdateSuccess(false);
this.currentPassword.error(false);
this.passwordMismatch(false);
this.errorDescription('');
Remote.changePassword(this.onChangePasswordResponse, this.currentPassword(), this.newPassword());
}
}
onHide() {
this.changeProcess(false);
this.currentPassword('');
this.newPassword('');
this.newPassword2('');
this.errorDescription('');
this.passwordMismatch(false);
this.currentPassword.error(false);
}
onChangePasswordResponse(result, data) {
this.changeProcess(false);
this.passwordMismatch(false);
this.errorDescription('');
this.currentPassword.error(false);
if (StorageResultType.Success === result && data && data.Result) {
this.currentPassword('');
this.newPassword('');
this.newPassword2('');
this.passwordUpdateSuccess(true);
this.currentPassword.error(false);
getApp().setClientSideToken(data.Result);
} else {
if (data && Notification.CurrentPasswordIncorrect === data.ErrorCode) {
this.currentPassword.error(true);
}
this.passwordUpdateError(true);
this.errorDescription(getNotificationFromResponse(data, Notification.CouldNotSaveNewPassword));
}
}
}
export { ChangePasswordUserSettings, ChangePasswordUserSettings as default };

View file

@ -50,7 +50,6 @@
@import "Ui.less";
@import "Main.less";
@import "Layout.less";
@import "Scroll.less";
@import "Components.less";
@import "SystemDropDown.less";
@import "Login.less";

View file

@ -1,38 +0,0 @@
.nano.scroller-shadow-top:before, .nano.scroller-shadow-bottom:after {
content: "";
position: absolute;
left: 0;
width: 100%;
height: 10px;
z-index: 102;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.4);
}
.nano.scroller-shadow-top:before {
top: -10px;
}
.nano.scroller-shadow-bottom:after {
bottom: -10px;
}
.nano.fixIndex.scroller-shadow-top:before, .nano.fixIndex.scroller-shadow-bottom:after {
z-index: 98;
}
/*
.nano {
.pane .slider {
.transition(top 0.1s ease-out);
}
.pane2 .slider2 {
.transition(left 0.1s ease-out);
}
.pane.active .slider, .pane2.active .slider2 {
.transition(none);
}
}
*/

View file

@ -1,9 +1,3 @@
import elementDatasetPolyfill from 'element-dataset';
elementDatasetPolyfill();
require('json3');
require('intersection-observer');
import window from 'window';
import { progressJs } from '../vendors/Progress.js/src/progress.js';

View file

@ -1,5 +0,0 @@
import 'core-js/features/object/assign';
import 'core-js/features/array/includes';
import 'core-js/features/string/includes';
import 'core-js/features/promise';
import 'raf/polyfill';