Skip to content

Commit

Permalink
Add imageRegex parameter in nmObject and use it in image filter. #Closes
Browse files Browse the repository at this point in the history
 #25

Fix CSS error. Closes #19
Add header and footer parameter in nmObject. Closes #13
  • Loading branch information
nyroDev committed Jan 22, 2011
1 parent ecbfb31 commit 8f2a6a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/jquery.nyroModal.filters.image.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jQuery(function($, undefined) {
$.nmFilters({
image: {
is: function(nm) {
return (new RegExp('[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', 'i')).test(nm.opener.attr('href'));
return (new RegExp(nm.imageRegex, 'i')).test(nm.opener.attr('href'));
},
init: function(nm) {
nm.loadFilter = 'image';
Expand Down
9 changes: 9 additions & 0 deletions js/jquery.nyroModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@ jQuery(function($, undefined) {

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

header: undefined, // header include in every modal
footer: undefined, // footer include in every modal

// Specific confirguation for gallery filter
galleryLoop: true, // Indicates if the gallery should loop
galleryCounts: true, // Indicates if the gallery counts should be shown
ltr: true, // Left to Right by default. Put to false for Hebrew or Right to Left language. Used in gallery filter

// Specific confirguation for image filter
imageRegex: '[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', // Regex used to detect image link

selIndicator: 'nyroModalSel', // Value added when a form or Ajax is sent with a filter content

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

// Store the size of the element
Expand Down
2 changes: 1 addition & 1 deletion styles/nyroModal.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@
background-position: right 20%;
}
.nyroModalNext:hover {
background-position: right: 20%;
background-position: right 20%;
background-image: url(../img/next.gif);
}

0 comments on commit 8f2a6a4

Please sign in to comment.