Delete trash
|
@ -1,45 +0,0 @@
|
|||
nl.drew.cp.lang.s['en'] = {
|
||||
"msgOn":"on",
|
||||
"msgOff":"off",
|
||||
|
||||
"allSites":"All Sites",
|
||||
"thisSite":"This Site",
|
||||
"listsTab":"Lists Sites",
|
||||
"userProTab":"User proxys",
|
||||
|
||||
"proxyEnabled": "Proxy enabled for all sites",
|
||||
"anonymityEnabled": "Enable anonymity for all sites",
|
||||
"locationForAll": "Use proxy location for all sites:",
|
||||
"torForAll": "TOR for all sites",
|
||||
"notUseProxy":"Not use proxy for this site",
|
||||
"alwUseProxy":"Always use proxy for this site",
|
||||
"anonForSite":"Enable anonymity for this site",
|
||||
"locSite":"Use proxy location for this site:",
|
||||
"torForSite": "TOR for this site",
|
||||
"setHttp":"Use proxy for https traffic",
|
||||
"setHelp":"Tips enable",
|
||||
|
||||
"proxyOff": "proxy <b>off</b> for this site",
|
||||
"proxyEnabledHelp": "if you disable this option, you will have access to all proxies, not just public and increases speed",
|
||||
"anonymityEnabledHelp": "Anonymity allows you to hide your IP, but it also imposes some restrictions. Some sites may block the access because of anonymity.",
|
||||
"locationForAllHelp": "If possible, the proxy will be chosen this country",
|
||||
|
||||
"notUseProxyHelp":"even if proxy is enabled for all sites",
|
||||
"alwUseProxyHelp":"even if proxy is disabled for all sites",
|
||||
"anonForSiteHelp":"only for this site",
|
||||
"locSiteHelp":"",
|
||||
"torAllHelp":"send all traffic through TOR",
|
||||
"torSiteHelp":"send site traffic through TOR",
|
||||
|
||||
"EmptyURL":"Empty URL",
|
||||
"WrongURLformat":"Wrong URL format",
|
||||
"WrongURLprotocol":"Wrong URL protocol",
|
||||
"ThisURLalreadyadded":"This URL already added",
|
||||
"Nooptionschanged":"No options changed",
|
||||
|
||||
"interfaceLanguage":"Interface language",
|
||||
|
||||
"uProxyNameFormat": "Wrong format of the list name. Must consist of letters, digits and _-",
|
||||
"uProxyNameAlreadyHave": "Already there is the proxy named ",
|
||||
"errUproxyIpFormat": "Proxy is defined as IP:PORT, for example: <b>127.0.0.1:443</b> or <b>proxyname.example:1080</b>"
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"chrome_extension_name": {
|
||||
"message": "Proxy for Chrome"
|
||||
},
|
||||
"chrome_extension_description": {
|
||||
"message": "Free proxy servers for you"
|
||||
},
|
||||
"browser_action_title": {
|
||||
"message": "on/off"
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
nl.drew.cp.lang.s['ru'] = {
|
||||
"msgOn":"вкл",
|
||||
"msgOff":"выкл",
|
||||
|
||||
"allSites":"Все сайты",
|
||||
"thisSite":"Текущий сайт",
|
||||
"listsTab":"Списки сайтов",
|
||||
"userProTab":"Мои прокси",
|
||||
|
||||
"proxyOff": "прокси <b>выкл.</b> для этого сайта",
|
||||
"proxyEnabled": "Вкл. прокси для всех сайтов",
|
||||
"anonymityEnabled": "Вкл. анонимность для всех сайтов",
|
||||
"locationForAll": "Для всех сайтов использовать локацию:",
|
||||
"torForAll": "Все сайты через TOR",
|
||||
|
||||
"notUseProxy":"Для этого сайта не использовать прокси",
|
||||
"alwUseProxy":"Всегда использовать прокси для этого сайта",
|
||||
"anonForSite":"Вкл. анонимность для этого сайта",
|
||||
"locSite":"Для этого сайта использовать локацию:",
|
||||
"torForSite": "Этот сайт через TOR",
|
||||
"setHttp":"Использовать прокси для https протокола",
|
||||
"setHelp":"Включить подсказки",
|
||||
|
||||
"locationForAllHelp": "По возможности будет выбран прокси этой страны",
|
||||
"proxyEnabledHelp": "если отключить эту опцию, то будут доступны все прокси, а не только общественные, что может значительно увеличить скорость",
|
||||
"anonymityEnabledHelp": "Анонимность позволяет скрыть свой IP, но одновременно накладывает некоторые ограничения. Некоторые сайты могут прекратить ваш доступ из-за анонимности.",
|
||||
"notUseProxyHelp":"даже если прокси включен для всех сайтов",
|
||||
"alwUseProxyHelp":"даже если прокси отключен для всех сайтов",
|
||||
"anonForSiteHelp":"только для этого сайта",
|
||||
"locSiteHelp":"",
|
||||
"torAllHelp":"направить весь трафик через шлюз tor",
|
||||
"torSiteHelp":"использовать tor для доступа к этому сайту",
|
||||
|
||||
"EmptyURL":"Поле URL пустое",
|
||||
"WrongURLformat":"Неправильный формать URL",
|
||||
"WrongURLprotocol":"Неправильный протокол URL",
|
||||
"ThisURLalreadyadded":"Этот адрес уже добавлен",
|
||||
"Nooptionschanged":"Нет измененных опций",
|
||||
|
||||
"interfaceLanguage":"Язык интерфейса",
|
||||
|
||||
"errUProxyNameFormat": "Имя прокси должно состоять из букв, цифр, тире и знака подчеркивания. От 3 до 9 символов",
|
||||
"errUProxyNameAlreadyHave": "Уже есть прокси с именем ",
|
||||
"errUproxyIpFormat": "Прокси задается в виде IP:PORT, например 127.0.0.1:443 или proxyname.example:1080"
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"chrome_extension_name": {
|
||||
"message": "Proxy for Chrome"
|
||||
},
|
||||
"chrome_extension_description": {
|
||||
"message": "Бесплатные прокси сервера для вашего браузера"
|
||||
},
|
||||
"browser_action_title": {
|
||||
"message": "babyList - вкл/выкл"
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="js/core/vars.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/ls.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/lib.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/icoanimation.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/conf.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/proxy.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/api.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/lib.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/interf.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/header.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/cache.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/core/core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<img src="im/ico19-2.png"/>
|
||||
<img src="im/ico19g-2.png"/>
|
||||
<img src="im/co/ru.png"/>
|
||||
<img src="im/co/de.png"/>
|
||||
<img src="im/co/uk.png"/>
|
||||
<img src="im/co/fr.png"/>
|
||||
<img src="im/co/nl.png"/>
|
||||
</body>
|
||||
</html>
|
|
@ -1,245 +0,0 @@
|
|||
|
||||
div#foot {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.cp-os-light {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.cp-os {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.cp-os-bold {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cp-os-condensed {
|
||||
font-family: 'Open Sans Condensed', sans-serif;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.cp-os-condensed-bold {
|
||||
font-family: 'Open Sans Condensed', sans-serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cp-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cp-pointer:hover {
|
||||
color: #777777;
|
||||
}
|
||||
|
||||
#mainproxy {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
td#mainproxyco {
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
#mainproxyco img {
|
||||
height: 28px;
|
||||
width: 42px;
|
||||
box-shadow: 0 0 1px 1px #dfdfdf;
|
||||
}
|
||||
|
||||
#listtable img {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
#hideip img {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.uk-text-success {
|
||||
color: #5B7900;
|
||||
}
|
||||
|
||||
.uk-tab li {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#configproxy > li {
|
||||
padding: 20px 20px 20px 15px;
|
||||
}
|
||||
|
||||
#configproxy > li.uk-active {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
a, .uk-tab > li > a {
|
||||
color: #006D9A;
|
||||
}
|
||||
|
||||
#flags-all, #flags-site {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cp-flags {
|
||||
display: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cp-uproxy {
|
||||
padding-left: 7px;
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.cp-uproxy > div {
|
||||
|
||||
}
|
||||
|
||||
.cp-flag {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
|
||||
background-color: #fff;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 3px;
|
||||
|
||||
padding: 5px 5px 5px 5px;
|
||||
-webkit-transition: background-color 0.3s;
|
||||
transition: background-color 0.3s;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.cp-flag img {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 32px;
|
||||
box-shadow: 0 0 2px 1px #efefef;
|
||||
}
|
||||
|
||||
label img {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 22px;
|
||||
box-shadow: 0 0 2px 1px #d0d0d0;
|
||||
}
|
||||
|
||||
.cp-flag:hover {
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 0 0 2px 1px #dfdfdf;
|
||||
}
|
||||
|
||||
.cp-flag.is-active {
|
||||
|
||||
border: 1px solid #fff;
|
||||
background: #B8BDC6;
|
||||
/*
|
||||
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%, #646473 200%);
|
||||
*/
|
||||
}
|
||||
|
||||
.cp-uproxy.is-active {
|
||||
|
||||
}
|
||||
|
||||
.cp-flag.is-active:after, .cp-uproxy.is-active:after {
|
||||
font-family: FontAwesome;
|
||||
content: "\f058";
|
||||
position: absolute;
|
||||
margin-left: -22px;
|
||||
top: 26px;
|
||||
color: #80A000;
|
||||
}
|
||||
|
||||
tr, td, table {
|
||||
border: 0px solid #da314b;
|
||||
}
|
||||
|
||||
.cp-uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #006D9A;
|
||||
}
|
||||
|
||||
.uk-form {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.cp-newhost input {
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
.uk-form input[type="text"] {
|
||||
height: 23px;
|
||||
}
|
||||
|
||||
td.cp-act {
|
||||
width: 54px;
|
||||
}
|
||||
|
||||
.cp-pname, .cp-pproto {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.cp-pip {
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.cp-pproto select {
|
||||
height: 23px;
|
||||
}
|
||||
|
||||
#addproxy {
|
||||
font-size: 24px;
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
.uk-badge {
|
||||
background: #006D9A;
|
||||
}
|
||||
|
||||
.uk-badge a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.uk-dropdown {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.uk-dropdown-scrollable {
|
||||
max-height: 140px;
|
||||
}
|
||||
|
||||
.cp-vspace {
|
||||
height: 7px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cp-unvis {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.uk-scrollable-text {
|
||||
max-height: 300px;
|
||||
min-height: 100px;
|
||||
height: auto;
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*! UIkit 2.12.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/* ========================================================================
|
||||
Component: Notify
|
||||
========================================================================== */
|
||||
/*
|
||||
* Message container for positioning
|
||||
*/
|
||||
.uk-notify {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 1040;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
width: 350px;
|
||||
}
|
||||
/* Position modifiers
|
||||
========================================================================== */
|
||||
.uk-notify-top-right,
|
||||
.uk-notify-bottom-right {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
.uk-notify-top-center,
|
||||
.uk-notify-bottom-center {
|
||||
left: 50%;
|
||||
margin-left: -175px;
|
||||
}
|
||||
.uk-notify-bottom-left,
|
||||
.uk-notify-bottom-right,
|
||||
.uk-notify-bottom-center {
|
||||
top: auto;
|
||||
bottom: 10px;
|
||||
}
|
||||
/* Responsiveness
|
||||
========================================================================== */
|
||||
/* Phones portrait and smaller */
|
||||
@media (max-width: 479px) {
|
||||
/*
|
||||
* Fit in small screen
|
||||
*/
|
||||
.uk-notify {
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
width: auto;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
/* Sub-object: `uk-notify-message`
|
||||
========================================================================== */
|
||||
.uk-notify-message {
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
padding: 15px;
|
||||
background: #444444;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #444444;
|
||||
border-radius: 4px;
|
||||
}
|
||||
/* Close in notify
|
||||
========================================================================== */
|
||||
.uk-notify-message > .uk-close {
|
||||
visibility: hidden;
|
||||
float: right;
|
||||
}
|
||||
.uk-notify-message:hover > .uk-close {
|
||||
visibility: visible;
|
||||
}
|
||||
/* Modifier: `uk-alert-info`
|
||||
========================================================================== */
|
||||
.uk-notify-message-primary {
|
||||
background: #ebf7fd;
|
||||
color: #2d7091;
|
||||
border-color: rgba(45, 112, 145, 0.3);
|
||||
}
|
||||
/* Modifier: `uk-alert-success`
|
||||
========================================================================== */
|
||||
.uk-notify-message-success {
|
||||
background: #f2fae3;
|
||||
color: #659f13;
|
||||
border-color: rgba(101, 159, 19, 0.3);
|
||||
}
|
||||
/* Modifier: `uk-notify-message-warning`
|
||||
========================================================================== */
|
||||
.uk-notify-message-warning {
|
||||
background: #fffceb;
|
||||
color: #e28327;
|
||||
border-color: rgba(226, 131, 39, 0.3);
|
||||
}
|
||||
/* Modifier: `uk-notify-message-danger`
|
||||
========================================================================== */
|
||||
.uk-notify-message-danger {
|
||||
background: #fff1f0;
|
||||
color: #d85030;
|
||||
border-color: rgba(216, 80, 48, 0.3);
|
||||
}
|
|
@ -1,123 +0,0 @@
|
|||
/* jquery.switcher - 1.2.4
|
||||
* https://github.com/djanix/jquery-switcher
|
||||
* Copyright (c) 2014-11-04 - */
|
||||
|
||||
|
||||
.switcher {
|
||||
cursor: pointer;
|
||||
/*
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
||||
*/
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
.switcher .content {
|
||||
position: relative;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.switcher .text {
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.switcher.is-disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.switcher.default {
|
||||
background-color: #efeff0;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 4px;
|
||||
line-height: 26px;
|
||||
min-width: 80px;
|
||||
padding: 2px;
|
||||
-webkit-transition: background-color 0.3s;
|
||||
transition: background-color 0.3s;
|
||||
margin: 4px 6px 0px 0px;
|
||||
}
|
||||
.switcher.default input {
|
||||
display: none;
|
||||
}
|
||||
.switcher.default .slider {
|
||||
background-color: white;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 0 2px 1px #dfdfdf;
|
||||
box-shadow: 0 0 2px 1px #dfdfdf;
|
||||
height: 26px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
-webkit-transform: translateX(0%);
|
||||
-ms-transform: translateX(0%);
|
||||
transform: translateX(0%);
|
||||
-webkit-transition: -webkit-transform 0.3s;
|
||||
transition: transform 0.3s;
|
||||
width: 50%;
|
||||
z-index: 2;
|
||||
}
|
||||
.switcher.default .text {
|
||||
width: 50%;
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
.switcher.default .textYes {
|
||||
color: white;
|
||||
float: left;
|
||||
}
|
||||
.switcher.default .textNo {
|
||||
color: #9f9f9f;
|
||||
float: right;
|
||||
}
|
||||
.switcher.default.is-active {
|
||||
background-color: #80A000;
|
||||
}
|
||||
.switcher.default.is-active .slider {
|
||||
-webkit-transform: translateX(100%);
|
||||
-ms-transform: translateX(100%);
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
.switcher.short {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.switcher.short input {
|
||||
display: none;
|
||||
}
|
||||
.switcher.short .content {
|
||||
border: 1px solid #aaaaaa;
|
||||
border-radius: 50%;
|
||||
height: 18px;
|
||||
padding: 0;
|
||||
width: 18px;
|
||||
}
|
||||
.switcher.short .slider {
|
||||
background-color: #519b20;
|
||||
border-radius: 50%;
|
||||
height: 12px;
|
||||
margin: 3px;
|
||||
opacity: 0;
|
||||
-webkit-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
-webkit-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
width: 12px;
|
||||
}
|
||||
.switcher.short.is-active .slider {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 744 B |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 997 B |
Before Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 921 B |
Before Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 2.0 KiB |
|
@ -1,509 +0,0 @@
|
|||
nl.drew.cp.core.api = function() {
|
||||
var api = {port:null};
|
||||
api.handling = function(port, msg) {
|
||||
var lid;
|
||||
nl.drew.cp.core.api.port = port;
|
||||
if (msg.msg == "log") {
|
||||
nl.drew.cp.lib.debug(msg.param);
|
||||
} else {
|
||||
if (msg.msg == "on") {
|
||||
nl.drew.cp.core.main.start(true);
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
} else {
|
||||
if (msg.msg == "off") {
|
||||
nl.drew.cp.core.main.stop();
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
} else {
|
||||
if (msg.msg == "icoupd") {
|
||||
nl.drew.cp.core.interf.icoupdate2();
|
||||
} else {
|
||||
if (msg.msg == "set") {
|
||||
if (msg.param == "https") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
nl.drew.cp.state.https = msg.val;
|
||||
nl.drew.cp.ls.set("https", nl.drew.cp.state.https, false);
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "uproxyremove") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.co != "undefined" && msg.val.co) {
|
||||
var delUproxyList = nl.drew.cp.core.lib.inUproxyList(msg.val.co);
|
||||
if (delUproxyList > -1) {
|
||||
nl.drew.cp.state.uproxys.splice(delUproxyList, 1);
|
||||
nl.drew.cp.ls.set("uproxys", nl.drew.cp.state.uproxys, false);
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
nl.drew.cp.core.filter.inst();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "uproxy") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.oldname != "undefined" && msg.val.oldname) {
|
||||
var i = nl.drew.cp.core.lib.inUproxyList(msg.val.oldname);
|
||||
var newname = msg.val.proto.toUpperCase() + " " + msg.val.ip + ":" + msg.val.port;
|
||||
if (i > -1) {
|
||||
nl.drew.cp.state.uproxys[i].co = msg.val.co;
|
||||
nl.drew.cp.state.uproxys[i].proto = msg.val.proto;
|
||||
nl.drew.cp.state.uproxys[i].ip = msg.val.ip;
|
||||
nl.drew.cp.state.uproxys[i].port = msg.val.port;
|
||||
nl.drew.cp.state.uproxys[i].name = newname;
|
||||
nl.drew.cp.state.uproxys[i].off = msg.val.hasOwnProperty("off") ? msg.val.off : nl.drew.cp.state.uproxys[i].off;
|
||||
if (nl.drew.cp.state.listContrySite.hasOwnProperty(msg.val.oldname)) {
|
||||
nl.drew.cp.state.listContrySite[msg.val.co] = nl.drew.cp.lib.clone(nl.drew.cp.state.listContrySite[msg.val.oldname]);
|
||||
delete nl.drew.cp.state.listContrySite[msg.val.oldname];
|
||||
}
|
||||
} else {
|
||||
nl.drew.cp.state.uproxys.push({ip:msg.val.ip, port:msg.val.port, sport:"", proto:msg.val.proto, co:msg.val.co, name:newname, off:msg.val.hasOwnProperty("off") ? msg.val.off : false});
|
||||
}
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
nl.drew.cp.ls.set("uproxys", nl.drew.cp.state.uproxys, false);
|
||||
nl.drew.cp.core.filter.inst();
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "liston") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
nl.drew.cp.core.lib.liston(msg.val);
|
||||
nl.drew.cp.core.api.postMessage({param:"lists", val:nl.drew.cp.core.lib.globalListGen()});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "listoff") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
nl.drew.cp.core.lib.listoff(msg.val);
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "listonrest") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
nl.drew.cp.core.lib.liston(msg.val, true);
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "listonremove") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
var nosend = false;
|
||||
if (typeof msg.val.nosend != "undefined") {
|
||||
nosend = msg.val.nosend;
|
||||
}
|
||||
nl.drew.cp.core.lib.listoff(msg.val.host, true, nosend);
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "listoffrest") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
if (nl.drew.cp.core.lib.inOffSiteListAllParam(msg.val) == -1) {
|
||||
nl.drew.cp.state.offlist.push(msg.val);
|
||||
}
|
||||
}
|
||||
nl.drew.cp.core.cache.nowProxyClean({host:msg.val});
|
||||
} else {
|
||||
if (msg.param == "listoffremove") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
lid = nl.drew.cp.core.lib.inOffSiteListAllParam(msg.val);
|
||||
if (lid == -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
nl.drew.cp.ls.set("offlist", nl.drew.cp.state.offlist, false);
|
||||
nl.drew.cp.core.cache.nowProxyClean({host:msg.val});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "globalalwproxy") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
nl.drew.cp.state.alwProxy = msg.val;
|
||||
nl.drew.cp.ls.set("globalalwproxy", nl.drew.cp.state.alwProxy, false);
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
nl.drew.cp.core.filter.inst();
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "contrymain") {
|
||||
if (typeof msg.val != "undefined" && msg.val) {
|
||||
nl.drew.cp.state.contryMain = msg.val;
|
||||
nl.drew.cp.ls.set("contrymain", nl.drew.cp.state.contryMain, false);
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
nl.drew.cp.core.filter.inst();
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "tor") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
if (typeof msg.val.all != "undefined") {
|
||||
nl.drew.cp.state.torAll = msg.val.all;
|
||||
nl.drew.cp.ls.set("torall", nl.drew.cp.state.torAll, false);
|
||||
}
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow();
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "torsite") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
if ((typeof msg.val.list == "undefined" || !msg.val.list) && (!purl.allow || msg.val.host != purl.host)) {
|
||||
return;
|
||||
}
|
||||
if (msg.val.val) {
|
||||
if (nl.drew.cp.core.lib.inTorSiteList(msg.val.host) > -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listTorSite.push(msg.val.host);
|
||||
} else {
|
||||
var ind = nl.drew.cp.core.lib.inTorSiteList(msg.val.host);
|
||||
if (ind == -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listTorSite.splice(ind, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("torSite", nl.drew.cp.state.listTorSite, false);
|
||||
nl.drew.cp.core.interf.icoupdate7(tab.url);
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow(msg.val);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "anonymity") {
|
||||
if (typeof msg.val != "undefined") {
|
||||
if (typeof msg.val.all != "undefined") {
|
||||
nl.drew.cp.state.anonymityAll = msg.val.all;
|
||||
nl.drew.cp.ls.set("anonymityall", nl.drew.cp.state.anonymityAll, false);
|
||||
}
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow();
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "anonymitysite") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
if ((typeof msg.val.list == "undefined" || !msg.val.list) && (!purl.allow || msg.val.host != purl.host)) {
|
||||
return;
|
||||
}
|
||||
if (msg.val.val) {
|
||||
if (nl.drew.cp.core.lib.inAnSiteList(msg.val.host) > -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listAnSite.push(msg.val.host);
|
||||
} else {
|
||||
var ind = nl.drew.cp.core.lib.inAnSiteList(msg.val.host);
|
||||
if (ind == -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listAnSite.splice(ind, 1);
|
||||
}
|
||||
lid = nl.drew.cp.core.lib.checkListOnOff(msg.val.host);
|
||||
if (lid > -1) {
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("anSite", nl.drew.cp.state.listAnSite, false);
|
||||
var nosend = false;
|
||||
if (typeof msg.val.nosend != "undefined") {
|
||||
nosend = msg.val.nosend;
|
||||
}
|
||||
if (!nosend) {
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow(msg.val);
|
||||
}
|
||||
nl.drew.cp.core.api.sendList(msg.val.listRequest, msg.val.host);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "nonproxy") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
nl.drew.cp.core.cache.nowProxyClean(purl);
|
||||
if ((typeof msg.val.list == "undefined" || !msg.val.list) && (!purl.allow || msg.val.host != purl.host)) {
|
||||
return;
|
||||
}
|
||||
if (msg.val.val) {
|
||||
if (nl.drew.cp.core.lib.inNonProxySiteList(msg.val.host) > -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listNonProxySite.push(msg.val.host);
|
||||
var ind = nl.drew.cp.core.lib.inAlwProxySiteList(msg.val.host);
|
||||
if (ind > -1) {
|
||||
nl.drew.cp.state.listAlwProxySite.splice(ind, 1);
|
||||
}
|
||||
} else {
|
||||
var ind = nl.drew.cp.core.lib.inNonProxySiteList(msg.val.host);
|
||||
if (ind == -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listNonProxySite.splice(ind, 1);
|
||||
}
|
||||
lid = nl.drew.cp.core.lib.checkListOnOff(msg.val.host);
|
||||
if (lid > -1) {
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("alwProxySite", nl.drew.cp.state.listAlwProxySite, false);
|
||||
nl.drew.cp.ls.set("nonProxySite", nl.drew.cp.state.listNonProxySite, false);
|
||||
nl.drew.cp.core.filter.inst();
|
||||
var nosend = false;
|
||||
if (typeof msg.val.nosend != "undefined") {
|
||||
nosend = msg.val.nosend;
|
||||
}
|
||||
if (!nosend) {
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList(msg.val);
|
||||
}
|
||||
nl.drew.cp.core.api.sendList(msg.val.listRequest, msg.val.host);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "alwproxy") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
nl.drew.cp.core.cache.nowProxyClean(purl);
|
||||
if ((typeof msg.val.list == "undefined" || !msg.val.list) && (!purl.allow || msg.val.host != purl.host)) {
|
||||
return;
|
||||
}
|
||||
if (msg.val.val) {
|
||||
if (nl.drew.cp.core.lib.inAlwProxySiteListEqually(msg.val.host) > -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listAlwProxySite.push(msg.val.host);
|
||||
var ind = nl.drew.cp.core.lib.inNonProxySiteList(msg.val.host);
|
||||
if (ind > -1) {
|
||||
nl.drew.cp.state.listNonProxySite.splice(ind, 1);
|
||||
}
|
||||
} else {
|
||||
var ind = nl.drew.cp.core.lib.inAlwProxySiteListEqually(msg.val.host);
|
||||
if (ind == -1) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.listAlwProxySite.splice(ind, 1);
|
||||
}
|
||||
lid = nl.drew.cp.core.lib.checkListOnOff(msg.val.host);
|
||||
if (lid > -1) {
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("alwProxySite", nl.drew.cp.state.listAlwProxySite, false);
|
||||
nl.drew.cp.ls.set("nonProxySite", nl.drew.cp.state.listNonProxySite, false);
|
||||
nl.drew.cp.core.filter.inst();
|
||||
var nosend = false;
|
||||
if (typeof msg.val.nosend != "undefined") {
|
||||
nosend = msg.val.nosend;
|
||||
}
|
||||
if (!nosend) {
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList(msg.val);
|
||||
}
|
||||
nl.drew.cp.core.api.sendList(msg.val.listRequest, msg.val.host);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "contrysite") {
|
||||
if (typeof msg.val != "undefined" && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
nl.drew.cp.core.cache.nowProxyClean(purl);
|
||||
if ((typeof msg.val.list == "undefined" || !msg.val.list) && (!purl.allow || msg.val.host != purl.host)) {
|
||||
return;
|
||||
}
|
||||
var key = msg.val.val;
|
||||
if (key != "main") {
|
||||
nl.drew.cp.core.lib.delContrySiteList(msg.val.host);
|
||||
if (typeof nl.drew.cp.state.listContrySite[key] == "undefined") {
|
||||
nl.drew.cp.state.listContrySite[key] = [];
|
||||
}
|
||||
nl.drew.cp.state.listContrySite[key].push(msg.val.host);
|
||||
} else {
|
||||
nl.drew.cp.core.lib.delContrySiteList(msg.val.host);
|
||||
}
|
||||
lid = nl.drew.cp.core.lib.checkListOnOff(msg.val.host);
|
||||
if (lid > -1) {
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("contrySiteList", nl.drew.cp.state.listContrySite, false);
|
||||
nl.drew.cp.core.proxy.getNowProxy(null, purl, true, true);
|
||||
nl.drew.cp.core.filter.inst();
|
||||
var nosend = false;
|
||||
if (typeof msg.val.nosend != "undefined") {
|
||||
nosend = msg.val.nosend;
|
||||
}
|
||||
if (!nosend) {
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList(msg.val);
|
||||
if (typeof msg.val.list != "undefined" && msg.val.list) {
|
||||
nl.drew.cp.core.api.sendtoPortContrys(msg.val);
|
||||
}
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow(msg.val);
|
||||
}
|
||||
nl.drew.cp.core.api.sendList(msg.val.listRequest, msg.val.host);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.msg == "get") {
|
||||
if (msg.param == "https") {
|
||||
port.postMessage({param:"https", val:nl.drew.cp.state.https});
|
||||
} else {
|
||||
if (msg.param == "globalalwproxy") {
|
||||
port.postMessage({param:"globalalwproxy", val:nl.drew.cp.state.alwProxy});
|
||||
} else {
|
||||
if (msg.param == "isenabled") {
|
||||
port.postMessage({param:"isenabled", val:nl.drew.cp.state.isenabled});
|
||||
} else {
|
||||
if (msg.param == "state") {
|
||||
port.postMessage({param:"state", val:nl.drew.cp.state.state});
|
||||
} else {
|
||||
if (msg.param == "uproxy") {
|
||||
port.postMessage({param:"uproxy", val:{uproxy:nl.drew.cp.state.uproxys, template:nl.drew.cp.config.proxyTemplate}});
|
||||
} else {
|
||||
if (msg.param == "mainproxy") {
|
||||
nl.drew.cp.core.api.sendtoPortMainproxy();
|
||||
} else {
|
||||
if (msg.param == "contrys") {
|
||||
nl.drew.cp.core.api.sendtoPortContrys(msg.val);
|
||||
} else {
|
||||
if (msg.param == "anonymity") {
|
||||
nl.drew.cp.core.api.sendtoPortAnonymity(msg.val);
|
||||
} else {
|
||||
if (msg.param == "anonymitynow") {
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow(msg.val);
|
||||
} else {
|
||||
if (msg.param == "tor") {
|
||||
nl.drew.cp.core.api.sendtoPortTor(msg.val);
|
||||
} else {
|
||||
if (msg.param == "nonproxyalwproxy") {
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList(msg.val);
|
||||
} else {
|
||||
if (msg.param == "lists") {
|
||||
nl.drew.cp.core.api.sendList(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
api.sendList = function(isSend, host) {
|
||||
if (!isSend) {
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.core.api.postMessage({param:"lists", val:nl.drew.cp.core.lib.globalListGen(), host:host});
|
||||
};
|
||||
api.sendtoPortInProxyList = function(val) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
purl.host = nl.drew.cp.core.api.preSendtoPort(val, purl);
|
||||
nl.drew.cp.core.api.postMessage({param:"nonproxyalwproxy", val:{host:purl.host, nonproxy:nl.drew.cp.core.lib.inNonProxySiteList(purl.host), alwproxy:nl.drew.cp.core.lib.inAlwProxySiteList(purl.host)}});
|
||||
});
|
||||
}
|
||||
};
|
||||
api.sendtoPortAnonymitynow = function(val) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
purl.host = nl.drew.cp.core.api.preSendtoPort(val, purl);
|
||||
var nowProxy = nl.drew.cp.core.proxy.getNowProxy(null, purl, true, true);
|
||||
if (nowProxy && nowProxy.co.length > 2) {
|
||||
nl.drew.cp.core.api.postMessage({param:"anonymitynow", val:[false, false]});
|
||||
} else {
|
||||
nl.drew.cp.core.api.postMessage({param:"anonymitynow", val:[nl.drew.cp.core.header.getAnonymityNow(purl.host), nl.drew.cp.core.header.getTorNow(purl.host)]});
|
||||
}
|
||||
nl.drew.cp.core.interf.icoupdate7(tab.url);
|
||||
});
|
||||
}
|
||||
};
|
||||
api.sendtoPortAnonymity = function(val) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
purl.host = nl.drew.cp.core.api.preSendtoPort(val, purl);
|
||||
nl.drew.cp.core.api.postMessage({param:"anonymity", val:nl.drew.cp.core.header.getAnonymity(purl.host)});
|
||||
});
|
||||
}
|
||||
};
|
||||
api.sendtoPortTor = function(val) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
purl.host = nl.drew.cp.core.api.preSendtoPort(val, purl);
|
||||
nl.drew.cp.core.api.postMessage({param:"tor", val:nl.drew.cp.core.header.getTor(purl.host)});
|
||||
});
|
||||
}
|
||||
};
|
||||
api.sendtoPortState = function() {
|
||||
nl.drew.cp.core.api.postMessage({param:"state", val:nl.drew.cp.state.state});
|
||||
};
|
||||
api.sendtoPortMainproxy = function(nowProxys) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
if (nl.drew.cp.state.started) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
var nowProxy = {};
|
||||
if (nl.drew.cp.state.alwProxy) {
|
||||
nowProxy = {name:" proxy server", co:"public", allow:true};
|
||||
} else {
|
||||
nowProxy = nl.drew.cp.core.proxy.getNowProxy(nowProxys, purl, true, true);
|
||||
}
|
||||
if (purl.allow && nowProxy == null) {
|
||||
nowProxy = {host:purl.host};
|
||||
}
|
||||
nl.drew.cp.core.interf.icoupdate7(tab.url);
|
||||
nl.drew.cp.core.api.sendtoPort({param:"mainproxy", val:nowProxy});
|
||||
} else {
|
||||
nl.drew.cp.core.api.postMessage({param:"mainproxy", val:false});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
api.sendtoPortContrys = function(val) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
purl.host = nl.drew.cp.core.api.preSendtoPort(val, purl);
|
||||
nl.drew.cp.core.api.postMessage({param:"contrys", val:{contrys:nl.drew.cp.state.contrys, uproxys:nl.drew.cp.state.uproxys, contrymain:nl.drew.cp.state.contryMain, contrysite:nl.drew.cp.core.lib.inContrySiteList(purl.host), host:purl.host}});
|
||||
});
|
||||
}
|
||||
};
|
||||
api.preSendtoPort = function(val, purl) {
|
||||
if ((!val || typeof val.list == "undefined" || !val.list) && !purl.allow) {
|
||||
return "";
|
||||
} else {
|
||||
if (val && typeof val.list != "undefined" && val.list) {
|
||||
return val.host;
|
||||
} else {
|
||||
if (!val || typeof val.host == "undefined" || !val.host) {
|
||||
return purl.host;
|
||||
} else {
|
||||
if (val.host != purl.host) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return purl.host;
|
||||
};
|
||||
api.sendtoPort = function(msg) {
|
||||
nl.drew.cp.core.api.postMessage(msg);
|
||||
};
|
||||
api.postMessage = function(msg) {
|
||||
if (nl.drew.cp.core.api.port) {
|
||||
try {
|
||||
nl.drew.cp.core.api.port.postMessage(msg);
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
};
|
||||
return api;
|
||||
}();
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
nl.drew.cp.core.cache = function() {
|
||||
var cache = {};
|
||||
cache.nowProxyAllClean = function() {
|
||||
nl.drew.cp.state.nowProxyCache = {};
|
||||
};
|
||||
cache.nowProxyClean = function(purl) {
|
||||
if (typeof purl.host != "undefined" && purl.host) {
|
||||
delete nl.drew.cp.state.nowProxyCache[purl.host];
|
||||
}
|
||||
};
|
||||
return cache;
|
||||
}();
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
nl.drew.cp.core.conf = function() {
|
||||
var conf = {};
|
||||
conf.getApiUrl = function() {
|
||||
if (nl.drew.cp.ls.isset("conf")) {
|
||||
var conf = nl.drew.cp.ls.get("conf");
|
||||
if (conf) {
|
||||
if (typeof conf.Apiurl != "undefined" && conf.Apiurl.length > 0) {
|
||||
nl.drew.cp.config.apiurl = conf.Apiurl;
|
||||
}
|
||||
if (typeof conf.Apiext != "undefined" && conf.Apiext.length > 0) {
|
||||
nl.drew.cp.config.apiext = conf.Apiext;
|
||||
}
|
||||
if (typeof conf.Apiind != "undefined" && conf.Apiind.length > 0) {
|
||||
nl.drew.cp.config.apiind = conf.Apiind;
|
||||
}
|
||||
if (typeof conf.Apidop != "undefined" && conf.Apidop.length > 0) {
|
||||
nl.drew.cp.config.apidop = conf.Apidop;
|
||||
}
|
||||
}
|
||||
}
|
||||
var ret = new Array;
|
||||
var uriapi;
|
||||
for (var i in nl.drew.cp.config.apiurl) {
|
||||
for (var j in nl.drew.cp.config.apiext) {
|
||||
for (var k in nl.drew.cp.config.apiind) {
|
||||
uriapi = nl.drew.cp.config.apiurl[i] + nl.drew.cp.config.apiind[k] + "." + nl.drew.cp.config.apiext[j];
|
||||
ret.push("https://" + uriapi + "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
nl.drew.cp.state.allApiUrls = ret;
|
||||
nl.drew.cp.state.allApiUrls = nl.drew.cp.state.allApiUrls.concat(nl.drew.cp.config.apidop);
|
||||
};
|
||||
conf.preLoadConfigFromServer = function(callback) {
|
||||
if (!nl.drew.cp.state.isenabled) {
|
||||
if (callback != null) {
|
||||
callback();
|
||||
}
|
||||
return;
|
||||
}
|
||||
nl.drew.cp.state.loadConfigFailCount = 0;
|
||||
var allapiurlsLen = nl.drew.cp.state.allApiUrls.length;
|
||||
if (allapiurlsLen < 1) {
|
||||
nl.drew.cp.lib.debug("+++++++ crome-proxy +++++++ no api urls");
|
||||
return null;
|
||||
}
|
||||
var ind = Math.random() * allapiurlsLen;
|
||||
ind = ind ^ 0;
|
||||
nl.drew.cp.state.apiUrl = nl.drew.cp.state.allApiUrls[ind];
|
||||
conf.loadConfigFromServer(callback, ind);
|
||||
};
|
||||
conf.loadLocalConfig = function() {
|
||||
if (nl.drew.cp.ls.isset("isenabled")) {
|
||||
nl.drew.cp.state.isenabled = nl.drew.cp.ls.get("isenabled", false);
|
||||
} else {
|
||||
nl.drew.cp.state.isenabled = nl.drew.cp.config.isenabled;
|
||||
}
|
||||
if (nl.drew.cp.state.isenabled) {
|
||||
if (nl.drew.cp.ls.isset("authHeader") && nl.drew.cp.ls.isset("authHeaderEnd")) {
|
||||
nl.drew.cp.state.authHeader = nl.drew.cp.ls.get("authHeader", "96W3tAJeY40DufpX");
|
||||
nl.drew.cp.state.authHeaderEnd = nl.drew.cp.ls.get("authHeaderEnd", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("contrymain")) {
|
||||
var contrymain = nl.drew.cp.ls.get("contrymain", false);
|
||||
if (contrymain) {
|
||||
nl.drew.cp.state.contryMain = contrymain;
|
||||
}
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("globalalwproxy")) {
|
||||
nl.drew.cp.state.alwProxy = nl.drew.cp.ls.get("globalalwproxy", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("anonymityall")) {
|
||||
nl.drew.cp.state.anonymityAll = nl.drew.cp.ls.get("anonymityall", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("contrySiteList")) {
|
||||
nl.drew.cp.state.listContrySite = nl.drew.cp.ls.get("contrySiteList", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("alwProxySite")) {
|
||||
nl.drew.cp.state.listAlwProxySite = nl.drew.cp.ls.get("alwProxySite", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("nonProxySite")) {
|
||||
nl.drew.cp.state.listNonProxySite = nl.drew.cp.ls.get("nonProxySite", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("anSite")) {
|
||||
nl.drew.cp.state.listAnSite = nl.drew.cp.ls.get("anSite", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("torSite")) {
|
||||
nl.drew.cp.state.listTorSite = nl.drew.cp.ls.get("torSite", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("offlist")) {
|
||||
nl.drew.cp.state.offlist = nl.drew.cp.ls.get("offlist", false);
|
||||
}
|
||||
if (nl.drew.cp.ls.isset("uproxys")) {
|
||||
nl.drew.cp.state.uproxys = nl.drew.cp.ls.get("uproxys", false);
|
||||
}
|
||||
nl.drew.cp.core.proxy.loadLocalProxy();
|
||||
}
|
||||
};
|
||||
conf.clearConfigTimer = function() {
|
||||
if (nl.drew.cp.state.loadConfigUpdTimer) {
|
||||
clearTimeout(nl.drew.cp.state.loadConfigUpdTimer);
|
||||
nl.drew.cp.state.loadConfigUpdTimer = null;
|
||||
}
|
||||
};
|
||||
conf.startConfigTimer = function(callback) {
|
||||
nl.drew.cp.state.loadConfigUpdTimer = setTimeout(function startLoadConfig() {
|
||||
nl.drew.cp.core.conf.preLoadConfigFromServer(callback);
|
||||
}, nl.drew.cp.config.loadConfigUpdT);
|
||||
};
|
||||
conf.startConfigTimer3 = function() {
|
||||
nl.drew.cp.state.loadConfigUpdTimer = setTimeout(function startLoadConfig() {
|
||||
nl.drew.cp.core.conf.loadConfigFromServer();
|
||||
}, nl.drew.cp.config.loadConfigUpdT3);
|
||||
};
|
||||
conf.loadConfigFromServer = function(callback, ind) {
|
||||
var apiUrl = nl.drew.cp.state.apiUrl;
|
||||
if (!apiUrl) {
|
||||
nl.drew.cp.lib.debug("+++++++ crome-proxy +++++++ no api url");
|
||||
return null;
|
||||
}
|
||||
var onFail = function() {
|
||||
var allapiurlsLen = nl.drew.cp.state.allApiUrls.length;
|
||||
nl.drew.cp.state.loadConfigFailCount++;
|
||||
if (ind !== null) {
|
||||
ind++;
|
||||
if (ind >= allapiurlsLen) {
|
||||
ind = 0;
|
||||
}
|
||||
nl.drew.cp.state.apiUrl = nl.drew.cp.state.allApiUrls[ind];
|
||||
if (nl.drew.cp.state.loadConfigFailCount >= allapiurlsLen) {
|
||||
nl.drew.cp.state.loadConfigFailCountt = 0;
|
||||
conf.loadConfigFromServer(callback, null);
|
||||
nl.drew.cp.core.interf.icoupdate();
|
||||
} else {
|
||||
conf.loadConfigFromServer(callback, ind);
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
nl.drew.cp.core.conf.clearConfigTimer();
|
||||
nl.drew.cp.core.conf.startConfigTimer(callback);
|
||||
}
|
||||
};
|
||||
nl.drew.cp.lib.ReqJson(apiUrl + nl.drew.cp.config.api + "?crome-proxy-ywPHzueGrJX4vLYmC6Zj8TpotBacbgEf", 1E4, function(response) {
|
||||
nl.drew.cp.core.conf.serverRespParse(response);
|
||||
if (callback != null) {
|
||||
callback();
|
||||
}
|
||||
nl.drew.cp.core.conf.clearConfigTimer();
|
||||
nl.drew.cp.core.conf.startConfigTimer3();
|
||||
}, onFail, onFail, "POST", "ip=" + encodeURIComponent(nl.drew.cp.state.ip) + "&s=" + encodeURIComponent(nl.drew.cp.state.lastUpdate) + "&sk=" + encodeURIComponent(nl.drew.cp.state.lastUpdateKey));
|
||||
};
|
||||
conf.serverRespParse = function(response) {
|
||||
var responseJSON = {};
|
||||
try {
|
||||
responseJSON = JSON.parse(response);
|
||||
} catch (e) {
|
||||
nl.drew.cp.lib.debug("+++++++ crome-proxy +++++++ can't parse");
|
||||
return null;
|
||||
}
|
||||
if (typeof responseJSON.Key != "undefined" && responseJSON.Key && typeof responseJSON.KeyD != "undefined" && typeof responseJSON.Now != "undefined") {
|
||||
nl.drew.cp.state.authHeader = responseJSON.Key;
|
||||
nl.drew.cp.state.authHeaderEnd = responseJSON.KeyD + (nl.drew.cp.lib.time() - responseJSON.Now);
|
||||
nl.drew.cp.ls.set("authHeader", nl.drew.cp.state.authHeader, "96W3tAJeY40DufpX");
|
||||
nl.drew.cp.ls.set("authHeaderEnd", nl.drew.cp.state.authHeaderEnd, false);
|
||||
}
|
||||
if (typeof responseJSON.Proxy != "undefined" && Object.prototype.toString.call(responseJSON.Proxy) === "[object Array]") {
|
||||
nl.drew.cp.core.proxy.fromServerParser(responseJSON.Proxy);
|
||||
} else {
|
||||
if (typeof responseJSON.ProxyStat != "undefined") {
|
||||
nl.drew.cp.core.proxy.setProxysCh(responseJSON.ProxyStat);
|
||||
nl.drew.cp.core.proxy.setMainProxys();
|
||||
}
|
||||
}
|
||||
if (typeof responseJSON.Conf != "undefined" && responseJSON.Conf) {
|
||||
}
|
||||
if (typeof responseJSON.S != "undefined" && responseJSON.S) {
|
||||
nl.drew.cp.state.lastUpdate = responseJSON.S;
|
||||
}
|
||||
if (typeof responseJSON.KeyD != "undefined" && responseJSON.KeyD) {
|
||||
nl.drew.cp.state.lastUpdateKey = responseJSON.KeyD;
|
||||
}
|
||||
};
|
||||
return conf;
|
||||
}();
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
nl.drew.cp.core.main = function() {
|
||||
var main = {};
|
||||
main.firstStart = function() {
|
||||
chrome.runtime.onConnect.addListener(function(port) {
|
||||
port.onMessage.addListener(function(msg) {
|
||||
nl.drew.cp.core.api.handling(port, msg);
|
||||
});
|
||||
});
|
||||
nl.drew.cp.state.icon = new iconAnimator("im/ico38-2.png");
|
||||
nl.drew.cp.state.iconoff = new iconAnimator("im/ico19g-2.png");
|
||||
chrome.tabs.onActivated.addListener(function onActTabs(info) {
|
||||
nl.drew.cp.core.interf.icoupdate71(info.tabId);
|
||||
});
|
||||
chrome.webRequest.onCompleted.addListener(function onCompleted(details) {
|
||||
if (details.url) {
|
||||
nl.drew.cp.core.interf.icoupdate7(details.url);
|
||||
}
|
||||
}, {urls:["http://*/*", "https://*/*", "ftp://*/*", "file://*/*"], types:["main_frame"]});
|
||||
nl.drew.cp.core.main.start();
|
||||
};
|
||||
main.onProxyError = function(details) {
|
||||
if (details && typeof details.levelOfControl != "undefined" && details.levelOfControl != "controllable_by_this_extension" && details.levelOfControl != "controlled_by_this_extension") {
|
||||
nl.drew.cp.state.started = null;
|
||||
nl.drew.cp.core.main.started(false);
|
||||
return false;
|
||||
} else {
|
||||
chrome.proxy.settings.get({"incognito":false}, function(details) {
|
||||
if (details && typeof details.levelOfControl != "undefined" && details.levelOfControl != "controllable_by_this_extension" && details.levelOfControl != "controlled_by_this_extension") {
|
||||
nl.drew.cp.state.started = null;
|
||||
nl.drew.cp.core.main.started(false);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!nl.drew.cp.state.timerCheckProxy) {
|
||||
nl.drew.cp.state.timerCheckProxy = setInterval(nl.drew.cp.core.main.onProxyError, 7E3);
|
||||
}
|
||||
};
|
||||
main.start = function(needEnabled) {
|
||||
chrome.proxy.settings.get({"incognito":false}, function(details) {
|
||||
nl.drew.cp.core.main.onProxyError(details);
|
||||
if (needEnabled) {
|
||||
nl.drew.cp.state.isenabled = true;
|
||||
nl.drew.cp.ls.set("isenabled", true, false);
|
||||
}
|
||||
if (nl.drew.cp.state.started !== null && !nl.drew.cp.state.started) {
|
||||
nl.drew.cp.state.started = null;
|
||||
nl.drew.cp.state.state = {text:"Starting...", cl:"uk-text-success", blink:true};
|
||||
nl.drew.cp.core.api.sendtoPortState();
|
||||
nl.drew.cp.core.conf.loadLocalConfig();
|
||||
if (nl.drew.cp.state.isenabled) {
|
||||
nl.drew.cp.core.header.inst();
|
||||
var proxyObjKeys = Object.keys(nl.drew.cp.state.proxys);
|
||||
if (proxyObjKeys.length > 1 && nl.drew.cp.state.authHeader.length > 0 && nl.drew.cp.state.authHeaderEnd > nl.drew.cp.lib.time()) {
|
||||
nl.drew.cp.core.proxy.setMainProxys();
|
||||
nl.drew.cp.core.filter.inst(function() {
|
||||
nl.drew.cp.core.main.started(true);
|
||||
nl.drew.cp.core.conf.getApiUrl();
|
||||
nl.drew.cp.core.conf.preLoadConfigFromServer(function() {
|
||||
nl.drew.cp.core.filter.inst(nl.drew.cp.core.interf.icoupdate71);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
nl.drew.cp.core.conf.getApiUrl();
|
||||
nl.drew.cp.core.conf.preLoadConfigFromServer(function() {
|
||||
nl.drew.cp.core.proxy.setMainProxys();
|
||||
nl.drew.cp.core.filter.inst(function() {
|
||||
nl.drew.cp.core.main.started(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
nl.drew.cp.core.main.started(false);
|
||||
}
|
||||
} else {
|
||||
nl.drew.cp.core.interf.icoupdate();
|
||||
}
|
||||
});
|
||||
};
|
||||
main.stop = function() {
|
||||
nl.drew.cp.state.isenabled = false;
|
||||
nl.drew.cp.ls.set("isenabled", false, false);
|
||||
if (nl.drew.cp.state.started !== null && nl.drew.cp.state.started) {
|
||||
nl.drew.cp.state.started = null;
|
||||
nl.drew.cp.core.filter.uninst(function() {
|
||||
});
|
||||
nl.drew.cp.core.header.uninst();
|
||||
nl.drew.cp.core.main.started(false);
|
||||
}
|
||||
if (nl.drew.cp.state.timerCheckProxy) {
|
||||
clearInterval(nl.drew.cp.state.timerCheckProxy);
|
||||
}
|
||||
nl.drew.cp.state.timerCheckProxy = null;
|
||||
};
|
||||
main.started = function(flag) {
|
||||
if (flag) {
|
||||
nl.drew.cp.state.state = {text:"Ok", cl:"uk-text-success", blink:false};
|
||||
nl.drew.cp.core.api.sendtoPortState();
|
||||
nl.drew.cp.state.started = true;
|
||||
nl.drew.cp.core.interf.icoupdate71();
|
||||
} else {
|
||||
nl.drew.cp.state.state = {text:"Off", cl:"uk-text-muted", blink:false};
|
||||
nl.drew.cp.core.api.sendtoPortState();
|
||||
nl.drew.cp.core.api.sendtoPortContrys();
|
||||
nl.drew.cp.core.interf.icoupdate();
|
||||
nl.drew.cp.state.started = false;
|
||||
nl.drew.cp.core.api.sendtoPortMainproxy();
|
||||
}
|
||||
};
|
||||
return main;
|
||||
}();
|
||||
window.addEventListener("load", function load(event) {
|
||||
window.removeEventListener("load", load, false);
|
||||
setTimeout(nl.drew.cp.core.main.firstStart, 1);
|
||||
}, false);
|
||||
window.addEventListener("close", function load(event) {
|
||||
}, false);
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
nl.drew.cp.core.header = function() {
|
||||
var header = {};
|
||||
header.inst = function() {
|
||||
nl.drew.cp.core.header.uninst();
|
||||
chrome.webRequest.onHeadersReceived.addListener(nl.drew.cp.core.header.onResponse, {urls:["http://*/*"]});
|
||||
chrome.webRequest.onBeforeSendHeaders.addListener(nl.drew.cp.core.header.listener, {urls:["http://*/*"]}, ["requestHeaders", "blocking"]);
|
||||
};
|
||||
header.uninst = function() {
|
||||
if (chrome.webRequest.onBeforeSendHeaders.hasListener(nl.drew.cp.core.header.listener)) {
|
||||
chrome.webRequest.onBeforeSendHeaders.removeListener(nl.drew.cp.core.header.listener);
|
||||
}
|
||||
if (chrome.webRequest.onHeadersReceived.hasListener(nl.drew.cp.core.header.onResponse)) {
|
||||
chrome.webRequest.onHeadersReceived.removeListener(nl.drew.cp.core.header.onResponse);
|
||||
}
|
||||
};
|
||||
header.listener = function(details) {
|
||||
var auth = "";
|
||||
var name = "";
|
||||
var purl = nl.drew.cp.lib.parseUrl(details.url);
|
||||
if (!purl.allow) {
|
||||
return{requestHeaders:details.requestHeaders};
|
||||
}
|
||||
var nowProxy = nl.drew.cp.core.proxy.getNowProxy(null, purl, true, false);
|
||||
if (!nowProxy) {
|
||||
return{requestHeaders:details.requestHeaders};
|
||||
}
|
||||
if (nowProxy.co.length == 2) {
|
||||
name = "Proxy-Authorization";
|
||||
if (nl.drew.cp.core.header.getTorNow(purl.host) || nl.drew.cp.state.alwProxy) {
|
||||
auth = nl.drew.cp.state.authHeader[2];
|
||||
} else {
|
||||
if (nl.drew.cp.core.header.getAnonymityNow(purl.host)) {
|
||||
auth = nl.drew.cp.state.authHeader[1];
|
||||
} else {
|
||||
auth = nl.drew.cp.state.authHeader[0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (nowProxy.ip == "proxy.googlezip.net" || nowProxy.ip == "compress.googlezip.net" || nowProxy.ip == "74.125.205.211") {
|
||||
name = "Chrome-Proxy";
|
||||
auth = nl.drew.cp.core.header.authGoogleHeader();
|
||||
}
|
||||
}
|
||||
if (name) {
|
||||
details.requestHeaders.push({name:name, value:auth});
|
||||
}
|
||||
return{requestHeaders:details.requestHeaders};
|
||||
};
|
||||
header.getAnonymityNow = function(host) {
|
||||
var ret = false;
|
||||
if (nl.drew.cp.state.anonymityAll) {
|
||||
return true;
|
||||
}
|
||||
if (nl.drew.cp.core.lib.inAnSiteList(host) > -1) {
|
||||
return true;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
header.getTorNow = function(host) {
|
||||
var ret = false;
|
||||
if (nl.drew.cp.state.torAll) {
|
||||
return true;
|
||||
}
|
||||
if (nl.drew.cp.core.lib.inTorSiteList(host) > -1) {
|
||||
return true;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
header.getTor = function(host) {
|
||||
var ret = {all:null, site:null, url:null};
|
||||
ret.all = nl.drew.cp.state.torAll;
|
||||
if (host) {
|
||||
ret.site = nl.drew.cp.core.lib.inTorSiteList(host) > -1;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
header.getAnonymity = function(host) {
|
||||
var ret = {all:null, site:null, url:null};
|
||||
ret.all = nl.drew.cp.state.anonymityAll;
|
||||
if (host) {
|
||||
ret.site = nl.drew.cp.core.lib.inAnSiteList(host) > -1;
|
||||
ret.host = host;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
header.authGoogleHeader = function() {
|
||||
var authValue = "ac4500dd3b7579186c1b0620614fdb1f7d61f944";
|
||||
var timestamp = Date.now().toString().substring(0, 10);
|
||||
var chromeVersion = navigator.appVersion.match(/Chrome\/(\d+)\.(\d+)\.(\d+)\.(\d+)/);
|
||||
return "ps=" + timestamp + "-" + Math.floor(Math.random() * 1E9) + "-" + Math.floor(Math.random() * 1E9) + "-" + Math.floor(Math.random() * 1E9) + ", sid=" + nl.drew.cp.core.lib.MD5(timestamp + authValue + timestamp) + ", b=" + chromeVersion[3] + ", p=" + chromeVersion[4];
|
||||
};
|
||||
header.onResponse = function(response) {
|
||||
};
|
||||
return header;
|
||||
}();
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
nl.drew.cp.core.interf = function() {
|
||||
var interf = {};
|
||||
interf.icoupdate71 = function(tabid) {
|
||||
var icoupd = function(tab) {
|
||||
var url;
|
||||
if (typeof tab.url != "undefined") {
|
||||
url = tab.url;
|
||||
nl.drew.cp.core.interf.icoupdate7(url);
|
||||
}
|
||||
};
|
||||
if (tabid) {
|
||||
chrome.tabs.get(tabid, function(tab) {
|
||||
icoupd(tab);
|
||||
});
|
||||
} else {
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
icoupd(tab);
|
||||
});
|
||||
}
|
||||
};
|
||||
interf.icoupdate7 = function(url) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(url);
|
||||
var nowproxy = nl.drew.cp.core.proxy.getNowProxy(null, purl, true, false);
|
||||
if (nowproxy) {
|
||||
var co = nowproxy.co;
|
||||
if (purl.allow && co.length < 3 && nl.drew.cp.core.header.getTorNow(purl.host)) {
|
||||
co = "tor";
|
||||
}
|
||||
nl.drew.cp.core.interf.icoupdate3(co, purl.pathname);
|
||||
} else {
|
||||
nl.drew.cp.core.interf.icoupdate3();
|
||||
}
|
||||
};
|
||||
interf.icoupdate3 = function(co, url) {
|
||||
if (url) {
|
||||
if (url.indexOf("_/chrome/newtab") != -1) {
|
||||
co = false;
|
||||
}
|
||||
}
|
||||
if (nl.drew.cp.lib.isNumeric(co)) {
|
||||
co = false;
|
||||
}
|
||||
if (nl.drew.cp.state.isenabled && nl.drew.cp.state.started) {
|
||||
if (co) {
|
||||
if (nl.drew.cp.state.alwProxy) {
|
||||
co = "public";
|
||||
}
|
||||
nl.drew.cp.state.icon.setCo(co);
|
||||
} else {
|
||||
nl.drew.cp.state.icon.set();
|
||||
}
|
||||
} else {
|
||||
if (nl.drew.cp.state.started == null) {
|
||||
nl.drew.cp.state.iconoff.setErr();
|
||||
} else {
|
||||
nl.drew.cp.state.iconoff.set();
|
||||
}
|
||||
}
|
||||
};
|
||||
interf.icoupdate = function() {
|
||||
if (nl.drew.cp.state.isenabled && nl.drew.cp.state.started) {
|
||||
nl.drew.cp.state.icon.set();
|
||||
nl.drew.cp.state.icon.rotate();
|
||||
} else {
|
||||
if (nl.drew.cp.state.started == null) {
|
||||
nl.drew.cp.state.iconoff.setErr();
|
||||
} else {
|
||||
nl.drew.cp.state.iconoff.set();
|
||||
nl.drew.cp.state.iconoff.rotate();
|
||||
}
|
||||
}
|
||||
};
|
||||
interf.icoupdate2 = function() {
|
||||
if (nl.drew.cp.state.isenabled && nl.drew.cp.state.started) {
|
||||
nl.drew.cp.state.icon.set();
|
||||
nl.drew.cp.state.icon.pulse2();
|
||||
} else {
|
||||
nl.drew.cp.state.iconoff.set();
|
||||
nl.drew.cp.state.iconoff.pulse2();
|
||||
}
|
||||
};
|
||||
return interf;
|
||||
}();
|
||||
|
|
@ -1,463 +0,0 @@
|
|||
nl.drew.cp.core.lib = function() {
|
||||
var lib = {};
|
||||
lib.inTorSiteList = function(host) {
|
||||
return this.isUriInAnyList(host, nl.drew.cp.state.listTorSite);
|
||||
};
|
||||
lib.inAnSiteList = function(host) {
|
||||
return this.isUriInAnyList(host, nl.drew.cp.state.listAnSite);
|
||||
};
|
||||
lib.inAnSiteListEqually = function(host) {
|
||||
return this.quickInArray2(host, nl.drew.cp.state.listAnSite);
|
||||
};
|
||||
lib.inAlwProxySiteList = function(host) {
|
||||
return this.isUriInAnyList(host, nl.drew.cp.state.listAlwProxySite);
|
||||
};
|
||||
lib.inAlwProxySiteListEqually = function(host) {
|
||||
return this.quickInArray2(host, nl.drew.cp.state.listAlwProxySite);
|
||||
};
|
||||
lib.inNonProxySiteList = function(host) {
|
||||
return this.isUriInAnyList(host, nl.drew.cp.state.listNonProxySite);
|
||||
};
|
||||
lib.inNonProxySiteListEqually = function(host) {
|
||||
return this.quickInArray2(host, nl.drew.cp.state.listNonProxySite);
|
||||
};
|
||||
lib.inOffSiteList = function(host) {
|
||||
return this.quickInArray(host, nl.drew.cp.state.offlist);
|
||||
};
|
||||
lib.inUproxyList = function(co) {
|
||||
var i = nl.drew.cp.state.uproxys.length;
|
||||
while (i--) {
|
||||
if (typeof nl.drew.cp.state.uproxys[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.uproxys[i].co == co) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.inOffSiteListAllParam = function(obj) {
|
||||
var i = nl.drew.cp.state.offlist.length;
|
||||
while (i--) {
|
||||
if (typeof nl.drew.cp.state.offlist[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.offlist[i].host == obj.host && nl.drew.cp.state.offlist[i].an == obj.an && nl.drew.cp.state.offlist[i].nonproxy == obj.nonproxy && nl.drew.cp.state.offlist[i].alwproxy == obj.alwproxy && nl.drew.cp.state.offlist[i].loc == obj.loc) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.isUriInAnyList = function(host, list) {
|
||||
var i, lenHost;
|
||||
if (!host) {
|
||||
return-1;
|
||||
}
|
||||
i = list.length;
|
||||
while (i--) {
|
||||
if (typeof list[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if (list[i] == host) {
|
||||
return i;
|
||||
} else {
|
||||
if (list[i][0] == "*") {
|
||||
lenHost = -1 * (list[i].length - 2);
|
||||
if (list[i].substr(lenHost) == host.substr(lenHost)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.delContrySiteList = function(host) {
|
||||
if (host) {
|
||||
var key;
|
||||
var ind;
|
||||
for (key in nl.drew.cp.state.listContrySite) {
|
||||
if (!nl.drew.cp.state.listContrySite.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.listContrySite[key].length < 1) {
|
||||
continue;
|
||||
}
|
||||
ind = this.isUriInAnyList(host, nl.drew.cp.state.listContrySite[key]);
|
||||
if (ind > -1) {
|
||||
nl.drew.cp.state.listContrySite[key].splice(ind, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.inContrySiteList = function(host) {
|
||||
if (host) {
|
||||
var key;
|
||||
var nowProxys = nl.drew.cp.core.proxy.getNowProxys();
|
||||
for (key in nl.drew.cp.state.listContrySite) {
|
||||
if (!nl.drew.cp.state.listContrySite.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.listContrySite[key].length < 1) {
|
||||
continue;
|
||||
}
|
||||
if (this.isUriInAnyList(host, nl.drew.cp.state.listContrySite[key]) > -1) {
|
||||
if (nowProxys.hasOwnProperty(key)) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "main";
|
||||
};
|
||||
lib.inContrySiteListEqually = function(host) {
|
||||
if (host) {
|
||||
var key;
|
||||
for (key in nl.drew.cp.state.listContrySite) {
|
||||
if (!nl.drew.cp.state.listContrySite.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.listContrySite[key].length < 1) {
|
||||
continue;
|
||||
}
|
||||
if (this.quickInArray2(host, nl.drew.cp.state.listContrySite[key]) > -1) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "main";
|
||||
};
|
||||
lib.quickInArray = function(it, arr) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i].host == it) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.quickInArray2 = function(it, arr) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (typeof arr[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if (arr[i] == it) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.globalListGen = function() {
|
||||
var retGlobal = [];
|
||||
var i, findkey;
|
||||
var listNonProxySite = nl.drew.cp.state.listNonProxySite.slice();
|
||||
var listAlwProxySite = nl.drew.cp.state.listAlwProxySite.slice();
|
||||
var offlist = nl.drew.cp.state.offlist.slice();
|
||||
while (i = offlist.shift()) {
|
||||
retGlobal.push(i);
|
||||
}
|
||||
while (i = listNonProxySite.shift()) {
|
||||
retGlobal.push({host:i, nonproxy:true, alwproxy:false, an:false, loc:"", del:false, off:false});
|
||||
}
|
||||
while (i = listAlwProxySite.shift()) {
|
||||
retGlobal.push({host:i, alwproxy:true, nonproxy:false, an:false, loc:"", del:false, off:false});
|
||||
}
|
||||
var j = nl.drew.cp.state.listAnSite.length;
|
||||
while (j--) {
|
||||
if (typeof nl.drew.cp.state.listAnSite[j] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if ((findkey = this.quickInArray(nl.drew.cp.state.listAnSite[j], retGlobal)) != -1) {
|
||||
retGlobal[findkey].an = true;
|
||||
} else {
|
||||
retGlobal.push({host:nl.drew.cp.state.listAnSite[j], an:true, nonproxy:false, alwproxy:false, loc:"", del:false, off:false});
|
||||
}
|
||||
}
|
||||
var key;
|
||||
for (key in nl.drew.cp.state.listContrySite) {
|
||||
if (!nl.drew.cp.state.listContrySite.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
j = nl.drew.cp.state.listContrySite[key].length;
|
||||
if (j < 1) {
|
||||
continue;
|
||||
}
|
||||
while (j--) {
|
||||
if (typeof nl.drew.cp.state.listContrySite[key][j] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if ((findkey = this.quickInArray(nl.drew.cp.state.listContrySite[key][j], retGlobal)) != -1) {
|
||||
retGlobal[findkey].loc = key;
|
||||
} else {
|
||||
retGlobal.push({host:nl.drew.cp.state.listContrySite[key][j], loc:key, nonproxy:false, alwproxy:false, an:false, del:false, off:false});
|
||||
}
|
||||
}
|
||||
}
|
||||
var i = retGlobal.length;
|
||||
while (i--) {
|
||||
if (typeof retGlobal[i].par == "undefined") {
|
||||
retGlobal[i].par = -1;
|
||||
}
|
||||
if (retGlobal[i].host[0] == "*") {
|
||||
var lenHost = -1 * (retGlobal[i].host.length - 2);
|
||||
var j = retGlobal.length;
|
||||
while (j--) {
|
||||
if (i != j) {
|
||||
if (retGlobal[i].host.substr(lenHost) == retGlobal[j].host.substr(lenHost)) {
|
||||
if (typeof retGlobal[j].par != "undefined" && retGlobal[j].par > -1) {
|
||||
if (retGlobal[i].host.length > retGlobal[retGlobal[j].par].host.length) {
|
||||
retGlobal[j].par = i;
|
||||
}
|
||||
} else {
|
||||
retGlobal[j].par = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return retGlobal;
|
||||
};
|
||||
lib.returnGen = function(nowProxy) {
|
||||
var ret = "return 'DIRECT'";
|
||||
if (nowProxy) {
|
||||
if (nowProxy.co.length == 2) {
|
||||
ret = "if ( schema=='https' ) " + "return 'SOCKS5 " + nowProxy.ip + ":" + nowProxy.sport + "'; " + "else " + "return 'HTTPS " + nowProxy.ip + ":" + nowProxy.port + "'; ";
|
||||
} else {
|
||||
nowProxy.proto = nowProxy.proto.toUpperCase();
|
||||
ret = "return '" + nowProxy.proto + " " + nowProxy.ip + ":" + nowProxy.port + "'; ";
|
||||
if (nowProxy.proto != "SOCKS5" && nowProxy.proto != "SOCKS") {
|
||||
ret = "if ( schema=='http:' ) " + ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
lib.searchInListCodeGen = function(listName, list, action) {
|
||||
var ret;
|
||||
if (list.length < 1) {
|
||||
return " ";
|
||||
}
|
||||
var listJson = JSON.stringify(list);
|
||||
ret = " var " + listName + " = " + listJson + "; " + "for (var i = 0, length = " + listName + ".length; i < length; i++) if (" + listName + ".hasOwnProperty(i)) {" + "if (" + listName + "[i]==host) {" + action + "break; } else {" + "if (" + listName + "[i][0] == '*') { " + "var lenHost = -1 * (" + listName + "[i].length - 2);" + "if (" + listName + "[i].substr(lenHost) == host.substr(lenHost)) {" + action + "break; }}}}";
|
||||
return ret;
|
||||
};
|
||||
lib.checkListOnOff = function(host) {
|
||||
var offiteam = {host:"", nonproxy:false, alwproxy:false, an:false, loc:"", del:false, off:true};
|
||||
var ch = false;
|
||||
if (nl.drew.cp.core.lib.inAnSiteListEqually(host) > -1) {
|
||||
ch = true;
|
||||
offiteam.an = true;
|
||||
}
|
||||
var co = nl.drew.cp.core.lib.inContrySiteListEqually(host);
|
||||
if (co != "main") {
|
||||
offiteam.loc = co;
|
||||
ch = true;
|
||||
}
|
||||
if (nl.drew.cp.core.lib.inAlwProxySiteListEqually(host) > -1) {
|
||||
ch = true;
|
||||
offiteam.alwproxy = true;
|
||||
}
|
||||
if (nl.drew.cp.core.lib.inNonProxySiteListEqually(host) > -1) {
|
||||
ch = true;
|
||||
offiteam.nonproxy = true;
|
||||
}
|
||||
if (ch) {
|
||||
offiteam.host = host;
|
||||
return nl.drew.cp.core.lib.inOffSiteListAllParam(offiteam);
|
||||
}
|
||||
return-1;
|
||||
};
|
||||
lib.liston = function(val, onlsave) {
|
||||
nl.drew.cp.core.cache.nowProxyClean(val);
|
||||
if (!onlsave) {
|
||||
var lid = nl.drew.cp.core.lib.inOffSiteListAllParam(val);
|
||||
if (lid == -1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var host = val.host;
|
||||
this.listoff(host);
|
||||
var ind;
|
||||
if (val.an) {
|
||||
if (nl.drew.cp.core.lib.inAnSiteListEqually(host) == -1) {
|
||||
nl.drew.cp.state.listAnSite.push(host);
|
||||
nl.drew.cp.ls.set("anSite", nl.drew.cp.state.listAnSite, false);
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow({host:host, list:true});
|
||||
nl.drew.cp.core.api.sendtoPortAnonymity({host:host, list:true});
|
||||
}
|
||||
}
|
||||
if (val.nonproxy) {
|
||||
if (nl.drew.cp.core.lib.inNonProxySiteListEqually(host) == -1) {
|
||||
nl.drew.cp.state.listNonProxySite.push(host);
|
||||
}
|
||||
ind = nl.drew.cp.core.lib.inAlwProxySiteListEqually(host);
|
||||
if (ind > -1) {
|
||||
nl.drew.cp.state.listAlwProxySite.splice(ind, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("alwProxySite", nl.drew.cp.state.listAlwProxySite, false);
|
||||
nl.drew.cp.ls.set("nonProxySite", nl.drew.cp.state.listNonProxySite, false);
|
||||
} else {
|
||||
if (val.alwproxy) {
|
||||
if (nl.drew.cp.core.lib.inAlwProxySiteListEqually(host) == -1) {
|
||||
nl.drew.cp.state.listAlwProxySite.push(host);
|
||||
}
|
||||
ind = nl.drew.cp.core.lib.inNonProxySiteListEqually(host);
|
||||
if (ind > -1) {
|
||||
nl.drew.cp.state.listNonProxySite.splice(ind, 1);
|
||||
}
|
||||
nl.drew.cp.ls.set("alwProxySite", nl.drew.cp.state.listAlwProxySite, false);
|
||||
nl.drew.cp.ls.set("nonProxySite", nl.drew.cp.state.listNonProxySite, false);
|
||||
}
|
||||
}
|
||||
if (val.loc) {
|
||||
if (val.loc != "main") {
|
||||
nl.drew.cp.core.lib.delContrySiteList(host);
|
||||
if (typeof nl.drew.cp.state.listContrySite[val.loc] == "undefined") {
|
||||
nl.drew.cp.state.listContrySite[val.loc] = [];
|
||||
}
|
||||
nl.drew.cp.state.listContrySite[val.loc].push(host);
|
||||
nl.drew.cp.ls.set("contrySiteList", nl.drew.cp.state.listContrySite, false);
|
||||
nl.drew.cp.core.api.sendtoPortContrys({host:host, list:true});
|
||||
}
|
||||
}
|
||||
nl.drew.cp.core.filter.inst();
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList({host:host, list:true});
|
||||
if (!onlsave) {
|
||||
nl.drew.cp.state.offlist.splice(lid, 1);
|
||||
nl.drew.cp.ls.set("offlist", nl.drew.cp.state.offlist, false);
|
||||
}
|
||||
};
|
||||
lib.listoff = function(host, onlremove, nosendtoport) {
|
||||
nl.drew.cp.lib.debug(host);
|
||||
nl.drew.cp.core.cache.nowProxyClean({host:host});
|
||||
var offiteam = {host:"", nonproxy:false, alwproxy:false, an:false, loc:"", del:false, off:true};
|
||||
var an, nonproxy, alwproxy;
|
||||
var ch = false;
|
||||
if ((an = nl.drew.cp.core.lib.inAnSiteListEqually(host)) > -1) {
|
||||
ch = true;
|
||||
offiteam.an = true;
|
||||
}
|
||||
var co = nl.drew.cp.core.lib.inContrySiteListEqually(host);
|
||||
if (co != "main") {
|
||||
offiteam.loc = co;
|
||||
ch = true;
|
||||
}
|
||||
if ((alwproxy = nl.drew.cp.core.lib.inAlwProxySiteListEqually(host)) > -1) {
|
||||
ch = true;
|
||||
offiteam.alwproxy = true;
|
||||
}
|
||||
if ((nonproxy = nl.drew.cp.core.lib.inNonProxySiteListEqually(host)) > -1) {
|
||||
ch = true;
|
||||
offiteam.nonproxy = true;
|
||||
}
|
||||
if (ch) {
|
||||
nl.drew.cp.lib.debug(offiteam);
|
||||
offiteam.host = host;
|
||||
if (offiteam.an) {
|
||||
nl.drew.cp.state.listAnSite.splice(an, 1);
|
||||
nl.drew.cp.ls.set("anSite", nl.drew.cp.state.listAnSite, false);
|
||||
if (!nosendtoport) {
|
||||
nl.drew.cp.core.api.sendtoPortAnonymitynow({host:host, list:true});
|
||||
nl.drew.cp.core.api.sendtoPortAnonymity({host:host, list:true});
|
||||
}
|
||||
}
|
||||
if (offiteam.alwproxy) {
|
||||
nl.drew.cp.state.listAlwProxySite.splice(alwproxy, 1);
|
||||
nl.drew.cp.ls.set("alwProxySite", nl.drew.cp.state.listAlwProxySite, false);
|
||||
} else {
|
||||
if (offiteam.nonproxy) {
|
||||
nl.drew.cp.state.listNonProxySite.splice(nonproxy, 1);
|
||||
nl.drew.cp.ls.set("nonProxySite", nl.drew.cp.state.listNonProxySite, false);
|
||||
}
|
||||
}
|
||||
if (co) {
|
||||
nl.drew.cp.core.lib.delContrySiteList(host);
|
||||
nl.drew.cp.ls.set("contrySiteList", nl.drew.cp.state.listContrySite, false);
|
||||
if (!nosendtoport) {
|
||||
nl.drew.cp.core.api.sendtoPortContrys({host:host, list:true});
|
||||
}
|
||||
}
|
||||
nl.drew.cp.core.filter.inst();
|
||||
if (!nosendtoport) {
|
||||
nl.drew.cp.core.api.sendtoPortInProxyList({host:host, list:true});
|
||||
}
|
||||
if (!onlremove) {
|
||||
if (this.inOffSiteListAllParam(offiteam) == -1) {
|
||||
nl.drew.cp.state.offlist.push(offiteam);
|
||||
}
|
||||
nl.drew.cp.ls.set("offlist", nl.drew.cp.state.offlist, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.MD5 = function(e) {
|
||||
function h(a, b) {
|
||||
var c, d, e, f, g;
|
||||
e = a & 2147483648;
|
||||
f = b & 2147483648;
|
||||
c = a & 1073741824;
|
||||
d = b & 1073741824;
|
||||
g = (a & 1073741823) + (b & 1073741823);
|
||||
return c & d ? g ^ 2147483648 ^ e ^ f : c | d ? g & 1073741824 ? g ^ 3221225472 ^ e ^ f : g ^ 1073741824 ^ e ^ f : g ^ e ^ f;
|
||||
}
|
||||
function k(a, b, c, d, e, f, g) {
|
||||
a = h(a, h(h(b & c | ~b & d, e), g));
|
||||
return h(a << f | a >>> 32 - f, b);
|
||||
}
|
||||
function l(a, b, c, d, e, f, g) {
|
||||
a = h(a, h(h(b & d | c & ~d, e), g));
|
||||
return h(a << f | a >>> 32 - f, b);
|
||||
}
|
||||
function m(a, b, d, c, e, f, g) {
|
||||
a = h(a, h(h(b ^ d ^ c, e), g));
|
||||
return h(a << f | a >>> 32 - f, b);
|
||||
}
|
||||
function n(a, b, d, c, e, f, g) {
|
||||
a = h(a, h(h(d ^ (b | ~c), e), g));
|
||||
return h(a << f | a >>> 32 - f, b);
|
||||
}
|
||||
function p(a) {
|
||||
var b = "", d = "", c;
|
||||
for (c = 0;3 >= c;c++) {
|
||||
d = a >>> 8 * c & 255, d = "0" + d.toString(16), b += d.substr(d.length - 2, 2);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
var f = [], q, r, s, t, a, b, c, d;
|
||||
e = function(a) {
|
||||
a = a.replace(/\r\n/g, "\n");
|
||||
for (var b = "", d = 0;d < a.length;d++) {
|
||||
var c = a.charCodeAt(d);
|
||||
128 > c ? b += String.fromCharCode(c) : (127 < c && 2048 > c ? b += String.fromCharCode(c >> 6 | 192) : (b += String.fromCharCode(c >> 12 | 224), b += String.fromCharCode(c >> 6 & 63 | 128)), b += String.fromCharCode(c & 63 | 128));
|
||||
}
|
||||
return b;
|
||||
}(e);
|
||||
f = function(b) {
|
||||
var a, c = b.length;
|
||||
a = c + 8;
|
||||
for (var d = 16 * ((a - a % 64) / 64 + 1), e = Array(d - 1), f = 0, g = 0;g < c;) {
|
||||
a = (g - g % 4) / 4, f = g % 4 * 8, e[a] |= b.charCodeAt(g) << f, g++;
|
||||
}
|
||||
a = (g - g % 4) / 4;
|
||||
e[a] |= 128 << g % 4 * 8;
|
||||
e[d - 2] = c << 3;
|
||||
e[d - 1] = c >>> 29;
|
||||
return e;
|
||||
}(e);
|
||||
a = 1732584193;
|
||||
b = 4023233417;
|
||||
c = 2562383102;
|
||||
d = 271733878;
|
||||
for (e = 0;e < f.length;e += 16) {
|
||||
q = a, r = b, s = c, t = d, a = k(a, b, c, d, f[e + 0], 7, 3614090360), d = k(d, a, b, c, f[e + 1], 12, 3905402710), c = k(c, d, a, b, f[e + 2], 17, 606105819), b = k(b, c, d, a, f[e + 3], 22, 3250441966), a = k(a, b, c, d, f[e + 4], 7, 4118548399), d = k(d, a, b, c, f[e + 5], 12, 1200080426), c = k(c, d, a, b, f[e + 6], 17, 2821735955), b = k(b, c, d, a, f[e + 7], 22, 4249261313), a = k(a, b, c, d, f[e + 8], 7, 1770035416), d = k(d, a, b, c, f[e + 9], 12, 2336552879), c = k(c, d, a, b, f[e +
|
||||
10], 17, 4294925233), b = k(b, c, d, a, f[e + 11], 22, 2304563134), a = k(a, b, c, d, f[e + 12], 7, 1804603682), d = k(d, a, b, c, f[e + 13], 12, 4254626195), c = k(c, d, a, b, f[e + 14], 17, 2792965006), b = k(b, c, d, a, f[e + 15], 22, 1236535329), a = l(a, b, c, d, f[e + 1], 5, 4129170786), d = l(d, a, b, c, f[e + 6], 9, 3225465664), c = l(c, d, a, b, f[e + 11], 14, 643717713), b = l(b, c, d, a, f[e + 0], 20, 3921069994), a = l(a, b, c, d, f[e + 5], 5, 3593408605), d = l(d, a, b, c, f[e +
|
||||
10], 9, 38016083), c = l(c, d, a, b, f[e + 15], 14, 3634488961), b = l(b, c, d, a, f[e + 4], 20, 3889429448), a = l(a, b, c, d, f[e + 9], 5, 568446438), d = l(d, a, b, c, f[e + 14], 9, 3275163606), c = l(c, d, a, b, f[e + 3], 14, 4107603335), b = l(b, c, d, a, f[e + 8], 20, 1163531501), a = l(a, b, c, d, f[e + 13], 5, 2850285829), d = l(d, a, b, c, f[e + 2], 9, 4243563512), c = l(c, d, a, b, f[e + 7], 14, 1735328473), b = l(b, c, d, a, f[e + 12], 20, 2368359562), a = m(a, b, c, d, f[e + 5],
|
||||
4, 4294588738), d = m(d, a, b, c, f[e + 8], 11, 2272392833), c = m(c, d, a, b, f[e + 11], 16, 1839030562), b = m(b, c, d, a, f[e + 14], 23, 4259657740), a = m(a, b, c, d, f[e + 1], 4, 2763975236), d = m(d, a, b, c, f[e + 4], 11, 1272893353), c = m(c, d, a, b, f[e + 7], 16, 4139469664), b = m(b, c, d, a, f[e + 10], 23, 3200236656), a = m(a, b, c, d, f[e + 13], 4, 681279174), d = m(d, a, b, c, f[e + 0], 11, 3936430074), c = m(c, d, a, b, f[e + 3], 16, 3572445317), b = m(b, c, d, a, f[e + 6],
|
||||
23, 76029189), a = m(a, b, c, d, f[e + 9], 4, 3654602809), d = m(d, a, b, c, f[e + 12], 11, 3873151461), c = m(c, d, a, b, f[e + 15], 16, 530742520), b = m(b, c, d, a, f[e + 2], 23, 3299628645), a = n(a, b, c, d, f[e + 0], 6, 4096336452), d = n(d, a, b, c, f[e + 7], 10, 1126891415), c = n(c, d, a, b, f[e + 14], 15, 2878612391), b = n(b, c, d, a, f[e + 5], 21, 4237533241), a = n(a, b, c, d, f[e + 12], 6, 1700485571), d = n(d, a, b, c, f[e + 3], 10, 2399980690), c = n(c, d, a, b, f[e + 10], 15,
|
||||
4293915773), b = n(b, c, d, a, f[e + 1], 21, 2240044497), a = n(a, b, c, d, f[e + 8], 6, 1873313359), d = n(d, a, b, c, f[e + 15], 10, 4264355552), c = n(c, d, a, b, f[e + 6], 15, 2734768916), b = n(b, c, d, a, f[e + 13], 21, 1309151649), a = n(a, b, c, d, f[e + 4], 6, 4149444226), d = n(d, a, b, c, f[e + 11], 10, 3174756917), c = n(c, d, a, b, f[e + 2], 15, 718787259), b = n(b, c, d, a, f[e + 9], 21, 3951481745), a = h(a, q), b = h(b, r), c = h(c, s), d = h(d, t);
|
||||
}
|
||||
return(p(a) + p(b) + p(c) + p(d)).toLowerCase();
|
||||
};
|
||||
return lib;
|
||||
}();
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
nl.drew.cp.core.onoff = function() {
|
||||
var onoff = {};
|
||||
onoff.on = function() {
|
||||
nl.drew.cp.state.isenabled = true;
|
||||
nl.drew.cp.ls.set("isenabled", true, false);
|
||||
console.log("onoff.on");
|
||||
nl.drew.cp.core.interf.icoupdate();
|
||||
nl.drew.cp.core.proxy.loadLocalProxy();
|
||||
};
|
||||
onoff.off = function() {
|
||||
nl.drew.cp.state.isenabled = false;
|
||||
nl.drew.cp.ls.set("isenabled", false, false);
|
||||
console.log("onoff.off");
|
||||
nl.drew.cp.core.interf.icoupdate();
|
||||
};
|
||||
return onoff;
|
||||
}();
|
||||
|
|
@ -1,298 +0,0 @@
|
|||
nl.drew.cp.core.proxy = function() {
|
||||
var proxy = {};
|
||||
proxy.setProxysCh = function(proxys) {
|
||||
for (var i in proxys) {
|
||||
if (!proxys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
if (typeof nl.drew.cp.state.proxys[i] != "undefined") {
|
||||
nl.drew.cp.state.proxys[i].chanel = proxys[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
proxy.loadLocalProxy = function() {
|
||||
if (nl.drew.cp.ls.isset("proxys")) {
|
||||
nl.drew.cp.state.proxys = nl.drew.cp.ls.get("proxys", "vw5yHc8t6dU10fRe");
|
||||
if (!nl.drew.cp.state.proxys) {
|
||||
nl.drew.cp.state.proxys = {};
|
||||
nl.drew.cp.ls.del("proxys");
|
||||
}
|
||||
}
|
||||
var proxyObjKeys = Object.keys(nl.drew.cp.state.proxys);
|
||||
if (proxyObjKeys.length < 1) {
|
||||
nl.drew.cp.state.proxys[nl.drew.cp.config.startProxy.id] = nl.drew.cp.lib.clone(nl.drew.cp.config.startProxy);
|
||||
}
|
||||
};
|
||||
proxy.getNowProxy = function(nowProxys, purl, noupdico, nocache) {
|
||||
if (!purl) {
|
||||
return null;
|
||||
}
|
||||
var now = nl.drew.cp.lib.time();
|
||||
if (!nocache && nl.drew.cp.state.nowProxyCache.hasOwnProperty(purl.host) && now < nl.drew.cp.state.nowProxyCache[purl.host].t) {
|
||||
return nl.drew.cp.state.nowProxyCache[purl.host].d;
|
||||
}
|
||||
now = now + 25;
|
||||
var proxyInd = "main";
|
||||
if (!nowProxys || nowProxys.length < 1) {
|
||||
nowProxys = this.getNowProxys();
|
||||
}
|
||||
if (purl.allow) {
|
||||
var host = purl.host;
|
||||
var alwProxy = nl.drew.cp.state.alwProxy;
|
||||
var needproxy = false;
|
||||
if (nl.drew.cp.core.lib.inNonProxySiteList(host) > -1) {
|
||||
nl.drew.cp.state.nowProxyCache[purl.host] = {t:now, d:null};
|
||||
if (!noupdico) {
|
||||
nl.drew.cp.core.interf.icoupdate3();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (nl.drew.cp.core.lib.inAlwProxySiteList(host) > -1) {
|
||||
needproxy = true;
|
||||
}
|
||||
if (!needproxy && !alwProxy) {
|
||||
nl.drew.cp.state.nowProxyCache[purl.host] = {t:now, d:null};
|
||||
if (!noupdico) {
|
||||
nl.drew.cp.core.interf.icoupdate3();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
proxyInd = nl.drew.cp.core.lib.inContrySiteList(host);
|
||||
} else {
|
||||
if (!noupdico) {
|
||||
nl.drew.cp.core.interf.icoupdate3();
|
||||
}
|
||||
}
|
||||
if (proxyInd == "main") {
|
||||
if (typeof nowProxys[nl.drew.cp.state.contryMain] != "undefined") {
|
||||
proxyInd = nl.drew.cp.state.contryMain;
|
||||
}
|
||||
}
|
||||
if (nowProxys.hasOwnProperty(proxyInd)) {
|
||||
var retproxy = nl.drew.cp.lib.clone(nowProxys[proxyInd]);
|
||||
retproxy.allow = purl.allow;
|
||||
nl.drew.cp.state.nowProxyCache[purl.host] = {t:now, d:retproxy};
|
||||
if (!noupdico) {
|
||||
if (proxyInd == "main") {
|
||||
proxyInd = nowProxys["main"].co;
|
||||
}
|
||||
nl.drew.cp.core.interf.icoupdate3(proxyInd, purl.pathname);
|
||||
}
|
||||
return retproxy;
|
||||
}
|
||||
nl.drew.cp.state.nowProxyCache[purl.host] = {t:now, d:null};
|
||||
if (!noupdico) {
|
||||
nl.drew.cp.core.interf.icoupdate3();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
proxy.getNowProxys = function() {
|
||||
var key, i;
|
||||
var ret = {};
|
||||
var now = Date.now();
|
||||
var contrys = nl.drew.cp.state.contrys.slice();
|
||||
contrys.push("main");
|
||||
for (i in contrys) {
|
||||
if (!contrys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
key = contrys[i];
|
||||
if (typeof nl.drew.cp.state.proxys != "undefined" && typeof nl.drew.cp.state.proxyMain[key] != "undefined" && nl.drew.cp.state.proxyMain[key] != null && typeof nl.drew.cp.state.proxyMainInd[key] != "undefined" && typeof nl.drew.cp.state.proxys[nl.drew.cp.state.proxyMain[key][nl.drew.cp.state.proxyMainInd[key]]] != "undefined") {
|
||||
ret[key] = nl.drew.cp.state.proxys[nl.drew.cp.state.proxyMain[key][nl.drew.cp.state.proxyMainInd[key]]];
|
||||
}
|
||||
}
|
||||
for (i in nl.drew.cp.state.uproxys) {
|
||||
if (!nl.drew.cp.state.uproxys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
key = nl.drew.cp.state.uproxys[i].co;
|
||||
ret[key] = nl.drew.cp.state.uproxys[i];
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
proxy.setMainProxys = function() {
|
||||
var key, i;
|
||||
var now = Date.now();
|
||||
nl.drew.cp.state.contrys = nl.drew.cp.core.proxy.contrys();
|
||||
var contrys = nl.drew.cp.state.contrys.slice();
|
||||
contrys.push("main");
|
||||
for (i in contrys) {
|
||||
if (!contrys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
key = contrys[i];
|
||||
if (typeof nl.drew.cp.state.proxyMain == "undefined") {
|
||||
nl.drew.cp.state.proxyMain = [];
|
||||
}
|
||||
if (typeof nl.drew.cp.state.proxyMain[key] == "undefined" || nl.drew.cp.state.proxyMain[key] == null || nl.drew.cp.state.proxyMainT[key] < now || typeof nl.drew.cp.state.proxyMainInd[key] == "undefined" || typeof nl.drew.cp.state.proxys[nl.drew.cp.state.proxyMain[key][nl.drew.cp.state.proxyMainInd[key]]] == "undefined") {
|
||||
nl.drew.cp.state.proxyMain[key] = nl.drew.cp.core.proxy.choice(key);
|
||||
nl.drew.cp.state.proxyMainT[key] = now + nl.drew.cp.config.proxyUpdT;
|
||||
nl.drew.cp.state.proxyMainInd[key] = 0;
|
||||
}
|
||||
}
|
||||
nl.drew.cp.core.cache.nowProxyAllClean();
|
||||
nl.drew.cp.core.api.sendtoPortContrys();
|
||||
};
|
||||
proxy.choice = function(co) {
|
||||
var tmpArr = [];
|
||||
var ret = [];
|
||||
var tmpArrLen;
|
||||
var key;
|
||||
for (key in nl.drew.cp.state.proxys) {
|
||||
if (!nl.drew.cp.state.proxys.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (co == null || co == "main" || co == nl.drew.cp.state.proxys[key].co) {
|
||||
tmpArr.push(nl.drew.cp.state.proxys[key]);
|
||||
}
|
||||
}
|
||||
tmpArr.sort(function(proxy1, proxy2) {
|
||||
return proxy1.chanel - proxy2.chanel;
|
||||
});
|
||||
tmpArrLen = tmpArr.length;
|
||||
if (tmpArrLen > 0) {
|
||||
for (var j = 0;j < tmpArrLen;j++) {
|
||||
ret.push(tmpArr[j].id);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
proxy.contrys = function() {
|
||||
var key;
|
||||
var ret = [];
|
||||
for (key in nl.drew.cp.state.proxys) {
|
||||
if (!nl.drew.cp.state.proxys.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (ret.indexOf(nl.drew.cp.state.proxys[key].co) == -1) {
|
||||
ret.push(nl.drew.cp.state.proxys[key].co);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
proxy.fromServerParser = function(proxys) {
|
||||
var key, i;
|
||||
var is;
|
||||
var ischange = false;
|
||||
for (i in proxys) {
|
||||
if (!proxys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
key = proxys[i].Id;
|
||||
if (typeof nl.drew.cp.state.proxys[key] == "undefined") {
|
||||
nl.drew.cp.state.proxys[key] = {};
|
||||
nl.drew.cp.state.proxys[key].id = proxys[i].Id;
|
||||
nl.drew.cp.state.proxys[key].ip = proxys[i].Ip;
|
||||
nl.drew.cp.state.proxys[key].port = proxys[i].Port;
|
||||
nl.drew.cp.state.proxys[key].sport = proxys[i].Sport;
|
||||
nl.drew.cp.state.proxys[key].chanel = proxys[i].Ch;
|
||||
nl.drew.cp.state.proxys[key].co = proxys[i].Co;
|
||||
nl.drew.cp.state.proxys[key].name = proxys[i].Na + ".chrome-proxy.com";
|
||||
nl.drew.cp.state.proxys[key].ssl = proxys[i].Ssl;
|
||||
ischange = true;
|
||||
} else {
|
||||
if (proxys[i].Ch != nl.drew.cp.state.proxys[key].chanel) {
|
||||
nl.drew.cp.state.proxys[key].chanel = proxys[i].Ch;
|
||||
}
|
||||
if (proxys[i].Port != nl.drew.cp.state.proxys[key].port || proxys[i].Sport != nl.drew.cp.state.proxys[key].sport || proxys[i].Ssl != nl.drew.cp.state.proxys[key].ssl) {
|
||||
ischange = true;
|
||||
nl.drew.cp.state.proxys[key].port = proxys[i].Port;
|
||||
nl.drew.cp.state.proxys[key].sport = proxys[i].Sport;
|
||||
nl.drew.cp.state.proxys[key].ssl = proxys[i].Ssl;
|
||||
}
|
||||
}
|
||||
nl.drew.cp.state.proxys[key].d = proxys[i].D + nl.drew.cp.lib.time();
|
||||
}
|
||||
for (key in nl.drew.cp.state.proxys) {
|
||||
if (!nl.drew.cp.state.proxys.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
is = false;
|
||||
for (i in proxys) {
|
||||
if (!proxys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
if (key == proxys[i].Id) {
|
||||
is = true;
|
||||
}
|
||||
}
|
||||
if (!is) {
|
||||
ischange = true;
|
||||
delete nl.drew.cp.state.proxys[key];
|
||||
}
|
||||
}
|
||||
if (ischange) {
|
||||
nl.drew.cp.core.proxy.setMainProxys();
|
||||
}
|
||||
var saveProxyArr = {};
|
||||
for (key in nl.drew.cp.state.proxys) {
|
||||
if (!nl.drew.cp.state.proxys.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
saveProxyArr[key] = {id:nl.drew.cp.state.proxys[key].id, ip:nl.drew.cp.state.proxys[key].ip, port:nl.drew.cp.state.proxys[key].port, sport:nl.drew.cp.state.proxys[key].sport, chanel:nl.drew.cp.state.proxys[key].chanel, co:nl.drew.cp.state.proxys[key].co, name:nl.drew.cp.state.proxys[key].name, ssl:nl.drew.cp.state.proxys[key].ssl, d:nl.drew.cp.state.proxys[key].d};
|
||||
}
|
||||
nl.drew.cp.ls.set("proxys", saveProxyArr, "vw5yHc8t6dU10fRe");
|
||||
};
|
||||
return proxy;
|
||||
}();
|
||||
nl.drew.cp.core.filter = function() {
|
||||
var filter = {};
|
||||
filter.uninst = function(callback) {
|
||||
try {
|
||||
chrome.proxy.settings.clear({scope:"regular"}, callback);
|
||||
} catch (e) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
filter.inst = function(callback) {
|
||||
if (typeof callback != "function") {
|
||||
callback = function() {
|
||||
};
|
||||
}
|
||||
if (nl.drew.cp.state.isenabled) {
|
||||
var nowProxys = nl.drew.cp.core.proxy.getNowProxys();
|
||||
var nowProxy;
|
||||
var key;
|
||||
if (typeof nowProxys[nl.drew.cp.state.contryMain] != "undefined") {
|
||||
nowProxy = nowProxys[nl.drew.cp.state.contryMain];
|
||||
} else {
|
||||
nowProxy = nowProxys["main"];
|
||||
}
|
||||
nl.drew.cp.core.api.sendtoPortMainproxy(nowProxys);
|
||||
var contryCodeStrig = "";
|
||||
for (key in nl.drew.cp.state.listContrySite) {
|
||||
if (!nl.drew.cp.state.listContrySite.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (!nowProxys.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if (nl.drew.cp.state.listContrySite[key].length < 1) {
|
||||
continue;
|
||||
}
|
||||
contryCodeStrig = contryCodeStrig + nl.drew.cp.core.lib.searchInListCodeGen(key, nl.drew.cp.state.listContrySite[key], nl.drew.cp.core.lib.returnGen(nowProxys[key])) + " ";
|
||||
}
|
||||
postclearproxy = function() {
|
||||
var scr = "function FindProxyForURL(url, host) { " + "var schema=url.substring(0,5); " + "if ( schema!='https' && schema!='http:' ) " + "return 'DIRECT'; " + "if ( isPlainHostName(host) || " + "host=='127.0.0.1' || " + "shExpMatch(url,'*crome-proxy-ywPHzueGrJX4vLYmC6Zj8TpotBacbgEf*') || " + "shExpMatch(host, '*.local') || " + "isInNet(dnsResolve(host), '10.0.0.0', '255.0.0.0') || " + "isInNet(dnsResolve(host), '172.16.0.0', '255.240.0.0') || " + "isInNet(dnsResolve(host), '192.168.0.0', '255.255.0.0') || " +
|
||||
"isInNet(dnsResolve(host), '127.0.0.0', '255.255.255.0') ) " + "return 'DIRECT'; " + "var alwProxy = " + JSON.stringify(nl.drew.cp.state.alwProxy) + ";" + "var needproxy = false;" + nl.drew.cp.core.lib.searchInListCodeGen("nonproxy", nl.drew.cp.state.listNonProxySite, "return 'DIRECT';") + nl.drew.cp.core.lib.searchInListCodeGen("alwproxy", nl.drew.cp.state.listAlwProxySite, "needproxy = true;") + "if ( !needproxy && !alwProxy) " + "return 'DIRECT'; " + contryCodeStrig + nl.drew.cp.core.lib.returnGen(nowProxy) +
|
||||
"}";
|
||||
var config = {mode:"pac_script", pacScript:{data:scr}};
|
||||
try {
|
||||
chrome.proxy.settings.set({value:config, scope:"regular"}, callback);
|
||||
} catch (e) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
postclearproxy = callback;
|
||||
}
|
||||
try {
|
||||
chrome.proxy.settings.clear({scope:"regular"}, postclearproxy);
|
||||
} catch (e) {
|
||||
postclearproxy();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
return filter;
|
||||
}();
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
if (!nl) {
|
||||
var nl = {}
|
||||
}
|
||||
if (!nl.drew) {
|
||||
nl.drew = {};
|
||||
}
|
||||
if (!nl.drew.cp) {
|
||||
nl.drew.cp = {};
|
||||
}
|
||||
nl.drew.cp = {core:{}, api:{}, config:{loadConfigUpdT:1E3 * 60 * 1, loadConfigUpdT3:1E3 * 60 * 15, isDebug:false, isenabled:true, startProxy:{id:0, ip:"nl0.myproxy.org", port:"433", sport:"1010", chanel:0, co:"nl", name:"nl0", ssl:true, d:false}, api:"api", port:8088, proxyUpdT:1E3 * 60 * 60, apiurl:["cpapi.friproxy"], apiext:["eu", "biz"], apiind:[""], apidop:[], minute:1E3 * 60 * 1, proxyTemplate:[{co:"Google_3", ip:"74.125.205.211", port:"80", proto:"http"}, {co:"TOR", ip:"127.0.0.1", port:"9050",
|
||||
proto:"socks5"}, {co:"TOR-Browser", ip:"127.0.0.1", port:"9150", proto:"socks5"}]}, state:{state:{text:"Off", cl:"uk-text-muted", blink:false}, isenabled:true, started:false, authHeader:null, isOnlyStartProxy:true, nowProxyCache:{}, uproxys:[], proxys:{}, anonymityAll:false, torAll:false, alwProxy:true, https:true, icon:null, iconoff:null, authHeader:[], authHeaderEnd:null, contrys:[], contryCh:"", proxyMain:{}, proxyMainT:{}, proxyMainInd:{}, ip:0, lastUpdate:0, lastUpdateKey:0, apiUrl:"", allApiUrls:[],
|
||||
loadConfigUpdTimer:null, loadConfigFailCount:0, proxyhttps:false, contryMain:"main", listTorSite:[], listAnSite:[], listNonProxySite:[], listAlwProxySite:[], listContrySite:{}, offlist:[], timerCheckProxy:null}};
|
||||
|
|
@ -1,328 +0,0 @@
|
|||
function iconAnimator(strPath) {
|
||||
var icon = document.createElement("img");
|
||||
icon.setAttribute("src", strPath);
|
||||
var canvas = document.createElement("canvas");
|
||||
canvas.setAttribute("width", "19");
|
||||
canvas.setAttribute("height", "19");
|
||||
var canvasContext = canvas.getContext("2d");
|
||||
var time = 0;
|
||||
var ru = new Image;
|
||||
ru.src = "im/co/ru.png";
|
||||
var de = new Image;
|
||||
de.src = "im/co/de.png";
|
||||
var uk = new Image;
|
||||
uk.src = "im/co/uk.png";
|
||||
var fr = new Image;
|
||||
fr.src = "im/co/fr.png";
|
||||
var nl = new Image;
|
||||
nl.src = "im/co/nl.png";
|
||||
var es = new Image;
|
||||
es.src = "im/co/es.png";
|
||||
var google = new Image;
|
||||
google.src = "im/co/google.png";
|
||||
var err = new Image;
|
||||
err.src = "im/co/err.png";
|
||||
var proxy = new Image;
|
||||
proxy.src = "im/co/p.png";
|
||||
var tor = new Image;
|
||||
tor.src = "im/co/tor.png";
|
||||
this.setErr = function() {
|
||||
var coimg = err;
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.drawImage(coimg, -8, -10, 16, 16);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, 19, 19)});
|
||||
};
|
||||
this.setCo = function(co) {
|
||||
var coimg = false;
|
||||
co = co.toLowerCase();
|
||||
if (co) {
|
||||
if (co == "ru") {
|
||||
coimg = ru;
|
||||
} else {
|
||||
if (co == "de") {
|
||||
coimg = de;
|
||||
} else {
|
||||
if (co == "uk") {
|
||||
coimg = uk;
|
||||
} else {
|
||||
if (co == "fr") {
|
||||
coimg = fr;
|
||||
} else {
|
||||
if (co == "nl") {
|
||||
coimg = nl;
|
||||
} else {
|
||||
if (co == "es") {
|
||||
coimg = es;
|
||||
} else {
|
||||
if (co == "err") {
|
||||
coimg = err;
|
||||
} else {
|
||||
if (co == "public") {
|
||||
coimg = proxy;
|
||||
} else {
|
||||
if (co == "tor") {
|
||||
coimg = tor;
|
||||
} else {
|
||||
if (co.indexOf("google") != -1) {
|
||||
coimg = google;
|
||||
} else {
|
||||
coimg = proxy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.fillStyle = "rgba(190,190,190,1)";
|
||||
canvasContext.fillRect(-2, 1, 11, 8);
|
||||
if (coimg) {
|
||||
canvasContext.drawImage(coimg, -1, 1, 10, 8);
|
||||
}
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, 19, 19)});
|
||||
};
|
||||
this.set = function() {
|
||||
chrome.browserAction.setIcon({path:{19:strPath}});
|
||||
};
|
||||
function ease(x) {
|
||||
return(1 - Math.sin(Math.PI / 2 + x * Math.PI)) / 2;
|
||||
}
|
||||
this.rotate = function() {
|
||||
var rotation = 0;
|
||||
var animationFrames = 30;
|
||||
var animationSpeed = 1;
|
||||
var cicles = 0;
|
||||
function drawIconAtRotation() {
|
||||
var width = canvas.width - 1;
|
||||
var height = canvas.height - 1;
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.rotate(2 * Math.PI * ease(rotation));
|
||||
canvasContext.drawImage(icon, -Math.ceil(width / 2), -Math.ceil(height / 2), width, height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
if (cicles <= 2) {
|
||||
if (rotation >= 1) {
|
||||
rotation = 0;
|
||||
cicles += 1;
|
||||
}
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = 0;
|
||||
chrome.browserAction.setIcon({path:{19:icon.src}});
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.flipHorizontal = function() {
|
||||
var rotation = -2;
|
||||
var animationFrames = 60;
|
||||
var animationSpeed = 1;
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.scale(ease(rotation), 1);
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = -2;
|
||||
chrome.browserAction.setIcon({path:{19:icon.src}});
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.flipVertical = function() {
|
||||
var rotation = -2;
|
||||
var animationFrames = 60;
|
||||
var animationSpeed = 1;
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.scale(1, ease(rotation));
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = -2;
|
||||
chrome.browserAction.setIcon({path:{19:icon.src}});
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.pulse = function() {
|
||||
var rotation = -3;
|
||||
var animationFrames = 60;
|
||||
var animationSpeed = 2;
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.scale(ease(rotation), ease(rotation));
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = -3;
|
||||
chrome.browserAction.setIcon({path:{19:icon.src}});
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.pulse2 = function() {
|
||||
var rotation = -3;
|
||||
var animationFrames = 15;
|
||||
var animationSpeed = 1;
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.scale(ease(rotation), ease(rotation));
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = -3;
|
||||
chrome.browserAction.setIcon({path:{19:icon.src}});
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.flipHorizontalChange = function(Icon) {
|
||||
var rotation = -1;
|
||||
var animationFrames = 35;
|
||||
var animationSpeed = 7;
|
||||
var i = 0;
|
||||
var newIcon = document.createElement("img");
|
||||
newIcon.setAttribute("src", Icon);
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvasContext.translate(Math.ceil(canvas.width / 2), Math.ceil(canvas.height / 2));
|
||||
canvasContext.scale(rotation, 1);
|
||||
if (rotation > 0) {
|
||||
canvasContext.drawImage(newIcon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
} else {
|
||||
canvasContext.drawImage(icon, -Math.ceil(canvas.width / 2), -Math.ceil(canvas.height / 2), canvas.width, canvas.height);
|
||||
}
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
rotation += 1 / animationFrames;
|
||||
drawIconAtRotation();
|
||||
i++;
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = -1;
|
||||
chrome.browserAction.setIcon({path:{19:newIcon.src}});
|
||||
icon = newIcon;
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.slideRightChange = function(Icon) {
|
||||
var rotation = 0;
|
||||
var animationFrames = 60;
|
||||
var animationSpeed = 10;
|
||||
var newIcon = document.createElement("img");
|
||||
newIcon.setAttribute("src", Icon);
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width + canvas.width, canvas.height);
|
||||
var position = canvas.width * rotation;
|
||||
canvasContext.translate(position, 0);
|
||||
canvasContext.drawImage(icon, 0, 0, canvas.width, canvas.height);
|
||||
canvasContext.drawImage(newIcon, -canvas.width, 0, canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
drawIconAtRotation();
|
||||
rotation += 1 / animationFrames;
|
||||
if (rotation <= 1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = 0;
|
||||
chrome.browserAction.setIcon({path:{19:newIcon.src}});
|
||||
icon = newIcon;
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
this.slideLeftChange = function(Icon) {
|
||||
var rotation = 0;
|
||||
var animationFrames = 60;
|
||||
var animationSpeed = 10;
|
||||
var newIcon = document.createElement("img");
|
||||
newIcon.setAttribute("src", Icon);
|
||||
function drawIconAtRotation() {
|
||||
canvasContext.save();
|
||||
canvasContext.clearRect(0, 0, canvas.width + canvas.width, canvas.height);
|
||||
var position = canvas.width * rotation;
|
||||
canvasContext.translate(position, 0);
|
||||
canvasContext.drawImage(icon, 0, 0, canvas.width, canvas.height);
|
||||
canvasContext.drawImage(newIcon, canvas.width, 0, canvas.width, canvas.height);
|
||||
canvasContext.restore();
|
||||
chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width, canvas.height)});
|
||||
}
|
||||
function Do() {
|
||||
drawIconAtRotation();
|
||||
rotation -= 1 / animationFrames;
|
||||
if (rotation >= -1) {
|
||||
setTimeout(Do, animationSpeed);
|
||||
} else {
|
||||
rotation = 0;
|
||||
chrome.browserAction.setIcon({path:{19:newIcon.src}});
|
||||
icon = newIcon;
|
||||
}
|
||||
}
|
||||
Do();
|
||||
};
|
||||
}
|
||||
;
|
|
@ -1,170 +0,0 @@
|
|||
(function($) {
|
||||
$.fn.ddslick = function(method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else {
|
||||
if (typeof method === "object" || !method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error("Method " + method + " does not exists.");
|
||||
}
|
||||
}
|
||||
};
|
||||
var methods = {}, defaults = {data:[], keepJSONItemsOnTop:false, width:260, height:null, background:"#eee", selectText:"", defaultSelectedIndex:null, truncateDescription:true, imagePosition:"left", showSelectedHTML:true, clickOffToClose:true, onSelected:function() {
|
||||
}}, ddSelectHtml = '<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>', ddOptionsHtml = '<ul class="dd-options" style=""></ul>', ddslickCSS = '<style id="css-ddslick" type="text/css">' + ".dd-select{ border-radius:3px; border:solid 1px #ccc; position:relative; cursor:pointer;}" + ".dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }" + ".dd-selected{line-height: 14px; font-size:14px; overflow:hidden; display:block; padding:3px 5px 3px 5px; font-weight:bold;}" +
|
||||
".dd-pointer{ width:0; height:0; position:absolute; right:5px; top:50%; margin-top:-3px;}" + ".dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }" + ".dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}" + ".dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}" + ".dd-option{ line-height: 16px; font-size:12px; padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }" +
|
||||
".dd-options > li:last-child > .dd-option{ border-bottom:none;}" + ".dd-option:hover{ background:#ddd; color:#000;}" + ".dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }" + ".dd-option-selected { background:#f6f6f6; }" + ".dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}" + ".dd-image-right { float:right; margin-right:15px; margin-left:5px;}" + "a.dd-option {text-decoration: none;}" + ".dd-container{ position:relative;}\u200b .dd-selected-text { font-weight:bold}\u200b</style>";
|
||||
if ($("#css-ddslick").length <= 0) {
|
||||
$(ddslickCSS).appendTo("head");
|
||||
}
|
||||
methods.init = function(options) {
|
||||
var options = $.extend({}, defaults, options);
|
||||
return this.each(function() {
|
||||
var obj = $(this), data = obj.data("ddslick");
|
||||
if (!data) {
|
||||
var ddSelect = [], ddJson = options.data;
|
||||
obj.find("option").each(function() {
|
||||
var $this = $(this), thisData = $this.data();
|
||||
ddSelect.push({text:$.trim($this.text()), value:$this.val(), selected:$this.is(":selected"), description:thisData.description, ico:thisData.ico, imageSrc:thisData.imagesrc});
|
||||
});
|
||||
if (options.keepJSONItemsOnTop) {
|
||||
$.merge(options.data, ddSelect);
|
||||
} else {
|
||||
options.data = $.merge(ddSelect, options.data);
|
||||
}
|
||||
var original = obj, placeholder = $('<div id="' + obj.attr("id") + '"></div>');
|
||||
obj.replaceWith(placeholder);
|
||||
obj = placeholder;
|
||||
obj.addClass("dd-container").append(ddSelectHtml).append(ddOptionsHtml);
|
||||
var ddSelect = obj.find(".dd-select"), ddOptions = obj.find(".dd-options");
|
||||
ddOptions.css({width:options.width});
|
||||
ddSelect.css({width:options.width, background:options.background});
|
||||
obj.css({width:options.width});
|
||||
if (options.height != null) {
|
||||
ddOptions.css({height:options.height, overflow:"auto"});
|
||||
}
|
||||
$.each(options.data, function(index, item) {
|
||||
if (item.selected) {
|
||||
options.defaultSelectedIndex = index;
|
||||
}
|
||||
ddOptions.append("<li>" + '<a class="dd-option">' + (item.value ? ' <input class="dd-option-value" type="hidden" value="' + item.value + '" />' : "") + (item.imageSrc ? ' <img class="dd-option-image' + (options.imagePosition == "right" ? " dd-image-right" : "") + '" src="' + item.imageSrc + '" />' : "") + (item.ico ? '<i class="uk-text-bold uk-icon-' + item.ico + '"></i>' : "") + (item.text ? ' <label class="dd-option-text">' + item.text + "</label>" : "") + (item.description ? ' <small class="dd-option-description dd-desc">' +
|
||||
item.description + "</small>" : "") + "</a>" + "</li>");
|
||||
});
|
||||
var pluginData = {settings:options, original:original, selectedIndex:-1, selectedItem:null, selectedData:null};
|
||||
obj.data("ddslick", pluginData);
|
||||
if (options.selectText.length > 0 && options.defaultSelectedIndex == null) {
|
||||
obj.find(".dd-selected").html(options.selectText);
|
||||
} else {
|
||||
var index = options.defaultSelectedIndex != null && options.defaultSelectedIndex >= 0 && options.defaultSelectedIndex < options.data.length ? options.defaultSelectedIndex : 0;
|
||||
selectIndex(obj, index);
|
||||
}
|
||||
obj.find(".dd-select").on("click.ddslick", function() {
|
||||
open(obj);
|
||||
});
|
||||
obj.find(".dd-option").on("click.ddslick", function() {
|
||||
selectIndex(obj, $(this).closest("li").index());
|
||||
});
|
||||
if (options.clickOffToClose) {
|
||||
ddOptions.addClass("dd-click-off-close");
|
||||
obj.on("click.ddslick", function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
$("body").on("click", function() {
|
||||
$(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
methods.select = function(options) {
|
||||
return this.each(function() {
|
||||
if (options.index) {
|
||||
selectIndex($(this), options.index);
|
||||
}
|
||||
});
|
||||
};
|
||||
methods.open = function() {
|
||||
return this.each(function() {
|
||||
var $this = $(this), pluginData = $this.data("ddslick");
|
||||
if (pluginData) {
|
||||
open($this);
|
||||
}
|
||||
});
|
||||
};
|
||||
methods.close = function() {
|
||||
return this.each(function() {
|
||||
var $this = $(this), pluginData = $this.data("ddslick");
|
||||
if (pluginData) {
|
||||
close($this);
|
||||
}
|
||||
});
|
||||
};
|
||||
methods.destroy = function() {
|
||||
return this.each(function() {
|
||||
var $this = $(this), pluginData = $this.data("ddslick");
|
||||
if (pluginData) {
|
||||
var originalElement = pluginData.original;
|
||||
$this.removeData("ddslick").unbind(".ddslick").replaceWith(originalElement);
|
||||
}
|
||||
});
|
||||
};
|
||||
function selectIndex(obj, index) {
|
||||
var pluginData = obj.data("ddslick");
|
||||
var ddSelected = obj.find(".dd-selected"), ddSelectedValue = ddSelected.siblings(".dd-selected-value"), ddOptions = obj.find(".dd-options"), ddPointer = ddSelected.siblings(".dd-pointer"), selectedOption = obj.find(".dd-option").eq(index), selectedLiItem = selectedOption.closest("li"), settings = pluginData.settings, selectedData = pluginData.settings.data[index];
|
||||
obj.find(".dd-option").removeClass("dd-option-selected");
|
||||
selectedOption.addClass("dd-option-selected");
|
||||
pluginData.selectedIndex = index;
|
||||
pluginData.selectedItem = selectedLiItem;
|
||||
pluginData.selectedData = selectedData;
|
||||
if (settings.showSelectedHTML) {
|
||||
ddSelected.html((selectedData.ico ? '<i class="uk-text-bold uk-icon-' + selectedData.ico + '"></i>' : "") + (selectedData.imageSrc ? '<img class="dd-selected-image' + (settings.imagePosition == "right" ? " dd-image-right" : "") + '" src="' + selectedData.imageSrc + '" />' : "") + (selectedData.text ? '<label class="dd-selected-text">' + selectedData.text + "</label>" : "") + (selectedData.description ? '<small class="dd-selected-description dd-desc' + (settings.truncateDescription ? " dd-selected-description-truncated" :
|
||||
"") + '" >' + selectedData.description + "</small>" : ""));
|
||||
} else {
|
||||
ddSelected.html(selectedData.text);
|
||||
}
|
||||
ddSelectedValue.val(selectedData.value);
|
||||
pluginData.original.val(selectedData.value);
|
||||
obj.data("ddslick", pluginData);
|
||||
close(obj);
|
||||
adjustSelectedHeight(obj);
|
||||
if (typeof settings.onSelected == "function") {
|
||||
settings.onSelected.call(this, pluginData);
|
||||
}
|
||||
}
|
||||
function open(obj) {
|
||||
var $this = obj.find(".dd-select"), ddOptions = $this.siblings(".dd-options"), ddPointer = $this.find(".dd-pointer"), wasOpen = ddOptions.is(":visible");
|
||||
$(".dd-click-off-close").not(ddOptions).slideUp(50);
|
||||
$(".dd-pointer").removeClass("dd-pointer-up");
|
||||
if (wasOpen) {
|
||||
ddOptions.slideUp("fast");
|
||||
ddPointer.removeClass("dd-pointer-up");
|
||||
} else {
|
||||
ddOptions.slideDown("fast");
|
||||
ddPointer.addClass("dd-pointer-up");
|
||||
}
|
||||
adjustOptionsHeight(obj);
|
||||
}
|
||||
function close(obj) {
|
||||
obj.find(".dd-options").slideUp(50);
|
||||
obj.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up");
|
||||
}
|
||||
function adjustSelectedHeight(obj) {
|
||||
var lSHeight = obj.find(".dd-select").css("height");
|
||||
var descriptionSelected = obj.find(".dd-selected-description");
|
||||
var imgSelected = obj.find(".dd-selected-image");
|
||||
if (descriptionSelected.length <= 0 && imgSelected.length > 0) {
|
||||
}
|
||||
}
|
||||
function adjustOptionsHeight(obj) {
|
||||
obj.find(".dd-option").each(function() {
|
||||
var $this = $(this);
|
||||
var lOHeight = $this.css("height");
|
||||
var descriptionOption = $this.find(".dd-option-description");
|
||||
var imgOption = obj.find(".dd-option-image");
|
||||
if (descriptionOption.length <= 0 && imgOption.length > 0) {
|
||||
$this.find(".dd-option-text").css("lineHeight", lOHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
$.fn.scrollTo = function(target, options, callback) {
|
||||
if (typeof options == "function" && arguments.length == 2) {
|
||||
callback = options;
|
||||
options = target;
|
||||
}
|
||||
var settings = $.extend({scrollTarget:target, offsetTop:130, duration:500, easing:"swing"}, options);
|
||||
return this.each(function() {
|
||||
var scrollPane = $(this);
|
||||
var scrollTarget = typeof settings.scrollTarget == "number" ? settings.scrollTarget : $(settings.scrollTarget);
|
||||
var scrollY = typeof scrollTarget == "number" ? scrollTarget : scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop);
|
||||
scrollPane.animate({scrollTop:scrollY}, parseInt(settings.duration), settings.easing, function() {
|
||||
if (typeof callback == "function") {
|
||||
callback.call(this);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
nl.drew.cp.lang = function() {
|
||||
var lang = {};
|
||||
lang.s = {"en":{}, "ru":{}};
|
||||
lang.user = "";
|
||||
lang.chrome = "";
|
||||
lang.init = function() {
|
||||
if (nl.drew.cp.ls.isset("lang")) {
|
||||
nl.drew.cp.lang.user = nl.drew.cp.ls.get("lang", false);
|
||||
}
|
||||
};
|
||||
lang.l = function(m) {
|
||||
var nowLang = this.getLang();
|
||||
if (typeof nl.drew.cp.lang.s[nowLang] == "undefined") {
|
||||
nowLang = "en";
|
||||
if (typeof nl.drew.cp.lang.s[nowLang] == "undefined") {
|
||||
return "not found iteam";
|
||||
}
|
||||
}
|
||||
if (typeof nl.drew.cp.lang.s[nowLang][m] == "undefined") {
|
||||
nowLang = "en";
|
||||
if (typeof nl.drew.cp.lang.s[nowLang][m] == "undefined") {
|
||||
return "not found iteam";
|
||||
}
|
||||
}
|
||||
return nl.drew.cp.lang.s[nowLang][m];
|
||||
};
|
||||
lang.getLang = function() {
|
||||
if (nl.drew.cp.lang.user) {
|
||||
return nl.drew.cp.lang.user;
|
||||
}
|
||||
var chromeLang = chrome.i18n.getUILanguage();
|
||||
if (chromeLang.substr(2).toLowerCase() == "en") {
|
||||
return "en";
|
||||
} else {
|
||||
if (chromeLang.substr(2).toLowerCase() == "ru") {
|
||||
return "ru";
|
||||
}
|
||||
}
|
||||
};
|
||||
lang.setLang = function(l) {
|
||||
nl.drew.cp.lang.user = l;
|
||||
nl.drew.cp.ls.set("lang", l, false);
|
||||
};
|
||||
return lang;
|
||||
}();
|
||||
|
|
@ -1,260 +0,0 @@
|
|||
if (!nl) {
|
||||
var nl = {}
|
||||
}
|
||||
if (!nl.drew) {
|
||||
nl.drew = {};
|
||||
}
|
||||
if (!nl.drew.cp) {
|
||||
nl.drew.cp = {};
|
||||
}
|
||||
nl.drew.cp.lib = function() {
|
||||
var lib = {};
|
||||
lib.l = function(m) {
|
||||
return chrome.i18n.getMessage(m);
|
||||
};
|
||||
lib.checkProxyUrl = function(addr) {
|
||||
var ipSplit = addr.split(/\:/g);
|
||||
if (typeof ipSplit[1] != "undefined") {
|
||||
if (ipSplit[1] < 65535 && ipSplit[1] > 0) {
|
||||
if (this.isipv4(ipSplit[0]) || this.isipv6(ipSplit[0])) {
|
||||
return{ip:ipSplit[0], port:ipSplit[1]};
|
||||
}
|
||||
var purl;
|
||||
if ((purl = this.parseUrl(ipSplit[0])) != false || (purl = this.parseUrl("http://" + ipSplit[0])) != false) {
|
||||
return{ip:purl.host, port:ipSplit[1]};
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
lib.isipv4 = function(addr) {
|
||||
if (/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(addr)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
lib.isipv6 = function(addr) {
|
||||
var ipSplit = addr.split(/\]:/g);
|
||||
if (typeof ipSplit[1] != "undefined") {
|
||||
if (ipSplit[1] < 65535 && ipSplit[1] > 0) {
|
||||
ipSplit = ipSplit[0].split(/\[/g);
|
||||
if (typeof ipSplit[1] != "undefined") {
|
||||
return/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i.test(ipSplit[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
lib.ReqJson = function(url, timeout, onSuccess, onError, onTimeout, type, data) {
|
||||
if (!type) {
|
||||
type = "GET";
|
||||
}
|
||||
if (!data) {
|
||||
data = null;
|
||||
}
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.onabort = function() {
|
||||
onError("abort");
|
||||
};
|
||||
xhr.ontimeout = function() {
|
||||
onTimeout("onTimeout");
|
||||
};
|
||||
xhr.onerror = function() {
|
||||
onError(xhr.status + " " + xhr.statusText);
|
||||
};
|
||||
xhr.onload = function() {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
onSuccess(xhr.response);
|
||||
} else {
|
||||
onError(xhr.status);
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
xhr.open(type, url, true);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
if (type == "POST") {
|
||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
}
|
||||
xhr.timeout = timeout;
|
||||
try {
|
||||
xhr.send(data);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
lib.urlvalid = new RegExp("^" + "(?:(?:https?|ftp)://)" + "(?:\\S+(?::\\S*)?@)?" + "(?:" + "(?!(?:10|127)(?:\\.\\d{1,3}){3})" + "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" + "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" + "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" + "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" + "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" +
|
||||
"(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" + ")" + "(?::\\d{2,5})?" + "(?:/\\S*)?" + "$", "i");
|
||||
lib.debug = function(mess) {
|
||||
if (nl.drew.cp.config.isDebug) {
|
||||
if (typeof mess != "number" && typeof mess != "string") {
|
||||
mess = JSON.stringify(mess);
|
||||
}
|
||||
console.log(mess);
|
||||
}
|
||||
return nl.drew.cp.config.isDebug;
|
||||
};
|
||||
lib.clone = function(obj) {
|
||||
if (obj == null || typeof obj != "object") {
|
||||
return obj;
|
||||
}
|
||||
var temp = {};
|
||||
for (var key in obj) {
|
||||
temp[key] = nl.drew.cp.lib.clone(obj[key]);
|
||||
}
|
||||
return temp;
|
||||
};
|
||||
lib.time = function() {
|
||||
return parseInt((new Date).getTime() / 1E3);
|
||||
};
|
||||
lib.timems = function() {
|
||||
return parseInt((new Date).getTime());
|
||||
};
|
||||
lib.parseUrl = function(url) {
|
||||
if (!nl.drew.cp.lib.urlvalid.test(url)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
var purl = new URL(url);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
if (purl.protocol == "http:" || purl.protocol == "https:") {
|
||||
purl.allow = true;
|
||||
} else {
|
||||
purl.allow = false;
|
||||
}
|
||||
return nl.drew.cp.lib.clone(purl);
|
||||
};
|
||||
lib.generatePW = function(c) {
|
||||
var i, s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", pw = "";
|
||||
if (!c) {
|
||||
c = 16;
|
||||
}
|
||||
for (i = 0;i < c;i++) {
|
||||
pw += s.charAt(Math.random() * 61);
|
||||
}
|
||||
return pw;
|
||||
};
|
||||
lib.sIncrease = function(i, ii) {
|
||||
if (i > ii) {
|
||||
return 1;
|
||||
} else {
|
||||
if (i < ii) {
|
||||
return-1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.sDecrease = function(i, ii) {
|
||||
if (i > ii) {
|
||||
return-1;
|
||||
} else {
|
||||
if (i < ii) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.naturalSort = function(array, extractor) {
|
||||
var splitters = array.map(makeSplitter);
|
||||
var sorted = splitters.sort(compareSplitters);
|
||||
return sorted.map(function(splitter) {
|
||||
return splitter.item;
|
||||
});
|
||||
function makeSplitter(item) {
|
||||
return new Splitter(item);
|
||||
}
|
||||
function Splitter(item) {
|
||||
var index = 0;
|
||||
var from = 0;
|
||||
var parts = [];
|
||||
var completed = false;
|
||||
this.item = item;
|
||||
var key = typeof extractor === "function" ? extractor(item) : item;
|
||||
this.key = key;
|
||||
this.count = function() {
|
||||
return parts.length;
|
||||
};
|
||||
this.part = function(i) {
|
||||
while (parts.length <= i && !completed) {
|
||||
next();
|
||||
}
|
||||
return i < parts.length ? parts[i] : null;
|
||||
};
|
||||
function next() {
|
||||
if (index < key.length) {
|
||||
while (++index) {
|
||||
var currentIsDigit = isDigit(key.charAt(index - 1));
|
||||
var nextChar = key.charAt(index);
|
||||
var currentIsLast = index === key.length;
|
||||
var isBorder = currentIsLast || xor(currentIsDigit, isDigit(nextChar));
|
||||
if (isBorder) {
|
||||
var partStr = key.slice(from, index);
|
||||
parts.push(new Part(partStr, currentIsDigit));
|
||||
from = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
completed = true;
|
||||
}
|
||||
}
|
||||
function Part(text, isNumber) {
|
||||
this.isNumber = isNumber;
|
||||
this.value = isNumber ? Number(text) : text;
|
||||
}
|
||||
}
|
||||
function compareSplitters(sp1, sp2) {
|
||||
var i = 0;
|
||||
do {
|
||||
var first = sp1.part(i);
|
||||
var second = sp2.part(i);
|
||||
if (null !== first && null !== second) {
|
||||
if (xor(first.isNumber, second.isNumber)) {
|
||||
return first.isNumber ? -1 : 1;
|
||||
} else {
|
||||
var comp = compare(first.value, second.value);
|
||||
if (comp != 0) {
|
||||
return comp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return compare(sp1.count(), sp2.count());
|
||||
}
|
||||
} while (++i);
|
||||
function compare(a, b) {
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
}
|
||||
}
|
||||
function xor(a, b) {
|
||||
return a ? !b : b;
|
||||
}
|
||||
function isDigit(chr) {
|
||||
var code = charCode(chr);
|
||||
return code >= charCode("0") && code <= charCode("9");
|
||||
function charCode(ch) {
|
||||
return ch.charCodeAt(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.quickquickInArray = function(it, arr) {
|
||||
var i;
|
||||
while (i = arr.shift()) {
|
||||
if (i.host == it) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
lib.isNumeric = function(obj) {
|
||||
return typeof obj != "array" && obj - parseFloat(obj) + 1 >= 0;
|
||||
};
|
||||
return lib;
|
||||
}();
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
if (!nl) {
|
||||
var nl = {}
|
||||
}
|
||||
if (!nl.drew) {
|
||||
nl.drew = {};
|
||||
}
|
||||
if (!nl.drew.cp) {
|
||||
nl.drew.cp = {};
|
||||
}
|
||||
nl.drew.cp.ls = function() {
|
||||
var ls = {};
|
||||
ls.isset = function(key) {
|
||||
if (typeof localStorage[key] != "undefined") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
ls.get = function(key, enc) {
|
||||
if (localStorage.getItem(key) !== null) {
|
||||
if (enc) {
|
||||
var denc = XXTEA.decrypt(localStorage.getItem(key), enc);
|
||||
if (denc) {
|
||||
return JSON.parse(Utf8.decode(denc));
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return JSON.parse(localStorage.getItem(key));
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
ls.set = function(key, val, enc) {
|
||||
val = JSON.stringify(val);
|
||||
if (enc) {
|
||||
val = XXTEA.encrypt(Utf8.encode(val), enc);
|
||||
}
|
||||
localStorage.setItem(key, val);
|
||||
};
|
||||
ls.del = function(key) {
|
||||
localStorage.removeItem(key);
|
||||
};
|
||||
ls.getAll = function() {
|
||||
ret = {};
|
||||
Object.each(localStorage, function(value, host) {
|
||||
try {
|
||||
ret[host] = JSON.parse(value);
|
||||
} catch (e) {
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
return ls;
|
||||
}();
|
||||
var delta = 2654435769;
|
||||
function longArrayToString(data, includeLength) {
|
||||
var length = data.length, n = length - 1 << 2;
|
||||
if (includeLength) {
|
||||
var m = data[length - 1];
|
||||
if (m < n - 3 || m > n) {
|
||||
return null;
|
||||
}
|
||||
n = m;
|
||||
}
|
||||
for (var i = 0;i < length;++i) {
|
||||
data[i] = String.fromCharCode(data[i] & 255, data[i] >>> 8 & 255, data[i] >>> 16 & 255, data[i] >>> 24 & 255);
|
||||
}
|
||||
if (includeLength) {
|
||||
return data.join("").substring(0, n);
|
||||
} else {
|
||||
return data.join("");
|
||||
}
|
||||
}
|
||||
function stringToLongArray(string, includeLength) {
|
||||
var length = string.length;
|
||||
var result = [];
|
||||
for (var i = 0;i < length;i += 4) {
|
||||
result[i >> 2] = string.charCodeAt(i) | string.charCodeAt(i + 1) << 8 | string.charCodeAt(i + 2) << 16 | string.charCodeAt(i + 3) << 24;
|
||||
}
|
||||
if (includeLength) {
|
||||
result[result.length] = length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var XXTEA = {encrypt:function(string, key) {
|
||||
if (string == "") {
|
||||
return "";
|
||||
}
|
||||
var v = stringToLongArray(string, true), k = stringToLongArray(key, false), n = v.length - 1, z = v[n], y = v[0], mx, e, p, q = Math.floor(6 + 52 / (n + 1)), sum = 0;
|
||||
if (k.length < 4) {
|
||||
k.length = 4;
|
||||
}
|
||||
while (0 <= --q) {
|
||||
sum = sum + delta & 4294967295;
|
||||
e = sum >>> 2 & 3;
|
||||
for (p = 0;p < n;++p) {
|
||||
y = v[p + 1];
|
||||
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||
z = v[p] = v[p] + mx & 4294967295;
|
||||
}
|
||||
y = v[0];
|
||||
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||
z = v[n] = v[n] + mx & 4294967295;
|
||||
}
|
||||
return longArrayToString(v, false);
|
||||
}, decrypt:function(string, key) {
|
||||
if (string == "") {
|
||||
return "";
|
||||
}
|
||||
var v = stringToLongArray(string, false);
|
||||
var k = stringToLongArray(key, false);
|
||||
if (k.length < 4) {
|
||||
k.length = 4;
|
||||
}
|
||||
var n = v.length - 1;
|
||||
var z = v[n - 1], y = v[0];
|
||||
var mx, e, p, q = Math.floor(6 + 52 / (n + 1)), sum = q * delta & 4294967295;
|
||||
while (sum != 0) {
|
||||
e = sum >>> 2 & 3;
|
||||
for (p = n;p > 0;--p) {
|
||||
z = v[p - 1];
|
||||
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||
y = v[p] = v[p] - mx & 4294967295;
|
||||
}
|
||||
z = v[n];
|
||||
mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
|
||||
y = v[0] = v[0] - mx & 4294967295;
|
||||
sum = sum - delta & 4294967295;
|
||||
}
|
||||
return longArrayToString(v, true);
|
||||
}};
|
||||
var Base64 = {};
|
||||
Base64.code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
Base64.encode = function(str, utf8encode) {
|
||||
utf8encode = typeof utf8encode == "undefined" ? false : utf8encode;
|
||||
var o1, o2, o3, bits, h1, h2, h3, h4, e = [], pad = "", c, plain, coded;
|
||||
var b64 = Base64.code;
|
||||
plain = utf8encode ? Utf8.encode(str) : str;
|
||||
c = plain.length % 3;
|
||||
if (c > 0) {
|
||||
while (c++ < 3) {
|
||||
pad += "=";
|
||||
plain += "\x00";
|
||||
}
|
||||
}
|
||||
for (c = 0;c < plain.length;c += 3) {
|
||||
o1 = plain.charCodeAt(c);
|
||||
o2 = plain.charCodeAt(c + 1);
|
||||
o3 = plain.charCodeAt(c + 2);
|
||||
bits = o1 << 16 | o2 << 8 | o3;
|
||||
h1 = bits >> 18 & 63;
|
||||
h2 = bits >> 12 & 63;
|
||||
h3 = bits >> 6 & 63;
|
||||
h4 = bits & 63;
|
||||
e[c / 3] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
|
||||
}
|
||||
coded = e.join("");
|
||||
coded = coded.slice(0, coded.length - pad.length) + pad;
|
||||
return coded;
|
||||
};
|
||||
Base64.decode = function(str, utf8decode) {
|
||||
str = str.replace(/\n/gm, "");
|
||||
utf8decode = typeof utf8decode == "undefined" ? false : utf8decode;
|
||||
var o1, o2, o3, h1, h2, h3, h4, bits, d = [], plain, coded;
|
||||
var b64 = Base64.code;
|
||||
coded = utf8decode ? Utf8.decode(str) : str;
|
||||
for (var c = 0;c < coded.length;c += 4) {
|
||||
h1 = b64.indexOf(coded.charAt(c));
|
||||
h2 = b64.indexOf(coded.charAt(c + 1));
|
||||
h3 = b64.indexOf(coded.charAt(c + 2));
|
||||
h4 = b64.indexOf(coded.charAt(c + 3));
|
||||
bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
|
||||
o1 = bits >>> 16 & 255;
|
||||
o2 = bits >>> 8 & 255;
|
||||
o3 = bits & 255;
|
||||
d[c / 4] = String.fromCharCode(o1, o2, o3);
|
||||
if (h4 == 64) {
|
||||
d[c / 4] = String.fromCharCode(o1, o2);
|
||||
}
|
||||
if (h3 == 64) {
|
||||
d[c / 4] = String.fromCharCode(o1);
|
||||
}
|
||||
}
|
||||
plain = d.join("");
|
||||
return utf8decode ? Utf8.decode(plain) : plain;
|
||||
};
|
||||
var Utf8 = {};
|
||||
Utf8.encode = function(strUni) {
|
||||
var strUtf = strUni.replace(/[\u0080-\u07ff]/g, function(c) {
|
||||
var cc = c.charCodeAt(0);
|
||||
return String.fromCharCode(192 | cc >> 6, 128 | cc & 63);
|
||||
});
|
||||
strUtf = strUtf.replace(/[\u0800-\uffff]/g, function(c) {
|
||||
var cc = c.charCodeAt(0);
|
||||
return String.fromCharCode(224 | cc >> 12, 128 | cc >> 6 & 63, 128 | cc & 63);
|
||||
});
|
||||
return strUtf;
|
||||
};
|
||||
Utf8.decode = function(strUtf) {
|
||||
var strUni = strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, function(c) {
|
||||
var cc = (c.charCodeAt(0) & 15) << 12 | (c.charCodeAt(1) & 63) << 6 | c.charCodeAt(2) & 63;
|
||||
return String.fromCharCode(cc);
|
||||
});
|
||||
strUni = strUni.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, function(c) {
|
||||
var cc = (c.charCodeAt(0) & 31) << 6 | c.charCodeAt(1) & 63;
|
||||
return String.fromCharCode(cc);
|
||||
});
|
||||
return strUni;
|
||||
};
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
(function($, undefined) {
|
||||
var pluginName = "switcher";
|
||||
var defaults = {className:"switcher", selected:null, language:"en", disabled:null, style:"default", copy:{en:{yes:"yes", no:"no"}, fr:{yes:"oui", no:"non"}}};
|
||||
function Plugin(element, options) {
|
||||
this.input = element;
|
||||
this.container = null;
|
||||
this.settings = $.extend({}, defaults, $(element).data(), options);
|
||||
this._defaults = defaults;
|
||||
this._name = pluginName;
|
||||
this.init();
|
||||
}
|
||||
$.extend(Plugin.prototype, {init:function() {
|
||||
this.buildHtml(this.input, this.settings);
|
||||
this.bindEvents(this.container, this.settings);
|
||||
}, buildHtml:function(input, settings) {
|
||||
var self = this;
|
||||
var $input = $(input);
|
||||
$input.wrap('<div class="' + settings.className + " " + settings.style + '"></div>');
|
||||
$input.after('<div class="content clearfix">' + '<div class="slider"></div>' + '<span class="text textYes"></span>' + '<span class="text textNo"></span>' + "</div>");
|
||||
this.container = $($input).parent("." + settings.className)[0];
|
||||
self.setLanguage(settings.language);
|
||||
self.setValue(settings.selected);
|
||||
self.setDisabled(settings.disabled);
|
||||
}, bindEvents:function(container, settings) {
|
||||
var self = this;
|
||||
var $container = $(container);
|
||||
var $input = $container.find("input");
|
||||
$container.on("click", function(e) {
|
||||
if (settings.disabled) {
|
||||
return;
|
||||
}
|
||||
if ($input.attr("type") == "radio") {
|
||||
self.setValue(true);
|
||||
} else {
|
||||
if ($container.closest("label").length) {
|
||||
self.setValue($input.prop("checked"));
|
||||
} else {
|
||||
self.setValue(!$input.prop("checked"));
|
||||
}
|
||||
}
|
||||
});
|
||||
$container.on("swipeleft", function() {
|
||||
if (settings.disabled) {
|
||||
return;
|
||||
}
|
||||
self.setValue(false);
|
||||
});
|
||||
$container.on("swiperight", function() {
|
||||
if (settings.disabled) {
|
||||
return;
|
||||
}
|
||||
self.setValue(true);
|
||||
});
|
||||
}, setValue:function(val) {
|
||||
var self = this;
|
||||
var $input = $(self.input);
|
||||
var $container = $(self.container);
|
||||
if (val === null) {
|
||||
if ($input.attr("type") == "radio") {
|
||||
val = typeof $input.filter(":checked").val() !== "undefined";
|
||||
} else {
|
||||
val = $input.prop("checked");
|
||||
}
|
||||
}
|
||||
if (typeof val != "boolean") {
|
||||
return console.log("The parameter need to be true or false as a boolean");
|
||||
}
|
||||
self.settings.selected = val;
|
||||
$input.prop("checked", val).trigger("change");
|
||||
if ($input.attr("type") == "radio") {
|
||||
var name = $input.attr("name");
|
||||
var $inputGroup = $('input[name="' + name + '"]');
|
||||
var $containerGroup = $inputGroup.parent("." + self.settings.className);
|
||||
if (val === true) {
|
||||
$containerGroup.removeClass("is-active");
|
||||
$inputGroup.prop("checked", false);
|
||||
$container.addClass("is-active");
|
||||
$input.prop("checked", true);
|
||||
}
|
||||
} else {
|
||||
if (val === true) {
|
||||
$container.addClass("is-active");
|
||||
} else {
|
||||
$container.removeClass("is-active");
|
||||
}
|
||||
}
|
||||
}, setDisabled:function(val) {
|
||||
var self = this;
|
||||
var $input = $(self.input);
|
||||
var $container = $(self.container);
|
||||
if (val === null) {
|
||||
if ($input.attr("disabled")) {
|
||||
val = true;
|
||||
} else {
|
||||
val = false;
|
||||
}
|
||||
}
|
||||
if (typeof val != "boolean") {
|
||||
return console.log("The parameter need to be true or false as a boolean");
|
||||
}
|
||||
self.settings.disabled = val;
|
||||
if (val === true) {
|
||||
$container.addClass("is-disabled");
|
||||
} else {
|
||||
$container.removeClass("is-disabled");
|
||||
}
|
||||
}, setLanguage:function(language) {
|
||||
var self = this;
|
||||
var $container = $(self.container);
|
||||
self.settings.language = language;
|
||||
$container.find(".textYes").text(self.settings.copy[language].yes);
|
||||
$container.find(".textNo").text(self.settings.copy[language].no);
|
||||
}, getLanguage:function(callback) {
|
||||
var self = this;
|
||||
return callback(self.settings.language);
|
||||
}, importLanguage:function(languageObj) {
|
||||
var self = this;
|
||||
self.settings.copy = languageObj;
|
||||
}});
|
||||
$.fn[pluginName] = function(options) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
this.each(function() {
|
||||
var $item = $(this);
|
||||
var instance = $item.data("plugin_" + pluginName);
|
||||
if (!instance) {
|
||||
$item.data("plugin_" + pluginName, new Plugin(this, options));
|
||||
} else {
|
||||
if (typeof options === "string") {
|
||||
instance[options].apply(instance, args);
|
||||
}
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
var startX = 0;
|
||||
var startY = 0;
|
||||
var moving = false;
|
||||
var threshold = 30;
|
||||
function onTouchEnd() {
|
||||
this.removeEventListener("touchmove", onTouchMove);
|
||||
this.removeEventListener("touchend", onTouchEnd);
|
||||
moving = false;
|
||||
}
|
||||
function onTouchMove(e) {
|
||||
e.preventDefault();
|
||||
if (moving) {
|
||||
var x = e.touches[0].pageX;
|
||||
var y = e.touches[0].pageY;
|
||||
var dx = startX - x;
|
||||
var dy = startY - y;
|
||||
var direction = null;
|
||||
if (Math.abs(dx) >= threshold) {
|
||||
direction = dx > 0 ? "left" : "right";
|
||||
} else {
|
||||
if (Math.abs(dy) >= threshold) {
|
||||
direction = dy > 0 ? "down" : "up";
|
||||
}
|
||||
}
|
||||
if (direction) {
|
||||
onTouchEnd.call(this);
|
||||
$(this).trigger("swipe", direction).trigger("swipe" + direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
function onTouchStart(e) {
|
||||
if (e.touches.length == 1) {
|
||||
startX = e.touches[0].pageX;
|
||||
startY = e.touches[0].pageY;
|
||||
moving = true;
|
||||
this.addEventListener("touchmove", onTouchMove, false);
|
||||
this.addEventListener("touchend", onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
function setup() {
|
||||
this.addEventListener && this.addEventListener("touchstart", onTouchStart, false);
|
||||
}
|
||||
$.event.special.swipe = {setup:setup};
|
||||
$.each(["left", "up", "down", "right"], function() {
|
||||
$.event.special["swipe" + this] = {setup:function() {
|
||||
$(this).on("swipe", $.noop);
|
||||
}};
|
||||
});
|
||||
})($);
|
||||
|
|
@ -1,290 +0,0 @@
|
|||
nl.drew.cp.popup.api = function() {
|
||||
var api = {};
|
||||
api.setapi = function() {
|
||||
nl.drew.cp.popup.portToExt = chrome.runtime.connect({name:"popup"});
|
||||
nl.drew.cp.popup.portToExt.onMessage.addListener(function(msg) {
|
||||
if (typeof msg.param != "undefined") {
|
||||
if (msg.param == "https") {
|
||||
} else {
|
||||
if (msg.param == "uproxy") {
|
||||
if (typeof msg.val == "undefined" && typeof msg.val.uproxy == "undefined") {
|
||||
return null;
|
||||
}
|
||||
var list = msg.val.uproxy;
|
||||
list.sort(function(i, ii) {
|
||||
if (i.host > ii.host) {
|
||||
return-1;
|
||||
} else {
|
||||
if (i.host < ii.host) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
var len = list.length;
|
||||
nl.drew.cp.popup.uproxys.listShow(list, msg.val.template, nl.drew.cp.popup.pagenumuproxy, len);
|
||||
if (len > 10) {
|
||||
var pagination = $.UIkit.pagination("#proxytable2", {items:len, itemsOnPage:nl.drew.cp.popup.listOnPage, displayedPages:3, edges:2});
|
||||
pagination.on("uk.pagination.select", function(e, pageIndex) {
|
||||
nl.drew.cp.popup.pagenumuproxy = pageIndex;
|
||||
nl.drew.cp.popup.uproxys.listShow(list, pageIndex, len);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "lists") {
|
||||
if (typeof msg.val == "undefined") {
|
||||
return null;
|
||||
}
|
||||
var list = msg.val;
|
||||
var hostScroll = msg.host;
|
||||
nl.drew.cp.popup.lists.listShow(list, nl.drew.cp.popup.pagenum, hostScroll);
|
||||
} else {
|
||||
if (msg.param == "globalalwproxy") {
|
||||
if (typeof msg.val == "undefined") {
|
||||
return null;
|
||||
}
|
||||
if (!nl.drew.cp.popup.globalalwproxySW) {
|
||||
nl.drew.cp.popup.globalalwproxySW = $("#globalalwproxy").switcher({style:"short", selected:msg.val, disabled:false});
|
||||
nl.drew.cp.popup.main.globalalwproxychangeset(nl.drew.cp.popup.globalalwproxySW);
|
||||
} else {
|
||||
if ($("#globalalwproxy").prop("checked") != msg.val) {
|
||||
nl.drew.cp.popup.globalalwproxySW.switcher("setValue", msg.val);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "tor") {
|
||||
if (msg.val.all != null) {
|
||||
if (!nl.drew.cp.popup.torAllSW) {
|
||||
nl.drew.cp.popup.torAllSW = $("#torall").switcher({style:"short", selected:msg.val.all, disabled:false});
|
||||
nl.drew.cp.popup.main.torchangeset(nl.drew.cp.popup.torAllSW);
|
||||
} else {
|
||||
if (typeof msg.val.all != "undefined") {
|
||||
if ($("#torall").prop("checked") != msg.val.all) {
|
||||
nl.drew.cp.popup.torAllSW.switcher("setValue", msg.val.all);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (msg.val.site != null) {
|
||||
if (!nl.drew.cp.popup.torSiteSW) {
|
||||
nl.drew.cp.popup.torSiteSW = $("#torsite").switcher({style:"short", selected:msg.val.site, disabled:false});
|
||||
nl.drew.cp.popup.main.torsitechangeset(nl.drew.cp.popup.torSiteSW);
|
||||
} else {
|
||||
if (typeof msg.val.site != "undefined") {
|
||||
if ($("#torsite").prop("checked") != msg.val.site) {
|
||||
nl.drew.cp.popup.torSiteSW.switcher("setValue", msg.val.site);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "anonymity") {
|
||||
if (msg.val.all != null) {
|
||||
if (!nl.drew.cp.popup.anonymityallSW) {
|
||||
nl.drew.cp.popup.anonymityallSW = $("#anonymityall").switcher({style:"short", selected:msg.val.all, disabled:false});
|
||||
nl.drew.cp.popup.main.anonymitychangeset(nl.drew.cp.popup.anonymityallSW);
|
||||
} else {
|
||||
if (typeof msg.val.all != "undefined") {
|
||||
if ($("#anonymityall").prop("checked") != msg.val.all) {
|
||||
nl.drew.cp.popup.anonymityallSW.switcher("setValue", msg.val.all);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (msg.val.site != null) {
|
||||
if (nl.drew.cp.popup.host != msg.val.host) {
|
||||
return;
|
||||
}
|
||||
if (!nl.drew.cp.popup.anonymitysiteSW) {
|
||||
nl.drew.cp.popup.anonymitysiteSW = $("#anonymitysite").switcher({style:"short", selected:msg.val.site, disabled:false});
|
||||
nl.drew.cp.popup.main.anonymitysitechangeset(nl.drew.cp.popup.anonymitysiteSW);
|
||||
} else {
|
||||
if (typeof msg.val.site != "undefined") {
|
||||
if ($("#anonymitysite").prop("checked") != msg.val.site) {
|
||||
nl.drew.cp.popup.anonymitysiteSW.switcher("setValue", msg.val.site);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "isenabled") {
|
||||
if (!nl.drew.cp.popup.onoffSW) {
|
||||
nl.drew.cp.popup.onoffSW = nl.drew.cp.popup.onoffUI.switcher({style:"default", selected:msg.val, language:"en", disabled:false, copy:{en:{yes:nl.drew.cp.lang.l("msgOn"), no:nl.drew.cp.lang.l("msgOff")}}});
|
||||
nl.drew.cp.popup.main.changeset();
|
||||
} else {
|
||||
if (typeof msg.val != "undefined") {
|
||||
if (nl.drew.cp.popup.onoffUI.prop("checked") != msg.val) {
|
||||
nl.drew.cp.popup.onoffSW.switcher("setValue", msg.val);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "state") {
|
||||
var state = $("#state");
|
||||
nl.drew.cp.popup.lib.blinkStop(state);
|
||||
if (typeof msg.val != "undefined" && msg.val.text) {
|
||||
state.removeClass("uk-text-muted uk-text-danger uk-text-success uk-text-warning");
|
||||
state.text(msg.val.text);
|
||||
if (typeof msg.val.cl != "undefined" && msg.val.cl) {
|
||||
state.addClass(msg.val.cl);
|
||||
}
|
||||
if (typeof msg.val.blink != "undefined" && msg.val.blink) {
|
||||
nl.drew.cp.popup.lib.blinkStart(state);
|
||||
}
|
||||
$("#state-wrap").css("visibility", "visible");
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "mainproxy") {
|
||||
var mainproxy = $("#mainproxy");
|
||||
var mainproxyco = $("#mainproxyco");
|
||||
var mainproxycotext = $("#mainproxycotext div");
|
||||
var enc = "";
|
||||
var activetab = 0;
|
||||
mainproxy.empty();
|
||||
mainproxyco.empty();
|
||||
mainproxycotext.empty();
|
||||
mainproxy.html(nl.drew.cp.lang.l("proxyOff"));
|
||||
if (typeof msg.val != "undefined" && msg.val && typeof msg.val.name != "undefined" && msg.val.name) {
|
||||
if (typeof msg.val.ssl != "undefined" && msg.val.ssl) {
|
||||
enc = '<div class="uk-text-small cp-os-light"><span class="cp-os"><i class="uk-icon-check-circle uk-text-success"></i> spdy</span> over ssl/tls encryption</div>';
|
||||
}
|
||||
if (msg.val.co != "unknown" || !msg.val.allow) {
|
||||
mainproxy.html("<b>" + msg.val.name + "</b>" + enc);
|
||||
} else {
|
||||
mainproxy.append('<div class="uk-text-small cp-os-light">' + msg.val.name + "</div>");
|
||||
}
|
||||
if (msg.val.co != "unknown" && msg.val.allow) {
|
||||
activetab = 1;
|
||||
} else {
|
||||
$("#sitetab").addClass("uk-disabled");
|
||||
activetab = 0;
|
||||
}
|
||||
if (msg.val.co.length == 2) {
|
||||
mainproxyco.html('<img src="im/co/' + msg.val.co + '.png">');
|
||||
} else {
|
||||
if (msg.val.co == "public") {
|
||||
mainproxyco.html('<img src="im/co/p.png">');
|
||||
} else {
|
||||
mainproxyco.html('<img src="im/co/unknown.png">');
|
||||
}
|
||||
}
|
||||
if (msg.val.co != "unknown") {
|
||||
mainproxycotext.text(msg.val.co);
|
||||
}
|
||||
}
|
||||
if (typeof msg.val != "undefined" && msg.val && typeof msg.val.host != "undefined" && msg.val.host) {
|
||||
activetab = 1;
|
||||
}
|
||||
if (!nl.drew.cp.popup.switcher) {
|
||||
nl.drew.cp.popup.switcher = $.UIkit.switcher("#maintabs", {connect:"#configproxy", animation:"fade", active:activetab});
|
||||
nl.drew.cp.popup.switcher.on("uk.switcher.show", function(event, area) {
|
||||
if (area[0].id == "liststab") {
|
||||
$("#listtable").html('<tr><td><i class="uk-icon-spinner uk-icon-spin"></i></td></tr>');
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"lists"});
|
||||
} else {
|
||||
if (area[0].id == "userprotab") {
|
||||
$("#proxytable").html('<tr><td><i class="uk-icon-spinner uk-icon-spin"></i></td></tr>');
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"uproxy"});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"contrys", val:{}});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "contrys") {
|
||||
var flags = $(".cp-flags");
|
||||
if (typeof msg.val != "undefined" && msg.val.contrys.length > 0) {
|
||||
nl.drew.cp.popup.contrys = msg.val.contrys.slice();
|
||||
flags.show();
|
||||
nl.drew.cp.popup.lib.buildFlags("flags-all", msg.val.contrys, msg.val.uproxys, msg.val.contrymain);
|
||||
if (nl.drew.cp.popup.host == msg.val.host) {
|
||||
nl.drew.cp.popup.lib.buildFlags("flags-site", msg.val.contrys, msg.val.uproxys, msg.val.contrysite, msg.val.host);
|
||||
}
|
||||
} else {
|
||||
flags.children(".cp-flags-content").empty();
|
||||
flags.hide();
|
||||
}
|
||||
$(".uk-icon-spinner").remove();
|
||||
$("body").css("min-width", "500px").css("min-height", "330px");
|
||||
$("#main").css("display", "block");
|
||||
} else {
|
||||
if (msg.param == "anonymitynow") {
|
||||
var anonymitynow, tornow;
|
||||
if (typeof msg.val == "undefined") {
|
||||
anonymitynow = false;
|
||||
tornow = false;
|
||||
} else {
|
||||
anonymitynow = msg.val[0];
|
||||
tornow = msg.val[1];
|
||||
}
|
||||
var hideip = $("#hideip");
|
||||
var hideiptext = $("#hideiptext div");
|
||||
hideip.empty();
|
||||
hideiptext.empty();
|
||||
if (tornow) {
|
||||
hideip.html('<img src="im/onion.png" />');
|
||||
hideiptext.text("TOR");
|
||||
} else {
|
||||
if (anonymitynow) {
|
||||
hideip.html('<img src="im/hide.png" />');
|
||||
hideiptext.text("hide ip");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (msg.param == "nonproxyalwproxy") {
|
||||
if (nl.drew.cp.popup.host != msg.val.host) {
|
||||
return;
|
||||
}
|
||||
var nonproxy;
|
||||
var alwproxy;
|
||||
if (typeof msg.val.nonproxy == "undefined") {
|
||||
nonproxy = false;
|
||||
} else {
|
||||
nonproxy = msg.val.nonproxy > -1;
|
||||
}
|
||||
if (typeof msg.val.alwproxy == "undefined") {
|
||||
alwproxy = false;
|
||||
} else {
|
||||
alwproxy = msg.val.alwproxy > -1;
|
||||
}
|
||||
if (!nl.drew.cp.popup.nonproxySW) {
|
||||
nl.drew.cp.popup.nonproxySW = $("#nonproxy").switcher({style:"short", selected:nonproxy});
|
||||
nl.drew.cp.popup.main.nonproxychangeset(nl.drew.cp.popup.nonproxySW);
|
||||
} else {
|
||||
if ($("#nonproxy").prop("checked") != nonproxy) {
|
||||
nl.drew.cp.popup.nonproxySW.switcher("setValue", nonproxy);
|
||||
}
|
||||
}
|
||||
if (!nl.drew.cp.popup.alwproxySW) {
|
||||
nl.drew.cp.popup.alwproxySW = $("#alwproxy").switcher({style:"short", selected:alwproxy});
|
||||
nl.drew.cp.popup.main.alwproxychangeset(nl.drew.cp.popup.alwproxySW);
|
||||
} else {
|
||||
if ($("#alwproxy").prop("checked") != alwproxy) {
|
||||
nl.drew.cp.popup.alwproxySW.switcher("setValue", alwproxy);
|
||||
}
|
||||
}
|
||||
if (nonproxy && !alwproxy) {
|
||||
$("#sitedopsetting").hide();
|
||||
} else {
|
||||
$("#sitedopsetting").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return api;
|
||||
}();
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
nl.drew.cp.popup.lib = function() {
|
||||
var lib = {};
|
||||
lib.lang = function(msg) {
|
||||
return chrome.i18n.getMessage(msg);
|
||||
};
|
||||
lib.blinkStart = function(obj, nofirst) {
|
||||
if (!nofirst) {
|
||||
obj.prop("blink", "true");
|
||||
}
|
||||
obj.fadeOut("slow", function() {
|
||||
obj.fadeIn("slow", function() {
|
||||
if (obj.prop("blink") == "true") {
|
||||
nl.drew.cp.popup.lib.blinkStart(obj, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
lib.blinkStop = function(obj) {
|
||||
obj.prop("blink", "");
|
||||
};
|
||||
lib.buildFlags = function(selector, contrys, uproxys, sel, host) {
|
||||
var i, key, isactive;
|
||||
var selact = false;
|
||||
var obj = $("#" + selector);
|
||||
obj.empty();
|
||||
if (!host) {
|
||||
host = "";
|
||||
}
|
||||
for (i in contrys) {
|
||||
if (!contrys.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
key = contrys[i];
|
||||
isactive = "";
|
||||
if (sel == key) {
|
||||
isactive = " is-active";
|
||||
nl.drew.cp.popup.contrymainSelected = key;
|
||||
}
|
||||
obj.append(' <div class="cp-flag' + isactive + '" host="' + host + '" co="' + key + '" ty="' + selector + '"><img title="' + key + '" src="im/co/' + key + '.png"/></div> ');
|
||||
}
|
||||
if (uproxys && uproxys.length > 0) {
|
||||
uproxysOptions = '<option value="-1">' + "no user proxy" + "</option>";
|
||||
var i = uproxys.length;
|
||||
while (i--) {
|
||||
if (typeof uproxys[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
isactive = "";
|
||||
if (sel == uproxys[i].co) {
|
||||
isactive = ' selected="selected"';
|
||||
selact = true;
|
||||
}
|
||||
uproxysOptions = uproxysOptions + "<option" + isactive + ' value="' + uproxys[i].co + '">' + uproxys[i].co + "</option>";
|
||||
}
|
||||
var uproxywrap = $("<div></div>").addClass("cp-uproxy uk-form");
|
||||
if (selact) {
|
||||
uproxywrap.addClass("is-active");
|
||||
if (selector == "flags-all") {
|
||||
$("#alldopsetting2").hide();
|
||||
} else {
|
||||
if (selector == "flags-site") {
|
||||
$("#sitedopsetting2").hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
var uproxy = $('<select host="' + host + '" ty="' + selector + '">' + uproxysOptions + "</select>");
|
||||
uproxy.change(this.uproxAct);
|
||||
uproxy.appendTo(uproxywrap);
|
||||
uproxywrap.appendTo(obj);
|
||||
}
|
||||
obj.children("div.cp-flag").on("click", nl.drew.cp.popup.lib.flagsAct);
|
||||
};
|
||||
lib.uproxAct = function() {
|
||||
var wrap = $(this).parent().parent();
|
||||
var allFlags = wrap.children("div.cp-flag");
|
||||
allFlags.each(function() {
|
||||
$(this).removeClass("is-active");
|
||||
});
|
||||
$(this).parent().removeClass("is-active");
|
||||
if (nl.drew.cp.popup.portToExt != null) {
|
||||
if ($(this).prop("value") != -1) {
|
||||
$(this).parent().addClass("is-active");
|
||||
}
|
||||
if ($(this).attr("ty") == "flags-all") {
|
||||
if ($(this).prop("value") != -1) {
|
||||
$("#alldopsetting2").hide();
|
||||
} else {
|
||||
$("#alldopsetting2").show();
|
||||
}
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"contrymain", val:$(this).prop("value")});
|
||||
} else {
|
||||
if ($(this).attr("ty") == "flags-site") {
|
||||
if ($(this).prop("value") != -1) {
|
||||
$("#sitedopsetting2").hide();
|
||||
} else {
|
||||
$("#sitedopsetting2").show();
|
||||
}
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"contrysite", val:{host:$(this).attr("host"), val:$(this).prop("value")}});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
lib.flagsAct = function() {
|
||||
var wrap = $(this).parent();
|
||||
var allFlags = wrap.children("div.cp-flag");
|
||||
var uproxysel = wrap.find("select");
|
||||
var hasClass = $(this).hasClass("is-active");
|
||||
allFlags.each(function() {
|
||||
$(this).removeClass("is-active");
|
||||
});
|
||||
uproxysel.parent().removeClass("is-active");
|
||||
uproxysel.val("-1");
|
||||
var co = $(this).attr("co");
|
||||
if (!hasClass) {
|
||||
$(this).addClass("is-active");
|
||||
} else {
|
||||
co = "main";
|
||||
}
|
||||
if (nl.drew.cp.popup.portToExt != null) {
|
||||
if ($(this).attr("ty") == "flags-all") {
|
||||
$("#alldopsetting2").show();
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"contrymain", val:co});
|
||||
} else {
|
||||
if ($(this).attr("ty") == "flags-site") {
|
||||
$("#sitedopsetting2").show();
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"contrysite", val:{host:$(this).attr("host"), val:co}});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return lib;
|
||||
}();
|
||||
|
|
@ -1,403 +0,0 @@
|
|||
nl.drew.cp.popup.lists = function() {
|
||||
var lists = {};
|
||||
lists.isedit = false;
|
||||
lists.incData = function(list) {
|
||||
var an = '<i class="uk-icon-eye-slash uk-invisible"></i>';
|
||||
var loc = "";
|
||||
var alwproxy = "";
|
||||
if (list.alwproxy) {
|
||||
alwproxy = '<i class="uk-icon-cloud-upload"></i>';
|
||||
} else {
|
||||
if (list.nonproxy) {
|
||||
alwproxy = '<i class="uk-icon-arrows-h"></i>';
|
||||
}
|
||||
}
|
||||
if (!list.nonproxy) {
|
||||
if (list.an) {
|
||||
an = '<i class="uk-icon-eye-slash"></i>';
|
||||
}
|
||||
if (list.loc) {
|
||||
if (list.loc.length > 2) {
|
||||
loc = '<img src="im/co/unknown' + '.png">';
|
||||
} else {
|
||||
loc = '<img src="im/co/' + list.loc + '.png">';
|
||||
}
|
||||
}
|
||||
}
|
||||
return'<td class="cp-proxy"><div>' + alwproxy + '</div></td><td class="cp-an"><div>' + an + '</div></td><td class="cp-loc"><div>' + loc + "<div></td>";
|
||||
};
|
||||
lists.listShow = function(list, page, hostScroll) {
|
||||
var listtable = $("#listtable");
|
||||
listtable.empty();
|
||||
this.listShowFolder(listtable, list, -1, 0, page);
|
||||
this.setEvents(list);
|
||||
setTimeout(function() {
|
||||
if (hostScroll) {
|
||||
$("#listWrap").scrollTo($("[ref='" + hostScroll + "']"));
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
lists.listShowFolder = function(listtable, alllist, parent, lavel, page) {
|
||||
var count = 0;
|
||||
var list = [];
|
||||
var i = alllist.length;
|
||||
while (i--) {
|
||||
alllist[i].id = i;
|
||||
if (alllist[i].par != -1) {
|
||||
alllist[alllist[i].par].ischild = alllist[i].par;
|
||||
}
|
||||
}
|
||||
var i = alllist.length;
|
||||
while (i--) {
|
||||
if (alllist[i].par != parent) {
|
||||
continue;
|
||||
}
|
||||
list.push(alllist[i]);
|
||||
}
|
||||
list.sort(function(i, ii) {
|
||||
if (i.host > ii.host) {
|
||||
return-1;
|
||||
} else {
|
||||
if (i.host < ii.host) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
var i = list.length;
|
||||
var tr;
|
||||
var dispedit;
|
||||
var onoffico, off, trstyle, tdstyle;
|
||||
while (i--) {
|
||||
an = '<i class="uk-icon-eye-slash uk-invisible"></i>';
|
||||
loc = "";
|
||||
alwproxy = "";
|
||||
trstyle = "";
|
||||
tdstyle = "";
|
||||
if (list[i].alwproxy) {
|
||||
alwproxy = '<i class="uk-icon-cloud-upload"></i>';
|
||||
} else {
|
||||
if (list[i].nonproxy) {
|
||||
alwproxy = '<i class="uk-icon-arrows-h"></i>';
|
||||
}
|
||||
}
|
||||
if (!list[i].nonproxy) {
|
||||
if (list[i].an) {
|
||||
an = '<i class="uk-icon-eye-slash"></i>';
|
||||
}
|
||||
if (list[i].loc) {
|
||||
loc = '<img src="im/co/' + list[i].loc + '.png">';
|
||||
}
|
||||
}
|
||||
if (list[i].off) {
|
||||
dispedit = ' style="display: none;"';
|
||||
onoffico = "uk-icon-toggle-off";
|
||||
trstyle = "opacity: 0.5;";
|
||||
} else {
|
||||
dispedit = "";
|
||||
onoffico = "uk-icon-toggle-on";
|
||||
}
|
||||
if (lavel > 0) {
|
||||
trstyle = trstyle + " font-size:" + (14 - lavel) + "px;";
|
||||
tdstyle = "padding-left:" + (lavel * 10 + 10) + "px";
|
||||
}
|
||||
if (trstyle) {
|
||||
trstyle = ' style="' + trstyle + '"';
|
||||
}
|
||||
if (tdstyle) {
|
||||
tdstyle = ' style="' + tdstyle + '"';
|
||||
}
|
||||
tr = listtable.append("<tr" + trstyle + ' rel="' + list[i].id + '" ref="' + list[i].host + '"><td' + tdstyle + ' class="cp-hname">' + "" + list[i].host + "</td>" + this.incData(list[i]) + '<td class="uk-text-right cp-act"><div class="cp-unvis"><a href="#" class="cp-edit"' + dispedit + '><i class="uk-icon-pencil"></i></a> <a href="#" class="cp-off"><i class="' + onoffico + '"></i></a> <a href="#" class="cp-del"><i class="uk-icon-trash-o"></i></a></div></td></tr>');
|
||||
if (list[i].ischild > -1) {
|
||||
this.listShowFolder(listtable, alllist, list[i].ischild, lavel + 1, 0);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
};
|
||||
lists.setEvents = function(list) {
|
||||
$("#listtable tr").unbind().bind({mouseenter:function() {
|
||||
if (!nl.drew.cp.popup.lists.isedit) {
|
||||
$(this).find(".cp-act div").removeClass("cp-unvis");
|
||||
}
|
||||
}, mouseleave:function() {
|
||||
$(this).find(".cp-act div").addClass("cp-unvis");
|
||||
}});
|
||||
$(".cp-off").unbind().on("click", function(e) {
|
||||
cpoff(e, $(this));
|
||||
});
|
||||
var cpoff = function(e, thiss) {
|
||||
e.stopPropagation();
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var icon = thiss.children();
|
||||
var id = tr.attr("rel");
|
||||
if (icon.hasClass("uk-icon-toggle-on")) {
|
||||
linkblock.children(".cp-edit").hide();
|
||||
tr.fadeTo("fast", .5, function() {
|
||||
icon.removeClass("uk-icon-toggle-on").addClass("uk-icon-toggle-off");
|
||||
list[id].off = true;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listoff", val:list[id].host});
|
||||
});
|
||||
} else {
|
||||
linkblock.children(".cp-edit").show();
|
||||
tr.fadeTo("fast", 1, function() {
|
||||
icon.removeClass("uk-icon-toggle-off").addClass("uk-icon-toggle-on");
|
||||
list[id].off = false;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"liston", val:list[id]});
|
||||
});
|
||||
}
|
||||
};
|
||||
$(".cp-del").unbind().on("click", function(e) {
|
||||
cpdel(e, $(this));
|
||||
});
|
||||
var cpdel = function(e, thiss) {
|
||||
e.stopPropagation();
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var id = tr.attr("rel");
|
||||
if (list[id].off) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listoffremove", val:list[id]});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listonremove", val:list[id]});
|
||||
}
|
||||
tr.fadeTo("fast", .4, function() {
|
||||
linkblock.hide();
|
||||
$('<a class="uk-text-small"></a>').text("restore").on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
var opt;
|
||||
$(this).remove();
|
||||
if (list[id].off) {
|
||||
opt = .7;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listoffrest", val:list[id]});
|
||||
} else {
|
||||
opt = 1;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listonrest", val:list[id]});
|
||||
}
|
||||
tr.fadeTo("fast", opt, function() {
|
||||
linkblock.show();
|
||||
});
|
||||
}}).appendTo(td);
|
||||
});
|
||||
};
|
||||
$(".cp-edit").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
cpedit(e, $(this));
|
||||
return false;
|
||||
});
|
||||
$("#addhost").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
var table = $("#listtable");
|
||||
var id = list.length;
|
||||
table.prepend('<tr rel="' + id + '"><td class="uk-form cp-newhost"><input id="newhost" placeholder="URL" type="text" /></td><td class="cp-proxy"><div></div></td><td class="cp-an"><div></div></td><td class="cp-loc"><div><div></td><td class="uk-text-right cp-act"><div><a href="#" class="cp-edit"><i class="uk-icon-pencil"></i></a> <a href="#" class="cp-off"><i class="uk-icon-toggle-on"></i></a> <a href="#" class="cp-del"><i class="uk-icon-trash-o"></i></a></div></td></tr>');
|
||||
list.push({host:"", nonproxy:false, alwproxy:false, an:false, loc:"", del:false});
|
||||
cpedit(e, $("[rel=" + id + "]").find(".cp-edit"), true);
|
||||
return false;
|
||||
});
|
||||
var cpedit = function(e, thiss, isnew) {
|
||||
nl.drew.cp.popup.lists.isedit = true;
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var id = tr.attr("rel");
|
||||
var newval = {host:"", nonproxy:false, alwproxy:false, an:false, loc:"", del:false, off:false};
|
||||
linkblock.hide();
|
||||
var save = $("<a></a>").html('<i class="uk-icon-save"></i>').on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
var hostinput = $("#newhost");
|
||||
hostinput.removeClass("uk-form-danger");
|
||||
var host = $.trim(hostinput.prop("value"));
|
||||
if (!host) {
|
||||
hostinput.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("EmptyURL"));
|
||||
return;
|
||||
}
|
||||
var isproto = host.indexOf("://");
|
||||
if (isproto != -1) {
|
||||
host = host.substr(isproto + 3);
|
||||
}
|
||||
if (host != list[id].host) {
|
||||
var isast = false;
|
||||
if (host[0] == "*" && host[1] == ".") {
|
||||
isast = true;
|
||||
host = host.substr(2);
|
||||
}
|
||||
host = "http://" + host;
|
||||
var purl = nl.drew.cp.lib.parseUrl(host);
|
||||
if (purl == false) {
|
||||
hostinput.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("WrongURLformat"));
|
||||
return;
|
||||
}
|
||||
if (!purl.allow) {
|
||||
hostinput.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("WrongURLprotocol"));
|
||||
return;
|
||||
}
|
||||
host = purl.host;
|
||||
if (isast) {
|
||||
host = "*." + purl.host;
|
||||
}
|
||||
if (nl.drew.cp.lib.quickquickInArray(host, list.slice()) != false) {
|
||||
hostinput.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("ThisURLalreadyadded"));
|
||||
return;
|
||||
}
|
||||
if (isnew && newval.loc == list[id].loc && newval.an == list[id].an && newval.nonproxy == list[id].nonproxy && newval.alwproxy == list[id].alwproxy) {
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("Nooptionschanged"));
|
||||
return;
|
||||
}
|
||||
if (!isnew) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"listonremove", val:{host:list[id].host, nosend:true}});
|
||||
list[id].loc = "";
|
||||
list[id].an = false;
|
||||
list[id].nonproxy = false;
|
||||
list[id].alwproxy = false;
|
||||
}
|
||||
list[id].host = host;
|
||||
}
|
||||
$(this).remove();
|
||||
space.remove();
|
||||
cancel.remove();
|
||||
linkblock.show();
|
||||
proxysave.remove();
|
||||
ansave.remove();
|
||||
locsave.remove();
|
||||
tr.children(".cp-hname").empty().removeClass("uk-form").text(list[id].host);
|
||||
if (isnew) {
|
||||
linkblock.children(".cp-edit").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
cpedit(e, $(this));
|
||||
return false;
|
||||
});
|
||||
linkblock.children(".cp-off").unbind().on("click", function(e) {
|
||||
cpoff(e, $(this));
|
||||
return false;
|
||||
});
|
||||
linkblock.children(".cp-del").unbind().on("click", function(e) {
|
||||
cpdel(e, $(this));
|
||||
return false;
|
||||
});
|
||||
}
|
||||
var step = 0;
|
||||
if (newval.loc != list[id].loc) {
|
||||
list[id].loc = newval.loc;
|
||||
newval.loc = true;
|
||||
step = 1;
|
||||
} else {
|
||||
newval.loc = false;
|
||||
}
|
||||
if (newval.an != list[id].an) {
|
||||
list[id].an = newval.an;
|
||||
newval.an = true;
|
||||
step = 2;
|
||||
} else {
|
||||
newval.an = false;
|
||||
}
|
||||
if (newval.nonproxy != list[id].nonproxy) {
|
||||
if (!list[id].nonproxy || newval.nonproxy && !list[id].nonproxy && !list[id].alwproxy || list[id].nonproxy && !newval.nonproxy && !newval.alwproxy) {
|
||||
list[id].nonproxy = newval.nonproxy;
|
||||
newval.nonproxy = true;
|
||||
step = 3;
|
||||
}
|
||||
} else {
|
||||
newval.nonproxy = false;
|
||||
}
|
||||
if (newval.alwproxy != list[id].alwproxy) {
|
||||
if (!list[id].alwproxy || newval.alwproxy && !list[id].alwproxy && !list[id].nonproxy || list[id].alwproxy && !newval.alwproxy && !newval.nonproxy) {
|
||||
list[id].alwproxy = newval.alwproxy;
|
||||
newval.alwproxy = true;
|
||||
step = 4;
|
||||
}
|
||||
} else {
|
||||
newval.alwproxy = false;
|
||||
}
|
||||
if (newval.loc) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"contrysite", val:{host:list[id].host, val:list[id].loc, list:true, nosend:true, listRequest:step == 1}});
|
||||
}
|
||||
if (newval.an) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"anonymitysite", val:{host:list[id].host, val:list[id].an, list:true, nosend:true, listRequest:step == 2}});
|
||||
}
|
||||
if (newval.nonproxy) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"nonproxy", val:{host:list[id].host, val:list[id].nonproxy, list:true, nosend:true, listRequest:step == 3}});
|
||||
}
|
||||
if (newval.alwproxy) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"alwproxy", val:{host:list[id].host, val:list[id].alwproxy, list:true, nosend:true, listRequest:step == 4}});
|
||||
}
|
||||
tr.children(".cp-loc").remove();
|
||||
tr.children(".cp-an").remove();
|
||||
tr.children(".cp-proxy").remove();
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"anonymitynow", val:{host:list[id].host}});
|
||||
nl.drew.cp.popup.lists.isedit = false;
|
||||
}}).appendTo(td);
|
||||
var space = $("<span> </span>").appendTo(td);
|
||||
var cancel = $("<a></a>").html('<i class="uk-icon-times-circle"></i>').on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
if (isnew) {
|
||||
tr.remove();
|
||||
list.splice(id, 1);
|
||||
} else {
|
||||
$(this).remove();
|
||||
space.remove();
|
||||
save.remove();
|
||||
linkblock.show();
|
||||
proxy.remove();
|
||||
tr.children(".cp-hname").removeClass("uk-form").text(list[id].host);
|
||||
tr.children(".cp-proxy").html(proxysave);
|
||||
an.remove();
|
||||
tr.children(".cp-an").html(ansave);
|
||||
loc.remove();
|
||||
tr.children(".cp-loc").html(locsave);
|
||||
}
|
||||
nl.drew.cp.popup.lists.isedit = false;
|
||||
}}).appendTo(td);
|
||||
var hname = tr.children(".cp-hname");
|
||||
var loc = tr.children(".cp-loc").children();
|
||||
var an = tr.children(".cp-an").children();
|
||||
var proxy = tr.children(".cp-proxy").children();
|
||||
hname.empty();
|
||||
hname.addClass("uk-form");
|
||||
$('<input id="newhost" size="20" value="' + list[id].host + '" type="text" />').appendTo(hname);
|
||||
var ddData = [{text:"NO", value:"", selected:!list[id].loc, description:""}];
|
||||
var i = nl.drew.cp.popup.contrys.length;
|
||||
while (i--) {
|
||||
if (typeof nl.drew.cp.popup.contrys[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
ddData.push({text:"", value:nl.drew.cp.popup.contrys[i], selected:list[id].loc == nl.drew.cp.popup.contrys[i], imageSrc:"im/co/" + nl.drew.cp.popup.contrys[i] + ".png"});
|
||||
}
|
||||
locsave = loc.clone();
|
||||
loc.empty();
|
||||
loc.ddslick({data:ddData, width:45, imagePosition:"left", selectText:"", onSelected:function(data) {
|
||||
newval.loc = data.selectedData.value;
|
||||
}});
|
||||
var anData = [{text:"", value:1, selected:list[id].an, description:"", ico:"eye-slash"}, {text:"", value:0, selected:!list[id].an, description:"", ico:"eye"}];
|
||||
ansave = an.clone();
|
||||
an.empty();
|
||||
an.ddslick({data:anData, width:40, imagePosition:"left", selectText:"", onSelected:function(data) {
|
||||
newval.an = data.selectedData.value == 1;
|
||||
}});
|
||||
var proxyData = [{text:"NO", value:"", selected:!list[id].alwproxy && !list[id].nonproxy}, {text:"", value:"alw", selected:list[id].alwproxy, ico:"cloud-upload"}, {text:"", value:"non", selected:list[id].nonproxy, ico:"arrows-h"}];
|
||||
proxysave = proxy.clone();
|
||||
proxy.empty();
|
||||
proxy.ddslick({data:proxyData, width:45, imagePosition:"left", selectText:"", onSelected:function(data) {
|
||||
if (data.selectedData.value == "alw") {
|
||||
newval.alwproxy = true;
|
||||
newval.nonproxy = false;
|
||||
} else {
|
||||
if (data.selectedData.value == "non") {
|
||||
newval.alwproxy = false;
|
||||
newval.nonproxy = true;
|
||||
} else {
|
||||
newval.alwproxy = false;
|
||||
newval.nonproxy = false;
|
||||
}
|
||||
}
|
||||
}});
|
||||
};
|
||||
};
|
||||
return lists;
|
||||
}();
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
nl.drew.cp.popup.main = function() {
|
||||
var main = {};
|
||||
main.tips = true;
|
||||
main.lang = function() {
|
||||
$("#allsitestab a").text(nl.drew.cp.lang.l("allSites"));
|
||||
$("#sitetab a").text(nl.drew.cp.lang.l("thisSite"));
|
||||
$("#liststab a").text(nl.drew.cp.lang.l("listsTab"));
|
||||
$("#userprotab a").text(nl.drew.cp.lang.l("userProTab"));
|
||||
$("#langProxyEn").text(nl.drew.cp.lang.l("proxyEnabled"));
|
||||
$("#langAnonEn").text(nl.drew.cp.lang.l("anonymityEnabled"));
|
||||
$("#langLocAll").text(nl.drew.cp.lang.l("locationForAll"));
|
||||
$("#langTorAll").text(nl.drew.cp.lang.l("torForAll"));
|
||||
$("#langNotUseProxy").text(nl.drew.cp.lang.l("notUseProxy"));
|
||||
$("#langAlwUseProxy").text(nl.drew.cp.lang.l("alwUseProxy"));
|
||||
$("#langAnonForSite").text(nl.drew.cp.lang.l("anonForSite"));
|
||||
$("#langLocSite").text(nl.drew.cp.lang.l("locSite"));
|
||||
$("#langTorSite").text(nl.drew.cp.lang.l("torForSite"));
|
||||
$("#setHttp").text(nl.drew.cp.lang.l("setHttp"));
|
||||
$("#setHelp").text(nl.drew.cp.lang.l("setHelp"));
|
||||
if (nl.drew.cp.popup.main.tips) {
|
||||
$("#langProxyEnHelp").text(nl.drew.cp.lang.l("proxyEnabledHelp"));
|
||||
$("#langAnonEnHelp").text(nl.drew.cp.lang.l("anonymityEnabledHelp"));
|
||||
$("#langLocAllHelp").text(nl.drew.cp.lang.l("locationForAllHelp"));
|
||||
$("#langNotUseProxyHelp").text(nl.drew.cp.lang.l("notUseProxyHelp"));
|
||||
$("#langAlwUseProxyHelp").text(nl.drew.cp.lang.l("alwUseProxyHelp"));
|
||||
$("#langAnonForSiteHelp").text(nl.drew.cp.lang.l("anonForSiteHelp"));
|
||||
$("#langLocSiteHelp").text(nl.drew.cp.lang.l("locSiteHelp"));
|
||||
$("#langTorAllHelp").text(nl.drew.cp.lang.l("torAllHelp"));
|
||||
$("#langTorSiteHelp").text(nl.drew.cp.lang.l("torSiteHelp"));
|
||||
} else {
|
||||
$("#langProxyEnHelp").text("");
|
||||
$("#langAnonEnHelp").text("");
|
||||
$("#langLocAllHelp").text("");
|
||||
$("#langNotUseProxyHelp").text("");
|
||||
$("#langAlwUseProxyHelp").text("");
|
||||
$("#langAnonForSiteHelp").text("");
|
||||
$("#langLocSiteHelp").text("");
|
||||
$("#langTorAllHelp").text("");
|
||||
$("#langTorSiteHelp").text("");
|
||||
}
|
||||
$("#interfaceLanguage").text(nl.drew.cp.lang.l("interfaceLanguage"));
|
||||
};
|
||||
main.start = function() {
|
||||
if (nl.drew.cp.ls.isset("tips")) {
|
||||
nl.drew.cp.popup.main.tips = nl.drew.cp.ls.get("tips", false);
|
||||
}
|
||||
nl.drew.cp.lang.init();
|
||||
this.lang();
|
||||
nl.drew.cp.popup.api.setapi();
|
||||
nl.drew.cp.popup.onoffUI = $("[name=switchName]");
|
||||
if (nl.drew.cp.popup.portToExt != null) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"isenabled"});
|
||||
}
|
||||
$("#close").on("click", function() {
|
||||
window.close();
|
||||
});
|
||||
if (nl.drew.cp.popup.portToExt != null) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"state"});
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"globalalwproxy"});
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"mainproxy"});
|
||||
}
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var purl = nl.drew.cp.lib.parseUrl(tab.url);
|
||||
var sitename = $("#sitename");
|
||||
if (purl.allow) {
|
||||
sitename.append('<i class="uk-icon-check-circle uk-text-success"></i>');
|
||||
$("#torsite").prop("value", purl.host);
|
||||
$("#anonymitysite").prop("value", purl.host);
|
||||
$("#nonproxy").prop("value", purl.host);
|
||||
$("#alwproxy").prop("value", purl.host);
|
||||
$("#sitesettingMsg").hide();
|
||||
$("#sitesetting").show();
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"nonproxyalwproxy", val:{host:purl.host}});
|
||||
nl.drew.cp.popup.host = purl.host;
|
||||
} else {
|
||||
purl.host = "";
|
||||
sitename.append('<i class="uk-icon-times-circle uk-text-danger"></i>');
|
||||
$("#sitesetting").hide();
|
||||
$("#sitesettingMsg").show();
|
||||
}
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"anonymity", val:{host:purl.host}});
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"tor", val:{host:purl.host}});
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"anonymitynow", val:{host:purl.host}});
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"get", param:"contrys", val:{host:purl.host}});
|
||||
sitename.append(purl.host);
|
||||
});
|
||||
var https = true;
|
||||
if (nl.drew.cp.ls.isset("https")) {
|
||||
https = nl.drew.cp.ls.get("https", false);
|
||||
}
|
||||
$("#httpsproxy").switcher({style:"short", selected:https, disabled:false});
|
||||
$("#httpsproxy").on("change", function() {
|
||||
if ($(this).prop("checked")) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"https", val:true});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"https", val:false});
|
||||
}
|
||||
});
|
||||
$("#onhelp").switcher({style:"short", selected:nl.drew.cp.popup.main.tips, disabled:false});
|
||||
$("#onhelp").on("change", function() {
|
||||
var tips;
|
||||
if ($("#onhelp").prop("checked")) {
|
||||
tips = true;
|
||||
} else {
|
||||
tips = false;
|
||||
}
|
||||
nl.drew.cp.ls.set("tips", tips, false);
|
||||
nl.drew.cp.popup.main.tips = tips;
|
||||
nl.drew.cp.popup.main.lang();
|
||||
});
|
||||
var langUI = $("[name=lang]");
|
||||
var langSwither = langUI.switcher({style:"short", disabled:false});
|
||||
var thisLang = nl.drew.cp.lang.getLang();
|
||||
if (thisLang == "ru") {
|
||||
langSwither.eq(1).switcher("setValue", true);
|
||||
} else {
|
||||
langSwither.eq(0).switcher("setValue", true);
|
||||
}
|
||||
langUI.on("change", function() {
|
||||
nl.drew.cp.lang.setLang(this.value);
|
||||
nl.drew.cp.popup.main.lang();
|
||||
});
|
||||
};
|
||||
main.alwproxychangeset = function(obj) {
|
||||
nl.drew.cp.popup.main.uniChangeset(obj, "alwproxy");
|
||||
};
|
||||
main.nonproxychangeset = function(obj) {
|
||||
nl.drew.cp.popup.main.uniChangeset(obj, "nonproxy");
|
||||
};
|
||||
main.anonymitysitechangeset = function(obj) {
|
||||
nl.drew.cp.popup.main.uniChangeset(obj, "anonymitysite");
|
||||
};
|
||||
main.torsitechangeset = function(obj) {
|
||||
nl.drew.cp.popup.main.uniChangeset(obj, "torsite");
|
||||
};
|
||||
main.uniChangeset = function(obj, param) {
|
||||
obj.on("change", function() {
|
||||
var host = $(this).prop("value");
|
||||
var checked = false;
|
||||
if ($(this).prop("checked")) {
|
||||
checked = true;
|
||||
}
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:param, val:{host:host, val:checked}});
|
||||
});
|
||||
};
|
||||
main.globalalwproxychangeset = function(obj) {
|
||||
obj.on("change", function() {
|
||||
if ($(this).prop("checked")) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"globalalwproxy", val:true});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"globalalwproxy", val:false});
|
||||
}
|
||||
});
|
||||
};
|
||||
main.anonymitychangeset = function(obj) {
|
||||
obj.on("change", function() {
|
||||
if ($(this).prop("checked")) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"anonymity", val:{all:true}});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"anonymity", val:{all:false}});
|
||||
}
|
||||
});
|
||||
};
|
||||
main.torchangeset = function(obj) {
|
||||
obj.on("change", function() {
|
||||
if ($(this).prop("checked")) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"tor", val:{all:true}});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"tor", val:{all:false}});
|
||||
}
|
||||
});
|
||||
};
|
||||
main.changeset = function() {
|
||||
nl.drew.cp.popup.onoffUI.on("change", function() {
|
||||
if (nl.drew.cp.popup.onoffUI.prop("checked")) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"on"});
|
||||
} else {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"off"});
|
||||
}
|
||||
});
|
||||
};
|
||||
return main;
|
||||
}();
|
||||
jQuery(document).ready(function() {
|
||||
nl.drew.cp.popup.main.start();
|
||||
});
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
nl.drew.cp.popup.uproxys = function() {
|
||||
var uproxys = {};
|
||||
uproxys.isedit = false;
|
||||
uproxys.tableStr = function(list, i) {
|
||||
var dispedit;
|
||||
var onoffico, off, ret;
|
||||
if (list[i].off) {
|
||||
dispedit = ' style="display: none;"';
|
||||
onoffico = "uk-icon-toggle-off";
|
||||
off = ' style="opacity: 0.7;"';
|
||||
} else {
|
||||
dispedit = "";
|
||||
onoffico = "uk-icon-toggle-on";
|
||||
off = "";
|
||||
}
|
||||
var proto = "";
|
||||
switch(list[i].proto.toUpperCase()) {
|
||||
case "PROXY":
|
||||
proto = "http";
|
||||
break;
|
||||
case "HTTPS":
|
||||
proto = "https";
|
||||
break;
|
||||
case "SOCKS":
|
||||
proto = "socks4";
|
||||
break;
|
||||
case "SOCKS5":
|
||||
proto = "socks5";
|
||||
break;
|
||||
}
|
||||
ret = '<tr rel="' + i + '"' + off + '><td class="cp-pname">' + list[i].co + '</td><td class="cp-uppercase cp-pproto">' + proto + '</td><td class="cp-pip uk-text-bold">' + list[i].ip + ":" + list[i].port + "</td>";
|
||||
ret = ret + '<td class="uk-text-right cp-act"><div class="cp-unvis"><a href="#" class="cp-edit"' + dispedit + '><i class="uk-icon-pencil"></i></a> <a href="#" class="cp-off"><i class="' + onoffico + '"></i></a> <a href="#" class="cp-del"><i class="uk-icon-trash-o"></i></a></div></td></tr>';
|
||||
return ret;
|
||||
};
|
||||
uproxys.listShow = function(list, template, page, len) {
|
||||
var listtable = $("#proxytable");
|
||||
var proxytemplate = $("#proxytemplate");
|
||||
var count = 0;
|
||||
listtable.empty();
|
||||
proxytemplate.empty();
|
||||
var i = list.length - page * nl.drew.cp.popup.listOnPage;
|
||||
var tr;
|
||||
while (i--) {
|
||||
if (typeof list[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
tr = listtable.append(this.tableStr(list, i));
|
||||
count++;
|
||||
if (count >= nl.drew.cp.popup.listOnPage) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
var dropdown = $.UIkit.dropdown("#proxydropdown", {"boundary":"#userprotabcontent"});
|
||||
var i = template.length;
|
||||
while (i--) {
|
||||
if (typeof template[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
proxytemplate.append('<li><a class="cp-pr-templ" rel="' + i + '"><b>' + template[i].co + "</b><br/> " + template[i].ip + ":" + template[i].port + "</a></li>");
|
||||
}
|
||||
this.setEvents(list, template, dropdown);
|
||||
};
|
||||
uproxys.setEvents = function(list, template, dropdown) {
|
||||
$("#proxytable tr").unbind().bind({mouseenter:function() {
|
||||
if (!nl.drew.cp.popup.uproxys.isedit) {
|
||||
$(this).find(".cp-act div").removeClass("cp-unvis");
|
||||
}
|
||||
}, mouseleave:function() {
|
||||
$(this).find(".cp-act div").addClass("cp-unvis");
|
||||
}});
|
||||
$(".cp-off").unbind().on("click", function(e) {
|
||||
cpoff(e, $(this));
|
||||
});
|
||||
var cpoff = function(e, thiss) {
|
||||
e.stopPropagation();
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var icon = thiss.children();
|
||||
var id = tr.attr("rel");
|
||||
if (icon.hasClass("uk-icon-toggle-on")) {
|
||||
linkblock.children(".cp-edit").hide();
|
||||
tr.fadeTo("fast", .7, function() {
|
||||
icon.removeClass("uk-icon-toggle-on").addClass("uk-icon-toggle-off");
|
||||
list[id].off = true;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxyoff", val:list[id].host});
|
||||
});
|
||||
} else {
|
||||
linkblock.children(".cp-edit").show();
|
||||
tr.fadeTo("fast", 1, function() {
|
||||
icon.removeClass("uk-icon-toggle-off").addClass("uk-icon-toggle-on");
|
||||
list[id].off = false;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxyon", val:list[id]});
|
||||
});
|
||||
}
|
||||
};
|
||||
$(".cp-del").unbind().on("click", function(e) {
|
||||
cpdel(e, $(this));
|
||||
});
|
||||
var cpdel = function(e, thiss) {
|
||||
e.stopPropagation();
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var id = tr.attr("rel");
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxyremove", val:list[id]});
|
||||
tr.fadeTo("fast", .4, function() {
|
||||
linkblock.hide();
|
||||
$('<a class="uk-text-small"></a>').text("restore").on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
var opt;
|
||||
$(this).remove();
|
||||
if (list[id].off) {
|
||||
opt = .7;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxy", val:list[id]});
|
||||
} else {
|
||||
opt = 1;
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxy", val:list[id]});
|
||||
}
|
||||
tr.fadeTo("fast", opt, function() {
|
||||
linkblock.show();
|
||||
});
|
||||
}}).appendTo(td);
|
||||
});
|
||||
};
|
||||
$(".cp-edit").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
cpedit(e, $(this));
|
||||
return false;
|
||||
});
|
||||
$("#addproxy").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
var listtable = $("#proxytable");
|
||||
var id = list.push({ip:"", port:"", sport:"", proto:"", co:"", name:"", off:false});
|
||||
id--;
|
||||
listtable.prepend(nl.drew.cp.popup.uproxys.tableStr(list, id));
|
||||
cpedit(e, $("[rel=" + id + "]").find(".cp-edit"), true);
|
||||
return false;
|
||||
});
|
||||
$(".cp-pr-templ").unbind().on("click", function(e) {
|
||||
e.stopPropagation();
|
||||
dropdown.hide();
|
||||
var listtable = $("#proxytable");
|
||||
var templateid = $(this).attr("rel");
|
||||
var id = list.push({ip:template[templateid].ip, port:template[templateid].port, sport:"", proto:template[templateid].proto, co:template[templateid].co, name:"", off:false});
|
||||
id--;
|
||||
listtable.prepend(nl.drew.cp.popup.uproxys.tableStr(list, id));
|
||||
cpedit(e, $("[rel=" + id + "]").find(".cp-edit"), true);
|
||||
});
|
||||
var cpedit = function(e, thiss, isnew) {
|
||||
nl.drew.cp.popup.uproxys.isedit = true;
|
||||
var linkblock = thiss.parent();
|
||||
var td = linkblock.parent();
|
||||
var tr = td.parent("tr");
|
||||
var id = tr.attr("rel");
|
||||
var newval = {pname:"", pproto:"", pip:""};
|
||||
linkblock.hide();
|
||||
var save = $("<a></a>").html('<i class="uk-icon-save"></i>').on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
var ischange = false;
|
||||
var checkProxy = false;
|
||||
var newpnameInp = $("#newpname").removeClass("uk-form-danger");
|
||||
var newpname = newpnameInp.prop("value");
|
||||
var ret = list[id];
|
||||
if (isnew || newpname != list[id].co) {
|
||||
if (!newpname || /[^\u0400-\u04FF_\-a-z0-9]/ig.test(newpname) || newpname.length < 3 || newpname.length > 15) {
|
||||
newpnameInp.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("errUProxyNameFormat"));
|
||||
return;
|
||||
}
|
||||
var i = list.length;
|
||||
while (i--) {
|
||||
if (typeof list[i] == "undefined") {
|
||||
continue;
|
||||
}
|
||||
if (i == id) {
|
||||
continue;
|
||||
}
|
||||
if (list[i].co == newpname) {
|
||||
newpnameInp.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("errUProxyNameAlreadyHave") + "<b>" + newpname + "</b>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
ret.co = newpname;
|
||||
ischange = true;
|
||||
}
|
||||
ret.oldname = list[id].co;
|
||||
var newpprotoInp = $("#newpproto").removeClass("uk-form-danger");
|
||||
var newpproto = newpprotoInp.prop("value");
|
||||
if (isnew || newpproto != list[id].proto) {
|
||||
ret.proto = newpproto.toUpperCase();
|
||||
ischange = true;
|
||||
}
|
||||
var newpipInp = $("#newpip").removeClass("uk-form-danger");
|
||||
var newpip = newpipInp.prop("value");
|
||||
if (isnew || newpip != list[id].ip + ":" + list[id].port) {
|
||||
checkProxy = nl.drew.cp.lib.checkProxyUrl(newpip);
|
||||
if (checkProxy == false) {
|
||||
newpipInp.addClass("uk-form-danger");
|
||||
$.UIkit.notify(nl.drew.cp.lang.l("errUproxyIpFormat"));
|
||||
return;
|
||||
}
|
||||
ret.ip = checkProxy.ip;
|
||||
ret.port = checkProxy.port;
|
||||
ischange = true;
|
||||
}
|
||||
if (ischange) {
|
||||
nl.drew.cp.popup.portToExt.postMessage({msg:"set", param:"uproxy", val:ret});
|
||||
}
|
||||
cancel.remove();
|
||||
space.remove();
|
||||
save.remove();
|
||||
linkblock.show();
|
||||
if (isnew) {
|
||||
linkblock.children(".cp-edit").unbind().on("click", function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
cpedit(e, $(this));
|
||||
return false;
|
||||
});
|
||||
linkblock.children(".cp-off").unbind().on("click", function(e) {
|
||||
cpoff(e, $(this));
|
||||
return false;
|
||||
});
|
||||
linkblock.children(".cp-del").unbind().on("click", function(e) {
|
||||
cpdel(e, $(this));
|
||||
return false;
|
||||
});
|
||||
}
|
||||
pname.removeClass("uk-form").empty().text(list[id].co);
|
||||
pip.removeClass("uk-form").empty().text(list[id].ip + ":" + list[id].port);
|
||||
pproto.removeClass("uk-form").empty().text(list[id].proto);
|
||||
nl.drew.cp.popup.uproxys.isedit = false;
|
||||
}}).appendTo(td);
|
||||
var space = $("<span> </span>").appendTo(td);
|
||||
var cancel = $("<a></a>").html('<i class="uk-icon-times-circle"></i>').on({click:function(event) {
|
||||
event.stopPropagation();
|
||||
if (isnew) {
|
||||
tr.remove();
|
||||
list.splice(id, 1);
|
||||
} else {
|
||||
cancel.remove();
|
||||
space.remove();
|
||||
save.remove();
|
||||
linkblock.show();
|
||||
pname.removeClass("uk-form").empty().text(list[id].co);
|
||||
pip.removeClass("uk-form").empty().text(list[id].ip + ":" + list[id].port);
|
||||
pproto.removeClass("uk-form").empty().text(list[id].proto);
|
||||
}
|
||||
nl.drew.cp.popup.uproxys.isedit = false;
|
||||
}}).appendTo(td);
|
||||
var pname = tr.children(".cp-pname");
|
||||
var pproto = tr.children(".cp-pproto");
|
||||
var pip = tr.children(".cp-pip");
|
||||
pname.empty();
|
||||
pname.addClass("uk-form");
|
||||
$('<input id="newpname" size="10" value="' + list[id].co + '" type="text" />').appendTo(pname);
|
||||
pip.empty();
|
||||
pip.addClass("uk-form");
|
||||
$('<input id="newpip" size="15" value="' + list[id].ip + ":" + list[id].port + '" type="text" />').appendTo(pip);
|
||||
pproto.empty();
|
||||
pproto.addClass("uk-form");
|
||||
$('<select id="newpproto">' + '<option value="proxy"' + (list[id].proto == "proxy" ? " selected" : "") + ">http</option>" + '<option value="https"' + (list[id].proto == "https" ? "selected" : "") + ">https</option>" + '<option value="socks"' + (list[id].proto == "socks" ? "selected" : "") + ">socks4</option>" + '<option value="socks5"' + (list[id].proto == "socks5" ? "selected" : "") + ">socks5</option>" + "</select>").appendTo(pproto);
|
||||
};
|
||||
};
|
||||
return uproxys;
|
||||
}();
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
if (!nl) {
|
||||
var nl = {}
|
||||
}
|
||||
if (!nl.drew) {
|
||||
nl.drew = {};
|
||||
}
|
||||
if (!nl.drew.cp) {
|
||||
nl.drew.cp = {};
|
||||
}
|
||||
nl.drew.cp.popup = {host:"", api:{}, onoffUI:null, onoffSW:null, anonymityallSW:null, torAllSW:null, anonymitysiteSW:null, torSiteSW:null, nonproxySW:null, alwproxySW:null, portToExt:null, contrymainSelected:null, switcher:null, listOnPage:10, contrys:[], pagenum:0, pagenumuproxy:0};
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
/*! UIkit 2.12.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
|
||||
if (jQuery && jQuery.UIkit) {
|
||||
component = addon(jQuery, jQuery.UIkit);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-notify", ["uikit"], function(){
|
||||
return component || addon(jQuery, jQuery.UIkit);
|
||||
});
|
||||
}
|
||||
|
||||
})(function($, UI){
|
||||
|
||||
"use strict";
|
||||
|
||||
var containers = {},
|
||||
messages = {},
|
||||
|
||||
notify = function(options){
|
||||
|
||||
if ($.type(options) == 'string') {
|
||||
options = { message: options };
|
||||
}
|
||||
|
||||
if (arguments[1]) {
|
||||
options = $.extend(options, $.type(arguments[1]) == 'string' ? {status:arguments[1]} : arguments[1]);
|
||||
}
|
||||
|
||||
return (new Message(options)).show();
|
||||
},
|
||||
closeAll = function(group, instantly){
|
||||
if(group) {
|
||||
for(var id in messages) { if(group===messages[id].group) messages[id].close(instantly); }
|
||||
} else {
|
||||
for(var id in messages) { messages[id].close(instantly); }
|
||||
}
|
||||
};
|
||||
|
||||
var Message = function(options){
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.options = $.extend({}, Message.defaults, options);
|
||||
|
||||
this.uuid = "ID"+(new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000));
|
||||
this.element = $([
|
||||
|
||||
'<div class="uk-notify-message">',
|
||||
'<a class="uk-close"></a>',
|
||||
'<div>'+this.options.message+'</div>',
|
||||
'</div>'
|
||||
|
||||
].join('')).data("notifyMessage", this);
|
||||
|
||||
// status
|
||||
if (this.options.status) {
|
||||
this.element.addClass('uk-notify-message-'+this.options.status);
|
||||
this.currentstatus = this.options.status;
|
||||
}
|
||||
|
||||
this.group = this.options.group;
|
||||
|
||||
messages[this.uuid] = this;
|
||||
|
||||
if(!containers[this.options.pos]) {
|
||||
containers[this.options.pos] = $('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo('body').on("click", ".uk-notify-message", function(){
|
||||
$(this).data("notifyMessage").close();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$.extend(Message.prototype, {
|
||||
|
||||
uuid: false,
|
||||
element: false,
|
||||
timout: false,
|
||||
currentstatus: "",
|
||||
group: false,
|
||||
|
||||
show: function() {
|
||||
|
||||
if (this.element.is(":visible")) return;
|
||||
|
||||
var $this = this;
|
||||
|
||||
containers[this.options.pos].show().prepend(this.element);
|
||||
|
||||
var marginbottom = parseInt(this.element.css("margin-bottom"), 10);
|
||||
|
||||
this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){
|
||||
|
||||
if ($this.options.timeout) {
|
||||
|
||||
var closefn = function(){ $this.close(); };
|
||||
|
||||
$this.timeout = setTimeout(closefn, $this.options.timeout);
|
||||
|
||||
$this.element.hover(
|
||||
function() { clearTimeout($this.timeout); },
|
||||
function() { $this.timeout = setTimeout(closefn, $this.options.timeout); }
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
close: function(instantly) {
|
||||
|
||||
var $this = this,
|
||||
finalize = function(){
|
||||
$this.element.remove();
|
||||
|
||||
if(!containers[$this.options.pos].children().length) {
|
||||
containers[$this.options.pos].hide();
|
||||
}
|
||||
|
||||
$this.options.onClose.apply($this, []);
|
||||
|
||||
delete messages[$this.uuid];
|
||||
};
|
||||
|
||||
if(this.timeout) clearTimeout(this.timeout);
|
||||
|
||||
if(instantly) {
|
||||
finalize();
|
||||
} else {
|
||||
this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){
|
||||
finalize();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
content: function(html){
|
||||
|
||||
var container = this.element.find(">div");
|
||||
|
||||
if(!html) {
|
||||
return container.html();
|
||||
}
|
||||
|
||||
container.html(html);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
status: function(status) {
|
||||
|
||||
if(!status) {
|
||||
return this.currentstatus;
|
||||
}
|
||||
|
||||
this.element.removeClass('uk-notify-message-'+this.currentstatus).addClass('uk-notify-message-'+status);
|
||||
|
||||
this.currentstatus = status;
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
Message.defaults = {
|
||||
message: "",
|
||||
status: "",
|
||||
timeout: 5000,
|
||||
group: null,
|
||||
pos: 'top-center',
|
||||
onClose: function() {}
|
||||
};
|
||||
|
||||
UI.notify = notify;
|
||||
UI.notify.message = Message;
|
||||
UI.notify.closeAll = closeAll;
|
||||
|
||||
return notify;
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"update_url": "https://clients2.google.com/service/update2/crx",
|
||||
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_chrome_extension_name__",
|
||||
"description": "__MSG_chrome_extension_description__",
|
||||
"default_locale": "en",
|
||||
"version": "1.12",
|
||||
"icons": {
|
||||
"128": "im/ico128-2.png"
|
||||
},
|
||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||
"background": {
|
||||
"page": "background.html",
|
||||
"persistent": true
|
||||
},
|
||||
"web_accessible_resources": [],
|
||||
"permissions": ["webNavigation","contextMenus","webRequest", "webRequestBlocking","unlimitedStorage", "tabs", "proxy", "browsingData", "http://*/*", "https://*/*","storage"],
|
||||
"browser_action": {
|
||||
"default_title": "__MSG_browser_action_title__",
|
||||
"default_icon": {
|
||||
"19": "im/ico38g-2.png",
|
||||
"38": "im/ico38g-2.png"
|
||||
},
|
||||
"default_popup": "popup.html"
|
||||
}
|
||||
}
|
|
@ -1,220 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="css/switcher.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/uikit.almost-flat.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/notify.almost-flat.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/main.css"/>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/jquery-2.1.3.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/switcher.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/vars.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/ls.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/api.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/lib.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/lists.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/uproxys.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/lib.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/lang.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="_locales/en/lang.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="_locales/ru/lang.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/popup/popup.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/uikit/uikit.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/uikit/components/notify.js"></script>
|
||||
<!--script type="text/javascript" charset="utf-8" src="js/uikit/components/pagination.js"></script-->
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/jquery.ddslick.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/lib/jquery.scrollTo.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
padding: 5px 10px 5px 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background-image: -webkit-linear-gradient(bottom,#f0f0f0,#ffffff);">
|
||||
<i class="uk-icon-spinner uk-icon-spin uk-icon-large"></i>
|
||||
|
||||
<div id="main" style="display: none; ">
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 100px;"><input type="checkbox" name="switchName" value="switchValue"
|
||||
style="visibility: hidden;"/></td>
|
||||
<td id="hideip" class="uk-text-center uk-text-middle"></td>
|
||||
<td id="mainproxyco" class="uk-text-middle uk-text-center"></td>
|
||||
<td id="mainproxy" style="line-height: 18px;" class="uk-text-middle"></td>
|
||||
<td class="uk-text-right uk-text-top"><i id="close" class="uk-icon-times-circle cp-pointer"></i></td>
|
||||
</tr>
|
||||
<tr class="uk-text-small" style="">
|
||||
<td></td>
|
||||
<td id="hideiptext" class="uk-text-center uk-text-middle cp-os-condensed">
|
||||
<div style="margin-top: -10px;"></div>
|
||||
</td>
|
||||
<td id="mainproxycotext" class="uk-text-center uk-text-middle cp-os cp-uppercase">
|
||||
<div style="margin-top: -10px;"></div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!--ul class="uk-tab uk-tab-flip " style="padding-right: 10px;" data-uk-tab="{connect:'#configproxy', animation: 'fade', active:1}"-->
|
||||
<ul id="maintabs" class="uk-tab uk-tab-flip">
|
||||
<li id="allsitestab"><a href=""></a></li>
|
||||
<li id="sitetab"><a href=""></a></li>
|
||||
<!--li id="urltab"><a href="">This Url</a></li-->
|
||||
<li id="liststab"><a href=""></a></li>
|
||||
<li id="userprotab"><a href=""></a></li>
|
||||
<li><a href=""><i class="uk-icon-navicon"></i></a></li>
|
||||
</ul>
|
||||
<ul id="configproxy" class="uk-switcher">
|
||||
<li id="allsitestabcontent">
|
||||
<input type="checkbox" id="globalalwproxy" value="globalalwproxy" style="visibility: hidden;"/>
|
||||
<label for="globalalwproxy" id="langProxyEn"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted uk-text-danger" id="langProxyEnHelp"></div>
|
||||
|
||||
<div id="alldopsetting2">
|
||||
<div class="cp-vspace"> </div>
|
||||
<input type="checkbox" id="anonymityall" value="anonymityall" style="visibility: hidden;"/>
|
||||
<label for="anonymityall" id="langAnonEn"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langAnonEnHelp"></div>
|
||||
|
||||
<div class="cp-vspace"> </div>
|
||||
<input type="checkbox" id="torall" style="visibility: hidden;"/>
|
||||
<label for="torall" id="langTorAll"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langTorAllHelp"></div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="cp-flags">
|
||||
<div id="langLocAll" class="cp-os-bold" style="margin-bottom: 5px; margin-top: -5px;">Use proxy location
|
||||
for all sites:
|
||||
</div>
|
||||
<div class="uk-text-small uk-text-muted" id="langLocAllHelp"></div>
|
||||
<div id="flags-all" class="cp-flags-content">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="sitetabcontent">
|
||||
<div id="sitename" class="cp-os-bold uk-text-right"></div>
|
||||
<div id="sitesettingMsg" class="uk-margin uk-text-danger" style="display: none;">
|
||||
Settings not available. Supported only 'http:', 'https:'
|
||||
</div>
|
||||
<div id="sitesetting" class="" style="">
|
||||
<input type="checkbox" id="nonproxy" value="" style="visibility: hidden;"/>
|
||||
<label for="nonproxy" id="langNotUseProxy"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langNotUseProxyHelp"></div>
|
||||
<div class="cp-vspace"> </div>
|
||||
<input type="checkbox" id="alwproxy" value="" style="visibility: hidden;"/>
|
||||
<label for="alwproxy" id="langAlwUseProxy"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langAlwUseProxyHelp"></div>
|
||||
<div class="cp-vspace"> </div>
|
||||
<div id="sitedopsetting">
|
||||
<div id="sitedopsetting2">
|
||||
<input type="checkbox" id="anonymitysite" value="" style="visibility: hidden;"/>
|
||||
<label for="anonymitysite" id="langAnonForSite"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langAnonForSiteHelp"></div>
|
||||
<div class="cp-vspace"> </div>
|
||||
<input type="checkbox" id="torsite" style="visibility: hidden;"/>
|
||||
<label for="torsite" id="langTorSite"></label>
|
||||
|
||||
<div class="uk-text-small uk-text-muted" id="langTorSiteHelp"></div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="cp-flags">
|
||||
<div id="langLocSite" class="cp-os-bold" style="margin-bottom: 5px; margin-top: -5px;"></div>
|
||||
<div class="uk-text-small uk-text-muted" id="langLocSiteHelp"></div>
|
||||
<div id="flags-site" class="cp-flags-content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<!--li id="urltabcontent">
|
||||
Url
|
||||
</li-->
|
||||
<li id="liststabcontent">
|
||||
<!--div class="uk-container uk-container-center"-->
|
||||
<a id="addhost"><i class="uk-icon-plus-circle"></i></a>
|
||||
|
||||
<div class="uk-scrollable-text" id="listWrap">
|
||||
<table id="listtable" class="uk-table uk-table-hover uk-table-striped uk-table-condensed">
|
||||
<tr>
|
||||
<td><i class="uk-icon-spinner uk-icon-spin"></i></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!--/div-->
|
||||
<!--ul id="listtable2" class="uk-pagination">
|
||||
|
||||
</ul-->
|
||||
</li>
|
||||
<li id="userprotabcontent">
|
||||
<a class="uk-text-middle" id="addproxy"><i class="uk-icon-plus-circle"></i></a>
|
||||
|
||||
<div class="uk-button-dropdown" id="proxydropdown">
|
||||
<span class="uk-badge uk-badge-notification"><a id="addproxytemplate"><i
|
||||
class="uk-icon-plus-circle"></i> template</a></span>
|
||||
|
||||
<div class="uk-dropdown uk-dropdown-scrollable uk-text-small" style="">
|
||||
<ul id="proxytemplate" class="uk-nav uk-nav-dropdown"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<table id="proxytable" class="uk-table uk-table-hover uk-table-striped uk-table-condensed">
|
||||
|
||||
</table>
|
||||
<!--/div-->
|
||||
<ul id="proxytable2" class="uk-pagination">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<input type="checkbox" id="httpsproxy" style="visibility: hidden;"/>
|
||||
<label for="httpsproxy" id="setHttp"></label>
|
||||
|
||||
<div class="cp-vspace"> </div>
|
||||
<input type="checkbox" id="onhelp" style="visibility: hidden;"/>
|
||||
<label for="onhelp" id="setHelp"></label>
|
||||
<hr/>
|
||||
<div id="interfaceLanguage" class="cp-os-bold" style="margin-bottom: 5px; margin-top: 5px;"></div>
|
||||
<input type="radio" name="lang" id="langen" value="en" style="visibility: hidden;"/>
|
||||
<label for="langen"><img src="im/co/uk.png"> En</label><br/>
|
||||
<input type="radio" name="lang" id="langru" value="ru" style="visibility: hidden;"/>
|
||||
<label for="langru"><img src="im/co/ru.png"> Ru</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
<div class="uk-grid" id="foot">
|
||||
<div class="uk-width-1-2 uk-text-left uk-text-small">
|
||||
<a href="https://proxy-chrome.com" target="_blank">support</a>
|
||||
|
||||
<a href="https://proxy-chrome.com" target="_blank">home page</a>
|
||||
</div>
|
||||
<div id="state-wrap" style="visibility: hidden;" class="uk-width-1-2 uk-text-right cp-os-condensed">
|
||||
<b>Status: </b> <span id="state" class="cp-os-condensed"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
Blue Ribbon Icon: http://www.iconsdb.com/icon-sets/cardboard-blue-icons/ribbon-12-icon.html
|