Wiki source code of FrontendResources
Version 16.1 by Silvia Macovei on 2010/02/25
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Front-end Resources = | ||
2 | |||
3 | {{info}}This section is a work in progress.{{/info}} | ||
4 | |||
5 | This sections 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: | ||
6 | |||
7 | * External Libraries | ||
8 | * Internal components (Based or not on some of the external libraries) | ||
9 | |||
10 | 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. | ||
11 | |||
12 | Some of the resources presented in here are not included by default with all HTML-rendered wiki pages (it would be a lot too much things 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>>Main.XWikiSyntax]]: | ||
13 | |||
14 | {{code}}$xwiki.jsfx.use("js/scriptaculous/slider.js"){{/code}} | ||
15 | |||
16 | In [[XWiki Syntax 2.0>>Main.XWikiSyntax]]: | ||
17 | |||
18 | {{code}} | ||
19 | {{velocity}} | ||
20 | $xwiki.jsfx.use("js/scriptaculous/slider.js") | ||
21 | {{/velocity}} | ||
22 | {{/code}} | ||
23 | |||
24 | 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. | ||
25 | |||
26 | == External resources == | ||
27 | |||
28 | External resources are third party libraries bundled with the XWiki webapp as resources developers can use for their in-wiki applications or to enhance the wiki itself. Almost all of the (except prototype.js) are not included by default in HTML-rendered wiki pages. | ||
29 | |||
30 | Hereunder is a table presenting some of the external libraries XWiki comes with: | ||
31 | |||
32 | {{velocity filter="none"}} | ||
33 | {{html clean="false" wiki="true"}} | ||
34 | <table> | ||
35 | <tbody> | ||
36 | <tr> | ||
37 | <td width="50%"> | ||
38 | <img src="$doc.getAttachmentURL('prototype.gif')" /><br /> | ||
39 | [[Prototype>>http://prototypejs.org||target=_blank]] is a <em>"JavaScript framework that aims to ease development of web applications"</em>. It extends the JavaScript native objects and browser objects providing utilities for Ajax, OOP-style classes, and so much more. Prototype is the only JavaScript library that is systematically shipped with any wiki page in XWiki. | ||
40 | </td> | ||
41 | <td> | ||
42 | <img src="$doc.getAttachmentURL('smartclient.png')" /><br /> | ||
43 | [[Smartclient>>http://www.smartclient.com/]] is an AJAX RIA system to easily develop rich interface components. Using it in XWiki, you can build powerful front-end widgets that can leverage [[XWiki's RESTful API>>Features.XWikiRESTfulAPI]]. | ||
44 | </td> | ||
45 | </tr> | ||
46 | </tbody> | ||
47 | </table> | ||
48 | {{/html}} | ||
49 | {{/velocity}} | ||
50 | |||
51 | * Scriptaculous | ||
52 | * YUI | ||
53 | |||
54 | == Internal resources == | ||
55 | |||
56 | === Front-end Components === | ||
57 | |||
58 | * [[Modal Popup>>ModalPopup]] | ||
59 | * [[Confirmation Box>>ConfirmationBox]] | ||
60 | * [[LiveTable]] | ||
61 | * [[Auto Suggest Widget>>DevGuide.AutoSuggestWidget]] | ||
62 | |||
63 | === JavaScript resources === | ||
64 | |||
65 | * [[JavaScriptAPI]] | ||
66 | * [[XWiki RESTFul API>>Features.XWikiRESTfulAPI]] | ||
67 | |||
68 | === StyleSheet resources === | ||
69 | |||
70 | * [[Pagination>>Pagination]] | ||
71 | * [[Result List>>ListOfResults]] | ||
72 | * [[Search Box>>SearchBox]] | ||
73 | * [[Suggest Box>>SuggestBox]] |