// ==UserScript== // @name Back to dealabs // @namespace http://tampermonkey.net/ // @version 1.3 // @description remet la jauge de température sur les deals. // @author Rasmus // @match https://www.dealabs.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var css = ""; if (false || (new RegExp("^.*dealabs.com/(?!.*/.*/edit|submission).*$")).test(document.location.href)) css += [ ".jauge {", " width:3em;", " grid-column: 5;", " grid-row: 1;", " grid-row-end: 5;", " position:relative;", "}", "", ".jauge-fill {", " z-index:3;", " position:absolute;", " margin-top:10px;", " bottom:0;", " width:10px;", " right:0;", " border-radius: 0 0 5px 5px;", "}", "", ".jauge-background {", " height:100%;", " position:absolute;", " margin-top:10px;", " bottom:0;", " width:10px;", " right:0;", " background-color:grey;", " border-radius: 0 0 5px 5px;", "}", "", ".jauge-fill.deal--hot {", " background-color: #DF0033;", "}", "", ".jauge-fill.deal--start {", " background-color: #FF7900;", "}", "", ".jauge-fill.deal--cold {", " background-color: #36B7CD;", "}", ].join("\n"); if (typeof GM_addStyle != "undefined") { GM_addStyle(css); } else if (typeof PRO_addStyle != "undefined") { PRO_addStyle(css); } else if (typeof addStyle != "undefined") { addStyle(css); } else { var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length > 0) { heads[0].appendChild(node); } else { // no head yet, stick it whereever document.documentElement.appendChild(node); } } function addJauge(t) { var class_temperature = ''; var temperature = parseInt(t.find('.vote-box > span').text().replace('°', '').replace('Expiré', '').trim()); temperature = temperature > 100 ? 100 : temperature; if(temperature >= 0) { class_temperature = 'deal--start'; if(temperature >= 100) { class_temperature = 'deal--hot'; } } else { class_temperature = 'deal--cold'; } temperature = Math.abs(temperature); t.append("