Files
core/hwe/js/board.js
T
2021-08-22 02:40:27 +09:00

2 lines
12 KiB
JavaScript

(()=>{"use strict";var t,e={5693:(t,e,r)=>{r(7042),r(1038),r(8783),r(2526),r(1817),r(2165),r(6992),r(3948);var n=r(2742),o=r.n(n),a=(r(5666),r(9826),r(2479),r(1539),r(8674),r(9669)),i=r.n(a),u=r(9755),c=r.n(u);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?p(t):e}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){var e="function"==typeof Map?new Map:void 0;return(d=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return h(t,arguments,b(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,t)})(t)}function h(t,e,r){return(h=y()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&v(o,r.prototype),o}).apply(null,arguments)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r(4916),r(5306),r(9714),r(1058),r(189),r(4723),r(3123),r(3210),r(2222),r(8304),r(489),r(2772),r(2419),r(1532);var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(o,t);var e,r,n=(e=o,r=y(),function(){var t,n=b(e);if(r){var o=b(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return s(this,t)});function o(){var t;f(this,o);for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return m(p(t=n.call.apply(n,[this].concat(r))),"name","NotNullExpected"),t}return o}(d(TypeError));r(3734),i().defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var w,x=(w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},function(t){return String(t).replace(/[&<>"'`=/]/g,(function(t){return w[t]}))});function j(t){return t.replace(/\n/g,"<br>")}String.prototype.format=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.replace(/{(\d+)}/g,(function(t,r){return void 0!==e[r]?e[r].toString():t}))};var S=r(1584),O=r.n(S),_=r(1763),T=r.n(_),k=r(7037),A=r.n(k),R=r(1469),P=r.n(R);function E(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=I(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function I(t,e){if(t){if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function M(t){for(var e=new FormData,r=function(t){if(A()(t))return t;if(T()(t))return t.toString();if(O()(t))return t?"true":"false";throw new TypeError("지원하지 않는 formData Type")},n=0,o=Object.entries(t);n<o.length;n++){var a=(p=o[n],d=2,function(t){if(Array.isArray(t))return t}(p)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(p,d)||I(p,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],u=a[1];if(P()(u)){var c,l="".concat(i,"[]"),f=E(u);try{for(f.s();!(c=f.n()).done;){var s=c.value;e.append(l,r(s))}}catch(t){f.e(t)}finally{f.f()}}else e.append(i,r(u))}var p,d;return e}function q(t){if(null==t)throw new g;return t}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function B(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function D(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){B(a,n,o,i,u,"next",t)}function u(t){B(a,n,o,i,u,"throw",t)}i(void 0)}))}}function N(t){return H.apply(this,arguments)}function H(){return(H=D(regeneratorRuntime.mark((function t(e){var r,n,a,u,l,f,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),r=c()("#newArticle"),n=r.find(".titleInput"),a=r.find(".contentInput"),u=o()(q(n.val())),(l=o()(q(a.val())))||u){t.next=8;break}return t.abrupt("return",!1);case 8:return t.prev=8,t.next=11,i()({url:"j_board_article_add.php",method:"post",responseType:"json",data:M({isSecret:isSecretBoard,title:u,text:l})});case 11:s=t.sent,f=s.data,t.next=20;break;case 15:return t.prev=15,t.t0=t.catch(8),console.error(t.t0),alert("실패했습니다. :".concat(t.t0)),t.abrupt("return");case 20:if(f.result){t.next=23;break}return alert("글을 올리는데 실패했습니다. ".concat(f.reason)),t.abrupt("return");case 23:n.val(""),a.val(""),$();case 26:case"end":return t.stop()}}),t,null,[[8,15]])})))).apply(this,arguments)}function X(t){return L.apply(this,arguments)}function L(){return(L=D(regeneratorRuntime.mark((function t(e){var r,n,a,u,l,f,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),r=c()(this),n=r.closest(".articleObj").eq(0),a=n.data("no"),u=n.find("input.commentText"),l=o()(q(u.val()))){t.next=8;break}return t.abrupt("return");case 8:return t.prev=8,t.next=11,i()({url:"j_board_comment_add.php",method:"post",responseType:"json",data:M({articleNo:a,text:l})});case 11:s=t.sent,f=s.data,t.next=20;break;case 15:return t.prev=15,t.t0=t.catch(8),console.error(t.t0),alert("실패했습니다. :".concat(t.t0)),t.abrupt("return");case 20:if(f.result){t.next=23;break}return alert("댓글을 다는데 실패했습니다. ".concat(f.reason)),t.abrupt("return");case 23:return u.val(""),$(),t.abrupt("return",!1);case 26:case"end":return t.stop()}}),t,this,[[8,15]])})))).apply(this,arguments)}function U(t){var e=c()("#articleTemplate > .articleFrame"),r=c()(c()("#commentTemplate").prop("content")),n=e.clone();n.addClass("articleObj").data("no",t.no).data("author",t.general_no),n.find(".articleNo").text(t.no),n.find(".authorName").text(t.author),n.find(".articleTitle").text(t.title),n.find(".date").text(t.date),t.author_icon&&n.find(".authorIcon").attr("src",t.author_icon),n.find(".text").html(j(x(t.text)));var o,a=n.find(".commentList"),i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(t.comment);try{for(i.s();!(o=i.n()).done;){var u=o.value,l=r.clone();l.find(".author").text(u.author),l.find(".text").html(j(x(u.text))),l.find(".date").text(u.date),a.append(l)}}catch(t){i.e(t)}finally{i.f()}n.find(".submitComment").on("click",X),n.find(".commentText").on("keypress",(function(t){13===t.which&&n.find(".submitComment").trigger("click")})),n.find(".inputCommentHeader").click((function(){n.find(".commentText").trigger("focus")})),c()("#board").prepend(n)}function W(t){if(t.result){c()(".articleObj").detach();for(var e=0,r=Object.values(t.articles);e<r.length;e++)U(r[e])}else alert("에러: ".concat(t.reason))}function $(){return z.apply(this,arguments)}function z(){return(z=D(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i()({url:"j_board_get_articles.php",responseType:"json",method:"post",data:M({isSecret:isSecretBoard})});case 3:W(t.sent.data),t.next=12;break;case 7:return t.prev=7,t.t0=t.catch(0),console.error(t.t0),alert("에러: ".concat(t.t0)),t.abrupt("return");case 12:return t.abrupt("return",c().post({url:"j_board_get_articles.php",dataType:"json",data:{isSecret:isSecretBoard}}));case 13:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}r(9720),c()((function(){i().defaults.headers.common["X-Requested-With"]="XMLHttpRequest",c()("textarea.autosize").on("keydown keyup",(function(){var t;(t=c()(this)).height(1).height(t.prop("scrollHeight")+12)})),c()("#submitArticle").on("click",N),$()}))}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=e,t=[],n.O=(e,r,o,a)=>{if(!r){var i=1/0;for(f=0;f<t.length;f++){for(var[r,o,a]=t[f],u=!0,c=0;c<r.length;c++)(!1&a||i>=a)&&Object.keys(n.O).every((t=>n.O[t](r[c])))?r.splice(c--,1):(u=!1,a<i&&(i=a));if(u){t.splice(f--,1);var l=o();void 0!==l&&(e=l)}}return e}a=a||0;for(var f=t.length;f>0&&t[f-1][2]>a;f--)t[f]=t[f-1];t[f]=[r,o,a]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.j=198,(()=>{var t={198:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var o,a,[i,u,c]=r,l=0;if(i.some((e=>0!==t[e]))){for(o in u)n.o(u,o)&&(n.m[o]=u[o]);if(c)var f=c(n)}for(e&&e(r);l<i.length;l++)a=i[l],n.o(t,a)&&t[a]&&t[a][0](),t[i[l]]=0;return n.O(f)},r=self.webpackChunkhidche_lib=self.webpackChunkhidche_lib||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var o=n.O(void 0,[216],(()=>n(5693)));o=n.O(o)})();
//# sourceMappingURL=board.js.map