User:Inductiveload/Easy proofread.js

/* * Easy Proofread : proofreading helper * * based on Easy LST by ThomasV */ function easy_proofread { var editbox = document.getElementById('wpTextbox1'); if(editbox && self.proofreadPageIsEdit) { $('#wpTextbox1').css('font-family', 'DPCustomMono2'); editbox.value = editbox.value.replace(/\n/g, '¶\n'); editbox.value = editbox.value.replace(/ /g, '⋅'); editbox.value = editbox.value.replace(/\t/g, '———→');

var saveButton = document.getElementById("wpSave"); var previewButton = document.getElementById("wpPreview"); var diffButton = document.getElementById("wpDiff"); if(saveButton){ saveButton.onclick = easy_proofread_restore_text; previewButton.onclick = easy_proofread_restore_text; diffButton.onclick = easy_proofread_restore_text; }	} }

function easy_proofread_restore_text{ var editbox = document.getElementById('wpTextbox1'); editbox.value = editbox.value.replace(/¶\n/g, '\n'); editbox.value = editbox.value.replace(/⋅/g, ' '); editbox.value = editbox.value.replace(/———→/g, '\t');

}

$(document).ready( easy_proofread );