Drop gulp-autoprefixer and cleanup boot process

This commit is contained in:
djmaze 2021-02-04 15:03:11 +01:00
parent b26586f2ba
commit 192f76c08a
6 changed files with 390 additions and 459 deletions

View file

@ -1,4 +1,4 @@
.progressjs {
#progressjs {
left: 0;
position: fixed;
top: 0;

View file

@ -33,13 +33,14 @@ const
}
};
}
return win[name];
},
STORAGE_KEY = '__rlA',
TIME_KEY = '__rlT',
AUTH_KEY = 'AuthAccountHash',
storage = () => window.sessionStorage,
storage = Storage('session'),
timestamp = () => Math.round(Date.now() / 1000),
setTimestamp = () => storage().setItem(TIME_KEY, timestamp()),
setTimestamp = () => storage.setItem(TIME_KEY, timestamp()),
showError = () => {
eId('rl-loading').hidden = true;
@ -83,29 +84,29 @@ if (!navigator || !navigator.cookieEnabled) {
}
let pStep = 0,
container = doc.querySelector('.progressjs'),
progress = doc.querySelector('.progressjs-inner'),
container = eId('progressjs'),
progress = container.querySelector('.progressjs-inner'),
RL_APP_DATA = {};
win.rl = {
hash: {
// getHash
get: () => storage().getItem(STORAGE_KEY) || null,
get: () => storage.getItem(STORAGE_KEY) || null,
// setHash
set: () => {
storage().setItem(STORAGE_KEY, RL_APP_DATA && RL_APP_DATA[AUTH_KEY]
storage.setItem(STORAGE_KEY, RL_APP_DATA && RL_APP_DATA[AUTH_KEY]
? RL_APP_DATA[AUTH_KEY] : '');
setTimestamp();
},
// clearHash
clear: () => {
storage().setItem(STORAGE_KEY, '');
storage.setItem(STORAGE_KEY, '');
setTimestamp();
},
// checkTimestamp
check: () => {
if (timestamp() > (parseInt(storage().getItem(TIME_KEY) || 0, 10) || 0) + 3600000) {
if (timestamp() > (parseInt(storage.getItem(TIME_KEY) || 0, 10) || 0) + 3600000) {
// 60m
rl.hash.clear();
return true;
@ -166,7 +167,6 @@ win.rl = {
p.set(1);
Storage('local');
Storage('session');
// init section
setInterval(setTimestamp, 60000); // 1m

View file

@ -50,7 +50,6 @@
"eslint": "6.8.0",
"eslint-plugin-prettier": "3.3.1",
"gulp": "4.0.2",
"gulp-autoprefixer": "7.0.1",
"gulp-cached": "1.1.1",
"gulp-clean-css": "4.3.0",
"gulp-concat-util": "0.5.5",

View file

@ -41,7 +41,7 @@
</div>
<div id="rl-templates"></div>
</div>
<div class="progressjs"><div class="progressjs-inner"><div class="progressjs-percent"></div></div></div>
<div id="progressjs"><div class="progressjs-inner"><div class="progressjs-percent"></div></div></div>
<script type="text/javascript">{{BaseAppBootScript}}</script>
</body>

View file

@ -15,20 +15,19 @@ const { del } = require('./common');
const cssClean = () => del(config.paths.staticCSS + '/*.css');
const cssBootBuild = () => {
const autoprefixer = require('gulp-autoprefixer'),
const
src = config.paths.css.boot.src;
return gulp
.src(src)
.pipe(expect.real({ errorOnFailure: true }, src))
.pipe(concat(config.paths.css.boot.name))
.pipe(autoprefixer())
.pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/'))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticCSS));
};
const cssMainBuild = () => {
const autoprefixer = require('gulp-autoprefixer'),
const
less = require('gulp-less'),
lessFilter = filter('**/*.less', { restore: true }),
src = config.paths.css.main.src.concat([config.paths.less.main.src]);
@ -44,7 +43,6 @@ const cssMainBuild = () => {
)
.pipe(lessFilter.restore)
.pipe(concat(config.paths.css.main.name))
.pipe(autoprefixer())
.pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/'))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticCSS))

820
yarn.lock

File diff suppressed because it is too large Load diff