MarktEnhancer

Usability fixes

Від 14.04.2020. Дивіться остання версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         MarktEnhancer
// @namespace https://greasyfork.org/users/290665
// @version      1.0
// @description  Usability fixes
// @match        https://*.markt.de/*
// @grant    GM_addStyle
// @grant    GM_download
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==

addStyle();
var myVersion = GM_info.script.version;

$(function() {
    var phone = "";
    $('.markt_expose_attrPhone_char').each(function(i,el) {
        var number = "";
        number += $(el).text();
        number += window.getComputedStyle(el,':before').content;
        console.log('number: ['+number+']');
        if (number.length) {
            number = number.replace(/none/,' ');
            number = number.replace(/ +/,' ');
            number = number.replace(/[^0-9\-+ ]+/g,'');
            phone += number;
        }
    });
    if (phone.length) {
        phone = phone.replace(/\+ +/,'+');
        var url = phone.replace(/[ -]+/g,'');
        var search = phone.replace(/ +/g,'%20');
        $('#markt_expose_attrPhone').html('<a href="tel:'+url+'">'+phone+'</a> [<a href="https://www.google.com/search?q='+search+'" target="_new">google</a>]');
    }
});


function addStyle() {
    GM_addStyle(`

`);
}