update bootstrap js
This commit is contained in:
parent
009068a440
commit
c0d6b57ebf
|
@ -9,7 +9,8 @@ all_template = Dir.glob(template_path+'/*/')
|
|||
#if !Dir.exist?("#{ENV['PWD']}"+"/app/assets/stylesheets/lib/jquery-ui-1.12.1/")
|
||||
puts "copying jquery-ui"
|
||||
begin
|
||||
`cp -r "#{app_path}/updatefiles/accessibility/jquery-ui-1.12.1/." "#{dir_pwd}/app/assets/stylesheets/lib/jquery-ui-1.12.1/"`
|
||||
`cp -rf "#{app_path}/updatefiles/javascripts/." "#{dir_pwd}/app/assets/javascripts/"`
|
||||
`cp -r "#{app_path}/updatefiles/accessibility/jquery-ui-1.12.1/." "#{dir_pwd}/app/assets/stylesheets/lib/jquery-ui-1.12.1/"`
|
||||
rescue
|
||||
puts "There is an error in coppying jquery-ui"
|
||||
end
|
||||
|
@ -44,7 +45,8 @@ all_template.each do |folder|
|
|||
begin
|
||||
filename = folder+'partial/_head.html.erb'
|
||||
texts = File.read(filename).force_encoding('UTF-8')
|
||||
new_texts = texts.gsub(/lib\/jquery\-1\.11\.0.min|\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/1\.11\.0\/jquery.min.js/,'jquery.min')
|
||||
new_texts = texts.gsub(/<.*javascript_include_tag.*bootstrap.*>/,"<%= javascript_include_tag \"bootstrap.min\"%>")
|
||||
new_texts = new_texts.gsub(/<.*javascript_include_tag.*jquery.min.*>/,"<%= javascript_include_tag \"jquery.min\"%>")
|
||||
if texts != new_texts
|
||||
File.open(filename,'w') do |f|
|
||||
f.write new_texts
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue