author | Edouard Tisserant <edouard.tisserant@gmail.com> |
Sun, 10 May 2020 23:40:43 +0200 | |
branch | svghmi |
changeset 2955 | 64e603b84aa3 |
parent 2912 | d320367eb2ad |
child 2958 | 895d3f2b1786 |
permissions | -rw-r--r-- |
2902 | 1 |
// widget_back.ysl2 |
2779
75c6a31caca6
SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents:
2763
diff
changeset
|
2 |
|
2902 | 3 |
template "widget[@type='Back']", mode="widget_defs" { |
2883
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
4 |
param "hmi_element"; |
2900
3ef217f525ff
SVGHMI: Check that explicit relative page jump path is consistant with destination page reference path.
Edouard Tisserant
parents:
2898
diff
changeset
|
5 |
|
2883
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
6 |
| on_click: function(evt) { |
2902 | 7 |
| if(jump_history.length > 1){ |
8 |
| jump_history.pop(); |
|
9 |
| let [page_name, index] = jump_history.pop(); |
|
10 |
| switch_page(page_name, index); |
|
11 |
| } |
|
2883
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
12 |
| }, |
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
13 |
| init: function() { |
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
14 |
| this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)"); |
8e3d130399b0
SVGHMI: created widget_*.ysl2. Renamed widget_common in widgets_common, so that it doesn't match globing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
2882
diff
changeset
|
15 |
| }, |
2753
9a7e12e96399
SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff
changeset
|
16 |
} |
2901
3f5194bba67d
SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents:
2900
diff
changeset
|
17 |