Introduce gulp build system

This commit is contained in:
christianesperar 2016-05-25 00:53:42 +08:00
parent b60a6c08fd
commit 475e8db2a6
50 changed files with 4842 additions and 82 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
nbproject
npm-debug.log
node_modules
.sass-cache

4426
build/css/custom.css Normal file

File diff suppressed because it is too large Load Diff

7
build/css/custom.min.css vendored Normal file

File diff suppressed because one or more lines are too long

0
production/js/custom.js → build/js/custom.js Executable file → Normal file
View File

1
build/js/custom.min.js vendored Normal file
View File

@ -0,0 +1 @@
function countChecked(){"all"===checkState&&$(".bulk_action input[name='table_records']").iCheck("check"),"none"===checkState&&$(".bulk_action input[name='table_records']").iCheck("uncheck");var e=$(".bulk_action input[name='table_records']:checked").length;e?($(".column-title").hide(),$(".bulk-actions").show(),$(".action-cnt").html(e+" Records Selected")):($(".column-title").show(),$(".bulk-actions").hide())}var CURRENT_URL=window.location.href.split("?")[0],$BODY=$("body"),$MENU_TOGGLE=$("#menu_toggle"),$SIDEBAR_MENU=$("#sidebar-menu"),$SIDEBAR_FOOTER=$(".sidebar-footer"),$LEFT_COL=$(".left_col"),$RIGHT_COL=$(".right_col"),$NAV_MENU=$(".nav_menu"),$FOOTER=$("footer");$(document).ready(function(){var e=function(){$RIGHT_COL.css("min-height",$(window).height());var e=$BODY.outerHeight(),t=$BODY.hasClass("footer_fixed")?0:$FOOTER.height(),n=$LEFT_COL.eq(1).height()+$SIDEBAR_FOOTER.height(),i=n>e?n:e;i-=$NAV_MENU.height()+t,$RIGHT_COL.css("min-height",i)};$SIDEBAR_MENU.find("a").on("click",function(t){var n=$(this).parent();n.is(".active")?(n.removeClass("active"),$("ul:first",n).slideUp(function(){e()})):(n.parent().is(".child_menu")||($SIDEBAR_MENU.find("li").removeClass("active"),$SIDEBAR_MENU.find("li ul").slideUp()),n.addClass("active"),$("ul:first",n).slideDown(function(){e()}))}),$MENU_TOGGLE.on("click",function(){$BODY.hasClass("nav-md")?($BODY.removeClass("nav-md").addClass("nav-sm"),$SIDEBAR_MENU.find("li").hasClass("active")&&$SIDEBAR_MENU.find("li.active").addClass("active-sm").removeClass("active")):($BODY.removeClass("nav-sm").addClass("nav-md"),$SIDEBAR_MENU.find("li").hasClass("active-sm")&&$SIDEBAR_MENU.find("li.active-sm").addClass("active").removeClass("active-sm")),e()}),$SIDEBAR_MENU.find('a[href="'+CURRENT_URL+'"]').parent("li").addClass("current-page"),$SIDEBAR_MENU.find("a").filter(function(){return this.href==CURRENT_URL}).parent("li").addClass("current-page").parents("ul").slideDown(function(){e()}).parent().addClass("active"),$(window).smartresize(function(){e()}),$.fn.mCustomScrollbar&&$(".menu_fixed").mCustomScrollbar({autoHideScrollbar:!0,theme:"minimal",mouseWheel:{preventDefault:!0}})}),$(document).ready(function(){$(".collapse-link").on("click",function(){var e=$(this).closest(".x_panel"),t=$(this).find("i"),n=e.find(".x_content");e.attr("style")?n.slideToggle(200,function(){e.removeAttr("style")}):(n.slideToggle(200),e.css("height","auto")),t.toggleClass("fa-chevron-up fa-chevron-down")}),$(".close-link").click(function(){var e=$(this).closest(".x_panel");e.remove()})}),$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({container:"body"})}),$(".progress .progress-bar")[0]&&$(".progress .progress-bar").progressbar(),$(document).ready(function(){if($(".js-switch")[0]){var e=Array.prototype.slice.call(document.querySelectorAll(".js-switch"));e.forEach(function(e){new Switchery(e,{color:"#26B99A"})})}}),$(document).ready(function(){$("input.flat")[0]&&$(document).ready(function(){$("input.flat").iCheck({checkboxClass:"icheckbox_flat-green",radioClass:"iradio_flat-green"})})}),$("table input").on("ifChecked",function(){checkState="",$(this).parent().parent().parent().addClass("selected"),countChecked()}),$("table input").on("ifUnchecked",function(){checkState="",$(this).parent().parent().parent().removeClass("selected"),countChecked()});var checkState="";$(".bulk_action input").on("ifChecked",function(){checkState="",$(this).parent().parent().parent().addClass("selected"),countChecked()}),$(".bulk_action input").on("ifUnchecked",function(){checkState="",$(this).parent().parent().parent().removeClass("selected"),countChecked()}),$(".bulk_action input#check-all").on("ifChecked",function(){checkState="all",countChecked()}),$(".bulk_action input#check-all").on("ifUnchecked",function(){checkState="none",countChecked()}),$(document).ready(function(){$(".expand").on("click",function(){$(this).next().slideToggle(200),$expand=$(this).find(">:first-child"),"+"==$expand.text()?$expand.text("-"):$expand.text("+")})}),"undefined"!=typeof NProgress&&($(document).ready(function(){NProgress.start()}),$(window).load(function(){NProgress.done()})),function(e,t){var n=function(e,t,n){var i;return function(){function c(){n||e.apply(a,o),i=null}var a=this,o=arguments;i?clearTimeout(i):n&&e.apply(a,o),i=setTimeout(c,t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",n(e)):this.trigger(t)}}(jQuery,"smartresize");

View File

@ -185,7 +185,7 @@
<!-- Theme styling -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="../assets/js/ie8-responsive-file-warning.js"></script>

35
gulpfile.js Normal file
View File

@ -0,0 +1,35 @@
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-ruby-sass');
var DEST = 'build/';
gulp.task('scripts', function() {
return gulp.src('src/js/*.js')
.pipe(concat('custom.js'))
.pipe(gulp.dest(DEST+'/js'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest(DEST+'/js'));
});
gulp.task('sass', function() {
return sass('src/scss/*.scss')
.pipe(concat('custom.css'))
.pipe(gulp.dest(DEST+'/css'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest(DEST+'/css'));
});
gulp.task('watch', function() {
// Watch .js files
gulp.watch('src/js/*.js', ['scripts']);
// Watch .scss files
gulp.watch('src/scss/*.scss', ['sass']);
});
// Default Task
gulp.task('default', ['watch']);

View File

@ -28,5 +28,12 @@
"bugs": {
"url": "https://github.com/puikinsh/gentelella/issues"
},
"homepage": "https://github.com/puikinsh/gentelella#readme"
"homepage": "https://github.com/puikinsh/gentelella#readme",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-rename": "^1.2.2",
"gulp-ruby-sass": "^2.0.6",
"gulp-uglify": "^1.5.3"
}
}

View File

@ -18,7 +18,7 @@
<link href="../vendors/fullcalendar/dist/fullcalendar.print.css" rel="stylesheet" media="print">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -420,7 +420,7 @@
<script src="../vendors/fullcalendar/dist/fullcalendar.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- FullCalendar -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -479,7 +479,7 @@
<script src="../vendors/Chart.js/dist/Chart.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Chart.js -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -477,7 +477,7 @@
<script src="../vendors/Chart.js/dist/Chart.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Chart.js -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -678,6 +678,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -468,6 +468,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -664,7 +664,7 @@
<script src="../vendors/echarts/map/js/world.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<script>
var theme = {

View File

@ -17,7 +17,7 @@
<link href="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css" rel="stylesheet"/>
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md footer_fixed">
@ -301,6 +301,6 @@
<script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css" rel="stylesheet"/>
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -300,6 +300,6 @@
<script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -25,7 +25,7 @@
<link href="../vendors/starrr/dist/starrr.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -1356,7 +1356,7 @@
<script src="../vendors/starrr/dist/starrr.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- bootstrap-daterangepicker -->
<script>

View File

@ -23,7 +23,7 @@
<link href="../vendors/cropper/dist/cropper.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -1907,7 +1907,7 @@
<script src="../vendors/cropper/dist/cropper.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- bootstrap-daterangepicker -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -742,6 +742,6 @@
<script src="../vendors/fastclick/lib/fastclick.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -18,7 +18,7 @@
<link href="../vendors/dropzone/dist/min/dropzone.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -348,6 +348,6 @@
<script src="../vendors/dropzone/dist/min/dropzone.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -421,7 +421,7 @@
<script src="../vendors/validator/validator.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- validator -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -595,7 +595,7 @@
<!-- jQuery Smart Wizard -->
<script src="../vendors/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- jQuery Smart Wizard -->
<script>

View File

@ -24,7 +24,7 @@
<link href="../vendors/pnotify/dist/pnotify.nonblock.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -1653,7 +1653,7 @@
<script src="../vendors/pnotify/dist/pnotify.nonblock.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- PNotify -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -1733,6 +1733,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -2341,6 +2341,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/google-code-prettify/bin/prettify.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -634,7 +634,7 @@
<script src="../vendors/google-code-prettify/src/prettify.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- bootstrap-wysiwyg -->
<script>

View File

@ -21,7 +21,7 @@
<link href="css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet"/>
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -1013,7 +1013,7 @@
<script src="js/datepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Flot -->
<script>

View File

@ -17,7 +17,7 @@
<link href="css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet"/>
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -763,7 +763,7 @@
<script src="js/datepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Flot -->
<script>

View File

@ -18,7 +18,7 @@
<link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -877,7 +877,7 @@
<script src="js/datepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Flot -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -488,6 +488,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -296,6 +296,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="https://colorlib.com/polygon/gentelella/css/animate.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="login">

View File

@ -19,7 +19,7 @@
<link href="css/animate.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
<link href="css/icheck/flat/green.css" rel="stylesheet">
@ -1403,7 +1403,7 @@
<!-- icheck -->
<script src="js/icheck/icheck.min.js"></script>
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- pace -->
<script src="js/pace/pace.min.js"></script>

View File

@ -16,7 +16,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -531,6 +531,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -491,7 +491,7 @@
<script src="../vendors/morris.js/morris.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- morris.js -->
<script>

View File

@ -19,7 +19,7 @@
<link href="css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet"/>
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -451,7 +451,7 @@
<script src="../vendors/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- jVectorMap -->
<script src="js/maps/gdp-data.js"></script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -59,6 +59,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -59,6 +59,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -59,6 +59,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -338,6 +338,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -479,6 +479,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -643,7 +643,7 @@
<script src="js/datepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<script>
$(function() {

View File

@ -17,7 +17,7 @@
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -476,7 +476,7 @@
<script src="../vendors/echarts/dist/echarts.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- ECharts -->
<script>

View File

@ -17,7 +17,7 @@
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -682,6 +682,6 @@
<script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -741,6 +741,6 @@
<script src="../vendors/iCheck/icheck.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -23,7 +23,7 @@
<link href="../vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -3020,7 +3020,7 @@
<script src="../vendors/pdfmake/build/vfs_fonts.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- Datatables -->
<script>

View File

@ -15,7 +15,7 @@
<link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Custom styling plus plugins -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -375,6 +375,6 @@
<script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>

View File

@ -17,7 +17,7 @@
<link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.css" rel="stylesheet">
<link href="../build/css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
@ -907,7 +907,7 @@
<script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.js"></script>
<script src="../build/js/custom.min.js"></script>
<!-- chart js -->
<!-- <script type="text/javascript" src="js/moment/moment.min.js"></script> -->
@ -917,7 +917,7 @@
<!-- icheck -->
<!-- <script src="js/icheck/icheck.min.js"></script> -->
<!-- <script src="js/custom.js"></script> -->
<!-- <script src="../build/js/custom.min.js"></script> -->
<!-- pace -->
<!-- <script src="js/pace/pace.min.js"></script> -->

282
src/js/custom.js Normal file
View File

@ -0,0 +1,282 @@
/**
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var CURRENT_URL = window.location.href.split('?')[0],
$BODY = $('body'),
$MENU_TOGGLE = $('#menu_toggle'),
$SIDEBAR_MENU = $('#sidebar-menu'),
$SIDEBAR_FOOTER = $('.sidebar-footer'),
$LEFT_COL = $('.left_col'),
$RIGHT_COL = $('.right_col'),
$NAV_MENU = $('.nav_menu'),
$FOOTER = $('footer');
// Sidebar
$(document).ready(function() {
// TODO: This is some kind of easy fix, maybe we can improve this
var setContentHeight = function () {
// reset height
$RIGHT_COL.css('min-height', $(window).height());
var bodyHeight = $BODY.outerHeight(),
footerHeight = $BODY.hasClass('footer_fixed') ? 0 : $FOOTER.height(),
leftColHeight = $LEFT_COL.eq(1).height() + $SIDEBAR_FOOTER.height(),
contentHeight = bodyHeight < leftColHeight ? leftColHeight : bodyHeight;
// normalize content
contentHeight -= $NAV_MENU.height() + footerHeight;
$RIGHT_COL.css('min-height', contentHeight);
};
$SIDEBAR_MENU.find('a').on('click', function(ev) {
var $li = $(this).parent();
if ($li.is('.active')) {
$li.removeClass('active');
$('ul:first', $li).slideUp(function() {
setContentHeight();
});
} else {
// prevent closing menu if we are on child menu
if (!$li.parent().is('.child_menu')) {
$SIDEBAR_MENU.find('li').removeClass('active');
$SIDEBAR_MENU.find('li ul').slideUp();
}
$li.addClass('active');
$('ul:first', $li).slideDown(function() {
setContentHeight();
});
}
});
// toggle small or large menu
$MENU_TOGGLE.on('click', function() {
if ($BODY.hasClass('nav-md')) {
$BODY.removeClass('nav-md').addClass('nav-sm');
if ($SIDEBAR_MENU.find('li').hasClass('active')) {
$SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active');
}
} else {
$BODY.removeClass('nav-sm').addClass('nav-md');
if ($SIDEBAR_MENU.find('li').hasClass('active-sm')) {
$SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm');
}
}
setContentHeight();
});
// check active menu
$SIDEBAR_MENU.find('a[href="' + CURRENT_URL + '"]').parent('li').addClass('current-page');
$SIDEBAR_MENU.find('a').filter(function () {
return this.href == CURRENT_URL;
}).parent('li').addClass('current-page').parents('ul').slideDown(function() {
setContentHeight();
}).parent().addClass('active');
// recompute content when resizing
$(window).smartresize(function(){
setContentHeight();
});
// fixed sidebar
if ($.fn.mCustomScrollbar) {
$('.menu_fixed').mCustomScrollbar({
autoHideScrollbar: true,
theme: 'minimal',
mouseWheel:{ preventDefault: true }
});
}
});
// /Sidebar
// Panel toolbox
$(document).ready(function() {
$('.collapse-link').on('click', function() {
var $BOX_PANEL = $(this).closest('.x_panel'),
$ICON = $(this).find('i'),
$BOX_CONTENT = $BOX_PANEL.find('.x_content');
// fix for some div with hardcoded fix class
if ($BOX_PANEL.attr('style')) {
$BOX_CONTENT.slideToggle(200, function(){
$BOX_PANEL.removeAttr('style');
});
} else {
$BOX_CONTENT.slideToggle(200);
$BOX_PANEL.css('height', 'auto');
}
$ICON.toggleClass('fa-chevron-up fa-chevron-down');
});
$('.close-link').click(function () {
var $BOX_PANEL = $(this).closest('.x_panel');
$BOX_PANEL.remove();
});
});
// /Panel toolbox
// Tooltip
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
});
// /Tooltip
// Progressbar
if ($(".progress .progress-bar")[0]) {
$('.progress .progress-bar').progressbar(); // bootstrap 3
}
// /Progressbar
// Switchery
$(document).ready(function() {
if ($(".js-switch")[0]) {
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function (html) {
var switchery = new Switchery(html, {
color: '#26B99A'
});
});
}
});
// /Switchery
// iCheck
$(document).ready(function() {
if ($("input.flat")[0]) {
$(document).ready(function () {
$('input.flat').iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});
});
}
});
// /iCheck
// Table
$('table input').on('ifChecked', function () {
checkState = '';
$(this).parent().parent().parent().addClass('selected');
countChecked();
});
$('table input').on('ifUnchecked', function () {
checkState = '';
$(this).parent().parent().parent().removeClass('selected');
countChecked();
});
var checkState = '';
$('.bulk_action input').on('ifChecked', function () {
checkState = '';
$(this).parent().parent().parent().addClass('selected');
countChecked();
});
$('.bulk_action input').on('ifUnchecked', function () {
checkState = '';
$(this).parent().parent().parent().removeClass('selected');
countChecked();
});
$('.bulk_action input#check-all').on('ifChecked', function () {
checkState = 'all';
countChecked();
});
$('.bulk_action input#check-all').on('ifUnchecked', function () {
checkState = 'none';
countChecked();
});
function countChecked() {
if (checkState === 'all') {
$(".bulk_action input[name='table_records']").iCheck('check');
}
if (checkState === 'none') {
$(".bulk_action input[name='table_records']").iCheck('uncheck');
}
var checkCount = $(".bulk_action input[name='table_records']:checked").length;
if (checkCount) {
$('.column-title').hide();
$('.bulk-actions').show();
$('.action-cnt').html(checkCount + ' Records Selected');
} else {
$('.column-title').show();
$('.bulk-actions').hide();
}
}
// Accordion
$(document).ready(function() {
$(".expand").on("click", function () {
$(this).next().slideToggle(200);
$expand = $(this).find(">:first-child");
if ($expand.text() == "+") {
$expand.text("-");
} else {
$expand.text("+");
}
});
});
// NProgress
if (typeof NProgress != 'undefined') {
$(document).ready(function () {
NProgress.start();
});
$(window).load(function () {
NProgress.done();
});
}
/**
* Resize function without multiple trigger
*
* Usage:
* $(window).smartresize(function(){
* // code here
* });
*/
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
if (!execAsap)
func.apply(obj, args);
timeout = null;
}
if (timeout)
clearTimeout(timeout);
else if (execAsap)
func.apply(obj, args);
timeout = setTimeout(delayed, threshold || 100);
};
};
// smartresize
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
})(jQuery,'smartresize');

0
production/css/custom.css → src/scss/custom.scss Executable file → Normal file
View File