(Install package: clbiwiki-frame-geometry-normalized-20260717 / js/CategoryPillar.js) |
(Install package: clbiwiki-portal-frame-canvas-atomic-v3-20260717 / js/CategoryPillar.js) |
||
| 1번째 줄: | 1번째 줄: | ||
/* portal-frame canvas v3 — 2026-07-17 */ | |||
/* ========================================= | /* ========================================= | ||
CategoryPillar | CategoryPillar | ||
canvas CategoryNav 내부 프로젝트 기둥 호환 모듈 | |||
========================================= */ | ========================================= */ | ||
| 7번째 줄: | 8번째 줄: | ||
'use strict'; | 'use strict'; | ||
var | var BUILD_TAG = 'portal-frame-canvas-v3-20260717'; | ||
window.PortalFrameModules = window.PortalFrameModules || {}; | |||
window.PortalFrameModules.CategoryPillar = BUILD_TAG; | |||
var REQUIRED_CATEGORY_VERSION = BUILD_TAG; | |||
var warned = false; | |||
function categoryReady() { | |||
var ready = window.CategoryNav && | |||
window.CategoryNav.version === REQUIRED_CATEGORY_VERSION && | |||
typeof window.CategoryNav.renderAll === 'function'; | |||
if (!ready && !warned && window.console && typeof window.console.error === 'function') { | |||
return | warned = true; | ||
window.console.error( | |||
'[CategoryNav 구버전 감지: CategoryPillar.js와 MediaWiki:CategoryNav.js를 같은 배포 세트로 업데이트하세요] ' + | |||
'필요 버전=' + REQUIRED_CATEGORY_VERSION | |||
); | |||
} | |||
if (ready) warned = false; | |||
return ready; | |||
} | } | ||
function renderAll(root | function renderAll(root) { | ||
var scope = root && root.querySelectorAll ? root : document; | var scope = root && root.querySelectorAll ? root : document; | ||
if (!categoryReady()) return 0; | |||
return scope.querySelectorAll( | |||
'.main-portal [data-component="category-nav"] .portal-category-canvas' | |||
).length; | |||
) | |||
} | } | ||
window.CategoryPillar = { | |||
version:BUILD_TAG, | |||
buildTag:BUILD_TAG, | |||
init:renderAll, | |||
renderAll:renderAll, | |||
render:function () { return renderAll(document) > 0; } | |||
} | }; | ||
if (mw && mw.hook) { | if (mw && mw.hook) { | ||
mw.hook('wikipage.content').add(function (content) { | mw.hook('wikipage.content').add(function (content) { | ||
renderAll(content && content[0] ? content[0] : document); | |||
}); | }); | ||
} | } | ||
}(window, document, window.mw)); | }(window, document, window.mw)); | ||
2026년 7월 17일 (금) 17:42 판
/* portal-frame canvas v3 — 2026-07-17 */
/* =========================================
CategoryPillar
canvas CategoryNav 내부 프로젝트 기둥 호환 모듈
========================================= */
(function (window, document, mw) {
'use strict';
var BUILD_TAG = 'portal-frame-canvas-v3-20260717';
window.PortalFrameModules = window.PortalFrameModules || {};
window.PortalFrameModules.CategoryPillar = BUILD_TAG;
var REQUIRED_CATEGORY_VERSION = BUILD_TAG;
var warned = false;
function categoryReady() {
var ready = window.CategoryNav &&
window.CategoryNav.version === REQUIRED_CATEGORY_VERSION &&
typeof window.CategoryNav.renderAll === 'function';
if (!ready && !warned && window.console && typeof window.console.error === 'function') {
warned = true;
window.console.error(
'[CategoryNav 구버전 감지: CategoryPillar.js와 MediaWiki:CategoryNav.js를 같은 배포 세트로 업데이트하세요] ' +
'필요 버전=' + REQUIRED_CATEGORY_VERSION
);
}
if (ready) warned = false;
return ready;
}
function renderAll(root) {
var scope = root && root.querySelectorAll ? root : document;
if (!categoryReady()) return 0;
return scope.querySelectorAll(
'.main-portal [data-component="category-nav"] .portal-category-canvas'
).length;
}
window.CategoryPillar = {
version:BUILD_TAG,
buildTag:BUILD_TAG,
init:renderAll,
renderAll:renderAll,
render:function () { return renderAll(document) > 0; }
};
if (mw && mw.hook) {
mw.hook('wikipage.content').add(function (content) {
renderAll(content && content[0] ? content[0] : document);
});
}
}(window, document, window.mw));