Lazy Input for MGSV:TPP Malicious Actions Reporting

This script will save last your inquiry_id, platform, type and mode on your browser storage so you don't need to input it again next time. And set the time to now.

Verze ze dne 28. 06. 2016. Zobrazit nejnovější verzi.

// ==UserScript==
// @name         Lazy Input for MGSV:TPP Malicious Actions Reporting
// @namespace    https://www.konami.co.jp/service_support/mgs/tpp/report/index.php5
// @version      0.1
// @description  This script will save last your inquiry_id, platform, type and  mode on your browser storage so you don't need to input it again next time. And set the time to now.
// @author       @suPirman
// @match        https://www.konami.co.jp/service_support/mgs/tpp/report/index.php5*
// @grant        none
// @run-at document-end
// ==/UserScript==

(function() {
    'use strict';
    if(typeof(Storage) !== "undefined") {
        var d= new Date();
        $('select[name=year]').val(d.getUTCFullYear()).change();
        $('select[name=month]').val(d.getUTCMonth()+1).change();
        $('select[name=day]').val(d.getUTCDate()).change();
        $('select[name=hour]').val(d.getUTCHours()).change();
        $('select[name=minute]').val(d.getUTCMinutes()).change();
        $('input[name=inquiry_id]').val(localStorage.tpp_report_inquiry_id).change();
        $('select[name=platform]').val(localStorage.tpp_report_plaform).change();
        $('select[name=type]').val(localStorage.tpp_report_type).change();
        $('select[name=mode]').val(localStorage.tpp_report_mode).change();

        $("a:contains('Send')").click(function(){
            localStorage.setItem("tpp_report_inquiry_id", $('input[name=inquiry_id]').val());
            localStorage.setItem("tpp_report_plaform", $('select[name=platform]').val());
            localStorage.setItem("tpp_report_type", $('select[name=type]').val());
            localStorage.setItem("tpp_report_mode", $('select[name=mode]').val());
        });
    } else {
        // Sorry! No Web Storage support..
    }
})();