fix some bug
This commit is contained in:
parent
f8c03d2342
commit
4433d4d40d
|
@ -78,6 +78,7 @@ class Admin::PatchfilesController < OrbitAdminController
|
|||
redirect_to admin_patchfiles_showckeditor_path
|
||||
end
|
||||
def newfont
|
||||
params["patchfilefield"]["new_add_font"] = params["patchfilefield"]["new_add_font"].gsub('\"','').gsub("\'",'').gsub(";",'')
|
||||
@field.new_add_font = params["patchfilefield"]["new_add_font"] rescue (redirect_to admin_patchfiles_showckeditor_path and return)
|
||||
params["patchfilefield"]["font_array"].each_with_index do |(font,istrue),index|
|
||||
if istrue =="0"
|
||||
|
|
|
@ -223,20 +223,22 @@ class Patchfilefield
|
|||
end
|
||||
end
|
||||
@delete_font_array.each do |font_to_delete|
|
||||
@str_above_end = @filedata.index(font_to_delete) - 1
|
||||
@str_above_start
|
||||
for @str_above_start in (0..@str_above_end).to_a.reverse
|
||||
if @filedata[@str_above_start] =="\'" || @filedata[@str_above_start] =="\""
|
||||
break
|
||||
if @filedata.index(font_to_delete) != nil
|
||||
@str_above_end = @filedata.index(font_to_delete) - 1
|
||||
@str_above_start
|
||||
for @str_above_start in (0..@str_above_end).to_a.reverse
|
||||
if @filedata[@str_above_start] =="\'" || @filedata[@str_above_start] =="\""
|
||||
break
|
||||
end
|
||||
break if @filedata[@str_above_start] == "\;"
|
||||
end
|
||||
@str_to_delete = (( @filedata[@str_above_start..@str_above_end].include? "\;") ? @filedata[@str_above_start..@str_above_end] : "")+font_to_delete
|
||||
@filedata =@filedata.sub(@str_to_delete,"")
|
||||
for @i in @str_start+1...@str_end
|
||||
next if @filedata[@i] == " "
|
||||
break if @filedata[@i] != "\;"
|
||||
@filedata.slice!(@i)
|
||||
end
|
||||
break if @filedata[@str_above_start] == "\;"
|
||||
end
|
||||
@str_to_delete = (( @filedata[@str_above_start..@str_above_end].include? "\;") ? @filedata[@str_above_start..@str_above_end] : "")+font_to_delete
|
||||
@filedata =@filedata.sub(@str_to_delete,"")
|
||||
for @i in @str_start+1...@str_end
|
||||
next if @filedata[@i] == " "
|
||||
break if @filedata[@i] != "\;"
|
||||
@filedata.slice!(@i)
|
||||
end
|
||||
end
|
||||
puts self.used_font
|
||||
|
|
Loading…
Reference in New Issue