X-Git-Url: http://git.scottworley.com/picsort/blobdiff_plain/fd69f56988c764cf5b190f130ecbe365de64b8ca..8bc0aad4edd7e9d033870594f833b24af6a108e1:/picsorter.js diff --git a/picsorter.js b/picsorter.js index 70cd236..2f9df0c 100644 --- a/picsorter.js +++ b/picsorter.js @@ -16,6 +16,16 @@ var exposure = 20; var zoom = "sm/"; var input_index = -1; +function endsWith(str, suffix) { + return str.indexOf(suffix, str.length - suffix.length) !== -1; +} + +function stripFromEnd(str, suffix) { + if (endsWith(str, suffix)) { + return str.substr(0, str.length - suffix.length); + } + return str; +} function setpic() { if ("exposure" in picinfo[files[input_index]]) {