Skip to content
Permalink
Browse files

Initial update to fix Bootstrap version and PHP 7.3 compatibility

  • Loading branch information
UnderDogg committed Dec 30, 2019
1 parent 61e0bd4 commit 5fbfebc269cfbd9db99092caf70bafbbb83448fc
Showing with 247 additions and 238 deletions.
  1. +174 −184 Gruntfile.js
  2. +19 −15 application/helpers/trans_helper.php
  3. +39 −25 application/third_party/MX/Router.php
  4. +15 −14 package.json
@@ -1,204 +1,194 @@
'use strict';
module.exports = function (grunt) {
"use strict";
module.exports = function(grunt) {
const sass = require("node-sass");

// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Load grunt tasks automatically
require("load-grunt-tasks")(grunt);

// MODULES
// MODULES

grunt.config('clean', {
basic: [
'assets/**/*.css', 'assets/**/*.css.map', '!assets/core/css/custom.css', '!assets/core/css/custom-pdf.css', // CSS
'assets/core/js/*.js', '!assets/core/js/scripts.js', '!assets/core/js/jquery-ui.js', // JS
'assets/core/fonts/*', '!assets/core/fonts/.gitignore' // Fonts
],
build: ['assets/default/js/dependencies.js', 'assets/default/js/legacy.js']
});
grunt.initConfig({
clean: {
basic: [
"assets/**/*.css",
"assets/**/*.css.map",
"!assets/core/css/custom.css",
"!assets/core/css/custom-pdf.css", // CSS
"assets/core/js/*.js",
"!assets/core/js/scripts.js",
"!assets/core/js/jquery-ui.js", // JS
"assets/core/fonts/*",
"!assets/core/fonts/.gitignore" // Fonts
],
build: ["assets/default/js/dependencies.js", "assets/default/js/legacy.js"]
},

grunt.config('sass', {
dev: {
options: {
outputStyle: 'extended',
sourceMap: true
},
files: grunt.file.expandMapping(['assets/**/sass/*.scss'], 'css', {
rename: function (dest, matched) {
return matched.replace(/\/sass\//, '/' + dest + '/').replace(/\.scss$/, '.css');
}
})
sass: {
dev: {
options: {
implementation: sass,
outputStyle: "extended",
sourceMap: true
},
build: {
options: {
outputStyle: 'compressed'
},
files: grunt.file.expandMapping(['assets/**/sass/*.scss'], 'css', {
rename: function (dest, matched) {
return matched.replace(/\/sass\//, '/' + dest + '/').replace(/\.scss$/, '.css');
}
})
}
});

grunt.config('postcss', {
dev: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: 'last 3 version'
})
]
},
src: [
'assets/**/css/*.css',
'!assets/core/css/custom.css',
'!assets/core/css/custom-pdf.css'
]
files: grunt.file.expandMapping(["assets/**/sass/*.scss"], "css", {
rename: function(dest, matched) {
return matched.replace(/\/sass\//, "/" + dest + "/").replace(/\.scss$/, ".css");
}
})
},
build: {
options: {
outputStyle: "compressed"
},
build: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: 'last 3 version'
})
]
},
src: [
'assets/**/css/*.css',
'!assets/core/css/custom.css',
'!assets/core/css/custom-pdf.css'
]
}
});
files: grunt.file.expandMapping(["assets/**/sass/*.scss"], "css", {
rename: function(dest, matched) {
return matched.replace(/\/sass\//, "/" + dest + "/").replace(/\.scss$/, ".css");
}
})
}
},

grunt.config('concat', {
legacy: {
src: [
'node_modules/html5shiv/dist/html5shiv.js'
],
dest: 'assets/core/js/legacy.js'
postcss: {
dev: {
options: {
map: true,
processors: [require("autoprefixer")]
},
dependencies: {
src: [
'node_modules/jquery/dist/jquery.js',
'node_modules/js-cookie/src/js.cookie.js',
'assets/core/js/jquery-ui.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap.js',
'node_modules/bootstrap-datepicker/js/bootstrap-datepicker.js',
'node_modules/select2/dist/js/select2.full.js',
'node_modules/dropzone/dist/dropzone.js',
'node_modules/clipboard/dist/clipboard.js'
],
dest: 'assets/core/js/dependencies.js'
src: ["assets/**/css/*.css", "!assets/core/css/custom.css", "!assets/core/css/custom-pdf.css"]
},
build: {
options: {
map: false,
processors: [require("autoprefixer")]
},
zxcvbn: {
src: [
'node_modules/zxcvbn/dist/zxcvbn.js'
],
dest: 'assets/core/js/zxcvbn.js'
}
});
src: ["assets/**/css/*.css", "!assets/core/css/custom.css", "!assets/core/css/custom-pdf.css"]
}
},

grunt.config('uglify', {
build: {
files: {
'assets/core/js/legacy.min.js': ['assets/core/js/legacy.js'],
'assets/core/js/dependencies.min.js': ['assets/core/js/dependencies.js'],
'assets/core/js/scripts.min.js': ['assets/core/js/scripts.js']
}
concat: {
legacy: {
src: ["node_modules/html5shiv/dist/html5shiv.js"],
dest: "assets/core/js/legacy.js"
},
dependencies: {
src: [
"node_modules/jquery/dist/jquery.js",
"node_modules/js-cookie/src/js.cookie.js",
"assets/core/js/jquery-ui.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap.js",
"node_modules/bootstrap-datepicker/js/bootstrap-datepicker.js",
"node_modules/select2/dist/js/select2.full.js",
"node_modules/dropzone/dist/dropzone.js",
"node_modules/clipboard/dist/clipboard.js"
],
dest: "assets/core/js/dependencies.js"
},
zxcvbn: {
src: ["node_modules/zxcvbn/dist/zxcvbn.js"],
dest: "assets/core/js/zxcvbn.js"
}
},

uglify: {
build: {
files: {
"assets/core/js/legacy.min.js": ["assets/core/js/legacy.js"],
"assets/core/js/dependencies.min.js": ["assets/core/js/dependencies.js"],
"assets/core/js/scripts.min.js": ["assets/core/js/scripts.js"]
}
});
}
},

grunt.config('copy', {
datepickerlocale: {
copy: {
datepickerlocale: {
expand: true,
flatten: true,
src: ["node_modules/bootstrap-datepicker/js/locales/**"],
dest: "assets/core/js/locales/",
filter: "isFile"
},
select2locale: {
expand: true,
flatten: true,
src: ["node_modules/select2/dist/js/i18n/**"],
dest: "assets/core/js/locales/select2/",
filter: "isFile"
},
fontawesome: {
expand: true,
flatten: true,
src: ["node_modules/font-awesome/fonts/*"],
dest: "assets/core/fonts"
},
devjs: {
files: [
{
cwd: "assets/core/js/",
src: ["*.js", "!jquery-ui.js"],
dest: "assets/core/js/",
expand: true,
flatten: true,
src: ['node_modules/bootstrap-datepicker/js/locales/**'],
dest: 'assets/core/js/locales/',
filter: 'isFile'
},
select2locale: {
expand: true,
flatten: true,
src: ['node_modules/select2/dist/js/i18n/**'],
dest: 'assets/core/js/locales/select2/',
filter: 'isFile'
},
fontawesome: {
expand: true,
flatten: true,
src: ['node_modules/font-awesome/fonts/*'],
dest: 'assets/core/fonts'
},
devjs: {
files: [{
cwd: 'assets/core/js/',
src: [
'*.js', '!jquery-ui.js'
],
dest: 'assets/core/js/',
expand: true,
rename: function(dest, src) {
return (dest + src).replace('.js', '.min.js');
}
}]
}
});
rename: function(dest, src) {
return (dest + src).replace(".js", ".min.js");
}
}
]
}
},

grunt.config('watch', {
sass: {
files: "assets/**/*.scss",
tasks: ['sass:dev', 'postcss:dev']
},
js: {
files: "assets/core/js/scripts.js",
tasks: ['uglify']
}
});
watch: {
sass: {
files: "assets/**/*.scss",
tasks: ["sass:dev", "postcss:dev"]
},
js: {
files: "assets/core/js/scripts.js",
tasks: ["uglify"]
}
}
});

// TASKS
// TASKS

grunt.registerTask('default', 'build');
grunt.registerTask("default", "build");

grunt.registerTask('dev-build', [
'clean:basic',
'sass:dev',
'postcss:dev',
'concat:legacy',
'concat:dependencies',
'concat:zxcvbn',
'copy:datepickerlocale',
'copy:select2locale',
'copy:fontawesome',
'copy:devjs'
]);
grunt.registerTask("dev-build", [
"clean:basic",
"sass:dev",
"postcss:dev",
"concat:legacy",
"concat:dependencies",
"concat:zxcvbn",
"copy:datepickerlocale",
"copy:select2locale",
"copy:fontawesome",
"copy:devjs"
]);

grunt.registerTask('dev', [
'clean:basic',
'sass:dev',
'postcss:dev',
'concat:legacy',
'concat:dependencies',
'concat:zxcvbn',
'copy:datepickerlocale',
'copy:select2locale',
'copy:fontawesome',
'copy:devjs',
'watch'
]);
grunt.registerTask("dev", [
"clean:basic",
"sass:dev",
"postcss:dev",
"concat:legacy",
"concat:dependencies",
"concat:zxcvbn",
"copy:datepickerlocale",
"copy:select2locale",
"copy:fontawesome",
"copy:devjs",
"watch"
]);

grunt.registerTask('build', [
'clean:basic',
'sass:build',
'postcss:build',
'concat:legacy',
'concat:dependencies',
'concat:zxcvbn',
'uglify:build',
'clean:build',
'copy:datepickerlocale',
'copy:select2locale',
'copy:fontawesome'
]);
grunt.registerTask("build", [
"clean:basic",
"sass:build",
"postcss:build",
"concat:legacy",
"concat:dependencies",
"concat:zxcvbn",
"uglify:build",
"clean:build",
"copy:datepickerlocale",
"copy:select2locale",
"copy:fontawesome"
]);
};

0 comments on commit 5fbfebc

Please sign in to comment.
You can’t perform that action at this time.