MaximeD/gitlab_commit_creator — pull request #1 by oelmekki (2014-08-09 14:49:16+00:00)
Title: FIX turbolinks and merge_requests other actions

There were two problems with initial release :

1. code would be triggered on all page matching "merge_requests" even if
they were not merge request creation - like `merge_requests#show` - and
generated errors

2. gitlab is using turbolinks, so extension code would only be loaded on
merge creation page if it was a first load or a page reload

Fixed it by binding execution on [page:load
event](https://github.com/rails/turbolinks#events) and checking if merge
request creation inputs are present in page.

Since extension may be loaded on any page and merge requests would be
accessed from there using pjax, we can't just load extension if url
matches `/merge_requests/`.

Instead, extension will be loaded on any page, and will check if there
is a `meta[name="description"]` element containing `/GitLab/`.