|
9 | 9 | <script> |
10 | 10 | // PEB page settings: |
11 | 11 | var pebSettings = {}; // 'pebSettings' object name is hard-coded. |
12 | | - pebSettings.autoStartScripts = ['interactive_one', 'interactive_two']; |
| 12 | + pebSettings.onStartScripts = ['interactive_one', 'interactive_two']; |
13 | 13 | pebSettings.cutLabel = '- Cut -'; |
14 | 14 | pebSettings.copyLabel = '- Copy -'; |
15 | 15 | pebSettings.pasteLabel = '- Paste -'; |
|
21 | 21 | pebSettings.closeConfirmation = |
22 | 22 | 'Text was entered in a form and it is going to be lost!\n' + |
23 | 23 | 'Are you sure you want to close the application?'; |
| 24 | + pebSettings.onExitScripts = ['interactive_one', 'interactive_two']; |
24 | 25 |
|
25 | 26 | // PEB settings objects for auto-started Perl interactive scripts: |
26 | 27 | var interactive_one = {}; |
27 | 28 | interactive_one.scriptRelativePath = 'perl-scripts/interactive.pl'; |
28 | 29 |
|
29 | 30 | interactive_one.inputData = function() { |
30 | | - var input = {} |
31 | | - input.mode = "unix-epoch"; |
32 | | - input.user_input = document.getElementById("interactive-one-input").value; |
| 31 | + var data = {} |
| 32 | + data.mode = "unix-epoch"; |
| 33 | + data.user_input = document.getElementById("interactive-one-input").value; |
33 | 34 | $('#form-one').trigger('reset'); |
34 | | - return JSON.stringify(input); |
| 35 | + return JSON.stringify(data); |
35 | 36 | } |
36 | 37 |
|
37 | 38 | interactive_one.stdoutFunction = function (stdout) { |
|
46 | 47 | target.innerHTML = html; |
47 | 48 | } |
48 | 49 |
|
| 50 | + interactive_one.exitData = function() { |
| 51 | + var data = {} |
| 52 | + data.mode = "unix-epoch"; |
| 53 | + data.user_input = "peb-exit"; |
| 54 | + return JSON.stringify(data); |
| 55 | + } |
| 56 | + |
49 | 57 | var interactive_two = {}; |
50 | 58 | interactive_two.scriptRelativePath = 'perl-scripts/interactive.pl'; |
51 | 59 |
|
52 | 60 | interactive_two.inputData = function() { |
53 | | - var input = {} |
54 | | - input.mode = "local-time"; |
55 | | - input.user_input = document.getElementById("interactive-two-input").value; |
56 | | - $('#form-one').trigger('reset'); |
57 | | - return JSON.stringify(input); |
| 61 | + var data = {} |
| 62 | + data.mode = "local-time"; |
| 63 | + data.user_input = document.getElementById("interactive-two-input").value; |
| 64 | + $('#form-two').trigger('reset'); |
| 65 | + return JSON.stringify(data); |
58 | 66 | } |
59 | 67 |
|
60 | 68 | interactive_two.stdoutFunction = function (stdout) { |
|
68 | 76 | }; |
69 | 77 | target.innerHTML = html; |
70 | 78 | } |
| 79 | + |
| 80 | + interactive_two.exitData = function() { |
| 81 | + var data = {} |
| 82 | + data.mode = "unix-epoch"; |
| 83 | + data.user_input = "peb-exit"; |
| 84 | + return JSON.stringify(data); |
| 85 | + } |
71 | 86 | </script> |
72 | 87 |
|
73 | 88 | <script src="jquery/jquery-1.12.4.min.js"></script> |
|
132 | 147 | <li> |
133 | 148 | <a href="javascript:location.reload();">Reload</a> |
134 | 149 | </li> |
| 150 | + |
| 151 | + <li> |
| 152 | + <a href="https://www.google.com/">Google</a> |
| 153 | + </li> |
135 | 154 | </ul> |
136 | 155 | </li> |
137 | 156 |
|
138 | | - <li><a href="https://www.google.com/">Google</a></li> |
139 | | - |
140 | 157 | <li><a href="about.function">About</a></li> |
141 | 158 | </ul> |
142 | 159 | </div> |
|
0 commit comments