Bladeren bron

HTML5

pull/24/head
Ben Kurtovic 11 jaren geleden
bovenliggende
commit
de87631cf5
6 gewijzigde bestanden met toevoegingen van 21 en 30 verwijderingen
  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 Bestand weergeven

@@ -45,7 +45,7 @@ def _do_set(query, headers, cookies):
def _do_delete(query, headers, cookies):
if query.cookie in cookies:
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))
elif query.all:
number = len(cookies)


+ 9
- 9
pages/index.mako Bestand weergeven

@@ -4,7 +4,7 @@
<% query, bot, all_langs, all_projects, page, result = main(environ) %>\
% if query.project and query.lang and query.title and not page:
<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>
% elif query.project and query.lang and query.title and page and not result:
<div class="red-box">
@@ -23,7 +23,7 @@
<tr>
<td>Site:</td>
<td>
<tt>http://</tt>
<span class="mono">http://</span>
<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 %>\
% for code, name in all_langs:
@@ -34,7 +34,7 @@
% endif
% endfor
</select>
<tt>.</tt>
<span class="mono">.</span>
<select name="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:
@@ -45,7 +45,7 @@
% endif
% endfor
</select>
<tt>.org</tt>
<span class="mono">.org</span>
</td>
</tr>
<tr>
@@ -97,13 +97,13 @@
<li>No matches found.</li>
% 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:
<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>
</a> from ${result.cache_time} (${result.cache_age} ago). <a href="${environ['REQUEST_URI'] | h}&amp;nocache=1">Bypass the cache.</a></li>
% 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
% 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>
@@ -117,12 +117,12 @@
<div id="cv-result-detail" style="display: none;">
% endif
<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.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:
<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
% if result.queries:


+ 6
- 6
pages/settings.mako Bestand weergeven

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


+ 1
- 1
pages/support/footer.mako Bestand weergeven

@@ -9,7 +9,7 @@
% 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; \
% 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>
</div>
</body>


+ 3
- 3
pages/support/header.mako Bestand weergeven

@@ -6,10 +6,10 @@
<%
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>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<title>${title}</title>
<link rel="stylesheet" href="${root}/static/style.css" type="text/css" />
<script src="${root}/static/script.js" type="text/javascript"></script>


+ 1
- 10
static/style.css Bestand weergeven

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

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

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

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

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



Laden…
Annuleren
Opslaan