├── bdtheme ├── patches.txt ├── bd_theme │ └── __init__.py ├── config │ ├── __init__.py │ ├── desktop.py │ └── docs.py ├── modules.txt ├── public │ ├── css │ │ ├── temp.css │ │ ├── bdtheme-web.css │ │ ├── custom.css │ │ ├── skin-blue.css │ │ └── bdtheme.css │ ├── images │ │ ├── icons.png │ │ ├── boxed-bg.jpg │ │ ├── boxed-bg.png │ │ ├── bp-ico-32.png │ │ ├── bp-ico-192.png │ │ ├── logo_bdoop.png │ │ └── default-50x50.gif │ ├── build.json │ └── js │ │ ├── custom.js │ │ ├── template │ │ └── main-sidebar.html │ │ └── bdtheme.js ├── templates │ ├── __init__.py │ └── pages │ │ └── __init__.py ├── __init__.py └── hooks.py ├── license.txt ├── requirements.txt ├── README.md ├── .gitignore ├── MANIFEST.in └── setup.py /bdtheme/patches.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | License: MIT -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | frappe -------------------------------------------------------------------------------- /bdtheme/bd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bdtheme/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bdtheme/modules.txt: -------------------------------------------------------------------------------- 1 | bd theme -------------------------------------------------------------------------------- /bdtheme/public/css/temp.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bdtheme/templates/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bdtheme/templates/pages/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bdtheme/public/css/bdtheme-web.css: -------------------------------------------------------------------------------- 1 | footer.web-footer{display:none} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## bd theme 2 | 3 | bd theme 4 | 5 | #### License 6 | 7 | MIT -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | *.egg-info 4 | *.swp 5 | tags 6 | bdtheme/docs/current -------------------------------------------------------------------------------- /bdtheme/public/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/icons.png -------------------------------------------------------------------------------- /bdtheme/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | __version__ = '0.0.1' 5 | 6 | -------------------------------------------------------------------------------- /bdtheme/public/images/boxed-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/boxed-bg.jpg -------------------------------------------------------------------------------- /bdtheme/public/images/boxed-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/boxed-bg.png -------------------------------------------------------------------------------- /bdtheme/public/images/bp-ico-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/bp-ico-32.png -------------------------------------------------------------------------------- /bdtheme/public/images/bp-ico-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/bp-ico-192.png -------------------------------------------------------------------------------- /bdtheme/public/images/logo_bdoop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/logo_bdoop.png -------------------------------------------------------------------------------- /bdtheme/public/images/default-50x50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinhnguyent090/bdtheme/HEAD/bdtheme/public/images/default-50x50.gif -------------------------------------------------------------------------------- /bdtheme/config/desktop.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | from frappe import _ 4 | 5 | def get_data(): 6 | return [ 7 | { 8 | "module_name": "bd theme", 9 | "color": "grey", 10 | "icon": "octicon octicon-file-directory", 11 | "type": "module", 12 | "label": _("bd theme") 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /bdtheme/config/docs.py: -------------------------------------------------------------------------------- 1 | """ 2 | Configuration for docs 3 | """ 4 | 5 | # source_link = "https://github.com/[org_name]/bdtheme" 6 | # docs_base_url = "https://[org_name].github.io/bdtheme" 7 | # headline = "App that does everything" 8 | # sub_heading = "Yes, you got that right the first time, everything" 9 | 10 | def get_context(context): 11 | context.brand_html = "bd theme" 12 | -------------------------------------------------------------------------------- /bdtheme/public/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "css/bdtheme.min.css": [ 3 | "public/css/bdtheme.css", 4 | "public/css/skin-blue.css", 5 | "public/css/custom.css", 6 | "public/css/temp.css" 7 | ], 8 | "js/bdtheme.min.js": [ 9 | "public/js/bdtheme.js", 10 | "public/js/custom.js" 11 | ], 12 | "js/bdtheme-template.min.js": [ 13 | "public/js/template/main-sidebar.html" 14 | ] 15 | 16 | } -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include MANIFEST.in 2 | include requirements.txt 3 | include *.json 4 | include *.md 5 | include *.py 6 | include *.txt 7 | recursive-include bdtheme *.css 8 | recursive-include bdtheme *.csv 9 | recursive-include bdtheme *.html 10 | recursive-include bdtheme *.ico 11 | recursive-include bdtheme *.js 12 | recursive-include bdtheme *.json 13 | recursive-include bdtheme *.md 14 | recursive-include bdtheme *.png 15 | recursive-include bdtheme *.py 16 | recursive-include bdtheme *.svg 17 | recursive-include bdtheme *.txt 18 | recursive-exclude bdtheme *.pyc -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from setuptools import setup, find_packages 4 | import re, ast 5 | 6 | with open('requirements.txt') as f: 7 | install_requires = f.read().strip().split('\n') 8 | 9 | # get version from __version__ variable in bdtheme/__init__.py 10 | _version_re = re.compile(r'__version__\s+=\s+(.*)') 11 | 12 | with open('bdtheme/__init__.py', 'rb') as f: 13 | version = str(ast.literal_eval(_version_re.search( 14 | f.read().decode('utf-8')).group(1))) 15 | 16 | setup( 17 | name='bdtheme', 18 | version=version, 19 | description='bd theme', 20 | author='vinhbk2000', 21 | author_email='vinhbk2000@gmail.com', 22 | packages=find_packages(), 23 | zip_safe=False, 24 | include_package_data=True, 25 | install_requires=install_requires 26 | ) 27 | -------------------------------------------------------------------------------- /bdtheme/public/css/custom.css: -------------------------------------------------------------------------------- 1 | #page-desktop{ position: static} 2 | #body_div{ background: #FFFFFF} 3 | .main-section{ background: #222d32} 4 | .page-head{ position: static} 5 | .page-content{ margin-top:0} 6 | header .container{ width:100%; padding:0px 15px 0 0; min-height: 50px;} 7 | .navbar-brand{ padding: 0 15px 0 15px; line-height: 50px; height: 50px;} 8 | #navbar-breadcrumbs > li > a{ padding: 11px 15px 15px 0px} 9 | .navbar-form{ margin-top:10px;} 10 | .navbar .dropdown-toggle{padding:13px 15px} 11 | header .dropdown-help{display:none} 12 | .main-header .sidebar-toggle{text-decoration: none;} 13 | .page-container{margin-top:0;} 14 | /* 15 | .navbar-brand{height: 50px; line-height: 30px} 16 | .main-header .logo { height: 40px} 17 | .main-header .sidebar-toggle{ line-height: 40px;} 18 | .main-header .navbar{min-height: 40px;} 19 | */ 20 | #page-desktop{ background-color:#FFFFFF !important} 21 | .main-header .logo .logo-lg{ 22 | background: #367fa9 url(/assets/bdtheme/images/logo_bdoop.png) center no-repeat; 23 | background-size: auto 48px; 24 | text-indent:-99em; 25 | } 26 | .main-header .logo .logo-mini{ 27 | background: #367fa9 url(/assets/bdtheme/images/bp-ico-32.png) center no-repeat; 28 | background-size: auto 38px; 29 | text-indent:-99em; 30 | } 31 | .layout-side-section{ font-size: 13px;} 32 | .case-label{ color:#000; text-shadow:none; font-size: 95%; font-weight:normal} 33 | h6.uppercase, .h6.uppercase{ color: #666666;} 34 | .control-label, .grid-heading-row{ color: #666666;} 35 | 36 | @media (max-width: 767px) { 37 | .skin-blue .main-header .navbar .dropdown-menu li a { 38 | color: #333; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bdtheme/public/js/custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('header').prepend(frappe.render_template("logo")); 3 | $('header .navbar .container').prepend(frappe.render_template("sidebar-toggle")); 4 | $('.main-section').append(frappe.render_template("main-sidebar")); 5 | 6 | $('header').addClass('main-header'); 7 | $('header .navbar').removeClass('navbar-fixed-top'); 8 | $('body').addClass('skin-blue sidebar-mini sidebar-collapse'); 9 | $('#body_div').addClass('content-wrapper'); 10 | 11 | bdtheme.set_user_background(); 12 | 13 | }); 14 | 15 | frappe.provide("bdtheme"); 16 | 17 | // add toolbar icon 18 | $(document).bind('toolbar_setup', function() { 19 | frappe.app.name = "bdoop Erp"; 20 | $('.navbar-home').html(frappe._('Home')); 21 | 22 | }); 23 | 24 | bdtheme.set_user_background = function(src, selector, style){ 25 | if(!selector) selector = "#page-desktop"; 26 | if(!style) style = "Fill Screen"; 27 | if(src) { 28 | if (window.cordova && src.indexOf("http") === -1) { 29 | src = frappe.base_url + src; 30 | } 31 | var background = repl('background: url("%(src)s") center center;', {src: src}); 32 | } else { 33 | var background = "background-color: #FFFFFF;"; 34 | } 35 | 36 | frappe.dom.set_style(repl('%(selector)s { \ 37 | %(background)s \ 38 | %(style)s \ 39 | }', { 40 | selector:selector, 41 | background:background, 42 | style: "" 43 | })); 44 | } 45 | 46 | frappe.templates["logo"] = ''; 50 | 51 | frappe.templates["sidebar-toggle"] = '' 52 | + 'Toggle navigation' 53 | + ''; -------------------------------------------------------------------------------- /bdtheme/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | from . import __version__ as app_version 4 | 5 | app_name = "bdtheme" 6 | app_title = "bd theme" 7 | app_publisher = "vinhbk2000" 8 | app_description = "bd theme" 9 | app_icon = "octicon octicon-file-directory" 10 | app_color = "grey" 11 | app_email = "vinhbk2000@gmail.com" 12 | app_license = "MIT" 13 | 14 | # Includes in 15 | # ------------------ 16 | 17 | # include js, css files in header of desk.html 18 | app_include_css = [ 19 | "/assets/bdtheme/css/bdtheme.css", 20 | "/assets/bdtheme/css/skin-blue.css", 21 | "/assets/bdtheme/css/custom.css", 22 | "/assets/bdtheme/css/temp.css", 23 | ] 24 | app_include_js = [ 25 | "/assets/bdtheme/js/bdtheme.js", 26 | "/assets/bdtheme/js/custom.js", 27 | "/assets/js/bdtheme-template.min.js", 28 | ] 29 | 30 | # include js, css files in header of web template 31 | web_include_css = "/assets/bdtheme/css/bdtheme-web.css" 32 | # web_include_js = "/assets/bdtheme/js/bdtheme.js" 33 | 34 | # include js in page 35 | # page_js = {"page" : "public/js/file.js"} 36 | 37 | # include js in doctype views 38 | # doctype_js = {"doctype" : "public/js/doctype.js"} 39 | # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} 40 | # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} 41 | 42 | # Home Pages 43 | # ---------- 44 | 45 | # application home page (will override Website Settings) 46 | # home_page = "login" 47 | 48 | # website user home page (by Role) 49 | # role_home_page = { 50 | # "Role": "home_page" 51 | # } 52 | 53 | # Website user home page (by function) 54 | # get_website_user_home_page = "bdtheme.utils.get_home_page" 55 | 56 | # Generators 57 | # ---------- 58 | 59 | # automatically create page for each record of this doctype 60 | # website_generators = ["Web Page"] 61 | 62 | # Installation 63 | # ------------ 64 | 65 | # before_install = "bdtheme.install.before_install" 66 | # after_install = "bdtheme.install.after_install" 67 | 68 | # Desk Notifications 69 | # ------------------ 70 | # See frappe.core.notifications.get_notification_config 71 | 72 | # notification_config = "bdtheme.notifications.get_notification_config" 73 | 74 | # Permissions 75 | # ----------- 76 | # Permissions evaluated in scripted ways 77 | 78 | # permission_query_conditions = { 79 | # "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", 80 | # } 81 | # 82 | # has_permission = { 83 | # "Event": "frappe.desk.doctype.event.event.has_permission", 84 | # } 85 | 86 | # Document Events 87 | # --------------- 88 | # Hook on document methods and events 89 | 90 | # doc_events = { 91 | # "*": { 92 | # "on_update": "method", 93 | # "on_cancel": "method", 94 | # "on_trash": "method" 95 | # } 96 | # } 97 | 98 | # Scheduled Tasks 99 | # --------------- 100 | 101 | # scheduler_events = { 102 | # "all": [ 103 | # "bdtheme.tasks.all" 104 | # ], 105 | # "daily": [ 106 | # "bdtheme.tasks.daily" 107 | # ], 108 | # "hourly": [ 109 | # "bdtheme.tasks.hourly" 110 | # ], 111 | # "weekly": [ 112 | # "bdtheme.tasks.weekly" 113 | # ] 114 | # "monthly": [ 115 | # "bdtheme.tasks.monthly" 116 | # ] 117 | # } 118 | 119 | # Testing 120 | # ------- 121 | 122 | # before_tests = "bdtheme.install.before_tests" 123 | 124 | # Overriding Whitelisted Methods 125 | # ------------------------------ 126 | # 127 | # override_whitelisted_methods = { 128 | # "frappe.desk.doctype.event.event.get_events": "bdtheme.event.get_events" 129 | # } 130 | 131 | -------------------------------------------------------------------------------- /bdtheme/public/css/skin-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Skin: Blue 3 | * ---------- 4 | */ 5 | .skin-blue .main-header .navbar { 6 | background-color: #3c8dbc; 7 | } 8 | .skin-blue .main-header .navbar .nav > li > a { 9 | color: #ffffff; 10 | } 11 | .skin-blue .main-header .navbar .nav > li > a:hover, 12 | .skin-blue .main-header .navbar .nav > li > a:active, 13 | .skin-blue .main-header .navbar .nav > li > a:focus, 14 | .skin-blue .main-header .navbar .nav .open > a, 15 | .skin-blue .main-header .navbar .nav .open > a:hover, 16 | .skin-blue .main-header .navbar .nav .open > a:focus, 17 | .skin-blue .main-header .navbar .nav > .active > a { 18 | background: rgba(0, 0, 0, 0.1); 19 | color: #f6f6f6; 20 | } 21 | .skin-blue .main-header .navbar .sidebar-toggle { 22 | color: #ffffff; 23 | } 24 | .skin-blue .main-header .navbar .sidebar-toggle:hover { 25 | color: #f6f6f6; 26 | background: rgba(0, 0, 0, 0.1); 27 | } 28 | .skin-blue .main-header .navbar .sidebar-toggle { 29 | color: #fff; 30 | } 31 | .skin-blue .main-header .navbar .sidebar-toggle:hover { 32 | background-color: #367fa9; 33 | } 34 | @media (max-width: 767px) { 35 | .skin-blue .main-header .navbar .dropdown-menu li.divider { 36 | background-color: rgba(255, 255, 255, 0.1); 37 | } 38 | .skin-blue .main-header .navbar .dropdown-menu li a { 39 | color: #fff; 40 | } 41 | .skin-blue .main-header .navbar .dropdown-menu li a:hover { 42 | background: #367fa9; 43 | } 44 | } 45 | .skin-blue .main-header .logo { 46 | background-color: #367fa9; 47 | color: #ffffff; 48 | border-bottom: 0 solid transparent; 49 | } 50 | .skin-blue .main-header .logo:hover { 51 | background-color: #357ca5; 52 | } 53 | .skin-blue .main-header li.user-header { 54 | background-color: #3c8dbc; 55 | } 56 | .skin-blue .content-header { 57 | background: transparent; 58 | } 59 | .skin-blue .wrapper, 60 | .skin-blue .main-sidebar, 61 | .skin-blue .left-side { 62 | background-color: #222d32; 63 | } 64 | .skin-blue .user-panel > .info, 65 | .skin-blue .user-panel > .info > a { 66 | color: #fff; 67 | } 68 | .skin-blue .main-sidebar .sidebar-menu > li.header { 69 | color: #4b646f; 70 | background: #1a2226; 71 | } 72 | .skin-blue .main-sidebar .sidebar-menu > li > a { 73 | border-left: 3px solid transparent; 74 | } 75 | .skin-blue .main-sidebar .sidebar-menu > li:hover > a, 76 | .skin-blue .main-sidebar .sidebar-menu > li.active > a { 77 | color: #ffffff; 78 | background: #1e282c; 79 | border-left-color: #3c8dbc; 80 | } 81 | .skin-blue .main-sidebar .sidebar-menu > li > .treeview-menu { 82 | margin: 0 1px; 83 | background: #2c3b41; 84 | } 85 | .skin-blue .sidebar a { 86 | color: #b8c7ce; 87 | } 88 | .skin-blue .sidebar a:hover { 89 | text-decoration: none; 90 | } 91 | .skin-blue .treeview-menu > li > a { 92 | color: #8aa4af; 93 | } 94 | .skin-blue .treeview-menu > li.active > a, 95 | .skin-blue .treeview-menu > li > a:hover { 96 | color: #ffffff; 97 | } 98 | .skin-blue .sidebar-form { 99 | border-radius: 3px; 100 | border: 1px solid #374850; 101 | margin: 10px 10px; 102 | } 103 | .skin-blue .sidebar-form input[type="text"], 104 | .skin-blue .sidebar-form .btn { 105 | box-shadow: none; 106 | background-color: #374850; 107 | border: 1px solid transparent; 108 | height: 35px; 109 | } 110 | .skin-blue .sidebar-form input[type="text"] { 111 | color: #666; 112 | border-top-left-radius: 2px; 113 | border-top-right-radius: 0; 114 | border-bottom-right-radius: 0; 115 | border-bottom-left-radius: 2px; 116 | } 117 | .skin-blue .sidebar-form input[type="text"]:focus, 118 | .skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { 119 | background-color: #fff; 120 | color: #666; 121 | } 122 | .skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { 123 | border-left-color: #fff; 124 | } 125 | .skin-blue .sidebar-form .btn { 126 | color: #999; 127 | border-top-left-radius: 0; 128 | border-top-right-radius: 2px; 129 | border-bottom-right-radius: 2px; 130 | border-bottom-left-radius: 0; 131 | } 132 | .skin-blue.layout-top-nav .main-header > .logo { 133 | background-color: #3c8dbc; 134 | color: #ffffff; 135 | border-bottom: 0 solid transparent; 136 | } 137 | .skin-blue.layout-top-nav .main-header > .logo:hover { 138 | background-color: #3b8ab8; 139 | } 140 | -------------------------------------------------------------------------------- /bdtheme/public/js/template/main-sidebar.html: -------------------------------------------------------------------------------- 1 | 147 |
-------------------------------------------------------------------------------- /bdtheme/public/css/bdtheme.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Component: Main Header 3 | * ---------------------- 4 | */ 5 | .main-header { 6 | position: relative; 7 | max-height: 100px; 8 | z-index: 1030; 9 | } 10 | .main-header .navbar { 11 | -webkit-transition: margin-left 0.3s ease-in-out; 12 | -o-transition: margin-left 0.3s ease-in-out; 13 | transition: margin-left 0.3s ease-in-out; 14 | margin-bottom: 0; 15 | margin-left: 230px; 16 | border: none; 17 | min-height: 50px; 18 | border-radius: 0; 19 | } 20 | .layout-top-nav .main-header .navbar { 21 | margin-left: 0; 22 | } 23 | .main-header #navbar-search-input.form-control { 24 | background: rgba(255, 255, 255, 0.2); 25 | border-color: transparent; 26 | } 27 | .main-header #navbar-search-input.form-control:focus, 28 | .main-header #navbar-search-input.form-control:active { 29 | border-color: rgba(0, 0, 0, 0.1); 30 | background: rgba(255, 255, 255, 0.9); 31 | } 32 | .main-header #navbar-search-input.form-control::-moz-placeholder { 33 | color: #ccc; 34 | opacity: 1; 35 | } 36 | .main-header #navbar-search-input.form-control:-ms-input-placeholder { 37 | color: #ccc; 38 | } 39 | .main-header #navbar-search-input.form-control::-webkit-input-placeholder { 40 | color: #ccc; 41 | } 42 | .main-header .navbar-custom-menu, 43 | .main-header .navbar-right { 44 | float: right; 45 | } 46 | @media (max-width: 991px) { 47 | .main-header .navbar-custom-menu a, 48 | .main-header .navbar-right a { 49 | color: inherit; 50 | background: transparent; 51 | } 52 | } 53 | @media (max-width: 767px) { 54 | .main-header .navbar-right { 55 | float: none; 56 | } 57 | .navbar-collapse .main-header .navbar-right { 58 | margin: 7.5px -15px; 59 | } 60 | .main-header .navbar-right > li { 61 | color: inherit; 62 | border: 0; 63 | } 64 | } 65 | .main-header .sidebar-toggle { 66 | float: left; 67 | background-color: transparent; 68 | background-image: none; 69 | padding: 0 20px; 70 | font-family: fontAwesome; 71 | line-height:50px; 72 | margin-right:10px; 73 | } 74 | .main-header .sidebar-toggle:before { 75 | content: "\f0c9"; 76 | } 77 | .main-header .sidebar-toggle:hover { 78 | color: #fff; 79 | } 80 | .main-header .sidebar-toggle:focus, 81 | .main-header .sidebar-toggle:active { 82 | background: transparent; 83 | } 84 | .main-header .sidebar-toggle .icon-bar { 85 | display: none; 86 | } 87 | .main-header .navbar .nav > li.user > a > .fa, 88 | .main-header .navbar .nav > li.user > a > .glyphicon, 89 | .main-header .navbar .nav > li.user > a > .ion { 90 | margin-right: 5px; 91 | } 92 | .main-header .navbar .nav > li > a > .label { 93 | position: absolute; 94 | top: 9px; 95 | right: 7px; 96 | text-align: center; 97 | font-size: 9px; 98 | padding: 2px 3px; 99 | line-height: .9; 100 | } 101 | .main-header .logo { 102 | -webkit-transition: width 0.3s ease-in-out; 103 | -o-transition: width 0.3s ease-in-out; 104 | transition: width 0.3s ease-in-out; 105 | display: block; 106 | float: left; 107 | height: 50px; 108 | font-size: 20px; 109 | line-height: 50px; 110 | text-align: center; 111 | width: 230px; 112 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 113 | padding: 0 15px; 114 | font-weight: 300; 115 | overflow: hidden; 116 | } 117 | .main-header .logo .logo-lg { 118 | display: block; 119 | } 120 | .main-header .logo .logo-mini { 121 | display: none; 122 | } 123 | .main-header .navbar-brand { 124 | color: #fff; 125 | } 126 | .content-header { 127 | position: relative; 128 | padding: 15px 15px 0 15px; 129 | } 130 | .content-header > h1 { 131 | margin: 0; 132 | font-size: 24px; 133 | } 134 | .content-header > h1 > small { 135 | font-size: 15px; 136 | display: inline-block; 137 | padding-left: 4px; 138 | font-weight: 300; 139 | } 140 | .content-header > .breadcrumb { 141 | float: right; 142 | background: transparent; 143 | margin-top: 0; 144 | margin-bottom: 0; 145 | font-size: 12px; 146 | padding: 7px 5px; 147 | position: absolute; 148 | top: 15px; 149 | right: 10px; 150 | border-radius: 2px; 151 | } 152 | .content-header > .breadcrumb > li > a { 153 | color: #444; 154 | text-decoration: none; 155 | display: inline-block; 156 | } 157 | .content-header > .breadcrumb > li > a > .fa, 158 | .content-header > .breadcrumb > li > a > .glyphicon, 159 | .content-header > .breadcrumb > li > a > .ion { 160 | margin-right: 5px; 161 | } 162 | .content-header > .breadcrumb > li + li:before { 163 | content: '>\00a0'; 164 | } 165 | @media (max-width: 991px) { 166 | .content-header > .breadcrumb { 167 | position: relative; 168 | margin-top: 5px; 169 | top: 0; 170 | right: 0; 171 | float: none; 172 | background: #d2d6de; 173 | padding-left: 10px; 174 | } 175 | .content-header > .breadcrumb li:before { 176 | color: #97a0b3; 177 | } 178 | } 179 | .navbar-toggle { 180 | color: #fff; 181 | border: 0; 182 | margin: 0; 183 | padding: 15px 15px; 184 | } 185 | @media (max-width: 991px) { 186 | .navbar-custom-menu .navbar-nav > li { 187 | float: left; 188 | } 189 | .navbar-custom-menu .navbar-nav { 190 | margin: 0; 191 | float: left; 192 | } 193 | .navbar-custom-menu .navbar-nav > li > a { 194 | padding-top: 15px; 195 | padding-bottom: 15px; 196 | line-height: 20px; 197 | } 198 | } 199 | @media (max-width: 767px) { 200 | .main-header { 201 | position: relative; 202 | } 203 | .main-header .logo, 204 | .main-header .navbar { 205 | width: 100%; 206 | float: none; 207 | } 208 | .main-header .navbar { 209 | margin: 0; 210 | } 211 | .main-header .navbar-custom-menu { 212 | float: right; 213 | } 214 | } 215 | @media (max-width: 991px) { 216 | .navbar-collapse.pull-left { 217 | float: none !important; 218 | } 219 | .navbar-collapse.pull-left + .navbar-custom-menu { 220 | display: block; 221 | position: absolute; 222 | top: 0; 223 | right: 40px; 224 | } 225 | } 226 | /* 227 | * Component: Sidebar 228 | * ------------------ 229 | */ 230 | .main-sidebar,.left-side { 231 | position:absolute; 232 | top:0; 233 | left:0; 234 | padding-top:50px; 235 | min-height:100%; 236 | width:230px; 237 | z-index:810; 238 | -webkit-transition:-webkit-transform .3s ease-in-out,width .3s ease-in-out; 239 | -moz-transition:-moz-transform .3s ease-in-out,width .3s ease-in-out; 240 | -o-transition:-o-transform .3s ease-in-out,width .3s ease-in-out; 241 | transition:transform .3s ease-in-out,width .3s ease-in-out 242 | } 243 | @media (max-width:767px) { 244 | .main-sidebar,.left-side { 245 | padding-top:100px 246 | } 247 | } 248 | @media (max-width:767px) { 249 | .main-sidebar,.left-side { 250 | -webkit-transform:translate(-230px, 0); 251 | -ms-transform:translate(-230px, 0); 252 | -o-transform:translate(-230px, 0); 253 | transform:translate(-230px, 0) 254 | } 255 | } 256 | @media (min-width:768px) { 257 | .sidebar-collapse .main-sidebar,.sidebar-collapse .left-side { 258 | -webkit-transform:translate(-230px, 0); 259 | -ms-transform:translate(-230px, 0); 260 | -o-transform:translate(-230px, 0); 261 | transform:translate(-230px, 0) 262 | } 263 | } 264 | @media (max-width:767px) { 265 | .sidebar-open .main-sidebar,.sidebar-open .left-side { 266 | -webkit-transform:translate(0, 0); 267 | -ms-transform:translate(0, 0); 268 | -o-transform:translate(0, 0); 269 | transform:translate(0, 0) 270 | } 271 | } 272 | .sidebar { 273 | padding-bottom:10px 274 | } 275 | .sidebar-form input:focus { 276 | border-color:transparent 277 | } 278 | .user-panel { 279 | position:relative; 280 | width:100%; 281 | padding:10px; 282 | overflow:hidden 283 | } 284 | .user-panel:before,.user-panel:after { 285 | content:" "; 286 | display:table 287 | } 288 | .user-panel:after { 289 | clear:both 290 | } 291 | .user-panel>.image>img { 292 | width:100%; 293 | max-width:45px; 294 | height:auto 295 | } 296 | .user-panel>.info { 297 | padding:5px 5px 5px 15px; 298 | line-height:1; 299 | position:absolute; 300 | left:55px 301 | } 302 | .user-panel>.info>p { 303 | font-weight:600; 304 | margin-bottom:9px 305 | } 306 | .user-panel>.info>a { 307 | text-decoration:none; 308 | padding-right:5px; 309 | margin-top:3px; 310 | font-size:11px 311 | } 312 | .user-panel>.info>a>.fa,.user-panel>.info>a>.ion,.user-panel>.info>a>.glyphicon { 313 | margin-right:3px 314 | } 315 | .main-sidebar .sidebar-menu { 316 | list-style:none; 317 | margin:0; 318 | padding:0 319 | } 320 | .main-sidebar .sidebar-menu>li { 321 | position:relative; 322 | margin:0; 323 | padding:0 324 | } 325 | .main-sidebar .sidebar-menu>li>a { 326 | padding:12px 5px 12px 15px; 327 | display:block 328 | } 329 | .main-sidebar .sidebar-menu>li>a>.fa,.main-sidebar .sidebar-menu>li>a>.glyphicon,.main-sidebar .sidebar-menu>li>a>.ion { 330 | width:20px 331 | } 332 | .main-sidebar .sidebar-menu>li .label,.main-sidebar .sidebar-menu>li .badge { 333 | margin-right:5px 334 | } 335 | .main-sidebar .sidebar-menu>li .badge { 336 | margin-top:3px 337 | } 338 | .main-sidebar .sidebar-menu li.header { 339 | padding:10px 25px 10px 15px; 340 | font-size:12px 341 | } 342 | .main-sidebar .sidebar-menu li>a>.fa-angle-left,.main-sidebar .sidebar-menu li>a>.pull-right-container>.fa-angle-left { 343 | width:auto; 344 | height:auto; 345 | padding:0; 346 | margin-right:10px 347 | } 348 | .main-sidebar .sidebar-menu li.active>a>.fa-angle-left,.main-sidebar .sidebar-menu li.active>a>.pull-right-container>.fa-angle-left { 349 | -webkit-transform:rotate(-90deg); 350 | -ms-transform:rotate(-90deg); 351 | -o-transform:rotate(-90deg); 352 | transform:rotate(-90deg) 353 | } 354 | .main-sidebar .sidebar-menu li.active>.treeview-menu { 355 | display:block 356 | } 357 | .main-sidebar .sidebar-menu .treeview-menu { 358 | display:none; 359 | list-style:none; 360 | padding:0; 361 | margin:0; 362 | padding-left:5px 363 | } 364 | .main-sidebar .sidebar-menu .treeview-menu .treeview-menu { 365 | padding-left:20px 366 | } 367 | .main-sidebar .sidebar-menu .treeview-menu>li { 368 | margin:0 369 | } 370 | .main-sidebar .sidebar-menu .treeview-menu>li>a { 371 | padding:5px 5px 5px 15px; 372 | display:block; 373 | font-size:14px 374 | } 375 | .main-sidebar .sidebar-menu .treeview-menu>li>a>.fa,.main-sidebar .sidebar-menu .treeview-menu>li>a>.glyphicon,.main-sidebar .sidebar-menu .treeview-menu>li>a>.ion { 376 | width:20px 377 | } 378 | .main-sidebar .sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-left,.main-sidebar .sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-down,.main-sidebar .sidebar-menu .treeview-menu>li>a>.fa-angle-left,.main-sidebar .sidebar-menu .treeview-menu>li>a>.fa-angle-down { 379 | width:auto 380 | } 381 | /* 382 | * Component: Sidebar Mini 383 | */ 384 | @media (min-width:768px) { 385 | .sidebar-mini.sidebar-collapse .content-wrapper,.sidebar-mini.sidebar-collapse .right-side,.sidebar-mini.sidebar-collapse .main-footer { 386 | margin-left:50px !important; 387 | z-index:840 388 | } 389 | .sidebar-mini.sidebar-collapse .main-sidebar { 390 | -webkit-transform:translate(0, 0); 391 | -ms-transform:translate(0, 0); 392 | -o-transform:translate(0, 0); 393 | transform:translate(0, 0); 394 | width:50px !important; 395 | z-index:850 396 | } 397 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li { 398 | position:relative 399 | } 400 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>a { 401 | margin-right:0 402 | } 403 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>a>span { 404 | border-top-right-radius:4px 405 | } 406 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:not(.treeview)>a>span { 407 | border-bottom-right-radius:4px 408 | } 409 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>.treeview-menu { 410 | padding-top:5px; 411 | padding-bottom:5px; 412 | border-bottom-right-radius:4px 413 | } 414 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>a>span:not(.pull-right),.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>.treeview-menu { 415 | display:block !important; 416 | position:absolute; 417 | width:180px; 418 | left:50px 419 | } 420 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>a>span { 421 | top:0; 422 | margin-left:-3px; 423 | padding:12px 5px 12px 20px; 424 | background-color:inherit 425 | } 426 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>a>.pull-right-container { 427 | float:right; 428 | width:auto!important; 429 | left:200px!important; 430 | top:10px!important 431 | } 432 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>a>.pull-right-container>.label:not(:first-of-type) { 433 | display:none 434 | } 435 | .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li:hover>.treeview-menu { 436 | top:44px; 437 | margin-left:0 438 | } 439 | .sidebar-mini.sidebar-collapse .main-sidebar .user-panel>.info,.sidebar-mini.sidebar-collapse .sidebar-form,.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>a>span,.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>.treeview-menu,.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu>li>a>.pull-right,.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu li.header { 440 | display:none !important; 441 | -webkit-transform:translateZ(0) 442 | } 443 | .sidebar-mini.sidebar-collapse .main-header .logo { 444 | width:50px 445 | } 446 | .sidebar-mini.sidebar-collapse .main-header .logo>.logo-mini { 447 | display:block; 448 | margin-left:-15px; 449 | margin-right:-15px; 450 | font-size:18px 451 | } 452 | .sidebar-mini.sidebar-collapse .main-header .logo>.logo-lg { 453 | display:none 454 | } 455 | .sidebar-mini.sidebar-collapse .main-header .navbar { 456 | margin-left:50px 457 | } 458 | } 459 | .main-sidebar .sidebar-menu,.main-sidebar .user-panel,.main-sidebar .sidebar-menu>li.header { 460 | white-space:nowrap; 461 | overflow:hidden 462 | } 463 | .main-sidebar .sidebar-menu:hover { 464 | overflow:visible 465 | } 466 | .sidebar-form,.main-sidebar .sidebar-menu>li.header { 467 | overflow:hidden; 468 | text-overflow:clip 469 | } 470 | .main-sidebar .sidebar-menu li>a { 471 | position:relative 472 | } 473 | .main-sidebar .sidebar-menu li>a>.pull-right-container { 474 | position:absolute; 475 | right:10px; 476 | top:50%; 477 | margin-top:-7px 478 | } 479 | 480 | .overlay { 481 | /* full screen */ 482 | width: 100vw; 483 | height: 100vh; 484 | /* transparent black */ 485 | background: rgba(0, 0, 0, 0.8); 486 | position: fixed; 487 | top: 0; 488 | left: 0; 489 | display: none; 490 | /* middle layer, i.e. appears below the sidebar */ 491 | z-index: 9998; 492 | } 493 | 494 | -------------------------------------------------------------------------------- /bdtheme/public/js/bdtheme.js: -------------------------------------------------------------------------------- 1 | /*! AdminLTE app.js 2 | * ================ 3 | * Main JS application file for AdminLTE v2. This file 4 | * should be included in all pages. It controls some layout 5 | * options and implements exclusive AdminLTE plugins. 6 | * 7 | * @Author Almsaeed Studio 8 | * @Support 9 | * @Email 10 | * @version 2.3.7 11 | * @license MIT 12 | */ 13 | 14 | //Make sure jQuery has been loaded before app.js 15 | if (typeof jQuery === "undefined") { 16 | throw new Error("AdminLTE requires jQuery"); 17 | } 18 | 19 | /* AdminLTE 20 | * 21 | * @type Object 22 | * @description $.AdminLTE is the main object for the template's app. 23 | * It's used for implementing functions and options related 24 | * to the template. Keeping everything wrapped in an object 25 | * prevents conflict with other plugins and is a better 26 | * way to organize our code. 27 | */ 28 | $.AdminLTE = {}; 29 | 30 | /* -------------------- 31 | * - AdminLTE Options - 32 | * -------------------- 33 | * Modify these options to suit your implementation 34 | */ 35 | $.AdminLTE.options = { 36 | //Add slimscroll to navbar menus 37 | //This requires you to load the slimscroll plugin 38 | //in every page before app.js 39 | navbarMenuSlimscroll: true, 40 | navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar 41 | navbarMenuHeight: "200px", //The height of the inner menu 42 | //General animation speed for JS animated elements such as box collapse/expand and 43 | //sidebar treeview slide up/down. This options accepts an integer as milliseconds, 44 | //'fast', 'normal', or 'slow' 45 | animationSpeed: 500, 46 | //Sidebar push menu toggle button selector 47 | sidebarToggleSelector: "[data-toggle='offcanvas']", 48 | //Activate sidebar push menu 49 | sidebarPushMenu: true, 50 | //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) 51 | sidebarSlimScroll: true, 52 | //Enable sidebar expand on hover effect for sidebar mini 53 | //This option is forced to true if both the fixed layout and sidebar mini 54 | //are used together 55 | sidebarExpandOnHover: false, 56 | //BoxRefresh Plugin 57 | enableBoxRefresh: true, 58 | //Bootstrap.js tooltip 59 | enableBSToppltip: true, 60 | BSTooltipSelector: "[data-toggle='tooltip']", 61 | //Enable Fast Click. Fastclick.js creates a more 62 | //native touch experience with touch devices. If you 63 | //choose to enable the plugin, make sure you load the script 64 | //before AdminLTE's app.js 65 | enableFastclick: false, 66 | //Control Sidebar Options 67 | enableControlSidebar: true, 68 | controlSidebarOptions: { 69 | //Which button should trigger the open/close event 70 | toggleBtnSelector: "[data-toggle='control-sidebar']", 71 | //The sidebar selector 72 | selector: ".control-sidebar", 73 | //Enable slide over content 74 | slide: true 75 | }, 76 | //Box Widget Plugin. Enable this plugin 77 | //to allow boxes to be collapsed and/or removed 78 | enableBoxWidget: true, 79 | //Box Widget plugin options 80 | boxWidgetOptions: { 81 | boxWidgetIcons: { 82 | //Collapse icon 83 | collapse: 'fa-minus', 84 | //Open icon 85 | open: 'fa-plus', 86 | //Remove icon 87 | remove: 'fa-times' 88 | }, 89 | boxWidgetSelectors: { 90 | //Remove button selector 91 | remove: '[data-widget="remove"]', 92 | //Collapse button selector 93 | collapse: '[data-widget="collapse"]' 94 | } 95 | }, 96 | //Direct Chat plugin options 97 | directChat: { 98 | //Enable direct chat by default 99 | enable: true, 100 | //The button to open and close the chat contacts pane 101 | contactToggleSelector: '[data-widget="chat-pane-toggle"]' 102 | }, 103 | //Define the set of colors to use globally around the website 104 | colors: { 105 | lightBlue: "#3c8dbc", 106 | red: "#f56954", 107 | green: "#00a65a", 108 | aqua: "#00c0ef", 109 | yellow: "#f39c12", 110 | blue: "#0073b7", 111 | navy: "#001F3F", 112 | teal: "#39CCCC", 113 | olive: "#3D9970", 114 | lime: "#01FF70", 115 | orange: "#FF851B", 116 | fuchsia: "#F012BE", 117 | purple: "#8E24AA", 118 | maroon: "#D81B60", 119 | black: "#222222", 120 | gray: "#d2d6de" 121 | }, 122 | //The standard screen sizes that bootstrap uses. 123 | //If you change these in the variables.less file, change 124 | //them here too. 125 | screenSizes: { 126 | xs: 480, 127 | sm: 768, 128 | md: 992, 129 | lg: 1200 130 | } 131 | }; 132 | 133 | /* ------------------ 134 | * - Implementation - 135 | * ------------------ 136 | * The next block of code implements AdminLTE's 137 | * functions and plugins as specified by the 138 | * options above. 139 | */ 140 | $(function () { 141 | "use strict"; 142 | 143 | //Fix for IE page transitions 144 | $("body").removeClass("hold-transition"); 145 | 146 | //Extend options if external options exist 147 | if (typeof AdminLTEOptions !== "undefined") { 148 | $.extend(true, 149 | $.AdminLTE.options, 150 | AdminLTEOptions); 151 | } 152 | 153 | //Easy access to options 154 | var o = $.AdminLTE.options; 155 | 156 | //Set up the object 157 | _init(); 158 | 159 | //Activate the layout maker 160 | $.AdminLTE.layout.activate(); 161 | 162 | //Enable sidebar tree view controls 163 | $.AdminLTE.tree('.sidebar'); 164 | 165 | //Enable control sidebar 166 | if (o.enableControlSidebar) { 167 | $.AdminLTE.controlSidebar.activate(); 168 | } 169 | 170 | //Add slimscroll to navbar dropdown 171 | if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { 172 | $(".navbar .menu").slimscroll({ 173 | height: o.navbarMenuHeight, 174 | alwaysVisible: false, 175 | size: o.navbarMenuSlimscrollWidth 176 | }).css("width", "100%"); 177 | } 178 | 179 | //Activate sidebar push menu 180 | if (o.sidebarPushMenu) { 181 | $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); 182 | } 183 | 184 | //Activate Bootstrap tooltip 185 | if (o.enableBSToppltip) { 186 | $('body').tooltip({ 187 | selector: o.BSTooltipSelector 188 | }); 189 | } 190 | 191 | //Activate box widget 192 | if (o.enableBoxWidget) { 193 | $.AdminLTE.boxWidget.activate(); 194 | } 195 | 196 | //Activate fast click 197 | if (o.enableFastclick && typeof FastClick != 'undefined') { 198 | FastClick.attach(document.body); 199 | } 200 | 201 | //Activate direct chat widget 202 | if (o.directChat.enable) { 203 | $(document).on('click', o.directChat.contactToggleSelector, function () { 204 | var box = $(this).parents('.direct-chat').first(); 205 | box.toggleClass('direct-chat-contacts-open'); 206 | }); 207 | } 208 | 209 | /* 210 | * INITIALIZE BUTTON TOGGLE 211 | * ------------------------ 212 | */ 213 | $('.btn-group[data-toggle="btn-toggle"]').each(function () { 214 | var group = $(this); 215 | $(this).find(".btn").on('click', function (e) { 216 | group.find(".btn.active").removeClass("active"); 217 | $(this).addClass("active"); 218 | e.preventDefault(); 219 | }); 220 | 221 | }); 222 | }); 223 | 224 | /* ---------------------------------- 225 | * - Initialize the AdminLTE Object - 226 | * ---------------------------------- 227 | * All AdminLTE functions are implemented below. 228 | */ 229 | function _init() { 230 | 'use strict'; 231 | /* Layout 232 | * ====== 233 | * Fixes the layout height in case min-height fails. 234 | * 235 | * @type Object 236 | * @usage $.AdminLTE.layout.activate() 237 | * $.AdminLTE.layout.fix() 238 | * $.AdminLTE.layout.fixSidebar() 239 | */ 240 | $.AdminLTE.layout = { 241 | activate: function () { 242 | var _this = this; 243 | _this.fix(); 244 | _this.fixSidebar(); 245 | $(window, ".wrapper").resize(function () { 246 | _this.fix(); 247 | _this.fixSidebar(); 248 | }); 249 | }, 250 | fix: function () { 251 | //Get window height and the wrapper height 252 | var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); 253 | var window_height = $(window).height(); 254 | var sidebar_height = $(".sidebar").height(); 255 | //Set the min-height of the content and sidebar based on the 256 | //the height of the document. 257 | if ($("body").hasClass("fixed")) { 258 | $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); 259 | } else { 260 | var postSetWidth; 261 | if (window_height >= sidebar_height) { 262 | $(".content-wrapper, .right-side").css('min-height', window_height - neg); 263 | postSetWidth = window_height - neg; 264 | } else { 265 | $(".content-wrapper, .right-side").css('min-height', sidebar_height); 266 | postSetWidth = sidebar_height; 267 | } 268 | 269 | //Fix for the control sidebar height 270 | var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); 271 | if (typeof controlSidebar !== "undefined") { 272 | if (controlSidebar.height() > postSetWidth) 273 | $(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); 274 | } 275 | 276 | } 277 | }, 278 | fixSidebar: function () { 279 | //Make sure the body tag has the .fixed class 280 | if (!$("body").hasClass("fixed")) { 281 | if (typeof $.fn.slimScroll != 'undefined') { 282 | $(".sidebar").slimScroll({destroy: true}).height("auto"); 283 | } 284 | return; 285 | } else if (typeof $.fn.slimScroll == 'undefined' && window.console) { 286 | window.console.error("Error: the fixed layout requires the slimscroll plugin!"); 287 | } 288 | //Enable slimscroll for fixed layout 289 | if ($.AdminLTE.options.sidebarSlimScroll) { 290 | if (typeof $.fn.slimScroll != 'undefined') { 291 | //Destroy if it exists 292 | $(".sidebar").slimScroll({destroy: true}).height("auto"); 293 | //Add slimscroll 294 | $(".sidebar").slimscroll({ 295 | height: ($(window).height() - $(".main-header").height()) + "px", 296 | color: "rgba(0,0,0,0.2)", 297 | size: "3px" 298 | }); 299 | } 300 | } 301 | } 302 | }; 303 | 304 | /* PushMenu() 305 | * ========== 306 | * Adds the push menu functionality to the sidebar. 307 | * 308 | * @type Function 309 | * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") 310 | */ 311 | $.AdminLTE.pushMenu = { 312 | activate: function (toggleBtn) { 313 | //Get the screen sizes 314 | var screenSizes = $.AdminLTE.options.screenSizes; 315 | 316 | //Enable sidebar toggle 317 | $(document).on('click', toggleBtn, function (e) { 318 | e.preventDefault(); 319 | 320 | //Enable sidebar push menu 321 | if ($(window).width() > (screenSizes.sm - 1)) { 322 | if ($("body").hasClass('sidebar-collapse')) { 323 | $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); 324 | } else { 325 | $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); 326 | } 327 | } 328 | //Handle sidebar push menu for small screens 329 | else { 330 | if ($("body").hasClass('sidebar-open')) { 331 | $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); 332 | } else { 333 | $("body").addClass('sidebar-open').trigger('expanded.pushMenu'); 334 | } 335 | } 336 | }); 337 | /* 338 | $(".content-wrapper").click(function () { 339 | //Enable hide menu when clicking on the content-wrapper on small screens 340 | if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { 341 | $("body").removeClass('sidebar-open'); 342 | } 343 | }); 344 | */ 345 | 346 | $("#body_div").click(function () { 347 | //hide menu when clicking on the content-wrapper on small screens 348 | //Enable sidebar push menu 349 | if ($(window).width() > (screenSizes.sm - 1)) { 350 | if (!$("body").hasClass('sidebar-collapse')) { 351 | $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); 352 | } 353 | } 354 | //Handle sidebar push menu for small screens 355 | else { 356 | if ($("body").hasClass('sidebar-open')) { 357 | $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); 358 | } 359 | } 360 | }); 361 | 362 | //Enable expand on hover for sidebar mini 363 | if ($.AdminLTE.options.sidebarExpandOnHover 364 | || ($('body').hasClass('fixed') 365 | && $('body').hasClass('sidebar-mini'))) { 366 | this.expandOnHover(); 367 | } 368 | }, 369 | expandOnHover: function () { 370 | var _this = this; 371 | var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; 372 | //Expand sidebar on hover 373 | $('.main-sidebar').hover(function () { 374 | if ($('body').hasClass('sidebar-mini') 375 | && $("body").hasClass('sidebar-collapse') 376 | && $(window).width() > screenWidth) { 377 | _this.expand(); 378 | } 379 | }, function () { 380 | if ($('body').hasClass('sidebar-mini') 381 | && $('body').hasClass('sidebar-expanded-on-hover') 382 | && $(window).width() > screenWidth) { 383 | _this.collapse(); 384 | } 385 | }); 386 | }, 387 | expand: function () { 388 | $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); 389 | }, 390 | collapse: function () { 391 | if ($('body').hasClass('sidebar-expanded-on-hover')) { 392 | $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse'); 393 | } 394 | } 395 | }; 396 | 397 | /* Tree() 398 | * ====== 399 | * Converts the sidebar into a multilevel 400 | * tree view menu. 401 | * 402 | * @type Function 403 | * @Usage: $.AdminLTE.tree('.sidebar') 404 | */ 405 | $.AdminLTE.tree = function (menu) { 406 | var _this = this; 407 | var animationSpeed = $.AdminLTE.options.animationSpeed; 408 | $(document).off('click', menu + ' li a') 409 | .on('click', menu + ' li a', function (e) { 410 | //Get the clicked link and the next element 411 | var $this = $(this); 412 | var checkElement = $this.next(); 413 | 414 | //Check if the next element is a menu and is visible 415 | if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { 416 | //Close the menu 417 | checkElement.slideUp(animationSpeed, function () { 418 | checkElement.removeClass('menu-open'); 419 | //Fix the layout in case the sidebar stretches over the height of the window 420 | //_this.layout.fix(); 421 | }); 422 | checkElement.parent("li").removeClass("active"); 423 | } 424 | //If the menu is not visible 425 | else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { 426 | //Get the parent menu 427 | var parent = $this.parents('ul').first(); 428 | //Close all open menus within the parent 429 | var ul = parent.find('ul:visible').slideUp(animationSpeed); 430 | //Remove the menu-open class from the parent 431 | ul.removeClass('menu-open'); 432 | //Get the parent li 433 | var parent_li = $this.parent("li"); 434 | 435 | //Open the target menu and add the menu-open class 436 | checkElement.slideDown(animationSpeed, function () { 437 | //Add the class active to the parent li 438 | checkElement.addClass('menu-open'); 439 | parent.find('li.active').removeClass('active'); 440 | parent_li.addClass('active'); 441 | //Fix the layout in case the sidebar stretches over the height of the window 442 | _this.layout.fix(); 443 | }); 444 | } 445 | //if this isn't a link, prevent the page from being redirected 446 | if (checkElement.is('.treeview-menu')) { 447 | e.preventDefault(); 448 | } 449 | }); 450 | }; 451 | 452 | /* ControlSidebar 453 | * ============== 454 | * Adds functionality to the right sidebar 455 | * 456 | * @type Object 457 | * @usage $.AdminLTE.controlSidebar.activate(options) 458 | */ 459 | $.AdminLTE.controlSidebar = { 460 | //instantiate the object 461 | activate: function () { 462 | //Get the object 463 | var _this = this; 464 | //Update options 465 | var o = $.AdminLTE.options.controlSidebarOptions; 466 | //Get the sidebar 467 | var sidebar = $(o.selector); 468 | //The toggle button 469 | var btn = $(o.toggleBtnSelector); 470 | 471 | //Listen to the click event 472 | btn.on('click', function (e) { 473 | e.preventDefault(); 474 | //If the sidebar is not open 475 | if (!sidebar.hasClass('control-sidebar-open') 476 | && !$('body').hasClass('control-sidebar-open')) { 477 | //Open the sidebar 478 | _this.open(sidebar, o.slide); 479 | } else { 480 | _this.close(sidebar, o.slide); 481 | } 482 | }); 483 | 484 | //If the body has a boxed layout, fix the sidebar bg position 485 | var bg = $(".control-sidebar-bg"); 486 | _this._fix(bg); 487 | 488 | //If the body has a fixed layout, make the control sidebar fixed 489 | if ($('body').hasClass('fixed')) { 490 | _this._fixForFixed(sidebar); 491 | } else { 492 | //If the content height is less than the sidebar's height, force max height 493 | if ($('.content-wrapper, .right-side').height() < sidebar.height()) { 494 | _this._fixForContent(sidebar); 495 | } 496 | } 497 | }, 498 | //Open the control sidebar 499 | open: function (sidebar, slide) { 500 | //Slide over content 501 | if (slide) { 502 | sidebar.addClass('control-sidebar-open'); 503 | } else { 504 | //Push the content by adding the open class to the body instead 505 | //of the sidebar itself 506 | $('body').addClass('control-sidebar-open'); 507 | } 508 | }, 509 | //Close the control sidebar 510 | close: function (sidebar, slide) { 511 | if (slide) { 512 | sidebar.removeClass('control-sidebar-open'); 513 | } else { 514 | $('body').removeClass('control-sidebar-open'); 515 | } 516 | 517 | }, 518 | _fix: function (sidebar) { 519 | var _this = this; 520 | if ($("body").hasClass('layout-boxed')) { 521 | sidebar.css('position', 'absolute'); 522 | sidebar.height($(".wrapper").height()); 523 | if (_this.hasBindedResize) { 524 | return; 525 | } 526 | $(window).resize(function () { 527 | _this._fix(sidebar); 528 | }); 529 | _this.hasBindedResize = true; 530 | } else { 531 | sidebar.css({ 532 | 'position': 'fixed', 533 | 'height': 'auto' 534 | }); 535 | } 536 | }, 537 | _fixForFixed: function (sidebar) { 538 | sidebar.css({ 539 | 'position': 'fixed', 540 | 'max-height': '100%', 541 | 'overflow': 'auto', 542 | 'padding-bottom': '50px' 543 | }); 544 | }, 545 | _fixForContent: function (sidebar) { 546 | $(".content-wrapper, .right-side").css('min-height', sidebar.height()); 547 | } 548 | }; 549 | 550 | /* BoxWidget 551 | * ========= 552 | * BoxWidget is a plugin to handle collapsing and 553 | * removing boxes from the screen. 554 | * 555 | * @type Object 556 | * @usage $.AdminLTE.boxWidget.activate() 557 | * Set all your options in the main $.AdminLTE.options object 558 | */ 559 | $.AdminLTE.boxWidget = { 560 | selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors, 561 | icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons, 562 | animationSpeed: $.AdminLTE.options.animationSpeed, 563 | activate: function (_box) { 564 | var _this = this; 565 | if (!_box) { 566 | _box = document; // activate all boxes per default 567 | } 568 | //Listen for collapse event triggers 569 | $(_box).on('click', _this.selectors.collapse, function (e) { 570 | e.preventDefault(); 571 | _this.collapse($(this)); 572 | }); 573 | 574 | //Listen for remove event triggers 575 | $(_box).on('click', _this.selectors.remove, function (e) { 576 | e.preventDefault(); 577 | _this.remove($(this)); 578 | }); 579 | }, 580 | collapse: function (element) { 581 | var _this = this; 582 | //Find the box parent 583 | var box = element.parents(".box").first(); 584 | //Find the body and the footer 585 | var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); 586 | if (!box.hasClass("collapsed-box")) { 587 | //Convert minus into plus 588 | element.children(":first") 589 | .removeClass(_this.icons.collapse) 590 | .addClass(_this.icons.open); 591 | //Hide the content 592 | box_content.slideUp(_this.animationSpeed, function () { 593 | box.addClass("collapsed-box"); 594 | }); 595 | } else { 596 | //Convert plus into minus 597 | element.children(":first") 598 | .removeClass(_this.icons.open) 599 | .addClass(_this.icons.collapse); 600 | //Show the content 601 | box_content.slideDown(_this.animationSpeed, function () { 602 | box.removeClass("collapsed-box"); 603 | }); 604 | } 605 | }, 606 | remove: function (element) { 607 | //Find the box parent 608 | var box = element.parents(".box").first(); 609 | box.slideUp(this.animationSpeed); 610 | } 611 | }; 612 | } 613 | 614 | /* ------------------ 615 | * - Custom Plugins - 616 | * ------------------ 617 | * All custom plugins are defined below. 618 | */ 619 | 620 | /* 621 | * BOX REFRESH BUTTON 622 | * ------------------ 623 | * This is a custom plugin to use with the component BOX. It allows you to add 624 | * a refresh button to the box. It converts the box's state to a loading state. 625 | * 626 | * @type plugin 627 | * @usage $("#box-widget").boxRefresh( options ); 628 | */ 629 | (function ($) { 630 | 631 | "use strict"; 632 | 633 | $.fn.boxRefresh = function (options) { 634 | 635 | // Render options 636 | var settings = $.extend({ 637 | //Refresh button selector 638 | trigger: ".refresh-btn", 639 | //File source to be loaded (e.g: ajax/src.php) 640 | source: "", 641 | //Callbacks 642 | onLoadStart: function (box) { 643 | return box; 644 | }, //Right after the button has been clicked 645 | onLoadDone: function (box) { 646 | return box; 647 | } //When the source has been loaded 648 | 649 | }, options); 650 | 651 | //The overlay 652 | var overlay = $('
'); 653 | 654 | return this.each(function () { 655 | //if a source is specified 656 | if (settings.source === "") { 657 | if (window.console) { 658 | window.console.log("Please specify a source first - boxRefresh()"); 659 | } 660 | return; 661 | } 662 | //the box 663 | var box = $(this); 664 | //the button 665 | var rBtn = box.find(settings.trigger).first(); 666 | 667 | //On trigger click 668 | rBtn.on('click', function (e) { 669 | e.preventDefault(); 670 | //Add loading overlay 671 | start(box); 672 | 673 | //Perform ajax call 674 | box.find(".box-body").load(settings.source, function () { 675 | done(box); 676 | }); 677 | }); 678 | }); 679 | 680 | function start(box) { 681 | //Add overlay and loading img 682 | box.append(overlay); 683 | 684 | settings.onLoadStart.call(box); 685 | } 686 | 687 | function done(box) { 688 | //Remove overlay and loading img 689 | box.find(overlay).remove(); 690 | 691 | settings.onLoadDone.call(box); 692 | } 693 | 694 | }; 695 | 696 | })(jQuery); 697 | 698 | /* 699 | * EXPLICIT BOX CONTROLS 700 | * ----------------------- 701 | * This is a custom plugin to use with the component BOX. It allows you to activate 702 | * a box inserted in the DOM after the app.js was loaded, toggle and remove box. 703 | * 704 | * @type plugin 705 | * @usage $("#box-widget").activateBox(); 706 | * @usage $("#box-widget").toggleBox(); 707 | * @usage $("#box-widget").removeBox(); 708 | */ 709 | (function ($) { 710 | 711 | 'use strict'; 712 | 713 | $.fn.activateBox = function () { 714 | $.AdminLTE.boxWidget.activate(this); 715 | }; 716 | 717 | $.fn.toggleBox = function () { 718 | var button = $($.AdminLTE.boxWidget.selectors.collapse, this); 719 | $.AdminLTE.boxWidget.collapse(button); 720 | }; 721 | 722 | $.fn.removeBox = function () { 723 | var button = $($.AdminLTE.boxWidget.selectors.remove, this); 724 | $.AdminLTE.boxWidget.remove(button); 725 | }; 726 | 727 | })(jQuery); 728 | 729 | /* 730 | * TODO LIST CUSTOM PLUGIN 731 | * ----------------------- 732 | * This plugin depends on iCheck plugin for checkbox and radio inputs 733 | * 734 | * @type plugin 735 | * @usage $("#todo-widget").todolist( options ); 736 | */ 737 | (function ($) { 738 | 739 | 'use strict'; 740 | 741 | $.fn.todolist = function (options) { 742 | // Render options 743 | var settings = $.extend({ 744 | //When the user checks the input 745 | onCheck: function (ele) { 746 | return ele; 747 | }, 748 | //When the user unchecks the input 749 | onUncheck: function (ele) { 750 | return ele; 751 | } 752 | }, options); 753 | 754 | return this.each(function () { 755 | 756 | if (typeof $.fn.iCheck != 'undefined') { 757 | $('input', this).on('ifChecked', function () { 758 | var ele = $(this).parents("li").first(); 759 | ele.toggleClass("done"); 760 | settings.onCheck.call(ele); 761 | }); 762 | 763 | $('input', this).on('ifUnchecked', function () { 764 | var ele = $(this).parents("li").first(); 765 | ele.toggleClass("done"); 766 | settings.onUncheck.call(ele); 767 | }); 768 | } else { 769 | $('input', this).on('change', function () { 770 | var ele = $(this).parents("li").first(); 771 | ele.toggleClass("done"); 772 | if ($('input', ele).is(":checked")) { 773 | settings.onCheck.call(ele); 774 | } else { 775 | settings.onUncheck.call(ele); 776 | } 777 | }); 778 | } 779 | }); 780 | }; 781 | }(jQuery)); --------------------------------------------------------------------------------