您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
custom reddit top posts
当前为
- // ==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);
- }
- });