문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 여기에는 다른 사용자의 개인 설정이 포함되어 있기 때문에 이 자바스크립트 문서를 편집할 수 없습니다. 문서의 원본을 보거나 복사할 수 있습니다. /* * written By. LiteHell and 다메즈마 * Warning : This script uses localStorage of your browser so BREADCUMB WILL BE DELETED IF YOU CLEAR STORAGE DATA FROM YOUR BROWSER. */ if (mw.config.exists("wgIsArticle") && mw.config.exists("wgPageName") && mw.config.exists("wgArticlePath")) { var conf = mw.config.get(["wgIsArticle", "wgPageName", "wgArticlePath"]); if (conf.wgIsArticle) { var itemName = "pageBreadcumbs"; function initStorageIfRequired() { if (localStorage.getItem(itemName) == null) localStorage.setItem(itemName, "[]"); } function setStorage(value) { initStorageIfRequired(); localStorage.setItem(itemName, JSON.stringify(value.slice(-20))); } function getStorage() { initStorageIfRequired(); return JSON.parse(localStorage.getItem(itemName)); } function makeBreadBar(arr, active) { var ol = document.createElement("ol"); ol.className = "breadcrumb"; ol.innerHTML = '<li id="cleanBreads"><a href="javascript:(function(){})();" style="color: red;"><span class="glyphicon glyphicon-trash"></span></a></li>'; ol.querySelector('li#cleanBreads > a').addEventListener("click", function() { if (confirm("진짜로 빵가루를 전부다 청소할까요?")) { localStorage.setItem(itemName, "[]"); alert('강제 새로고침하면 지워져 있을겁니다. :)'); } }); for (var i = 0; i < arr.length; i++) { var now = arr[i]; var li = document.createElement("li"); if (now == active) { li.className = "active"; li.textContent = now; } else { var anchor = document.createElement("a"); anchor.href = conf.wgArticlePath.replace('$1', now); anchor.title = now; anchor.textContent = now; li.appendChild(anchor); } ol.appendChild(li); } return ol; } var articles = getStorage(); if(articles.length == 0 || (articles.length != 0 && articles[articles.length - 1] != conf.wgPageName)) articles.push(conf.wgPageName); setStorage(articles, conf.wgPageName); var breadbar = makeBreadBar(articles, conf.wgPageName); var headerAds = document.querySelector(".header-ads"); headerAds.parentNode.insertBefore(breadbar, headerAds); // 광고 위에 삽입하기 } } 사용자:Utolee90/BreadCrumb.js 문서로 돌아갑니다.