diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js index f77aa9f..2c4eec6 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/35-pac-kitchen-api.js @@ -74,7 +74,7 @@ ifProxyMoreDomains: { ifDisabled: true, dflt: false, - category: 'exceptions', + category: 'ownProxies', label: 'проксировать .onion, .i2p и OpenNIC', desc: 'Проксировать особые домены. Необходима поддержка со стороны СВОИХ прокси.', order: 8, diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.js new file mode 100644 index 0000000..cd34579 --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/70-menu-items.js @@ -0,0 +1,63 @@ +'use strict'; + +{ + + window.apis.menus = { + + getItemsAsObject: () => ({ + + googleTranslate: { + title: 'Через Google Translate', + getUrl: (blockedUrl) => ( + 'https://translate.google.com/translate?hl=&sl=en&tl=ru&anno=2&sandbox=1&u=' + blockedUrl), + order: 0, + }, + + hostTracker: { + title: 'Из кэша Google', + getUrl: (blockedUrl) => 'http://webcache.googleusercontent.com/search?q=cache:' + blockedUrl, + order: 1, + }, + + archiveOrg: { + title: 'Из архива archive.org', + getUrl: (blockedUrl) => 'https://web.archive.org/web/*/' + blockedUrl, + order: 2, + }, + + otherUnblock: { + title: 'Разблокировать по-другому', + getUrl: (blockedUrl) => ('https://rebrand.ly/ac-unblock#' + blockedUrl), + order: 3, + }, + + antizapretInfo: { + title: 'Сайт в реестре блокировок?', + getUrl: (blockedUrl) => 'https://antizapret.info/index.php?search=' + new URL(blockedUrl).hostname, + order: 4, + }, + + support: { + title: 'Документация / Помощь / Поддержка', + getUrl: (blockedUrl) => 'https://rebrand.ly/ac-support', + order: 99, + }, + + }), + + getItemsAsArray: function() { + + const itemsObj = this.getItemsAsObject(); + return Object.keys(itemsObj).reduce((acc, key) => { + + acc.push(itemsObj[key]); + return acc; + + }, []) + .sort((a, b) => a.order - b.order); + + }, + + }; + +} diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/75-context-menus.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/75-context-menus.js new file mode 100644 index 0000000..87a7d24 --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/75-context-menus.js @@ -0,0 +1,45 @@ +'use strict'; + +{ + + const chromified = window.utils.chromified; + + let seqId = 0; + + const createMenuLinkEntry = (title, tab2url) => { + + const id = (++seqId).toString(); + + chrome.contextMenus.create({ + id: id, + title: title, + contexts: ['browser_action'], + }, chromified((err) => { + + if(err) { + console.warn('Context menu error ignored:', err); + } + + })); + + chrome.contextMenus.onClicked.addListener((info, tab) => { + + if(info.menuItemId === id) { + Promise.resolve( tab2url( tab ) ) + .then( (url) => chrome.tabs.create({url: url}) ); + } + + }); + + }; + + window.apis.menus.getItemsAsArray().forEach((item) => { + + createMenuLinkEntry( + item.title, + (tab) => item.getUrl(tab.url), + ); + + }); + +} diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/80-context-menus.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/80-context-menus.js deleted file mode 100644 index 66e53e5..0000000 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/80-context-menus.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -{ - - const chromified = window.utils.chromified; - - let seqId = 0; - - const createMenuLinkEntry = (title, tab2url) => { - - const id = (++seqId).toString(); - - chrome.contextMenus.create({ - id: id, - title: title, - contexts: ['browser_action'], - }, chromified((err) => { - - if(err) { - console.warn('Context menu error ignored:', err); - } - - })); - - chrome.contextMenus.onClicked.addListener((info, tab) => { - - if(info.menuItemId === id) { - Promise.resolve( tab2url( tab ) ) - .then( (url) => chrome.tabs.create({url: url}) ); - } - - }); - - }; - - createMenuLinkEntry( - 'Сайт доступен из-за границы? Is up?', - (tab) => `data:text/html;charset=utf8,Запрашиваю... -
- -
- + + diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/errors-to-exc/index.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/errors-to-exc/index.js new file mode 100644 index 0000000..3af7694 --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/errors-to-exc/index.js @@ -0,0 +1,75 @@ +'use strict'; + +chrome.runtime.getBackgroundPage( (bgWindow) => + bgWindow.apis.errorHandlers.installListenersOn( + window, 'LERR', () => { + + const tbody = document.getElementById('errorsTable'); + const errors = bgWindow.apis.lastErrors.get().map( + ({url, error}, index) => ({ message: error, hostname: new URL(url).hostname, ifChecked: false }) + ); + + const renderTbody = () => { + + const exc = bgWindow.apis.pacKitchen.getPacMods().exceptions || {}; + tbody.innerHTML = ''; + errors.forEach((err, index) => { + + const ifProxy = exc[err.hostname]; + let style = ''; + if (ifProxy !== undefined) { + style = `style="color: ${ifProxy ? 'green' : 'red' }"`; + } + const tr = document.createElement('tr'); + tr.innerHTML = ` + ${index} + ${err.hostname} + ${err.message} + + `; + tr.querySelector('input').onchange = function() { + + errors[index].ifChecked = this.checked; + return false; + + }; + tbody.appendChild(tr); + + }); + + }; + + document.getElementById('allBtn').onclick = () => { + + const ifAllChecked = errors.every((err) => err.ifChecked); + if (ifAllChecked) { + errors.forEach((err) => { err.ifChecked = false; }) + } else { + errors.forEach((err) => { err.ifChecked = true; }) + } + renderTbody(); + return false; + + }; + + document.getElementById('addBtn').onclick = () => { + + const mutatedMods = bgWindow.apis.pacKitchen.getPacMods(); + const exc = mutatedMods.exceptions || {}; + mutatedMods.exceptions = errors.reduce((acc, err) => { + + if (err.ifChecked) { + acc[err.hostname] = true; + } + return acc; + + }, exc); + bgWindow.apis.pacKitchen.keepCookedNowAsync(mutatedMods, (err) => alert(err || 'Сделано!')); + + }; + + renderTbody(); + document.documentElement.style.display = ''; + + }) +); diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/check.png b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/check.png new file mode 100644 index 0000000..94c58b7 Binary files /dev/null and b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/check.png differ diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/index.css b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/index.css new file mode 100644 index 0000000..a3cc382 --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/chrome-style/index.css @@ -0,0 +1,346 @@ +/* + * Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * This stylesheet is used to apply Chrome styles to extension pages that opt in + * to using them. + * + * These styles have been copied from ui/webui/resources/css/chrome_shared.css + * and ui/webui/resources/css/widgets.css *with CSS class logic removed*, so + * that it's as close to a user-agent stylesheet as possible. + * + * For example, extensions shouldn't be able to set a .link-button class and + * have it do anything. + * + * Other than that, keep this file and chrome_shared.css/widgets.cc in sync as + * much as possible. + */ + +body { + color: #333; + cursor: default; + /* Note that the correct font-family and font-size are set in + * extension_fonts.css. */ + /* This top margin of 14px matches the top padding on the h1 element on + * overlays (see the ".overlay .page h1" selector in overlay.css), which + * every dialogue has. + * + * Similarly, the bottom 14px margin matches the bottom padding of the area + * which hosts the buttons (see the ".overlay .page * .action-area" selector + * in overlay.css). + * + * Both have a padding left/right of 17px. + * + * Note that we're putting this here in the Extension content, rather than + * the WebUI element which contains the content, so that scrollbars in the + * Extension content don't get a 6px margin, which looks quite odd. + */ + margin: 14px 17px; +} + +p { + line-height: 1.8em; +} + +h1, +h2, +h3 { + -webkit-user-select: none; + font-weight: normal; + /* Makes the vertical size of the text the same for all fonts. */ + line-height: 1; +} + +h1 { + font-size: 1.5em; +} + +h2 { + font-size: 1.3em; + margin-bottom: 0.4em; +} + +h3 { + color: black; + font-size: 1.2em; + margin-bottom: 0.8em; +} + +a { + color: rgb(17, 85, 204); + text-decoration: underline; +} + +a:active { + color: rgb(5, 37, 119); +} + +/* Default state **************************************************************/ + +:-webkit-any(button, + input[type='button'], + input[type='submit']), +select, +input[type='checkbox'], +input[type='radio'] { + -webkit-appearance: none; + -webkit-user-select: none; + background-image: linear-gradient(#ededed, #ededed 38%, #dedede); + border: 1px solid rgba(0, 0, 0, 0.25); + border-radius: 2px; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), + inset 0 1px 2px rgba(255, 255, 255, 0.75); + color: #444; + font: inherit; + margin: 0 1px 0 0; + outline: none; + text-shadow: 0 1px 0 rgb(240, 240, 240); +} + +:-webkit-any(button, + input[type='button'], + input[type='submit']), +select { + min-height: 2em; + min-width: 4em; +/* + /* The following platform-specific rule is necessary to get adjacent + * buttons, text inputs, and so forth to align on their borders while also + * aligning on the text's baselines. */ + padding-bottom: 1px; +/**/ +} + +:-webkit-any(button, + input[type='button'], + input[type='submit']) { + -webkit-padding-end: 10px; + -webkit-padding-start: 10px; +} + +select { + -webkit-appearance: none; + -webkit-padding-end: 20px; + -webkit-padding-start: 6px; + /* OVERRIDE */ + background-image: /*url(../../../ui/webui/resources/images/select.png),*/ + linear-gradient(#ededed, #ededed 38%, #dedede); + background-position: right center; + background-repeat: no-repeat; +} + +html[dir='rtl'] select { + background-position: center left; +} + +input[type='checkbox'] { + height: 13px; + position: relative; + vertical-align: middle; + width: 13px; +} + +input[type='radio'] { + /* OVERRIDE */ + border-radius: 100%; + height: 15px; + position: relative; + vertical-align: middle; + width: 15px; +} + +/* TODO(estade): add more types here? */ +input[type='number'], +input[type='password'], +input[type='search'], +input[type='text'], +input[type='url'], +input:not([type]), +textarea { + border: 1px solid #bfbfbf; + border-radius: 2px; + box-sizing: border-box; + color: #444; + font: inherit; + margin: 0; + /* Use min-height to accommodate addditional padding for touch as needed. */ + min-height: 2em; + padding: 3px; + outline: none; + + /* For better alignment between adjacent buttons and inputs. */ + padding-bottom: 4px; + +} + +input[type='search'] { + -webkit-appearance: textfield; + /* NOTE: Keep a relatively high min-width for this so we don't obscure the end + * of the default text in relatively spacious languages (i.e. German). */ + min-width: 160px; +} + +/* Checked ********************************************************************/ + +input[type='checkbox']:checked::before { + -webkit-user-select: none; + background-image: url(./check.png); + background-size: 100% 100%; + content: ''; + display: block; + height: 100%; + width: 100%; +} + +input[type='radio']:checked::before { + background-color: #666; + border-radius: 100%; + bottom: 3px; + content: ''; + display: block; + left: 3px; + position: absolute; + right: 3px; + top: 3px; +} + +/* Hover **********************************************************************/ + +:enabled:hover:-webkit-any( + select, + input[type='checkbox'], + input[type='radio'], + :-webkit-any( + button, + input[type='button'], + input[type='submit'])) { + background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); + border-color: rgba(0, 0, 0, 0.3); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), + inset 0 1px 2px rgba(255, 255, 255, 0.95); + color: black; +} + +:enabled:hover:-webkit-any(select) { + /* OVERRIDE */ + background-image: /*url(../../../ui/webui/resources/images/select.png)*/, + linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); +} + +/* Active *********************************************************************/ + +:enabled:active:-webkit-any( + select, + input[type='checkbox'], + input[type='radio'], + :-webkit-any( + button, + input[type='button'], + input[type='submit'])) { + background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); + box-shadow: none; + text-shadow: none; +} + +:enabled:active:-webkit-any(select) { + /* OVERRIDE */ + background-image: /*url(../../../ui/webui/resources/images/select.png),*/ + linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); +} + +/* Disabled *******************************************************************/ + +:disabled:-webkit-any( + button, + input[type='button'], + input[type='submit']), +select:disabled { + background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); + border-color: rgba(80, 80, 80, 0.2); + box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), + inset 0 1px 2px rgba(255, 255, 255, 0.75); + color: #aaa; +} + +select:disabled { + /* OVERRIDE */ + background-image: /*url(../../../ui/webui/resources/images/disabled_select.png),*/ + linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); +} + +input:disabled:-webkit-any([type='checkbox'], + [type='radio']) { + opacity: .75; +} + +input:disabled:-webkit-any([type='password'], + [type='search'], + [type='text'], + [type='url'], + :not([type])) { + color: #999; +} + +/* Focus **********************************************************************/ + +:enabled:focus:-webkit-any( + select, + input[type='checkbox'], + input[type='number'], + input[type='password'], + input[type='radio'], + input[type='search'], + input[type='text'], + input[type='url'], + input:not([type]), + :-webkit-any( + button, + input[type='button'], + input[type='submit'])) { + /* OVERRIDE */ + -webkit-transition: border-color 200ms; + /* We use border color because it follows the border radius (unlike outline). + * This is particularly noticeable on mac. */ + border-color: rgb(77, 144, 254); + outline: none; +} + +/* Checkbox/radio helpers ****************************************************** + * + * .checkbox and .radio classes wrap labels. Checkboxes and radios should use + * these classes with the markup structure: + * + *
+ * + *
+ */ + +:-webkit-any(.checkbox, .radio) label { + /* Don't expand horizontally: . */ + align-items: center; + display: inline-flex; + padding-bottom: 7px; + padding-top: 7px; +} + +:-webkit-any(.checkbox, .radio) label input { + flex-shrink: 0; +} + +:-webkit-any(.checkbox, .radio) label input ~ span { + -webkit-margin-start: 0.6em; + /* Make sure long spans wrap at the same horizontal position they start. */ + display: block; +} + +:-webkit-any(.checkbox, .radio) label:hover { + color: black; +} + +label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span { + color: #999; +} diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/links.txt b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/links.txt new file mode 100644 index 0000000..63869b9 --- /dev/null +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/lib/links.txt @@ -0,0 +1 @@ +ChromeStyle: https://cs.chromium.org/chromium/src/extensions/renderer/resources/extension.css diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/index.html b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/index.html index 1dccd73..a19cb9a 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/index.html +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/index.html @@ -3,6 +3,7 @@ Настройки + diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js index 44556c7..bd38b45 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js @@ -17,9 +17,15 @@ export default function getApp(theState) { constructor(props) { super(props); + + const hash = window.location.hash.substr(1); + const hashParams = new URLSearchParams(hash); + console.log('GOT from', hash, hashParams.toString()); + this.state = { - status: 'Загрузка...', + status: hashParams.get('status') || 'Загрузка...', ifInputsDisabled: false, + hashParams, }; } @@ -131,6 +137,7 @@ export default function getApp(theState) { showErrors: this.showErrors.bind(this), }, ifInputsDisabled: this.state.ifInputsDisabled, + hashParams: this.state.hashParams, }); return createElement('div', null, [ diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js index 47228c2..6cf261c 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js @@ -332,7 +332,11 @@ export default function getExcEditor(theState) {
  • - {' '} + {' '}
  • diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js index c97d77d..7df8ec1 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js @@ -62,6 +62,21 @@ export default function getExceptions(theState) { }) } + { + + props.bgWindow.apis.lastErrors.ifCollecting = event.target.checked; + props.funs.setStatusTo('Сделано.'); + + }} + nodeAfterLabel={(Собирать последние ошибки сайтов)} + /> ); diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/InfoLi.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/InfoLi.js index ebb12d8..e966878 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/InfoLi.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/InfoLi.js @@ -1,4 +1,5 @@ import Inferno from 'inferno'; +import createElement from 'inferno-create-element'; import css from 'csjs-inject'; export default function getInfoLi() { @@ -23,7 +24,6 @@ export default function getInfoLi() { .infoRow { position: relative; - flex-wrap: wrap; } .infoRow > input[type="checkbox"] { position: relative; @@ -119,19 +119,11 @@ export default function getInfoLi() { const iddy = props.idPrefix + ( props.ifDashify ? camelToDash(props.conf.key) : props.conf.key ); return ( -
  • - +
  • + { createElement('input', Object.assign({}, props, {id: iddy})) }
    -  {props.nodeAfterLabel} + {props.nodeAfterLabel}
    {props.conf.desc ? ( diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Main.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Main.js index 3e6c1a7..b018c7b 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Main.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Main.js @@ -69,6 +69,7 @@ export default function getMain(theState) { handleModChange({targetConf, targetIndex, newValue}) { + console.log('NEW VALUE', newValue); const oldCats = this.state.catToOrderedMods; const newCats = Object.keys(this.state.catToOrderedMods).reduce((acc, cat) => { @@ -110,7 +111,7 @@ export default function getMain(theState) { onConfChanged: this.handleModChange, }; - return createElement(TabPanel, { + return createElement(TabPanel, Object.assign({}, props, { tabs: [ { label: 'PAC-скрипт', @@ -160,7 +161,7 @@ export default function getMain(theState) { alwaysShownWith: { 'applyMods': ['ownProxies', 'mods'], }, - }); + })); } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ModList.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ModList.js index c0aaa4b..fa3628f 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ModList.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ModList.js @@ -20,15 +20,13 @@ export default function getModList(theState) { handleCheck(confMeta, ifChecked) { - this.state.checks[confMeta.index] = ifChecked; + this.setState({ + checks: this.state.checks.map( + (ch, i) => i === confMeta.index ? ifChecked : ch + ) + }); if (ifChecked === false || !confMeta.ifChild) { this.handleNewValue(confMeta, ifChecked); - } else { - this.setState({ - checks: this.state.checks.map( - (ch, i) => i === confMeta.index ? ifChecked : ch - ) - }); } } @@ -63,7 +61,7 @@ export default function getModList(theState) { conf={conf} type='checkbox' name={props.name} - checked={conf.value} + checked={this.state.checks[index]} key={index} onChange={(event) => this.handleCheck(confMeta, event.target.checked)} > diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js index 1dcc388..92dd30b 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js @@ -28,6 +28,7 @@ export default function getPacChooser(theState) { .updateButton { visibility: hidden; + margin-left: 0.5em; } input:checked + div .updateButton { visibility: inherit; diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ProxyEditor.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ProxyEditor.js index 73b82e6..8d57680 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ProxyEditor.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ProxyEditor.js @@ -25,14 +25,38 @@ export default function getProxyEditor(theState) { height: 100%; } + table.editor input, + table.editor button, + table.editor select + { + min-width: 0; + min-height: 0; + } + /* ADD PANEL */ - table.editor tr.addPanel td { + table.editor tr.addPanel td, + table.editor tr.addPanel td input + { padding: 0; } + table.editor tr.addPanel td > select[name="proxyType"], + table.editor tr.addPanel td:nth-last-child(2) input /* PORT */ + { + font-size: 0.9em; + } + table.editor tr.addPanel td:nth-last-child(2) input /* PORT */ + { + min-width: 4em; + } /* PROXY ROW */ - table.editor tr.proxyRow td:nth-child(2) { + table.editor tr.proxyRow td:nth-child(2), /* type */ + table.editor tr.proxyRow td:nth-child(4) /* port */ + { text-align: center; } + table.editor tr.proxyRow input[name="hostname"] { + padding: 0; + } table.editor th:not(:last-child) { padding: 0 0.6em; @@ -56,8 +80,6 @@ export default function getProxyEditor(theState) { /* BUTTONS */ table.editor input[type="submit"], table.editor button { - min-width: 0; - min-height: 0; width: 100%; padding: 0; border: none; @@ -74,7 +96,7 @@ export default function getProxyEditor(theState) { font-weight: 900; } table.editor .export { - padding-right: 2px; + /*padding-right: 2px;*/ } /* LAST COLUMN: BUTTONS */ @@ -93,7 +115,7 @@ export default function getProxyEditor(theState) { padding: 0; } .padLeft { - padding-left: 2px; + padding-left: 2px !important; } textarea.textarea { @@ -266,7 +288,7 @@ export default function getProxyEditor(theState) { {/* LAST-1: PORT */} this.handleDelete(this, {proxyAsString, index})} >X - {type}{hostname}{port} + + {type} + + {port}