Skip to content

Commit

Permalink
Merge pull request #5 from ouraios/dev
Browse files Browse the repository at this point in the history
Optimization at startup
  • Loading branch information
ouraios authored Sep 2, 2018
2 parents 890e562 + d1f2fd2 commit f971550
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
5 changes: 2 additions & 3 deletions js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ AGO.Styles = {
window.setTimeout(AGO.Styles.preload, 5)));
},
Init: function() {
},
Load: function(a) {
var a;
a = document.createDocumentFragment();
AGO.Styles.Sheet = DOM.append(a, "style", {
Expand All @@ -267,7 +265,8 @@ AGO.Styles = {
DOM.extendClass(document.body, null, "ago_improve")),
AGO.Styles.set(AGO.Styles.Data.Styles));
document.head.appendChild(a);

},
Load: function(a) {
AGO.App.Ogame &&
(1 !== AGO.Styles.status || AGO.App.reload || a) &&
(AGB.Log("Update - Styles :", !0),
Expand Down
22 changes: 10 additions & 12 deletions js/galaxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ AGO.Galaxy = {
: "sendShips" === a && AGO.Galaxy.sendShips(b);
},
Run: function() {
AGO.Option.is("G40") &&
!AGO.App.OgameMobile &&
((AGO.Galaxy.enabled = !0),
(AGO.Galaxy.improve = AGO.Option.is("G41")),
(AGO.Galaxy.shrink = AGO.Option.get("G42", 2)),
(AGO.Galaxy.status = 5),
AGO.Galaxy.Show(),
document.getElementById("galaxytable") && AGO.Galaxy.Content());
if(AGO.Option.is("G40") && !AGO.App.OgameMobile){
AGO.Galaxy.enabled = !0;
AGO.Galaxy.improve = AGO.Option.is("G41");
AGO.Galaxy.shrink = AGO.Option.get("G42", 2);
AGO.Galaxy.status = 5;
AGO.Galaxy.Show();
document.querySelector("#galaxytable");
AGO.Galaxy.Content();
}

},
onKeydown: function(a) {
if (13 === a.keyCode && !a.cached)
Expand Down Expand Up @@ -78,7 +80,6 @@ AGO.Galaxy = {
});
},
Content: function() {
console.log('galaxy content');
var galaxyTable, galaxyNb, systemNb, h;
galaxyTable = document.getElementById("galaxytable");
AGO.Galaxy.status = 5;
Expand Down Expand Up @@ -136,7 +137,6 @@ AGO.Galaxy = {
AGO.Init.Messages("Panel", "updateTab", {
tab: "Flights"
}));
console.log('galaxy improve');
if (AGO.Galaxy.improve)
function improveGalaxy(galaxyNb, head){
if(head) {
Expand Down Expand Up @@ -706,7 +706,6 @@ AGO.Galaxy = {
return 0;
},
Action: function(a) {
console.log('galaxy action');
var b, d, h, e;
b = AGO.Galaxy.Data;
AGO.Galaxy.status &&
Expand Down Expand Up @@ -746,7 +745,6 @@ AGO.Galaxy = {
})));
},
click: function(a) {
console.log('galaxy click');
var b;
a &&
a.target &&
Expand Down
9 changes: 6 additions & 3 deletions js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,11 @@ AGO.Observer = {
function b(a) {
var b;
OBJ.iterate(a, function(e) {
"BODY" === a[e].target.nodeName && (b = !0);
"HTML" === a[e].target.nodeName &&
a[e].addedNodes.length &&
"BODY" === a[e].addedNodes[0].nodeName &&
a[e].addedNodes[0].childNodes.length &&
(b = !0)
});
b && AGO.Observer.Call(AGO.Observer.head);
}
Expand Down Expand Up @@ -1132,5 +1136,4 @@ AGO.Data = {
a && (window.localStorage[a] = "");
}
};
// window.top === window.self && AGO.Init.Start();
document.addEventListener('DOMContentLoaded', function(){AGO.Init.Start()}, false);
window.top === window.self && AGO.Init.Start();
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"name": "AntiGameReloaded",
"permissions": [ "unlimitedStorage", "storage", "tabs", "https://*/*" ],
"short_name": "AGR",
"version": "0.9.3",
"version": "0.9.5",
"web_accessible_resources": [ "js/*.js", "skin/*", "loca/*.json" ]
}
2 changes: 1 addition & 1 deletion skin/ago/pages.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f971550

Please sign in to comment.