Apply the supplied inquiry layout to the list and native write/detail dialogs while preserving existing API requests, author controls, attachments, comments and search. Keep legacy entry links and confirm before discarding drafts. Validation: 98 tests and syntax checks pass; mocked Chromium desktop/mobile and six author/session visibility scenarios pass.
9 lines
329 B
JavaScript
9 lines
329 B
JavaScript
(function () {
|
|
const url = new URL(window.location.href);
|
|
const view = url.pathname.endsWith('/write.html') ? 'write' : 'detail';
|
|
url.pathname = url.pathname.replace(/[^/]+$/, '');
|
|
url.searchParams.set('view', view);
|
|
if (view === 'write') url.searchParams.delete('id');
|
|
window.location.replace(url.toString());
|
|
})();
|