You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.9 KiB

7 years ago
  1. APP.BOARD = {};
  2. APP.BOARD.CATEGORY = {};
  3. APP.BOARD.EXTRA = {};
  4. APP.BOARD.COMMENT = {};
  5. /**
  6. * 특정 카테고리의 하위 카테고리가 몇개인지 가져온다.
  7. * @param bca_idx
  8. */
  9. APP.BOARD.CATEGORY.count = function(bca_idx)
  10. {
  11. if (typeof bca_idx == 'undefined' || ! bca_idx) return 0;
  12. var count = 0;
  13. $.ajax({
  14. url : base_url + "/ajax/board/category_count",
  15. type : 'get',
  16. cache : false,
  17. async : false,
  18. data : {
  19. bca_idx: bca_idx
  20. },
  21. success:function(res)
  22. {
  23. count = res.result;
  24. }
  25. })
  26. return count;
  27. };
  28. APP.BOARD.CATEGORY.postCount = function(bca_idx)
  29. {
  30. if (typeof bca_idx == 'undefined' || ! bca_idx) return 0;
  31. var count = 0;
  32. $.ajax({
  33. url : base_url + "/ajax/board/category_post_count",
  34. type : 'get',
  35. cache : false,
  36. async : false,
  37. data : {
  38. bca_idx: bca_idx
  39. },
  40. success:function(res)
  41. {
  42. count = res.result;
  43. }
  44. });
  45. return count;
  46. };
  47. APP.BOARD.COMMENT.modify= function( cmt_idx )
  48. {
  49. APP.POPUP({
  50. title : '_blank',
  51. width : 800,
  52. height : 600,
  53. url : base_url + '/board/comment/modify/' + cmt_idx
  54. });
  55. };
  56. APP.BOARD.COMMENT.reply= function( cmt_idx, cmt_num )
  57. {
  58. APP.POPUP({
  59. title : '_blank',
  60. width : 800,
  61. height : 600,
  62. url : base_url + '/board/comment/reply/' + cmt_idx + '/' + cmt_num
  63. });
  64. };
  65. $(function(){
  66. var $form_post = $('[data-form="post"]');
  67. if( $form_post.length > 0 )
  68. {
  69. $form_post.on('submit', function(){
  70. $.blockUI({
  71. css: {width:'25px',top:'49%',left:'49%',border:'0px none',backgroundColor:'transparent',cursor:'wait'},
  72. message : '<img src="/assets/images/common/ajax-loader.gif" alt="로딩중">',
  73. baseZ : 10000,
  74. overlayCSS : {opacity : 0}
  75. });
  76. });
  77. }
  78. });