redmine_extensions 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/redmine_extensions/easy_togglers.js +22 -25
- data/lib/generators/redmine_extensions/entity/templates/mail_added.html.erb.erb +1 -1
- data/lib/generators/redmine_extensions/entity/templates/mail_added.text.erb.erb +2 -2
- data/lib/generators/redmine_extensions/entity/templates/mail_updated.text.erb.erb +2 -2
- data/lib/redmine_extensions/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0f667f85e0d110624ccd5f899854088d8015fa00
|
4
|
+
data.tar.gz: c28815a63c4e04d663c7fd745d49e31ec82baf4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce9bceb329b3a207e46cbca65a3c96dc950219d928d919b3a7d06a07f08bff2a06f4798f23b1f553752cfd78a7b623d493e345fd59c908a03b28532da66f9969
|
7
|
+
data.tar.gz: 4cc55109bd400d1f256f35e4814187e8d7c1ca0f18f599d9a359528f0da77c6b103f3c27eb0fbcf5ad3af9b5233ec3a4004de437d27ac75354bdc035e5673562
|
@@ -3,23 +3,25 @@ window.EasyToggler = new function() {
|
|
3
3
|
// Example:
|
4
4
|
// localStorage # => {"easy-toggle-state": {myDiv: 0, history: 1}} # where myDiv is by default hidden, and now will be shown as visible and history is vice versa
|
5
5
|
|
6
|
-
|
6
|
+
const storage = JSON.parse(localStorage.getItem("easy-toggle-state") || "{}");
|
7
7
|
|
8
|
-
|
9
|
-
localStorage.setItem(
|
8
|
+
const save = function() {
|
9
|
+
localStorage.setItem("easy-toggle-state", JSON.stringify(storage));
|
10
10
|
return storage;
|
11
11
|
};
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
const isHidden = function (el) {
|
14
|
+
if (!el) return false;
|
15
|
+
const computedStyle = window.getComputedStyle(el);
|
16
|
+
return computedStyle.display === "none";
|
15
17
|
};
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
const toggle = function(el) {
|
20
|
+
const parent = el.parentNode;
|
19
21
|
|
20
22
|
parent.classList.toggle("collapsed");
|
21
23
|
|
22
|
-
el.style.display = isHidden(el) ?
|
24
|
+
el.style.display = isHidden(el) ? "block" : "none";
|
23
25
|
el.id && !!parent.dataset.toggle && save();
|
24
26
|
$( document ).trigger( "erui_interface_change_vertical" ); // <> !#@!
|
25
27
|
return el;
|
@@ -30,22 +32,16 @@ window.EasyToggler = new function() {
|
|
30
32
|
if (event && event.target.tagName === "A")
|
31
33
|
return;
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
if (id)
|
36
|
-
if (!!storage[id]) {
|
37
|
-
delete storage[id];
|
38
|
-
} else {
|
39
|
-
storage[id] = isHidden(el) ? 0 : 1;
|
40
|
-
}
|
41
|
-
}
|
35
|
+
const el = (typeof(id_or_el) === "object") ? id_or_el : document.getElementById(id_or_el);
|
36
|
+
const id = el.id;
|
37
|
+
if (id) storage[id] = isHidden(el) ? 0 : 1;
|
42
38
|
toggle(el);
|
43
39
|
};
|
44
40
|
|
45
41
|
this.ensureToggle = function() {
|
46
|
-
|
47
|
-
for (
|
48
|
-
|
42
|
+
const list = document.querySelectorAll("*[data-toggle]");
|
43
|
+
for (let i = 0; i < list.length; ++i) {
|
44
|
+
const item = list.item(i);
|
49
45
|
window.EasyToggler.ensureToggleItem(item);
|
50
46
|
}
|
51
47
|
return this;
|
@@ -54,11 +50,12 @@ window.EasyToggler = new function() {
|
|
54
50
|
/**
|
55
51
|
* @param {HTMLElement} item
|
56
52
|
*/
|
57
|
-
this.ensureToggleItem = function(item) {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
53
|
+
this.ensureToggleItem = function (item) {
|
54
|
+
if (storage[item.dataset.toggle] == null) return;
|
55
|
+
const container = document.getElementById(item.dataset.toggle);
|
56
|
+
const containerState = isHidden(container);
|
57
|
+
const savedContainerState = !!storage[item.dataset.toggle];
|
58
|
+
if (containerState !== savedContainerState) toggle(container);
|
62
59
|
return this;
|
63
60
|
};
|
64
61
|
};
|
@@ -1 +1 @@
|
|
1
|
-
<h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
|
1
|
+
<h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%%= @<%= model_name_underscored %>.to_s %>
|
2
|
-
<%%= @<%= model_name_underscored %>_url %>
|
1
|
+
<%%= @<%= model_name_underscored %>.to_s %>
|
2
|
+
<%%= @<%= model_name_underscored %>_url %>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%%= @<%= model_name_underscored %>.to_s %>
|
2
|
-
<%%= @<%= model_name_underscored %>_url %>
|
1
|
+
<%%= @<%= model_name_underscored %>.to_s %>
|
2
|
+
<%%= @<%= model_name_underscored %>_url %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Easy Software Ltd
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -175,7 +175,7 @@ homepage: https://www.easyredmine.com
|
|
175
175
|
licenses:
|
176
176
|
- GPL-2.0
|
177
177
|
metadata: {}
|
178
|
-
post_install_message:
|
178
|
+
post_install_message:
|
179
179
|
rdoc_options: []
|
180
180
|
require_paths:
|
181
181
|
- lib
|
@@ -190,14 +190,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
|
194
|
-
|
193
|
+
rubyforge_project:
|
194
|
+
rubygems_version: 2.6.7
|
195
|
+
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: Redmine Extensions is set of useful features for Redmine. Main focus is on
|
197
198
|
development helpers, but many users can find it helpfull
|
198
199
|
test_files:
|
199
|
-
- spec/
|
200
|
+
- spec/factories/easy_settings.rb
|
200
201
|
- spec/init_rails.rb
|
201
202
|
- spec/models/easy_setting_spec.rb
|
202
203
|
- spec/presenters/easy_settings/params_wrapper_spec.rb
|
203
|
-
- spec/
|
204
|
+
- spec/spec_helper.rb
|