From ca62330d15b9e33ca32c8bf3545b713f4e1a3cc1 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Tue, 3 Jan 2012 23:27:56 +0100 Subject: [PATCH] Fix for broken dialogs --- js/gallery.dialog.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/js/gallery.dialog.js b/js/gallery.dialog.js index ec187186..0e5edcfd 100644 --- a/js/gallery.dialog.js +++ b/js/gallery.dialog.js @@ -137,28 +137,6 @@ this.xhrData = xhr; }, success: function(data) { - // Pre jquery 1.4, get the saved XMLHttpRequest object - xhr = this.xhrData; - if (xhr) { - var mimeType = /^(\w+\/\w+)\;?/.exec(xhr.getResponseHeader("Content-Type")); - - var content = ""; - if (mimeType[1] == "application/json") { - data = JSON.parse(data); - } else { - data = {"html": escape(data)}; - } - } else { - // Uploading files (eg: watermark) uses a fake xhr in jquery.form.js so - // all we have is in the data field, which should be some very simple JSON. - // Weirdly enough in Chrome the result gets wrapped in a
 element and
-             // looks like this:
-             //   
{"result":"success",
-             //   "location":"\/~bharat\/gallery3\/index.php\/admin\/watermarks"}
- // bizarre. Strip that off before parsing. - data = JSON.parse(data.match("({.*})")[0]); - } - if (data.html) { $("#g-dialog").html(unescape(data.html)); $("#g-dialog").dialog("option", "position", "center");