// ==UserScript== // @name [PseudoTweetDeck] HomeTL/List/User/Searchページの自動更新と既読管理 // @namespace http://coltpythonkingcobra.g1.xrea.com/pseudoTweetdeck/ // @version 1.4.10280840 // @description TwitterWEB(X)の各種ページの自動更新(停止可能)、タイトル文字列の置換と絶対時間表示、既読管理などを行う // @author @PseudoTwDk // @match https://twitter.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com // @grant none // ==/UserScript== //グローバル定義時用の汎用カウンタ var gi_defIdx = 0; /************************************************************ 変更される事を考慮した各種const定義(var定義は変更しない事) ************************************************************/ //※ 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 * 2;//mouseleaveですぐ消えるが、万一の消え残り対策 //DOM更新の最終タイムスタンプを自動更新OFFでも表示する=1, 表示しない=0 const gi_defaultEnableTimeAutoOff = 1; var gi_enableTimeAutoOff = gi_defaultEnableTimeAutoOff;//※システムコンフィグで変更可能 //既読ポイント用のチェックボックスを表示する=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;//※コンフィグで変更可能 //表示部のボタンや横の各ボタン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;//※コンフィグで変更可能 //更新トリガ時新着を上に積む更新でトリガから先頭記事に遷移するまでの待機時間(ms) [ unknown(未使用), Home, List, User、Notification(未使用), Search ] const giA_defaultUpdateContinuousDelayTimeMs = [500, 250, 750, 750, 500, 750]; 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;//※システムコンフィグで変更可能 //画像サムネイル左クリックで前回開いたパス 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 = 10000; 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 = 8; 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;//※システムコンフィグで設定可能 /************************************************************************************************************************************ 以下のconst定義はさすがに全部システムコンフィグには出せないので変えている人はスクリプトの更新時に手動で好みの設定に書き直して下さい。 ***********************************************************************************************************************************/ //カラーモード ダークテーマ・ブラックテーマ=1, ライトテーマ=0 const DEF_COLOR_MODE = 1; var COLOR_MODE = DEF_COLOR_MODE;//※システムコンフィグで変更可能 const COLORMODE_HEADER = "PTD_CMODE"; (function(){ var v = window.localStorage.getItem( COLORMODE_HEADER ); 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 = COLOR_SOLID_GRAY;//一般ポップアップの背景色 //情報表示部ボタンの色 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.1)":"rgba(0,0,0,0.1)"; const DEF_READ_COLOR_ENABLED2 = (COLOR_MODE)?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.2)"; const DEF_READ_COLOR_ENABLED3 = (COLOR_MODE)?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"; var READ_COLOR_ENABLED = [];//※ここは変更しない var READ_COLOR_ENABLED1 = [];//※ここは変更しない var READ_COLOR_ENABLED2 = [];//※ここは変更しない var READ_COLOR_ENABLED3 = [];//※ここは変更しない var READ_COLOR_ENABLED4 = [];//※ここは変更しない //既読ポイント背景色の切り替えパターン数 const gi_readColorPattern = 8;//※(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, ]; //既読ポイント背景色パターンType2 READ_COLOR_ENABLED2 = [ DEF_READ_COLOR_ENABLED2, (COLOR_MODE)?"rgba(255,191,191,0.2)":"rgba(63,0,0,0.2)", (COLOR_MODE)?"rgba(191,255,191,0.2)":"rgba(0,63,0,0.2)", (COLOR_MODE)?"rgba(191,191,255,0.2)":"rgba(0,0,63,0.2)", DEF_READ_COLOR_ENABLED2, (COLOR_MODE)?"rgba(191,255,255,0.2)":"rgba(0,63,63,0.2)", (COLOR_MODE)?"rgba(255,191,255,0.2)":"rgba(63,0,63,0.2)", (COLOR_MODE)?"rgba(255,255,191,0.2)":"rgba(63,63,0,0.2)", ]; //既読ポイント背景色パターンType3 READ_COLOR_ENABLED3 = [ DEF_READ_COLOR_ENABLED3, (COLOR_MODE)?"rgba(191,255,255,0.3)":"rgba(0,63,63,0.3)", (COLOR_MODE)?"rgba(255,191,255,0.3)":"rgba(63,0,63,0.3)", (COLOR_MODE)?"rgba(255,255,191,0.3)":"rgba(63,63,0,0.3)", DEF_READ_COLOR_ENABLED3, (COLOR_MODE)?"rgba(255,191,191,0.3)":"rgba(63,0,0,0.3)", (COLOR_MODE)?"rgba(191,255,191,0.3)":"rgba(0,63,0,0.3)", (COLOR_MODE)?"rgba(191,191,255,0.3)":"rgba(0,0,63,0.3)", ]; //既読ポイント背景色パターン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, ]; //既読ポイント背景色パターン以降がある場合 パターン以降先頭要素で繰り返し=0, パターン全体を繰り返す=1 const DEF_READ_COLOR_CYCLEMODE = 1; var READ_COLOR_CYCLEMODE = DEF_READ_COLOR_CYCLEMODE;//※システムコンフィグで変更可能 //情報表示部の固定サイズ(フォントサイズを変更したらここも合わせて変更する) 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_PAUSEDUPDATE = "[ Paused Refresh ]";//自動更新停止中 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...]";//通知ページの新着表示クリア中 /******************************************** 以下のconst定義は各自の変更を推奨しないもの *******************************************/ //スクロールによってトリガするタイプのページでスクロールを戻すまでのウェイト時間(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; //初期化が必要=0, 初期化済み=1 var gi_initComplete = 0; //前回処理URL var gstr_lastURL = null; //更新間隔カウンタ var gi_updateCountMs = 0; //監視間隔タイマの間隔(ミリ秒) const gi_timerIntervalMs = 1000; //短周期タイマオブジェクト var gtmr_shortTimer = null; //自動更新が停止中 var gi_displayPaused = 0; //スクロール位置の前回値 var gf_lastYOffset = 0; //ヘルプ・コンフィグ系のダイアログ表示のテーブル幅・フォント倍率設定 const DIALOG_MIN_WIDTH = "390px"; const DIALOG_MAX_WIDTH = "500px"; const DIALOG_FONT_SIZE = "75%"; // ***** 既読マーク遡り検索機能関連 ***** //遡り捜索モード var gi_findMode = 0; //遡り捜索のタイムスタンプ無視モード var gi_findNoTimeStamp = 0; //見つけた既読マーク var giA_findMark = []; //既読マーク捜索処理 var gi_findReadPointCount = 0; //既読マークの捜索モードで1スクロール置きに挟むウェイト const gi_defaultFindModeIntervalMs = 3000; var gi_findModeIntervalMs = gi_defaultFindModeIntervalMs;//※コンフィグで設定可能 //既読マーク遡り中に読み込まれたアーティクルのタイムスタンプ蓄積 var gstrA_findModeArticleTimeStamp = []; //遡る上限の件数 const MAX_CONTINUE_ARTICLES = 500; //有効な既読マーク数(この数未満では捜索を行わない) const ACTIVE_READ_COUNT = 4; //発見した既読マーク数の閾値(全部見つからない前提なので有効な既読マーク数マイナスこの値がヒットしたら捜索終了) const FIND_READ_COUNTSUB = 2; //遡って読み込んだアーティクルから先頭の何件を既読マークのタイムスタンプと比較するか const FIND_OLD_ARTICLE_COUNT = 16; //通知ページの新着表示が消えるまでのポップアップ最大時間(秒) const CLEAR_NEWNOTI_SEC = 180; //表示中のページ種別 0:unknown, 1:Home, 2:List, 3:User, 4:Notification, 5:Search var gi_dispMode = 0; //メディアサイズ 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:リンク"]; //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;//※コンフィグで設定可能 //このスクリプト固有のプリフィクス(カスタムCSSのセレクタで使用される) const gstr_scrModeAttrPfx = "PSEUDOTWEETDECK"; //このスクリプト固有のメディアサイズ記録用属性名(カスタムCSSのセレクタで使用される) const gstr_scrMediaAttr = "PTD_MEDIA"; //このスクリプト固有のRT表示切り替え用属性名(カスタムCSSのセレクタで使用される) const gstr_scrNotRtAttr = "PTD_NOTRT"; //このスクリプト固有の引用RT表示切り替え用属性名(カスタムCSSのセレクタで使用される) const gstr_scrNotQuoteAttr = "PTD_NOTQUOTE"; //このスクリプト固有のツイート下部コマンドアイコン表示切り替え用属性名(カスタムCSSのセレクタで使用される) const gstr_scrNotCommIconAttr = "PTD_NOTCOMMICON"; //このスクリプト固有のリストページスクロール状態で切り替え用属性名(カスタムCSSのセレクタで使用される) const gstr_scrScrollList = "PTD_LIST_SCROLL"; //このスクリプト固有の一部環境で検索ページ上部の隙間を更に詰める処理が起因して更新があがってこない時の強引な解決策用属性名(カスタムCSSのセレクタで使用される) 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"; //最後に更新をかけた時間 var gdt_lastTriggerTime = new Date(); //種別プリフィクス用文字列 const gstrA_modeNamePrifix = ["NULL","HOME","LIST","USER","NOTI","SEAR"]; //モードのインデックス(配列タイプで定義している他の項目に影響するので変更禁止) 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 //自動更新の情報表示エレメント 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; //ヘルプツールチップス用のボタンエレメント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; //MutationObserverでDOM更新が上がってきた最終タイムスタンプ保持 var gdt_lastDomTime = new Date(); var gstr_lastDomTime = toFormatedTimeString(gdt_lastDomTime); //短周期タイマ開始時間を保持 var gstr_lastShortStart = null; //リロード告知ダイアログオブジェクト var gobj_reloadDialog = 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 gdt_temp = null; var gb_flgClearNotification = false; var gtmr_waitClear = null; var gelm_fixedPopupFind = null; var gelm_fixedPopupFindInfo = null; var gelm_fixedPopupClearNewTweet = null; var gelm_fixedPopupClearNewDM = null; var gelm_fixedToolTips = null; var gelm_fixedConfirm = null; /* localStorage保存キーのプリフィクス */ //システムで一意のもの const FORCEUPDATE_HEADER = "PTD_FTIME"; const CHGTIME_HEADER = "PTD_CHTME"; const READCOUNT_HEADER = "PTD_RECNT"; const READCHK_HEADER = "PTD_RECHK"; const EDITDISP_HEADER = "PTD_EDITD"; const NEWTWDISP_HEADER = "PTD_NEWTW"; const CLICKNEW_HEADER = "PTD_CLNEW"; const POPUPTIME_HEADER = "PTD_POPTM"; const ENDOMTIME_HEADER = "PTD_DOMTM"; const NODISPSAME_HEADER = "PTD_NOSAM"; const OPACITY_HEADER = "PTD_OPACT"; const MANTRIGNEW_HEADER = "PTD_MNTNW"; const IMAGENEW_HEADER = "PTD_IMGNW"; const LOCKTIME_HEADER = "PTD_LOCKT"; const IDLESHORT_HEADER = "PTD_IDLSH"; const INITWAIT_HEADER = "PTD_INITW"; const SHORTINTVL_HEADER = "PTD_SHINT"; const ONTOPWAIT_HEADER = "PTD_TOPWT"; const RELOADWAIT_HEADER = "PTD_RELWT"; const CHKENAOP_HEADER = "PTD_CHKEO"; const CHKDISOP_HEADER = "PTD_CHKDO"; const INFOWIDTH_HEADER = "PTD_WDINF"; const INFOHEIGHT_HEADER = "PTD_HTINF"; const FONTTEXT_HEADER = "PTD_FONTX"; const FONTBTN_HEADER = "PTD_FONTB"; const BGCYCLE_HEADER = "PTD_BGCYC"; const HELPPOPUP_HEADER = "PTD_HLPPU"; const SEACSS_HEADER = "PTD_SEACS"; const SEACSSW_HEADER = "PTD_SEACW"; //URL個別のキーとなるもの const INTERVAL_HEADER = "PTD_INTE-"; const CHKCOLOR_HEADER = "PTD_CCOL-"; const MANUAL_HEADER = "PTD_MANU-"; const RELOAD_HEADER = "PTD_RELD-"; const AUTOOFF_HEADER = "PTD_AOFF-"; const IDLETM_HEADER = "PTD_IDLE-"; const MEDIA_HEADER = "PTD_MEDI-"; const NOTRT_HEADER = "PTD_NORT-"; const NOTICON_HEADER = "PTD_NOIC-"; const RESSRTTMR_HEADER = ["PTD_RSTM1-","PTD_RSTM2-","PTD_RSTM3-","PTD_RSTM4-","PTD_RSTM5-","PTD_RSTM6-"]; const AUTOMARK_HEADER = ["PTD_AUTM1-","PTD_AUTM2-","PTD_AUTM3-","PTD_AUTM4-","PTD_AUTM5-","PTD_AUTM6-"]; const CLRNEWTW_HEADER = ["PTD_CNTW1-","PTD_CNTW2-","PTD_CNTW3-","PTD_CNTW4-","PTD_CNTW5-","PTD_CNTW6-"]; const MANTRIG_HEADER = ["PTD_MTRG1-","PTD_MTRG2-","PTD_MTRG3-","PTD_MTRG4-","PTD_MTRG5-","PTD_MTRG6-"]; const CONTNEW_HEADER = ["PTD_CONW1-","PTD_CONW2-","PTD_CONW3-","PTD_CONW4-","PTD_CONW5-","PTD_CONW6-"]; const FINDMODE_HEADER = ["PTD_FMOD1-","PTD_FMOD2-","PTD_FMOD3-","PTD_FMOD4-","PTD_FMOD5-","PTD_FMOD6-"]; const CONTDLY_HEADER = "PTD_CODL-"; const CONTRET_HEADER = "PTD_CORE-"; const CONTPOPUP_HEADER = "PTD_COPU-"; const FINDPOPUP_HEADER = "PTD_FIPU-"; const FINDINTVAL_HEADER = "PTD_FINT-"; var READ_HEADER = []; var READTM_HEADER = []; for( gi_defIdx=0; gi_defIdx < 100; gi_defIdx++ ){ READ_HEADER[gi_defIdx] = "PTD_RD" + ("0" + gi_defIdx).slice(-2) + "-"; READTM_HEADER[gi_defIdx] = "PTD_TM" + ("0" + gi_defIdx).slice(-2) + "-"; } //強制リロードまでの時間管理のため起動した時間を記録 window.localStorage.setItem(FORCEUPDATE_HEADER, ("" + toFormatedDateString(gdt_lastDomTime)) ); //操作ボタンコントロールの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"; //コンフィグ・システムコンフィグ表示中のフラグ(強制リロードなどを抑止するため) var gb_enableSettingWindow = false; //システムコンフィグで変更保存された項目がある=true, 変更なし=false var gb_changedSetting = false; //エディット部表示非表示切り替え時の追加要素 const EDITSW_BLOCK = "PTD_EDIT_SWITCH_BLOCK"; //タイムスタンプ部にチェックボックス追加済みを示す追加要素 const TIME_FIXED = "PTD_TIME_FIXED_BLOCK"; //画像リンク部のclickを乗っ取った状態の追加要素 const IMAGE_LINK = "PTD_IMAGE_LINK"; //動画リンク部のclickを乗っ取った状態の追加要素 const MOVIE_LINK = "PTD_MOVIE_LINK"; //表示部・ボタン類の色替え 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 = "  "; //対象URLの基本部 const TWITTER_URL = "https://twitter.com/"; const TWITTER_URL2 = "https://twitter.com"; //TwitterURLのパス文字列 const PATH_HOME = "home"; const PATH_LIST = "i/lists/"; const PATH_NOTI = "notifications"; const PATH_SEAR = "search"; //配布ページURL const PSEUDO_URL = "http://coltpythonkingcobra.g1.xrea.com/pseudoTweetdeck/"; //本スクリプトとは無関係のURLかどうかを判定 ※先にPATH_LISTかどうかを判定しないとリスト一覧の i なしlistsにパターンマッチしてしまうので注意 function isOtherURL(hr){ 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){ // 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){ // HH:MM:SS var ret = ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2) + ":" + ("0" + date.getSeconds()).slice(-2); return ret; } //既読ポイント背景色のセットアップ(システムコンフィグ項目のローカルデータ読み込み完了後にメイン関数から呼び出して初期化する) 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 ); } } //更新が必要かどうかをURLとフォーカスコントロールの状態などから判定(内部の画面遷移とlocation.hrefは一致しないタイミングがあるので更新直前に確認が必要) function shouldNotUpdate() { 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 ){ gstr_lastURL = window.location.href; gi_initComplete = 0; for(var idx=0; idx < gi_readArticles; idx++){ gstrA_readTimeStamp[idx] = ""; gstrA_readArticleURL[idx] = ""; } if(gi_idleShortTimer){ //停止していた短周期タイマを再開 if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceEtements, gi_shortIntervalMs); //console.log("★gtmr_shortTimer: START[clearElements]"); } gstr_lastShortStart = gdt_temp; } //初期処理 clearElements(); //URLに対応する設定をローカルストレージから読み込む findSettings(); //既読ポイント背景色設定の読込 if( gi_enableReadPointCheckBox ){ loadReadPointColorSetting(); } return; } //自動更新に該当しないページは何もせず戻る if( gi_dispMode == MODE_NULL ){ return; } //リストページは何故か一定以上スクロールするとヘッダ非表示の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_idleShortTimer){ //短周期タイマ開始から時間が経過したらタイマを停止させる if( gtmr_shortTimer !== null ){ if( ( gdt_temp.getTime() - gstr_lastShortStart.getTime() ) / (gi_shortTimerIdleMs ) > 1.0 ){ window.clearInterval(gtmr_shortTimer); gtmr_shortTimer = null; //console.log("★gtmr_shortTimer: OFF"); } }else{ //停止していた短周期タイマをワンショット実行 var tmp = document.title; if( tmp.indexOf("@") == 0 || tmp.slice(-3) == "/ X" ){ replaceEtements(); } } if(window.pageYOffset != gf_lastYOffset){ //先頭に戻った場合ワンショットで短周期処理を走らせる if( window.pageYOffset == 0 ){ replaceEtements(); } //スクロール操作中短周期処理を再開させる if( Math.abs(window.pageYOffset - gf_lastYOffset) > SCROLL_LIMIT ){ if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceEtements, gi_shortIntervalMs); } gstr_lastShortStart = gdt_temp; } gf_lastYOffset = window.pageYOffset; } } //console.log("☆PageY-Offset=" + window.pageYOffset); if(window.pageYOffset <= SCROLL_LIMIT) { if(!shouldNotUpdate()) { if(gi_updateCountMs >= giA_updateIntervalMs[gi_dispMode]) { //フォーカス判定が外れた状態からの復帰 if( gi_initComplete == 0 ){ clearElements(); } if(gi_reloadTimeoutSec){ //一定時間以上DOM更新が無い場合はリロードする if( ( gdt_temp.getTime() - gdt_lastDomTime.getTime() ) > (gi_reloadTimeoutSec * 1000) ){ var f = false; var v = "20" + window.localStorage.getItem(FORCEUPDATE_HEADER); if( v != null ){ var timeSub = (gdt_temp.getTime() - (new Date(v)).getTime() ); //短時間に実施しないため前回実施時刻を獲得 if( timeSub > (gi_forceUpdateLockTimeSec * 1000) && ! gb_enableSettingWindow ){ f = true; }else{ gi_updateCountMs = Math.trunc(Math.random() * giA_updateIntervalMs[gi_dispMode] / 1000) * 1000; forceUpdateColor(COLOR_RELOAD, TXT_RELOADEXTEND); return; } }else{ f = true; } if( f ){ window.localStorage.setItem(FORCEUPDATE_HEADER, ("" + toFormatedDateString(gdt_temp)) ); 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; closePopupConfirm(); 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); } if(gi_idleShortTimer){ //停止していた短周期タイマをワンショット実行 if( gtmr_shortTimer === null ){ replaceEtements(); } } //更新されたのでカウンタをリセット gi_displayPaused = 0; gi_updateCountMs = 0; //console.log("☆Counter Update0 [" + gi_updateCountMs + "]" ); }else{ if(gi_idleShortTimer && gi_displayPaused){ //停止していた短周期タイマを時差でワンショット実行 if( gtmr_shortTimer === null ){ window.setTimeout( replaceEtements, gi_timerIntervalMs ); } } //更新待ちカウンタの加算 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){ 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("新着を現在の最新より上に積むのを試みます", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } 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("新着を現在の最新より上に積むのを試みます", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } 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_dispMode != MODE_NOTI ){ if( ! gi_displayPaused ){ //TXT_COUNTDOWNTIM = " [ #### / $$$$$$$$ ]"; str = TXT_COUNTDOWNTIM.replace("####", ("0000" + (tmp / 1000)).slice(-4) ).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_enableTimeAutoOff ){ 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 ){ str = " [Latest / " + 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_enableTimeAutoOff ){ 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 ){ //短周期タイマ停止中 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 ){ //短周期タイマ停止中 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 ){ //短周期タイマ停止中 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 ){ //短周期タイマ停止中 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 ){ //短周期タイマ停止中 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 ){ //短周期タイマ停止中 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; } } } } } //通常パターン以外での色替え(手動の更新操作やエラー発生時などのモニタリング用) function forceUpdateColor(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; } //要素の初回書き換わりを監視 window.addEventListener('load', function(){ gi_initComplete = 0; //各種カウンタの初期化 gi_updateCountMs = 0; gi_displayPaused = 0; //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(replaceEtements, gi_shortIntervalMs); //console.log("★gtmr_shortTimer: START[DOM]"); } gstr_lastShortStart = gdt_lastDomTime; } console.log("★DOMが変化しました " + gdt_lastDomTime.toLocaleTimeString() ); }); //MutationObserver監視時のオプション const configObserver = { attributes: false, characterData: true, childList: true, subtree: false, attributeOldValue: false, characterDataOldValue: false }; //監視するエレメントの取得・再取得 async function clearElements(){ //ボタンヘルプポップアップが出ていたら消去 closePopupToolTips(); //スクリプト固有の属性を一旦削除 gelm0 = document.querySelectorAll('body[' + gstr_scrTypeAttr +']'); if( gelm0.length > 0 ){ gelm0[0].removeAttribute( gstr_scrTypeAttr ); } gelm0 = document.querySelectorAll('body[' + gstr_scrLightColorAttr +']'); if( gelm0.length > 0 ){ gelm0[0].removeAttribute( gstr_scrLightColorAttr ); } //URLからモードを決定 getModeFromURL(); if( gi_dispMode == MODE_NULL ){ gstr_lastURL = ""; window.setTimeout(clearElements, gi_initWaitMs); return; } //カスタム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, "" ); } } //各種カウンタの初期化 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 = 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 ) gelm0 = gelm1[0].firstElementChild; if( gelm0 === null ){ //ドキュメント未構成のため時間を置いてリトライ window.setTimeout(clearElements, gi_initWaitMs); //console.log("☆clearElements Retry Timer" ); return; } var i; //固定ツイートを非表示にするための目印追加 if( gi_dispMode == MODE_USER ){ gelm2 = gelm0.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(gelm0, configObserver); //表示更新用エレメントの再取得 gelm_dispInfo = null; gi_initComplete = 1; //console.log("★clear: Element"); } //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"); } } } } } } const HOME_NEW_TWEET = '[class="css-18t94o4 css-1dbjc4n r-1777fci r-dfe81l r-1ny4l3l r-o7ynqc r-6416eg r-13qz1uu"]'; //短周期処理(タイムスタンプ置換、表示タイトル変更、さらに表示系の自動押下) function replaceEtements() { var e0, e1, e2, e3, e4, e5, e6, idx; var dt = new Date(); //新着表示をクリックした場合にも更新時間を記録 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); } } } //重複記事の非表示 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プロパティが変わる事があるらしい?ので重いけど都度取得 //※一旦先頭のツイートに遷移中とかでもデータは読み込まれていて裏で書き換わっているイメージか? for( idx=0; idx < gi_readArticles; idx++ ){ gstrA_readArticleURL[idx] = window.localStorage.getItem( READ_HEADER[idx] + u ); if( gstrA_readArticleURL[idx] === null ) gstrA_readArticleURL[idx] = ""; gstrA_readTimeStamp[idx] = window.localStorage.getItem( READTM_HEADER[idx] + u ); 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(e.target,0); appendNextReadCheck(); 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 ); } } }); //画像リンクの処理 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"); } } window.open( h, '_blank' ); } return false; }; //左クリックでは単体のみ開く e.onclick = function(e){ e.stopPropagation(); var h = e.target.getAttribute('src'); 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; } window.open( h, '_blank' ); return false; }; }); } //console.log("★ 1 Title=" + document.title); if( document.title.indexOf('@') != -1 ){ var t, idx1, idx2; // Listページ タブタイトルの変更 「@USERNAME/ListName」→「ListName」 if( window.location.href.indexOf(TWITTER_URL + PATH_LIST) !== -1 ){ t = document.title; idx1 = t.indexOf('@'); idx2 = t.indexOf('/'); if( idx1 !== -1 && idx2 !== -1 ) document.title = t.substr(idx2+1); }else{ // Userページ タブタイトルの変更 「Posts with replies by 」など削除 document.title = document.title.replace('Posts with replies by ',''); document.title = document.title.replace('Media posts by ',''); document.title = document.title.replace('Posts liked by ',''); // 通知があると先頭に(1)とかが付くのでこのあとのタブタイトル置換でidx2の値がidx1より手前になってしまうのを回避 // 「(1) DISPNAME (@USERNAME) / X」→「DISPNAME (@USERNAME) / X」 // 「(1) DISPNAME(@USERNAME)さん / X」→「DISPNAME(@USERNAME)さん / X」 t = document.title; idx1 = t.indexOf(")"); idx2 = t.indexOf("@"); if( t.substr(0,1) == "(" && idx1 > 1 && (idx2 - 5) > idx1 ){ document.title = t.substr(idx1+1); //console.log("★ 3 Title=" + document.title); } // Userページ タブタイトルの変更 「DISPNAME (@USERNAME)」→「[@USERNAME]」 t = document.title; idx1 = t.indexOf(' (@'); idx2 = t.indexOf(')'); if( idx1 !== -1 && idx2 !== -1 ) document.title = '[' + t.substr(idx1+3, idx2-idx1-3) + ']'; // Userページ タブタイトルの変更 「DISPNAME(@USERNAME)さん / X」→「[@USERNAME]」 t = document.title; idx1 = t.indexOf('(@'); idx2 = t.indexOf(')さん'); if( idx1 !== -1 && idx2 !== -1 ) document.title = '[' + t.substr(idx1+2, idx2-idx1-2) + ']'; } } // 個別ツイート表示先頭の「Xユーザーの」を削除 if(document.title.indexOf("Xユーザーの") == 0 ){ document.title = document.title.replace('Xユーザーの',''); } // タブタイトル末尾の 「/ X」を削除 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 + "]"); 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 + "]"); e2[idx].click(); return; } //手動更新直後に新着表示だけされて読み込まれないパターンの救済 if( gi_manualUpdateTriggerNewTweet && (dt.getTime() - gdt_lastTriggerTime.getTime() < gi_manualUpdateIntervalSec * 1000) ){ forceUpdateColor(COLOR_UPDATE, TXT_AUTOCLICKMOR); console.log("★replaceElements3 新着のエレメントを自動クリック[" + idx + "]"); e2[idx].click(); return; } } } } //新着表示部のクリックイベントで更新表示と時間記録を行う 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; } //既読ポイントの変更 function chgReadPoint(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; window.localStorage.setItem( READ_HEADER[idx] + h, u ); window.localStorage.setItem( READTM_HEADER[idx] + h, gstrA_readTimeStamp[idx] ); } }else{ //チェックが外されたアーティクルを戻しローカル保存データの破棄 obj.checked = false; obj.setAttribute(gstr_scrReadPointAttr,'false'); //チェック数の定義を減らした後にゴミが残らないように最大数まで探して消す for( i=0; i< 100; i++ ){ //定義数が減った時に定義が残るのでクリアする手段 window.localStorage.removeItem( READ_HEADER[i] + h ); window.localStorage.removeItem( READTM_HEADER[i] + h ); 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 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(window.localStorage.getItem(CHKCOLOR_HEADER + u)); changeReadPointColor(); } //既読ポイントチェックボックスの右クリック function rclickReadPoint(doCycle, notDispMsg){ 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; window.localStorage.setItem(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); } 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); } }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); } 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); } }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 = []; if( gi_findModeDispPopup ){ dispPopupMessage("既読ポイント捜索を停止しました" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); closePopupFindInfoMessage(); closePopupFindMessage(); } 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 ){ closePopupFindInfoMessage(); closePopupFindMessage(); gelm_fixedPopupFind = dispPopupMessage("既読ポイントの捜索を開始します\r\n(" + BTN_TXT_BTNL + "," + BTN_TXT_BTNM + "," + BTN_TXT_BTNR + "で中断)", -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } 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 ){ dispPopupMessage("既読ポイントを " + findCount + " / " + aliveReadPoint + " 個発見しました" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } gi_findReadPointCount = findCount; } //有効な既読ポイントから消失予想分を引いた数まで見つかったら終了 if( aliveReadPoint - FIND_READ_COUNTSUB <= findCount ){ if( gi_findModeDispPopup ){ window.setTimeout( function(){if(gi_findModeDispPopup){closePopupFindInfoMessage();closePopupFindMessage();}}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage("既読ポイントを " + findCount + " 個発見したので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; if( idx > -1 ){ e0 = document.querySelectorAll('div[data-testid="cellInnerDiv"]:has(input[' + gstr_scrReadPointAttr + '="true' + idx + '"])'); if( e0.length > 0 ){ //既読マーク一番上のアーティクルが下端に表示される位置までスクロールする e0[0].scrollIntoView({ behavior : 'smooth', block : 'end', inline : 'center' }); } } 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); closePopupFindInfoMessage(); gelm_fixedPopupFindInfo = dispPopupMessage("発見既読ポイント[" + findCount + " / " + aliveReadPoint + "]" + msg , -1, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } //既読ポイントのタイムスタンプよりも古いものが現れ始めたら行きすぎている if( ! gi_findNoTimeStamp && gstrA_sortedMarkTimeStamp[0] > gstrA_sortedAllTimeStamp[0] ){ //ポップアップ型confirmは完了復帰ではないのでそれぞれボタンのイベントで後続処理を行う popupConfirm( "既読ポイントのタイムスタンプより
古いアーティクルに到達しました
中断しますか?", "中断する", function(){ if( gi_findModeDispPopup ){ closePopupConfirm(); window.setTimeout( function(){closePopupFindInfoMessage();closePopupFindMessage();}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage("既読ポイントのタイムスタンプより古いアーティクルに到達したので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; }, "続行する", function(){ gi_findNoTimeStamp = 1; if( gi_findModeDispPopup ){ closePopupConfirm(); dispPopupMessage("タイムスタンプ判定なしで遡ります" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); } ); return; } //読み込まれた件数が一定を超えたら行きすぎている if( gstrA_findModeArticleTimeStamp.length > MAX_CONTINUE_ARTICLES ){ if( gi_findModeDispPopup ){ closePopupConfirm(); window.setTimeout( function(){closePopupFindInfoMessage();closePopupFindMessage();}, gi_displayPopupCloseTimeSec * 2 ); dispPopupMessage(MAX_CONTINUE_ARTICLES + "件遡っても見つからないので捜索を終了します" , gi_displayPopupCloseTimeSec * 3, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } gi_findReadPointCount = 0; gi_findMode = 0; gstrA_findModeArticleTimeStamp = []; 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 ){ //読み込まれた最古アーティクルが上端に表示される位置までスクロールする e0[i].scrollIntoView({ behavior : 'smooth', block : 'start', inline : 'center' }); window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); return; } } } } } } } window.scrollTo(0, window.pageYOffset + window.innerHeight); window.setTimeout( continueReadPointFindingMode, gi_findModeIntervalMs ); } //配列の昇順クイックソート function quicksort(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); } //URLごとの各種設定をローカルストレージから読み込む function findSettings(){ var v, idx; var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); //インターバル値を一旦初期状態に戻す giA_updateIntervalMs = giA_defaultIntervalMs; v = window.localStorage.getItem( INTERVAL_HEADER + u ); 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 = window.localStorage.getItem( RELOAD_HEADER + u ); if( v !== null ){ v = Number(v); gi_reloadTimeoutSec = v; } //自動更新OFFの設定保存値を読み込む gi_modeAutoOff = gi_defaultModeAutoOff; v = window.localStorage.getItem( AUTOOFF_HEADER + u ); 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 = window.localStorage.getItem( IDLETM_HEADER + u ); if( v !== null ){ v = Number(v); if( v == 0 ){ //ずっと動作させ続けて停止させない gi_idleShortTimer = 0; }else{ //時間がたつと停止 gi_idleShortTimer = 1; } } //手動更新禁止時間の設定保存値を読み込む gi_manualUpdateIntervalSec = gi_defaultManualUpdateIntervalSec; v = window.localStorage.getItem( MANUAL_HEADER + u ); if( v !== null ){ v = Number(v); gi_manualUpdateIntervalSec = v; } //メディアサイズ設定を読み込む gi_mediaSize = gi_defaultMediaSize; v = window.localStorage.getItem( MEDIA_HEADER + u ); if( v !== null ){ v = Number(v); gi_mediaSize = v; } //RT&引用RT設定を読み込む gi_notDispRt = gi_defaultNotDispRt; v = window.localStorage.getItem( NOTRT_HEADER + u ); if( v !== null ){ v = Number(v); gi_notDispRt = v; } //メディアサイズ設定とRT非表示設定をドキュメント反映とローカル保存 updateMediaAttribute(); //下部アイコン表示設定を読み込む gi_notDispCommIcon = gi_defaultNotDispCommIcon; v = window.localStorage.getItem( NOTICON_HEADER + u ); if( v !== null ){ v = Number(v); gi_notDispCommIcon = v; } //下部アイコン表示設定をドキュメント反映とローカル保存 updateCommIconAttribute(); //ボタン毎の動作設定を読み込む for( idx=0; idx 0 ){ gelm0[0].setAttribute( gstr_scrMediaAttr, gi_mediaSize ); } if( ! isOther ){ window.localStorage.setItem( MEDIA_HEADER + u, gi_mediaSize ); } //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で切り替わるようにメディアサイズ情報を書き込む gelm0 = document.querySelectorAll('body'); if( gelm0.length > 0 ){ gelm0[0].setAttribute( gstr_scrNotRtAttr, rt ); gelm0[0].setAttribute( gstr_scrNotQuoteAttr, quote ); } if( ! isOther ){ window.localStorage.setItem( NOTRT_HEADER + u, gi_notDispRt ); } } //ツイート下部のアイコン類を非表示にする設定をドキュメントとローカルに保存 function updateCommIconAttribute(){ var v; var u = window.location.href; var isOther = isOtherURL(u); if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); //CSSで切り替わるように下部アイコン非表示情報を書き込む gelm0 = document.querySelectorAll('body'); if( gelm0.length > 0 ){ gelm0[0].setAttribute( gstr_scrNotCommIconAttr, gi_notDispCommIcon ); } if( ! isOther ){ window.localStorage.setItem( NOTICON_HEADER + u, gi_notDispCommIcon ); } } //クリックで入力ダイアログを入力させるボタン部と自動更新の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 = idleTimerChange; 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.onclick = testFunction; 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(); } if(gi_dispToolTipsPopup){ //ボタン機能のヘルプポップアップを表示 gelm_btnLeft.addEventListener('mouseover', function(){ 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(){ 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(){ 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); }); gelm_btnRight.addEventListener('mouseleave', closePopupToolTips); gelm_btnShort.addEventListener('mouseover', function(){ 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); }); gelm_btnShort.addEventListener('mouseleave', closePopupToolTips); gelm_btnInterval.addEventListener('mouseover', function(){ 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); }); gelm_btnInterval.addEventListener('mouseleave', closePopupToolTips); gelm_btnAutoOff.addEventListener('mouseover', function(){ 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); }); gelm_btnAutoOff.addEventListener('mouseleave', closePopupToolTips); gelm_btnHelp.addEventListener('mouseover', function(){ 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); }); gelm_btnHelp.addEventListener('mouseleave', closePopupToolTips); if( gi_dispMode == MODE_HOME ){ gelm_btnEdit.addEventListener('mouseover', function(){ 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); }); gelm_btnEdit.addEventListener('mouseleave', closePopupToolTips); } } } //ボタンヘルプToolTipsのinnerHTMLを生成する function getButtonToolTipsHTML(label,btn1,btn2){ var msg = ""; msg += "
[ " + label + " ] ボタン機能割付
" msg += ""; msg += ""; msg += ""; msg += "
左クリック :" + getButtonFunction(btn1) + "右クリック :" + getButtonFunction(btn2) + "
"; return msg; } //ボタンに割り付けた機能一覧の取得 function getButtonFunction(btnIdx){ var ntf = (gi_dispMode == MODE_NOTI) ? true : false; var msg = ""; if( btnIdx < MAX_CON_BUTTON ){ if( gi_findMode ){ msg += "
 既読マーク捜索中断"; } 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(ntf && (btnIdx % 2)){ msg += "
 タイマ時間リセット"; } if(giA_clearNewNotification[btnIdx] && ntf){ msg += "
 新着表示色クリア"; } if( gi_findMode ){ msg += "
"; } return msg; } switch(btnIdx){ case BTNID_SHORT://左クリック msg += "
 短周期タイマ切替"; 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); //dispPopupMessage("ボタン1", gi_displayPopupCloseTimeSec); } //情報表示部(左ボタン)の右クリック function clickInformationButton2(){ clickInformationButton(CON_BUTTON_LR); //dispPopupMessage("ボタン2", gi_displayPopupCloseTimeSec); } //情報表示部の(中ボタン)の左クリック function clickInformationButton3(){ clickInformationButton(CON_BUTTON_ML); //dispPopupMessage("ボタン3", gi_displayPopupCloseTimeSec); } //情報表示部の(中ボタン)の右クリック function clickInformationButton4(){ clickInformationButton(CON_BUTTON_MR); //dispPopupMessage("ボタン4", gi_displayPopupCloseTimeSec); } //情報表示部の(右ボタン)の左クリック function clickInformationButton5(){ clickInformationButton(CON_BUTTON_RL); //dispPopupMessage("ボタン5", gi_displayPopupCloseTimeSec); } //情報表示部の(右ボタン)の右クリック function clickInformationButton6(){ clickInformationButton(CON_BUTTON_RR); //dispPopupMessage("ボタン6", gi_displayPopupCloseTimeSec); } //クリック操作によるスクロール操作・短周期タイマ再開・更新トリガ・自読既読マーク・既読マーク捜索 function clickInformationButton(btnId){ var dt = new Date(); closePopupToolTips(); //既読捜索モード中はどのボタンを押しても中断 if( gi_findMode ){ gi_findMode = 0; gi_findReadPointCount = 0; gstrA_findModeArticleTimeStamp = []; if(gi_findModeDispPopup){ dispPopupMessage("既読ポイント捜索を中止しました" , gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); closePopupFindInfoMessage(); closePopupFindMessage(); } return; } //スクロールがほぼは最上部なら先頭に戻す if( window.pageYOffset <= SCROLL_LIMIT + 1.0 ){ window.scrollTo(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; } //既読ポイントを捜索するモードに移行する(手動更新や既読マーク更新は設定されていても動作しない) if( giA_findReadPointButton[btnId] && gi_enableReadPointCheckBox && gi_dispMode != MODE_NOTI ){ startReadPointFindingMode(); return; } //スクロール中は最上部のアーティクルが読まれていない状態の事があるので先頭よりちょっと下に戻るのみ(先頭に戻すとトリガされてしまう) if( window.pageYOffset > SCROLL_LIMIT + 1.0 ){ dispPopupMessage("先頭にスクロールを戻します", gi_displayPopupCloseTimeSec * 2, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); if( gi_dispMode != MODE_LIST || window.pageYOffset < LIST_PAGE_SCROLL_LIMIT ){ window.setTimeout( function(){ window.scrollTo(0, SCROLL_LIMIT + 1.0); }, 100 ); }else{ //CSS切り替えポイントを一気に跨がないように分割してスクロールする window.setTimeout( function(){ window.scrollTo(0, LIST_PAGE_SCROLL_LIMIT - 1 ); }, gi_findModeIntervalMs ); window.setTimeout( function(){ window.scrollTo(0, SCROLL_LIMIT + 1.0); }, gi_findModeIntervalMs * 2 ); } return; } //短周期タイマの再開 if( gi_idleShortTimer && giA_restartShortTimer[btnId] ){ if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceEtements, gi_shortIntervalMs); gstr_lastShortStart = dt; //console.log("★gtmr_shortTimer: START[startShortTimerByButton]"); } } //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( giA_manualUpdateAutoCheck[btnId] && gi_enableReadPointCheckBox ){ if( gi_updateContinuousDispPopup && giA_manualUpdateTrigger[btnId] && giA_updateContinuousButton[btnId] ){ dispPopupMessage("先頭記事を既読マークします", gi_displayPopupCloseTimeSec, COLOR_POPUP_FGCOLOR, COLOR_POPUP_BGCOLOR); } updateReadCheck(); } //更新禁止期間によって抑止されている時はトリガさせない 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); //手動でトリガを掛けたのでインターバル時間はリセット gi_updateCountMs = 0; } } } 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$="件の未読通知)"]'; //通知ページの新着表示を戻す 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{ } } } const NEW_NOTI_DM_ELEMENT = 'nav[aria-label="メインメニュー"] a[aria-label^="ダイレクトメッセージ("][aria-label$="件の未読会話)"]'; //DM新着があればポップアップを表示 function checkDMNotification(){ //DM新着の確認 var msg = ""; var e; var e0 = document.querySelectorAll(NEW_NOTI_DM_ELEMENT); if( e0.length > 0 ){ if( gelm_fixedPopupClearNewDM !== null ) return; msg += "
新着のDMがあります"; msg += "
"; msg += "
"; gelm_fixedPopupClearNewDM = dispPopupMessage(msg, -1, null, null, true, false); e = document.getElementById('ELM_CONFIRM_BTN1'); if( e !== null ){ e.onclick = function(){ window.open( TWITTER_URL2 + "/messages", '_blank' ); closePopupClearNewDM() }; } }else{ closePopupClearNewDM() } } //新着件数表示が無くなるまで待つ 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(); }, 5100 ); //console.log("★Finish!" + gi_chkNotificationCount); gi_chkNotificationCount = 0; e0[0].style.height = null; } } //ポップアップタイプのボタン付きダイアログを表示 function popupConfirm(dispMsg, btn1Text, btn1Func, btn2Text, btn2Func, btn3Text, btn3Func){ var msg = ""; var e; closePopupConfirm(); msg += "
" + dispMsg + ""; if( btn1Text != "" && btn1Text !== null && btn1Text !== undefined ){ msg += "
"; } if( btn2Text != "" && btn2Text !== null && btn2Text !== undefined ){ msg += "
"; } if( btn3Text != "" && btn3Text !== null && btn3Text !== undefined ){ msg += "
"; } msg += "
"; gelm_fixedConfirm = 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; } } if( btn2Text != "" && btn2Text !== null && btn2Text !== undefined ){ e = document.getElementById('ELM_CONFIRM_BTN2'); if( e !== null ){ e.onclick = btn2Func; } } if( btn3Text != "" && btn3Text !== null && btn3Text !== undefined ){ e = document.getElementById('ELM_CONFIRM_BTN3'); if( e !== null ){ e.onclick = btn3Func; } } } //自動更新を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){ localStorage.setItem( AUTOOFF_HEADER + u, 0 ); dispPopupMessage("自動更新を通常モードに切り替えました", gi_displayPopupCloseTimeSec); } }else{ //AUTO = OFFにする gi_modeAutoOff = 1; if(u.length > 2){ localStorage.setItem( 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){ localStorage.setItem( IDLETM_HEADER + u, gi_idleShortTimer ); } //どちらの設定であっても切り替えられたら短周期タイマを再開させる if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceEtements, 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 + " "; } localStorage.setItem( EDITDISP_HEADER, gi_hideEditControl ); //console.log("★setItem" + EDITDISP_HEADER + " = " + gi_hideEditControl); } } //新着件数表示の表示非表示切り替え function swichDispNumberNewTweet(noMessage){ if( gi_dispMode != MODE_HOME ) return; var e0, e1; //要素変更 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; } localStorage.setItem( NEWTWDISP_HEADER, gi_hideNumberNewTweet ); if( ! noMessage ){ if( gi_hideNumberNewTweet ){ dispPopupMessage("新着件数の表示をOFFにしました", gi_displayPopupCloseTimeSec); }else{ dispPopupMessage("新着件数の表示をONにしました", gi_displayPopupCloseTimeSec); } } } } //ポップアップのためのエレメントを生成してメッセージを下部に表示する // msg=表示テキスト, // tim_sec=表示時間(-1指定時は自動的に消さない), // fgcolor=文字色rgbテキスト(省略時白) // bgcolor=背景色rgbテキスト(省略時Twitterテーマカラー) // typeHTML=テキストでは無くinnerHTMLを差し込む // closeOnClick=ポップアップ自体のクリックで閉じる動作をする(=true) // floatOnTop=上に固定ポップアップする(=true) function dispPopupMessage(msg, tim_sec, fgcolor=null, bgcolor=null, typeHTML=false, closeOnClick=true, floatOnTop=false){ if( gi_displayPopupCloseTimeSec <= 0 ) return; 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 = ""; 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.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;}; 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"; 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.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; } 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){ var dt = (new Date()).getTime(); var val, attrTime, retry = 0; 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 + '"]'); for( var i=0; i < e0.length; i++ ){ val = e0[i].getAttribute(POPUP_ENDTIME); if( val !== null && val !== undefined && val !== "" && val != -1 ){ attrTime = Number(val); if( dt > attrTime ){ e0[0].remove(); //console.log("★popupRemoved " + dt + " / " + attrTime); }else{ window.setTimeout( closePopupMessage, 100 ); } } } } // ********************************************************************************* // 固定(永続化)ポップアップを削除する時はnullチェックしてからclosePopupMessage()を // 呼ばないと引数がnullだと複数スタックのポップアップを消す動作モードになってしまう // ********************************************************************************* //ボタンヘルプToolTipsを閉じる function closePopupToolTips(){ if( gelm_fixedToolTips !== null ) closePopupMessage(gelm_fixedToolTips); } //既読マーク捜索ポップアップを閉じる function closePopupFindMessage(){ if( gelm_fixedPopupFind !== null ) closePopupMessage(gelm_fixedPopupFind); } //既読マーク捜索(情報)ポップアップを閉じる function closePopupFindInfoMessage(){ if( gelm_fixedPopupFindInfo !== null ) closePopupMessage(gelm_fixedPopupFindInfo); } //新着クリア待ち中ポップアップを閉じる function closePopupClearNewTweetMessage(){ if( gelm_fixedPopupClearNewTweet !== null ) closePopupMessage(gelm_fixedPopupClearNewTweet); } //DM新着表示ポップアップを閉じる function closePopupClearNewDM(){ if( gelm_fixedPopupClearNewDM !== null ) closePopupMessage(gelm_fixedPopupClearNewDM); } //ボタン付きポップアップを閉じる function closePopupConfirm(){ if( gelm_fixedConfirm !== null ) closePopupMessage(gelm_fixedConfirm); } //コンフィグのためのエレメントを生成してオーバーレイ表示する 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 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 + ""; 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 + ""; } 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回毎の待機時間100〜10000(ms)"; HTML += CRLF + " "; HTML += CRLF + "
情報表示部クリック時の動作
左ボタン(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 + "

" + PSEUDO_URL + "
"; 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.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; localStorage.setItem( 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"); localStorage.setItem( IDLETM_HEADER + u, gi_idleShortTimer ); //どちらの設定であっても切り替えられたら短周期タイマを再開させる if( gtmr_shortTimer === null ){ gtmr_shortTimer = window.setInterval(replaceEtements, 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_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"); localStorage.setItem( 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"); localStorage.setItem( 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"); localStorage.setItem( RESSRTTMR_HEADER[2], 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"); localStorage.setItem( RESSRTTMR_HEADER[3], 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"); localStorage.setItem( RESSRTTMR_HEADER[4], 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"); localStorage.setItem( RESSRTTMR_HEADER[5], 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"); localStorage.setItem( AUTOMARK_HEADER[0], 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"); localStorage.setItem( AUTOMARK_HEADER[1], 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"); localStorage.setItem( AUTOMARK_HEADER[2], 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"); localStorage.setItem( AUTOMARK_HEADER[3], 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"); localStorage.setItem( AUTOMARK_HEADER[4], 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"); localStorage.setItem( AUTOMARK_HEADER[5], 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"); localStorage.setItem( CLRNEWTW_HEADER[0], 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"); localStorage.setItem( CLRNEWTW_HEADER[1], 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"); localStorage.setItem( CLRNEWTW_HEADER[2], 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"); localStorage.setItem( CLRNEWTW_HEADER[3], 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"); localStorage.setItem( CLRNEWTW_HEADER[4], 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"); localStorage.setItem( CLRNEWTW_HEADER[5], 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"); localStorage.setItem( MANTRIG_HEADER[0], 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"); localStorage.setItem( MANTRIG_HEADER[1], 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"); localStorage.setItem( MANTRIG_HEADER[2], 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"); localStorage.setItem( MANTRIG_HEADER[3], 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"); localStorage.setItem( MANTRIG_HEADER[4], 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"); localStorage.setItem( MANTRIG_HEADER[5], 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"); localStorage.setItem( CONTNEW_HEADER[0], 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"); localStorage.setItem( CONTNEW_HEADER[1], 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"); localStorage.setItem( CONTNEW_HEADER[2], 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"); localStorage.setItem( CONTNEW_HEADER[3], 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"); localStorage.setItem( CONTNEW_HEADER[4], 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"); localStorage.setItem( CONTNEW_HEADER[5], 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"); localStorage.setItem( FINDMODE_HEADER[0], 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"); localStorage.setItem( FINDMODE_HEADER[1], 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"); localStorage.setItem( FINDMODE_HEADER[2], 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"); localStorage.setItem( FINDMODE_HEADER[3], 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"); localStorage.setItem( FINDMODE_HEADER[4], 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"); localStorage.setItem( FINDMODE_HEADER[5], giA_findReadPointButton[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"); localStorage.setItem( 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"); localStorage.setItem( FINDPOPUP_HEADER + u, gi_findModeDispPopup ); 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',100,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',100,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].onclick = function(e){e.stopPropagation(); deletePageSetting(); return false;}; //情報部ボタン設定の削除 e[0] = document.getElementById('ELM_BTNSETTING_CLEAR'); e[0].onclick = function(e){e.stopPropagation(); deleteButtonSetting(); return false;}; //設定画面を閉じる e[0] = document.getElementById('ELM_CLOSE'); e[0].style.width = "100px"; 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 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 + "
設定項目設定範囲/選択肢設定値
テーマカラー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:表示しない
同一の記事を並べないHIDE:重複は非表示
DISP:重複でも表示する
画像サムネイル左クリックで別タブに表示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 + "

" + PSEUDO_URL + "
"; 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.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"); localStorage.setItem( COLORMODE_HEADER, 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"); localStorage.setItem( CHGTIME_HEADER, 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"); localStorage.setItem( CLICKNEW_HEADER, 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"); localStorage.setItem( MANTRIGNEW_HEADER, 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_enableTimeAutoOff==1)?"ON":"OFF"); e[0].onclick = function(e){ e.stopPropagation(); gi_enableTimeAutoOff = (gi_enableTimeAutoOff==1)?0:1; e.target.value = ((gi_enableTimeAutoOff==1)?"ON":"OFF"); localStorage.setItem( ENDOMTIME_HEADER, gi_enableTimeAutoOff ); 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"); localStorage.setItem( NODISPSAME_HEADER, 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"); localStorage.setItem( IMAGENEW_HEADER, gi_displayImageNewTab ); 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"); localStorage.setItem( HELPPOPUP_HEADER, 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"); localStorage.setItem( READCHK_HEADER, 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"); localStorage.setItem( BGCYCLE_HEADER, 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"); localStorage.setItem( SEACSS_HEADER, 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].onclick = function(e){e.stopPropagation(); deleteAllData(); return false;}; //既読ポイントの削除 e[0] = document.getElementById('ELM_READ_CLEAR'); e[0].onclick = function(e){e.stopPropagation(); deleteReadPointData(); return false;}; //設定画面を閉じる e[0] = document.getElementById('ELM_CLOSE'); e[0].style.width = "100px"; 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,1000,1500,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,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){ 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){ 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){ 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){ var i; switch(tgt){ case "ELM_INTERVAL_TIME": giA_updateIntervalMs[gi_dispMode] = val * 1000; localStorage.setItem( 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; localStorage.setItem( RELOAD_HEADER + u, val ); break; case "ELM_HOLD_TIME": gi_manualUpdateIntervalSec = val; localStorage.setItem( 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; localStorage.setItem( READCOUNT_HEADER, val ); break; case "ELM_SHORT_INTVL": gi_shortIntervalMs = val; localStorage.setItem( SHORTINTVL_HEADER, val ); break; case "ELM_SHORT_IDLE_TIME": //短周期タイマを一時停止させる設定は秒で編集するのでミリ秒に戻す gi_shortTimerIdleMs = val * 1000; localStorage.setItem( IDLESHORT_HEADER, (val * 1000) ); break; case "ELM_INIT_WAIT": //起動時待ち合わせ時間は秒で編集するのでミリ秒に戻す gi_initWaitMs = val * 1000; localStorage.setItem( INITWAIT_HEADER, (val * 1000) ); break; case "ELM_ONTOP_WAIT": //スクロールをトップに戻したあとのトリガまでの時間は秒で編集するのでミリ秒に戻す gi_onTopWaitMs = val * 1000; localStorage.setItem( ONTOPWAIT_HEADER, (val * 1000) ); break; case "ELM_RELOAD_WAIT": gi_reloadWaitMs = val; localStorage.setItem( RELOADWAIT_HEADER, val ); break; case "ELM_LOCK_TIME": gi_forceUpdateLockTimeSec = val; localStorage.setItem( LOCKTIME_HEADER, val ); break; case "ELM_POPUP_TIME": gi_displayPopupCloseTimeSec = val; localStorage.setItem( POPUPTIME_HEADER, val ); break; case "ELM_DSP_OPACITY": gf_dispUnitOpacity = Number(val) / 100.0; //opacity0.0〜1.0を0〜100で設定しているので小数に戻す localStorage.setItem( OPACITY_HEADER, (Number(val)/100.0) ); break; case "ELM_CHKEN_OPACITY": CHECKBOX_ENABLE_OPACITY = Number(val) / 100.0; //opacity0.0〜1.0を0〜100で設定しているので小数に戻す localStorage.setItem( CHKENAOP_HEADER, (Number(val)/100.0) ); break; case "ELM_CHKDI_OPACITY": //opacity0.0〜1.0を0〜100で設定しているので小数に戻す CHECKBOX_DISABLE_OPACITY = Number(val) / 100.0; localStorage.setItem( CHKDISOP_HEADER, (Number(val)/100.0) ); break; case "ELM_INFOWIDTH": DISPINFO_WIDTH = val + "px"; localStorage.setItem( INFOWIDTH_HEADER, val + "px" ); break; case "ELM_INFOHEIGHT": DISPINFO_HEIGHT = val + "px"; localStorage.setItem( INFOHEIGHT_HEADER, 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(); } gb_changedSetting = false; } //ヘルプ・設定情報表示ウィンドウ表示 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_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_clearNewNotification[0] && ntf){ msg += SPC + "      +新着表示色クリア"; } 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(ntf){ msg += SPC + "      +タイマリセット"; } if(giA_clearNewNotification[1] && ntf){ msg += SPC + "      +新着表示色クリア"; } msg += SPC + "------------------------------------"; msg += SPC + "情報表示欄(中央ボタン)" + BTN_TXT_BTNM; 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_clearNewNotification[2] && ntf){ msg += SPC + "      +新着表示色クリア"; } 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(ntf){ msg += SPC + "      +タイマリセット"; } if(giA_clearNewNotification[3] && ntf){ msg += SPC + "      +新着表示色クリア"; } msg += SPC + "------------------------------------"; msg += SPC + "情報表示欄(右側ボタン)" + BTN_TXT_BTNR; 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_clearNewNotification[4] && ntf){ msg += SPC + "      +新着表示色クリア"; } 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(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_enableTimeAutoOff ){ 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, ""); 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] = window.localStorage.getItem( READ_HEADER[idx] + u ); if( gstrA_readArticleURL[idx] === null ) gstrA_readArticleURL[idx] = ""; gstrA_readTimeStamp[idx] = window.localStorage.getItem( READTM_HEADER[idx] + u ); 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){ 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 Help & Information
"; HTML += CRLF + "Path=" + decodeURIComponent(u) + "
"; HTML += CRLF + "
"; HTML += CRLF + ""; HTML += CRLF + ""; HTML += CRLF + "
"; HTML += CRLF + msg; HTML += CRLF + "
"; HTML += CRLF + "

" + PSEUDO_URL + "
"; 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.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 = "100px"; 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.indexOf(INTERVAL_HEADER) == 0 || keys.indexOf(AUTOOFF_HEADER) == 0 || keys.indexOf(IDLETM_HEADER) == 0 || keys.indexOf("PTD_") == 0 ){ window.localStorage.removeItem(keys); removeCount++; } for( var i=0; i < gi_readArticles; i++ ){ if( keys.indexOf(READ_HEADER[i]) == 0 ){ window.localStorage.removeItem(keys); removeCount++; } if( keys.indexOf(READTM_HEADER[i]) == 0 ){ window.localStorage.removeItem(keys); removeCount++; } } } if( removeCount > 0 ){ window.alert("  " + removeCount + "件のデータを削除しました\r\n  リロードします"); window.location.reload(); }else{ window.alert("  該当データはありませんでした"); } } //既読ポイントのみクリア function deleteReadPointData(){ if( window.confirm("  自動更新スクリプトが保存した\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); for( var i=0; i < gi_readArticles; i++ ){ if( keys.indexOf(READ_HEADER[i]) == 0 ){ window.localStorage.removeItem(keys); removeCount++; } if( keys.indexOf(READTM_HEADER[i]) == 0 ){ window.localStorage.removeItem(keys); removeCount++; } } } window.alert("  " + removeCount + "件のデータを削除しました"); } //情報表示部ボタンの設定のみクリア function deleteButtonSetting(){ if( window.confirm("  情報表示部ボタンの設定データを初期化しますか?\r\n  ※削除後にリロードが必要になります") == false ) return; var idx,btnIdx; var imax = window.localStorage.length; var keys; var removeCount = 0; for( idx = imax - 1; idx > -1; idx-- ){ keys = "" + window.localStorage.key(idx); for( btnIdx=0; btnIdx 0 ){ window.alert("  " + removeCount + "件のデータを削除しました\r\n  リロードします"); window.location.reload(); }else{ window.alert("  該当データはありませんでした"); } } //表示中ページの設定のみクリア function deletePageSetting(){ var u = window.location.href; if(u.length < (TWITTER_URL.length + 4)) return; u = u.replace(TWITTER_URL, ""); if( window.confirm("  [" + u + "]\r\n  このURL用の設定データを初期化しますか?\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.indexOf("PTD_") == 0 && keys.indexOf("-" + u) > 7 ){ window.localStorage.removeItem(keys); console.log("★remove " + keys); removeCount++; } } if( removeCount > 0 ){ window.alert("  " + removeCount + "件のデータを削除しました\r\n  リロードします"); window.location.reload(); }else{ window.alert("  該当データはありませんでした"); } } //DEBUG function testFunction(){ // } //メイン処理 (function() { //システム設定の読み込み loadSystemSettings(); //背景色テーブルの初期化 setupBgColorTables(); //初期処理の遅延実行 window.setTimeout(clearElements, gi_initWaitMs); //短周期処理開始 gtmr_shortTimer = window.setInterval(replaceEtements, gi_shortIntervalMs); gstr_lastShortStart = new Date(); //console.log("★gtmr_shortTimer: START[FIRST]"); //更新処理開始 window.setInterval(updateTimeline, gi_timerIntervalMs); })();