diff --git a/Gruntfile.js b/Gruntfile.js index b7ed948df..9936fcac3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,14 +2,33 @@ module.exports = function (grunt) { - 'use strict'; + 'use strict' grunt.initConfig({ + + // Metadata. + pkg: grunt.file.readJSON('package.json'), + banner: '/*!\n' + + ' * AdminLTE v<%= pkg.version %> (<%= pkg.homepage %>)\n' + + ' * Copyright 2014-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + + ' * Project website Almsaeed Studio (https://almsaeedstudio.com)\n' + + ' * Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE)\n' + + ' */\n', + + // Watch files for changes and invoke appropriate compiler watch: { - // If any .less file changes in directory "build/less/" run the "less"-task. - // files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"], - files: ["build/scss/*.scss", "build/scss/skins/*.scss", "dist/js/app.js"], - tasks: ["sass", "uglify"] + sass: { + files: ['build/scss/*.scss', 'build/scss/skins/*.scss'], + tasks: ['sass'] + }, + es6: { + files: ['build/js/src/*.js'], + tasks: ['babel'] + }, + js: { + files: ['dist/js/AdminLTE.js', 'dist/js/app.js'], + tasks: ['uglify'] + } }, // SASS compiler @@ -27,25 +46,26 @@ module.exports = function (grunt) { style: 'compressed' }, files: { - 'dist/css/AdminLTE.min.css': 'build/scss/AdminLTE.scss' + 'dist/css/adminlte.min.css': 'build/scss/AdminLTE.scss' } } }, - // Uglify task info. Compress the js files. + // Compress the js files. uglify: { options: { mangle: true, preserveComments: 'some' }, - my_target: { + target: { files: { + 'dist/js/adminlte.min.js': ['dist/js/adminlte.js'], 'dist/js/app.min.js': ['dist/js/app.js'] } } }, - // Compile ECMA6 to ECMA5 + // Compile ES6 babel: { options: { sourceMap: true, @@ -53,11 +73,29 @@ module.exports = function (grunt) { }, dist: { files: { - 'dist/js/AdminLTE.js': 'build/js/AdminLTE.js' + 'build/js/dist/Treeview.js': 'build/js/src/Treeview.js', + 'build/js/dist/PushMenu.js': 'build/js/src/PushMenu.js', + 'build/js/dist/Widget.js': 'build/js/src/Widget.js' } } }, + // Concat compiled JS files + concat: { + options: { + stripBanners: true, + banner: '<%= banner %>' + }, + adminlte: { + src: [ + 'build/js/dist/Treeview.js', + 'build/js/dist/PushMenu.js', + 'build/js/dist/Widget.js' + ], + dest: 'dist/js/adminlte.js' + } + }, + // Build the documentation files includes: { build: { @@ -75,29 +113,38 @@ module.exports = function (grunt) { // Optimize images image: { dynamic: { - files: [{ - expand: true, - cwd: 'build/img/', - src: ['**/*.{png,jpg,gif,svg,jpeg}'], - dest: 'dist/img/' - }] + files: [ + { + expand: true, + cwd: 'build/img/', + src: ['**/*.{png,jpg,gif,svg,jpeg}'], + dest: 'dist/img/' + } + ] } }, - // Validate JS code - jshint: { + eslint: { options: { - jshintrc: '.jshintrc' + configFile: 'build/js/.eslintrc' + }, + target: 'build/js/src/*.js' + }, + + // Lint JS code + jscs: { + options: { + config: 'build/js/.jscsrc' + }, + grunt: { + src: ['Gruntfile.js'] }, core: { - src: 'dist/js/app.js' - }, - demo: { - src: 'dist/js/demo.js' - }, - pages: { - src: 'dist/js/pages/*.js' + src: 'js/src/*.js' } + /*app: { + src: 'dist/js/app.js' + }*/ }, // Validate CSS files @@ -106,7 +153,7 @@ module.exports = function (grunt) { csslintrc: 'build/scss/.csslintrc' }, dist: [ - 'dist/tmp/AdminLTE.css', + 'dist/css/AdminLTE.css' ] }, @@ -122,38 +169,42 @@ module.exports = function (grunt) { // After compressing the images in the build/img dir, there is no need // for them clean: { - build: ["build/img/*"] + build: ['build/img/*'] } - }); + }) // Load all grunt tasks - // LESS Compiler - grunt.loadNpmTasks('grunt-contrib-less'); // SASS compiler - grunt.loadNpmTasks('grunt-sass'); + grunt.loadNpmTasks('grunt-sass') // Watch File Changes - grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-watch') // Compress JS Files - grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-uglify') // Include Files Within HTML - grunt.loadNpmTasks('grunt-includes'); + grunt.loadNpmTasks('grunt-includes') // Optimize images - grunt.loadNpmTasks('grunt-image'); - // Validate JS code - grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-image') // Delete not needed files - grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-clean') + // Lint JS code + grunt.loadNpmTasks('grunt-jscs') + // Lint ECMA6 code + grunt.loadNpmTasks('grunt-eslint') // Lint CSS - grunt.loadNpmTasks('grunt-contrib-csslint'); + grunt.loadNpmTasks('grunt-contrib-csslint') // Lint Bootstrap - grunt.loadNpmTasks('grunt-bootlint'); + grunt.loadNpmTasks('grunt-bootlint') // Grunt Babel to compile ECMA6 to ECMA5 - grunt.loadNpmTasks('grunt-babel'); + grunt.loadNpmTasks('grunt-babel') + // Concat files + grunt.loadNpmTasks('grunt-contrib-concat') // Linting task - grunt.registerTask('lint', ['jshint', 'csslint', 'bootlint']); + grunt.registerTask('lint', ['jscs', 'eslint', 'csslint', 'bootlint']) + // JS Build Task + grunt.registerTask('build-js', ['babel', 'concat', 'uglify']) - // The default task (running "grunt" in console) is "watch" - grunt.registerTask('default', ['watch']); -}; + // The default task (running 'grunt' in console) is 'watch' + grunt.registerTask('default', ['watch']) +} diff --git a/build/js/.eslintrc b/build/js/.eslintrc new file mode 100644 index 000000000..cb4ae9b41 --- /dev/null +++ b/build/js/.eslintrc @@ -0,0 +1,178 @@ +{ + "root": true, + "parser": "babel-eslint", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + + // Possible Errors + "comma-dangle": [2, "never"], + "no-cond-assign": 2, + "no-console": 2, + "no-constant-condition": 2, + "no-control-regex": 2, + "no-debugger": 2, + "no-dupe-args": 2, + "no-dupe-keys": 2, + "no-duplicate-case": 2, + "no-empty": 2, + "no-empty-character-class": 2, + "no-ex-assign": 2, + "no-extra-boolean-cast": 2, + "no-extra-parens": 0, + "no-extra-semi": 2, + "no-func-assign": 2, + "no-inner-declarations": 2, + "no-invalid-regexp": 2, + "no-irregular-whitespace": 0, + "no-negated-in-lhs": 2, + "no-obj-calls": 2, + "no-regex-spaces": 2, + "no-sparse-arrays": 2, + "no-unexpected-multiline": 2, + "no-unreachable": 2, + "use-isnan": 2, + "valid-jsdoc": 0, + "valid-typeof": 2, + + //Best Practices + "accessor-pairs": 2, + "block-scoped-var": 2, + "consistent-return": 2, + "curly": 2, + "default-case": 2, + "dot-location": 0, + "dot-notation": 0, + "eqeqeq": 2, + "guard-for-in": 2, + "no-alert": 2, + "no-caller": 2, + "no-div-regex": 2, + "no-else-return": 2, + "no-empty-label": 2, + "no-eq-null": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-fallthrough": 2, + "no-floating-decimal": 2, + "no-implicit-coercion": 2, + "no-implied-eval": 2, + "no-invalid-this": 0, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-spaces": 0, + "no-multi-str": 0, + "no-native-reassign": 2, + "no-new": 2, + "no-new-func": 0, + "no-new-wrappers": 2, + "no-octal": 2, + "no-octal-escape": 2, + "no-param-reassign": 0, + "no-process-env": 2, + "no-proto": 2, + "no-redeclare": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-throw-literal": 2, + "no-unused-expressions": 2, + "no-useless-call": 2, + "no-void": 2, + "no-warning-comments": 0, + "no-with": 2, + "radix": 2, + "vars-on-top": 0, + "wrap-iife": 2, + "yoda": 2, + + // Variables + "init-declarations": 0, + "no-catch-shadow": 2, + "no-delete-var": 2, + "no-label-var": 2, + "no-shadow": 0, + "no-shadow-restricted-names": 2, + "no-undef": 2, + "no-undefined": 0, + "no-undef-init": 2, + "no-unused-vars": 2, + "no-use-before-define": 0, + + // Stylistic + "array-bracket-spacing": 2, + "block-spacing": 2, + "brace-style": 2, + "camelcase": 2, + "comma-spacing": 2, + "comma-style": 2, + "computed-property-spacing": 2, + "consistent-this": 2, + "eol-last": 2, + "func-names": 0, + "func-style": 0, + "indent": 0, + "key-spacing": 0, + "linebreak-style": 2, + "lines-around-comment": 0, + "new-cap": 0, + "newline-after-var": 0, + "new-parens": 2, + "no-array-constructor": 2, + "no-continue": 0, + "no-inline-comments": 0, + "no-lonely-if": 2, + "no-mixed-spaces-and-tabs": 2, + "no-multiple-empty-lines": 2, + "no-nested-ternary": 0, + "no-new-object": 2, + "no-spaced-func": 2, + "no-ternary": 0, + "no-trailing-spaces": 2, + "no-underscore-dangle": 0, + "no-unneeded-ternary": 2, + "object-curly-spacing": [1, "always"], + "one-var": 0, + "operator-assignment": 2, + "operator-linebreak": 0, + "padded-blocks": 0, + "quote-props": 0, + "quotes": 0, + "semi": [2, "never"], + "semi-spacing": 0, + "sort-vars": 2, + "space-after-keywords": 2, + "space-before-blocks": 2, + "space-before-function-paren": 0, + "spaced-comment": 2, + "space-infix-ops": 2, + "space-in-parens": 2, + "space-return-throw-case": 2, + "space-unary-ops": 2, + + // es6 + "arrow-parens": 2, + "arrow-spacing": 2, + "constructor-super": 2, + "generator-star-spacing": 2, + "no-class-assign": 2, + "no-const-assign": 2, + "no-dupe-class-members": 2, + "no-this-before-super": 2, + "no-var": 2, + "object-shorthand": 2, + "prefer-arrow-callback": 2, + "prefer-const": 0, + "prefer-reflect": 0, + "prefer-spread": 2, + "prefer-template": 2, + "require-yield": 2 + + } +} \ No newline at end of file diff --git a/build/js/.jscsrc b/build/js/.jscsrc new file mode 100644 index 000000000..a2ec95bb7 --- /dev/null +++ b/build/js/.jscsrc @@ -0,0 +1,44 @@ +{ + "esnext": true, + "verbose": true, + "disallowEmptyBlocks": true, + "disallowKeywords": ["with"], + "disallowMixedSpacesAndTabs": true, + "disallowMultipleLineStrings": true, + "disallowMultipleVarDecl": true, + "disallowQuotedKeysInObjects": "allButReserved", + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforeBinaryOperators": [","], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideArrayBrackets": true, + "disallowSpacesInsideParentheses": true, + "disallowTrailingComma": true, + "disallowTrailingWhitespace": true, + "requireCamelCaseOrUpperCaseIdentifiers": true, + "requireCapitalizedConstructors": true, + "requireCommaBeforeLineBreak": true, + "requireDollarBeforejQueryAssignment": true, + "requireDotNotation": true, + "requireLineFeedAtFileEnd": true, + "requirePaddingNewLinesAfterUseStrict": true, + "requirePaddingNewLinesBeforeExport": true, + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], + "requireSpaceAfterLineComment": true, + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], + "requireSpaceBetweenArguments": true, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true, "allExcept": ["shorthand"] }, + "requireSpacesInConditionalExpression": true, + "requireSpacesInForStatement": true, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInsideObjectBrackets": "allButNested", + "validateAlignedFunctionParameters": true, + "validateIndentation": 2, + "validateLineBreaks": "LF", + "validateNewlineAfterArrayElements": true, + "validateQuoteMarks": "'" +} diff --git a/build/js/AdminLTE.js b/build/js/AdminLTE.js deleted file mode 100644 index 53df944df..000000000 --- a/build/js/AdminLTE.js +++ /dev/null @@ -1,8 +0,0 @@ -(function ($) { - "use strict"; - class treeview { - _do() { - alert("Good"); - } - } -})(jQuery); \ No newline at end of file diff --git a/build/js/dist/PushMenu.js b/build/js/dist/PushMenu.js new file mode 100644 index 000000000..4fe5a1939 --- /dev/null +++ b/build/js/dist/PushMenu.js @@ -0,0 +1,143 @@ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE PushMenu.js + * License MIT + * -------------------------------------------- + */ + +var PushMenu = (function ($) { + 'use strict'; + + /** + * Constants + * ==================================================== + */ + + var NAME = 'PushMenu'; + var DATA_KEY = 'lte.pushmenu'; + var EVENT_KEY = '.' + DATA_KEY; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Event = { + COLLAPSED: 'collapsed' + EVENT_KEY, + SHOWN: 'shown' + DATA_KEY + }; + + var Selector = { + COLLAPSED: 'sidebar-collapse', + TOGGLE_BUTTON: '[data-widget="pushmenu"]' + }; + + /** + * Class Definition + * ==================================================== + */ + + var PushMenu = (function () { + function PushMenu() { + _classCallCheck(this, PushMenu); + } + + _createClass(PushMenu, [{ + key: 'Constructor', + value: function Constructor(element) { + this._element = element; + this._isShown; + } + + // Public + + }, { + key: 'show', + value: function show() { + $('body').removeClass(Selector.COLLAPSED); + this._isShown = true; + + var shownEvent = $.Event(Event.SHOWN); + $(this._element).trigger(shownEvent); + } + }, { + key: 'collapse', + value: function collapse() { + $('body').addClass(Selector.COLLAPSED); + this._isShown = false; + + var collapsedEvent = $.Event(Event.COLLAPSED); + $(this._element).trigger(collapsedEvent); + } + }, { + key: 'toggle', + value: function toggle() { + + if (typeof this._isShown === 'undefined') { + this._isShown = !$('body').hasClass(Selector.COLLAPSED); + } + + if (this._isShown) { + this.collapse(); + } else { + this.show(); + } + } + + // Static + + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(operation) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + data = new PushMenu(this); + $(this).data(DATA_KEY, data); + } + + if (operation) { + data[operation](); + } + }); + } + }]); + + return PushMenu; + })(); + + /** + * Data API + * ==================================================== + */ + + $(document).on('click', Selector.TOGGLE_BUTTON, function (event) { + event.preventDefault(); + + var button = event.target; + + if ($(button).data('widget') !== 'pushmenu') { + button = $(button).closest(Selector.TOGGLE_BUTTON); + } + + PushMenu._jQueryInterface.call($(button), 'toggle'); + }); + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = PushMenu._jQueryInterface; + $.fn[NAME].Constructor = PushMenu; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return PushMenu._jQueryInterface; + }; + + return PushMenu; +})(jQuery); +//# sourceMappingURL=PushMenu.js.map diff --git a/build/js/dist/PushMenu.js.map b/build/js/dist/PushMenu.js.map new file mode 100644 index 000000000..f3d59ba22 --- /dev/null +++ b/build/js/dist/PushMenu.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/PushMenu.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;AACvB,cAAY;;;;;;;AAAA,AAOZ,MAAM,IAAI,GAAiB,UAAU,CAAA;AACrC,MAAM,QAAQ,GAAa,cAAc,CAAA;AACzC,MAAM,SAAS,SAAgB,QAAQ,AAAE,CAAA;AACzC,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,KAAK,GAAG;AACZ,aAAS,gBAAc,SAAS,AAAE;AAClC,SAAK,YAAU,QAAQ,AAAE;GAC1B,CAAA;;AAED,MAAM,QAAQ,GAAG;AACf,aAAS,EAAE,kBAAkB;AAC7B,iBAAa,EAAE,0BAA0B;GAC1C;;;;;;;AAAA,MAOK,QAAQ;aAAR,QAAQ;4BAAR,QAAQ;;;iBAAR,QAAQ;;kCAEA,OAAO,EAAE;AACnB,YAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;AACvB,YAAI,CAAC,QAAQ,CAAA;OACd;;;;;;6BAIM;AACL,SAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;AACzC,YAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;;AAEpB,YAAI,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACrC,SAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;OACrC;;;iCAEU;AACT,SAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;AACtC,YAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;;AAErB,YAAI,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAC7C,SAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;OACzC;;;+BAEQ;;AAEP,YAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,WAAW,EAAE;AACxC,cAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;SACxD;;AAED,YAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,cAAI,CAAC,QAAQ,EAAE,CAAA;SAChB,MAAM;AACL,cAAI,CAAC,IAAI,EAAE,CAAA;SACZ;OACF;;;;;;uCAIuB,SAAS,EAAE;AACjC,eAAO,IAAI,CAAC,IAAI,CAAC,YAAY;AAC3B,cAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;;AAEjC,cAAI,CAAC,IAAI,EAAE;AACT,gBAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;AACzB,aAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC7B;;AAED,cAAI,SAAS,EAAE;AACb,gBAAI,CAAC,SAAS,CAAC,EAAE,CAAA;WAClB;SACF,CAAC,CAAA;OACH;;;WArDG,QAAQ;;;;;;;;AA6Dd,GAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,UAAC,KAAK,EAAK;AACzD,SAAK,CAAC,cAAc,EAAE,CAAA;;AAEtB,QAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;;AAEzB,QAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,UAAU,EAAE;AAC3C,YAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;KACnD;;AAED,YAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;GACpD,CAAC;;;;;;;AAAA,AAOF,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAA;AACtC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,QAAQ,CAAC,gBAAgB,CAAA;GACjC,CAAA;;AAED,SAAO,QAAQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"PushMenu.js","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE PushMenu.js\n * License MIT\n * --------------------------------------------\n */\n\nconst PushMenu = (($) => {\n 'use strict'\n\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'PushMenu'\n const DATA_KEY = 'lte.pushmenu'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n COLLAPSED: `collapsed${EVENT_KEY}`,\n SHOWN: `shown${DATA_KEY}`\n }\n\n const Selector = {\n COLLAPSED: 'sidebar-collapse',\n TOGGLE_BUTTON: '[data-widget=\"pushmenu\"]'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class PushMenu {\n\n Constructor(element) {\n this._element = element\n this._isShown\n }\n\n // Public\n\n show() {\n $('body').removeClass(Selector.COLLAPSED)\n this._isShown = true\n\n let shownEvent = $.Event(Event.SHOWN)\n $(this._element).trigger(shownEvent)\n }\n\n collapse() {\n $('body').addClass(Selector.COLLAPSED)\n this._isShown = false\n\n let collapsedEvent = $.Event(Event.COLLAPSED)\n $(this._element).trigger(collapsedEvent)\n }\n\n toggle() {\n\n if (typeof this._isShown === 'undefined') {\n this._isShown = !$('body').hasClass(Selector.COLLAPSED)\n }\n\n if (this._isShown) {\n this.collapse()\n } else {\n this.show()\n }\n }\n\n // Static\n\n static _jQueryInterface(operation) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new PushMenu(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (operation) {\n data[operation]()\n }\n })\n }\n }\n\n /**\n * Data API\n * ====================================================\n */\n\n $(document).on('click', Selector.TOGGLE_BUTTON, (event) => {\n event.preventDefault()\n\n let button = event.target\n\n if ($(button).data('widget') !== 'pushmenu') {\n button = $(button).closest(Selector.TOGGLE_BUTTON)\n }\n\n PushMenu._jQueryInterface.call($(button), 'toggle')\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = PushMenu._jQueryInterface\n $.fn[NAME].Constructor = PushMenu\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return PushMenu._jQueryInterface\n }\n\n return PushMenu\n\n})(jQuery)\n"]} \ No newline at end of file diff --git a/build/js/dist/Treeview.js b/build/js/dist/Treeview.js new file mode 100644 index 000000000..ee1759f41 --- /dev/null +++ b/build/js/dist/Treeview.js @@ -0,0 +1,81 @@ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE Treeview.js + * License MIT + * -------------------------------------------- + */ + +var Treeview = (function ($) { + + /** + * Constants + * ==================================================== + */ + + var NAME = 'Treeview'; + var DATA_KEY = 'lte.treeview'; + var EVENT_KEY = '.' + DATA_KEY; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var EVENT = { + SELECTED: 'selected' + EVENT_KEY + }; + + var Selector = { + LI: '.nav-item', + LINK: '.nav-link', + DATA_WIDGET: '[data-widget="treeview"]' + }; + + /** + * Class Definition + * ==================================================== + */ + + var Treeview = (function () { + function Treeview(element, config) { + _classCallCheck(this, Treeview); + + this._config = config; + this._element = element; + } + + // Public + + // Private + + // Static + + _createClass(Treeview, null, [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + this._config = config; + }); + } + }]); + + return Treeview; + })(); + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = Treeview._jQueryInterface; + $.fn[NAME].Constructor = Treeview; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Treeview._jQueryInterface; + }; + + return Treeview; +})(jQuery); +//# sourceMappingURL=Treeview.js.map diff --git a/build/js/dist/Treeview.js.map b/build/js/dist/Treeview.js.map new file mode 100644 index 000000000..36adb01af --- /dev/null +++ b/build/js/dist/Treeview.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/Treeview.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOvB,MAAM,IAAI,GAAiB,UAAU,CAAA;AACrC,MAAM,QAAQ,GAAa,cAAc,CAAA;AACzC,MAAM,SAAS,SAAgB,QAAQ,AAAE,CAAA;AACzC,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,KAAK,GAAG;AACZ,YAAQ,eAAa,SAAS,AAAE;GACjC,CAAA;;AAED,MAAM,QAAQ,GAAG;AACf,MAAE,EAAE,WAAW;AACf,QAAI,EAAE,WAAW;AACjB,eAAW,EAAE,0BAA0B;GACxC;;;;;;AAAA;MAMK,QAAQ;AAEZ,aAFI,QAAQ,CAEA,OAAO,EAAE,MAAM,EAAE;4BAFzB,QAAQ;;AAGV,UAAI,CAAC,OAAO,GAAI,MAAM,CAAA;AACtB,UAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;KACxB;;;;;;;AAAA;iBALG,QAAQ;;uCAYY,MAAM,EAAE;AAC9B,eAAO,IAAI,CAAC,IAAI,CAAC,YAAY;AAC3B,cAAI,CAAC,OAAO,GAAG,MAAM,CAAA;SAEtB,CAAC,CAAA;OACH;;;WAjBG,QAAQ;;;;;;;;AA0Bd,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,QAAQ,CAAC,gBAAgB,CAAA;AAClD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,QAAQ,CAAC,gBAAgB,CAAA;GACjC,CAAA;;AAED,SAAO,QAAQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"Treeview.js","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE Treeview.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Treeview = (($) => {\n\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Treeview'\n const DATA_KEY = 'lte.treeview'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const EVENT = {\n SELECTED: `selected${EVENT_KEY}`\n }\n\n const Selector = {\n LI: '.nav-item',\n LINK: '.nav-link',\n DATA_WIDGET: '[data-widget=\"treeview\"]'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n class Treeview {\n\n constructor(element, config) {\n this._config = config\n this._element = element\n }\n\n // Public\n\n // Private\n\n // Static\n static _jQueryInterface(config) {\n return this.each(function () {\n this._config = config\n\n })\n }\n\n }\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Treeview._jQueryInterface\n $.fn[NAME].Constructor = Treeview\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Treeview._jQueryInterface\n }\n\n return Treeview\n\n})(jQuery)\n"]} \ No newline at end of file diff --git a/build/js/dist/Widget.js b/build/js/dist/Widget.js new file mode 100644 index 000000000..de29625fc --- /dev/null +++ b/build/js/dist/Widget.js @@ -0,0 +1,40 @@ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE Widget.js + * License MIT + * -------------------------------------------- + */ + +var Widget = (function ($) { + 'use strict'; + + var Widget = (function () { + function Widget() { + _classCallCheck(this, Widget); + } + + _createClass(Widget, [{ + key: 'Constructor', + value: function Constructor(element) { + this._element = element; + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(element) { + var $this = $(element); + $this.show(); + } + }]); + + return Widget; + })(); + + return Widget; +})(jQuery); +//# sourceMappingURL=Widget.js.map diff --git a/build/js/dist/Widget.js.map b/build/js/dist/Widget.js.map new file mode 100644 index 000000000..bfc3e36c7 --- /dev/null +++ b/build/js/dist/Widget.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/Widget.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,MAAM,GAAG,CAAC,UAAC,CAAC,EAAK;AACrB,cAAY,CAAA;;MAEN,MAAM;aAAN,MAAM;4BAAN,MAAM;;;iBAAN,MAAM;;kCAEE,OAAO,EAAE;AACnB,YAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;OACxB;;;uCAEuB,OAAO,EAAE;AAC/B,YAAI,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;AACtB,aAAK,CAAC,IAAI,EAAE,CAAA;OACb;;;WATG,MAAM;;;AAYZ,SAAO,MAAM,CAAA;CAEd,CAAA,CAAE,MAAM,CAAC,CAAA","file":"Widget.js","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE Widget.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Widget = (($) => {\n 'use strict'\n\n class Widget {\n\n Constructor(element) {\n this._element = element\n }\n\n static _jQueryInterface(element) {\n let $this = $(element)\n $this.show()\n }\n }\n\n return Widget\n\n})(jQuery)\n"]} \ No newline at end of file diff --git a/build/js/src/PushMenu.js b/build/js/src/PushMenu.js new file mode 100644 index 000000000..75501ae65 --- /dev/null +++ b/build/js/src/PushMenu.js @@ -0,0 +1,123 @@ +/** + * -------------------------------------------- + * AdminLTE PushMenu.js + * License MIT + * -------------------------------------------- + */ + +const PushMenu = (($) => { + 'use strict' + + /** + * Constants + * ==================================================== + */ + + const NAME = 'PushMenu' + const DATA_KEY = 'lte.pushmenu' + const EVENT_KEY = `.${DATA_KEY}` + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const Event = { + COLLAPSED: `collapsed${EVENT_KEY}`, + SHOWN: `shown${DATA_KEY}` + } + + const Selector = { + COLLAPSED: 'sidebar-collapse', + TOGGLE_BUTTON: '[data-widget="pushmenu"]' + } + + /** + * Class Definition + * ==================================================== + */ + + class PushMenu { + + Constructor(element) { + this._element = element + this._isShown + } + + // Public + + show() { + $('body').removeClass(Selector.COLLAPSED) + this._isShown = true + + let shownEvent = $.Event(Event.SHOWN) + $(this._element).trigger(shownEvent) + } + + collapse() { + $('body').addClass(Selector.COLLAPSED) + this._isShown = false + + let collapsedEvent = $.Event(Event.COLLAPSED) + $(this._element).trigger(collapsedEvent) + } + + toggle() { + + if (typeof this._isShown === 'undefined') { + this._isShown = !$('body').hasClass(Selector.COLLAPSED) + } + + if (this._isShown) { + this.collapse() + } else { + this.show() + } + } + + // Static + + static _jQueryInterface(operation) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + + if (!data) { + data = new PushMenu(this) + $(this).data(DATA_KEY, data) + } + + if (operation) { + data[operation]() + } + }) + } + } + + /** + * Data API + * ==================================================== + */ + + $(document).on('click', Selector.TOGGLE_BUTTON, (event) => { + event.preventDefault() + + let button = event.target + + if ($(button).data('widget') !== 'pushmenu') { + button = $(button).closest(Selector.TOGGLE_BUTTON) + } + + PushMenu._jQueryInterface.call($(button), 'toggle') + }) + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = PushMenu._jQueryInterface + $.fn[NAME].Constructor = PushMenu + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return PushMenu._jQueryInterface + } + + return PushMenu + +})(jQuery) diff --git a/build/js/src/Widget.js b/build/js/src/Widget.js new file mode 100644 index 000000000..f4a8415b7 --- /dev/null +++ b/build/js/src/Widget.js @@ -0,0 +1,25 @@ +/** + * -------------------------------------------- + * AdminLTE Widget.js + * License MIT + * -------------------------------------------- + */ + +const Widget = (($) => { + 'use strict' + + class Widget { + + Constructor(element) { + this._element = element + } + + static _jQueryInterface(element) { + let $this = $(element) + $this.show() + } + } + + return Widget + +})(jQuery) diff --git a/build/js/src/treeview.js b/build/js/src/treeview.js new file mode 100644 index 000000000..15de9f88c --- /dev/null +++ b/build/js/src/treeview.js @@ -0,0 +1,69 @@ +/** + * -------------------------------------------- + * AdminLTE Treeview.js + * License MIT + * -------------------------------------------- + */ + +const Treeview = (($) => { + + /** + * Constants + * ==================================================== + */ + + const NAME = 'Treeview' + const DATA_KEY = 'lte.treeview' + const EVENT_KEY = `.${DATA_KEY}` + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const EVENT = { + SELECTED: `selected${EVENT_KEY}` + } + + const Selector = { + LI: '.nav-item', + LINK: '.nav-link', + DATA_WIDGET: '[data-widget="treeview"]' + } + + /** + * Class Definition + * ==================================================== + */ + class Treeview { + + constructor(element, config) { + this._config = config + this._element = element + } + + // Public + + // Private + + // Static + static _jQueryInterface(config) { + return this.each(function () { + this._config = config + + }) + } + + } + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = Treeview._jQueryInterface + $.fn[NAME].Constructor = Treeview + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Treeview._jQueryInterface + } + + return Treeview + +})(jQuery) diff --git a/build/js/treeview.js b/build/js/treeview.js deleted file mode 100644 index b7eae6c78..000000000 --- a/build/js/treeview.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Treeview.js - * Version 1.0 - * Author Abdullah Almsaeed - * Website Almsaeed Studio - */ - -(function($){ - "use strict"; - -})(jQuery); \ No newline at end of file diff --git a/build/scss/_control-sidebar.scss b/build/scss/_control-sidebar.scss index e75943469..376bfac9f 100644 --- a/build/scss/_control-sidebar.scss +++ b/build/scss/_control-sidebar.scss @@ -5,7 +5,7 @@ //This is a hack to make the background visible while scrolling .control-sidebar-bg { position: fixed; - z-index: 1000; + z-index: 820; bottom: 0; } @@ -13,6 +13,7 @@ .control-sidebar-bg, .control-sidebar { top: 0; + bottom: 0; right: -$control-sidebar-width; width: $control-sidebar-width; transition: right $transition-speed ease-in-out @@ -21,12 +22,10 @@ //The sidebar .control-sidebar { position: absolute; - //padding-top: $navbar-height; - z-index: 1010; - //Fix position after header collapse - @media (max-width: map-get($grid-breakpoints, sm)) { - //padding-top: $navbar-height + 50; - } + padding-top: 55px; //$navbar-height; + z-index: 830; + height: 100%; + overflow: auto; //Tab panes > .tab-content { padding: 10px 15px; @@ -57,15 +56,19 @@ //Control sidebar tabs .nav-tabs.control-sidebar-tabs { - > li { - &:first-of-type > a { + //display: table; + //width: 100%; + > .nav-item { + //display: table-cell; + //width: auto; + &:first-of-type > .nav-link { &, &:hover, &:focus { border-left-width: 0; } } - > a { + > .nav-link { @include border-radius(0); //Hover and active states @@ -82,7 +85,7 @@ } //Active state &.active { - > a { + > .nav-link { &, &:hover, &:focus, @@ -95,7 +98,7 @@ } } //Remove responsiveness on small screens - @media (max-width: map-get($grid-breakpoints, sm)) { + @media (max-width: map-get($grid-breakpoints, md)) { display: table; > li { display: table-cell; diff --git a/dist/css/AdminLTE.css b/dist/css/AdminLTE.css index a6d8b4280..cbcd120e8 100644 --- a/dist/css/AdminLTE.css +++ b/dist/css/AdminLTE.css @@ -4841,19 +4841,23 @@ a:focus { */ .control-sidebar-bg { position: fixed; - z-index: 1000; + z-index: 820; bottom: 0; } .control-sidebar-bg, .control-sidebar { top: 0; + bottom: 0; right: -230px; width: 230px; transition: right 0.3s ease-in-out; } .control-sidebar { position: absolute; - z-index: 1010; } + padding-top: 55px; + z-index: 830; + height: 100%; + overflow: auto; } .control-sidebar > .tab-content { padding: 10px 15px; } .control-sidebar.control-sidebar-open, @@ -4870,25 +4874,25 @@ a:focus { .control-sidebar-open .main-footer { margin-right: 230px; } } -.nav-tabs.control-sidebar-tabs > li:first-of-type > a, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:hover, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:focus { +.nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link:hover, .nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link:focus { border-left-width: 0; } -.nav-tabs.control-sidebar-tabs > li > a { +.nav-tabs.control-sidebar-tabs > .nav-item > .nav-link { border-radius: 0; } - .nav-tabs.control-sidebar-tabs > li > a, .nav-tabs.control-sidebar-tabs > li > a:hover { + .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link:hover { border-top: none; border-right: none; border-left: 1px solid transparent; border-bottom: 1px solid transparent; } - .nav-tabs.control-sidebar-tabs > li > a .icon { + .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link .icon { font-size: 16px; } -.nav-tabs.control-sidebar-tabs > li.active > a, .nav-tabs.control-sidebar-tabs > li.active > a:hover, .nav-tabs.control-sidebar-tabs > li.active > a:focus, .nav-tabs.control-sidebar-tabs > li.active > a:active { +.nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:hover, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:focus, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:active { border-top: none; border-right: none; border-bottom: none; } -@media (max-width: 34em) { +@media (max-width: 48em) { .nav-tabs.control-sidebar-tabs { display: table; } .nav-tabs.control-sidebar-tabs > li { diff --git a/dist/css/AdminLTE.min.css b/dist/css/AdminLTE.min.css index a6d8b4280..cbcd120e8 100644 --- a/dist/css/AdminLTE.min.css +++ b/dist/css/AdminLTE.min.css @@ -4841,19 +4841,23 @@ a:focus { */ .control-sidebar-bg { position: fixed; - z-index: 1000; + z-index: 820; bottom: 0; } .control-sidebar-bg, .control-sidebar { top: 0; + bottom: 0; right: -230px; width: 230px; transition: right 0.3s ease-in-out; } .control-sidebar { position: absolute; - z-index: 1010; } + padding-top: 55px; + z-index: 830; + height: 100%; + overflow: auto; } .control-sidebar > .tab-content { padding: 10px 15px; } .control-sidebar.control-sidebar-open, @@ -4870,25 +4874,25 @@ a:focus { .control-sidebar-open .main-footer { margin-right: 230px; } } -.nav-tabs.control-sidebar-tabs > li:first-of-type > a, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:hover, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:focus { +.nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link:hover, .nav-tabs.control-sidebar-tabs > .nav-item:first-of-type > .nav-link:focus { border-left-width: 0; } -.nav-tabs.control-sidebar-tabs > li > a { +.nav-tabs.control-sidebar-tabs > .nav-item > .nav-link { border-radius: 0; } - .nav-tabs.control-sidebar-tabs > li > a, .nav-tabs.control-sidebar-tabs > li > a:hover { + .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link:hover { border-top: none; border-right: none; border-left: 1px solid transparent; border-bottom: 1px solid transparent; } - .nav-tabs.control-sidebar-tabs > li > a .icon { + .nav-tabs.control-sidebar-tabs > .nav-item > .nav-link .icon { font-size: 16px; } -.nav-tabs.control-sidebar-tabs > li.active > a, .nav-tabs.control-sidebar-tabs > li.active > a:hover, .nav-tabs.control-sidebar-tabs > li.active > a:focus, .nav-tabs.control-sidebar-tabs > li.active > a:active { +.nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:hover, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:focus, .nav-tabs.control-sidebar-tabs > .nav-item.active > .nav-link:active { border-top: none; border-right: none; border-bottom: none; } -@media (max-width: 34em) { +@media (max-width: 48em) { .nav-tabs.control-sidebar-tabs { display: table; } .nav-tabs.control-sidebar-tabs > li { diff --git a/dist/js/adminlte.js b/dist/js/adminlte.js new file mode 100644 index 000000000..8a5227970 --- /dev/null +++ b/dist/js/adminlte.js @@ -0,0 +1,272 @@ +/*! + * AdminLTE v3.0.0-alpha (https://almsaeedstudio.com) + * Copyright 2014-2015 Abdullah Almsaeed + * Project website Almsaeed Studio (https://almsaeedstudio.com) + * Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE) + */ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE Treeview.js + * License MIT + * -------------------------------------------- + */ + +var Treeview = (function ($) { + + /** + * Constants + * ==================================================== + */ + + var NAME = 'Treeview'; + var DATA_KEY = 'lte.treeview'; + var EVENT_KEY = '.' + DATA_KEY; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var EVENT = { + SELECTED: 'selected' + EVENT_KEY + }; + + var Selector = { + LI: '.nav-item', + LINK: '.nav-link', + DATA_WIDGET: '[data-widget="treeview"]' + }; + + /** + * Class Definition + * ==================================================== + */ + + var Treeview = (function () { + function Treeview(element, config) { + _classCallCheck(this, Treeview); + + this._config = config; + this._element = element; + } + + // Public + + // Private + + // Static + + _createClass(Treeview, null, [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + this._config = config; + }); + } + }]); + + return Treeview; + })(); + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = Treeview._jQueryInterface; + $.fn[NAME].Constructor = Treeview; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Treeview._jQueryInterface; + }; + + return Treeview; +})(jQuery); +//# sourceMappingURL=Treeview.js.map + +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE PushMenu.js + * License MIT + * -------------------------------------------- + */ + +var PushMenu = (function ($) { + 'use strict'; + + /** + * Constants + * ==================================================== + */ + + var NAME = 'PushMenu'; + var DATA_KEY = 'lte.pushmenu'; + var EVENT_KEY = '.' + DATA_KEY; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Event = { + COLLAPSED: 'collapsed' + EVENT_KEY, + SHOWN: 'shown' + DATA_KEY + }; + + var Selector = { + COLLAPSED: 'sidebar-collapse', + TOGGLE_BUTTON: '[data-widget="pushmenu"]' + }; + + /** + * Class Definition + * ==================================================== + */ + + var PushMenu = (function () { + function PushMenu() { + _classCallCheck(this, PushMenu); + } + + _createClass(PushMenu, [{ + key: 'Constructor', + value: function Constructor(element) { + this._element = element; + this._isShown; + } + + // Public + + }, { + key: 'show', + value: function show() { + $('body').removeClass(Selector.COLLAPSED); + this._isShown = true; + + var shownEvent = $.Event(Event.SHOWN); + $(this._element).trigger(shownEvent); + } + }, { + key: 'collapse', + value: function collapse() { + $('body').addClass(Selector.COLLAPSED); + this._isShown = false; + + var collapsedEvent = $.Event(Event.COLLAPSED); + $(this._element).trigger(collapsedEvent); + } + }, { + key: 'toggle', + value: function toggle() { + + if (typeof this._isShown === 'undefined') { + this._isShown = !$('body').hasClass(Selector.COLLAPSED); + } + + if (this._isShown) { + this.collapse(); + } else { + this.show(); + } + } + + // Static + + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(operation) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + data = new PushMenu(this); + $(this).data(DATA_KEY, data); + } + + if (operation) { + data[operation](); + } + }); + } + }]); + + return PushMenu; + })(); + + /** + * Data API + * ==================================================== + */ + + $(document).on('click', Selector.TOGGLE_BUTTON, function (event) { + event.preventDefault(); + + var button = event.target; + + if ($(button).data('widget') !== 'pushmenu') { + button = $(button).closest(Selector.TOGGLE_BUTTON); + } + + PushMenu._jQueryInterface.call($(button), 'toggle'); + }); + + /** + * jQuery API + * ==================================================== + */ + + $.fn[NAME] = PushMenu._jQueryInterface; + $.fn[NAME].Constructor = PushMenu; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return PushMenu._jQueryInterface; + }; + + return PushMenu; +})(jQuery); +//# sourceMappingURL=PushMenu.js.map + +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * -------------------------------------------- + * AdminLTE Widget.js + * License MIT + * -------------------------------------------- + */ + +var Widget = (function ($) { + 'use strict'; + + var Widget = (function () { + function Widget() { + _classCallCheck(this, Widget); + } + + _createClass(Widget, [{ + key: 'Constructor', + value: function Constructor(element) { + this._element = element; + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(element) { + var $this = $(element); + $this.show(); + } + }]); + + return Widget; + })(); + + return Widget; +})(jQuery); +//# sourceMappingURL=Widget.js.map diff --git a/dist/js/adminlte.min.js b/dist/js/adminlte.min.js new file mode 100644 index 000000000..fb79a118a --- /dev/null +++ b/dist/js/adminlte.min.js @@ -0,0 +1,7 @@ +/*! + * AdminLTE v3.0.0-alpha (https://almsaeedstudio.com) + * Copyright 2014-2015 Abdullah Almsaeed + * Project website Almsaeed Studio (https://almsaeedstudio.com) + * Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE) + */ +"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function a(a,b){for(var c=0;c + * @Support * @Email * @version 2.3.2 - * @license MIT + * @license MIT */ -//Make sure jQuery has been loaded before app.js -if (typeof jQuery === "undefined") { - throw new Error("AdminLTE requires jQuery"); +// Make sure jQuery has been loaded before app.js +if (typeof jQuery === 'undefined') { + throw new Error('AdminLTE requires jQuery'); } /* AdminLTE @@ -33,95 +33,96 @@ $.AdminLTE = {}; * Modify these options to suit your implementation */ $.AdminLTE.options = { - //Add slimscroll to navbar menus - //This requires you to load the slimscroll plugin - //in every page before app.js + // Add slimscroll to navbar menus + // This requires you to load the slimscroll plugin + // in every page before app.js navbarMenuSlimscroll: true, - navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar - navbarMenuHeight: "200px", //The height of the inner menu - //General animation speed for JS animated elements such as box collapse/expand and - //sidebar treeview slide up/down. This options accepts an integer as milliseconds, - //'fast', 'normal', or 'slow' + navbarMenuSlimscrollWidth: '3px', // The width of the scroll bar + navbarMenuHeight: '200px', // The height of the inner menu + // General animation speed for JS animated elements such as box collapse/expand and + // sidebar treeview slide up/down. This options accepts an integer as milliseconds, + // 'fast', 'normal', or 'slow' animationSpeed: 500, - //Sidebar push menu toggle button selector - sidebarToggleSelector: "[data-toggle='offcanvas']", - //Activate sidebar push menu + // Sidebar push menu toggle button selector + sidebarToggleSelector: '[data-toggle="offcanvas"]', + // Activate sidebar push menu sidebarPushMenu: true, - //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) + // Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) sidebarSlimScroll: true, - //Enable sidebar expand on hover effect for sidebar mini - //This option is forced to true if both the fixed layout and sidebar mini - //are used together + // Enable sidebar expand on hover effect for sidebar mini + // This option is forced to true if both the fixed layout and sidebar mini + // are used together + // are used together sidebarExpandOnHover: false, - //BoxRefresh Plugin + // BoxRefresh Plugin enableBoxRefresh: true, - //Bootstrap.js tooltip + // Bootstrap.js tooltip enableBSToppltip: true, - BSTooltipSelector: "[data-toggle='tooltip']", - //Enable Fast Click. Fastclick.js creates a more - //native touch experience with touch devices. If you - //choose to enable the plugin, make sure you load the script - //before AdminLTE's app.js + BSTooltipSelector: '[data-toggle="tooltip"]', + // Enable Fast Click. Fastclick.js creates a more + // native touch experience with touch devices. If you + // choose to enable the plugin, make sure you load the script + // before AdminLTE's app.js enableFastclick: true, - //Control Sidebar Options + // Control Sidebar Options enableControlSidebar: true, controlSidebarOptions: { - //Which button should trigger the open/close event - toggleBtnSelector: "[data-toggle='control-sidebar']", - //The sidebar selector - selector: ".control-sidebar", - //Enable slide over content + // Which button should trigger the open/close event + toggleBtnSelector: '[data-toggle="control-sidebar"]', + // The sidebar selector + selector: '.control-sidebar', + // Enable slide over content slide: true }, - //Box Widget Plugin. Enable this plugin - //to allow boxes to be collapsed and/or removed + // Box Widget Plugin. Enable this plugin + // to allow boxes to be collapsed and/or removed enableBoxWidget: true, - //Box Widget plugin options + // Box Widget plugin options boxWidgetOptions: { boxWidgetIcons: { - //Collapse icon + // Collapse icon collapse: 'fa-minus', - //Open icon + // Open icon open: 'fa-plus', - //Remove icon + // Remove icon remove: 'fa-times' }, boxWidgetSelectors: { - //Remove button selector + // Remove button selector remove: '[data-widget="remove"]', - //Collapse button selector + // Collapse button selector collapse: '[data-widget="collapse"]' } }, - //Direct Chat plugin options + // Direct Chat plugin options directChat: { - //Enable direct chat by default + // Enable direct chat by default enable: true, - //The button to open and close the chat contacts pane + // The button to open and close the chat contacts pane contactToggleSelector: '[data-widget="chat-pane-toggle"]' }, - //Define the set of colors to use globally around the website + // Define the set of colors to use globally around the website colors: { - lightBlue: "#3c8dbc", - red: "#f56954", - green: "#00a65a", - aqua: "#00c0ef", - yellow: "#f39c12", - blue: "#0073b7", - navy: "#001F3F", - teal: "#39CCCC", - olive: "#3D9970", - lime: "#01FF70", - orange: "#FF851B", - fuchsia: "#F012BE", - purple: "#8E24AA", - maroon: "#D81B60", - black: "#222222", - gray: "#d2d6de" + lightBlue: '#3c8dbc', + red: '#f56954', + green: '#00a65a', + aqua: '#00c0ef', + yellow: '#f39c12', + blue: '#0073b7', + navy: '#001F3F', + teal: '#39CCCC', + olive: '#3D9970', + lime: '#01FF70', + orange: '#FF851B', + fuchsia: '#F012BE', + purple: '#8E24AA', + maroon: '#D81B60', + black: '#222222', + gray: '#d2d6de' }, - //The standard screen sizes that bootstrap uses. - //If you change these in the variables.less file, change - //them here too. + // The standard screen sizes that bootstrap uses. + // If you change these in the variables.less file, change + // them here too. screenSizes: { xs: 480, sm: 768, @@ -138,67 +139,67 @@ $.AdminLTE.options = { * options above. */ $(function () { - "use strict"; + 'use strict'; - //Fix for IE page transitions - $("body").removeClass("hold-transition"); + // Fix for IE page transitions + $('body').removeClass('hold-transition'); - //Extend options if external options exist - if (typeof AdminLTEOptions !== "undefined") { + // Extend options if external options exist + if (typeof AdminLTEOptions !== 'undefined') { $.extend(true, $.AdminLTE.options, AdminLTEOptions); } - //Easy access to options + // Easy access to options var o = $.AdminLTE.options; - //Set up the object + // Set up the object _init(); - //Activate the layout maker + // Activate the layout maker $.AdminLTE.layout.activate(); - //Enable sidebar tree view controls + // Enable sidebar tree view controls $.AdminLTE.tree('.sidebar'); - //Enable control sidebar + // Enable control sidebar if (o.enableControlSidebar) { $.AdminLTE.controlSidebar.activate(); } - //Add slimscroll to navbar dropdown + // Add slimscroll to navbar dropdown if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { - $(".navbar .menu").slimscroll({ + $('.navbar .menu').slimscroll({ height: o.navbarMenuHeight, alwaysVisible: false, size: o.navbarMenuSlimscrollWidth - }).css("width", "100%"); + }).css('width', '100%'); } - //Activate sidebar push menu + // Activate sidebar push menu if (o.sidebarPushMenu) { $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); } - //Activate Bootstrap tooltip + // Activate Bootstrap tooltip if (o.enableBSToppltip) { $('body').tooltip({ selector: o.BSTooltipSelector }); } - //Activate box widget + // Activate box widget if (o.enableBoxWidget) { $.AdminLTE.boxWidget.activate(); } - //Activate fast click + // Activate fast click if (o.enableFastclick && typeof FastClick != 'undefined') { FastClick.attach(document.body); } - //Activate direct chat widget + // Activate direct chat widget if (o.directChat.enable) { $(document).on('click', o.directChat.contactToggleSelector, function () { var box = $(this).parents('.direct-chat').first(); @@ -212,9 +213,9 @@ $(function () { */ $('.btn-group[data-toggle="btn-toggle"]').each(function () { var group = $(this); - $(this).find(".btn").on('click', function (e) { - group.find(".btn.active").removeClass("active"); - $(this).addClass("active"); + $(this).find('.btn').on('click', function (e) { + group.find('.btn.active').removeClass('active'); + $(this).addClass('active'); e.preventDefault(); }); @@ -242,59 +243,59 @@ function _init() { var _this = this; _this.fix(); _this.fixSidebar(); - $(window, ".wrapper").resize(function () { + $(window, '.wrapper').resize(function () { _this.fix(); _this.fixSidebar(); }); }, fix: function () { - //Get window height and the wrapper height + // Get window height and the wrapper height var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); var window_height = $(window).height(); - var sidebar_height = $(".sidebar").height(); - //Set the min-height of the content and sidebar based on the - //the height of the document. - if ($("body").hasClass("fixed")) { - $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); + var sidebar_height = $('.sidebar').height(); + // Set the min-height of the content and sidebar based on the + // the height of the document. + if ($('body').hasClass('fixed')) { + $('.content-wrapper, .right-side').css('min-height', window_height - $('.main-footer').outerHeight()); } else { var postSetWidth; if (window_height >= sidebar_height) { - $(".content-wrapper, .right-side").css('min-height', window_height - neg); + $('.content-wrapper, .right-side').css('min-height', window_height - neg); postSetWidth = window_height - neg; } else { - $(".content-wrapper, .right-side").css('min-height', sidebar_height); + $('.content-wrapper, .right-side').css('min-height', sidebar_height); postSetWidth = sidebar_height; } - //Fix for the control sidebar height + // Fix for the control sidebar height var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); - if (typeof controlSidebar !== "undefined") { + if (typeof controlSidebar !== 'undefined') { if (controlSidebar.height() > postSetWidth) - $(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); + $('.content-wrapper, .right-side').css('min-height', controlSidebar.height()); } } }, fixSidebar: function () { - //Make sure the body tag has the .fixed class - if (!$("body").hasClass("fixed")) { + // Make sure the body tag has the .fixed class + if (!$('body').hasClass('fixed')) { if (typeof $.fn.slimScroll != 'undefined') { - $(".sidebar").slimScroll({destroy: true}).height("auto"); + $('.sidebar').slimScroll({destroy: true}).height('auto'); } return; } else if (typeof $.fn.slimScroll == 'undefined' && window.console) { - window.console.error("Error: the fixed layout requires the slimscroll plugin!"); + window.console.error('Error: the fixed layout requires the slimscroll plugin!'); } - //Enable slimscroll for fixed layout + // Enable slimscroll for fixed layout if ($.AdminLTE.options.sidebarSlimScroll) { if (typeof $.fn.slimScroll != 'undefined') { - //Destroy if it exists - $(".sidebar").slimScroll({destroy: true}).height("auto"); - //Add slimscroll - $(".sidebar").slimscroll({ - height: ($(window).height() - $(".main-header").height()) + "px", - color: "rgba(0,0,0,0.2)", - size: "3px" + // Destroy if it exists + $('.sidebar').slimScroll({destroy: true}).height('auto'); + // Add slimscroll + $('.sidebar').slimscroll({ + height: ($(window).height() - $('.main-header').height()) + 'px', + color: 'rgba(0,0,0,0.2)', + size: '3px' }); } } @@ -306,43 +307,43 @@ function _init() { * Adds the push menu functionality to the sidebar. * * @type Function - * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") + * @usage: $.AdminLTE.pushMenu('[data-toggle="offcanvas']') */ $.AdminLTE.pushMenu = { activate: function (toggleBtn) { - //Get the screen sizes + // Get the screen sizes var screenSizes = $.AdminLTE.options.screenSizes; - //Enable sidebar toggle + // Enable sidebar toggle $(document).on('click', toggleBtn, function (e) { e.preventDefault(); - //Enable sidebar push menu + // Enable sidebar push menu if ($(window).width() > (screenSizes.sm - 1)) { - if ($("body").hasClass('sidebar-collapse')) { - $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); + if ($('body').hasClass('sidebar-collapse')) { + $('body').removeClass('sidebar-collapse').trigger('expanded.pushMenu'); } else { - $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); + $('body').addClass('sidebar-collapse').trigger('collapsed.pushMenu'); } } - //Handle sidebar push menu for small screens + // Handle sidebar push menu for small screens else { - if ($("body").hasClass('sidebar-open')) { - $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); + if ($('body').hasClass('sidebar-open')) { + $('body').removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); } else { - $("body").addClass('sidebar-open').trigger('expanded.pushMenu'); + $('body').addClass('sidebar-open').trigger('expanded.pushMenu'); } } }); - $(".content-wrapper").click(function () { - //Enable hide menu when clicking on the content-wrapper on small screens - if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { - $("body").removeClass('sidebar-open'); + $('.content-wrapper').click(function () { + // Enable hide menu when clicking on the content-wrapper on small screens + if ($(window).width() <= (screenSizes.sm - 1) && $('body').hasClass('sidebar-open')) { + $('body').removeClass('sidebar-open'); } }); - //Enable expand on hover for sidebar mini + // Enable expand on hover for sidebar mini if ($.AdminLTE.options.sidebarExpandOnHover || ($('body').hasClass('fixed') && $('body').hasClass('sidebar-mini'))) { @@ -352,10 +353,10 @@ function _init() { expandOnHover: function () { var _this = this; var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; - //Expand sidebar on hover + // Expand sidebar on hover $('.main-sidebar').hover(function () { if ($('body').hasClass('sidebar-mini') - && $("body").hasClass('sidebar-collapse') + && $('body').hasClass('sidebar-collapse') && $(window).width() > screenWidth) { _this.expand(); } @@ -368,7 +369,7 @@ function _init() { }); }, expand: function () { - $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); + $('body').removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); }, collapse: function () { if ($('body').hasClass('sidebar-expanded-on-hover')) { @@ -389,42 +390,42 @@ function _init() { var _this = this; var animationSpeed = $.AdminLTE.options.animationSpeed; $(menu).on('click', 'li a', function (e) { - //Get the clicked link and the next element + // Get the clicked link and the next element var $this = $(this); var checkElement = $this.next(); - //Check if the next element is a menu and is visible + // Check if the next element is a menu and is visible if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { - //Close the menu + // Close the menu checkElement.slideUp(animationSpeed, function () { checkElement.removeClass('menu-open'); - //Fix the layout in case the sidebar stretches over the height of the window - //_this.layout.fix(); + // Fix the layout in case the sidebar stretches over the height of the window + // _this.layout.fix(); }); - checkElement.parent("li").removeClass("active"); + checkElement.parent('li').removeClass('active'); } - //If the menu is not visible + // If the menu is not visible else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { - //Get the parent menu + // Get the parent menu var parent = $this.parents('ul').first(); - //Close all open menus within the parent + // Close all open menus within the parent var ul = parent.find('ul:visible').slideUp(animationSpeed); - //Remove the menu-open class from the parent + // Remove the menu-open class from the parent ul.removeClass('menu-open'); - //Get the parent li - var parent_li = $this.parent("li"); + // Get the parent li + var parent_li = $this.parent('li'); - //Open the target menu and add the menu-open class + // Open the target menu and add the menu-open class checkElement.slideDown(animationSpeed, function () { - //Add the class active to the parent li + // Add the class active to the parent li checkElement.addClass('menu-open'); parent.find('li.active').removeClass('active'); parent_li.addClass('active'); - //Fix the layout in case the sidebar stretches over the height of the window + // Fix the layout in case the sidebar stretches over the height of the window _this.layout.fix(); }); } - //if this isn't a link, prevent the page from being redirected + // if this isn't a link, prevent the page from being redirected if (checkElement.is('.treeview-menu')) { e.preventDefault(); } @@ -439,56 +440,56 @@ function _init() { * @usage $.AdminLTE.controlSidebar.activate(options) */ $.AdminLTE.controlSidebar = { - //instantiate the object + // instantiate the object activate: function () { - //Get the object + // Get the object var _this = this; - //Update options + // Update options var o = $.AdminLTE.options.controlSidebarOptions; - //Get the sidebar + // Get the sidebar var sidebar = $(o.selector); - //The toggle button + // The toggle button var btn = $(o.toggleBtnSelector); - //Listen to the click event + // Listen to the click event btn.on('click', function (e) { e.preventDefault(); - //If the sidebar is not open + // If the sidebar is not open if (!sidebar.hasClass('control-sidebar-open') && !$('body').hasClass('control-sidebar-open')) { - //Open the sidebar + // Open the sidebar _this.open(sidebar, o.slide); } else { _this.close(sidebar, o.slide); } }); - //If the body has a boxed layout, fix the sidebar bg position - var bg = $(".control-sidebar-bg"); + // If the body has a boxed layout, fix the sidebar bg position + var bg = $('.control-sidebar-bg'); _this._fix(bg); - //If the body has a fixed layout, make the control sidebar fixed + // If the body has a fixed layout, make the control sidebar fixed if ($('body').hasClass('fixed')) { _this._fixForFixed(sidebar); } else { - //If the content height is less than the sidebar's height, force max height + // If the content height is less than the sidebar's height, force max height if ($('.content-wrapper, .right-side').height() < sidebar.height()) { _this._fixForContent(sidebar); } } }, - //Open the control sidebar + // Open the control sidebar open: function (sidebar, slide) { - //Slide over content + // Slide over content if (slide) { sidebar.addClass('control-sidebar-open'); } else { - //Push the content by adding the open class to the body instead - //of the sidebar itself + // Push the content by adding the open class to the body instead + // of the sidebar itself $('body').addClass('control-sidebar-open'); } }, - //Close the control sidebar + // Close the control sidebar close: function (sidebar, slide) { if (slide) { sidebar.removeClass('control-sidebar-open'); @@ -498,9 +499,9 @@ function _init() { }, _fix: function (sidebar) { var _this = this; - if ($("body").hasClass('layout-boxed')) { + if ($('body').hasClass('layout-boxed')) { sidebar.css('position', 'absolute'); - sidebar.height($(".wrapper").height()); + sidebar.height($('.wrapper').height()); $(window).resize(function () { _this._fix(sidebar); }); @@ -520,7 +521,7 @@ function _init() { }); }, _fixForContent: function (sidebar) { - $(".content-wrapper, .right-side").css('min-height', sidebar.height()); + $('.content-wrapper, .right-side').css('min-height', sidebar.height()); } }; @@ -540,15 +541,15 @@ function _init() { activate: function (_box) { var _this = this; if (!_box) { - _box = document; // activate all boxes per default + _box = document; // activate all boxes per default } - //Listen for collapse event triggers + // Listen for collapse event triggers $(_box).on('click', _this.selectors.collapse, function (e) { e.preventDefault(); _this.collapse($(this)); }); - //Listen for remove event triggers + // Listen for remove event triggers $(_box).on('click', _this.selectors.remove, function (e) { e.preventDefault(); _this.remove($(this)); @@ -556,33 +557,33 @@ function _init() { }, collapse: function (element) { var _this = this; - //Find the box parent - var box = element.parents(".box").first(); - //Find the body and the footer - var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); - if (!box.hasClass("collapsed-box")) { - //Convert minus into plus - element.children(":first") + // Find the box parent + var box = element.parents('.box').first(); + // Find the body and the footer + var box_content = box.find('> .box-body, > .box-footer, > form >.box-body, > form > .box-footer'); + if (!box.hasClass('collapsed-box')) { + // Convert minus into plus + element.children(':first') .removeClass(_this.icons.collapse) .addClass(_this.icons.open); - //Hide the content + // Hide the content box_content.slideUp(_this.animationSpeed, function () { - box.addClass("collapsed-box"); + box.addClass('collapsed-box'); }); } else { - //Convert plus into minus - element.children(":first") + // Convert plus into minus + element.children(':first') .removeClass(_this.icons.open) .addClass(_this.icons.collapse); - //Show the content + // Show the content box_content.slideDown(_this.animationSpeed, function () { - box.removeClass("collapsed-box"); + box.removeClass('collapsed-box'); }); } }, remove: function (element) { - //Find the box parent - var box = element.parents(".box").first(); + // Find the box parent + var box = element.parents('.box').first(); box.slideUp(this.animationSpeed); } }; @@ -601,68 +602,68 @@ function _init() { * a refresh button to the box. It converts the box's state to a loading state. * * @type plugin - * @usage $("#box-widget").boxRefresh( options ); + * @usage $('#box-widget').boxRefresh( options ); */ (function ($) { - "use strict"; + 'use strict'; $.fn.boxRefresh = function (options) { - // Render options + // Render options var settings = $.extend({ - //Refresh button selector - trigger: ".refresh-btn", - //File source to be loaded (e.g: ajax/src.php) - source: "", - //Callbacks + // Refresh button selector + trigger: '.refresh-btn', + // File source to be loaded (e.g: ajax/src.php) + source: '', + // Callbacks onLoadStart: function (box) { return box; - }, //Right after the button has been clicked + }, // Right after the button has been clicked onLoadDone: function (box) { return box; - } //When the source has been loaded + } // When the source has been loaded }, options); - //The overlay + // The overlay var overlay = $('
'); return this.each(function () { - //if a source is specified - if (settings.source === "") { + // if a source is specified + if (settings.source === '') { if (window.console) { - window.console.log("Please specify a source first - boxRefresh()"); + window.console.log('Please specify a source first - boxRefresh()'); } return; } - //the box + // the box var box = $(this); - //the button + // the button var rBtn = box.find(settings.trigger).first(); - //On trigger click + // On trigger click rBtn.on('click', function (e) { e.preventDefault(); - //Add loading overlay + // Add loading overlay start(box); - //Perform ajax call - box.find(".box-body").load(settings.source, function () { + // Perform ajax call + box.find('.box-body').load(settings.source, function () { done(box); }); }); }); function start(box) { - //Add overlay and loading img + // Add overlay and loading img box.append(overlay); settings.onLoadStart.call(box); } function done(box) { - //Remove overlay and loading img + // Remove overlay and loading img box.find(overlay).remove(); settings.onLoadDone.call(box); @@ -679,9 +680,9 @@ function _init() { * a box inserted in the DOM after the app.js was loaded, toggle and remove box. * * @type plugin - * @usage $("#box-widget").activateBox(); - * @usage $("#box-widget").toggleBox(); - * @usage $("#box-widget").removeBox(); + * @usage $('#box-widget').activateBox(); + * @usage $('#box-widget').toggleBox(); + * @usage $('#box-widget').removeBox(); */ (function ($) { @@ -691,12 +692,12 @@ function _init() { $.AdminLTE.boxWidget.activate(this); }; - $.fn.toggleBox = function(){ + $.fn.toggleBox = function() { var button = $($.AdminLTE.boxWidget.selectors.collapse, this); $.AdminLTE.boxWidget.collapse(button); }; - $.fn.removeBox = function(){ + $.fn.removeBox = function() { var button = $($.AdminLTE.boxWidget.selectors.remove, this); $.AdminLTE.boxWidget.remove(button); }; @@ -709,20 +710,20 @@ function _init() { * This plugin depends on iCheck plugin for checkbox and radio inputs * * @type plugin - * @usage $("#todo-widget").todolist( options ); + * @usage $('#todo-widget').todolist( options ); */ (function ($) { 'use strict'; $.fn.todolist = function (options) { - // Render options + // Render options var settings = $.extend({ - //When the user checks the input + // When the user checks the input onCheck: function (ele) { return ele; }, - //When the user unchecks the input + // When the user unchecks the input onUncheck: function (ele) { return ele; } @@ -732,21 +733,21 @@ function _init() { if (typeof $.fn.iCheck != 'undefined') { $('input', this).on('ifChecked', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); + var ele = $(this).parents('li').first(); + ele.toggleClass('done'); settings.onCheck.call(ele); }); $('input', this).on('ifUnchecked', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); + var ele = $(this).parents('li').first(); + ele.toggleClass('done'); settings.onUncheck.call(ele); }); } else { $('input', this).on('change', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); - if ($('input', ele).is(":checked")) { + var ele = $(this).parents('li').first(); + ele.toggleClass('done'); + if ($('input', ele).is(':checked')) { settings.onCheck.call(ele); } else { settings.onUncheck.call(ele); @@ -755,4 +756,4 @@ function _init() { } }); }; -}(jQuery)); +}(jQuery)); \ No newline at end of file diff --git a/dist/js/app.min.js b/dist/js/app.min.js index 8ec5fe161..8fa4c714f 100644 --- a/dist/js/app.min.js +++ b/dist/js/app.min.js @@ -5,9 +5,9 @@ * options and implements exclusive AdminLTE plugins. * * @Author Almsaeed Studio - * @Support + * @Support * @Email * @version 2.3.2 - * @license MIT + * @license MIT */ -function _init(){"use strict";$.AdminLTE.layout={activate:function(){var a=this;a.fix(),a.fixSidebar(),$(window,".wrapper").resize(function(){a.fix(),a.fixSidebar()})},fix:function(){var a=$(".main-header").outerHeight()+$(".main-footer").outerHeight(),b=$(window).height(),c=$(".sidebar").height();if($("body").hasClass("fixed"))$(".content-wrapper, .right-side").css("min-height",b-$(".main-footer").outerHeight());else{var d;b>=c?($(".content-wrapper, .right-side").css("min-height",b-a),d=b-a):($(".content-wrapper, .right-side").css("min-height",c),d=c);var e=$($.AdminLTE.options.controlSidebarOptions.selector);"undefined"!=typeof e&&e.height()>d&&$(".content-wrapper, .right-side").css("min-height",e.height())}},fixSidebar:function(){return $("body").hasClass("fixed")?("undefined"==typeof $.fn.slimScroll&&window.console&&window.console.error("Error: the fixed layout requires the slimscroll plugin!"),void($.AdminLTE.options.sidebarSlimScroll&&"undefined"!=typeof $.fn.slimScroll&&($(".sidebar").slimScroll({destroy:!0}).height("auto"),$(".sidebar").slimscroll({height:$(window).height()-$(".main-header").height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"})))):void("undefined"!=typeof $.fn.slimScroll&&$(".sidebar").slimScroll({destroy:!0}).height("auto"))}},$.AdminLTE.pushMenu={activate:function(a){var b=$.AdminLTE.options.screenSizes;$(document).on("click",a,function(a){a.preventDefault(),$(window).width()>b.sm-1?$("body").hasClass("sidebar-collapse")?$("body").removeClass("sidebar-collapse").trigger("expanded.pushMenu"):$("body").addClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").hasClass("sidebar-open")?$("body").removeClass("sidebar-open").removeClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").addClass("sidebar-open").trigger("expanded.pushMenu")}),$(".content-wrapper").click(function(){$(window).width()<=b.sm-1&&$("body").hasClass("sidebar-open")&&$("body").removeClass("sidebar-open")}),($.AdminLTE.options.sidebarExpandOnHover||$("body").hasClass("fixed")&&$("body").hasClass("sidebar-mini"))&&this.expandOnHover()},expandOnHover:function(){var a=this,b=$.AdminLTE.options.screenSizes.sm-1;$(".main-sidebar").hover(function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-collapse")&&$(window).width()>b&&a.expand()},function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-expanded-on-hover")&&$(window).width()>b&&a.collapse()})},expand:function(){$("body").removeClass("sidebar-collapse").addClass("sidebar-expanded-on-hover")},collapse:function(){$("body").hasClass("sidebar-expanded-on-hover")&&$("body").removeClass("sidebar-expanded-on-hover").addClass("sidebar-collapse")}},$.AdminLTE.tree=function(a){var b=this,c=$.AdminLTE.options.animationSpeed;$(a).on("click","li a",function(a){var d=$(this),e=d.next();if(e.is(".treeview-menu")&&e.is(":visible")&&!$("body").hasClass("sidebar-collapse"))e.slideUp(c,function(){e.removeClass("menu-open")}),e.parent("li").removeClass("active");else if(e.is(".treeview-menu")&&!e.is(":visible")){var f=d.parents("ul").first(),g=f.find("ul:visible").slideUp(c);g.removeClass("menu-open");var h=d.parent("li");e.slideDown(c,function(){e.addClass("menu-open"),f.find("li.active").removeClass("active"),h.addClass("active"),b.layout.fix()})}e.is(".treeview-menu")&&a.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var a=this,b=$.AdminLTE.options.controlSidebarOptions,c=$(b.selector),d=$(b.toggleBtnSelector);d.on("click",function(d){d.preventDefault(),c.hasClass("control-sidebar-open")||$("body").hasClass("control-sidebar-open")?a.close(c,b.slide):a.open(c,b.slide)});var e=$(".control-sidebar-bg");a._fix(e),$("body").hasClass("fixed")?a._fixForFixed(c):$(".content-wrapper, .right-side").height() .box-body, > .box-footer, > form >.box-body, > form > .box-footer");c.hasClass("collapsed-box")?(a.children(":first").removeClass(b.icons.open).addClass(b.icons.collapse),d.slideDown(b.animationSpeed,function(){c.removeClass("collapsed-box")})):(a.children(":first").removeClass(b.icons.collapse).addClass(b.icons.open),d.slideUp(b.animationSpeed,function(){c.addClass("collapsed-box")}))},remove:function(a){var b=a.parents(".box").first();b.slideUp(this.animationSpeed)}}}if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:"3px",navbarMenuHeight:"200px",animationSpeed:500,sidebarToggleSelector:"[data-toggle='offcanvas']",sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:"[data-toggle='tooltip']",enableFastclick:!0,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:"[data-toggle='control-sidebar']",selector:".control-sidebar",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:"fa-minus",open:"fa-plus",remove:"fa-times"},boxWidgetSelectors:{remove:'[data-widget="remove"]',collapse:'[data-widget="collapse"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget="chat-pane-toggle"]'},colors:{lightBlue:"#3c8dbc",red:"#f56954",green:"#00a65a",aqua:"#00c0ef",yellow:"#f39c12",blue:"#0073b7",navy:"#001F3F",teal:"#39CCCC",olive:"#3D9970",lime:"#01FF70",orange:"#FF851B",fuchsia:"#F012BE",purple:"#8E24AA",maroon:"#D81B60",black:"#222222",gray:"#d2d6de"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){"use strict";$("body").removeClass("hold-transition"),"undefined"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var a=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),$.AdminLTE.tree(".sidebar"),a.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),a.navbarMenuSlimscroll&&"undefined"!=typeof $.fn.slimscroll&&$(".navbar .menu").slimscroll({height:a.navbarMenuHeight,alwaysVisible:!1,size:a.navbarMenuSlimscrollWidth}).css("width","100%"),a.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(a.sidebarToggleSelector),a.enableBSToppltip&&$("body").tooltip({selector:a.BSTooltipSelector}),a.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),a.enableFastclick&&"undefined"!=typeof FastClick&&FastClick.attach(document.body),a.directChat.enable&&$(document).on("click",a.directChat.contactToggleSelector,function(){var a=$(this).parents(".direct-chat").first();a.toggleClass("direct-chat-contacts-open")}),$('.btn-group[data-toggle="btn-toggle"]').each(function(){var a=$(this);$(this).find(".btn").on("click",function(b){a.find(".btn.active").removeClass("active"),$(this).addClass("active"),b.preventDefault()})})}),function(a){"use strict";a.fn.boxRefresh=function(b){function c(a){a.append(f),e.onLoadStart.call(a)}function d(a){a.find(f).remove(),e.onLoadDone.call(a)}var e=a.extend({trigger:".refresh-btn",source:"",onLoadStart:function(a){return a},onLoadDone:function(a){return a}},b),f=a('
');return this.each(function(){if(""===e.source)return void(window.console&&window.console.log("Please specify a source first - boxRefresh()"));var b=a(this),f=b.find(e.trigger).first();f.on("click",function(a){a.preventDefault(),c(b),b.find(".box-body").load(e.source,function(){d(b)})})})}}(jQuery),function(a){"use strict";a.fn.activateBox=function(){a.AdminLTE.boxWidget.activate(this)},a.fn.toggleBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.collapse,this);a.AdminLTE.boxWidget.collapse(b)},a.fn.removeBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.remove,this);a.AdminLTE.boxWidget.remove(b)}}(jQuery),function(a){"use strict";a.fn.todolist=function(b){var c=a.extend({onCheck:function(a){return a},onUncheck:function(a){return a}},b);return this.each(function(){"undefined"!=typeof a.fn.iCheck?(a("input",this).on("ifChecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onCheck.call(b)}),a("input",this).on("ifUnchecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onUncheck.call(b)})):a("input",this).on("change",function(){var b=a(this).parents("li").first();b.toggleClass("done"),a("input",b).is(":checked")?c.onCheck.call(b):c.onUncheck.call(b)})})}}(jQuery); \ No newline at end of file +function _init(){"use strict";$.AdminLTE.layout={activate:function(){var a=this;a.fix(),a.fixSidebar(),$(window,".wrapper").resize(function(){a.fix(),a.fixSidebar()})},fix:function(){var a=$(".main-header").outerHeight()+$(".main-footer").outerHeight(),b=$(window).height(),c=$(".sidebar").height();if($("body").hasClass("fixed"))$(".content-wrapper, .right-side").css("min-height",b-$(".main-footer").outerHeight());else{var d;b>=c?($(".content-wrapper, .right-side").css("min-height",b-a),d=b-a):($(".content-wrapper, .right-side").css("min-height",c),d=c);var e=$($.AdminLTE.options.controlSidebarOptions.selector);"undefined"!=typeof e&&e.height()>d&&$(".content-wrapper, .right-side").css("min-height",e.height())}},fixSidebar:function(){return $("body").hasClass("fixed")?("undefined"==typeof $.fn.slimScroll&&window.console&&window.console.error("Error: the fixed layout requires the slimscroll plugin!"),void($.AdminLTE.options.sidebarSlimScroll&&"undefined"!=typeof $.fn.slimScroll&&($(".sidebar").slimScroll({destroy:!0}).height("auto"),$(".sidebar").slimscroll({height:$(window).height()-$(".main-header").height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"})))):void("undefined"!=typeof $.fn.slimScroll&&$(".sidebar").slimScroll({destroy:!0}).height("auto"))}},$.AdminLTE.pushMenu={activate:function(a){var b=$.AdminLTE.options.screenSizes;$(document).on("click",a,function(a){a.preventDefault(),$(window).width()>b.sm-1?$("body").hasClass("sidebar-collapse")?$("body").removeClass("sidebar-collapse").trigger("expanded.pushMenu"):$("body").addClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").hasClass("sidebar-open")?$("body").removeClass("sidebar-open").removeClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").addClass("sidebar-open").trigger("expanded.pushMenu")}),$(".content-wrapper").click(function(){$(window).width()<=b.sm-1&&$("body").hasClass("sidebar-open")&&$("body").removeClass("sidebar-open")}),($.AdminLTE.options.sidebarExpandOnHover||$("body").hasClass("fixed")&&$("body").hasClass("sidebar-mini"))&&this.expandOnHover()},expandOnHover:function(){var a=this,b=$.AdminLTE.options.screenSizes.sm-1;$(".main-sidebar").hover(function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-collapse")&&$(window).width()>b&&a.expand()},function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-expanded-on-hover")&&$(window).width()>b&&a.collapse()})},expand:function(){$("body").removeClass("sidebar-collapse").addClass("sidebar-expanded-on-hover")},collapse:function(){$("body").hasClass("sidebar-expanded-on-hover")&&$("body").removeClass("sidebar-expanded-on-hover").addClass("sidebar-collapse")}},$.AdminLTE.tree=function(a){var b=this,c=$.AdminLTE.options.animationSpeed;$(a).on("click","li a",function(a){var d=$(this),e=d.next();if(e.is(".treeview-menu")&&e.is(":visible")&&!$("body").hasClass("sidebar-collapse"))e.slideUp(c,function(){e.removeClass("menu-open")}),e.parent("li").removeClass("active");else if(e.is(".treeview-menu")&&!e.is(":visible")){var f=d.parents("ul").first(),g=f.find("ul:visible").slideUp(c);g.removeClass("menu-open");var h=d.parent("li");e.slideDown(c,function(){e.addClass("menu-open"),f.find("li.active").removeClass("active"),h.addClass("active"),b.layout.fix()})}e.is(".treeview-menu")&&a.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var a=this,b=$.AdminLTE.options.controlSidebarOptions,c=$(b.selector),d=$(b.toggleBtnSelector);d.on("click",function(d){d.preventDefault(),c.hasClass("control-sidebar-open")||$("body").hasClass("control-sidebar-open")?a.close(c,b.slide):a.open(c,b.slide)});var e=$(".control-sidebar-bg");a._fix(e),$("body").hasClass("fixed")?a._fixForFixed(c):$(".content-wrapper, .right-side").height() .box-body, > .box-footer, > form >.box-body, > form > .box-footer");c.hasClass("collapsed-box")?(a.children(":first").removeClass(b.icons.open).addClass(b.icons.collapse),d.slideDown(b.animationSpeed,function(){c.removeClass("collapsed-box")})):(a.children(":first").removeClass(b.icons.collapse).addClass(b.icons.open),d.slideUp(b.animationSpeed,function(){c.addClass("collapsed-box")}))},remove:function(a){var b=a.parents(".box").first();b.slideUp(this.animationSpeed)}}}if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:"3px",navbarMenuHeight:"200px",animationSpeed:500,sidebarToggleSelector:'[data-toggle="offcanvas"]',sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:'[data-toggle="tooltip"]',enableFastclick:!0,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:'[data-toggle="control-sidebar"]',selector:".control-sidebar",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:"fa-minus",open:"fa-plus",remove:"fa-times"},boxWidgetSelectors:{remove:'[data-widget="remove"]',collapse:'[data-widget="collapse"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget="chat-pane-toggle"]'},colors:{lightBlue:"#3c8dbc",red:"#f56954",green:"#00a65a",aqua:"#00c0ef",yellow:"#f39c12",blue:"#0073b7",navy:"#001F3F",teal:"#39CCCC",olive:"#3D9970",lime:"#01FF70",orange:"#FF851B",fuchsia:"#F012BE",purple:"#8E24AA",maroon:"#D81B60",black:"#222222",gray:"#d2d6de"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){"use strict";$("body").removeClass("hold-transition"),"undefined"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var a=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),$.AdminLTE.tree(".sidebar"),a.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),a.navbarMenuSlimscroll&&"undefined"!=typeof $.fn.slimscroll&&$(".navbar .menu").slimscroll({height:a.navbarMenuHeight,alwaysVisible:!1,size:a.navbarMenuSlimscrollWidth}).css("width","100%"),a.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(a.sidebarToggleSelector),a.enableBSToppltip&&$("body").tooltip({selector:a.BSTooltipSelector}),a.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),a.enableFastclick&&"undefined"!=typeof FastClick&&FastClick.attach(document.body),a.directChat.enable&&$(document).on("click",a.directChat.contactToggleSelector,function(){var a=$(this).parents(".direct-chat").first();a.toggleClass("direct-chat-contacts-open")}),$('.btn-group[data-toggle="btn-toggle"]').each(function(){var a=$(this);$(this).find(".btn").on("click",function(b){a.find(".btn.active").removeClass("active"),$(this).addClass("active"),b.preventDefault()})})}),function(a){"use strict";a.fn.boxRefresh=function(b){function c(a){a.append(f),e.onLoadStart.call(a)}function d(a){a.find(f).remove(),e.onLoadDone.call(a)}var e=a.extend({trigger:".refresh-btn",source:"",onLoadStart:function(a){return a},onLoadDone:function(a){return a}},b),f=a('
');return this.each(function(){if(""===e.source)return void(window.console&&window.console.log("Please specify a source first - boxRefresh()"));var b=a(this),f=b.find(e.trigger).first();f.on("click",function(a){a.preventDefault(),c(b),b.find(".box-body").load(e.source,function(){d(b)})})})}}(jQuery),function(a){"use strict";a.fn.activateBox=function(){a.AdminLTE.boxWidget.activate(this)},a.fn.toggleBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.collapse,this);a.AdminLTE.boxWidget.collapse(b)},a.fn.removeBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.remove,this);a.AdminLTE.boxWidget.remove(b)}}(jQuery),function(a){"use strict";a.fn.todolist=function(b){var c=a.extend({onCheck:function(a){return a},onUncheck:function(a){return a}},b);return this.each(function(){"undefined"!=typeof a.fn.iCheck?(a("input",this).on("ifChecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onCheck.call(b)}),a("input",this).on("ifUnchecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onUncheck.call(b)})):a("input",this).on("change",function(){var b=a(this).parents("li").first();b.toggleClass("done"),a("input",b).is(":checked")?c.onCheck.call(b):c.onUncheck.call(b)})})}}(jQuery); \ No newline at end of file diff --git a/dist/js/demo.js b/dist/js/demo.js index 86731bd26..95e87d244 100644 --- a/dist/js/demo.js +++ b/dist/js/demo.js @@ -31,12 +31,12 @@ //Create the new tab var tab_pane = $("
", { "id": "control-sidebar-theme-demo-options-tab", - "class": "tab-pane active" + "class": "tab-pane" }); //Create the tab button - var tab_button = $("
  • ", {"class": "active"}) - .html("" + var tab_button = $("
  • ", {"class": "nav-item"}) + .html("" + "" + ""); diff --git a/package.json b/package.json index d20d91818..f69322525 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,38 @@ { "name": "admin-lte", - "version": "2.3.2", + "description": "Responsive open source admin dashboard and control panel.", + "version": "3.0.0-alpha", + "license": "MIT", + "author": "Abdullah Almsaeed ", + "keywords": [ + "css", + "sass", + "responsive", + "admin", + "template", + "theme", + "framework", + "control-panel", + "dashboard" + ], + "homepage": "https://almsaeedstudio.com", + "style": "dist/css/AdminLTE.css", + "sass": "build/scss/AdminLTE.scss", "repository": { "type": "git", "url": "git://github.com/almasaeed2010/AdminLTE.git" }, - "license": "MIT", + "bugs": { + "url": "https://github.com/almasaeed2010/AdminLTE/issues" + }, "devDependencies": { - "R2": "^1.4.3", - "babel-preset-es2015": "^6.0.15", + "babel-eslint": "^4.1.4", + "babel-preset-es2015": "^6.1.4", "grunt": "~0.4.5", "grunt-babel": "^6.0.0", "grunt-bootlint": "^0.9.1", "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-concat": "^0.5.1", "grunt-contrib-csslint": "^0.5.0", "grunt-contrib-cssmin": "^0.12.2", "grunt-contrib-jshint": "^0.11.2", @@ -20,8 +40,11 @@ "grunt-contrib-uglify": "^0.7.0", "grunt-contrib-watch": "~0.6.1", "grunt-cssjanus": "^0.2.4", + "grunt-eslint": "^17.3.1", "grunt-image": "^1.0.5", "grunt-includes": "^0.4.5", - "grunt-sass": "^1.1.0" + "grunt-jscs": "^2.3.0", + "grunt-sass": "^1.1.0", + "grunt-scss-lint": "^0.3.8" } }