Reddit Inline Gallery

Add's inline gallery viewmode on reddit.com

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

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           Reddit Inline Gallery
// @namespace      http://google.dcom
// @description    Add's inline gallery viewmode on reddit.com
// @version        1.2
// @include        http://www.reddit.com/*
// @include        http://*.reddit.com/*
// @exclude        http://www.reddit.com/ads/*
// @require 	   http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js
// ==/UserScript==
//

(function() {
  $('head').append('<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css">');

  $('#siteTable div.entry').each(function(index) {
    var gallink = $(this).find('p.title a.title').clone();
    gallink.addClass('fancybox');gallink.removeClass('title');gallink.removeClass('may-blank');
    gallink.attr('data-fancybox-group', 'gallery');
    gallink.attr('title', gallink.html());
    gallink.html('open gallery');

    var extension = gallink.attr('href').substr((gallink.attr('href').lastIndexOf('.') +1));
    if (extension != 'jpg' && gallink.attr('href').indexOf('imgur') != -1) {
      gallink.attr('href', gallink.attr('href') + '.jpg');
      var extension_force = true;
    }

    if (extension == 'jpg' || extension_force == true) {
      $(this).find('ul.flat-list').append('<li>' + gallink.get(0).outerHTML + '</li>');
    }
  });

  $(".fancybox").fancybox({
    openEffect  : 'none',
    closeEffect : 'none'
  });
})();