mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 13:47:59 -06:00
ENH: model info display UI
Change-Id: I066c0e7f8ce87ec00b1141a1b44430444a819b42 (cherry picked from commit 05907a1a42da82737090d55046974d401f8af057)
This commit is contained in:
parent
0cc953ad41
commit
b4ffa91cb4
343 changed files with 54828 additions and 2 deletions
36
resources/web/include/swiper/postinstall.js
Normal file
36
resources/web/include/swiper/postinstall.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* eslint-disable max-len -- for better formatting */
|
||||
var env = process.env;
|
||||
|
||||
var ADBLOCK = is(env.ADBLOCK);
|
||||
var COLOR = is(env.npm_config_color);
|
||||
var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
|
||||
var SILENT = ['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel) !== -1;
|
||||
var OPEN_SOURCE_CONTRIBUTOR = is(env.OPEN_SOURCE_CONTRIBUTOR);
|
||||
|
||||
// you could add a PR with an env variable for your CI detection
|
||||
var CI = [
|
||||
'BUILD_NUMBER',
|
||||
'CI',
|
||||
'CONTINUOUS_INTEGRATION',
|
||||
'DRONE',
|
||||
'RUN_ID'
|
||||
].some(function (it) { return is(env[it]); });
|
||||
|
||||
var BANNER = '\u001b[35m\u001b[1mLove Swiper? Support Vladimir\'s work by donating or pledging: \u001B[0m\n' +
|
||||
'\u001b[22m\u001b[39m\u001b[32m> On Patreon https://patreon.com/swiperjs \u001B[0m\n' +
|
||||
'\u001b[22m\u001b[39m\u001b[32m> On Open Collective https://opencollective.com/swiper';
|
||||
|
||||
function is(it) {
|
||||
return !!it && it !== '0' && it !== 'false';
|
||||
}
|
||||
|
||||
function isBannerRequired() {
|
||||
return !(ADBLOCK || CI || DISABLE_OPENCOLLECTIVE || SILENT || OPEN_SOURCE_CONTRIBUTOR);
|
||||
}
|
||||
|
||||
function showBanner() {
|
||||
// eslint-disable-next-line no-console,no-control-regex -- output
|
||||
console.log(COLOR ? BANNER : BANNER.replace(/\u001B\[\d+m/g, ''));
|
||||
}
|
||||
|
||||
if (isBannerRequired()) showBanner();
|
Loading…
Add table
Add a link
Reference in a new issue