Skip to content

Instantly share code, notes, and snippets.

@ygun
Last active May 18, 2018 15:17
Show Gist options
  • Save ygun/56d320cc5b901a71154a28c2c8ea1281 to your computer and use it in GitHub Desktop.
Save ygun/56d320cc5b901a71154a28c2c8ea1281 to your computer and use it in GitHub Desktop.

Revisions

  1. ygun revised this gist May 18, 2018. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions cleanup.js
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,10 @@
    // ==UserScript==
    // @name Clean comments on antitreningi.ru
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @version 0.2
    // @description try to take over the world!
    // @author You
    // @match http://antitreningi.ru/ru/student/lessons/lesson/*
    // @require https://code.jquery.com/jquery-2.1.4.min.js
    // @grant none
    // ==/UserScript==

    @@ -16,7 +15,10 @@
    var $ = window.jQuery;
    switch (e.keyCode) {
    case 120: //F9
    $(".b-hwtest__one__answer > i").remove();
    var elements = document.querySelectorAll('.b-hwtest__one__answer > i');
    Array.prototype.forEach.call(elements, function(el, i) {
    el.parentNode.removeChild(el);
    });
    break;
    default:
    break;
  2. ygun created this gist May 16, 2018.
    26 changes: 26 additions & 0 deletions cleanup.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    // ==UserScript==
    // @name Clean comments on antitreningi.ru
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @description try to take over the world!
    // @author You
    // @match http://antitreningi.ru/ru/student/lessons/lesson/*
    // @require https://code.jquery.com/jquery-2.1.4.min.js
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';
    // Your code here...
    function doc_keyUp(e) {
    var $ = window.jQuery;
    switch (e.keyCode) {
    case 120: //F9
    $(".b-hwtest__one__answer > i").remove();
    break;
    default:
    break;
    }
    }
    document.addEventListener('keyup', doc_keyUp, false);
    })();