User:Steven2113/ForcePreviewLite.js

// ForcePreviewLite // // A modified version of http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Force_edit_summary_alternative // // NOTE: This is not a completed script, only a test of possible options for future addition. Implementation of this script would be done by combining the code of "function forceSummary" into "function forcePreview" at http://www.mediawiki.org/wiki/Manual:Force_preview // function addForceSummary {   if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return; if(/&section=new/.test(window.location.href)) return; if(!document.forms.editform) return; document.forms.editform.wpSave.onclick = forceSummary; } function forceSummary {       flashcolour(7); document.forms.editform.wpSave.onclick = ""; return false; } var flashcolour_timer; function flashcolour(count) { if (count%2 == 1) document.getElementById("wpPreview").style.fontWeight = "bold"; else document.getElementById("wpPreview").style.fontWeight = "normal";

if (flashcolour_timer != null) { clearTimeout(flashcolour_timer); flashcolour_timer = null; }   if (count > 0) flashcolour_timer = window.setTimeout("flashcolour(" + (count-1) + ")",350); } addOnloadHook(addForceSummary); // (end of script)