Skip to content

Commit 183081b

Browse files
committed
document text editor replace feature
dashjoin/dashjoin-aas#711
1 parent eacca8d commit 183081b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

dashjoin-docs/docs/developer-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,17 @@ allows the user to edit the text and call expressions via the custom menu.
585585
"context": "'my context expression'",
586586
"properties": {
587587
"alert": "$alert('selection: ' & selection & '. markdown: ' & markdown)",
588-
"log": "$log($)",
588+
"replace": "selection ? {'selection': 'replace'} : {'markdown': 'replace'}",
589589
"sleep": "($progress({'message': 'working'});$sleep(1000))"
590590
},
591-
"expression": "{... see below}",
591+
"expression": "{... see below}"
592592
}
593593
```
594594

595595
The widget defines three expressions:
596596

597597
* alert: shows that we can use the context fields markdown and selection to access the entire document (with the user's changes) or the text selected in the editor
598-
* log: simply logs th entire expression context in the console
598+
* replace: if a text is selected, replaces the text with "replace", otherwise, replaces the entire text with "replace"
599599
* sleep: an example for how to provide feedback for operations with a longer runtime
600600

601601
The menu structure is defined by an expression the yields the following JSON:
@@ -620,8 +620,8 @@ The menu structure is defined by an expression the yields the following JSON:
620620
"value": "alert"
621621
},
622622
{
623-
"label": "doc to console",
624-
"value": "log"
623+
"label": "replace",
624+
"value": "replace"
625625
}
626626
]
627627
}

0 commit comments

Comments
 (0)