The Backend JavaScript code is based on jQuery, therefore it requires jQuery sources to be loaded initially.
Right after jQuery, it is required to load CONTENIDO Backend JavaScript sources. The minimum required JavaScript code in Backend and the order looks like:
<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="scripts/contenido.js"></script>
<script type="text/javascript" src="scripts/general.js"></script>
contenido.js:
The main CONTENIDO Backend JavaScript module.
Creates the global object 'Con' in window scope and stores the reference to jQuery as it's property 'Con.$'. Furthermore it defines few properties and functions like:
Con.sid // Backend session id
Con.cfg = {enableLog: true} // Common configuration object, will be set later
Con.parseTemplate() // Template parser
Con.getFrame() // Easy access to backend frames
Con.log() // Logging, console.log wrapper
The 'Con' property within windows is also the namespace which should be used by all JavaScript modules.
general.js:
This file contains general modules which are potentially helpful for every backend page. It should be loaded right after contenido.js!
Following modules are implemented here:
Registry (Con.Registry)
Registry module store (get/set) application wide objects.
Note: Every frame has it's own registry instance. If you want to keep something in the registry and it should be available for all frames, the add it to the top window.
top.Con.Registry.set('foobar', 1);
var value = top.Con.Registry.get('foobar');
- Loader (Con.Loader)
The JavaScript loader
- UtilUrl (Con.UtilUrl)
Collection of URL helper functions to build backend URLs, extrat parametes from URLs, etc.
- FrameLeftTop (Con.FrameLeftTop)
Object to resize left_top frame
- Additional functions
Definition of additional functions for common usage like
- Con.multiLink(), the former conMultiLink()
- Con.getRegistry()
- Con.getContentWindow(), returns right_bottom frame
- Con.getTranslations()
- Con.showConfirmation()
- Con.showNotification()
- Con.markSubmenuItem()