combo_auto_box 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/lib/combo_auto_box/active_record.rb +0 -0
  3. data/lib/combo_auto_box/engine.rb +0 -0
  4. data/lib/combo_auto_box/railtie.rb +0 -0
  5. data/lib/combo_auto_box/version.rb +1 -1
  6. data/lib/combo_auto_box.rb +0 -0
  7. data/spec/combo_auto_box_spec.rb +0 -0
  8. data/spec/database.yml +0 -0
  9. data/spec/finders/activerecord_test_connector.rb +0 -0
  10. data/spec/fixtures/job.rb +0 -0
  11. data/spec/fixtures/jobs.yml +0 -0
  12. data/spec/fixtures/people.yml +0 -0
  13. data/spec/fixtures/person.rb +0 -0
  14. data/spec/fixtures/schema.rb +0 -0
  15. data/spec/spec_helper.rb +0 -0
  16. data/test/combo_auto_box_rails_test.rb +0 -0
  17. data/test/dummy/Rakefile +0 -0
  18. data/test/dummy/config/application.rb +0 -0
  19. data/test/dummy/config/boot.rb +0 -0
  20. data/test/dummy/config/environment.rb +0 -0
  21. data/test/dummy/config/environments/development.rb +0 -0
  22. data/test/dummy/config/environments/production.rb +0 -0
  23. data/test/dummy/config/environments/test.rb +0 -0
  24. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
  25. data/test/dummy/config/initializers/inflections.rb +0 -0
  26. data/test/dummy/config/initializers/mime_types.rb +0 -0
  27. data/test/dummy/config/initializers/secret_token.rb +0 -0
  28. data/test/dummy/config/initializers/session_store.rb +0 -0
  29. data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
  30. data/test/dummy/config/locales/en.yml +0 -0
  31. data/test/dummy/config/routes.rb +0 -0
  32. data/test/dummy/config.ru +0 -0
  33. data/test/dummy/log/test.log +0 -0
  34. data/test/test_helper.rb +0 -0
  35. data/vendor/assets/images/combo_auto_box_expand.png +0 -0
  36. data/vendor/assets/images/dark-grey-disclosure-arrow-down.png +0 -0
  37. data/vendor/assets/images/light-grey-disclosure-arrow-down.png +0 -0
  38. data/vendor/assets/javascripts/combo-auto-box.js +65 -6
  39. data/vendor/assets/stylesheets/combo-auto-box-bootstrap.css +0 -0
  40. data/vendor/assets/stylesheets/combo-auto-box.css +19 -3
  41. metadata +16 -21
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9121959ce06292542a08cf21938afa27fea2c8c9
4
+ data.tar.gz: decfc0be015e7c24539e07f11ea5b0f2803326c5
5
+ SHA512:
6
+ metadata.gz: 4868baa85babbc92b0281b96a21b1ca78bd20adbd17db2f6aa429220b0113d85c114f5f1dcb61b74767660eff95e8fdf7be91580ca05e157749d44def48e6e95
7
+ data.tar.gz: f54ed93e2e0ef2cc2cb8fe5b1d4ae16cb5211e31c3bf32bbc97fe845fcab991bcac3467fe3fedf6946f98af35a0fbd6a3f87c2e8966546c7da0cfc0d4f67ecd6
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module ComboAutoBox
2
- VERSION = '0.0.32'
2
+ VERSION = '0.0.33'
3
3
  end
File without changes
File without changes
data/spec/database.yml CHANGED
File without changes
File without changes
data/spec/fixtures/job.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/spec_helper.rb CHANGED
File without changes
File without changes
data/test/dummy/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/test/dummy/config.ru CHANGED
File without changes
File without changes
data/test/test_helper.rb CHANGED
File without changes
File without changes
@@ -277,6 +277,28 @@ var ComboAutoBox = {
277
277
  return title;
278
278
  };
279
279
 
280
+ var i18nSelectAll = function (language) {
281
+ var title = 'Select All';
282
+ switch(language) {
283
+ case 'pt-br':
284
+ title = 'Selecionar Tudo';
285
+ break;
286
+ case 'pt':
287
+ title = 'Selecionar Tudo';
288
+ break;
289
+ case 'fr':
290
+ title = 'Sélectionner Tout';
291
+ break;
292
+ case 'es':
293
+ title = 'Seleccionar Todo';
294
+ break;
295
+ case 'it':
296
+ title = 'Seleziona Tutto';
297
+ break;
298
+ }
299
+ return title;
300
+ };
301
+
280
302
  // generates text field with html options
281
303
  var generateInputTag = function () {
282
304
  var html = 'input type="text"';
@@ -431,7 +453,18 @@ var ComboAutoBox = {
431
453
 
432
454
  // dialog modal
433
455
  var generateDivDialogModal = function (modalDialogId) {
434
- $('<div id="'+ modalDialogId +'" class="dialog-modal"><div class="head"><span class="label">' + options.label + '</span><span class="close" title="Close">X</span></div><div class="list"><ul></ul></div></div>').appendTo('#' + container);
456
+ $('<div id="'+ modalDialogId +'" class="dialog-modal">' +
457
+ '<div class="head">' +
458
+ '<span class="label">' + options.label + '</span>' +
459
+ '<span class="close" title="Close">X</span>' +
460
+ '</div>' +
461
+ '<div class="list">' +
462
+ '<ul></ul>' +
463
+ '</div>' +
464
+ '<div class="footer">' +
465
+ '<a href="javascript:void(0)" class="selectAll">' + i18nSelectAll() + '</a>' +
466
+ '</div>' +
467
+ '</div>').appendTo('#' + container);
435
468
 
436
469
  $('#' + modalDialogId + ' > div.head > span.close').click(function() {
437
470
  $('#' + modalDialogId).dialog('close');
@@ -439,10 +472,12 @@ var ComboAutoBox = {
439
472
 
440
473
  $('#' + modalDialogId).dialog({
441
474
  width: 500,
442
- height: 400,
475
+ height: 412,
443
476
  modal: true,
444
477
  closeOnEscape: true,
445
478
  autoOpen: false,
479
+ margin: 0,
480
+ padding: 0,
446
481
  });
447
482
 
448
483
  getListForModalDialog(modalDialogId);
@@ -452,6 +487,10 @@ var ComboAutoBox = {
452
487
  $('#' + container + ' > div.container-combo-auto-box > span.' + options.type).click(function() {
453
488
  openModalDialog(modalDialogId)
454
489
  });
490
+
491
+ $('a.selectAll').click(function() {
492
+ selectAllData(container, modalDialogId);
493
+ });
455
494
  };
456
495
 
457
496
  // dialog modal
@@ -470,19 +509,24 @@ var ComboAutoBox = {
470
509
  '<h4 class="modal-title">' + options.label + '</h4>' +
471
510
  '</div>' +
472
511
  '<div class="modal-body">' +
473
- '<div class="list-group" style="overflow:auto;height:440px"></div>' +
512
+ '<div class="list-group" style="overflow:auto;height:440px"></div>' +
474
513
  '</div>' +
514
+ ((options.type == 'multiple') ? '<div class="modal-footer"><button id="selectAll" type="button" class="btn btn-primary">' + i18nSelectAll() + '</button></div>' : '') +
475
515
  '</div>' +
476
516
  '</div>' +
477
517
  '</div>';
478
518
 
479
- $(modal).appendTo('#' + container);
519
+ $(modal).appendTo('#' + container);
480
520
 
481
521
  getListForModalDialog(modalDialogId);
482
522
 
483
523
  $(targetObject).click(function() {
484
524
  $('#' + modalDialogId).modal('show');
485
- });
525
+ });
526
+
527
+ $('button#selectAll').click(function() {
528
+ selectAllData(container, modalDialogId);
529
+ });
486
530
  };
487
531
 
488
532
  // Selects an item form modal dialog when clicked on
@@ -521,7 +565,7 @@ var ComboAutoBox = {
521
565
  items.push('<li><span class="combo-auto-box-item-id">' + data[index].id +'</span><span class="combo-auto-box-item-label">'+ data[index].label + '</span></li>');
522
566
  });
523
567
 
524
- $('#' + modalDialogId + ' > div.list').css('height', ($('#' + modalDialogId).dialog("option", "height") - 60) + 'px');
568
+ $('#' + modalDialogId + ' > div.list').css('height', ($('#' + modalDialogId).dialog("option", "height") - 90) + 'px');
525
569
  $('#' + modalDialogId + ' > div.list > ul').html(items.join(''));
526
570
  $('#' + modalDialogId + ' > div.list > ul > li').click(function() {
527
571
  var thisId = $(this).children('span.combo-auto-box-item-id').text();
@@ -814,6 +858,21 @@ var ComboAutoBox = {
814
858
  var matched = value.match(pattern);
815
859
  return matched[1];
816
860
  }
861
+
862
+ var selectAllData = function(container, modalDialogId) {
863
+ var inputId = $('#' + container + ' > div.container-combo-auto-box > input').attr('id');
864
+ if (options.bootstrap) {
865
+ inputId = $('#' + container + ' > div.container-combo-auto-box-bootstrap > input').attr('id');
866
+ $('#' + modalDialogId).modal('hide');
867
+ } else {
868
+ $('#' + modalDialogId).dialog('close');
869
+ }
870
+
871
+ $.each(options.source, function( index, value ){
872
+ selectData(value.id, value.label);
873
+ addMultipleItem(inputId, value.id, value.label);
874
+ });
875
+ }
817
876
 
818
877
  // main
819
878
  if (options == null) {
@@ -23,14 +23,30 @@ div.searchable div.item span { margin-left:10px; color:#CCCCCC; }
23
23
  div.searchable div.item span:hover { color:#FFFFFF; cursor:pointer;}
24
24
  div.searchable input:focus {outline:none; }
25
25
 
26
- div.dialog-modal div.head { display:block; width:99%; position:absolute; z-index:2002; top:0px; left:0px; border: 1px solid #000; background-color:#CECECE; height:30px; -moz-border-radius:4px;-webkit-border-radius:4px;}
26
+ div.dialog-modal div.head { display:table; width:99%; float:left; border: 1px solid #000; background-color:#CECECE; height:30px; -moz-border-radius:4px;-webkit-border-radius:4px; }
27
27
  div.dialog-modal div.head span.label { float:left; margin: 5px 0 0 10px; padding: 0 0 0 0; text-weight: bold; font-size:16px; font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";}
28
28
  div.dialog-modal div.head span.close { float:right; margin: 5px 10px 0 0; padding: 0 0 0 0; font-size:16px; font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; text-indent: 0;}
29
29
  div.dialog-modal div.head span.close:hover { cursor:pointer; text-decoration:underline; }
30
30
 
31
- div.dialog-modal div.list { display:block; width:99%; position:absolute; z-index:2003; top:40px; left:0px; overflow-y:auto; overflow-x:hidden;}
31
+ div.dialog-modal div.list { display:block; height:100px; width:99%; float:left; overflow-y:auto; overflow-x:hidden;}
32
+
33
+ div.dialog-modal div.list ul { list-style:none; width:100%; height:100px; float:left; display:table; padding: 0; margin: 0;}
34
+
35
+ div.dialog-modal div.list ul li { padding: 5px 0 5px 3px; margin-left:0px; width:100%; border-bottom:1px solid #DCDCDC; font-size:12px; }
36
+ div.dialog-modal div.list ul li:hover { cursor:pointer; text-decoration:underline; background-color:#F9F9F9; }
37
+
38
+ div.dialog-modal div.footer { display:table; width:99%; float:left; margin-top:12px; text-align: right;}
39
+
40
+ /*div.dialog-modal div.head { display:block; width:99%; position:absolute; z-index:2002; top:0px; left:0px; border: 1px solid #000; background-color:#CECECE; height:30px; -moz-border-radius:4px;-webkit-border-radius:4px;}
41
+ div.dialog-modal div.head span.label { float:left; margin: 5px 0 0 10px; padding: 0 0 0 0; text-weight: bold; font-size:16px; font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";}
42
+ div.dialog-modal div.head span.close { float:right; margin: 5px 10px 0 0; padding: 0 0 0 0; font-size:16px; font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; text-indent: 0;}
43
+ div.dialog-modal div.head span.close:hover { cursor:pointer; text-decoration:underline; }
44
+
45
+ div.dialog-modal div.list { display:block; height:200px; width:99%; position:absolute; z-index:2003; top:40px; left:0px; overflow-y:auto; overflow-x:hidden;}
32
46
 
33
47
  div.dialog-modal div.list ul { list-style:none; width:100%; position:absolute; z-index:2004; top:0px; left:0px; display:block; padding: 0; margin: 0;}
34
48
 
35
49
  div.dialog-modal div.list ul li { padding: 5px 0 5px 3px; margin-left:0px; width:100%; border-bottom:1px solid #DCDCDC; font-size:12px; }
36
- div.dialog-modal div.list ul li:hover { cursor:pointer; text-decoration:underline; background-color:#F9F9F9; }
50
+ div.dialog-modal div.list ul li:hover { cursor:pointer; text-decoration:underline; background-color:#F9F9F9; }
51
+
52
+ div.dialog-modal div.footer { display:block; width:99%; position:absolute; z-index:2004; bottom: 5px; left:400px; height:20px;}*/
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combo_auto_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
5
- prerelease:
4
+ version: 0.0.33
6
5
  platform: ruby
7
6
  authors:
8
7
  - Adilson Chacon
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-12-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Text Field Autocomplete To Replace Comboboxes.
@@ -34,17 +31,11 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
34
+ - lib/combo_auto_box.rb
37
35
  - lib/combo_auto_box/active_record.rb
38
36
  - lib/combo_auto_box/engine.rb
39
37
  - lib/combo_auto_box/railtie.rb
40
38
  - lib/combo_auto_box/version.rb
41
- - lib/combo_auto_box.rb
42
- - vendor/assets/images/combo_auto_box_expand.png
43
- - vendor/assets/images/dark-grey-disclosure-arrow-down.png
44
- - vendor/assets/images/light-grey-disclosure-arrow-down.png
45
- - vendor/assets/javascripts/combo-auto-box.js
46
- - vendor/assets/stylesheets/combo-auto-box-bootstrap.css
47
- - vendor/assets/stylesheets/combo-auto-box.css
48
39
  - spec/combo_auto_box_spec.rb
49
40
  - spec/database.yml
50
41
  - spec/finders/activerecord_test_connector.rb
@@ -73,31 +64,36 @@ files:
73
64
  - test/dummy/config/routes.rb
74
65
  - test/dummy/log/test.log
75
66
  - test/test_helper.rb
67
+ - vendor/assets/images/combo_auto_box_expand.png
68
+ - vendor/assets/images/dark-grey-disclosure-arrow-down.png
69
+ - vendor/assets/images/light-grey-disclosure-arrow-down.png
70
+ - vendor/assets/javascripts/combo-auto-box.js
71
+ - vendor/assets/stylesheets/combo-auto-box-bootstrap.css
72
+ - vendor/assets/stylesheets/combo-auto-box.css
76
73
  homepage: https://github.com/adilsonchacon/combo_auto_box
77
74
  licenses:
78
75
  - MIT
79
76
  - GPL-2
77
+ metadata: {}
80
78
  post_install_message:
81
79
  rdoc_options: []
82
80
  require_paths:
83
81
  - lib
84
82
  required_ruby_version: !ruby/object:Gem::Requirement
85
- none: false
86
83
  requirements:
87
- - - ! '>='
84
+ - - ">="
88
85
  - !ruby/object:Gem::Version
89
86
  version: '0'
90
87
  required_rubygems_version: !ruby/object:Gem::Requirement
91
- none: false
92
88
  requirements:
93
- - - ! '>='
89
+ - - ">="
94
90
  - !ruby/object:Gem::Version
95
91
  version: '0'
96
92
  requirements: []
97
93
  rubyforge_project:
98
- rubygems_version: 1.8.24
94
+ rubygems_version: 2.4.3
99
95
  signing_key:
100
- specification_version: 3
96
+ specification_version: 4
101
97
  summary: Text Field Autocomplete To Replace Comboboxes
102
98
  test_files:
103
99
  - spec/combo_auto_box_spec.rb
@@ -128,4 +124,3 @@ test_files:
128
124
  - test/dummy/config/routes.rb
129
125
  - test/dummy/log/test.log
130
126
  - test/test_helper.rb
131
- has_rdoc: