282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
# File 'lib/creng/file_processor.rb', line 282
def self.processExtensionType clean_path, manifest_text
browser_action_page_path = "#{clean_path}/build/html/browser_action.html"
page_action_page_path = "#{clean_path}/build/html/page_action.html"
type = nil
manifest_text = manifest_text.gsub(/\,?\n?\"page_action\"\s*\:\s*\{(.|\n)*\}\,?/, "")
manifest_text = manifest_text.gsub(/\,?\n?\"browser_action\"\s*\:\s*\{(.|\n)*\}\,?/, "")
if File.file? browser_action_page_path
type = "browser_action"
elsif File.file? page_action_page_path
type = "page_action"
end
unless type.nil?
page_text = File.read("#{clean_path}/build/html/#{type}.html")
title = page_text.match(/\<title\>(.*)\<\/title\>/)[1]
title = title.nil? ? "Action Title" : title
action_text = FileProcessor.ActionTemplate type, title
manifest_text = manifest_text.gsub(/(\n){1}(\})$/) { |m| m.gsub!($1, ",\n#{action_text}") }
end
manifest_text
end
|