You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,7 @@ They have two functions:
226
226
}
227
227
```
228
228
229
-
***Checking for unsaved user input before closing a window:**
229
+
***Checking for unsaved user input before closing a window:**{#checking-for-unsaved-user-input-before-closing-a-window}
230
230
PEB users can enter a lot of data in local HTML forms and it is often important to safeguard this information from accidental deletion if PEB window is closed without first saving the user data. When user starts closing a PEB window, the browser checks for any unsaved data in all forms of the HTML page that is going to be closed. This is achieved using internal JavaScript code compiled in the resources of the browser binary.
231
231
232
232
If any unsaved data is detected, PEB tries to determine what kind of JavaScript routine has to be displayed to warn the user and ask for final confirmation. Two types of JavaScript warning routines are possible in this scenario: synchronous and asynchronous.
@@ -239,7 +239,7 @@ They have two functions:
239
239
240
240
The asynchronous warning function does not rely on JavaScript Confirm dialog, does not stop the execution of any JavaScript code within the page and does not wait for the user's decision. If the user chooses to close the window, a special window-closing URL, ```http://local-pseudodomain/close-window.function```, has to be sent to the browser. Upon receiving this URL, PEB closes the window from where the window-closing URL was requested. The warning dialog can be styled to blend with the rest of the HTML interface or to attract attention and this is the main advantage of using an asynchronous warning dialog. Developers can implement it using any suitable JavaScript library or custom code.
241
241
242
-
The following code is an example of both synchronous and asynchronous warning functions. It is expected, that one of them will be present in a PEB-based application where user data is to be protected against accidental loss. If both functions are present, the asynchronous one will take precedence. The asynchronous function in the example code is implemented using[jQuery](https://jquery.com/) and[Alertify.js](http://alertifyjs.com/).
242
+
The following code is an example of both synchronous and asynchronous warning functions. It is expected that one of them will be present in a PEB-based application where user data is to be protected against accidental loss. If both functions are present, the asynchronous one will take precedence. The asynchronous function in the example code is implemented using [Alertify.js](http://alertifyjs.com/).
243
243
244
244
```javascript
245
245
functionpebCloseConfirmationSync() {
@@ -252,10 +252,7 @@ They have two functions:
252
252
alertify.set({buttonFocus:"cancel"});
253
253
alertify.confirm("Are you sure you want to close the window?", function (confirmation) {
Having a target DOM element is mandatory when using this special URL.
306
303
HTML event called ```inodeselection``` is emitted when the path of the selected file is inserted into the calling local page.
307
304
This event can be binded to a JavaScript function transmitting the file path to a local Perl script.
308
-
Actual opening of the selected file is performed only after the selected file is transmitted to and opened from a Perl script.
305
+
The actual opening of the selected file is performed by the designated Perl script and not by PEB itself.
309
306
310
307
Please note that for security reasons full paths of local files or folders are inserted only inside local pages!
311
308
@@ -338,14 +335,15 @@ They have two functions:
338
335
Having a target DOM element is mandatory when using this special URL.
339
336
```inodeselection``` HTML event is emitted when the new file name is inserted into the calling local page.
340
337
341
-
Please note that the actual creation of the new file is not performed directly by PEB. Only after the new file name is transmitted to a Perl script, the script itself will create the new file.
338
+
The actual creation of the new file is performed by the designated Perl script and not by PEB itself.
The full path of the selected directory will be inserted in the target DOM element of the calling local page.
345
342
Having a target DOM element is mandatory when using this special URL.
346
343
```inodeselection``` HTML event is emitted when the path of the selected directory is inserted into the calling local page.
347
344
348
-
Please note that if you choose to create a new directory, it will be created immediately by PEB and it will be already existing when it will be passed to a local Perl script.
345
+
Please note that if you choose to create a new directory, it will be created immediately by PEB.
346
+
It will be already existing when passed to a local Perl script.
0 commit comments