mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Refactor.
This commit is contained in:
parent
69cc1bd281
commit
003b3f3edb
3 changed files with 4 additions and 4 deletions
|
@ -95,7 +95,7 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/event', 'core/settings
|
||||||
|
|
||||||
_.each(json.items, function (jsonItem) {
|
_.each(json.items, function (jsonItem) {
|
||||||
|
|
||||||
var e = Item.get(jsonItem.absHref, jsonItem.time, jsonItem.size, jsonItem.isManaged, jsonItem.content);
|
var e = Item.get(jsonItem.href, jsonItem.time, jsonItem.size, jsonItem.isManaged, jsonItem.content);
|
||||||
found[e.absHref] = true;
|
found[e.absHref] = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -104,8 +104,8 @@ modulejs.define('model/item', ['_', 'core/event', 'core/location', 'core/server'
|
||||||
server.request({action: 'get', items: true, itemsHref: self.absHref, itemsWhat: 1}, function (response) {
|
server.request({action: 'get', items: true, itemsHref: self.absHref, itemsWhat: 1}, function (response) {
|
||||||
|
|
||||||
if (response.items) {
|
if (response.items) {
|
||||||
_.each(response.items, function (item) {
|
_.each(response.items, function (jsonItem) {
|
||||||
getItem(item.absHref, item.time, item.size, item.isManaged, item.content);
|
getItem(jsonItem.href, jsonItem.time, jsonItem.size, jsonItem.isManaged, jsonItem.content);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Item {
|
||||||
public function to_json_object() {
|
public function to_json_object() {
|
||||||
|
|
||||||
$obj = array(
|
$obj = array(
|
||||||
"absHref" => $this->href,
|
"href" => $this->href,
|
||||||
"time" => $this->date * 1000, // seconds (PHP) to milliseconds (JavaScript)
|
"time" => $this->date * 1000, // seconds (PHP) to milliseconds (JavaScript)
|
||||||
"size" => $this->size
|
"size" => $this->size
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue