Skip to content

Commit

Permalink
Merge pull request #2 from LetheanMovement/develop
Browse files Browse the repository at this point in the history
added loading screen #1 and dynamic interval checking if extension is online
  • Loading branch information
valiant1x authored Oct 1, 2018
2 parents c88db6e + 949a638 commit dee7cfb
Show file tree
Hide file tree
Showing 7 changed files with 354 additions and 42 deletions.
Binary file added images/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions js/sendControll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $(document).ready(function() {
var defaultHost = "localhost";
var defaultPort = "8180";

var defaultStats = "[not available]";

if (window.localStorage['proxyConfig'] == undefined || window.localStorage['proxyConfig'][20] == "s") {
console.log("Local Storage does not exist");
$("#system").attr("hidden", "hidden");
Expand All @@ -25,6 +27,23 @@ $(document).ready(function() {
localStorage.setItem('proxyPort', defaultPort);
}

// set default connection stats values in storage
if (localStorage.getItem('stats_provider') == null) {
localStorage.setItem('stats_provider', defaultStats);
}
if (localStorage.getItem('stats_service') == null) {
localStorage.setItem('stats_service', defaultStats);
}
if (localStorage.getItem('stats_time') == null) {
localStorage.setItem('stats_time', 0);
}
if (localStorage.getItem('stats_ip') == null) {
localStorage.setItem('stats_ip', defaultStats);
}
if (localStorage.getItem('stats_transfer') == null) {
localStorage.setItem('stats_transfer', defaultStats);
}

// load form fields with values from storage
document.getElementById('proxyHostHttp').value = localStorage.getItem('proxyHost');
document.getElementById('proxyPortHttp').value = localStorage.getItem('proxyPort');
Expand Down Expand Up @@ -64,13 +83,20 @@ $(document).ready(function() {

// connect click
$('input[id=proxyTypeManual]').click(function() {

// show loading screen
$("#loadingScreen").show();

console.log("Connect Clicked");

$("#fixed_servers").attr("hidden", "hidden");
$("#system").removeAttr("hidden");
$("#settingsConfig").attr("hidden", "hidden");
$("#dataValue").removeAttr("hidden");
$("#imgError").attr("hidden", "hidden");

// reset the timer check to its default value when connecting or reconnecting
resetOnlineTimerCheck();
});


Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Lethean Proxy/VPN Extension",
"version": "1.0.4",
"version": "3.0.0",
"description": "Your gateway to the Lethean Proxy/VPN network, a secure and anonymous platform where users sell their bandwidth for cryptocurrency.",
"default_locale": "en",
"browser_action": {
Expand All @@ -22,7 +22,7 @@
},
"permissions": [
"proxy",
"https://geoip.nekudo.com/api/"
"<all_urls>"
],
"manifest_version": 2
}
23 changes: 23 additions & 0 deletions popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,26 @@ section legend {
.nonDisplay{
display: none;
}


/* loading screen */
#loadingScreen {
position: absolute;

z-index: 9999;
height: 100%;
width: 100%;
left: 0;
top: 0;
background-color: #000000;
color: #FFFFFF;
text-align: center;
padding-top: 40px;
display: none;
}

#loadingScreen img {
display: block;
margin: auto;
margin-top: 50px;
}
6 changes: 6 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<body style='height:250px;'>
<img id="settingsConfig" src="images/settings.png" style="width: 20px; height: 20px; position: absolute; margin-top: -1px; margin-left: 127px;" />
<h1 style='padding-left: 10px;'>LETHEAN VPN</h1>


<div id='loadingScreen'>
<p>Please wait while<br>establishing connection...</p>
<img src='images/loader.gif'>
</div>

<div role="main">
<form id="proxyForm" name="proxyForm">
Expand Down
17 changes: 10 additions & 7 deletions proxy_error_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ ProxyErrorHandler.prototype = {
this.lastError_ = JSON.stringify(details);

function transferComplete(){
document.getElementById('proxyFail').setAttribute('hidden', 'hidden');
var GREEN = [124, 252, 0, 255];
chrome.browserAction.setBadgeText({text: 'o'});
chrome.browserAction.setBadgeBackgroundColor({color: GREEN});
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('connectedPopupTitle')
});
if(document.getElementById('proxyFail') !== null){
document.getElementById('proxyFail').setAttribute('hidden', 'hidden');
var GREEN = [124, 252, 0, 255];
chrome.browserAction.setBadgeText({text: 'o'});
chrome.browserAction.setBadgeBackgroundColor({color: GREEN});
chrome.browserAction.setTitle({
title: chrome.i18n.getMessage('connectedPopupTitle')
});
}

}
},

Expand Down
Loading

0 comments on commit dee7cfb

Please sign in to comment.