Wiki source code of CheckboxedTask

Last modified by Admin Trust-IT on 2023/01/06 21:17

Show last authors
1 This macro adds a checkboxed **task with checkbox** macro and an event listener for ticking completed tasks off using the checkboxes
2
3 **Example:**
4
5 {{checktask dueDate="31.12.2022, 23:59:59"}}
6 Description of task to be done
7 {{/checktask}}
8
9 **CKEditor:**
10
11 In order to make best use of it, add the following CKeditor configuration to your editor through the [[dedicated "WYSIWYG Editor" section>>url:https://extensions.xwiki.org/xwiki/bin/view/Extension/CKEditor%20Integration/#HAdministrationSection]] in the [[Wiki Administration>>url:https://extensions.xwiki.org/xwiki/bin/view/Extension/Administration%20Application]]:
12
13 {{code language="javascript" layout="LINENUMBERS"}}
14 config['xwiki-macro'] = config['xwiki-macro'] || {};
15 config['xwiki-macro'].insertButtons = [
16 {
17 insertDirectly: false,
18 macroCall: {
19 name:'checktask',
20 inline:'enforce',
21 }
22 }
23 ];
24 {{/code}}
25
26 **Macros and components:**
27
28 * [[CheckboxedTask>>CheckboxedTask]]: Contains the **checktask **macro that inserts checkboxed tasks in pages and a JavaScript listener that listens for checking/unchecking events
29 * [[CheckboxedTaskListener>>doc:.CheckboxedTaskListener.WebHome]]: Event listener that listens for creating and updating tasks on pages, adding xobjects to the respective pages
30 * [[CheckboxUpdater>>doc:CheckboxUpdater]]: Is called by the JavaScript listener to update the xobject of a task when checked or unchecked
31 * [[Task Class>>doc:TaskClass]]:  Xobject class that defines the properties of tasks to be saved
32 * [[CheckboxedTaskReport>>doc:.CheckboxedTaskReport.WebHome]]: Contains the macro **reportchecktasks **that inserts a task report in pages using the default **live data** macro. Also contains another JavaScript listener listening for cheking/unchecking events within the live data table.
33 * [[TasksJSON>>doc:TasksJSON]]: Defines the database query and formats the input for the live data macro in  the task report
34 * [[CheckboxedTaskTranslations>>doc:.CheckboxedTaskTranslations.WebHome||style="outline-width: 0px !important; user-select: auto !important;"]]: Contains the localized labes of the task and task report macros