From 97584aabb3f86070ece6b362b20e1f6b41aceeb2 Mon Sep 17 00:00:00 2001 From: Nbernot Date: Tue, 14 Feb 2017 16:44:03 +0100 Subject: [PATCH] Updated the lists of office online file extensions Extended the list of file extensions that receive office online icons and 'open in' text. --- app/helpers/file_icons_helper.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/helpers/file_icons_helper.rb b/app/helpers/file_icons_helper.rb index 01721e38b..e12c51fd7 100644 --- a/app/helpers/file_icons_helper.rb +++ b/app/helpers/file_icons_helper.rb @@ -1,17 +1,17 @@ module FileIconsHelper def wopi_file?(asset) file_ext = asset.file_file_name.split('.').last - %w(doc docx xls xlsx ppt pptx).include?(file_ext) + %w(csv ods xls xlsb xlsm xlsx odp pot potm potx pps ppsm ppsx ppt pptm pptx doc docm docx dot dotm dotx odt rtf).include?(file_ext) end # For showing next to file def file_extension_icon(asset) file_ext = asset.file_file_name.split('.').last - if %w(doc docx).include?(file_ext) + if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext) image_link = 'office/Word-docx_20x20x32.png' - elsif %w(xls xlsx).include?(file_ext) + elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext) image_link = 'office/Excel-xlsx_20x20x32.png' - elsif %w(ppt pptx).include?(file_ext) + elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext) image_link = 'office/PowerPoint-pptx_20x20x32.png' end @@ -25,11 +25,11 @@ module FileIconsHelper # For showing in view/edit buttons (WOPI) def file_application_icon(asset) file_ext = asset.file_file_name.split('.').last - if %w(doc docx).include?(file_ext) + if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext) image_link = 'office/Word-color_16x16x32.png' - elsif %w(xls xlsx).include?(file_ext) + elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext) image_link = 'office/Excel-color_16x16x32.png' - elsif %w(ppt pptx).include?(file_ext) + elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext) image_link = 'office/PowerPoint-Color_16x16x32.png' end @@ -43,11 +43,11 @@ module FileIconsHelper # Shows correct WOPI application text (Word Online/Excel ..) def wopi_button_text(asset, action) file_ext = asset.file_file_name.split('.').last - if %w(doc docx).include?(file_ext) + if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext) app = 'Word Online' - elsif %w(xls xlsx).include?(file_ext) + elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext) app = 'Excel Online' - elsif %w(ppt pptx).include?(file_ext) + elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext) app = 'PowerPoint Online' end