// ==UserScript== // @name IBM-Weather-UI // @name:ZH-CN IBM-Weather-UI // @name:ZH-TW IBM-Weather-UI // @namespace https://github.com/li-zyang // @version 1.0.1 // @description An enchanced UI for weather.com // @description:ZH-CN 一个用于 weather.com 的优化 UI // @description:ZH-TW 一個用於 weather.com 的優化 UI // @author 阿昭 // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAlCAYAAADFniADAAADLklEQVRYhe2Wv46qQBTGeQQewUfgDeQNsKZZGwsqCS0ma4OlSGdBomtDosUaQotaKZ0kVFqoCZVGo4XSfre4Oyfin7vcTXbdwpOQDDBn+OXjzHeG4yQFvy24J1TGeEJljSdU1nhCZY3fD3U4JRhF86tLtXuPg5ouYuT1OnhZQ65UQV6vo+p4EHXzcVAsRN1E1fEAAFXHQ65UQaHWhKibWG12OJwSuu8H4eOghtEMgmqg7U9QtDoo1JroByF4WXsMFPt97Lmom+Akha5fAcWUAoBRNP8ZqLLdRcsfAwBa/hhlu5t6vj8mkGpNCKqBF+vtZ6AeHd8KNYrmOJyS/8678ilOUrDa7ND2J+AkBaNojn4QZi7oUTSnesyVKl+quSuleFlD259AtXvgJAUNd5Aq9lE0R8MdkAKrzQ4Nd0B+VbQ6EFQD4TKGqJto+xNUHQ+rzQ7A367RcAcEGy5jWvMuVKHWhGr3IOomBNVA0erQrmO+VLa7yJUqpEbZ7oKXNQJhvsbWKNSaqflFq4NcqYJ+EJIPvn6oexOq4Q7Ih9iYlzWMojmpUHU8+s39IIRq92jOpYWw/slKgZMUmlN1vJtt7ApqFM3Byxp4WcNyvU0ZJFNtGM0wjGb0kfcghKAan0Kxmu0HIYbRDNNFnA0KADhJoYm8rNF4GM1IflE3CZoppdo9NNwB1eUlFCsPUTdT9ZYJarqIsVxvaTxdxPRuud5iGM2wPyap++V6m8pZrreYLmLsjwn2xwTDaEZrMJVY/vn6d6EeHTehWIEXrQ5Wmx1ypcqXTDBLsFr8J5Rq9yCoBt6DkPof2znfEbfWvmuel4m8rNF2ZupxkgJBNQCAPIkV/v6Y0Hu24w6nBIJq0KExM9TNSR+LXjr7uf+IugnV7qEfhDSH5RWtDnkS+12cpCBcxtmhbil17kGrzQ6cpKBsd1NQVcej8WUeu3hZQ16vI6/Xybc+hWKJbX9CPe4SquEOqE0wNbJAtf0JNWnW626Wy63dxw52putjf0zw6njkR+yQ92K9Qao18ep4mC5itPwx+RXbIOd5zKda/hgv1htM1wcAvAdhqu/dhXp0PKGyxh869SPFcsnM3QAAAABJRU5ErkJggg== // @license CC0 // @include https://weather.com/* // @exclude none // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // @grant GM_setValue // @grant GM_getValue // @grant GM_listValues // @grant GM_deleteValue // @grant GM_addValueChangeListener // @grant GM_removeValueChangeListener // @grant GM_addStyle // @grant GM_setClipboard // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_download // @grant GM_getTab // @grant GM_saveTab // @grant GM_getTabs // @grant GM_setClipboard // @grant GM_info // @grant GM_openInTab // @grant GM_notification // @grant GM_getResourceText // @grant GM_getResourceURL // @connect * // @noframes // @run-at document-end // @note v1.0.0 2021-06-18 随便改了改 // @downloadURL https://update.greasyfork.icu/scripts/428121/IBM-Weather-UI.user.js // @updateURL https://update.greasyfork.icu/scripts/428121/IBM-Weather-UI.meta.js // ==/UserScript== (function(window, $) { 'use strict'; window.IBMWeatherUIJS = {}; var s = window.IBMWeatherUIJS; function isDescendentOf (elem, pElemList) { while (!$(elem).filter('html').length) { var parent = $(elem).parent(); for (var pElem of pElemList) { if (parent[0] == pElem) { return true; } } elem = parent; } return false; } s.isDescendentOf = isDescendentOf; if (location.toString().match(/https?:\/\/weather.com\/((\w|-)*\/)?weather\/today\//)) { $('[id*="WxuAirQuality-sidebar-"]').after($('#todayDetails')); } else if ( location.toString().match(/https?:\/\/weather.com\/((\w|-)*\/)?weather\/hourbyhour\//) || location.toString().match(/https?:\/\/weather.com\/((\w|-)*\/)?weather\/tenday\//) ) { $('aside.region-sidebar').prepend($('[id*="WxuTodayMapCard-main-"]')); } $('html').append($(` `)); })(window.unsafeWindow, $);