angular-smart-search 0.0.2 → 0.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f7521287ba8a4189f22a5835f53d2dc5743d234
|
4
|
+
data.tar.gz: 7eb1f618794192008154d0fadafaa35fb5b71e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 461f8d6cb3c254110b93077c6c87054abff4822c513fe07cbb5fe14c5432b840b8661afb73d2f5466a6208772d9e88bfb3997574836557cfd2ded81dc0c590c4
|
7
|
+
data.tar.gz: cf57d634b97d7c6f5c636d97ab5e3d5ef95244ad67ef02db71f26a78619ad58a42608c7b87f8800d168d61d254df60997493163e53c08348d70eeee7a5188584
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// author: Samuel Mueller
|
2
|
-
// version: 0.0.
|
2
|
+
// version: 0.0.3
|
3
3
|
// license: MIT
|
4
4
|
// homepage: http://github.com/ssmm/angular-smart-search
|
5
5
|
(function() {
|
@@ -39,8 +39,15 @@
|
|
39
39
|
post: function($scope, $element, $attributes) {
|
40
40
|
var allowedFormats, input, outerQueryTimeout, overlay, queryState, service;
|
41
41
|
|
42
|
+
queryState = new QueryState();
|
43
|
+
$scope.queryState = queryState;
|
44
|
+
$scope.resultList = [{}];
|
42
45
|
allowedFormats = $attributes.formats.split(" ");
|
43
46
|
service = $attributes.service;
|
47
|
+
if ($attributes.init) {
|
48
|
+
$scope.result = angular.fromJson($attributes.init);
|
49
|
+
$scope.queryState.setTo("successful");
|
50
|
+
}
|
44
51
|
input = $element.find("[queryfield]");
|
45
52
|
overlay = $element.children("[overlay]");
|
46
53
|
$scope.show = function() {
|
@@ -69,8 +76,6 @@
|
|
69
76
|
return $scope.currentItem = item;
|
70
77
|
};
|
71
78
|
outerQueryTimeout = null;
|
72
|
-
queryState = new QueryState();
|
73
|
-
$scope.queryState = queryState;
|
74
79
|
return $scope.outerQueryChanged = function(query) {
|
75
80
|
window.clearTimeout(outerQueryTimeout);
|
76
81
|
query = searchQueryFactory(query, allowedFormats);
|
@@ -150,7 +155,7 @@
|
|
150
155
|
angular.module("angular-smart-search").factory("templateFactory", [
|
151
156
|
"markupStore", function(markupStore) {
|
152
157
|
return function() {
|
153
|
-
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 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 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 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='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> ";
|
154
159
|
};
|
155
160
|
}
|
156
161
|
]);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-smart-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|