Skip to content

Commit

Permalink
Added support to Bootstrap 4
Browse files Browse the repository at this point in the history
Removed columns display (col-*) and adopted flex display
Media manager changed from default to JCE
Removed the index.html files
Moved the image caption from modal footer to modal body in order to avoid javascript errors
Changed the way to include the helper functions from "require_once" to "JLoader::register"
Call bootstrap.framework in order to load script file after the bootstrap and jquery files
Removed screen size limitation from javascript file
Add focus on carousel control next when call modal
  • Loading branch information
hfittipaldi committed Feb 5, 2019
1 parent 55d4c4b commit a5465ed
Show file tree
Hide file tree
Showing 18 changed files with 526 additions and 492 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# Módulo B3 Gallery
Bootstrap 3 Gallery Module is a module for Joomla 3.6+ which displays a gallery of images and a modal carousel.
# B3 Gallery Module
**B3 Gallery Module is a module for Joomla 3.6+ which displays a gallery of images and a modal carousel.**

This is compatible with Bootstrap 3.x and 4.x

The gallery items width should be set on your template css file. Example (SASS):
```
.b3Gallery-item {
flex-basis: calc(50% - 1rem);
@media (min-width: 768px) {
flex-basis: calc(100% / 3 - 1rem);
}
@media (min-width: 992px) {
flex-basis: calc(25% - 1rem);
}
}
```
140 changes: 81 additions & 59 deletions css/b3_gallery.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions css/b3_gallery.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 130 additions & 0 deletions css/b3_gallery.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
.b3Gallery {
display: flex;
flex-wrap: wrap;
margin-left: -1rem;

/*** Gallery ***/
.b3Gallery-item {
margin-bottom: 1rem;
margin-left: 1rem;

a {
display: block;

img {
width: 100%;
}
}
}

/*** Carousel ***/
.modal-dialog {
max-width: calc(100% - 1rem);

.modal-body {
background: url('../images/load.gif') center center no-repeat;

.carousel-inner {
figure {
margin-bottom: 0;

img {
display: block;
margin: 0 auto;
max-width: 100%;
height: auto;
}

figcaption {
display: flex;
flex-wrap: nowrap;
justify-content: flex-end;
align-items: flex-start;
background-color: #fff;

.caption,
.counter {
padding-top: 1rem;
}

.caption {
flex-basis: 100%;
}

.counter {
flex: 0 0 100px;
text-align: right;
}
}
}
}
}
}

&.b3 {
margin-bottom: 1rem;

.modal-dialog {
margin-right: auto;
margin-left: auto;

.modal-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 1rem;
border-bottom: 1px solid #e9ecef;
border-top-left-radius: 0.3rem;
border-top-right-radius: 0.3rem;

.modal-title {
flex: 1;
}

.close {
padding: 1rem;
margin: -1rem -1rem -1rem auto;
}
}

.modal-body {
.carousel-fade {
.carousel-control {
z-index: 2;
}

.carousel-inner {
.item,
.active.left,
.active.right {
opacity: 0;
visibility: hidden;
transition-property: visibility, opacity;
transition-delay: 1000ms;
}

.active,
.next.left,
.prev.right {
opacity: 1;
visibility: visible;
}

.next,
.prev,
.active.left,
.active.right {
left: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}

.item img {
margin: auto;
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion css/index.html

This file was deleted.

14 changes: 9 additions & 5 deletions en-GB.mod_b3_gallery.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
MOD_B3_GALLERY_CONTROLS="Controls"
MOD_B3_GALLERY_BOOTSTRAP_VERSION_LABEL="Bootstrap"
MOD_B3_GALLERY_BOOTSTRAP_VERSION_DESC="Bootstrap version."
MOD_B3_GALLERY_INFO_LABEL="<b>Only jpg, jpeg and png images types are suported.</b>"
MOD_B3_GALLERY_IMAGES_GALLERY_LABEL="Gallery images"
MOD_B3_GALLERY_IMAGES_GALLERY_DESC="Add or remove the images."
MOD_B3_GALLERY_IMAGE_FIELD_LABEL="Image"
Expand All @@ -7,10 +10,6 @@ MOD_B3_GALLERY_THUMB_FIELD_LABEL="Thumbnail"
MOD_B3_GALLERY_THUMB_FIELD_DESC="Image to be displayed on the gallery."
MOD_B3_GALLERY_CAPTION_FIELD_LABEL="Image caption"
MOD_B3_GALLERY_CAPTION_FIELD_DESC="The caption of the image."
MOD_B3_GALLERY_BOOTSTRAP_FIELD_LABEL="Use bootstrap"
MOD_B3_GALLERY_BOOTSTRAP_FIELD_DESC="Use bootstrap columns grid."
MOD_B3_GALLERY_COLUMNS_FIELD_LABEL="Custom columns"
MOD_B3_GALLERY_COLUMNS_FIELD_DESC="Customize bootstrap columns grid."
MOD_B3_GALLERY_THUMBS_SIZE_FIELD_LABEL="Thumbnail size"
MOD_B3_GALLERY_THUMBS_SIZE_FIELD_DESC="Maximun heigh/width of the thumbnail ('px' is not needed)."
MOD_B3_GALLERY_COUNTER_FIELD_LABEL="Show counter"
Expand All @@ -19,9 +18,11 @@ MOD_B3_GALLERY_COUNTER_FIELD_DESC="Show counter."
; Modal Options
MOD_B3_GALLERY_MODAL_OPTIONS="Modal Options"
MOD_B3_GALLERY_AUTO_SLIDE_FIELD_LABEL="Auto slide"
MOD_B3_GALLERY_AUTO_SLIDE_FIELD_DESC="If no, carousel will not automatically cycle."
MOD_B3_GALLERY_AUTO_SLIDE_FIELD_DESC="If NO, carousel will not automatically cycle."
MOD_B3_GALLERY_TRANSITION_FIELD_LABEL="Transition"
MOD_B3_GALLERY_TRANSITION_FIELD_DESC="Image transition animation."
MOD_B3_GALLERY_INTERVAL_FIELD_LABEL="Interval"
MOD_B3_GALLERY_INTERVAL_FIELD_DESC="The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle."
MOD_B3_GALLERY_CONTROLS_FIELD_LABEL="Left/right controls"
MOD_B3_GALLERY_CONTROLS_FIELD_DESC="Turn on or off left/right buttons."
MOD_B3_GALLERY_PAUSE_FIELD_LABEL="Pauses on mouseenter?"
Expand All @@ -30,3 +31,6 @@ MOD_B3_GALLERY_CAROUSEL_LOOP_FIELD_LABEL="Carousel loop"
MOD_B3_GALLERY_CAROUSEL_LOOP_FIELD_DESC="Whether the carousel should cycle continuously or have hard stops."
MOD_B3_GALLERY_KEYBOARD_CONTROL_FIELD_LABEL="Keyboard control"
MOD_B3_GALLERY_KEYBOARD_CONTROL_FIELD_DESC="Whether the carousel should react to keyboard events."

; File texts
MOD_B3_GALLERY_WARNING_NO_IMAGES="<strong>Warning: </strong>There is no registered images."
Loading

0 comments on commit a5465ed

Please sign in to comment.