-
Notifications
You must be signed in to change notification settings - Fork 0
Sidebar accordeon config protocol
Eragon666 edited this page Jun 25, 2015
·
4 revisions
{
defaults: {
headers: [
{
key: "high",
title: "Dit moet worden gecorrigeerd!",
color: "red"
},
{
key: "medium",
title: "Overweeg dit te corrigeren",
color: "orange"
},
{
key: "done",
title: "Perfect!",
color: "#38cc70"
}
]
},
checks: [
{
name: "typeTokenFrequency",
hint: "Type token frequency geeft aan hoeveel verschillende woorden er in de tekst gebruikt worden.",
message: {
head: "Controleer de type token frequency",
lower: "Is lager in de paragrafen %p%",
higher: "Is hoger in de paragrafen %p%",
equal: ""
},
warn: {
check: 'multiply',
lower: 2,
higher: 2,
equal: false
},
combine: true,
importance: "medium",
warnings: 0,
paragraphs: {
lower: [],
higher: [],
equal: []
},
activeOn: "typeTokenFrequencyHighlights"
}
]
};
This protocol is used to change the configuration of the sidebar analytics/feedback inside the accordeon.
The info displayed is highly customizable with this configuration (and maybe some small code changes with bigger edits).
We will give a short explanation of the different configuration items. defaults.
- defaults.headers: the actual blocks shown in the sidebar can be added here. 'key' is used to identify the block, title is the text as seen in the editor and the color is the background-color.
- checks: In this block the actual checks are configured
- checks.name: The name/identifier to be used, make sure that the same name is used in the communication protocol.
- checks.hint: Hint to be shown if there is an error, shown as tooltip on hover.
- checks.message: Different messages to give as feedback for each possible error (to highh, to low or equal), the header is shown bold. The %p% tag is replaced with the actual paragraphs.
- checks.warn: Is used to determine on what to check, the 'check' can be set to check on multiply or sum. The lower, higher and equal can be set to a value (equal only to true/false), if false nothing is checked else the value is used to determine if the error must be displayed. For example if the corpus value is 10 and the text value 7 and lower = 2, the error is shown (10-7 = 3), but if lower is set on 3 than nothing is shown. So the value is used as a threshold.
- checks.combine: Is not used, but can be implemented easily. If set on false, at the moment nothing is shown. But if implemented, it can be used to show all errors on the same line (so paragraphs are shown as paragraphs 1,2,3,4 are to long) or each paragraph seperately (par 1 is to long, par 2 is to long, par 3 is to long etc.)
- checks.importance: corresponds to the id of the header
- checks.warnings: used internally by the code
- checks.paragraphs: used internally by the code
- checks.activeOn: it will only be checked if the object in the communication protocol is set to true