Front-end Resources
This section aims to document all the front-end resources available in XWiki for application developers and for developers of the XWiki products. Front-end resources are of two main types:
- External Libraries
- Internal components (based or not on some of the external libraries)
Front-end resources are mainly composed of JavaScript libraries, CSS stylesheets and their corresponding HTML reusable snippets (or velocity macro to output this snippet) and velocity macros.
Some of the resources presented in here are not included by default with all HTML-rendered wiki pages (it would be too much to send to the client!). You have to request their inclusion from a skin template or from the wiki page itself using the jsfx plugin. For example, to request the inclusion of scriptaculous slider library, you can write, in XWiki Syntax 1.0:
In XWiki Syntax 2.0:
$xwiki.jsfx.use("js/scriptaculous/slider.js")
{{/velocity}}
The path you indicate to the jsfx plugin is the relative path where the library can be found under the resources directory of the XWiki webapp. Similarly to the jsfx plugin, there is a ssfx plugin that can be used to request the inclusion of CSS stylesheets files.
External resources
XWiki contains some third-party libraries bundled by default.
Hereunder is a table presenting some of the external libraries XWiki comes with:
Library Name | Description |
---|---|
Prototype is a "JavaScript framework that aims to ease development of web applications". It extends the JavaScript native objects and browser objects providing utilities for Ajax, OOP-style classes, and much more. Prototype is the only JavaScript library that is systematically shipped with any wiki page in XWiki. | |
Smartclient is an AJAX RIA system that allows the easy development of rich interface components. Using it in XWiki, you can build powerful front-end widgets that can leverage XWiki's RESTful API. | |
Scriptaculous | |
YUI | |
LiveValidation | |
JQuery | jQuery is "a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript." |
JQuery UI | jQuery UI is "a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice." |
Bootstrap | Bootstrap is "the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web."" Bootstrap is bundled with XWiki mainly because the XWiki skin is based on it. |
See Using jQuery and jQuery UI for an example of using jQuery and jQuery UI in an XWiki page, and more generally check how to integrate JavaScript Libraries in XWiki.
Internal resources
Front-end Components
- Modal Popup
- Confirmation Box
- LiveTable
- Auto Suggest Widget
- Notification Widget
- HTML5 Upload
- Autosave
- XWiki Select