您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
remet la jauge de température sur les deals.
当前为
// ==UserScript== // @name Back to dealabs // @namespace http://tampermonkey.net/ // @version 1.0.1 // @description remet la jauge de température sur les deals. // @author Rasmus // @match https://www.dealabs.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function addJauge(t) { var class_temperature = ''; var color = ''; 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'; color = 'orange'; if(temperature >= 100) { class_temperature = 'deal--hot'; color = 'red'; } } else { class_temperature = 'deal--cold'; color = 'deepskyblue'; } temperature = Math.abs(temperature); t.append("<div class='jauge' style='width:3em;grid-column: 5;grid-row: 1;grid-row-end: 5;position:relative;'><div class='jauge-fill "+ class_temperature +"' style='z-index:3;position:absolute;margin-top:10px;bottom:10px;width:10px;right:0;background-color:"+ color +";height:"+ temperature +"%;'></div><div class='jauge-background' style='height:100%;position:absolute;margin-top:10px;bottom:10px;width:10px;right:0;background-color:grey;'></div></div>"); } $('.thread--deal .threadGrid, .thread--voucher .threadGrid').not('.jauge').each(function() { addJauge($(this)); }); $( document ).ajaxStop(function() { $('.thread--deal .threadGrid, .thread--voucher .threadGrid').not('.jauge').each(function() { addJauge($(this)); }); }); })();