Browse Source

HTML5

pull/24/head
Ben Kurtovic 11 years ago
parent
commit
de87631cf5
6 changed files with 21 additions and 30 deletions
  1. +1
    -1
      copyvios/settings.py
  2. +9
    -9
      pages/index.mako
  3. +6
    -6
      pages/settings.mako
  4. +1
    -1
      pages/support/footer.mako
  5. +3
    -3
      pages/support/header.mako
  6. +1
    -10
      static/style.css

+ 1
- 1
copyvios/settings.py View File

@@ -45,7 +45,7 @@ def _do_set(query, headers, cookies):
def _do_delete(query, headers, cookies): def _do_delete(query, headers, cookies):
if query.cookie in cookies: if query.cookie in cookies:
delete_cookie(headers, cookies, query.cookie.encode("utf8")) delete_cookie(headers, cookies, query.cookie.encode("utf8"))
template = u"Deleted cookie <b><tt>{0}</tt></b>."
template = u"Deleted cookie <b><span class="mono">{0}</span></b>."
return template.format(escape(query.cookie)) return template.format(escape(query.cookie))
elif query.all: elif query.all:
number = len(cookies) number = len(cookies)


+ 9
- 9
pages/index.mako View File

@@ -4,7 +4,7 @@
<% query, bot, all_langs, all_projects, page, result = main(environ) %>\ <% query, bot, all_langs, all_projects, page, result = main(environ) %>\
% if query.project and query.lang and query.title and not page: % if query.project and query.lang and query.title and not page:
<div class="red-box"> <div class="red-box">
<p>The given site (project=<b><tt>${query.project | h}</tt></b>, language=<b><tt>${query.lang | h}</tt></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang | h}.${query.project | h}.org/">Confirm its URL.</a></p>
<p>The given site (project=<b><span class="mono">${query.project | h}</span></b>, language=<b><span class="mono">${query.lang | h}</span></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang | h}.${query.project | h}.org/">Confirm its URL.</a></p>
</div> </div>
% elif query.project and query.lang and query.title and page and not result: % elif query.project and query.lang and query.title and page and not result:
<div class="red-box"> <div class="red-box">
@@ -23,7 +23,7 @@
<tr> <tr>
<td>Site:</td> <td>Site:</td>
<td> <td>
<tt>http://</tt>
<span class="mono">http://</span>
<select name="lang"> <select name="lang">
<% selected_lang = query.orig_lang if query.orig_lang else cookies["CopyviosDefaultLang"].value if "CopyviosDefaultLang" in cookies else bot.wiki.get_site().lang %>\ <% selected_lang = query.orig_lang if query.orig_lang else cookies["CopyviosDefaultLang"].value if "CopyviosDefaultLang" in cookies else bot.wiki.get_site().lang %>\
% for code, name in all_langs: % for code, name in all_langs:
@@ -34,7 +34,7 @@
% endif % endif
% endfor % endfor
</select> </select>
<tt>.</tt>
<span class="mono">.</span>
<select name="project"> <select name="project">
<% selected_project = query.project if query.project else cookies["CopyviosDefaultProject"].value if "CopyviosDefaultProject" in cookies else bot.wiki.get_site().project %>\ <% selected_project = query.project if query.project else cookies["CopyviosDefaultProject"].value if "CopyviosDefaultProject" in cookies else bot.wiki.get_site().project %>\
% for code, name in all_projects: % for code, name in all_projects:
@@ -45,7 +45,7 @@
% endif % endif
% endfor % endfor
</select> </select>
<tt>.org</tt>
<span class="mono">.org</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -97,13 +97,13 @@
<li>No matches found.</li> <li>No matches found.</li>
% endif % endif
% endif % endif
<li><b><tt>${round(result.confidence * 100, 1)}%</tt></b> confidence of a violation.</li>
<li><b><span class="mono">${round(result.confidence * 100, 1)}%</span></b> confidence of a violation.</li>
% if result.cached: % if result.cached:
<li>Results are <a id="cv-cached" href="#">cached <li>Results are <a id="cv-cached" href="#">cached
<span>To save time (and money), this tool will retain the results of checks for up to 72 hours. This includes the URL of the "violated" source, but neither its content nor the content of the article. Future checks on the same page (assuming it remains unchanged) will not involve additional search queries, but a fresh comparison against the source URL will be made. If the page is modified, a new check will be run.</span> <span>To save time (and money), this tool will retain the results of checks for up to 72 hours. This includes the URL of the "violated" source, but neither its content nor the content of the article. Future checks on the same page (assuming it remains unchanged) will not involve additional search queries, but a fresh comparison against the source URL will be made. If the page is modified, a new check will be run.</span>
</a> from ${result.cache_time} (${result.cache_age} ago). <a href="${environ['REQUEST_URI'] | h}&amp;nocache=1">Bypass the cache.</a></li> </a> from ${result.cache_time} (${result.cache_age} ago). <a href="${environ['REQUEST_URI'] | h}&amp;nocache=1">Bypass the cache.</a></li>
% else: % else:
<li>Results generated in <tt>${round(result.time, 3)}</tt> seconds using <tt>${result.queries}</tt> queries.</li>
<li>Results generated in <span class="mono">${round(result.time, 3)}</span> seconds using <span class="mono">${result.queries}</span> queries.</li>
% endif % endif
% if "CopyviosShowDetails" in cookies and cookies["CopyviosShowDetails"].value == "True": % if "CopyviosShowDetails" in cookies and cookies["CopyviosShowDetails"].value == "True":
<li><a id="cv-result-detail-link" href="#cv-result-detail" onclick="copyvio_toggle_details()">Hide details:</a></li> <li><a id="cv-result-detail-link" href="#cv-result-detail" onclick="copyvio_toggle_details()">Hide details:</a></li>
@@ -117,12 +117,12 @@
<div id="cv-result-detail" style="display: none;"> <div id="cv-result-detail" style="display: none;">
% endif % endif
<ul id="cv-result-detail-list"> <ul id="cv-result-detail-list">
<li>Trigrams: <i>Article:</i> <tt>${result.article_chain.size()}</tt> / <i>Source:</i> <tt>${result.source_chain.size()}</tt> / <i>Delta:</i> <tt>${result.delta_chain.size()}</tt></li>
<li>Trigrams: <i>Article:</i> <span class="mono">${result.article_chain.size()}</span> / <i>Source:</i> <span class="mono">${result.source_chain.size()}</span> / <i>Delta:</i> <span class="mono">${result.delta_chain.size()}</span></li>
% if result.cached: % if result.cached:
% if result.queries: % if result.queries:
<li>Retrieved from cache in <tt>${round(result.time, 3)}</tt> seconds (originally generated in <tt>${round(result.original_time, 3)}</tt>s using <tt>${result.queries}</tt> queries; <tt>${round(result.original_time - result.time, 3)}</tt>s saved).</li>
<li>Retrieved from cache in <span class="mono">${round(result.time, 3)}</span> seconds (originally generated in <span class="mono">${round(result.original_time, 3)}</span>s using <span class="mono">${result.queries}</span> queries; <span class="mono">${round(result.original_time - result.time, 3)}</span>s saved).</li>
% else: % else:
<li>Retrieved from cache in <tt>${round(result.time, 3)}</tt> seconds (originally generated in <tt>${round(result.original_time, 3)}</tt>s; <tt>${round(result.original_time - result.time, 3)}</tt>s saved).</li>
<li>Retrieved from cache in <span class="mono">${round(result.time, 3)}</span> seconds (originally generated in <span class="mono">${round(result.original_time, 3)}</span>s; <span class="mono">${round(result.original_time - result.time, 3)}</span>s saved).</li>
% endif % endif
% endif % endif
% if result.queries: % if result.queries:


+ 6
- 6
pages/settings.mako View File

@@ -14,7 +14,7 @@
<tr> <tr>
<td>Default site:</td> <td>Default site:</td>
<td> <td>
<tt>http://</tt>
<span class="mono">http://</span>
<select name="lang"> <select name="lang">
<% selected_lang = cookies["CopyviosDefaultLang"].value if "CopyviosDefaultLang" in cookies else bot.wiki.get_site().lang %>\ <% selected_lang = cookies["CopyviosDefaultLang"].value if "CopyviosDefaultLang" in cookies else bot.wiki.get_site().lang %>\
% for code, name in langs: % for code, name in langs:
@@ -25,7 +25,7 @@
% endif % endif
% endfor % endfor
</select> </select>
<tt>.</tt>
<span class="mono">.</span>
<select name="project"> <select name="project">
<% selected_project = cookies["CopyviosDefaultProject"].value if "CopyviosDefaultProject" in cookies else bot.wiki.get_site().project %>\ <% selected_project = cookies["CopyviosDefaultProject"].value if "CopyviosDefaultProject" in cookies else bot.wiki.get_site().project %>\
% for code, name in projects: % for code, name in projects:
@@ -36,7 +36,7 @@
% endif % endif
% endfor % endfor
</select> </select>
<tt>.org</tt>
<span class="mono">.org</span>
</td> </td>
</tr> </tr>
<% <%
@@ -74,16 +74,16 @@
% for key in [key for key in cookie_order if key in cookies]: % for key in [key for key in cookie_order if key in cookies]:
<% cookie = cookies[key] %>\ <% cookie = cookies[key] %>\
<tr> <tr>
<td><b><tt>${key | h}</tt></b></td>
<td><b><span class="mono">${key | h}</span></b></td>
% try: % try:
<% lines = dumps(loads(cookie.value), indent=4).splitlines() %>\ <% lines = dumps(loads(cookie.value), indent=4).splitlines() %>\
<td> <td>
% for line in lines: % for line in lines:
<tt><div class="indentable">${line | h}</div></tt>
<span class="mono"><div class="indentable">${line | h}</div></span>
% endfor % endfor
</td> </td>
% except ValueError: % except ValueError:
<td><tt>${cookie.value | h}</tt></td>
<td><span class="mono">${cookie.value | h}</span></td>
% endtry % endtry
<td> <td>
<form action="${environ['PATH_INFO']}" method="post"> <form action="${environ['PATH_INFO']}" method="post">


+ 1
- 1
pages/support/footer.mako View File

@@ -9,7 +9,7 @@
% if ("CopyviosBackground" in cookies and cookies["CopyviosBackground"].value in ["potd", "list"]) or "CopyviosBackground" not in cookies: % if ("CopyviosBackground" in cookies and cookies["CopyviosBackground"].value in ["potd", "list"]) or "CopyviosBackground" not in cookies:
<a href="${get_desc_url() | h}">Background</a> &bull; \ <a href="${get_desc_url() | h}">Background</a> &bull; \
% endif % endif
<a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0 Strict</a>
<a href="http://validator.w3.org/check?uri=referer">Valid HTML5</a>
</p> </p>
</div> </div>
</body> </body>


+ 3
- 3
pages/support/header.mako View File

@@ -6,10 +6,10 @@
<% <%
root = path.dirname(environ["SCRIPT_NAME"]) root = path.dirname(environ["SCRIPT_NAME"])
%>\ %>\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<!DOCTYPE html>
<html lang="en">
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<title>${title}</title> <title>${title}</title>
<link rel="stylesheet" href="${root}/static/style.css" type="text/css" /> <link rel="stylesheet" href="${root}/static/style.css" type="text/css" />
<script src="${root}/static/script.js" type="text/javascript"></script> <script src="${root}/static/script.js" type="text/javascript"></script>


+ 1
- 10
static/style.css View File

@@ -159,16 +159,6 @@ p.tooldesc {
margin: 6px 0 6px 0; margin: 6px 0 6px 0;
} }


span.offline {
color: #900;
font-weight: bold;
}

span.online {
color: #090;
font-weight: bold;
}

td.cv-chain-cell { td.cv-chain-cell {
width: 50%; width: 50%;
vertical-align: top; vertical-align: top;
@@ -198,6 +188,7 @@ span.cv-hl-out {
background: linear-gradient(left, #FAA, #FFF); background: linear-gradient(left, #FAA, #FFF);
} }


span.mono { font-family: monospace; }
span.light { color: #CCC; } span.light { color: #CCC; }
span.medium { color: #AAA; } span.medium { color: #AAA; }




Loading…
Cancel
Save