無視設定ID編集

    @@ -1,8 +1,67 @@ /* - * @title テスト。 + * @title 無視設定ID編集 * @description my bookmarklet * @include http://* * @license MIT License * @require */ -alert(localStorage) +var firstLoadFlag = true +var lsHead_ngID = 'ignv3:' +var deli = '\",\"' +var aryTail = '\"]' +if (location.href.slice(0,5) != 'https') { + lsHead_ngID = 'ign:' + deli = ':1\",\"' + aryTail = ':1\"]' +} +var list_ngID = '' +console.log(lsHead_ngID) +var test = kget(lsHead_ngID + bbs) + '' +if (test != ''){ + list_ngID = test.slice(1,-1).replace(/"/g,'').replace(/,/g,'\n').replace(/:1/g,'') +} +function kget(key){ + var val; + if(window.localStorage){ + val = localStorage.getItem(key); + } else { + val = storage[key]; + } + return val; +} +function kset(key,val){ + if(window.localStorage){ + localStorage.setItem(key,val); + } else { + storage[key] = val; + } +} +function NGID_UPD(){ + console.log() + var list_newNgID = document.getElementById("ngID_txtArea").value + list_newNgID = list_newNgID.replace(/\n{2,}/g,'\n') + list_newNgID = list_newNgID.replace(/\n\n/g,'\n').replace(/\n/g,deli) + list_newNgID = '[\"' + list_newNgID + aryTail + kset(lsHead_ngID + bbs,list_newNgID) +} + + +(window.onload = function() { + if (firstLoadFlag == true) { + firstLoadFlag = false + var div_element = document.createElement("div"); + var parent_object + div_element.style.position="fixed" + div_element.style.bottom= 0 + div_element.style.left= 0 + div_element.innerHTML = '' + div_element.innerHTML = div_element.innerHTML + '<textarea id="ngID_txtArea" wrap="off" ROWS="18" COLS="10" STYLE="resize:none; width:120px; font-size:1em; color:#00FF00; background-color:#404040; overflow:scroll; top:0"></textarea>' + div_element.innerHTML = div_element.innerHTML + '<div style="width:500px;"><div style="padding:0px"><div style="padding:0px">' + div_element.innerHTML = div_element.innerHTML + '<input type="button" id="ngID_UpdBtn" value="NGID更新" style="font-size:20px; WIDTH: 105px; HEIGHT: 45px; LEFT: 0">'; + parent_object = document.getElementsByTagName("body")[0] + parent_object.appendChild(div_element); + document.getElementById("ngID_txtArea").value = list_ngID + document.getElementById("ngID_UpdBtn").onclick = function() {NGID_UPD()}; + + } +})();
  • /*
     * @title 無視設定ID編集
     * @description my bookmarklet
     * @include http://*
     * @license MIT License
     * @require 
     */
    var firstLoadFlag = true
    var lsHead_ngID = 'ignv3:'
    var deli = '\",\"'
    var aryTail = '\"]'
    if (location.href.slice(0,5) != 'https') {
        lsHead_ngID = 'ign:'
        deli = ':1\",\"'
        aryTail = ':1\"]'
    }
    var list_ngID = ''
    console.log(lsHead_ngID)
    var test = kget(lsHead_ngID + bbs) + ''
    if (test != ''){
        list_ngID = test.slice(1,-1).replace(/"/g,'').replace(/,/g,'\n').replace(/:1/g,'')
    }
    function kget(key){
        var val;
        if(window.localStorage){
            val = localStorage.getItem(key);
        } else {
            val = storage[key];
        }
        return val;
    }
    function kset(key,val){
        if(window.localStorage){
            localStorage.setItem(key,val);
        } else {
            storage[key] = val;
        }
    }
    function NGID_UPD(){
        console.log()
        var list_newNgID = document.getElementById("ngID_txtArea").value
        list_newNgID = list_newNgID.replace(/\n{2,}/g,'\n')
        list_newNgID = list_newNgID.replace(/\n\n/g,'\n').replace(/\n/g,deli)
        list_newNgID = '[\"' + list_newNgID + aryTail
        kset(lsHead_ngID + bbs,list_newNgID)
    }
    
    
    (window.onload = function() {
        if (firstLoadFlag == true) {
            firstLoadFlag = false
            var div_element = document.createElement("div");
            var parent_object
            div_element.style.position="fixed"
            div_element.style.bottom= 0
            div_element.style.left= 0
            div_element.innerHTML = ''
            div_element.innerHTML = div_element.innerHTML + '<textarea id="ngID_txtArea" wrap="off" ROWS="18" COLS="10" STYLE="resize:none; width:120px; font-size:1em; color:#00FF00; background-color:#404040; overflow:scroll; top:0"></textarea>'
            div_element.innerHTML = div_element.innerHTML + '<div style="width:500px;"><div style="padding:0px"><div style="padding:0px">'
            div_element.innerHTML = div_element.innerHTML + '<input type="button" id="ngID_UpdBtn" value="NGID更新" style="font-size:20px; WIDTH: 105px; HEIGHT: 45px; LEFT: 0">';
            parent_object = document.getElementsByTagName("body")[0]
            parent_object.appendChild(div_element);
            document.getElementById("ngID_txtArea").value = list_ngID
            document.getElementById("ngID_UpdBtn").onclick = function() {NGID_UPD()};
    
        }
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2019/04/21 19:19:40 - 2019-04-21
  2. 2019/04/21 12:55:45 - 2019-04-21
  3. 2019/03/10 16:14:16 - 2019-03-10
  4. 2019/03/10 14:38:17 - 2019-03-10
  5. 2019/03/10 11:11:34 - 2019-03-10
  6. 2019/03/10 11:10:58 - 2019-03-10