redmine_plugin_asset_pipeline 0.0.2 → 0.0.3
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: 91a4a9461b84bbf19043080f128f089fd85d3c74
|
|
4
|
+
data.tar.gz: 72b472baeee4c937c37c8363ddc1c1686b7ed77d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ce8dcd7185a4908425dc34db083dbf526e5f3f536a5a530069580dc0a59f87bc32afea5f562df543d8647e907bed81add8c46c49ab43bc2e65acc1b743d54f6
|
|
7
|
+
data.tar.gz: 7d55ea3df973138e063d269b6ad7c196abe41c566e1d528fd03608c7f39ecf955d92bd8fd5dce484b044b8f368f46ccf3f1cc01c35159a32d12e94f7bc113134
|
|
@@ -33,11 +33,8 @@ module RedminePluginAssetPipeline
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
config.
|
|
36
|
+
config.to_prepare do
|
|
37
37
|
require_dependency 'redmine_plugin_asset_pipeline/application_helper_patch'
|
|
38
|
-
unless ApplicationHelper.included_modules.include? RedminePluginAssetPipeline::ApplicationHelperPatch
|
|
39
|
-
ApplicationHelper.send(:include, RedminePluginAssetPipeline::ApplicationHelperPatch)
|
|
40
|
-
end
|
|
41
38
|
end
|
|
42
39
|
|
|
43
40
|
end
|
|
@@ -1,54 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
module ApplicationHelperPatch
|
|
3
|
-
def self.included(base)
|
|
4
|
-
base.send(:include, InstanceMethods)
|
|
5
|
-
base.class_eval do
|
|
6
|
-
def assets_prefix
|
|
7
|
-
Rails.application.config.assets.prefix.gsub(/^\//, '')
|
|
8
|
-
end
|
|
1
|
+
require_dependency 'application_helper'
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if plugin
|
|
15
|
-
"/#{[assets_prefix, "#{plugin}/stylesheets/#{source}"].join('/')}"
|
|
16
|
-
elsif current_theme && current_theme.stylesheets.include?(source)
|
|
17
|
-
current_theme.stylesheet_path(source)
|
|
18
|
-
else
|
|
19
|
-
"/#{[assets_prefix, "stylesheets/#{source}"].join('/')}"
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
super *sources, options
|
|
23
|
-
end
|
|
3
|
+
module ApplicationHelper
|
|
4
|
+
def assets_prefix
|
|
5
|
+
Rails.application.config.assets.prefix.gsub(/^\//, '')
|
|
6
|
+
end
|
|
24
7
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
8
|
+
def stylesheet_link_tag(*sources)
|
|
9
|
+
options = sources.last.is_a?(Hash) ? sources.pop : {}
|
|
10
|
+
plugin = options.delete(:plugin)
|
|
11
|
+
sources = sources.map do |source|
|
|
12
|
+
if plugin
|
|
13
|
+
"/#{[assets_prefix, "#{plugin}/stylesheets/#{source}"].join('/')}"
|
|
14
|
+
elsif current_theme && current_theme.stylesheets.include?(source)
|
|
15
|
+
current_theme.stylesheet_path(source)
|
|
16
|
+
else
|
|
17
|
+
"/#{[assets_prefix, "stylesheets/#{source}"].join('/')}"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
super *sources, options
|
|
21
|
+
end
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
super source, options
|
|
47
|
-
end
|
|
23
|
+
def javascript_include_tag(*sources)
|
|
24
|
+
options = sources.last.is_a?(Hash) ? sources.pop : {}
|
|
25
|
+
plugin = options.delete(:plugin)
|
|
26
|
+
sources = sources.map do |source|
|
|
27
|
+
if plugin
|
|
28
|
+
"/#{[assets_prefix, "#{plugin}/javascripts/#{source}"].join('/')}"
|
|
29
|
+
else
|
|
30
|
+
"/#{[assets_prefix, "javascripts/#{source}"].join('/')}"
|
|
48
31
|
end
|
|
49
32
|
end
|
|
33
|
+
super *sources, options
|
|
34
|
+
end
|
|
50
35
|
|
|
51
|
-
|
|
36
|
+
def image_tag(source, options={})
|
|
37
|
+
if plugin = options.delete(:plugin)
|
|
38
|
+
source = "/#{[assets_prefix, "#{plugin}/images/#{source}"].join('/')}"
|
|
39
|
+
elsif current_theme && current_theme.images.include?(source)
|
|
40
|
+
source = current_theme.image_path(source)
|
|
41
|
+
else
|
|
42
|
+
source = "/#{[assets_prefix, "images/#{source}"].join('/')}"
|
|
52
43
|
end
|
|
44
|
+
super source, options
|
|
53
45
|
end
|
|
54
46
|
end
|