Merge branch 'development' into production

This commit is contained in:
ilyaigpetrov 2019-05-04 12:36:34 -05:00
commit f37539a19c
17 changed files with 191 additions and 63 deletions

View File

@ -189,7 +189,7 @@
return chrome.i18n.getMessage('noControl') + return chrome.i18n.getMessage('noControl') +
` <a href="${ this.searchSettingsForUrl('proxy') }"> ` <a href="${ this.searchSettingsForUrl('proxy') }">
${ chrome.i18n.getMessage('which') } ${ chrome.i18n.getMessage('WhichQ') }
</a>`; </a>`;
}, },

View File

@ -198,7 +198,7 @@
// Distinct keys are needed if you want to check if a given // Distinct keys are needed if you want to check if a given
// provider is this or that (distinct it from others). // provider is this or that (distinct it from others).
distinctKey: 'Antizapret', distinctKey: 'Antizapret',
label: 'Антизапрет', label: chrome.i18n.getMessage('Antizapret'),
desc: \`Альтернативный PAC-скрипт от стороннего разработчика. desc: \`Альтернативный PAC-скрипт от стороннего разработчика.
Охватывет меньше сайтов. Охватывет меньше сайтов.
Блокировка определяется по доменному имени. Блокировка определяется по доменному имени.
@ -208,7 +208,7 @@
}, },
Антицензорити: { Антицензорити: {
distinctKey: 'Anticensority', distinctKey: 'Anticensority',
label: 'Антицензорити', label: chrome.i18n.getMessage('Anticensority'),
desc: \`Основной PAC-скрипт от автора расширения. desc: \`Основной PAC-скрипт от автора расширения.
Охватывает больше сайтов. Охватывает больше сайтов.
Блокировка определятся по доменному имени или IP адресу. Блокировка определятся по доменному имени или IP адресу.
@ -224,7 +224,7 @@
}, },
onlyOwnSites: { onlyOwnSites: {
distinctKey: 'onlyOwnSites', distinctKey: 'onlyOwnSites',
label: 'Только свои сайты и свои прокси', label: chrome.i18n.getMessage('Only_own_sites_and_only_own_proxies'),
desc: 'Проксируются только добавленные вручную сайты через СВОИ вручную добавленные прокси или через локальный Tor.', desc: 'Проксируются только добавленные вручную сайты через СВОИ вручную добавленные прокси или через локальный Tor.',
order: 99, order: 99,
pacUrls: [ pacUrls: [

View File

@ -11,7 +11,52 @@
"noControl": { "noControl": {
"message": "Other extension controls proxy!" "message": "Other extension controls proxy!"
}, },
"which": { "WhichQ": {
"message": "Which?" "message": "Which?"
},
"update": {
"message": "update"
},
"ProblemsQ": {
"message": "Problems?"
},
"Finish": {
"message": "OK"
},
"Disable": {
"message": "Disable"
},
"Only_own_sites_and_only_own_proxies": {
"message": "Only own sites and only own proxies"
},
"Antizapret": {
"message": "Antizapret"
},
"Anticensority": {
"message": "Anticensority"
},
"PAC_script": {
"message": "PAC-script"
},
"Exceptions": {
"message": "Exceptions"
},
"Own_proxies": {
"message": "Own proxies"
},
"Modifiers": {
"message": "Modifiers"
},
"Notifications": {
"message": "Notifications"
},
"Error": {
"message": "Error"
},
"Non_critical_error": {
"message": "Non-critical error"
},
"Donate": {
"message": "Donate"
} }
} }

View File

@ -11,7 +11,52 @@
"noControl": { "noControl": {
"message": "Другое расширение контролирует настройки прокси!" "message": "Другое расширение контролирует настройки прокси!"
}, },
"which": { "WhichQ": {
"message": "Какое?" "message": "Какое?"
},
"update": {
"message": "обновить"
},
"ProblemsQ": {
"message": "Проблемы?"
},
"Finish": {
"message": "Готово"
},
"Disable": {
"message": "Отключить"
},
"Only_own_sites_and_only_own_proxies": {
"message": "Только свои сайты и свои прокси"
},
"Antizapret": {
"message": "Антизапрет"
},
"Anticensority": {
"message": "Антицензорити"
},
"PAC_script": {
"message": "PAC-скрипт"
},
"Exceptions": {
"message": "Исключения"
},
"Own_proxies": {
"message": "Свои прокси"
},
"Modifiers": {
"message": "Модификаторы"
},
"Notifications": {
"message": "Уведомления"
},
"Error": {
"message": "Ошибка"
},
"Non_critical_error": {
"message": "Некритичная ошибка"
},
"Donate": {
"message": "Поддержать"
} }
} }

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html style="display: none; will-change: contents, display"> <html style="visibility: hidden; will-change: contents, visibility">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Настройки</title> <title>Настройки</title>

View File

@ -231,9 +231,9 @@
} }
}, },
"babel-loader": { "babel-loader": {
"version": "7.1.4", "version": "7.1.5",
"resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz",
"integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==",
"dev": true, "dev": true,
"requires": { "requires": {
"find-cache-dir": "^1.0.0", "find-cache-dir": "^1.0.0",
@ -251,14 +251,10 @@
} }
}, },
"babel-plugin-dynamic-import-webpack": { "babel-plugin-dynamic-import-webpack": {
"version": "1.0.2", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-webpack/-/babel-plugin-dynamic-import-webpack-1.0.2.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-webpack/-/babel-plugin-dynamic-import-webpack-1.1.0.tgz",
"integrity": "sha512-uJtIdcqcphnuv18bl7WOZeIe6JyEGV/FdI6NIxsUNR49S0kwomgrVB4tzFyxn3OMUuf8YJOonUpPKHrfu8MZ4g==", "integrity": "sha512-Q/Vxl3zRwC5/DMyg97Ey2UD/f7ApvO+0zXgzwT3G2N7oajGFroqcUEmXZ23QXJsr0Y+DBVNK57saaUnQhCpllA==",
"dev": true, "dev": true
"requires": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-template": "^6.26.0"
}
}, },
"babel-plugin-inferno": { "babel-plugin-inferno": {
"version": "3.5.1", "version": "3.5.1",
@ -276,12 +272,6 @@
} }
} }
}, },
"babel-plugin-syntax-dynamic-import": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
"integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
"dev": true
},
"babel-plugin-syntax-flow": { "babel-plugin-syntax-flow": {
"version": "6.18.0", "version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz",
@ -2484,14 +2474,37 @@
"dev": true "dev": true
}, },
"loader-utils": { "loader-utils": {
"version": "1.1.0", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
"integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==",
"dev": true, "dev": true,
"requires": { "requires": {
"big.js": "^3.1.3", "big.js": "^5.2.2",
"emojis-list": "^2.0.0", "emojis-list": "^2.0.0",
"json5": "^0.5.0" "json5": "^1.0.1"
},
"dependencies": {
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
} }
}, },
"locate-path": { "locate-path": {
@ -2526,9 +2539,9 @@
} }
}, },
"make-dir": { "make-dir": {
"version": "1.2.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
"integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"pify": "^3.0.0" "pify": "^3.0.0"
@ -2784,9 +2797,9 @@
} }
}, },
"p-limit": { "p-limit": {
"version": "1.2.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
"integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"p-try": "^1.0.0" "p-try": "^1.0.0"

View File

@ -1,12 +1,12 @@
{ {
"name": "hello-react", "name": "options-page-builder",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "GPLv3",
"devDependencies": { "devDependencies": {
"babel-cli": "^6.24.1", "babel-cli": "^6.24.1",
"babel-loader": "^7.1.4", "babel-loader": "^7.1.5",
"babel-plugin-dynamic-import-webpack": "^1.0.2", "babel-plugin-dynamic-import-webpack": "^1.1.0",
"babel-preset-flow": "^6.23.0", "babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1", "babel-preset-react": "^6.24.1",
"concat-stream": "^1.6.2", "concat-stream": "^1.6.2",

View File

@ -227,7 +227,10 @@ export default function getApp(theState) {
this.setStatusTo( this.setStatusTo(
(<span> (<span>
<span style="color:red"> <span style="color:red">
{err ? <span><span class="emoji">🔥</span> Ошибка!</span> : 'Некритичная oшибка.'} {err
? <span><span class="emoji">🔥</span> {chrome.i18n.getMessage('Error')}!</span>
: `${chrome.i18n.getMessage('Non_critical_error')}.`
}
</span> </span>
<br/> <br/>
<span style="font-size: 0.9em; color: darkred" dangerouslySetInnerHTML={{__html: messageHtml}}></span> <span style="font-size: 0.9em; color: darkred" dangerouslySetInnerHTML={{__html: messageHtml}}></span>

View File

@ -26,9 +26,10 @@ export default function getFooter() {
</section> </section>
<footer class={scopedCss.controlRow + ' horFlex nowrap'}> <footer class={scopedCss.controlRow + ' horFlex nowrap'}>
<input type="button" value="Готово" disabled={props.ifInputsDisabled} onClick={() => window.close()} /> <input type="button" value={chrome.i18n.getMessage('Finish')} disabled={props.ifInputsDisabled} onClick={() => window.close()} />
<a href="https://rebrand.ly/ac-donate">{chrome.i18n.getMessage('Donate')}</a>
<a data-in-bg="false" href="../troubleshoot/index.html"> <a data-in-bg="false" href="../troubleshoot/index.html">
Проблемы? {chrome.i18n.getMessage('ProblemsQ')}
</a> </a>
</footer> </footer>
</div> </div>

View File

@ -144,17 +144,17 @@ export default function getMain(theState) {
return createElement(TabPanel, Object.assign({}, props, { return createElement(TabPanel, Object.assign({}, props, {
tabs: [ tabs: [
{ {
label: 'PAC-скрипт', label: chrome.i18n.getMessage('PAC_script'),
content: createElement(PacChooser, props), content: createElement(PacChooser, props),
key: 'pacScript', key: 'pacScript',
}, },
{ {
label: 'Исключения', label: chrome.i18n.getMessage('Exceptions'),
content: createElement(Exceptions, props), content: createElement(Exceptions, props),
key: 'exceptions', key: 'exceptions',
}, },
{ {
label: 'Свои прокси', label: chrome.i18n.getMessage('Own_proxies'),
content: createElement( content: createElement(
ModList, ModList,
Object.assign({}, props, { Object.assign({}, props, {
@ -168,7 +168,7 @@ export default function getMain(theState) {
key: 'ownProxies', key: 'ownProxies',
}, },
{ {
label: 'Модификаторы', label: chrome.i18n.getMessage('Modifiers'),
content: createElement( content: createElement(
ModList, ModList,
Object.assign({}, props, { Object.assign({}, props, {
@ -183,7 +183,7 @@ export default function getMain(theState) {
key: 'applyMods', key: 'applyMods',
}, },
{ {
label: 'Уведомления', label: chrome.i18n.getMessage('Notifications'),
content: createElement(Notifications, props), content: createElement(Notifications, props),
key: 'notifications', key: 'notifications',
}, },

View File

@ -124,10 +124,10 @@ export default function getPacChooser(theState) {
const iddyToCheck = this.getCurrentProviderId(); const iddyToCheck = this.getCurrentProviderId();
return ( return (
<div> <div>
{props.flags.ifInsideOptionsPage && (<header>PAC-скрипт:</header>)} {props.flags.ifInsideOptionsPage && (<header>{chrome.i18n.getMessage('PAC_script')}:</header>)}
<ul> <ul>
{ {
[...theState.apis.antiCensorRu.getSortedEntriesForProviders(), {key: 'none', label: 'Отключить'}].map((provConf) => [...theState.apis.antiCensorRu.getSortedEntriesForProviders(), {key: 'none', label: chrome.i18n.getMessage('Disable')}].map((provConf) =>
(<InfoLi (<InfoLi
onClick={this.radioClickHandler} onClick={this.radioClickHandler}
conf={provConf} conf={provConf}
@ -135,7 +135,7 @@ export default function getPacChooser(theState) {
name="pacProvider" name="pacProvider"
checked={iddyToCheck === provConf.key} checked={iddyToCheck === provConf.key}
ifInputsDisabled={props.ifInputsDisabled} ifInputsDisabled={props.ifInputsDisabled}
nodeAfterLabel={<a href="" class={scopedCss.updateButton} onClick={this.updateClickHandler}>[обновить]</a>} nodeAfterLabel={<a href="" class={scopedCss.updateButton} onClick={this.updateClickHandler}>[{chrome.i18n.getMessage('update')}]</a>}
/>) />)
) )
} }

View File

@ -54,7 +54,7 @@ export default function getTabPannel({ flags, baseCss }) {
.navLabels { .navLabels {
background-color: var(--cr-grey-panel); background-color: var(--cr-grey-panel);
text-align: center; text-align: center;
min-width: 24em; min-width: 25em;
} }
.navLabels li label { .navLabels li label {
display: inline-block; display: inline-block;

View File

@ -17,7 +17,7 @@ export default function append(document, { flags }) {
// options page width may be jerking // options page width may be jerking
// in size when scrolling is showed. // in size when scrolling is showed.
? 'width: 20em' ? 'width: 20em'
: 'max-width: 24em;' } : 'max-width: 25em;' }
} }
/* BASE ELEMENTS */ /* BASE ELEMENTS */

View File

@ -49,7 +49,7 @@ chrome.runtime.getBackgroundPage( (bgWindow) =>
); );
// READY TO RENDER // READY TO RENDER
const show = () => { document.documentElement.style.display = 'initial'; }; const show = () => { document.documentElement.style.visibility = 'initial'; };
if (theState.flags.ifInsideOptionsPage) { if (theState.flags.ifInsideOptionsPage) {
show(); show();

View File

@ -5,10 +5,11 @@
<title>Устранение проблем</title> <title>Устранение проблем</title>
</head> </head>
<body> <body>
<h1>Устранение проблем</h1> <h1>Устранение проблем</h1>
<ol> <ol>
<li><a data-in-bg="false" href id="view-errors">Детали последних ошибок</a></li> <li><a data-in-bg="false" href class="view-errors">Детали последних ошибок</a></li>
<li><a data-in-bg="false" href id="reset-settings">Сбросить настройки</a></li> <li><a data-in-bg="false" href class="reset-settings">Сбросить настройки</a></li>
<li><a data-in-bg="false" href="https://rebrand.ly/ac-support" target="_blank">Файл самопомощи</a></li> <li><a data-in-bg="false" href="https://rebrand.ly/ac-support" target="_blank">Файл самопомощи</a></li>
<li><a data-in-bg="false" href="https://rebrand.ly/ac-contact">Напишите нам!</a></li> <li><a data-in-bg="false" href="https://rebrand.ly/ac-contact">Напишите нам!</a></li>
</ol> </ol>
@ -17,6 +18,19 @@
<li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li> <li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">Как прочитать логи?</a></li>
<li><a data-in-bg="false" href="../debug/index.html">Отладка PAC-скрипта</a></li> <li><a data-in-bg="false" href="../debug/index.html">Отладка PAC-скрипта</a></li>
</ol> </ol>
<hr/>
<h1>Troubleshooting</h1>
<ol>
<li><a data-in-bg="false" href class="view-errors">Details of last errors</a></li>
<li><a data-in-bg="false" href class="reset-settings">Reset settings</a></li>
<li><a data-in-bg="false" href="https://rebrand.ly/ac-support" target="_blank">Troubleshoot guide (ru)</a></li>
<li><a data-in-bg="false" href="https://rebrand.ly/ac-contact">Write to us!</a></li>
</ol>
<h2>Advanced</h2>
<ol>
<li><a data-in-bg="false" href="https://rebrand.ly/ac-logs">How to read logs?</a></li>
<li><a data-in-bg="false" href="../debug/index.html">PAC-script debugging</a></li>
</ol>
<script src="./index.js"></script> <script src="./index.js"></script>
<script src="../lib/keep-links-clickable.js"></script> <script src="../lib/keep-links-clickable.js"></script>
</body> </body>

View File

@ -4,15 +4,22 @@ chrome.runtime.getBackgroundPage( (backgroundPage) =>
backgroundPage.apis.errorHandlers.installListenersOn( backgroundPage.apis.errorHandlers.installListenersOn(
window, 'TRBL', () => { window, 'TRBL', () => {
document.getElementById('reset-settings').onclick = () => { document.querySelectorAll('.reset-settings').forEach((el) => {
el.onclick = () => {
backgroundPage.localStorage.clear(); backgroundPage.localStorage.clear();
chrome.storage.local.clear( () => chrome.runtime.reload() ); chrome.storage.local.clear( () => chrome.runtime.reload() );
}; };
});
document.getElementById('view-errors').onclick = () => document.querySelectorAll('.view-errors').forEach((el) => {
el.onclick = () =>
backgroundPage.apis.errorHandlers.viewError('all'); backgroundPage.apis.errorHandlers.viewError('all');
});
}) },
),
); );

View File

@ -10,7 +10,7 @@ const pacUrls = [
]; ];
const commonContext = { const commonContext = {
version: '1.30', version: '1.31',
anticensorityPacUrls: [ anticensorityPacUrls: [
...pacUrls, ...pacUrls,
], ],