pghero 2.2.1 → 2.7.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.

Potentially problematic release.


This version of pghero might be problematic. Click here for more details.

Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +100 -53
  3. data/README.md +20 -8
  4. data/app/assets/javascripts/pghero/Chart.bundle.js +16260 -15580
  5. data/app/assets/javascripts/pghero/application.js +8 -7
  6. data/app/assets/javascripts/pghero/chartkick.js +1973 -1325
  7. data/app/assets/javascripts/pghero/highlight.pack.js +2 -2
  8. data/app/assets/javascripts/pghero/jquery.js +3605 -4015
  9. data/app/assets/javascripts/pghero/nouislider.js +2479 -0
  10. data/app/assets/stylesheets/pghero/application.css +1 -1
  11. data/app/assets/stylesheets/pghero/nouislider.css +299 -0
  12. data/app/controllers/pg_hero/home_controller.rb +97 -42
  13. data/app/helpers/pg_hero/home_helper.rb +11 -0
  14. data/app/views/pg_hero/home/_live_queries_table.html.erb +14 -3
  15. data/app/views/pg_hero/home/connections.html.erb +9 -0
  16. data/app/views/pg_hero/home/index.html.erb +49 -10
  17. data/app/views/pg_hero/home/live_queries.html.erb +1 -1
  18. data/app/views/pg_hero/home/maintenance.html.erb +16 -2
  19. data/app/views/pg_hero/home/relation_space.html.erb +2 -2
  20. data/app/views/pg_hero/home/show_query.html.erb +4 -5
  21. data/app/views/pg_hero/home/space.html.erb +3 -3
  22. data/app/views/pg_hero/home/system.html.erb +4 -4
  23. data/app/views/pg_hero/home/tune.html.erb +2 -1
  24. data/lib/generators/pghero/config_generator.rb +1 -1
  25. data/lib/generators/pghero/query_stats_generator.rb +3 -20
  26. data/lib/generators/pghero/space_stats_generator.rb +3 -20
  27. data/lib/generators/pghero/templates/config.yml.tt +21 -1
  28. data/lib/pghero.rb +82 -17
  29. data/lib/pghero/database.rb +104 -19
  30. data/lib/pghero/methods/basic.rb +34 -25
  31. data/lib/pghero/methods/connections.rb +35 -0
  32. data/lib/pghero/methods/constraints.rb +30 -0
  33. data/lib/pghero/methods/explain.rb +1 -1
  34. data/lib/pghero/methods/indexes.rb +1 -1
  35. data/lib/pghero/methods/maintenance.rb +3 -1
  36. data/lib/pghero/methods/queries.rb +7 -3
  37. data/lib/pghero/methods/query_stats.rb +93 -25
  38. data/lib/pghero/methods/sequences.rb +1 -1
  39. data/lib/pghero/methods/space.rb +4 -0
  40. data/lib/pghero/methods/suggested_indexes.rb +1 -1
  41. data/lib/pghero/methods/system.rb +219 -23
  42. data/lib/pghero/methods/users.rb +4 -0
  43. data/lib/pghero/query_stats.rb +1 -3
  44. data/lib/pghero/space_stats.rb +5 -0
  45. data/lib/pghero/stats.rb +6 -0
  46. data/lib/pghero/version.rb +1 -1
  47. data/lib/tasks/pghero.rake +10 -4
  48. metadata +15 -12
  49. data/app/assets/javascripts/pghero/jquery.nouislider.min.js +0 -31
  50. data/app/assets/stylesheets/pghero/jquery.nouislider.css +0 -165
@@ -1,6 +1,8 @@
1
1
  module PgHero
2
2
  module Methods
3
3
  module Users
4
+ # documented as unsafe to pass user input
5
+ # TODO quote in 3.0, but still not officially supported
4
6
  def create_user(user, password: nil, schema: "public", database: nil, readonly: false, tables: nil)
5
7
  password ||= random_password
6
8
  database ||= connection_model.connection_config[:database]
@@ -39,6 +41,8 @@ module PgHero
39
41
  {password: password}
40
42
  end
41
43
 
44
+ # documented as unsafe to pass user input
45
+ # TODO quote in 3.0, but still not officially supported
42
46
  def drop_user(user, schema: "public", database: nil)
43
47
  database ||= connection_model.connection_config[:database]
44
48
 
@@ -1,7 +1,5 @@
1
1
  module PgHero
2
- class QueryStats < ActiveRecord::Base
3
- self.abstract_class = true
2
+ class QueryStats < Stats
4
3
  self.table_name = "pghero_query_stats"
5
- establish_connection ENV["PGHERO_STATS_DATABASE_URL"] if ENV["PGHERO_STATS_DATABASE_URL"]
6
4
  end
7
5
  end
@@ -0,0 +1,5 @@
1
+ module PgHero
2
+ class SpaceStats < Stats
3
+ self.table_name = "pghero_space_stats"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module PgHero
2
+ class Stats < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ establish_connection PgHero.stats_database_url if PgHero.stats_database_url
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module PgHero
2
- VERSION = "2.2.1"
2
+ VERSION = "2.7.0"
3
3
  end
@@ -1,21 +1,27 @@
1
1
  namespace :pghero do
2
- desc "capture query stats"
2
+ desc "Capture query stats"
3
3
  task capture_query_stats: :environment do
4
4
  PgHero.capture_query_stats(verbose: true)
5
5
  end
6
6
 
7
- desc "capture space stats"
7
+ desc "Capture space stats"
8
8
  task capture_space_stats: :environment do
9
9
  PgHero.capture_space_stats(verbose: true)
10
10
  end
11
11
 
12
- desc "analyze tables"
12
+ desc "Analyze tables"
13
13
  task analyze: :environment do
14
14
  PgHero.analyze_all(verbose: true, min_size: ENV["MIN_SIZE_GB"].to_f.gigabytes)
15
15
  end
16
16
 
17
- desc "autoindex"
17
+ desc "Autoindex tables"
18
18
  task autoindex: :environment do
19
19
  PgHero.autoindex_all(verbose: true, create: true)
20
20
  end
21
+
22
+ desc "Remove old query stats"
23
+ task clean_query_stats: :environment do
24
+ puts "Deleting old query stats..."
25
+ PgHero.clean_query_stats
26
+ end
21
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pghero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord-import
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: pg
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "<"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.0
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "<"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.0
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pg_query
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -124,10 +124,10 @@ files:
124
124
  - app/assets/javascripts/pghero/chartkick.js
125
125
  - app/assets/javascripts/pghero/highlight.pack.js
126
126
  - app/assets/javascripts/pghero/jquery.js
127
- - app/assets/javascripts/pghero/jquery.nouislider.min.js
127
+ - app/assets/javascripts/pghero/nouislider.js
128
128
  - app/assets/stylesheets/pghero/application.css
129
129
  - app/assets/stylesheets/pghero/arduino-light.css
130
- - app/assets/stylesheets/pghero/jquery.nouislider.css
130
+ - app/assets/stylesheets/pghero/nouislider.css
131
131
  - app/controllers/pg_hero/home_controller.rb
132
132
  - app/helpers/pg_hero/home_helper.rb
133
133
  - app/views/layouts/pg_hero/application.html.erb
@@ -161,6 +161,7 @@ files:
161
161
  - lib/pghero/engine.rb
162
162
  - lib/pghero/methods/basic.rb
163
163
  - lib/pghero/methods/connections.rb
164
+ - lib/pghero/methods/constraints.rb
164
165
  - lib/pghero/methods/explain.rb
165
166
  - lib/pghero/methods/indexes.rb
166
167
  - lib/pghero/methods/kill.rb
@@ -176,6 +177,8 @@ files:
176
177
  - lib/pghero/methods/tables.rb
177
178
  - lib/pghero/methods/users.rb
178
179
  - lib/pghero/query_stats.rb
180
+ - lib/pghero/space_stats.rb
181
+ - lib/pghero/stats.rb
179
182
  - lib/pghero/version.rb
180
183
  - lib/tasks/pghero.rake
181
184
  homepage: https://github.com/ankane/pghero
@@ -190,14 +193,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
193
  requirements:
191
194
  - - ">="
192
195
  - !ruby/object:Gem::Version
193
- version: '2.2'
196
+ version: '2.4'
194
197
  required_rubygems_version: !ruby/object:Gem::Requirement
195
198
  requirements:
196
199
  - - ">="
197
200
  - !ruby/object:Gem::Version
198
201
  version: '0'
199
202
  requirements: []
200
- rubygems_version: 3.0.3
203
+ rubygems_version: 3.1.2
201
204
  signing_key:
202
205
  specification_version: 4
203
206
  summary: A performance dashboard for Postgres
@@ -1,31 +0,0 @@
1
- /*
2
-
3
- $.Link (part of noUiSlider) - WTFPL */
4
- (function(c){function m(a,c,d){if((a[c]||a[d])&&a[c]===a[d])throw Error("(Link) '"+c+"' can't match '"+d+"'.'");}function r(a){void 0===a&&(a={});if("object"!==typeof a)throw Error("(Format) 'format' option must be an object.");var h={};c(u).each(function(c,n){if(void 0===a[n])h[n]=A[c];else if(typeof a[n]===typeof A[c]){if("decimals"===n&&(0>a[n]||7<a[n]))throw Error("(Format) 'format.decimals' option must be between 0 and 7.");h[n]=a[n]}else throw Error("(Format) 'format."+n+"' must be a "+typeof A[c]+
5
- ".");});m(h,"mark","thousand");m(h,"prefix","negative");m(h,"prefix","negativeBefore");this.r=h}function k(a,h){"object"!==typeof a&&c.error("(Link) Initialize with an object.");return new k.prototype.p(a.target||function(){},a.method,a.format||{},h)}var u="decimals mark thousand prefix postfix encoder decoder negative negativeBefore to from".split(" "),A=[2,".","","","",function(a){return a},function(a){return a},"-","",function(a){return a},function(a){return a}];r.prototype.a=function(a){return this.r[a]};
6
- r.prototype.L=function(a){function c(a){return a.split("").reverse().join("")}a=this.a("encoder")(a);var d=this.a("decimals"),n="",k="",m="",r="";0===parseFloat(a.toFixed(d))&&(a="0");0>a&&(n=this.a("negative"),k=this.a("negativeBefore"));a=Math.abs(a).toFixed(d).toString();a=a.split(".");this.a("thousand")?(m=c(a[0]).match(/.{1,3}/g),m=c(m.join(c(this.a("thousand"))))):m=a[0];this.a("mark")&&1<a.length&&(r=this.a("mark")+a[1]);return this.a("to")(k+this.a("prefix")+n+m+r+this.a("postfix"))};r.prototype.w=
7
- function(a){function c(a){return a.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}var d;if(null===a||void 0===a)return!1;a=this.a("from")(a);a=a.toString();d=a.replace(RegExp("^"+c(this.a("negativeBefore"))),"");a!==d?(a=d,d="-"):d="";a=a.replace(RegExp("^"+c(this.a("prefix"))),"");this.a("negative")&&(d="",a=a.replace(RegExp("^"+c(this.a("negative"))),"-"));a=a.replace(RegExp(c(this.a("postfix"))+"$"),"").replace(RegExp(c(this.a("thousand")),"g"),"").replace(this.a("mark"),".");a=this.a("decoder")(parseFloat(d+
8
- a));return isNaN(a)?!1:a};k.prototype.K=function(a,h){this.method=h||"html";this.j=c(a.replace("-tooltip-","")||"<div/>")[0]};k.prototype.H=function(a){this.method="val";this.j=document.createElement("input");this.j.name=a;this.j.type="hidden"};k.prototype.G=function(a){function h(a,c){return[c?null:a,c?a:null]}var d=this;this.method="val";this.target=a.on("change",function(a){d.B.val(h(c(a.target).val(),d.t),{link:d,set:!0})})};k.prototype.p=function(a,h,d,k){this.g=d;this.update=!k;if("string"===
9
- typeof a&&0===a.indexOf("-tooltip-"))this.K(a,h);else if("string"===typeof a&&0!==a.indexOf("-"))this.H(a);else if("function"===typeof a)this.target=!1,this.method=a;else{if(a instanceof c||c.zepto&&c.zepto.isZ(a)){if(!h){if(a.is("input, select, textarea")){this.G(a);return}h="html"}if("function"===typeof h||"string"===typeof h&&a[h]){this.method=h;this.target=a;return}}throw new RangeError("(Link) Invalid Link.");}};k.prototype.write=function(a,c,d,k){if(!this.update||!1!==k)if(this.u=a,this.F=a=
10
- this.format(a),"function"===typeof this.method)this.method.call(this.target[0]||d[0],a,c,d);else this.target[this.method](a,c,d)};k.prototype.q=function(a){this.g=new r(c.extend({},a,this.g instanceof r?this.g.r:this.g))};k.prototype.J=function(a){this.B=a};k.prototype.I=function(a){this.t=a};k.prototype.format=function(a){return this.g.L(a)};k.prototype.A=function(a){return this.g.w(a)};k.prototype.p.prototype=k.prototype;c.Link=k})(window.jQuery||window.Zepto);/*
11
-
12
- $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
13
- (function(c){function m(e){return"number"===typeof e&&!isNaN(e)&&isFinite(e)}function r(e){return c.isArray(e)?e:[e]}function k(e,b){e.addClass(b);setTimeout(function(){e.removeClass(b)},300)}function u(e,b){return 100*b/(e[1]-e[0])}function A(e,b){if(b>=e.d.slice(-1)[0])return 100;for(var a=1,c,f,d;b>=e.d[a];)a++;c=e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return d+u(c,0>c[0]?b+Math.abs(c[0]):b-c[0])/(100/(e.c[a]-d))}function a(e,b){if(100<=b)return e.d.slice(-1)[0];for(var a=1,c,f,d;b>=e.c[a];)a++;c=
14
- e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return 100/(e.c[a]-d)*(b-d)*(c[1]-c[0])/100+c[0]}function h(a,b){for(var c=1,g;(a.dir?100-b:b)>=a.c[c];)c++;if(a.m)return g=a.c[c-1],c=a.c[c],b-g>(c-g)/2?c:g;a.h[c-1]?(g=a.h[c-1],c=a.c[c-1]+Math.round((b-a.c[c-1])/g)*g):c=b;return c}function d(a,b){if(!m(b))throw Error("noUiSlider: 'step' is not numeric.");a.h[0]=b}function n(a,b){if("object"!==typeof b||c.isArray(b))throw Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw Error("noUiSlider: Missing 'min' or 'max' in 'range'.");
15
- c.each(b,function(b,g){var d;"number"===typeof g&&(g=[g]);if(!c.isArray(g))throw Error("noUiSlider: 'range' contains invalid value.");d="min"===b?0:"max"===b?100:parseFloat(b);if(!m(d)||!m(g[0]))throw Error("noUiSlider: 'range' value isn't numeric.");a.c.push(d);a.d.push(g[0]);d?a.h.push(isNaN(g[1])?!1:g[1]):isNaN(g[1])||(a.h[0]=g[1])});c.each(a.h,function(b,c){if(!c)return!0;a.h[b]=u([a.d[b],a.d[b+1]],c)/(100/(a.c[b+1]-a.c[b]))})}function E(a,b){"number"===typeof b&&(b=[b]);if(!c.isArray(b)||!b.length||
16
- 2<b.length)throw Error("noUiSlider: 'start' option is incorrect.");a.b=b.length;a.start=b}function I(a,b){a.m=b;if("boolean"!==typeof b)throw Error("noUiSlider: 'snap' option must be a boolean.");}function J(a,b){if("lower"===b&&1===a.b)a.i=1;else if("upper"===b&&1===a.b)a.i=2;else if(!0===b&&2===a.b)a.i=3;else if(!1===b)a.i=0;else throw Error("noUiSlider: 'connect' option doesn't match handle count.");}function D(a,b){switch(b){case "horizontal":a.k=0;break;case "vertical":a.k=1;break;default:throw Error("noUiSlider: 'orientation' option is invalid.");
17
- }}function K(a,b){if(2<a.c.length)throw Error("noUiSlider: 'margin' option is only supported on linear sliders.");a.margin=u(a.d,b);if(!m(b))throw Error("noUiSlider: 'margin' option must be numeric.");}function L(a,b){switch(b){case "ltr":a.dir=0;break;case "rtl":a.dir=1;a.i=[0,2,1,3][a.i];break;default:throw Error("noUiSlider: 'direction' option was not recognized.");}}function M(a,b){if("string"!==typeof b)throw Error("noUiSlider: 'behaviour' must be a string containing options.");var c=0<=b.indexOf("snap");
18
- a.n={s:0<=b.indexOf("tap")||c,extend:0<=b.indexOf("extend"),v:0<=b.indexOf("drag"),fixed:0<=b.indexOf("fixed"),m:c}}function N(a,b,d){a.o=[b.lower,b.upper];a.g=b.format;c.each(a.o,function(a,e){if(!c.isArray(e))throw Error("noUiSlider: 'serialization."+(a?"upper":"lower")+"' must be an array.");c.each(e,function(){if(!(this instanceof c.Link))throw Error("noUiSlider: 'serialization."+(a?"upper":"lower")+"' can only contain Link instances.");this.I(a);this.J(d);this.q(b.format)})});a.dir&&1<a.b&&a.o.reverse()}
19
- function O(a,b){var f={c:[],d:[],h:[!1],margin:0},g;g={step:{e:!1,f:d},start:{e:!0,f:E},connect:{e:!0,f:J},direction:{e:!0,f:L},range:{e:!0,f:n},snap:{e:!1,f:I},orientation:{e:!1,f:D},margin:{e:!1,f:K},behaviour:{e:!0,f:M},serialization:{e:!0,f:N}};a=c.extend({connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"},a);a.serialization=c.extend({lower:[],upper:[],format:{}},a.serialization);c.each(g,function(c,d){if(void 0===a[c]){if(d.e)throw Error("noUiSlider: '"+c+"' is required.");
20
- return!0}d.f(f,a[c],b)});f.style=f.k?"top":"left";return f}function P(a,b){var d=c("<div><div/></div>").addClass(f[2]),g=["-lower","-upper"];a.dir&&g.reverse();d.children().addClass(f[3]+" "+f[3]+g[b]);return d}function Q(a,b){b.j&&(b=new c.Link({target:c(b.j).clone().appendTo(a),method:b.method,format:b.g},!0));return b}function R(a,b){var d,f=[];for(d=0;d<a.b;d++){var k=f,h=d,m=a.o[d],n=b[d].children(),r=a.g,s=void 0,v=[],s=new c.Link({},!0);s.q(r);v.push(s);for(s=0;s<m.length;s++)v.push(Q(n,m[s]));
21
- k[h]=v}return f}function S(a,b,c){switch(a){case 1:b.addClass(f[7]);c[0].addClass(f[6]);break;case 3:c[1].addClass(f[6]);case 2:c[0].addClass(f[7]);case 0:b.addClass(f[6])}}function T(a,b){var c,d=[];for(c=0;c<a.b;c++)d.push(P(a,c).appendTo(b));return d}function U(a,b){b.addClass([f[0],f[8+a.dir],f[4+a.k]].join(" "));return c("<div/>").appendTo(b).addClass(f[1])}function V(d,b,m){function g(){return t[["width","height"][b.k]]()}function n(a){var b,c=[q.val()];for(b=0;b<a.length;b++)q.trigger(a[b],
22
- c)}function u(d,p,e){var g=d[0]!==l[0][0]?1:0,H=x[0]+b.margin,k=x[1]-b.margin;e&&1<l.length&&(p=g?Math.max(p,H):Math.min(p,k));100>p&&(p=h(b,p));p=Math.max(Math.min(parseFloat(p.toFixed(7)),100),0);if(p===x[g])return 1===l.length?!1:p===H||p===k?0:!1;d.css(b.style,p+"%");d.is(":first-child")&&d.toggleClass(f[17],50<p);x[g]=p;b.dir&&(p=100-p);c(y[g]).each(function(){this.write(a(b,p),d.children(),q)});return!0}function B(a,b,c){c||k(q,f[14]);u(a,b,!1);n(["slide","set","change"])}function w(a,c,d,e){a=
23
- a.replace(/\s/g,".nui ")+".nui";c.on(a,function(a){var c=q.attr("disabled");if(q.hasClass(f[14])||void 0!==c&&null!==c)return!1;a.preventDefault();var c=0===a.type.indexOf("touch"),p=0===a.type.indexOf("mouse"),F=0===a.type.indexOf("pointer"),g,k,l=a;0===a.type.indexOf("MSPointer")&&(F=!0);a.originalEvent&&(a=a.originalEvent);c&&(g=a.changedTouches[0].pageX,k=a.changedTouches[0].pageY);if(p||F)F||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,window.pageYOffset=
24
- document.documentElement.scrollTop),g=a.clientX+window.pageXOffset,k=a.clientY+window.pageYOffset;l.C=[g,k];l.cursor=p;a=l;a.l=a.C[b.k];d(a,e)})}function C(a,c){var b=c.b||l,d,e=!1,e=100*(a.l-c.start)/g(),f=b[0][0]!==l[0][0]?1:0;var k=c.D;d=e+k[0];e+=k[1];1<b.length?(0>d&&(e+=Math.abs(d)),100<e&&(d-=e-100),d=[Math.max(Math.min(d,100),0),Math.max(Math.min(e,100),0)]):d=[d,e];e=u(b[0],d[f],1===b.length);1<b.length&&(e=u(b[1],d[f?0:1],!1)||e);e&&n(["slide"])}function s(a){c("."+f[15]).removeClass(f[15]);
25
- a.cursor&&c("body").css("cursor","").off(".nui");G.off(".nui");q.removeClass(f[12]);n(["set","change"])}function v(a,b){1===b.b.length&&b.b[0].children().addClass(f[15]);a.stopPropagation();w(z.move,G,C,{start:a.l,b:b.b,D:[x[0],x[l.length-1]]});w(z.end,G,s,null);a.cursor&&(c("body").css("cursor",c(a.target).css("cursor")),1<l.length&&q.addClass(f[12]),c("body").on("selectstart.nui",!1))}function D(a){var d=a.l,e=0;a.stopPropagation();c.each(l,function(){e+=this.offset()[b.style]});e=d<e/2||1===l.length?
26
- 0:1;d-=t.offset()[b.style];d=100*d/g();B(l[e],d,b.n.m);b.n.m&&v(a,{b:[l[e]]})}function E(a){var c=(a=a.l<t.offset()[b.style])?0:100;a=a?0:l.length-1;B(l[a],c,!1)}var q=c(d),x=[-1,-1],t,y,l;if(q.hasClass(f[0]))throw Error("Slider was already initialized.");t=U(b,q);l=T(b,t);y=R(b,l);S(b.i,q,l);(function(a){var b;if(!a.fixed)for(b=0;b<l.length;b++)w(z.start,l[b].children(),v,{b:[l[b]]});a.s&&w(z.start,t,D,{b:l});a.extend&&(q.addClass(f[16]),a.s&&w(z.start,q,E,{b:l}));a.v&&(b=t.find("."+f[7]).addClass(f[10]),
27
- a.fixed&&(b=b.add(t.children().not(b).children())),w(z.start,b,v,{b:l}))})(b.n);d.vSet=function(){var a=Array.prototype.slice.call(arguments,0),d,e,g,h,m,s,t=r(a[0]);"object"===typeof a[1]?(d=a[1].set,e=a[1].link,g=a[1].update,h=a[1].animate):!0===a[1]&&(d=!0);b.dir&&1<b.b&&t.reverse();h&&k(q,f[14]);a=1<l.length?3:1;1===t.length&&(a=1);for(m=0;m<a;m++)h=e||y[m%2][0],h=h.A(t[m%2]),!1!==h&&(h=A(b,h),b.dir&&(h=100-h),!0!==u(l[m%2],h,!0)&&c(y[m%2]).each(function(a){if(!a)return s=this.u,!0;this.write(s,
28
- l[m%2].children(),q,g)}));!0===d&&n(["set"]);return this};d.vGet=function(){var a,c=[];for(a=0;a<b.b;a++)c[a]=y[a][0].F;return 1===c.length?c[0]:b.dir?c.reverse():c};d.destroy=function(){c.each(y,function(){c.each(this,function(){this.target&&this.target.off(".nui")})});c(this).off(".nui").removeClass(f.join(" ")).empty();return m};q.val(b.start)}function W(a){if(!this.length)throw Error("noUiSlider: Can't initialize slider on empty selection.");var b=O(a,this);return this.each(function(){V(this,
29
- b,a)})}function X(a){return this.each(function(){var b=c(this).val(),d=this.destroy(),f=c.extend({},d,a);c(this).noUiSlider(f);d.start===f.start&&c(this).val(b)})}function B(){return this[0][arguments.length?"vSet":"vGet"].apply(this[0],arguments)}var G=c(document),C=c.fn.val,z=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",
30
- end:"mouseup touchend"},f="noUi-target noUi-base noUi-origin noUi-handle noUi-horizontal noUi-vertical noUi-background noUi-connect noUi-ltr noUi-rtl noUi-dragable noUi-state-drag noUi-state-tap noUi-active noUi-extended noUi-stacking".split(" ");c.fn.val=function(){var a=arguments,b=c(this[0]);return arguments.length?this.each(function(){(c(this).hasClass(f[0])?B:C).apply(c(this),a)}):(b.hasClass(f[0])?B:C).call(b)};c.noUiSlider={Link:c.Link};c.fn.noUiSlider=function(a,b){return(b?X:W).call(this,
31
- a)}})(window.jQuery||window.Zepto);
@@ -1,165 +0,0 @@
1
-
2
- /* Functional styling;
3
- * These styles are required for noUiSlider to function.
4
- * You don't need to change these rules to apply your design.
5
- */
6
- .noUi-target,
7
- .noUi-target * {
8
- -webkit-touch-callout: none;
9
- -webkit-user-select: none;
10
- -ms-touch-action: none;
11
- -ms-user-select: none;
12
- -moz-user-select: none;
13
- -moz-box-sizing: border-box;
14
- box-sizing: border-box;
15
- }
16
- .noUi-base {
17
- width: 100%;
18
- height: 100%;
19
- position: relative;
20
- }
21
- .noUi-origin {
22
- position: absolute;
23
- right: 0;
24
- top: 0;
25
- left: 0;
26
- bottom: 0;
27
- }
28
- .noUi-handle {
29
- position: relative;
30
- z-index: 1;
31
- }
32
- .noUi-stacking .noUi-handle {
33
- /* This class is applied to the lower origin when
34
- its values is > 50%. */
35
- z-index: 10;
36
- }
37
- .noUi-stacking + .noUi-origin {
38
- /* Fix stacking order in IE7, which incorrectly
39
- creates a new context for the origins. */
40
- *z-index: -1;
41
- }
42
- .noUi-state-tap .noUi-origin {
43
- -webkit-transition: left 0.3s, top 0.3s;
44
- transition: left 0.3s, top 0.3s;
45
- }
46
- .noUi-state-drag * {
47
- cursor: inherit !important;
48
- }
49
-
50
- /* Slider size and handle placement;
51
- */
52
- .noUi-horizontal {
53
- height: 18px;
54
- }
55
- .noUi-horizontal .noUi-handle {
56
- width: 34px;
57
- height: 28px;
58
- left: -17px;
59
- top: -6px;
60
- }
61
- .noUi-horizontal.noUi-extended {
62
- padding: 0 15px;
63
- }
64
- .noUi-horizontal.noUi-extended .noUi-origin {
65
- right: -15px;
66
- }
67
- .noUi-vertical {
68
- width: 18px;
69
- }
70
- .noUi-vertical .noUi-handle {
71
- width: 28px;
72
- height: 34px;
73
- left: -6px;
74
- top: -17px;
75
- }
76
- .noUi-vertical.noUi-extended {
77
- padding: 15px 0;
78
- }
79
- .noUi-vertical.noUi-extended .noUi-origin {
80
- bottom: -15px;
81
- }
82
-
83
- /* Styling;
84
- */
85
- .noUi-background {
86
- background: #FAFAFA;
87
- box-shadow: inset 0 1px 1px #f0f0f0;
88
- }
89
- .noUi-connect {
90
- background: #3FB8AF;
91
- box-shadow: inset 0 0 3px rgba(51,51,51,0.45);
92
- -webkit-transition: background 450ms;
93
- transition: background 450ms;
94
- }
95
- .noUi-origin {
96
- border-radius: 2px;
97
- }
98
- .noUi-target {
99
- border-radius: 4px;
100
- border: 1px solid #D3D3D3;
101
- box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;
102
- }
103
- .noUi-target.noUi-connect {
104
- box-shadow: inset 0 0 3px rgba(51,51,51,0.45), 0 3px 6px -5px #BBB;
105
- }
106
-
107
- /* Handles and cursors;
108
- */
109
- .noUi-dragable {
110
- cursor: w-resize;
111
- }
112
- .noUi-vertical .noUi-dragable {
113
- cursor: n-resize;
114
- }
115
- .noUi-handle {
116
- border: 1px solid #D9D9D9;
117
- border-radius: 3px;
118
- background: #FFF;
119
- cursor: default;
120
- box-shadow: inset 0 0 1px #FFF,
121
- inset 0 1px 7px #EBEBEB,
122
- 0 3px 6px -3px #BBB;
123
- }
124
- .noUi-active {
125
- box-shadow: inset 0 0 1px #FFF,
126
- inset 0 1px 7px #DDD,
127
- 0 3px 6px -3px #BBB;
128
- }
129
-
130
- /* Handle stripes;
131
- */
132
- .noUi-handle:before,
133
- .noUi-handle:after {
134
- content: "";
135
- display: block;
136
- position: absolute;
137
- height: 14px;
138
- width: 1px;
139
- background: #E8E7E6;
140
- left: 14px;
141
- top: 6px;
142
- }
143
- .noUi-handle:after {
144
- left: 17px;
145
- }
146
- .noUi-vertical .noUi-handle:before,
147
- .noUi-vertical .noUi-handle:after {
148
- width: 14px;
149
- height: 1px;
150
- left: 6px;
151
- top: 14px;
152
- }
153
- .noUi-vertical .noUi-handle:after {
154
- top: 17px;
155
- }
156
-
157
- /* Disabled state;
158
- */
159
- [disabled].noUi-connect,
160
- [disabled] .noUi-connect {
161
- background: #B8B8B8;
162
- }
163
- [disabled] .noUi-handle {
164
- cursor: not-allowed;
165
- }