Last active
December 14, 2015 11:09
-
-
Save vgrem/5077275 to your computer and use it in GitHub Desktop.
SlideshowObjectInitializer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Overridden SlideshowObject constructor with method for excluding pictures | |
function SlideshowObjectInitializer() { | |
SlideshowObject = (function(SlideshowObjectOrig) { | |
return function() { | |
//Exclude pictures | |
if(typeof excludePic != 'undefined') { | |
for(i=0,k=0;i<arguments[1].length;i++) { | |
var imageInfo = {src: arguments[1][i], fullImageSrc: arguments[2][i], title: arguments[3][i],description: arguments[4][i], height: arguments[5][i], width: arguments[6][i]}; | |
if(excludePic(imageInfo)) { | |
for(j=1;j<7;j++) { | |
arguments[j].splice(i, 1); | |
} | |
i--; | |
} | |
} | |
} | |
//Call original SlideshowObject constructor | |
return SlideshowObjectOrig.apply(this, arguments); | |
}; | |
})(SlideshowObject); | |
} | |
//Exclide pictures with no titles | |
function excludePic(imageInfo) { | |
return (imageInfo.title.length == 0); | |
} | |
ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment