Multireddit to link

Convert a new-style multireddit to an old-style link

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Multireddit to link
// @namespace    https://nucular.github.io
// @version      0.2
// @description  Convert a new-style multireddit to an old-style link
// @author       nucular
// @match        https://www.reddit.com/*/m/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';

  $("<a></a>")
  .attr("href",
    "https://www.reddit.com/r/" +
      $(".titlebox.multi-details .subreddits li").map(function(i, li) {
        return $(li).find("a").attr("href").match(/\/r\/(.+)/)[1];
      }).toArray().join("+")
  )
  .attr("target", "__new")
  .css("margin-right", "12px")
  .append(
    $("<button>multilink</button>")
  )
  .prependTo(
    $(".titlebox.multi-details .gray-buttons.settings .spacer")
   );
})();