diff --git a/htdocs/js/PGProblemEditor/pgproblemeditor.js b/htdocs/js/PGProblemEditor/pgproblemeditor.js index 328a23547f..a009cfc50d 100644 --- a/htdocs/js/PGProblemEditor/pgproblemeditor.js +++ b/htdocs/js/PGProblemEditor/pgproblemeditor.js @@ -344,51 +344,11 @@ } const actionView = document.getElementById('view'); - const editorForm = document.getElementById('editor'); - - // Make sure this is reset on each click so that a new window isn't always opened once that has been done once. - if (editorForm) editorForm.target = '_self'; if (actionView && actionView.classList.contains('active')) { - if (document.getElementById('newWindowView')?.checked) { - document.getElementById('revert-tab')?.classList.remove('disabled'); - document.getElementById('revert-to-tmp-container')?.classList.remove('d-none'); - const revertRadio = document.getElementById('action_revert_type_revert_id'); - if (revertRadio && revertRadio.disabled) { - revertRadio.disabled = false; - revertRadio.checked = true; - } - - // Add the temporary file coloring and change the current file to the saved file. - document.querySelectorAll('.set-file-info').forEach((nfo) => nfo.classList.add('temporaryFile')); - for (const currentFile of document.querySelectorAll('.current-file')) { - currentFile.textContent = currentFile.dataset.tmpFile; - } - - if (editorForm) editorForm.target = 'WW_View'; - } else { - e.preventDefault(); - await render(); - - saveTempFile(); - } - } - - const actionSave = document.getElementById('save'); - if ( - actionSave && - actionSave.classList.contains('active') && - document.getElementById('newWindowSave')?.checked && - editorForm - ) { - if (document.getElementById('backupFile')?.checked) { - document.getElementById('show-backups-comment')?.classList.remove('d-none'); - const deleteBackupCheck = document.getElementById('deleteBackup'); - if (deleteBackupCheck) deleteBackupCheck.disabled = false; - } - document.getElementById('revert-tab')?.classList.remove('disabled'); - - editorForm.target = 'WW_View'; + e.preventDefault(); + await render(); + saveTempFile(); } const actionHardcopy = document.getElementById('hardcopy'); @@ -671,7 +631,8 @@ if (fileType === 'hardcopy_header') { renderArea.innerHTML = '
<%= maketext('Render or re-render the problem, course info file, or set header being edited. This does not ' . 'change the permanent file on the disk. You can view different versions of the same problem by ' - . 'changing the seed. You can also change the manner in which the mathematics is typeset. If "Open ' - . 'in new window" is checked, then the problem will open in a new tab or window showing the ' - . 'problem as it will be rendered for students in the set.') =%> + . 'changing the seed. You can also change the manner in which the mathematics is typeset.') =%>
<%= maketext('This tab is available for all file types except hardcopy header files.') =%> @@ -205,12 +203,11 @@
<%= maketext('Save the contents of the editor window to the file on disk and re-render the problem. If ' - . '"Open in new window" is checked, then the problem will open in a new tab or window showing the ' - . 'problem as it will be rendered for students in the set. If "Create backup" is checked then a ' - . 'backup of the current file on disk will be created before overwriting it with the contents of ' - . 'the editor window. If a backup already exists, then a "Delete oldest backup" check box will be ' - . 'present. If that is checked, then the oldest backup will be deleted when "Save" is clicked. ' - . 'These backups can be reverted to and managed on the "Revert" tab.') =%> + . '"Create backup" is checked then a backup of the current file on disk will be created before ' + . 'overwriting it with the contents of the editor window. If a backup already exists, then a ' + . '"Delete oldest backup" check box will be present. If that is checked, then the oldest backup ' + . 'will be deleted when "Save" is clicked. These backups can be reverted to and managed on the ' + . '"Revert" tab.') =%>
<%= maketext('This tab is available for all files, but is only active for files in the course templates '