Skip to content

Commit 8f2a6a4

Browse files
committed
Add imageRegex parameter in nmObject and use it in image filter. #Closes #25
Fix CSS error. Closes #19 Add header and footer parameter in nmObject. Closes #13
1 parent ecbfb31 commit 8f2a6a4

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

js/jquery.nyroModal.filters.image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jQuery(function($, undefined) {
1212
$.nmFilters({
1313
image: {
1414
is: function(nm) {
15-
return (new RegExp('[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', 'i')).test(nm.opener.attr('href'));
15+
return (new RegExp(nm.imageRegex, 'i')).test(nm.opener.attr('href'));
1616
},
1717
init: function(nm) {
1818
nm.loadFilter = 'image';

js/jquery.nyroModal.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,17 @@ jQuery(function($, undefined) {
2525

2626
stack: false, // Indicates if links automatically binded inside the modal should stack or not
2727

28+
header: undefined, // header include in every modal
29+
footer: undefined, // footer include in every modal
30+
31+
// Specific confirguation for gallery filter
2832
galleryLoop: true, // Indicates if the gallery should loop
2933
galleryCounts: true, // Indicates if the gallery counts should be shown
3034
ltr: true, // Left to Right by default. Put to false for Hebrew or Right to Left language. Used in gallery filter
3135

36+
// Specific confirguation for image filter
37+
imageRegex: '[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', // Regex used to detect image link
38+
3239
selIndicator: 'nyroModalSel', // Value added when a form or Ajax is sent with a filter content
3340

3441
swf: { // Default SWF attributes
@@ -255,6 +262,8 @@ jQuery(function($, undefined) {
255262
}
256263
this.elts.hidden
257264
.append(this._filterScripts(html))
265+
.prepend(this.header)
266+
.append(this.footer)
258267
.wrapInner('<div class="nyroModal'+ucfirst(this.loadFilter)+'" />');
259268

260269
// Store the size of the element

styles/nyroModal.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@
9797
background-position: right 20%;
9898
}
9999
.nyroModalNext:hover {
100-
background-position: right: 20%;
100+
background-position: right 20%;
101101
background-image: url(../img/next.gif);
102102
}

0 commit comments

Comments
 (0)