Merge pull request #143 from MaximeChretien/improve-ui
Improve Elixir UI
This commit is contained in:
commit
70a4151871
5 changed files with 54 additions and 7 deletions
3
http/img/arrow-dropdown-16.svg
Normal file
3
http/img/arrow-dropdown-16.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M8 12a1 1 0 0 1-.707-.293l-5-5a1 1 0 0 1 1.414-1.414L8 9.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-5 5A1 1 0 0 1 8 12z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 283 B |
|
|
@ -267,18 +267,58 @@ h2 {
|
|||
background: #ddd;
|
||||
padding-right: 3em;
|
||||
min-width: 0;
|
||||
flex: 4;
|
||||
flex: 3.5;
|
||||
}
|
||||
.search input:focus {
|
||||
background: #eee;
|
||||
}
|
||||
.search select {
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
font-family: 'Ubuntu Mono', monospace;
|
||||
font-size: 0.9em;
|
||||
padding: 0.45em;
|
||||
text-align: center;
|
||||
text-align-last: center;
|
||||
min-height: 32px;
|
||||
|
||||
padding: 7px;
|
||||
padding-right: 20px;
|
||||
text-decoration: none;
|
||||
|
||||
background-color: #aaa;
|
||||
background-image: url("/img/arrow-dropdown-16.svg");
|
||||
background-position: right 2px center;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
opacity: 0.9;
|
||||
border: 0 none;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.search select:-moz-focusring { /* Remove unwanted firefox borders */
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0);
|
||||
text-shadow: 0 0 0 #000;
|
||||
outline: 1px;
|
||||
outline-style: dotted;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
.search select:focus {
|
||||
outline: 1px;
|
||||
outline-style: dotted;
|
||||
outline-offset: -1px;
|
||||
outline-color: #000;
|
||||
}
|
||||
.search select:hover,
|
||||
.search select:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
.search option { /* Firefox ignores that on linux but the default color is close */
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.filter {
|
||||
padding: 0.5em;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ if m:
|
|||
if family == None:
|
||||
family = 'C'
|
||||
|
||||
search_family = 'A'
|
||||
|
||||
basedir = os.environ['LXR_PROJ_DIR']
|
||||
datadir = basedir + '/' + project + '/data'
|
||||
repodir = basedir + '/' + project + '/repo'
|
||||
|
|
@ -81,6 +83,8 @@ if m:
|
|||
url = 'source'+path
|
||||
|
||||
elif cmd == 'ident':
|
||||
search_family = family
|
||||
|
||||
ident = arg[1:]
|
||||
form = cgi.FieldStorage()
|
||||
ident2 = form.getvalue('i')
|
||||
|
|
@ -137,7 +141,7 @@ data = {
|
|||
'project': project,
|
||||
'projects': projects,
|
||||
'ident': ident,
|
||||
'family': family,
|
||||
'family': search_family,
|
||||
'breadcrumb': '<a class="project" href="'+version+'/source">/</a>'
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +263,6 @@ if mode == 'source':
|
|||
filename, extension = os.path.splitext(fname)
|
||||
extension = extension[1:].lower()
|
||||
family = query('family', fname)
|
||||
data['family'] = family
|
||||
|
||||
# Source common filter definitions
|
||||
os.chdir('filters')
|
||||
|
|
|
|||
4
query.py
4
query.py
|
|
@ -233,12 +233,12 @@ def query(cmd, *args):
|
|||
|
||||
# Copy information about this identifier into dBuf, rBuf, and docBuf.
|
||||
while def_idx == file_idx:
|
||||
if def_family == family:
|
||||
if def_family == family or family == 'A':
|
||||
dBuf.append((file_path, def_type, def_line))
|
||||
def_idx, def_type, def_line, def_family = next(defs_this_ident)
|
||||
|
||||
if ref_idx == file_idx:
|
||||
if lib.compatibleFamily(family, ref_family):
|
||||
if lib.compatibleFamily(family, ref_family) or family == 'A':
|
||||
rBuf.append((file_path, ref_lines))
|
||||
|
||||
if doc_idx == file_idx: # TODO should this be a `while`?
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@
|
|||
</div>
|
||||
<div class="search">
|
||||
<form method="post" action="{{version}}/ident">
|
||||
<select name="f">
|
||||
<select name="f" title="Restricts search to specific file families">
|
||||
<option value="A" {% if family=="A" %} selected="selected"{% endif %}>All</option>
|
||||
<option value="C" {% if family=="C" %} selected="selected"{% endif %}>C/CPP/ASM</option>
|
||||
<option value="K" {% if family=="K" %} selected="selected"{% endif %}>Kconfig</option>
|
||||
<option value="D" {% if family=="D" %} selected="selected"{% endif %}>Devicetree</option>
|
||||
|
|
|
|||
Loading…
Reference in a new issue