Upland Improver

Enables clicked outside dialogs to close them

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Upland Improver
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Enables clicked outside dialogs to close them
// @author       nljuggler
// @match        https://play.upland.me/*
// @icon         https://www.google.com/s2/favicons?domain=upland.me
// @grant        none
// @require      https://code.jquery.com/jquery-2.2.4.js
// ==/UserScript==

$(function(){
    // Property dialog
    $(document).on("click", ".sc-cBOTKl.kfrDeA", function() {
        console.log("clicked");
        $(".show .close-section button").click();
    });

    // Messages, Treasures or Rrofile dialog
    $(document).on("click", ".sc-iwsKbI.gHlBcE", function() {
        console.log("clicked messages, treasures or profile");
        if ($(".card .card .with-left-side-btn button")[1] !== undefined){
            $(".card .card .with-left-side-btn button")[1].click();
        }
        else {
            $(".card .card .card .sc-bdVaJa.jvDJOL button")[0].click();
        }
    });

    $(document).on("click", ".sc-dnqmqq.hbnEBx.card,.sc-dnqmqq.hbnEBx.large_modal,.sc-ifAKCX.fnJSSS", function(e) {
        e.stopPropagation();
    });

    $(document).on("click", ".sc-iwsKbI.gHlBcE", function(e) {
        e.preventDefault();
        e.stopPropagation();
        console.log("clicked");
        $(".card .card .card button")[0].click();
    });

    //sc-dnqmqq hbnEBx card
});