nelisovski / PIN Fixed Bugs

// ==UserScript==
// @name         PIN Fixed Bugs
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Fixed some bugs for comfortable work 
// @author       Lisovski
// @grant        GM_getResourceText
// @resource     jQuery https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @match        https://*.arenda-piter.ru/*
// @match        https://*.internet-piter.ru/*
// @copyright 2020, Lisovski (https://openuserjs.org/users/nelisovski)
// @updateURL https://openuserjs.org/meta/nelisovski/PIN_Fixed_Bugs.meta.js
// @license MIT
// ==/UserScript==

(function() {
  var head = document.getElementsByTagName('head')[0];

  var script = document.createElement('script');
  script.id = 'jquery';
  script.type = 'text/javascript';

  var jQuery = GM_getResourceText('jQuery');

  script.innerHTML = jQuery;
  head.appendChild(script);

    script_inserted = document.getElementById('jquery');
    if (script_inserted != null) {
        $ = unsafeWindow.$;
        start();
    }
})();

function start() {
if (location.href.indexOf('arenda-piter.ru') > -1 && jQuery(".link_block .swiper-wrapper img").length > 0) {
  var id = location.href.split('rv=')[1].split('&')[0];
  jQuery('.link_block .tbl04 .st03').before('<br><a style="display:inline-block;padding: 10px 20px;border:2px solid #f00;color:#f00;background:#fff;border-radius:5px;margin: 20px;font-size: 15px;" onclick="jQuery(this).attr(\'style\',jQuery(this).attr(\'style\') + \'opacity:0.5;\').text(\'Ожидайте...\');" href="https://vspb.pro/download.php?id=' + id + '" download>Скачать фото архивом</a>');
}

if (location.href.indexOf('internet-piter.ru') > -1 && jQuery(".link_block .swiper-wrapper img").length > 0) {
  var id = location.href.split('rv=')[1].split('&')[0];
  jQuery('.link_block .tbl04 .st03').before('<br><a style="display:inline-block;padding: 10px 20px;border:2px solid #f00;color:#f00;background:#fff;border-radius:5px;margin: 20px;font-size: 15px;" onclick="jQuery(this).attr(\'style\',jQuery(this).attr(\'style\') + \'opacity:0.5;\').text(\'Ожидайте...\');" href="https://vspb.pro/download.php?id=' + id + '" download>Скачать фото архивом</a>');
};
}