forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.js
More file actions
42 lines (37 loc) · 1.14 KB
/
view.js
File metadata and controls
42 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
App.View.popup = function(content)
{
var tpl = App.Templates.get('popup', 'general');
if ('undefined' != typeof App.Templates.html.popup[content]) {
var content = App.Templates.get(content, 'popup').finalize();
}
tpl.set(':content', content);
$('#popup-bg, #popup').remove();
$(document.body).append(tpl.finalize());
}
App.View.closePopup = function()
{
$('.black_overlay').remove();
$('.popup_content').remove();
}
App.View.updateInitialInfo = function(key, object)
{
var expr = '.'+key;
var object = parseInt(object, 10);
var html = object + ' ' + App.Messages.get(key, (object > 1));
$(expr).html(html);
}
App.View.listItems = function(reply){
var acc = [];
var build_method = App.Env.getWorldName() + '_entry';
var data = reply.data;
// TODO: fix it data.data
$.each(data, function(key)
{
var o = data[key];
fb.warn(key);
acc[acc.length++] = App.HTML.Build[build_method](o, key);
});
var html = acc.done().wrapperize('ENTRIES_WRAPPER', App.Env.getWorldName());
App.Ref.CONTENT.html(html);
App.Helpers.updateScreen();
}