Files
gallery3/modules/developer/js/developer.js
Tim Almdal 6ac6c6a7e0 Updates to the developer tool create module.
It now creates a fully functional sidebar block, a dialog pop up on
the option menu for albums or photos, a dashboard block and an admin
screen.
2009-03-15 19:27:30 +00:00

40 lines
994 B
JavaScript

$("#gDeveloperTools").ready(function() {
$("#gDeveloperTools").tabs();
});
var module_success = function(data) {
$("#gGenerateModule").after('<div id="moduleProgress" style="margin-left: 5.5em;"></div>');
$("#moduleProgress").progressbar();
var task = data.task;
var url = data.url;
var done = false;
while (!done) {
$.ajax({async: false,
success: function(data, textStatus) {
$("#moduleProgress").progressbar("value", data.task.percent_complete);
done = data.task.done;
},
dataType: "json",
type: "POST",
url: url
});
}
document.location.reload();
};
function ajaxify_developer_form(selector, success) {
$(selector).ajaxForm({
dataType: "json",
success: function(data) {
if (data.form && data.result != "started") {
$(selector).replaceWith(data.form);
ajaxify_developer_form(selector, success);
}
if (data.result == "started") {
success(data);
}
}
});
}