Refactored and lots of modification. See README.md.

This commit is contained in:
Lars Jung 2012-04-16 12:53:54 +02:00
parent 859a680e19
commit 71ed41fa69
85 changed files with 3191 additions and 2969 deletions

View file

@ -0,0 +1,49 @@
module.define('h5ai-info', [jQuery, 'core/resource'], function ($, resource) {
var setCheckResult = function (id, result) {
var $ele = $(id).find('.test-result');
if (result) {
$ele.addClass('test-passed').text('yes');
} else {
$ele.addClass('test-failed').text('no');
}
},
handleChecksResponse = function (response) {
_.each(['php', 'cache', 'thumbs', 'temp', 'zips'], function (test) {
setCheckResult('#test-' + test, response && response[test]);
})
},
checks = function () {
$.ajax({
url: resource.api(),
data: {
action: 'checks'
},
type: 'POST',
dataType: 'json',
success: function (response) {
handleChecksResponse(response);
},
error: function () {
handleChecksResponse();
}
});
},
init = function () {
checks();
};
init();
});