Immodem

try to take over the world!

当前为 2020-01-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Immodem
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description try to take over the world!
  6. // @author coz3n
  7. // @match https://immodem.poste-immo.intra.laposte.fr/*
  8. // @require https://greasyfork.org/scripts/394721-w84kel/code/w84Kel.js?version=763605
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let obsconf = {childList: true},
  13. url = [],
  14. css = document.createTextNode("@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local('Roboto Regular'),local('Roboto-Regular'),url(https://themes.googleusercontent.com/static/fonts/roboto/v11/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff')}html{box-sizing:border-box;overflow:hidden}*{font-family:roboto}*,:after,:before{box-sizing:inherit}body{padding:0;height:100vh}h4{font-size:16px}#page-content-wrapper,#wrapper,body{height:100vh}#wrapper{overflow-y:auto;overflow-x:hidden}#sidebar-wrapper{overflow:hidden}.container-fluid{height:100%}div vertilize-container{justify-content:space-between}#wrap{display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;flex-flow:row nowrap;justify-content:space-around}.entete{width:100%;height:48px;text-align:center;font-size:1.5em;color:#fff;text-shadow:0 1px 0 #aaa;margin:0;padding:0}.bucket{padding:24px 8px 8px;margin:0 10px;display:flex;background:#ddd;height:80vh;overflow-y:scroll;flex-flow:row wrap;flex:1 1 100%;justify-content:space-between;align-items:flex-start;align-content:flex-start;max-width:20vw}.bucket>div{width:100%!important}.taskCard{border-radius:2px!important;border:none;box-shadow:0 1px 2px 0 rgba(0,0,0,.5);transition:box-shadow .25s linear;height:auto!important}.taskCard:hover{box-shadow:0 2px 4px 1px rgba(0,0,0,.5)}.taskInfos{font-size:12px}p{margin-bottom:6px}[id=\"Validation CP\"]{order:0}#Réalisation{order:1}[id=\"Validation technique\"]{order:2}[id=\"Réception de la demande\"]{order:3}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-thumb{background:#666;border-radius:16px}::-webkit-scrollbar-track{background:#ddd;width:12px}"),
  15. initLaunch,
  16. buckets = ["Validation CP","Réalisation","Validation technique","Réception de la demande"],
  17. sessionVal = localStorage.getItem("user_session");
  18.  
  19. console.log(JSON.parse(sessionVal));
  20.  
  21. waitForKeyElements(".taskCard", card => ux(card));
  22.  
  23. function formatInfos(infos) {
  24. infos.forEach(info => {
  25. let infoSplit = info.innerHTML.split(" : ")
  26. info.innerHTML = "<b>" + infoSplit[0] + "</b> : " + infoSplit[1];
  27. });
  28. }
  29.  
  30. function ux() {
  31. let container = document.querySelector('[vertilize-container]'),
  32. card = arguments[0].parentElement,
  33. taskInfos = arguments[0].querySelectorAll('.taskInfos'),
  34. step = card.querySelector(".itemStep").innerText;
  35.  
  36. let infosFormated = formatInfos(taskInfos);
  37. card.classList.add("card");
  38. step = step.replace(/\n|\r|(\n\r)|\s/g,'');
  39.  
  40. buckets.forEach(bucketId => {
  41. let newBucketId = bucketId.replace(/\n|\r|(\n\r)|\s/g,'');
  42. let bucket = document.getElementById(newBucketId);
  43. if (!bucket) {
  44. let divBucket = document.createElement('div'),
  45. headBucket = document.createElement('h4'),
  46. tasksContainer = document.createElement('div');
  47. headBucket.innerText = bucketId;
  48. tasksContainer.classList.add("tasksContainer");
  49. divBucket.id = newBucketId;
  50. divBucket.dataset.step = newBucketId;
  51. divBucket.classList.add("stepBucket");
  52. divBucket.appendChild(headBucket);
  53. divBucket.appendChild(tasksContainer);
  54. container.appendChild(divBucket);
  55. if (step === newBucketId) {
  56. tasksContainer.appendChild(card);
  57. }
  58. } else {
  59. if (bucket.id === step) {
  60. let tasksContainer = bucket.querySelector(".tasksContainer");
  61. tasksContainer.appendChild(card);
  62. }
  63. }
  64. })
  65. }