VRAPI Enhancements

Add map links with pushpin above map in VRAPI dashboard.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         VRAPI Enhancements
// @version      0.33
// @description  Add map links with pushpin above map in VRAPI dashboard.
// @author       Shoshi
// @include      https://safe.hostcompliance.com/*
// @include      https://safe-ca.hostcompliance.com/*
// @include      https://secure.hostcompliance.com/*
// @include      https://www.homeaway.com/vacation-rental/*
// @namespace    https://greasyfork.org/users/438196
// ==/UserScript==

const google = `https://www.google.com/maps/search/?api=1&query=`;
const bing = `https://www.bing.com/maps?where1=`;
const style = "font-weight: bold; width: 100%; text-align: center;";


if (window.location.hostname === "www.homeaway.com") {
window.onload = (e) => {
    const src = document.querySelector('.pdp-map-thumbnail').firstChild.src;
    let params = new URLSearchParams(src);
    let haCoord = params.get("center");
    let haMap = document.querySelector('.listing-overview__map');


haMap.insertAdjacentHTML('beforebegin', `

<a href=${google}${haCoord} style="${style} white-space: normal;" class="label label-default" target="_blank">Google</a><br>
<a href="${bing}${haCoord}&style=h&lvl=18" style="${style} white-space: normal;" class="label label-default" target="_blank">Bing</a>

`);
   document.querySelector('.listing-overview__col').style.cssText = "white-space: normal"
};


}


if(window.location.hostname === "safe-ca.hostcompliance.com" || window.location.hostname === "safe.hostcompliance.com" || window.location.hostname === "secure.hostcompliance.com") {
setTimeout(() => {
    const coord = document.querySelector("#circle").getAttribute("center");
    const map = document.querySelector(".map-container");
    const title = document.querySelectorAll(".md-headline")[2];
    const searchTerm = encodeURIComponent(title.innerText);
    const list = document.querySelectorAll('[ng-if="vm.listing.duplicate_listings.length"]')[0];
    const dupes = (list === undefined) ? 0 : list.getElementsByTagName('A');


    for(let i = 0; i < dupes.length; i++) {
        if(dupes != 0){
            map.insertAdjacentHTML("beforebegin", `
<a class="md-no-style md-button md-ink-ripple" style="${style} font-size: 12px" href=${dupes[i].innerText} target="_blank">${dupes[i].innerText}</a>

`);
        }

}
    map.insertAdjacentHTML("beforebegin", `

<hr>

<a class="md-no-style md-button md-ink-ripple" style="${style}" href=${google}${coord} target="_blank">Google</a><br>
<a class="md-no-style md-button md-ink-ripple" style="${style}" href="${bing}${coord}&style=h&lvl=18" target="_blank">Bing</a>
`);

   title.insertAdjacentHTML("beforeend", `

<a class="md-icon-button md-button md-ink-ripple" target="_blank" href='http://googl.com/#q="${searchTerm}"'>
<md-icon md-font-icon="fa fa-search" class="ng-scope md-font FontAwesome fa fa-search" role="img" aria-label="fa fa-search"></md-icon>

`);

}, 1500);

}