From 09508c9c5a28db6a308264054bbe94eeb0473b26 Mon Sep 17 00:00:00 2001 From: michigg Date: Mon, 4 Dec 2017 20:38:16 +0100 Subject: [PATCH] Fancy Pics --- .../migrations/0006_auto_20171204_1543.py | 22 + .../migrations/0007_auto_20171204_1634.py | 22 + .../migrations/0008_auto_20171204_1645.py | 22 + .../migrations/0009_auto_20171204_1648.py | 22 + ofu_app/apps/food/admin.py | 18 +- .../migrations/0004_auto_20171204_1543.py | 26 + .../migrations/0005_auto_20171204_1634.py | 24 + ofu_app/apps/food/models.py | 2 +- ofu_app/static/css/food/main.css | 10 + .../libs/lightbox2-master/.editorconfig | 21 + .../.github/ISSUE_TEMPLATE.md | 27 + .../.github/PULL_REQUEST_TEMPLATE.md | 4 + .../static/libs/lightbox2-master/.gitignore | 2 + ofu_app/static/libs/lightbox2-master/.jscsrc | 75 +++ .../static/libs/lightbox2-master/.jshintrc | 35 ++ .../static/libs/lightbox2-master/DEPLOY.md | 15 + .../static/libs/lightbox2-master/Gruntfile.js | 83 +++ ofu_app/static/libs/lightbox2-master/LICENSE | 21 + .../static/libs/lightbox2-master/README.md | 19 + .../static/libs/lightbox2-master/ROADMAP.md | 64 +++ .../static/libs/lightbox2-master/bower.json | 29 + .../libs/lightbox2-master/examples/index.html | 37 ++ .../static/libs/lightbox2-master/package.json | 40 ++ .../lightbox2-master/src/css/lightbox.css | 207 +++++++ .../lightbox2-master/src/images/close.png | Bin 0 -> 280 bytes .../lightbox2-master/src/images/loading.gif | Bin 0 -> 8476 bytes .../libs/lightbox2-master/src/images/next.png | Bin 0 -> 1350 bytes .../libs/lightbox2-master/src/images/prev.png | Bin 0 -> 1360 bytes .../libs/lightbox2-master/src/js/lightbox.js | 519 ++++++++++++++++++ ofu_app/templates/food/food_wrapper.jinja | 2 + ofu_app/templates/macros/food_macros.jinja | 10 +- 31 files changed, 1371 insertions(+), 7 deletions(-) create mode 100644 ofu_app/apps/donar/migrations/0006_auto_20171204_1543.py create mode 100644 ofu_app/apps/donar/migrations/0007_auto_20171204_1634.py create mode 100644 ofu_app/apps/donar/migrations/0008_auto_20171204_1645.py create mode 100644 ofu_app/apps/donar/migrations/0009_auto_20171204_1648.py create mode 100644 ofu_app/apps/food/migrations/0004_auto_20171204_1543.py create mode 100644 ofu_app/apps/food/migrations/0005_auto_20171204_1634.py create mode 100644 ofu_app/static/libs/lightbox2-master/.editorconfig create mode 100644 ofu_app/static/libs/lightbox2-master/.github/ISSUE_TEMPLATE.md create mode 100644 ofu_app/static/libs/lightbox2-master/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 ofu_app/static/libs/lightbox2-master/.gitignore create mode 100644 ofu_app/static/libs/lightbox2-master/.jscsrc create mode 100644 ofu_app/static/libs/lightbox2-master/.jshintrc create mode 100644 ofu_app/static/libs/lightbox2-master/DEPLOY.md create mode 100644 ofu_app/static/libs/lightbox2-master/Gruntfile.js create mode 100644 ofu_app/static/libs/lightbox2-master/LICENSE create mode 100644 ofu_app/static/libs/lightbox2-master/README.md create mode 100644 ofu_app/static/libs/lightbox2-master/ROADMAP.md create mode 100644 ofu_app/static/libs/lightbox2-master/bower.json create mode 100644 ofu_app/static/libs/lightbox2-master/examples/index.html create mode 100644 ofu_app/static/libs/lightbox2-master/package.json create mode 100644 ofu_app/static/libs/lightbox2-master/src/css/lightbox.css create mode 100644 ofu_app/static/libs/lightbox2-master/src/images/close.png create mode 100644 ofu_app/static/libs/lightbox2-master/src/images/loading.gif create mode 100644 ofu_app/static/libs/lightbox2-master/src/images/next.png create mode 100644 ofu_app/static/libs/lightbox2-master/src/images/prev.png create mode 100644 ofu_app/static/libs/lightbox2-master/src/js/lightbox.js diff --git a/ofu_app/apps/donar/migrations/0006_auto_20171204_1543.py b/ofu_app/apps/donar/migrations/0006_auto_20171204_1543.py new file mode 100644 index 0000000..c4f59ff --- /dev/null +++ b/ofu_app/apps/donar/migrations/0006_auto_20171204_1543.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 14:43 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('donar', '0005_auto_20171204_0454'), + ] + + operations = [ + migrations.AlterField( + model_name='lecture_terms', + name='starttime', + field=models.TimeField(default=datetime.datetime(2017, 12, 4, 14, 42, 5, 347, tzinfo=utc)), + ), + ] diff --git a/ofu_app/apps/donar/migrations/0007_auto_20171204_1634.py b/ofu_app/apps/donar/migrations/0007_auto_20171204_1634.py new file mode 100644 index 0000000..3519f5e --- /dev/null +++ b/ofu_app/apps/donar/migrations/0007_auto_20171204_1634.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 15:34 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('donar', '0006_auto_20171204_1543'), + ] + + operations = [ + migrations.AlterField( + model_name='lecture_terms', + name='starttime', + field=models.TimeField(default=datetime.datetime(2017, 12, 4, 15, 34, 41, 765204, tzinfo=utc)), + ), + ] diff --git a/ofu_app/apps/donar/migrations/0008_auto_20171204_1645.py b/ofu_app/apps/donar/migrations/0008_auto_20171204_1645.py new file mode 100644 index 0000000..5758407 --- /dev/null +++ b/ofu_app/apps/donar/migrations/0008_auto_20171204_1645.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 15:45 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('donar', '0007_auto_20171204_1634'), + ] + + operations = [ + migrations.AlterField( + model_name='lecture_terms', + name='starttime', + field=models.TimeField(default=datetime.datetime(2017, 12, 4, 15, 45, 46, 720753, tzinfo=utc)), + ), + ] diff --git a/ofu_app/apps/donar/migrations/0009_auto_20171204_1648.py b/ofu_app/apps/donar/migrations/0009_auto_20171204_1648.py new file mode 100644 index 0000000..511cf38 --- /dev/null +++ b/ofu_app/apps/donar/migrations/0009_auto_20171204_1648.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 15:48 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('donar', '0008_auto_20171204_1645'), + ] + + operations = [ + migrations.AlterField( + model_name='lecture_terms', + name='starttime', + field=models.TimeField(default=datetime.datetime(2017, 12, 4, 15, 48, 28, 229201, tzinfo=utc)), + ), + ] diff --git a/ofu_app/apps/food/admin.py b/ofu_app/apps/food/admin.py index ededaa5..160c214 100644 --- a/ofu_app/apps/food/admin.py +++ b/ofu_app/apps/food/admin.py @@ -4,10 +4,24 @@ from __future__ import unicode_literals from django.contrib import admin from apps.food.models import SingleFood, Menu, HappyHour, UserRating, UserFoodImage + +class SingleFoodInline(admin.TabularInline): + model = Menu.menu.through + extra = 1 + # fields = ['menu__image', ] + + +class MenuAdmin(admin.ModelAdmin): + list_filter = ('date',) + inlines = [ + SingleFoodInline, + ] + exclude = ('menu',) + + # Register your models here. admin.site.register(SingleFood) -admin.site.register(Menu) admin.site.register(HappyHour) admin.site.register(UserRating) admin.site.register(UserFoodImage) - +admin.site.register(Menu, MenuAdmin) diff --git a/ofu_app/apps/food/migrations/0004_auto_20171204_1543.py b/ofu_app/apps/food/migrations/0004_auto_20171204_1543.py new file mode 100644 index 0000000..a059ab9 --- /dev/null +++ b/ofu_app/apps/food/migrations/0004_auto_20171204_1543.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 14:43 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('food', '0003_auto_20171204_0454'), + ] + + operations = [ + migrations.RemoveField( + model_name='menu', + name='menu', + ), + migrations.AddField( + model_name='menu', + name='menu', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='food.SingleFood'), + preserve_default=False, + ), + ] diff --git a/ofu_app/apps/food/migrations/0005_auto_20171204_1634.py b/ofu_app/apps/food/migrations/0005_auto_20171204_1634.py new file mode 100644 index 0000000..39f831d --- /dev/null +++ b/ofu_app/apps/food/migrations/0005_auto_20171204_1634.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-12-04 15:34 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('food', '0004_auto_20171204_1543'), + ] + + operations = [ + migrations.RemoveField( + model_name='menu', + name='menu', + ), + migrations.AddField( + model_name='menu', + name='menu', + field=models.ManyToManyField(to='food.SingleFood'), + ), + ] diff --git a/ofu_app/apps/food/models.py b/ofu_app/apps/food/models.py index 949c7d1..f2b7bc9 100644 --- a/ofu_app/apps/food/models.py +++ b/ofu_app/apps/food/models.py @@ -12,7 +12,7 @@ class Menu(models.Model): id = models.AutoField(primary_key=True) date = models.DateField(default=timezone.now) location = models.CharField(max_length=MAX_LENGTH) - menu = models.ManyToManyField("SingleFood") + menu = models.ManyToManyField("SingleFood", related_name="foods") class Meta: unique_together = ('date', 'location') diff --git a/ofu_app/static/css/food/main.css b/ofu_app/static/css/food/main.css index 05851a7..a24f1cd 100644 --- a/ofu_app/static/css/food/main.css +++ b/ofu_app/static/css/food/main.css @@ -39,4 +39,14 @@ footer { .image-wrapper img { width: 80px; height: 80px; +} + +.lb-image, .lb-outerContainer, .lb-image { + width: 56% !important; + height: auto !important; +} + +.lb-image { + width: 100% !important; + height: auto !important; } \ No newline at end of file diff --git a/ofu_app/static/libs/lightbox2-master/.editorconfig b/ofu_app/static/libs/lightbox2-master/.editorconfig new file mode 100644 index 0000000..c2cdfb8 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/ofu_app/static/libs/lightbox2-master/.github/ISSUE_TEMPLATE.md b/ofu_app/static/libs/lightbox2-master/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..823a414 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,27 @@ +🐛 **Github issues is for bugs only.** No feature requests or support tickets please. + +## Trouble using Lightbox? + +1. Search [Stackoverflow](https://stackoverflow.com/questions/tagged/lightbox2) to see if other people have run into similar issues. +3. If you don't find anything similar, then post a new question on [Stackoverflow](https://stackoverflow.com/questions/ask). Use the `lightbox2` tag. + +## Have a Feature Request? + +1. [Search through existing Github Issues and PRs](https://github.com/lokesh/lightbox2/issues) to see if the feature has been discussed or already created. +2. If not, search [Stackoverflow](https://stackoverflow.com/questions/tagged/lightbox2) to see if other people have made similar requests. +3. If your feature request is unique, then post a new question on [Stackoverflow](https://stackoverflow.com/questions/ask). Use the `lightbox2` tag. + +View the project [Roadmap](https://github.com/lokesh/lightbox2/blob/master/ROADMAP.md). + + +## Found a Bug? + +[Search through existing Github Issues](https://github.com/lokesh/lightbox2/issues) that have been reported to avoid creating a duplicate issue. If your bug has not been reported, create a new issue with the following details: + +**What version of Lightbox2 you are using?** + +**Which browsers and operating systems have you seen the issue on?** + +**What are the steps to reproduce the bug?** + +**Do you have link to a live site where the bug is visible? or can you post relevant HTML, CSS, and Javascript?** diff --git a/ofu_app/static/libs/lightbox2-master/.github/PULL_REQUEST_TEMPLATE.md b/ofu_app/static/libs/lightbox2-master/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..92828b7 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,4 @@ +> Pull Requests are welcome. But note that v2 of Lightbox is in Maintenance Mode and no new features +> will be added. See the [Roadmap](https://github.com/lokesh/lightbox2/blob/master/ROADMAP.md). +> +> PRs submitted will still be reviewed and then kept open for other users to utilize. diff --git a/ofu_app/static/libs/lightbox2-master/.gitignore b/ofu_app/static/libs/lightbox2-master/.gitignore new file mode 100644 index 0000000..7bf6eb1 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.gitignore @@ -0,0 +1,2 @@ +bower_components +node_modules diff --git a/ofu_app/static/libs/lightbox2-master/.jscsrc b/ofu_app/static/libs/lightbox2-master/.jscsrc new file mode 100644 index 0000000..b1ee028 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.jscsrc @@ -0,0 +1,75 @@ +{ + "requireSpaceAfterLineComment": true, + "requireSpaceAfterKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "void", + "while", + "with", + "return", + "typeof" + ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": true, + "disallowMultipleVarDecl": true, + "requireBlocksOnNewline": true, + "disallowEmptyBlocks": true, + "disallowSpacesInsideParentheses": true, + "disallowSpaceAfterObjectKeys": true, + "requireSpaceBeforeObjectValues": true, + "requireCommaBeforeLineBreak": true, + "requireOperatorBeforeLineBreak": [ + "?", + "=", + "+", + "-", + "/", + "*", + "==", + "===", + "!=", + "!==", + ">", + ">=", + "<", + "<=" + ], + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforeBinaryOperators": [ + "=", + "+", + "-", + "/", + "*", + "==", + "===", + "!=", + "!==" + ], + "requireSpaceAfterBinaryOperators": [ + "=", + ",", + "+", + "-", + "/", + "*", + "==", + "===", + "!=", + "!==" + ], + "disallowMixedSpacesAndTabs" : true, + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true +} + diff --git a/ofu_app/static/libs/lightbox2-master/.jshintrc b/ofu_app/static/libs/lightbox2-master/.jshintrc new file mode 100644 index 0000000..1bc8f85 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/.jshintrc @@ -0,0 +1,35 @@ +{ + "bitwise":true, + "browser":true, + "camelcase":true, + "curly":true, + "eqeqeq":true, + "forin":true, + "freeze":true, + "indent":2, + "latedef":true, + "maxdepth": 6, + "maxparams": 6, + "maxstatements": 50, + "newcap": true, + "noarg":true, + "noempty":true, + "nonbsp":true, + "nonew":true, + "quotmark":"single", + "trailing":true, + "undef":true, + "unused":"vars", + "immed":true, + "browser": true, + "jquery":true, + "predef": [ + "alert", + "confirm", + "console", + "escape", + "define", + "module", + "require" + ] +} diff --git a/ofu_app/static/libs/lightbox2-master/DEPLOY.md b/ofu_app/static/libs/lightbox2-master/DEPLOY.md new file mode 100644 index 0000000..2645243 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/DEPLOY.md @@ -0,0 +1,15 @@ +## How to Make a Release + +### Build +- **Checkout dev branch.** This will contain work queued up for the next release. +- **Update version number.** Manually update version number in `src/lightbox.js` and `package.json`. Don't use `npm version`. +- **`grunt build`.** Make sure you have run `bower install` ahead of this as it will pull down jQuery which is utilized in the build step. +- **Merge to `master`.** Commit changes and push to new branch. Create PR from this branch to `master`. Merge. + +### Release +- **Create tagged release.** Go to [Github Releases page](https://github.com/lokesh/lightbox2/releases). Draft a new release. Naming convention is `v2.8.1`. Add notes that link to PRs. +- **`npm publish`**. No need to do anything for Bower as it is entirely based on the Github repo. + +### Maintenance and Docs +- **GH clean-up.** Close out issues with `[status] pending release`. +- **Lightbox Site.** If there are any changes to the options, don't forget to update the [Lightbox Site](http://localhost:8000/dist/#options). The code lives in a separate repo, [lightbox2-site](https://github.com/lokesh/lightbox2-site/). diff --git a/ofu_app/static/libs/lightbox2-master/Gruntfile.js b/ofu_app/static/libs/lightbox2-master/Gruntfile.js new file mode 100644 index 0000000..6eea00c --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/Gruntfile.js @@ -0,0 +1,83 @@ +module.exports = function(grunt) { + + grunt.initConfig({ + concat: { + dist: { + src: ['bower_components/jquery/dist/jquery.js', 'src/js/lightbox.js'], + dest: 'dist/js/lightbox-plus-jquery.js', + }, + }, + connect: { + server: { + options: { + port: 8000 + } + } + }, + copy: { + dist: { + files: [ + { + expand: true, + cwd: 'src/', + src: ['**'], + dest: 'dist/' + } + ], + }, + }, + jshint: { + all: [ + 'src/js/lightbox.js' + ], + options: { + jshintrc: true + } + }, + jscs: { + src: [ + 'src/js/lightbox.js' + ], + options: { + config: ".jscsrc" + } + }, + uglify: { + options: { + preserveComments: 'some', + sourceMap: true + }, + dist: { + files: { + 'dist/js/lightbox.min.js': ['src/js/lightbox.js'], + 'dist/js/lightbox-plus-jquery.min.js': ['dist/js/lightbox-plus-jquery.js'] + } + } + }, + watch: { + jshint: { + files: ['src/js/lightbox.js'], + tasks: ['jshint', 'jscs'] + } + }, + cssmin: { + minify: { + src: 'dist/css/lightbox.css', + dest: 'dist/css/lightbox.min.css' + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks("grunt-jscs"); + + grunt.registerTask('default', ['connect', 'watch']); + grunt.registerTask('test', ['jshint', 'jscs']); + grunt.registerTask('build', ['jshint', 'jscs', 'copy:dist', 'concat', 'uglify', 'cssmin:minify']); +}; diff --git a/ofu_app/static/libs/lightbox2-master/LICENSE b/ofu_app/static/libs/lightbox2-master/LICENSE new file mode 100644 index 0000000..0b34e12 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Lokesh Dhakar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ofu_app/static/libs/lightbox2-master/README.md b/ofu_app/static/libs/lightbox2-master/README.md new file mode 100644 index 0000000..11ded5a --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/README.md @@ -0,0 +1,19 @@ +# Lightbox2 + +The original lightbox script. Eight years later — still going strong! + +Lightbox is small javascript library used to overlay images on top of the current page. It's a snap to setup and works on all modern browsers. + +- **Demos and usage instructions.** Visit the [Lightbox homepage](http://lokeshdhakar.com/projects/lightbox2/) to see examples, info on getting started, script options, how to get help, and more. +- **Releases and Changelog**. Viewable on the [Github Releases page](https://github.com/lokesh/lightbox2/releases) +- **Roadmap.** View the [Roadmap](https://github.com/lokesh/lightbox2/blob/master/ROADMAP.md) for a peek at what is being planned for future releases. +- **License.** Lightbox is licensed under the MIT License. [Learn more about the license.](http://lokeshdhakar.com/projects/lightbox2/#license) + +by [Lokesh Dhakar](http://www.lokeshdhakar.com) + +--- + +### Info for Maintainers + +- **Release instructions.** See [DEPLOY.md](https://github.com/lokesh/lightbox2/blob/master/DEPLOY.md). +- **Issues and PRs requiring review.** See items tagged with [\[status\] needs review](https://github.com/lokesh/lightbox2/labels/%5Bstatus%5D%20needs%20review) diff --git a/ofu_app/static/libs/lightbox2-master/ROADMAP.md b/ofu_app/static/libs/lightbox2-master/ROADMAP.md new file mode 100644 index 0000000..9292743 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/ROADMAP.md @@ -0,0 +1,64 @@ +# Roadmap + +## v2.x - Maintenance Mode + +No new features are being worked on for v2.x. + +## v3.0 - In Brainstorming Phase + +**Not planned for v3.0** +The goal of this script from it's beginnings till today is to to provide a better *image viewing experience*. + +- **HTML or video content.** If you need to show html or video content, I recommend googling for an alternative script as there are many options. +- **Social sharing buttons.** + +**Image Support** +- Investigate `srcset` and `` + +**Interactions** +- Add touch gesture support. +- Exploring using tilt gesture on mobile devices with extra-wide images. +- If user attempts to go forward when at end of image set, animation (shake?) indicating the end or option to close Lightbox. +- Make sure right-click/long pressing works to access the image's context menu. + +**Layout** +- Allow vertical centering. +- Update sizing on window resize. +- Should the dev be able to choose the position of the caption, close button, and nav controls? +- Optimize layout for mobile. +- Optimize layout for screens of varying densities. +- Should the close button still live in the bottom right corner? + +**Animations** +- Evaluate start, end, and transition animations. +- Rewrite animations for performance and flexibility. + +**Assets** +- Use inline SVG for UI elements. + +**Caching** +- Review if and how images should be preloaded + +**Error Handling** +- What happens when an image url is incorrect? +- What happens when an image takes too long to load? + +**Accessibility** +- Should opening lightbox update the url? and should this url be parsed on page load to show Lightbox automatically? +- Review alt attributes. +- Review ARIA roles. +- Review constrast ratios. +- Review keyboard input and tabbing. +- Review click/touch target size. +- Test with screen reader. + +**API** +- Do not initialize automatically and allow multiple instances. +- Add event handlers. +- Allow setting options on the fly. +- Allow the setting of options from HTML? +- Evaluate preloading and caching. +- Allow placement inside of a specified element? Orig feature requester was dealing with iframe. + +**Dependencies** +- Drop jQuery requirement. diff --git a/ofu_app/static/libs/lightbox2-master/bower.json b/ofu_app/static/libs/lightbox2-master/bower.json new file mode 100644 index 0000000..50fc7f4 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/bower.json @@ -0,0 +1,29 @@ +{ + "name": "lightbox2", + "homepage": "http://lokeshdhakar.com/projects/lightbox2/", + "authors": [ + "Lokesh Dhakar " + ], + "description": "The original Lightbox script. Uses jQuery.", + "main": [ + "./dist/js/lightbox.js", + "./dist/css/lightbox.css" + ], + "keywords": [ + "lightbox", + "lightbox2", + "overlay", + "gallery", + "slideshow", + "images" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components" + ], + "dependencies": { + "jquery": ">2" + } +} diff --git a/ofu_app/static/libs/lightbox2-master/examples/index.html b/ofu_app/static/libs/lightbox2-master/examples/index.html new file mode 100644 index 0000000..1312c7f --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/examples/index.html @@ -0,0 +1,37 @@ + + + + + Lightbox Example + + + + +
+

Two Individual Images

+
+ image-1 + image-1 +
+ +
+ +

A Four Image Set

+
+ + + + +
+
+ +
+

+ For more information, visit http://lokeshdhakar.com/projects/lightbox2/ +

+
+ + + + + diff --git a/ofu_app/static/libs/lightbox2-master/package.json b/ofu_app/static/libs/lightbox2-master/package.json new file mode 100644 index 0000000..4e62566 --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/package.json @@ -0,0 +1,40 @@ +{ + "name": "lightbox2", + "version": "2.10.0", + "author": "Lokesh Dhakar ", + "description": "The original Lightbox script. Uses jQuery.", + "keywords": [ + "lightbox", + "lightbox2", + "overlay", + "gallery", + "slideshow", + "images" + ], + "homepage": "http://lokeshdhakar.com/projects/lightbox2/", + "main": "./dist/js/lightbox.js", + "repository": { + "type": "git", + "url": "https://github.com/lokesh/lightbox2.git" + }, + "bugs": { + "url": "https://github.com/lokesh/lightbox2/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.githubusercontent.com/lokesh/lightbox2/master/LICENSE" + } + ], + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-connect": "^0.7.1", + "grunt-contrib-copy": "^0.8.0", + "grunt-contrib-cssmin": "^0.12.3", + "grunt-contrib-jshint": "^0.11.2", + "grunt-contrib-uglify": "~0.4.0", + "grunt-contrib-watch": "^0.5.3", + "grunt-jscs": "^1.8.0" + } +} diff --git a/ofu_app/static/libs/lightbox2-master/src/css/lightbox.css b/ofu_app/static/libs/lightbox2-master/src/css/lightbox.css new file mode 100644 index 0000000..a95d45a --- /dev/null +++ b/ofu_app/static/libs/lightbox2-master/src/css/lightbox.css @@ -0,0 +1,207 @@ +html.lb-disable-scrolling { + overflow: hidden; + /* Position fixed required for iOS. Just putting overflow: hidden; on the body is not enough. */ + position: fixed; + height: 100vh; + width: 100vw; +} + +.lightboxOverlay { + position: absolute; + top: 0; + left: 0; + z-index: 9999; + background-color: black; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + opacity: 0.8; + display: none; +} + +.lightbox { + position: absolute; + left: 0; + width: 100%; + z-index: 10000; + text-align: center; + line-height: 0; + font-weight: normal; +} + +.lightbox .lb-image { + display: block; + height: auto; + max-width: inherit; + max-height: none; + border-radius: 3px; + + /* Image border */ + border: 4px solid white; +} + +.lightbox a img { + border: none; +} + +.lb-outerContainer { + position: relative; + *zoom: 1; + width: 250px; + height: 250px; + margin: 0 auto; + border-radius: 4px; + + /* Background color behind image. + This is visible during transitions. */ + background-color: white; +} + +.lb-outerContainer:after { + content: ""; + display: table; + clear: both; +} + +.lb-loader { + position: absolute; + top: 43%; + left: 0; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} + +.lb-cancel { + display: block; + width: 32px; + height: 32px; + margin: 0 auto; + background: url(../images/loading.gif) no-repeat; +} + +.lb-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} + +.lb-container > .nav { + left: 0; +} + +.lb-nav a { + outline: none; + background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); +} + +.lb-prev, .lb-next { + height: 100%; + cursor: pointer; + display: block; +} + +.lb-nav a.lb-prev { + width: 34%; + left: 0; + float: left; + background: url(../images/prev.png) left 48% no-repeat; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; + -webkit-transition: opacity 0.6s; + -moz-transition: opacity 0.6s; + -o-transition: opacity 0.6s; + transition: opacity 0.6s; +} + +.lb-nav a.lb-prev:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.lb-nav a.lb-next { + width: 64%; + right: 0; + float: right; + background: url(../images/next.png) right 48% no-repeat; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; + -webkit-transition: opacity 0.6s; + -moz-transition: opacity 0.6s; + -o-transition: opacity 0.6s; + transition: opacity 0.6s; +} + +.lb-nav a.lb-next:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.lb-dataContainer { + margin: 0 auto; + padding-top: 5px; + *zoom: 1; + width: 100%; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; +} + +.lb-dataContainer:after { + content: ""; + display: table; + clear: both; +} + +.lb-data { + padding: 0 4px; + color: #ccc; +} + +.lb-data .lb-details { + width: 85%; + float: left; + text-align: left; + line-height: 1.1em; +} + +.lb-data .lb-caption { + font-size: 13px; + font-weight: bold; + line-height: 1em; +} + +.lb-data .lb-caption a { + color: #4ae; +} + +.lb-data .lb-number { + display: block; + clear: left; + padding-bottom: 1em; + font-size: 12px; + color: #999999; +} + +.lb-data .lb-close { + display: block; + float: right; + width: 30px; + height: 30px; + background: url(../images/close.png) top right no-repeat; + text-align: right; + outline: none; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + opacity: 0.7; + -webkit-transition: opacity 0.2s; + -moz-transition: opacity 0.2s; + -o-transition: opacity 0.2s; + transition: opacity 0.2s; +} + +.lb-data .lb-close:hover { + cursor: pointer; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} diff --git a/ofu_app/static/libs/lightbox2-master/src/images/close.png b/ofu_app/static/libs/lightbox2-master/src/images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..20baa1db5fdf9e22655a0f851c4401d36b9e7ef9 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i3?z4Pv7`ejn*g5>*Z=?j1DSvS{%vY%YG`Nx zvLV3R+Z)1I1qQoz?eg;S^6>Bg3hv&$d*{xbK#iaC4$A=f!X-g|!3vbDHnnh5Xg#OL;K8su!;fw4MC7hH<+BPou~5EnOggc)I$z JtaD0e0ssdsYEA$E literal 0 HcmV?d00001 diff --git a/ofu_app/static/libs/lightbox2-master/src/images/loading.gif b/ofu_app/static/libs/lightbox2-master/src/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..5087c2a644223a95984baefdb74f39a287fdfd9a GIT binary patch literal 8476 zcmai(X;@SD*7mdaPWF^(CxkH}*_lX!K*CT(AL|K8(1566s6|hY4TvpP+s4^C)C7Wr zL1l;vYGn`*XPj}MhDk+1K~T|Jjbp7%Dcb>C}3 z!uZ(H86=IQy^NqeeE9IjjT=2ZJ*Q5cI(qcz{{8z8A3l8I#EH(%&c43B!NI}S*490H z_8dEQtgEZ5uCA`WzP_fW=FXivj~+dG`t<382M?YEiL{1{S6HbmoHzguC6|R{`|#@7q4Eu+TPy&`t|F_ zj~{!z-l3tP#>U2b_wH@lw5hVPa?6%2zyJO_?f>_Y{?42npO$Kjv&2V5=pcalzVx4T z453BP!ruJ$&EM3+zw0;J%yf*i*^*_PJLVsSSr1?0*w*y98GnCRe89U~uLuhBbEOTg z@7p~=dTHjkb%XNNFKtcNbOB#1n}fmhJOs}vi~u;Om;-`x4NmfXeFT01{{Df1a{y@m zlEopxMG<7MR-q;KGd|pD09Y$mvJX%BfFV+!oPxleu&Ql}n2sQ`u&&7xXkZ;jg>BIJ zgb6l(Rs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6EAW{inKDh&-WnVn{2|U$^CYsxo|aSO z{Ownq88;}UZ8k-jIoYojI2o0f0X2APo+O#$L@rS+iOB3oe3`5L{rz9#-@Xsnxj#NW zeg`@6QsCu}R-7k*d~gB(;p+DG_RmL0N9V`J#^&+;r#71{KyP@n<%d1~0!Rl=Pzas{ z&(T*8cmm{dAB*LR2xK%Go3p?U@(4R!OXmMbAzwuN8bYJ-NhXr$n&rVr(fJ!hydyMn S-YhKu0000 0) { + return; + } + + var self = this; + $('
').appendTo($('body')); + + // Cache jQuery objects + this.$lightbox = $('#lightbox'); + this.$overlay = $('#lightboxOverlay'); + this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); + this.$container = this.$lightbox.find('.lb-container'); + this.$image = this.$lightbox.find('.lb-image'); + this.$nav = this.$lightbox.find('.lb-nav'); + + // Store css values for future lookup + this.containerPadding = { + top: parseInt(this.$container.css('padding-top'), 10), + right: parseInt(this.$container.css('padding-right'), 10), + bottom: parseInt(this.$container.css('padding-bottom'), 10), + left: parseInt(this.$container.css('padding-left'), 10) + }; + + this.imageBorderWidth = { + top: parseInt(this.$image.css('border-top-width'), 10), + right: parseInt(this.$image.css('border-right-width'), 10), + bottom: parseInt(this.$image.css('border-bottom-width'), 10), + left: parseInt(this.$image.css('border-left-width'), 10) + }; + + // Attach event handlers to the newly minted DOM elements + this.$overlay.hide().on('click', function() { + self.end(); + return false; + }); + + this.$lightbox.hide().on('click', function(event) { + if ($(event.target).attr('id') === 'lightbox') { + self.end(); + } + return false; + }); + + this.$outerContainer.on('click', function(event) { + if ($(event.target).attr('id') === 'lightbox') { + self.end(); + } + return false; + }); + + this.$lightbox.find('.lb-prev').on('click', function() { + if (self.currentImageIndex === 0) { + self.changeImage(self.album.length - 1); + } else { + self.changeImage(self.currentImageIndex - 1); + } + return false; + }); + + this.$lightbox.find('.lb-next').on('click', function() { + if (self.currentImageIndex === self.album.length - 1) { + self.changeImage(0); + } else { + self.changeImage(self.currentImageIndex + 1); + } + return false; + }); + + /* + Show context menu for image on right-click + + There is a div containing the navigation that spans the entire image and lives above of it. If + you right-click, you are right clicking this div and not the image. This prevents users from + saving the image or using other context menu actions with the image. + + To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we + set pointer-events to none on the nav div. This is so that the upcoming right-click event on + the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs + we set the pointer events back to auto for the nav div so it can capture hover and left-click + events as usual. + */ + this.$nav.on('mousedown', function(event) { + if (event.which === 3) { + self.$nav.css('pointer-events', 'none'); + + self.$lightbox.one('contextmenu', function() { + setTimeout(function() { + this.$nav.css('pointer-events', 'auto'); + }.bind(self), 0); + }); + } + }); + + + this.$lightbox.find('.lb-loader, .lb-close').on('click', function() { + self.end(); + return false; + }); + }; + + // Show overlay and lightbox. If the image is part of a set, add siblings to album array. + Lightbox.prototype.start = function($link) { + var self = this; + var $window = $(window); + + $window.on('resize', $.proxy(this.sizeOverlay, this)); + + $('select, object, embed').css({ + visibility: 'hidden' + }); + + this.sizeOverlay(); + + this.album = []; + var imageNumber = 0; + + function addToAlbum($link) { + self.album.push({ + alt: $link.attr('data-alt'), + link: $link.attr('href'), + title: $link.attr('data-title') || $link.attr('title') + }); + } + + // Support both data-lightbox attribute and rel attribute implementations + var dataLightboxValue = $link.attr('data-lightbox'); + var $links; + + if (dataLightboxValue) { + $links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]'); + for (var i = 0; i < $links.length; i = ++i) { + addToAlbum($($links[i])); + if ($links[i] === $link[0]) { + imageNumber = i; + } + } + } else { + if ($link.attr('rel') === 'lightbox') { + // If image is not part of a set + addToAlbum($link); + } else { + // If image is part of a set + $links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]'); + for (var j = 0; j < $links.length; j = ++j) { + addToAlbum($($links[j])); + if ($links[j] === $link[0]) { + imageNumber = j; + } + } + } + } + + // Position Lightbox + var top = $window.scrollTop() + this.options.positionFromTop; + var left = $window.scrollLeft(); + this.$lightbox.css({ + top: top + 'px', + left: left + 'px' + }).fadeIn(this.options.fadeDuration); + + // Disable scrolling of the page while open + if (this.options.disableScrolling) { + $('html').addClass('lb-disable-scrolling'); + } + + this.changeImage(imageNumber); + }; + + // Hide most UI elements in preparation for the animated resizing of the lightbox. + Lightbox.prototype.changeImage = function(imageNumber) { + var self = this; + + this.disableKeyboardNav(); + var $image = this.$lightbox.find('.lb-image'); + + this.$overlay.fadeIn(this.options.fadeDuration); + + $('.lb-loader').fadeIn('slow'); + this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); + + this.$outerContainer.addClass('animating'); + + // When image to show is preloaded, we send the width and height to sizeContainer() + var preloader = new Image(); + preloader.onload = function() { + var $preloader; + var imageHeight; + var imageWidth; + var maxImageHeight; + var maxImageWidth; + var windowHeight; + var windowWidth; + + $image.attr({ + 'alt': self.album[imageNumber].alt, + 'src': self.album[imageNumber].link + }); + + $preloader = $(preloader); + + $image.width(preloader.width); + $image.height(preloader.height); + + if (self.options.fitImagesInViewport) { + // Fit image inside the viewport. + // Take into account the border around the image and an additional 10px gutter on each side. + + windowWidth = $(window).width(); + windowHeight = $(window).height(); + maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20; + maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - 120; + + // Check if image size is larger then maxWidth|maxHeight in settings + if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) { + maxImageWidth = self.options.maxWidth; + } + if (self.options.maxHeight && self.options.maxHeight < maxImageWidth) { + maxImageHeight = self.options.maxHeight; + } + + // Is the current image's width or height is greater than the maxImageWidth or maxImageHeight + // option than we need to size down while maintaining the aspect ratio. + if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) { + if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) { + imageWidth = maxImageWidth; + imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10); + $image.width(imageWidth); + $image.height(imageHeight); + } else { + imageHeight = maxImageHeight; + imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10); + $image.width(imageWidth); + $image.height(imageHeight); + } + } + } + self.sizeContainer($image.width(), $image.height()); + }; + + preloader.src = this.album[imageNumber].link; + this.currentImageIndex = imageNumber; + }; + + // Stretch overlay to fit the viewport + Lightbox.prototype.sizeOverlay = function() { + this.$overlay + .width($(document).width()) + .height($(document).height()); + }; + + // Animate the size of the lightbox to fit the image we are showing + Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) { + var self = this; + + var oldWidth = this.$outerContainer.outerWidth(); + var oldHeight = this.$outerContainer.outerHeight(); + var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right; + var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom; + + function postResize() { + self.$lightbox.find('.lb-dataContainer').width(newWidth); + self.$lightbox.find('.lb-prevLink').height(newHeight); + self.$lightbox.find('.lb-nextLink').height(newHeight); + self.showImage(); + } + + if (oldWidth !== newWidth || oldHeight !== newHeight) { + this.$outerContainer.animate({ + width: newWidth, + height: newHeight + }, this.options.resizeDuration, 'swing', function() { + postResize(); + }); + } else { + postResize(); + } + }; + + // Display the image and its details and begin preload neighboring images. + Lightbox.prototype.showImage = function() { + this.$lightbox.find('.lb-loader').stop(true).hide(); + this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration); + + this.updateNav(); + this.updateDetails(); + this.preloadNeighboringImages(); + this.enableKeyboardNav(); + }; + + // Display previous and next navigation if appropriate. + Lightbox.prototype.updateNav = function() { + // Check to see if the browser supports touch events. If so, we take the conservative approach + // and assume that mouse hover events are not supported and always show prev/next navigation + // arrows in image sets. + var alwaysShowNav = false; + try { + document.createEvent('TouchEvent'); + alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false; + } catch (e) {} + + this.$lightbox.find('.lb-nav').show(); + + if (this.album.length > 1) { + if (this.options.wrapAround) { + if (alwaysShowNav) { + this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1'); + } + this.$lightbox.find('.lb-prev, .lb-next').show(); + } else { + if (this.currentImageIndex > 0) { + this.$lightbox.find('.lb-prev').show(); + if (alwaysShowNav) { + this.$lightbox.find('.lb-prev').css('opacity', '1'); + } + } + if (this.currentImageIndex < this.album.length - 1) { + this.$lightbox.find('.lb-next').show(); + if (alwaysShowNav) { + this.$lightbox.find('.lb-next').css('opacity', '1'); + } + } + } + } + }; + + // Display caption, image number, and closing button. + Lightbox.prototype.updateDetails = function() { + var self = this; + + // Enable anchor clicks in the injected caption html. + // Thanks Nate Wright for the fix. @https://github.com/NateWr + if (typeof this.album[this.currentImageIndex].title !== 'undefined' && + this.album[this.currentImageIndex].title !== '') { + var $caption = this.$lightbox.find('.lb-caption'); + if (this.options.sanitizeTitle) { + $caption.text(this.album[this.currentImageIndex].title); + } else { + $caption.html(this.album[this.currentImageIndex].title); + } + $caption.fadeIn('fast') + .find('a').on('click', function(event) { + if ($(this).attr('target') !== undefined) { + window.open($(this).attr('href'), $(this).attr('target')); + } else { + location.href = $(this).attr('href'); + } + }); + } + + if (this.album.length > 1 && this.options.showImageNumberLabel) { + var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length); + this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast'); + } else { + this.$lightbox.find('.lb-number').hide(); + } + + this.$outerContainer.removeClass('animating'); + + this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() { + return self.sizeOverlay(); + }); + }; + + // Preload previous and next images in set. + Lightbox.prototype.preloadNeighboringImages = function() { + if (this.album.length > this.currentImageIndex + 1) { + var preloadNext = new Image(); + preloadNext.src = this.album[this.currentImageIndex + 1].link; + } + if (this.currentImageIndex > 0) { + var preloadPrev = new Image(); + preloadPrev.src = this.album[this.currentImageIndex - 1].link; + } + }; + + Lightbox.prototype.enableKeyboardNav = function() { + $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this)); + }; + + Lightbox.prototype.disableKeyboardNav = function() { + $(document).off('.keyboard'); + }; + + Lightbox.prototype.keyboardAction = function(event) { + var KEYCODE_ESC = 27; + var KEYCODE_LEFTARROW = 37; + var KEYCODE_RIGHTARROW = 39; + + var keycode = event.keyCode; + var key = String.fromCharCode(keycode).toLowerCase(); + if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) { + this.end(); + } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) { + if (this.currentImageIndex !== 0) { + this.changeImage(this.currentImageIndex - 1); + } else if (this.options.wrapAround && this.album.length > 1) { + this.changeImage(this.album.length - 1); + } + } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) { + if (this.currentImageIndex !== this.album.length - 1) { + this.changeImage(this.currentImageIndex + 1); + } else if (this.options.wrapAround && this.album.length > 1) { + this.changeImage(0); + } + } + }; + + // Closing time. :-( + Lightbox.prototype.end = function() { + this.disableKeyboardNav(); + $(window).off('resize', this.sizeOverlay); + this.$lightbox.fadeOut(this.options.fadeDuration); + this.$overlay.fadeOut(this.options.fadeDuration); + $('select, object, embed').css({ + visibility: 'visible' + }); + if (this.options.disableScrolling) { + $('html').removeClass('lb-disable-scrolling'); + } + }; + + return new Lightbox(); +})); diff --git a/ofu_app/templates/food/food_wrapper.jinja b/ofu_app/templates/food/food_wrapper.jinja index 4c05b41..1d94d3c 100644 --- a/ofu_app/templates/food/food_wrapper.jinja +++ b/ofu_app/templates/food/food_wrapper.jinja @@ -3,8 +3,10 @@ {# #} + {% endblock %} {% block css_extra %} + {% endblock %} {% block bottom_nav %} diff --git a/ofu_app/templates/macros/food_macros.jinja b/ofu_app/templates/macros/food_macros.jinja index c9b51fe..e254ff6 100644 --- a/ofu_app/templates/macros/food_macros.jinja +++ b/ofu_app/templates/macros/food_macros.jinja @@ -4,7 +4,7 @@

{{ title }}

{% if location_menu %}

{{ location_menu.date.strftime('%d.%m.%Y') }}

- {{ get_menu(location_menu.menu.all()) }} + {{ get_menu(location_menu.menu.all(), title) }} {% else %}

{{ fail_text }}

{% endif %} @@ -30,7 +30,7 @@ {% endmacro %} -{% macro get_menu(menu) -%} +{% macro get_menu(menu, title="") -%}
    {% for single_food in menu %}
  • @@ -38,12 +38,14 @@ {# TODO: without many to many #} {% if single_food.image.all() %} {% for image in single_food.image.all() %} - + Bild {% endfor %} {% else %} - + Bild {% endif %}