mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
More changes to enable smart browsing.
This commit is contained in:
parent
499013f4fb
commit
e956a49680
14 changed files with 85 additions and 74 deletions
|
@ -1,5 +1,5 @@
|
|||
|
||||
modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/event', 'core/server'], function (_, allsettings, entry, event, server) {
|
||||
modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/server'], function (_, allsettings, event, server) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
|
@ -56,22 +56,26 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/eve
|
|||
}
|
||||
},
|
||||
|
||||
init = function (entry) {
|
||||
onLocationChanged = function (item) {
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
_.each(item.content, checkEntry);
|
||||
}, settings.delay);
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled || !server.api) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
_.each(entry.content, checkEntry);
|
||||
}, settings.delay);
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('entry.created', function (entry) {
|
||||
|
||||
checkEntry(entry);
|
||||
});
|
||||
};
|
||||
|
||||
init(entry);
|
||||
init();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue