Преглед на файлове

Search-result style edits. Close #41.

Add:
    static/sass/index.sass
        -Add style rules to fix bugs, and improve the appearance of some minor
        details.

    static/js/index.advanced-search-form.js
        -Close #41. Add statements to scroll to the bottom of the search-groups
        div when any search-groups/input fields are added.

Fix:
    bitshift/languages.py
        -Python's `u"string"` unicode specifier results in a Javascript syntax
        error when pasted verbatim into `templates/index.html` by Flask; add
        `str()` to the languages array loader to fix it.
tags/v1.0^2
Severyn Kozak преди 10 години
родител
ревизия
69ca385939
променени са 5 файла, в които са добавени 26 реда и са изтрити 8 реда
  1. +1
    -1
      bitshift/languages.py
  2. +5
    -1
      static/js/index.advanced-search-form.js
  3. +2
    -0
      static/js/index.js
  4. +17
    -5
      static/sass/index.sass
  5. +1
    -1
      templates/index.html

+ 1
- 1
bitshift/languages.py Целия файл

@@ -2,4 +2,4 @@ import json
from os import path

with open(path.join(path.dirname(__file__), "languages.json")) as lang_json:
LANGS = [lang for lang in json.load(lang_json)["languages"]]
LANGS = [str(lang) for lang in json.load(lang_json)["languages"]]

+ 5
- 1
static/js/index.advanced-search-form.js Целия файл

@@ -37,6 +37,8 @@ var searchGroups = $("div#search-groups");
searchGroups.append(
searchGroup.append(createSearchGroupInput("language")));
$("div#sidebar input[type=checkbox]#language").prop("checked", true);

searchGroups[0].scrollTop = searchGroups[0].scrollHeight;
});

// Remove the currently selected group if it's not the only one, and mark
@@ -82,6 +84,7 @@ var searchGroups = $("div#search-groups");
else
$(this).prop("checked", true);
}
searchGroups[0].scrollTop = searchGroups[0].scrollHeight;
});

var previousAdvancedQuery = "";
@@ -129,7 +132,8 @@ function assembleQuery(){
groupQuery.push(genFieldQueryString(
inputFields[field], regexCheckbox[field].checked));

groupQueries.push(groupQuery.join(" AND "));
if(groupQuery.length > 0)
groupQueries.push(groupQuery.join(" AND "));
}

return groupQueries.join(" OR ");


+ 2
- 0
static/js/index.js Целия файл

@@ -302,3 +302,5 @@ function loadMoreResults(){
result * 20);
}
}

loadMoreResults();

+ 17
- 5
static/sass/index.sass Целия файл

@@ -236,7 +236,7 @@ div#advanced-search

#search-groups
margin-top: 1%
max-height: 93%
max-height: 87%
overflow-y: auto
width: 75%

@@ -325,16 +325,20 @@ div#display-info
#site
text-transform: capitalize



td#code
width: $codeWidth
height: inherit
padding: 0px

@include vendor(transition, width 0.2s ease-in-out)

.display-all &
width: 500px
// .display-all &
// width: 500px

#tablecontainer
overflow: scroll
overflow: hidden
width: 100%
height: inherit
background-color: #49483e
@@ -344,9 +348,17 @@ td#code
table
table-layout:fixed
border-collapse: collapse
border: none
font-family: monospace

.linenos
padding-left: 1%

pre
margin-top: 5px

.code pre
margin-top: 5px

div#hidden-info
width: $hiddenInfoWidth
margin-left: -$hiddenInfoWidth - 10px


+ 1
- 1
templates/index.html Целия файл

@@ -18,7 +18,7 @@
= endblock

= block body
<div id="search-field">
<div id="search-field" class="partly-visible">
<a id="title" href="/">
<div id="title">
<span id="title-bit">bit</span


Зареждане…
Отказ
Запис