Browse Source

Fix default behavior.

pull/24/head
Ben Kurtovic 12 years ago
parent
commit
37cb1f568c
2 changed files with 7 additions and 10 deletions
  1. +1
    -1
      pages/settings.mako
  2. +6
    -9
      pages/support/header.mako

+ 1
- 1
pages/settings.mako View File

@@ -47,7 +47,7 @@
("potd", 'Use the current <a href="//commons.wikimedia.org/">Wikimedia Commons</a> <a href="//commons.wikimedia.org/wiki/Commons:Picture_of_the_day">Picture of the Day</a>, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter (generally portraits do not work well).'),
("list", 'Randomly select from <a href="http://commons.wikimedia.org/wiki/User:The_Earwig/POTD">a subset of previous Commons Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily (default).'),
]
selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else None
selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else "list"
%>
% for i, (value, desc) in enumerate(background_options):
<tr>


+ 6
- 9
pages/support/header.mako View File

@@ -28,16 +28,13 @@
<script src="${root}/static/js/${filename}" type="text/javascript"></script>
% endfor
</head>
% if "EarwigBackground" in cookies:
% if cookies["EarwigBackground"].value == "list":
<body onload="set_background_list()">
% elif cookies["EarwigBackground"].value in ["plain-brown", "plain-blue"]:
<body style="background-image: url('${root}/static/images/background-${cookies['EarwigBackground'].value[6:]}.png');">
% else:
<body onload="set_background_potd()">
% endif
% else:
<% selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else "list" %>\
% if selected in ["plain-brown", "plain-blue"]:
<body style="background-image: url('${root}/static/images/background-${selected[6:]}.png');">
% elif selected == "potd":
<body onload="set_background_potd()">
% else:
<body onload="set_background_list()">
% endif
<div id="header">
<p id="heading"><a class="dark" href="${pretty}">earwig</a><span class="light">@</span><a class="mid" href="https://wiki.toolserver.org/">toolserver</a><span class="light">:</span><a class="dark" href="${this}">${slug}</a></p>


Loading…
Cancel
Save