Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:architecture:lightbox
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
development:architecture:lightbox [2016/03/29 15:57] – [Lightbox] crhallberg | development:architecture:lightbox [2017/01/04 18:44] – [Form Controls] demiankatz | ||
---|---|---|---|
Line 3: | Line 3: | ||
The new Lightbox (version 3.0, aka the Delightbox) focuses on using the same paths as VuFind would without Javascript. The general idea is that it emulates a seamless iframe with hooks and methods that allow more control. It uses '' | The new Lightbox (version 3.0, aka the Delightbox) focuses on using the same paths as VuFind would without Javascript. The general idea is that it emulates a seamless iframe with hooks and methods that allow more control. It uses '' | ||
- | ===== Built-in Stops ===== | + | ====== Controlling the Lightbox ====== |
- | The Lightbox is programmed to close under the following conditions: | ||
- | |||
- | ==== Non-forced login ==== | ||
- | VuFind refreshes the page after a login to update information and present new fields. The lightbox determines if a login has occureed using the following criteria: | ||
- | * the request came from a form | ||
- | * the form's action matches login/ | ||
- | * the response to the form doesn' | ||
- | |||
- | If the above is true and the form action is directly from UserLogin or catalogLogin, | ||
- | |||
- | ==== A success message is reached ==== | ||
- | When an .alert-success message is found, it is isolated in the lightbox, representing the end of a path. The lightbox can only be closed or escaped after this (by default). | ||
===== Universal Controls ===== | ===== Universal Controls ===== | ||
Line 35: | Line 23: | ||
===== Form Controls ===== | ===== Form Controls ===== | ||
- | **data-lightbox-onsubmit** - Specify a callback | + | **data-lightbox-onsubmit** - Specify a callback to be evaluated and run. Callbacks will be passed the event and all of the parsed form data (includes [[http:// |
+ | |||
+ | **data-lightbox-onclose** - Specify a callback to be evaluated and run when the lightbox closes next. | ||
+ | |||
+ | :!: Prior to VuFind 4.0, a callback could be either a function name in the global scope, or a block of Javascript code. VuFind 4.0 and later, the callback MUST be either a function name in the global scope (e.g. myFunction) or a function name within the global VuFind object (e.g. VuFind.myFunction). | ||
+ | ====== Built-in Stops ====== | ||
+ | |||
+ | The Lightbox is programmed to close under the following conditions: | ||
+ | |||
+ | ===== Non-forced login ===== | ||
+ | VuFind refreshes the page after a login to update information and present new fields. The lightbox determines if a login has occureed using the following criteria: | ||
+ | * the request came from a form | ||
+ | * the form's action matches login/ | ||
+ | * the response to the form doesn' | ||
+ | |||
+ | If the above is true and the form action is directly from UserLogin or catalogLogin, | ||
+ | |||
+ | ===== A success message is reached ===== | ||
+ | When an .alert-success message is found, it is isolated in the lightbox, representing the end of a path. The lightbox can only be closed or escaped after this (by default). | ||
- | **data-lightbox-onclose** - Specify | + | ===== 205 Status Code ===== |
+ | If a form results in a 205 status code (Reset Content), it will immediately refresh | ||
+ | ====== Transitioning ====== | ||
+ | ^ Old Lightbox ^ New Lightbox ^ | ||
+ | | Lightbox.addFormCallback | data-lightbox-onsubmit | | ||
+ | | Lightbox.addFormHandler | ||
+ | | Lightbox.addCloseAction | ||
+ | | Lightbox.addOpenAction | ||
---- struct data ---- | ---- struct data ---- | ||
---- | ---- | ||
development/architecture/lightbox.txt · Last modified: 2023/06/07 12:19 by demiankatz