Navigation Menu

Skip to content

Commit

Permalink
Debug and Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
iorate committed Jul 21, 2019
1 parent 4f389d3 commit f46de17
Show file tree
Hide file tree
Showing 14 changed files with 627 additions and 246 deletions.
2 changes: 2 additions & 0 deletions Example.uBlacklist.txt
@@ -0,0 +1,2 @@
*://*.example.com/*
/example\.(net|org)/
20 changes: 16 additions & 4 deletions LICENSE.txt
@@ -1,9 +1,21 @@
MIT License

Copyright (c) 2018 iorate
Copyright (c) 2018-2019 iorate

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,11 @@ The same function is already provided by [Personal Blocklist (by Google)](https:

You can add rules on search result pages, or on sites to be blocked by clicking the toolbar icon. Rules can be specified either by [match patterns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) (e.g. `*://*.example.com/*`) or by [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) (e.g. `/example\.(net|org)/`).

### Subscription
Subscription was implemented in version 3. If you add a subscription, a blacklist will be regularly downloaded from the specified URL.

To publish a blacklist as a subscription, place a blacklist file encoded in UTF-8 on a suitable HTTP(S) server, and publish the URL. Here is [an example](https://raw.githubusercontent.com/iorate/uBlacklist/master/Example.uBlacklist.txt) hosted on GitHub.

## Author
[iorate](https://github.com/iorate) ([Twitter](https://twitter.com/iorate))

Expand Down
438 changes: 438 additions & 0 deletions ThirdPartyNotice.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/_locales/en/messages.json
Expand Up @@ -202,7 +202,7 @@
"description": "The text of a menu item to remove a subscription."
},
"options_updateAllSubscriptionsNowButton": {
"message": "Update Now",
"message": "Update now",
"description": "The text of the button to update all subscriptions now."
},
"options_addSubscriptionDialog_title": {
Expand Down
4 changes: 2 additions & 2 deletions src/_locales/ru/messages.json
Expand Up @@ -114,7 +114,7 @@
"message": "Syncing..."
},
"options_syncNowButton": {
"message": "Sync Now"
"message": "Sync now"
},
"options_subscriptionTitle": {
"message": "Subscription"
Expand Down Expand Up @@ -153,7 +153,7 @@
"message": "Updating..."
},
"options_updateAllSubscriptionsNowButton": {
"message": "Update Now"
"message": "Update now"
},
"options_addSubscriptionDialog_title": {
"message": "Add a subscription"
Expand Down
6 changes: 3 additions & 3 deletions src/_locales/tr/messages.json
Expand Up @@ -93,7 +93,7 @@
"message": "Google Drive ile senkronize et"
},
"options_syncFeatureDescription": {
"message": "Senkronizasyonu etkinleştirirseniz, Google Drive'ınızda 'uBlacklist.txt' adlı bir dosya oluşturulur ve yerel kara listenizle senkronize edilir. <br>Yerel kara listenizin istemeden üzerine yazılması durumunda, senkronizasyonu etkinleştirmeden önce yedeklemeniz önerilir."
"message": "Senkronizasyonu etkinleştirirseniz, Google Drive'ınızda 'uBlacklist.txt' adlı bir dosya oluşturulur ve yerel kara listenizle senkronize edilir."
},
"options_turnOnSync": {
"message": "Senkronizasyonu etkinleştir"
Expand All @@ -114,7 +114,7 @@
"message": "Syncing..."
},
"options_syncNowButton": {
"message": "Sync Now"
"message": "Sync now"
},
"options_subscriptionTitle": {
"message": "Subscription"
Expand Down Expand Up @@ -153,7 +153,7 @@
"message": "Updating..."
},
"options_updateAllSubscriptionsNowButton": {
"message": "Update Now"
"message": "Update now"
},
"options_addSubscriptionDialog_title": {
"message": "Add a subscription"
Expand Down
6 changes: 3 additions & 3 deletions src/_locales/zh_TW/messages.json
Expand Up @@ -93,7 +93,7 @@
"message": "與 Google Drive 同步"
},
"options_syncFeatureDescription": {
"message": "如果您啟用同步,將在您的 Google Drive 建立名為「uBlacklist.txt」的檔案,並與您本地端的黑名單同步。<br>如果您本地端的黑名單無意中被覆蓋,建議您在啟用同步前先備份。"
"message": "如果您啟用同步,將在您的 Google Drive 建立名為「uBlacklist.txt」的檔案,並與您本地端的黑名單同步。"
},
"options_turnOnSync": {
"message": "啟用同步"
Expand All @@ -114,7 +114,7 @@
"message": "Syncing..."
},
"options_syncNowButton": {
"message": "Sync Now"
"message": "Sync now"
},
"options_subscriptionTitle": {
"message": "Subscription"
Expand Down Expand Up @@ -153,7 +153,7 @@
"message": "Updating..."
},
"options_updateAllSubscriptionsNowButton": {
"message": "Update Now"
"message": "Update now"
},
"options_addSubscriptionDialog_title": {
"message": "Add a subscription"
Expand Down
27 changes: 12 additions & 15 deletions src/options.html
Expand Up @@ -27,13 +27,12 @@ <h1 class="title">
</p>
</div>
<div class="field">
<div class="columns is-mobile is-vcentered">
<div class="column is-narrow">
<div class="columns is-vcentered">
<div class="column">
<button id="importBlacklist" class="button has-text-primary">
<span data-i18n="options_importBlacklistButton"></span>
</button>
</div>
<div class="column"></div>
<div class="column is-narrow">
<button id="saveBlacklist" class="button is-primary" disabled>
<span data-i18n="options_saveBlacklistButton"></span>
Expand All @@ -43,13 +42,12 @@ <h1 class="title">
</div>
</li>
<li class="list-item">
<div class="columns is-mobile is-vcentered">
<div class="column is-narrow">
<label class="label" for="hideBlockSiteLinks">
<div class="columns is-vcentered">
<div class="column">
<label for="hideBlockSiteLinks">
<span data-i18n="options_hideBlockSiteLinksLabel"></span>
</label>
</div>
<div class="column"></div>
<div class="column is-narrow">
<div class="switch-wrapper">
<input id="hideBlockSiteLinks" class="switch is-rounded" type="checkbox"></input>
Expand All @@ -66,7 +64,7 @@ <h1 class="title">
</h1>
<ul class="list">
<li class="list-item">
<div class="columns is-mobile is-vcentered">
<div class="columns is-vcentered">
<div class="column">
<p class="is-hidden-sync-on">
<span data-i18n="options_syncFeature"></span>
Expand All @@ -89,7 +87,7 @@ <h1 class="title">
</div>
</li>
<li class="list-item">
<div class="columns is-mobile is-vcentered">
<div class="columns is-vcentered">
<div class="column">
<p>
<span data-i18n="options_syncResult"></span>
Expand All @@ -114,7 +112,7 @@ <h1 class="title">
<ul class="list">
<li class="list-item">
<div class="field">
<div class="columns is-mobile is-vcentered">
<div class="columns is-vcentered">
<div class="column">
<p>
<span data-i18n="options_subscriptionFeature"></span>
Expand All @@ -130,21 +128,20 @@ <h1 class="title">
</div>
</div>
</div>
<div class="field"></div>
<div class="field">
<table id="subscriptions" class="table is-fullwidth">
<thead>
<tr>
<th class="name-header has-text-grey">
<th class="subscription-name has-text-grey">
<span data-i18n="options_subscriptionNameHeader"></span>
</th>
<th class="url-header has-text-grey">
<th class="subscription-url has-text-grey">
<span data-i18n="options_subscriptionURLHeader"></span>
</th>
<th class="update-result-header has-text-grey">
<th class="subscription-update-result has-text-grey">
<span data-i18n="options_subscriptionUpdateResultHeader"></span>
</th>
<th class="more-header"></th>
<th class="subscription-more"></th>
</tr>
</thead>
<tbody>
Expand Down
52 changes: 28 additions & 24 deletions src/sass/options.sass
@@ -1,4 +1,5 @@
$block-spacing: 1rem
$tablet: 600px
$primary: #1a73e8
// #if BROWSER === 'chrome'
$body-size: 13px
Expand All @@ -14,17 +15,28 @@ $title-weight: normal
$dropdown-menu-min-width: 0
$switch-focus: none

@import 'bulma'
@import '~bulma/sass/utilities/_all.sass'
@import '~bulma/sass/base/_all.sass'
@import '~bulma/sass/grid/columns.sass'
@import '~bulma/sass/layout/section.sass'
@import '~bulma/sass/form/shared.sass'
@import '~bulma/sass/form/input-textarea.sass'
@import '~bulma/sass/form/tools.sass'
@import '~bulma/sass/elements/box.sass'
@import '~bulma/sass/elements/button.sass'
@import '~bulma/sass/elements/table.sass'
@import '~bulma/sass/elements/title.sass'
@import '~bulma/sass/components/dropdown.sass'
@import '~bulma/sass/components/list.sass'
@import '~bulma/sass/components/modal.sass'
@import '~bulma-switch/src/sass/index.sass'

.button[disabled]
cursor: default

.table
table-layout: fixed
td
vertical-align: middle
word-break: break-word
th
font-weight: normal

Expand All @@ -38,29 +50,21 @@ $switch-focus: none
height: 2.25rem
padding-top: 0.525rem

// #if BROWSER === 'chrome'
.name-header
width: 10rem

.url-header
width: 20rem
.subscription-name
width: 20%
word-break: break-word

.update-result-header
width: 10rem
// #else
.name-header
width: 8rem
.subscription-url
width: calc(60% - 3.25rem)
word-break: break-all

.url-header
width: 16rem

.update-result-header
width: 8rem
// #endif
.subscription-update-result
width: 20%
word-break: break-word

.more-header
width: 3.5rem
.subscription-menu
width: 3.25rem

.more
.subscription-menu-button
background: url('~@mdi/svg/svg/dots-vertical.svg') center no-repeat
width: 2.5rem
width: 2.25rem

0 comments on commit f46de17

Please sign in to comment.