diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/public.js | 25 | ||||
-rw-r--r-- | apps/theming/lib/Service/BackgroundService.php | 18 |
2 files changed, 42 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 6c68490aef5..9b0f4421360 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -62,6 +62,11 @@ OCA.Sharing.PublicApp = { // file list mode ? if ($el.find('.files-filestable').length) { + // Toggle for grid view + this.$showGridView = $('input#showgridview'); + this.$showGridView.on('change', _.bind(this._onGridviewChange, this)); + $('#view-toggle').tooltip({placement: 'bottom', trigger: 'hover'}); + var filesClient = new OC.Files.Client({ host: OC.getHost(), port: OC.getPort(), @@ -364,6 +369,26 @@ OCA.Sharing.PublicApp = { } }, + /** + * Toggle showing gridview by default or not + * + * @returns {undefined} + */ + _onGridviewChange: function() { + const isGridView = this.$showGridView.is(':checked'); + this.$showGridView.next('#view-toggle') + .removeClass('icon-toggle-filelist icon-toggle-pictures') + .addClass(isGridView ? 'icon-toggle-filelist' : 'icon-toggle-pictures') + this.$showGridView.next('#view-toggle').attr( + 'data-original-title', + isGridView ? t('files', 'Show list view') : t('files', 'Show grid view'), + ) + + if (this.fileList) { + this.fileList.setGridView(isGridView); + } + }, + _onDirectoryChanged: function (e) { OC.Util.History.pushState({ // arghhhh, why is this not called "dir" !? diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index 2223c1d2d0a..bbf7bde9e5f 100644 --- a/apps/theming/lib/Service/BackgroundService.php +++ b/apps/theming/lib/Service/BackgroundService.php @@ -49,67 +49,83 @@ class BackgroundService { 'anatoly-mikhaltsov-butterfly-wing-scale.jpg' => [ 'attribution' => 'Butterfly wing scale (Anatoly Mikhaltsov, CC BY-SA)', 'attribution_url' => 'https://commons.wikimedia.org/wiki/File:%D0%A7%D0%B5%D1%88%D1%83%D0%B9%D0%BA%D0%B8_%D0%BA%D1%80%D1%8B%D0%BB%D0%B0_%D0%B1%D0%B0%D0%B1%D0%BE%D1%87%D0%BA%D0%B8.jpg', + 'primary_color' => '#a53c17', ], 'bernie-cetonia-aurata-take-off-composition.jpg' => [ 'attribution' => 'Cetonia aurata take off composition (Bernie, Public Domain)', 'attribution_url' => 'https://commons.wikimedia.org/wiki/File:Cetonia_aurata_take_off_composition_05172009.jpg', 'theming' => self::THEMING_MODE_DARK, + 'primary_color' => '#56633d', ], 'dejan-krsmanovic-ribbed-red-metal.jpg' => [ 'attribution' => 'Ribbed red metal (Dejan Krsmanovic, CC BY)', 'attribution_url' => 'https://www.flickr.com/photos/dejankrsmanovic/42971456774/', + 'primary_color' => '#9c4236', ], 'eduardo-neves-pedra-azul.jpg' => [ 'attribution' => 'Pedra azul milky way (Eduardo Neves, CC BY-SA)', 'attribution_url' => 'https://commons.wikimedia.org/wiki/File:Pedra_Azul_Milky_Way.jpg', + 'primary_color' => '#4f6071', ], 'european-space-agency-barents-bloom.jpg' => [ 'attribution' => 'Barents bloom (European Space Agency, CC BY-SA)', 'attribution_url' => 'https://www.esa.int/ESA_Multimedia/Images/2016/08/Barents_bloom', + 'primary_color' => '#396475', ], 'hannes-fritz-flippity-floppity.jpg' => [ 'attribution' => 'Flippity floppity (Hannes Fritz, CC BY-SA)', 'attribution_url' => 'http://hannes.photos/flippity-floppity', + 'primary_color' => '#98415a', ], 'hannes-fritz-roulette.jpg' => [ 'attribution' => 'Roulette (Hannes Fritz, CC BY-SA)', 'attribution_url' => 'http://hannes.photos/roulette', + 'primary_color' => '#845334', ], 'hannes-fritz-sea-spray.jpg' => [ 'attribution' => 'Sea spray (Hannes Fritz, CC BY-SA)', 'attribution_url' => 'http://hannes.photos/sea-spray', + 'primary_color' => '#4f6071', ], 'kamil-porembinski-clouds.jpg' => [ 'attribution' => 'Clouds (Kamil PorembiĆski, CC BY-SA)', 'attribution_url' => 'https://www.flickr.com/photos/paszczak000/8715851521/', + // Originally #0082c9 but adjusted for accessibility + 'primary_color' => '#00639a', ], 'bernard-spragg-new-zealand-fern.jpg' => [ 'attribution' => 'New zealand fern (Bernard Spragg, CC0)', 'attribution_url' => 'https://commons.wikimedia.org/wiki/File:NZ_Fern.(Blechnum_chambersii)_(11263534936).jpg', + 'primary_color' => '#316b26', ], 'rawpixel-pink-tapioca-bubbles.jpg' => [ 'attribution' => 'Pink tapioca bubbles (Rawpixel, CC BY)', 'attribution_url' => 'https://www.flickr.com/photos/byrawpixel/27665140298/in/photostream/', 'theming' => self::THEMING_MODE_DARK, + 'primary_color' => '#7b4e7e', ], 'nasa-waxing-crescent-moon.jpg' => [ 'attribution' => 'Waxing crescent moon (NASA, Public Domain)', 'attribution_url' => 'https://www.nasa.gov/image-feature/a-waxing-crescent-moon', + 'primary_color' => '#005ac1', ], 'tommy-chau-already.jpg' => [ 'attribution' => 'Cityscape (Tommy Chau, CC BY)', 'attribution_url' => 'https://www.flickr.com/photos/90975693@N05/16910999368', + 'primary_color' => '#6a2af4', ], 'tommy-chau-lion-rock-hill.jpg' => [ 'attribution' => 'Lion rock hill (Tommy Chau, CC BY)', 'attribution_url' => 'https://www.flickr.com/photos/90975693@N05/17136440246', 'theming' => self::THEMING_MODE_DARK, + 'primary_color' => '#7f4f70', ], 'lali-masriera-yellow-bricks.jpg' => [ 'attribution' => 'Yellow bricks (Lali Masriera, CC BY)', 'attribution_url' => 'https://www.flickr.com/photos/visualpanic/3982464447', 'theming' => self::THEMING_MODE_DARK, - ] + 'primary_color' => '#7f5700', + ], ]; private IRootFolder $rootFolder; |