Firefoxのデザイン崩れに修復対応しました

Firefoxの「全角空白が関係する改行」に対応したデザイン修正を行いました。

 

下は、操作パネルの経過表示行が改行されています。

 

 

 

下は修復後の正常なデザインです。

 

 

 

 

 「Every Page Snap 💢」の機能と操作方法

詳細は以下のページを参照ください。

 

 

 

 

「Every Page Snap 💢」を利用するには

このツールは Chrome / Edge / Firefox版の拡張機能「Tampermonkey」上で動作します。 以下に、このツールの導入手順を簡単に説明します。

 

❶「Tampermonkey」を導入します

◎ 使用しているブラウザに拡張機能「Tampermonkey」を導入する事が必要です。

既に「Tampermonkey」を導入している場合は、この手順 ❶ は不要です。 

拡張機能の導入については、以下のページに簡単な説明があるので参照ください。

 

 

❷「Tampermonkey」にスクリプトを登録します

◎「Tampermonkey」の「」マークの「新規スクリプト」タブを開きます。

 

 

 

◎「新規スクリプト」には、最初からテンプレートが記入されています。 これは全て削除して、完全に空白の編集枠に 下のコードをコピー&ペーストします。

 

〔コピー方法〕 軽量シンプルなツール「PreBox Button   」を使うと

  コード枠内を「Ctrl+左Click」➔「Copy code 」を「左Click」

  の操作で、掲載コードのコピーが可能になります。

 

◎ 最後に「ファイル」メニューの「保存」を押すと、ツールが使用可能になります。

 

 

〔 Every Page Snap 💢 〕 ver. 2.9 

 

// ==UserScript==
// @name         Every Page Snap 💢
// @namespace  http://tampermonkey.net/
// @version       2.9
// @description  「記事の編集・削除」ページで全記事の「公開設定」を記録する
// @author        Ameba Blog User
// @match        https://blog.ameba.jp/ucs/entry/srventrylist*
// @run-at        document-start
// ==/UserScript==


let retry=0;
let interval=setInterval(wait_target, 1);
function wait_target(){
    retry++;
    if(retry>100){ // リトライ制限 100回 0.1secまで
        clearInterval(interval); }
    let target=document.documentElement; // 監視 target
    if(target){
        clearInterval(interval);
        style_in(); }}

function style_in(){
    let style=
        '<style id="EPS">'+
        '#globalHeader, #ucsHeader, #ucsMainLeft h1, .l-ucs-sidemenu-area, #ucsMainRight,'+
        '#entryList .deleteCol, #entryList dl, .selection-bar, #footerAd, #globalFooter, '+
        '.checkboxAllControl { display: none !important; } '+

        '#ucsContent { width: 840px !important; background: #fff; '+
        'box-shadow: 0 0 0 100vh #c5d8e1; border-radius: 0; }'+
        '#ucsContent::before { content: unset; } '+
        '#ucsMain { margin-top: 15px; padding-top: 0 !important; background: #fff; '+
        'border-radius: 0; } '+
        '#ucsMainLeft { width: 838px !important; padding: 0 15px; float: none; } '+

        '#entryYear { margin: 0 5px; }'+
        '#entryMonth { font-size: 14px; overflow: visible; margin-top: 3px }'+
        '#entryMonth li, #entryMonth #nowMonthLi { font-weight: bold; padding: 2px 10px 0; }'+
        '#entryMonth li a:visited { color: #3970B5; }'+
        '#nowMonth { padding: 1px 6px 0; border: none; border-radius: 1px; '+
        'color: #000; box-shadow: 0 0 0 2px #0066cc; }'+

        '#entryListEdit form { display: flex; flex-direction: column } #entrySort { order: -2 }'+
        '.pagingArea { order: -1; padding: 4px; margin-bottom: -33px; '+
        'background: #ddedf3 !important; position: unset !important; }'+
        '.pagingArea a { border: 1px solid #888 } .pagingArea .active{ border: 2px solid #0066cc }'+
        '.pagingArea a, .pagingArea .active, .pagingArea .disabled { font-size: 14px; line-height: 23px }'+
        '#sorting { margin: 38px 0 4px; padding: 4px 10px; height: 110px; '+
        'font: 14px Meiryo; background: #ddedf3 }'+
        '#sorting select, #sorting ul { display: none }'+
        'input { font-family: meiryo; font-size: 14px }'+

        '#entryList li{ height: 24px; padding: 8px 5px 5px !important }'+
        '#entryList li:hover{ background-color: #e2eef0 }'+
        '#entryList li .entry-column { padding: 0; }'+

        '#entryList .leftCol, #entryList .titleCol h2{ width: 560px !important; line-height: 24px; }'+
        '#entryList .leftCol a { text-decoration: none !important; color: #3970b5 !important; }'+
        '#entryList .rightCol { flex-direction: row; align-items: center; width: 260px !important; '+
        'min-width: unset !important; margin: 0; }'+

        '#entryList .txtCol{ white-space: nowrap; font-size: 13px; margin-bottom: 2px; line-height: 16px }'+
        '#entryList .txtCol .date{ display: inline-block; padding: 2px 4px 0; font-size: 13px; color: #000; }'+

        '#entryList .status-text { display: inline-block; font-weight: normal; color: #000; '+
        'width: 64px; padding: 2px 4px 0; overflow: hidden; margin-bottom: -4px; }'+
        '#entryList ul input[value="1"] + input + li .txtCol span:first-child{ display: inline-block;'+
        'text-indent: 12px; color: #fff; background: #2196f3 !important }'+
        '#entryList ul input[value="2"] + input + li .txtCol span:first-child{ display: inline-block;'+
        'text-indent: 2px; color: #fff; background: #009688 !important }'+

        '#div0 { color: #333; margin: 10px -10px 0 15px; }'+
        '#div1 { color: #000; margin: 8px 15px; border: 1px solid #888; background: #fafcfd; }'+
        '#list_snap { padding: 2px 0 0; margin: 7px 40px 7px 0; width: 210px; }'+
        '#reset { padding: 2px 0 0; margin-right: 20px; width: 60px; }'+
        '#export { padding: 2px 0 0; margin: 7px 10px 7px 0; width: 150px; }'+
        '#import_sw { padding: 2px 0 0; margin: 7px 10px 7px 0; width: 115px; }'+
        '#import_result { display: inline-flex; padding: 2px 0 0; margin: 7px 0; width: 160px; '+
        'overflow: hidden; white-space: nowrap; }'+
        '#import { display: none; }'+
        '#snap_result { display: inline-block; margin: 6px 12px 4px; white-space: nowrap; }'+
        '</style>';

    if(!document.querySelector('#EPS')){
        document.documentElement.insertAdjacentHTML('beforeend', style); }

} // style_in()



window.addEventListener('load', function(){
    let drive_mode;
    let blogDB={}; //「アメンバー公開」の記事IDリスト
    let entry_id;
    let entry_id_DB;
    let publish_f;
    let pub_all;
    let pub_dra;
    let pub_ame;

    let ua=0;
    let agent=window.navigator.userAgent.toLowerCase();
    if(agent.indexOf('firefox') > -1){ ua=1; } // Firefoxの場合のフラグ

    let read_json=localStorage.getItem('blogDB_back'); // ローカルストレージ 保存名
    blogDB=JSON.parse(read_json);
    if(blogDB==null){
        blogDB=[['00000000000', 's']]; }

    drive_mode=blogDB[0][1]; // 起動時に動作フラグを取得
    if(drive_mode==0){ drive_mode='s'; } // 旧ファイルの救済

    reg_set();

    function reg_set(){
        let k;
        entry_id_DB=[]; // リセット
        pub_all=0;
        pub_dra=0;
        pub_ame=0;

        for(k=0; k<blogDB.length; k++){
            entry_id_DB[k]=blogDB[k][0]; // ID検索用の配列を作成
            if(blogDB[k][1]=='0'){
                pub_all +=1; continue; }
            if(blogDB[k][1]=='1'){
                pub_dra +=1; continue; }
            if(blogDB[k][1]=='2'){
                pub_ame +=1; continue; }}}

    control_pannel(drive_mode);



    function control_pannel(d){
        let box=document.querySelector('#sorting');
        if(box){

            let insert_div=
                '<div id="div0">'+
                '<input id="list_snap" type="submit">'+
                '<input id="reset" type="submit" value="初期化">'+
                '<input id="export" type="submit" value="SNAPをファイル保存">'+
                '<input id="import_sw" type="submit" value="ファイル読込み">'+
                '<span id="import_result"></span>'+
                '<input id="import" type="file">'+
                '</div>'+
                '<div id="div1">'+
                '<span id="snap_result"></span>'+
                '</div>';

            if(!box.querySelector('#div0')){
                box.insertAdjacentHTML('beforeend', insert_div); }


            let button1=box.querySelector('#list_snap');
            let button2=box.querySelector('#reset');
            let button3=box.querySelector('#export');
            let button4=box.querySelector('#import_sw');
            let span5=box.querySelector('#import_result');
            let input6=box.querySelector('#import');
            let span7=box.querySelector('#snap_result');


            if(d=='s'){
                button1.value='公開設定のSNAP開始 ▶';
                button1.onclick=function(e){
                    e.preventDefault();
                    start(); }

                function start(){
                    let conf_str=['   🔴 このページ以降の記事に関して 「公開設定」を記録します',
                                  '\n      連続動作はコントロール部にマウスに乗せると停止します'].join(' ');
                    let ok=confirm(conf_str);
                    if(ok){
                        blogDB[0][1]='c'; // 連続動作フラグをセット
                        let write_json=JSON.stringify(blogDB);
                        localStorage.setItem('blogDB_back', write_json); // ローカルストレージ 保存
                        next(); }}}


            else if(d=='c'){ // 「c」は連続動作
                button2.style.display='none'; // 動作モードが「c」の場合は非表示
                button3.style.display='none'; // 動作モードが「c」の場合は非表示
                button4.style.display='none'; // 動作モードが「c」の場合は非表示
                span5.style.display='none'; // 動作モードが「c」の場合は非表示


                button1.value='SNAPを停止  ❚❚';
                button1.style.pointerEvents='none';
                button1.style.width='760px';
                box.addEventListener('mouseover', function(e){
                    e.preventDefault();
                    box.style.background='#96b6d2';
                    stop(); }, false);

                function stop(){
                    blogDB[0][1]='s'; // 連続動作フラグをリセット
                    let write_json=JSON.stringify(blogDB);
                    localStorage.setItem('blogDB_back', write_json); } // ローカルストレージ 保存
                setTimeout(next, 400); } // 連続実行のぺージ遷移のタイミング 0.4sec ⭕


            else if(d=='e'){ // 「e」は終了
                button1.value='🔵 SNAPが終了しました';
                button1.style.pointerEvents='none';
                box.addEventListener('mouseover', function(e){
                    e.preventDefault();
                    box.style.background='#ddedf3'; }, false); }


            if(d=='s' || d=='e'){
                button2.onclick=function(e){
                    e.preventDefault();
                    blogDB=[['00000000000', 's']];
                    let write_json=JSON.stringify(blogDB);
                    localStorage.setItem('blogDB_back', write_json); // ローカルストレージ保存
                    snap_disp();
                    button2.value='〔 〕';
                    span5.textContent='';
                    input6.value=''; }

                button3.onclick=function(e){
                    e.preventDefault();
                    let write_json=JSON.stringify(blogDB);
                    let blob=new Blob([write_json], {type: 'application/json'});
                    let a_elem=document.createElement('a');
                    a_elem.href=URL.createObjectURL(blob);
                    a_elem.download='blogDB.json'; // 保存ファイル名
                    if(ua==1){
                        a_elem.target='_blank';
                        document.body.appendChild(a_elem); }
                    a_elem.click();
                    if(ua==1){
                        document.body.removeChild(a_elem); }
                    URL.revokeObjectURL(a_elem.href); }

                button4.onclick=function(e){
                    e.preventDefault();
                    input6.click(); }

                input6.addEventListener("change", function(){
                    if(!(input6.value)) return; // ファイルが選択されない場合
                    let file_list=input6.files;
                    if(!file_list) return; // ファイルリストが選択されない場合
                    let file=file_list[0];
                    if(!file) return; // ファイルが無い場合

                    let file_reader=new FileReader();
                    file_reader.readAsText(file);
                    file_reader.onload=function(){
                        if(file_reader.result.slice(0, 15)=='[["00000000000"'){ // blogDB.jsonの確認
                            let data_in=JSON.parse(file_reader.result);
                            blogDB=data_in; // 読込み上書き処理
                            let write_json=JSON.stringify(blogDB);
                            localStorage.setItem('blogDB_back', write_json); // ローカルストレージ 保存
                            button2.value='初期化'; // 初期化後なら読み込んだ事を示す
                            snap_disp();
                            span5.textContent=file.name; }
                        else{
                            alert("   ⛔ 不適合なファイルです  blogDB(n).json ファイルを選択してください"); }}
                }); }

            snap_disp(); } // if(box)

    } // control_pannel()



    function snap_disp(){
        reg_set();
        let span7=document.querySelector('#snap_result');
        span7.innerHTML=' 記録件数:<b>' + (blogDB.length -1) + '</b>  全員に公開:<b>' + pub_all +
            '</b>  アメンバー限定公開:<b>' + pub_ame + '</b>  下書き:<b>' + pub_dra; +'</b>'; }



    function next(){
        let win_url;
        let current;
        let pageid;
        let next_url;
        let pager;
        let end;

        entry_id=document.querySelectorAll('input[name="entry_id"]');
        if(entry_id.length >0){
            snap(); } // 投稿記事がある場合SNAPを実行 無ければスルーする

        win_url=window.location.search.substring(1,window.location.search.length);
        current=win_url.slice(-6);
        if(!current){ current=make_curr(); }

        if(win_url.indexOf('pageID') ==-1){ // pageIDが無い 月のトップページの場合
            pager=document.querySelector('.pagingArea');
            if(pager){ // ページャーが有りその末尾でなければ同月次ページへ
                next_url=['https://blog.ameba.jp/ucs/entry/srventrylist.do?',
                          'pageID=2&entry_ym=' + current].join('');
                window.open( next_url, '_self'); }
            else{ // ページャーが無ければ次月トップページへ
                current=make_next(current);
                if(current!=0){ // 現在を越えないなら次月へ
                    next_url=['https://blog.ameba.jp/ucs/entry/srventrylist.do?',
                              'entry_ym=' + current].join('');
                    window.open( next_url, '_self'); }
                else{ // 現在を越えたら0が戻り停止
                    when_edge(); }}}

        else{ // pageIDを含み 月のトップページでない場合
            end=document.querySelector('.pagingArea .disabled.next');
            if(!end){ // ページャーの末尾でなければ同月次ページへ
                pageid=parseInt(win_url.slice(7).slice(0, -16), 10) +1;
                next_url=['https://blog.ameba.jp/ucs/entry/srventrylist.do?',
                          'pageID=' + pageid + '&entry_ym=' + current].join('');
                window.open( next_url, '_self'); }
            else{ // ページャーの末尾なら次月トップページへ
                current=make_next(current);
                if(current!=0){ // 現在を越えないなら次月へ
                    next_url=['https://blog.ameba.jp/ucs/entry/srventrylist.do?',
                              'entry_ym=' + current].join('');
                    window.open( next_url, '_self'); }
                else{ // 現在を越えたら0が戻り停止
                    when_edge(); }}}


        function make_next(curr){
            let ym;
            let y;
            let m;
            ym=parseInt(curr, 10); // 10進数値化
            y=Math.floor(ym/100); // 年は100で割った商
            m=ym % 100; // 月は100で割った余り
            if(m !=12){
                ym=100*y + m +1; }
            else{
                ym=100*y + 101; }

            let now=new Date();
            if(ym > 100*now.getFullYear() + now.getMonth() +1){
                return 0; } // 現在の月を越える場合は0を返す
            else{
                return ym; }} // 次年月の数値を返す


        function make_curr(){
            let now=new Date();
            return 100*now.getFullYear() + now.getMonth() +1 }


        function when_edge(){
            blogDB[0][1]='s'; // 連続動作フラグをリセット
            let write_json=JSON.stringify(blogDB);
            localStorage.setItem('blogDB_back', write_json); // ローカルストレージ保存
            document.querySelector('#div0').remove();
            document.querySelector('#div1').remove();
            control_pannel('e'); } // SNAP終了時の表示をさせる

    } // next()



    function snap(){ // ページ内の「公開設定」をSNAPする
        let k;
        entry_id=document.querySelectorAll('input[name="entry_id"]');
        publish_f=document.querySelectorAll('input[name="publish_flg"]');

        for(k=0; k< entry_id.length; k++){
            let index=entry_id_DB.indexOf(entry_id[k].value);
            if(index==-1){ // IDがblogDBに記録されていない場合
                blogDB.push([entry_id[k].value, publish_f[k].value]); } // 公開設定の登録を追加
            else{ // IDがblogDBに記録されていた場合
                blogDB[index]=[entry_id[k].value, publish_f[k].value]; }} // 公開設定の登録を更新
        setTimeout(write_local, 10);

        function write_local(){
            let write_json=JSON.stringify(blogDB);
            localStorage.setItem('blogDB_back', write_json); }} // ローカルストレージ保存

});


 

 

 

「Every Page Snap 💢」最新版について 

旧いバージョンの JavaScriptツールは、アメーバのページ構成の変更で動作しない場合があり、導入する場合は最新バージョンをお勧めします。

 

●「Every Page Snap 💢」の最新バージョンへのリンクは、以下のページのリンクリストから探せます。