1// LICENSE_CODE ZON 2'use strict'; /*jslint browser:true, node:true*/ 3(function(){ 4var define; 5var is_node = typeof module=='object' && module.exports; 6if (!is_node) 7 define = self.define; 8else 9 define = require('../../../util/require_node.js').define(module, '../'); 10define(['/util/country.js', 'jquery', '/util/etask.js'], 11 function(country, $, etask){ 12var E = {psk: '12345678'}; 13 14var top_countries = ['us', 'uk', 'ca']; 15 16E.ensure_vpn_info = function(force_new_password){ 17 var backend_url = '/users/ensure_vpn_info'; 18 return force_new_password ? 19 $.post(backend_url, {force_new_password: true}) : $.get(backend_url); 20}; 21 22E.get_countries_options = etask.fn([function(){ 23 return $.get('/users/get_vpn_countries'); 24}, function(countries){ 25 var reverse = {}, labels = [], options = [], i; 26 for (i = 0; i<countries.length; i++) 27 { 28 var label = country.list[countries[i].toUpperCase()]; 29 reverse[label] = countries[i]; 30 labels.push(label); 31 } 32 labels.sort(); 33 for (i = 0; i<top_countries.length; i++) 34 { 35 if (countries.indexOf(top_countries[i])!=-1) 36 { 37 options.push({val: top_countries[i], top: true, 38 text: country.list[top_countries[i].toUpperCase()]}); 39 } 40 } 41 options.push({disabled: true, role: 'separator', 42 text: '\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014'}); 43 for (i = 0; i<labels.length; i++) 44 options.push({val: reverse[labels[i]], text: labels[i]}); 45 return options; 46}]); 47 48E.is_premium_dns_used = etask.fn([function(){ 49 return $.get('//dnscheck.hola.org/check.txt'); 50}, function catch$(e){}]); 51 52E.get_mac_profile_url = function(p){ 53 var proto = {l2tp: 'L2TP', pptp: 'PPTP', ikev2: 'IKEv2'}[p]||'IKEv2'; 54 return '/users/download_apple_profile?protocol='+proto; 55}; 56 57return E; }); })();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.