Skip to content

Commit

Permalink
Added ViewerJS for gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
andchir committed Feb 26, 2017
1 parent b29087c commit 431471d
Show file tree
Hide file tree
Showing 15 changed files with 3,821 additions and 19 deletions.
8 changes: 3 additions & 5 deletions assets/template/chunk.gallery_item.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<div>
<a href="[[++base_url]]assets/[[+image]]" class="magnificPopup">
<img src="[[phpthumbon?input=`assets/[[+image]]`&options=`w=350&h=300&bg=ffffff&far=1`]]" width="280" height="220" alt="[[+name]]">
</a>
</div>
<li>
<img src="[[phpthumbon?input=`assets/files/[[+image]]`&options=`w=350&h=300&bg=ffffff&zc=1`]]" data-original="[[++base_url]]assets/files/[[+image]]" width="280" height="220" alt="[[+name]]">
</li>
Empty file modified assets/template/chunk_lgnUpdateProfile.html
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions assets/template/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ h1:first-child { margin-top: 0; }
.panel-heading h4 { margin: 0; padding: 5px 0; }
.padding-lr-30 { padding: 0 30px; }
.nowrap { white-space: nowrap; }
ul.images-zoom { list-style-type: none; }
ul.images-zoom li { margin: 0; padding: 0; }
.images-zoom img,
.image-zoom img,
img.image-zoom { cursor: zoom-in; }

h1:first-child,
h2:first-child,
Expand Down
4 changes: 2 additions & 2 deletions assets/template/head_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<link rel="stylesheet" href="[[++base_url]]assets/template/bootflat/bootflat/css/bootflat.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/js/slick/css/slick.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/js/slick/css/slick-theme.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/js/Magnific-Popup/magnific-popup.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/js/viewerjs/dist/viewer.min.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/angularicons/src/css/angularicons.css">
<link rel="stylesheet" href="[[++base_url]]assets/components/tag_manager2/css/web/tm-style.css">
<link rel="stylesheet" href="[[++base_url]]assets/template/css/custom.css">

<script type="text/javascript" src="[[++base_url]]assets/template/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/template/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/template/js/Magnific-Popup/jquery.magnific-popup.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/template/js/viewerjs/dist/viewer.min.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/template/js/slick/slick.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/components/shopkeeper3/web/js/lang/ru.js"></script>
<script type="text/javascript" src="[[++base_url]]assets/components/shopkeeper3/web/js/shopkeeper.js"></script>
Expand Down
17 changes: 8 additions & 9 deletions assets/template/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ var siteLib = (function( $ ){
}
});

jQuery('a.magnificPopup')
.magnificPopup({
type:'image',
cursor: 'mfp-zoom-out-cur',
gallery: {
enabled: true
}
});

jQuery('.slick-slider-one')
.slick({
dots: true,
Expand Down Expand Up @@ -81,6 +72,14 @@ var siteLib = (function( $ ){
]
});

var viewer;
if( $('ul.images-zoom').length > 0 ){
viewer = new Viewer($('ul.images-zoom').get(0), {
url: 'data-original',
navbar: false
});
}

};

this.alert = function( msg, type, time ){
Expand Down
76 changes: 76 additions & 0 deletions assets/template/js/viewerjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Changelog


## 0.6.1 (Feb 18, 2017)

- Prevented the default behaviour of drag action (#63).


## 0.6.0 (Jan 24, 2017)

- Ported JavaScript code to ECMAScript 6.
- Ported CSS code to CSSNext.


## 0.5.1 (Jan 2, 2017)

- Improved event handler for Pointer Events.


## 0.5.0 (July 22, 2016)

- Improve modal opening and closing.
- Remove `build` event.
- Rename `built` event to `ready`.
- Fixed a bug of `data-*` attributes setting and getting (#33).


## 0.4.0 (Mar 20, 2016)

- Added some properties to "event.detail" of the "view" and "viewed" events.


## 0.3.3 (Mar 19, 2016)

- Fix the issue of hiding wrong element in the "view" method (#19).


## 0.3.2 (Mar 11, 2016)

- Fix the parameters error on the "url" option when it is a function.


## 0.3.1 (Feb 2, 2016)

- Added tests.
- Ignored invalid class name.
- Re-render image only when viewed.


## 0.3.0 (Jan 21, 2016)

- Add more available values to the "title", "toolbar" and "navbar" options.
- Support to toggle the visibility of title, toolbar and navbar between different screen widths.
- Exit fullscreen when stop playing.
- Fixed title not generated bug.


## 0.2.0 (Jan 1, 2016)

- Added "update" method for update image dynamically.
- Hides title and toolbar on small screen (width < 768px).


## 0.1.1 (Dec 28, 2015)

- Supports to zoom from event triggering point.
- Optimized "toggle" method.
- Fixed a bug of the index of viewing image.


## 0.1.0 (Dec 24, 2015)

- Supports 2 modes: "modal" (default), "inline"
- Supports 30 options: "inline", "button", "navbar", "title", "toolbar", "tooltip", "movable", "zoomable", "rotatable", "scalable", "transition", "fullscreen", "keyboard", "interval", "minWidth", "minHeight", "zoomRatio", "minZoomRatio", "maxZoomRatio", "zIndex", "zIndexInline", "url", "build", "built", "show", "shown", "hide", "hidden", "view", "viewed"
- Supports 22 methods: "show", "hide", "view", "prev", "next", "move", "moveTo", "zoom", "zoomTo", "rotate", "rotateTo", "scale", "scaleX", "scaleY", "play", "stop", "full", "exit", "tooltip", "toggle", "reset", "destroy"
- Supports 8 events: "build", "built", "show", "shown", "hide", "hidden", "view", "viewed"
21 changes: 21 additions & 0 deletions assets/template/js/viewerjs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-2017 Fengyuan Chen

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.
Loading

0 comments on commit 431471d

Please sign in to comment.