pages.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. }
  10. App.Pages.prepareHTML = function()
  11. {
  12. if ('undefined' != typeof App.Pages[App.Env.world].prepareHTML) {
  13. App.Pages.prepareHTML();
  14. }
  15. else {
  16. App.Model[App.Env.world].loadList();
  17. }
  18. }
  19. App.Pages.DNS.showSubform = function(ref)
  20. {
  21. App.Helpers.showLoading();
  22. var data = ref.find('.source:first').val();
  23. App.Ajax.request('DNS.getListRecords', {
  24. spell: data
  25. }, function(reply) {
  26. var tpl = App.Templates.get('SUBFORM', 'dns');
  27. var tpl_records = App.HTML.Build.dns_records(reply.data);
  28. tpl.set(':SUBRECORDS', tpl_records);
  29. $(ref).find('.show-records').addClass('hidden');
  30. $(ref).after(tpl.finalize());
  31. App.Helpers.updateScreen();
  32. });
  33. }
  34. App.Pages.DNS.edit = function(elm) {
  35. var options = elm.find('.source').val();
  36. fb.warn(elm);
  37. fb.warn(options);
  38. var tpl = App.HTML.Build.dns_form(options);
  39. elm.replaceWith(tpl);
  40. }