Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
akoya-tomo committed Dec 29, 2017
2 parents 7655d7d + 2f495c1 commit eacf55c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 28 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

Firefoxの場合、[Tampermonkey](https://addons.mozilla.org/ja/firefox/addon/tampermonkey/)を先にインスールしてからスクリプトをインストールして下さい。
(GreasemonkeyやViolentmonkeyでの動作は未確認です)
ChromeやOperaでの動作は未確認です。既読スレピックアップ機能が動作しないのでオリジナル版の使用を推奨します
Chromeの場合、[Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo)を先にインスールしてからスクリプトをインストールして下さい

※このUserscriptはFirefoxアドオン[KOSHIAN Catarog Marker kai](https://github.com/akoya-tomo/koshian_catalog_marker_kai)との併用を推奨しています。
[赤福Firefox SP](http://toshiakisp.github.io/akahuku-firefox-sp/)[ふたクロ](http://futakuro.com/)にも一応対応しているはずですが、オリジナル版の使用を推奨します。
[赤福Firefox SP](http://toshiakisp.github.io/akahuku-firefox-sp/)[ふたクロ](http://futakuro.com/)でも動作しますが、既読スレピックアップ機能は使用できません。

KOSHIANアドオン改変版は[こちら](https://github.com/akoya-tomo/futaba_auto_reloader_K/wiki)の一覧からどうぞ
その他のUserscriptとKOSHIANアドオン派生版は[こちら](https://github.com/akoya-tomo/futaba_auto_reloader_K/wiki)の一覧からどうぞ

## 使い方
* ふたばのカタログモードの設定で「文字数」を適当な大きさ(4以上推奨)に設定してください。(板毎に設定が必要です)
Expand All @@ -20,7 +20,7 @@ ChromeやOperaでの動作は未確認です。既読スレピックアップ機
検索ワードは全板共通と各板個別でそれぞれ設定できます。
* (rev1)KOSHIAN Catarog Marker kaiとの連携で既読スレをピックアップできます。(デフォルト:有効)
* (rev1)タブの表示を「板名(二次裏のみサーバー名)+ソート名(カタログ・新順・古順etc)」に変更します。(デフォルト:有効)
* (rev1)ねないこのNGスレをピックアップしないようにしました
* (rev1)[合間合間に](http://toshiakisp.github.io/akahuku-firefox-sp/#others)のNGスレをピックアップしないようにしました

## インストール
[GreasyFork](https://greasyfork.org/ja/scripts/36639-futaba-thread-highlighter-k) 
Expand All @@ -42,14 +42,17 @@ ChromeやOperaでの動作は未確認です。既読スレピックアップ機
* Firefoxアドオン[ねないこ](http://nenaiko.sakura.ne.jp/nenaiko/)と併用する場合は、ねないこの設定より「カタログ2」→「カタログ本文のスタイルを指定する」のチェックを外してください。

## 更新履歴
* v1.6.6rev4 2017-12-29
- 合間合間にのNGスレをピックアップ除外する処理の不具合修正
- ピックアップ欄のスレから合間合間にのボタンを削除
* v1.6.6rev3 2017-12-24
- マーク監視開始前にマーク完了が来た時の処理を変更
* v1.6.6rev2 2017-12-24
- マーク監視タイムアウト処理に失敗することがあるのを修正
* v1.6.6rev1 2017-12-23
- KOSHIAN Catarog Marker kaiとの連携で既読スレのピックアップ機能を追加
- 板名+ソート名をタブに表示する機能を追加
- ねないこのNGスレをピックアップしないように変更
- 合間合間にのNGスレをピックアップしないように変更

***

Expand Down
56 changes: 33 additions & 23 deletions futaba_thread_highlighter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @description スレ本文を検索してカタログでスレッド監視しちゃう
// @include http://*.2chan.net/*/futaba.php?mode=cat*
// @include https://*.2chan.net/*/futaba.php?mode=cat*
// @version 1.6.6rev3
// @version 1.6.6rev4
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// @grant GM_registerMenuCommand
// @grant GM_getValue
Expand Down Expand Up @@ -428,19 +428,20 @@ this.$ = this.jQuery = jQuery.noConflict(true);
if( words !== "" ) {
removeOldHighlighted();
$("body > table[border] td small").each(function(){
if( $(this).text().match(re) &&
( $(this).parent("td").attr("style") != "display: none;" ) && //ねないこNGスレ判定追加
( $(this).attr("style") != "display: none;" )) { //ねないこNGスレ判定追加
if ( !$(this).children(".GM_fth_matchedword").length ) {
$(this).html($(this).html().replace(re,
"<span class='GM_fth_matchedword'>" +
$(this).text().match(re)[0] +
"</span>"));
}
if ( $(this).parent("a").length ) { //文字スレ
$(this).parent().parent("td").addClass("GM_fth_highlighted");
} else {
$(this).parent("td").addClass("GM_fth_highlighted");
if( $(this).text().match(re) ) {
if( (($(this).parent("td").attr("style") + "").indexOf("display: none;") == -1 ) && //合間合間にNGスレ判定追加
(($(this).attr("style") + "").indexOf("display: none;") == -1 )) { //合間合間にNGスレ判定追加
if ( !$(this).children(".GM_fth_matchedword").length ) {
$(this).html($(this).html().replace(re,
"<span class='GM_fth_matchedword'>" +
$(this).text().match(re)[0] +
"</span>"));
}
if ( $(this).parent("a").length ) { //文字スレ
$(this).parent().parent("td").addClass("GM_fth_highlighted");
} else {
$(this).parent("td").addClass("GM_fth_highlighted");
}
}
}
});
Expand Down Expand Up @@ -480,6 +481,8 @@ this.$ = this.jQuery = jQuery.noConflict(true);
$(this).children("small").html() + "</div>");
$(this).children("br").replaceWith();
}
//合間合間にのボタンを削除
$(this).children("small.aima_aimani_generated").replaceWith();
$(this).replaceWith("<div class='GM_fth_pickuped'>" + $(this).html() + "</div>");
});
var $pickuped = $(".GM_fth_pickuped");
Expand All @@ -499,8 +502,8 @@ this.$ = this.jQuery = jQuery.noConflict(true);
if ( $("#GM_fth_highlighted_threads .GM_fth_opened").length ) {
$("#GM_fth_highlighted_threads .GM_fth_opened").remove();
}
//ピックアップ済みは除外
var kcm_opened = $("body > table td[class = 'GM_kcm_opened'][class != 'GM_fth_pickuped']").clone();
//合間合間にNGスレ(スレを無かった事にする設定)とピックアップ済みは除外
var kcm_opened = $("body > table td:not([style *= 'display: none;'])[class = 'GM_kcm_opened'][class != 'GM_fth_pickuped']").clone();
//KOSHIAN_CATALOG_MARKER_STYLEが未設定ならマークされたスタイルをコピー
if (kcm_opened.length && !openedThreadCssText) {
openedThreadCssText = kcm_opened.get(0).style.cssText;
Expand All @@ -510,15 +513,22 @@ this.$ = this.jQuery = jQuery.noConflict(true);
$("#GM_fth_highlighted_threads").append(kcm_opened);
//要素の中身を整形
kcm_opened.each(function(){
if ( !$(this).children("small").length ) { //文字スレ
//console.log($(this).children("a").html());
//$(this).children("a").replaceWith("<div class='GM_fth_opened_caption'>" + $(this).html() + "</div>");
//合間合間にNGスレは除去
if ( $(this).find("small[style *= 'display: none;']").length ) {
$(this).remove();
} else {
$(this).children("small:not(.aima_aimani_generated)").replaceWith("<div class='GM_fth_opened_caption'>" +
$(this).children("small").html() + "</div>");
$(this).children("br").replaceWith();
if ( !$(this).children("small").length ) { //文字スレ
//console.log($(this).children("a").html());
//$(this).children("a").replaceWith("<div class='GM_fth_opened_caption'>" + $(this).html() + "</div>");
} else {
$(this).children("small:not(.aima_aimani_generated)").replaceWith("<div class='GM_fth_opened_caption'>" +
$(this).children("small").html() + "</div>");
$(this).children("br").replaceWith();
}
//合間合間にのボタンを削除
$(this).children("small.aima_aimani_generated").replaceWith();
$(this).replaceWith("<div class='GM_fth_opened'>" + $(this).html() + "</div>");
}
$(this).replaceWith("<div class='GM_fth_opened'>" + $(this).html() + "</div>");
});
var $fth_opened = $(".GM_fth_opened");
$fth_opened.each(function(){
Expand Down

0 comments on commit eacf55c

Please sign in to comment.