From 10c68e6823b0c355e455386dc5bb4b127b18ce52 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 6 Sep 2014 00:36:09 -0500 Subject: [PATCH] Polishing for URL list; remove 'hide comparison' option. --- static/script.js | 16 ---------------- static/style.css | 20 ++++++++++++++++++-- templates/index.mako | 32 +++++++++++++++++++------------- templates/settings.mako | 2 +- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/static/script.js b/static/script.js index ed8bd45..231ceb9 100644 --- a/static/script.js +++ b/static/script.js @@ -1,19 +1,3 @@ -function copyvio_toggle_details() { - link = document.getElementById("cv-chain-link"); - table = document.getElementById("cv-chain-table"); - - if (link.innerHTML == "Hide comparison:") { - table.style.display = "none"; - link.innerHTML = "Show comparison:"; - set_cookie("CopyviosHideComparison", "True", 1095); - } else { - table.style.display = "table"; - link.innerHTML = "Hide comparison:"; - if (get_cookie("CopyviosHideComparison")) - delete_cookie("CopyviosHideComparison"); - } -} - function update_screen_size() { var cache = cache_cookie(); var data = { diff --git a/static/style.css b/static/style.css index 8d88877..7fcb311 100644 --- a/static/style.css +++ b/static/style.css @@ -54,7 +54,15 @@ div#cv-result { margin: 15px 5px 10px 5px; } +div#sources-container { + padding: 5px 10px; + margin: 15px 5px 10px 5px; + background-color: #EEE; + border: 1px solid #BBB; +} + div#cv-additional { + padding-bottom: 5px; display: none; } @@ -73,7 +81,7 @@ table#cv-form-inner { table#cv-result-sources { width: 100%; - background-color: #EEE; + border-spacing: 0 4px; } table#cv-result-sources th { @@ -81,7 +89,7 @@ table#cv-result-sources th { } table#cv-result-sources tr:nth-child(even) { - background-color: #F0F0F0; + background-color: #E0E0E0; } table#cv-chain-table { @@ -131,6 +139,14 @@ ul#cv-result-list { margin: 0.5em 0; } +span#cv-additional-text { + font-style: italic; +} + +a#source-selected { + font-weight: bold; +} + a#cv-cached { position: relative; } diff --git a/templates/index.mako b/templates/index.mako index c64eeaa..1694d6a 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -145,7 +145,6 @@ % if result: - <% hide_comparison = "CopyviosHideComparison" in g.cookies and g.cookies["CopyviosHideComparison"].value == "True" %>

% if result.confidence >= T_POSSIBLE: @@ -169,25 +168,33 @@ - + % for i, source in enumerate(result.sources): = 10 else ""}> - - - % if source.skipped: - <% skips = True %> - - % else: - - % endif + + + % endfor
URLCompare ConfidenceCompare
${source.url | h}CompareSkipped= T_SUSPECT else "source-possible" if source.confidence >= T_POSSIBLE else "source-novio"}">${round(source.confidence * 100, 1)}%${source.url | h} + % if source.skipped: + <% skips = True %> + Skipped + % else: + = T_SUSPECT else "source-possible" if source.confidence >= T_POSSIBLE else "source-novio"}">${round(source.confidence * 100, 1)}% + % endif + + % if i == 0: + Compare + % else: + Compare + % endif +
% if len(result.sources) > 10:
- ${len(result.sources) - 10} URL${"s" if len(result.sources) > 11 else ""} with lower confidence hidden. Show them. + ${len(result.sources) - 10} URL${"s" if len(result.sources) > 11 else ""} with lower confidence hidden. Show them.
% endif

@@ -209,9 +216,8 @@ % else:
  • Results generated in ${round(result.time, 3)} seconds using ${result.queries} queries.
  • % endif -
  • ${"Show" if hide_comparison else "Hide"} comparison:
  • - +
    diff --git a/templates/settings.mako b/templates/settings.mako index fb0babb..403bf9d 100644 --- a/templates/settings.mako +++ b/templates/settings.mako @@ -70,7 +70,7 @@

    Cookies

    % if g.cookies:
    Article:

    ${highlight_delta(result.article_chain, result.best.chains[1] if result.best else None)}

    Source:

    ${highlight_delta(result.best.chains[0], result.best.chains[1]) if result.best else ""}

    - <% cookie_order = ["CopyviosDefaultProject", "CopyviosDefaultLang", "CopyviosBackground", "CopyviosHideComparison", "CopyviosScreenCache"] %>\ + <% cookie_order = ["CopyviosDefaultProject", "CopyviosDefaultLang", "CopyviosBackground", "CopyviosScreenCache"] %>\ % for key in [key for key in cookie_order if key in g.cookies]: <% cookie = g.cookies[key] %>\