Browse Source

Webapp icons

pull/5421/head
Ruud 10 years ago
parent
commit
46867a97ba
  1. 4
      couchpotato/__init__.py
  2. BIN
      couchpotato/static/images/favicon.ico
  3. BIN
      couchpotato/static/images/homescreen.png
  4. BIN
      couchpotato/static/images/icons/android.png
  5. BIN
      couchpotato/static/images/icons/dark/android.png
  6. BIN
      couchpotato/static/images/icons/dark/favicon.ico
  7. BIN
      couchpotato/static/images/icons/dark/ios.png
  8. BIN
      couchpotato/static/images/icons/favicon.ico
  9. BIN
      couchpotato/static/images/icons/ios.png
  10. BIN
      couchpotato/static/images/icons/windows.png
  11. 11
      couchpotato/static/scripts/combined.base.min.js
  12. 14
      couchpotato/static/scripts/couchpotato.js
  13. 30
      couchpotato/templates/index.html

4
couchpotato/__init__.py

@ -77,8 +77,10 @@ def manifest(handler):
lines = [ lines = [
'CACHE MANIFEST', 'CACHE MANIFEST',
'# %s theme' % ('dark' if Env.setting('dark_theme') else 'light'),
'', '',
'CACHE:' 'CACHE:',
''
] ]
if not Env.get('dev'): if not Env.get('dev'):

BIN
couchpotato/static/images/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
couchpotato/static/images/homescreen.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

BIN
couchpotato/static/images/icons/android.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
couchpotato/static/images/icons/dark/android.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
couchpotato/static/images/icons/dark/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
couchpotato/static/images/icons/dark/ios.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
couchpotato/static/images/icons/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
couchpotato/static/images/icons/ios.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
couchpotato/static/images/icons/windows.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

11
couchpotato/static/scripts/combined.base.min.js

@ -187,6 +187,17 @@ var CouchPotato = new Class({
} }
window.addEvent("resize", self.resize.bind(self)); window.addEvent("resize", self.resize.bind(self));
self.resize(); self.resize();
self.checkCache();
},
checkCache: function() {
window.addEventListener("load", function() {
window.applicationCache.addEventListener("updateready", function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
window.applicationCache.swapCache();
window.location.reload();
}
}, false);
}, false);
}, },
resize: function() { resize: function() {
var self = this; var self = this;

14
couchpotato/static/scripts/couchpotato.js

@ -46,6 +46,20 @@
window.addEvent('resize', self.resize.bind(self)); window.addEvent('resize', self.resize.bind(self));
self.resize(); self.resize();
self.checkCache();
},
checkCache: function(){
window.addEventListener('load', function() {
window.applicationCache.addEventListener('updateready', function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
window.applicationCache.swapCache();
window.location.reload();
}
}, false);
}, false);
}, },
resize: function(){ resize: function(){

30
couchpotato/templates/index.html

@ -1,18 +1,32 @@
{% autoescape None %} {% autoescape None %}
<!doctype html> <!doctype html>
<html class="{{ 'dark' if Env.setting('dark_theme') else '' }}" manifest="{{ Env.get('web_base') }}couchpotato.appcache"> <html class="{{ 'dark' if Env.setting('dark_theme') else '' }}" manifest="{{ Env.get('web_base') }}couchpotato.appcache?{{ 'dark' if Env.setting('dark_theme') else 'light' }}">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <title>CouchPotato</title>
<meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="msapplication-tap-highlight" content="no" /> <meta name="msapplication-tap-highlight" content="no" />
<link href="{{ Env.get('static_path') }}images/favicon.ico" rel="icon" type="image/x-icon" /> {% set icon_path = Env.get('static_path') + 'images/icons/' %}
<link rel="apple-touch-icon" href="{{ Env.get('static_path') }}images/homescreen.png" /> {% set themed_icon_path = icon_path + ('dark/' if Env.setting('dark_theme') else '') %}
<!-- IOS -->
<link rel="apple-touch-icon-precomposed" href="{{ themed_icon_path }}ios.png" />
<!-- Android -->
<link rel="icon" type="image/png" href="{{ themed_icon_path }}android.png" sizes="192x192">
<!-- Windows 8 -->
<meta name="msapplication-TileColor" content="{{ '#f85c22' if Env.setting('dark_theme') else '#ac0000' }}">
<meta name="msapplication-TileImage" content="{{ icon_path }}windows.png">
<meta name="msapplication-square70x70logo" content="{{ icon_path }}windows.png">
<meta name="msapplication-square150x150logo" content="{{ icon_path }}windows.png">
<meta name="msapplication-square310x310logo" content="{{ icon_path }}windows.png">
<link href="{{ icon_path }}favicon.ico" rel="icon" type="image/x-icon" />
{% for url in fireEvent('clientscript.get_styles', single = True) %}
<link data-url="{{ url }}" rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
{% for url in fireEvent('clientscript.get_scripts', single = True) %} {% for url in fireEvent('clientscript.get_scripts', single = True) %}
<script type="text/javascript" src="{{ Env.get('web_base') }}{{ url }}"></script>{% end %} <script type="text/javascript" src="{{ Env.get('web_base') }}{{ url }}"></script>{% end %}
@ -81,7 +95,9 @@
{% end %} {% end %}
</script> </script>
<title>CouchPotato</title>
{% for url in fireEvent('clientscript.get_styles', single = True) %}
<link data-url="{{ url }}" rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
</head> </head>
<body></body> <body></body>
</html> </html>

Loading…
Cancel
Save