Skip to content

Commit 9780d9c

Browse files
committed
ver1.2の配布
1 parent 87e4596 commit 9780d9c

24 files changed

+2403
-9
lines changed

ForRelease/Latest-Release/latest./bin/Latest.js

+39-8
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,17 @@ class CommentManager {
309309
if ($("#" + n.pin_node.id).is(":visible")) {
310310
$("#" + n.pin_node.id).hide();
311311
}
312-
$(target_node).toggleClass("latest_button--six");
312+
if (!$(target_node).hasClass("latest_button--six")) {
313+
$(target_node).addClass("latest_button--six");
314+
}
313315
}
314316
else {
315317
if ($("#" + n.pin_node.id).is(":hidden")) {
316318
$("#" + n.pin_node.id).show();
317319
}
318-
$(target_node).toggleClass("latest_button--six");
320+
if ($(target_node).hasClass("latest_button--six")) {
321+
$(target_node).removeClass("latest_button--six");
322+
}
319323
}
320324
});
321325
}
@@ -408,19 +412,22 @@ class DB {
408412
}
409413
}
410414
class Mode {
411-
constructor() {
415+
constructor(munu) {
412416
this.flag = "read";
413417
this.writing = false;
418+
this.menu = menu;
414419
}
415420
/**
416421
* 状態を変更するための関数
417422
* @param command セットした状態
418423
*/
419424
Change_mode(command) {
420-
if (command != "wirte" && command != "read") {
421-
this.flag = "read";
425+
if (command == "none") {
426+
this.menu.nondisplay_menubar();
427+
}
428+
else {
429+
this.menu.display_menubar();
422430
}
423-
this.flag = command;
424431
}
425432
/**
426433
* 指定したモードになっているかどうかを返す
@@ -627,12 +634,22 @@ class Menu_Node {
627634
this.img_count += 1;
628635
this.img_root.style.setProperty(css_img_id, target_img_url);
629636
}
637+
display_menubar() {
638+
console.log("ttt");
639+
$('.' + this.menu_class).show();
640+
}
641+
nondisplay_menubar() {
642+
console.log("nondisplay");
643+
$('.' + this.menu_class).hide();
644+
}
630645
}
631646
class Share {
632647
constructor(urlmanage, comment_manager) {
633648
this.urlmanage = urlmanage;
634649
this.comment_manager = comment_manager;
635650
this.current_sharenum = urlmanage.sharenum;
651+
this.limit = false;
652+
this.setLimit = this.setLimit_false.bind(this);
636653
}
637654
get_Sharenum() {
638655
this.urlmanage.getParam("sharenum");
@@ -653,6 +670,10 @@ class Share {
653670
return String(num);
654671
}
655672
Change_Share() {
673+
console.log("DEBUG: Change_Share: limit = " + this.limit);
674+
if (this.limit) {
675+
return;
676+
}
656677
this.Change_Share_img();
657678
if (this.current_sharenum == null) {
658679
this.Init_Share();
@@ -668,8 +689,18 @@ class Share {
668689
this.urlmanage.sharenum = null;
669690
}
670691
this.comment_manager.loadComment(this.urlmanage);
692+
this.limit = true;
693+
setTimeout(this.setLimit, 1000);
694+
}
695+
const target_node = document.getElementsByClassName("latest_button--four");
696+
if ($(target_node).hasClass("latest_button--six")) {
697+
$(target_node).removeClass("latest_button--six");
671698
}
672699
}
700+
setLimit_false() {
701+
this.limit = false;
702+
console.log("DEBUG: setLimit: limit = " + this.limit);
703+
}
673704
Change_Share_img() {
674705
const target_node = document.getElementsByClassName("latest_button--three");
675706
$(target_node).toggleClass("latest_button--seven");
@@ -747,11 +778,11 @@ class Debug {
747778
/// <reference path = "Share.ts" />
748779
/// <reference path = "Debug.ts" />
749780
// 変数を宣言
750-
const mode = new Mode();
781+
const menu = new Menu_Node();
782+
const mode = new Mode(menu);
751783
const comment_manager = new CommentManager();
752784
const debug = new Debug();
753785
const form = new Form();
754-
const menu = new Menu_Node();
755786
const urlmanage = new URLManage();
756787
const share = new Share(urlmanage, comment_manager);
757788
// サイトを読み込んだときに実行
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//押された回数を記憶するための変数
2+
var count = 0;
3+
//右上のアイコンがクリックされたら実行
4+
chrome.browserAction.onClicked.addListener(function (tab) {
5+
//押されたらカウントを増やす
6+
count++;
7+
//カウントが偶数の時
8+
if (count % 2 != 0) {
9+
//アイコンをオフの物に変更
10+
chrome.browserAction.setIcon({ path: "img/icon_off.png" });
11+
if (tab.id == undefined) {
12+
return;
13+
}
14+
//main.tsにStopメッセージを送る
15+
chrome.tabs.sendMessage(tab.id, { command: "none" });
16+
}
17+
else { //それ以外
18+
//アイコンをオンの物に変更
19+
chrome.browserAction.setIcon({ path: "img/icon_32.png" });
20+
if (tab.id == undefined) {
21+
return;
22+
}
23+
//main.tsにActionメッセージを送る。
24+
chrome.tabs.sendMessage(tab.id, { command: "block" });
25+
}
26+
});

ForRelease/Latest-Release/latest./css/menu-ui.css

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
right: 0;
1515
width: 220px;
1616
z-index: 1001;
17+
display: block;
1718
}
1819

1920
.latest_button{
1.66 KB
Loading
589 Bytes
Loading
315 Bytes
Loading

ForRelease/Latest-Release/latest./manifest.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Latest_ver.beta-test",
3-
"version": "1.0.0",
3+
"version": "0.5.2",
44
"manifest_version": 2,
55
"description": "サイトにコメントを付与したり、追加したりする事ができる拡張です",
66
"icons":{
@@ -17,6 +17,10 @@
1717
"default_icon": "img/icon_32.png",
1818
"default_title": "Latestを起動する"
1919
},
20+
"background":{
21+
"scripts" : ["bin/background.js"],
22+
"persistent": false
23+
},
2024
"web_accessible_resources": [
2125
"*.png"
2226
],

0 commit comments

Comments
 (0)