Uwaga: aby zobaczyć zmiany po opublikowaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.
- Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5, lub Ctrl+R (⌘-R na komputerze Mac)
- Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
- Edge: Przytrzymaj Ctrl, jednocześnie klikając Odśwież, lub naciśnij klawisze Ctrl+F5.
- Opera: Naciśnij klawisze Ctrl+F5.
/* fix iOS smart quotes */
// Based on: https://stackoverflow.com/a/49890732
// Patch the iOS Smart Punctuation functionality on restricted field(s),
// so that the user types acceptable characters.
// Here are the reference to Unicode Characters in the Punctuation
// Open-quotes: http://www.fileformat.info/info/unicode/category/Pi/list.htm
// Close-quotes: http://www.fileformat.info/info/unicode/category/Pf/list.htm
$(document).ready( function() {
var target = document.getElementsByTagName("body")[0];
var config = { attributes: true, childList: false, subtree: false };
var callback = function (mutationList, observer) {
mutationList.forEach(function(mutation){
if (mutation.type === "attributes" && mutation.attributeName === "class") {
if (mutation.target.classList.contains("minerva-animations-ready"))
attachFilterToInputs();
}});
};
var observer = new MutationObserver(callback);
observer.observe(target, config);
});
function attachFilterToInputs() {
try {
$(".wikitext-editor").on('input', preventPretentiousPunctuation);
}
catch (err) {
// do nothing
}
}
function preventPretentiousPunctuation(event) {
try {
console.log($(this).val());
var str = $(this).val();
var replacedStr = str;
replacedStr = replacedStr.replace(/[\u201A\u2018\u2019]/g, "'");
replacedStr = replacedStr.replace(/[\u201E\u201C\u201D]/g, '"');
if (str !== replacedStr) {
$(this).val(replacedStr);
}
}
catch (err) {
// do nothing
console.error(err);
}
}