Fix bootstrap js include twice bug.
This commit is contained in:
parent
6b2930860e
commit
e636be4b4c
|
@ -50,6 +50,11 @@ all_template.each do |folder|
|
||||||
filename = folder+'partial/_head.html.erb'
|
filename = folder+'partial/_head.html.erb'
|
||||||
texts = File.read(filename).force_encoding('UTF-8')
|
texts = File.read(filename).force_encoding('UTF-8')
|
||||||
new_texts = texts.gsub(/<.*javascript_include_tag.*bootstrap.*>/,"<%= javascript_include_tag \"bootstrap.min\"%>")
|
new_texts = texts.gsub(/<.*javascript_include_tag.*bootstrap.*>/,"<%= javascript_include_tag \"bootstrap.min\"%>")
|
||||||
|
bootstrap_count = 0
|
||||||
|
new_texts.gsub("<%= javascript_include_tag \"bootstrap.min\"%>"){|t|
|
||||||
|
bootstrap_count += 1
|
||||||
|
(bootstrap_count > 1) ? "" : t
|
||||||
|
}
|
||||||
if new_texts.include?('jquery_prefix')
|
if new_texts.include?('jquery_prefix')
|
||||||
new_texts = new_texts.gsub(/<.*javascript_include_tag.*\/jquery\.min.*>|<.*javascript_include_tag.*\/jquery-1\.11\.0\.min.*>/,"<%= javascript_include_tag \"jquery.min\"%>")
|
new_texts = new_texts.gsub(/<.*javascript_include_tag.*\/jquery\.min.*>|<.*javascript_include_tag.*\/jquery-1\.11\.0\.min.*>/,"<%= javascript_include_tag \"jquery.min\"%>")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue