您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Quick hacky fix to restore chronological ordering to map comment conversations
当前为
// ==UserScript== // @name WME Map Comments Chronological Conversation Corrector (WMC4) // @namespace http://greasemonkey.chizzum.com // @description Quick hacky fix to restore chronological ordering to map comment conversations // @include https://*.waze.com/*editor* // @include https://editor-beta.waze.com/* // @include https://beta.waze.com/* // @exclude https://www.waze.com/user/*editor/* // @exclude https://www.waze.com/*/user/*editor/* // @grant none // @version 1.0 // ==/UserScript== /* JSHint Directives */ /* globals W: true */ /* jshint bitwise: false */ /* jshint eqnull: true */ /* jshint esversion: 6 */ function wmc4MCLayerEvent() { // re-order MC conversations after any change is detected in the MC layer var idx; console.info('WMC4 - re-ordering conversations...'); for(idx in W.model.mapComments.objects) { if(W.model.mapComments.objects.hasOwnProperty(idx)) { var convo = W.model.mapComments.objects[idx].attributes.conversation; if(convo.length > 1) { var doSwapPass = true; while(doSwapPass === true) { doSwapPass = false; for(var i = 0; i < (convo.length - 1); ++ i) { if(convo[i].createdOn > convo[i + 1].createdOn) { var tSwap = convo[i]; convo[i] = convo[i + 1]; convo[i + 1] = tSwap; doSwapPass = true; } } } } } } console.info('WMC4 - done'); } function wmc4WaitInit() { var stillWaiting = false; var mteMode = false; // check for all required objects... stillWaiting = stillWaiting || (typeof W == 'undefined'); if(stillWaiting === false) { stillWaiting = stillWaiting || (typeof W.app == 'undefined'); stillWaiting = stillWaiting || (typeof W.model == 'undefined'); stillWaiting = stillWaiting || (typeof W.loginManager == 'undefined'); } if(stillWaiting === false) { stillWaiting = stillWaiting || (typeof W.app.modeController == 'undefined'); stillWaiting = stillWaiting || (typeof W.model.mapComments == 'undefined'); } if(stillWaiting === false) { stillWaiting = stillWaiting || (typeof W.app.modeController.mode == 'undefined'); } // check for MTE mode... if(stillWaiting === false) { mteMode = (W.app.modeController.mode === undefined); if(mteMode === false) { mteMode = mteMode || (W.app.modeController.mode.mteModeState !== undefined); } } if((stillWaiting === false) && (mteMode === false)) { if(W.loginManager.isLoggedIn()) { console.info('WMC4 - ready for action'); W.model.mapComments.on("objectsadded", wmc4MCLayerEvent); wmc4MCLayerEvent(); // force a re-order just in case the MC layer loaded before the listener was set up... } else { stillWaiting = true; } } if(stillWaiting === true) { // if we weren't able to complete initialisation, try again in a little while window.setTimeout(wmc4WaitInit, 1000); } } wmc4WaitInit();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址