您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display the exact Tripadvisor note after the "bubbles"
当前为
- // ==UserScript==
- // @name Tripadvisor precise note
- // @description Display the exact Tripadvisor note after the "bubbles"
- // @namespace KrisWebDev
- // @include http://www.tripadvisor.fr/*
- // @include http://www.tripadvisor.com/*
- // @version 1
- // @grant none
- // @require http://code.jquery.com/jquery-2.1.4.min.js
- // ==/UserScript==
- this.$ = this.jQuery = jQuery.noConflict(true);
- var coeff = 5;
- var result = 0;
- var sommeAvis = 0;
- var nbAvis = 0;
- $("span.compositeCount").each(function(index, val) {
- nbAvis = parseInt($(this).text());
- result += nbAvis*coeff--;
- sommeAvis += nbAvis;
- });
- result = (Math.round(result/sommeAvis*10))/10;
- $("span.rate.sprite-rating_rr").after($("<span><b>"+result+"</b></<span>"));