Fix project snippets button appearing when it is disabled
There was a typo in 9bcd36396b that caused the project snippets option to be shown when it is disabled.
Closes#1705
See merge request !720
Fix clone URL losing selection after a single click in Safari and Chrome
### What does this MR do?
This MR deactivates the mouseup event in the `git clone` URL to prevent the text from being deselected after a single click.
### Why was this MR needed?
In Safari and Chrome 43.0.2357.65 (42.0.2311.152 worked fine), the URL would lose selection after a single click. To reproduce:
1. Go to https://gitlab.com/gitlab-org/gitlab-ce
2. Click on the URL in the repository (HTTP is selected by default).
3. Click on the SSH button.
4. Click on the URL again.
The URL selection should be selected automatically, but it is deselected immediately.
It appears that 92544df changed the selection event from `click` to `focusin` to make copy & paste work in X11. This Stack Overflow article discusses the deselection issue in detail:
http://stackoverflow.com/questions/3380458/looking-for-a-better-workaround-to-chrome-select-on-focus-bug
### What are the relevant issue numbers?
Closes https://github.com/gitlabhq/gitlabhq/issues/9326
See merge request !698
Add file attachment support in Milestone description
### What does this MR do?
This MR adds support for attaching files to Milestone descriptions.
### Why was this MR needed?
Dropzone support should be in every Markdown area. It seems that this one was overlooked.
### What are the relevant issue numbers?
Closes#1648
See merge request !712
Add to_reference method to referable models
Now there is a single source of information for which attribute a model uses to be referenced, and its special character.
See merge request !641
Allow HipChat API version to be blank and default to v2
### What does this MR do?
This MR fixes a regression introduced in v7.11 that requires a HipChat API version to be specified when it is supposed to be optional.
### Why was this MR needed?
The "optional" HipChat API version in 57c724558 passed in a blank `api_version` when nothing was specified, and the code was not tested. This would cause a 500 Error.
### What are the relevant issue numbers?
Closes#772
See merge request !718
Prior, comparison would use the Ruby object's ID, which got out of sync
after a Spring fork and would result in erroneous test failures.
Now we just check that the compared object is a Commit and then compare
their underlying raw commit objects.
Change percent_complete rescue value from 100 to 0
The percent_complete method returns a value of 100 when a
ZeroDivisionError occurs. That seems like a very strange default for an
error case, and results in a bug when a milestone has no corresponding
issues (new, empty milestones show 100% completion). This commit changes
the rescue value to 0, and subsequently fixes#1656, which reported this
problem.
See merge request !714
The percent_complete method returns a value of 100 when a
ZeroDivisionError occurs. That seems like a very strange default for an
error case, and results in a bug when a milestone has no corresponding
issues (new, empty milestones show 100% completion). This commit changes
the rescue value to 0, and subsequently fixes#1656, which reported this
problem.
**What does this do?**
It makes sure that when you create a wiki page via the web interface, the
extention is .md instead of .markdown
**Why is this needed?**
When you're using Gollum locally, it will create pages with the .md extention.
Also .md is the best known extention for markdown. This fix will make sure that
if you're using gollum or the webinterface, the extention will be the same.
**What issues does this fix?**
Fixes https://github.com/gitlabhq/gitlabhq/issues/5204
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Fix Markdown preview not working in Edit Milestone page
### What does this MR do?
This MR removes the automatic Zen Mode URL update when a hash is present and makes Markdown preview work again in the Edit Milestone page. I think the intent was to make it possible to link to a full-screen edit with a URL (e.g. http://foo/bar/issues/1/edit#fullscreen), but I don't this has ever worked. Perhaps a future MR can support this.
### Why was this MR needed?
A JavaScript error would be seen in the Milestone Edit page:
```javascript
Uncaught error, unrecognized expression: $('.zennable input[type=checkbox]##md-preview-holder')
```
In the Milestone Edit page, apparently the use of the hash `#md-preview-holder` causes the Zen Mode JavaScript to attempt to parse the hash for the `fullscreen_` prefix and look up the checkbox based on a unknown ID.
### Are there points in the code the reviewer needs to double check?
If we want to keep this hash update, an alternative fix is to add an `if` check in the beginning of `checkboxFromLocationHash`:
```coffeescript
if (window.location.hash.indexOf('#' + ZenMode.fullscreen_prefix) == -1)
return null
```
### What are the relevant issue numbers?
* Closes#1687
* Closes https://github.com/gitlabhq/gitlabhq/issues/9325
See merge request !711