redmine_extensions 0.4.0.beta → 0.4.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
  SHA256:
3
- metadata.gz: 186ecf1e1604893d9fda643e2b589dbada90b4319c0da5d7a5c2c0f3c53eb176
4
- data.tar.gz: f956c9668a5926ba5012902dfb2a1c88d2dd020f7ea06428310e3ef3963e9cff
3
+ metadata.gz: 6cfd25b21afbd47411c74ccc712573a7110b3b7aa284b270f6f3d4f626ceaa33
4
+ data.tar.gz: 7c5210837d187b99b81a2f9e80504b7ab8b888bc8f719fe68ebadcb1bc3cd268
5
5
  SHA512:
6
- metadata.gz: ac84a447270e5d19538c99c5fc6d4dcd95ac936de8645c179ebd497d27d09ff65f2def4d24ee5f1b80aa9ac4d78289feca73edfe1242ac94d4a136e03dd50804
7
- data.tar.gz: ca999dfd768ba7df0f23f45f5508136eeebd4b09fdef1a92383ec26d0c4d6e3d950252b420913e804eafde49498b00e55122773f490dfce1bb4b53a6de8ea7a4
6
+ metadata.gz: b04693359b7efb7a7b61356a737303ce8e209a567d41535106147bd0bfaba06d18e792bed737e63441a4411fdeb952dbbd0b527bc49447b514daa29516ba5d7d
7
+ data.tar.gz: 1cc15831cc45289159517263b8e0fab1c6051baf22be9a7e1d417f6f64283d5bf1d3b5d91f79151966de7eae4c660c5d5b49ca09d5c373b7a109d4781e7ae56e
@@ -1,3 +1,5 @@
1
1
  window.EASY = window.EASY || {};
2
2
  window.EasyGem = window.EasyGem || {};
3
- window.EasyGem.test = window.EasyGem.test || {};
3
+ window.EasyGem.test = window.EasyGem.test || {};
4
+ window.EASY.asyncModules = window.EASY.asyncModules || {};
5
+ window.EASY.asyncModules.states = window.EASY.asyncModules.states || {};
@@ -46,10 +46,18 @@ window.EasyToggler = new function() {
46
46
  var list = document.querySelectorAll('*[data-toggle]');
47
47
  for (var i = 0; i < list.length; ++i) {
48
48
  var item = list.item(i);
49
- var container = document.getElementById(item.dataset.toggle);
50
- if (!!storage[item.dataset.toggle]) {
51
- toggle(container);
52
- }
49
+ window.EasyToggler.ensureToggleItem(item);
50
+ }
51
+ return this;
52
+ };
53
+
54
+ /**
55
+ * @param {HTMLElement} item
56
+ */
57
+ this.ensureToggleItem = function(item) {
58
+ var container = document.getElementById(item.dataset.toggle);
59
+ if (!!storage[item.dataset.toggle]) {
60
+ toggle(container);
53
61
  }
54
62
  return this;
55
63
  };
@@ -123,6 +123,22 @@ module RedmineExtensions
123
123
  content_tag(:script, javascript_cdata_section(content), html_options)
124
124
  end
125
125
 
126
+ def require_javascript_tag(content_or_options_with_block = nil, html_options = {}, &block)
127
+ content =
128
+ if block_given?
129
+ html_options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)
130
+ capture(&block)
131
+ else
132
+ content_or_options_with_block
133
+ end
134
+ html_options.reverse_merge!(type: 'application/javascript')
135
+ html_options[:data] ||= { container: '' }
136
+ html_options[:data][:container].slice!("#module_inside_")
137
+ content = "EasyGem.schedule.require(function(){#{content}}, function(){ return EASY.asyncModules.states['#{html_options[:data][:container]}']});"
138
+
139
+ javascript_tag content.html_safe, html_options
140
+ end
141
+
126
142
  def get_jasmine_tags
127
143
  tags = params[:jasmine]
128
144
  return [] if tags == 'true'
@@ -21,7 +21,7 @@ module EasySettings
21
21
  Key
22
22
  end
23
23
 
24
- key_class.new(name, options)
24
+ key_class.new(name, **options)
25
25
  end
26
26
 
27
27
  def initialize(name, **options)
@@ -17,13 +17,13 @@ module EasySettings
17
17
  end
18
18
 
19
19
  EasySetting.mapper_clear_caches
20
- @all_keys[name] = EasySettings::Key.init(name, options)
20
+ @all_keys[name] = EasySettings::Key.init(name, **options)
21
21
  end
22
22
  alias_method :add_key, :key
23
23
 
24
24
  def keys(*names, **options, &block)
25
25
  names.each do |name|
26
- key(name, options, &block)
26
+ key(name, **options, &block)
27
27
  end
28
28
  end
29
29
  alias_method :add_keys, :keys
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.4.0.beta'
2
+ VERSION = '0.4.3'
3
3
  end
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.4.0.beta
4
+ version: 0.4.3
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: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -196,7 +196,7 @@ homepage: https://www.easyredmine.com
196
196
  licenses:
197
197
  - GPL-2.0
198
198
  metadata: {}
199
- post_install_message:
199
+ post_install_message:
200
200
  rdoc_options: []
201
201
  require_paths:
202
202
  - lib
@@ -207,12 +207,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  version: '2.5'
208
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
- - - ">"
210
+ - - ">="
211
211
  - !ruby/object:Gem::Version
212
- version: 1.3.1
212
+ version: '0'
213
213
  requirements: []
214
- rubygems_version: 3.0.8
215
- signing_key:
214
+ rubygems_version: 3.2.16
215
+ signing_key:
216
216
  specification_version: 4
217
217
  summary: Redmine Extensions is set of usefull features for Redmine. Main focus is
218
218
  on development helpers, but many users can find it helpfull