Skip to content

Commit

Permalink
Merge pull request #16 from mogproject/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mogproject committed Mar 8, 2021
2 parents f819df2 + e959f3a commit e7ac78b
Show file tree
Hide file tree
Showing 10 changed files with 579 additions and 128 deletions.
18 changes: 18 additions & 0 deletions assets/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,30 @@
"enable_by_default": {
"message": "Enable filter by default"
},
"show_filter_button": {
"message": "Show filter button"
},
"page_reload_required": {
"message": "Page reload required"
},
"filter_replies": {
"message": "Filter replies"
},
"languages": {
"message": "Languages"
},
"filter_by_language": {
"message": "Enable language filter"
},
"filter_by_word": {
"message": "Enable word filter"
},
"block_selected_languages": {
"message": "Use as a blocklist"
},
"filter_by_regular_expression": {
"message": "Use regular expressions"
},
"unknown": {
"message": "Unknown"
},
Expand Down
18 changes: 18 additions & 0 deletions assets/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,30 @@
"enable_by_default": {
"message": "デフォルトで有効"
},
"show_filter_button": {
"message": "フィルターボタンを表示"
},
"page_reload_required": {
"message": "ページ再読み込みが必要"
},
"filter_replies": {
"message": "返信もフィルターする"
},
"languages": {
"message": "言語"
},
"filter_by_language": {
"message": "言語フィルターを有効"
},
"filter_by_word": {
"message": "単語フィルターを有効"
},
"block_selected_languages": {
"message": "選択した言語を非表示にする"
},
"filter_by_regular_expression": {
"message": "正規表現で入力"
},
"unknown": {
"message": "判別不能"
},
Expand Down
18 changes: 18 additions & 0 deletions assets/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,30 @@
"enable_by_default": {
"message": "기본으로 활성화"
},
"show_filter_button": {
"message": "필터 버튼을 표시"
},
"page_reload_required": {
"message": "페이지 새로 고침 필요"
},
"filter_replies": {
"message": "회신 필터링"
},
"languages": {
"message": "언어"
},
"filter_by_language": {
"message": "언어 필터 활성화"
},
"filter_by_word": {
"message": "단어 필터 활성화"
},
"block_selected_languages": {
"message": "선택한 언어를 숨기려면"
},
"filter_by_regular_expression": {
"message": "정규식 사용"
},
"unknown": {
"message": "판단 불가"
},
Expand Down
19 changes: 11 additions & 8 deletions assets/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,22 @@ footer a {
padding: 8px 10px;
}

.popup-settings .settings-annotation{
font-size: 11px;
text-align: right;
}

.popup-settings h4 {
font-size: 16px;
margin: 12px 0px 6px 0px;
}

.popup-settings form {
margin: 6px -4px -4px -4px;
padding: 4px 4px 4px 4px;
border: 1px solid #dddddd;
}

.popup-settings input,
label {
font-size: 14px;
Expand All @@ -72,10 +83,6 @@ label {
-khtml-user-select: none;
}

.popup-settings textarea {
font-size: 14px;
}

.popup-settings input[type='button'],
input[type='submit'] {
color: #065fd4;
Expand Down Expand Up @@ -106,10 +113,6 @@ input[type='submit']:disabled:hover {
background-color: #f9f9f9;
}

#popup-form-blocked-words div {
padding-left: 16px;
}

.popup-settings textarea {
font-size: 13px;
width: 100%;
Expand Down
14 changes: 14 additions & 0 deletions assets/css/yay-filter.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
-khtml-user-select: none;
}

#yay-filter-container .yay-tooltip {
position: absolute;
visibility: hidden;
z-index: 100;
margin-top: 46px;
opacity: 0;
transition: opacity 0.3s;
}

#yay-filter-container:hover .yay-tooltip {
visibility: visible;
opacity: 0.9;
}

#yay-filter-container svg {
position: absolute;
width: 24px;
Expand Down
6 changes: 6 additions & 0 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ export default class App {
private injectFilterButton(commentHeader: HTMLElement): void {
// this.log('injectFilterButton()');

// do not inject
if (!this.context.settings.isFilterButtonVisible()) {
this.threadContainer = DomManager.getCommentThreadContainer();
return;
}

// create filter button
this.clearYayFilterContainer();
const [c, s, i] = DomManager.createYayFilterContainer(() => this.toggleEnabled());
Expand Down
Loading

0 comments on commit e7ac78b

Please sign in to comment.