locatine 0.01971 → 0.02007

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: 7f657236dd233260c2ce19bfc4960c3f7a77ccaf
4
- data.tar.gz: fd76da1f17ae3eed77e0b04dc2df3add1ecfbb2f
3
+ metadata.gz: 7d489c3b40e3742d4a0133a1280587c338879b7c
4
+ data.tar.gz: 3347799276e7b897802781ce57cfc1d480c61b77
5
5
  SHA512:
6
- metadata.gz: 5c060f1f8c183113a1d3c95aac8612d889b03afeb439d5f41e676e7b3fe513bcb9082499f93616c4cb774a348aed91f45187e95b09c411caa8768a1cc292ea3a
7
- data.tar.gz: 974782f877bdfd62faac8bee06ac8df307ae829d498e01db2ce6e6256d3506d351fe1281343695561b9bb477daf030c988fdfcc016923711142f7b20a94156ef
6
+ metadata.gz: 794115b0c100ed8724bce73059ec80c8b39e2d91022ce4a0710838e976faba02be568096477c6b3482a0b591d0cdda90e7a09c3ad15b41b0323286ebd271ea24
7
+ data.tar.gz: 457935ca593e60dd278cfd18c8aad043f366c7fb8f79197139ddcea79d1cd196b78f2063e7e8f9be0455693568d6a787a7b9ada4e1aa28ce320de739194bdb63
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.01971** only. It means so far this is an early alfa. You can use it in a real project if you are really risky person.
19
+ Version of Locatine is **0.02007** 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
 
@@ -51,8 +51,8 @@ s.find(name: "element", scope: "Main").click
51
51
  $ LEARN=1 ruby path_to_your_test.rb
52
52
 
53
53
  4. It will open the browser and transfer you to the yourpage.com.com
54
- 5. Select element to represent *element* in the *Main* scope (you can click on it or select it in devtools)
55
- 6. Click Locatine application icon at the browser panel
54
+ 5. Click Locatine application icon at the browser panel
55
+ 6. Select element to represent *element* in the *Main* scope (you can click on it or select it in devtools)
56
56
  7. And confirm the selection
57
57
 
58
58
  ![U can see an image here. On github)](readme/567.png)
@@ -14,12 +14,15 @@ div[locatinestyle=true] {
14
14
  top:0;
15
15
  left:0;
16
16
  opacity: 0;
17
- background: black;
17
+ background-color:rgba(0, 0, 0, 0.5);
18
18
  height: 100%;
19
19
  width: 100%;
20
- pointer-events: visible;
21
20
  display: block;
22
21
  z-index: 2147483646;
22
+ color: #FF99AA;
23
+ font-size: 45px;
24
+ text-align: center;
25
+ cursor: default;
23
26
  }
24
27
 
25
28
  div[locatinestyle=false] {
@@ -20,6 +20,11 @@ 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
+ document.body.onkeypress = async function(e) {
24
+ if (e.which == 13) {
25
+ await set_value('locatine_confirm', true)
26
+ }
27
+ }
23
28
  }
24
29
 
25
30
  async function setStyle(style, magicDiv){
@@ -40,6 +45,21 @@ async function setTitleHint(magicDiv){
40
45
  await set_value('locatine_title', magicDiv.getAttribute("locatinetitle"));
41
46
  await set_value('locatine_hint', magicDiv.getAttribute("locatinehint"));
42
47
  magicDiv.setAttribute("locatinetitle", "ok");
48
+ let op = 1;
49
+ magicDiv.innerHTML = await get_value("locatine_title");
50
+ let timer = setInterval(function () {
51
+ if ((magicDiv.style.opacity == 1) && (op < 0.97)) {
52
+ clearInterval(timer);// If other process changed opacity.
53
+ };
54
+ if (op <= 0.2) {
55
+ clearInterval(timer);
56
+ magicDiv.style.opacity = 0;
57
+ magicDiv.innerHTML = "";
58
+ }
59
+ magicDiv.style.opacity = op;
60
+ magicDiv.style.filter = 'alpha(opacity=' + op * 100 + ")";
61
+ op -= op * 0.03;
62
+ }, 50);
43
63
  }
44
64
  }
45
65
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Locatine app",
3
- "version": "0.01971",
3
+ "version": "0.02007",
4
4
  "description": "Messaging from browser to main app",
5
5
  "devtools_page": "devtools.html",
6
6
  "permissions": ["activeTab", "storage", "contextMenus", "tabs"],
@@ -5,15 +5,11 @@ module Locatine
5
5
  module Helpers
6
6
  private
7
7
 
8
- def enforce(what, value, *args)
9
- if args.last.class == Hash
10
- args.last[what] = value
11
- else
12
- temp = {}
13
- temp[what] = value
14
- args.push(temp)
15
- end
16
- find(*args)
8
+ def enforce(inject, *args)
9
+ inject = args.last.merge(inject) if args.last.class == Hash
10
+ ok = (args.first.class == String) && inject[:name].nil?
11
+ inject[:name] = args.first if ok
12
+ find(inject)
17
13
  end
18
14
 
19
15
  def engine
@@ -101,13 +101,13 @@ module Locatine
101
101
  ##
102
102
  # Find alias with return_locator option enforced
103
103
  def lctr(*args)
104
- enforce(:return_locator, true, *args)
104
+ enforce({ return_locator: true }, *args)
105
105
  end
106
106
 
107
107
  ##
108
108
  # Find alias with collection option enforced
109
109
  def collect(*args)
110
- enforce(:collection, true, *args)
110
+ enforce({ collection: true }, *args)
111
111
  end
112
112
 
113
113
  def json=(value)
@@ -1,6 +1,6 @@
1
1
  module Locatine
2
2
  # constants here...
3
- VERSION = '0.01971'.freeze
3
+ VERSION = '0.02007'.freeze
4
4
  NAME = 'locatine'.freeze
5
5
  HOME = if File.readable?("#{Dir.pwd}/lib/#{Locatine::NAME}")
6
6
  "#{Dir.pwd}/lib/#{Locatine::NAME}"
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.01971'
4
+ version: '0.02007'
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-04-12 00:00:00.000000000 Z
11
+ date: 2019-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler