// ==UserScript== // @name GCUnAppifier // @author thomfre // @namespace https://thomfre.net/ // @version 0.0.1.55 // @description Fixing new dashboard experience, new profile experience, new logging experience etc. // @icon https://thomfre.net/thomfre_Heltinnen_250px.png // @include https://www.geocaching.com/* // @include https://www.geocaching.com/account/dashboard // @include https://www.geocaching.com/p/* // @include https://www.geocaching.com/map/* // @include https://www.geocaching.com/play/map* // @include https://www.geocaching.com/geocache/* // @include https://www.geocaching.com/play/geocache/*/log* // @grant GM_info // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle // @run-at document-start // @copyright 2017+, thomfre // @require https://code.jquery.com/jquery-latest.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @require https://www.geocaching.com/scripts/MarkdownDeepLib.min.js // @require https://www.geocaching.com/scripts/SmileyConverter.js // @downloadURL https://thomfre.net/gcunappifier.user.js // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); if(window.location.pathname.indexOf("/play/map") !== -1) { const constantMock = unsafeWindow.fetch; unsafeWindow.fetch = function() { return new Promise((resolve, reject) => { constantMock.apply(this, arguments) .then((response) => { if (response.url.indexOf("/api/proxy/web/v1/MapGeocache") > -1 && response.type != "cors") { let clone = response.clone(); clone.json().then(data => { if (data.owner !== undefined && data.owner.username !== undefined) { if (!$(".cache-metadata-owner").length) { $(".cache-metadata").prepend(''); } $(".cache-metadata-owner").html('By ' + data.owner.username); } }); } resolve(response); }) .catch((error) => { reject(response); }) }); } } $(document).ready(function () { console.log("Starting GC UnAppifier V. " + GM_info.script.version); var pathname = window.location.pathname; if (pathname.indexOf("/account/dashboard") !== -1) handleDashboard(); else if (pathname.indexOf("/p/default") !== -1) handleProfile(); else if (pathname.indexOf("/map/") !== -1) handleMap(); else if (pathname.indexOf("/geocache/") !== -1 && pathname.indexOf("/log") !== -1) handleLogPage(); else if (pathname.indexOf("/geocache/") !== -1) handleCachePage(); fixGeneralAnnoyances(); }); //General function fixGeneralAnnoyances() { console.log("Fixing general annoyances"); $('a[href="/play/map/"]').attr("href", "/map"); } //Profile function handleProfile() { console.log("Unappifying profile page"); profileFixStyling(); profileFixLinks(); } function profileFixStyling() { GM_addStyle('.span-20, .span-19 { width: 100% !important; }' + '#Content { background: none !important; }' + '#ProfileTabs { border: none !important; }' + '#divContentSide { display: none !important; }' + '.profile-panel { width: auto !important; }' + '.profile-banner-wrapper { display: none !important; }' + '.profile-hero-wrapper { width: auto !important; }' + '.profile-hero { width: auto !important; }'); } function profileFixLinks() { $(document).ready(function(){ let iFrame = $("iframe#iFrameUserContent"); if(iFrame.length === 0) return; let iFrameDOM = iFrame.contents(); iFrameDOM.find('a').each(function() { let link = $(this)[0]; if(link.hash !== undefined && link.hash.startsWith('#link:')) { let hrefParts = link.hash.split(':'); if(hrefParts.length === 3) { let decodedUrl = atob(hrefParts[2]); link.href = decodedUrl; } } }); }); } // Log page function handleLogPage() { console.log("Fixing log page annoyances"); GM_addStyle('.log-date { border: 1px solid !important; } ' + '.main .wrapper { max-width: 1000px !important; } ' + '.main .wrapper .muted { font-size: 0.7rem; color: #777; } ' + '.main .wrapper .muted > a { font-size: 1rem; color: #333; }' + '.main .wrapper .muted > a ~ a { font-size: 0.70rem; #777; }' + '.main .log-view-wrapper { max-width: 1000px !important; }'); GM_addStyle('.mdd_modal{background:rgba(0,0,0,.6);display:none;font-size:14px;margin:0;padding:0;position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}.mdd_modal_frame{background-color:#fff;color:#4a4a4a;height:80%;margin:10% auto;position:relative;width:680px;z-index:2000}.mdd_modal_button{background:url(/images/tlnMasters/icon-close@2x.png) no-repeat;background-size:100%;position:absolute;top:1em;right:2em;z-index:1999}#mdd_close_help{display:block;height:33px;width:32px}.mdd_modal_button span{position:absolute;left:-999em}.mdd_modal_button a{color:#fff;text-decoration:none}.mdd_modal_content{overflow:scroll;overflow-x:hidden;position:relative;width:100%;height:100%}.mdd_ajax_loader{background-position:center center;background-image:url(https://www.geocaching.com/scripts/mdd_ajax_loader.gif);background-repeat:no-repeat;width:100%;height:200px}.mdd_syntax{padding:2em 3em 1em;text-align:left}.markdowndeep-guide{overflow:hidden}.markdowndeep-guide>div{float:left;width:47.5%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.markdowndeep-guide>div+div{margin-left:5%}.mdd_modal_frame h2{color:#4a4a4a;font-size:1.57em;font-weight:400;margin:0 0 .5em;text-align:center}.markdowndeep-guide section+section{margin-top:3em}.mddg__format{font-size:.93em}.markdowndeep-guide pre{margin-bottom:0}.markdowndeep-guide button,.markdowndeep-guide code,.markdowndeep-guide pre{line-height:1.375em}.markdowndeep-guide code{font-family:"Noto Sans",Arial,Helvetica,sans-serif}.mddg__help{color:#7e7d7a;font-size:.857em;margin:0}.markdowndeep-guide pre::before{background:url(https://www.geocaching.com/scripts/sprite-mdd-htf-icons@2x.png) no-repeat;background-size:auto 16px;content:"";display:block;float:left;height:16px;margin-right:.5em}.mddg__h1 pre::before{background-position:0 1px;width:17px}.mddg__h2 pre::before{background-position:-19px 1px;width:19px}.mddg__h3 pre::before{background-position:-39px 1px;width:19px}.mddg__italic pre::before{background-position:-116px 1px;width:8px}.mddg__bold pre::before{background-position:-87px 1px;width:10px}.mddg__quote pre::before{background-position:-99px 2px;width:15px}.mddg__hr pre::before{background-position:-126px 7px;width:15px}.mddg__links pre::before{background-position:-74px 1px;height:14px;width:11px}.mddg__ulist pre::before{background-position:-142px 1px;margin-top:3px;vertical-align:top;width:14px}.mddg__olist pre::before{background-position:-158px 1px;margin-top:3px;vertical-align:top;width:14px}.mddg__example{clear:both;margin:0}.mddg__hr .mddg__example{background:#d8d8d8;border:none;display:block;height:2px;margin:1.45em 0}.mddg__h1 .mddg__example,.mddg__h2 .mddg__example,.mddg__h3 .mddg__example{font-size:1.285em;line-height:1.375em;margin-bottom:0}.mddg__h1 .mddg__example{color:#4a4a4a;font-weight:700}.mddg__h2 .mddg__example{color:#4a4a4a;font-weight:400}.mddg__h3 .mddg__example{color:#00b265;font-weight:400;text-transform:uppercase}.mddg__linebreak .mddg__format{margin:0 0 .5em}.mddg__links .mddg__example{border-bottom:1px solid transparent;color:#006cff;text-decoration:none}.mddg__links .mddg__example:hover{border-bottom:1px solid currentColor}.mddg__bold .mddg__example,.mddg__italic .mddg__example{display:block}.mddg__linebreak span{color:#00b265}.mddg__linebreak .mddg__example{margin-bottom:.5em}.mddg__olist code,.mddg__ulist code{display:inline-block;margin-bottom:.5em}.mddg__quote .mddg__example{background:0;color:#00b265;font-style:normal;font-weight:700;margin:0;padding:0;text-align:left}.mddg__quote .mddg__example p{margin:0}.mddg__quote .mddg__example p::before{content:"“"}.mddg__quote .mddg__example p::after{content:"”"}.mddg__ulist .mddg__example{margin-left:17px}.mddg__olist .mddg__example{margin-left:15px}.mddg__ulist li ul{list-style-type:none;margin-left:0;margin-bottom:0;padding-left:0}.mddg__ulist li ul li::before{background-color:#e0b70a;border-radius:50%;content:"";display:inline-block;height:5px;margin-right:.75em;margin-top:-1px;width:5px;vertical-align:middle}.smiley-guide{border-top:2px solid #4a4a4a;margin-top:2em;padding-top:2em}.smiley-guide table{width:100%}.smiley-guide table,.smiley-guide td,.smiley-guide th{vertical-align:top}.smiley-guide p{margin-bottom:1.5em}.smiley-guide img{padding:0;vertical-align:middle}.smiley-guide .td__column{padding:0;width:32%}.smiley-guide .td__column+.td__column{padding-left:2%}.smiley-guide .td__column td:first-child{width:15px}.mdd_toolbar_wrap{width:100%;margin-top: -50px;}.AdminUserLogPanel .mdd_toolbar_wrap{width:99.55%}.mdd_toolbar ul{margin:0;padding:0}span.mdd_sep{width:10px;height:20px;display:block;border-left:solid 1px gray;margin-left:10px}.mdd_links a{text-decoration:none;color:#404040}.mdd_editor_wrap{padding-right:8px}textarea.mdd_editor{width:100%;resize:none;margin:0;padding:3px}.mdd_resizer_wrap{width:100%}.mdd_resizer{background:url(https://www.geocaching.com/scripts/mdd_gripper.png) center center no-repeat #f8f8f8;padding-left:2px;padding-right:2px;height:9px;border:1px solid #d0d0d0;margin-top:-1px;cursor:n-resize}.mdd_toolbar_wrap+.mdd_editor_wrap{padding-right:1px}.mdd_toolbar_wrap .mdd_toolbar{background-color:#00b265;width:550px;display: inline-block;margin-top: 40px;padding:.385em}.mdd_links{float:right}.mdd_toolbar .mdd_links a{color:#fff;line-height:26px}.mdd_toolbar .mdd_links a:active,.mdd_toolbar .mdd_links a:focus,.mdd_toolbar .mdd_links a:hover{background-color:transparent;border-bottom:1px solid currentColor;color:#fff}#bd .mdd_toolbar .mdd_links a,#bd .mdd_toolbar .mdd_links a:active,#bd .mdd_toolbar .mdd_links a:focus,#bd .mdd_toolbar .mdd_links a:hover{color:#fff!important;text-decoration:none}#bd .mdd_toolbar .mdd_links a:active,#bd .mdd_toolbar .mdd_links a:focus,#bd .mdd_toolbar .mdd_links a:hover{border-bottom:1px solid #fff}.mdd_toolbar li{float:left;margin:0;padding:0;list-style:none}.mdd_toolbar .mdd_sep{width:5px;height:24px;display:block;border-left:solid 1px #02874d;margin-left:5px}.mdd_toolbar a.mdd_button{background:url(https://www.geocaching.com/scripts/sprite-mdd-toolbar-icons@2x.png) no-repeat;background-size:auto 15px;border-radius:50%;display:block;height:26px;margin:0 1px;width:26px}.mdd_toolbar .mdd_button:focus,.mdd_toolbar .mdd_button:hover{background-color:#02874d}.mdd_toolbar #mdd_bold{background-position:-49px 5px}.mdd_toolbar #mdd_italic{background-position:-22px 5px}.mdd_toolbar #mdd_quote{background-position:5px 6px}.mdd_toolbar #mdd_link{background-position:-238px 5px}.mdd_toolbar #mdd_hr{background-position:-75px 6px}.mdd_toolbar #mdd_h1{background-position:-157px 5px}.mdd_toolbar #mdd_h2{background-position:-183px 5px}.mdd_toolbar #mdd_h3{background-position:-210px 5px}.mdd_toolbar #mdd_ullist{background-position:-104px 6px}.mdd_toolbar #mdd_ollist{background-position:-130px 6px}.mdd_toolbar .mdd_help{margin-right:.6em}.mdd_toolbar .mdd_help:focus,.mdd_toolbar .mdd_help:hover{border-bottom:1px solid currentColor}.AdminUserLogPanel .PostLogList dd{margin-left:10em}.markdown-output{font-size:1.08em;line-height:1.375em;margin:1.5em auto;overflow:hidden;word-wrap:break-word}.markdown-output h1{color:#4a4a4a;font-size:1.285em;font-weight:700;line-height:1.375em;margin:0}.markdown-output h2,.markdown-output h3{font-size:1.285em;font-weight:400;line-height:1.375em;margin:0}.markdown-output h2{color:#4a4a4a}.markdown-output h3{color:#00b265;text-align:center;text-transform:uppercase}.markdown-output hr{background:#d8d8d8;height:2px;margin:1.45em 0}.markdown-output p{color:#4a4a4a;margin:0 0 1.5em}.markdown-output li{list-style:inherit}.markdown-output ul{list-style-type:disc}.markdown-output ol{list-style-type:decimal}.markdown-output ol,.markdown-output ul{color:#4a4a4a;margin:0 1.5em 1.5em .75em;padding-left:1.5em}.markdown-output li ol,.markdown-output li ul{margin-left:0;margin-bottom:0}.markdown-output li ul{list-style-type:none;padding-left:0}.markdown-output li ul li::before{background-color:#e0b70a;border-radius:50%;content:"";display:inline-block;height:5px;margin-right:.75em;margin-top:-1px;width:5px;vertical-align:middle}.markdown-output blockquote{background:0 0;font-style:normal;margin:1.5em .75em;padding:0;text-align:center}.markdown-output blockquote p{color:#00b265;font-weight:700}.markdown-output blockquote p::before{content:"“"}.markdown-output blockquote p::after{content:"”"}#bd .markdown-output a,.markdown-output a{color:#006cff;text-decoration:none}.markdown-output a:focus,.markdown-output a:hover{border-bottom:1px solid #006cff;color:#006cff}.LogImagesTable a:focus,.LogImagesTable a:hover{border-bottom:none}#bd .markdown-output a:focus,#bd .markdown-output a:hover{border-bottom:1px solid #006cff;color:#006cff!important}.markdown-output .AlignRight a{color:#00447c}.markdown-output .AlignRight a:visited{color:#00a0b0}.markdown-output .AlignRight a:focus,.markdown-output .AlignRight a:hover{border-bottom:none;color:#6c8e10}.markdown-output~.AlternatingRow,table .markdown-output~tr.AlternatingRow td{background:#fff}.markdown-output.BorderBottom td{border-bottom-color:#9b9b9b}.markdown-output.BorderBottom:last-child td{border-bottom:none}.markdown-output>td:last-child{padding-bottom:2.5em}'); waitForKeyElements("#LogText", function() { $("textarea#LogText").MarkdownDeep({ SafeMode :true, AllowInlineImages: false, ExtraMode: false, RequireHeaderClosingTag: true, disableShortCutKeys: true, DisabledBlockTypes: [ BLOCKTYPE_CONST.h4, BLOCKTYPE_CONST.h5, BLOCKTYPE_CONST.h6 ], help_location: "/guide/markdown.aspx", active_modal_class: "modal-open", active_modal_selector: "html", additionalPreviewFilter: SmileyConvert() }); $(".mdd_toolbar_wrap").append('