@fiduswriter/frontend 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +66 -0
- package/dist/admin_console/index.d.ts +8 -0
- package/dist/admin_console/index.d.ts.map +1 -0
- package/dist/admin_console/index.js +54 -0
- package/dist/admin_console/index.js.map +1 -0
- package/dist/api/index.d.ts +193 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -0
- package/dist/app/index.d.ts +74 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +471 -0
- package/dist/app/index.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/templates.d.ts +3 -0
- package/dist/common/templates.d.ts.map +1 -0
- package/dist/common/templates.js +42 -0
- package/dist/common/templates.js.map +1 -0
- package/dist/common/user_util.d.ts +6 -0
- package/dist/common/user_util.d.ts.map +1 -0
- package/dist/common/user_util.js +16 -0
- package/dist/common/user_util.js.map +1 -0
- package/dist/document_templates/actions.d.ts +11 -0
- package/dist/document_templates/actions.d.ts.map +1 -0
- package/dist/document_templates/actions.js +141 -0
- package/dist/document_templates/actions.js.map +1 -0
- package/dist/document_templates/editor.d.ts +28 -0
- package/dist/document_templates/editor.d.ts.map +1 -0
- package/dist/document_templates/editor.js +139 -0
- package/dist/document_templates/editor.js.map +1 -0
- package/dist/document_templates/index.d.ts +3 -0
- package/dist/document_templates/index.d.ts.map +1 -0
- package/dist/document_templates/index.js +3 -0
- package/dist/document_templates/index.js.map +1 -0
- package/dist/document_templates/menu.d.ts +7 -0
- package/dist/document_templates/menu.d.ts.map +1 -0
- package/dist/document_templates/menu.js +62 -0
- package/dist/document_templates/menu.js.map +1 -0
- package/dist/document_templates/overview.d.ts +52 -0
- package/dist/document_templates/overview.d.ts.map +1 -0
- package/dist/document_templates/overview.js +274 -0
- package/dist/document_templates/overview.js.map +1 -0
- package/dist/document_templates/templates.d.ts +3 -0
- package/dist/document_templates/templates.d.ts.map +1 -0
- package/dist/document_templates/templates.js +9 -0
- package/dist/document_templates/templates.js.map +1 -0
- package/dist/documents/importer/docx/import.d.ts +5 -0
- package/dist/documents/importer/docx/import.d.ts.map +1 -0
- package/dist/documents/importer/docx/import.js +15 -0
- package/dist/documents/importer/docx/import.js.map +1 -0
- package/dist/documents/importer/docx/index.d.ts +2 -0
- package/dist/documents/importer/docx/index.d.ts.map +1 -0
- package/dist/documents/importer/docx/index.js +2 -0
- package/dist/documents/importer/docx/index.js.map +1 -0
- package/dist/documents/importer/native/file.d.ts +7 -0
- package/dist/documents/importer/native/file.d.ts.map +1 -0
- package/dist/documents/importer/native/file.js +60 -0
- package/dist/documents/importer/native/file.js.map +1 -0
- package/dist/documents/importer/native/import.d.ts +41 -0
- package/dist/documents/importer/native/import.d.ts.map +1 -0
- package/dist/documents/importer/native/import.js +126 -0
- package/dist/documents/importer/native/import.js.map +1 -0
- package/dist/documents/importer/native/index.d.ts +3 -0
- package/dist/documents/importer/native/index.d.ts.map +1 -0
- package/dist/documents/importer/native/index.js +3 -0
- package/dist/documents/importer/native/index.js.map +1 -0
- package/dist/documents/importer/odt/import.d.ts +5 -0
- package/dist/documents/importer/odt/import.d.ts.map +1 -0
- package/dist/documents/importer/odt/import.js +16 -0
- package/dist/documents/importer/odt/import.js.map +1 -0
- package/dist/documents/importer/odt/index.d.ts +2 -0
- package/dist/documents/importer/odt/index.d.ts.map +1 -0
- package/dist/documents/importer/odt/index.js +2 -0
- package/dist/documents/importer/odt/index.js.map +1 -0
- package/dist/documents/importer/pandoc/import.d.ts +5 -0
- package/dist/documents/importer/pandoc/import.d.ts.map +1 -0
- package/dist/documents/importer/pandoc/import.js +37 -0
- package/dist/documents/importer/pandoc/import.js.map +1 -0
- package/dist/documents/importer/pandoc/index.d.ts +2 -0
- package/dist/documents/importer/pandoc/index.d.ts.map +1 -0
- package/dist/documents/importer/pandoc/index.js +2 -0
- package/dist/documents/importer/pandoc/index.js.map +1 -0
- package/dist/documents/importer/register.d.ts +4 -0
- package/dist/documents/importer/register.d.ts.map +1 -0
- package/dist/documents/importer/register.js +4 -0
- package/dist/documents/importer/register.js.map +1 -0
- package/dist/documents/overview/actions.d.ts +32 -0
- package/dist/documents/overview/actions.d.ts.map +1 -0
- package/dist/documents/overview/actions.js +725 -0
- package/dist/documents/overview/actions.js.map +1 -0
- package/dist/documents/overview/index.d.ts +98 -0
- package/dist/documents/overview/index.d.ts.map +1 -0
- package/dist/documents/overview/index.js +814 -0
- package/dist/documents/overview/index.js.map +1 -0
- package/dist/documents/overview/menu.d.ts +28 -0
- package/dist/documents/overview/menu.d.ts.map +1 -0
- package/dist/documents/overview/menu.js +222 -0
- package/dist/documents/overview/menu.js.map +1 -0
- package/dist/documents/overview/templates.d.ts +31 -0
- package/dist/documents/overview/templates.d.ts.map +1 -0
- package/dist/documents/overview/templates.js +39 -0
- package/dist/documents/overview/templates.js.map +1 -0
- package/dist/documents/revisions/index.d.ts +14 -0
- package/dist/documents/revisions/index.d.ts.map +1 -0
- package/dist/documents/revisions/index.js +143 -0
- package/dist/documents/revisions/index.js.map +1 -0
- package/dist/documents/revisions/templates.d.ts +4 -0
- package/dist/documents/revisions/templates.d.ts.map +1 -0
- package/dist/documents/revisions/templates.js +36 -0
- package/dist/documents/revisions/templates.js.map +1 -0
- package/dist/documents/tools.d.ts +16 -0
- package/dist/documents/tools.d.ts.map +1 -0
- package/dist/documents/tools.js +69 -0
- package/dist/documents/tools.js.map +1 -0
- package/dist/error_hook/index.d.ts +19 -0
- package/dist/error_hook/index.d.ts.map +1 -0
- package/dist/error_hook/index.js +75 -0
- package/dist/error_hook/index.js.map +1 -0
- package/dist/feedback/index.d.ts +12 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +125 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/indexed_db/index.d.ts +24 -0
- package/dist/indexed_db/index.d.ts.map +1 -0
- package/dist/indexed_db/index.js +175 -0
- package/dist/indexed_db/index.js.map +1 -0
- package/dist/maintenance/index.d.ts +19 -0
- package/dist/maintenance/index.d.ts.map +1 -0
- package/dist/maintenance/index.js +223 -0
- package/dist/maintenance/index.js.map +1 -0
- package/dist/menu/index.d.ts +25 -0
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/menu/index.js +229 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/menu/templates.d.ts +6 -0
- package/dist/menu/templates.d.ts.map +1 -0
- package/dist/menu/templates.js +10 -0
- package/dist/menu/templates.js.map +1 -0
- package/dist/pages/404.d.ts +9 -0
- package/dist/pages/404.d.ts.map +1 -0
- package/dist/pages/404.js +12 -0
- package/dist/pages/404.js.map +1 -0
- package/dist/pages/flatpage.d.ts +12 -0
- package/dist/pages/flatpage.d.ts.map +1 -0
- package/dist/pages/flatpage.js +39 -0
- package/dist/pages/flatpage.js.map +1 -0
- package/dist/pages/offline.d.ts +10 -0
- package/dist/pages/offline.d.ts.map +1 -0
- package/dist/pages/offline.js +27 -0
- package/dist/pages/offline.js.map +1 -0
- package/dist/pages/setup.d.ts +10 -0
- package/dist/pages/setup.d.ts.map +1 -0
- package/dist/pages/setup.js +22 -0
- package/dist/pages/setup.js.map +1 -0
- package/dist/plugins/menu/index.d.ts +3 -0
- package/dist/plugins/menu/index.d.ts.map +1 -0
- package/dist/plugins/menu/index.js +2 -0
- package/dist/plugins/menu/index.js.map +1 -0
- package/dist/prelogin/index.d.ts +51 -0
- package/dist/prelogin/index.d.ts.map +1 -0
- package/dist/prelogin/index.js +131 -0
- package/dist/prelogin/index.js.map +1 -0
- package/dist/prelogin/templates.d.ts +20 -0
- package/dist/prelogin/templates.d.ts.map +1 -0
- package/dist/prelogin/templates.js +50 -0
- package/dist/prelogin/templates.js.map +1 -0
- package/dist/state_plugins/contributor_input/add_button.d.ts +22 -0
- package/dist/state_plugins/contributor_input/add_button.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/add_button.js +106 -0
- package/dist/state_plugins/contributor_input/add_button.js.map +1 -0
- package/dist/state_plugins/contributor_input/helpers.d.ts +3 -0
- package/dist/state_plugins/contributor_input/helpers.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/helpers.js +23 -0
- package/dist/state_plugins/contributor_input/helpers.js.map +1 -0
- package/dist/state_plugins/contributor_input/index.d.ts +4 -0
- package/dist/state_plugins/contributor_input/index.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/index.js +4 -0
- package/dist/state_plugins/contributor_input/index.js.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.d.ts +20 -0
- package/dist/state_plugins/contributor_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.js +85 -0
- package/dist/state_plugins/contributor_input/node_view.js.map +1 -0
- package/dist/state_plugins/index.d.ts +3 -0
- package/dist/state_plugins/index.d.ts.map +1 -0
- package/dist/state_plugins/index.js +3 -0
- package/dist/state_plugins/index.js.map +1 -0
- package/dist/state_plugins/tag_input/helpers.d.ts +5 -0
- package/dist/state_plugins/tag_input/helpers.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/helpers.js +55 -0
- package/dist/state_plugins/tag_input/helpers.js.map +1 -0
- package/dist/state_plugins/tag_input/index.d.ts +5 -0
- package/dist/state_plugins/tag_input/index.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/index.js +5 -0
- package/dist/state_plugins/tag_input/index.js.map +1 -0
- package/dist/state_plugins/tag_input/node_view.d.ts +19 -0
- package/dist/state_plugins/tag_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/node_view.js +85 -0
- package/dist/state_plugins/tag_input/node_view.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor.d.ts +4 -0
- package/dist/state_plugins/tag_input/tag_editor.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor.js +160 -0
- package/dist/state_plugins/tag_input/tag_editor.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.d.ts +5 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js +64 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js.map +1 -0
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/user/auth/email_confirm.d.ts +23 -0
- package/dist/user/auth/email_confirm.d.ts.map +1 -0
- package/dist/user/auth/email_confirm.js +123 -0
- package/dist/user/auth/email_confirm.js.map +1 -0
- package/dist/user/auth/email_confirm_templates.d.ts +12 -0
- package/dist/user/auth/email_confirm_templates.d.ts.map +1 -0
- package/dist/user/auth/email_confirm_templates.js +30 -0
- package/dist/user/auth/email_confirm_templates.js.map +1 -0
- package/dist/user/auth/login.d.ts +13 -0
- package/dist/user/auth/login.d.ts.map +1 -0
- package/dist/user/auth/login.js +186 -0
- package/dist/user/auth/login.js.map +1 -0
- package/dist/user/auth/password_reset_change.d.ts +11 -0
- package/dist/user/auth/password_reset_change.d.ts.map +1 -0
- package/dist/user/auth/password_reset_change.js +101 -0
- package/dist/user/auth/password_reset_change.js.map +1 -0
- package/dist/user/auth/password_reset_request.d.ts +10 -0
- package/dist/user/auth/password_reset_request.d.ts.map +1 -0
- package/dist/user/auth/password_reset_request.js +82 -0
- package/dist/user/auth/password_reset_request.js.map +1 -0
- package/dist/user/auth/signup.d.ts +9 -0
- package/dist/user/auth/signup.d.ts.map +1 -0
- package/dist/user/auth/signup.js +148 -0
- package/dist/user/auth/signup.js.map +1 -0
- package/dist/user/auth/two_factor.d.ts +10 -0
- package/dist/user/auth/two_factor.d.ts.map +1 -0
- package/dist/user/auth/two_factor.js +201 -0
- package/dist/user/auth/two_factor.js.map +1 -0
- package/dist/user/contacts/add_dialog.d.ts +7 -0
- package/dist/user/contacts/add_dialog.d.ts.map +1 -0
- package/dist/user/contacts/add_dialog.js +84 -0
- package/dist/user/contacts/add_dialog.js.map +1 -0
- package/dist/user/contacts/delete_dialog.d.ts +6 -0
- package/dist/user/contacts/delete_dialog.d.ts.map +1 -0
- package/dist/user/contacts/delete_dialog.js +38 -0
- package/dist/user/contacts/delete_dialog.js.map +1 -0
- package/dist/user/contacts/index.d.ts +35 -0
- package/dist/user/contacts/index.d.ts.map +1 -0
- package/dist/user/contacts/index.js +234 -0
- package/dist/user/contacts/index.js.map +1 -0
- package/dist/user/contacts/invite.d.ts +9 -0
- package/dist/user/contacts/invite.d.ts.map +1 -0
- package/dist/user/contacts/invite.js +21 -0
- package/dist/user/contacts/invite.js.map +1 -0
- package/dist/user/contacts/menu.d.ts +7 -0
- package/dist/user/contacts/menu.d.ts.map +1 -0
- package/dist/user/contacts/menu.js +62 -0
- package/dist/user/contacts/menu.js.map +1 -0
- package/dist/user/contacts/respond_invite.d.ts +9 -0
- package/dist/user/contacts/respond_invite.d.ts.map +1 -0
- package/dist/user/contacts/respond_invite.js +65 -0
- package/dist/user/contacts/respond_invite.js.map +1 -0
- package/dist/user/contacts/templates.d.ts +7 -0
- package/dist/user/contacts/templates.d.ts.map +1 -0
- package/dist/user/contacts/templates.js +24 -0
- package/dist/user/contacts/templates.js.map +1 -0
- package/dist/user/profile/delete_user.d.ts +8 -0
- package/dist/user/profile/delete_user.d.ts.map +1 -0
- package/dist/user/profile/delete_user.js +56 -0
- package/dist/user/profile/delete_user.js.map +1 -0
- package/dist/user/profile/dialogs.d.ts +10 -0
- package/dist/user/profile/dialogs.d.ts.map +1 -0
- package/dist/user/profile/dialogs.js +311 -0
- package/dist/user/profile/dialogs.js.map +1 -0
- package/dist/user/profile/index.d.ts +27 -0
- package/dist/user/profile/index.d.ts.map +1 -0
- package/dist/user/profile/index.js +254 -0
- package/dist/user/profile/index.js.map +1 -0
- package/dist/user/profile/templates.d.ts +22 -0
- package/dist/user/profile/templates.d.ts.map +1 -0
- package/dist/user/profile/templates.js +261 -0
- package/dist/user/profile/templates.js.map +1 -0
- package/dist/workers/adjust_doc_to_template.d.ts +11 -0
- package/dist/workers/adjust_doc_to_template.d.ts.map +1 -0
- package/dist/workers/adjust_doc_to_template.js +26 -0
- package/dist/workers/adjust_doc_to_template.js.map +1 -0
- package/package.json +225 -0
- package/src/admin_console/index.ts +84 -0
- package/src/api/index.ts +149 -0
- package/src/app/index.ts +605 -0
- package/src/common/index.ts +2 -0
- package/src/common/templates.ts +49 -0
- package/src/common/user_util.ts +16 -0
- package/src/document_templates/actions.ts +179 -0
- package/src/document_templates/editor.ts +177 -0
- package/src/document_templates/index.ts +2 -0
- package/src/document_templates/menu.ts +74 -0
- package/src/document_templates/overview.ts +335 -0
- package/src/document_templates/templates.ts +9 -0
- package/src/documents/importer/docx/import.ts +25 -0
- package/src/documents/importer/docx/index.ts +1 -0
- package/src/documents/importer/native/file.ts +112 -0
- package/src/documents/importer/native/import.ts +219 -0
- package/src/documents/importer/native/index.ts +2 -0
- package/src/documents/importer/odt/import.ts +26 -0
- package/src/documents/importer/odt/index.ts +1 -0
- package/src/documents/importer/pandoc/import.ts +57 -0
- package/src/documents/importer/pandoc/index.ts +1 -0
- package/src/documents/importer/register.ts +8 -0
- package/src/documents/overview/actions.ts +1031 -0
- package/src/documents/overview/index.ts +1006 -0
- package/src/documents/overview/menu.ts +311 -0
- package/src/documents/overview/templates.ts +64 -0
- package/src/documents/revisions/index.ts +183 -0
- package/src/documents/revisions/templates.ts +42 -0
- package/src/documents/tools.ts +107 -0
- package/src/error_hook/index.ts +129 -0
- package/src/feedback/index.ts +185 -0
- package/src/global.d.ts +22 -0
- package/src/index.ts +95 -0
- package/src/indexed_db/index.ts +217 -0
- package/src/maintenance/index.ts +258 -0
- package/src/menu/index.ts +267 -0
- package/src/menu/templates.ts +21 -0
- package/src/pages/404.ts +13 -0
- package/src/pages/flatpage.ts +43 -0
- package/src/pages/offline.ts +39 -0
- package/src/pages/setup.ts +34 -0
- package/src/plugins/menu/index.ts +3 -0
- package/src/prelogin/index.ts +175 -0
- package/src/prelogin/templates.ts +86 -0
- package/src/types.ts +63 -0
- package/src/user/auth/email_confirm.ts +153 -0
- package/src/user/auth/email_confirm_templates.ts +76 -0
- package/src/user/auth/login.ts +221 -0
- package/src/user/auth/password_reset_change.ts +120 -0
- package/src/user/auth/password_reset_request.ts +107 -0
- package/src/user/auth/signup.ts +182 -0
- package/src/user/auth/two_factor.ts +244 -0
- package/src/user/contacts/add_dialog.ts +104 -0
- package/src/user/contacts/delete_dialog.ts +40 -0
- package/src/user/contacts/index.ts +289 -0
- package/src/user/contacts/invite.ts +24 -0
- package/src/user/contacts/menu.ts +70 -0
- package/src/user/contacts/respond_invite.ts +76 -0
- package/src/user/contacts/templates.ts +29 -0
- package/src/user/profile/delete_user.ts +71 -0
- package/src/user/profile/dialogs.ts +363 -0
- package/src/user/profile/index.ts +359 -0
- package/src/user/profile/templates.ts +299 -0
- package/src/workers/adjust_doc_to_template.ts +41 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { avatarTemplate, escapeText, langName } from "fwtoolkit";
|
|
2
|
+
/** A template to confirm the deletion of a user avatar. */
|
|
3
|
+
export const confirmDeleteAvatarTemplate = () => `<p>${gettext("Delete the avatar?")}</p>`;
|
|
4
|
+
/** A template to change the user avatar. */
|
|
5
|
+
export const changeAvatarDialogTemplate = () => `<span id="upload-avatar-btn" class="fw-button fw-light fw-large">
|
|
6
|
+
${gettext("Select a file")}
|
|
7
|
+
</span>
|
|
8
|
+
<label id="uploaded-avatar-name" class="ajax-upload-label"></label>`;
|
|
9
|
+
/** A template for the confirmation dialog to delete a user account. */
|
|
10
|
+
export const deleteUserDialogTemplate = () => `<h3>
|
|
11
|
+
${gettext("NOTICE: ALL OF YOUR INFORMATION WILL DISAPPEAR FROM OUR SYSTEM!")}
|
|
12
|
+
</h3>
|
|
13
|
+
<p>
|
|
14
|
+
${gettext("Really delete your account? Type in your username and password below to confirm deletion.")}
|
|
15
|
+
</p>
|
|
16
|
+
<p>
|
|
17
|
+
${gettext("We cannot reverse an account deletion.")}
|
|
18
|
+
</p>
|
|
19
|
+
<p>
|
|
20
|
+
${gettext("Some copies of your files may temporarily be kept in our backup system, but also these will disappear automatically in due time.")}
|
|
21
|
+
</p>
|
|
22
|
+
<form>
|
|
23
|
+
<input type="text" id="username-confirmation" placeholder="${gettext("Username")}">
|
|
24
|
+
<input type="password" id="password" autocomplete="new-password" placeholder="${gettext("Password")}">
|
|
25
|
+
</form>`;
|
|
26
|
+
/** A template for the change email dialog of the user account. */
|
|
27
|
+
export const changeEmailDialogTemplate = () => `<table class="ui-dialog-content-table"><tbody>
|
|
28
|
+
<tr><td>
|
|
29
|
+
<form id="fw-add-email-form" action="" method="post" onsubmit="return false;">
|
|
30
|
+
<input type="text" name="email" id="new-profile-email"
|
|
31
|
+
class="fw-profile-dialog-input"
|
|
32
|
+
placeholder="${gettext("Enter the new E-mail address")}" />
|
|
33
|
+
</form>
|
|
34
|
+
</td></tr>
|
|
35
|
+
<tr><td><span id="fw-add-email-error" class="fw-warning"></span></td></tr>
|
|
36
|
+
</tbody></table>`;
|
|
37
|
+
/** A template for the delete email dialog of the user account. */
|
|
38
|
+
export const deleteEmailDialogTemplate = ({ text }) => `<p>${escapeText(text)}</p>`;
|
|
39
|
+
/** A template for the change primary email dialog of the user account. */
|
|
40
|
+
export const changePrimaryEmailDialogTemplate = ({ text }) => `<p>${escapeText(text)}</p>`;
|
|
41
|
+
/** A template for the change password dialog of the user account. */
|
|
42
|
+
export const changePwdDialogTemplate = ({ username }) => `<table class="ui-dialog-content-table"><tbody>
|
|
43
|
+
<tr><td><form id="fw-password-change-form" action="" method="post"
|
|
44
|
+
onsubmit="return false;">
|
|
45
|
+
<input type="text" id="current-username" autocomplete="username" value="${escapeText(username)}" style="display: none;">
|
|
46
|
+
<input type="password" id="old-password-input" name="old_password" autocomplete="current-password"
|
|
47
|
+
class="fw-profile-dialog-input" placeholder="${gettext("Old password")}" /><br />
|
|
48
|
+
<input type="password" id="new-password-input1" name="new_password1" autocomplete="new-password"
|
|
49
|
+
class="fw-profile-dialog-input" placeholder="${gettext("New password")}" /><br />
|
|
50
|
+
<input type="password" id="new-password-input2" name="new_password2" autocomplete="new-password"
|
|
51
|
+
class="fw-profile-dialog-input"
|
|
52
|
+
placeholder="${gettext("Confirm the new password")}" />
|
|
53
|
+
</form></td></tr>
|
|
54
|
+
<tr><td><span id="fw-password-change-error" class="fw-warning"></span></td></tr>
|
|
55
|
+
</tbody></table>`;
|
|
56
|
+
export const profileContents = (user, socialaccount_providers, settings = {}, pluginTemplates = []) => `<div id="profile-wrapper" class="fw-clearfix fw-dialog ui-dialog-fullpage">
|
|
57
|
+
<div id="profile-avatar">
|
|
58
|
+
${avatarTemplate({ user })}
|
|
59
|
+
<div id="avatar-pulldown-wrapper">
|
|
60
|
+
<span id="edit-avatar-btn" class="fw-link-text">
|
|
61
|
+
${gettext("Edit profile picture")}
|
|
62
|
+
</span>
|
|
63
|
+
<select id="edit-avatar-pulldown">
|
|
64
|
+
<option value="change">${gettext("Change picture")}</option>
|
|
65
|
+
${user.avatar ? `<option value="delete">${gettext("Delete picture")}</option>` : ""}
|
|
66
|
+
</select>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div id="profile-data">
|
|
70
|
+
<form>
|
|
71
|
+
<div class="profile-data-row">
|
|
72
|
+
<label class="form-label">${gettext("Username")}</label>
|
|
73
|
+
<input type="text" name="username" id="username" autocomplete="username" value="${escapeText(user.username)}" />
|
|
74
|
+
</div>
|
|
75
|
+
<div class="profile-data-row">
|
|
76
|
+
<label class="form-label">${gettext("First name")}</label>
|
|
77
|
+
<input type="text" name="firstname" id="first_name" autocomplete="given-name" value="${escapeText(user.first_name)}" />
|
|
78
|
+
</div>
|
|
79
|
+
<div class="profile-data-row">
|
|
80
|
+
<label class="form-label">${gettext("Last name")}</label>
|
|
81
|
+
<input type="text" name="lastname" id="last_name" autocomplete="family-name" value="${escapeText(user.last_name)}" />
|
|
82
|
+
</div>
|
|
83
|
+
<div class="profile-data-row">
|
|
84
|
+
<label class="form-label">${gettext("Password")}</label>
|
|
85
|
+
<input type="password" value="******" autocomplete="new-password" readonly disabled />
|
|
86
|
+
<span id="fw-edit-profile-pwd" class="fw-link-text"><i class="fa fa-pencil-alt"></i></span>
|
|
87
|
+
</div>
|
|
88
|
+
</form>
|
|
89
|
+
${settings.TWO_FACTOR_ENABLED
|
|
90
|
+
? `<div class="profile-data-row">
|
|
91
|
+
<label class="form-label">${gettext("Two-Factor Authentication")}</label>
|
|
92
|
+
<div id="two-factor-status">
|
|
93
|
+
<span id="two-factor-enabled-status" style="display: none;">
|
|
94
|
+
<i class="fa fa-check"></i>
|
|
95
|
+
${gettext("Enabled")}
|
|
96
|
+
</span>
|
|
97
|
+
<span id="two-factor-disabled-status" style="display: none;">
|
|
98
|
+
<i class="fa fa-times"></i>
|
|
99
|
+
${gettext("Disabled")}
|
|
100
|
+
</span>
|
|
101
|
+
</div>
|
|
102
|
+
<span id="setup-two-factor" class="fw-link-text" style="display: none;">
|
|
103
|
+
<i class="fa fa-shield-alt"></i>
|
|
104
|
+
${gettext("Enable 2FA")}
|
|
105
|
+
</span>
|
|
106
|
+
<span id="disable-two-factor" class="fw-link-text" style="display: none;">
|
|
107
|
+
<i class="fa fa-shield-alt"></i>
|
|
108
|
+
${gettext("Disable 2FA")}
|
|
109
|
+
</span>
|
|
110
|
+
</div>`
|
|
111
|
+
: ""}
|
|
112
|
+
${settings.E2EE_MODE && settings.E2EE_MODE !== "disabled"
|
|
113
|
+
? `<div class="profile-data-row">
|
|
114
|
+
<label class="form-label">${gettext("End-to-End Encryption")}</label>
|
|
115
|
+
<div id="e2ee-passphrase-status">
|
|
116
|
+
<span id="e2ee-passphrase-enabled-status" style="display: none;">
|
|
117
|
+
<i class="fa fa-check"></i>
|
|
118
|
+
${gettext("Personal passphrase set up")}
|
|
119
|
+
</span>
|
|
120
|
+
<span id="e2ee-passphrase-disabled-status" style="display: none;">
|
|
121
|
+
<i class="fa fa-times"></i>
|
|
122
|
+
${gettext("Not set up")}
|
|
123
|
+
</span>
|
|
124
|
+
</div>
|
|
125
|
+
<span id="setup-e2ee-passphrase" class="fw-link-text" style="display: none;">
|
|
126
|
+
<i class="fa fa-lock"></i>
|
|
127
|
+
${gettext("Set up encryption passphrase")}
|
|
128
|
+
</span>
|
|
129
|
+
<span id="change-e2ee-passphrase" class="fw-link-text" style="display: none;">
|
|
130
|
+
<i class="fa fa-pencil-alt"></i>
|
|
131
|
+
${gettext("Change passphrase")}
|
|
132
|
+
</span>
|
|
133
|
+
<span id="recover-e2ee-passphrase" class="fw-link-text" style="display: none;">
|
|
134
|
+
<i class="fa fa-key"></i>
|
|
135
|
+
${gettext("Recover with recovery key")}
|
|
136
|
+
</span>
|
|
137
|
+
</div>`
|
|
138
|
+
: ""}
|
|
139
|
+
<div class="profile-data-row">
|
|
140
|
+
<table class="fw-data-table profile-email-table">
|
|
141
|
+
<thead class="fw-data-table-header">
|
|
142
|
+
<tr>
|
|
143
|
+
<th>${gettext("Email")}</th>
|
|
144
|
+
<th>${gettext("Primary address")}</th>
|
|
145
|
+
<th>${gettext("Verified")}</th>
|
|
146
|
+
<th> </th>
|
|
147
|
+
</tr>
|
|
148
|
+
</thead>
|
|
149
|
+
<tbody>
|
|
150
|
+
${user.emails
|
|
151
|
+
.map((email) => `<tr${email.primary ? ' class="primary-email-tr"' : ""}>
|
|
152
|
+
<td class="emailaddress">${email.address}</td>
|
|
153
|
+
<td>
|
|
154
|
+
${email.verified
|
|
155
|
+
? `<input type="radio" class="primary-email-radio" value="${email.address}"
|
|
156
|
+
name="primaryemail"${email.primary ? " checked" : ""} />`
|
|
157
|
+
: ""}
|
|
158
|
+
</td>
|
|
159
|
+
<td>
|
|
160
|
+
${email.verified ? '<i class="fa fa-check"></i>' : ""}
|
|
161
|
+
</td>
|
|
162
|
+
<td class="profile-email-action">
|
|
163
|
+
${email.primary
|
|
164
|
+
? " "
|
|
165
|
+
: `<span class="delete-email fw-link-text" data-email="${email.address}">` +
|
|
166
|
+
'<i class="fa fa-trash-alt"></i>' +
|
|
167
|
+
"</span>"}
|
|
168
|
+
</td>
|
|
169
|
+
</tr>`)
|
|
170
|
+
.join("")}
|
|
171
|
+
<tr>
|
|
172
|
+
<td colspan="3"></td>
|
|
173
|
+
<td class="profile-email-action">
|
|
174
|
+
<span class="fw-link-text" id="add-profile-email">
|
|
175
|
+
<i class="fa fa-plus-circle"></i>
|
|
176
|
+
</span>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</tbody>
|
|
180
|
+
</table>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="profile-data-row">
|
|
183
|
+
<label class="form-label">${gettext("Language")}</label>
|
|
184
|
+
<select name="language" id="language" class="entry-form dk fw-button fw-large">
|
|
185
|
+
<option value="">${gettext("Default language")}</option>
|
|
186
|
+
${(settings.LANGUAGES || [])
|
|
187
|
+
.map(([code, _name]) => `<option value="${code}" ${user.language === code ? "selected" : ""}>${langName(code)}</option>`)
|
|
188
|
+
.join("")}
|
|
189
|
+
</select>
|
|
190
|
+
<div class="fw-select-arrow fa fa-caret-down"></div>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="profile-data-row">
|
|
193
|
+
<label class="form-label">${gettext("Editor")}</label>
|
|
194
|
+
<div class="profile-editor-settings">
|
|
195
|
+
<label class="checkable-label">
|
|
196
|
+
<input type="checkbox" id="inline-references" ${user.preferences?.inline_references ? "checked" : ""} />
|
|
197
|
+
${gettext("Enable inline reference typing (@)")}
|
|
198
|
+
</label>
|
|
199
|
+
<p class="inline-editor-hint">${gettext("Type @ in the editor to insert a citation or cross-reference:")}</p>
|
|
200
|
+
<ul class="inline-editor-hint">
|
|
201
|
+
<li>${gettext("Citation: @entry_key – optional suffix: @entry_key[prefix][locator]. Textual citation: @@entry_key. Multiple sources: @key1;key2")}</li>
|
|
202
|
+
<li>${gettext("Cross-reference: @#target-id")}</li>
|
|
203
|
+
</ul>
|
|
204
|
+
<label class="checkable-label">
|
|
205
|
+
<input type="checkbox" id="inline-math" ${user.preferences?.inline_math ? "checked" : ""} />
|
|
206
|
+
${gettext("Enable inline math typing ($)")}
|
|
207
|
+
</label>
|
|
208
|
+
<p class="inline-editor-hint">${gettext("Type $ in the editor followed by LaTeX math to insert an equation inline, e.g. $x^2. Press Enter or Tab to confirm.")}</p>
|
|
209
|
+
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
${socialaccount_providers.length
|
|
213
|
+
? `<div class="profile-data-row">
|
|
214
|
+
<table class="fw-data-table profile-social-accounts-table">
|
|
215
|
+
<thead class="fw-data-table-header">
|
|
216
|
+
<tr>
|
|
217
|
+
<th>${gettext("Social Account Provider")}</th>
|
|
218
|
+
<th>${gettext("Username")}</th>
|
|
219
|
+
<th> </th>
|
|
220
|
+
</tr>
|
|
221
|
+
</thead>
|
|
222
|
+
<tbody>
|
|
223
|
+
${socialaccount_providers
|
|
224
|
+
.map((provider) => {
|
|
225
|
+
const account = user.socialaccounts.find((saccount) => saccount.provider ===
|
|
226
|
+
provider.id);
|
|
227
|
+
if (account) {
|
|
228
|
+
return `<tr>
|
|
229
|
+
<td>${escapeText(provider.name)}</td>
|
|
230
|
+
<td>${escapeText(account.name)}</td>
|
|
231
|
+
<td>
|
|
232
|
+
<span class="delete-socialaccount fw-link-text" data-socialaccount="${account.id}" data-provider="${escapeText(provider.name)}">
|
|
233
|
+
<i class="fa fa-trash-alt"></i>
|
|
234
|
+
</span>
|
|
235
|
+
</td>
|
|
236
|
+
</tr>`;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
return `<tr>
|
|
240
|
+
<td>${escapeText(provider.name)}</td>
|
|
241
|
+
<td> </td>
|
|
242
|
+
<td><a href="${provider.login_url}?process=connect">${gettext("Connect")}</a></td>
|
|
243
|
+
</tr>`;
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
.join("")}
|
|
247
|
+
</tbody>
|
|
248
|
+
</table>
|
|
249
|
+
</div>`
|
|
250
|
+
: ""}
|
|
251
|
+
${pluginTemplates.join("")}
|
|
252
|
+
<div id="profile-submit-wrapper">
|
|
253
|
+
<span id="submit-profile" class="fw-button fw-dark">
|
|
254
|
+
${gettext("Submit")}
|
|
255
|
+
</span>
|
|
256
|
+
<span id="delete-account" data-username="${user.username}" class="fw-button fw-orange">
|
|
257
|
+
${gettext("Delete account")}
|
|
258
|
+
</span>
|
|
259
|
+
</div>
|
|
260
|
+
</div>`;
|
|
261
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/user/profile/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAA;AAE9D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAW,EAAE,CACpD,MAAM,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAA;AAE7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAW,EAAE,CACnD;UACM,OAAO,CAAC,eAAe,CAAC;;wEAEsC,CAAA;AAExE,uEAAuE;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAW,EAAE,CACjD;UACM,OAAO,CAAC,iEAAiE,CAAC;;;UAG1E,OAAO,CAAC,2FAA2F,CAAC;;;UAGpG,OAAO,CAAC,wCAAwC,CAAC;;;UAGjD,OAAO,CAAC,kIAAkI,CAAC;;;qEAGhF,OAAO,CAAC,UAAU,CAAC;wFACA,OAAO,CAAC,UAAU,CAAC;YAC/F,CAAA;AAEZ,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAW,EAAE,CAClD;;;;;uCAKmC,OAAO,CAAC,8BAA8B,CAAC;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;0DACzB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC;;8HAE4C,OAAO,CAAC,EAAE,oBAAoB,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;;;;sDAI/H,CAAA;QACd,CAAC;aAAM,CAAC;YACJ,OAAO;0DACO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;;mEAEhB,QAAQ,CAAC,SAAS,qBAAqB,OAAO,CAAC,SAAS,CAAC;sDACtE,CAAA;QACd,CAAC;IACL,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC;;;2BAGlB;IACP,CAAC,CAAC,EACV;cACE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;;;sBAGhB,OAAO,CAAC,QAAQ,CAAC;;2DAEoB,IAAI,CAAC,QAAQ;sBAClD,OAAO,CAAC,gBAAgB,CAAC;;;WAGpC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
export declare class AdjustDocToTemplateWorker {
|
|
3
|
+
schema: Schema;
|
|
4
|
+
doc: Record<string, unknown>;
|
|
5
|
+
template: Record<string, unknown>;
|
|
6
|
+
documentStyleSlugs: string[];
|
|
7
|
+
sendMessage: (message: Record<string, unknown>) => void;
|
|
8
|
+
constructor(schemaSpec: Record<string, unknown>, doc: Record<string, unknown>, template: Record<string, unknown>, documentStyleSlugs: string[], sendMessage: (message: Record<string, unknown>) => void);
|
|
9
|
+
init(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=adjust_doc_to_template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjust_doc_to_template.d.ts","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,qBAAa,yBAAyB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;gBAGnD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI;IAS3D,IAAI,IAAI,IAAI;CAef"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { recreateTransform } from "@fiduswriter/editor/collab/merge/recreate_transform";
|
|
2
|
+
import { adjustDocToTemplate } from "@fiduswriter/document-template-editor/fix_doc";
|
|
3
|
+
import { Schema } from "prosemirror-model";
|
|
4
|
+
export class AdjustDocToTemplateWorker {
|
|
5
|
+
schema;
|
|
6
|
+
doc;
|
|
7
|
+
template;
|
|
8
|
+
documentStyleSlugs;
|
|
9
|
+
sendMessage;
|
|
10
|
+
constructor(schemaSpec, doc, template, documentStyleSlugs, sendMessage) {
|
|
11
|
+
this.schema = new Schema(schemaSpec);
|
|
12
|
+
this.doc = doc;
|
|
13
|
+
this.template = template;
|
|
14
|
+
this.documentStyleSlugs = documentStyleSlugs;
|
|
15
|
+
this.sendMessage = sendMessage;
|
|
16
|
+
}
|
|
17
|
+
init() {
|
|
18
|
+
const stateDoc = this.schema.nodeFromJSON(this.doc);
|
|
19
|
+
const newStateDoc = this.schema.nodeFromJSON(adjustDocToTemplate(this.doc, this.template, this.documentStyleSlugs, this.schema));
|
|
20
|
+
const transform = recreateTransform(stateDoc, newStateDoc);
|
|
21
|
+
const steps = [];
|
|
22
|
+
transform.steps.forEach((step) => steps.push(step.toJSON()));
|
|
23
|
+
this.sendMessage({ type: "result", steps });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=adjust_doc_to_template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjust_doc_to_template.js","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAA;AACrF,OAAO,EAAC,mBAAmB,EAAC,MAAM,+CAA+C,CAAA;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,MAAM,OAAO,yBAAyB;IAClC,MAAM,CAAQ;IACd,GAAG,CAAyB;IAC5B,QAAQ,CAAyB;IACjC,kBAAkB,CAAU;IAC5B,WAAW,CAA4C;IAEvD,YACI,UAAmC,EACnC,GAA4B,EAC5B,QAAiC,EACjC,kBAA4B,EAC5B,WAAuD;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,UAAiB,CAAC,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAClC,CAAC;IAED,IAAI;QACA,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CACxC,mBAAmB,CACf,IAAI,CAAC,GAAU,EACf,IAAI,CAAC,QAAe,EACpB,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,MAAM,CACd,CACJ,CAAA;QACD,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;QAC1D,MAAM,KAAK,GAAmC,EAAE,CAAA;QAChD,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACjE,IAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAA;IAC7C,CAAC;CACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fiduswriter/frontend",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Fidus Writer-specific shared utilities and UI chrome",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "ssh://git@codeberg.org/fiduswriter/fiduswriter-common-js.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "AGPL-3.0",
|
|
10
|
+
"author": "Johannes Wilm",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./common": {
|
|
20
|
+
"types": "./dist/common/index.d.ts",
|
|
21
|
+
"default": "./dist/common/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./feedback": {
|
|
24
|
+
"types": "./dist/feedback/index.d.ts",
|
|
25
|
+
"default": "./dist/feedback/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./menu": {
|
|
28
|
+
"types": "./dist/menu/index.d.ts",
|
|
29
|
+
"default": "./dist/menu/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./indexed_db": {
|
|
32
|
+
"types": "./dist/indexed_db/index.d.ts",
|
|
33
|
+
"default": "./dist/indexed_db/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./prelogin": {
|
|
36
|
+
"types": "./dist/prelogin/index.d.ts",
|
|
37
|
+
"default": "./dist/prelogin/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./prelogin/templates": {
|
|
40
|
+
"types": "./dist/prelogin/templates.d.ts",
|
|
41
|
+
"default": "./dist/prelogin/templates.js"
|
|
42
|
+
},
|
|
43
|
+
"./pages/404": {
|
|
44
|
+
"types": "./dist/pages/404.d.ts",
|
|
45
|
+
"default": "./dist/pages/404.js"
|
|
46
|
+
},
|
|
47
|
+
"./pages/offline": {
|
|
48
|
+
"types": "./dist/pages/offline.d.ts",
|
|
49
|
+
"default": "./dist/pages/offline.js"
|
|
50
|
+
},
|
|
51
|
+
"./pages/setup": {
|
|
52
|
+
"types": "./dist/pages/setup.d.ts",
|
|
53
|
+
"default": "./dist/pages/setup.js"
|
|
54
|
+
},
|
|
55
|
+
"./pages/flatpage": {
|
|
56
|
+
"types": "./dist/pages/flatpage.d.ts",
|
|
57
|
+
"default": "./dist/pages/flatpage.js"
|
|
58
|
+
},
|
|
59
|
+
"./admin_console": {
|
|
60
|
+
"types": "./dist/admin_console/index.d.ts",
|
|
61
|
+
"default": "./dist/admin_console/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./error_hook": {
|
|
64
|
+
"types": "./dist/error_hook/index.d.ts",
|
|
65
|
+
"default": "./dist/error_hook/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./documents/overview": {
|
|
68
|
+
"types": "./dist/documents/overview/index.d.ts",
|
|
69
|
+
"default": "./dist/documents/overview/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./documents/tools": {
|
|
72
|
+
"types": "./dist/documents/tools.d.ts",
|
|
73
|
+
"default": "./dist/documents/tools.js"
|
|
74
|
+
},
|
|
75
|
+
"./documents/importer/register": {
|
|
76
|
+
"types": "./dist/documents/importer/register.d.ts",
|
|
77
|
+
"default": "./dist/documents/importer/register.js"
|
|
78
|
+
},
|
|
79
|
+
"./documents/importer/native": {
|
|
80
|
+
"types": "./dist/documents/importer/native/index.d.ts",
|
|
81
|
+
"default": "./dist/documents/importer/native/index.js"
|
|
82
|
+
},
|
|
83
|
+
"./documents/importer/native/import": {
|
|
84
|
+
"types": "./dist/documents/importer/native/import.d.ts",
|
|
85
|
+
"default": "./dist/documents/importer/native/import.js"
|
|
86
|
+
},
|
|
87
|
+
"./documents/importer/native/file": {
|
|
88
|
+
"types": "./dist/documents/importer/native/file.d.ts",
|
|
89
|
+
"default": "./dist/documents/importer/native/file.js"
|
|
90
|
+
},
|
|
91
|
+
"./documents/importer/docx": {
|
|
92
|
+
"types": "./dist/documents/importer/docx/index.d.ts",
|
|
93
|
+
"default": "./dist/documents/importer/docx/index.js"
|
|
94
|
+
},
|
|
95
|
+
"./documents/importer/odt": {
|
|
96
|
+
"types": "./dist/documents/importer/odt/index.d.ts",
|
|
97
|
+
"default": "./dist/documents/importer/odt/index.js"
|
|
98
|
+
},
|
|
99
|
+
"./documents/importer/pandoc": {
|
|
100
|
+
"types": "./dist/documents/importer/pandoc/index.d.ts",
|
|
101
|
+
"default": "./dist/documents/importer/pandoc/index.js"
|
|
102
|
+
},
|
|
103
|
+
"./documents/revisions": {
|
|
104
|
+
"types": "./dist/documents/revisions/index.d.ts",
|
|
105
|
+
"default": "./dist/documents/revisions/index.js"
|
|
106
|
+
},
|
|
107
|
+
"./user/profile": {
|
|
108
|
+
"types": "./dist/user/profile/index.d.ts",
|
|
109
|
+
"default": "./dist/user/profile/index.js"
|
|
110
|
+
},
|
|
111
|
+
"./user/auth/login": {
|
|
112
|
+
"types": "./dist/user/auth/login.d.ts",
|
|
113
|
+
"default": "./dist/user/auth/login.js"
|
|
114
|
+
},
|
|
115
|
+
"./user/auth/signup": {
|
|
116
|
+
"types": "./dist/user/auth/signup.d.ts",
|
|
117
|
+
"default": "./dist/user/auth/signup.js"
|
|
118
|
+
},
|
|
119
|
+
"./user/auth/password-reset": {
|
|
120
|
+
"types": "./dist/user/auth/password_reset_request.d.ts",
|
|
121
|
+
"default": "./dist/user/auth/password_reset_request.js"
|
|
122
|
+
},
|
|
123
|
+
"./user/auth/password-reset-change": {
|
|
124
|
+
"types": "./dist/user/auth/password_reset_change.d.ts",
|
|
125
|
+
"default": "./dist/user/auth/password_reset_change.js"
|
|
126
|
+
},
|
|
127
|
+
"./user/auth/email-confirm": {
|
|
128
|
+
"types": "./dist/user/auth/email_confirm.d.ts",
|
|
129
|
+
"default": "./dist/user/auth/email_confirm.js"
|
|
130
|
+
},
|
|
131
|
+
"./user/auth/two-factor": {
|
|
132
|
+
"types": "./dist/user/auth/two_factor.d.ts",
|
|
133
|
+
"default": "./dist/user/auth/two_factor.js"
|
|
134
|
+
},
|
|
135
|
+
"./user/contacts": {
|
|
136
|
+
"types": "./dist/user/contacts/index.d.ts",
|
|
137
|
+
"default": "./dist/user/contacts/index.js"
|
|
138
|
+
},
|
|
139
|
+
"./document_templates": {
|
|
140
|
+
"types": "./dist/document_templates/index.d.ts",
|
|
141
|
+
"default": "./dist/document_templates/index.js"
|
|
142
|
+
},
|
|
143
|
+
"./document_templates/overview": {
|
|
144
|
+
"types": "./dist/document_templates/overview.d.ts",
|
|
145
|
+
"default": "./dist/document_templates/overview.js"
|
|
146
|
+
},
|
|
147
|
+
"./document_templates/editor": {
|
|
148
|
+
"types": "./dist/document_templates/editor.d.ts",
|
|
149
|
+
"default": "./dist/document_templates/editor.js"
|
|
150
|
+
},
|
|
151
|
+
"./maintenance": {
|
|
152
|
+
"types": "./dist/maintenance/index.d.ts",
|
|
153
|
+
"default": "./dist/maintenance/index.js"
|
|
154
|
+
},
|
|
155
|
+
"./workers/adjust-doc": {
|
|
156
|
+
"types": "./dist/workers/adjust_doc_to_template.d.ts",
|
|
157
|
+
"default": "./dist/workers/adjust_doc_to_template.js"
|
|
158
|
+
},
|
|
159
|
+
"./app": {
|
|
160
|
+
"types": "./dist/app/index.d.ts",
|
|
161
|
+
"default": "./dist/app/index.js"
|
|
162
|
+
},
|
|
163
|
+
"./api": {
|
|
164
|
+
"types": "./dist/api/index.d.ts",
|
|
165
|
+
"default": "./dist/api/index.js"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"files": [
|
|
169
|
+
"dist/",
|
|
170
|
+
"src/",
|
|
171
|
+
"README.md",
|
|
172
|
+
"LICENSE"
|
|
173
|
+
],
|
|
174
|
+
"scripts": {
|
|
175
|
+
"build": "tsc",
|
|
176
|
+
"prepare": "npm run build",
|
|
177
|
+
"prepublishOnly": "npm run build",
|
|
178
|
+
"typecheck": "tsc --noEmit",
|
|
179
|
+
"lint": "eslint src",
|
|
180
|
+
"lint:fix": "eslint src --fix",
|
|
181
|
+
"format": "prettier --write .",
|
|
182
|
+
"format:check": "prettier --check .",
|
|
183
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.config.js"
|
|
184
|
+
},
|
|
185
|
+
"dependencies": {
|
|
186
|
+
"@fiduswriter/bibliography-manager": "^0.1.10",
|
|
187
|
+
"@fiduswriter/document": "^0.2.26",
|
|
188
|
+
"@fiduswriter/document-template-editor": "^0.1.6",
|
|
189
|
+
"@fiduswriter/editor": "^0.1.46",
|
|
190
|
+
"downloadjs": "^1.4.7",
|
|
191
|
+
"fwtoolkit": "^0.1.4",
|
|
192
|
+
"jszip": "^3.10.1",
|
|
193
|
+
"prosemirror-history": "^1.3.2",
|
|
194
|
+
"prosemirror-keymap": "^1.2.2",
|
|
195
|
+
"prosemirror-model": "^1.25.0",
|
|
196
|
+
"prosemirror-state": "^1.4.3",
|
|
197
|
+
"prosemirror-view": "^1.38.1",
|
|
198
|
+
"qrcode": "^1.5.3",
|
|
199
|
+
"stacktrace-js": "^2.0.2",
|
|
200
|
+
"w3c-keyname": "2.2.8"
|
|
201
|
+
},
|
|
202
|
+
"devDependencies": {
|
|
203
|
+
"@eslint/js": "^10.0.1",
|
|
204
|
+
"@types/downloadjs": "^1.4.6",
|
|
205
|
+
"@types/jest": "^30.0.0",
|
|
206
|
+
"@types/qrcode": "^1.5.6",
|
|
207
|
+
"eslint": "^10.6.0",
|
|
208
|
+
"globals": "^15.15.0",
|
|
209
|
+
"happy-dom": "^20.10.6",
|
|
210
|
+
"jest": "^30.4.2",
|
|
211
|
+
"prettier": "^3.5.3",
|
|
212
|
+
"ts-jest": "^29.4.11",
|
|
213
|
+
"ts-jest-resolver": "^2.0.1",
|
|
214
|
+
"typescript": "^6.0.3",
|
|
215
|
+
"typescript-eslint": "^8.62.0"
|
|
216
|
+
},
|
|
217
|
+
"lint-staged": {
|
|
218
|
+
"*.{ts,js,mjs,css,md,json,html}": [
|
|
219
|
+
"prettier --write"
|
|
220
|
+
],
|
|
221
|
+
"*.{ts,js,mjs}": [
|
|
222
|
+
"eslint --fix"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {addAlert, findTarget, getJson, postJson, whenReady} from "fwtoolkit"
|
|
2
|
+
|
|
3
|
+
// To see how many users are currently online and send them maintenance messages
|
|
4
|
+
|
|
5
|
+
export class AdminConsole {
|
|
6
|
+
constructor() {}
|
|
7
|
+
|
|
8
|
+
init(): void {
|
|
9
|
+
whenReady().then(() => {
|
|
10
|
+
this.render()
|
|
11
|
+
this.bind()
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
bind(): void {
|
|
16
|
+
document.body.addEventListener("click", event => {
|
|
17
|
+
const el: {target?: HTMLElement} = {}
|
|
18
|
+
switch (true) {
|
|
19
|
+
case findTarget(
|
|
20
|
+
event,
|
|
21
|
+
"input#submit_user_message:not(.fw-disabled)",
|
|
22
|
+
el
|
|
23
|
+
): {
|
|
24
|
+
const message = (
|
|
25
|
+
document.querySelector(
|
|
26
|
+
"textarea#user_message"
|
|
27
|
+
) as HTMLTextAreaElement
|
|
28
|
+
).value
|
|
29
|
+
if (!message.length) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
;(
|
|
33
|
+
document.querySelector(
|
|
34
|
+
"textarea#user_message"
|
|
35
|
+
) as HTMLTextAreaElement
|
|
36
|
+
).disabled = true
|
|
37
|
+
;(
|
|
38
|
+
document.querySelector(
|
|
39
|
+
"input#submit_user_message"
|
|
40
|
+
) as HTMLInputElement
|
|
41
|
+
).disabled = true
|
|
42
|
+
;(
|
|
43
|
+
document.querySelector(
|
|
44
|
+
"input#submit_user_message"
|
|
45
|
+
) as HTMLInputElement
|
|
46
|
+
).value = gettext("Sending...")
|
|
47
|
+
this.sendSystemMessage(message)
|
|
48
|
+
break
|
|
49
|
+
}
|
|
50
|
+
default:
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
sendSystemMessage(message: string): Promise<void> {
|
|
57
|
+
return postJson("/api/base/send_system_message/", {message}).then(
|
|
58
|
+
() => {
|
|
59
|
+
addAlert("info", gettext("Message delivered successfully!"))
|
|
60
|
+
const button = document.querySelector(
|
|
61
|
+
"input#submit_user_message"
|
|
62
|
+
) as HTMLInputElement
|
|
63
|
+
button.value = gettext("Message delivered")
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
render(): Promise<void> {
|
|
69
|
+
return getJson("/api/base/connection_info/").then(
|
|
70
|
+
(data: unknown) => {
|
|
71
|
+
const {sessions, users} = data as {sessions: number; users: number}
|
|
72
|
+
const sessionCounterEl =
|
|
73
|
+
document.getElementById("session_count")
|
|
74
|
+
if (sessionCounterEl) {
|
|
75
|
+
sessionCounterEl.innerHTML = String(sessions)
|
|
76
|
+
}
|
|
77
|
+
const userCounterEl = document.getElementById("user_count")
|
|
78
|
+
if (userCounterEl) {
|
|
79
|
+
userCounterEl.innerHTML = String(users)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|