참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다.
- 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
- 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
- 인터넷 익스플로러 / 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
- 오페라: Ctrl-F5를 입력.
// <nowiki>
//존재/가상에 있는 링크 기울이기
//mw.loader.load("/index.php?title=사용자:렌즈/categoryCheck.js&action=raw&ctype=text/javascript");
// 주소 표시줄에 한국어 이름공간 있으면 영어로 바꾸기
$(document).ready(function () {
window.history.pushState(
{},
'',
window.location.href.replace(
encodeURIComponent(
mw.config.get('wgFormattedNamespaces')[
mw.config.get('wgNamespaceNumber')
]
),
(function () {
for (
var _i = 0,
_Object$entries = Object.entries(mw.config.get('wgNamespaceIds'));
_i < _Object$entries.length;
_i++
) {
var _Object$entries$_i = _Object$entries[_i],
k = _Object$entries$_i[0],
v = _Object$entries$_i[1];
if (mw.config.get('wgNamespaceNumber') == v && /[a-z]/.test(k))
return k;
}
})() || ''
)
);
});
//메뉴에 Purge 링크 추가
$(document).ready(function () {
try {
var menu = document
.getElementById('p-actions')
.getElementsByTagName('ul')[0],
purge = document.createElement('li'),
a = document.createElement('a'),
lingurl =
window.location.protocol +
'//' +
window.location.hostname +
'/index.php?title=' +
mw.config.get('wgPageName') +
'&action=purge';
posturl =
window.location.protocol +
'//' +
window.location.hostname +
'/api.php?action=purge&forcelinkupdate=1&titles=' +
mw.config.get('wgPageName');
menu.append(purge);
purge.append(a);
a.innerHTML = '새로고침';
a.href = lingurl;
a.onclick = function () {
$.post({
url: posturl,
})
.done(function (data) {
console.log('done');
})
.fail(function (data) {
console.log('fail');
});
// location.reload();
return false;
};
} catch (err) {}
});
//개인메뉴에 롤백 활성화 버튼 추가
$(document).ready(function () {
var enabled = $.cookie('femiwiki-lens0021-rollback-enabled');
if (enabled === '1') enabled = true;
else enabled = false;
var buttons = $('span.mw-rollback-link'),
menu = $('#p-personal ul'),
toggle = $('<li></li>').append($('<a href="#">롤백</a>'));
menu.append(toggle);
toggle.children('a').click(function (e) {
e.preventDefault();
enabled = !enabled;
$.cookie('femiwiki-lens0021-rollback-enabled', enabled ? '1' : '0', {
expires: 30,
});
buttons.toggle(enabled);
});
buttons.toggle(enabled);
});
//공유 메뉴에 판 링크 만들기 추가
$(document).ready(function () {
try {
var menu = document
.getElementById('p-page-tb')
.getElementsByTagName('ul')[0],
ref = document.createElement('li'),
a = document.createElement('a');
menu.append(ref);
ref.append(a);
a.innerHTML = '판 링크 만들기';
a.href = '#';
a.accesskey = 'r';
a.onclick = function () {
document.getElementById('searchInput').value =
'[[' +
mw.config.get('wgPageName').replace(/_/g, ' ') +
']]([[특:고유링크/' +
mw.config.get('wgRevisionId') +
'|' +
mw.config.get('wgRevisionId') +
'판]])';
return false;
};
} catch (err) {}
});
// redlink 시각편집기로 열기
$(function () {
$('a.new').each(function () {
$(this).attr(
'href',
$(this).attr('href').replace('action=edit', 'veaction=edit')
);
});
});
// 동음이의어 문서 템플릿 가져오기
$(document).ready(function () {
$(
mw.util.addPortletLink(
'p-actions',
'#',
'동음이의어',
'p-Disambiguation',
''
)
).on('click', function () {
var memo = document.createElement('textarea');
memo.innerHTML = [
'{{동음이의어 문서}}',
'',
'; [[문서1]]',
': 문서1에 대한 설명',
':',
'; [[문서2]]',
': 문서2에 대한 설명',
':',
'',
'{{분류|성격/동음이의어}}',
].join('\n');
document.body.appendChild(memo);
memo.select();
});
});
// 시각편집기에 저렴한 Citoid 추가
mw.loader.using('ext.visualEditor.desktopArticleTarget.init').then(function () {
mw.libs.ve.addPlugin(function () {
var api = 'https://ko.wikipedia.org/api/rest_v1/data/citation/mediawiki/';
/**
* @class citoidCommand
*/
var citoidCommand = function () {
// Parent constructor
citoidCommand.parent.call(
this,
'citoid' // Command name
);
};
OO.inheritClass(citoidCommand, ve.ui.Command);
citoidCommand.prototype.execute = function (surface) {
mw.loader.using('oojs-ui-windows').done(function () {
OO.ui
.prompt('URL 입력', {
textInput: { placeholder: 'https://femiwiki.com' },
})
.done(function (articleUrl) {
// Test URL
// articleUrl = "http://www.womennews.co.kr/news/articleView.html?idxno=198034";
if (articleUrl !== null) {
jQuery.get(api + encodeURIComponent(articleUrl), function (data) {
data = data[0];
console.log(data);
var paramMap = {
url: articleUrl,
title: data.title,
date: data.date,
language: data.language,
'access-date': data.accessDate,
};
var wikitext = '';
for (var param in paramMap) {
wikitext += '|' + param + '=' + paramMap[param];
}
wikitext = '<ref>{{뉴스 인용' + wikitext + '}}</ref>';
OO.ui.alert(wikitext);
});
}
});
});
return true;
};
// class ends
/**
* @class citoidTool
*/
var citoidTool = function () {
citoidTool.super.apply(this, arguments);
};
OO.inheritClass(citoidTool, ve.ui.FragmentWindowTool);
citoidTool.static.name = 'citoid';
citoidTool.static.group = 'cite';
citoidTool.static.icon = 'quotes';
citoidTool.static.title = 'Citoid';
citoidTool.static.modelClasses = [ve.dm.MWReferencesListNode];
citoidTool.static.commandName = 'citoid';
// class ends
ve.ui.commandRegistry.register(new citoidCommand());
ve.ui.toolFactory.register(citoidTool);
});
});
// </nowiki>