Skip to content

Commit

Permalink
Tweak script load order; change favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
huzecong committed Jun 25, 2018
1 parent 4d0ff26 commit 29ea39c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion application/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def route_index():
return render_template('index.html', static_version=GIT_COMMIT_HASH, debug=app.config['DEBUG'])

@app.route('/favicon.ico')
@app.route('/favicon')
def route_favicon():
directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static/favicon')
return send_from_directory(directory, 'favicon.png')
Expand Down
42 changes: 21 additions & 21 deletions application/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -916,31 +916,31 @@ App.controller('AppCtrl', ['$scope', '$http', '$mdToast', '$mdMenu', '$timeout',

// Load data

$http.get('/static/scripts/achievements.js?' + _jsVersion).then(function (response) {
let currentScript = response.data;
achievementsList = eval(currentScript);

for (let idx = 0; idx < achievementsList.length; ++idx)
achievementMap[achievementsList[idx].name] = idx;
if (storage.getItem("_achievements") === null)
storage.setItem("_achievements", "0".repeat(achievementsList.length));
});

$http.get('/static/scripts/ending.js?' + _jsVersion).then(function (response) {
let currentScript = response.data;
endingsList = eval(currentScript);

for (let ending of endingsList) {
endingMap[ending.name] = ending;
if (ending.image)
cacheImage(ending.image);
}
});

initialize();
loadScriptFromUrl('/static/scripts/merged_script.js?' + _jsVersion, function () {
// let mainMenuEvent =
// $scope.events.unshift(mainMenuEvent);
$scope.loadMainMenu(false);

$http.get('/static/scripts/achievements.js?' + _jsVersion).then(function (response) {
let currentScript = response.data;
achievementsList = eval(currentScript);

for (let idx = 0; idx < achievementsList.length; ++idx)
achievementMap[achievementsList[idx].name] = idx;
if (storage.getItem("_achievements") === null)
storage.setItem("_achievements", "0".repeat(achievementsList.length));
});

$http.get('/static/scripts/ending.js?' + _jsVersion).then(function (response) {
let currentScript = response.data;
endingsList = eval(currentScript);

for (let ending of endingsList) {
endingMap[ending.name] = ending;
if (ending.image)
cacheImage(ending.image);
}
});
});
}]);
1 change: 1 addition & 0 deletions application/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="icon" type="image/png" href="/favicon" />

<link rel="stylesheet" href="/static/app.css?version={- static_version -}">
{% if debug %}
Expand Down

0 comments on commit 29ea39c

Please sign in to comment.