Skip to content

Commit

Permalink
Merge pull request #55 from perfectsense/feature/gallery
Browse files Browse the repository at this point in the history
BSP-1571 Gallery
  • Loading branch information
jpencola authored Aug 11, 2016
2 parents cf2d73a + 0a1c707 commit 71bcb16
Show file tree
Hide file tree
Showing 20 changed files with 1,296 additions and 14 deletions.
43 changes: 41 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,50 @@ module.exports = function (grunt) {
require('bsp-grunt')(grunt, {
bsp: {

bower: {
// Gallery uses Masonry javascript, which has a few dependencies
// BEGIN dependencies for Masonry
'outlayer': [
{
src: 'outlayer.js',
dest: 'outlayer/outlayer.js'
},
{
src: 'item.js',
dest: 'outlayer/item.js'
}
],
'ev-emitter': [
{
src: 'ev-emitter.js',
dest: 'ev-emitter/ev-emitter.js'
}
],
'get-size': [
{
src: 'get-size.js',
dest: 'get-size/get-size.js'
}
],
'fizzy-ui-utils': [
{
src: 'utils.js',
dest: 'fizzy-ui-utils/utils.js'
}
],
'desandro-matches-selector': [
{
src: 'matches-selector.js',
dest: 'desandro-matches-selector/matches-selector.js'
}
]
// END dependencies for Masonry
},

styles: {
dir: '',
less: [
'base/All.less',
'sample/All.less'
'base/All.less'
],
options : {
autoprefixer: true
Expand Down
18 changes: 11 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
"version": "3.0.0",
"homepage": "https://github.com/perfectsense/brightspot-base",
"dependencies": {
"bsp-utils": "perfectsense/brightspot-js-utils#^3.1.0",
"jquery": "^2.1.4",
"normalize-css": "necolas/normalize.css#^3.0.3"
"bsp-utils": "perfectsense/brightspot-js-utils#3.1.0",
"jquery": "2.1.4",
"normalize-css": "necolas/normalize.css#3.0.3",
"masonry": "masonry#4.1.0",
"bsp-modal": "perfectsense/brightspot-js-modal#1.0.2",
"bsp-carousel": "perfectsense/brightspot-js-carousel#1.4.1",
"vex": "2.3.2"
},
"main": "src/main/webapp/main.js",
"ignore": [
Expand Down Expand Up @@ -36,10 +40,10 @@
}
],
"normalize-css": [
{
"src": "normalize.css",
"dest": "bower/normalize-css/normalize.css"
}
{
"src": "normalize.css",
"dest": "bower/normalize-css/normalize.css"
}
]
}
}
4 changes: 4 additions & 0 deletions src/main/webapp/base/All.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
@import "main/ArticleMain.less";
@import "main/CreativeWorkMain.less";
@import "main/Main.less";
@import "main/GalleryMain.less";

@import "GalleryIntro.less";
@import "GallerySlide.less";

@import "page/Page.less";
@import "page/PageFooter.less";
Expand Down
27 changes: 27 additions & 0 deletions src/main/webapp/base/GalleryIntro.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{#defineBlock "GalleryIntro"}}

{{#defineElement "titleShort"}}data-shorttext="{{this}}"{{/defineElement}}
{{#defineElement "title" noWith=true}}
<div class="{{elementName}}" {{element "titleShort"}} itemprop="headline">
<span>{{title}}</span>
</div>
{{/defineElement}}

{{#defineElement "descriptionShort"}}data-shorttext="{{this}}"{{/defineElement}}
{{#defineElement "description" noWith=true}}
<div class="{{elementName}}" {{element "descriptionShort"}} itemprop="description">
<span>{{description}}</span>
</div>
{{/defineElement}}

{{#defineBlockContainer}}
<div class="{{blockName}}" {{extraAttributes}}>

{{#defineBlockBody}}
{{element "title"}}
{{element "description"}}
{{/defineBlockBody}}

</div>
{{/defineBlockContainer}}
{{/defineBlock}}
11 changes: 11 additions & 0 deletions src/main/webapp/base/GalleryIntro.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.GalleryIntro {

&-title {
&:extend(.GalleryIntro-title all);
}

&-description {
&:extend(.GalleryIntro-description all);
}

}
60 changes: 60 additions & 0 deletions src/main/webapp/base/GallerySlide.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{{#defineBlock "GallerySlide"}}

{{#defineElement "mediaContent"}}
<div class="{{elementName}}">{{this}}</div>
{{/defineElement}}

{{#defineElement "mediaControlsZoom" noWith=true}}
<button title="Increase image size" class="{{elementName}}">Zoom</button>
{{/defineElement}}

{{#defineElement "mediaControls" noWith=true}}
<div class="{{elementName}}">
{{element "mediaControlsZoom"}}
</div>
{{/defineElement}}

{{#defineElement "media" noWith=true}}
<div class="{{elementName}}">
{{element "mediaControls"}}
{{element "mediaContent"}}
</div>
{{/defineElement}}

{{#defineElement "infoTitleShort"}}data-shorttext="{{this}}"{{/defineElement}}
{{#defineElement "infoTitle" noWith=true}}
<div class="{{elementName}}" {{element "infoTitleShort"}} itemprop="name">
<span>{{infoTitle}}</span>
</div>
{{/defineElement}}

{{#defineElement "infoDescriptionShort"}}data-shorttext="{{this}}"{{/defineElement}}
{{#defineElement "infoDescription" noWith=true}}
<div class="{{elementName}}" {{element "infoDescriptionShort"}} itemprop="description">
<span>{{infoDescription}}</span>
</div>
{{/defineElement}}

{{#defineElement "infoAttribution"}}
<div class="{{elementName}}">{{this}}</div>
{{/defineElement}}

{{#defineElement "info" noWith=true}}
<div class="{{elementName}}">
{{element "infoTitle"}}
{{element "infoDescription"}}
{{element "infoAttribution"}}
</div>
{{/defineElement}}

{{#defineBlockContainer}}
<div class="{{blockName}}" itemprop="image" itemtype="http://schema.org/ImageObject" {{extraAttributes}}>

{{#defineBlockBody}}
{{element "media"}}
{{element "info"}}
{{/defineBlockBody}}

</div>
{{/defineBlockContainer}}
{{/defineBlock}}
23 changes: 23 additions & 0 deletions src/main/webapp/base/GallerySlide.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.GallerySlide {

&-image {
&:extend(.GallerySlide-image all);
}

&-info {
&:extend(.GallerySlide-info all);
}

&-infoTitle {
&:extend(.GallerySlide-infoTitle all);
}

&-infoDescription {
&:extend(.GallerySlide-infoDescription all);
}

&-infoAttribution {
&:extend(.GallerySlide-infoAttribution all);
}

}
85 changes: 85 additions & 0 deletions src/main/webapp/base/main/GalleryMain.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{{#defineBlock "Gallery"}}

{{#defineElement "intro"}}
<div class="{{elementName}}">{{this}}</div>
{{/defineElement}}

{{#defineElement "controls" noWith=true}}
<div class="{{elementName}}">
<span class="{{elementName}}-count"></span>
<span class="{{elementName}}-buttons">
<button class="{{elementName}}-buttons-list"><span>List</span></button>
<button class="{{elementName}}-buttons-tiles"><span>Tiles<span></button>
</span>
</div>
{{/defineElement}}

{{#defineElement "slides" noWith=true}}
<div class="{{elementName}}">
{{#each slides}}{{this}}{{/each}}
</div>
{{/defineElement}}

{{#defineElement "modalControlsClose" noWith=true}}
<button class="{{elementName}}"><span>Close</span></button>
{{/defineElement}}
{{#defineElement "modalControlsFullscreen" noWith=true}}
<button class="{{elementName}}"><span>Fullscreen</span></button>
{{/defineElement}}

{{#defineElement "modalControlsPrev" noWith=true}}
<button class="{{elementName}}"><span>Previous</span></button>
{{/defineElement}}

{{#defineElement "modalControlsNext" noWith=true}}
<button class="{{elementName}}"><span>Next</span></button>
{{/defineElement}}

{{#defineElement "modalControlsCount" noWith=true}}
<span class="{{elementName}}"></span>
{{/defineElement}}

{{#defineElement "modalControlsInfo" noWith=true}}
<button class="{{elementName}}"><span>Info</span></button>
{{/defineElement}}

{{#defineElement "modalControls" noWith=true}}
<div class="{{elementName}}">
{{element "modalControlsClose"}}
{{element "modalControlsFullscreen"}}
{{element "modalControlsPrev"}}
{{element "modalControlsCount"}}
{{element "modalControlsNext"}}
{{element "modalControlsInfo"}}
</div>
{{/defineElement}}

{{#defineElement "modalCarousel" noWith=true}}
<div class="{{elementName}}"></div>
{{/defineElement}}

{{#defineElement "modal" noWith=true}}
<div class="{{elementName}}">
{{element "modalControls"}}
{{element "modalCarousel"}}
</div>
{{/defineElement}}

{{#defineBlockContainer}}
<section class="{{blockName}}"
itemscope itemtype="https://schema.org/ImageGallery"
data-bsp-gallery-list
data-bsp-gallery-list-options="{ &quot;singleton&quot;:&quot;{{singleton}}&quot;, &quot;id&quot;:&quot;{{id}}&quot;, &quot;introBackgroundImage&quot;:&quot;{{introBackgroundImage}}&quot; }" {{extraAttributes}}>

{{#defineBlockBody}}
{{#unless singleton}}
{{element "intro"}}
{{element "controls"}}
{{/unless}}
{{element "slides"}}
{{element "modal"}}
{{/defineBlockBody}}

</section>
{{/defineBlockContainer}}
{{/defineBlock}}
Loading

0 comments on commit 71bcb16

Please sign in to comment.