<commit_before>/*jslint indent: 2 */
/*global $: false, document: false, togglbutton: false*/

/* For main task (not a subtask) */
togglbutton.render('.commonInfoTaskDescription:not(.toggl)', {observe: true}, function () {
  'use strict';

  var link, description, project;
  description = $('#essenceTitle') || {};
  project = $('.task-desc-block .value a') || {};

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description.textContent,
    projectName: project.textContent,
    buttonType: 'minimal'
  });
  $('.project-title').appendChild(link);
});

/* For subtasks */
togglbutton.render('.subtasks .subtask:not(.toggl):not(.closed)', {observe: true}, function (elem) {
  'use strict';

  var link, description, project, button;
  description = $('.taskName span', elem) || {};
  project = $('.task-desc-block .value a') || {};

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description.textContent,
    projectName: project.textContent,
    buttonType: 'minimal'
  });
  elem.insertBefore(link, $('.check', elem));
  button = $('.toggl-button.onlyoffice', elem);
  if (button && button.style) {
    button.style.float = 'left';
  }
});

/* For main project screen */
togglbutton.render('.taskList .task:not(.toggl):not(.closed)', {observe: true}, function (elem) {
  'use strict';

  var link, description, project, button;

  description = $('.taskName a', elem) || {};
  project = $('#essenceTitle') || {};

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description.textContent,
    projectName: project.textContent,
    buttonType: 'minimal'
  });
  elem.insertBefore(link, $('.check', elem));
  button = $('.toggl-button.onlyoffice', elem);
  if (button && button.style) {
    button.style.float = 'left';
  }
});<commit_msg>Added trim to onlyoffice description and projectname<commit_after>/*jslint indent: 2 */
/*global $: false, document: false, togglbutton: false*/

/* For main task (not a subtask) */
togglbutton.render('.commonInfoTaskDescription:not(.toggl)', {observe: true}, function () {
  'use strict';

  var link, description, project;

  description = $('#essenceTitle');
  description = (!!description) ? description.textContent.trim() : null;

  project = $('.task-desc-block .value a');
  project = (!!project) ? project.textContent.trim() : null;

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description,
    projectName: project,
    buttonType: 'minimal'
  });
  $('.project-title').appendChild(link);
});

/* For subtasks */
togglbutton.render('.subtasks .subtask:not(.toggl):not(.closed)', {observe: true}, function (elem) {
  'use strict';

  var link, description, project, button;

  description = $('.taskName span', elem);
  description = (!!description) ? description.textContent.trim() : null;

  project = $('.task-desc-block .value a');
  project = (!!project) ? project.textContent.trim() : null;

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description,
    projectName: project,
    buttonType: 'minimal'
  });
  elem.insertBefore(link, $('.check', elem));
  button = $('.toggl-button.onlyoffice', elem);
  if (button && button.style) {
    button.style.float = 'left';
  }
});

/* For main project screen */
togglbutton.render('.taskList .task:not(.toggl):not(.closed)', {observe: true}, function (elem) {
  'use strict';

  var link, description, project, button;

  description = $('.taskName a', elem);
  description = (!!description) ? description.textContent.trim() : null;

  project = $('#essenceTitle');
  project = (!!project) ? project.textContent.trim() : null;

  link = togglbutton.createTimerLink({
    className: 'onlyoffice',
    description: description,
    projectName: project,
    buttonType: 'minimal'
  });
  elem.insertBefore(link, $('.check', elem));
  button = $('.toggl-button.onlyoffice', elem);
  if (button && button.style) {
    button.style.float = 'left';
  }
});
{'fraction_non_alphanumeric': 0.18118811881188118, 'fraction_numerical': 0.0004950495049504951, 'mean_word_length': 4.194087403598972, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6625938', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1230, 'n_words': 290}