diff options
author | Thomas Ebert <thomas.ebert@usability.de> | 2017-08-31 17:20:21 +0300 |
---|---|---|
committer | Thomas Ebert <thomas.ebert@usability.de> | 2017-08-31 17:53:07 +0300 |
commit | 93d539b0cf06249545bed413a71ffb50dfdcfb87 (patch) | |
tree | 38f929b43a73cd1cc468fe0e9889bb4c2ba95f26 | |
parent | 84ea66dca8593a967d0114a7d0206260263f61f9 (diff) |
Add mimetype support for .URL (Windows) and .webloc (macOS) files. Update places/link svg. Add filetype/link icon. Add repair step for mime types.
Signed-off-by: Thomas Ebert <thomas.ebert@te-online.net>
-rw-r--r-- | core/Command/Maintenance/Mimetype/UpdateJS.php | 2 | ||||
-rw-r--r-- | core/img/filetypes/link.svg | 1 | ||||
-rw-r--r-- | core/img/places/link.svg | 2 | ||||
-rw-r--r-- | core/js/mimetypelist.js | 6 | ||||
-rw-r--r-- | lib/private/Repair/RepairMimeTypes.php | 15 | ||||
-rw-r--r-- | resources/config/mimetypemapping.dist.json | 6 |
6 files changed, 25 insertions, 7 deletions
diff --git a/core/Command/Maintenance/Mimetype/UpdateJS.php b/core/Command/Maintenance/Mimetype/UpdateJS.php index 7908d066c80..f302b4a2018 100644 --- a/core/Command/Maintenance/Mimetype/UpdateJS.php +++ b/core/Command/Maintenance/Mimetype/UpdateJS.php @@ -113,7 +113,7 @@ class UpdateJS extends Command { * * You can update the list of MimeType Aliases in config/mimetypealiases.json * The list of files is fetched from core/img/filetypes -* To regenerate this file run ./occ maintenance:mimetypesjs +* To regenerate this file run ./occ maintenance:mimetype:update-js */ OC.MimeTypeList={ aliases: ' . json_encode($aliases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . ', diff --git a/core/img/filetypes/link.svg b/core/img/filetypes/link.svg new file mode 100644 index 00000000000..999a9deb70e --- /dev/null +++ b/core/img/filetypes/link.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16"><path d="M7.4 0C3.3 0 0 3.3 0 7.4s3.3 7.4 7.4 7.4 7.4-3.3 7.4-7.4S11.5 0 7.4 0zm.8.9c1.3 0 2.4.8 3.5 1.3l1.8 2.5-.3 1.1.6.3V8.5c-.2.7-.6 1.3-.9 2-.2.1 0-.8-.1-1 0-.6-.5-.6-.9-.2-.4.3-1.4.3-1.5-.4-.3-.8 0-1.7.3-2.5l-.6-.7.2-1.8-.8-.9.2-1-1-.6c-.2-.2-.6-.2-.7-.4.1 0 .2-.1.2-.1zM5.6 1s.1 0 .1.1c.4.2-.1.4-.2.6-.5.3.3.7.5 1 .4-.1.8-.7 1.4-.5.7-.2.6.6 1.1 1 .1.2.9.8.4.6-.5-.4-1-.4-1.3.1-.8.5-.3-.9-.7-1.2-.6-.7-.4.5-.4.9-.4 0-1.1-.3-1.5.2l.4.6.5-.7c0-.3.1.2.3.3.1.2.8.7.3.9-.8.4-1.4 1.1-2.1 1.7-.2.5-.7.4-1 0-.7-.4-.7.7-.6 1.1l.6-.4v1.1c-.4.4-.9-.7-1.3-.9V5.9c0-.4-.1-.9 0-1.3.8-.9 1.7-1.9 2.2-3h.8c.6.2.3-.7.5-.6zM4.4 9.2c.1 0 .2 0 .3.1.8.1 1.4.7 2 1.1.5.5 1.6.3 1.7 1.2-.2.9-1.1 1.4-1.8 1.7-.2.1-.4.2-.6.2-.7.2-1-.6-1.2-1.1-.3-.7-1.1-1.2-1-2.1 0-.4.2-1 .6-1.1z" fill="#969696" color="#000"/></svg> diff --git a/core/img/places/link.svg b/core/img/places/link.svg index efc9474522b..08127c00100 100644 --- a/core/img/places/link.svg +++ b/core/img/places/link.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32" version="1" viewbox="0 0 32 32"><path d="M16 4C9.373 4 4 9.373 4 16s5.373 12 12 12 12-5.373 12-12S22.627 4 16 4zm1.375 1.53c2.06.047 3.88 1.284 5.72 2.095l2.968 4.11-.47 1.765.907.563-.015 2.093c-.02.6.008 1.2-.016 1.797-.286 1.136-.945 2.17-1.5 3.203-.378.186.034-1.23-.204-1.672.055-1.017-.807-.97-1.39-.405-.722.42-2.308.547-2.36-.595-.41-1.37-.06-2.833.5-4.11l-.92-1.124.326-2.89-1.47-1.484.346-1.625-1.72-.968c-.338-.266-.983-.37-1.124-.734.14-.008.284-.02.422-.016zm-4.22.017c.055.008.12.045.22.125.58.318-.14.68-.312 1.016-.926.626.284 1.138.687 1.64.646-.185 1.292-1.108 2.234-.828 1.206-.376 1.014 1.01 1.703 1.625.09.29 1.51 1.232.657.922-.702-.544-1.483-.503-1.985.28-1.356.736-.553-1.413-1.203-1.936-.982-1.095-.57.82-.687 1.392-.64-.014-1.83-.492-2.485.28l.64 1.048.766-1.172c.187-.424.42.33.626.47.246.472 1.41 1.273.532 1.5-1.304.722-2.33 1.82-3.438 2.796-.374.788-1.137.698-1.61.047-1.143-.703-1.058 1.126-1 1.813l1.002-.626v1.03c-.028.196-.004.4-.016.595-.7.732-1.406-1.027-2.015-1.422l-.046-2.578c.022-.724-.13-1.466.016-2.172 1.377-1.48 2.777-3.01 3.593-4.89h1.344c.94.454.404-1.01.78-.954zm-1.983 13.406a.955.955 0 0 1 .547.125c1.264.18 2.21 1.1 3.218 1.797.803.796 2.542.54 2.734 1.89-.292 1.464-1.732 2.25-3 2.766a3.132 3.132 0 0 1-1.015.377c-1.176.293-1.684-.912-1.922-1.814-.532-1.114-1.862-1.958-1.672-3.327.03-.68.403-1.738 1.11-1.813z" fill="#333"/></svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16"><path d="M7.4 0C3.3 0 0 3.3 0 7.4s3.3 7.4 7.4 7.4 7.4-3.3 7.4-7.4S11.5 0 7.4 0zm.8.9c1.3 0 2.4.8 3.5 1.3l1.8 2.5-.3 1.1.6.3V8.5c-.2.7-.6 1.3-.9 2-.2.1 0-.8-.1-1 0-.6-.5-.6-.9-.2-.4.3-1.4.3-1.5-.4-.3-.8 0-1.7.3-2.5l-.6-.7.2-1.8-.8-.9.2-1-1-.6c-.2-.2-.6-.2-.7-.4.1 0 .2-.1.2-.1zM5.6 1s.1 0 .1.1c.4.2-.1.4-.2.6-.5.3.3.7.5 1 .4-.1.8-.7 1.4-.5.7-.2.6.6 1.1 1 .1.2.9.8.4.6-.5-.4-1-.4-1.3.1-.8.5-.3-.9-.7-1.2-.6-.7-.4.5-.4.9-.4 0-1.1-.3-1.5.2l.4.6.5-.7c0-.3.1.2.3.3.1.2.8.7.3.9-.8.4-1.4 1.1-2.1 1.7-.2.5-.7.4-1 0-.7-.4-.7.7-.6 1.1l.6-.4v1.1c-.4.4-.9-.7-1.3-.9V5.9c0-.4-.1-.9 0-1.3.8-.9 1.7-1.9 2.2-3h.8c.6.2.3-.7.5-.6zM4.4 9.2c.1 0 .2 0 .3.1.8.1 1.4.7 2 1.1.5.5 1.6.3 1.7 1.2-.2.9-1.1 1.4-1.8 1.7-.2.1-.4.2-.6.2-.7.2-1-.6-1.2-1.1-.3-.7-1.1-1.2-1-2.1 0-.4.2-1 .6-1.1z"/></svg>
\ No newline at end of file diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index b0104b50bef..ea513131d88 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -4,7 +4,7 @@ * * You can update the list of MimeType Aliases in config/mimetypealiases.json * The list of files is fetched from core/img/filetypes -* To regenerate this file run ./occ maintenance:mimetypesjs +* To regenerate this file run ./occ maintenance:mimetype:update-js */ OC.MimeTypeList={ aliases: { @@ -94,7 +94,8 @@ OC.MimeTypeList={ "text/x-ldif": "text/code", "text/x-python": "text/code", "text/x-shellscript": "text/code", - "web": "text/code" + "web": "text/code", + "application/internet-shortcut": "link" }, files: [ "application", @@ -108,6 +109,7 @@ OC.MimeTypeList={ "folder-shared", "folder-starred", "image", + "link", "location", "package-x-generic", "text", diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 0bf35c1d2ae..74d81be9834 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -100,7 +100,7 @@ class RepairMimeTypes implements IRepairStep { // insert mimetype \OC_DB::executeAudited(self::insertStmt(), array($mimetype)); } - + // get target mimetype id $result = \OC_DB::executeAudited(self::getIdStmt(), array($mimetype)); $mimetypeId = $result->fetchOne(); @@ -140,6 +140,15 @@ class RepairMimeTypes implements IRepairStep { $this->updateMimetypes($updatedMimetypes); } + private function introduceInternetShortcutTypes() { + $updatedMimetypes = [ + 'url' => 'application/internet-shortcut', + 'webloc' => 'application/internet-shortcut' + ]; + + $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -161,5 +170,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.0', '<') && $this->introduceLocationTypes()) { $out->info('Fixed geospatial mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.3', '<') && $this->introduceInternetShortcutTypes()) { + $out->info('Fixed internet-shortcut mime types'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index ae90a138a42..06e4d30b9e5 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -120,7 +120,7 @@ "ogg": ["audio/ogg"], "ogv": ["video/ogg"], "one": ["application/msonenote"], - "opus": ["audio/ogg"], + "opus": ["audio/ogg"], "orf": ["image/x-dcraw"], "otf": ["application/font-sfnt"], "pages": ["application/x-iwork-pages-sffpages"], @@ -193,5 +193,7 @@ "xrf": ["image/x-dcraw"], "yaml": ["application/yaml", "text/plain"], "yml": ["application/yaml", "text/plain"], - "zip": ["application/zip"] + "zip": ["application/zip"], + "url": ["application/internet-shortcut"], + "webloc": ["application/internet-shortcut"] } |