Manual:Force preview

Force preview is a javascript that prevents specified individuals or groups from saving a wiki page before they preview it at least once. The below scripts are based on Marc Mongenet's script, from.

Force preview by wgUserGroups, requires a MW version >= 1.10
function forcePreview { if (wgUserGroups == "user" || wgAction != "edit") return; saveButton = document.getElementById("wpSave"); if (!saveButton) return; saveButton.disabled = true; saveButton.value = "Save page (use preview first)"; saveButton.style.fontWeight = "normal"; document.getElementById("wpPreview").style.fontWeight = "bold"; } addOnloadHook(forcePreview);

Marc Mongenet's force preview, by wgUserName, requires a MW version > 1.6
/* Force preview for anons */ /* by Marc Mongenet, 2006, fr.wikipedia */ function forcePreview { if (wgUserName != null || wgAction != "edit") return; saveButton = document.getElementById("wpSave"); if (!saveButton) return; saveButton.disabled = true; saveButton.value = "Save page (use preview first)"; saveButton.style.fontWeight = "normal"; document.getElementById("wpPreview").style.fontWeight = "bold"; } addOnloadHook(forcePreview); /* Ende von forcePreview