dashstrap 0.2.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile +0 -9
  4. data/Rakefile +0 -5
  5. data/app/assets/javascripts/dashstrap/application.js +5 -1
  6. data/app/assets/javascripts/dashstrap/modules/list-view.js +13 -3
  7. data/app/assets/javascripts/dashstrap/modules/modules.js +2 -2
  8. data/app/assets/stylesheets/dashstrap/dashboard/ltr/application.css +5 -1
  9. data/app/assets/stylesheets/dashstrap/dashboard/rtl/application.css +5 -1
  10. data/app/assets/stylesheets/dashstrap/dashboard/share.scss +1 -1
  11. data/app/assets/stylesheets/dashstrap/ltr/application.css +3 -3
  12. data/app/assets/stylesheets/dashstrap/rtl/application.css +4 -3
  13. data/app/assets/stylesheets/dashstrap/share.scss +39 -1
  14. data/app/assets/stylesheets/dashstrap/variables.scss +5 -0
  15. data/app/views/angular/auth/groups/index.html.slim +1 -3
  16. data/app/views/angular/auth/groups/new.html.slim +12 -0
  17. data/app/views/angular/auth/users/index.html.slim +2 -0
  18. data/app/views/angular/list-view/index.html +12 -11
  19. data/app/views/dashstrap/shared/_content_header.html.slim +14 -0
  20. data/app/views/dashstrap/shared/_header.html.erb +273 -0
  21. data/app/views/dashstrap/shared/_sidebar.html.erb +62 -0
  22. data/app/views/faalis/dashboard/index.html.erb +0 -44
  23. data/app/views/faalis/dashboard/not_found.html.slim +9 -0
  24. data/app/views/faalis/dashboard/not_found.js.erb +1 -0
  25. data/app/views/layouts/faalis/dashboard.html.erb +48 -24
  26. data/config/initializers/assets.rb +1 -0
  27. data/dashstrap.gemspec +4 -5
  28. data/lib/dashstrap/engine.rb +3 -17
  29. data/lib/dashstrap/version.rb +1 -1
  30. data/lib/generators/templates/js/list_view/index.html.erb +1 -1
  31. data/lib/generators/templates/js/list_view/partials/index_controller.js.erb +9 -5
  32. data/vendor/assets/fonts/Lato-Bold.woff +0 -0
  33. data/vendor/assets/fonts/Lato-Bold.woff2 +0 -0
  34. data/vendor/assets/fonts/Lato-Light.woff +0 -0
  35. data/vendor/assets/fonts/Lato-Light.woff2 +0 -0
  36. data/vendor/assets/fonts/Lato-Regular.woff +0 -0
  37. data/vendor/assets/fonts/Lato-Regular.woff2 +0 -0
  38. data/vendor/assets/images/avatar.jpg +0 -0
  39. data/vendor/assets/javascripts/AdminLTE/app.js +929 -593
  40. data/vendor/assets/javascripts/AdminLTE/dashboard.js +11 -12
  41. data/vendor/assets/javascripts/bootstrap-datepicker.js +2286 -0
  42. data/vendor/assets/javascripts/rtl/bootstrap-datepicker.fa.js +245 -0
  43. data/vendor/assets/stylesheets/AdminLTE.css +3 -5
  44. data/vendor/assets/stylesheets/daterangepicker.css +337 -0
  45. data/vendor/assets/stylesheets/fonts.css.erb +20 -0
  46. metadata +33 -30
  47. data/app/views/angular/auth/users/index.html +0 -6
  48. data/vendor/assets/javascripts/ui-bootstrap.js +0 -3799
@@ -0,0 +1,62 @@
1
+ <aside class="left-side sidebar-offcanvas">
2
+
3
+
4
+ <!-- Left side column. contains the logo and sidebar -->
5
+ <!-- sidebar: style can be found in sidebar.less -->
6
+ <section class="sidebar">
7
+ <!-- Sidebar user panel -->
8
+ <div class="user-panel">
9
+ <div class="pull-left image">
10
+ <img src="<%= asset_path 'avatar.jpg' %>" class="img-circle" alt="User Image" />
11
+ </div>
12
+ <div class="pull-left info">
13
+ <p><%= _("Hello ") %>, <%= current_user.name %> </p>
14
+
15
+ <a href="#"><i class="fa fa-circle text-success"></i> <span Translate>Online</span></a>
16
+ </div>
17
+ </div>
18
+ <!-- search form -->
19
+ <form class="sidebar-form">
20
+ <div class="input-group">
21
+ <input type="text" name="q" class="form-control" placeholder="<%= _("Search...") %>"/>
22
+ <span class="input-group-btn">
23
+ <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
24
+ </span>
25
+ </div>
26
+ </form>
27
+
28
+ <!-- /.search form -->
29
+ <!-- sidebar menu: : style can be found in sidebar.less -->
30
+ <ul class="sidebar-menu" >
31
+ <li class="active">
32
+ <a href="/<%= Faalis::Engine.dashboard_namespace.to_s %>/">
33
+ <i class="fa fa-dashboard"></i><%= _('Dashboard') %></span>
34
+ </a>
35
+ </li>
36
+ <% cache @sidebar do %>
37
+ <% @sidebar.menu_entries.each do |menu| %>
38
+ <li class="treeview point">
39
+ <a href="#">
40
+ <i class="<%= menu.icon %>"></i> <span><%= menu.title %></span>
41
+ <i class="fa fa-angle-left pull-right"></i>
42
+ </a>
43
+
44
+ <% unless menu.children.nil? %>
45
+ <ul class="treeview-menu slide">
46
+ <% menu.children.each do |submenu| %>
47
+ <li>
48
+ <a href="<%= submenu.url %>">
49
+ <i class="<%= submenu.icon %>"></i>
50
+ <span><%= submenu.title %></span>
51
+ </a>
52
+ </li>
53
+ <% end %>
54
+ </ul>
55
+ <% end %>
56
+ </li>
57
+ <% end %>
58
+ <% end %>
59
+ </ul>
60
+ </section>
61
+ <!-- /.sidebar -->
62
+ </aside>
@@ -1,44 +0,0 @@
1
- <header class="header" ng-include="'<%= @jstemplates_path %>/nav.html'">
2
- </header>
3
- <div class="wrapper row-offcanvas row-offcanvas-left">
4
- <aside class="left-side sidebar-offcanvas" ng-include="'<%= @jstemplates_path %>/modules.html'">
5
- </aside>
6
-
7
- <!-- Right side column. Contains the navbar and content of the page -->
8
- <aside class="right-side">
9
- <!-- Content Header (Page header) -->
10
- <section class="content-header">
11
- <h1>
12
- <span>{{ section_name || 'Dashboard' | translate }}</span>
13
- <small>{{ section_slug || '<%= Faalis::Engine.try(:slug) %>' || 'SLUG' }}</small>
14
- </h1>
15
- <ol class="breadcrumb">
16
- <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
17
- <li class="active"></li>
18
- </ol>
19
- </section>
20
-
21
-
22
- <!-- Main content -->
23
- <section class="content">
24
-
25
- <div class="row">
26
- <div class="col-sm-12">
27
- <br />
28
- <div id="flash-alert" class="alert alert-danger alert-dismissable hide">
29
- <i id="flash-icon" class="fa"></i>
30
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
31
- <span id="flash-msg"></span>
32
- </div>
33
- </div>
34
- </div>
35
-
36
-
37
- <div ui-view>
38
- </div>
39
-
40
- </section><!-- /.content -->
41
-
42
- </aside><!-- /.right-side -->
43
-
44
- </div>
@@ -0,0 +1,9 @@
1
+ .error-page
2
+ h2.headline.text-yellow
3
+ |404
4
+ .error-content
5
+ h3
6
+ i.fa.fa-warning.text-yellow
7
+ = _('Oops! Page not found.')
8
+ p
9
+ = _('We could not find the page you were looking for.')
@@ -0,0 +1 @@
1
+ error_message("<%= _('We could not find the page you were looking for.') %>");
@@ -1,27 +1,51 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="<%= ::I18n.locale %>" dir="<%= Faalis::I18n.direction(I18n.locale) %>">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
6
- <title><%= Faalis::Engine.site_title %></title>
7
-
8
- <%= stylesheet_link_tag "dashboard/" + Faalis::I18n.direction(I18n.locale) + "/application", media: "all" %>
9
- <%= javascript_include_tag :modernizr %>
10
- <%= csrf_meta_tags %>
11
- <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
12
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
13
- <!--[if lt IE 9]>
14
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
15
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
16
- <![endif]-->
17
- </head>
18
- <body class="skin-blue" data-current-user="<%= current_user.to_json %>">
19
- <%= yield %>
20
-
21
- <%= javascript_include_tag Faalis::Engine.dashboard_js_manifest %>
22
-
23
- <%= javascript_include_tag "locales/#{::I18n.locale}" %>
24
-
25
- </body>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
6
+ <title><%= Faalis::Engine.site_title %></title>
7
+
8
+ <%= stylesheet_link_tag "dashboard/" + Faalis::I18n.direction(I18n.locale) + "/application", media: "all" %>
9
+ <%= javascript_include_tag :modernizr %>
10
+ <%= javascript_include_tag Faalis::Engine.dashboard_js_manifest %>
11
+
12
+ <%= csrf_meta_tags %>
13
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
14
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
15
+ <!--[if lt IE 9]>
16
+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
17
+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
18
+ <![endif]-->
19
+ </head>
20
+ <body class="skin-blue">
21
+
22
+ <%= render 'dashstrap/shared/header' %>
23
+ <div class="wrapper row-offcanvas row-offcanvas-left">
24
+
25
+ <%= render 'dashstrap/shared/sidebar' %>
26
+
27
+ <!-- Right side column. Contains the navbar and content of the page -->
28
+ <aside class="right-side">
29
+ <%= render 'dashstrap/shared/content_header' %>
30
+ <!-- Main content -->
31
+ <section class="content">
32
+
33
+ <div class="row">
34
+ <div class="col-sm-12">
35
+ <br />
36
+ <div id="flash-alert" class="alert alert-danger alert-dismissable hide">
37
+ <i id="flash-icon" class="fa"></i>
38
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
39
+ <span id="flash-msg"></span>
40
+ </div>
41
+ </div>
42
+ </div>
43
+
44
+ <%= yield %>
45
+ </section><!-- /.content -->
46
+ </aside><!-- /.right-side -->
47
+ </div>
48
+
49
+ <%= javascript_include_tag "locales/#{::I18n.locale}" %>
50
+ </body>
26
51
  </html>
27
- </head>
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( avatar.jpg )
data/dashstrap.gemspec CHANGED
@@ -18,18 +18,17 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_development_dependency 'bundler', '~> 1.5'
20
20
  spec.add_development_dependency 'rake'
21
- #spec.add_development_dependency '"fast_gettext"'
22
- spec.add_development_dependency 'gettext'
23
- spec.add_development_dependency 'ruby_parser'
24
- spec.add_development_dependency'gettext_i18n_rails'
25
21
 
26
22
  spec.add_dependency 'less-rails'
27
23
  spec.add_dependency 'railties'
28
- spec.add_dependency 'faalis'
24
+
29
25
  spec.add_dependency 'jquery-rails'
30
26
  spec.add_dependency 'font-awesome-rails'
31
27
  spec.add_dependency 'slim-rails'
32
28
  spec.add_dependency 'jquery-ui-rails'
29
+ spec.add_dependency 'rails-assets-jquery-knob'
30
+ spec.add_dependency 'rails-assets-bootstrap-daterangepicker'
31
+ spec.add_dependency 'rails-assets-jquery-sparkline'
33
32
  #spec.add_dependency 'rails-assets-angular-ui-bootstrap'
34
33
 
35
34
  spec.add_dependency 'select2-rails'
@@ -1,35 +1,21 @@
1
- require 'faalis/extension'
2
1
  require 'jquery-ui-rails'
3
2
  require 'font-awesome-rails'
4
3
  require 'select2-rails'
5
4
  require 'momentjs-rails'
6
5
  require 'bootstrap3-datetimepicker-rails'
7
-
6
+ require 'rails-assets-jquery-knob'
7
+ require 'rails-assets-bootstrap-daterangepicker'
8
+ require 'rails-assets-jquery-sparkline'
8
9
 
9
10
  module Dashstrap
10
11
  class TemplateEngine < ::Rails::Engine
11
12
 
12
- include Faalis::Extension::Base
13
-
14
13
  initializer 'dashboard.add_assets_for_precompile' do |app|
15
14
  Rails.application.config.assets.precompile += ['fontawesome-webfont.eot',
16
15
  'fontawesome-webfont.woff',
17
16
  'fontawesome-webfont.ttf',
18
17
  'fontawesome-webfont.svg']
19
18
  end
20
-
21
- def self.register_extension(name, klass)
22
- Faalis::Extension.extensions[name] = klass
23
- end
24
-
25
- def self.override_generator_templates(template_path)
26
- send(:define_singleton_method, 'generator_templates_path') do
27
- template_path
28
- end
29
- end
30
-
31
- register_extension 'dashstrap', self
32
- override_generator_templates File.expand_path('../../generators/templates', __FILE__)
33
19
  end
34
20
  end
35
21
 
@@ -1,3 +1,3 @@
1
1
  module Dashstrap
2
- VERSION = '0.2.3'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -85,6 +85,6 @@
85
85
 
86
86
 
87
87
  <div ui-view>
88
- <list-view buttons="buttons" tools="tools" model="'<% if model_specified? %><%= model %><% else %><%= resource %><% end %>'" objects="<%= resource.pluralize.underscore %>" title-attribute="'<%= resource_data["title-field"] || 'name' %>'" details-template="details_template" item-per-page="10" on_delete="on_delete" column_defs="columns" list-title="list_title">
88
+ <list-view buttons="buttons" tools_processor="tools" model="'<% if model_specified? %><%= model %><% else %><%= resource %><% end %>'" objects="<%= resource.pluralize.underscore %>" title-attribute="'<%= resource_data["title-field"] || 'name' %>'" details-template="details_template" item-per-page="10" on_delete="on_delete" column_defs="columns" list-title="list_title">
89
89
  </list-view>
90
90
  </div>
@@ -13,15 +13,19 @@
13
13
 
14
14
  $scope.list_title = '<%= resource %>';
15
15
 
16
- $scope.tools = [
17
- {
18
- url: function(object) {
16
+ $scope.tools = function(obj)
17
+ {
18
+ items = [
19
+ {
20
+ url: function(object) {
19
21
  return "#" + <% parents.each do |p| %>"/<%= p %>/" + $scope.<%= p %>_id + <% end %>"/<%= resource_url %>/" + object.id + "/edit";
20
22
  },
21
23
  text: _("Edit"),
22
24
  icon: 'fa fa-edit'
23
- }
24
- ];
25
+ }
26
+ ];
27
+ return items;
28
+ };
25
29
 
26
30
  <% unless no_filter? %>$scope.filter_config = {
27
31
  list: <% if parent? %>API.<% parents.each do |parent| %>one("<%= parent %>", $scope.<%= parent %>_id)<% end %>.all("<%= resource.pluralize.underscore %>")<% else %>API.all("<%= resource.pluralize.underscore %>")<% end %>
Binary file
Binary file
Binary file
Binary file
@@ -12,130 +12,466 @@
12
12
  var left_side_width = 220; //Sidebar width in pixels
13
13
 
14
14
  $(function() {
15
- "use strict";
16
-
17
- //Add hover support for touch devices
18
- $('.btn').bind('touchstart', function() {
19
- $(this).addClass('hover');
20
- }).bind('touchend', function() {
21
- $(this).removeClass('hover');
22
- });
23
-
24
- //Activate tooltips
25
- $("[data-toggle='tooltip']").tooltip();
26
-
27
- /*
28
- * Add collapse and remove events to boxes
29
- */
30
- $("[data-widget='collapse']").click(function() {
31
- //Find the box parent
32
- var box = $(this).parents(".box").first();
33
- //Find the body and the footer
34
- var bf = box.find(".box-body, .box-footer");
35
- if (!box.hasClass("collapsed-box")) {
36
- box.addClass("collapsed-box");
37
- //Convert minus into plus
38
- $(this).children(".fa-minus").removeClass("fa-minus").addClass("fa-plus");
39
- bf.slideUp();
40
- } else {
41
- box.removeClass("collapsed-box");
42
- //Convert plus into minus
43
- $(this).children(".fa-plus").removeClass("fa-plus").addClass("fa-minus");
44
- bf.slideDown();
45
- }
46
- });
47
-
48
- /*
49
- * ADD SLIMSCROLL TO THE TOP NAV DROPDOWNS
50
- * ---------------------------------------
51
- */
52
- $(".navbar .menu").slimscroll({
53
- height: "200px",
54
- alwaysVisible: false,
55
- size: "3px"
56
- }).css("width", "100%");
57
-
58
- /*
59
- * INITIALIZE BUTTON TOGGLE
60
- * ------------------------
61
- */
62
- $('.btn-group[data-toggle="btn-toggle"]').each(function() {
63
- var group = $(this);
64
- $(this).find(".btn").click(function(e) {
65
- group.find(".btn.active").removeClass("active");
66
- $(this).addClass("active");
67
- e.preventDefault();
15
+ "use strict";
16
+
17
+ //Enable sidebar toggle
18
+ $("[data-toggle='offcanvas']").click(function(e) {
19
+ e.preventDefault();
20
+
21
+ //If window is small enough, enable sidebar push menu
22
+ if ($(window).width() <= 992) {
23
+ $('.row-offcanvas').toggleClass('active');
24
+ $('.left-side').removeClass("collapse-left");
25
+ $(".right-side").removeClass("strech");
26
+ $('.row-offcanvas').toggleClass("relative");
27
+ } else {
28
+ //Else, enable content streching
29
+ $('.left-side').toggleClass("collapse-left");
30
+ $(".right-side").toggleClass("strech");
31
+ }
32
+ });
33
+
34
+ //Add hover support for touch devices
35
+ $('.btn').bind('touchstart', function() {
36
+ $(this).addClass('hover');
37
+ }).bind('touchend', function() {
38
+ $(this).removeClass('hover');
39
+ });
40
+
41
+ //Activate tooltips
42
+ $("[data-toggle='tooltip']").tooltip();
43
+
44
+ /*
45
+ * Add collapse and remove events to boxes
46
+ */
47
+ $("[data-widget='collapse']").click(function() {
48
+ //Find the box parent
49
+ var box = $(this).parents(".box").first();
50
+ //Find the body and the footer
51
+ var bf = box.find(".box-body, .box-footer");
52
+ if (!box.hasClass("collapsed-box")) {
53
+ box.addClass("collapsed-box");
54
+ //Convert minus into plus
55
+ $(this).children(".fa-minus").removeClass("fa-minus").addClass("fa-plus");
56
+ bf.slideUp();
57
+ } else {
58
+ box.removeClass("collapsed-box");
59
+ //Convert plus into minus
60
+ $(this).children(".fa-plus").removeClass("fa-plus").addClass("fa-minus");
61
+ bf.slideDown();
62
+ }
68
63
  });
69
64
 
70
- });
71
-
72
- $("[data-widget='remove']").click(function() {
73
- //Find the box parent
74
- var box = $(this).parents(".box").first();
75
- box.slideUp();
76
- });
77
-
78
- /* Sidebar tree view */
79
- $(".sidebar .treeview").tree();
80
-
81
- /*
82
- * Make sure that the sidebar is streched full height
83
- * ---------------------------------------------
84
- * We are gonna assign a min-height value every time the
85
- * wrapper gets resized and upon page load. We will use
86
- * Ben Alman's method for detecting the resize event.
87
- *
88
- **/
89
- function _fix() {
90
- //Get window height and the wrapper height
91
- var height = $(window).height() - $("body > .header").height() - ($("body > .footer").outerHeight() || 0);
92
- $(".wrapper").css("min-height", height + "px");
93
- var content = $(".wrapper").height();
94
- //If the wrapper height is greater than the window
95
- if (content > height)
96
- //then set sidebar height to the wrapper
97
- $(".left-side, html, body").css("min-height", content + "px");
98
- else {
99
- //Otherwise, set the sidebar to the height of the window
100
- $(".left-side, html, body").css("min-height", height + "px");
65
+ /*
66
+ * ADD SLIMSCROLL TO THE TOP NAV DROPDOWNS
67
+ * ---------------------------------------
68
+ */
69
+ $(".navbar .menu").slimscroll({
70
+ height: "200px",
71
+ alwaysVisible: false,
72
+ size: "3px"
73
+ }).css("width", "100%");
74
+
75
+ /*
76
+ * INITIALIZE BUTTON TOGGLE
77
+ * ------------------------
78
+ */
79
+ $('.btn-group[data-toggle="btn-toggle"]').each(function() {
80
+ var group = $(this);
81
+ $(this).find(".btn").click(function(e) {
82
+ group.find(".btn.active").removeClass("active");
83
+ $(this).addClass("active");
84
+ e.preventDefault();
85
+ });
86
+
87
+ });
88
+
89
+ $("[data-widget='remove']").click(function() {
90
+ //Find the box parent
91
+ var box = $(this).parents(".box").first();
92
+ box.slideUp();
93
+ });
94
+
95
+ /* Sidebar tree view */
96
+ $(".sidebar .treeview").tree();
97
+
98
+ /*
99
+ * Make sure that the sidebar is streched full height
100
+ * ---------------------------------------------
101
+ * We are gonna assign a min-height value every time the
102
+ * wrapper gets resized and upon page load. We will use
103
+ * Ben Alman's method for detecting the resize event.
104
+ *
105
+ **/
106
+ function _fix() {
107
+ //Get window height and the wrapper height
108
+ var height = $(window).height() - $("body > .header").height() - ($("body > .footer").outerHeight() || 0);
109
+ $(".wrapper").css("min-height", height + "px");
110
+ var content = $(".wrapper").height();
111
+ //If the wrapper height is greater than the window
112
+ if (content > height)
113
+ //then set sidebar height to the wrapper
114
+ $(".left-side, html, body").css("min-height", content + "px");
115
+ else {
116
+ //Otherwise, set the sidebar to the height of the window
117
+ $(".left-side, html, body").css("min-height", height + "px");
118
+ }
101
119
  }
102
- }
103
- //Fire upon load
104
- _fix();
105
- //Fire when wrapper is resized
106
- $(".wrapper").resize(function() {
120
+ //Fire upon load
107
121
  _fix();
108
- fix_sidebar();
109
- });
122
+ //Fire when wrapper is resized
123
+ $(".wrapper").resize(function() {
124
+ _fix();
125
+ fix_sidebar();
126
+ });
110
127
 
111
- //Fix the fixed layout sidebar scroll bug
112
- fix_sidebar();
128
+ //Fix the fixed layout sidebar scroll bug
129
+ fix_sidebar();
113
130
 
114
- /*
115
- * We are gonna initialize all checkbox and radio inputs to
116
- * iCheck plugin in.
117
- * You can find the documentation at http://fronteed.com/iCheck/
118
- */
119
- $("input[type='checkbox']:not(.simple), input[type='radio']:not(.simple)").iCheck({
120
- checkboxClass: 'icheckbox_minimal',
121
- radioClass: 'iradio_minimal'
122
- });
131
+ /*
132
+ * We are gonna initialize all checkbox and radio inputs to
133
+ * ckck plugin in.
134
+ * You can find the documentation at http://fronteed.com/iCheck/
135
+ */
136
+ $("input[type='checkbox']:not(.simple), input[type='radio']:not(.simple)").iCheck({
137
+ checkboxClass: 'icheckbox_minimal',
138
+ radioClass: 'iradio_minimal'
139
+ });
123
140
 
124
141
  });
125
142
  function fix_sidebar() {
126
- //Make sure the body tag has the .fixed class
127
- if (!$("body").hasClass("fixed")) {
128
- return;
129
- }
130
-
131
- //Add slimscroll
132
- $(".sidebar").slimscroll({
133
- height: ($(window).height() - $(".header").height()) + "px",
134
- color: "rgba(0,0,0,0.2)"
135
- });
143
+ //Make sure the body tag has the .fixed class
144
+ if (!$("body").hasClass("fixed")) {
145
+ return;
146
+ }
147
+
148
+ //Add slimscroll
149
+ $(".sidebar").slimscroll({
150
+ height: ($(window).height() - $(".header").height()) + "px",
151
+ color: "rgba(0,0,0,0.2)"
152
+ });
136
153
  }
137
154
 
138
155
  /*END DEMO*/
156
+ $(window).load(function() {
157
+ /*! pace 0.4.17 */
158
+ (function() {
159
+ var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V = [].slice, W = {}.hasOwnProperty, X = function(a, b) {
160
+ function c() {
161
+ this.constructor = a
162
+ }
163
+ for (var d in b)
164
+ W.call(b, d) && (a[d] = b[d]);
165
+ return c.prototype = b.prototype, a.prototype = new c, a.__super__ = b.prototype, a
166
+ }, Y = [].indexOf || function(a) {
167
+ for (var b = 0, c = this.length; c > b; b++)
168
+ if (b in this && this[b] === a)
169
+ return b;
170
+ return-1
171
+ };
172
+ for (t = {catchupTime:500, initialRate:.03, minTime:500, ghostTime:500, maxProgressPerFrame:10, easeFactor:1.25, startOnPageLoad:!0, restartOnPushState:!0, restartOnRequestAfter:500, target:"body", elements:{checkInterval:100, selectors:["body"]}, eventLag:{minSamples:10, sampleCount:3, lagThreshold:3}, ajax:{trackMethods:["GET"], trackWebSockets:!1}}, B = function() {
173
+ var a;
174
+ return null != (a = "undefined" != typeof performance && null !== performance ? "function" == typeof performance.now ? performance.now() : void 0 : void 0) ? a : +new Date
175
+ }, D = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, s = window.cancelAnimationFrame || window.mozCancelAnimationFrame, null == D && (D = function(a) {
176
+ return setTimeout(a, 50)
177
+ }, s = function(a) {
178
+ return clearTimeout(a)
179
+ }), F = function(a) {
180
+ var b, c;
181
+ return b = B(), (c = function() {
182
+ var d;
183
+ return d = B() - b, d >= 33 ? (b = B(), a(d, function() {
184
+ return D(c)
185
+ })) : setTimeout(c, 33 - d)
186
+ })()
187
+ }, E = function() {
188
+ var a, b, c;
189
+ return c = arguments[0], b = arguments[1], a = 3 <= arguments.length ? V.call(arguments, 2) : [], "function" == typeof c[b] ? c[b].apply(c, a) : c[b]
190
+ }, u = function() {
191
+ var a, b, c, d, e, f, g;
192
+ for (b = arguments[0], d = 2 <= arguments.length?V.call(arguments, 1):[], f = 0, g = d.length; g > f; f++)
193
+ if (c = d[f])
194
+ for (a in c)
195
+ W.call(c, a) && (e = c[a], null != b[a] && "object" == typeof b[a] && null != e && "object" == typeof e ? u(b[a], e) : b[a] = e);
196
+ return b
197
+ }, p = function(a) {
198
+ var b, c, d, e, f;
199
+ for (c = b = 0, e = 0, f = a.length; f > e; e++)
200
+ d = a[e], c += Math.abs(d), b++;
201
+ return c / b
202
+ }, w = function(a, b) {
203
+ var c, d, e;
204
+ if (null == a && (a = "options"), null == b && (b = !0), e = document.querySelector("[data-pace-" + a + "]")) {
205
+ if (c = e.getAttribute("data-pace-" + a), !b)
206
+ return c;
207
+ try {
208
+ return JSON.parse(c)
209
+ } catch (f) {
210
+ return d = f, "undefined" != typeof console && null !== console ? console.error("Error parsing inline pace options", d) : void 0
211
+ }
212
+ }
213
+ }, g = function() {
214
+ function a() {
215
+ }
216
+ return a.prototype.on = function(a, b, c, d) {
217
+ var e;
218
+ return null == d && (d = !1), null == this.bindings && (this.bindings = {}), null == (e = this.bindings)[a] && (e[a] = []), this.bindings[a].push({handler: b, ctx: c, once: d})
219
+ }, a.prototype.once = function(a, b, c) {
220
+ return this.on(a, b, c, !0)
221
+ }, a.prototype.off = function(a, b) {
222
+ var c, d, e;
223
+ if (null != (null != (d = this.bindings) ? d[a] : void 0)) {
224
+ if (null == b)
225
+ return delete this.bindings[a];
226
+ for (c = 0, e = []; c < this.bindings[a].length; )
227
+ this.bindings[a][c].handler === b ? e.push(this.bindings[a].splice(c, 1)) : e.push(c++);
228
+ return e
229
+ }
230
+ }, a.prototype.trigger = function() {
231
+ var a, b, c, d, e, f, g, h, i;
232
+ if (c = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], null != (g = this.bindings) ? g[c] : void 0) {
233
+ for (e = 0, i = []; e < this.bindings[c].length; )
234
+ h = this.bindings[c][e], d = h.handler, b = h.ctx, f = h.once, d.apply(null != b ? b : this, a), f ? i.push(this.bindings[c].splice(e, 1)) : i.push(e++);
235
+ return i
236
+ }
237
+ }, a
238
+ }(), null == window.Pace && (window.Pace = {}), u(Pace, g.prototype), C = Pace.options = u({}, t, window.paceOptions, w()), S = ["ajax", "document", "eventLag", "elements"], O = 0, Q = S.length; Q > O; O++)
239
+ I = S[O], C[I] === !0 && (C[I] = t[I]);
240
+ i = function(a) {
241
+ function b() {
242
+ return T = b.__super__.constructor.apply(this, arguments)
243
+ }
244
+ return X(b, a), b
245
+ }(Error), b = function() {
246
+ function a() {
247
+ this.progress = 0
248
+ }
249
+ return a.prototype.getElement = function() {
250
+ var a;
251
+ if (null == this.el) {
252
+ if (a = document.querySelector(C.target), !a)
253
+ throw new i;
254
+ this.el = document.createElement("div"), this.el.className = "pace pace-active", document.body.className = document.body.className.replace("pace-done", ""), document.body.className += " pace-running", this.el.innerHTML = '<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>', null != a.firstChild ? a.insertBefore(this.el, a.firstChild) : a.appendChild(this.el)
255
+ }
256
+ return this.el
257
+ }, a.prototype.finish = function() {
258
+ var a;
259
+ return a = this.getElement(), a.className = a.className.replace("pace-active", ""), a.className += " pace-inactive", document.body.className = document.body.className.replace("pace-running", ""), document.body.className += " pace-done"
260
+ }, a.prototype.update = function(a) {
261
+ return this.progress = a, this.render()
262
+ }, a.prototype.destroy = function() {
263
+ try {
264
+ this.getElement().parentNode.removeChild(this.getElement())
265
+ } catch (a) {
266
+ i = a
267
+ }
268
+ return this.el = void 0
269
+ }, a.prototype.render = function() {
270
+ var a, b;
271
+ return null == document.querySelector(C.target) ? !1 : (a = this.getElement(), a.children[0].style.width = "" + this.progress + "%", (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) && (a.children[0].setAttribute("data-progress-text", "" + (0 | this.progress) + "%"), this.progress >= 100 ? b = "99" : (b = this.progress < 10 ? "0" : "", b += 0 | this.progress), a.children[0].setAttribute("data-progress", "" + b)), this.lastRenderedProgress = this.progress)
272
+ }, a.prototype.done = function() {
273
+ return this.progress >= 100
274
+ }, a
275
+ }(), h = function() {
276
+ function a() {
277
+ this.bindings = {}
278
+ }
279
+ return a.prototype.trigger = function(a, b) {
280
+ var c, d, e, f, g;
281
+ if (null != this.bindings[a]) {
282
+ for (f = this.bindings[a], g = [], d = 0, e = f.length; e > d; d++)
283
+ c = f[d], g.push(c.call(this, b));
284
+ return g
285
+ }
286
+ }, a.prototype.on = function(a, b) {
287
+ var c;
288
+ return null == (c = this.bindings)[a] && (c[a] = []), this.bindings[a].push(b)
289
+ }, a
290
+ }(), N = window.XMLHttpRequest, M = window.XDomainRequest, L = window.WebSocket, v = function(a, b) {
291
+ var c, d, e, f;
292
+ f = [];
293
+ for (d in b.prototype)
294
+ try {
295
+ e = b.prototype[d], null == a[d] && "function" != typeof e ? f.push(a[d] = e) : f.push(void 0)
296
+ } catch (g) {
297
+ c = g
298
+ }
299
+ return f
300
+ }, z = [], Pace.ignore = function() {
301
+ var a, b, c;
302
+ return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("ignore"), c = b.apply(null, a), z.shift(), c
303
+ }, Pace.track = function() {
304
+ var a, b, c;
305
+ return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("track"), c = b.apply(null, a), z.shift(), c
306
+ }, H = function(a) {
307
+ var b;
308
+ if (null == a && (a = "GET"), "track" === z[0])
309
+ return"force";
310
+ if (!z.length && C.ajax) {
311
+ if ("socket" === a && C.ajax.trackWebSockets)
312
+ return!0;
313
+ if (b = a.toUpperCase(), Y.call(C.ajax.trackMethods, b) >= 0)
314
+ return!0
315
+ }
316
+ return!1
317
+ }, j = function(a) {
318
+ function b() {
319
+ var a, c = this;
320
+ b.__super__.constructor.apply(this, arguments), a = function(a) {
321
+ var b;
322
+ return b = a.open, a.open = function(d, e) {
323
+ return H(d) && c.trigger("request", {type: d, url: e, request: a}), b.apply(a, arguments)
324
+ }
325
+ }, window.XMLHttpRequest = function(b) {
326
+ var c;
327
+ return c = new N(b), a(c), c
328
+ }, v(window.XMLHttpRequest, N), null != M && (window.XDomainRequest = function() {
329
+ var b;
330
+ return b = new M, a(b), b
331
+ }, v(window.XDomainRequest, M)), null != L && C.ajax.trackWebSockets && (window.WebSocket = function(a, b) {
332
+ var d;
333
+ return d = new L(a, b), H("socket") && c.trigger("request", {type: "socket", url: a, protocols: b, request: d}), d
334
+ }, v(window.WebSocket, L))
335
+ }
336
+ return X(b, a), b
337
+ }(h), P = null, x = function() {
338
+ return null == P && (P = new j), P
339
+ }, x().on("request", function(b) {
340
+ var c, d, e, f;
341
+ return f = b.type, e = b.request, Pace.running || C.restartOnRequestAfter === !1 && "force" !== H(f) ? void 0 : (d = arguments, c = C.restartOnRequestAfter || 0, "boolean" == typeof c && (c = 0), setTimeout(function() {
342
+ var b, c, g, h, i, j;
343
+ if (b = "socket" === f ? e.readyState < 2 : 0 < (h = e.readyState) && 4 > h) {
344
+ for (Pace.restart(), i = Pace.sources, j = [], c = 0, g = i.length; g > c; c++) {
345
+ if (I = i[c], I instanceof a) {
346
+ I.watch.apply(I, d);
347
+ break
348
+ }
349
+ j.push(void 0)
350
+ }
351
+ return j
352
+ }
353
+ }, c))
354
+ }), a = function() {
355
+ function a() {
356
+ var a = this;
357
+ this.elements = [], x().on("request", function() {
358
+ return a.watch.apply(a, arguments)
359
+ })
360
+ }
361
+ return a.prototype.watch = function(a) {
362
+ var b, c, d;
363
+ return d = a.type, b = a.request, c = "socket" === d ? new m(b) : new n(b), this.elements.push(c)
364
+ }, a
365
+ }(), n = function() {
366
+ function a(a) {
367
+ var b, c, d, e, f, g, h = this;
368
+ if (this.progress = 0, null != window.ProgressEvent)
369
+ for (c = null, a.addEventListener("progress", function(a) {
370
+ return h.progress = a.lengthComputable ? 100 * a.loaded / a.total : h.progress + (100 - h.progress) / 2
371
+ }), g = ["load", "abort", "timeout", "error"], d = 0, e = g.length; e > d; d++)
372
+ b = g[d], a.addEventListener(b, function() {
373
+ return h.progress = 100
374
+ });
375
+ else
376
+ f = a.onreadystatechange, a.onreadystatechange = function() {
377
+ var b;
378
+ return 0 === (b = a.readyState) || 4 === b ? h.progress = 100 : 3 === a.readyState && (h.progress = 50), "function" == typeof f ? f.apply(null, arguments) : void 0
379
+ }
380
+ }
381
+ return a
382
+ }(), m = function() {
383
+ function a(a) {
384
+ var b, c, d, e, f = this;
385
+ for (this.progress = 0, e = ["error", "open"], c = 0, d = e.length; d > c; c++)
386
+ b = e[c], a.addEventListener(b, function() {
387
+ return f.progress = 100
388
+ })
389
+ }
390
+ return a
391
+ }(), d = function() {
392
+ function a(a) {
393
+ var b, c, d, f;
394
+ for (null == a && (a = {}), this.elements = [], null == a.selectors && (a.selectors = []), f = a.selectors, c = 0, d = f.length; d > c; c++)
395
+ b = f[c], this.elements.push(new e(b))
396
+ }
397
+ return a
398
+ }(), e = function() {
399
+ function a(a) {
400
+ this.selector = a, this.progress = 0, this.check()
401
+ }
402
+ return a.prototype.check = function() {
403
+ var a = this;
404
+ return document.querySelector(this.selector) ? this.done() : setTimeout(function() {
405
+ return a.check()
406
+ }, C.elements.checkInterval)
407
+ }, a.prototype.done = function() {
408
+ return this.progress = 100
409
+ }, a
410
+ }(), c = function() {
411
+ function a() {
412
+ var a, b, c = this;
413
+ this.progress = null != (b = this.states[document.readyState]) ? b : 100, a = document.onreadystatechange, document.onreadystatechange = function() {
414
+ return null != c.states[document.readyState] && (c.progress = c.states[document.readyState]), "function" == typeof a ? a.apply(null, arguments) : void 0
415
+ }
416
+ }
417
+ return a.prototype.states = {loading: 0, interactive: 50, complete: 100}, a
418
+ }(), f = function() {
419
+ function a() {
420
+ var a, b, c, d, e, f = this;
421
+ this.progress = 0, a = 0, e = [], d = 0, c = B(), b = setInterval(function() {
422
+ var g;
423
+ return g = B() - c - 50, c = B(), e.push(g), e.length > C.eventLag.sampleCount && e.shift(), a = p(e), ++d >= C.eventLag.minSamples && a < C.eventLag.lagThreshold ? (f.progress = 100, clearInterval(b)) : f.progress = 100 * (3 / (a + 3))
424
+ }, 50)
425
+ }
426
+ return a
427
+ }(), l = function() {
428
+ function a(a) {
429
+ this.source = a, this.last = this.sinceLastUpdate = 0, this.rate = C.initialRate, this.catchup = 0, this.progress = this.lastProgress = 0, null != this.source && (this.progress = E(this.source, "progress"))
430
+ }
431
+ return a.prototype.tick = function(a, b) {
432
+ var c;
433
+ return null == b && (b = E(this.source, "progress")), b >= 100 && (this.done = !0), b === this.last ? this.sinceLastUpdate += a : (this.sinceLastUpdate && (this.rate = (b - this.last) / this.sinceLastUpdate), this.catchup = (b - this.progress) / C.catchupTime, this.sinceLastUpdate = 0, this.last = b), b > this.progress && (this.progress += this.catchup * a), c = 1 - Math.pow(this.progress / 100, C.easeFactor), this.progress += c * this.rate * a, this.progress = Math.min(this.lastProgress + C.maxProgressPerFrame, this.progress), this.progress = Math.max(0, this.progress), this.progress = Math.min(100, this.progress), this.lastProgress = this.progress, this.progress
434
+ }, a
435
+ }(), J = null, G = null, q = null, K = null, o = null, r = null, Pace.running = !1, y = function() {
436
+ return C.restartOnPushState ? Pace.restart() : void 0
437
+ }, null != window.history.pushState && (R = window.history.pushState, window.history.pushState = function() {
438
+ return y(), R.apply(window.history, arguments)
439
+ }), null != window.history.replaceState && (U = window.history.replaceState, window.history.replaceState = function() {
440
+ return y(), U.apply(window.history, arguments)
441
+ }), k = {ajax: a, elements: d, document: c, eventLag: f}, (A = function() {
442
+ var a, c, d, e, f, g, h, i;
443
+ for (Pace.sources = J = [], g = ["ajax", "elements", "document", "eventLag"], c = 0, e = g.length; e > c; c++)
444
+ a = g[c], C[a] !== !1 && J.push(new k[a](C[a]));
445
+ for (i = null != (h = C.extraSources)?h:[], d = 0, f = i.length; f > d; d++)
446
+ I = i[d], J.push(new I(C));
447
+ return Pace.bar = q = new b, G = [], K = new l
448
+ })(), Pace.stop = function() {
449
+ return Pace.trigger("stop"), Pace.running = !1, q.destroy(), r = !0, null != o && ("function" == typeof s && s(o), o = null), A()
450
+ }, Pace.restart = function() {
451
+ return Pace.trigger("restart"), Pace.stop(), Pace.start()
452
+ }, Pace.go = function() {
453
+ return Pace.running = !0, q.render(), r = !1, o = F(function(a, b) {
454
+ var c, d, e, f, g, h, i, j, k, m, n, o, p, s, t, u, v;
455
+ for (j = 100 - q.progress, d = o = 0, e = !0, h = p = 0, t = J.length; t > p; h = ++p)
456
+ for (I = J[h], m = null != G[h]?G[h]:G[h] = [], g = null != (v = I.elements)?v:[I], i = s = 0, u = g.length; u > s; i = ++s)
457
+ f = g[i], k = null != m[i] ? m[i] : m[i] = new l(f), e &= k.done, k.done || (d++, o += k.tick(a));
458
+ return c = o / d, q.update(K.tick(a, c)), n = B(), q.done() || e || r ? (q.update(100), Pace.trigger("done"), setTimeout(function() {
459
+ return q.finish(), Pace.running = !1, Pace.trigger("hide")
460
+ }, Math.max(C.ghostTime, Math.min(C.minTime, B() - n)))) : b()
461
+ })
462
+ }, Pace.start = function(a) {
463
+ u(C, a), Pace.running = !0;
464
+ try {
465
+ q.render()
466
+ } catch (b) {
467
+ i = b
468
+ }
469
+ return document.querySelector(".pace") ? (Pace.trigger("start"), Pace.go()) : setTimeout(Pace.start, 50)
470
+ }, "function" == typeof define && define.amd ? define('theme-app', [], function() {
471
+ return Pace
472
+ }) : "object" == typeof exports ? module.exports = Pace : C.startOnPageLoad && Pace.start()
473
+ }).call(this);
474
+ });
139
475
 
140
476
  /*
141
477
  * BOX REFRESH BUTTON
@@ -147,71 +483,71 @@ function fix_sidebar() {
147
483
  * $("#box-widget").boxRefresh( options );
148
484
  * */
149
485
  (function($) {
150
- "use strict";
151
-
152
- $.fn.boxRefresh = function(options) {
153
-
154
- // Render options
155
- var settings = $.extend({
156
- //Refressh button selector
157
- trigger: ".refresh-btn",
158
- //File source to be loaded (e.g: ajax/src.php)
159
- source: "",
160
- //Callbacks
161
- onLoadStart: function(box) {
162
- }, //Right after the button has been clicked
163
- onLoadDone: function(box) {
164
- } //When the source has been loaded
165
-
166
- }, options);
167
-
168
- //The overlay
169
- var overlay = $('<div class="overlay"></div><div class="loading-img"></div>');
170
-
171
- return this.each(function() {
172
- //if a source is specified
173
- if (settings.source === "") {
174
- if (console) {
175
- console.log("Please specify a source first - boxRefresh()");
176
- }
177
- return;
178
- }
179
- //the box
180
- var box = $(this);
181
- //the button
182
- var rBtn = box.find(settings.trigger).first();
183
-
184
- //On trigger click
185
- rBtn.click(function(e) {
186
- e.preventDefault();
187
- //Add loading overlay
188
- start(box);
486
+ "use strict";
189
487
 
190
- //Perform ajax call
191
- box.find(".box-body").load(settings.source, function() {
192
- done(box);
193
- });
488
+ $.fn.boxRefresh = function(options) {
194
489
 
490
+ // Render options
491
+ var settings = $.extend({
492
+ //Refressh button selector
493
+ trigger: ".refresh-btn",
494
+ //File source to be loaded (e.g: ajax/src.php)
495
+ source: "",
496
+ //Callbacks
497
+ onLoadStart: function(box) {
498
+ }, //Right after the button has been clicked
499
+ onLoadDone: function(box) {
500
+ } //When the source has been loaded
195
501
 
196
- });
502
+ }, options);
197
503
 
198
- });
504
+ //The overlay
505
+ var overlay = $('<div class="overlay"></div><div class="loading-img"></div>');
199
506
 
200
- function start(box) {
201
- //Add overlay and loading img
202
- box.append(overlay);
507
+ return this.each(function() {
508
+ //if a source is specified
509
+ if (settings.source === "") {
510
+ if (console) {
511
+ console.log("Please specify a source first - boxRefresh()");
512
+ }
513
+ return;
514
+ }
515
+ //the box
516
+ var box = $(this);
517
+ //the button
518
+ var rBtn = box.find(settings.trigger).first();
203
519
 
204
- settings.onLoadStart.call(box);
205
- }
520
+ //On trigger click
521
+ rBtn.click(function(e) {
522
+ e.preventDefault();
523
+ //Add loading overlay
524
+ start(box);
206
525
 
207
- function done(box) {
208
- //Remove overlay and loading img
209
- box.find(overlay).remove();
526
+ //Perform ajax call
527
+ box.find(".box-body").load(settings.source, function() {
528
+ done(box);
529
+ });
210
530
 
211
- settings.onLoadDone.call(box);
212
- }
213
531
 
214
- };
532
+ });
533
+
534
+ });
535
+
536
+ function start(box) {
537
+ //Add overlay and loading img
538
+ box.append(overlay);
539
+
540
+ settings.onLoadStart.call(box);
541
+ }
542
+
543
+ function done(box) {
544
+ //Remove overlay and loading img
545
+ box.find(overlay).remove();
546
+
547
+ settings.onLoadDone.call(box);
548
+ }
549
+
550
+ };
215
551
 
216
552
  })(jQuery);
217
553
 
@@ -240,48 +576,48 @@ function fix_sidebar() {
240
576
  * on page load. See above for an example.
241
577
  */
242
578
  (function($) {
243
- "use strict";
244
-
245
- $.fn.tree = function() {
246
-
247
- return this.each(function() {
248
- var btn = $(this).children("a").first();
249
- var menu = $(this).children(".treeview-menu").first();
250
- var isActive = $(this).hasClass('active');
251
-
252
- //initialize already active menus
253
- if (isActive) {
254
- menu.show();
255
- btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
256
- }
257
- //Slide open or close the menu on link click
258
- btn.click(function(e) {
259
- e.preventDefault();
260
- if (isActive) {
261
- //Slide up to close menu
262
- menu.slideUp();
263
- isActive = false;
264
- btn.children(".fa-angle-down").first().removeClass("fa-angle-down").addClass("fa-angle-left");
265
- btn.parent("li").removeClass("active");
266
- } else {
267
- //Slide down to open menu
268
- menu.slideDown();
269
- isActive = true;
270
- btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
271
- btn.parent("li").addClass("active");
272
- }
273
- });
579
+ "use strict";
274
580
 
275
- /* Add margins to submenu elements to give it a tree look */
276
- menu.find("li > a").each(function() {
277
- var pad = parseInt($(this).css("margin-left")) + 10;
581
+ $.fn.tree = function() {
278
582
 
279
- $(this).css({"margin-left": pad + "px"});
280
- });
583
+ return this.each(function() {
584
+ var btn = $(this).children("a").first();
585
+ var menu = $(this).children(".treeview-menu").first();
586
+ var isActive = $(this).hasClass('active');
281
587
 
282
- });
588
+ //initialize already active menus
589
+ if (isActive) {
590
+ menu.show();
591
+ btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
592
+ }
593
+ //Slide open or close the menu on link click
594
+ btn.click(function(e) {
595
+ e.preventDefault();
596
+ if (isActive) {
597
+ //Slide up to close menu
598
+ menu.slideUp();
599
+ isActive = false;
600
+ btn.children(".fa-angle-down").first().removeClass("fa-angle-down").addClass("fa-angle-left");
601
+ btn.parent("li").removeClass("active");
602
+ } else {
603
+ //Slide down to open menu
604
+ menu.slideDown();
605
+ isActive = true;
606
+ btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
607
+ btn.parent("li").addClass("active");
608
+ }
609
+ });
283
610
 
284
- };
611
+ /* Add margins to submenu elements to give it a tree look */
612
+ menu.find("li > a").each(function() {
613
+ var pad = parseInt($(this).css("margin-left")) + 10;
614
+
615
+ $(this).css({"margin-left": pad + "px"});
616
+ });
617
+
618
+ });
619
+
620
+ };
285
621
 
286
622
 
287
623
  }(jQuery));
@@ -292,52 +628,52 @@ function fix_sidebar() {
292
628
  * This plugin depends on iCheck plugin for checkbox and radio inputs
293
629
  */
294
630
  (function($) {
295
- "use strict";
296
-
297
- $.fn.todolist = function(options) {
298
- // Render options
299
- var settings = $.extend({
300
- //When the user checks the input
301
- onCheck: function(ele) {
302
- },
303
- //When the user unchecks the input
304
- onUncheck: function(ele) {
305
- }
306
- }, options);
307
-
308
- return this.each(function() {
309
- $('input', this).on('ifChecked', function(event) {
310
- var ele = $(this).parents("li").first();
311
- ele.toggleClass("done");
312
- settings.onCheck.call(ele);
313
- });
314
-
315
- $('input', this).on('ifUnchecked', function(event) {
316
- var ele = $(this).parents("li").first();
317
- ele.toggleClass("done");
318
- settings.onUncheck.call(ele);
319
- });
320
- });
321
- };
631
+ "use strict";
632
+
633
+ $.fn.todolist = function(options) {
634
+ // Render options
635
+ var settings = $.extend({
636
+ //When the user checks the input
637
+ onCheck: function(ele) {
638
+ },
639
+ //When the user unchecks the input
640
+ onUncheck: function(ele) {
641
+ }
642
+ }, options);
643
+
644
+ return this.each(function() {
645
+ $('input', this).on('ifChecked', function(event) {
646
+ var ele = $(this).parents("li").first();
647
+ ele.toggleClass("done");
648
+ settings.onCheck.call(ele);
649
+ });
650
+
651
+ $('input', this).on('ifUnchecked', function(event) {
652
+ var ele = $(this).parents("li").first();
653
+ ele.toggleClass("done");
654
+ settings.onUncheck.call(ele);
655
+ });
656
+ });
657
+ };
322
658
 
323
659
  }(jQuery));
324
660
 
325
661
  /* CENTER ELEMENTS */
326
662
  (function($) {
327
- "use strict";
328
- jQuery.fn.center = function(parent) {
329
- if (parent) {
330
- parent = this.parent();
331
- } else {
332
- parent = window;
663
+ "use strict";
664
+ jQuery.fn.center = function(parent) {
665
+ if (parent) {
666
+ parent = this.parent();
667
+ } else {
668
+ parent = window;
669
+ }
670
+ this.css({
671
+ "position": "absolute",
672
+ "top": ((($(parent).height() - this.outerHeight()) / 2) + $(parent).scrollTop() + "px"),
673
+ "left": ((($(parent).width() - this.outerWidth()) / 2) + $(parent).scrollLeft() + "px")
674
+ });
675
+ return this;
333
676
  }
334
- this.css({
335
- "position": "absolute",
336
- "top": ((($(parent).height() - this.outerHeight()) / 2) + $(parent).scrollTop() + "px"),
337
- "left": ((($(parent).width() - this.outerWidth()) / 2) + $(parent).scrollLeft() + "px")
338
- });
339
- return this;
340
- }
341
677
  }(jQuery));
342
678
 
343
679
  /*
@@ -349,59 +685,59 @@ function fix_sidebar() {
349
685
  * http://benalman.com/about/license/
350
686
  */
351
687
  (function($, h, c) {
352
- var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTimeout", j = "resize", d = j + "-special-event", b = "delay", f = "throttleWindow";
353
- e[b] = 250;
354
- e[f] = true;
355
- $.event.special[j] = {setup: function() {
356
- if (!e[f] && this[k]) {
357
- return false;
358
- }
359
- var l = $(this);
360
- a = a.add(l);
361
- $.data(this, d, {w: l.width(), h: l.height()});
362
- if (a.length === 1) {
363
- g();
364
- }
365
- }, teardown: function() {
366
- if (!e[f] && this[k]) {
367
- return false
368
- }
369
- var l = $(this);
370
- a = a.not(l);
371
- l.removeData(d);
372
- if (!a.length) {
373
- clearTimeout(i);
374
- }
375
- }, add: function(l) {
376
- if (!e[f] && this[k]) {
377
- return false
378
- }
379
- var n;
380
- function m(s, o, p) {
381
- var q = $(this), r = $.data(this, d);
382
- r.w = o !== c ? o : q.width();
383
- r.h = p !== c ? p : q.height();
384
- n.apply(this, arguments)
385
- }
386
- if ($.isFunction(l)) {
387
- n = l;
388
- return m
389
- } else {
390
- n = l.handler;
391
- l.handler = m
392
- }
393
- }};
394
- function g() {
395
- i = h[k](function() {
396
- a.each(function() {
397
- var n = $(this), m = n.width(), l = n.height(), o = $.data(this, d);
398
- if (m !== o.w || l !== o.h) {
399
- n.trigger(j, [o.w = m, o.h = l])
400
- }
401
- });
402
- g()
403
- }, e[b])
404
- }}
688
+ var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTimeout", j = "resize", d = j + "-special-event", b = "delay", f = "throttleWindow";
689
+ e[b] = 250;
690
+ e[f] = true;
691
+ $.event.special[j] = {setup: function() {
692
+ if (!e[f] && this[k]) {
693
+ return false;
694
+ }
695
+ var l = $(this);
696
+ a = a.add(l);
697
+ $.data(this, d, {w: l.width(), h: l.height()});
698
+ if (a.length === 1) {
699
+ g();
700
+ }
701
+ }, teardown: function() {
702
+ if (!e[f] && this[k]) {
703
+ return false
704
+ }
705
+ var l = $(this);
706
+ a = a.not(l);
707
+ l.removeData(d);
708
+ if (!a.length) {
709
+ clearTimeout(i);
710
+ }
711
+ }, add: function(l) {
712
+ if (!e[f] && this[k]) {
713
+ return false
714
+ }
715
+ var n;
716
+ function m(s, o, p) {
717
+ var q = $(this), r = $.data(this, d);
718
+ r.w = o !== c ? o : q.width();
719
+ r.h = p !== c ? p : q.height();
720
+ n.apply(this, arguments)
721
+ }
722
+ if ($.isFunction(l)) {
723
+ n = l;
724
+ return m
725
+ } else {
726
+ n = l.handler;
727
+ l.handler = m
728
+ }
729
+ }};
730
+ function g() {
731
+ i = h[k](function() {
732
+ a.each(function() {
733
+ var n = $(this), m = n.width(), l = n.height(), o = $.data(this, d);
734
+ if (m !== o.w || l !== o.h) {
735
+ n.trigger(j, [o.w = m, o.h = l])
736
+ }
737
+ });
738
+ g()
739
+ }, e[b])
740
+ }}
405
741
  )(jQuery, this);
406
742
 
407
743
  /*!
@@ -411,308 +747,308 @@ function fix_sidebar() {
411
747
  * Copyright (c) 2011 Piotr Rochala (http://rocha.la) Dual licensed under the MIT
412
748
  */
413
749
  (function(f) {
414
- jQuery.fn.extend({slimScroll: function(h) {
415
- var a = f.extend({width: "auto", height: "250px", size: "7px", color: "#000", position: "right", distance: "1px", start: "top", opacity: 0.4, alwaysVisible: !1, disableFadeOut: !1, railVisible: !1, railColor: "#333", railOpacity: 0.2, railDraggable: !0, railClass: "slimScrollRail", barClass: "slimScrollBar", wrapperClass: "slimScrollDiv", allowPageScroll: !1, wheelStep: 20, touchScrollStep: 200, borderRadius: "0px", railBorderRadius: "0px"}, h);
416
- this.each(function() {
417
- function r(d) {
418
- if (s) {
419
- d = d ||
420
- window.event;
421
- var c = 0;
422
- d.wheelDelta && (c = -d.wheelDelta / 120);
423
- d.detail && (c = d.detail / 3);
424
- f(d.target || d.srcTarget || d.srcElement).closest("." + a.wrapperClass).is(b.parent()) && m(c, !0);
425
- d.preventDefault && !k && d.preventDefault();
426
- k || (d.returnValue = !1)
427
- }
428
- }
429
- function m(d, f, h) {
430
- k = !1;
431
- var e = d, g = b.outerHeight() - c.outerHeight();
432
- f && (e = parseInt(c.css("top")) + d * parseInt(a.wheelStep) / 100 * c.outerHeight(), e = Math.min(Math.max(e, 0), g), e = 0 < d ? Math.ceil(e) : Math.floor(e), c.css({top: e + "px"}));
433
- l = parseInt(c.css("top")) / (b.outerHeight() - c.outerHeight());
434
- e = l * (b[0].scrollHeight - b.outerHeight());
435
- h && (e = d, d = e / b[0].scrollHeight * b.outerHeight(), d = Math.min(Math.max(d, 0), g), c.css({top: d + "px"}));
436
- b.scrollTop(e);
437
- b.trigger("slimscrolling", ~~e);
438
- v();
439
- p()
440
- }
441
- function C() {
442
- window.addEventListener ? (this.addEventListener("DOMMouseScroll", r, !1), this.addEventListener("mousewheel", r, !1), this.addEventListener("MozMousePixelScroll", r, !1)) : document.attachEvent("onmousewheel", r)
443
- }
444
- function w() {
445
- u = Math.max(b.outerHeight() / b[0].scrollHeight * b.outerHeight(), D);
446
- c.css({height: u + "px"});
447
- var a = u == b.outerHeight() ? "none" : "block";
448
- c.css({display: a})
449
- }
450
- function v() {
451
- w();
452
- clearTimeout(A);
453
- l == ~~l ? (k = a.allowPageScroll, B != l && b.trigger("slimscroll", 0 == ~~l ? "top" : "bottom")) : k = !1;
454
- B = l;
455
- u >= b.outerHeight() ? k = !0 : (c.stop(!0, !0).fadeIn("fast"), a.railVisible && g.stop(!0, !0).fadeIn("fast"))
456
- }
457
- function p() {
458
- a.alwaysVisible || (A = setTimeout(function() {
459
- a.disableFadeOut && s || (x || y) || (c.fadeOut("slow"), g.fadeOut("slow"))
460
- }, 1E3))
461
- }
462
- var s, x, y, A, z, u, l, B, D = 30, k = !1, b = f(this);
463
- if (b.parent().hasClass(a.wrapperClass)) {
464
- var n = b.scrollTop(),
465
- c = b.parent().find("." + a.barClass), g = b.parent().find("." + a.railClass);
466
- w();
467
- if (f.isPlainObject(h)) {
468
- if ("height"in h && "auto" == h.height) {
469
- b.parent().css("height", "auto");
470
- b.css("height", "auto");
471
- var q = b.parent().parent().height();
472
- b.parent().css("height", q);
473
- b.css("height", q)
474
- }
475
- if ("scrollTo"in h)
476
- n = parseInt(a.scrollTo);
477
- else if ("scrollBy"in h)
478
- n += parseInt(a.scrollBy);
479
- else if ("destroy"in h) {
480
- c.remove();
481
- g.remove();
482
- b.unwrap();
483
- return
484
- }
485
- m(n, !1, !0)
486
- }
487
- } else {
488
- a.height = "auto" == a.height ? b.parent().height() : a.height;
489
- n = f("<div></div>").addClass(a.wrapperClass).css({position: "relative",
490
- overflow: "hidden", width: a.width, height: a.height});
491
- b.css({overflow: "hidden", width: a.width, height: a.height});
492
- var g = f("<div></div>").addClass(a.railClass).css({width: a.size, height: "100%", position: "absolute", top: 0, display: a.alwaysVisible && a.railVisible ? "block" : "none", "border-radius": a.railBorderRadius, background: a.railColor, opacity: a.railOpacity, zIndex: 90}), c = f("<div></div>").addClass(a.barClass).css({background: a.color, width: a.size, position: "absolute", top: 0, opacity: a.opacity, display: a.alwaysVisible ?
493
- "block" : "none", "border-radius": a.borderRadius, BorderRadius: a.borderRadius, MozBorderRadius: a.borderRadius, WebkitBorderRadius: a.borderRadius, zIndex: 99}), q = "right" == a.position ? {right: a.distance} : {left: a.distance};
494
- g.css(q);
495
- c.css(q);
496
- b.wrap(n);
497
- b.parent().append(c);
498
- b.parent().append(g);
499
- a.railDraggable && c.bind("mousedown", function(a) {
500
- var b = f(document);
501
- y = !0;
502
- t = parseFloat(c.css("top"));
503
- pageY = a.pageY;
504
- b.bind("mousemove.slimscroll", function(a) {
505
- currTop = t + a.pageY - pageY;
506
- c.css("top", currTop);
507
- m(0, c.position().top, !1)
508
- });
509
- b.bind("mouseup.slimscroll", function(a) {
510
- y = !1;
511
- p();
512
- b.unbind(".slimscroll")
513
- });
514
- return!1
515
- }).bind("selectstart.slimscroll", function(a) {
516
- a.stopPropagation();
517
- a.preventDefault();
518
- return!1
519
- });
520
- g.hover(function() {
521
- v()
522
- }, function() {
523
- p()
524
- });
525
- c.hover(function() {
526
- x = !0
527
- }, function() {
528
- x = !1
529
- });
530
- b.hover(function() {
531
- s = !0;
532
- v();
533
- p()
534
- }, function() {
535
- s = !1;
536
- p()
537
- });
538
- b.bind("touchstart", function(a, b) {
539
- a.originalEvent.touches.length && (z = a.originalEvent.touches[0].pageY)
540
- });
541
- b.bind("touchmove", function(b) {
542
- k || b.originalEvent.preventDefault();
543
- b.originalEvent.touches.length &&
544
- (m((z - b.originalEvent.touches[0].pageY) / a.touchScrollStep, !0), z = b.originalEvent.touches[0].pageY)
545
- });
546
- w();
547
- "bottom" === a.start ? (c.css({top: b.outerHeight() - c.outerHeight()}), m(0, !0)) : "top" !== a.start && (m(f(a.start).position().top, null, !0), a.alwaysVisible || c.hide());
548
- C()
549
- }
550
- });
551
- return this
552
- }});
553
- jQuery.fn.extend({slimscroll: jQuery.fn.slimScroll})
750
+ jQuery.fn.extend({slimScroll: function(h) {
751
+ var a = f.extend({width: "auto", height: "250px", size: "7px", color: "#000", position: "right", distance: "1px", start: "top", opacity: 0.4, alwaysVisible: !1, disableFadeOut: !1, railVisible: !1, railColor: "#333", railOpacity: 0.2, railDraggable: !0, railClass: "slimScrollRail", barClass: "slimScrollBar", wrapperClass: "slimScrollDiv", allowPageScroll: !1, wheelStep: 20, touchScrollStep: 200, borderRadius: "0px", railBorderRadius: "0px"}, h);
752
+ this.each(function() {
753
+ function r(d) {
754
+ if (s) {
755
+ d = d ||
756
+ window.event;
757
+ var c = 0;
758
+ d.wheelDelta && (c = -d.wheelDelta / 120);
759
+ d.detail && (c = d.detail / 3);
760
+ f(d.target || d.srcTarget || d.srcElement).closest("." + a.wrapperClass).is(b.parent()) && m(c, !0);
761
+ d.preventDefault && !k && d.preventDefault();
762
+ k || (d.returnValue = !1)
763
+ }
764
+ }
765
+ function m(d, f, h) {
766
+ k = !1;
767
+ var e = d, g = b.outerHeight() - c.outerHeight();
768
+ f && (e = parseInt(c.css("top")) + d * parseInt(a.wheelStep) / 100 * c.outerHeight(), e = Math.min(Math.max(e, 0), g), e = 0 < d ? Math.ceil(e) : Math.floor(e), c.css({top: e + "px"}));
769
+ l = parseInt(c.css("top")) / (b.outerHeight() - c.outerHeight());
770
+ e = l * (b[0].scrollHeight - b.outerHeight());
771
+ h && (e = d, d = e / b[0].scrollHeight * b.outerHeight(), d = Math.min(Math.max(d, 0), g), c.css({top: d + "px"}));
772
+ b.scrollTop(e);
773
+ b.trigger("slimscrolling", ~~e);
774
+ v();
775
+ p()
776
+ }
777
+ function C() {
778
+ window.addEventListener ? (this.addEventListener("DOMMouseScroll", r, !1), this.addEventListener("mousewheel", r, !1), this.addEventListener("MozMousePixelScroll", r, !1)) : document.attachEvent("onmousewheel", r)
779
+ }
780
+ function w() {
781
+ u = Math.max(b.outerHeight() / b[0].scrollHeight * b.outerHeight(), D);
782
+ c.css({height: u + "px"});
783
+ var a = u == b.outerHeight() ? "none" : "block";
784
+ c.css({display: a})
785
+ }
786
+ function v() {
787
+ w();
788
+ clearTimeout(A);
789
+ l == ~~l ? (k = a.allowPageScroll, B != l && b.trigger("slimscroll", 0 == ~~l ? "top" : "bottom")) : k = !1;
790
+ B = l;
791
+ u >= b.outerHeight() ? k = !0 : (c.stop(!0, !0).fadeIn("fast"), a.railVisible && g.stop(!0, !0).fadeIn("fast"))
792
+ }
793
+ function p() {
794
+ a.alwaysVisible || (A = setTimeout(function() {
795
+ a.disableFadeOut && s || (x || y) || (c.fadeOut("slow"), g.fadeOut("slow"))
796
+ }, 1E3))
797
+ }
798
+ var s, x, y, A, z, u, l, B, D = 30, k = !1, b = f(this);
799
+ if (b.parent().hasClass(a.wrapperClass)) {
800
+ var n = b.scrollTop(),
801
+ c = b.parent().find("." + a.barClass), g = b.parent().find("." + a.railClass);
802
+ w();
803
+ if (f.isPlainObject(h)) {
804
+ if ("height"in h && "auto" == h.height) {
805
+ b.parent().css("height", "auto");
806
+ b.css("height", "auto");
807
+ var q = b.parent().parent().height();
808
+ b.parent().css("height", q);
809
+ b.css("height", q)
810
+ }
811
+ if ("scrollTo"in h)
812
+ n = parseInt(a.scrollTo);
813
+ else if ("scrollBy"in h)
814
+ n += parseInt(a.scrollBy);
815
+ else if ("destroy"in h) {
816
+ c.remove();
817
+ g.remove();
818
+ b.unwrap();
819
+ return
820
+ }
821
+ m(n, !1, !0)
822
+ }
823
+ } else {
824
+ a.height = "auto" == a.height ? b.parent().height() : a.height;
825
+ n = f("<div></div>").addClass(a.wrapperClass).css({position: "relative",
826
+ overflow: "hidden", width: a.width, height: a.height});
827
+ b.css({overflow: "hidden", width: a.width, height: a.height});
828
+ var g = f("<div></div>").addClass(a.railClass).css({width: a.size, height: "100%", position: "absolute", top: 0, display: a.alwaysVisible && a.railVisible ? "block" : "none", "border-radius": a.railBorderRadius, background: a.railColor, opacity: a.railOpacity, zIndex: 90}), c = f("<div></div>").addClass(a.barClass).css({background: a.color, width: a.size, position: "absolute", top: 0, opacity: a.opacity, display: a.alwaysVisible ?
829
+ "block" : "none", "border-radius": a.borderRadius, BorderRadius: a.borderRadius, MozBorderRadius: a.borderRadius, WebkitBorderRadius: a.borderRadius, zIndex: 99}), q = "right" == a.position ? {right: a.distance} : {left: a.distance};
830
+ g.css(q);
831
+ c.css(q);
832
+ b.wrap(n);
833
+ b.parent().append(c);
834
+ b.parent().append(g);
835
+ a.railDraggable && c.bind("mousedown", function(a) {
836
+ var b = f(document);
837
+ y = !0;
838
+ t = parseFloat(c.css("top"));
839
+ pageY = a.pageY;
840
+ b.bind("mousemove.slimscroll", function(a) {
841
+ currTop = t + a.pageY - pageY;
842
+ c.css("top", currTop);
843
+ m(0, c.position().top, !1)
844
+ });
845
+ b.bind("mouseup.slimscroll", function(a) {
846
+ y = !1;
847
+ p();
848
+ b.unbind(".slimscroll")
849
+ });
850
+ return!1
851
+ }).bind("selectstart.slimscroll", function(a) {
852
+ a.stopPropagation();
853
+ a.preventDefault();
854
+ return!1
855
+ });
856
+ g.hover(function() {
857
+ v()
858
+ }, function() {
859
+ p()
860
+ });
861
+ c.hover(function() {
862
+ x = !0
863
+ }, function() {
864
+ x = !1
865
+ });
866
+ b.hover(function() {
867
+ s = !0;
868
+ v();
869
+ p()
870
+ }, function() {
871
+ s = !1;
872
+ p()
873
+ });
874
+ b.bind("touchstart", function(a, b) {
875
+ a.originalEvent.touches.length && (z = a.originalEvent.touches[0].pageY)
876
+ });
877
+ b.bind("touchmove", function(b) {
878
+ k || b.originalEvent.preventDefault();
879
+ b.originalEvent.touches.length &&
880
+ (m((z - b.originalEvent.touches[0].pageY) / a.touchScrollStep, !0), z = b.originalEvent.touches[0].pageY)
881
+ });
882
+ w();
883
+ "bottom" === a.start ? (c.css({top: b.outerHeight() - c.outerHeight()}), m(0, !0)) : "top" !== a.start && (m(f(a.start).position().top, null, !0), a.alwaysVisible || c.hide());
884
+ C()
885
+ }
886
+ });
887
+ return this
888
+ }});
889
+ jQuery.fn.extend({slimscroll: jQuery.fn.slimScroll})
554
890
  })(jQuery);
555
891
 
556
892
  /*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
557
893
  (function(h) {
558
- function F(a, b, d) {
559
- var c = a[0], e = /er/.test(d) ? m : /bl/.test(d) ? s : l, f = d == H ? {checked: c[l], disabled: c[s], indeterminate: "true" == a.attr(m) || "false" == a.attr(w)} : c[e];
560
- if (/^(ch|di|in)/.test(d) && !f)
561
- D(a, e);
562
- else if (/^(un|en|de)/.test(d) && f)
563
- t(a, e);
564
- else if (d == H)
565
- for (e in f)
566
- f[e] ? D(a, e, !0) : t(a, e, !0);
567
- else if (!b || "toggle" == d) {
568
- if (!b)
569
- a[p]("ifClicked");
570
- f ? c[n] !== u && t(a, e) : D(a, e)
894
+ function F(a, b, d) {
895
+ var c = a[0], e = /er/.test(d) ? m : /bl/.test(d) ? s : l, f = d == H ? {checked: c[l], disabled: c[s], indeterminate: "true" == a.attr(m) || "false" == a.attr(w)} : c[e];
896
+ if (/^(ch|di|in)/.test(d) && !f)
897
+ D(a, e);
898
+ else if (/^(un|en|de)/.test(d) && f)
899
+ t(a, e);
900
+ else if (d == H)
901
+ for (e in f)
902
+ f[e] ? D(a, e, !0) : t(a, e, !0);
903
+ else if (!b || "toggle" == d) {
904
+ if (!b)
905
+ a[p]("ifClicked");
906
+ f ? c[n] !== u && t(a, e) : D(a, e)
907
+ }
571
908
  }
572
- }
573
- function D(a, b, d) {
574
- var c = a[0], e = a.parent(), f = b == l, A = b == m, B = b == s, K = A ? w : f ? E : "enabled", p = k(a, K + x(c[n])), N = k(a, b + x(c[n]));
575
- if (!0 !== c[b]) {
576
- if (!d &&
577
- b == l && c[n] == u && c.name) {
578
- var C = a.closest("form"), r = 'input[name="' + c.name + '"]', r = C.length ? C.find(r) : h(r);
579
- r.each(function() {
580
- this !== c && h(this).data(q) && t(h(this), b)
581
- })
582
- }
583
- A ? (c[b] = !0, c[l] && t(a, l, "force")) : (d || (c[b] = !0), f && c[m] && t(a, m, !1));
584
- L(a, f, b, d)
909
+ function D(a, b, d) {
910
+ var c = a[0], e = a.parent(), f = b == l, A = b == m, B = b == s, K = A ? w : f ? E : "enabled", p = k(a, K + x(c[n])), N = k(a, b + x(c[n]));
911
+ if (!0 !== c[b]) {
912
+ if (!d &&
913
+ b == l && c[n] == u && c.name) {
914
+ var C = a.closest("form"), r = 'input[name="' + c.name + '"]', r = C.length ? C.find(r) : h(r);
915
+ r.each(function() {
916
+ this !== c && h(this).data(q) && t(h(this), b)
917
+ })
918
+ }
919
+ A ? (c[b] = !0, c[l] && t(a, l, "force")) : (d || (c[b] = !0), f && c[m] && t(a, m, !1));
920
+ L(a, f, b, d)
921
+ }
922
+ c[s] && k(a, y, !0) && e.find("." + I).css(y, "default");
923
+ e[v](N || k(a, b) || "");
924
+ B ? e.attr("aria-disabled", "true") : e.attr("aria-checked", A ? "mixed" : "true");
925
+ e[z](p || k(a, K) || "")
585
926
  }
586
- c[s] && k(a, y, !0) && e.find("." + I).css(y, "default");
587
- e[v](N || k(a, b) || "");
588
- B ? e.attr("aria-disabled", "true") : e.attr("aria-checked", A ? "mixed" : "true");
589
- e[z](p || k(a, K) || "")
590
- }
591
- function t(a, b, d) {
592
- var c = a[0], e = a.parent(), f = b == l, h = b == m, q = b == s, p = h ? w : f ? E : "enabled", t = k(a, p + x(c[n])),
593
- u = k(a, b + x(c[n]));
594
- if (!1 !== c[b]) {
595
- if (h || !d || "force" == d)
596
- c[b] = !1;
597
- L(a, f, p, d)
927
+ function t(a, b, d) {
928
+ var c = a[0], e = a.parent(), f = b == l, h = b == m, q = b == s, p = h ? w : f ? E : "enabled", t = k(a, p + x(c[n])),
929
+ u = k(a, b + x(c[n]));
930
+ if (!1 !== c[b]) {
931
+ if (h || !d || "force" == d)
932
+ c[b] = !1;
933
+ L(a, f, p, d)
934
+ }
935
+ !c[s] && k(a, y, !0) && e.find("." + I).css(y, "pointer");
936
+ e[z](u || k(a, b) || "");
937
+ q ? e.attr("aria-disabled", "false") : e.attr("aria-checked", "false");
938
+ e[v](t || k(a, p) || "")
598
939
  }
599
- !c[s] && k(a, y, !0) && e.find("." + I).css(y, "pointer");
600
- e[z](u || k(a, b) || "");
601
- q ? e.attr("aria-disabled", "false") : e.attr("aria-checked", "false");
602
- e[v](t || k(a, p) || "")
603
- }
604
- function M(a, b) {
605
- if (a.data(q)) {
606
- a.parent().html(a.attr("style", a.data(q).s || ""));
607
- if (b)
608
- a[p](b);
609
- a.off(".i").unwrap();
610
- h(G + '[for="' + a[0].id + '"]').add(a.closest(G)).off(".i")
940
+ function M(a, b) {
941
+ if (a.data(q)) {
942
+ a.parent().html(a.attr("style", a.data(q).s || ""));
943
+ if (b)
944
+ a[p](b);
945
+ a.off(".i").unwrap();
946
+ h(G + '[for="' + a[0].id + '"]').add(a.closest(G)).off(".i")
947
+ }
611
948
  }
612
- }
613
- function k(a, b, d) {
614
- if (a.data(q))
615
- return a.data(q).o[b + (d ? "" : "Class")]
616
- }
617
- function x(a) {
618
- return a.charAt(0).toUpperCase() +
619
- a.slice(1)
620
- }
621
- function L(a, b, d, c) {
622
- if (!c) {
623
- if (b)
624
- a[p]("ifToggled");
625
- a[p]("ifChanged")[p]("if" + x(d))
949
+ function k(a, b, d) {
950
+ if (a.data(q))
951
+ return a.data(q).o[b + (d ? "" : "Class")]
626
952
  }
627
- }
628
- var q = "iCheck", I = q + "-helper", u = "radio", l = "checked", E = "un" + l, s = "disabled", w = "determinate", m = "in" + w, H = "update", n = "type", v = "addClass", z = "removeClass", p = "trigger", G = "label", y = "cursor", J = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);
629
- h.fn[q] = function(a, b) {
630
- var d = 'input[type="checkbox"], input[type="' + u + '"]', c = h(), e = function(a) {
631
- a.each(function() {
632
- var a = h(this);
633
- c = a.is(d) ?
634
- c.add(a) : c.add(a.find(d))
635
- })
636
- };
637
- if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))
638
- return a = a.toLowerCase(), e(this), c.each(function() {
639
- var c = h(this);
640
- "destroy" == a ? M(c, "ifDestroyed") : F(c, !0, a);
641
- h.isFunction(b) && b()
642
- });
643
- if ("object" != typeof a && a)
644
- return this;
645
- var f = h.extend({checkedClass: l, disabledClass: s, indeterminateClass: m, labelHover: !0, aria: !1}, a), k = f.handle, B = f.hoverClass || "hover", x = f.focusClass || "focus", w = f.activeClass || "active", y = !!f.labelHover, C = f.labelHoverClass ||
646
- "hover", r = ("" + f.increaseArea).replace("%", "") | 0;
647
- if ("checkbox" == k || k == u)
648
- d = 'input[type="' + k + '"]';
649
- -50 > r && (r = -50);
650
- e(this);
651
- return c.each(function() {
652
- var a = h(this);
653
- M(a);
654
- var c = this, b = c.id, e = -r + "%", d = 100 + 2 * r + "%", d = {position: "absolute", top: e, left: e, display: "block", width: d, height: d, margin: 0, padding: 0, background: "#fff", border: 0, opacity: 0}, e = J ? {position: "absolute", visibility: "hidden"} : r ? d : {position: "absolute", opacity: 0}, k = "checkbox" == c[n] ? f.checkboxClass || "icheckbox" : f.radioClass || "i" + u, m = h(G + '[for="' + b + '"]').add(a.closest(G)),
655
- A = !!f.aria, E = q + "-" + Math.random().toString(36).replace("0.", ""), g = '<div class="' + k + '" ' + (A ? 'role="' + c[n] + '" ' : "");
656
- m.length && A && m.each(function() {
657
- g += 'aria-labelledby="';
658
- this.id ? g += this.id : (this.id = E, g += E);
659
- g += '"'
660
- });
661
- g = a.wrap(g + "/>")[p]("ifCreated").parent().append(f.insert);
662
- d = h('<ins class="' + I + '"/>').css(d).appendTo(g);
663
- a.data(q, {o: f, s: a.attr("style")}).css(e);
664
- f.inheritClass && g[v](c.className || "");
665
- f.inheritID && b && g.attr("id", q + "-" + b);
666
- "static" == g.css("position") && g.css("position", "relative");
667
- F(a, !0, H);
668
- if (m.length)
669
- m.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i", function(b) {
670
- var d = b[n], e = h(this);
671
- if (!c[s]) {
672
- if ("click" == d) {
673
- if (h(b.target).is("a"))
674
- return;
675
- F(a, !1, !0)
676
- } else
677
- y && (/ut|nd/.test(d) ? (g[z](B), e[z](C)) : (g[v](B), e[v](C)));
678
- if (J)
679
- b.stopPropagation();
680
- else
681
- return!1
682
- }
683
- });
684
- a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i", function(b) {
685
- var d = b[n];
686
- b = b.keyCode;
687
- if ("click" == d)
688
- return!1;
689
- if ("keydown" == d && 32 == b)
690
- return c[n] == u && c[l] || (c[l] ? t(a, l) : D(a, l)), !1;
691
- if ("keyup" == d && c[n] == u)
692
- !c[l] && D(a, l);
693
- else if (/us|ur/.test(d))
694
- g["blur" ==
695
- d ? z : v](x)
696
- });
697
- d.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i", function(b) {
698
- var d = b[n], e = /wn|up/.test(d) ? w : B;
699
- if (!c[s]) {
700
- if ("click" == d)
701
- F(a, !1, !0);
702
- else {
703
- if (/wn|er|in/.test(d))
704
- g[v](e);
705
- else
706
- g[z](e + " " + w);
707
- if (m.length && y && e == B)
708
- m[/ut|nd/.test(d) ? z : v](C)
709
- }
710
- if (J)
711
- b.stopPropagation();
712
- else
713
- return!1
953
+ function x(a) {
954
+ return a.charAt(0).toUpperCase() +
955
+ a.slice(1)
956
+ }
957
+ function L(a, b, d, c) {
958
+ if (!c) {
959
+ if (b)
960
+ a[p]("ifToggled");
961
+ a[p]("ifChanged")[p]("if" + x(d))
714
962
  }
715
- })
716
- })
717
- }
963
+ }
964
+ var q = "iCheck", I = q + "-helper", u = "radio", l = "checked", E = "un" + l, s = "disabled", w = "determinate", m = "in" + w, H = "update", n = "type", v = "addClass", z = "removeClass", p = "trigger", G = "label", y = "cursor", J = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);
965
+ h.fn[q] = function(a, b) {
966
+ var d = 'input[type="checkbox"], input[type="' + u + '"]', c = h(), e = function(a) {
967
+ a.each(function() {
968
+ var a = h(this);
969
+ c = a.is(d) ?
970
+ c.add(a) : c.add(a.find(d))
971
+ })
972
+ };
973
+ if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))
974
+ return a = a.toLowerCase(), e(this), c.each(function() {
975
+ var c = h(this);
976
+ "destroy" == a ? M(c, "ifDestroyed") : F(c, !0, a);
977
+ h.isFunction(b) && b()
978
+ });
979
+ if ("object" != typeof a && a)
980
+ return this;
981
+ var f = h.extend({checkedClass: l, disabledClass: s, indeterminateClass: m, labelHover: !0, aria: !1}, a), k = f.handle, B = f.hoverClass || "hover", x = f.focusClass || "focus", w = f.activeClass || "active", y = !!f.labelHover, C = f.labelHoverClass ||
982
+ "hover", r = ("" + f.increaseArea).replace("%", "") | 0;
983
+ if ("checkbox" == k || k == u)
984
+ d = 'input[type="' + k + '"]';
985
+ -50 > r && (r = -50);
986
+ e(this);
987
+ return c.each(function() {
988
+ var a = h(this);
989
+ M(a);
990
+ var c = this, b = c.id, e = -r + "%", d = 100 + 2 * r + "%", d = {position: "absolute", top: e, left: e, display: "block", width: d, height: d, margin: 0, padding: 0, background: "#fff", border: 0, opacity: 0}, e = J ? {position: "absolute", visibility: "hidden"} : r ? d : {position: "absolute", opacity: 0}, k = "checkbox" == c[n] ? f.checkboxClass || "icheckbox" : f.radioClass || "i" + u, m = h(G + '[for="' + b + '"]').add(a.closest(G)),
991
+ A = !!f.aria, E = q + "-" + Math.random().toString(36).replace("0.", ""), g = '<div class="' + k + '" ' + (A ? 'role="' + c[n] + '" ' : "");
992
+ m.length && A && m.each(function() {
993
+ g += 'aria-labelledby="';
994
+ this.id ? g += this.id : (this.id = E, g += E);
995
+ g += '"'
996
+ });
997
+ g = a.wrap(g + "/>")[p]("ifCreated").parent().append(f.insert);
998
+ d = h('<ins class="' + I + '"/>').css(d).appendTo(g);
999
+ a.data(q, {o: f, s: a.attr("style")}).css(e);
1000
+ f.inheritClass && g[v](c.className || "");
1001
+ f.inheritID && b && g.attr("id", q + "-" + b);
1002
+ "static" == g.css("position") && g.css("position", "relative");
1003
+ F(a, !0, H);
1004
+ if (m.length)
1005
+ m.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i", function(b) {
1006
+ var d = b[n], e = h(this);
1007
+ if (!c[s]) {
1008
+ if ("click" == d) {
1009
+ if (h(b.target).is("a"))
1010
+ return;
1011
+ F(a, !1, !0)
1012
+ } else
1013
+ y && (/ut|nd/.test(d) ? (g[z](B), e[z](C)) : (g[v](B), e[v](C)));
1014
+ if (J)
1015
+ b.stopPropagation();
1016
+ else
1017
+ return!1
1018
+ }
1019
+ });
1020
+ a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i", function(b) {
1021
+ var d = b[n];
1022
+ b = b.keyCode;
1023
+ if ("click" == d)
1024
+ return!1;
1025
+ if ("keydown" == d && 32 == b)
1026
+ return c[n] == u && c[l] || (c[l] ? t(a, l) : D(a, l)), !1;
1027
+ if ("keyup" == d && c[n] == u)
1028
+ !c[l] && D(a, l);
1029
+ else if (/us|ur/.test(d))
1030
+ g["blur" ==
1031
+ d ? z : v](x)
1032
+ });
1033
+ d.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i", function(b) {
1034
+ var d = b[n], e = /wn|up/.test(d) ? w : B;
1035
+ if (!c[s]) {
1036
+ if ("click" == d)
1037
+ F(a, !1, !0);
1038
+ else {
1039
+ if (/wn|er|in/.test(d))
1040
+ g[v](e);
1041
+ else
1042
+ g[z](e + " " + w);
1043
+ if (m.length && y && e == B)
1044
+ m[/ut|nd/.test(d) ? z : v](C)
1045
+ }
1046
+ if (J)
1047
+ b.stopPropagation();
1048
+ else
1049
+ return!1
1050
+ }
1051
+ })
1052
+ })
1053
+ }
718
1054
  })(window.jQuery || window.Zepto);