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 Sep 25, 2018
2 parents c8766b2 + 30023c6 commit 8c54097
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 23 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## インストール
**GitHub**
[![インストールボタン](images/install_button.png "クリックでアドオンをインストール")](https://github.com/akoya-tomo/koshian_ng_kai/releases/download/v1.3.0/koshian_ng_kai-1.3.0-an+fx.xpi)
[![インストールボタン](images/install_button.png "クリックでアドオンをインストール")](https://github.com/akoya-tomo/koshian_ng_kai/releases/download/v1.3.1/koshian_ng_kai-1.3.1-fx.xpi)

※「接続エラーのため、アドオンをダウンロードできませんでした。」と表示されてインストール出来ないときはインストールボタンを右クリックしてxpiファイルをダウンロードし、メニューのツール→アドオン(またはCtrl+Shift+A)で表示されたアドオンマネージャーのページにxpiファイルをドラッグ&ドロップして下さい。

Expand All @@ -42,6 +42,8 @@
- 永続的な登録を必要としないIDやIPの登録を想定しています。

## 更新履歴
* v1.3.1 2018-09-26
- NGにしたレスの画像が[futaba lightbox](https://github.com/himuro-majika/futaba_lightbox/)で表示されないように修正
* v1.3.0 2018-09-12
- \[NGワード\]ボタンにマウスオーバーすると該当したNGワードをポップアップ表示する機能を追加
- ツールバーボタンを押したときに選択した文字列に正規表現でエスケープが必要な文字が含まれていたらエスケープを追加するように修正
Expand Down
2 changes: 1 addition & 1 deletion koshian_ng/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name":"KOSHIAN NG 改",

"version":"1.3.0",
"version":"1.3.1",

"applications": {
"gecko": {
Expand Down
34 changes: 17 additions & 17 deletions koshian_ng/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<head>
<meta charset="utf-8">
<title>KOSHIAN NG</title>
<script src="options.js"></script>
<style type="text/css">
.title {font-size: 150%}
Expand All @@ -29,23 +30,22 @@
<label for="hide_size">[隠す]ボタンのサイズ</label>
</p>
<ul style="list-style-type: none">
<p>
NGワード (正規表現が使えます)<br>
<input type="text" id="ng_input" placeholder="NGワードを入力" autofocus>
<input type="button" value="追加", id = "ng_submit">
<br>
<input type="checkbox" id="check_body">
<label for="check_body">本文 </label>
<input type="checkbox" id="check_header">
<label for="check_header">メール欄など </label>
<input type="checkbox" id="ignore_case">
<label for="ignore_case" >大文字/小文字を区別しない </label>
</p>
<p><div class="col_btn"> </div><div class="col_check">本文</div><div class="col_check">メ欄</div><div class="col_check">大/小</div><div class="col_text"> NGワード</div></p>
<p id="ng_list">
</p>
</ul>

<p>
NGワード (正規表現が使えます)<br>
<input type="text" id="ng_input" placeholder="NGワードを入力" autofocus>
<input type="button" value="追加", id = "ng_submit">
<br>
<input type="checkbox" id="check_body">
<label for="check_body">本文 </label>
<input type="checkbox" id="check_header">
<label for="check_header">メール欄など </label>
<input type="checkbox" id="ignore_case">
<label for="ignore_case" >大文字/小文字を区別しない </label>
</p>
<p><div class="col_btn"> </div><div class="col_check">本文</div><div class="col_check">メ欄</div><div class="col_check">大/小</div><div class="col_text"> NGワード</div></p>
<p id="ng_list">
</p>
</ul>
</body>

</html>
4 changes: 2 additions & 2 deletions koshian_ng/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let g_ng_word_list = [];
let g_check_body = null;
let g_check_header = null;
let g_ignore_case = null;
let g_put_hide_button = true;
let g_hide_size = 16;
let g_put_hide_button = null;
let g_hide_size = null;

/* eslint indent: ["warn", 2] */

Expand Down
32 changes: 31 additions & 1 deletion koshian_ng/res.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const FUTABA_LIGHTBOX_CLASS = "futaba_lightbox";
const FUTABA_LIGHTBOX_HIDDEN_CLASS = "futaba_lightbox_hidden";

let hide_completely = false;
let ng_word_list = [];
let put_hide_button = true;
Expand Down Expand Up @@ -35,13 +38,19 @@ function switchNG(e){
blockquote.style.display = "block";
if(a_img){
a_img.style.display = "block";
if (a_img.className == FUTABA_LIGHTBOX_HIDDEN_CLASS) {
a_img.className = FUTABA_LIGHTBOX_CLASS;
}
}
e.target.textContent = `[隠す]`;
}else{
// hide
blockquote.style.display = "none";
if(a_img){
a_img.style.display = "none";
if (a_img.className == FUTABA_LIGHTBOX_CLASS) {
a_img.className = FUTABA_LIGHTBOX_HIDDEN_CLASS;
}
}
e.target.textContent = `[NGワード]`;
}
Expand All @@ -60,13 +69,19 @@ function switchHide(e){
blockquote.style.display = "block";
if(a_img){
a_img.style.display = "block";
if (a_img.className == FUTABA_LIGHTBOX_HIDDEN_CLASS) {
a_img.className = FUTABA_LIGHTBOX_CLASS;
}
}
e.target.textContent = `[隠す]`;
}else{
// hide
blockquote.style.display = "none";
if(a_img){
a_img.style.display = "none";
if (a_img.className == FUTABA_LIGHTBOX_CLASS) {
a_img.className = FUTABA_LIGHTBOX_HIDDEN_CLASS;
}
}
e.target.textContent = `[見る]`;
}
Expand Down Expand Up @@ -95,9 +110,18 @@ function hide(block, ng_word){
}

function hideComopletely(block){
let response = block.parentNode;
let img = response.getElementsByTagName("img")[0];
let a_img = img ? img.parentNode : null;
for(let node = block.parentNode; node != null; node = node.parentNode){
if(node.nodeName == "TABLE"){
node.style.display = "none";
if(a_img){
a_img.style.display = "none";
if (a_img.className == FUTABA_LIGHTBOX_CLASS) {
a_img.className = FUTABA_LIGHTBOX_HIDDEN_CLASS;
}
}
break;
}
}
Expand All @@ -113,13 +137,19 @@ function show(response){
blockquote.style.display = "block";
if(a_img){
a_img.style.display = "block";
if (a_img.className == FUTABA_LIGHTBOX_HIDDEN_CLASS) {
a_img.className = FUTABA_LIGHTBOX_CLASS;
}
}
}

for(let node = response.parentNode; node; node = node.parentNode){
if(node.nodeName == "TABLE"){
if(show_deleted_res || node.className != "deleted"){
node.style.display = "table";
node.style.display = "";
if (a_img && a_img.className == FUTABA_LIGHTBOX_HIDDEN_CLASS) {
a_img.className = FUTABA_LIGHTBOX_CLASS;
}
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"addons": {
"{709CBCCE-3EDF-11E8-817A-C6D28A3A6C14}": {
"updates": [
{ "version": "1.3.0", "update_link": "https://github.com/akoya-tomo/koshian_ng_kai/releases/download/v1.3.0/koshian_ng_kai-1.3.0-an+fx.xpi" }
{ "version": "1.3.1", "update_link": "https://github.com/akoya-tomo/koshian_ng_kai/releases/download/v1.3.1/koshian_ng_kai-1.3.1-fx.xpi" }
]
}
}
Expand Down

0 comments on commit 8c54097

Please sign in to comment.