Tasks Inject Link in Timesheets

A Way to... well.. adding simple HTML link to tasks and project

当前为 2023-08-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Tasks Inject Link in Timesheets
  3. // @namespace com.firemonkey.co.talenta.hr
  4. // @version 0.1
  5. // @license MIT
  6. // @description A Way to... well.. adding simple HTML link to tasks and project
  7. // @author Benyamin Limanto <me@benyamin.xyz>
  8. // @match *://hr.talenta.co/*
  9. // @icon https://www.google.com/s2/favicons?domain=hr.talenta.co
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var linkTask = '<a data-v-1d6e5c48="" data-v-46a22fd4="" target="_blank" class="text-decoration-none" href="https://hr.talenta.co/tasks/index">' +
  16. '<i class="ic ic-doc"></i> ' +
  17. '<span class="text-body">Tasks</span></a>';
  18. var spanContainer = document.createElement('span');
  19. spanContainer.innerHTML = linkTask;
  20. var linkProject = ' &nbsp;&nbsp;<a target="_blank" class="text-decoration-none" href="https://hr.talenta.co/tasks/projects">' +
  21. '<i class="ic ic-product"></i> ' +
  22. '<span class="text-body">Projects</span></a>';
  23. spanContainer.innerHTML += linkProject;
  24. var timer = setInterval(function() {
  25. var actionContainer = document.querySelector(".tl-header__action");
  26. if (actionContainer !== null){
  27. console.log(actionContainer.children[0]);
  28. actionContainer.children[0].before(spanContainer);
  29. clearInterval(timer);
  30. }
  31. }, 1000);
  32. })();