Pastebin selector language

With this script you can select language via hash

  1. // ==UserScript==
  2. // @name Pastebin selector language
  3. // @version 1.1
  4. // @description With this script you can select language via hash
  5. // @author Maxeo | maxeo.net
  6. // @license https://creativecommons.org/licenses/by-sa/4.0/
  7. // @include https://pastebin.com/*
  8. // @icon https://www.maxeo.net/imgs/icon/android-chrome-192x192.png
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/88678
  11. // ==/UserScript==
  12. (function () {
  13. 'use strict';
  14. var not_find = 1
  15. $('select[name=paste_format] option').each(function () {
  16. if (not_find && ($(this).html() + ' ').toUpperCase().indexOf(document.location.hash.substr(1).toUpperCase()) + 1) {
  17. $('select[name=paste_format]').val($(this).val()).change()
  18. not_find = 0;
  19. }
  20. })
  21. }) ();