Skip to content

Instantly share code, notes, and snippets.

@gunr2171
Created August 14, 2015 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gunr2171/70aa46bbdb1f617920dc to your computer and use it in GitHub Desktop.
Save gunr2171/70aa46bbdb1f617920dc to your computer and use it in GitHub Desktop.
// this should be reviewed and expanded, then put into the main list
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match http://stackoverflow.com/questions/*
// @grant none
// ==/UserScript==
var postMenu = $('#question .postcell .fw .post-menu');
var cvButton = $('<a href="#">cv-plz</a>');
postMenu.append(cvButton);
cvButton.on('click', function() {
var tit = $('#question-header h1 a').text();
$('#question .post-menu .short-link').click();
var url = $('.share-tip input').val();
$('.share-tip a.close-share-tip').click();
var reason = window.prompt('Reason for closing');
var result = '[tag:cv-pls] ' + reason + ' [' + tit + '](' + url + ')';
window.prompt("Copy to clipboard: Ctrl+C, Enter", result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment