From 885aa941a247a2658299f8bdc6cf0bdd40bc0f2c Mon Sep 17 00:00:00 2001 From: akoya-tomo Date: Fri, 7 Jun 2019 05:07:57 +0900 Subject: [PATCH 1/5] =?UTF-8?q?cell=5Fmap=E7=99=BB=E9=8C=B2=E6=99=82?= =?UTF-8?q?=E3=81=AB=E6=97=A2=E3=81=ABpopup=20container=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8C=E3=81=B0=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koshian_image_popuper/cat.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/koshian_image_popuper/cat.js b/koshian_image_popuper/cat.js index 1e52559..d3bd38b 100644 --- a/koshian_image_popuper/cat.js +++ b/koshian_image_popuper/cat.js @@ -496,8 +496,15 @@ function setCellMap(target_list, name, index) { continue; } - let dummy = document.createElement("a"); - target.appendChild(dummy); + // 既存のポップアップコンテナがあれば削除 + let containers = target.getElementsByClassName("KOSHIAN_image_popup_container"); + for (let container of containers) { + container.remove(); + } + + let container = document.createElement("a"); + container.className = "KOSHIAN_image_popup_container"; + target.appendChild(container); let a = a_list[0]; let img = img_list[0]; @@ -511,7 +518,7 @@ function setCellMap(target_list, name, index) { font = "(" + font_list[0].textContent + ")"; } - cell_map.push(new Cell(a.href, dummy, img, img_src, comment, font, index)); + cell_map.push(new Cell(a.href, container, img, img_src, comment, font, index)); ++index; } return index; From 5dfbbc3a1495f8061387de728592ebfc822761c1 Mon Sep 17 00:00:00 2001 From: akoya-tomo Date: Fri, 7 Jun 2019 05:29:04 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E4=B8=80=E5=BA=A6=E9=96=8B=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=83=9D=E3=83=83=E3=83=97=E3=82=A2=E3=83=83=E3=83=97?= =?UTF-8?q?=E7=94=BB=E5=83=8F=E3=83=BB=E5=8B=95=E7=94=BB=E3=81=AEurl?= =?UTF-8?q?=E3=82=92=E3=83=AA=E3=83=AD=E3=83=BC=E3=83=89=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=82=E8=A8=98=E6=86=B6=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koshian_image_popuper/cat.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/koshian_image_popuper/cat.js b/koshian_image_popuper/cat.js index d3bd38b..769df25 100644 --- a/koshian_image_popuper/cat.js +++ b/koshian_image_popuper/cat.js @@ -190,6 +190,11 @@ class Cell{ this.setVideo(media_url); } + let ss_obj = {}; + ss_obj.media_url = media_url; + ss_obj.thre_text = thre_text; + sessionStorage[this.img_src] = JSON.stringify(ss_obj); + //this.loaded = true; } @@ -224,6 +229,29 @@ class Cell{ this.setImage(media_url); } //this.loaded = true; + } else if (sessionStorage.getItem(this.img_src)) { + let ss_json = sessionStorage.getItem(this.img_src), ss_obj; + if (ss_json) { + ss_obj = JSON.parse(ss_json); + } else { + ss_obj = {}; + } + let media_url = ss_obj.media_url; + let thre_text = ss_obj.thre_text; + + if (!media_url) { + return; + } + + if(thre_text){ + this.text.textContent = this.res_num + thre_text; + } + + if(isImage(media_url)){ + this.setImage(media_url); + }else{ + this.setVideo(media_url); + } } else { let xhr = new XMLHttpRequest(); xhr.responseType = "document"; From e342daf03aa786ed84491aa7db7eb1d073300fbd Mon Sep 17 00:00:00 2001 From: akoya-tomo Date: Fri, 7 Jun 2019 05:36:23 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koshian_image_popuper/cat.js | 37 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/koshian_image_popuper/cat.js b/koshian_image_popuper/cat.js index 769df25..fe61a12 100644 --- a/koshian_image_popuper/cat.js +++ b/koshian_image_popuper/cat.js @@ -198,7 +198,7 @@ class Cell{ //this.loaded = true; } - onThreNotFound(e){ + onThreNotFound(e){ // eslint-disable-line no-unused-vars let media_url = browser.extension.getURL("img/ThreadNotFound.png"); //console.log("cat.js : media_url = " + media_url); this.setImage(media_url); @@ -210,11 +210,11 @@ class Cell{ this.setImage(media_url); //this.loading = false; this.img.error = true; - console.log("KOSHIAN_image_popuper/cat.js - onThreError(e):"); + console.error("KOSHIAN_image_popuper/cat.js/onThreError - " + e.name + ": " + e.message); console.dir(e); } - onThreTimeout(e){ + onThreTimeout(e){ // eslint-disable-line no-unused-vars let media_url = browser.extension.getURL("img/TimeOut.png"); this.setImage(media_url); this.img.error = true; @@ -257,13 +257,14 @@ class Cell{ xhr.responseType = "document"; xhr.timeout = 60000; xhr.open('GET', this.link); - xhr.onload = (e) => {if(xhr.status == 200){ - this.onThreLoad(xhr.responseXML); - } - if(xhr.status == 404){ - this.onThreNotFound(e); - } - }; + xhr.onload = (e) => { + if(xhr.status == 200){ + this.onThreLoad(xhr.responseXML); + } + if(xhr.status == 404){ + this.onThreNotFound(e); + } + }; xhr.onerror = (e) => {this.onThreError(e);}; xhr.ontimeout = (e) => {this.onThreTimeout(e);}; xhr.send(); @@ -377,9 +378,7 @@ class Cell{ if(this.img && this.img.error){ this.img = null; - while(this.popup.firstChild){ - this.popup.removeChild(this.popup.firstChild); - } + this.popup.textContent = null; // 子要素全削除 this.loading = false; this.loaded = false; } @@ -511,7 +510,9 @@ function isCatalog(){ function setCellMap(target_list, name, index) { let hasClass = name.charAt(0) == "."; // nameの先頭が"."ならclassNameとして処理 - if(hasClass) name = name.substr(1); + if(hasClass) { + name = name.substr(1); + } for(let i = 0; i < target_list.length; ++i){ let target = target_list[i]; @@ -553,7 +554,7 @@ function setCellMap(target_list, name, index) { } -function onError(error){ +function onError(error){ // eslint-disable-line no-unused-vars } function safeGetValue(value, default_value){ @@ -644,14 +645,16 @@ function onLoad(){ } else { document.addEventListener("AkahukuContentApplied", () => { target = document.getElementById("akahuku_catalog_reload_status"); - if (target) checkAkahukuReload(); + if (target) { + checkAkahukuReload(); + } }); } function checkAkahukuReload() { let config = { childList: true }; let observer = new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { + mutations.forEach(function(mutation) { // eslint-disable-line no-unused-vars if (target.textContent == status) return; status = target.textContent; if (status == "完了しました" || status == "アンドゥしました" || status == "リドゥしました") { From 9340c7ef935ad76067004ba89a61a2746989752b Mon Sep 17 00:00:00 2001 From: akoya-tomo Date: Fri, 7 Jun 2019 05:40:23 +0900 Subject: [PATCH 4/5] =?UTF-8?q?README.md=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 916e430..81cd2c9 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ サムネ使用時はエラーの種類に関わらず「スレ画像削除」のエラー画像が表示されます。 - 過剰なリクエストの抑制 サーバーへの過剰なリクエストを抑制しました。デメリットとしてポップアップまでの時間の最小値が300ミリ秒に制限されます。表示の遅れが気になるときはサムネ使用をご検討下さい。 - - ![\(New\)](images/new.png "New") [KOSHIAN リロード拡張 改](https://github.com/akoya-tomo/koshian_reload_futaba_kai/)のページ更新無しでのカタログリロードに対応 + - [KOSHIAN リロード拡張 改](https://github.com/akoya-tomo/koshian_reload_futaba_kai/)のページ更新無しでのカタログリロードに対応 ## インストール **GitHub** -[![インストールボタン](images/install_button.png "クリックでアドオンをインストール")](https://github.com/akoya-tomo/koshian_image_popuper_kai/releases/download/v1.6.2/koshian_image_popuper_kai-1.6.2-fx.xpi) +[![インストールボタン](images/install_button.png "クリックでアドオンをインストール")](https://github.com/akoya-tomo/koshian_image_popuper_kai/releases/download/v1.6.3/koshian_image_popuper_kai-1.6.3-fx.xpi) ※「接続エラーのため、アドオンをダウンロードできませんでした。」と表示されてインストール出来ない時は、インストールボタンを右クリックしてxpiファイルをダウンロードし、メニューのツール→アドオン(またはCtrl+Shift+A)で表示されたアドオンマネージャーのページにxpiファイルをドラッグ&ドロップして下さい。 @@ -54,6 +54,9 @@ * [futaba thread highlighter K](https://greasyfork.org/ja/scripts/36639-futaba-thread-highlighter-k/)がピックアップしたスレの画像もポップアップさせたい場合はfutaba thread highlighter K **rev13以上**をインストールして下さい。 ## 更新履歴 +* v1.6.3 2019-06-07 + - Firefox 68以降でポップアップが表示されたままになる不具合を修正 + - 一度開いたポップアップ画像・動画のurlをリロードしても記憶するように修正 * v1.6.2 2019-05-17 - KOSHIAN リロード拡張 改のページ更新無しでのカタログリロードに対応 * v1.6.1 2019-05-15 From 1d3d6d2f2d980e81266184eefa16bf0302a147dc Mon Sep 17 00:00:00 2001 From: akoya-tomo Date: Fri, 7 Jun 2019 05:47:35 +0900 Subject: [PATCH 5/5] v1.6.3 --- koshian_image_popuper/manifest.json | 2 +- updates.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koshian_image_popuper/manifest.json b/koshian_image_popuper/manifest.json index 249aff1..b2b5378 100644 --- a/koshian_image_popuper/manifest.json +++ b/koshian_image_popuper/manifest.json @@ -3,7 +3,7 @@ "name":"KOSHIAN カタログの画像をポップアップで表示 改", - "version":"1.6.2", + "version":"1.6.3", "description":"スレ画像をポップアップ表示します", diff --git a/updates.json b/updates.json index cec5ab7..913c05c 100644 --- a/updates.json +++ b/updates.json @@ -2,7 +2,7 @@ "addons": { "{4B803436-E2DF-11E7-8568-2E3D1843E317}": { "updates": [ - { "version": "1.6.2", "update_link": "https://github.com/akoya-tomo/koshian_image_popuper_kai/releases/download/v1.6.2/koshian_image_popuper_kai-1.6.2-fx.xpi" } + { "version": "1.6.3", "update_link": "https://github.com/akoya-tomo/koshian_image_popuper_kai/releases/download/v1.6.3/koshian_image_popuper_kai-1.6.3-fx.xpi" } ] } }