allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: [#8239] Add lightbox for screenshots
Date Fri, 28 Sep 2018 19:32:50 GMT
Repository: allura
Updated Branches:
  refs/heads/master ae071edd8 -> 49252b397


[#8239] Add lightbox for screenshots


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/da4d994c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/da4d994c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/da4d994c

Branch: refs/heads/master
Commit: da4d994cc892114b2979d18a7f36d59489620ab0
Parents: ae071ed
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Wed Sep 26 22:55:23 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 28 19:11:23 2018 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py                               | 2 +-
 Allura/allura/templates/widgets/project_screenshots.html | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/da4d994c/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 2044740..cf54ea5 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -591,7 +591,7 @@ class ForgeHTMLSanitizerFilter(html5lib.filters.sanitizer.Filter):
         self.allowed_elements = set(html5lib.filters.sanitizer.allowed_elements) - _form_elements
 
         # srcset is used in our own project_list/project_summary widgets which are used as
macros so go through markdown
-        self.allowed_attributes = html5lib.filters.sanitizer.allowed_attributes | {'srcset'}
+        self.allowed_attributes = html5lib.filters.sanitizer.allowed_attributes | {'srcset',
(None, 'data-src')}
 
         self.valid_iframe_srcs = ('https://www.youtube.com/embed/', 'https://www.gittip.com/')
         self._prev_token_was_ok_iframe = False

http://git-wip-us.apache.org/repos/asf/allura/blob/da4d994c/Allura/allura/templates/widgets/project_screenshots.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/project_screenshots.html b/Allura/allura/templates/widgets/project_screenshots.html
index 57102c7..83bbbc1 100644
--- a/Allura/allura/templates/widgets/project_screenshots.html
+++ b/Allura/allura/templates/widgets/project_screenshots.html
@@ -25,7 +25,7 @@
   {% for ss in screenshots %}
   <div data-ss-id="{{ ss._id }}" class="screenshot">
     <div class="image">
-      <a href="{{project.url()}}screenshot/{{h.urlquote(ss.filename)}}"><img src="{{project.url()}}screenshot/{{h.urlquote(ss.filename)}}/thumb"
alt="Screenshot thumbnail"/></a>
+      <a class="lightbox" data-src="{{project.url()}}screenshot/{{h.urlquote(ss.filename)}}"
href="{{project.url()}}screenshot/{{h.urlquote(ss.filename)}}" ><img src="{{project.url()}}screenshot/{{h.urlquote(ss.filename)}}/thumb"
alt="Screenshot thumbnail"/></a>
       {% if not edit %}
       <br>
       {{ss.caption}}
@@ -50,3 +50,7 @@
   {% endfor %}
 </div>
 {% if screenshots.__len__() %}<hr>{% endif %}
+<!-- lightbox_me div that will dynamically load attachment image -->
+<div id="lightbox" style="display:none; height: 90%">
+  <img style="width: inherit; height: inherit; display: block; margin-left: auto; margin-right:
auto;">
+</div>
\ No newline at end of file


Mime
View raw message