您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

61 行
2.4 KiB

  1. // Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
  2. //
  3. // MIT License (MIT)
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a
  6. // copy of this software and associated documentation files (the "Software"),
  7. // to deal in the Software without restriction, including without limitation
  8. // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. // and/or sell copies of the Software, and to permit persons to whom the
  10. // Software is furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  19. // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  20. // OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. //
  22. // Error Console:
  23. var err_console;
  24. var err_list = [];
  25. function errprint(t) {
  26. if(!err_list)err_list = [];
  27. err_list.push('<pre style="font-family: Courier, Fixed; font-size: 11px; \
  28. border-bottom: 1px solid #AAA; overflow: auto; width: 90%;">'+t+'</pre>');
  29. }
  30. $(document).bind('startup', function() {
  31. err_console = new Dialog(640, 480, 'Error Console')
  32. err_console.make_body([
  33. ['HTML', 'Error List']
  34. ,['Button', 'Clear']
  35. ,['HTML', 'Error Report']
  36. ]);
  37. var span = $a(err_console.widgets['Error Report'], 'span', 'link_type');
  38. span.innerHTML = 'Send Error Report';
  39. span.onclick = function() {
  40. msg = prompt('How / where did you get the error [optional]')
  41. var call_back = function(r, rt){
  42. err_console.hide();
  43. msgprint("Error Report Sent")
  44. }
  45. $c('webnotes.utils.send_error_report', {'err_msg': err_console.rows['Error List'].innerHTML, 'msg': msg}, call_back);
  46. }
  47. err_console.widgets['Clear'].onclick = function() {
  48. err_list = [];
  49. err_console.rows['Error List'].innerHTML = '';
  50. err_console.hide();
  51. }
  52. err_console.onshow = function() {
  53. err_console.rows['Error List'].innerHTML = '<div style="padding: 16px; height: 360px; width: 90%; overflow: auto;">'
  54. + err_list.join('<div style="height: 10px; margin-bottom: 10px; border-bottom: 1px solid #AAA"></div>') + '</div>';
  55. }
  56. });