瀏覽代碼

Fix default behavior.

pull/24/head
Ben Kurtovic 12 年之前
父節點
當前提交
37cb1f568c
共有 2 個文件被更改,包括 7 次插入10 次删除
  1. +1
    -1
      pages/settings.mako
  2. +6
    -9
      pages/support/header.mako

+ 1
- 1
pages/settings.mako 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存