Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-21633: Adding a step tour on a class field doesn't work #3781

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@
</dl>
#else
<dl>
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label></dt>
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange indentation. And I would call $escapetool.xml() on the label.

## Add a hint for the field if there's one defined in the translations.
#if($!services.localization.render("${class.name}_${prop.name}.hint") != "${class.name}_${prop.name}.hint")##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<span class='xHint'>$!services.localization.render("${class.name}_${prop.name}.hint")</span>##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span class='xHint'>$!services.localization.render("${class.name}_${prop.name}.hint")</span>##
<span class='xHint'>$!escapetool.xml($services.localization.render("${class.name}_${prop.name}.hint"))</span>##

#end##
</dt>
<dd>$vobj.get($prop.getName())</dd>
</dl>
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ require(['jquery', 'xwiki-meta'], function ($, xm) {
createTour(tour);
}
}
}).fail(function (data) {
console.error("Querying the JSON for the Tour failed. %o", data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's the benefit for this, since the browser's web developer tools already provide information about the failed HTTP requests.

});
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unnecessary.

});
});</code>
</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<hidden>true</hidden>
<content>{{include reference="TourCode.Macros"/}}

{{velocity}}
{{velocity wiki="false"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the indentation? And BTW, you could instead set output="false" and call the #jsonResponse() Velocity macro at the end to write the JSON directly to the HTTP response.

#if ($xcontext.action == 'get')
##--------------------------------------------------------
## Get the tour steps corresponding to the target page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ tour.popover.show.hint=You can restart the tour by clicking this button at anyti
# Steps
TourCode.StepClass_order=Order
TourCode.StepClass_element=Element (CSS selector that identify an element)
TourCode.StepClass_element.hint=CSS selector that identifies an element. Escape special CSS characters with a backslash.
TourCode.StepClass_title=Title
TourCode.StepClass_content=Content
TourCode.StepClass_backdrop=Backdrop
Expand Down