Custom reddit top posts

custom reddit top posts

Stan na 19-05-2016. Zobacz najnowsza wersja.

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        Custom reddit top posts
// @namespace   http://hayageek.com
// @include 	https://*.reddit.com/r/*/top/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version     1.01
// @description custom reddit top posts
// ==/UserScript==

$( ".drop-choices" ).append("<div class='custom'>custom</div>");

$( ".drop-choices" ).append('<div class="calendar" style="display: none;"> <fieldset>\
  From: <input type="text" id="input_from">\
</fieldset>\
<fieldset>\
  To:   <input type="text" id="input_to">\
</fieldset>');

    $(document).ready(function() {
        $('.custom').mouseover(function() {
                $('.calendar').slideToggle("fast");
        });
    });

var from_$input = $('#input_from').pickadate(),
    from_picker = from_$input.pickadate('picker');

var to_$input = $('#input_to').pickadate(),
    to_picker = to_$input.pickadate('picker');


// Check if there’s a “from” or “to” date to start with.
if ( from_picker.get('value') ) {
  to_picker.set('min', from_picker.get('select'));
}
if ( to_picker.get('value') ) {
  from_picker.set('max', to_picker.get('select'));
}

// When something is selected, update the “from” and “to” limits.
from_picker.on('set', function(event) {
  if ( event.select ) {
    to_picker.set('min', from_picker.get('select'));
  }
  else if ( 'clear' in event ) {
    to_picker.set('min', false);
  }
});
to_picker.on('set', function(event) {
  if ( event.select ) {
    from_picker.set('max', to_picker.get('select'));
  }
  else if ( 'clear' in event ) {
    from_picker.set('max', false);
  }
});