locatine 0.02539 → 0.02542
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/locatine/app/background.js +0 -1
- data/lib/locatine/app/content.js +1 -0
- data/lib/locatine/app/manifest.json +1 -1
- data/lib/locatine/app/popup.js +4 -2
- data/lib/locatine/for_search/dialog_logic.rb +30 -8
- data/lib/locatine/for_search/find_by_guess.rb +0 -1
- data/lib/locatine/for_search/helpers.rb +2 -3
- data/lib/locatine/for_search/listening.rb +1 -0
- data/lib/locatine/large_scripts/element.js +0 -1
- data/lib/locatine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df3f8d995c895faf833681632462dcd884e73bce
|
4
|
+
data.tar.gz: 8885ecd8b1513df7cac86761a22e02acdb692f03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0234243bf852972ac60752c0be0232a2c427ce0f40f21fefaaa2cf8e7a32403e2c33f8761fcaa28712ffd8bd0960b1d2c46f5f3846e45c56e51edf5b5dc2831e
|
7
|
+
data.tar.gz: ec7071e6b671a03d6cf2fe034b510f914af84e403248ddcd6a3d230a9c8cf9ba4f2c291ffe9722a5a58436d3208754b5898d1a9dc94d00f9016772fcf2a6b117
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ That's it.
|
|
16
16
|
|
17
17
|
## Stage of development:
|
18
18
|
|
19
|
-
Version of Locatine is **0.
|
19
|
+
Version of Locatine is **0.02542** only. It means so far this is an alfa. You can use it in a real project if you are a risky person.
|
20
20
|
|
21
21
|
## Installation
|
22
22
|
|
data/lib/locatine/app/content.js
CHANGED
@@ -20,6 +20,7 @@ async function creatingDiv(){
|
|
20
20
|
locatine_create_element(document.body, "div", options, "");
|
21
21
|
const magic_cover = document.getElementById('locatine_magic_div');
|
22
22
|
magic_cover.onclick = function(e) {locatine_magic_click(e)};
|
23
|
+
await set_value('locatine_confirm', 'new')
|
23
24
|
document.body.onkeypress = async function(e) {
|
24
25
|
if (e.which == 13) {
|
25
26
|
await set_value('locatine_confirm', true)
|
data/lib/locatine/app/popup.js
CHANGED
@@ -20,8 +20,10 @@ async function correct_buttons() {
|
|
20
20
|
} else {
|
21
21
|
document.getElementById("mode").setAttribute("value", "You are in single selection mode")
|
22
22
|
};
|
23
|
-
|
24
|
-
|
23
|
+
if (await get_value("locatine_title")) {
|
24
|
+
document.getElementById("mainTitle").innerText = await get_value("locatine_title");
|
25
|
+
document.getElementById("hint").innerText = await get_value("locatine_hint");
|
26
|
+
}
|
25
27
|
if ((document.getElementById("nameHandler").value != await get_value("locatineName")) && (!document.hasFocus())){
|
26
28
|
document.getElementById("nameHandler").value = (await get_value("locatineName") || "");
|
27
29
|
}
|
@@ -53,18 +53,40 @@ module Locatine
|
|
53
53
|
return els, attrs
|
54
54
|
end
|
55
55
|
|
56
|
+
# get_from_app('locatineconfirmed') 'selected' or 'declined' or 'true'
|
57
|
+
# or 'abort' or 'new' or anything else (ok or false)
|
56
58
|
def listening(els, attrs, vars, name, scope)
|
57
|
-
|
58
|
-
|
59
|
-
|
59
|
+
sleep(0.1)
|
60
|
+
result = hearing
|
61
|
+
els, attrs = understanding(els, attrs, vars, name, scope, result)
|
62
|
+
if (!result[:done] || !els) && !result[:abort]
|
63
|
+
return listening(els, attrs, vars, name, scope)
|
60
64
|
end
|
61
|
-
result = get_from_app('locatineconfirmed')
|
62
|
-
return els, attrs if els && result != 'abort'
|
63
65
|
|
64
|
-
els, attrs
|
65
|
-
|
66
|
+
return els, attrs
|
67
|
+
end
|
68
|
+
|
69
|
+
def understanding(els, attrs, vars, name, scope, result)
|
70
|
+
if result[:selected]
|
71
|
+
els, attrs = user_selection(els, attrs, vars, name, scope)
|
72
|
+
else
|
73
|
+
start_listening(scope, name) if result[:new]
|
74
|
+
els, attrs = decline(els, name, scope) if result[:declined]
|
75
|
+
end
|
76
|
+
return els, attrs
|
77
|
+
end
|
66
78
|
|
67
|
-
|
79
|
+
def hearing
|
80
|
+
answer = {}
|
81
|
+
result = get_from_app('locatineconfirmed')
|
82
|
+
answer[:selected] = ((result == 'selected') || (result == 'true'))
|
83
|
+
answer[:new] = result == 'new'
|
84
|
+
answer[:done] = result == 'true'
|
85
|
+
answer[:abort] = result == 'abort'
|
86
|
+
answer[:declined] = ((result == 'new') ||
|
87
|
+
(result == 'declined') ||
|
88
|
+
(result == 'abort'))
|
89
|
+
answer
|
68
90
|
end
|
69
91
|
|
70
92
|
##
|
@@ -18,13 +18,12 @@ module Locatine
|
|
18
18
|
|
19
19
|
def take_html
|
20
20
|
engine.locate
|
21
|
-
engine.html
|
21
|
+
engine.html.gsub(/<div.*id="locatine_magic_div".*>/, '')
|
22
22
|
end
|
23
23
|
|
24
24
|
def time
|
25
25
|
t = Time.now
|
26
|
-
|
27
|
-
"#{t.min.to_s.rjust(2, '0')}:#{t.sec.to_s.rjust(2, '0')}"
|
26
|
+
t.strftime('%F %T')
|
28
27
|
end
|
29
28
|
|
30
29
|
def fix_iframe
|
data/lib/locatine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locatine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.02542'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Seleznev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|