Changes for page Tour
From version 3.1
edited by superadmin
on 2024/11/13 14:12
on 2024/11/13 14:12
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-tour-ui/15.10.13]
To version 1.1
edited by Gianfranco Andreoli
on 2023/03/17 14:43
on 2023/03/17 14:43
Change comment:
Install extension [org.xwiki.contrib:application-tour-ui/1.3.3]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. superadmin1 +XWiki.gianfranco
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -1,6 +1,6 @@ 1 1 require(['jquery', 'xwiki-events-bridge'], function ($) { 2 2 'use strict'; 3 - 3 + 4 4 /** 5 5 * Add a 'launch tour' button into the 'actions' columns. 6 6 */ ... ... @@ -10,16 +10,23 @@ 10 10 return; 11 11 } 12 12 var targetPage = XWiki.Model.resolve(row.find('.targetPage').text(), XWiki.EntityType.DOCUMENT); 13 - var targetPageDocument = new XWiki.Document(targetPage); 14 - 13 + var targetPageDocument; 14 + // Two behaviours depending of the handling of the Nested Pages feature. 15 + if (XWiki.Document.initializeFromReference) { 16 + targetPageDocument = new XWiki.Document(targetPage); 17 + } else { 18 + targetPageDocument = new XWiki.Document(targetPage.name, 19 + targetPage.extractReferenceValue(XWiki.EntityType.SPACE)); 20 + } 21 + 15 15 // Add a launch tour link to the actions column. 16 16 if (row.find('.actionLaunch').length == 0) { 17 - $('<a class="action actionLaunch">$ escapetool.javascript($services.icon.renderHTML("play"))$escapetool.javascript($escapetool.xml($services.localization.render("tour.livetable._actions.launch")))</a>')24 + $('<a class="action actionLaunch">$services.icon.renderHTML("play") $escapetool.javascript($escapetool.xml($services.localization.render("tour.livetable._actions.launch")))</a>') 18 18 .attr('href', targetPageDocument.getURL('view', 'startTour=true')) 19 19 .css('padding-left', '1px').appendTo(row.find('.actions')); 20 20 } 21 21 } 22 - 29 + 23 23 /** 24 24 * Add the launch button into each livetable raw. 25 25 */ ... ... @@ -29,8 +29,8 @@ 29 29 }); 30 30 } 31 31 $(document).on('xwiki:livetable:ready', initLivetableResults); 32 - $(initLivetableResults); 33 - 39 + $(document).ready(initLivetableResults); 40 + 34 34 /** 35 35 * Add the launch button into each new livetable raw. 36 36 */