pages.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. App.Pages.init = function(){
  2. App.Ajax.request('MAIN.getInitial', {}, function(reply){
  3. App.Env.initialParams = reply.data;
  4. App.Helpers.updateInitial();
  5. });
  6. App.Pages.prepareHTML();
  7. $('.section.active').removeClass('active');
  8. $('#'+App.Env.world).addClass('active');
  9. if (cookieEnabled()) {
  10. setCookie('tab', App.Env.world);
  11. }
  12. }
  13. App.Pages.prepareHTML = function()
  14. {
  15. if ('undefined' != typeof App.Pages[App.Env.world].prepareHTML) {
  16. App.Pages.prepareHTML();
  17. }
  18. else {
  19. App.Model[App.Env.world].loadList();
  20. }
  21. }
  22. App.Pages.DNS.showSubform = function(ref)
  23. {
  24. App.Helpers.showLoading();
  25. var data = ref.find('.source:first').val();
  26. App.Ajax.request('DNS.getListRecords', {
  27. spell: data
  28. }, function(reply) {
  29. var tpl = App.Templates.get('SUBFORM', 'dns');
  30. var tpl_records = App.HTML.Build.dns_records(reply.data);
  31. tpl.set(':SUBRECORDS', tpl_records);
  32. $(ref).find('.show-records').addClass('hidden');
  33. $(ref).after(tpl.finalize());
  34. App.Helpers.updateScreen();
  35. });
  36. }
  37. App.Pages.DNS.edit = function(elm) {
  38. var options = elm.find('.source').val();
  39. fb.warn(elm);
  40. fb.warn(options);
  41. var tpl = App.HTML.Build.dns_form(options);
  42. elm.replaceWith(tpl);
  43. }