Immodem

Testing

当前为 2018-10-08 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Immodem
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Testing
// @author       You
// @match        https://immodem.poste-immo.intra.laposte.fr/*
// @grant        none
// ==/UserScript==

var css = document.createTextNode("html{box-sizing:border-box}body{background:linear-gradient(to bottom,#fff 0,#ddd 100%)!important}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}.entete{width:100%;height:48px;text-align:center;font-size:1.5em;color:#fff;text-shadow:0 1px solid #aaa}.bucket{padding:24px 8px 8px;margin:0 10px;display:flex;flex-flow:column nowrap;flex:1 100%;background:#ddd}.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}.taskCard:hover{box-shadow:0 2px 4px 1px rgba(0,0,0,.5)}p{margin-bottom:6px}@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')}*{font-family:roboto}"),
    initLaunch,
    hash,
    url = [],
    buckets = {};

window.onhashchange = function(event) {
    url = event.newURL.split("/");
    hash = url[url.length - 1];

    if (hash == "cartTasks") {
        initLaunch = setTimeout(init, 500);
    } else {
        console.log("Pas de modification sur cette url")
    };
}

function init() {
    var wrap = document.querySelectorAll("[vertilize-container]")[0],
        style = document.createElement('style');
    style.type = 'text/css';
    style.appendChild(css);
    document.head.appendChild(style);

    wrap.id = "wrap";

    var cards = wrap.children;
    for (var i = 0; i < cards.length; i++) {
        var label = cards[i].getElementsByClassName("itemStep")[0].firstElementChild.innerHTML;
        if (buckets[label]) {
            buckets[label].push(cards[i]);
        } else {
            buckets[label] = [];
            buckets[label].push(cards[i]);
        }
    }
    makeEnv(buckets, wrap);
//    wrap.appendChild(environnement);
}

function makeEnv(buckets, wrap) {
//    console.log(el);
    var step = Object.keys(buckets);
    for (var i = 0; i < step.length; i++) {
        var bucket = document.createElement("div");
        bucket.classList.add('bucket');
        bucket.id = step[i];
        for (var j = 0; j < buckets[step[i]].length; j++){
            bucket.appendChild(buckets[step[i]][j]);
        }
        console.log(bucket);
        wrap.appendChild(bucket);
    }
}