/*! 2024. 5. 2. 오후 4:59:11 */
/******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
(() => {
const { EventManager, utils } = ShopbySkin;
const url = new URL(window.location.href);
const searchParams = new URLSearchParams(url.search);
const boardId = searchParams.get('boardId');
const boardNo = searchParams.get('boardNo');
const getActionNameWithPairKey = ({ action, target }) => {
const pairKey = target.closest('[pair-key]')?.getAttribute('pair-key');
const actionKeySuffix = pairKey ? `:${pairKey}` : '';
return `${action}${actionKeySuffix}`;
};
const moduleActionHandler = {
WRITE: ({ target }) => {
const boardName = document.querySelector('[shopby-board-name]')?.getAttribute('shopby-board-name');
const canPostByMember = target.closest('[shopby-can-post-by-member]')?.getAttribute('shopby-can-post-by-member');
const canPostByGuest = target.closest('[shopby-can-post-by-guest]')?.getAttribute('shopby-can-post-by-guest');
const canSecretPosting = target.closest('[shopby-can-secret-posting]')?.getAttribute('shopby-can-secret-posting');
const usesAttachment = target.closest('[shopby-uses-attachment]')?.getAttribute('shopby-uses-attachment');
const isCanPostByMember = canPostByMember === 'true';
const isCanPostByGuest = canPostByGuest === 'true';
if (isCanPostByMember && !utils.isSignedIn()) {
if (!isCanPostByGuest) {
EventManager.fire('MODAL_CONFIRM_OPEN', {
noticeType: 'WARNING',
confirmLabel: 'Confirm',
cancelLabel: 'Cancel',
message: 'You must log in to
use this service.',
onConfirm: () => {
const nextUrl = `${location.origin}/en/pages/sign-in/sign-in.html`;
const from = location.pathname.startsWith('/en/pages/') ? encodeURIComponent(location.href) : encodeURIComponent( location.href.replace('/pages/', '/en/pages/') );
location.href = `${nextUrl}?from=${from}`;
},
});
return;
}
}
if (!isCanPostByMember && utils.isSignedIn()) {
EventManager.fire('MODAL_ALERT_OPEN', {
noticeType: 'CAUTION',
label: 'Confirm',
message: 'This is a bulletin board for non-members only.',
});
return;
}
EventManager.fire('OPEN_LAYER_MODAL', {
name: 'article-write-form',
title: boardName,
isFull: false,
data: {
boardId,
canSecretPosting,
usesAttachment,
isModify: false,
},
onClose: ({ reason }) => {
if (reason === 'DID_SUBMIT') {
location.reload();
}
},
});
},
MOVE_TO_FIRST_PAGE: ({ target }) => {
const actionName = getActionNameWithPairKey({ action: 'MOVE_TO_FIRST_PAGE', target });
EventManager.fire(actionName);
},
MOVE_TO_PREV_PAGE: ({ target }) => {
const actionName = getActionNameWithPairKey({ action: 'MOVE_TO_PREV_PAGE', target });
EventManager.fire(actionName);
},
MOVE_TO_PAGE: ({ target }) => {
const actionName = getActionNameWithPairKey({ action: 'MOVE_TO_PAGE', target });
const page = target.closest('[shopby-page]')?.getAttribute('shopby-page');
EventManager.fire(actionName, { page });
},
MOVE_TO_NEXT_PAGE: ({ target }) => {
const actionName = getActionNameWithPairKey({ action: 'MOVE_TO_NEXT_PAGE', target });
EventManager.fire(actionName);
},
MOVE_TO_LAST_PAGE: ({ target }) => {
const actionName = getActionNameWithPairKey({ action: 'MOVE_TO_LAST_PAGE', target });
EventManager.fire(actionName);
},
};
document.querySelector('article-list-info')?.addEventListener('click', ({ target }) => {
const action = target.getAttribute('shopby-action');
const boardName = document.querySelector('[shopby-board-name]')?.getAttribute('shopby-board-name');
moduleActionHandler[action]?.({ boardName });
});
document.querySelector('article-total-count')?.addEventListener('click', ({ target }) => {
const action = target.getAttribute('shopby-action');
moduleActionHandler[action]?.({ target });
});
document.querySelector('article-list')?.addEventListener('click', ({ target }) => {
const action = target.getAttribute('shopby-action');
moduleActionHandler[action]?.({ target });
});
//매거진 게시판
if(boardId == "magazineEn" || boardNo =="285803"){
document.querySelector('.l-page').classList.add("magazine");
}
})();
/******/ })()
;