_settings.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. App.Env.lang = 'EN';
  2. App.i18n.EN = {};
  3. App.i18n.EN.incorrect_ip = 'Incorrect ip';
  4. App.i18n.EN.confirm = 'Are you sure?';
  5. App.i18n.getMessage = function(key)
  6. {
  7. return 'undefined' != typeof App.i18n[App.Env.lang][key] ? App.i18n[App.Env.lang][key] : '';
  8. }
  9. // Constants
  10. App.Constants.IP_FORM_ID = 'ip-form';
  11. App.Constants.DNS_FORM_ID = 'dns-form';
  12. App.Constants.USER_FORM_ID = 'user-form';
  13. App.Settings.ajax_url = 1;
  14. App.Settings.uri = location.href.replace('index.html', '');
  15. App.Settings.popup_conf = { 'centered' : true, 'bgcolor' : '#FF0000', 'lightboxSpeed' : 'fast', 'destroyOnClose': true };
  16. App.Constants.SUSPENDED_YES = 'yes';
  17. App.Constants.IP = 'IP';
  18. App.Constants.DNS = 'DNS';
  19. App.Constants.DNS_TEMPLATES = {'default': 'Default'};
  20. App.Messages.total_dns_records = {single: 'total record', plural: 'total records'};
  21. App.Messages.get = function(key, plural) {
  22. if ('undefined' != typeof App.Messages[key]) {
  23. return plural ? App.Messages[key].plural : App.Messages[key].single;
  24. }
  25. }
  26. App.Settings.getMethodName = function(action)
  27. {
  28. var type = '';
  29. var method = '';
  30. // TYPE NAME
  31. switch (App.Env.world)
  32. {
  33. case App.Constants.DNS:
  34. type = 'DNS'
  35. break;
  36. default:
  37. type = App.Env.world;
  38. break;
  39. }
  40. // METHOD NAME
  41. switch (action)
  42. {
  43. case 'update':
  44. method = 'change';
  45. break;
  46. default:
  47. method = action;
  48. break;
  49. }
  50. return type + '.' + method;
  51. }