From 7386fa57c8fd8422b6aa2c947603c8c2f945ba62 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Nov 2017 17:13:48 -0800 Subject: remove column item.diaspora_meta, action items 2 and 3 of hubzilla issue #828 --- boot.php | 2 +- install/schema_mysql.sql | 1 - install/update.php | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 0ac1d08df..3fc53a47b 100755 --- a/boot.php +++ b/boot.php @@ -53,7 +53,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '2.9' ); define ( 'ZOT_REVISION', '1.3' ); -define ( 'DB_UPDATE_VERSION', 1197 ); +define ( 'DB_UPDATE_VERSION', 1198 ); define ( 'PROJECT_BASE', __DIR__ ); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index afa3c095d..673e4cd75 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -609,7 +609,6 @@ CREATE TABLE IF NOT EXISTS `item` ( `resource_type` char(16) NOT NULL DEFAULT '', `attach` mediumtext NOT NULL, `sig` text NOT NULL, - `diaspora_meta` mediumtext NOT NULL, `location` char(191) NOT NULL DEFAULT '', `coord` char(191) NOT NULL DEFAULT '', `public_policy` char(191) NOT NULL DEFAULT '', diff --git a/install/update.php b/install/update.php index 7d59555d3..f7b9b03ed 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Thu, 16 Nov 2017 19:26:56 -0800 Subject: allow svg image previews in cloud browser when using tile mode. --- Zotlabs/Storage/Browser.php | 11 ++++++++++- view/tpl/cloud_directory.tpl | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index b5440aacf..ee5a9fef4 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -197,6 +197,11 @@ class Browser extends DAV\Browser\Plugin { } } + + // generate preview icons for tile view. + // Currently we only handle images, but this could potentially be extended with plugins + // to provide document and video thumbnails + $photo_icon = ''; if(strpos($type,'image/') === 0 && $attachHash) { @@ -206,8 +211,12 @@ class Browser extends DAV\Browser\Plugin { intval(PHOTO_RES_PROFILE_80) ); if($r) { - $photo_icon = $r[0]['resource_id'] . '-' . $r[0]['imgscale']; + $photo_icon = 'photo/' . $r[0]['resource_id'] . '-' . $r[0]['imgscale']; } + if($type === 'image/svg+xml') { + $photo_icon = $fullPath; + } + } $attachIcon = ""; // ""; diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl index 40278661f..3ae8cbf35 100644 --- a/view/tpl/cloud_directory.tpl +++ b/view/tpl/cloud_directory.tpl @@ -16,7 +16,7 @@
{{if $item.photo_icon}} - + {{else}} {{/if}} -- cgit v1.2.3 From ab363e31322d699ee53f052d5198c3a7680f8cc8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Nov 2017 19:58:09 -0800 Subject: improve the icon mappings for cloud tile view --- include/attach.php | 12 +++++++++--- include/text.php | 27 ++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/include/attach.php b/include/attach.php index 96b9c0b44..0f07fe035 100644 --- a/include/attach.php +++ b/include/attach.php @@ -31,7 +31,6 @@ function z_mime_content_type($filename) { 'txt' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html', - 'php' => 'text/html', 'css' => 'text/css', 'md' => 'text/markdown', 'bb' => 'text/bbcode', @@ -41,8 +40,17 @@ function z_mime_content_type($filename) { 'swf' => 'application/x-shockwave-flash', 'flv' => 'video/x-flv', 'epub' => 'application/epub+zip', + 'c' => 'text/plain', + 'h' => 'text/plain', + 'sh' => 'text/plain', + 'py' => 'text/plain', + 'php' => 'text/plain', + 'rb' => 'text/plain', + 'pdl' => 'text/plain', + // images + 'png' => 'image/png', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', @@ -73,9 +81,7 @@ function z_mime_content_type($filename) { 'flac' => 'audio/flac', 'opus' => 'audio/ogg', 'webm' => 'video/webm', -// 'webm' => 'audio/webm', 'mp4' => 'video/mp4', -// 'mp4' => 'audio/mp4', 'mkv' => 'video/x-matroska', // adobe diff --git a/include/text.php b/include/text.php index c74e515d2..ee8318d7c 100644 --- a/include/text.php +++ b/include/text.php @@ -2710,6 +2710,9 @@ function getIconFromType($type) { 'application/octet-stream' => 'fa-file-o', //Text 'text/plain' => 'fa-file-text-o', + 'text/markdown' => 'fa-file-text-o', + 'text/bbcode' => 'fa-file-text-o', + 'text/html' => 'fa-file-text-o', 'application/msword' => 'fa-file-word-o', 'application/pdf' => 'fa-file-pdf-o', 'application/vnd.oasis.opendocument.text' => 'fa-file-word-o', @@ -2739,11 +2742,33 @@ function getIconFromType($type) { 'video/x-matroska' => 'fa-file-video-o' ); - $iconFromType = 'fa-file-o'; + $catMap = [ + 'application' => 'fa-file-code-o', + 'multipart' => 'fa-folder', + 'audio' => 'fa-file-audio-o', + 'video' => 'fa-file-video-o', + 'text' => 'fa-file-text-o', + 'image' => 'fa=file-picture-o', + 'message' => 'fa-file-text-o' + ]; + + + $iconFromType = ''; if (array_key_exists($type, $iconMap)) { $iconFromType = $iconMap[$type]; } + else { + $parts = explode('/',$type); + if($parts[0] && $catMap[$parts[0]]) { + $iconFromType = $catMap[$parts[0]]; + } + } + + if(! $iconFromType) { + $iconFromType = 'fa-file-o'; + } + return $iconFromType; } -- cgit v1.2.3