User page functionality merger (80%)

This commit is contained in:
Dima Malishev 2011-07-23 17:34:27 +03:00
parent 2b06ef5faa
commit 43dffa3fbe
11 changed files with 826 additions and 208 deletions

View file

@ -1,5 +1,5 @@
App.View.popup = function(content) {
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();
@ -10,26 +10,33 @@ App.View.popup = function(content) {
$(document.body).append(tpl.finalize());
}
App.View.closePopup = function(){
App.View.closePopup = function()
{
$('.black_overlay').remove();
$('.popup_content').remove();
}
App.View.updateInitialInfo = function(key, object) {
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){
App.View.listItems = function(reply){
var acc = [];
var build_method = App.Env.getWorldName() + '_entry';
$(reply.data).each(function(i, o){
acc[acc.length++] = App.HTML.Build[build_method](o);
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', 'ip');
var html = acc.done().wrapperize('ENTRIES_WRAPPER', App.Env.getWorldName());
App.Ref.CONTENT.html(html);
App.Helpers.updateScreen();
}