/*jslint indent: 2, unparam: true*/
/*global $: false, document: false, togglbutton: false*/

'use strict';

togglbutton.render('.issue .detail-page-description .title:not(.toggl)', {observe: true}, function (elem) {
  var link, description,
    titleElem = $(".issue .detail-page-description .title"),
    projectElem = $('.title').firstChild;
  description = titleElem.textContent;
  description = description.trim();

  link = togglbutton.createTimerLink({
    className: 'gitlab',
    description: description,
    projectName: projectElem.textContent.split(' / ').pop()
  });

  $('.issue .detail-page-description h2.title').appendChild(link);
});

/*jslint indent: 2, unparam: true*/
/*global $: false, document: false, togglbutton: false*/

'use strict';

togglbutton.render('.issue .detail-page-description .title:not(.toggl)', {observe: true}, function (elem) {
  var link, description,
    numElem = $(".identifier"),
    titleElem = $(".issue .detail-page-description .title"),
    projectElem = $('.title').firstChild;
  description = titleElem.textContent;
  description = description.trim();
  
  if (numElem !== null) {
    description = "#" + numElem.innerText.split("#").pop() + " " + description;
  }
  link = togglbutton.createTimerLink({
    className: 'gitlab',
    description: description,
    projectName: projectElem.textContent.split(' / ').pop().split(' · ')[0]
  });

  $('.issue .detail-page-description h2.title').appendChild(link);
});

Include issue number in description, remove " · Issues" from projectName
Gitlab: Include issue number in description, remove " · Issues" from projectName