Skip to content

Commit

Permalink
Redesign done.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaurdan committed Nov 25, 2015
1 parent 1f9ba01 commit 1709e4d
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 10 deletions.
11 changes: 8 additions & 3 deletions Google Chrome/ahoy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ var Ahoy = function() {
/**
* CONFIGS
*/
//this.api_url = "http://46.101.64.62";
this.api_url = "http://ahoy.app:8000";
this.api_url = "http://46.101.64.62";
//this.api_url = "http://ahoy.app:8000";

/**
* DEFAULTS
Expand Down Expand Up @@ -210,6 +210,11 @@ Ahoy.prototype.after_update = function( details ) {
// Make sure the plugins fetch for new information when it's installed/updated
this.update_site_list();
this.update_proxy();
console.log(details);
if( (details.reason === "update" && details.previousVersion !== chrome.app.getDetails().version) || details.reason === "install" ) {
chrome.tabs.create({'url': chrome.extension.getURL('views/release_notes.html'), 'selected': true});
}

};


Expand Down Expand Up @@ -280,7 +285,7 @@ Ahoy.prototype.event_sites_updated = function( e ) {

// Update the local storage
chrome.storage.sync.set( { "sites_list": e.detail.sites } );

this.sites_list = e.detail.sites;

// Setup the callback filters
Expand Down
Binary file modified Google Chrome/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Google Chrome/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Google Chrome/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Google Chrome/img/cravo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Google Chrome/img/cravo_curto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 15 additions & 6 deletions Google Chrome/views/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@

<body>
<script src="jquery-1.11.3.min.js"></script>
<script src="ahoy.js"></script>
<script src="popup.js"></script>
<script>
</script>

<h1>Ahoy!</h1>
<div class="info">A utilizar o proxy <span id="proxyaddr">xxx.xxx.xxx.xxx</span></div>
<header>
<h1>Ahoy!</h1>
</header>
<div class="info">Ligado a <span id="proxyaddr">xxx.xxx.xxx.xxx</span></div>
<div class="waiting" ><img src="wait.gif"></img></div>
<div class="links">
<a href="#" id="forcarProxy">Forçar Novo Proxy</a>
<a href="#" id="listaSites">Actualizar Lista de Sites</a>
<div class="buttons">
<button id="forcarProxy">Forçar Novo Proxy</button>
<button id="listaSites">Actualizar Lista de Sites</button>
<input type="hidden" autofocus />
</div>

<footer>
<div>Feito com ♥ em Portugal <span id="ahoy-version">v1.0</span></div>
<div><a href="">#RevoluçãoDosBytes</a></div>
</footer>
</body>
</html>
53 changes: 53 additions & 0 deletions Google Chrome/views/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
$(document).ready( function() {

$('#ahoy-version').text("v" + chrome.app.getDetails().version);

chrome.storage.sync.get( [ "proxy_addr" ], function( result) {
$("#proxyaddr").text( result.proxy_addr );
} )


$("#forcarProxy").click( function() {
if($(this).attr('disabled')) { // HERE
return false;
};

chrome.extension.getBackgroundPage().ahoy.update_proxy( true );
$(this).attr('disabled', "");

$(".info").hide();
$(".waiting").show();

setTimeout( function() {

$("#proxyaddr").text( chrome.extension.getBackgroundPage().ahoy.proxy_addr );
$("#forcarProxy").attr('disabled', false);

$(".info").show();
$(".waiting").hide();

}, 2000 );

});

$("#listaSites").click( function() {
if($(this).attr('disabled')) { // HERE
return false;
};

chrome.extension.getBackgroundPage().ahoy.update_site_list();
$(this).attr('disabled', "");

$(".waiting").show();

setTimeout( function() {

$("#listaSites").attr('disabled', false);

$(".waiting").hide();

}, 1000 );

});

});
1 change: 1 addition & 0 deletions Google Chrome/views/release_notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Changelog</h1>
66 changes: 65 additions & 1 deletion Google Chrome/views/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@ body {
font-family: Arial;
text-align: center;
width: 300px;
min-height: 300px;
background: url("../img/cravo_curto.png") no-repeat;
background-position: right bottom;
background-size: 100px;
margin: 0px;
}

header {
background: #219d55;
color: white;
padding: 10px;
}

header h1 {
margin: 0;
padding 0;
}

h1 {
font-size: 20px;
Expand All @@ -12,7 +27,42 @@ h1 {
}

.info {
margin: 10px;
margin: 15px 0;
font-weight: bold;
text-transform: uppercase;
font-size: 15px;
}

.buttons button {
-moz-outline:0 none;
outline:0 none;
display: block;
margin: 5px auto;
}

.buttons button {
position: relative;
vertical-align: top;
width: 200px;
height: 30px;
padding: 0;
font-size: 15px;
color: white;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
background: #27ae60;
border: 0;
border-bottom: 2px solid #219d55;
cursor: pointer;
-webkit-box-shadow: inset 0 -2px #219d55;
box-shadow: inset 0 -2px #219d55;
}

.buttons button:active {
top: 1px;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
}

.waiting { display: none; margin: 10px; }
Expand All @@ -30,4 +80,18 @@ h1 {

a:visited {
color: blue;
}

footer {
position: absolute;
bottom: 5px;
color: gray;
width: 100%;
font-size: 10px;
}

footer a {
text-decoration: none;
color: gray !important;
font-weight: bold;
}

0 comments on commit 1709e4d

Please sign in to comment.