summaryrefslogtreecommitdiffstats
path: root/src/proxy.html
blob: ed77bec100424b69ecd08b5dbf30482d7d6eece6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title data-i18n="add">FoxyProxy </title>
    <link rel="icon" type="image/png" href="/images/icon.svg">
    <link rel="stylesheet" href="styles/fontawesome-4.6.3.css">
    <link rel="stylesheet" href="styles/app.css">
    <style>
      .main > div:nth-child(1) { flex: 1;  margin-right: 1em; }
      .main > div:nth-child(2) { flex: 1; }
      input[type], select { margin-top: 0.3em; }
  
      .onOff > label:first-of-type { flex: 0; flex-grow: 1; margin: 0 1em 0.5em 0; }
      .onOff > div { flex: 0; }
      .na { margin-top: 1.5em; }
      .onOff, .pac, .na { display: none; }
      input[name="nav"] { display: none; }
      
      #http:checked ~ div .onOff:not(.dns),
      #https:checked ~ div .onOff:not(.dns),
      #socks4:checked ~ div .onOff:not(.dns) {
        display: flex;
      }
      #socks5:checked ~ div .onOff { display: flex; }
      
      #pac:checked ~ div .pac,
      #wpad:checked ~ div .pac {
        display: block;
      }
      #pac:checked ~ div div.na,
      #wpad:checked ~ div div.na,
      #system:checked ~ div div.na  {
        display: block;
      }
      
      #pac:checked ~ div .proxyData,
      #wpad:checked ~ div .proxyData,
      #system:checked ~ div .proxyData,
      #direct:checked ~ div div.proxyData,
      #pac:checked ~ div button:not(:first-of-type),
      #wpad:checked ~ div button:not(:first-of-type),
      #system:checked ~ div button:not(:first-of-type) {
        display: none;
      }

      #http:checked ~ div .patternShortcuts,
      #https:checked ~ div .patternShortcuts,
      #socks4:checked ~ div .patternShortcuts,
      #socks5:checked ~ div .patternShortcuts,
      #direct:checked ~ div .patternShortcuts {
        display: flex;
      }
      
      #pac:checked ~ div .patternShortcutsContainer,
      #wpad:checked ~ div .patternShortcutsContainer,
      #system:checked ~ div .patternShortcutsContainer {
        display: none;
      }
      
      #direct:checked ~ div .patternShortcutsContainer {
        display: block;
      }      
    </style>
  </head>
  <body>

    <!-- Navigation -->
    <input type="radio" name="nav" id="http">
    <input type="radio" name="nav" id="https" checked>
    <input type="radio" name="nav" id="socks5">
    <input type="radio" name="nav" id="socks4">
    <input type="radio" name="nav" id="direct">
    <input type="radio" name="nav" id="pac">
    <input type="radio" name="nav" id="wpad">
    <input type="radio" name="nav" id="system">

    <!-- header -->
    <div class="prime header" data-i18n="options"></div>


    <!-- main -->
    <div class="prime">  
      <div class="main flex">
  
        <!-- left column -->
        <div>
          <div>
            <label data-i18n="title"></label>
            <input id="proxyTitle" type="text" spellcheck="false" placeholder="title">
    
            <label data-i18n="color"></label>
            <input id="colorChooser" type="text" style="text-align: center;">
          </div>
  
          <!-- SOCKS5 -->
          <div class="flex onOff dns">
            <label>Send DNS through SOCKS5 proxy</label>
            <div>
              <input type="checkbox" class="switch" id="proxyDNS" checked><label for="proxyDNS"></label>
            </div>
          </div>

          <div class="patternShortcutsContainer notForBasic notForEdit">
            <label data-i18n="patternShortcuts" class="notForBasic notForEdit"></label>
            <div class="prime warning">
              <div class="patternShortcuts flex onOff">
                <label data-i18n="active"></label>
                <div>
                  <input type="checkbox" class="switch" id="proxyActive" checked><label for="proxyActive"></label>
                </div>
              </div>
      
              <div class="patternShortcuts onOff">
                <label><span data-i18n="addWhitelist"></span>
                <div class="tooltip"><i class="fa fa-info-circle"></i><span class="tooltiptext" data-i18n="addWhitelistTip"></span></div></label>
                <div>
                  <input type="checkbox" class="switch" id="whiteAll" checked><label for="whiteAll"></label>
                </div>
              </div>
      
              <div class="patternShortcuts onOff">
                <label><span data-i18n="noLocal"></span>
                <div class="tooltip"><i class="fa fa-info-circle"></i><span class="tooltiptext" data-i18n="addBlacklistTip"></span></div></label>
      
                <div>
                  <input type="checkbox" class="switch" id="blackAll"><label for="blackAll"></label>
                </div>
              </div>
            </div>
          </div>
        </div>
  
        <!-- right column -->
        <div>
          <div class="rightData">
          <label data-i18n="proxyType"></label>
          <select id="proxyType">
            <option value="1" selected>HTTP</option>
            <option value="2">HTTPS/SSL</option>
            <option value="3">SOCKS5</option>
            <option value="4">SOCKS4</option>
            <option value="6">PAC URL</option>
            <option value="7">WPAD</option>
            <option value="8">System (use system settings)</option>
            <option value="5">Direct (no proxy)</option>
          </select>


            <div class="proxyData">
              <label data-i18n="ip"></label> <i class="fa fa-star"></i>
              <input id="proxyAddress" type="text" spellcheck="false" placeholder="111.111.111.111, www.example.com">
  
              <label data-i18n="port"></label> <i class="fa fa-star"></i>
              <input id="proxyPort" type="text" placeholder="3128">
  
              <label data-i18n="username"></label>
              <input id="proxyUsername" type="text" spellcheck="false" placeholder="username">
  
              <label data-i18n="password"></label>
              <button type="button" class="plain" data-i18n="togglePW|title"><i class="fa fa-eye"></i></button>
              <input id="proxyPassword" type="password" spellcheck="false" placeholder="*****">
            </div>
          </div>

          <!-- PAC/WPAD -->
          <div class="pac">
            <label>URL</label> <i class="fa fa-star"></i>
            <input id="pacURL" type="text" placeholder="PAC URL">
          </div>

  
          <div class="prime alert small na">
            <h3>Not supported</h3>
            <p>Due to Firefox limitation, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1396485" target="_blank">PAC</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1319631" target="_blank">WPAD</a>, and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1319630"  target="_blank">System Settings</a> are currently not supported, but they are due to be added.</p>
          </div>
        </div>
      </div>

      <div style="text-align: right;">
        <button type="button" class="alert" data-i18n="cancel"></button>
        <button type="button" data-i18n="saveAdd"></button>
        <button type="button" class="notForBasic" data-i18n="saveEditPattern"></button>
        <button type="submit" data-i18n="save"></button>
      </div>      

  </div>

  <script src="scripts/jscolor-2.0.5.js"></script><!-- only used here -->
  <script src="scripts/utils.js"></script>
  <script src="scripts/proxy.js"></script>
  </body>
</html>