diff --git a/gulpfile.js b/gulpfile.js index 816594f0..3230914c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,7 +50,7 @@ var vendorStyles = [ 'sweetalert2/dist/sweetalert2.min.css', ]; -var replacements = [ +var styleReplacements = [ ['blue.png', '"../images/blue.png"'], ['blue@2x.png', '"../images/blue@2x.png"'], ['../img/loading.gif', '"../images/loading.gif"'], @@ -58,6 +58,10 @@ var replacements = [ ['@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);', ''], ]; +var scriptReplacements = [ + ['$.AdminLTE.layout.activate(),', ''] +]; + var fonts = [ 'font-awesome/fonts/**', 'bootstrap/dist/fonts/**', @@ -81,7 +85,8 @@ elixir((mix) => { .scripts(convertNpmRelativePath(vendorScripts), distPath + 'scripts/app.min.js', './') .styles(convertNpmRelativePath(vendorStyles), distPath + 'styles/app.min.css', './') - .replace(distPath + 'styles/app.min.css', replacements) + .replace(distPath + 'styles/app.min.css', styleReplacements) + .replace(distPath + 'scripts/app.min.js', scriptReplacements) // copy fonts & images .copy(convertNpmRelativePath(fonts), distPath + 'fonts/') diff --git a/resources/assets/src/scripts/general.js b/resources/assets/src/scripts/general.js index 8cb2dce1..526edd31 100644 --- a/resources/assets/src/scripts/general.js +++ b/resources/assets/src/scripts/general.js @@ -1,8 +1,8 @@ /* -* @Author: printempw -* @Date: 2016-09-15 10:39:41 - * @Last Modified by: g-plane - * @Last Modified time: 2017-04-27 15:33:24 + * @Author: printempw + * @Date: 2016-09-15 10:39:41 + * @Last Modified by: printempw + * @Last Modified time: 2017-06-30 13:33:20 */ 'use strict'; @@ -23,6 +23,44 @@ $.defaultPaginatorConfig = { wrapper: '' }; +// polyfill of String.prototype.includes +if (!String.prototype.includes) { + String.prototype.includes = function(search, start) { + 'use strict'; + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > this.length) { + return false; + } else { + return this.indexOf(search, start) !== -1; + } + }; +} + +// polyfill of String.prototype.endsWith +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.lastIndexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +$(window).ready(activateLayout).resize(activateLayout); + +function activateLayout() { + if (location.pathname == "/" || location.pathname.includes('auth')) + return; + + $.AdminLTE.layout.activate(); +} + /** * Check if given value is empty. * @@ -193,19 +231,6 @@ function debounce(func, delay, args = [], context = undefined) { } } -// polyfill of String.prototype.endsWith -if (!String.prototype.endsWith) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.lastIndexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - function url(relativeUri) { relativeUri = relativeUri || ""; blessing.base_url = blessing.base_url || ""; diff --git a/resources/assets/src/styles/general.scss b/resources/assets/src/styles/general.scss index 35ae4e34..2aab55eb 100644 --- a/resources/assets/src/styles/general.scss +++ b/resources/assets/src/styles/general.scss @@ -40,6 +40,10 @@ input:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px #fff inset !important; } +.login-page { + height: auto; +} + .item { display: block; background: #EFF1F0; diff --git a/resources/views/index.tpl b/resources/views/index.tpl index fe04f71e..70d0c94f 100644 --- a/resources/views/index.tpl +++ b/resources/views/index.tpl @@ -134,10 +134,7 @@ {!! bs_footer() !!}