// ==UserScript== // @name [PseudoTweetDeck] HomeTL/List/User/Searchページの自動更新と既読管理 // @namespace http://coltpythonkingcobra.g1.xrea.com/pseudoTweetdeck/ // @version 1.5.11082100 // @description TwitterWEB(X)の各種ページの自動更新(停止可能)、タイトル文字列の置換と絶対時間表示、既読管理などを行う // @author @PseudoTwDk // @match https://twitter.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com // @run-at document-idle // @grant none // ==/UserScript== //バージョン情報(ヘルプ・コンフィグ表示用) const VERSION_INFO = "1.5.11082100"; /************************************************************ ローカル保存データの読み書き関連 ************************************************************/ //配布ページURL const PSEUDO_URL = "http://coltpythonkingcobra.g1.xrea.com/pseudoTweetdeck/"; //ローカルストレージのオブジェクトアクセス用キー文字列 const LOCAL_DATA_KEY = "PseudoTwDk_JSON"; //リロード時間記録のキー(複数タブで同時にアクセスされる可能性があるので処理時間短縮のためオブジェクト型ではなく直接ローカルストレージに読み書きする) const FORCEUPDATE_HEADER = "PseudoTwDk_Reload"; //ローカルストレージ読み書き時のシステム分類キー const KEY_SYSTEM = "SYSTEM"; /* localStorage保存キー */ //システムで一意のもの const COLORMODE_HEADER = "ColorThemeMode";// カラーモード const CHGTIME_HEADER = "ChangeTimestamp";// タイムスタンプの置換 const READCOUNT_HEADER = "ReadPointCount";// 既読ポイント数 const READCHK_HEADER = "ReadPointEnable";// 既読マークの有効無効 const EDITDISP_HEADER = "DispEditControl";// ツイート欄の表示 const NEWTWDISP_HEADER = "DispNewTwHeader";// 上部の新着数表示 const CLICKNEW_HEADER = "AutoClickNewTw";// 上部の新着を自動的に押す const POPUPTIME_HEADER = "PopupDispTime";// ポップアップを表示する時間 const ENDOMTIME_HEADER = "EnableDOMTime";// DOM更新時間を非アクティブでも表示 const NOCOUNTDN_HEADER = "NoCountDownDisp";// カウントダウンを表示しない const NODISPSAME_HEADER = "NoDispSameTw";// 同一ツイートのRTを並べない const HDOPACITY_HEADER = "HeaderOpacity";// 情報表示部+ボタンの不透明度 const MANTRIGNEW_HEADER = "ManTrigNewTw";// 更新直後に新着表示が出たら押す const IMAGENEW_HEADER = "OpenImageNewTab";// 画像サムネイル左クリックで別タブ表示 const IMAGEORG_HEADER = "OpenImageNewOrg";// 画像サムネイル左クリック時のorig/large const LOCKTIME_HEADER = "ReloadLockTime";// 強制リロードが連続しない排他時間 const IDLESHORT_HEADER = "IdleShortTimer";// 短周期タイマを停止するまでの時間 const INITWAIT_HEADER = "InitialWait";// 起動待ち合わせ時間 const SHORTINTVL_HEADER = "ShortInterval";// 短周期タイマのインターバル const ONTOPWAIT_HEADER = "OnTopUpdWait";// 最上部にスクロールを戻した直後のトリガ const RELOADWAIT_HEADER = "ReloadWait";// 強制リロード待ち時間 const CHKENAOP_HEADER = "CheckBoxOpaEn";// チェックボックス有効時の不透明度 const CHKDISOP_HEADER = "CheckBoxOpaDs";// チェックボックス無効時の不透明度 const INFOWIDTH_HEADER = "InfoAreaWidth";// 情報表示部の幅 const INFOHEIGHT_HEADER = "InfoAreaHeight";// 情報表示部の高さ const FONTTEXT_HEADER = "FontTextSize";// 表示部のフォントサイズ const FONTBTN_HEADER = "FontButtonSize";// ボタンのフォントサイズ const BGCYCLE_HEADER = "BackgroundCycle";// 既読背景色パターンの繰り返しタイプ const HELPPOPUP_HEADER = "DispHelpPopup";// ヘルプツールチップの表示 const SEACSS_HEADER = "SearchCSSExt";// 検索ページ更新時にCSSを無効にする const SEACSSW_HEADER = "SearchCSSWait";// 検索ページ更新時のCSS無効待ち時間 //URL個別のキーとなるもの const INTERVAL_HEADER = "UpdateInterval";// 自動更新インターバル const CHKCOLOR_HEADER = "CheckedBgType";// 既読背景色の表示タイプ const MANUAL_HEADER = "UpdateHoldTime";// 更新後の禁止期間 const RELOAD_HEADER = "ReloadInterval";// 強制リロードインターバル const AUTOOFF_HEADER = "AutoOffMode";// 強制AutoOFFモード const IDLETM_HEADER = "ShortTimerIdle";// 短周期タイマを都度停止するか const MEDIA_HEADER = "MediaDispType";// メディアサムネイル表示サイズ const NOTRT_HEADER = "NotDispRtQuote";// RT&Quoteの非表示 const NOTICON_HEADER = "NotDispExtIcon";// 下部アイコン類の非表示 const CONTDLY_HEADER = "ContinuousDelay";// 新着積み上げの遷移待ち時間 const CONTRET_HEADER = "ContinuousRetTm";// 新着積み上げの戻り待ち時間 const CONTPOPUP_HEADER = "ContinuousPopup";// 新着積み上げ動作時のポップアップ表示 const FINDPOPUP_HEADER = "FindModePopup";// 既読マーク捜索モードのポップアップ表示 const FINDINTVAL_HEADER = "FindModeDelay";// 既読マーク捜索モードの待ち時間 const SCRTOTOPPOPUP_HEADER = "ScrToTopPopup";// スクロールを先頭に戻す時のポップアップ表示 const SCRTOPMKPOPUP_HEADER = "ScrTopMkPopup";// スクロール先頭で既読マークモードのポップアップ表示 //ボタンへの割り付け設定 const SCRTOTOP_HEADER = ["ScrolToTopBTN1","ScrolToTopBTN1","ScrolToTopBTN1","ScrolToTopBTN1","ScrolToTopBTN1","ScrolToTopBTN1"];// 先頭にスクロール const RESSRTTMR_HEADER = ["OneShotSrtBTN1","OneShotSrtBTN2","OneShotSrtBTN3","OneShotSrtBTN4","OneShotSrtBTN5","OneShotSrtBTN6"];// 短周期処理のワンショット実施 const AUTOMARK_HEADER = ["AutoReadPtBTN1","AutoReadPtBTN2","AutoReadPtBTN3","AutoReadPtBTN4","AutoReadPtBTN5","AutoReadPtBTN6"];// 既読ポイント設定 const CLRNEWTW_HEADER = ["ClearNewTwBTN1","ClearNewTwBTN2","ClearNewTwBTN3","ClearNewTwBTN4","ClearNewTwBTN5","ClearNewTwBTN6"];// 新着の消去待ち const MANTRIG_HEADER = ["ManTriggerBTN1","ManTriggerBTN2","ManTriggerBTN3","ManTriggerBTN4","ManTriggerBTN5","ManTriggerBTN6"];// 手動更新 const CONTNEW_HEADER = ["ContinuousBTN1","ContinuousBTN2","ContinuousBTN3","ContinuousBTN4","ContinuousBTN5","ContinuousBTN6"];// 新着積み上げ更新 const FINDMODE_HEADER = ["FindModeStBTN1","FindModeStBTN2","FindModeStBTN3","FindModeStBTN4","FindModeStBTN5","FindModeStBTN6"];// 既読マーク捜索 const SCRTOPMK_HEADER = ["ScrTopMarkBTN1","ScrTopMarkBTN2","ScrTopMarkBTN3","ScrTopMarkBTN4","ScrTopMarkBTN5","ScrTopMarkBTN6"];// スクロール先頭で既読ポイント設定 //グローバル定義時用の汎用カウンタ var gi_defIdx = 0; //既読マークとタイムスタンプ var READ_HEADER = [];// 既読マーク記事の個別ツイートURL var READTM_HEADER = [];// 既読マーク記事のタイムスタンプ for( gi_defIdx=0; gi_defIdx < 100; gi_defIdx++ ){ READ_HEADER[gi_defIdx] = "ReadPoint" + ("0" + gi_defIdx).slice(-2); READTM_HEADER[gi_defIdx] = "ReadPTime" + ("0" + gi_defIdx).slice(-2); } //対象URLの基本部 const TWITTER_URL = "https://twitter.com/"; const TWITTER_URL2 = "https://twitter.com"; //TwitterURLのパス文字列 const PATH_HOME = "home";// ホームPATH const PATH_LIST = "i/lists/";// リストPATH const PATH_NOTI = "notifications";// 通知PATH const PATH_SEAR = "search";// 検索PATH //ローカル保存データオブジェクト { SYSTEM : { Keyxxx1: NNN1, Keyxxx2: NNN2 }, URL1 : { Keyxxx1: NNN1, Keyxxx2: NNN2 }, URL2 : { Keyxxx1: NNN1, Keyxxx2: NNN2 },... } var gobj_localData = new Object; //ローカル保存データオブジェクトの獲得とパース function loadStorageData(){ var tmp; tmp = window.localStorage.getItem(LOCAL_DATA_KEY); if( tmp !== null ){ gobj_localData = JSON.parse(tmp); }else{ if( gobj_localData === null ){ gobj_localData = new Object; } } if( gobj_localData[KEY_SYSTEM] == null || gobj_localData[KEY_SYSTEM] == undefined ){ gobj_localData[KEY_SYSTEM] = new Object; saveStorageData(); } if( gobj_localData[PATH_HOME] == null || gobj_localData[PATH_HOME] == undefined ){ gobj_localData[PATH_HOME] = new Object; saveStorageData(); } } //ローカル保存データオブジェクトの格納 function saveStorageData(){ //console.log("★saveStorageData : gobj_localData = "); //console.dir(gobj_localData); var tmp = JSON.stringify(gobj_localData); window.localStorage.setItem(LOCAL_DATA_KEY, tmp); } //ローカル保存データのレコード読み込み function loadSetting( key1, key2, noLoadObject = false){ //key1 : 保存項目名 //key2 : URL/PATH または"SYSTEM" //noLoadObject : true=ローカル保存データを読み込まずに既に読み込まれているデータを対象とする(連続処理時用、先にloadStorageData()を実施しておくこと) /* 旧データ形式 var k = key1; if( key2 != KEY_SYSTEM ){ k += key2; } return window.localStorage.getItem(k); */ var k = decodeURIComponent(key2); //リロード時間記録だけは直でアクセスする if( key1 == FORCEUPDATE_HEADER ){ return window.localStorage.getItem(key1); } var val; if( ! noLoadObject ){ //localStorageから読み込む loadStorageData(); } if( gobj_localData === null ){ gobj_localData = new Object; } if( gobj_localData[KEY_SYSTEM] == null || gobj_localData[KEY_SYSTEM] == undefined ){ gobj_localData[KEY_SYSTEM] = new Object; } if( gobj_localData[PATH_HOME] == null || gobj_localData[PATH_HOME] == undefined ){ gobj_localData[PATH_HOME] = new Object; } var obj = gobj_localData[k]; if( obj === null || obj === undefined ){ return null; }else{ val = obj[key1]; if( val === null || val === undefined ){ return null; }else{ return "" + val; } } } //ローカル保存データのレコード書き込み function saveSetting( key1, key2, value, noLoadObject=false, noSaveObject=false){ //key1 : 保存項目名 //key2 : URL/PATH または"SYSTEM" //value : 保存値 //noLoadObject : true=ローカル保存データを読み込まずに既に読み込まれているデータを対象とする(連続処理時用、先にloadStorageData()を実施しておくこと) //noSaveObject : true=ローカル保存データを最後に書き込まない(連続処理時用、次処理でsaveStorageData()を実施しておくこと) /* 旧データ形式 var k = key1; if( key2 != KEY_SYSTEM ){ k += key2; } return window.localStorage.setItem(k,value); */ var k = decodeURIComponent(key2); //リロード時間記録だけは直でアクセスする if( key1 == FORCEUPDATE_HEADER ){ return window.localStorage.setItem(key1,value); } if( ! noLoadObject ){ //他のタブでも更新しているので読み込んでから更新する loadStorageData(); } var obj = gobj_localData[k]; if( obj === null || obj === undefined ){ obj = new Object; } obj[key1] = "" + value; gobj_localData[k] = JSON.parse(JSON.stringify(obj)); if( ! noSaveObject ){ //localStorageに格納する saveStorageData(); } } //ローカル保存データのレコード削除 function removeSetting( key1, key2, noLoadObject=false, noSaveObject=false){ //key1 : 保存項目名 //key2 : URL/PATH または"SYSTEM" //noLoadObject : true=ローカル保存データを読み込まずに既に読み込まれているデータを対象とする(連続処理時用、先にloadStorageData()を実施しておくこと) //noSaveObject : true=ローカル保存データを最後に書き込まない(連続処理時用、次処理でsaveStorageData()を実施しておくこと) var k = decodeURIComponent(key2); //リロード時間記録だけは直でアクセスする if( key1 == FORCEUPDATE_HEADER ){ return window.localStorage.removeItem(key1); } if( ! noLoadObject ){ //他のタブでも更新しているので読み込んでから更新する loadStorageData(); } var obj = gobj_localData[k]; if( obj === null || obj === undefined ){ return; } delete gobj_localData[k][key1]; if( ! noSaveObject ){ //localStorageに格納する saveStorageData(); } } //デバッグモードを有効にする場合の記録キー const DEBUG_MODE_HEADER = "PseudoTwDk_DEBUG"; var DEBUG_MODE = 0; /************************************************************ 色関連定義 ************************************************************/ //カラーモード ダークテーマ・ブラックテーマ=1, ライトテーマ=0 const DEF_COLOR_MODE = 1; var COLOR_MODE = DEF_COLOR_MODE;//※システムコンフィグで変更可能 //後続の色定義はカラーモードによって定義を切り替えているので先にローカル保存データから読み込む (function(){ var v = loadSetting( COLORMODE_HEADER, KEY_SYSTEM ); if( v !== null ){ v = Number(v); if( v == 0 ){ //ライトテーマ COLOR_MODE = 0; }else{ //ダークテーマ・ブラックテーマ COLOR_MODE = 1; } } })(); /***** ※色関係の定義を変えたらヘルプダイアログ中の説明文なども変える *****/ //※(COLOR_MODE)?暗テーマ時の色:明テーマ時の色 const COLOR_GRAY = (COLOR_MODE)?"rgba(255,255,255,0.3)":"rgba(191,191,191,0.2)";//初期色(非稼働) const COLOR_BLACK = "rgba(0,0,0,1.0)"; const COLOR_WHITE = "rgba(255,255,255,1.0)"; const COLOR_LIGHT_BLACK = "rgba(15,15,15,0.75)"; const COLOR_LIGHT_WHITE = "rgba(239,239,239,0.75)"; const COLOR_CLEAR = "rgba(0,0,0,0.0)"; const COLOR_BORDER = (COLOR_MODE)?"rgba(31,31,31,0.4)":"rgba(223,223,223,0.2)";//表示部枠の色 const COLOR_TOOLTIPS_FGCOLOR = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK;//ヘルプツールチップの文字色 const COLOR_TOOLTIPS_BGCOLOR = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE;//ヘルプツールチップの背景色 const COLOR_TOOLTIPS_BORDER = (COLOR_MODE)?"rgba(31,31,31,0.4)":"rgba(223,223,223,0.2)";//ヘルプツールチップの枠色 const COLOR_SOLID_GRAY = (COLOR_MODE)?"rgba(63,63,63,1.0)":"rgba(191,191,191,1.0)";//不透明グレー const COLOR_POPUP_FGCOLOR = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK;//ポップアップの文字色 const COLOR_POPUP_BGCOLOR_MARK = (COLOR_MODE)?COLOR_SOLID_GRAY:COLOR_SOLID_GRAY;//ポップアップの背景色(先頭記事に既読マーク) const COLOR_POPUP_BGCOLOR_TOPM = (COLOR_MODE)?"rgba(42,42,42,1.0)":"rgba(181,181,181,1.0)";//ポップアップの背景色(スクロール先頭で既読マーク) const COLOR_POPUP_BGCOLOR_TTOP = (COLOR_MODE)?"rgba(52,52,52,1.0)":"rgba(171,171,171,1.0)";//ポップアップの背景色(先頭にスクロール) const COLOR_POPUP_BGCOLOR_CONT = (COLOR_MODE)?"rgba(62,62,62,1.0)":"rgba(161,161,161,1.0)";//ポップアップの背景色(新着積み上げ更新) const COLOR_POPUP_BGCOLOR_FIND = (COLOR_MODE)?"rgba(72,72,72,1.0)":"rgba(151,151,151,1.0)";//ポップアップの背景色(既読マーク捜索モード) //情報表示部ボタンの色 const INFOBUTTON_BORDER_COLOR = "transparent";//情報表示部に配置されるボタンコントロールの枠色 "transparent"=透明 const INFOBUTTON_FORE_COLOR = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK;//同上文字色 const INFOBUTTON_BG_COLOR = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE;//同上背景色 //情報表示部の色 const COLOR_UPDATE = (COLOR_MODE)?"rgba(191,63,63,1.0)":"rgba(127,0,0,1.0)";//自動更新トリガ時の色 const COLOR_UPSOON = (COLOR_MODE)?"rgba(191,191,63,1.0)":"rgba(127,127,0,1.0)";//自動更新トリガまで10秒以内の色 const COLOR_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,1.0)":"rgba(0,127,0,1.0)";//自動更新モード有効時の色 const COLOR_PAUSED = (COLOR_MODE)?"rgba(63,63,191,1.0)":"rgba(0,0,127,1.0)";//自動更新の一時停止状態の色 const COLOR_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,1.0)":"rgba(0,127,127,1.0)";//手動更新抑止期間の色 const COLOR_RELOAD = (COLOR_MODE)?"rgba(191,63,191,1.0)":"rgba(127,0,127,1.0)";//強制自動リロード10秒前の色 //インターバル設定ボタンの色 const COLOR_INT_DISABL = (COLOR_MODE)?"rgba(127,127,127,0.5)":"rgba(191,191,191,0.5)";//初期値(非稼働) const COLOR_INT_UPDATE = (COLOR_MODE)?"rgba(191,63,63,1.0)":"rgba(127,0,0,1.0)";//自動更新トリガ時の色 const COLOR_INT_UPSOON = (COLOR_MODE)?"rgba(191,191,63,1.0)":"rgba(127,127,0,1.0)";//自動更新トリガまで10秒以内の色 const COLOR_INT_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,1.0)":"rgba(0,127,0,1.0)";//自動更新モード有効時の色 const COLOR_INT_PAUSED = (COLOR_MODE)?"rgba(63,63,191,1.0)":"rgba(0,0,127,1.0)";//自動更新の一時停止状態の色 const COLOR_INT_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,1.0)":"rgba(0,127,127,1.0)";//手動更新抑止期間の色 const COLOR_INT_RELOAD = (COLOR_MODE)?"rgba(191,63,191,1.0)":"rgba(127,0,127,1.0)";//強制自動リロード10秒前の色 //ヘルプボタンの色 const COLOR_HLP_DISABL = (COLOR_MODE)?"rgba(127,127,127,0.5)":"rgba(191,191,191,0.5)";//初期値(非稼働) const COLOR_HLP_UPDATE = (COLOR_MODE)?"rgba(191,63,63,0.5)":"rgba(127,0,0,0.5)";//自動更新トリガ時の色 const COLOR_HLP_UPSOON = (COLOR_MODE)?"rgba(191,191,63,0.5)":"rgba(127,191,0,0.5)";//自動更新トリガまで10秒以内の色 const COLOR_HLP_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,0.5)":"rgba(0,127,0,0.5)";//自動更新モード有効時の色 const COLOR_HLP_PAUSED = (COLOR_MODE)?"rgba(63,63,191,0.5)":"rgba(0,0,127,0.5)";//自動更新の一時停止状態の色 const COLOR_HLP_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,0.5)":"rgba(0,127,127,0.5)";//手動更新抑止期間の色 const COLOR_HLP_RELOAD = (COLOR_MODE)?"rgba(191,63,191,0.5)":"rgba(0,127,0.5)";//強制自動リロード10秒前の色 //短周期タイマ変更ボタンの色 const COLOR_ALW_UPDATE = (COLOR_MODE)?"rgba(191,63,63,0.5)":"rgba(127,0,0,0.5)";//短周期タイマ常時稼動モード状態で自動更新トリガ時の色 const COLOR_ALW_UPSOON = (COLOR_MODE)?"rgba(191,191,63,0.5)":"rgba(127,127,0,0.5)";//短周期タイマ常時稼動モード状態で自動更新トリガまで10秒以内の色 const COLOR_ALW_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,0.5)":"rgba(0,127,0,0.5)";//短周期タイマ常時稼動モード状態で自動更新モード有効時の色 const COLOR_ALW_PAUSED = (COLOR_MODE)?"rgba(63,63,191,0.5)":"rgba(0,0,127,0.5)";//短周期タイマ常時稼動モード状態で自動更新の一時停止状態の色 const COLOR_ALW_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,0.5)":"rgba(0,127,127,0.5)";//短周期タイマ常時稼動モード状態で手動更新抑止期間の色 const COLOR_ALW_RELOAD = (COLOR_MODE)?"rgba(191,63,191,0.5)":"rgba(127,0,127,0.5)";//短周期タイマ常時稼動モード状態で強制自動リロード10秒前の色 const COLOR_IDL_DISABL = (COLOR_MODE)?"rgba(127,127,127,0.5)":"rgba(191,191,191,0.5)";//短周期タイマの一時停止状態の色 const COLOR_IDL_UPDATE = (COLOR_MODE)?"rgba(191,63,63,1.0)":"rgba(127,0,0,1.0)";//短周期タイマ適宜停止モード状態で自動更新トリガ時の色 const COLOR_IDL_UPSOON = (COLOR_MODE)?"rgba(191,191,63,1.0)":"rgba(127,127,0,1.0)";//短周期タイマ適宜停止モード状態で自動更新トリガまで10秒以内の色 const COLOR_IDL_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,1.0)":"rgba(0,127,0,1.0)";//短周期タイマ適宜停止モード状態で自動更新モード有効時の色 const COLOR_IDL_PAUSED = (COLOR_MODE)?"rgba(63,63,191,1.0)":"rgba(0,0,127,1.0)";//短周期タイマ適宜停止モード状態で自動更新の一時停止状態の色 const COLOR_IDL_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,1.0)":"rgba(0,127,127,1.0)";//手動更新抑止期間の色短周期タイマ適宜停止モード状態で const COLOR_IDL_RELOAD = (COLOR_MODE)?"rgba(191,63,191,1.0)":"rgba(127,0,127,1.0)";//短周期タイマ適宜停止モード状態で強制自動リロード10秒前の色 //自動更新ON/OFFボタンの色 const COLOR_AUT_DISABL = (COLOR_MODE)?"rgba(127,127,127,0.5)":"rgba(191,191,191,0.5)";//自動更新OFF時の色 const COLOR_AUT_UPDATE = (COLOR_MODE)?"rgba(191,63,63,1.0)":"rgba(127,0,0,1.0)";//自動更新ON時で自動更新トリガ時の色 const COLOR_AUT_UPSOON = (COLOR_MODE)?"rgba(191,191,63,1.0)":"rgba(127,127,0,1.0)";//自動更新ON時で自動更新トリガまで10秒以内の色 const COLOR_AUT_ACTIVE = (COLOR_MODE)?"rgba(63,191,63,1.0)":"rgba(0,127,0,1.0)";//自動更新ON時で自動更新モード有効時の色 const COLOR_AUT_PAUSED = (COLOR_MODE)?"rgba(63,63,191,1.0)":"rgba(0,0,127,1.0)";//自動更新ON時で自動更新の一時停止状態の色 const COLOR_AUT_HOLDTM = (COLOR_MODE)?"rgba(63,191,191,1.0)":"rgba(0,127,127,1.0)";//自動更新ON時で手動更新抑止期間の色 const COLOR_AUT_RELOAD = (COLOR_MODE)?"rgba(191,63,191,1.0)":"rgba(127,0,127,1.0)";//自動更新ON時で強制自動リロード10秒前の色 //チェックボックスの不透明度 const DEF_CHECKBOX_ENABLE_OPACITY = "0.5"; var CHECKBOX_ENABLE_OPACITY = DEF_CHECKBOX_ENABLE_OPACITY;//※システムコンフィグで変更可能 const DEF_CHECKBOX_DISABLE_OPACITY = "0.0"; var CHECKBOX_DISABLE_OPACITY = DEF_CHECKBOX_DISABLE_OPACITY;//※システムコンフィグで変更可能 //既読ポイントとしてチェックしたアーティクルの背景色 const DEF_READ_COLOR_ENABLED1 = (COLOR_MODE)?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.10)"; const DEF_READ_COLOR_ENABLED2 = (COLOR_MODE)?"rgba(255,255,255,0.20)":"rgba(0,0,0,0.20)"; const DEF_READ_COLOR_ENABLED3 = (COLOR_MODE)?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.30)"; const DEF_READ_COLOR_ENABLED4 = (COLOR_MODE)?"rgba(255,255,255,0.30)":"rgba(0,0,0,0.40)"; var READ_COLOR_ENABLED = []; var READ_COLOR_ENABLED1 = []; var READ_COLOR_ENABLED2 = []; var READ_COLOR_ENABLED3 = []; var READ_COLOR_ENABLED4 = []; //既読ポイント背景色の切り替えパターン数 const gi_readColorPattern = 10;//※(READ_COLOR_ENABLED1,2,3,4)の配列要素数を設定 //既読ポイント背景色の繰り返しパターンType数(READ_COLOR_ENABLED1,2,3,4) const READ_COLOR_CYCLE = 4;//Type数 //既読ポイント背景色パターンType1 READ_COLOR_ENABLED1 = [ DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, DEF_READ_COLOR_ENABLED1, ]; //既読ポイント背景色パターンType2 READ_COLOR_ENABLED2 = [ DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, (COLOR_MODE)?"rgba(255,191,191,0.2)":"rgba(255,0,0,0.1)", (COLOR_MODE)?"rgba(191,255,191,0.2)":"rgba(0,255,0,0.1)", (COLOR_MODE)?"rgba(191,191,255,0.2)":"rgba(0,0,255,0.1)", DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, (COLOR_MODE)?"rgba(191,255,255,0.2)":"rgba(0,255,255,0.1)", (COLOR_MODE)?"rgba(255,191,255,0.2)":"rgba(255,0,255,0.1)", (COLOR_MODE)?"rgba(255,255,191,0.2)":"rgba(255,255,0,0.1)", ]; //既読ポイント背景色パターンType3 READ_COLOR_ENABLED3 = [ DEF_READ_COLOR_ENABLED4, DEF_READ_COLOR_ENABLED3, (COLOR_MODE)?"rgba(191,255,255,0.3)":"rgba(0,255,255,0.2)", (COLOR_MODE)?"rgba(255,191,255,0.3)":"rgba(255,0,255,0.2)", (COLOR_MODE)?"rgba(255,255,191,0.3)":"rgba(255,255,0,0.2)", DEF_READ_COLOR_ENABLED4, DEF_READ_COLOR_ENABLED3, (COLOR_MODE)?"rgba(255,191,191,0.3)":"rgba(255,0,0,0.2)", (COLOR_MODE)?"rgba(191,255,191,0.3)":"rgba(0,255,0,0.2)", (COLOR_MODE)?"rgba(191,191,255,0.3)":"rgba(0,0,255,0.2)", ]; //既読ポイント背景色パターンType4 READ_COLOR_ENABLED4 = [ DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, DEF_READ_COLOR_ENABLED3, DEF_READ_COLOR_ENABLED2, ]; /************************************************************ 各種const定義 コンフィグ・システムコンフィグ項目・初期値 ************************************************************/ //※ const gx_defaultXXXX = xxx; / var gx_xXXX = gx_defaultXXXX; になっている項目は(ほぼ全て)コンフィグまたはシステムコンフィグで変更すると保存されます //コンフィグ・システムコンフィグで設定変更可能で保存される項目にはコメントをつけておきます //これらの項目は一度設定しておけばバージョンアップでスクリプトソースを丸ごと差し換えても保存値で動作します(直接その項目に大幅な仕様変更がある場合を除く) //短周期タイマを一定時間後に停止する=1, 停止させず回ったままにする=0 (短周期タイマ切り替えボタンのクリックで変更可能) const gi_defalutIdleShortTimer = 1; var gi_idleShortTimer = gi_defalutIdleShortTimer;//※ボタン操作とコンフィグで変更可能 //相対時間を絶対時間表記にする=1, しない=0 const gi_defaultReplaceTimeStamp = 1; var gi_replaceTimeStamp = gi_defaultReplaceTimeStamp;//※システムコンフィグで変更可能 //自動更新OFFモード スクロール位置やエディットのフォーカスによらず強制OFF=1, 従来の動作=0(自動更新ON/OFF切り替えボタンのクリックで変更可能) const gi_defaultModeAutoOff = 0; var gi_modeAutoOff = gi_defaultModeAutoOff;//※ボタン操作とコンフィグで変更可能 //Homeで上部の新着ツイートありの表示を勝手に押す=1, 押さない=0 const gi_defaultAutoClickNewTweet = 0; var gi_autoClickNewTweet = gi_defaultAutoClickNewTweet;//※システムコンフィグで変更可能 //Homeで上部の新着ツイートありの表示を非表示にする=1, 非表示にしない=0(エディット表示切り替えボタンの右クリックで変更可能) const gi_defaultHideNumberNewTweet = 0; var gi_hideNumberNewTweet = gi_defaultHideNumberNewTweet;//※ボタン操作とコンフィグで変更可能 //設定更新時にポップアップメッセージを出しておく時間(秒) 出さない場合は0にする const gi_defaultDisplayPopupCloseTimeSec = 5; var gi_displayPopupCloseTimeSec = gi_defaultDisplayPopupCloseTimeSec;//※システムコンフィグで変更可能 var gi_displayHelpToolTipsPopupCloseTimeSec = gi_displayPopupCloseTimeSec * 6;//mouseleaveですぐ消えるが、万一の消え残り対策 //DOM更新の最終タイムスタンプを自動更新OFFでも表示する=1, 表示しない=0 const gi_defaultEnableDomTimeAutoOff = 1; var gi_enableDomTimeAutoOff = gi_defaultEnableDomTimeAutoOff;//※システムコンフィグで変更可能 //情報表示部のカウントダウンを表示しない=1, 表示する=0 const gi_defaultNoCountDownDisp = 0; var gi_noCountDownDisp = gi_defaultNoCountDownDisp;//※システムコンフィグで変更可能 //既読ポイント用のチェックボックスを表示する=1, 表示しない=0 const gi_defaultEnableReadPointCheckBox = 1; var gi_enableReadPointCheckBox = gi_defaultEnableReadPointCheckBox;//※システムコンフィグで変更可能 //同一のアーティクルをTLに複数表示しない(RTが並ばなくなる)表示しない=1, 表示する=0 const gi_defaultNotDispSameArticle = 1; var gi_notDispSameArticle = gi_defaultNotDispSameArticle;//※システムコンフィグで変更可能 //Home上部のツイート欄を非表示にする=1, 表示したままにする=0 (エディット表示切り替えボタンクリックで変更可能) const gi_defaultHideEditControl = 0; var gi_hideEditControl = gi_defaultHideEditControl;//※システムコンフィグで変更可能 //表示部+ボタンの不透明度(透明0.0〜1.0不透明 ※多分0.1刻みくらいでしか変化しない) const gf_defaultDispUnitOpacity = 1.0; var gf_dispUnitOpacity = gf_defaultDispUnitOpacity;//※システムコンフィグで変更可能 //表示部の左右ボタン左右クリック設定 const CON_BUTTON_LL = 0; //左ボタン左クリック const CON_BUTTON_LR = 1; //左ボタン右クリック const CON_BUTTON_ML = 2; //中ボタン左クリック const CON_BUTTON_MR = 3; //中ボタン右クリック const CON_BUTTON_RL = 4; //右ボタン左クリック const CON_BUTTON_RR = 5; //右ボタン右クリック const MAX_CON_BUTTON = 6; //enum値最大値+1 //表示部をクリックで短周期処理のワンショット実行をする=1, しない=0 const giA_defaultRestartShortTimer = [1,0,1,0,1,0]; var giA_restartShortTimer = giA_defaultRestartShortTimer;//※コンフィグで変更可能 //表示部をクリックした時に表示されている最新アーティクルを既読マークする=1, しない=0 const giA_defaultManualUpdateAutoCheck = [1,1,0,1,0,0]; var giA_manualUpdateAutoCheck = giA_defaultManualUpdateAutoCheck;//※コンフィグで変更可能 //表示部をクリックで通知ページの新着表示を消去する=1, しない=0 const giA_defaultClearNewNotification = [1,0,1,0,1,0]; var giA_clearNewNotification = giA_defaultClearNewNotification;//※コンフィグで変更可能 //表示部をクリックで手動更新トリガをかける=1, トリガしない=0(但し、更新禁止間隔以内ではトリガしない) const giA_defaultManualUpdateTrigger = [0,1,1,1,0,0]; var giA_manualUpdateTrigger = giA_defaultManualUpdateTrigger;//※コンフィグで変更可能 //表示部をクリックで手動更新トリガ時に新着を上に積む動作をする=1, しない=0 (※上のgiA_manualUpdateTriggerが有効じゃないと使われません) const giA_defaultUpdateContinuousButton = [0,1,0,0,0,0]; var giA_updateContinuousButton = giA_defaultUpdateContinuousButton;//※コンフィグで変更可能 //表示部をクリックで既読ポイント捜索モードに入る=1, 入らない=0(※手動更新トリガ・新着上積みとは同時に使えません) const giA_defaultFindReadPointButton = [0,0,0,0,0,1]; var giA_findReadPointButton = giA_defaultFindReadPointButton;//※コンフィグで変更可能 //表示部をクリックでスクロールを最上部に戻す=1, 戻さない=0 const giA_defaultScrToTopButton = [0,1,1,1,1,0]; var giA_scrToTopButton = giA_defaultScrToTopButton;//※コンフィグで変更可能 ※giA_defaultScrTopMarkButtonと排他が望ましい //表示部をクリックで次回のスクロール最上部で既読ポイントをつける=1, つけない=0 const giA_defaultScrTopMarkButton = [1,0,0,0,0,1]; var giA_scrTopMarkButton = giA_defaultScrTopMarkButton;//※コンフィグで変更可能 ※giA_defaultScrToTopButtonと排他が望ましい //表示部のボタンや横の各ボタンhover時にヘルプツールチップを表示する=1, 表示しない=0 const gi_defaultDispToolTipsPopup = 1; var gi_dispToolTipsPopup = gi_defaultDispToolTipsPopup;//※システムコンフィグで変更可能 //更新トリガした直後の新着表示を自動的に押す=1, 押さない=0 const gi_defaultManualUpdateTriggerNewTweet = 1; var gi_manualUpdateTriggerNewTweet = gi_defaultManualUpdateTriggerNewTweet;//※システムコンフィグで変更可能 //新着を上に積む操作時にポップアップを出す=1, 出さない=0 const gi_defaultUpdateContinuousDispPopup = 1; var gi_updateContinuousDispPopup = gi_defaultUpdateContinuousDispPopup;//※コンフィグで変更可能 //既読マーク捜索モード中にポップアップを出す=1, 出さない=0 const gi_defaultFindModeDispPopup = 1; var gi_findModeDispPopup = gi_defaultFindModeDispPopup;//※コンフィグで変更可能 //次回のスクロール最上部で既読マークモード中にポップアップを出す=1, 出さない=0 const gi_defaultScrTopMarkModeDispPopup = 1; var gi_scrTopMarkModeDispPopup = gi_defaultScrTopMarkModeDispPopup;//※コンフィグで変更可能 //スクロールを先頭に戻す処理中にポップアップを出す=1, 出さない=0 const gi_defaultScrToTopModeDispPopup = 1; var gi_scrToTopModeDispPopup = gi_defaultScrToTopModeDispPopup;//※コンフィグで変更可能 //更新トリガ時新着を上に積む更新でトリガから先頭記事に遷移するまでの待機時間(ms) [ unknown(未使用), Home, List, User、Notification(未使用), Search ] const giA_defaultUpdateContinuousDelayTimeMs = [1000, 250, 500, 500, 1000, 500]; var gi_updateContimuousDelayTimeMs = giA_defaultUpdateContinuousDelayTimeMs[1];//※コンフィグで変更可能 //遷移先にまだボタンコントロールが構築されていない場合にリトライする最大試行回数 const MAX_UPDATE_CONTINUOUS_RETURN_RETRY = 10; var gi_updateContinuousReturnRetry = 0; //更新トリガ時新着を上に積む更新で遷移先から戻るまでの待機時間(ms) const gi_defaultUpdateContinuousReturnTimeMs = 500; var gi_updateContinuousReturnTimeMs = gi_defaultUpdateContinuousReturnTimeMs;//※コンフィグで変更可能 //画像サムネイルを左クリックで別タブに画像表示する=1, しない=0 const gi_defaultDisplayImageNewTab = 1; var gi_displayImageNewTab = gi_defaultDisplayImageNewTab;//※システムコンフィグで変更可能 //画像サムネイルを左クリックで別タブに画像表示するときorigで開き次はlargeで開く=1, 常にlargeで開く=0 const gi_defaultDisplayImageTryOrig = 0; var gi_displayImageTryOrig = gi_defaultDisplayImageTryOrig;//※システムコンフィグで変更可能 //画像サムネイル左クリックで前回開いたパス var gstr_lastImagePath = ""; //更新間隔定義(秒)=これを初期値としてコンフィグページで設定変更と保存が可能、最大3600だが強制再起動が先に掛かる可能性あり const gi_updateIntervalMsHome = 30; const gi_updateIntervalMsList = 300; const gi_updateIntervalMsUser = 600; const gi_updateIntervalMsNoti = 15; const gi_updateIntervalMsSear = 180; //更新間隔 [ unknown(未使用), Home, List, User、Notification(新着クリア), Search ] const giA_defaultIntervalMs = [1000, parseInt(gi_updateIntervalMsHome * 1000), parseInt(gi_updateIntervalMsList * 1000), parseInt(gi_updateIntervalMsUser * 1000), parseInt(gi_updateIntervalMsNoti * 1000), parseInt(gi_updateIntervalMsSear * 1000)]//※コンフィグで変更可能 var giA_updateIntervalMs = giA_defaultIntervalMs; //短周期タイマを止めるまでの経過時間(ミリ秒) const gi_defaultShortTimerIdleMs = 10000; var gi_shortTimerIdleMs = gi_defaultShortTimerIdleMs;//※システムコンフィグで変更可能 //起動時待ち合わせ時間(ミリ秒) const gi_defaultInitWaitMs = 5000; var gi_initWaitMs = gi_defaultInitWaitMs;//※システムコンフィグで変更可能 //短周期タイマの間隔(ミリ秒) const gi_defaultShortIntervalMs = 250; var gi_shortIntervalMs = gi_defaultShortIntervalMs;//※システムコンフィグで変更可能 //スクロール位置が先頭に戻った後の短縮更新待ちあわせ時間(ミリ秒) const gi_defaultOnTopWaitMs = 0; var gi_onTopWaitMs = gi_defaultOnTopWaitMs;//※システムコンフィグで変更可能 //強制リロード時の待ち合わせ時間(ミリ秒) const gi_defaultReloadWaitMs = 3000; var gi_reloadWaitMs = gi_defaultReloadWaitMs;//※システムコンフィグで変更可能 //強制リロード実施間隔初期値(秒)=これを初期値としてコンフィグページで設定変更と保存が可能、最大7200だがTwitter独自の再起動が先に掛かる可能性あり const gi_defaultReloadTimeoutSec = 3600; var gi_reloadTimeoutSec = gi_defaultReloadTimeoutSec;//※コンフィグで変更可能 //手動で更新をかけない経過時間(秒) ※自動更新インターバルの最小値としても使われる ※最後に更新をかけた時からこの設定時間以内は更新トリガ発行しない const gi_defaultManualUpdateIntervalSec = 15; var gi_manualUpdateIntervalSec = gi_defaultManualUpdateIntervalSec;//※コンフィグで変更可能 //他のタブが強制リロードをしたら一定時間以内に強制リロードしない間隔時間(秒) const gi_defaultForceUpdateLockTimeSec = 120; var gi_forceUpdateLockTimeSec = gi_defaultForceUpdateLockTimeSec;//※システムコンフィグで変更可能 //マークする件数(最大100までにする事、ローカル保存データのキーを2桁[00〜99]にしているため) ※但し一度に読み込まれている件数は20前後なのでそれ以上はマークされない const gi_defaultReadArticles = 10; var gi_readArticles = gi_defaultReadArticles;//※システムコンフィグで変更可能 //検索ページの更新トリガ前に上部詰め処理のCSSを一旦無効にする(CSSによって上部余白を更に詰める追い込み処理が起因して更新されない場合の救済措置) const gi_defaultDispabeCssOnSearchUpdate = 0; var gi_disableCssOnSearchUpdate = gi_defaultDispabeCssOnSearchUpdate;//※システムコンフィグで設定可能 //検索ページの更新トリガ前に上部詰め処理のCSSを一旦無効にする時に従来のスクロール処理間ウェイト設定に加算するウェイト値(ミリ秒) const gi_defaultDisableCssSearchWaitMs = 100; var gi_disableCssSearchWaitMs = gi_defaultDisableCssSearchWaitMs;//※システムコンフィグで設定可能 //既読ポイント背景色パターン以降がある場合 パターン以降先頭要素で繰り返し=0, パターン全体を繰り返す=1 const DEF_READ_COLOR_CYCLEMODE = 1; var READ_COLOR_CYCLEMODE = DEF_READ_COLOR_CYCLEMODE;//※システムコンフィグで変更可能 //RTと引用RT非表示設定 制限無し=0, RT非表示=1, 引用RT非表示=2, RT/引用RT両方非表示=3 const gi_defaultNotDispRt = 0; var gi_notDispRt = gi_defaultNotDispRt;//※コンフィグで設定可能 const NOTRT_NAME = ["0:RT=ON/QUOTE=ON","1:RT=OFF/QUOTE=ON","2:RT=ON/QUOTE=OFF","3:RT=OFF/QUOTE=OFF"]; //ツイート下部のアイコン類非表示設定 const gi_defaultNotDispCommIcon = 0; var gi_notDispCommIcon = gi_defaultNotDispCommIcon;//※コンフィグで設定可能 /************************************************************ 各種定数・グローバル変数定義 ************************************************************/ //モードのインデックス(配列タイプで定義している他の項目に影響するので変更禁止) const MODE_NULL = 0; const MODE_HOME = 1; const MODE_LIST = 2; const MODE_USER = 3; const MODE_NOTI = 4; const MODE_SEAR = 5; const MODE_MAX = 6;//enum値最大値+1 //スクロールによってトリガするタイプのページでスクロールを戻すまでのウェイト時間(ms) ※0msで動くはずだがPCの処理能力によっては最大1000msくらいまで増やす const SCROLL_TYPE_TRIGGER_WAIT = 0; //スクロール位置をトップと判定する範囲 const SCROLL_LIMIT = 5.0; //リストページは一定以上スクロールするとヘッダ部非表示のCSSが起因してか、いつまでもDOM更新が止まらなくなるので閾値を設けてbodyタグに目印をつけてCSSを無効にする const LIST_PAGE_SCROLL_LIMIT = 2000; //分割スクロールする場合のウェイト時間 const gi_splitScrollIntervalMs = 1000; //スクロール処理中の排他フラグ var gf_scrollOperation = false; //初期化が必要=0, 初期化済み=1 var gi_initComplete = 0; //前回処理URL var gstr_lastURL = ""; //前回処理タブ幅 var gi_lastInnerWidth = 0; //更新間隔カウンタ var gi_updateCountMs = 0; //監視間隔タイマの間隔(ミリ秒) const gi_timerIntervalMs = 1000; //監視間隔タイマ内でカウントして長周期の処理をする var gi_longTimerCount10 = 0; var gi_longTimerCount60 = 0; const gi_maxLongTimerCount10 = 10; const gi_maxLongTimerCount60 = 6; //短周期タイマオブジェクト var gtmr_shortTimer = null; //短周期タイマ開始時間を保持 var gstr_lastShortStart = null; //短周期タイマ処理のワンショット実施フラグ var gf_oneShotShortTimer = false; //短周期処理のワンショット実行を時間差で行うタイマ var gobjA_delayOneShotShortTimer = [null,null,null]; //短周期処理のワンショット実行を行う時間(秒) const giA_delayOneShotShortTimerSec = [10,30,60]; //自動更新が停止中 var gi_displayPaused = 0; //スクロール位置の前回値 var gf_lastYOffset = 0; //最後に更新をかけた時間 var gdt_lastTriggerTime = new Date(); //DOM更新イベントが正常に動作しているかどうかチェックする時間(ms) const CHECK_DOM_INTERVAL = 100; //DOM更新イベントの正常性チェックは起動直後のみ(DOMイベントを受信したらfalseに落とす) var gf_firstDOM = true; //情報表示部ボタンのHover中 var gi_onButtonHover = 0; //ヘルプ・コンフィグ系のダイアログ表示のテーブル幅・フォント倍率設定 const DIALOG_MIN_WIDTH = "390px"; const DIALOG_MAX_WIDTH = "500px"; const DIALOG_FONT_SIZE = "75%"; //自動更新の情報表示エレメント var gelm_dispInfo = null; //ボタンコントロールのエレメント var gelm_allParent = null; var gelm_btnParent = null; var gelm_btnShort = null; var gelm_btnInterval = null; var gelm_btnAutoOff = null; var gelm_btnHelp = null; var gelm_btnEdit = null; var gelm_btnLeft = null; var gelm_btnMid = null; var gelm_btnRight = null; //更新情報の表示エレメント、定周期で再利用するオブジェクト変数のグローバル化 var gelm0 = null; var gelm1 = null; var gelm2 = null; var gelm3 = null; var gelm4 = null; var gelm5 = null; var gelm6 = null; var gelm7 = null; var gelm8 = null; var gelm9 = null; var gelmObserv = null; var gdt_temp = null; var gb_flgClearNotification = false; var gtmr_waitClear = null; //リロード告知ダイアログオブジェクト var gobj_reloadDialog = null; //ポップアップダイアログオブジェクト var gelm_fixedPopupFindInfo = null; var gelm_fixedPopupFindCount = null; var gelm_fixedPopupFindConfirm = null; var gelm_fixedPopupFindContinue = null; var gelm_fixedPopupClearNewTweet = null; var gelm_fixedPopupClearNewDM = null; var gelm_fixedToolTips = null; var gelm_fixedScrTopMark = null; var gelm_fixedReloadConfirm = null; //デバッグ用ダイアログオブジェクト var gelm_debugDialog = null; // ***** 既読マーク遡り検索機能関連 ***** //遡り捜索モード var gi_findMode = 0; //遡り捜索DIALOG_FONT_SIZEのタイムスタンプ無視モード var gi_findNoTimeStamp = 0; //見つけた既読マーク var giA_findMark = []; //既読マーク捜索処理 var gi_findReadPointCount = 0; //既読マークの捜索モードで1スクロール置きに挟むウェイト const gi_defaultFindModeIntervalMs = 100; var gi_findModeIntervalMs = gi_defaultFindModeIntervalMs;//※コンフィグで設定可能 //既読マーク遡り中に読み込まれたアーティクルのタイムスタンプ蓄積 var gstrA_findModeArticleTimeStamp = []; //既読マーク遡り中に読み込まれたアーティクル数の前回値 var gi_lastFindModeArticleRecs = 0; //遡る上限の件数 const MAX_CONTINUE_ARTICLES = 500; //有効な既読マーク数(この数未満では捜索を行わない) const ACTIVE_READ_COUNT = 4; //発見した既読マーク数の閾値(全部見つからない前提なので有効な既読マーク数マイナスこの値がヒットしたら捜索終了) const FIND_READ_COUNTSUB = 2; //有効な既読マーク数が一定以上あったら判定を緩くする const FIND_READ_THRETHOLD = 8; //有効な既読マーク数が一定以上あったら一定割合以上でヒットとする const FIND_READ_RATIO = 0.75; //遡って読み込んだアーティクルから先頭の何件を既読マークのタイムスタンプと比較するか const FIND_OLD_ARTICLE_COUNT = 16; //次回のスクロール先頭で既読マークするモード var gi_scrToTopMode = 0; //次回のスクロール先頭で既読マークするモードに入った時のURL var gstr_scrToTopModeURL = ""; //次回のスクロール先頭で既読マークするモード中に他の画面に遷移して戻ってきた初回の検出 var gf_scrToTopModeReturn = false; //通知ページの新着表示が消えるまでのポップアップ最大時間(秒) const CLEAR_NEWNOTI_SEC = 180; //コンフィグ・システムコンフィグ表示中のフラグ(強制リロードなどを抑止するため) var gb_enableSettingWindow = false; //システムコンフィグで変更保存された項目がある=true, 変更なし=false var gb_changedSetting = false; //表示中のページ種別 0:unknown, 1:Home, 2:List, 3:User, 4:Notification, 5:Search var gi_dispMode = 0; //遷移の判定を初期構築処理で行うための前回値、比較しているので初期値は変えておく var gi_lastDispMode = -1; //初期構築中にドキュメントが未構築な状態 var gf_documentError = false; //メディアサイズ 0:非表示, 1:最小サムネイル, 2:通常のコンパクトサムネイル, 3:元のまま const gi_defaultMediaSize = 2; var gi_mediaSize = gi_defaultMediaSize;//※コンフィグで設定可能 const MEDIA_NONE = 0; const MEDIA_SMALL = 1; const MEDIA_NORMAL = 2; const MEDIA_LARGE = 3; const MEDIA_LINK = 4; const SIZE_NAME = ["0:非表示","1:縮小(小)","2:縮小(中)","3:元サイズ","4:リンク"]; /********************************************************************************** setAttribute/getAttribute 固有キー文字列定義 (カスタムCSSのセレクタで使用される) *********************************************************************************/ //このスクリプト固有のプリフィクス const gstr_scrModeAttrPfx = "PSEUDOTWEETDECK"; //このスクリプト固有のメディアサイズ記録用属性名 const gstr_scrMediaAttr = "PTD_MEDIA"; //このスクリプト固有のRT表示切り替え用属性名 const gstr_scrNotRtAttr = "PTD_NOTRT"; //このスクリプト固有の引用RT表示切り替え用属性名 const gstr_scrNotQuoteAttr = "PTD_NOTQUOTE"; //このスクリプト固有のツイート下部コマンドアイコン表示切り替え用属性名 const gstr_scrNotCommIconAttr = "PTD_NOTCOMMICON"; //このスクリプト固有のリストページスクロール状態で切り替え用属性名 const gstr_scrScrollList = "PTD_LIST_SCROLL"; //このスクリプト固有の一部環境で検索ページ上部の隙間を更に詰める処理が起因して更新があがってこない時の強引な解決策用属性名 const gstr_scrSearchUpdate = "PTD_SEARCH_UPD"; //スクリプト固有のモード記録用属性名 const gstr_scrTypeAttr = "PTD_TYPE"; //スクリプト固有の固定ツイート判定用属性名 const gstr_scrFixedUserAttr = "PTD_FIXED"; //スクリプト固有の既読ポイント判定用チェックボックス属性名 const gstr_scrReadPointAttr = "PTD_READ"; //スクリプト固有の既読ポイント判定用チェックボックス格納親属性名 const gstr_scrReadPointParentAttr = "PTD_READ_PARENT"; //スクリプト固有のカラーモード判定用属性名 const gstr_scrLightColorAttr = "PTD_LIGHTCOLOR"; //新着表示部のイベントトラップ目印用属性名 const gstr_scrNewTweetAttr = "PTD_NEWTWEET"; //重複するRT非表示時に追加しておく属性 const gstr_multipleArticleAttr = "PTD_MULTI_RT"; //種別プリフィクス用文字列 const gstrA_modeNamePrifix = ["NULL","HOME","LIST","USER","NOTI","SEAR"]; //ヘルプツールチップス用のボタンエレメントID(左クリック用と右クリック用なので+2ずつインデックスをずらす) const BTNID_SHORT = MAX_CON_BUTTON; const BTNID_INTVL = MAX_CON_BUTTON + 2; const BTNID_ATOFF = MAX_CON_BUTTON + 4; const BTNID_HELP = MAX_CON_BUTTON + 6; const BTNID_EDIT = MAX_CON_BUTTON + 8; //操作ボタンコントロールのID const PARENT_BLOCK = "PTD_PARENT_BLOCK"; const BUTTON_BLOCK = "PTD_BUTTON_BLOCK"; const INFO_BLOCK = "PTD_INFO_BLOCK" const HELP_BLOCK = "PTD_HELP_BLOCK" const SHORT_BLOCK = "PTD_SHORT_BLOCK"; const INTERVAL_BLOCK = "PTD_INTERVAL_BLOCK"; const AUTO_BLOCK = "PTD_AUTO_BLOCK"; const EDITBTN_BLOCK = "PTD_EDIT_BLOCK"; const INFOLBTN_BLOCK = "PTD_INFO_LBTN_BLOCK"; const INFOMBTN_BLOCK = "PTD_INFO_MBTN_BLOCK"; const INFORBTN_BLOCK = "PTD_INFO_RBTN_BLOCK"; //ポップアップ部コントロールのID const POPUP_BLOCK = "PTD_POPUP_BLOCK"; //ポップアップ終了時間要素 const POPUP_ENDTIME = "PTD_POPUP_ENDTIME_BLOCK"; //コンフィグ画面コントロールID const SETTING_BLOCK = "PTD_SETTING_CONIG_BLOCK"; //エディット部表示非表示切り替え時の追加要素 const EDITSW_BLOCK = "PTD_EDIT_SWITCH_BLOCK"; //タイムスタンプ部にチェックボックス追加済みを示す追加要素 const TIME_FIXED = "PTD_TIME_FIXED_BLOCK"; //引用RT先のタイムスタンプ置換済みを示す追加要素 const TIME_FIXED_SUB = "PTD_TIME_FIXED_SUB_BLOCK"; //画像リンク部のclickを乗っ取った状態の追加要素 const IMAGE_LINK = "PTD_IMAGE_LINK"; //動画リンク部のclickを乗っ取った状態の追加要素 const MOVIE_LINK = "PTD_MOVIE_LINK"; //DEBUG表示用のテキスト部要素 const ELM_DEBUG_TEXT = "PTD_DEBUG_TEXT"; //表示部・ボタン類の色替え var gi_colorType = 0; const TYPE_UPDATE = 1; const TYPE_UPSOON = 2; const TYPE_ACTIVE = 3; const TYPE_PAUSED = 4; const TYPE_HOLDTM = 5; const TYPE_RELOAD = 6; //チェックボックスエレメントに追加するタイムスタンプの要素名 const CHK_TIMESTAMP = "PTD_CHK_TIMESTAMP"; //チェックされたアーティクルのタイムスタンプ var gstrA_readTimeStamp = []; //チェックされたアーティクルのURL var gstrA_readArticleURL = []; for( gi_defIdx=0; gi_defIdx < gi_readArticles; gi_defIdx++ ){ gstrA_readTimeStamp[gi_defIdx] = ""; gstrA_readArticleURL[gi_defIdx] = ""; } //チェックされたアーティクルの背景色モード ※非表示モードの時=-1 var gi_readCheckedColorMode = 0; //新着が消えるのを待ち合わせるカウンタ var gi_chkNotificationCount = 0; const gi_chkNotificationCountMax = 100; //ダイアログ表示の余白 const CRLF = "\r\n"; const CRLFSPC = "\r\n  "; const SPC = "
\r\n  "; const SPT = "  "; /************************************************************ 情報表示部関連定義 ************************************************************/ //情報表示部の固定サイズ(フォントサイズを変更したらここも合わせて変更する) const DEF_DISPINFO_WIDTH = "120px"; var DISPINFO_WIDTH = DEF_DISPINFO_WIDTH;//※システムコンフィグで変更可能 const DEF_DISPINFO_HEIGHT = "20px"; var DISPINFO_HEIGHT = DEF_DISPINFO_HEIGHT;//※システムコンフィグで変更可能 //情報表示部のフォントサイズ unknown,home,list,user,notification,search const DEF_INFO_TEXT_FONT_SIZE = "12px";//※システムコンフィグで変更可能 var gstrA_titleSize = [DEF_INFO_TEXT_FONT_SIZE,DEF_INFO_TEXT_FONT_SIZE,DEF_INFO_TEXT_FONT_SIZE,DEF_INFO_TEXT_FONT_SIZE,DEF_INFO_TEXT_FONT_SIZE,DEF_INFO_TEXT_FONT_SIZE]; //更新時間変更ボタン・自動更新停止ボタンのフォントサイズ unknown,home,list,user,notification,search const DEF_INFO_BTN_FONT_SIZE = "14px";//※システムコンフィグで変更可能 var gstrA_buttonSize = [DEF_INFO_BTN_FONT_SIZE,DEF_INFO_BTN_FONT_SIZE,DEF_INFO_BTN_FONT_SIZE,DEF_INFO_BTN_FONT_SIZE,DEF_INFO_BTN_FONT_SIZE,DEF_INFO_BTN_FONT_SIZE]; //ヘルプツールチップスのポップアップコントロールの高さ(px) ※ポップアップコントロールは下端からの相対座標なのでウィンドウ内部の高さからコントロールの高さを減算 const DEF_FLOAT_POPUP_HEIGHT = 300; var gi_floatPopupHeight = DEF_FLOAT_POPUP_HEIGHT; //ヘルプツールチップスのポップアップコントロールを表示するY軸方向のマージン(px) ※ポップアップコントロールを上部ヘッダ(スクロールしない固定部)ぶんずらす為の値 const DEF_FLOAT_POPUP_MARGIN = 45; var gi_floatPopupMargin = DEF_FLOAT_POPUP_MARGIN; //ホームTLの「フォロー中」表示を置き換える文字列(置き換えない場合は空文字 "" にしておく) const HOME_TL_NAME = "HomeTL"; //ボタンコントロールの文字列 var BTN_TXT_AUT = "◆";// 自動更新強制OFF切り替えボタン var BTN_TXT_SRT = "▲";// 短周期タイマのワンショット実行・動作切り替えボタン var BTN_TXT_INT = "■";// コンフィグ・システムコンフィグボタン var BTN_TXT_HLP = "?";// ヘルプダイアログ表示ボタン var BTN_TXT_ED1 = "↑";// エディット欄表示切り替えボタン:表示ON中 var BTN_TXT_ED0 = "↓";// エディット欄表示切り替えボタン:表示OFF中 var BTN_TXT_BTNL = "BTN1";// 情報表示部の左ボタン var BTN_TXT_BTNM = "BTN2";// 情報表示部の中ボタン var BTN_TXT_BTNR = "BTN3";// 情報表示部の右ボタン //表示部固定文字列 const TXT_COUNTDOWNTIM = "[ #### / $$$$$$$$ ]";//自動更新有効時のカウントダウン表示 const TXT_NOCOUNTDOWNT = "[ Active/ $$$$$$$$ ]";//自動更新有効時のカウントダウン表示なし設定時 const TXT_PAUSEDUPDATE = "[ Paused Refresh...]";//自動更新停止中 const TXT_LATESTNOFOCS = "[ Auto / $$$$$$$$ ]";//自動更新有効時フォーカスのない時の表示 const TXT_PAUSEDUPDAT2 = "[ Paused/ $$$$$$$$ ]";//自動更新停止中(最終更新時間表示あり) const TXT_MANUALUPDATE = "[ Manually Update. ]";//手動更新実施中 const TXT_AUTOCLICKMOR = "[ AutoClick Update ]";//さらに表示の自動クリック更新実施中 const TXT_RELOADEXTEND = "[ Reload Extended. ]";//強制リロード時間延長 const TXT_FORCERELOADD = "[ Force ReloadPage ]";//強制リロード実施中 const TXT_CHANGEBGTYPE = "[ Change BG Type# ]";//既読マーク背景パターン変更 const TXT_CHANGEBGNONE = "[ ReadMarkDisabled ]";//既読マーク無効 const TXT_CLEARNEWNOTI = "[ Clear New Info...]";//通知ページの新着表示クリア中 /************************************************************ 汎用関数定義 ************************************************************/ //本スクリプトとは無関係のURLかどうかを判定 ※先にPATH_LISTかどうかを判定しないとリスト一覧の i なしlistsにパターンマッチしてしまうので注意 function isOtherURL(hr){ //hr: URL/Path //return: true=無関係のURL / false=スクリプト処理対象のURL if( hr.indexOf(TWITTER_URL + "messages") != -1 || hr.indexOf(TWITTER_URL + "compose") != -1 || hr.indexOf(TWITTER_URL + "settings") != -1 || hr.indexOf(TWITTER_URL + "explore") != -1 || hr.indexOf(TWITTER_URL + "i/bookmarks") != -1 || hr.indexOf(TWITTER_URL + "i/circles") != -1 || hr.indexOf(TWITTER_URL + "i/connect_people") != -1 || hr.indexOf(TWITTER_URL + "i/display") != -1 || hr.indexOf(TWITTER_URL + "intent/") != -1 || hr.indexOf(TWITTER_URL + "ja/") != -1 || hr.indexOf(TWITTER_URL + "en/") != -1 || (hr.indexOf(TWITTER_URL) != -1 && hr.indexOf("/status/") != -1) || (hr.indexOf(TWITTER_URL) != -1 && hr.indexOf("/lists") != -1)){ return true; } return false; } //日付時刻の整形 function toFormatedDateString(date){ //date: 日時オブジェクト //return: 整形後の日付時刻 // yy/mm/dd HH:MM:SS var ret = ("0" + date.getFullYear()).slice(-2) + "/" + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) + " " + ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2) + ":" + ("0" + date.getSeconds()).slice(-2); return ret; } //時刻の整形 function toFormatedTimeString(date){ //date: 日時オブジェクト //return: 整形後の時刻 // HH:MM:SS var ret = ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2) + ":" + ("0" + date.getSeconds()).slice(-2); return ret; } //配列の昇順クイックソート function quicksort(ary) { //ary: ソート対象配列 function impl(start, end){ if (start + 1 >= end) return; let [pivot, l, r] = [start, start, end - 1]; while (l < r) { while (ary[pivot] < ary[r]) r--; while (ary[l] <= ary[pivot] && l < r) l++; [ary[l], ary[r]] = [ary[r], ary[l]]; } [ary[pivot], ary[l]] = [ary[l], ary[pivot]]; impl(start, l); impl(l+1, end); } impl(0, ary.length); } /************************************************************ イベント処理関連関数 ************************************************************/ //MutationObserverでDOM更新が上がってきた最終タイムスタンプ保持 var gdt_lastDomTime = new Date(); var gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); //要素の初回書き換わりを監視 window.addEventListener('load', function(){ dispDebugTextWithTime("window.load : Window loaded"); //初期処理が先に終わってロードイベントが発生するパターンの救済 if( gi_initComplete ){ //各種カウンタの初期化 dispDebugTextWithTime("window.load : Retry clearElements()"); gi_updateCountMs = 0; gi_displayPaused = 0; gi_initComplete = 0; clearElements(); } //リサイズされた時に情報表示部+ボタンが消失するパターンの救済 window.addEventListener("resize", function(){ //初回または初期処理が終わったあとにリサイズイベントが遅れてきた場合は処理しない if( gi_lastInnerWidth == 0 || gi_lastInnerWidth == Math.floor(window.innerWidth) ) return; //各種カウンタの初期化 dispDebugTextWithTime("window.resize : Retry clearElements()"); gi_updateCountMs = 0; gi_displayPaused = 0; gi_initComplete = 0; clearElements(); }); //console.log("★load: WindowLoaded"); }); //アーティクル数に応じた可変要素の1つ上のエレメントをDOM更新監視(アーティクルの増減をイベントとして受け取る) var observer = new MutationObserver(function(){ //DOMの変化が起こった時の処理 gdt_lastDomTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); //停止していた短周期タイマを再開 if( gi_idleShortTimer ){ if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceElements, gi_shortIntervalMs); for( var i=0; i 0 ){ gelm0[0].removeAttribute( gstr_scrTypeAttr ); } gelm0 = document.querySelectorAll('body[' + gstr_scrLightColorAttr +']'); if( gelm0.length > 0 ){ gelm0[0].removeAttribute( gstr_scrLightColorAttr ); } //URLからモードを決定 gi_lastDispMode = gi_dispMode; getModeFromURL(); if( gi_lastDispMode != gi_dispMode ){ //遷移後初回だけ dispDebugTextWithTime("clearElements : gi_dispMode = " + gstrA_modeNamePrifix[gi_dispMode]); } if( gi_dispMode == MODE_NULL ){ //gstr_lastURL = ""; window.setTimeout(clearElements, gi_shortIntervalMs); if( gi_lastDispMode != gi_dispMode ){ //遷移後初回だけ dispDebugTextWithTime("clearElements : MODE_NULL Retry"); } return; } //各種カウンタの初期化 gi_updateCountMs = Math.trunc(Math.random() * giA_updateIntervalMs[gi_dispMode] / 1000) * 1000; gi_displayPaused = 0; gelm0 = gelm1 = gelm2 = gelm3 = gelm4 = gelm5 = gelm6 = gelm7 = gelm8 = gelm9 = gelmObserv = null; //console.log("☆clearElements [" + gi_updateCountMs + "]" ); //監視対象の要素オブジェクト if( gi_dispMode == MODE_HOME ){ gelm1 = document.querySelectorAll('div[aria-label="タイムライン: ホームタイムライン"]'); }else if( gi_dispMode == MODE_LIST ){ gelm1 = document.querySelectorAll('div[aria-label="タイムライン: リスト"]'); }else if( gi_dispMode == MODE_USER ){ gelm1 = document.querySelectorAll('div[aria-label^="タイムライン: "][aria-label$="さんのポスト"]'); }else if( gi_dispMode == MODE_NOTI ){ gelm1 = document.querySelectorAll('div[aria-label="タイムライン: 通知"]'); }else if( gi_dispMode == MODE_SEAR ){ gelm1 = document.querySelectorAll('div[aria-label="タイムライン: タイムラインを検索"]'); } if( gelm1.length > 0 ) gelmObserv = gelm1[0].firstElementChild; if( gelmObserv === null ){ //ドキュメント未構成のため時間を置いてリトライ window.setTimeout(clearElements, gi_shortIntervalMs); //console.log("☆clearElements Retry Timer" ); //連続して出ないように初回だけ表示 if( ! gf_documentError ){ dispDebugTextWithTime("clearElements : Document not found [forDOM]"); } gf_documentError = true; return; } gf_documentError = false; //カスタムCSSで判別するための要素を追加(ユーザーページは消去法で判定しないと無理で、カスタムCSSではそんな判別は出来ないため) gelm0 = document.querySelectorAll('body'); if( gelm0.length > 0 ){ gelm0[0].setAttribute( gstr_scrTypeAttr, gstr_scrModeAttrPfx + gstrA_modeNamePrifix[gi_dispMode] ); //ライトカラー設定の時に目印 if( ! COLOR_MODE ){ gelm0[0].setAttribute( gstr_scrLightColorAttr, "" ); } //URL別の設定を読み込む findSettings(); //既読ポイント背景色設定の読込 if( gi_enableReadPointCheckBox ){ loadReadPointColorSetting(); } }else{ dispDebugTextWithTime("clearElements : Document not found [body]"); return; } var i; //固定ツイートを非表示にするための目印追加 if( gi_dispMode == MODE_USER ){ gelm2 = gelmObserv.firstElementChild; if( gelm2 !== null ){ gelm3 = gelm2.querySelectorAll('span'); for( i=0; i < gelm3.length; i++ ){ if( gelm3[i].textContent == "固定" ){ gelm2.setAttribute(gstr_scrFixedUserAttr,"true"); gelm4 = gelm2.firstElementChild; break; } } } } //検索ページで「話題のツイート」を非表示にしていた場合に「最新」にフォーカスを移す (style.displayでは状態が獲得出来ないのでclientHeigtを見るべし) if( gi_dispMode == MODE_SEAR ){ gelm3 = document.querySelectorAll('div[aria-label="ホームタイムライン"] div[role="tablist"][data-testid="ScrollSnap-List"] div[role="presentation"]:has(a[role="tab"])'); if( gelm3.length > 1 ){ gelm4 = gelm3[0].querySelectorAll('a[role="tab"]'); gelm5 = gelm3[1].querySelectorAll('a[role="tab"]'); if( gelm4.length > 0 && gelm5.length > 0 ){ if( gelm4[0].clientHeight == 0 && gelm4[0].getAttribute("aria-selected") == "true" ){ gelm5[0].click(); } } } } //既に張られているovserverを消去 observer.disconnect(); //要素の変化監視をスタート observer.observe(gelmObserv, configObserver); gdt_lastDomTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); if( gf_firstDOM ){ //起動時のドキュメント構築中の親エレメントが操作されてしまうとObserverが無効になるケースがあるのでイベントが上がるか要素追加してみる var dmy = document.createElement('DIV'); dmy.textContent = "[PseudoTweetDeck] Script Loading..."; gelmObserv.appendChild(dmy); gelmObserv.removeChild(dmy); window.setTimeout(checkDOMEvent, CHECK_DOM_INTERVAL); dispDebugTextWithTime("clearElements : checkDOMEvent()"); } //表示更新用エレメントの再取得 gelm_dispInfo = null; gi_initComplete = 1; gstr_lastURL = window.location.href; gi_lastInnerWidth = Math.floor(window.innerWidth); //console.log("★clear: Element"); dispDebugTextWithTime("clearElements : Init complete"); } //observerを設定したあとにDOMイベントが上がってきているかチェック function checkDOMEvent(){ if( gf_firstDOM ){ dispDebugTextWithTime("checkDOMEvent : Init retry"); gi_initComplete = 0; gi_lastDispMode = -1; clearElements(); } } //新着表示部のクリックイベントで更新表示と時間記録を行う function onClickNewTweet(){ if( gi_modeAutoOff ){ //色替え・手動更新表示 forceUpdateColor(COLOR_UPDATE, TXT_MANUALUPDATE); }else{ //色替え・自動クリック更新表示 forceUpdateColor(COLOR_UPDATE, TXT_AUTOCLICKMOR); } //更新トリガの時間を記録 gdt_lastTriggerTime = new Date(); //手動でトリガを掛けたので更新カウンタ時間を満了時間にする gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; } /************************************************************ 更新・表示関連関数 ************************************************************/ //更新が必要かどうかをURLとフォーカスコントロールの状態などから判定(内部の画面遷移とlocation.hrefは一致しないタイミングがあるので更新直前に確認が必要) function shouldNotUpdate(){ //return: true=更新しない状態 / false=更新する状態 var searchCandidate; var focusElement; var focusAttr; //HOME if( gi_dispMode == MODE_HOME ){ searchCandidate = document.body.querySelectorAll('div[class="css-1dbjc4n r-13awgt0 r-bnwqim"]'); focusElement = document.activeElement; if(searchCandidate.length > 0) { if(searchCandidate[0].innerHTML != ""){ //更新してしまうと検索ボックスが閉じてしまうため、この場合は更新しない //console.log("※SearchBox Enable"); return true; } } if(window.location.href == TWITTER_URL + PATH_HOME ){ //ツイート入力などにフォーカスが当たっている場合には処理しないようにする(フォーカスが外れる) focusAttr = focusElement.getAttribute("data-testid"); if(focusAttr !== null){ if(focusAttr != "tweet" && focusAttr != "retweet" && focusAttr != "unretweet" && focusAttr != "like" && focusAttr != "unlike" && focusAttr != "AppTabBar_Home_Link"){ //ホームボタンを押すと、ツイートにフォーカスが設定されることがある。その場合は更新する。 //console.log("※InputBox etc Enable + [" + focusAttr + "]"); return true; }else{ //console.log("※Focus Attr + [" + focusAttr + "]"); } } if( gi_modeAutoOff == 1 ){ return true; }else{ return false; } }else{ return true; } //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return true"); return true; } //LIST if( gi_dispMode == MODE_LIST ){ if(window.location.href.indexOf(TWITTER_URL + PATH_LIST) != -1 ){ //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return false"); if( gi_modeAutoOff == 1 ){ return true; }else{ return false; } } //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return true"); return false; } //USER if( gi_dispMode == MODE_USER ){ var hr = window.location.href; if(hr == (TWITTER_URL + PATH_HOME) || hr.indexOf(TWITTER_URL + PATH_LIST) != -1 || hr.indexOf(TWITTER_URL + PATH_NOTI) != -1 || hr.indexOf(TWITTER_URL + PATH_SEAR) != -1 || isOtherURL(hr) ){ //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return false"); return true; } //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return true"); if( gi_modeAutoOff == 1 ){ return true; }else{ return false; } } //NOTI if( gi_dispMode == MODE_NOTI ){ if(window.location.href.indexOf(TWITTER_URL + PATH_NOTI) != -1 ){ //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return false"); return false; } //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return true"); return true; } //SEAR if( gi_dispMode == MODE_SEAR ){ focusElement = document.activeElement; focusAttr = focusElement.getAttribute("data-testid"); if(focusAttr !== null){ //検索ボックスにフォーカスがあったら更新させない if(focusAttr == "SearchBox_Search_Input"){ //console.log("※InputBox Enable + [" + focusAttr + "] return true"); return true; }else{ //console.log("※Focus Attr + [" + focusAttr + "]"); } } if(window.location.href.indexOf(TWITTER_URL + PATH_SEAR) != -1 ){ //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return false"); if( gi_modeAutoOff == 1 ){ return true; }else{ return false; } } //console.log("※Current href + [" + window.location.href + "] / Focus tagName + [" + focusElement.tagName + "] return true"); return true; } return true; } //定周期更新処理メイン function updateTimeline() { gdt_temp = new Date(); //画面遷移を判定し、変わっていたら初期処理をやりなおす if( gstr_lastURL != window.location.href ){ dispDebugTextWithTime("updateTimeline : [" + gstr_lastURL.replace(TWITTER_URL,'').substr(0,25) + "]→[" + window.location.href.replace(TWITTER_URL,'').substr(0,25) + "]" ); gstr_lastURL = window.location.href; for(var idx=0; idx < gi_readArticles; idx++){ gstrA_readTimeStamp[idx] = ""; gstrA_readArticleURL[idx] = ""; } //初期処理 gi_initComplete = 0; clearElements(); return; } //長周期タイマ処理 execLongSpanTimer(); //自動更新に該当しないページは何もせず戻る if( gi_dispMode == MODE_NULL ){ return; } if(gi_idleShortTimer){ //短周期タイマ開始から時間が経過したらタイマを停止させる if( gtmr_shortTimer !== null ){ if( gdt_temp.getTime() - gstr_lastShortStart.getTime() > gi_shortTimerIdleMs ){ window.clearInterval(gtmr_shortTimer); gtmr_shortTimer = null; gstr_lastShortStart = gdt_temp; dispDebugTextWithTime("updateTimeline : Stop short timer"); //console.log("★gtmr_shortTimer: ShortTimerOFF [" + toFormatedDateString(gdt_temp) + "]"); for( var i=0; i (gi_reloadTimeoutSec * 1000) ){ var f = false; var v = "20" + loadSetting(FORCEUPDATE_HEADER, KEY_SYSTEM); if( v != null ){ var timeSub = (gdt_temp.getTime() - (new Date(v)).getTime() ); //短時間に実施しないため前回実施時刻を獲得 if( timeSub > (gi_forceUpdateLockTimeSec * 1000) ){ f = true; }else{ gi_updateCountMs = Math.trunc(Math.random() * giA_updateIntervalMs[gi_dispMode] / 1000) * 1000; forceUpdateColor(COLOR_RELOAD, TXT_RELOADEXTEND); dispDebugTextWithTime("updateTimeline : Reload extend"); return; } }else{ f = true; } if( f ){ saveSetting(FORCEUPDATE_HEADER, KEY_SYSTEM, ( toFormatedDateString(gdt_temp)) ); closePopupReloadConfirm(); dispDebugTextWithTime("updateTimeline : Reload confirm"); gelm_fixedReloadConfirm = popupConfirm( "リロードします", "キャンセル", function(){ window.clearTimeout(gobj_reloadDialog); gi_reloadWaitMs = null; gdt_lastDomTime = gdt_lastTriggerTime = gdt_temp; gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; closePopupReloadConfirm(); dispPopupMessage("強制リロードをキャンセルしました", gi_displayPopupCloseTimeSec); } ); gobj_reloadDialog = window.setTimeout( function(){ window.location.reload(); }, gi_reloadWaitMs ); gi_displayPaused = 0; gi_updateCountMs = 0; forceUpdateColor(COLOR_UPDATE, TXT_FORCERELOADD); gi_initComplete = 0; return; } } } //更新トリガ(通知ページの新着クリアは経過時間に関係なくトリガする) if( (gdt_temp.getTime() - gdt_lastTriggerTime.getTime() > gi_manualUpdateIntervalSec * 1000) || (gi_dispMode == MODE_NOTI) ){ execTrigger(true, null); dispDebugTextWithTime("updateTimeline : Auto execTrigger()"); } //更新されたのでカウンタをリセット gi_displayPaused = 0; gi_updateCountMs = 0; //console.log("☆Counter Update0 [" + gi_updateCountMs + "]" ); }else{ //更新待ちカウンタの加算 gi_displayPaused = 0; gi_updateCountMs += gi_timerIntervalMs; //console.log("☆Counter Update1 [" + gi_updateCountMs + "]" ); } }else{ //フォーカスの判定が外れたのでカウントリセット・URLが変わっていたので次回オブジェクト捜索しなおし gi_initComplete = 0; gi_updateCountMs = giA_updateIntervalMs[gi_dispMode]; gi_displayPaused = 1; //console.log("☆Wait for current control [" + gi_updateCountMs + "]" ); } }else{ //先頭に戻された次回に少し待って更新がかかるようにする gi_displayPaused = 1; //手動更新の操作でトリガが掛かった後ならカウンタリセット、それ以外でスクロール位置が先頭に戻ったら少し後にトリガ if( gi_onTopWaitMs != 0 && ( gdt_temp.getTime() - gdt_lastTriggerTime.getTime() > gi_manualUpdateIntervalSec * 1000 ) ){ gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - gi_onTopWaitMs; }else{ gi_updateCountMs = 0; } if(gi_updateCountMs < 1000 ) gi_updateCountMs = 0; //console.log("☆Wait for window top [" + gi_updateCountMs + "]" ); } //更新に関する情報を表示する updateDisplayInfo(); } //更新トリガ処理 function execTrigger(onAuto, buttonId){ //onAuto: true=自動処理によるトリガ / false=手動更新によるトリガ //buttonId : 手動トリガ時のボタンインデックス var msg = "新着を現在の最新より上に積むのを試みます"; var e0, e1, tm = new Date(); if( gi_dispMode == MODE_HOME ){ //メニューのHomeを押す事で更新トリガさせる var homeButton = document.body.querySelectorAll('a[data-testid="AppTabBar_Home_Link"]'); if(homeButton.length > 0) { homeButton[0].click(); //更新トリガの時間を記録 gdt_lastTriggerTime = tm; //console.log("★Home Button Update"); //トリガ後に先頭記事に遷移して新着を上に積む if( ! onAuto && giA_updateContinuousButton[buttonId] ){ if( gi_updateContinuousDispPopup ){ dispPopupMessage(msg, gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } window.setTimeout( clickNewestTweet, gi_updateContimuousDelayTimeMs ); } } }else if( gi_dispMode == MODE_LIST || gi_dispMode == MODE_SEAR || gi_dispMode == MODE_USER ){ if( gi_dispMode != MODE_SEAR || ! gi_disableCssOnSearchUpdate ){ //スクロール操作によって更新トリガさせる window.scrollTo(0, window.innerHeight); window.setTimeout( function(){ window.scrollTo(0, 0);}, SCROLL_TYPE_TRIGGER_WAIT ); }else{ //検索ページでは一部環境でCSSが起因してか更新が掛からないので一旦印をつけてCSSを無効にする e0 = document.querySelectorAll('body:not([' + gstr_scrSearchUpdate +'])'); if( e0.length > 0 ){ e0[0].setAttribute( gstr_scrSearchUpdate, "" ); } //スクロール操作によって更新トリガさせる window.setTimeout( function(){ window.scrollTo(0, window.innerHeight);}, SCROLL_TYPE_TRIGGER_WAIT + gi_disableCssSearchWaitMs ); window.setTimeout( function(){ window.scrollTo(0, 0);}, (SCROLL_TYPE_TRIGGER_WAIT + gi_disableCssSearchWaitMs) * 2 ); //CSS無効を戻す window.setTimeout( function(){ var e0 = document.querySelectorAll('body[' + gstr_scrSearchUpdate +']'); if( e0.length > 0 ){ e0[0].removeAttribute( gstr_scrSearchUpdate ); } }, (SCROLL_TYPE_TRIGGER_WAIT + gi_disableCssSearchWaitMs) * 3 ); } //更新トリガの時間を記録 gdt_lastTriggerTime = tm; //トリガ後に先頭記事に遷移して新着を上に積む if( ! onAuto && giA_updateContinuousButton[buttonId] ){ if( gi_updateContinuousDispPopup ){ dispPopupMessage(msg, gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } gi_updateContinuousReturnRetry = 0; window.setTimeout( clickNewestTweet, gi_updateContimuousDelayTimeMs ); } //console.log("★Scroll Update"); /* //参考ソース https://github.com/natsuyasai/TwitterAutoReloadScript // aタグの中からタグ要素かつ現在アクティブになっている要素を取得し、クリックイベントを発火させる・・・手動で上部タブをクリックしても更新かかってくれませんね、これは旧仕様用でしょう e0 = document.querySelectorAll('a[role="tab"][aria-selected="true"]'); if( e0.length > 0 ) { e0[0].click(); } */ }else if( gi_dispMode == MODE_NOTI ){ //通知ページの場合はDM新着チェック checkDMNotification(); //通知ページの場合は新着表示クリア clearNewNotification(); } } //表示用エレメントのチェック〜無ければ捜索 function findDisplayElements(){ //カウンタ表示用のエレメントを捜索 if( gelm_dispInfo === null ){ if( gi_dispMode == MODE_HOME ){ //Home gelm0 = document.querySelectorAll('a[role="tab"][aria-selected="true"]'); if( gelm0.length > 0 ){ gelm1 = gelm0[0].firstElementChild; if( gelm1 !== null ){ gelm2 = gelm1.firstElementChild; if( gelm2 !== null ){ //情報表示&ボタン類を追加する場所 setupElement(gelm2); //「フォロー中」を「Home」に置換 gelm3 = gelm2.firstElementChild; if( gelm3 !== null && HOME_TL_NAME != "" ){ gelm3.textContent = HOME_TL_NAME; } //情報表示をする場所 //gelm_dispInfo = gelm2.firstElementChild; //console.log("★find: Element"); } } } }else if( gi_dispMode == MODE_LIST ){ //List //リスト作成者のアカウント名に表示項目を追加 gelm0 = document.querySelectorAll('h2[dir="ltr"][aria-level="2"][role="heading"]'); if( gelm0.length > 0 ){ gelm4 = gelm0[0].firstElementChild; if( gelm4 !== null ){ //情報表示&ボタン類を追加する場所 setupElement(gelm4); } } }else if( gi_dispMode == MODE_USER ){ //User //ユーザーのツイート数に表示項目を追加 gelm0 = document.querySelectorAll('h2[dir="ltr"][aria-level="2"][role="heading"]'); if( gelm0.length > 0 ){ gelm4 = gelm0[0].firstElementChild; if( gelm4 !== null ){ gelm5 = gelm4.firstElementChild; if( gelm5 !== null ){ //情報表示&ボタン類を追加する場所 setupElement(gelm5); } } //console.log("★find: Element"); } }else if( gi_dispMode == MODE_NOTI ){ //Notification gelm0 = document.querySelectorAll('h2[dir="ltr"][aria-level="2"][role="heading"]'); if( gelm0.length > 0 ){ setupElement(gelm0[0]); gelm_btnAutoOff.style.display = "none"; //console.log("★find: Element"); } }else if( gi_dispMode == MODE_SEAR ){ //Search //検索ページの最新に表示項目を追加 gelm0 = document.querySelectorAll('div[data-testid="ScrollSnap-SwipeableList"]'); if( gelm0.length > 0 ){ gelm1 = gelm0[0].firstElementChild; if( gelm1 !== null ){ gelm2 = gelm1.firstElementChild; if( gelm2 !== null ){ gelm3 = gelm2.nextElementSibling; if( gelm3 !== null ){ gelm4 = gelm3.firstElementChild; if( gelm4 !== null ){ gelm5 = gelm4.firstElementChild; if( gelm5 !== null ){ gelm6 = gelm5.firstElementChild; if( gelm6 !== null ){ //情報表示&ボタン類を追加する場所 setupElement(gelm6); //console.log("★find: Element"); } } } } } } } } } } //情報の表示更新〜色替え function updateDisplayInfo(){ var tmp, str; //更新に関する情報を表示する if( gi_initComplete != 0 || gi_displayPaused ){ //表示用エレメントのチェック〜無ければ捜索 findDisplayElements(); //カウンタを更新 if( gelm_dispInfo !== null ){ tmp = giA_updateIntervalMs[gi_dispMode] - gi_updateCountMs; if(tmp < 1000 ) tmp = 0; //フォーカスを持ったタブのみカウントを都度更新(全部に対して行うと重すぎる) //設定内容を設定先と比較して違ったら代入するようにしているのは、代入によって内部でDOM更新が走り処理が重くなるため if( (document.visibilityState === "visible" && document.hasFocus() === true || gi_onButtonHover ) && gi_dispMode != MODE_NOTI ){ if( ! gi_displayPaused ){ if( ! gi_noCountDownDisp || gi_onButtonHover ){ //TXT_COUNTDOWNTIM = "[ #### / $$$$$$$$ ]"; str = TXT_COUNTDOWNTIM.replace("####", ("0000" + (tmp / 1000)).slice(-4) ).replace("$$$$$$$$",gstr_lastDomTime) }else{ //TXT_NOCOUNTDOWNT = "[ Active/ $$$$$$$$ ]"; str = TXT_NOCOUNTDOWNT.replace("$$$$$$$$",gstr_lastDomTime) } if(gelm_dispInfo.textContent != str) gelm_dispInfo.textContent = str; if( tmp == 0 ){ gi_colorType = TYPE_UPDATE; }else if( tmp <= 10000 ){ //強制リロード間際の色替え if( gdt_temp.getTime() - gdt_lastDomTime.getTime() > (gi_reloadTimeoutSec * 1000 - 10000) && gi_reloadTimeoutSec > 0 ){ gi_colorType= TYPE_RELOAD; }else{ gi_colorType = TYPE_UPSOON; } }else{ gi_colorType = TYPE_ACTIVE; } }else{ if( ! gi_enableDomTimeAutoOff ){ //TXT_PAUSEDUPDATE = "[ Paused Refresh...]"; str = TXT_PAUSEDUPDATE; }else{ //TXT_PAUSEDUPDAT2 = "[ Paused/ $$$$$$$$ ]"; str = TXT_PAUSEDUPDAT2.replace("$$$$$$$$",gstr_lastDomTime); } if(gelm_dispInfo.textContent != str) gelm_dispInfo.textContent = str; gi_colorType = TYPE_PAUSED; } }else{ //最後にDOM更新があがってきたタイムスタンプを表示 if( ! gi_displayPaused || gi_dispMode == MODE_NOTI ){ //TXT_LATESTNOFOCS = "[ Auto / $$$$$$$$ ]"; str = TXT_LATESTNOFOCS.replace("$$$$$$$$",gstr_lastDomTime); if(gelm_dispInfo.textContent != str) gelm_dispInfo.textContent = str; if( tmp == 0 && gi_dispMode != MODE_NOTI ){ gi_colorType = TYPE_UPDATE; }else if( tmp <= 10000 && gi_dispMode != MODE_NOTI ){ //強制リロード間際の色替え if( gdt_temp.getTime() - gdt_lastDomTime.getTime() > (gi_reloadTimeoutSec * 1000 - 10000) && gi_reloadTimeoutSec > 0 ){ gi_colorType= TYPE_RELOAD; }else{ gi_colorType = TYPE_UPSOON; } }else{ //通知ページ専用処理 if( gi_dispMode == MODE_NOTI ){ //強制リロード間際の色替え if( gdt_temp.getTime() - gdt_lastDomTime.getTime() > (gi_reloadTimeoutSec * 1000 - 10000) && gi_reloadTimeoutSec > 0 ){ gi_colorType= TYPE_RELOAD; }else if(gb_flgClearNotification){ //新着クリア中の表示 forceUpdateColor((COLOR_MODE)?COLOR_WHITE:COLOR_BLACK,TXT_CLEARNEWNOTI); gi_colorType= 0; }else{ gi_colorType= TYPE_ACTIVE; } }else{ gi_colorType = TYPE_ACTIVE; } } }else{ if( ! gi_enableDomTimeAutoOff ){ //TXT_PAUSEDUPDATE = "[ Paused Refresh...]"; str = TXT_PAUSEDUPDATE; }else{ //TXT_PAUSEDUPDAT2 = "[ Paused/ $$$$$$$$ ]"; str = TXT_PAUSEDUPDAT2.replace("$$$$$$$$",gstr_lastDomTime); } if(gelm_dispInfo.textContent != str) gelm_dispInfo.textContent = str; gi_colorType = TYPE_PAUSED; } } if(gelm_dispInfo.style.fontSize != gstrA_titleSize[gi_dispMode]) gelm_dispInfo.style.fontSize = gstrA_titleSize[gi_dispMode]; //表示部をクリックしても更新トリガしない期間の色替え if( gi_colorType != TYPE_RELOAD && gi_colorType != 0 ){ if( gdt_temp.getTime() - gdt_lastTriggerTime.getTime() <= gi_manualUpdateIntervalSec * 1000 ){ gi_colorType = TYPE_HOLDTM; } } //ボタンコントロールの色替え if(gi_colorType == TYPE_UPDATE){ if(gelm_dispInfo.style.color != COLOR_UPDATE) gelm_dispInfo.style.color = COLOR_UPDATE; if(gelm_btnInterval.style.color != COLOR_INT_UPDATE) gelm_btnInterval.style.color = COLOR_INT_UPDATE; if(gelm_btnHelp.style.color != COLOR_HLP_UPDATE) gelm_btnHelp.style.color = COLOR_HLP_UPDATE; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_UPDATE) gelm_btnAutoOff.style.color = COLOR_AUT_UPDATE; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null && ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_UPDATE) gelm_btnShort.style.color = COLOR_IDL_UPDATE; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_UPDATE) gelm_btnShort.style.color = COLOR_ALW_UPDATE; } }else if(gi_colorType == TYPE_UPSOON){ if(gelm_dispInfo.style.color != COLOR_UPSOON) gelm_dispInfo.style.color = COLOR_UPSOON; if(gelm_btnInterval.style.color != COLOR_INT_UPSOON) gelm_btnInterval.style.color = COLOR_INT_UPSOON; if(gelm_btnHelp.style.color != COLOR_HLP_UPSOON) gelm_btnHelp.style.color = COLOR_HLP_UPSOON; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_UPSOON) gelm_btnAutoOff.style.color = COLOR_AUT_UPSOON; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null && ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_UPSOON) gelm_btnShort.style.color = COLOR_IDL_UPSOON; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_UPSOON) gelm_btnShort.style.color = COLOR_ALW_UPSOON; } }else if(gi_colorType == TYPE_ACTIVE){ if(gelm_dispInfo.style.color != COLOR_ACTIVE) gelm_dispInfo.style.color = COLOR_ACTIVE; if(gelm_btnInterval.style.color != COLOR_INT_ACTIVE) gelm_btnInterval.style.color = COLOR_INT_ACTIVE; if(gelm_btnHelp.style.color != COLOR_HLP_ACTIVE) gelm_btnHelp.style.color = COLOR_HLP_ACTIVE; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_ACTIVE) gelm_btnAutoOff.style.color = COLOR_AUT_ACTIVE; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null && ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_ACTIVE) gelm_btnShort.style.color = COLOR_IDL_ACTIVE; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_ACTIVE) gelm_btnShort.style.color = COLOR_ALW_ACTIVE; } }else if(gi_colorType == TYPE_PAUSED){ if(gelm_dispInfo.style.color != COLOR_PAUSED) gelm_dispInfo.style.color = COLOR_PAUSED; if(gelm_btnInterval.style.color != COLOR_INT_PAUSED) gelm_btnInterval.style.color = COLOR_INT_PAUSED; if(gelm_btnHelp.style.color != COLOR_HLP_PAUSED) gelm_btnHelp.style.color = COLOR_HLP_PAUSED; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_PAUSED) gelm_btnAutoOff.style.color = COLOR_AUT_PAUSED; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null && ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_PAUSED) gelm_btnShort.style.color = COLOR_IDL_PAUSED; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_PAUSED) gelm_btnShort.style.color = COLOR_ALW_PAUSED; } }else if(gi_colorType == TYPE_HOLDTM){ if(gelm_dispInfo.style.color != COLOR_HOLDTM) gelm_dispInfo.style.color = COLOR_HOLDTM; if(gelm_btnInterval.style.color != COLOR_INT_HOLDTM) gelm_btnInterval.style.color = COLOR_INT_HOLDTM; if(gelm_btnHelp.style.color != COLOR_HLP_HOLDTM) gelm_btnHelp.style.color = COLOR_HLP_HOLDTM; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_HOLDTM) gelm_btnAutoOff.style.color = COLOR_AUT_HOLDTM; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null&& ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_HOLDTM) gelm_btnShort.style.color = COLOR_IDL_HOLDTM; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_HOLDTM) gelm_btnShort.style.color = COLOR_ALW_HOLDTM; } }else if(gi_colorType == TYPE_RELOAD){ if(gelm_dispInfo.style.color != COLOR_RELOAD) gelm_dispInfo.style.color = COLOR_RELOAD; if(gelm_btnInterval.style.color != COLOR_INT_RELOAD) gelm_btnInterval.style.color = COLOR_INT_RELOAD; if(gelm_btnHelp.style.color != COLOR_HLP_RELOAD) gelm_btnHelp.style.color = COLOR_HLP_RELOAD; if( gi_modeAutoOff == 1 ){ if(gelm_btnAutoOff.style.color != COLOR_AUT_DISABL) gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; }else{ if(gelm_btnAutoOff.style.color != COLOR_AUT_RELOAD) gelm_btnAutoOff.style.color = COLOR_AUT_RELOAD; } //短周期タイマの稼動状態 if( gi_idleShortTimer == 1 ){ if( gtmr_shortTimer === null && ! gf_oneShotShortTimer ){ //短周期タイマ停止中 if(gelm_btnShort.style.color != COLOR_IDL_DISABL) gelm_btnShort.style.color = COLOR_IDL_DISABL; }else{ //短周期タイマ動作中 if(gelm_btnShort.style.color != COLOR_IDL_RELOAD) gelm_btnShort.style.color = COLOR_IDL_RELOAD; } }else{ //短周期タイマ常時稼動モード if(gelm_btnShort.style.color != COLOR_ALW_RELOAD) gelm_btnShort.style.color = COLOR_ALW_RELOAD; } } } } gf_oneShotShortTimer = false; } //通常パターン以外での色替え(手動の更新操作やエラー発生時などのモニタリング用) function forceUpdateColor(rgba,txt){ //rgba: 表示色 //txt: 表示文字列 if( gelm_dispInfo === null || gelm_dispInfo.textContent === null || gelm_btnInterval === null || gelm_btnHelp === null || gelm_btnAutoOff === null || gelm_btnShort === null ) return; gelm_dispInfo.textContent = txt; gelm_dispInfo.style.color = rgba; gelm_btnHelp.style.color = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnInterval.style.color = COLOR_GRAY; gelm_btnAutoOff.style.color = COLOR_GRAY; gelm_btnShort.style.color = COLOR_GRAY; } /************************************************************ 長周期タイマ処理関数 ************************************************************/ function execLongSpanTimer(){ //10秒サイクル処理 if( ++gi_longTimerCount10 >= gi_maxLongTimerCount10 ){ gi_longTimerCount10 = 0; //消し残りポップアップ救済 closePopupMessage(); } //60秒サイクル処理を10秒サイクル処理から半サイクルずらして実行 if( gi_longTimerCount10 == Math.floor(gi_maxLongTimerCount10 / 2) ){ if( ++gi_longTimerCount60 >= gi_maxLongTimerCount60 ){ gi_longTimerCount60 = 0; /* //短周期タイマ開始から時間が経過したらワンショット実施する if( gi_dispMode == MODE_HOME || gi_dispMode == MODE_LIST || gi_dispMode == MODE_USER || gi_dispMode == MODE_SEAR ){ if( gi_idleShortTimer == 1 && gtmr_shortTimer === null ){ if( gdt_temp.getTime() - gstr_lastShortStart.getTime() > gi_shortTimerIdleMs * 2 ){ replaceElementsOneShot(); gstr_lastShortStart = gdt_temp; //console.log("★execLongSpanTimer : OneShot shortTimer [" + toFormatedDateString(gdt_temp) + "]"); } } } */ } } } /************************************************************ 短周期タイマ処理関数 ************************************************************/ function replaceElementsOneShot(){ return replaceElements(true); } const HOME_NEW_TWEET = '[class="css-18t94o4 css-1dbjc4n r-1777fci r-dfe81l r-1ny4l3l r-o7ynqc r-6416eg r-13qz1uu"]'; //短周期処理(タイムスタンプ置換、表示タイトル変更、さらに表示系の自動押下) function replaceElements(oneShot=false) { //oneShot: true=短周期タイマ停止中のワンショット実行 var e0, e1, e2, e3, e4, e5, e6, idx; var dt = new Date(); gf_oneShotShortTimer = oneShot; //新着表示をクリックした場合にも更新時間を記録 e0 = document.querySelectorAll('body'); if( e0.length > 0 ){ e1 = e0[0].querySelectorAll('div[aria-label="タイムライン: ホームタイムライン"] div[data-testid="cellInnerDiv"]:has(' + HOME_NEW_TWEET + ')'); if( e1.length > 0 ){ if( e0[0].getAttribute(gstr_scrNewTweetAttr) == null){ if( gi_hideNumberNewTweet ){ e0[0].setAttribute(gstr_scrNewTweetAttr, 'false'); e1[0].display = "none"; // console.log("★replaceElements0 SET:" + gstr_scrNewTweetAttr + " = false"); }else{ e0[0].setAttribute(gstr_scrNewTweetAttr, 'true'); e1[0].display = null; //console.log("★replaceElements0 SET:" + gstr_scrNewTweetAttr + " = true"); } } e2 = e1[0].querySelectorAll( HOME_NEW_TWEET + ':not([' + gstr_scrNewTweetAttr + '])'); for( idx=0; idx < e2.length; idx++ ){ //イベントリスナーを多重登録しないよう目印をつける e2[idx].setAttribute(gstr_scrNewTweetAttr, 'true'); //console.log("★replaceElements0 新着のエレメント発見[" + idx + "]"); e2[idx].addEventListener('click', onClickNewTweet); } } } //リストページは何故か一定以上スクロールするとヘッダ非表示のCSSが悪さをするらしくDOM更新が止まらなくなるのを抑止 if( gi_dispMode == MODE_LIST ){ var elm; if( window.pageYOffset < LIST_PAGE_SCROLL_LIMIT ){ elm = document.querySelectorAll('body[' + gstr_scrScrollList +']'); if( elm.length > 0 ){ elm[0].removeAttribute( gstr_scrScrollList ); //console.log("★updateTimeline: reset gstr_scrScrollList"); } }else{ elm = document.querySelectorAll('body:not([' + gstr_scrScrollList +'])'); if( elm.length > 0 ){ elm[0].setAttribute( gstr_scrScrollList, "" ); //console.log("★updateTimeline: set gstr_scrScrollList"); } } } //重複記事の非表示 if( gi_notDispSameArticle ){ removeSameArticle(); } //タイムスタンプ置換・既読マークを全アーティクルに対して実施する document.querySelectorAll('main div[data-testid="primaryColumn"] section article a[href*="/status/"] time:not([' + TIME_FIXED + '])').forEach(function(e) { var a = e.parentNode; var b = a.parentNode; var h = a.getAttribute('href'); var s0 = e.getAttribute('datetime'); var s1 = toFormatedDateString(new Date(s0)); var span; if( gi_replaceTimeStamp ){ //置換をする設定の場合 span = document.createElement('span'); span.setAttribute('datetime', s0); span.setAttribute('local-datetime', s1); span.textContent = s1; a.appendChild(span); a.removeChild(e); }else{ //置換をしない設定の場合は目印をつけておかないと毎回チェックボックスが増えてしまう e.setAttribute(TIME_FIXED,""); } var u = window.location.href; u = u.replace( TWITTER_URL, ""); //遷移直後にURLがhomeなのにgi_dispModeが0のような事があるので再判定 if( gi_dispMode == MODE_NULL ){ getModeFromURL(); } //既読マークの処理 if( gi_enableReadPointCheckBox ){ if( gi_dispMode == MODE_HOME || gi_dispMode == MODE_LIST || gi_dispMode == MODE_USER || gi_dispMode == MODE_SEAR ){ //チェックボックスの下地になるdiv作成 var dv = document.createElement("div"); dv.setAttribute(gstr_scrReadPointParentAttr,""); dv.style.display = "flex"; dv.style.marginTop = '0px'; dv.style.marginBottom = '0px'; dv.style.marginLeft = '3px'; dv.style.marginRight = '0px'; dv.style.backgroundColor = COLOR_BORDER; dv.style.borderWidth = "0px"; dv.zIndex = "9"; //既読ポイントのチェックボックス追加 var chk = document.createElement('input'); chk.setAttribute('type','checkbox'); chk.setAttribute(gstr_scrReadPointAttr,'false'); //既読ポイントのデータは先に読み込んでおいてループ内では取得しないようにしたいところだがループ中にURLプロパティが変わる事があるらしい?ので重いけど都度取得 //※一旦先頭のツイートに遷移中とかでもデータは読み込まれていて裏で書き換わっているイメージか? loadStorageData(); for( idx=0; idx < gi_readArticles; idx++ ){ gstrA_readArticleURL[idx] = loadSetting( READ_HEADER[idx], u, true ); if( gstrA_readArticleURL[idx] === null ) gstrA_readArticleURL[idx] = ""; gstrA_readTimeStamp[idx] = loadSetting( READTM_HEADER[idx], u, true ); if( gstrA_readTimeStamp[idx] === null ) gstrA_readTimeStamp[idx] = ""; if( gstrA_readArticleURL[idx] == h ){ chk.setAttribute(gstr_scrReadPointAttr,'true' + idx); chk.checked = true; //捜索モードで既読マークをカウント if( gi_findMode ){ giA_findMark[idx]++; //console.log("★find mark [" + idx + "] = " + h + " (" + s1 + ")"); } break; } } //通り過ぎ判定のために読み込まれたアーティクルのタイムスタンプを蓄積していく if( gi_findMode ){ gstrA_findModeArticleTimeStamp.push(s1); } chk.setAttribute('href', h); chk.setAttribute(CHK_TIMESTAMP, s1); chk.style.marginTop = '2px'; chk.style.marginBottom = '2px'; chk.style.marginLeft = '2px'; chk.style.marginRight = '2px'; if( gi_readCheckedColorMode > -1 ){ chk.style.opacity = CHECKBOX_ENABLE_OPACITY; }else{ chk.style.opacity = CHECKBOX_DISABLE_OPACITY; } //stopPropagationのあと無名関数自身をreturn falseで返さないと親エレメントのイベントが止まらない chk.onchange = function(e){ e.stopPropagation(); //chgReadPoint と appendNextReadCheck 内では連続した読み書きが行われるので処理前にストレージから読み込む loadStorageData(); //クリックされたチェックボックス起点 chgReadPoint(e.target,0); //後続する複数件にチェック処理 appendNextReadCheck(); //chgReadPoint と appendNextReadCheck 内では連続した読み書きが行われるので処理後にストレージに格納する saveStorageData(); return false; }; chk.oncontextmenu = function(e){ e.stopPropagation(); rclickReadPoint(true, false); return false; }; dv.appendChild(chk); b.appendChild(dv); //先祖要素を探して色替え for( idx = 0; idx < gi_readArticles; idx++ ){ e1 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + idx + '"][href="' + h + '"])'); if( e1.length> 0 ){ if( gi_readCheckedColorMode > -1 ){ e1[0].style.backgroundColor = READ_COLOR_ENABLED[idx]; }else{ e1[0].style.backgroundColor = null; } gstrA_readTimeStamp[idx] = s1; gstrA_readArticleURL[idx] = h; } } }else{ //console.log("★ gi_dispMode=" + gi_dispMode + " / " + u ); } } }); //引用RT先のタイムスタンプ置換 document.querySelectorAll('main div[data-testid="primaryColumn"] section article div:not(:has(a[href*="/status/"])) time:not([' + TIME_FIXED_SUB + '])').forEach(function(e) { var a = e.parentNode; var s0 = e.getAttribute('datetime'); var s1 = toFormatedDateString(new Date(s0)); var span; if( gi_replaceTimeStamp ){ //置換をする設定の場合 span = document.createElement('span'); span.setAttribute('datetime', s0); span.setAttribute('local-datetime', s1); span.textContent = s1; a.appendChild(span); a.removeChild(e); }else{ //置換をしない設定の場合は目印をつけておかないと毎回処理されてしまう e.setAttribute(TIME_FIXED_SUB,""); } }); //画像リンクの処理 if( gi_displayImageNewTab ){ //静止画リンクの処理(別タブに元画像サイズで表示) document.querySelectorAll('a[href*="/status/"][role="link"]:not([' + IMAGE_LINK + ']):is([href$="/photo/1"],[href$="/photo/2"],[href$="/photo/3"],[href$="/photo/4"]):has(img[draggable="true"])').forEach(function(e) { e.setAttribute( IMAGE_LINK, "" ); //console.log("★Image find=" + e.getAttribute('href')); //右クリックでは複数枚一気に開く e.oncontextmenu = function(e){ e.stopPropagation(); var i, h; //1〜3枚の場合は6階層上だが4枚では7階層上を親ノードとして画像が並んでいる var p = e.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; if( p === null ) return false; var elms = p.querySelectorAll('img[draggable="true"]:not([alt="埋め込み動画"])'); //複数貼られている画像をそれぞれ別タブに開く for( i=0; i -1 ){ h = h.substr(0, h.indexOf('?')) + "?format=jpg&name=orig"; } if( i==0 ){ //nameクエリがorigだと開かない画像があるので2回目はlargeで開いてみる if( h == gstr_lastImagePath ){ h = h.replace("orig","large"); gstr_lastImagePath = ""; }else{ gstr_lastImagePath = h; } }else{ if( gstr_lastImagePath == "" ){ h = h.replace("orig","large"); } } }else{ //常に大サイズで開く if( h.indexOf('?') > -1 ){ h = h.substr(0, h.indexOf('?')) + "?format=jpg&name=large"; } gstr_lastImagePath = ""; } window.open( h, '_blank' ); } return false; }; //左クリックでは単体のみ開く e.onclick = function(e){ e.stopPropagation(); var h = e.target.getAttribute('src'); if( gi_displayImageTryOrig ){ //まず原寸で開いてみる if( h.indexOf('?') > -1 ){ h = h.substr(0, h.indexOf('?')) + "?format=jpg&name=orig"; } //nameクエリがorigだと開かない画像があるので2回目はlargeで開いてみる if( h == gstr_lastImagePath ){ h = h.replace("orig","large"); gstr_lastImagePath = ""; }else{ gstr_lastImagePath = h; } }else{ //常に大サイズで開く if( h.indexOf('?') > -1 ){ h = h.substr(0, h.indexOf('?')) + "?format=jpg&name=large"; } gstr_lastImagePath = ""; } window.open( h, '_blank' ); return false; }; }); } //console.log("★ 1 Title=" + document.title); if( document.title.indexOf('@') != -1 ){ var t, idx1, idx2; t = document.title; // Listページ タブタイトルの変更 「@USERNAME/ListName」→「ListName」 if( window.location.href.indexOf(TWITTER_URL + PATH_LIST) !== -1 ){ idx1 = t.indexOf('@'); idx2 = t.indexOf('/'); if( idx1 !== -1 && idx2 !== -1 ) t = t.substr(idx2+1); }else{ // Userページ タブタイトルの変更 「Posts with replies by 」など削除 t = t.replace('Posts with replies by ',''); t = t.replace('Media posts by ',''); t = t.replace('Posts liked by ',''); // 通知があると先頭に(1)とかが付くのでこのあとのタブタイトル置換でidx2の値がidx1より手前になってしまうのを回避 // 「(1) DISPNAME (@USERNAME) / X」→「DISPNAME (@USERNAME) / X」 // 「(1) DISPNAME(@USERNAME)さん / X」→「DISPNAME(@USERNAME)さん / X」 idx1 = t.indexOf(")"); idx2 = t.indexOf("@"); if( t.substr(0,1) == "(" && idx1 > 1 && (idx2 - 5) > idx1 ){ t = t.substr(idx1+1); //console.log("★ 3 Title=" + t); } // Userページ タブタイトルの変更 「DISPNAME (@USERNAME)」→「[@USERNAME]」 idx1 = t.indexOf(' (@'); idx2 = t.indexOf(')'); if( idx1 !== -1 && idx2 !== -1 ) t = '[' + t.substr(idx1+3, idx2-idx1-3) + ']'; // Userページ タブタイトルの変更 「DISPNAME(@USERNAME)さん / X」→「[@USERNAME]」 idx1 = t.indexOf('(@'); idx2 = t.indexOf(')さん'); if( idx1 !== -1 && idx2 !== -1 ) t = '[' + t.substr(idx1+2, idx2-idx1-2) + ']'; } if( document.title != t ){ document.title = t; } } // 個別ツイート表示先頭の「Xユーザーの」を削除 if( document.title.indexOf("Xユーザーの") == 0 ){ document.title = document.title.replace('Xユーザーの',''); } // タブタイトル末尾の 「/ X」を削除 if( document.title.indexOf("\/ X") > -1 ){ document.title = document.title.replace('\/ X',''); } //console.log("★ 2 Title=" + document.title); //遡りスクロール中に出てきた「さらに」表示はモードに関係なくトリガさせる if( ( gi_displayPaused == 1 && window.pageYOffset > window.innerHeight ) || ( ( gi_autoClickNewTweet && (gi_modeAutoOff == 0 || gi_displayPaused == 0) ) && ( window.pageYOffset <= SCROLL_LIMIT || window.pageYOffset > window.innerHeight / 2 ) ) ){ e2 = document.querySelectorAll(HOME_NEW_TWEET); } if( e2 != null ){ for( idx=0; idx < e2.length; idx++ ){ if( gi_displayPaused == 1 && window.pageYOffset > window.innerHeight ) { e3 = e2[idx].firstElementChild; if( e3 !== null ){ e4 = e3.firstElementChild; if( e4 !== null ){ e5 = e4.firstElementChild; if( e5 !== null ){ e6 = e5.textContent; if( e6.indexOf("さらに") != -1 || e6.indexOf("More") != -1 || e6.indexOf("more") != -1 ){ //色替え・半自動更新表示 forceUpdateColor(COLOR_UPDATE, TXT_AUTOCLICKMOR); console.log("★replaceElements1 「さらに」のエレメント発見、トリガ[" + idx + "]"); dispDebugTextWithTime("replaceElements : AutoTrigger[1]"); e2[idx].click(); return; } } } } } //自動更新OFFのボタンが押されて有効となっている場合は自動クリックも停止 if( gi_autoClickNewTweet && (gi_modeAutoOff == 0 || gi_displayPaused == 0) && ( window.pageYOffset <= SCROLL_LIMIT || window.pageYOffset > window.innerHeight / 2 ) ) { forceUpdateColor(COLOR_UPDATE, TXT_AUTOCLICKMOR); console.log("★replaceElements2 新着のエレメントを自動クリック[" + idx + "]"); dispDebugTextWithTime("replaceElements : AutoTrigger[2]"); e2[idx].click(); return; } //手動更新直後に新着表示だけされて読み込まれないパターンの救済 if( gi_manualUpdateTriggerNewTweet && (dt.getTime() - gdt_lastTriggerTime.getTime() < gi_manualUpdateIntervalSec * 1000) ){ forceUpdateColor(COLOR_UPDATE, TXT_AUTOCLICKMOR); console.log("★replaceElements3 新着のエレメントを自動クリック[" + idx + "]"); dispDebugTextWithTime("replaceElements : AutoTrigger[3]"); e2[idx].click(); return; } } } } /************************************************************ 各種内部処理関数 ************************************************************/ //URLからモードを決定する function getModeFromURL(){ //画面遷移が発生したので動作モードの決定 var hr = window.location.href; if( hr == (TWITTER_URL + PATH_HOME)){ gi_dispMode = MODE_HOME; }else if( hr.indexOf(TWITTER_URL + PATH_LIST) != -1 ){ gi_dispMode = MODE_LIST; }else if( hr.indexOf(TWITTER_URL + PATH_NOTI) != -1 ){ gi_dispMode = MODE_NOTI; }else if( hr.indexOf(TWITTER_URL + PATH_SEAR) != -1 ){ gi_dispMode = MODE_SEAR; }else if(isOtherURL(hr)){ gi_dispMode = MODE_NULL; }else if( hr.indexOf(TWITTER_URL) != -1 ){ //ユーザーアカウント名で終わるURLなので消去法で各種ページを除外していかないと判定が出来ない gi_dispMode = MODE_USER; }else{ gi_dispMode = MODE_NULL; } } //RTされた同一の記事が複数表示されないようにする function removeSameArticle(){ var e0, e1, e2, i, j, u1, u2; //重複の削除 e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(a[href*="/status/"]):has(span[datetime])'); for(i=e0.length-1; i > -1; i--){ e1 = e0[i].querySelectorAll('a[href*="/status/"]:has(span[datetime])'); if( e1[0] !== null ){ for(j=0; j < i; j++){ e2 = e0[j].querySelectorAll('a[href*="/status/"]:has(span[datetime])'); if( e2[0] !== null ){ u1 = e1[0].getAttribute('href'); u2 = e2[0].getAttribute('href'); //console.log("★ removeSameArticle i=" + i + " : " + u1 + " # j=" + j + " : " + u2 ); if( u1 == u2 && e0[j].getAttribute(gstr_multipleArticleAttr) != "1" ){ //console.log("★removeSameArticle: HIT i=" + i + " / j=" + j + " : " + u2 ); e0[j].style.display = "none"; e0[j].setAttribute(gstr_multipleArticleAttr, "1"); } } } } } } /************************************************************ 既読ポイント(既読マーク)関連関数 ************************************************************/ //既読ポイントの変更 function chgReadPoint(obj, idx){ //obj: クリックされたチェックボックスオブジェクト //idx: 既読ポイント番号 if( ! gi_enableReadPointCheckBox ) return; if( gi_dispMode != MODE_HOME && gi_dispMode != MODE_LIST && gi_dispMode != MODE_USER && gi_dispMode != MODE_SEAR ) return; var i, j, e0, e1, flg = false; var h = window.location.href; h = h.replace( TWITTER_URL, ""); if( obj !== null ){ var c = false; var u = ""; c = obj.checked; u = obj.getAttribute('href'); //既にチェック済みになっているエレメントを戻す if( idx == 0 ){ e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '^="true"])'); for( i = 0; i < e0.length; i++ ){ e0[i].style.backgroundColor = null; e1 = e0[i].querySelectorAll('input[' + gstr_scrReadPointAttr + ']'); if( e1.length > 0 ){ e1[0].checked = false; e1[0].setAttribute(gstr_scrReadPointAttr,'false'); } } } //操作されたエレメントの更新 if( c == true ){ //チェックが付けられたアーティクルの色替えとローカル保存 obj.setAttribute(gstr_scrReadPointAttr,'true' + idx ); obj.checked = true; e1 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + idx + '"][href="' + u + '"])'); if( e1.length> 0 ){ if( gi_readCheckedColorMode > -1 ){ e1[0].style.backgroundColor = READ_COLOR_ENABLED[idx]; }else{ e1[0].style.backgroundColor = null; } gstrA_readTimeStamp[idx] = obj.getAttribute(CHK_TIMESTAMP); gstrA_readArticleURL[idx] = u; saveSetting( READ_HEADER[idx], h, u, true, true ); saveSetting( READTM_HEADER[idx], h, gstrA_readTimeStamp[idx], true, true ); } }else{ //チェックが外されたアーティクルを戻しローカル保存データの破棄 obj.checked = false; obj.setAttribute(gstr_scrReadPointAttr,'false'); //チェック数の定義を減らした後にゴミが残らないように最大数まで探して消す for( i=0; i< 100; i++ ){ //定義数が減った時に定義が残るのでクリアする removeSetting( READ_HEADER[i], h, true, true ); removeSetting( READTM_HEADER[i], h, true, true ); if( i < gi_readArticles ){ gstrA_readTimeStamp[i] = ""; gstrA_readArticleURL[i] = ""; } } } } } //既読ポイントの有効無効切り替え function chgReadPointMode(){ if( ! gi_enableReadPointCheckBox ) return; if( gi_dispMode != MODE_HOME && gi_dispMode != MODE_LIST && gi_dispMode != MODE_USER && gi_dispMode != MODE_SEAR ) return; var i, e0, e1, idx; var h = window.location.href; h = h.replace( TWITTER_URL, ""); //色と透明度を戻す e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '^="true"])'); for( i = 0; i < e0.length; i++ ){ e1 = e0[i].querySelectorAll('input[' + gstr_scrReadPointAttr + ']'); if( e1.length > 0 ){ idx = Number((e1[0].getAttribute(gstr_scrReadPointAttr)).replace("true","")); if( gi_readCheckedColorMode > -1 ){ e0[i].style.backgroundColor = READ_COLOR_ENABLED[idx]; e1[0].style.opacity = CHECKBOX_ENABLE_OPACITY; }else{ e0[i].style.backgroundColor = null; e1[0].style.opacity = CHECKBOX_DISABLE_OPACITY; } } } e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="false"])'); for( i = 0; i < e0.length; i++ ){ e1 = e0[i].querySelectorAll('input[' + gstr_scrReadPointAttr + ']'); if( e1.length > 0 ){ e0[i].style.backgroundColor = null; if( gi_readCheckedColorMode > -1 ){ e1[0].style.opacity = CHECKBOX_ENABLE_OPACITY; }else{ e1[0].style.opacity = CHECKBOX_DISABLE_OPACITY; } } } } //手動更新時に既読ポイントを現在表示中の最新アーティクルから自動設定する function updateReadCheck(){ var e0, e1, e2, e3, e4, e5; var idx = 0; e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '])'); for( var i=0; i< e0.length; i++ ){ if( e0[i].style.display != "none" && e0[i].clientHeight > 0 && e0[i].getAttribute(gstr_multipleArticleAttr) != "1" && e0[i].getAttribute(gstr_scrFixedUserAttr) != "1" ){ e1 = e0[i].querySelectorAll('input[' + gstr_scrReadPointAttr + ']'); if( e1.length > 0 ){ e2 = e0[i].firstElementChild; if( e2 !== null ){ //1階層下・2階層下のエレメントでdisplay=noneになっている場合がある if( e2.style.display != "none" && e2.clientHeight > 0 ){ e3 = e2.firstElementChild; if( e3 !== null ){ if( e3.style.display != "none" && e3.clientHeight > 0 ){ e1[0].checked = true; //チェック更新処理 chgReadPoint(e1[0] ,idx++); if( idx == gi_readArticles ) return; } } } } } } } } //既読ポイント設定時に続く数件を自動設定する function appendNextReadCheck(){ var e0, e1, e2, e3, e4, e5; var idx = 0; e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '])'); for( var i=0; i< e0.length; i++ ){ if( e0[i].style.display != "none" && e0[i].clientHeight > 0 && e0[i].getAttribute(gstr_multipleArticleAttr) != "1" && e0[i].getAttribute(gstr_scrFixedUserAttr) != "1" ){ e1 = e0[i].querySelectorAll('input[' + gstr_scrReadPointAttr + ']'); if( e1.length > 0 ){ e2 = e0[i].firstElementChild; if( e2 !== null ){ //1階層下・2階層下のエレメントでdisplay=noneになっている場合がある if( e2.style.display != "none" && e2.clientHeight > 0 ){ e3 = e2.firstElementChild; if( e3 !== null ){ if( e3.style.display != "none" && e3.clientHeight > 0 ){ //チェックされた本体の特定 if( idx == 0 && e1[0].checked == true ){ idx++; }else if( idx > 0 ){ //チェック更新処理 e1[0].checked = true; chgReadPoint(e1[0] ,idx++); } if( idx == gi_readArticles ) return; } } } } } } } } //既読マーク背景色切り替え function changeReadPointColor(){ if( ! gi_enableReadPointCheckBox ) return; switch( gi_readCheckedColorMode ){ case 0: READ_COLOR_ENABLED = READ_COLOR_ENABLED1; break; case 1: READ_COLOR_ENABLED = READ_COLOR_ENABLED2; break; case 2: READ_COLOR_ENABLED = READ_COLOR_ENABLED3; break; case 3: READ_COLOR_ENABLED = READ_COLOR_ENABLED4; break; } chgReadPointMode(); } //既読ポイント背景色のセットアップ(システムコンフィグ項目のローカルデータ読み込み完了後にメイン関数から呼び出して初期化する) function setupBgColorTables(){ if( ! READ_COLOR_CYCLEMODE ){ //既読ポイント背景色パターン以降がある場合 パターン以降先頭要素で繰り返し for( gi_defIdx=gi_readColorPattern; gi_defIdx < gi_readArticles; gi_defIdx++ ){ READ_COLOR_ENABLED1[gi_defIdx] = DEF_READ_COLOR_ENABLED1; READ_COLOR_ENABLED2[gi_defIdx] = DEF_READ_COLOR_ENABLED2; READ_COLOR_ENABLED3[gi_defIdx] = DEF_READ_COLOR_ENABLED3; READ_COLOR_ENABLED4[gi_defIdx] = DEF_READ_COLOR_ENABLED3; //console.log("★1 gi_defIdx = " + gi_defIdx + " / gi_readArticles = " + gi_readArticles ); } //console.log("★1 gi_readColorPattern = " + gi_readColorPattern ); }else{ //既読ポイント背景色パターン以降がある場合 パターン全体を繰り返す for( gi_defIdx=gi_readColorPattern; gi_defIdx < gi_readArticles; gi_defIdx++ ){ READ_COLOR_ENABLED1[gi_defIdx] = READ_COLOR_ENABLED1[gi_defIdx % gi_readColorPattern]; READ_COLOR_ENABLED2[gi_defIdx] = READ_COLOR_ENABLED2[gi_defIdx % gi_readColorPattern]; READ_COLOR_ENABLED3[gi_defIdx] = READ_COLOR_ENABLED3[gi_defIdx % gi_readColorPattern]; READ_COLOR_ENABLED4[gi_defIdx] = READ_COLOR_ENABLED4[gi_defIdx % gi_readColorPattern]; //console.log("★2 gi_defIdx = " + gi_defIdx + " / idx=" + gi_defIdx % gi_readColorPattern); } //console.log("★2 gi_defIdx = " + gi_defIdx + " / gi_readArticles = " + gi_readArticles ); } } //既読マーク背景色設定の読込 function loadReadPointColorSetting(){ if( ! gi_enableReadPointCheckBox ) return; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); gi_readCheckedColorMode = Number(loadSetting(CHKCOLOR_HEADER, u)); changeReadPointColor(); } //既読ポイントチェックボックスの右クリック function rclickReadPoint(doCycle, notDispMsg){ //doCycle: true=表示タイプの順次切り替えモード / false=コンフィグからの変更モード //notDispMsg: true=ポップアップメッセージなし / false=ポップアップメッセージあり if( ! gi_enableReadPointCheckBox ) return; var i, j, e0; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); if( doCycle ){ //表示色の入れ替え if( ++gi_readCheckedColorMode >= READ_COLOR_CYCLE ) gi_readCheckedColorMode = -1; saveSetting(CHKCOLOR_HEADER, u, gi_readCheckedColorMode); } changeReadPointColor(); if( gi_readCheckedColorMode > -1 ){ forceUpdateColor((COLOR_MODE)?COLOR_WHITE:COLOR_BLACK, TXT_CHANGEBGTYPE.replace("#", Number(gi_readCheckedColorMode + 1))); for( i = 0; i < gi_readArticles; i++ ){ e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + i + '"])'); for( j = 0; j < e0.length; j++ ){ e0[j].style.backgroundColor = READ_COLOR_ENABLED[i]; } } if( ! notDispMsg ){ dispPopupMessage("既読マークの背景色をType" + (gi_readCheckedColorMode+1) + "に変更しました", gi_displayPopupCloseTimeSec); } }else{ forceUpdateColor((COLOR_MODE)?COLOR_WHITE:COLOR_BLACK, TXT_CHANGEBGNONE); for( i = 0; i < gi_readArticles; i++ ){ e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + i + '"])'); for( j = 0; j < e0.length; j++ ){ e0[j].style.backgroundColor = null; } } if( ! notDispMsg ){ dispPopupMessage("既読マークを非表示に変更しました", gi_displayPopupCloseTimeSec); } } } /************************************************************ 新着の積み上げ更新関連関数 ************************************************************/ //更新直後に現時点の最新アーティクルに遷移する function clickNewestTweet(){ var e0, e1, e2, e3, e4, e5; var idx = 0; e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(span[datetime],time[datetime])'); for( var i=0; i< e0.length; i++ ){ if( e0[i].style.display != "none" && e0[i].clientHeight > 0 && e0[i].getAttribute(gstr_multipleArticleAttr) != "1" && e0[i].getAttribute(gstr_scrFixedUserAttr) != "1" ){ e1 = e0[i].querySelectorAll('a[href]:has(span[datetime],time[datetime])'); if( e1.length > 0 ){ e2 = e0[i].firstElementChild; if( e2 !== null ){ //1階層下・2階層下のエレメントでdisplay=noneになっている場合がある if( e2.style.display != "none" && e2.clientHeight > 0 ){ e3 = e2.firstElementChild; if( e3 !== null ){ if( e3.style.display != "none" && e3.clientHeight > 0 ){ if( gi_updateContinuousDispPopup ){ dispPopupMessage("先頭記事に一旦遷移します", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } e1[0].click(); window.setTimeout( clickNewestTweetReturn, gi_updateContinuousReturnTimeMs ); gi_updateContinuousReturnRetry = 0; return; } } } } } } } gi_updateContinuousReturnRetry++; if( gi_updateContinuousReturnRetry < MAX_UPDATE_CONTINUOUS_RETURN_RETRY ){ window.setTimeout( clickNewestTweet, gi_updateContinuousReturnTimeMs ); if( gi_updateContinuousDispPopup ){ dispPopupMessage("先頭記事に一旦遷移します 待ち合わせ" + gi_updateContinuousReturnRetry + "回目", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } }else{ //エラーパターンではポップアップなしの設定でも表示する dispPopupMessage("リトライオーバーしました 手動で元の画面に戻って下さい", gi_displayPopupCloseTimeSec * 3); } } //更新直後に遷移した先から戻る function clickNewestTweetReturn(){ var e0; e0 = document.querySelectorAll('div[aria-label="ホームタイムライン"] div[aria-label="戻る"][role="button"]'); for( var i=0; i< e0.length; i++ ){ if( gi_updateContinuousDispPopup ){ dispPopupMessage("元の画面に戻ります", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } e0[0].click(); gi_updateContinuousReturnRetry = 0; return; } gi_updateContinuousReturnRetry++; if( gi_updateContinuousReturnRetry < MAX_UPDATE_CONTINUOUS_RETURN_RETRY ){ window.setTimeout( clickNewestTweetReturn, gi_updateContinuousReturnTimeMs ); if( gi_updateContinuousDispPopup ){ dispPopupMessage("元の画面に戻ります 待ち合わせ" + gi_updateContinuousReturnRetry + "回目", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_CONT); } }else{ //エラーパターンではポップアップなしの設定でも表示する dispPopupMessage("リトライオーバーしました 手動で元の画面に戻って下さい", gi_displayPopupCloseTimeSec * 3); } } /************************************************************ 既読ポイント捜索モード関連関数 ************************************************************/ //既読ポイントを遡って探す function startReadPointFindingMode(){ var i, j, h, c=0, v, findIdx=-1; var e0, e1, e2, e3, e4, e5; var idx = 0; var aliveReadPoint = 0; if( ! gi_enableReadPointCheckBox ){ return; } //既に動いていたら停止 if( gi_findMode ){ gi_findMode = 0; gi_findReadPointCount = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; if( gi_findModeDispPopup ){ dispPopupMessage("既読ポイント捜索を停止しました" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); closePopupFindAll(); } return; } //生きている既読ポイントの数 for( i=0; i 0 ){ h = e1[0].getAttribute('href'); for( j=0; j < gi_readArticles; j++ ){ if( gstrA_readArticleURL[j] == h ){ giA_findMark[j]++; if( findIdx == -1 ){ findIdx = i; } } } } //既に読み込まれているアーティクルのタイムスタンプを保存する e2 = e0[i].querySelectorAll('input[' + CHK_TIMESTAMP + ']'); if( e2.length > 0 ){ v = e2[0].getAttribute(CHK_TIMESTAMP); if( v !== null ){ gstrA_findModeArticleTimeStamp.push(v); } } } //console.log("★startReadPointFindingMode() gstrA_findModeArticleTimeStamp[" + gstrA_findModeArticleTimeStamp.length + "] array = " + gstrA_findModeArticleTimeStamp); for( i=0; i < gi_readArticles; i++ ){ if( giA_findMark[i] > 0 ){ c++; } } gi_findReadPointCount = c; gi_findMode = 1; if( gi_findModeDispPopup ){ var e, msg = ""; closePopupFindAll(); var max = (DIALOG_MAX_WIDTH).replace("px","") - 44; var min = (DIALOG_MIN_WIDTH).replace("px","") - 44; var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : (window.innerWidth * 0.9)); msg += "
[" + toFormatedDateString(new Date()) + "]\r\n既読ポイントの捜索を開始します\r\n(" + BTN_TXT_BTNL + "," + BTN_TXT_BTNM + "," + BTN_TXT_BTNR + "や右のボタンで中断)"; msg += "
"; msg += "
"; gelm_fixedPopupFindConfirm = dispPopupMessage( msg, -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND, true, false); dispDebugTextWithTime("既読ポイントの捜索を開始します/BTNで中断"); e = document.getElementById('ELM_FINDMODE_BTN1'); if( e !== null ){ e.onclick = function(){ gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; if( gi_findModeDispPopup ){ dispPopupMessage("既読ポイント捜索を停止しました" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); closePopupFindAll(); } }; } } window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); } //既読ポイントを遡って探す(継続動作中) function continueReadPointFindingMode(){ //解除されたら停止 if( ! gi_findMode ){ gi_findReadPointCount = 0; return; } var i, e0, e1, e2, e3, h; var findCount = 0, idx = -1, msg = ""; var t0 = []; var t1 = []; var flg = false; var aliveReadPoint = 0; //既読マークのタイムスタンプを降順に並ぶものだけ抽出したもの var gstrA_sortedMarkTimeStamp = []; //読み込まれた全アーティクルのタイムスタンプを降順に並ぶものだけ抽出したもの var gstrA_sortedAllTimeStamp = []; for( i=0; i < gi_readArticles; i++ ){ if( giA_findMark[i] > 0 ){ if( findCount == 0 ){ //見つけた先頭マーク要素のインデックス idx = i; } findCount++; } } //生きている既読ポイントの数 for( i=0; i gi_findReadPointCount ){ if( gi_findModeDispPopup ){ closePopupFindCount(); gelm_fixedPopupFindCount = dispPopupMessage("既読ポイントを " + findCount + " / " + aliveReadPoint + " 個発見しました" , -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } gi_findReadPointCount = findCount; } //有効な既読ポイントから消失予想分を引いた数まで見つかったら終了 if( (aliveReadPoint - FIND_READ_COUNTSUB <= findCount) || (aliveReadPoint >= FIND_READ_THRETHOLD && Math.floor(FIND_READ_THRETHOLD * FIND_READ_RATIO) <= findCount) ){ if( gi_findModeDispPopup ){ window.setTimeout( function(){if(gi_findModeDispPopup) closePopupFindAll();}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage("既読ポイントを " + findCount + " 個発見したので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; if( idx > -1 ){ for( i=idx; i < gi_readArticles; i++ ){ if( giA_findMark[i] > 0 ){ e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + i + '"])'); if( e0.length > 0 ){ //既読マーク一番上のアーティクルが下端に表示される位置までスクロールする e0[0].scrollIntoView({behavior:'smooth',block:'end',inline:'center'}); dispDebugTextWithTime("continueReadPointFindingMode : End scrollIntoView idx=[" + i + "]"); return; } } } } return; } //通り過ぎていないかチェックする 既読マーク配列 t0 = []; gstrA_sortedMarkTimeStamp = []; for( i=gstrA_readTimeStamp.length-1; i>-1; i-- ){ if( gstrA_readTimeStamp[i] != "" && gstrA_readTimeStamp[i] != undefined ){ t0.push(gstrA_readTimeStamp[i]); //console.log("★continueReadPointFindingMode() t0[" + i + "] = " + gstrA_readTimeStamp[i]); } } quicksort(t0); for( i=t0.length-1; i>-1; i-- ){ gstrA_sortedMarkTimeStamp.push(t0[i]); //console.log("★continueReadPointFindingMode() gstrA_sortedMarkTimeStamp[" + i + "] = " + t0[i]); } //var idxMark = Math.floor(gstrA_sortedMarkTimeStamp.length / 2); //console.log("★continueReadPointFindingMode() MAX gstrA_sortedMarkTimeStamp[" + 0 + "] = " + gstrA_sortedMarkTimeStamp[0]); //console.log("★continueReadPointFindingMode() MED gstrA_sortedMarkTimeStamp[" + idxMark + "] = " + gstrA_sortedMarkTimeStamp[idxMark]); //console.log("★continueReadPointFindingMode() MIN gstrA_sortedMarkTimeStamp[" + (gstrA_sortedMarkTimeStamp.length-1) + "] = " + gstrA_sortedMarkTimeStamp[gstrA_sortedMarkTimeStamp.length-1]); //通り過ぎていないかチェックする 全件配列 t0 = []; idx = 0; gstrA_sortedAllTimeStamp = []; for( i=gstrA_findModeArticleTimeStamp.length-1; i>-1; i-- ){ if( gstrA_findModeArticleTimeStamp[i] != "" && gstrA_findModeArticleTimeStamp[i] != undefined ){ t0.push(gstrA_findModeArticleTimeStamp[i]); //console.log("★continueReadPointFindingMode() t0[" + i + "] = " + gstrA_findModeArticleTimeStamp[i]); //取得した最新アーティクルから先頭n件のレコードを抽出 if( ++idx >= FIND_OLD_ARTICLE_COUNT ) break; } } quicksort(t0); for( i=t0.length-1; i>-1; i-- ){ gstrA_sortedAllTimeStamp.push(t0[i]); //console.log("★continueReadPointFindingMode() gstrA_sortedAllTimeStamp[" + i + "] = " + t0[i]); } //var idxAll = Math.floor(gstrA_sortedAllTimeStamp.length / 2); //console.log("★continueReadPointFindingMode() MAX gstrA_sortedAllTimeStamp[" + 0 + "] = " + gstrA_sortedAllTimeStamp[0]); //console.log("★continueReadPointFindingMode() MED gstrA_sortedAllTimeStamp[" + idxAll + "] = " + gstrA_sortedAllTimeStamp[idxAll]); //console.log("★continueReadPointFindingMode() MIN gstrA_sortedAllTimeStamp[" + (gstrA_sortedAllTimeStamp.length-1) + "] = " + gstrA_sortedAllTimeStamp[gstrA_sortedAllTimeStamp.length-1]); if( gi_findModeDispPopup ){ if( gi_findNoTimeStamp ){ msg += " (※時刻比較判定無効)"; } msg += "\r\n既読時刻最大値=" + gstrA_sortedMarkTimeStamp[0] + "\r\n読込時刻最大値=" + gstrA_sortedAllTimeStamp[0]; msg += "\r\n読み込まれた過去データ件数=" + (gstrA_findModeArticleTimeStamp.length -1); //途中経過情報の表示なので既に出ている情報ダイアログを閉じる closePopupFindInfo(); gelm_fixedPopupFindInfo = dispPopupMessage("発見既読ポイント[" + findCount + " / " + aliveReadPoint + "]" + msg , -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } //既読ポイントのタイムスタンプよりも古いものが現れ始めたら行きすぎている if( ! gi_findNoTimeStamp && gstrA_sortedMarkTimeStamp[0] > gstrA_sortedAllTimeStamp[0] ){ //ポップアップ型confirmは完了復帰ではないのでそれぞれボタンのイベントで後続処理を行う closePopupFindContinue(); dispDebugTextWithTime("既読ポイントのタイムスタンプより古いアーティクルに到達しました/中断しますか?"); gelm_fixedPopupFindContinue = popupConfirm( "既読ポイントのタイムスタンプより
古いアーティクルに到達しました
中断しますか?", "中断する", function(){ if( gi_findModeDispPopup ){ closePopupFindContinue(); window.setTimeout( function(){closePopupFindAll();}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage("既読ポイントのタイムスタンプより古いアーティクルに到達したので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; }, "続行する", function(){ gi_findNoTimeStamp = 1; if( gi_findModeDispPopup ){ closePopupFindContinue(); dispPopupMessage("タイムスタンプ判定なしで遡ります" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); } ); return; } //読み込まれた件数が一定を超えたら行きすぎている if( gstrA_findModeArticleTimeStamp.length > MAX_CONTINUE_ARTICLES ){ if( gi_findModeDispPopup ){ window.setTimeout( function(){closePopupFindAll();}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage(MAX_CONTINUE_ARTICLES + "件遡っても見つからないので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; return; } //読み込まれている最後のアーティクルを探す e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(span[datetime],time[datetime])'); for( i=e0.length-1; i>-1; i-- ){ if( e0[i].style.display != "none" && e0[i].clientHeight > 0 && e0[i].getAttribute(gstr_multipleArticleAttr) != "1" && e0[i].getAttribute(gstr_scrFixedUserAttr) != "1" ){ e1 = e0[i].querySelectorAll('a[href]:has(span[datetime],time[datetime])'); if( e1.length > 0 ){ e2 = e0[i].firstElementChild; if( e2 !== null ){ //1階層下・2階層下のエレメントでdisplay=noneになっている場合がある if( e2.style.display != "none" && e2.clientHeight > 0 ){ e3 = e2.firstElementChild; if( e3 !== null ){ if( e3.style.display != "none" && e3.clientHeight > 0 ){ //読み込まれたアーティクル数が増えていないようなら更にスクロールさせる if( gi_lastFindModeArticleRecs == gstrA_findModeArticleTimeStamp.length){ dispDebugTextWithTime("continueReadPointFindingMode : scrollIntoView[A]" ); //読み込まれた最古アーティクルが下端に表示される位置までスクロールする e0[i].scrollIntoView({behavior:'smooth',block:'end',inline:'center'}); }else{ dispDebugTextWithTime("continueReadPointFindingMode : Non-scroll wait[A]"); } //読み込まれた前回アーティクル数を保存 gi_lastFindModeArticleRecs = gstrA_findModeArticleTimeStamp.length; window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); return; } } } } } } } //読み込まれたアーティクル数が増えていないようなら更にスクロールさせる if( gi_lastFindModeArticleRecs == gstrA_findModeArticleTimeStamp.length){ dispDebugTextWithTime("continueReadPointFindingMode : scrollTo " + (window.pageYOffset + window.innerHeight) + "[B]" ); window.scrollTo(0, window.pageYOffset + window.innerHeight); }else{ dispDebugTextWithTime("continueReadPointFindingMode : Non-scroll wait[B]"); } //読み込まれた前回アーティクル数を保存 gi_lastFindModeArticleRecs = gstrA_findModeArticleTimeStamp.length; window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); } /************************************************************ 次回スクロール位置が先頭に戻ったら既読マークする関連関数 ************************************************************/ //スクロールイベント function scrollEventFunc(){ if( ! gi_scrToTopMode ) return; //途中で他の画面に遷移された場合は処理しない if( gstr_scrToTopModeURL != window.location.href ){ gf_scrToTopModeReturn = true; //console.log("★scrollEventFunc MovedURL : " + location.href); return; } //遷移先から戻ってきた初回のみ処理しない if( gf_scrToTopModeReturn ){ gf_scrToTopModeReturn = false; //console.log("★scrollEventFunc ReturnURL : " + location.href); return; } if( window.pageYOffset == 0 ){ //捜索中のスクロールイベントは無視 if( gi_findMode ) return; //連続更新前にストレージから読み出す loadStorageData(); //マークを先頭記事から更新 updateReadCheck(); //連続更新後にストレージに格納する saveStorageData(); //終了 window.setTimeout( endModeScrTopMark, 10 ); //console.log("★scrollEventFunc : " + location.href); } } //スクロール位置が先頭に戻ったら既読マークをする動作の開始 function startModeScrTopMark(withFindMode){ //withFindMode: true=既読マーク捜索と併せて使う / false:単独で実行 var e, msg = ""; if( window.pageYOffset <= SCROLL_LIMIT && ! withFindMode ) return; if( gi_scrToTopMode || gelm_fixedScrTopMark !== null ){ endModeScrTopMark(); } if( gi_scrTopMarkModeDispPopup ){ closePopupScrTopMark(); var max = (DIALOG_MAX_WIDTH).replace("px","") - 44; var min = (DIALOG_MIN_WIDTH).replace("px","") - 44; var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : (window.innerWidth * 0.9)); //スクロール位置が先頭に戻ったら既読マークをする処理中のポップアップ表示 msg += "
[" + toFormatedDateString(new Date()) + "]\r\n先頭に戻ると既読マークします"; msg += "
"; msg += "
"; gelm_fixedScrTopMark = dispPopupMessage(msg, -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_TOPM, true, false); e = document.getElementById('ELM_SCRTOTOP_BTN1'); if( e !== null ){ e.onclick = function(){ dispPopupMessage("先頭で既読マークのモードを解除しました" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_TOPM); window.setTimeout( endModeScrTopMark, 10 ); }; } } //モード開始 gi_scrToTopMode = 1; gstr_scrToTopModeURL = window.location.href; gf_scrToTopModeReturn = false; //スクロール位置監視のイベントリスナーを開始する window.addEventListener('scroll', scrollEventFunc); } //スクロール位置が先頭に戻ったら既読マークする処理の終了 function endModeScrTopMark(){ //イベントリスナーの削除 window.removeEventListener('scroll', scrollEventFunc ); //ポップアップ消去 if( gi_scrTopMarkModeDispPopup ){ closePopupScrTopMark(); } //モード終了 gi_scrToTopMode = 0; gstr_scrToTopModeURL = ""; gf_scrToTopModeReturn = false; } /************************************************************ 通知ページ関連関数 ************************************************************/ const NEW_NOTI_CONTROL_ELEMENT = 'div[aria-label="ホームタイムライン"] > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1)'; const NEW_NOTI_MARK_ELEMENT = 'nav[aria-label="メインメニュー"] a[aria-label^="通知("][aria-label$="件の未読通知)"]'; const NEW_NOTI_DM_ELEMENT = 'nav[aria-label="メインメニュー"] a[aria-label^="ダイレクトメッセージ("][aria-label$="件の未読会話)"]'; //通知ページの新着表示を戻す function clearNewNotification(){ if( gtmr_waitClear !== null ) return; //gelm_fixedPopupClearNewTweetが生きていてgb_flgClearNotification==trueになるスレ違いパターンがある if( gb_flgClearNotification && gelm_fixedPopupClearNewTweet === null ) return; //上部を詰めている要素と通知新着要素の確認 var e0 = document.querySelectorAll(NEW_NOTI_CONTROL_ELEMENT); if( e0.length > 0 ){ var e1 = document.querySelectorAll(NEW_NOTI_MARK_ELEMENT); if( e1.length > 0 ){ var he = e0[0].clientHeight; if( he < 50 ){ e0[0].style.height = "100px"; gb_flgClearNotification = true; gtmr_waitClear = window.setTimeout( waitforNotificationClear, 1000 ); closePopupClearNewTweetMessage(); gelm_fixedPopupClearNewTweet = dispPopupMessage("新着通知の表示から戻します", CLEAR_NEWNOTI_SEC); } }else{ } } } //新着件数表示が無くなるまで待つ function waitforNotificationClear(){ //多重で走らないようにタイマキャンセル if( gtmr_waitClear !== null ){ window.clearTimeout(gtmr_waitClear); gtmr_waitClear = null; } var e0 = document.querySelectorAll(NEW_NOTI_CONTROL_ELEMENT); if( e0.length > 0 ){ var e1 = document.querySelectorAll(NEW_NOTI_MARK_ELEMENT); if( e1.length > 0 ){ if( ++gi_chkNotificationCount < gi_chkNotificationCountMax ){ gtmr_waitClear = window.setTimeout( waitforNotificationClear, 1000 ); return; } } //新着数を示すタグが消えても背景色の色替えが戻らない事があるのでスクロールを操作する window.setTimeout( function(){ window.scrollTo(0, window.innerHeight);}, 5000 ); window.setTimeout( function(){ window.scrollTo(0, 0); gb_flgClearNotification = false; closePopupClearNewTweetMessage(); dispDebugTextWithTime("waitforNotificationClear : Scroll complete"); }, 5100 ); //console.log("★Finish!" + gi_chkNotificationCount); gi_chkNotificationCount = 0; e0[0].style.height = null; } } //DM新着があればポップアップを表示 function checkDMNotification(){ var msg = ""; var e; var e0 = document.querySelectorAll(NEW_NOTI_DM_ELEMENT); if( e0.length > 0 ){ if( gelm_fixedPopupClearNewDM !== null ) return; var max = (DIALOG_MAX_WIDTH).replace("px","") - 44; var min = (DIALOG_MIN_WIDTH).replace("px","") - 44; var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : (window.innerWidth * 0.9)); msg += "
[" + toFormatedDateString(new Date()) + "]\r\n新着のDMがあります"; msg += "
"; msg += "
"; gelm_fixedPopupClearNewDM = dispPopupMessage(msg, -1, null, null, true, false); dispDebugTextWithTime("checkDMNotification : Display DM Page Notification"); e = document.getElementById('ELM_DMNOTIFICATION_BTN1'); if( e !== null ){ e.onclick = function(){ dispDebugTextWithTime("checkDMNotification : Display DM Page Open"); window.open( TWITTER_URL2 + "/messages", '_blank' ); closePopupClearNewDM() }; } }else{ closePopupClearNewDM() } } /************************************************************ 情報表示部・ボタン生成関連関数 ************************************************************/ //クリックで入力ダイアログを入力させるボタン部と自動更新のON/OFFをするボタン部を生成 function setupElement(parentElm){ var D_WIDTH = Number((DISPINFO_WIDTH).replace("px","")); var D_HEIGHT = Number((DISPINFO_HEIGHT).replace("px","")) //既にあったら消す if( gelm_btnEdit !== null ) gelm_btnEdit.remove(); if( gelm_btnAutoOff !== null ) gelm_btnAutoOff.remove(); if( gelm_btnInterval !== null ) gelm_btnInterval.remove(); if( gelm_btnShort !== null ) gelm_btnShort.remove(); if( gelm_btnHelp !== null ) gelm_btnHelp.remove(); if( gelm_btnLeft !== null ) gelm_btnLeft.remove(); if( gelm_btnMid !== null ) gelm_btnMid.remove(); if( gelm_btnRight !== null ) gelm_btnRight.remove(); if( gelm_dispInfo !== null ) gelm_dispInfo.remove(); if( gelm_btnParent !== null ) gelm_btnParent.remove(); if( gelm_allParent !== null ) gelm_allParent.remove(); //基準となる元エレメントのプロパティ parentElm.style.display = "flex"; parentElm.style.fontSize = gstrA_titleSize[gi_dispMode]; //親エレメント生成 gelm_allParent = document.createElement("div"); gelm_allParent.setAttribute("id",PARENT_BLOCK); gelm_allParent.style.display = "flex"; gelm_allParent.style.marginLeft = "3px"; gelm_allParent.style.marginRight = "3px"; gelm_allParent.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_allParent.style.borderWidth = "0px"; gelm_allParent.style.opacity = gf_dispUnitOpacity; gelm_allParent.style.zIndex = "7"; //stopPropagationのあと無名関数自身をreturn falseで返さないと親エレメントのイベントが止まらない gelm_allParent.onclick = function(e){e.stopPropagation();return false;}; gelm_allParent.oncontextmenu = function(e){e.stopPropagation();return false;}; parentElm.appendChild(gelm_allParent); //自動更新情報表示(情報表示部)のエレメント生成 gelm_dispInfo = document.createElement("div"); gelm_dispInfo.setAttribute("id",INFO_BLOCK); gelm_dispInfo.style.display = "block"; gelm_dispInfo.style.textAlign = "center"; gelm_dispInfo.style.width = DISPINFO_WIDTH; gelm_dispInfo.style.height = DISPINFO_HEIGHT; gelm_dispInfo.style.overflowX = "hidden"; gelm_dispInfo.style.overflowY = "hidden"; gelm_dispInfo.style.color = COLOR_GRAY; gelm_dispInfo.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_dispInfo.style.fontSize = gstrA_titleSize[gi_dispMode]; gelm_dispInfo.style.border = COLOR_BORDER; gelm_dispInfo.style.borderStyle = "solid"; gelm_dispInfo.style.borderWidth = "1px"; gelm_dispInfo.style.zIndex = "9"; gelm_dispInfo.textContent = ""; gelm_dispInfo.style.userSelect = "none"; gelm_allParent.appendChild(gelm_dispInfo); //情報表示部の上に置かれる左ボタンエレメント生成 gelm_btnLeft = document.createElement("div"); gelm_btnLeft.setAttribute("id",INFOLBTN_BLOCK); gelm_btnLeft.style.display = "block"; gelm_btnLeft.style.position = "absolute"; gelm_btnLeft.style.textAlign = "center"; gelm_btnLeft.style.width = (D_WIDTH / 3) + "px"; gelm_btnLeft.style.height = (D_HEIGHT - 2) + "px"; gelm_btnLeft.style.marginLeft = "0px"; gelm_btnLeft.style.overflowX = "hidden"; gelm_btnLeft.style.overflowY = "hidden"; gelm_btnLeft.style.color = INFOBUTTON_FORE_COLOR; gelm_btnLeft.style.backgroundColor = INFOBUTTON_BG_COLOR; gelm_btnLeft.style.opacity = "0.0"; gelm_btnLeft.style.fontSize = gstrA_titleSize[gi_dispMode]; gelm_btnLeft.style.borderColor = INFOBUTTON_BORDER_COLOR; gelm_btnLeft.style.borderStyle = "solid"; gelm_btnLeft.style.borderWidth = "1px"; gelm_btnLeft.style.zIndex = "9"; gelm_btnLeft.textContent = BTN_TXT_BTNL; gelm_btnLeft.style.userSelect = "none"; gelm_btnLeft.onclick = clickInformationButton1; gelm_btnLeft.oncontextmenu = clickInformationButton2; gelm_allParent.appendChild(gelm_btnLeft); //情報表示部の上に置かれる中ボタンエレメント生成 gelm_btnMid = document.createElement("div"); gelm_btnMid.setAttribute("id",INFOMBTN_BLOCK); gelm_btnMid.style.display = "block"; gelm_btnMid.style.position = "absolute"; gelm_btnMid.style.textAlign = "center"; gelm_btnMid.style.width = (D_WIDTH / 3) + "px"; gelm_btnMid.style.height = (D_HEIGHT - 2) + "px"; gelm_btnMid.style.marginLeft = (D_WIDTH / 3) + "px"; gelm_btnMid.style.overflowX = "hidden"; gelm_btnMid.style.overflowY = "hidden"; gelm_btnMid.style.color = INFOBUTTON_FORE_COLOR; gelm_btnMid.style.backgroundColor = INFOBUTTON_BG_COLOR; gelm_btnMid.style.opacity = "0.0"; gelm_btnMid.style.fontSize = gstrA_titleSize[gi_dispMode]; gelm_btnMid.style.borderColor = INFOBUTTON_BORDER_COLOR; gelm_btnMid.style.borderStyle = "solid"; gelm_btnMid.style.borderWidth = "1px"; gelm_btnMid.style.zIndex = "9"; gelm_btnMid.textContent = BTN_TXT_BTNM; gelm_btnMid.style.userSelect = "none"; gelm_btnMid.onclick = clickInformationButton3; gelm_btnMid.oncontextmenu = clickInformationButton4; gelm_allParent.appendChild(gelm_btnMid); //情報表示部の上に置かれる右ボタンエレメント生成 gelm_btnRight = document.createElement("div"); gelm_btnRight.setAttribute("id",INFORBTN_BLOCK); gelm_btnRight.style.display = "block"; gelm_btnRight.style.position = "absolute"; gelm_btnRight.style.textAlign = "center"; gelm_btnRight.style.width = (D_WIDTH / 3) + "px"; gelm_btnRight.style.height = (D_HEIGHT - 2) + "px"; gelm_btnRight.style.marginLeft = (D_WIDTH * 2 / 3) + "px"; gelm_btnRight.style.overflowX = "hidden"; gelm_btnRight.style.overflowY = "hidden"; gelm_btnRight.style.color = INFOBUTTON_FORE_COLOR; gelm_btnRight.style.backgroundColor = INFOBUTTON_BG_COLOR; gelm_btnRight.style.opacity = "0.0"; gelm_btnRight.style.fontSize = gstrA_titleSize[gi_dispMode]; gelm_btnRight.style.borderColor = INFOBUTTON_BORDER_COLOR; gelm_btnRight.style.borderStyle = "solid"; gelm_btnRight.style.borderWidth = "1px"; gelm_btnRight.style.zIndex = "9"; gelm_btnRight.textContent = BTN_TXT_BTNR; gelm_btnRight.style.userSelect = "none"; gelm_btnRight.onclick = clickInformationButton5; gelm_btnRight.oncontextmenu = clickInformationButton6; gelm_allParent.appendChild(gelm_btnRight); //ボタン親エレメント生成 gelm_btnParent = document.createElement("div"); gelm_btnParent.setAttribute("id",BUTTON_BLOCK); gelm_btnParent.style.display = "flex"; gelm_btnParent.style.height = DISPINFO_HEIGHT; gelm_btnParent.style.marginLeft = "0px"; gelm_btnParent.style.marginRight = "0px"; gelm_btnParent.style.borderWidth = "0px"; gelm_btnParent.style.zIndex = "8"; //stopPropagationのあと無名関数自身をreturn falseで返さないと親エレメントのイベントが止まらない gelm_btnParent.onclick = function(e){e.stopPropagation();return false;}; gelm_btnParent.oncontextmenu = function(e){e.stopPropagation();return false;}; gelm_allParent.appendChild(gelm_btnParent); //ヘルプダイアログボタンのエレメント生成 gelm_btnHelp = document.createElement("div"); gelm_btnHelp.setAttribute("id",HELP_BLOCK); gelm_btnHelp.style.display = "flex"; gelm_btnHelp.style.height = DISPINFO_HEIGHT; gelm_btnHelp.style.color = COLOR_GRAY; gelm_btnHelp.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnHelp.style.fontSize = gstrA_buttonSize[gi_dispMode]; gelm_btnHelp.style.border = COLOR_BORDER; gelm_btnHelp.style.borderStyle = "solid"; gelm_btnHelp.style.borderWidth = "1px"; gelm_btnHelp.style.textAlign = "center"; gelm_btnHelp.style.zIndex = "9"; gelm_btnHelp.textContent = BTN_TXT_HLP; gelm_btnHelp.style.userSelect = "none"; gelm_btnHelp.onclick = dispInfoDialog; gelm_btnHelp.oncontextmenu = dispReadDialog; gelm_btnParent.appendChild(gelm_btnHelp); //インターバル設定ボタンのエレメント生成 gelm_btnInterval = document.createElement("div"); gelm_btnInterval.setAttribute("id",INTERVAL_BLOCK); gelm_btnInterval.style.display = "flex"; gelm_btnInterval.style.height = DISPINFO_HEIGHT; gelm_btnInterval.style.color = COLOR_GRAY; gelm_btnInterval.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnInterval.style.fontSize = gstrA_buttonSize[gi_dispMode]; gelm_btnInterval.style.border = COLOR_BORDER; gelm_btnInterval.style.borderStyle = "solid"; gelm_btnInterval.style.borderWidth = "1px"; gelm_btnInterval.style.zIndex = "9"; gelm_btnInterval.style.textAlign = "center"; gelm_btnInterval.textContent = BTN_TXT_INT; gelm_btnInterval.style.userSelect = "none"; gelm_btnInterval.onclick = dispSettingMessage; gelm_btnInterval.oncontextmenu = dispSystemSettingMessage; gelm_btnParent.appendChild(gelm_btnInterval); //短周期タイマ設定ボタンのエレメント生成 gelm_btnShort = document.createElement("div"); gelm_btnShort.setAttribute("id",SHORT_BLOCK); gelm_btnShort.style.display = "flex"; gelm_btnShort.style.height = DISPINFO_HEIGHT; gelm_btnShort.style.color = COLOR_IDL_DISABL; gelm_btnShort.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnShort.style.fontSize = gstrA_buttonSize[gi_dispMode]; gelm_btnShort.style.border = COLOR_BORDER; gelm_btnShort.style.borderStyle = "solid"; gelm_btnShort.style.borderWidth = "1px"; gelm_btnShort.style.zIndex = "9"; gelm_btnShort.style.textAlign = "center"; gelm_btnShort.textContent = BTN_TXT_SRT; gelm_btnShort.style.userSelect = "none"; gelm_btnShort.onclick = function(){ replaceElementsOneShot(); if(DEBUG_MODE)debugFunction(); }; gelm_btnShort.oncontextmenu = idleTimerChange; gelm_btnParent.appendChild(gelm_btnShort); //自動更新ON/OFF設定ボタンのエレメント生成 gelm_btnAutoOff = document.createElement("div"); gelm_btnAutoOff.setAttribute("id",AUTO_BLOCK); gelm_btnAutoOff.style.display = "flex"; gelm_btnAutoOff.style.height = DISPINFO_HEIGHT; gelm_btnAutoOff.style.color = COLOR_AUT_DISABL; gelm_btnAutoOff.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnAutoOff.style.fontSize = gstrA_buttonSize[gi_dispMode]; gelm_btnAutoOff.style.border = COLOR_BORDER; gelm_btnAutoOff.style.borderStyle = "solid"; gelm_btnAutoOff.style.borderWidth = "1px"; gelm_btnAutoOff.style.zIndex = "9"; gelm_btnAutoOff.style.textAlign = "center"; gelm_btnAutoOff.textContent = BTN_TXT_AUT; gelm_btnAutoOff.style.userSelect = "none"; gelm_btnAutoOff.onclick = switchAutoButton; gelm_btnAutoOff.oncontextmenu = resetDomTime; gelm_btnParent.appendChild(gelm_btnAutoOff); if( gi_dispMode == MODE_HOME ){ //ツイート欄ON/OFF設定ボタンのエレメント生成 gelm_btnEdit = document.createElement("div"); gelm_btnEdit.setAttribute("id",EDITBTN_BLOCK); gelm_btnEdit.style.display = "flex"; gelm_btnEdit.style.height = DISPINFO_HEIGHT; gelm_btnEdit.style.color = (COLOR_MODE)?COLOR_LIGHT_WHITE:COLOR_LIGHT_BLACK; gelm_btnEdit.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; gelm_btnEdit.style.fontSize = gstrA_buttonSize[gi_dispMode]; gelm_btnEdit.style.border = COLOR_BORDER; gelm_btnEdit.style.borderStyle = "solid"; gelm_btnEdit.style.borderWidth = "1px"; gelm_btnEdit.style.zIndex = "9"; gelm_btnEdit.style.textAlign = "center"; gelm_btnEdit.textContent = " "; gelm_btnEdit.style.userSelect = "none"; gelm_btnEdit.onclick = function(){closePopupToolTips();gi_hideEditControl=(gi_hideEditControl==0)?1:0; swichEditColumn();}; gelm_btnEdit.oncontextmenu = function(){closePopupToolTips();gi_hideNumberNewTweet=(gi_hideNumberNewTweet==0)?1:0; swichDispNumberNewTweet(0);}; gelm_btnParent.appendChild(gelm_btnEdit); swichEditColumn(); } //ボタン機能のヘルプポップアップを表示 gelm_btnLeft.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_BTNL,CON_BUTTON_LL,CON_BUTTON_LR); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } }); gelm_btnLeft.addEventListener('mouseleave', closePopupToolTips); gelm_btnMid.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_BTNM,CON_BUTTON_ML,CON_BUTTON_MR); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } }); gelm_btnMid.addEventListener('mouseleave', closePopupToolTips); gelm_btnRight.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_BTNR,CON_BUTTON_RL,CON_BUTTON_RR); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnRight.addEventListener('mouseleave', closePopupToolTips); gelm_btnShort.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_SRT,BTNID_SHORT,BTNID_SHORT+1); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnShort.addEventListener('mouseleave', closePopupToolTips); gelm_btnInterval.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_INT,BTNID_INTVL,BTNID_INTVL+1); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnInterval.addEventListener('mouseleave', closePopupToolTips); gelm_btnAutoOff.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_AUT,BTNID_ATOFF,BTNID_ATOFF+1); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnAutoOff.addEventListener('mouseleave', closePopupToolTips); gelm_btnHelp.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_HLP,BTNID_HELP,BTNID_HELP+1); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnHelp.addEventListener('mouseleave', closePopupToolTips); if( gi_dispMode == MODE_HOME ){ gelm_btnEdit.addEventListener('mouseover', function(){ if(gi_dispToolTipsPopup){ var msg = getButtonToolTipsHTML(BTN_TXT_ED1 + " / " + BTN_TXT_ED0,BTNID_EDIT,BTNID_EDIT+1); closePopupToolTips(); gelm_fixedToolTips = dispPopupMessage(msg, gi_displayHelpToolTipsPopupCloseTimeSec, COLOR_TOOLTIPS_FGCOLOR, COLOR_TOOLTIPS_BGCOLOR, true, false, true); } gi_onButtonHover = 1; }); gelm_btnEdit.addEventListener('mouseleave', closePopupToolTips); } } //ボタンヘルプToolTipsのinnerHTMLを生成する function getButtonToolTipsHTML(label,btn1,btn2){ //label: 表示ラベル //btn1: 情報表示部ボタンの左クリック用インデックス //btn2: 情報表示部ボタンの右クリック用インデックス //return: 生成されたinnerHTML var max = (DIALOG_MAX_WIDTH).replace("px",""); var min = (DIALOG_MIN_WIDTH).replace("px",""); var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : Math.floor(window.innerWidth * 0.9)); var msg = ""; //msg += "style='border-collapse: collapse; border-color: " + COLOR_TOOLTIPS_BORDER + "'>"; msg += "
[ " + label + " ] ボタン機能割付
" msg += ""; msg += ""; msg += ""; msg += "
左クリック :" + getButtonFunction(btn1) + "右クリック :" + getButtonFunction(btn2) + "
"; return msg; } //ボタンに割り付けた機能一覧の取得 function getButtonFunction(btnIdx){ //btnIdx: 情報表示部ボタンのインデックス //return: 機能一覧文字列 var ntf = (gi_dispMode == MODE_NOTI) ? true : false; var msg = ""; if( btnIdx < MAX_CON_BUTTON ){ if( gi_findMode ){ msg += "
 既読マーク捜索中断"; } if(giA_scrToTopButton[btnIdx]){ msg += "
 先頭にスクロール"; } if(giA_restartShortTimer[btnIdx]){ msg += "
 短周期処理の単発実行"; } if( gi_enableReadPointCheckBox && giA_manualUpdateAutoCheck[btnIdx] && !ntf ){ msg += "
 自動既読マーク"; } if(giA_manualUpdateTrigger[btnIdx] && !ntf){ msg += "
 手動更新"; } if( giA_updateContinuousButton[btnIdx] && !ntf){ msg += "
 新着積み上げ"; } if( gi_enableReadPointCheckBox && giA_findReadPointButton[btnIdx] && !ntf ){ msg += "
 既読マーク捜索"; } if( giA_scrTopMarkButton[btnIdx] && !ntf){ msg += "
 先頭で既読マーク"; } if(ntf && (btnIdx % 2)){ msg += "
 タイマ時間リセット"; } if(giA_clearNewNotification[btnIdx] && ntf){ msg += "
 新着表示色クリア"; } if( gi_findMode ){ msg += "
"; } return msg; } switch(btnIdx){ case BTNID_SHORT://左クリック msg += "
 短周期処理の単発実行"; if(DEBUG_MODE){ msg += "
 OPEN DEBUG WINDOW"; } break; case BTNID_SHORT + 1://右クリック msg += "
 短周期タイマ切替"; break; case BTNID_INTVL://左クリック msg += "
 コンフィグ設定"; break; case BTNID_INTVL + 1://右クリック msg += "
 システムコンフィグ設定"; break; case BTNID_ATOFF://左クリック msg += "
 自動更新OFF切替"; break; case BTNID_ATOFF + 1://右クリック msg += "
 タイマ時間リセット"; break; case BTNID_HELP://左クリック msg += "
 ヘルプダイアログ表示"; break; case BTNID_HELP + 1://右クリック if(gi_enableReadPointCheckBox && !ntf){ msg += "
 既読情報ダイアログ表示"; }else{ msg += "
 (none)"; } break; case BTNID_EDIT://左クリック msg += "
 ツイート入力欄表示切替"; break; case BTNID_EDIT + 1://右クリック msg += "
 上部の新着件数表示切替"; break; } return msg; } //情報表示部(左ボタン)の左クリック function clickInformationButton1(){ clickInformationButton(CON_BUTTON_LL); } //情報表示部(左ボタン)の右クリック function clickInformationButton2(){ clickInformationButton(CON_BUTTON_LR); } //情報表示部の(中ボタン)の左クリック function clickInformationButton3(){ clickInformationButton(CON_BUTTON_ML); } //情報表示部の(中ボタン)の右クリック function clickInformationButton4(){ clickInformationButton(CON_BUTTON_MR); } //情報表示部の(右ボタン)の左クリック function clickInformationButton5(){ clickInformationButton(CON_BUTTON_RL); } //情報表示部の(右ボタン)の右クリック function clickInformationButton6(){ clickInformationButton(CON_BUTTON_RR); } //クリック操作によるスクロール操作・短周期処理の単発実行・更新トリガ・自読既読マーク・既読マーク捜索 function clickInformationButton(btnId){ //btnId: 情報表示部ボタンのインデックス var dt = new Date(); closePopupToolTips(); //既読捜索モード中はどのボタンを押しても中断 if( gi_findMode ){ gi_findMode = 0; gi_findReadPointCount = 0; gstrA_findModeArticleTimeStamp = []; gi_lastFindModeArticleRecs = 0; if(gi_findModeDispPopup){ dispPopupMessage("既読ポイント捜索を中止しました" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_FIND); closePopupFindAll(); } return; } //スクロールがほぼは最上部なら先頭に戻す if( window.pageYOffset <= SCROLL_LIMIT + 1.0 ){ window.scrollTo(0, 0); dispDebugTextWithTime("clickInformationButton[" + btnId + "] : Scroll to (0,0)"); } //通知ページは右クリックされたらタイマリセットを行う(◆ボタンが無いので強制リロードをキャンセルできないため) if( gi_dispMode == MODE_NOTI && (! gb_flgClearNotification) && (btnId == CON_BUTTON_LR || btnId == CON_BUTTON_MR || btnId == CON_BUTTON_RR) ){ gdt_lastDomTime = gdt_lastTriggerTime = dt; gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; dispDebugTextWithTime("clickInformationButton[" + btnId + "] : Timer reset"); } //次回スクロール位置を先頭に戻したら既読マークする if( giA_scrTopMarkButton[btnId] && gi_enableReadPointCheckBox && gi_dispMode != MODE_NOTI ){ if( giA_findReadPointButton[btnId] && gi_enableReadPointCheckBox && gi_dispMode != MODE_NOTI ){ startModeScrTopMark(true); }else{ startModeScrTopMark(false); } dispDebugTextWithTime("clickInformationButton[" + btnId + "] : Scroll top mark mode"); } //既読ポイントを捜索するモードに移行する(手動更新や既読マーク更新は設定されていても動作しない if( giA_findReadPointButton[btnId] && gi_enableReadPointCheckBox && gi_dispMode != MODE_NOTI ){ startReadPointFindingMode(); dispDebugTextWithTime("clickInformationButton[" + btnId + "] : Start find mark mode"); return; } //スクロール中は最上部のアーティクルが読まれていない状態の事があるので先頭よりちょっと下に戻るのみ(先頭に戻すとトリガされてしまう) if( giA_scrToTopButton[btnId] ){ if( window.pageYOffset > SCROLL_LIMIT + 1.0 && ! gf_scrollOperation ){ if( gi_scrToTopModeDispPopup ){ dispPopupMessage("先頭にスクロールを戻します", gi_displayPopupCloseTimeSec * 2, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_TTOP); } //スクロール操作の排他開始 gf_scrollOperation = true; if( gi_dispMode != MODE_LIST || window.pageYOffset < LIST_PAGE_SCROLL_LIMIT ){ dispDebugTextWithTime("clickInformationButton : Normal-scroll start : " + Math.floor(window.pageYOffset)); window.setTimeout( function(){ window.scrollTo(0, SCROLL_LIMIT + 1 ); }, 100 ); window.setTimeout( function(){ checkScrollComplete(); }, gi_splitScrollIntervalMs ); }else{ //CSS切り替えポイントを一気に跨がないように分割してスクロールする dispDebugTextWithTime("clickInformationButton : Split-scroll start : " + Math.floor(window.pageYOffset)); window.setTimeout( function(){ window.scrollTo(0, LIST_PAGE_SCROLL_LIMIT - 1 ); }, 100 ); window.setTimeout( function(){ checkScrollLimitOnSplitScroll(); }, gi_splitScrollIntervalMs ); } return; } } //短周期処理のワンショット実施 if( gi_idleShortTimer && giA_restartShortTimer[btnId] ){ replaceElementsOneShot(); dispDebugTextWithTime("clickInformationButton[" + btnId + "] : replaceElementsOneShot()"); //for DEBUG ※ローカルストレージの保存データオブジェクトをコンソールに表示 if( btnId == CON_BUTTON_RL ){ loadStorageData(); console.log("ONESHOT PseudoTwDk: Setting="); console.dir(gobj_localData); } } //DMがあれば通知ページにポップアップ表示 if( gi_dispMode == MODE_NOTI ){ checkDMNotification(); } //通知ページの新着表示を戻す if( giA_clearNewNotification[btnId] && gi_dispMode == MODE_NOTI ){ clearNewNotification(); return; } if( gi_dispMode != MODE_HOME && gi_dispMode != MODE_LIST && gi_dispMode != MODE_USER && gi_dispMode != MODE_SEAR ) return; if( window.pageYOffset <= SCROLL_LIMIT ){ //自動で最新表示中のアーティクルを既読マークする if( giA_manualUpdateAutoCheck[btnId] && gi_enableReadPointCheckBox ){ if( gi_updateContinuousDispPopup && giA_manualUpdateTrigger[btnId] && giA_updateContinuousButton[btnId] ){ dispPopupMessage("先頭記事を既読マークします", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_MARK); } //連続更新前にストレージから読み出す loadStorageData(); //マークを先頭記事から更新 updateReadCheck(); //連続更新後にストレージに格納する saveStorageData(); } } //更新禁止期間によって抑止されている時はトリガさせない if( gi_colorType == TYPE_HOLDTM ) return; //前回の手動更新から時間が経過していたらトリガ if( giA_manualUpdateTrigger[btnId] ){ if( dt.getTime() - gdt_lastTriggerTime.getTime() > gi_manualUpdateIntervalSec * 1000 ){ //色替え・手動更新表示 forceUpdateColor(COLOR_UPDATE, TXT_MANUALUPDATE); //更新トリガの時間を記録 gdt_lastTriggerTime = dt; //先頭に戻してからトリガ window.scrollTo(0, 0); //手動でトリガ execTrigger(false, btnId); dispDebugTextWithTime("clickInformationButton[" + btnId + "] : Manual execTrigger()"); //手動でトリガを掛けたのでインターバル時間はリセット gi_updateCountMs = 0; } } } //分割スクロールの中間ポイント完了待ち function checkScrollLimitOnSplitScroll(){ var elm = document.querySelectorAll('body:not([' + gstr_scrScrollList +'])'); if( elm.length > 0 ){ dispDebugTextWithTime("checkScrollLimitOnSplitScroll : Split-scroll continue : " + Math.floor(window.pageYOffset)); window.setTimeout( function(){ window.scrollTo(0, SCROLL_LIMIT + 1 ); }, gi_splitScrollIntervalMs ); window.setTimeout( function(){ checkScrollComplete(); }, gi_splitScrollIntervalMs * 2 ); }else{ dispDebugTextWithTime("checkScrollLimitOnSplitScroll : Split-scroll waiting : " + Math.floor(window.pageYOffset)); window.setTimeout( function(){ window.scrollTo(0, LIST_PAGE_SCROLL_LIMIT - 1 ); }, gi_splitScrollIntervalMs ); window.setTimeout( function(){ checkScrollLimitOnSplitScroll(); }, gi_splitScrollIntervalMs * 2 ); } } //スクロールの完了待ち function checkScrollComplete(){ if( Math.floor(window.pageYOffset) <= SCROLL_LIMIT + 1 ){ dispDebugTextWithTime("checkScrollComplete : Scroll complete : " + Math.floor(window.pageYOffset)); if( gi_scrToTopModeDispPopup ){ dispPopupMessage("先頭にスクロールしました", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR_TTOP); } gf_scrollOperation = false; }else{ dispDebugTextWithTime("checkScrollComplete : Scroll waiting : " + Math.floor(window.pageYOffset)); window.setTimeout( function(){ window.scrollTo(0, SCROLL_LIMIT + 1 ); }, gi_splitScrollIntervalMs ); window.setTimeout( function(){ checkScrollComplete(); }, gi_splitScrollIntervalMs * 2 ); } } /************************************************************ ボタン押下・設定切り替え関連関数 ************************************************************/ //自動更新をON/OFFする(OFFでは強制停止、ONの時はスクロールバーの位置やエディット入力にフォーカスがあるか無いかで判定する従来の動作をする) function switchAutoButton(){ closePopupToolTips(); var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); if( gelm_btnAutoOff === null ) return; if( gi_modeAutoOff == 1 ){ //AUTO = ONにする gi_modeAutoOff = 0; if(u.length > 2){ saveSetting( AUTOOFF_HEADER, u, 0 ); dispPopupMessage("自動更新を通常モードに切り替えました", gi_displayPopupCloseTimeSec); } }else{ //AUTO = OFFにする gi_modeAutoOff = 1; if(u.length > 2){ saveSetting( AUTOOFF_HEADER, u, 1 ); dispPopupMessage("自動更新を強制OFFモードに切り替えました", gi_displayPopupCloseTimeSec); } } gdt_lastDomTime = gdt_lastTriggerTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; } //DOM更新時間をリセットし、自動更新・強制リロードまでの時間を再カウントする function resetDomTime(){ closePopupToolTips(); gdt_lastDomTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = 0; dispPopupMessage("自動更新タイマと強制リロードまでの時間をリセットしました", gi_displayPopupCloseTimeSec); } //短周期タイマの常時動作切り替え function idleTimerChange(){ closePopupToolTips(); if( gi_idleShortTimer == 0 ){ gi_idleShortTimer = 1; dispPopupMessage("短周期タイマを都度停止するモードに切り替えました", gi_displayPopupCloseTimeSec); }else{ gi_idleShortTimer = 0; dispPopupMessage("短周期タイマを常時稼動モードに切り替えました", gi_displayPopupCloseTimeSec); } var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); if(u.length > 2){ saveSetting( IDLETM_HEADER, u, gi_idleShortTimer ); } //どちらの設定であっても切り替えられたら短周期タイマを再開させる if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceElements, gi_shortIntervalMs); gstr_lastShortStart = new Date(); //console.log("★gtmr_shortTimer: START[idleTimerChange]"); } } //ツイート欄の表示非表示切り替え function swichEditColumn(){ if( gi_dispMode != MODE_HOME ) return; var e0, v; e0 = document.querySelectorAll('div[aria-label="ホームタイムライン"] > div:nth-of-type(3)'); if( e0.length > 0 ){ if( ! gi_hideEditControl ){ //表示へ切り替え e0[0].setAttribute(EDITSW_BLOCK, "0"); e0[0].style.display = null; gelm_btnEdit.textContent = " " + BTN_TXT_ED1 + " "; }else{ //非表示へ切り替え e0[0].setAttribute(EDITSW_BLOCK, "1"); e0[0].style.display = "none"; gelm_btnEdit.textContent = " " + BTN_TXT_ED0 + " "; } v = loadSetting( EDITDISP_HEADER, KEY_SYSTEM ); if( (v === null && gi_hideEditControl != gi_defaultHideEditControl) || (v != null && v != gi_hideEditControl) ){ saveSetting( EDITDISP_HEADER, KEY_SYSTEM, gi_hideEditControl ); } //console.log("★saveSetting" + EDITDISP_HEADER + " = " + gi_hideEditControl); } } //新着件数表示の表示非表示切り替え function swichDispNumberNewTweet(noMessage){ //noMessage: true=ポップアップメッセージ表示なし / false:ポップアップメッセージ表示あり if( gi_dispMode != MODE_HOME ) return; var e0, e1, v; //要素変更 e0 = document.querySelectorAll('body'); if( e0.length > 0 ){ if( gi_hideNumberNewTweet ){ e0[0].setAttribute(gstr_scrNewTweetAttr, 'false'); e0[0].display = "none"; }else{ e0[0].setAttribute(gstr_scrNewTweetAttr, 'true'); e0[0].display = null; } v = loadSetting( NEWTWDISP_HEADER, KEY_SYSTEM ); if( (v === null && gi_hideNumberNewTweet != gi_defaultHideNumberNewTweet) || (v != null && v != gi_hideNumberNewTweet) ){ saveSetting( NEWTWDISP_HEADER, KEY_SYSTEM, gi_hideNumberNewTweet ); } if( ! noMessage ){ if( gi_hideNumberNewTweet ){ dispPopupMessage("新着件数の表示をOFFにしました", gi_displayPopupCloseTimeSec); }else{ dispPopupMessage("新着件数の表示をONにしました", gi_displayPopupCloseTimeSec); } } } } /************************************************************ ポップアップ表示関連関数 ************************************************************/ //ポップアップタイプのボタン付きダイアログを表示 function popupConfirm(dispMsg, btn1Text, btn1Func, btn2Text, btn2Func, btn3Text, btn3Func){ //dispMsg: 表示する文字列 //btn1Text: ボタン1に表示する文字列 //btn1Func: ボタン1押下時に呼ぶ関数 //btn2Text: ボタン2に表示する文字列 //btn2Func: ボタン2押下時に呼ぶ関数 //btn3Text: ボタン3に表示する文字列 //btn3Func: ボタン3押下時に呼ぶ関数 //ret: ポップアップオブジェクト var msg = ""; var e; var ret; var max = (DIALOG_MAX_WIDTH).replace("px","") - 44; var min = (DIALOG_MIN_WIDTH).replace("px","") - 44; var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : (window.innerWidth * 0.9)); msg += "
" + dispMsg + ""; if( btn1Text != "" && btn1Text !== null && btn1Text !== undefined ){ msg += "
"; } if( btn2Text != "" && btn2Text !== null && btn2Text !== undefined ){ msg += "
"; } if( btn3Text != "" && btn3Text !== null && btn3Text !== undefined ){ msg += "
"; } msg += "
"; ret = dispPopupMessage(msg, -1, null, null, true, false); if( btn1Text != "" && btn1Text !== null && btn1Text !== undefined ){ e = document.getElementById('ELM_CONFIRM_BTN1'); if( e !== null ){ e.onclick = btn1Func; e.style.marginTop = e.style.marginBottom = "3px"; } } if( btn2Text != "" && btn2Text !== null && btn2Text !== undefined ){ e = document.getElementById('ELM_CONFIRM_BTN2'); if( e !== null ){ e.onclick = btn2Func; e.style.marginTop = e.style.marginBottom = "3px"; } } if( btn3Text != "" && btn3Text !== null && btn3Text !== undefined ){ e = document.getElementById('ELM_CONFIRM_BTN3'); if( e !== null ){ e.onclick = btn3Func; e.style.marginTop = e.style.marginBottom = "3px"; } } return ret; } //ポップアップのためのエレメントを生成してメッセージを下部に表示する function dispPopupMessage(msg, tim_sec, fgcolor=null, bgcolor=null, typeHTML=false, closeOnClick=true, floatOnTop=false, debugWindow=false){ //msg: 表示テキスト, //tim_sec: 表示時間(-1指定時は自動的に消さない), //fgcolor: 文字色rgbテキスト(省略時白) //bgcolor: 背景色rgbテキスト(省略時Twitterテーマカラー) //typeHTML: true=テキストでは無くinnerHTMLを差し込む //closeOnClick: true=ポップアップ自体のクリックで閉じる動作をする / false=しない //floatOnTop: true=上に固定ポップアップする / false=しない //debugWindow: true=デバッグ用表示 //return: ポップアップオブジェクト if( gi_displayPopupCloseTimeSec <= 0 ) return; if( ! floatOnTop && ! typeHTML ){ dispDebugTextWithTime(msg); } var e0, e1, e2, e3, e4, e5, e6, e7; var fg = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; var bg = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; var isNotHTML; var nowObj, nowTime, endTime = ""; var max = (DIALOG_MAX_WIDTH).replace("px",""); var min = (DIALOG_MIN_WIDTH).replace("px",""); var w1 = (window.innerWidth > max ) ? max : ((window.innerWidth < min ) ? min : window.innerWidth); nowObj = new Date(); nowTime = nowObj.getTime(); isNotHTML = ! typeHTML; if( tim_sec != -1 ){ //複数のポップアップが積み重なるのを許可するため、消去予定時間をエレメントに付加しておく endTime = nowTime + (tim_sec * 1000); } if( fgcolor !== null ){ fg = fgcolor; } if( bgcolor === null ){ //Twitterの色設定に依存するツイートボタン色から背景色を拾ってくる e7 = document.querySelectorAll('a[data-testid="SideNav_NewTweet_Button"]'); if( e7.length > 0 ){ bg = window.getComputedStyle(e7[0], null).getPropertyValue('background-color'); } }else{ bg = bgcolor; } //要らないクラスIDとかありそうだけど、実際ツイート後に出るポップアップの要素をそのままコピー e0 = document.querySelectorAll('div[id="react-root"] div[id="layers"] > div:nth-of-type(1) > div:nth-of-type(1)'); if( e0.length > 0 ){ e1 = document.createElement("div"); e1.setAttribute("id",POPUP_BLOCK); //e1.setAttribute("class","css-1dbjc4n r-12vffkv"); e1.style.backgroundColor = COLOR_CLEAR; e1.style.width = "100%"; e1.onclick = function(e){e.stopPropagation(); return false;}; e1.onkeydown = function(e){e.stopPropagation(); return false;}; e1.onkeyup = function(e){e.stopPropagation(); return false;}; e1.onkeypress = function(e){e.stopPropagation(); return false;}; e1.onchange = function(e){e.stopPropagation(); return false;}; if( endTime != "" ){ e1.setAttribute(POPUP_ENDTIME, endTime); } e1.style.zIndex = "999"; if( floatOnTop ){ e1.style.position = "fixed"; e1.style.height = gi_floatPopupHeight + "px"; e1.style.bottom = (window.innerHeight - gi_floatPopupHeight - gi_floatPopupMargin) + "px"; } e2 = document.createElement("div"); e2.setAttribute("id",POPUP_BLOCK + "-1"); e2.setAttribute("class", "css-1dbjc4n r-1jgb5lz r-633pao r-13qz1uu"); if( ! floatOnTop ){ e2.style.backgroundColor = bg; }else{ //ツールチップにする場合は内部のテーブルより外側は透明にする e2.style.backgroundColor = COLOR_CLEAR; } e2.style.zIndex = "999"; if( ! floatOnTop && ! debugWindow ){ e2.style.width = w1 + "px"; }else{ e2.style.width = "100%"; } e1.appendChild(e2); e3 = document.createElement("div"); e3.setAttribute("id",POPUP_BLOCK + "-2"); e3.setAttribute("class", "css-1dbjc4n r-1awozwy r-18u37iz r-1wtj0ep r-q81ovl r-105ug2t r-o7fkjf r-1i6wzkk"); e3.setAttribute("role", "alert"); e3.setAttribute("data-testid", "toast"); e3.setAttribute("style", "transition-duration: 0ms; transition-timing-function: cubic-bezier(0, 0, 1, 1);"); if( ! floatOnTop ){ e3.style.backgroundColor = bg; }else{ e3.style.backgroundColor = COLOR_CLEAR; e3.style.justifyContent = "center"; } if( debugWindow ){ e3.style.justifyContent = "center"; e3.style.paddingLeft = "2px"; e3.style.paddingRight = "2px"; e3.style.paddingTop = "2px"; e3.style.paddingBottom = "2px"; } e3.style.zIndex = "999"; e3.style.width = "100%"; e2.appendChild(e3); e4 = document.createElement("div"); e4.setAttribute("id",POPUP_BLOCK + "-3"); e4.setAttribute("class", "css-901oao r-jwli3a r-1wbh5a2 r-1tl8opc r-1b43r93 r-16dba41 r-hjklzo r-bcqeeo r-1qfz7tf r-qvutc0"); e4.setAttribute("dir", "ltr"); if( closeOnClick ){ e4.onclick = function(e){e.stopPropagation(); closePopupMessage(e.target); return false;}; } if( ! floatOnTop ){ e4.style.backgroundColor = bg; }else{ e4.style.backgroundColor = COLOR_CLEAR; } if( debugWindow ){ e4.style.paddingLeft = "2px"; e4.style.paddingRight = "2px"; e4.style.paddingTop = "2px"; e4.style.paddingBottom = "2px"; } e4.style.zIndex = "999"; e3.appendChild(e4); e5 = document.createElement("span"); e5.setAttribute("id",POPUP_BLOCK + "-4"); e5.setAttribute("class", "css-901oao css-16my406 r-1tl8opc r-bcqeeo r-qvutc0"); if( ! floatOnTop ){ e5.style.backgroundColor = bg; }else{ e5.style.backgroundColor = COLOR_CLEAR; } e5.style.zIndex = "999"; e4.appendChild(e5); e6 = document.createElement("span"); e6.setAttribute("type","button"); e6.setAttribute("id",POPUP_BLOCK + "-5"); e6.style.zIndex = "999"; e6.style.pointerEvents = "auto"; e6.style.backgroundColor = bg; e6.style.color = fg; if( isNotHTML ){ e6.textContent = "[" + toFormatedDateString(nowObj) + "] \r\n" + msg; }else{ e6.insertAdjacentHTML("beforeend", msg); } if( closeOnClick ){ e6.onclick = function(e){e.stopPropagation(); closePopupMessage(e.target); return false;}; } e5.appendChild(e6); e0[0].insertBefore(e1, e0[0].firstElementChild); if( floatOnTop ){ e7 = document.getElementById('PTD_POPUP_TOOLTIPS'); if( e7 !== null ){ e7.style.backgroundColor = bg; } } if( tim_sec != -1 ){ window.setTimeout( closePopupMessage, tim_sec * 1000 ); } return e1; } } //ポップアップを消去 function closePopupMessage(obj=null){ //obj: 閉じるポップアップのオブジェクト / null時は経過時間を判定して表示中のポップアップを閉じる var dt = (new Date()).getTime(); var val, attrTime, retry = 0; var flg = false; if( obj != null ){ //console.log("★popupRemoved onClick0 : [" + obj + "]"); while(obj.getAttribute("id") != POPUP_BLOCK){ //console.log("★popupRemoved onClick1 : [" + obj + "] = " + obj.getAttribute("id") ); obj = obj.parentNode; if( obj == null ) break; retry++; if( retry > 100 ) return; } if( obj != null ){ obj.remove(); obj = null; } return; } //複数スタックを許可するポップアップの終了条件を要素から取得 var e0 = document.querySelectorAll('div[id="' + POPUP_BLOCK + '"][' + POPUP_ENDTIME + ']'); for( var i=0; i < e0.length; i++ ){ val = e0[i].getAttribute(POPUP_ENDTIME); if( val !== null && val !== undefined ){ attrTime = Number(val); if( dt > attrTime ){ e0[0].remove(); //console.log("★popupRemoved " + dt + " / " + attrTime); }else{ flg = true; } } } if(flg){ window.setTimeout( closePopupMessage, 100 ); } } // ================================================================================= // 固定(永続化)ポップアップを削除する時はnullチェックしてからclosePopupMessage()を // 呼ばないと引数がnullだと複数スタックのポップアップを消す動作モードになってしまう // ================================================================================= //ボタンヘルプToolTipsを閉じる function closePopupToolTips(){ gi_onButtonHover = 0; if( gelm_fixedToolTips !== null ) closePopupMessage(gelm_fixedToolTips); gelm_fixedToolTips = null; } //既読マーク捜索(情報)ポップアップを閉じる function closePopupFindInfo(){ if( gelm_fixedPopupFindInfo !== null ) closePopupMessage(gelm_fixedPopupFindInfo); gelm_fixedPopupFindInfo = null; } //既読マーク捜索(ヒット数)ポップアップを閉じる function closePopupFindCount(){ if( gelm_fixedPopupFindCount !== null ) closePopupMessage(gelm_fixedPopupFindCount); gelm_fixedPopupFindCount = null; } //ボタン付きポップアップを閉じる(既読捜索モード中断) function closePopupFindContinue(){ if( gelm_fixedPopupFindContinue !== null ) closePopupMessage(gelm_fixedPopupFindContinue); gelm_fixedPopupFindContinue = null; } //ボタン付きポップアップを閉じる(既読捜索モード続行可否問い合わせ) function closePopupFindConfirm(){ if( gelm_fixedPopupFindConfirm !== null ) closePopupMessage(gelm_fixedPopupFindConfirm); gelm_fixedPopupFindConfirm = null; } //既読マーク捜索ポップアップ類を全部閉じる function closePopupFindAll(){ var tim = 1; //継続可否のポップアップは消えているはずだが closePopupFindContinue(); //ほか捜索モード関連のポップアップは順次消していく if( gelm_fixedPopupFindConfirm !== null ){ window.setTimeout( closePopupFindConfirm, ++tim * 1000 ); } if( gelm_fixedPopupFindInfo !==null ){ window.setTimeout( closePopupFindInfo, ++tim * 1000 ); } if( gelm_fixedPopupFindCount !== null ){ window.setTimeout( closePopupFindCount, ++tim * 1000 ); } } //新着クリア待ち中ポップアップを閉じる function closePopupClearNewTweetMessage(){ if( gelm_fixedPopupClearNewTweet !== null ) closePopupMessage(gelm_fixedPopupClearNewTweet); gelm_fixedPopupClearNewTweet = null; } //DM新着表示ポップアップを閉じる function closePopupClearNewDM(){ if( gelm_fixedPopupClearNewDM !== null ) closePopupMessage(gelm_fixedPopupClearNewDM); gelm_fixedPopupClearNewDM = null; } //次回のスクロール先頭で既読マークのポップアップを閉じる function closePopupScrTopMark(){ if( gelm_fixedScrTopMark !== null ) closePopupMessage(gelm_fixedScrTopMark); gelm_fixedScrTopMark = null; } //ボタン付きポップアップを閉じる(強制リロード問い合わせ) function closePopupReloadConfirm(){ if( gelm_fixedReloadConfirm !== null ) closePopupMessage(gelm_fixedReloadConfirm); gelm_fixedReloadConfirm = null; } /************************************************************ コンフィグ・システムコンフィグのデータ操作関連関数 ************************************************************/ //URLごとの各種設定をローカルストレージから読み込む function findSettings(){ var v, idx; var u = window.location.href; u = u.replace(TWITTER_URL, ""); //連続読み込みなのでloadSetting内では読み込まない loadStorageData(); //インターバル値を一旦初期状態に戻す giA_updateIntervalMs = giA_defaultIntervalMs; v = loadSetting( INTERVAL_HEADER, u, true ); if( v !== null ){ v = Number(v); giA_updateIntervalMs[gi_dispMode] = v * 1000; gi_updateCountMs = 0; //console.log("☆findSettings [" + gi_updateCountMs + "]" ); } //強制リロードまでの時間を一旦初期状態に戻す gi_reloadTimeoutSec = gi_defaultReloadTimeoutSec; v = loadSetting( RELOAD_HEADER, u, true ); if( v !== null ){ v = Number(v); gi_reloadTimeoutSec = v; } //自動更新OFFの設定保存値を読み込む gi_modeAutoOff = gi_defaultModeAutoOff; v = loadSetting( AUTOOFF_HEADER, u, true ); if( v !== null ){ v = Number(v); if( v == 0 ){ //AUTO = ONにする gi_modeAutoOff = 0; }else{ //AUTO = OFFにする gi_modeAutoOff = 1; gi_displayPaused = 1; } } //短周期タイマの常時ON設定保存値を読み込む gi_idleShortTimer = gi_defalutIdleShortTimer; v = loadSetting( IDLETM_HEADER, u, true ); if( v !== null ){ v = Number(v); if( v == 0 ){ //ずっと動作させ続けて停止させない gi_idleShortTimer = 0; }else{ //時間がたつと停止 gi_idleShortTimer = 1; } } //手動更新禁止時間の設定保存値を読み込む gi_manualUpdateIntervalSec = gi_defaultManualUpdateIntervalSec; v = loadSetting( MANUAL_HEADER, u, true ); if( v !== null ){ v = Number(v); gi_manualUpdateIntervalSec = v; } //メディアサイズ設定を読み込む gi_mediaSize = gi_defaultMediaSize; v = loadSetting( MEDIA_HEADER, u, true ); if( v !== null ){ v = Number(v); gi_mediaSize = v; } //RT&引用RT設定を読み込む gi_notDispRt = gi_defaultNotDispRt; v = loadSetting( NOTRT_HEADER, u, true ); if( v !== null ){ v = Number(v); gi_notDispRt = v; } //メディアサイズ設定とRT非表示設定をドキュメント反映とローカル保存 updateMediaAttribute(); //下部アイコン表示設定を読み込む gi_notDispCommIcon = gi_defaultNotDispCommIcon; v = loadSetting( NOTICON_HEADER, u, true ); if( v !== null ){ v = Number(v); gi_notDispCommIcon = v; } //下部アイコン表示設定をドキュメント反映とローカル保存 updateCommIconAttribute(); //ボタン毎の動作設定を読み込む for( idx=0; idx 0 ){ gelm0[0].setAttribute( gstr_scrMediaAttr, gi_mediaSize ); } if( ! isOther ){ v = loadSetting( MEDIA_HEADER, u, true ); if( (v === null && gi_mediaSize != gi_defaultMediaSize) || (v != null && v != gi_mediaSize) ){ saveSetting( MEDIA_HEADER, u, gi_mediaSize, true ); } } //RT非表示設定をドキュメントに設定し、ローカルにも保存 switch(gi_notDispRt){ case 1: rt = 1; quote = 0; break; case 2: rt = 0; quote = 1; break; case 3: rt = 1; quote = 1; break; default: rt = 0; quote = 0; break; } //CSSで切り替わるようにメディアサイズ情報を書き込む if( gelm0.length > 0 ){ gelm0[0].setAttribute( gstr_scrNotRtAttr, rt ); gelm0[0].setAttribute( gstr_scrNotQuoteAttr, quote ); } if( ! isOther ){ v = loadSetting( NOTRT_HEADER, u, true ); if( (v === null && gi_notDispRt != gi_defaultNotDispRt) || (v != null && v != gi_notDispRt) ){ saveSetting( NOTRT_HEADER, u, gi_notDispRt, true ); } } return; } //ツイート下部のアイコン類を非表示にする設定をドキュメントとローカルに保存 function updateCommIconAttribute(){ var v; var u = window.location.href; getModeFromURL(); var isOther = (gi_dispMode == MODE_NULL); if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); //連続読み込み+書き込みなのでloadSetting/saveSetting内では読み込まない loadStorageData(); //CSSで切り替わるように下部アイコン非表示情報を書き込む gelm0 = document.querySelectorAll('body'); if( gelm0.length > 0 ){ gelm0[0].setAttribute( gstr_scrNotCommIconAttr, gi_notDispCommIcon ); } if( ! isOther ){ v = loadSetting( NOTICON_HEADER, u, true ); if( (v === null && gi_notDispCommIcon != gi_defaultNotDispCommIcon) || (v != null && v != gi_notDispCommIcon) ){ saveSetting( NOTICON_HEADER, u, gi_notDispCommIcon, true ); } } } /************************************************************ コンフィグ・システムコンフィグ画面関連関数 ************************************************************/ //コンフィグのためのエレメントを生成してオーバーレイ表示する function dispSettingMessage(){ closePopupToolTips(); var e0, e1, e2, e = []; var nowObj, nowTime, endTime; var HTML = ""; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); gb_changedSetting = false; HTML += CRLF + "

"; HTML += CRLF + "PseudoTweetDeck [Ver" + VERSION_INFO + "]
"; HTML += CRLF + "Config Setting
"; HTML += CRLF + "Path=" + decodeURIComponent(u) + "
"; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; if( gi_dispMode != MODE_NOTI ){ HTML += CRLF + " "; }else{ HTML += CRLF + " "; } HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; if( gi_dispMode == MODE_HOME ){ HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; } if( gi_dispMode != MODE_NOTI ){ HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; } HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; if( gi_dispMode != MODE_NOTI ){ HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; } //情報表示部ボタンクリックの左右各設定 HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; if( gi_dispMode != MODE_NOTI ){ HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; } if( gi_dispMode == MODE_NOTI ){ HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; } HTML += CRLF + "
設定項目設定範囲/選択肢設定値
自動更新モードON:通常モード
OFF:強制停止モード
短周期タイマIDLE:都度停止
ALWAYS:常時動作
自動更新間隔自動新着表示クリア間隔5〜3600(sec)"; HTML += CRLF + " "; HTML += CRLF + "
強制リロード間隔0〜7200(sec)
※不使用時=0
"; HTML += CRLF + " "; HTML += CRLF + "
更新禁止期間5〜60(sec)"; HTML += CRLF + " "; HTML += CRLF + "
メディアサムネイルサイズ" + SIZE_NAME[0] + "
" + SIZE_NAME[1] + "
" + SIZE_NAME[2] + "
" + SIZE_NAME[3] + "
" + SIZE_NAME[4] + "
"; HTML += CRLF + " "; HTML += CRLF + "
RT&引用RT表示設定" + NOTRT_NAME[0] + "
" + NOTRT_NAME[1] + "
" + NOTRT_NAME[2] + "
" + NOTRT_NAME[3] + "
"; HTML += CRLF + " "; HTML += CRLF + "
各ツイート下部アイコンの表示ON:表示
OFF:非表示
ツイート欄の表示ON:表示
OFF:非表示
新着件数の表示ON:表示
OFF:非表示
既読マーク背景色設定0:非表示
1〜" + READ_COLOR_CYCLE + ":表示タイプ
"; HTML += CRLF + " "; HTML += CRLF + "
タイマのリセットRESET
最新記事の上に積むのを試みる動作中のポップアップON:表示する
OFF:表示しない
最新記事の上に新着を積むため遷移する待機時間100〜3000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
最新記事の上に新着を積むため遷移先から戻る待機時間100〜10000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
既読マーク捜索動作中のポップアップON:表示する
OFF:表示しない
既読マーク捜索時のスクロール1回毎の待機時間10〜10000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
スクロールを最上部に戻す動作中のポップアップON:表示する
OFF:表示しない
スクロール最上部で既読マーク動作中のポップアップON:表示する
OFF:表示しない
情報表示部クリック時の動作
左ボタン(BTN1)・中ボタン(BTN2)・右ボタン(BTN2)
"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
スクロールを最上部に戻す"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
短周期処理を単発実行する"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
最新記事に既読マークする"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
手動更新トリガをかける"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
手動更新時に新着を上に積むのを試みる"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
既読マークを捜索して遡る"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
次回のスクロール最上部で既読マーク"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
通知ページの新着をクリアする"; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + "

" + PSEUDO_URL + "

"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + "

"; //コンフィグ画面を構築 e0 = document.querySelectorAll('div[id="react-root"]'); if( e0.length > 0 ){ //設定起動中のフラグを立てる(強制リロードの回避) gb_enableSettingWindow = true; //背景エレメント e1 = document.createElement("div"); e1.setAttribute("id",SETTING_BLOCK); e1.style.display = "block"; e1.style.position = "absolute"; e1.style.height = "100%"; e1.style.width = "100%"; e1.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e1.style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e1.style.zIndex = "999"; e1.style.position = "fixed"; e1.onclick = function(e){e.stopPropagation(); return false;}; e1.onkeydown = function(e){e.stopPropagation(); return false;}; e1.onkeyup = function(e){e.stopPropagation(); return false;}; e1.onkeypress = function(e){e.stopPropagation(); return false;}; e1.onchange = function(e){e.stopPropagation(); return false;}; e2 = document.createElement("div"); e2.style.display = "flex"; e2.style.position = "relative"; e2.style.height = "100%"; e2.style.width = "100%"; e2.style.overflow = "scroll"; e2.style.justifyContent = "center"; e2.insertAdjacentHTML("beforeend", HTML); e1.appendChild(e2); e0[0].appendChild(e1); //テーブルエレメント e[0] = document.getElementById('ELM_MAIN_TABLE'); e[0].style.minWidth = DIALOG_MIN_WIDTH; e[0].style.maxWidth = DIALOG_MAX_WIDTH; e[1] = document.getElementById('ELM_INNER_TABLE'); e[1].style.fontSize = DIALOG_FONT_SIZE; //自動モード e[0] = document.getElementById('ELM_AUTO_OFF_MODE'); e[0].style.width = "95%"; e[0].value = ((gi_modeAutoOff==1)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_modeAutoOff = (gi_modeAutoOff==1)?0:1; e.target.value = ((gi_modeAutoOff==1)?"OFF":"ON"); //自動モードを切り替えたらタイマ類をリセット gdt_lastDomTime = gdt_lastTriggerTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; saveSetting( AUTOOFF_HEADER, u, gi_modeAutoOff ); return false; }; //短周期タイマ都度停止モード e[0] = document.getElementById('ELM_SHORT_IDLE_MODE'); e[0].style.width = "95%"; e[0].value = ((gi_idleShortTimer==1)?"IDLE":"ALWAYS"); e[0].onclick = function(e){ e.stopPropagation(); gi_idleShortTimer = (gi_idleShortTimer==1)?0:1; e.target.value = ((gi_idleShortTimer==1)?"IDLE":"ALWAYS"); saveSetting( IDLETM_HEADER, u, gi_idleShortTimer ); //どちらの設定であっても切り替えられたら短周期タイマを再開させる if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceElements, gi_shortIntervalMs); gstr_lastShortStart = new Date(); } return false; }; //自動更新インターバル e[0] = document.getElementById('ELM_INTERVAL_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = giA_updateIntervalMs[gi_dispMode] / 1000; e[1] = document.getElementById('ELM_INTERVAL_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_INTERVAL_TIME',5,3600,u ); return false;}; e[2] = document.getElementById('ELM_INTERVAL_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_INTERVAL_TIME',5,3600,u ); return false;}; //強制リロードインターバル e[0] = document.getElementById('ELM_FORCE_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_reloadTimeoutSec; e[1] = document.getElementById('ELM_FORCE_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_FORCE_TIME',0,7200,u ); return false;}; e[2] = document.getElementById('ELM_FORCE_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_FORCE_TIME',0,7200,u ); return false;}; //更新禁止期間 e[0] = document.getElementById('ELM_HOLD_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_manualUpdateIntervalSec; e[1] = document.getElementById('ELM_HOLD_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_HOLD_TIME',5,60,u ); return false;}; e[2] = document.getElementById('ELM_HOLD_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_HOLD_TIME',5,60,u ); return false;}; //メディアサムネイルサイズ e[0] = document.getElementById('ELM_MEDIA_SIZE'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_mediaSize; e[1] = document.getElementById('ELM_MEDIA_SIZE_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_MEDIA_SIZE',0,4,u ); return false;}; e[2] = document.getElementById('ELM_MEDIA_SIZE_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_MEDIA_SIZE',0,4,u ); return false;}; //RT&引用RT非表示 e[0] = document.getElementById('ELM_HIDE_RT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_notDispRt; e[1] = document.getElementById('ELM_HIDE_RT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_HIDE_RT',0,3,u ); return false;}; e[2] = document.getElementById('ELM_HIDE_RT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_HIDE_RT',0,3,u ); return false;}; //ツイート下部アイコンの表示 e[0] = document.getElementById('ELM_DISP_COMMICON'); e[0].style.width = "95%"; e[0].value = ((gi_notDispCommIcon==1)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_notDispCommIcon = (gi_notDispCommIcon==1)?0:1; e.target.value = ((gi_notDispCommIcon==1)?"OFF":"ON"); updateCommIconAttribute(); return false; }; //情報部のボタン1 左右クリック見出し行 e[1] = document.getElementById('ELM_LABEL_LBTN1'); e[1].style.pointerEvents = "none"; e[1].style.width = "15%"; e[1].value = "左"; e[1].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e[1].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e[2] = document.getElementById('ELM_LABEL_RBTN1'); e[2].style.pointerEvents = "none"; e[2].style.width = "15%"; e[2].value = "右"; e[2].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e[2].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; //情報部のボタン2 左右クリック見出し行 e[1] = document.getElementById('ELM_LABEL_LBTN2'); e[1].style.pointerEvents = "none"; e[1].style.width = "15%"; e[1].value = "左"; e[1].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e[1].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e[2] = document.getElementById('ELM_LABEL_RBTN2'); e[2].style.pointerEvents = "none"; e[2].style.width = "15%"; e[2].value = "右"; e[2].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e[2].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; //情報部のボタン3 左右クリック見出し行 e[1] = document.getElementById('ELM_LABEL_LBTN3'); e[1].style.pointerEvents = "none"; e[1].style.width = "15%"; e[1].value = "左"; e[1].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e[1].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e[2] = document.getElementById('ELM_LABEL_RBTN3'); e[2].style.pointerEvents = "none"; e[2].style.width = "15%"; e[2].value = "右"; e[2].style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e[2].style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; //スクロールを最上部に戻す e[1] = document.getElementById('ELM_SCRTOTOPL1'); e[1].style.width = "15%"; e[1].value = ((giA_scrToTopButton[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[0] = (giA_scrToTopButton[0]==1)?0:1; e.target.value = ((giA_scrToTopButton[0]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[0], u, giA_scrToTopButton[0] ); return false; }; e[2] = document.getElementById('ELM_SCRTOTOPR1'); e[2].style.width = "15%"; e[2].value = ((giA_scrToTopButton[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[1] = (giA_scrToTopButton[1]==1)?0:1; e.target.value = ((giA_scrToTopButton[1]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[1], u, giA_scrToTopButton[1] ); return false; }; e[3] = document.getElementById('ELM_SCRTOTOPL2'); e[3].style.width = "15%"; e[3].value = ((giA_scrToTopButton[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[2] = (giA_scrToTopButton[2]==1)?0:1; e.target.value = ((giA_scrToTopButton[2]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[2], u, giA_scrToTopButton[2] ); return false; }; e[4] = document.getElementById('ELM_SCRTOTOPR2'); e[4].style.width = "15%"; e[4].value = ((giA_scrToTopButton[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[3] = (giA_scrToTopButton[3]==1)?0:1; e.target.value = ((giA_scrToTopButton[3]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[3], u, giA_scrToTopButton[3] ); return false; }; e[5] = document.getElementById('ELM_SCRTOTOPL3'); e[5].style.width = "15%"; e[5].value = ((giA_scrToTopButton[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[4] = (giA_scrToTopButton[4]==1)?0:1; e.target.value = ((giA_scrToTopButton[4]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[4], u, giA_scrToTopButton[4] ); return false; }; e[6] = document.getElementById('ELM_SCRTOTOPR3'); e[6].style.width = "15%"; e[6].value = ((giA_scrToTopButton[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_scrToTopButton[5] = (giA_scrToTopButton[5]==1)?0:1; e.target.value = ((giA_scrToTopButton[5]==1)?"ON":"OFF"); saveSetting( SCRTOTOP_HEADER[5], u, giA_scrToTopButton[5] ); return false; }; //クリックで短周期タイマ再開 e[1] = document.getElementById('ELM_RESSRTTMRL1'); e[1].style.width = "15%"; e[1].value = ((giA_restartShortTimer[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[0] = (giA_restartShortTimer[0]==1)?0:1; e.target.value = ((giA_restartShortTimer[0]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[0], u, giA_restartShortTimer[0] ); return false; }; e[2] = document.getElementById('ELM_RESSRTTMRR1'); e[2].style.width = "15%"; e[2].value = ((giA_restartShortTimer[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[1] = (giA_restartShortTimer[1]==1)?0:1; e.target.value = ((giA_restartShortTimer[1]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[1], u, giA_restartShortTimer[1] ); return false; }; e[3] = document.getElementById('ELM_RESSRTTMRL2'); e[3].style.width = "15%"; e[3].value = ((giA_restartShortTimer[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[2] = (giA_restartShortTimer[2]==1)?0:1; e.target.value = ((giA_restartShortTimer[2]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[2], u, giA_restartShortTimer[2] ); return false; }; e[4] = document.getElementById('ELM_RESSRTTMRR2'); e[4].style.width = "15%"; e[4].value = ((giA_restartShortTimer[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[3] = (giA_restartShortTimer[3]==1)?0:1; e.target.value = ((giA_restartShortTimer[3]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[3], u, giA_restartShortTimer[3] ); return false; }; e[5] = document.getElementById('ELM_RESSRTTMRL3'); e[5].style.width = "15%"; e[5].value = ((giA_restartShortTimer[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[4] = (giA_restartShortTimer[4]==1)?0:1; e.target.value = ((giA_restartShortTimer[4]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[4], u, giA_restartShortTimer[4] ); return false; }; e[6] = document.getElementById('ELM_RESSRTTMRR3'); e[6].style.width = "15%"; e[6].value = ((giA_restartShortTimer[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_restartShortTimer[5] = (giA_restartShortTimer[5]==1)?0:1; e.target.value = ((giA_restartShortTimer[5]==1)?"ON":"OFF"); saveSetting( RESSRTTMR_HEADER[5], u, giA_restartShortTimer[5] ); return false; }; if( gi_dispMode != MODE_NOTI ){ //クリックで既読マークする e[1] = document.getElementById('ELM_AUTOMARKL1'); e[1].style.width = "15%"; e[1].value = ((giA_manualUpdateAutoCheck[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[0] = (giA_manualUpdateAutoCheck[0]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[0]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[0], u, giA_manualUpdateAutoCheck[0] ); return false; }; e[2] = document.getElementById('ELM_AUTOMARKR1'); e[2].style.width = "15%"; e[2].value = ((giA_manualUpdateAutoCheck[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[1] = (giA_manualUpdateAutoCheck[1]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[1]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[1], u, giA_manualUpdateAutoCheck[1] ); return false; }; e[3] = document.getElementById('ELM_AUTOMARKL2'); e[3].style.width = "15%"; e[3].value = ((giA_manualUpdateAutoCheck[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[2] = (giA_manualUpdateAutoCheck[2]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[2]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[2], u, giA_manualUpdateAutoCheck[2] ); return false; }; e[4] = document.getElementById('ELM_AUTOMARKR2'); e[4].style.width = "15%"; e[4].value = ((giA_manualUpdateAutoCheck[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[3] = (giA_manualUpdateAutoCheck[3]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[3]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[3], u, giA_manualUpdateAutoCheck[3] ); return false; }; e[5] = document.getElementById('ELM_AUTOMARKL3'); e[5].style.width = "15%"; e[5].value = ((giA_manualUpdateAutoCheck[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[4] = (giA_manualUpdateAutoCheck[4]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[4]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[4], u, giA_manualUpdateAutoCheck[4] ); return false; }; e[5] = document.getElementById('ELM_AUTOMARKR3'); e[5].style.width = "15%"; e[5].value = ((giA_manualUpdateAutoCheck[5]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_manualUpdateAutoCheck[5] = (giA_manualUpdateAutoCheck[5]==1)?0:1; e.target.value = ((giA_manualUpdateAutoCheck[5]==1)?"ON":"OFF"); saveSetting( AUTOMARK_HEADER[5], u, giA_manualUpdateAutoCheck[5] ); return false; }; } if( gi_dispMode == MODE_NOTI ){ //クリックで通知クリアする e[1] = document.getElementById('ELM_CLRNEWTWL1'); e[1].style.width = "15%"; e[1].value = ((giA_clearNewNotification[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[0] = (giA_clearNewNotification[0]==1)?0:1; e.target.value = ((giA_clearNewNotification[0]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[0], u, giA_clearNewNotification[0] ); return false; }; e[2] = document.getElementById('ELM_CLRNEWTWR1'); e[2].style.width = "15%"; e[2].value = ((giA_clearNewNotification[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[1] = (giA_clearNewNotification[1]==1)?0:1; e.target.value = ((giA_clearNewNotification[1]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[1], u, giA_clearNewNotification[1] ); return false; }; e[3] = document.getElementById('ELM_CLRNEWTWL2'); e[3].style.width = "15%"; e[3].value = ((giA_clearNewNotification[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[2] = (giA_clearNewNotification[2]==1)?0:1; e.target.value = ((giA_clearNewNotification[2]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[2], u, giA_clearNewNotification[2] ); return false; }; e[4] = document.getElementById('ELM_CLRNEWTWR2'); e[4].style.width = "15%"; e[4].value = ((giA_clearNewNotification[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[3] = (giA_clearNewNotification[3]==1)?0:1; e.target.value = ((giA_clearNewNotification[3]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[3], u, giA_clearNewNotification[3] ); return false; }; e[5] = document.getElementById('ELM_CLRNEWTWL3'); e[5].style.width = "15%"; e[5].value = ((giA_clearNewNotification[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[4] = (giA_clearNewNotification[4]==1)?0:1; e.target.value = ((giA_clearNewNotification[4]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[4], u, giA_clearNewNotification[4] ); return false; }; e[6] = document.getElementById('ELM_CLRNEWTWR3'); e[6].style.width = "15%"; e[6].value = ((giA_clearNewNotification[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_clearNewNotification[5] = (giA_clearNewNotification[5]==1)?0:1; e.target.value = ((giA_clearNewNotification[5]==1)?"ON":"OFF"); saveSetting( CLRNEWTW_HEADER[5], u, giA_clearNewNotification[5] ); return false; }; } if( gi_dispMode != MODE_NOTI ){ //クリックで手動更新トリガする e[1] = document.getElementById('ELM_MANTRIGL1'); e[1].style.width = "15%"; e[1].value = ((giA_manualUpdateTrigger[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[0] = (giA_manualUpdateTrigger[0]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[0]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[0], u, giA_manualUpdateTrigger[0] ); return false; }; e[2] = document.getElementById('ELM_MANTRIGR1'); e[2].style.width = "15%"; e[2].value = ((giA_manualUpdateTrigger[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[1] = (giA_manualUpdateTrigger[1]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[1]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[1], u, giA_manualUpdateTrigger[1] ); return false; }; e[3] = document.getElementById('ELM_MANTRIGL2'); e[3].style.width = "15%"; e[3].value = ((giA_manualUpdateTrigger[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[2] = (giA_manualUpdateTrigger[2]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[2]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[2], u, giA_manualUpdateTrigger[2] ); return false; }; e[4] = document.getElementById('ELM_MANTRIGR2'); e[4].style.width = "15%"; e[4].value = ((giA_manualUpdateTrigger[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[3] = (giA_manualUpdateTrigger[3]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[3]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[3], u, giA_manualUpdateTrigger[3] ); return false; }; e[5] = document.getElementById('ELM_MANTRIGL3'); e[5].style.width = "15%"; e[5].value = ((giA_manualUpdateTrigger[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[4] = (giA_manualUpdateTrigger[4]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[4]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[4], u, giA_manualUpdateTrigger[4] ); return false; }; e[6] = document.getElementById('ELM_MANTRIGR3'); e[6].style.width = "15%"; e[6].value = ((giA_manualUpdateTrigger[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_manualUpdateTrigger[5] = (giA_manualUpdateTrigger[5]==1)?0:1; e.target.value = ((giA_manualUpdateTrigger[5]==1)?"ON":"OFF"); saveSetting( MANTRIG_HEADER[5], u, giA_manualUpdateTrigger[5] ); return false; }; //手動更新トリガ時に新着の積み上げを行う e[1] = document.getElementById('ELM_CONTNEWL1'); e[1].style.width = "15%"; e[1].value = ((giA_updateContinuousButton[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[0] = (giA_updateContinuousButton[0]==1)?0:1; e.target.value = ((giA_updateContinuousButton[0]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[0], u, giA_updateContinuousButton[0] ); return false; }; e[2] = document.getElementById('ELM_CONTNEWR1'); e[2].style.width = "15%"; e[2].value = ((giA_updateContinuousButton[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[1] = (giA_updateContinuousButton[1]==1)?0:1; e.target.value = ((giA_updateContinuousButton[1]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[1], u, giA_updateContinuousButton[1] ); return false; }; e[3] = document.getElementById('ELM_CONTNEWL2'); e[3].style.width = "15%"; e[3].value = ((giA_updateContinuousButton[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[2] = (giA_updateContinuousButton[2]==1)?0:1; e.target.value = ((giA_updateContinuousButton[2]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[2], u, giA_updateContinuousButton[2] ); return false; }; e[4] = document.getElementById('ELM_CONTNEWR2'); e[4].style.width = "15%"; e[4].value = ((giA_updateContinuousButton[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[3] = (giA_updateContinuousButton[3]==1)?0:1; e.target.value = ((giA_updateContinuousButton[3]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[3], u, giA_updateContinuousButton[3] ); return false; }; e[5] = document.getElementById('ELM_CONTNEWL3'); e[5].style.width = "15%"; e[5].value = ((giA_updateContinuousButton[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[4] = (giA_updateContinuousButton[4]==1)?0:1; e.target.value = ((giA_updateContinuousButton[4]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[4], u, giA_updateContinuousButton[4] ); return false; }; e[6] = document.getElementById('ELM_CONTNEWR3'); e[6].style.width = "15%"; e[6].value = ((giA_updateContinuousButton[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_updateContinuousButton[5] = (giA_updateContinuousButton[5]==1)?0:1; e.target.value = ((giA_updateContinuousButton[5]==1)?"ON":"OFF"); saveSetting( CONTNEW_HEADER[5], u, giA_updateContinuousButton[5] ); return false; }; //既読マークの捜索モードに入る e[1] = document.getElementById('ELM_FINDMODEL1'); e[1].style.width = "15%"; e[1].value = ((giA_findReadPointButton[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[0] = (giA_findReadPointButton[0]==1)?0:1; e.target.value = ((giA_findReadPointButton[0]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[0], u, giA_findReadPointButton[0] ); return false; }; e[2] = document.getElementById('ELM_FINDMODER1'); e[2].style.width = "15%"; e[2].value = ((giA_findReadPointButton[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[1] = (giA_findReadPointButton[1]==1)?0:1; e.target.value = ((giA_findReadPointButton[1]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[1], u, giA_findReadPointButton[1] ); return false; }; e[3] = document.getElementById('ELM_FINDMODEL2'); e[3].style.width = "15%"; e[3].value = ((giA_findReadPointButton[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[2] = (giA_findReadPointButton[2]==1)?0:1; e.target.value = ((giA_findReadPointButton[2]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[2], u, giA_findReadPointButton[2] ); return false; }; e[4] = document.getElementById('ELM_FINDMODER2'); e[4].style.width = "15%"; e[4].value = ((giA_findReadPointButton[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[3] = (giA_findReadPointButton[3]==1)?0:1; e.target.value = ((giA_findReadPointButton[3]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[3], u, giA_findReadPointButton[3] ); return false; }; e[5] = document.getElementById('ELM_FINDMODEL3'); e[5].style.width = "15%"; e[5].value = ((giA_findReadPointButton[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[4] = (giA_findReadPointButton[4]==1)?0:1; e.target.value = ((giA_findReadPointButton[4]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[4], u, giA_findReadPointButton[4] ); return false; }; e[6] = document.getElementById('ELM_FINDMODER3'); e[6].style.width = "15%"; e[6].value = ((giA_findReadPointButton[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_findReadPointButton[5] = (giA_findReadPointButton[5]==1)?0:1; e.target.value = ((giA_findReadPointButton[5]==1)?"ON":"OFF"); saveSetting( FINDMODE_HEADER[5], u, giA_findReadPointButton[5] ); return false; }; //次回のスクロール最上部で既読マークを行う e[1] = document.getElementById('ELM_SCRTOPMKL1'); e[1].style.width = "15%"; e[1].value = ((giA_scrTopMarkButton[0]==1)?"ON":"OFF"); e[1].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[0] = (giA_scrTopMarkButton[0]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[0]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[0], u, giA_scrTopMarkButton[0] ); return false; }; e[2] = document.getElementById('ELM_SCRTOPMKR1'); e[2].style.width = "15%"; e[2].value = ((giA_scrTopMarkButton[1]==1)?"ON":"OFF"); e[2].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[1] = (giA_scrTopMarkButton[1]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[1]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[1], u, giA_scrTopMarkButton[1] ); return false; }; e[3] = document.getElementById('ELM_SCRTOPMKL2'); e[3].style.width = "15%"; e[3].value = ((giA_scrTopMarkButton[2]==1)?"ON":"OFF"); e[3].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[2] = (giA_scrTopMarkButton[2]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[2]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[2], u, giA_scrTopMarkButton[2] ); return false; }; e[4] = document.getElementById('ELM_SCRTOPMKR2'); e[4].style.width = "15%"; e[4].value = ((giA_scrTopMarkButton[3]==1)?"ON":"OFF"); e[4].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[3] = (giA_scrTopMarkButton[3]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[3]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[3], u, giA_scrTopMarkButton[3] ); return false; }; e[5] = document.getElementById('ELM_SCRTOPMKL3'); e[5].style.width = "15%"; e[5].value = ((giA_scrTopMarkButton[4]==1)?"ON":"OFF"); e[5].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[4] = (giA_scrTopMarkButton[4]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[4]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[4], u, giA_scrTopMarkButton[4] ); return false; }; e[6] = document.getElementById('ELM_SCRTOPMKR3'); e[6].style.width = "15%"; e[6].value = ((giA_scrTopMarkButton[5]==1)?"ON":"OFF"); e[6].onclick = function(e){ e.stopPropagation(); giA_scrTopMarkButton[5] = (giA_scrTopMarkButton[5]==1)?0:1; e.target.value = ((giA_scrTopMarkButton[5]==1)?"ON":"OFF"); saveSetting( SCRTOPMK_HEADER[5], u, giA_scrTopMarkButton[5] ); return false; }; //手動更新時に新着を上に積む動作でポップアップ表示する e[0] = document.getElementById('ELM_CONTPOPUP'); e[0].style.width = "95%"; e[0].value = ((gi_updateContinuousDispPopup==0)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_updateContinuousDispPopup = (gi_updateContinuousDispPopup==1)?0:1; e.target.value = ((gi_updateContinuousDispPopup==0)?"OFF":"ON"); saveSetting( CONTPOPUP_HEADER, u, gi_updateContinuousDispPopup ); return false; }; //既読捜索モードでポップアップ表示する e[0] = document.getElementById('ELM_FINDPOPUP'); e[0].style.width = "95%"; e[0].value = ((gi_findModeDispPopup==0)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_findModeDispPopup = (gi_findModeDispPopup==1)?0:1; e.target.value = ((gi_findModeDispPopup==0)?"OFF":"ON"); saveSetting( FINDPOPUP_HEADER, u, gi_findModeDispPopup ); return false; }; //スクロールを先頭に戻すモードでポップアップ表示する e[0] = document.getElementById('ELM_SCRTOTOPPOPUP'); e[0].style.width = "95%"; e[0].value = ((gi_scrToTopModeDispPopup==0)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_scrToTopModeDispPopup = (gi_scrToTopModeDispPopup==1)?0:1; e.target.value = ((gi_scrToTopModeDispPopup==0)?"OFF":"ON"); saveSetting( SCRTOPMKPOPUP_HEADER, u, gi_scrToTopModeDispPopup ); return false; }; //スクロール先頭で既読マークモードでポップアップ表示する e[0] = document.getElementById('ELM_SCRTOPMKPOPUP'); e[0].style.width = "95%"; e[0].value = ((gi_scrTopMarkModeDispPopup==0)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_scrTopMarkModeDispPopup = (gi_scrTopMarkModeDispPopup==1)?0:1; e.target.value = ((gi_scrTopMarkModeDispPopup==0)?"OFF":"ON"); saveSetting( SCRTOPMKPOPUP_HEADER, u, gi_scrTopMarkModeDispPopup ); return false; }; //新着を上に積む動作時の遷移待機時間 e[0] = document.getElementById('ELM_CONTDLY'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_updateContimuousDelayTimeMs; e[1] = document.getElementById('ELM_CONTDLY_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_CONTDLY',100,3000,u ); return false;}; e[2] = document.getElementById('ELM_CONTDLY_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_CONTDLY',100,3000,u ); return false;}; //新着を上に積む動作時の遷移先からの戻り待機時間 e[0] = document.getElementById('ELM_CONTRET'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_updateContinuousReturnTimeMs; e[1] = document.getElementById('ELM_CONTRET_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_CONTRET',100,10000,u ); return false;}; e[2] = document.getElementById('ELM_CONTRET_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_CONTRET',100,10000,u ); return false;}; //既読マーク捜索モードでスクロール毎の待機時間 e[0] = document.getElementById('ELM_FINDINTVAL'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_findModeIntervalMs; e[1] = document.getElementById('ELM_FINDINTVAL_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_FINDINTVAL',10,10000,u ); return false;}; e[2] = document.getElementById('ELM_FINDINTVAL_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_FINDINTVAL',10,10000,u ); return false;}; } if( gi_dispMode == MODE_HOME ){ //ツイート欄の表示 e[0] = document.getElementById('ELM_DISP_EDIT'); e[0].style.width = "95%"; e[0].value = ((gi_hideEditControl==1)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_hideEditControl = (gi_hideEditControl==1)?0:1; e.target.value = ((gi_hideEditControl==1)?"OFF":"ON"); swichEditColumn(); return false; }; //新着件数の表示 e[0] = document.getElementById('ELM_DISP_NEW_TWEET'); e[0].style.width = "95%"; e[0].value = ((gi_hideNumberNewTweet==1)?"OFF":"ON"); e[0].onclick = function(e){ e.stopPropagation(); gi_hideNumberNewTweet = (gi_hideNumberNewTweet==1)?0:1; e.target.value = ((gi_hideNumberNewTweet==1)?"OFF":"ON"); swichDispNumberNewTweet(true); return false; }; } if( gi_dispMode != MODE_NOTI && gi_enableReadPointCheckBox ){ //既読マーク背景色切り替え e[0] = document.getElementById('ELM_BGCOLOR_TYPE'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_readCheckedColorMode + 1; e[1] = document.getElementById('ELM_BGCOLOR_TYPE_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_BGCOLOR_TYPE',0,READ_COLOR_CYCLE,u ); return false;}; e[2] = document.getElementById('ELM_BGCOLOR_TYPE_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_BGCOLOR_TYPE',0,READ_COLOR_CYCLE,u ); return false;}; } //タイマのリセット(実行のみで何もローカルに保存とかは無し) e[0] = document.getElementById('ELM_RESET_DOM_TIME'); e[0].style.width = "95%"; e[0].value = "RESET"; e[0].onclick = function(e){ e.stopPropagation(); resetDomTime(); return false; }; //このページの設定の削除 e[0] = document.getElementById('ELM_PAGESETTING_CLEAR'); e[0].style.fontSize = "10px"; e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); deletePageSetting(); return false;}; //設定画面を閉じる e[0] = document.getElementById('ELM_CLOSE'); e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); closeSettingWindow(false); return false;}; } } //システム設定コンフィグのためのエレメントを生成してオーバーレイ表示する(変更後リロードが必要な項目) function dispSystemSettingMessage(){ closePopupToolTips(); var e0, e1, e2, e = []; var nowObj, nowTime, endTime; var HTML = ""; gb_changedSetting = false; HTML += CRLF + "

"; HTML += CRLF + "PseudoTweetDeck Ver[" + VERSION_INFO + "]
"; HTML += CRLF + "System Config Setting
"; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + " "; HTML += CRLF + ""; HTML += CRLF + "
設定項目設定範囲/選択肢設定値
テーマカラーDARK:ダーク/ブラック
LIGHT:ライトテーマ
短周期タイマ間隔50〜1000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
短周期タイマを停止する経過時間5〜60(sec)"; HTML += CRLF + " "; HTML += CRLF + "
起動待ち合わせ時間1〜30(sec)"; HTML += CRLF + " "; HTML += CRLF + "
スクロールを最上部に戻してからトリガまでの時間0〜30(sec)
※無効時は0に設定
"; HTML += CRLF + " "; HTML += CRLF + "
強制リロード開始までのラグ時間100〜5000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
強制リロード禁止時間10〜300(sec)"; HTML += CRLF + " "; HTML += CRLF + "
ポップアップ表示時間0〜30(sec)
※無効時は0に設定
"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部+ボタン不透明度0〜100(%)
透明〜不透明
"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部+ボタン枠幅100〜200(px)"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部+ボタン枠高10〜30(px)"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部テキストフォントサイズ8〜24(px)"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部ボタンフォントサイズ8〜24(px)"; HTML += CRLF + " "; HTML += CRLF + "
タイムスタンプの置換ON:絶対時間に置換
OFF:相対時間のまま
新着表示を自動でクリックするON:クリックする
OFF:クリックしない
更新直後に新着表示を自動でクリックするON:クリックする
OFF:クリックしない
DOM時間を自動更新OFFでも表示するON:表示する
OFF:表示しない
フォーカスのあるタブでもカウントダウンを非表示にするON:非表示にする
OFF:表示する
同一の記事を並べないHIDE:重複は非表示
DISP:重複でも表示する
画像サムネイル左クリックで別タブに表示ON:表示する
OFF:表示しない
画像表示時まず原寸で試すON:原寸で試し次に大サイズで開く
OFF:常に大サイズで開く
情報表示部とボタンのヘルプToolTips表示ON:表示する
OFF:表示しない
既読ポイントを表示ON:表示する
OFF:表示しない
既読チェックボックス有効時の不透明度0〜100(%)
透明〜不透明
"; HTML += CRLF + " "; HTML += CRLF + "
既読チェックボックス無効時の不透明度0〜100(%)
透明〜不透明
"; HTML += CRLF + " "; HTML += CRLF + "
既読ポイント数4〜100"; HTML += CRLF + " "; HTML += CRLF + "
既読ポイント背景の繰り返しパターンTOP:パターン以降先頭要素で繰り返し
ALL:パターン全体を繰り返す
検索ページで更新が掛からない環境でトリガ時CSSを無効にするON:無効にする
OFF:無効にしない
検索ページで更新が掛からない環境でトリガ時CSSを無効にする追加待ち時間0〜5000"; HTML += CRLF + " "; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + "

" + PSEUDO_URL + "
"; HTML += CRLF + "

"; HTML += CRLF + "※システムコンフィグの設定項目は全タブ共通なので変更後は全てリロードして下さい"; HTML += CRLF + "
"; HTML += CRLF + ""; if(DEBUG_MODE){ HTML += CRLF + ""; }else{ HTML += CRLF + ""; } HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + "
"; //コンフィグ画面を構築 e0 = document.querySelectorAll('div[id="react-root"]'); if( e0.length > 0 ){ //設定起動中のフラグを立てる(強制リロードの回避) gb_enableSettingWindow = true; //背景エレメント e1 = document.createElement("div"); e1.setAttribute("id",SETTING_BLOCK); e1.style.display = "block"; e1.style.position = "absolute"; e1.style.height = "100%"; e1.style.width = "100%"; e1.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e1.style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e1.style.zIndex = "999"; e1.style.position = "fixed"; e1.onclick = function(e){e.stopPropagation(); return false;}; e1.onkeydown = function(e){e.stopPropagation(); return false;}; e1.onkeyup = function(e){e.stopPropagation(); return false;}; e1.onkeypress = function(e){e.stopPropagation(); return false;}; e1.onchange = function(e){e.stopPropagation(); return false;}; e2 = document.createElement("div"); e2.style.display = "flex"; e2.style.position = "relative"; e2.style.height = "100%"; e2.style.width = "100%"; e2.style.justifyContent = "center"; e2.style.overflow = "scroll"; e2.insertAdjacentHTML("beforeend", HTML); e1.appendChild(e2); e0[0].appendChild(e1); //テーブルエレメント e[0] = document.getElementById('ELM_MAIN_TABLE'); e[0].style.minWidth = DIALOG_MIN_WIDTH; e[0].style.maxWidth = DIALOG_MAX_WIDTH; e[1] = document.getElementById('ELM_INNER_TABLE'); e[1].style.fontSize = DIALOG_FONT_SIZE; //カラーモード e[0] = document.getElementById('ELM_COLORMODE'); e[0].style.width = "95%"; e[0].value = ((COLOR_MODE==1)?"DARK":"LIGHT"); e[0].onclick = function(e){ e.stopPropagation(); COLOR_MODE = (COLOR_MODE==1)?0:1; e.target.value = ((COLOR_MODE==1)?"DARK":"LIGHT"); saveSetting( COLORMODE_HEADER, KEY_SYSTEM, COLOR_MODE ); gb_changedSetting = true; return false; }; //短周期タイマインターバル e[0] = document.getElementById('ELM_SHORT_INTVL'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_shortIntervalMs; e[1] = document.getElementById('ELM_SHORT_INTVL_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_SHORT_INTVL',50,1000,null ); return false;}; e[2] = document.getElementById('ELM_SHORT_INTVL_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_SHORT_INTVL',50,1000,null ); return false;}; //短周期タイマ一時停止時間 e[0] = document.getElementById('ELM_SHORT_IDLE_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(gi_shortTimerIdleMs / 1000); e[1] = document.getElementById('ELM_SHORT_IDLE_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_SHORT_IDLE_TIME',5,60,null ); return false;}; e[2] = document.getElementById('ELM_SHORT_IDLE_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_SHORT_IDLE_TIME',5,60,null ); return false;}; //起動待ち合わせ時間 e[0] = document.getElementById('ELM_INIT_WAIT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(gi_initWaitMs / 1000); e[1] = document.getElementById('ELM_INIT_WAIT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_INIT_WAIT',1,30,null ); return false;}; e[2] = document.getElementById('ELM_INIT_WAIT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_INIT_WAIT',1,30,null ); return false;}; //スクロールをトップに戻してからトリガまでの時間 e[0] = document.getElementById('ELM_ONTOP_WAIT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(gi_onTopWaitMs / 1000); e[1] = document.getElementById('ELM_ONTOP_WAIT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_ONTOP_WAIT',0,30,null ); return false;}; e[2] = document.getElementById('ELM_ONTOP_WAIT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_ONTOP_WAIT',0,30,null ); return false;}; //強制リロードまでのラグ時間 e[0] = document.getElementById('ELM_RELOAD_WAIT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_reloadWaitMs; e[1] = document.getElementById('ELM_RELOAD_WAIT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_RELOAD_WAIT',100,5000,null ); return false;}; e[2] = document.getElementById('ELM_RELOAD_WAIT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_RELOAD_WAIT',100,5000,null ); return false;}; //連続リロード禁止時間 e[0] = document.getElementById('ELM_LOCK_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_forceUpdateLockTimeSec; e[1] = document.getElementById('ELM_LOCK_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_LOCK_TIME',10,300,null ); return false;}; e[2] = document.getElementById('ELM_LOCK_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_LOCK_TIME',10,300,null ); return false;}; //ポップアップ表示時間 e[0] = document.getElementById('ELM_POPUP_TIME'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_displayPopupCloseTimeSec; e[1] = document.getElementById('ELM_POPUP_TIME_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_POPUP_TIME',0,30,null ); return false;}; e[2] = document.getElementById('ELM_POPUP_TIME_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_POPUP_TIME',0,30,null ); return false;}; //表示部+ボタンの不透明度 e[0] = document.getElementById('ELM_DSP_OPACITY'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(gf_dispUnitOpacity * 100); e[1] = document.getElementById('ELM_DSP_OPACITY_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_DSP_OPACITY',0,100,null ); return false;}; e[2] = document.getElementById('ELM_DSP_OPACITY_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_DSP_OPACITY',0,100,null ); return false;}; //表示部+ボタンの幅 e[0] = document.getElementById('ELM_INFOWIDTH'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = (DISPINFO_WIDTH).replace("px",""); e[1] = document.getElementById('ELM_INFOWIDTH_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_INFOWIDTH',100,200,null ); return false;}; e[2] = document.getElementById('ELM_INFOWIDTH_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_INFOWIDTH',100,200,null ); return false;}; //表示部+ボタンの高さ e[0] = document.getElementById('ELM_INFOHEIGHT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = (DISPINFO_HEIGHT).replace("px",""); e[1] = document.getElementById('ELM_INFOHEIGHT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_INFOHEIGHT',10,30,null ); return false;}; e[2] = document.getElementById('ELM_INFOHEIGHT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_INFOHEIGHT',10,30,null ); return false;}; //表示部テキストフォントサイズ e[0] = document.getElementById('ELM_FONTTEXT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = (gstrA_titleSize[0]).replace("px",""); e[1] = document.getElementById('ELM_FONTTEXT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_FONTTEXT',8,24,null ); return false;}; e[2] = document.getElementById('ELM_FONTTEXT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_FONTTEXT',8,24,null ); return false;}; //表示部ボタンフォントサイズ e[0] = document.getElementById('ELM_FONTBTN'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = (gstrA_buttonSize[0]).replace("px",""); e[1] = document.getElementById('ELM_FONTBTN_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_FONTBTN',8,24,null ); return false;}; e[2] = document.getElementById('ELM_FONTBTN_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_FONTBTN',8,24,null ); return false;}; //タイムスタンプ置換 e[0] = document.getElementById('ELM_CHG_TIME_MODE'); e[0].style.width = "95%"; e[0].value = ((gi_replaceTimeStamp==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_replaceTimeStamp = (gi_replaceTimeStamp==1)?0:1; e.target.value = ((gi_replaceTimeStamp==1)?"ON":"OFF"); saveSetting( CHGTIME_HEADER, KEY_SYSTEM, gi_replaceTimeStamp ); gb_changedSetting = true; return false; }; //新着を自動的に押す e[0] = document.getElementById('ELM_CLICK_NEW'); e[0].style.width = "95%"; e[0].value = ((gi_autoClickNewTweet==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_autoClickNewTweet = (gi_autoClickNewTweet==1)?0:1; e.target.value = ((gi_autoClickNewTweet==1)?"ON":"OFF"); saveSetting( CLICKNEW_HEADER, KEY_SYSTEM, gi_autoClickNewTweet ); gb_changedSetting = true; return false; }; //更新直後の新着を自動的に押す e[0] = document.getElementById('ELM_MANCLICK_NEW'); e[0].style.width = "95%"; e[0].value = ((gi_manualUpdateTriggerNewTweet==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_manualUpdateTriggerNewTweet = (gi_manualUpdateTriggerNewTweet==1)?0:1; e.target.value = ((gi_manualUpdateTriggerNewTweet==1)?"ON":"OFF"); saveSetting( MANTRIGNEW_HEADER, KEY_SYSTEM, gi_manualUpdateTriggerNewTweet ); gb_changedSetting = true; return false; }; //DOM時間を自動更新OFFでも表示する e[0] = document.getElementById('ELM_ENABLE_DOM'); e[0].style.width = "95%"; e[0].value = ((gi_enableDomTimeAutoOff==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_enableDomTimeAutoOff = (gi_enableDomTimeAutoOff==1)?0:1; e.target.value = ((gi_enableDomTimeAutoOff==1)?"ON":"OFF"); saveSetting( ENDOMTIME_HEADER, KEY_SYSTEM, gi_enableDomTimeAutoOff ); gb_changedSetting = true; return false; }; //カウントダウンを非表示にする e[0] = document.getElementById('ELM_NOCOUNTDOWN'); e[0].style.width = "95%"; e[0].value = ((gi_noCountDownDisp==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_noCountDownDisp = (gi_noCountDownDisp==1)?0:1; e.target.value = ((gi_noCountDownDisp==1)?"ON":"OFF"); saveSetting( NOCOUNTDN_HEADER, KEY_SYSTEM, gi_noCountDownDisp ); gb_changedSetting = true; return false; }; //同一のRT記事を表示しない e[0] = document.getElementById('ELM_NODISP_SAME'); e[0].style.width = "95%"; e[0].value = ((gi_notDispSameArticle==1)?"HIDE":"DISP"); e[0].onclick = function(e){ e.stopPropagation(); gi_notDispSameArticle = (gi_notDispSameArticle==1)?0:1; e.target.value = ((gi_notDispSameArticle==1)?"HIDE":"DISP"); saveSetting( NODISPSAME_HEADER, KEY_SYSTEM, gi_notDispSameArticle ); gb_changedSetting = true; return false; }; //画像サムネイル左クリックで別タブに表示する e[0] = document.getElementById('ELM_IMAGE_NEWTAB'); e[0].style.width = "95%"; e[0].value = ((gi_displayImageNewTab==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_displayImageNewTab = (gi_displayImageNewTab==1)?0:1; e.target.value = ((gi_displayImageNewTab==1)?"ON":"OFF"); saveSetting( IMAGENEW_HEADER, KEY_SYSTEM, gi_displayImageNewTab ); gb_changedSetting = true; return false; }; //画像サムネイル左クリックで別タブに表示する時origで試す e[0] = document.getElementById('ELM_IMAGE_TRYORG'); e[0].style.width = "95%"; e[0].value = ((gi_displayImageTryOrig==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_displayImageTryOrig = (gi_displayImageTryOrig==1)?0:1; e.target.value = ((gi_displayImageTryOrig==1)?"ON":"OFF"); saveSetting( IMAGEORG_HEADER, KEY_SYSTEM, gi_displayImageTryOrig ); gb_changedSetting = true; return false; }; //情報表示部ボタンのヘルプToolTipsを表示する e[0] = document.getElementById('ELM_HELP_POPUP'); e[0].style.width = "95%"; e[0].value = ((gi_dispToolTipsPopup==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_dispToolTipsPopup = (gi_dispToolTipsPopup==1)?0:1; e.target.value = ((gi_dispToolTipsPopup==1)?"ON":"OFF"); saveSetting( HELPPOPUP_HEADER, KEY_SYSTEM, gi_dispToolTipsPopup ); gb_changedSetting = true; return false; }; //既読マークのチェックボックスを出すか e[0] = document.getElementById('ELM_READ_CHECK'); e[0].style.width = "95%"; e[0].value = ((gi_enableReadPointCheckBox==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_enableReadPointCheckBox = (gi_enableReadPointCheckBox==1)?0:1; e.target.value = ((gi_enableReadPointCheckBox==1)?"ON":"OFF"); saveSetting( READCHK_HEADER, KEY_SYSTEM, gi_enableReadPointCheckBox ); gb_changedSetting = true; return false; }; //既読マークチェックボックス有効時の不透明度 e[0] = document.getElementById('ELM_CHKEN_OPACITY'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(CHECKBOX_ENABLE_OPACITY * 100); e[1] = document.getElementById('ELM_CHKEN_OPACITY_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_CHKEN_OPACITY',0,100,null ); return false;}; e[2] = document.getElementById('ELM_CHKEN_OPACITY_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_CHKEN_OPACITY',0,100,null ); return false;}; //既読マークチェックボックス無効時の不透明度 e[0] = document.getElementById('ELM_CHKDI_OPACITY'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = Math.floor(CHECKBOX_DISABLE_OPACITY * 100); e[1] = document.getElementById('ELM_CHKDI_OPACITY_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_CHKDI_OPACITY',0,100,null ); return false;}; e[2] = document.getElementById('ELM_CHKDI_OPACITY_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_CHKDI_OPACITY',0,100,null ); return false;}; //既読ポイント数 e[0] = document.getElementById('ELM_READ_COUNT'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_readArticles; e[1] = document.getElementById('ELM_READ_COUNT_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_READ_COUNT',4,100,null ); return false;}; e[2] = document.getElementById('ELM_READ_COUNT_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_READ_COUNT',4,100,null ); return false;}; //既読マークの背景の繰り返しパターン e[0] = document.getElementById('ELM_BGCYCLE'); e[0].style.width = "95%"; e[0].value = ((READ_COLOR_CYCLEMODE==1)?"ALL":"TOP"); e[0].onclick = function(e){ e.stopPropagation(); READ_COLOR_CYCLEMODE = (READ_COLOR_CYCLEMODE==1)?0:1; e.target.value = ((READ_COLOR_CYCLEMODE==1)?"ALL":"TOP"); saveSetting( BGCYCLE_HEADER, KEY_SYSTEM, READ_COLOR_CYCLEMODE ); gb_changedSetting = true; return false; }; //検索ページで更新トリガが掛からない環境の時トリガ時だけCSSを無効にする e[0] = document.getElementById('ELM_SEACSS'); e[0].style.width = "95%"; e[0].value = ((gi_disableCssOnSearchUpdate==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_disableCssOnSearchUpdate = (gi_disableCssOnSearchUpdate==1)?0:1; e.target.value = ((gi_disableCssOnSearchUpdate==1)?"ON":"OFF"); saveSetting( SEACSS_HEADER, KEY_SYSTEM, gi_disableCssOnSearchUpdate ); gb_changedSetting = true; return false; }; //検索ページで更新トリガが掛からない環境の時トリガ時だけCSSを無効にする追加待ち時間 e[0] = document.getElementById('ELM_SEACSSW'); e[0].style.width = "50%"; e[0].style.pointerEvents = "none"; e[0].value = gi_disableCssSearchWaitMs; e[1] = document.getElementById('ELM_SEACSSW_VALUP'); e[1].style.width = "20%"; e[1].onclick = function(e){e.stopPropagation(); valueUpButton('ELM_SEACSSW',0,5000,null ); return false;}; e[2] = document.getElementById('ELM_SEACSSW_VALDN'); e[2].style.width = "20%"; e[2].onclick = function(e){e.stopPropagation(); valueDnButton('ELM_SEACSSW',0,5000,null ); return false;}; //全保存データの削除 e[0] = document.getElementById('ELM_ALL_CLEAR'); e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); deleteAllData(); return false;}; //各ページ保存データの削除 e[0] = document.getElementById('ELM_URLS_CLEAR'); e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); deleteAllPageSetting(); return false;}; //既読ポイントの削除 e[0] = document.getElementById('ELM_READ_CLEAR'); e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); deleteReadPointData(); return false;}; //デバッグ表示 e[0] = document.getElementById('ELM_DEBUG'); e[0].style.width = "128px"; e[0].onclick = function(e){ e.stopPropagation(); if( DEBUG_MODE ){ e.target.value = "DEBUG ON"; }else{ e.target.value = "DEBUG OFF"; } debugSetting(); return false; }; //設定画面を閉じる e[0] = document.getElementById('ELM_CLOSE'); e[0].style.width = "128px"; e[0].onclick = function(e){e.stopPropagation(); closeSettingWindow(true); return false;}; } } /************************************************************ コンフィグ・システムコンフィグ操作関連関数 ************************************************************/ //コンフィグ数値増減テーブル const VALUES0 = [0,10,20,30,40,50,60,70,80,90,100,200,300,400,500,700,1000,1200,1500,1800,2000,2500,3000,3500,4000,4500,5000,5500,6000,6500,7000,7500,8000,8500,9000,9500,10000,11000,12000,13000,14000,15000]; const VALUES1 = [0,5,10,15,20,25,30,35,40,45,50,55,60,70,80,90,100,120,150,180,200,250,280,300,350,400,450,500,600,700,800,900,1000,1200,1500,1800,2000,2400,3000,3600,4200,4800,5600,6400,7200]; const VALUES2 = [0,5,10,15,20,25,30,35,40,45,50,55,60,70,80,90,100,120,150,180,200,250,300,350,400,450,500,600,700,800,900,1000,1200,1500,1800,2000,2400,3000,3600,4000,4500,4800,5000]; const VALUES3 = [0,50,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,270,300,350,400,450,500,600,700,800,900,1000]; const VALUES4 = [0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,130,140,150,160,170,180,190,200,250,300,350,400,4500,500]; const VALUES5 = [0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,130,140,150,160,170,180,190,200,210,220,230,240,250]; const VALUES6 = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,25,27,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100]; const VALUESP = [0,10,20,30,40,50,60,70,80,90,100];//OPACITY用10ステップ const VALUESW = [100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150, 152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200];//表示部横幅用2ステップ const VALUESF = [8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32];//フォントサイズ用1ステップ const VALUESD = [100,125,150,175,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000,1200,1500,1800,2000,2400,3000];//遷移用遅延時間ステップ var VALUES = []; //数値増減テーブルの選択 function selectValueTable(min,max){ //min: 設定最小値 //max: 設定最大値 if( min == 0 && max == 100 ) VALUES = VALUESP;//OPACITY用10ステップ else if( min == 100 && max == 200 ) VALUES = VALUESW;//表示部横幅用2ステップ else if( min == 100 && max == 3000 ) VALUES = VALUESD;//遷移用遅延時間ステップ else if( min <= 12 && min >=8 && max <= 32 ) VALUES = VALUESF;//フォントサイズ用1ステップ else if( max > VALUES1[VALUES1.length-1] ) VALUES = VALUES0; else if( max > VALUES2[VALUES2.length-1] ) VALUES = VALUES1; else if( max > VALUES3[VALUES3.length-1] ) VALUES = VALUES2; else if( max > VALUES4[VALUES4.length-1] ) VALUES = VALUES3; else if( max > VALUES5[VALUES5.length-1] ) VALUES = VALUES4; else if( max > VALUES6[VALUES6.length-1] ) VALUES = VALUES5; else VALUES = VALUES6; } //コンフィグの増ボタン共通処理 function valueUpButton(tgt, min, max, u){ //tgt: 対象となるエレメントID //min: 設定可能な最小値 //max: 設定可能な最大値 //u: 設定対象のURL/PATH selectValueTable(min,max); var e1 = document.getElementById(tgt); var val = Number(e1.value); if( val < min ) val = min; if( val > max ) val = max; for( var i=0; i max ) val = max; e1.value = val; saveSettingValueFromUpDn(tgt, u, val); break; } } } //コンフィグの減ボタン共通処理 function valueDnButton(tgt, min, max, u){ //tgt: 対象となるエレメントID //min: 設定可能な最小値 //max: 設定可能な最大値 //u: 設定対象のURL/PATH selectValueTable(min,max); var e1 = document.getElementById(tgt); var val = Number(e1.value); if( val < min ) val = min; if( val > max ) val = max; for( var i=VALUES.length; i>0; i-- ){ if( VALUES[i-1] < val && val <= VALUES[i] ){ val = VALUES[i-1]; if( val < min ) val = min; e1.value = val; saveSettingValueFromUpDn(tgt, u, val); break; } } } //増減ボタンで変更した値の格納・記憶 function saveSettingValueFromUpDn(tgt, u, val){ //tgt: 対象となるエレメントID //u: 設定対象のURL/PATH //val: 設定値 var i; switch(tgt){ case "ELM_INTERVAL_TIME": giA_updateIntervalMs[gi_dispMode] = val * 1000; saveSetting( INTERVAL_HEADER, u, val ); //インターバルが変更されたのでカウンタリセット gdt_lastDomTime = gdt_lastTriggerTime = new Date(); gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); gi_updateCountMs = giA_updateIntervalMs[gi_dispMode] - 1000; break; case "ELM_FORCE_TIME": gi_reloadTimeoutSec = val; saveSetting( RELOAD_HEADER, u, val ); break; case "ELM_HOLD_TIME": gi_manualUpdateIntervalSec = val; saveSetting( MANUAL_HEADER, u, val ); break; case "ELM_MEDIA_SIZE": gi_mediaSize = val; updateMediaAttribute(); break; case "ELM_HIDE_RT": gi_notDispRt = val; updateMediaAttribute(); break; case "ELM_BGCOLOR_TYPE": //既読マーク背景の定義は -1, 0, 1,... なのでインデックスを1つずらす gi_readCheckedColorMode = val - 1; rclickReadPoint(false,true); break; case "ELM_READ_COUNT": gi_readArticles = val; saveSetting( READCOUNT_HEADER, KEY_SYSTEM, val ); break; case "ELM_SHORT_INTVL": gi_shortIntervalMs = val; saveSetting( SHORTINTVL_HEADER, KEY_SYSTEM, val ); break; case "ELM_SHORT_IDLE_TIME": //短周期タイマを一時停止させる設定は秒で編集するのでミリ秒に戻す gi_shortTimerIdleMs = val * 1000; saveSetting( IDLESHORT_HEADER, KEY_SYSTEM, (val * 1000) ); break; case "ELM_INIT_WAIT": //起動時待ち合わせ時間は秒で編集するのでミリ秒に戻す gi_initWaitMs = val * 1000; saveSetting( INITWAIT_HEADER, KEY_SYSTEM, (val * 1000) ); break; case "ELM_ONTOP_WAIT": //スクロールをトップに戻したあとのトリガまでの時間は秒で編集するのでミリ秒に戻す gi_onTopWaitMs = val * 1000; saveSetting( ONTOPWAIT_HEADER, KEY_SYSTEM, (val * 1000) ); break; case "ELM_RELOAD_WAIT": gi_reloadWaitMs = val; saveSetting( RELOADWAIT_HEADER, KEY_SYSTEM, val ); break; case "ELM_LOCK_TIME": gi_forceUpdateLockTimeSec = val; saveSetting( LOCKTIME_HEADER, KEY_SYSTEM, val ); break; case "ELM_POPUP_TIME": gi_displayPopupCloseTimeSec = val; saveSetting( POPUPTIME_HEADER, KEY_SYSTEM, val ); break; case "ELM_DSP_OPACITY": gf_dispUnitOpacity = Number(val) / 100.0; //opacity0.0〜1.0を0〜100で設定しているので小数に戻す saveSetting( HDOPACITY_HEADER, KEY_SYSTEM, (Number(val)/100.0) ); break; case "ELM_CHKEN_OPACITY": CHECKBOX_ENABLE_OPACITY = Number(val) / 100.0; //opacity0.0〜1.0を0〜100で設定しているので小数に戻す saveSetting( CHKENAOP_HEADER, KEY_SYSTEM, (Number(val)/100.0) ); break; case "ELM_CHKDI_OPACITY": //opacity0.0〜1.0を0〜100で設定しているので小数に戻す CHECKBOX_DISABLE_OPACITY = Number(val) / 100.0; saveSetting( CHKDISOP_HEADER, KEY_SYSTEM, (Number(val)/100.0) ); break; case "ELM_INFOWIDTH": DISPINFO_WIDTH = val + "px"; saveSetting( INFOWIDTH_HEADER, KEY_SYSTEM, val + "px" ); break; case "ELM_INFOHEIGHT": DISPINFO_HEIGHT = val + "px"; saveSetting( INFOHEIGHT_HEADER, KEY_SYSTEM, val + "px" ); break; case "ELM_FONTTEXT": for( i=0; i 0 ){ e0[0].remove(); } //設定起動中のフラグを落とす(強制リロードの回避終了) gb_enableSettingWindow = false; if(withReload && gb_changedSetting){ if( window.confirm("  システム設定を保存しました\r\n  リロードしますか?") == false ) return; window.location.reload(); } } /************************************************************ ヘルプ画面表示関連関数 ************************************************************/ //ヘルプ・設定情報表示ウィンドウ表示 function dispInfoDialog(){ closePopupToolTips(); var idx; var aut = (gi_modeAutoOff) ? "ON" : "OFF"; var sht = (gi_idleShortTimer) ? "OFF" : "ON"; var rth = Math.floor(gi_reloadTimeoutSec / 3600); var rtm = Math.floor(gi_reloadTimeoutSec % 3600 / 60); var rts = gi_reloadTimeoutSec % 60; var rtt = ("0" + rth).slice(-2) + ":" + ("0" + rtm).slice(-2) + ":" + ("0" + rts).slice(-2); var reb = (gi_reloadTimeoutSec) ? rtt : "----"; var siz = window.innerWidth + "x" + window.innerHeight; var ntf = (gi_dispMode == MODE_NOTI) ? true : false; var msg = ""; msg += SPC + "------------------------------------"; if(!ntf){ msg += SPC + "自動更新インターバル = " + giA_updateIntervalMs[gi_dispMode] / 1000 + "(sec)"; msg += SPC + "手動更新操作の禁止期間 = " + gi_manualUpdateIntervalSec + "(sec)"; msg += SPC + "自動更新の強制停止モード = " + aut; } msg += SPC + "短周期タイマ常時稼動モード = " + sht; msg += SPC + "DOM更新受信最終時刻 = " + gstr_lastDomTime; msg += SPC + "強制再起動までの待機時間 = " + reb; msg += SPC + "メディアサムネイルの表示 = " + SIZE_NAME[gi_mediaSize]; msg += SPC + "RT&引用RTの表示設定"; msg += SPC + "   = " + NOTRT_NAME[gi_notDispRt]; if( gi_dispMode == MODE_HOME ){ msg += SPC + "上部新着件数の表示設定 = " + ( (gi_hideNumberNewTweet) ? "OFF" : "ON" ); } msg += SPC + "TabSize = " + siz; msg += SPC + "------------------------------------"; msg += SPC + "情報表示欄(左側ボタン)" + BTN_TXT_BTNL; msg += SPC + "  : 左クリック="; if(giA_scrToTopButton[0]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[0]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[0] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[0] && !ntf){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[0] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[0] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[0] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(giA_clearNewNotification[0] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "  : 右クリック="; if(giA_scrToTopButton[1]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[1]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[1] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[1]){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[1] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[1] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[1] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(ntf){ msg += SPC + "      タイマリセット"; } if(giA_clearNewNotification[1] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "------------------------------------"; msg += SPC + "情報表示欄(中央ボタン)" + BTN_TXT_BTNM; msg += SPC + "  : 左クリック="; if(giA_scrToTopButton[2]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[2]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[2] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[2] && !ntf){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[2] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[2] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[2] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(giA_clearNewNotification[2] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "  : 右クリック="; if(giA_scrToTopButton[3]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[3]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[3] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[3]){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[3] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[3] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[3] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(ntf){ msg += SPC + "      タイマリセット"; } if(giA_clearNewNotification[3] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "------------------------------------"; msg += SPC + "情報表示欄(右側ボタン)" + BTN_TXT_BTNR; msg += SPC + "  : 左クリック="; if(giA_scrToTopButton[4]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[4]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[4] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[4] && !ntf){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[4] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[4] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[4] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(giA_clearNewNotification[4] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "  : 右クリック="; if(giA_scrToTopButton[5]){ msg += SPC + "      先頭にスクロール"; } if(giA_restartShortTimer[5]){ msg += SPC + "      短周期処理実施"; } if(giA_manualUpdateAutoCheck[5] && !ntf){ msg += SPC + "      自動既読マーク"; } if(giA_manualUpdateTrigger[5]){ msg += SPC + "      手動更新"; } if( giA_updateContinuousButton[5] && !ntf){ msg += SPC + "      新着積み上げ"; } if( giA_findReadPointButton[5] && !ntf){ msg += SPC + "      既読マーク捜索"; } if( giA_scrTopMarkButton[5] && !ntf){ msg += SPC + "      先頭で既読マーク"; } if(ntf){ msg += SPC + "      タイマリセット"; } if(giA_clearNewNotification[5] && ntf){ msg += SPC + "      新着表示色クリア"; } msg += SPC + "------------------------------------"; msg += SPC + BTN_TXT_HLP + " : 左クリック=ヘルプダイアログの表示"; if(gi_enableReadPointCheckBox && !ntf){ msg += SPC + "  : 右クリック=既読情報ダイアログの表示"; } msg += SPC + BTN_TXT_INT + " : 左クリック=コンフィグ設定"; msg += SPC + "  : 右クリック=システムコンフィグ設定"; msg += SPC + BTN_TXT_SRT + " : 左クリック=短周期処理の単発実行"; msg += SPC + "  : 右クリック=短周期タイマ切り替え"; if(!ntf){ msg += SPC + BTN_TXT_AUT + " : 左クリック=自動更新OFF切り替え"; msg += SPC + "  : 右クリック=タイマ時間をリセットする"; } if( gi_enableReadPointCheckBox ){ if( gi_readCheckedColorMode > -1 ){ msg += SPC + "チェックボックス : ColorType=[" + gi_readCheckedColorMode + "]"; }else{ msg += SPC + "チェックボックス : 非表示"; } msg += SPC + "  : 左クリック=" + gi_readArticles + "件を既読マーク"; msg += SPC + "  : 右クリック=既読マーク背景色切替"; } if( gi_dispMode == MODE_HOME ){ msg += SPC + BTN_TXT_ED0 + "/" + BTN_TXT_ED1; msg += SPC + " : 左クリック=ツイート入力欄表示切り替え"; msg += SPC + " : 右クリック=上部の新着件数表示切り替え"; } msg += SPC + "------------------------------------"; if(!ntf){ msg += SPC + "[COUNT / DOM時刻] , "; } msg += SPC + "[Latest / DOM時刻] :"; if(!ntf){ msg += SPC + "   緑:自動更新トリガ有効"; msg += SPC + "   黄:自動更新トリガ直前"; msg += SPC + "   赤:自動更新トリガ発行中"; if( ! gi_enableDomTimeAutoOff ){ msg += SPC + "[Paused Refresh] :"; }else{ msg += SPC + "[Paused / DOM時刻] :"; } msg += SPC + "   青:自動更新停止中"; }else{ msg += SPC + "   緑:(通知ページは常時自動動作)"; } msg += SPC + "表示内容に依存しない色替 :"; msg += SPC + "   水:手動更新の抑制期間中"; msg += SPC + "   紫:強制リロード直前"; msg += SPC + "------------------------------------"; msg += SPC + BTN_TXT_INT + "(明色) / " + BTN_TXT_HLP + "(暗色) :"; msg += SPC + "   基本色は情報表示部に準ずる"; msg += SPC + BTN_TXT_SRT + " :"; msg += SPC + "  短周期タイマ都度停止中"; msg += SPC + "   基本色は情報表示部に準ずる"; msg += SPC + "   灰:短周期タイマ停止中"; msg += SPC + "  短周期タイマ常時稼動中"; msg += SPC + "   基本色は情報表示部に準ずる"; if(!ntf){ msg += SPC + BTN_TXT_AUT + " :"; msg += SPC + "  自動更新の通常動作中"; msg += SPC + "   基本色は情報表示部に準ずる"; msg += SPC + "  自動更新の強制停止中"; msg += SPC + "   灰:自動更新強制停止中"; } msg += SPC + "------------------------------------"; dispHelpInfoDialogWindow(msg); } //情報表示ダイアログ(既読ポイント情報) function dispReadDialog(){ closePopupToolTips(); if( ! gi_enableReadPointCheckBox || gi_readArticles < 0 || gi_dispMode == MODE_NOTI ) return; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); //連続読み込みloadSetting内では読み込まない loadStorageData(); var idx, dsp=0; var msg = ""; msg += SPC + "------------------------------------"; msg += SPC + "既読ポイント数 : " + gi_readArticles; if( gi_readCheckedColorMode > -1 ){ msg += SPC + "表示タイプ : " + Number(gi_readCheckedColorMode + 1) + " / " + READ_COLOR_CYCLE; }else{ msg += SPC + "表示タイプ : 非表示中"; } msg += SPC + "------------------------------------"; for( idx = 0; idx < gi_readArticles; idx++ ){ if( gstrA_readArticleURL[idx] == "" ){ gstrA_readArticleURL[idx] = loadSetting( READ_HEADER[idx], u, true ); if( gstrA_readArticleURL[idx] === null ) gstrA_readArticleURL[idx] = ""; gstrA_readTimeStamp[idx] = loadSetting( READTM_HEADER[idx], u, true ); if( gstrA_readTimeStamp[idx] === null ) gstrA_readTimeStamp[idx] = ""; } if( gstrA_readArticleURL[idx] != "" ){ msg += SPC + "既読ポイント" + Number(idx + 1) + ":(" + gstrA_readTimeStamp[idx] + ")"; msg += SPC + gstrA_readArticleURL[idx]; msg += SPC + "------------------------------------"; dsp++; }} if( dsp == 0 ){ msg += SPC + "現在既読ポイントは設定されていません"; msg += SPC + "------------------------------------"; } dispHelpInfoDialogWindow(msg); } //ヘルプ・情報表示ウィンドウの表示処理共通部 function dispHelpInfoDialogWindow(msg, buttonLeft=false){ //msg: 表示する文字列 //buttonLeft: true=閉じるボタンを左に出す var e0, e1, e2, e3, e4, e5; var nowObj, nowTime, endTime; var HTML = ""; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); HTML += CRLF + "

"; HTML += CRLF + "PseudoTweetDeck [Ver" + VERSION_INFO + "]
"; HTML += CRLF + "Help & Information
"; HTML += CRLF + "Path=" + decodeURIComponent(u) + "
"; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + msg; HTML += CRLF + "
"; HTML += CRLF + "

" + PSEUDO_URL + "
"; if( ! buttonLeft ){ HTML += CRLF + "

"; }else{ HTML += CRLF + "

"; } HTML += CRLF + "
"; //ヘルプ表示画面を構築 e0 = document.querySelectorAll('div[id="react-root"]'); if( e0.length > 0 ){ //設定起動中のフラグを立てる(強制リロードの回避) gb_enableSettingWindow = true; //背景エレメント e1 = document.createElement("div"); e1.setAttribute("id",SETTING_BLOCK); e1.style.display = "block"; e1.style.position = "absolute"; e1.style.height = "100%"; e1.style.width = "100%"; e1.style.backgroundColor = (COLOR_MODE)?COLOR_BLACK:COLOR_WHITE; e1.style.color = (COLOR_MODE)?COLOR_WHITE:COLOR_BLACK; e1.style.zIndex = "999"; e1.style.position = "fixed"; e1.onclick = function(e){e.stopPropagation(); return false;}; e1.onkeydown = function(e){e.stopPropagation(); return false;}; e1.onkeyup = function(e){e.stopPropagation(); return false;}; e1.onkeypress = function(e){e.stopPropagation(); return false;}; e1.onchange = function(e){e.stopPropagation(); return false;}; e2 = document.createElement("div"); e2.style.display = "flex"; e2.style.position = "relative"; e2.style.height = "100%"; e2.style.width = "100%"; e2.style.justifyContent = "center"; e2.style.overflow = "scroll"; e2.insertAdjacentHTML("beforeend", HTML); e1.appendChild(e2); e0[0].appendChild(e1); //テーブルエレメント e3 = document.getElementById('ELM_MAIN_TABLE'); e3.style.minWidth = DIALOG_MIN_WIDTH; e3.style.maxWidth = DIALOG_MAX_WIDTH; e4 = document.getElementById('ELM_INNER_TABLE'); e4.style.fontSize = DIALOG_FONT_SIZE; //ヘルプ画面を閉じる e5 = document.getElementById('ELM_CLOSE'); e5.style.width = "128px"; e5.onclick = function(e){e.stopPropagation(); closeSettingWindow(false); return false;}; } } /************************************************************ メンテナンス関連関数 ************************************************************/ //ローカル保存データの全削除 function deleteAllData(){ if( window.confirm("  自動更新スクリプトが保存した\r\n  全設定データ・保存データを初期化しますか?\r\n  ※削除後にリロードが必要になります") == false ) return; var idx; var imax = window.localStorage.length; var keys; var removeCount = 0; for( idx = imax - 1; idx > -1; idx-- ){ keys = "" + window.localStorage.key(idx); if( keys == LOCAL_DATA_KEY || keys == FORCEUPDATE_HEADER || keys.indexOf("PTD_") == 0 ){ window.localStorage.removeItem(keys); removeCount++; } } if( removeCount > 0 ){ window.alert("  データを削除しました\r\n  リロードします"); window.location.reload(); }else{ window.alert("  該当データはありませんでした"); } } //既読ポイントのみクリア function deleteReadPointData(){ if( window.confirm("  自動更新スクリプトが保存した\r\n  全既読ポイントデータを初期化しますか?") == false ) return; var removeCount = 0; loadStorageData(); for( var item in gobj_localData ){ for( var i=0; i < 100; i++ ){ var obj = gobj_localData[item]; if( obj[READ_HEADER[i]] !== null && obj[READ_HEADER[i]] !== undefined ){ delete obj[READ_HEADER[i]]; removeCount++; } if( obj[READTM_HEADER[i]] !== null && obj[READTM_HEADER[i]] !== undefined ){ delete obj[READTM_HEADER[i]]; removeCount++; } } } saveStorageData(); window.alert("  " + removeCount + "件のデータを削除しました\r\n  各タブをリロードして下さい"); } //表示中ページの設定のみクリア function deletePageSetting(){ var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); u = decodeURIComponent(u); loadStorageData(); if( window.confirm("  [" + u + "]\r\n  このURL用の設定データを初期化しますか?\r\n  ※削除後にリロードが必要になります") == false ) return; if( gobj_localData[u] !== null && gobj_localData[u] !== undefined ){ delete gobj_localData[u]; saveStorageData(); window.alert("  データを削除しました\r\n  リロードします"); window.location.reload(); } } //各URLごとのデータを順次クリア function deleteAllPageSetting(){ loadStorageData(); for( var item in gobj_localData ){ if( item != KEY_SYSTEM ){ if( window.confirm("  [" + item + "]\r\n  このURL用の設定データを初期化しますか?") == true ){ delete gobj_localData[item]; } } } saveStorageData(); } /* //旧形式データ(〜Ver1.4)の強制削除・・・すまぬ・・・すまぬ・・・ function deleteOldData(){ var idx; var imax = window.localStorage.length; var keys; var removeCount = 0; for( idx = imax - 1; idx > -1; idx-- ){ keys = "" + window.localStorage.key(idx); if( keys.indexOf("PTD_") == 0 ){ window.localStorage.removeItem(keys); removeCount++; } } } deleteOldData(); //旧ローカルデータキーからの置換処理 function convertOldData(){ const CHGTABLE = [ "OLD_KEY0","NEW_KEY0","OLD_KEY1","OLD_KEY1" ]; var removeCount = 0; loadStorageData(); var value; for( var item in gobj_localData ){ for( var subitem in gobj_localData[item] ){ for( var i=0; i max ) ? max : ((window.innerWidth < min ) ? min : Math.floor(window.innerWidth * 0.98)); var w2 = (window.innerWidth > max ) ? "65" : ((window.innerWidth < min ) ? "57" : Math.floor(window.innerWidth * 0.16)); //スクロール位置が先頭に戻ったら既読マークをする処理中のポップアップ表示 msg += "
" msg += ""; msg += "
"; msg += ""; msg += " "; msg += " "; msg += " "; msg += " "; msg += " "; msg += " "; msg += ""; msg += " "; msg += " "; msg += " "; msg += " "; msg += " "; msg += " "; msg += "
DEBUG
"; msg += "
"; msg += "
"; msg += "
"; msg += "
"; gelm_debugDialog = dispPopupMessage(msg, -1, COLOR_WHITE, COLOR_BLACK, true, false, false, true); e = document.getElementById('DEBUG_WINDOW'); if( e !== null ){ e.style.minWidth = DIALOG_MIN_WIDTH; e.style.maxWidth = DIALOG_MAX_WIDTH; e.onclick = function(e){e.stopPropagation(); return false;}; e.onkeydown = function(e){e.stopPropagation(); return false;}; e.onkeyup = function(e){e.stopPropagation(); return false;}; e.onkeypress = function(e){e.stopPropagation(); return false;}; e.onchange = function(e){e.stopPropagation(); return false;}; } e = document.getElementById('ELM_DEBUG_BTN1'); if( e !== null ){ e.onclick = function(){window.setTimeout( closeDebugWindow, 10 );}; } e = document.getElementById('ELM_DEBUG_BTN2'); if( e !== null ){ e.onclick = function(){window.setTimeout( clearDebugText, 10 );}; } e = document.getElementById('ELM_DEBUG_BTN3'); if( e !== null ){ e.onclick = function(){window.setTimeout( dispLocalStorageData, 10 );}; } e = document.getElementById('ELM_DEBUG_BTN4'); if( e !== null ){ e.onclick = function(){ var elm = document.getElementById('DEBUG_WINDOW'); if( elm === null ) return; debugWindowSize = 0; elm.style.minHeight = elm.style.maxHeight = DEBUG_MIN_HEIGHT[debugWindowSize]; }; } e = document.getElementById('ELM_DEBUG_BTN5'); if( e !== null ){ e.onclick = function(){ var elm = document.getElementById('DEBUG_WINDOW'); if( elm === null ) return; debugWindowSize = 1; elm.style.minHeight = elm.style.maxHeight = DEBUG_MIN_HEIGHT[debugWindowSize]; }; } e = document.getElementById('ELM_DEBUG_BTN6'); if( e !== null ){ e.onclick = function(){ var elm = document.getElementById('DEBUG_WINDOW'); if( elm === null ) return; debugWindowSize = 2; elm.style.minHeight = elm.style.maxHeight = DEBUG_MIN_HEIGHT[debugWindowSize]; }; } e = document.getElementById('ELM_DEBUG_BTN7'); if( e !== null ){ e.onclick = function(){ var elm = document.getElementById('DEBUG_WINDOW'); if( elm === null ) return; debugWindowSize = 3; elm.style.minHeight = elm.style.maxHeight = DEBUG_MIN_HEIGHT[debugWindowSize]; }; } e = document.getElementById('ELM_DEBUG_BTN8'); if( e !== null ){ e.onclick = function(){ var elm = document.getElementById('DEBUG_TEXT_TABLE'); //rangeオブジェクトの作成 var range = document.createRange(); //取得した要素の内側を範囲とする range.selectNodeContents(elm); //範囲を選択状態にする window.getSelection().addRange(range); //クリップボードにコピー window.setTimeout(function(){document.execCommand('copy');}, 100); //選択を解除 window.setTimeout(function(){window.getSelection().removeAllRanges();}, 200); }; } e = document.getElementById('ELM_DEBUG_BTN9'); if( e !== null ){ e.onclick = function(){ dispPopupMessage("予約1", gi_displayPopupCloseTimeSec); }; } e = document.getElementById('ELM_DEBUG_BTN10'); if( e !== null ){ e.onclick = function(){ dispPopupMessage("予約2", gi_displayPopupCloseTimeSec); }; } e = document.getElementById('ELM_DEBUG_BTN11'); if( e !== null ){ e.onclick = function(){ dispPopupMessage("予約3", gi_displayPopupCloseTimeSec); }; } } //デバッグウィンドウにテキストを表示 function dispDebugText(txt="", timestamp=""){ if( ! DEBUG_MODE ) return; var i, tmp = ""; var e = document.getElementById(ELM_DEBUG_TEXT); const TEXT = "TEXT"; const TIME = "TIME"; /* //末尾に積む debugTextArray.push(txt); if( debugTextArray.length > MAX_DEBUG_RECS ){ debugTextArray.shift(); } */ //先頭に積む if( txt != "" ){ if( debugTextArray.length > 0 && (debugTextArray[0][TEXT]).indexOf(txt) != -1 ){ debugTextArray[0][TIME] = timestamp; debugTextArray[0][TEXT] = txt; }else{ debugTextArray.unshift({TIME:timestamp,TEXT:txt}); if( debugTextArray.length > MAX_DEBUG_RECS ){ debugTextArray.pop(); } } } if( e === null ) return; tmp = ""; for( i=0; i" ; }else{ tmp += "" ; } } tmp += "
" + debugTextArray[i][TEXT] + "
" + debugTextArray[i][TEXT] + "
"; e.textContent = ""; e.insertAdjacentHTML("beforeend", tmp); } //デバッグウィンドウに時刻付きでテキストを表示 function dispDebugTextWithTime(txt){ if( ! DEBUG_MODE ) return; var dt = new Date(); dispDebugText(txt, toFormatedTimeString(dt)); } //ローカルストレージデータを展開表示 function dispLocalStorageData(){ if( ! DEBUG_MODE ) return; loadStorageData(); var txt = JSON.stringify(gobj_localData, null, 2); console.log("LocalStorage=" + txt); dispHelpInfoDialogWindow("
" + txt + "
", true); } //デバッグ表示と蓄積レコードを破棄 function clearDebugText(){ if( ! DEBUG_MODE ) return; debugTextArray = []; dispDebugText(); } //デバッグウィンドウを閉じる function closeDebugWindow(){ if( ! DEBUG_MODE ) return; if( gelm_debugDialog !== null ) closePopupMessage(gelm_debugDialog); gelm_debugDialog = null; } //デバッグウィンドウ処理メイン function debugFunction(){ if( ! DEBUG_MODE ) return; var msg = ""; dispDebugWindow(); dispDebugText(msg); } /************************************************************ メイン処理 ************************************************************/ function startMain(){ //初期処理の完了待ち if( gi_initComplete == 0 ){ window.setTimeout(startMain, gi_shortIntervalMs); //console.log("★startMain : WaitFor initComplete"); dispDebugTextWithTime("startMain : Wait for initComplete"); return; } //短周期処理開始 gtmr_shortTimer = window.setInterval(replaceElements, gi_shortIntervalMs); gstr_lastShortStart = new Date(); //console.log("★gtmr_shortTimer: START[FIRST]"); //更新処理開始 window.setInterval(updateTimeline, gi_timerIntervalMs); //デバッグトレース用のウィンドウを表示 if( DEBUG_MODE ) window.setTimeout( debugFunction, 10 ); dispDebugTextWithTime("startMain : Start Timer"); } (function() { //強制リロードまでの時間管理のため起動した時間を記録 saveSetting(FORCEUPDATE_HEADER, KEY_SYSTEM, ( toFormatedDateString(gdt_lastDomTime)) ); //システム設定の読み込み loadSystemSettings(); //背景色テーブルの初期化 setupBgColorTables(); //初期処理の遅延実行 window.setTimeout(clearElements, gi_initWaitMs); window.setTimeout(startMain, gi_initWaitMs + 100); console.log("START PseudoTwDk: Setting="); console.dir(gobj_localData); })();