IMPR: UI version info

This commit is contained in:
Tony Air 2020-09-11 01:17:07 +07:00
parent 0d963161ac
commit b2d625fbae
5 changed files with 33 additions and 16 deletions

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

2
dist/js/app.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate", "name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
"version": "2.5.1", "version": "2.5.2",
"author": "Tony Air <tony@twma.pro>", "author": "Tony Air <tony@twma.pro>",
"license": "MIT", "license": "MIT",
"description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.", "description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.",

View File

@ -28,16 +28,18 @@ const MainUI = (($) => {
console.clear(); console.clear();
if (typeof UINAME !== 'undefined') { console.info(
console.info( `%cUI Kit ${UINAME} ${UIVERSION}`,
`%cUI Kit ${UINAME} ${UIVERSION}`, 'color:yellow;font-size:14px',
'color:yellow;font-size:14px', );
); console.info(
console.info( `%c${UIMetaNAME} ${UIMetaVersion}`,
`%chttps://github.com/a2nt/webpack-bootstrap-ui-kit by ${UIAUTHOR}`, 'color:yellow;font-size:12px',
'color:yellow;font-size:10px', );
); console.info(
} `%chttps://github.com/a2nt/webpack-bootstrap-ui-kit by ${UIAUTHOR}`,
'color:yellow;font-size:10px',
);
console.groupCollapsed('Events'); console.groupCollapsed('Events');
Object.keys(Events).forEach((k) => { Object.keys(Events).forEach((k) => {
@ -403,7 +405,7 @@ const MainUI = (($) => {
W.URLDetails.relative = location.split('#')[0]; W.URLDetails.relative = location.split('#')[0];
W.URLDetails.hash = W.URLDetails.hash =
hash >= 0 ? location.substr(location.indexOf('#')) : ''; hash >= 0 ? location.substr(location.indexOf('#')) : '';
} }
// show site-wide alert // show site-wide alert
@ -438,7 +440,10 @@ const MainUI = (($) => {
}); });
} }
if ($AlertNotify.length && typeof $AlertNotify[0].stop !== 'undefined') { if (
$AlertNotify.length &&
typeof $AlertNotify[0].stop !== 'undefined'
) {
$AlertNotify[0].stop(); $AlertNotify[0].stop();
} }
@ -575,7 +580,9 @@ const MainUI = (($) => {
// hide spinner on target _blank // hide spinner on target _blank
$('[target="_blank"],.external').on('click submit', (e) => { $('[target="_blank"],.external').on('click submit', (e) => {
if ( if (
$(e.currentTarget).is('[data-toggle="lightbox"],[data-lightbox-gallery]') $(e.currentTarget).is(
'[data-toggle="lightbox"],[data-lightbox-gallery]',
)
) { ) {
return false; return false;
} }

View File

@ -14,6 +14,9 @@ const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack'); const ImageminPlugin = require('imagemin-webpack');
const ImageSpritePlugin = require('@a2nt/image-sprite-webpack-plugin'); const ImageSpritePlugin = require('@a2nt/image-sprite-webpack-plugin');
const UIInfo = require('./package.json');
const UIMetaInfo = require('./node_modules/@a2nt/meta-lightbox/package.json');
const plugins = [ const plugins = [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {
@ -33,6 +36,13 @@ const plugins = [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/index.html', template: './src/index.html',
}), }),
new webpack.DefinePlugin({
UINAME: JSON.stringify(UIInfo.name),
UIVERSION: JSON.stringify(UIInfo.version),
UIAUTHOR: JSON.stringify(UIInfo.author),
UIMetaName: JSON.stringify(UIMetaInfo.name),
UIMetaVersion: JSON.stringify(UIMetaInfo.version),
}),
]; ];
if (COMPRESS) { if (COMPRESS) {