aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/010-libphotofloat.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/010-libphotofloat.js')
-rw-r--r--web/js/010-libphotofloat.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/web/js/010-libphotofloat.js b/web/js/010-libphotofloat.js
index f716ca7..fb469a0 100644
--- a/web/js/010-libphotofloat.js
+++ b/web/js/010-libphotofloat.js
@@ -34,8 +34,11 @@
callback(album);
}
};
- if (typeof error !== "undefined" && error !== null)
- ajaxOptions.error = error;
+ if (typeof error !== "undefined" && error !== null) {
+ ajaxOptions.error = function(jqXHR, textStatus, errorThrown) {
+ error(jqXHR.status);
+ };
+ }
$.ajax(ajaxOptions);
};
PhotoFloat.prototype.albumPhoto = function(subalbum, callback, error) {
@@ -85,6 +88,19 @@
callback(theAlbum, photo, i);
}, error);
};
+ PhotoFloat.prototype.authenticate = function(password, result) {
+ $.ajax({
+ type: "GET",
+ dataType: "text",
+ url: "auth?password=" + password,
+ success: function() {
+ result(true);
+ },
+ error: function() {
+ result(false);
+ }
+ });
+ };
/* static functions */
PhotoFloat.cachePath = function(path) {