mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-02 08:09:47 -04:00
More refactorings.
This commit is contained in:
parent
bd65025a4c
commit
b8b6d32a33
7 changed files with 207 additions and 84 deletions
|
@ -29,13 +29,14 @@ modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], functi
|
|||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'getchecks'
|
||||
action: 'get',
|
||||
checks: true
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
|
||||
callback(json);
|
||||
callback(json.checks);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
|
@ -44,19 +45,21 @@ modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], functi
|
|||
});
|
||||
},
|
||||
|
||||
getEntries = function (href, content, callback) {
|
||||
getEntries = function (href, what, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'getentries',
|
||||
href: href,
|
||||
content: content
|
||||
action: 'get',
|
||||
entries: true,
|
||||
entriesHref: href,
|
||||
entriesWhat: what
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
|
||||
callback(json);
|
||||
callback(json.entries);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
|
@ -154,6 +157,7 @@ modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], functi
|
|||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
dataType: 'html',
|
||||
success: function (html) {
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ modulejs.define('core/refresh', ['_', 'core/mode', 'core/ajax', 'model/entry'],
|
|||
|
||||
var found = {};
|
||||
|
||||
_.each(json.entries, function (jsonEntry) {
|
||||
_.each(json, function (jsonEntry) {
|
||||
|
||||
found[jsonEntry.absHref] = true;
|
||||
Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue