Wiki source code of Snippets

Version 4.1 by Vincent Massol on 2020/04/08 12:59

Show last authors
1 {{include reference="ExtensionCode.RepositoryCode"/}}
2
3 {{include reference="ExtensionCode.CreateExtension"/}}
4
5 {{info}}
6 Snippets are reusable portions of [[scripts>>platform:DevGuide.Scripting]] that you can copy paste in wiki pages.
7 {{/info}}
8
9 (% class="extension-link search-extension box" %)(((
10 (((
11 {{velocity}}
12 === #if($services.icon)$services.icon.render('find')#end Search Snippet... ===
13 {{html}}
14 <form action="$xwiki.getURL("ExtensionCode.ExtensionSearch")">
15 <input type="hidden" name="f_space" value="Extension" />
16 <input type="text" name="text" value="snippet name..." size="25" class="withTip" id="searchTextInput" />
17 <span class="buttonwrapper">
18 <input class="btn btn-primary" type="submit" value="Search" id="searchSubmit"/>
19 </span>
20 </form>
21 {{/html}}
22
23 {{/velocity}}
24 )))
25 )))
26
27 (% class="extension-link add-extension box" %)(((
28 (((
29 {{velocity}}
30 === #if($services.icon)$services.icon.render('add')#end Contribute Snippet... ===
31 {{html}}
32 #if ($isGuest)
33 You need first to <a href="${escapetool.xml($xwiki.getURL('Main.WebHome', 'login', "xredirect=$doc.externalURL"))}">log in</a> or <a href="${escapetool.xml($xwiki.getURL($services.model.resolveDocument('', 'default'), "register", "xredirect=$doc.externalURL"))}">register</a>.
34 #else
35 <form action="$doc.getURL()" id="createextension">
36 <input type="hidden" name="parent" value="Extension.WebHome" />
37 <input type="hidden" name="template" value="ExtensionCode.ExtensionTemplate" />
38 <input type="hidden" name="createExtension" value="true" />
39 <input class="withTip" type="text" name="name" value="snippet name..." size="25" id="contributeNameInput"/>
40 <span class="buttonwrapper">
41 <input class="btn btn-success" type="submit" value="Add" id="contributeSubmit"/>
42 </span>
43 </form>
44 {{/html}}
45
46 #end
47 {{/velocity}}
48 )))
49 )))
50
51 (% class="clearfloats" %)((()))(%%)
52
53 {{velocity}}
54 #set($columns = ["name", "summary", "authors", "doc.creationDate", "doc.date", "rating"])
55 #set($columnsProperties = {
56 "name" : { "type" : "text", "link" : "view" },
57 "summary" : { "type" : "text" },
58 "authors" : {"type" : "text", 'html': true},
59 "doc.creationDate" : { "type" : "date" },
60 "doc.date" : { "type" : "date" },
61 "rating" : { 'html' : true, 'filterable' : false, 'sortable' : false}
62 })
63 #set($options = {
64 "tagCloud":true,
65 "className":"ExtensionCode.ExtensionClass",
66 "selectedColumn":"doc.creationDate",
67 "defaultOrder":"desc",
68 "translationPrefix" : "extension.repository.",
69 "rowCount": 30
70 })
71 #livetable("extensions" $columns $columnsProperties $options)
72
73 (% class="hidden" %) (((
74 Temporary provide a link for robots to index all extension.
75 In the future, this link will be provided via a sitemap.
76 [[ExtensionCode.AllExtensionsList]]
77 )))
78 {{/velocity}}

Get Connected