diff --git a/frontend/src/components/dirent-detail/file-details.js b/frontend/src/components/dirent-detail/file-details.js index 08230d23fd9..f76818c398a 100644 --- a/frontend/src/components/dirent-detail/file-details.js +++ b/frontend/src/components/dirent-detail/file-details.js @@ -103,7 +103,7 @@ class FileDetails extends React.Component { let { dirent, repoID, path } = this.props; const smallIconUrl = Utils.getFileIconUrl(dirent.name); - let bigIconUrl = Utils.getFileIconUrl(dirent.name, 192); + let bigIconUrl = Utils.getFileIconUrl(dirent.name); const isImg = Utils.imageCheck(dirent.name); const isVideo = Utils.videoCheck(dirent.name); if (isImg || (enableVideoThumbnail && isVideo)) { diff --git a/frontend/src/components/file-chooser/searched-list-item.js b/frontend/src/components/file-chooser/searched-list-item.js index c2e6bcd76ca..260f6163336 100644 --- a/frontend/src/components/file-chooser/searched-list-item.js +++ b/frontend/src/components/file-chooser/searched-list-item.js @@ -40,7 +40,7 @@ class SearchedListItem extends React.Component { render() { let { item, currentItem } = this.props; let folderIconUrl = item.link_content ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(false); - let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192); + let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name); let trClass = this.state.highlight ? 'tr-highlight' : ''; if (currentItem) { if (item.repo_id === currentItem.repo_id && item.path === currentItem.path) { diff --git a/frontend/src/components/file-view/file-view.js b/frontend/src/components/file-view/file-view.js index f1e374d743d..7ed754d8774 100644 --- a/frontend/src/components/file-view/file-view.js +++ b/frontend/src/components/file-view/file-view.js @@ -39,7 +39,7 @@ class FileView extends React.Component { } componentDidMount() { - const fileIcon = Utils.getFileIconUrl(fileName, 192); + const fileIcon = Utils.getFileIconUrl(fileName); document.getElementById('favicon').href = fileIcon; } diff --git a/frontend/src/components/search/search-result-item.js b/frontend/src/components/search/search-result-item.js index e99f28f3b2b..cafac2cf47e 100644 --- a/frontend/src/components/search/search-result-item.js +++ b/frontend/src/components/search/search-result-item.js @@ -23,7 +23,7 @@ class SearchResultItem extends React.Component { render() { let item = this.props.item; let folderIconUrl = item.link_content ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(true); - let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192); + let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name); let showName = item.repo_name + '/' + item.link_content; showName = showName.endsWith('/') ? showName.slice(0, showName.length - 1) : showName; diff --git a/frontend/src/components/shared-file-view/shared-file-view.js b/frontend/src/components/shared-file-view/shared-file-view.js index a2b05ef7644..648c0e7d7c5 100644 --- a/frontend/src/components/shared-file-view/shared-file-view.js +++ b/frontend/src/components/shared-file-view/shared-file-view.js @@ -56,8 +56,7 @@ class SharedFileView extends React.Component { }; componentDidMount() { - - const fileIcon = Utils.getFileIconUrl(fileName, 192); + const fileIcon = Utils.getFileIconUrl(fileName); document.getElementById('favicon').href = fileIcon; if (trafficOverLimit) { diff --git a/frontend/src/pages/markdown-editor/index.js b/frontend/src/pages/markdown-editor/index.js index e3ac8123ad3..99d974cc023 100644 --- a/frontend/src/pages/markdown-editor/index.js +++ b/frontend/src/pages/markdown-editor/index.js @@ -204,8 +204,7 @@ class MarkdownEditor extends React.Component { }; async componentDidMount() { - - const fileIcon = Utils.getFileIconUrl(fileName, 192); + const fileIcon = Utils.getFileIconUrl(fileName); document.getElementById('favicon').href = fileIcon; // get file info diff --git a/frontend/src/pages/plain-markdown-editor/helper.js b/frontend/src/pages/plain-markdown-editor/helper.js index c9ccc26057c..48d958e2c0e 100644 --- a/frontend/src/pages/plain-markdown-editor/helper.js +++ b/frontend/src/pages/plain-markdown-editor/helper.js @@ -1,11 +1,6 @@ import { seafileAPI } from '../../utils/seafile-api'; import { Utils } from '../../utils/utils'; -const initFavicon = (fileName) => { - const fileIcon = Utils.getFileIconUrl(fileName, 192); - document.getElementById('favicon').href = fileIcon; -}; - const getFileInfo = async (repoID, filePath) => { const fileInfoRes = await seafileAPI.getFileInfo(repoID, filePath); const { mtime, size, starred, permission, last_modifier_name: lastModifier, id } = fileInfoRes.data; @@ -38,7 +33,8 @@ const setFileContent = async (downloadUrl) => { }; export const getPlainOptions = async ({ fileName, filePath, repoID }) => { - initFavicon(fileName); + const fileIcon = Utils.getFileIconUrl(fileName); + document.getElementById('favicon').href = fileIcon; const fileInfo = await getFileInfo(repoID, filePath); const downloadUrl = await getFileDownloadUrl(repoID, filePath); const markdownContent = await setFileContent(downloadUrl); diff --git a/frontend/src/pages/sdoc/sdoc-editor/index.js b/frontend/src/pages/sdoc/sdoc-editor/index.js index 645bd7a5639..b936663a8ca 100644 --- a/frontend/src/pages/sdoc/sdoc-editor/index.js +++ b/frontend/src/pages/sdoc/sdoc-editor/index.js @@ -31,7 +31,7 @@ export default class SdocEditor extends React.Component { if (suffix) { docName = docName + suffix; } - const fileIcon = Utils.getFileIconUrl(docName, 192); + const fileIcon = Utils.getFileIconUrl(docName); document.getElementById('favicon').href = fileIcon; }; diff --git a/frontend/src/pages/search/search-results.js b/frontend/src/pages/search/search-results.js index a5ed4a4bc43..de30d127462 100644 --- a/frontend/src/pages/search/search-results.js +++ b/frontend/src/pages/search/search-results.js @@ -28,7 +28,7 @@ class ResultsItem extends React.Component { let item = this.props.item; let linkContent = decodeURI(item.fullpath).substring(1); let folderIconUrl = linkContent ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(true); - let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192); + let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name); if (item.thumbnail_url !== '') { fileIconUrl = item.thumbnail_url; diff --git a/frontend/src/shared-dir-view.js b/frontend/src/shared-dir-view.js index 41db7c0dad8..94476a57431 100644 --- a/frontend/src/shared-dir-view.js +++ b/frontend/src/shared-dir-view.js @@ -959,7 +959,7 @@ class GridItem extends React.Component { {thumbnailURL ? : - + } {item.file_name} diff --git a/frontend/src/shared-file-view-sdoc.js b/frontend/src/shared-file-view-sdoc.js index 616cd7407a5..913f14693c8 100644 --- a/frontend/src/shared-file-view-sdoc.js +++ b/frontend/src/shared-file-view-sdoc.js @@ -40,7 +40,7 @@ window.seafile = { }; (function () { - const fileIcon = Utils.getFileIconUrl(docName, 192); + const fileIcon = Utils.getFileIconUrl(docName); document.getElementById('favicon').href = fileIcon; })(); diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js index e618d922a6f..54ed04b4571 100644 --- a/frontend/src/utils/utils.js +++ b/frontend/src/utils/utils.js @@ -392,15 +392,13 @@ export const Utils = { } return this.getFolderIconUrl(readonly, size, dirent.has_been_shared_out); } else { - return this.getFileIconUrl(dirent.name, size); + return this.getFileIconUrl(dirent.name); } }, - getAdminTemplateDirentIcon: function (dirent, isBig) { - let size = this.isHiDPI() ? 48 : 24; - size = isBig ? 192 : size; + getAdminTemplateDirentIcon: function (dirent) { if (dirent.is_file) { - return this.getFileIconUrl(dirent.obj_name, size); + return this.getFileIconUrl(dirent.obj_name); } else { return this.getFolderIconUrl(); } @@ -414,22 +412,18 @@ export const Utils = { return `${mediaUrl}img/folder${readonly ? '-read-only' : ''}${sharedOut ? '-shared-out' : ''}-${size}.png`; }, - getFileIconUrl: function (filename, size) { - if (!size) { - size = Utils.isHiDPI() ? 48 : 24; - } - size = size > 24 ? 192 : 24; + getFileIconUrl: function (filename) { let file_ext = ''; if (filename.lastIndexOf('.') == -1) { - return mediaUrl + 'img/file/' + size + '/' + this.FILEEXT_ICON_MAP['default']; + return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default']; } else { file_ext = filename.substr(filename.lastIndexOf('.') + 1).toLowerCase(); } if (this.FILEEXT_ICON_MAP[file_ext]) { - return mediaUrl + 'img/file/' + size + '/' + this.FILEEXT_ICON_MAP[file_ext]; + return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP[file_ext]; } else { - return mediaUrl + 'img/file/' + size + '/' + this.FILEEXT_ICON_MAP['default']; + return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default']; } }, diff --git a/media/img/file/192/excel.png b/media/img/file/192/excel.png deleted file mode 100644 index bf3266e4c29..00000000000 Binary files a/media/img/file/192/excel.png and /dev/null differ diff --git a/media/img/file/192/file.png b/media/img/file/192/file.png deleted file mode 100644 index df1352f761f..00000000000 Binary files a/media/img/file/192/file.png and /dev/null differ diff --git a/media/img/file/192/music.png b/media/img/file/192/music.png deleted file mode 100644 index 6057c995c7d..00000000000 Binary files a/media/img/file/192/music.png and /dev/null differ diff --git a/media/img/file/192/pdf.png b/media/img/file/192/pdf.png deleted file mode 100644 index 576808cf390..00000000000 Binary files a/media/img/file/192/pdf.png and /dev/null differ diff --git a/media/img/file/192/pic.png b/media/img/file/192/pic.png deleted file mode 100644 index 31e0c19f863..00000000000 Binary files a/media/img/file/192/pic.png and /dev/null differ diff --git a/media/img/file/192/ppt.png b/media/img/file/192/ppt.png deleted file mode 100644 index bd2b8dd214e..00000000000 Binary files a/media/img/file/192/ppt.png and /dev/null differ diff --git a/media/img/file/192/sdoc.png b/media/img/file/192/sdoc.png deleted file mode 100644 index 6a0480d41a5..00000000000 Binary files a/media/img/file/192/sdoc.png and /dev/null differ diff --git a/media/img/file/192/sdoc_notification.ico b/media/img/file/192/sdoc_notification.ico deleted file mode 100644 index 2942705a027..00000000000 Binary files a/media/img/file/192/sdoc_notification.ico and /dev/null differ diff --git a/media/img/file/192/txt.png b/media/img/file/192/txt.png deleted file mode 100644 index 3d8d4b55505..00000000000 Binary files a/media/img/file/192/txt.png and /dev/null differ diff --git a/media/img/file/192/video.png b/media/img/file/192/video.png deleted file mode 100644 index b8bf63d61e7..00000000000 Binary files a/media/img/file/192/video.png and /dev/null differ diff --git a/media/img/file/192/word.png b/media/img/file/192/word.png deleted file mode 100644 index 9018b64caf7..00000000000 Binary files a/media/img/file/192/word.png and /dev/null differ diff --git a/media/img/file/24/excel.png b/media/img/file/24/excel.png deleted file mode 100644 index 99f9aaaa9a7..00000000000 Binary files a/media/img/file/24/excel.png and /dev/null differ diff --git a/media/img/file/24/file.png b/media/img/file/24/file.png deleted file mode 100644 index 4c5e246b307..00000000000 Binary files a/media/img/file/24/file.png and /dev/null differ diff --git a/media/img/file/24/music.png b/media/img/file/24/music.png deleted file mode 100644 index 3a91d035c8c..00000000000 Binary files a/media/img/file/24/music.png and /dev/null differ diff --git a/media/img/file/24/pdf.png b/media/img/file/24/pdf.png deleted file mode 100644 index 11f0d637fa3..00000000000 Binary files a/media/img/file/24/pdf.png and /dev/null differ diff --git a/media/img/file/24/pic.png b/media/img/file/24/pic.png deleted file mode 100644 index d628f47363a..00000000000 Binary files a/media/img/file/24/pic.png and /dev/null differ diff --git a/media/img/file/24/ppt.png b/media/img/file/24/ppt.png deleted file mode 100644 index 6aa676fd032..00000000000 Binary files a/media/img/file/24/ppt.png and /dev/null differ diff --git a/media/img/file/24/sdoc.png b/media/img/file/24/sdoc.png deleted file mode 100644 index d5d9e7a8213..00000000000 Binary files a/media/img/file/24/sdoc.png and /dev/null differ diff --git a/media/img/file/24/txt.png b/media/img/file/24/txt.png deleted file mode 100644 index 281abef98eb..00000000000 Binary files a/media/img/file/24/txt.png and /dev/null differ diff --git a/media/img/file/24/video.png b/media/img/file/24/video.png deleted file mode 100644 index af35e8c2997..00000000000 Binary files a/media/img/file/24/video.png and /dev/null differ diff --git a/media/img/file/24/word.png b/media/img/file/24/word.png deleted file mode 100644 index 61f26a99a48..00000000000 Binary files a/media/img/file/24/word.png and /dev/null differ diff --git a/media/img/file/256/css.png b/media/img/file/256/css.png new file mode 100644 index 00000000000..a9b8adabc33 Binary files /dev/null and b/media/img/file/256/css.png differ diff --git a/media/img/file/256/excel.png b/media/img/file/256/excel.png new file mode 100644 index 00000000000..7b15bbaa9f5 Binary files /dev/null and b/media/img/file/256/excel.png differ diff --git a/media/img/file/256/file.png b/media/img/file/256/file.png new file mode 100644 index 00000000000..d8c678f72cf Binary files /dev/null and b/media/img/file/256/file.png differ diff --git a/media/img/file/256/md.png b/media/img/file/256/md.png new file mode 100644 index 00000000000..b0183004b2a Binary files /dev/null and b/media/img/file/256/md.png differ diff --git a/media/img/file/256/music.png b/media/img/file/256/music.png new file mode 100644 index 00000000000..69763a76f06 Binary files /dev/null and b/media/img/file/256/music.png differ diff --git a/media/img/file/256/pdf.png b/media/img/file/256/pdf.png new file mode 100644 index 00000000000..d3c166bb552 Binary files /dev/null and b/media/img/file/256/pdf.png differ diff --git a/media/img/file/256/pic.png b/media/img/file/256/pic.png new file mode 100644 index 00000000000..0c31dcc324a Binary files /dev/null and b/media/img/file/256/pic.png differ diff --git a/media/img/file/256/ppt.png b/media/img/file/256/ppt.png new file mode 100644 index 00000000000..a9aa5a8f544 Binary files /dev/null and b/media/img/file/256/ppt.png differ diff --git a/media/img/file/256/psd.png b/media/img/file/256/psd.png new file mode 100644 index 00000000000..8609cdd0c28 Binary files /dev/null and b/media/img/file/256/psd.png differ diff --git a/media/img/file/256/sdoc.png b/media/img/file/256/sdoc.png new file mode 100644 index 00000000000..e594c53e081 Binary files /dev/null and b/media/img/file/256/sdoc.png differ diff --git a/media/img/file/256/sdoc_notification.ico b/media/img/file/256/sdoc_notification.ico new file mode 100644 index 00000000000..5127696e004 Binary files /dev/null and b/media/img/file/256/sdoc_notification.ico differ diff --git a/media/img/file/256/txt.png b/media/img/file/256/txt.png new file mode 100644 index 00000000000..d8c678f72cf Binary files /dev/null and b/media/img/file/256/txt.png differ diff --git a/media/img/file/256/video.png b/media/img/file/256/video.png new file mode 100644 index 00000000000..b1b5ff81326 Binary files /dev/null and b/media/img/file/256/video.png differ diff --git a/media/img/file/256/word.png b/media/img/file/256/word.png new file mode 100644 index 00000000000..458950d4ad0 Binary files /dev/null and b/media/img/file/256/word.png differ