잔글 (Chirho님이 사용자:Cerulean/addArticleMenuItem.js 문서를 넘겨주기를 만들지 않고 사용자:하늘/addArticleMenuItem.js 문서로 이동했습니다: "Cerulean" 사용자의 이름을 "하늘"(으)로 바꿀 때 문서를 자동으로 이동했습니다) |
편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
function | function extendedDropdownItem(htmlObject) { | ||
this.menuitem = htmlObject; | this.menuitem = htmlObject; | ||
this.AddItem = function (func, buttonname, buttontitle) { | this.AddItem = function (func, buttonname, buttontitle) { | ||
11번째 줄: | 11번째 줄: | ||
}; | }; | ||
this.SetMenuItem = function (htmlObject) { this.menuitem = htmlObject; }; | this.SetMenuItem = function (htmlObject) { this.menuitem = htmlObject; }; | ||
} | |||
if (mw.config.get('skin') == "liberty") { | |||
window.extendedDropdownItemArray = new extendedDropdownItem(document.querySelector('.content-tools .dropdown-item:last-child')); | |||
} | } |
2022년 8월 28일 (일) 12:58 판
function extendedDropdownItem(htmlObject) {
this.menuitem = htmlObject;
this.AddItem = function (func, buttonname, buttontitle) {
var toAddItem = this.menuitem.cloneNode(true);
toAddItem.href = 'javascript:;';
toAddItem.innerHTML = buttonname;
toAddItem.accessKey = '';
toAddItem.title = buttontitle;
toAddItem.onclick = func;
this.menuitem.after(toAddItem);
};
this.SetMenuItem = function (htmlObject) { this.menuitem = htmlObject; };
}
if (mw.config.get('skin') == "liberty") {
window.extendedDropdownItemArray = new extendedDropdownItem(document.querySelector('.content-tools .dropdown-item:last-child'));
}