Skip to content

Conversation

dregad
Copy link
Member

@dregad dregad commented Oct 24, 2017

Creating a pull request to make the review process easier.

Fixes #16

The simpletip javascript library that has been used until now to provide
contextual help for Snippets placeholders is no longer maintained (since
2009), and has been superseded by qTip2 [1].

This commit removes the old library, adds the latest version of qTip2 and
implements the following changes in the code to support it:

- Change display from a floating tooltip to a fixed position on the top
  right of the textarea
- Modify the format of the JSON returned by the *pattern_help* XHR to an
  array [title, help text]
- Update language strings for the new help format
- Adjust CSS for correct display; in particular, the ace-mantis.css
  forces a white background for <table> so we need to override that

Fixes mantisbt-plugins#25
Fixes mantisbt-plugins#19

[1]: https://qtip2.com
XHR was deprecated in Mantis 2.3.0.

Publish 3 REST API endpoints to replace the corresponding XHR functions:

- xmlhttprequest_plugin_snippets_data
  => ./plugins/Snippets/list and ./plugins/Snippets/list/{bug_id}
- xmlhttprequest_plugin_snippets_help
  => ./plugins/Snippets/help

Fixes mantisbt-plugins#16
@dregad
Copy link
Member Author

dregad commented Oct 24, 2017

@vboctor Many thanks for taking the time to review. I've responded to your comments, let me know
how I should address the version thing (#26 (comment))

Following @vboctor's recommendation in the PR's discussion:

> We may want to have the API extensibility infrastructure do the
> plugin_push_current() call so that each plugin doesn't have to worry
> about this. We can have a middle where that matches against paths
> under plugin_route_group() and pushes the base name. In preparation
> for that, it may be useful just to have one line for a push rather
> than having N places references base name
This was introduced in v0.3 (f2b7f23),
but the version information was never actually used in the javascript.

Fixes mantisbt-plugins#27
@dregad
Copy link
Member Author

dregad commented Oct 24, 2017

Something's wrong with this PR, it contains an unrelated commit and I can't seem to fix it.

@dregad dregad closed this Oct 24, 2017
@dregad dregad changed the title Use REST API instead of xmlhttprequest Use REST API instead of xmlhttprequest [CANCELLED] Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants