Skip to content

Commit f971550

Browse files
authored
Merge pull request #5 from ouraios/dev
Optimization at startup
2 parents 890e562 + d1f2fd2 commit f971550

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

js/common.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ AGO.Styles = {
252252
window.setTimeout(AGO.Styles.preload, 5)));
253253
},
254254
Init: function() {
255-
},
256-
Load: function(a) {
257255
var a;
258256
a = document.createDocumentFragment();
259257
AGO.Styles.Sheet = DOM.append(a, "style", {
@@ -267,7 +265,8 @@ AGO.Styles = {
267265
DOM.extendClass(document.body, null, "ago_improve")),
268266
AGO.Styles.set(AGO.Styles.Data.Styles));
269267
document.head.appendChild(a);
270-
268+
},
269+
Load: function(a) {
271270
AGO.App.Ogame &&
272271
(1 !== AGO.Styles.status || AGO.App.reload || a) &&
273272
(AGB.Log("Update - Styles :", !0),

js/galaxy.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ AGO.Galaxy = {
1313
: "sendShips" === a && AGO.Galaxy.sendShips(b);
1414
},
1515
Run: function() {
16-
AGO.Option.is("G40") &&
17-
!AGO.App.OgameMobile &&
18-
((AGO.Galaxy.enabled = !0),
19-
(AGO.Galaxy.improve = AGO.Option.is("G41")),
20-
(AGO.Galaxy.shrink = AGO.Option.get("G42", 2)),
21-
(AGO.Galaxy.status = 5),
22-
AGO.Galaxy.Show(),
23-
document.getElementById("galaxytable") && AGO.Galaxy.Content());
16+
if(AGO.Option.is("G40") && !AGO.App.OgameMobile){
17+
AGO.Galaxy.enabled = !0;
18+
AGO.Galaxy.improve = AGO.Option.is("G41");
19+
AGO.Galaxy.shrink = AGO.Option.get("G42", 2);
20+
AGO.Galaxy.status = 5;
21+
AGO.Galaxy.Show();
22+
document.querySelector("#galaxytable");
23+
AGO.Galaxy.Content();
24+
}
25+
2426
},
2527
onKeydown: function(a) {
2628
if (13 === a.keyCode && !a.cached)
@@ -78,7 +80,6 @@ AGO.Galaxy = {
7880
});
7981
},
8082
Content: function() {
81-
console.log('galaxy content');
8283
var galaxyTable, galaxyNb, systemNb, h;
8384
galaxyTable = document.getElementById("galaxytable");
8485
AGO.Galaxy.status = 5;
@@ -136,7 +137,6 @@ AGO.Galaxy = {
136137
AGO.Init.Messages("Panel", "updateTab", {
137138
tab: "Flights"
138139
}));
139-
console.log('galaxy improve');
140140
if (AGO.Galaxy.improve)
141141
function improveGalaxy(galaxyNb, head){
142142
if(head) {
@@ -706,7 +706,6 @@ AGO.Galaxy = {
706706
return 0;
707707
},
708708
Action: function(a) {
709-
console.log('galaxy action');
710709
var b, d, h, e;
711710
b = AGO.Galaxy.Data;
712711
AGO.Galaxy.status &&
@@ -746,7 +745,6 @@ AGO.Galaxy = {
746745
})));
747746
},
748747
click: function(a) {
749-
console.log('galaxy click');
750748
var b;
751749
a &&
752750
a.target &&

js/init.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,11 @@ AGO.Observer = {
641641
function b(a) {
642642
var b;
643643
OBJ.iterate(a, function(e) {
644-
"BODY" === a[e].target.nodeName && (b = !0);
644+
"HTML" === a[e].target.nodeName &&
645+
a[e].addedNodes.length &&
646+
"BODY" === a[e].addedNodes[0].nodeName &&
647+
a[e].addedNodes[0].childNodes.length &&
648+
(b = !0)
645649
});
646650
b && AGO.Observer.Call(AGO.Observer.head);
647651
}
@@ -1132,5 +1136,4 @@ AGO.Data = {
11321136
a && (window.localStorage[a] = "");
11331137
}
11341138
};
1135-
// window.top === window.self && AGO.Init.Start();
1136-
document.addEventListener('DOMContentLoaded', function(){AGO.Init.Start()}, false);
1139+
window.top === window.self && AGO.Init.Start();

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"name": "AntiGameReloaded",
2929
"permissions": [ "unlimitedStorage", "storage", "tabs", "https://*/*" ],
3030
"short_name": "AGR",
31-
"version": "0.9.3",
31+
"version": "0.9.5",
3232
"web_accessible_resources": [ "js/*.js", "skin/*", "loca/*.json" ]
3333
}

skin/ago/pages.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)