sinatra-hexacta 0.3.17 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ce9729468b924495d760e891e5011f6ec91a7a1d5867445043fb36cd8c7cced
4
- data.tar.gz: 84206d7c18208e55794e01e00904c1c58f0781f7f7116045d560ae44ec6bb659
3
+ metadata.gz: 97f4b7ddae3eed8c5c72cb43e0782c54b1110c732d1a4799d4c6455584bc9f0f
4
+ data.tar.gz: 9e3fd98d2ee05cbb2ace638f1e743c5d70a13bdb749e0d8c5396e2a8ba8c230a
5
5
  SHA512:
6
- metadata.gz: 407744e4cf104e64dd731aaca8b3c302b888b6045065cba2f35789c99700c9459d8806879fc76cb6adb7216285805472849cd9e832f0ae13c31ffb35ee2e6372
7
- data.tar.gz: 2523b68e3033e60b18f4dd0b6efeafd16f68b8a5ba1f1b2baaf38e5622fe26f3bb72deea41338bc250a1fa1da9c709f339c939b44d0b8cb2623cd1955d4a123e
6
+ metadata.gz: 9e122a0675221f5c77fd5863b558d078c5717861d040841b170e4d77ea9614b0ad5ac2ba1ea1746d71f8e19674bc1b4467561ac83e2760d12ed6a3701bdd463d
7
+ data.tar.gz: dae1e7b0facb4f41be2b769e551ae20b16cd70f1a0f1eb66a95606fddba8bb26d72ac9797371e391159875de4879c108d647efd3793d552adb3f81caaad38814
@@ -3,6 +3,7 @@ require 'sinatra/base'
3
3
  require 'fileutils'
4
4
  require 'sucker_punch'
5
5
  require 'rufus-scheduler'
6
+ require 'similar_text'
6
7
 
7
8
  module Sinatra
8
9
 
@@ -11247,10 +11247,6 @@ body:not(.sw-toggled) #sidebar {
11247
11247
  }
11248
11248
  }
11249
11249
 
11250
- .listview.lv-lg .lv-item:hover {
11251
- background-color: #FFFFDB;
11252
- }
11253
-
11254
11250
  .listview .lv-item {
11255
11251
  position: relative;
11256
11252
  display: block;
@@ -16359,4 +16355,35 @@ svg.ct-chart-bar, svg.ct-chart-line{
16359
16355
  .ct-legend .ct-series-14:before {
16360
16356
  background-color: #a748ca;
16361
16357
  border-color: #a748ca;
16362
- }
16358
+ }
16359
+
16360
+ /* HEADER RESULTS */
16361
+
16362
+ #header .results {
16363
+ display:block;
16364
+ position: absolute;
16365
+ width: 500px;
16366
+ background: white;
16367
+ margin-left: 20px;
16368
+ margin-top: 5px;
16369
+ border-radius: 2px;
16370
+ overflow: auto;
16371
+ max-height: 0px;
16372
+ opacity: 0;
16373
+ -webkit-transition: all 0.2s ease-in-out;
16374
+ -o-transition: all 0.2s ease-in-out;
16375
+ transition: all 0.2s ease-in-out;
16376
+ }
16377
+ #header .results.toggled {
16378
+ opacity: 1;
16379
+ max-height: 400px;
16380
+ }
16381
+
16382
+ .progressive {
16383
+ animation: load 5s cubic-bezier(0.165, 0.840, 0.440, 1.000) forwards;
16384
+ }
16385
+
16386
+ @keyframes load {
16387
+ 0% { width: 0; }
16388
+ 100% { width: 100%; }
16389
+ }
@@ -0,0 +1,79 @@
1
+ class Finder {
2
+
3
+ static find(query){
4
+ $.ajax({
5
+ url: "/find",
6
+ type: 'GET',
7
+ data: { query: query }
8
+ }).done(function(result) {
9
+ $("#header .results").html(result);
10
+ });
11
+ }
12
+
13
+ static do_find(url,query,html){
14
+ $.ajax({
15
+ url: url,
16
+ type: 'GET',
17
+ data: { query: query }
18
+ }).done(function(result) {
19
+ $(html).html(result);
20
+ });
21
+ }
22
+ }
23
+
24
+ var last_query = null;
25
+ var header_input_timeout = null;
26
+ $.xhrPool = [];
27
+
28
+ $.xhrPool.abortAll = function() {
29
+ $(this).each(function(idx, jqXHR) {
30
+ jqXHR.abort();
31
+ });
32
+ $(this).each(function(idx, jqXHR) {
33
+ var index = $.inArray(jqXHR, $.xhrPool);
34
+ if (index > -1) {
35
+ $.xhrPool.splice(index, 1);
36
+ }
37
+ });
38
+ };
39
+
40
+ $.ajaxSetup({
41
+ beforeSend: function(jqXHR) {
42
+ $.xhrPool.push(jqXHR);
43
+ },
44
+ complete: function(jqXHR) {
45
+ var index = $.inArray(jqXHR, $.xhrPool);
46
+ if (index > -1) {
47
+ $.xhrPool.splice(index, 1);
48
+ }
49
+ }
50
+ });
51
+
52
+ $(document).ready(function(){
53
+
54
+ $("#header input").focusin(function() {
55
+ $("#header .results").addClass("toggled");
56
+ })
57
+ $("#header input").focusout(function() {
58
+ $("#header .results").removeClass("toggled");
59
+ })
60
+ $('#header .results').click(function() {
61
+ $("#header input").focus();
62
+ });
63
+ $('#header input').keyup(function() {
64
+ clearTimeout(header_input_timeout);
65
+
66
+ if($('#header input').val().length > 2 && $.trim($('#header input').val())) {
67
+ header_input_timeout = setTimeout(function() {
68
+ $.xhrPool.abortAll();
69
+ if (last_query != $.trim($('#header input').val())) {
70
+ last_query = $.trim($('#header input').val());
71
+ console.log(last_query);
72
+ if (last_query.length > 2) {
73
+ Finder.find(last_query);
74
+ }
75
+ }
76
+ }, 1000);
77
+ }
78
+ });
79
+ });
@@ -1,13 +1,14 @@
1
1
  .row
2
2
  .col-xs-12
3
- .lv-item.p-20.bgm-orange.m-b-5
4
- .media
5
- .pull-left
6
- i.zmdi.zmdi-hc-3x.zmdi-cloud-off.c-white
7
- .media-body
8
- .lv-title.c-white Error de conexión con la base de datos
9
- small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
10
-
3
+ .progress.progress-striped.active.bgm-red style="height:80px;"
4
+ .progress-bar.progress-bar-danger aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" style="width: 0%;text-align:left;"
5
+ .lv-item.p-20.p-fixed
6
+ .media
7
+ .pull-left
8
+ i.zmdi.zmdi-hc-3x.zmdi-cloud-off.c-white
9
+ .media-body
10
+ .lv-title.c-white Error de conexión con la base de datos
11
+ small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
11
12
 
12
13
 
13
14
  javascript:
@@ -15,4 +16,12 @@ javascript:
15
16
  setTimeout(function(){
16
17
  window.location.reload(1);
17
18
  }, 5000);
18
- });
19
+
20
+ update_progress();
21
+
22
+ function update_progress() {
23
+ var current = $(".progress-bar").width() / $('.progress-bar').parent().width() * 100;
24
+ $(".progress-bar").width( current + 10 + "%");
25
+ setTimeout(update_progress, 100);
26
+ }
27
+ });
@@ -1,12 +1,14 @@
1
1
  .row
2
2
  .col-xs-12
3
- .lv-item.p-20.bgm-orange.m-b-5
4
- .media
5
- .pull-left
6
- i.zmdi.zmdi-hc-3x.zmdi-cloud-off.c-white
7
- .media-body
8
- .lv-title.c-white Conexión con la base de datos
9
- small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
3
+ .progress.progress-striped.active.bgm-orange style="height:80px;"
4
+ .progress-bar.progress-bar-warning aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" style="width: 0%;text-align:left;"
5
+ .lv-item.p-20.p-fixed
6
+ .media
7
+ .pull-left
8
+ i.zmdi.zmdi-hc-3x.zmdi-cloud-off.c-white
9
+ .media-body
10
+ .lv-title.c-white Conexión con la base de datos
11
+ small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
10
12
 
11
13
 
12
14
 
@@ -15,4 +17,13 @@ javascript:
15
17
  setTimeout(function(){
16
18
  window.location.reload(1);
17
19
  }, 5000);
18
- });
20
+
21
+ update_progress();
22
+
23
+ function update_progress() {
24
+ var current = $(".progress-bar").width() / $('.progress-bar').parent().width() * 100;
25
+ $(".progress-bar").width( current + 10 + "%");
26
+ setTimeout(update_progress, 100);
27
+ }
28
+ });
29
+
@@ -6,3 +6,4 @@ script src="/sinatra-hexacta/vendors/chartist/chartist.min.js"
6
6
  script src="/sinatra-hexacta/vendors/chartist/chartist-plugin-legend.js"
7
7
 
8
8
  script src="/sinatra-hexacta/js/app.js?ver=#{settings.version}" type='text/javascript'
9
+ script src="/sinatra-hexacta/js/finder.js?ver=#{settings.version}" type='text/javascript'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: similar_text
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.4
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.4
55
69
  description: A gem to support general functionality accross all apps
56
70
  email: mzanger@hexacta.com
57
71
  executables: []
@@ -110,10 +124,11 @@ files:
110
124
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.svg
111
125
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
112
126
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
127
+ - lib/sinatra/public/img/finder.jpg
113
128
  - lib/sinatra/public/img/select.png
114
129
  - lib/sinatra/public/img/select@2x.png
115
130
  - lib/sinatra/public/js/app.js
116
- - lib/sinatra/public/js/form_validator.js
131
+ - lib/sinatra/public/js/finder.js
117
132
  - lib/sinatra/public/vendors/animate.css/animate.min.css
118
133
  - lib/sinatra/public/vendors/bootstrap-validator/validator.js
119
134
  - lib/sinatra/public/vendors/bootstrap/bootstrap.min.js
@@ -1,29 +0,0 @@
1
-
2
- $(':input[required]').each(function() {
3
- console.log($(this).val());
4
- if ($(this).val() == "" || $(this).val() == null) {
5
- $(this).parent().removeClass("has-success");
6
- $(this).parent().addClass("has-error");
7
- } else {
8
- $(this).parent().removeClass("has-error");
9
- $(this).parent().addClass("has-success");
10
- }
11
- })
12
-
13
-
14
- $(function() { //shorthand document.ready function
15
- $('form').on('submit', function(e) { //use on if jQuery 1.7+
16
- $(this).find(':input[required]').each(function() {
17
- if ($(this).val() == "" || $(this).val() == null) {
18
- $(this).parent().removeClass("success");
19
- $(this).parent().addClass("error");
20
- } else {
21
- $(this).parent().removeClass("error");
22
- $(this).parent().addClass("success");
23
- }
24
- })
25
- if ($(this).find(':input[required]').length > 0) {
26
- e.preventDefault();
27
- }
28
- });
29
- });