view.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. App.View.popup = function(content)
  2. {
  3. var tpl = App.Templates.get('popup', 'general');
  4. if ('undefined' != typeof App.Templates.html.popup[content]) {
  5. var content = App.Templates.get(content, 'popup').finalize();
  6. }
  7. tpl.set(':content', content);
  8. tpl.set(':STYLE', 'height:'+$(window).height()+'px');
  9. $('#popup-bg, #popup').remove();
  10. $(document.body).append(tpl.finalize());
  11. }
  12. App.View.closePopup = function()
  13. {
  14. $('.black_overlay').remove();
  15. $('.popup_content').remove();
  16. }
  17. App.View.updateInitialInfo = function(key, object)
  18. {
  19. var expr = '.'+key;
  20. var object = parseInt(object, 10);
  21. var html = object + ' ' + App.Messages.get(key, (object > 1));
  22. $(expr).html(html);
  23. }
  24. App.View.listItems = function(reply){
  25. var acc = [];
  26. var build_method = App.Env.getWorldName() + '_entry';
  27. var data = reply.data;
  28. // TODO: fix it data.data
  29. $.each(data, function(key)
  30. {
  31. var o = data[key];
  32. fb.warn(key);
  33. acc[acc.length++] = App.HTML.Build[build_method](o, key);
  34. });
  35. var html = acc.done().wrapperize('ENTRIES_WRAPPER', App.Env.getWorldName());
  36. App.Ref.CONTENT.html(html);
  37. //App.Helpers.updateScreen();
  38. }