assoc_whisperer 1.1.0 → 1.1.1
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2960496ba2056b1cbdaa67fa844d589f6d99e16
|
|
4
|
+
data.tar.gz: 974d3d0c13f0076d4a9999939b2f174179e6dfea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bd9f8f5160f64f80771260787bc1d6c8cc29bf75f534ddd42401a035a60b6b2979194cb70af5f517938b4e83066fd942e8c3cc212e0c45b989b7d4c00a0f7ad
|
|
7
|
+
data.tar.gz: d041b0693d85f550207a0ee1a9ffc48e7ce7e5206a5471831477c1ed25b4e572a9bfb45b34f5fbb914497162d6239d817ec8abe6fff0265bf2a86e5463f54a92
|
|
Binary file
|
|
@@ -60,13 +60,13 @@ document.AssocWhisperer = (function () {
|
|
|
60
60
|
}
|
|
61
61
|
_timer = setTimeout(function () {
|
|
62
62
|
if (w.client_side) {
|
|
63
|
-
if (!w.full_data)
|
|
63
|
+
if (!w.full_data) query(w, null, function (html_text) {
|
|
64
64
|
w.full_data = $(html_text);
|
|
65
|
-
digest(input_text);
|
|
65
|
+
showList(digest(input_text));
|
|
66
66
|
});
|
|
67
|
-
else digest(input_text);
|
|
67
|
+
else showList(digest(input_text));
|
|
68
68
|
}
|
|
69
|
-
else
|
|
69
|
+
else query(w, input_text, function (html_text) {
|
|
70
70
|
showList($(html_text));
|
|
71
71
|
});
|
|
72
72
|
}, 700);
|
|
@@ -76,31 +76,29 @@ document.AssocWhisperer = (function () {
|
|
|
76
76
|
_nodes.text_field.focus(function(){ w.focused = true; });
|
|
77
77
|
_nodes.text_field.blur(function(){ onBlur(); });
|
|
78
78
|
el.children('.dropdown_button').on('click', function(){
|
|
79
|
+
var f;
|
|
79
80
|
if (_timer) clearTimeout(_timer);
|
|
80
81
|
if (w.client_side) {
|
|
81
|
-
function
|
|
82
|
+
f = function () {
|
|
82
83
|
var input_text;
|
|
83
84
|
if (w.filled) showList(w.full_data);
|
|
84
85
|
else {
|
|
85
86
|
input_text = _nodes['text_field'].val();
|
|
86
|
-
digest(input_text==='' ? null : input_text);
|
|
87
|
+
showList(digest(input_text==='' ? null : input_text));
|
|
87
88
|
}
|
|
88
89
|
_nodes['list'].focus();
|
|
89
|
-
}
|
|
90
|
-
if (!w.full_data)
|
|
90
|
+
};
|
|
91
|
+
if (!w.full_data) query(w, null, function (html_text) {
|
|
91
92
|
w.full_data = $(html_text);
|
|
92
93
|
f();
|
|
93
94
|
});
|
|
94
95
|
else f();
|
|
95
96
|
}
|
|
96
97
|
else {
|
|
97
|
-
|
|
98
|
-
showList($(html_text));
|
|
99
|
-
});
|
|
100
|
-
else querry.call(w, _nodes['text_field'].val(), function (html_text) {
|
|
98
|
+
query(w, (w.filled ? null : _nodes['text_field'].val()), function (html_text) {
|
|
101
99
|
showList($(html_text));
|
|
100
|
+
_nodes['list'].focus();
|
|
102
101
|
});
|
|
103
|
-
_nodes['list'].focus();
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
104
|
|
|
@@ -115,7 +113,7 @@ document.AssocWhisperer = (function () {
|
|
|
115
113
|
narrowed_list.append($(this).clone());
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
|
-
|
|
116
|
+
return narrowed_list;
|
|
119
117
|
}
|
|
120
118
|
|
|
121
119
|
// Attaches a List sent by html string within Whisperer's tag. Positions it underneath the text field.
|
|
@@ -176,16 +174,21 @@ document.AssocWhisperer = (function () {
|
|
|
176
174
|
});
|
|
177
175
|
|
|
178
176
|
// Actual ajax request for given input
|
|
179
|
-
function
|
|
180
|
-
var
|
|
181
|
-
klass.
|
|
177
|
+
function query (w, input, on_success) {
|
|
178
|
+
var btn;
|
|
179
|
+
klass.querying = true;
|
|
180
|
+
btn = w.nodes['base'].find('.dropdown_button');
|
|
181
|
+
btn.addClass('querying');
|
|
182
182
|
$.ajax(w.url, {
|
|
183
183
|
type: 'GET',
|
|
184
184
|
dataType: 'html',
|
|
185
185
|
data: {data_action: w.action, input: (input||'')},
|
|
186
186
|
error: function () { w.removeList(); },
|
|
187
187
|
success: on_success,
|
|
188
|
-
complete: function () {
|
|
188
|
+
complete: function () {
|
|
189
|
+
klass.querying = false;
|
|
190
|
+
btn.removeClass('querying');
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
);
|
|
191
194
|
}
|
|
@@ -195,7 +198,7 @@ document.AssocWhisperer = (function () {
|
|
|
195
198
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
196
199
|
|
|
197
200
|
|
|
198
|
-
klass = Object.create(Object, {
|
|
201
|
+
klass = Object.create(Object, {querying: {value: false, writable: true}});
|
|
199
202
|
|
|
200
203
|
// Return a Whisperer instance by its data-action attribute.
|
|
201
204
|
function findWhisperer(action) {
|
|
@@ -219,7 +222,7 @@ document.AssocWhisperer = (function () {
|
|
|
219
222
|
value: function (text, whisp_action) {
|
|
220
223
|
var w;
|
|
221
224
|
w = findWhisperer(whisp_action);
|
|
222
|
-
|
|
225
|
+
query(w, text, function (html_text) {
|
|
223
226
|
w.select($(html_text).find('div:contains("'+text+'")'));
|
|
224
227
|
});
|
|
225
228
|
}
|
|
@@ -231,7 +234,7 @@ document.AssocWhisperer = (function () {
|
|
|
231
234
|
value: function (value, whisp_action) {
|
|
232
235
|
var w;
|
|
233
236
|
w = findWhisperer(whisp_action);
|
|
234
|
-
|
|
237
|
+
query(w, null, function (html_text) {
|
|
235
238
|
switch (value) {
|
|
236
239
|
case '#1':
|
|
237
240
|
w.select($(html_text).find('div:first'));
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
user-select: none;
|
|
25
25
|
cursor: default;
|
|
26
26
|
}
|
|
27
|
+
.assoc_whisperer .querying {
|
|
28
|
+
background-image: url("assoc_whisp_querying.gif");
|
|
29
|
+
background-size: contain;
|
|
30
|
+
background-repeat: no-repeat;
|
|
31
|
+
color: rgba(0, 0, 0, 0);
|
|
32
|
+
}
|
|
27
33
|
.assoc_whisperer .list {
|
|
28
34
|
max-height: 300px;
|
|
29
35
|
overflow-y: scroll;
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: assoc_whisperer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ondřej Želazko
|
|
@@ -51,6 +51,7 @@ files:
|
|
|
51
51
|
- LICENSE.txt
|
|
52
52
|
- README.md
|
|
53
53
|
- Rakefile
|
|
54
|
+
- app/assets/images/assoc_whisp_querying.gif
|
|
54
55
|
- app/assets/javascripts/assoc_whisp.js
|
|
55
56
|
- app/assets/stylesheets/assoc_whisp_example.css
|
|
56
57
|
- app/helpers/action_view/helpers/assoc_whisperer_helper.rb
|