Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // ==UserScript==
  2. // @name E-sim companies
  3. // @namespace http://history.unixstorm.org/staff/js/
  4. // @version 0.1
  5. // @description adds new column 'Worklog' with links to workers' working history
  6. // @author Michal
  7. // @include /^https?:\/\/(.*)\.e-sim\.org\/company.html?.*$/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. $(`table:last.dataTable`).width(400);
  14.  
  15. $("<td>Worklog</td>").appendTo($(`table:last > tbody > tr.tableHeader`));
  16.  
  17. $(`table:last > tbody > tr.tableRow`).each(function(){
  18. let $link = $(this.querySelector('td:nth-child(1) > a ')).attr('href');
  19. let id = /id=(\d*)/.exec($link)[1];
  20. $(`<td><a target="_blank" href=workResults.html?id=`+id+`>log</a>`).appendTo(this);
  21. });
  22.  
  23. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement