angular-smart-search 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 2f7521287ba8a4189f22a5835f53d2dc5743d234
4
- data.tar.gz: 7eb1f618794192008154d0fadafaa35fb5b71e79
3
+ metadata.gz: dae3dc6da4ef7ece3dcfbae6f3690f65f970407c
4
+ data.tar.gz: 3763c61e4ef2b99c2cbc794458e0c37ff1a715b7
5
5
  SHA512:
6
- metadata.gz: 461f8d6cb3c254110b93077c6c87054abff4822c513fe07cbb5fe14c5432b840b8661afb73d2f5466a6208772d9e88bfb3997574836557cfd2ded81dc0c590c4
7
- data.tar.gz: cf57d634b97d7c6f5c636d97ab5e3d5ef95244ad67ef02db71f26a78619ad58a42608c7b87f8800d168d61d254df60997493163e53c08348d70eeee7a5188584
6
+ metadata.gz: 21133229a0789b1cb27d1bc686afcae58e8d6ad4b337be9e6b376991a39c04456c65e8a353fe8c006cfa4dfa6d9d68617ff6233cfa184adb4bb410375924664e
7
+ data.tar.gz: ec7514036fa8fd629174a76d58e01d34a92e7a5b2f5292bf8266da643f33b40abcad2b04da7149e156563edfaca7464d9e481dbb3f5667f798c15def4564ea12
@@ -1,5 +1,5 @@
1
1
  // author: Samuel Mueller
2
- // version: 0.0.3
2
+ // version: 0.0.4
3
3
  // license: MIT
4
4
  // homepage: http://github.com/ssmm/angular-smart-search
5
5
  (function() {
@@ -31,7 +31,7 @@
31
31
  compile: function(element, attributes, transclude) {
32
32
  var id_field;
33
33
 
34
- id_field = angular.element("<input ng-model='result.id' type='text' style='width: 30px; text-align: center; display: none;' disabled='disabled'>");
34
+ id_field = angular.element("<input ng-model='result.id' type='text' style='width: 30px; display: none;'>");
35
35
  id_field.attr("id", attributes.id);
36
36
  id_field.attr("name", attributes.name);
37
37
  element.append(id_field);
@@ -41,11 +41,11 @@
41
41
 
42
42
  queryState = new QueryState();
43
43
  $scope.queryState = queryState;
44
- $scope.resultList = [{}];
44
+ $scope.resultList = [];
45
45
  allowedFormats = $attributes.formats.split(" ");
46
46
  service = $attributes.service;
47
47
  if ($attributes.init) {
48
- $scope.result = angular.fromJson($attributes.init);
48
+ $scope.result = angular.fromJson($attributes.init)[0];
49
49
  $scope.queryState.setTo("successful");
50
50
  }
51
51
  input = $element.find("[queryfield]");
@@ -155,23 +155,27 @@
155
155
  angular.module("angular-smart-search").factory("templateFactory", [
156
156
  "markupStore", function(markupStore) {
157
157
  return function() {
158
- return " <div> <!-- input section you see initially --> <div class='input-prepend input-append'> <!-- gray display section --> <span class='add-on' style='min-width: 200px;'> <!-- result if found --> <span ng-show='queryState.is(\"successful\")'> <i class='" + (markupStore.successIconClass()) + "'></i> {{result.displayText}} </span> <!-- query states --> <span ng-show='queryState.is(\"changed\")'> <em>{{queryState.query.format.name}} detected</em> </span> <span ng-show='queryState.is(\"pending\")'> <em>searching...</em> </span> <span ng-show='queryState.is(\"unsuccessful\")'> <em>Not found</em> </span> <span ng-show='queryState.is(\"invalid-format\")'> <em>Invalid format</em> </span> <span ng-show='queryState.is(\"error\")'> <em>Error</em> </span> </span> <!-- quick query field --> <input ng-change='outerQueryChanged(quickQuery)' ng-model='quickQuery' queryfield style='width: 100px;' type='text'> <!-- button that triggers detail search overlay --> <button type='button' class='btn' ng-click='show()'> <i class='" + (markupStore.searchIconClass()) + "'></i> </button> </div> <!-- detail search overlay, initially hidden --> <div class='uw-overlay shadow' ng-mouseleave='hide()' overlay> <div class='row-fluid'> <div class='span12'> <div class='input-append'> <input detail-queryfield ng-model='detailQuery' type='text'> <button type='button' class='btn' ng-click='search(detailQuery)'> <i class='" + (markupStore.searchIconClass()) + "'></i> </button> </div> </div> </div> <div class='horizontal-space'></div> <div class='row-fluid'> <div class='span12'> <table at-table class='table table-bordered table-hover' fill-last-page pagination='wildPagination'> <thead></thead> <tbody> <tr ng-mouseover='hover(item)'> <td at-implicit attribute='id' class='sortable 50px'></td> <td at-implicit attribute='displayText' class='sortable 280px' title='Result'></td> <td class='50px' title='-'> <button type='button' class='btn btn-mini' ng-click='pick(item)'>pick</button> </td> </tr> </tbody> </table> <at-pagination instance='wildPagination' items-per-page='3' list='resultList'></at-pagination> </div> </div> </div> </div> ";
158
+ return " <div> <!-- input section you see initially --> <div class='input-prepend input-append'> <!-- gray display section --> <span class='add-on' style='min-width: 200px;'> <!-- result if found --> <span ng-show='queryState.is(\"successful\")'> <i class='" + (markupStore.successIconClass()) + "'></i> {{result.displayText}} </span> <!-- query states --> <span ng-show='queryState.is(\"changed\")'> <em>{{queryState.query.format.name}} detected</em> </span> <span ng-show='queryState.is(\"pending\")'> <em>searching...</em> </span> <span ng-show='queryState.is(\"unsuccessful\")'> <em>Not found</em> </span> <span ng-show='queryState.is(\"invalid-format\")'> <em>Invalid format</em> </span> <span ng-show='queryState.is(\"error\")'> <em>Error</em> </span> </span> <!-- quick query field --> <input ng-change='outerQueryChanged(quickQuery)' ng-model='quickQuery' queryfield style='width: 100px;' type='text'> <!-- button that triggers detail search overlay --> <button type='button' class='btn' ng-click='show()'> <i class='" + (markupStore.searchIconClass()) + "'></i> </button> </div> <!-- detail search overlay, initially hidden --> <div class='" + (markupStore.overlayClass()) + "' ng-mouseleave='hide()' overlay> <div class='row-fluid'> <div class='span12'> <div class='input-append'> <input detail-queryfield ng-model='detailQuery' type='text'> <button type='button' class='btn' ng-click='search(detailQuery)'> <i class='" + (markupStore.searchIconClass()) + "'></i> </button> </div> </div> </div> <div class='horizontal-space'></div> <div class='row-fluid'> <div class='span12'> <table at-table class='table table-bordered table-hover' fill-last-page pagination='wildPagination'> <thead></thead> <tbody> <tr ng-mouseover='hover(item)'> <td at-implicit attribute='id' class='sortable 50px'></td> <td at-implicit attribute='displayText' class='sortable 280px' title='Result'></td> <td class='50px' title=''> <button type='button' class='btn btn-mini' ng-click='pick(item)'>pick</button> </td> </tr> </tbody> </table> <at-pagination instance='wildPagination' items-per-page='3' list='resultList'></at-pagination> </div> </div> </div> </div> ";
159
159
  };
160
160
  }
161
161
  ]);
162
162
 
163
163
  angular.module("angular-smart-search").provider("markupStore", [
164
164
  function() {
165
- var searchIconClass, successIconClass;
165
+ var overlayClass, searchIconClass, successIconClass;
166
166
 
167
167
  successIconClass = "icon-ok";
168
168
  searchIconClass = "icon-search";
169
+ overlayClass = "smart-search-overlay";
169
170
  this.setSuccessIconClass = function(attr) {
170
171
  return successIconClass = attr;
171
172
  };
172
173
  this.setSearchIconClass = function(attr) {
173
174
  return searchIconClass = attr;
174
175
  };
176
+ this.setOverlayClass = function(attr) {
177
+ return overlayClass = attr;
178
+ };
175
179
  return this.$get = function() {
176
180
  return {
177
181
  successIconClass: function() {
@@ -179,6 +183,9 @@
179
183
  },
180
184
  searchIconClass: function() {
181
185
  return searchIconClass;
186
+ },
187
+ overlayClass: function() {
188
+ return overlayClass;
182
189
  }
183
190
  };
184
191
  };
@@ -1,3 +1,3 @@
1
1
  module AngularSmartSearch
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-smart-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Mueller