_settings.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.Settings.ajax_url = 1;
  13. App.Settings.uri = location.href.replace('index.html', '');
  14. App.Settings.popup_conf = { 'centered' : true, 'bgcolor' : '#FF0000', 'lightboxSpeed' : 'fast', 'destroyOnClose': true };
  15. App.Constants.SUSPENDED_YES = 'yes';
  16. App.Constants.IP = 'IP';
  17. App.Constants.DNS = 'DNS';
  18. App.Constants.DNS_TEMPLATES = {'default': 'Default'};
  19. App.Messages.total_dns_records = {single: 'total record', plural: 'total records'};
  20. App.Messages.get = function(key, plural) {
  21. if ('undefined' != typeof App.Messages[key]) {
  22. return plural ? App.Messages[key].plural : App.Messages[key].single;
  23. }
  24. }
  25. App.Settings.getMethodName = function(action)
  26. {
  27. var type = '';
  28. var method = '';
  29. // TYPE NAME
  30. switch (App.Env.world)
  31. {
  32. case App.Constants.DNS:
  33. type = 'DNS'
  34. break;
  35. default:
  36. type = App.Env.world;
  37. break;
  38. }
  39. // METHOD NAME
  40. switch (action)
  41. {
  42. case 'update':
  43. method = 'change';
  44. break;
  45. default:
  46. method = action;
  47. break;
  48. }
  49. return type + '.' + method;
  50. }