Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
492f33b6
Commit
492f33b6
authored
Jul 06, 2015
by
Sumit Sahrawat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small changes to MsgSpec.md
- Formatting issues: Bad numbering. - Clarify usage of custom messages.
parent
e1dafd07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
MsgSpec.md
ihaskell-display/ihaskell-widgets/MsgSpec.md
+22
-17
No files found.
ihaskell-display/ihaskell-widgets/MsgSpec.md
View file @
492f33b6
...
...
@@ -54,6 +54,8 @@ message to the frontend on the widget's comm.
}
```
## Custom messages
*
Widgets can also send a custom message, having the form:
```
json
...
...
@@ -63,6 +65,9 @@ message to the frontend on the widget's comm.
}
```
This message is used by widgets for ad-hoc syncronization, event handling and other stuff. An example
is mentioned in the next section.
## Handling changes to widget in the frontend
Changes to widgets in the frontend lead to messages being sent to the backend. These messages have
...
...
@@ -70,28 +75,28 @@ two possible formats:
1.
Backbone.js initiated sync:
```
json
{
"method"
:
"backbone"
,
"sync_data"
:
{
"<changes to sync with the backend>"
}
}
```
```json
{
"method": "backbone",
"sync_data": { "<changes to sync with the backend>" }
}
```
These messages are sent by the Backbone.js library when some change is made to a widget. For
example, whenever a change is made to the text inside a
`TextWidget`
, the complete contents are sent
to the kernel so that the kernel stays up-to-date about the widget's contents.
These messages are sent by the Backbone.js library when some change is made to a widget. For
example, whenever a change is made to the text inside a
`TextWidget`
, the complete contents are sent
to the kernel so that the kernel stays up-to-date about the widget's contents.
2.
Custom message:
```
json
{
"method"
:
"custom"
,
"content"
:
{
"<custom message data>"
}
}
```
```json
{
"method": "custom",
"content": { "<custom message data>" }
}
```
This form is generally used to notify the kernel about events. For example, the
`TextWidget`
sends a
custom message when the text is submitted by hitting the 'Enter' key.
This form is generally used to notify the kernel about events. For example, the
`TextWidget`
sends a
custom message when the text is submitted by hitting the 'Enter' key.
---
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment