File tree 5 files changed +32
-1
lines changed
5 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 88
88
89
89
# Rope project settings
90
90
.ropeproject
91
+
92
+ app /search /static /names.js
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ COPY cron.conf /etc/supervisor/conf.d/cron.conf
20
20
COPY app /app
21
21
COPY libc-database /libc-database
22
22
23
+ # Generate autocomplete symbols list
24
+ COPY gen_names.sh /gen_names.sh
25
+ RUN cd / && /gen_names.sh
26
+
23
27
# nginx.conf of the base image aliases /static to /app/static.
24
28
RUN ln -s /app/search/static /app/static
25
29
# Enable download link
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ function show_offset_diffs($radio) {
72
72
} ) ;
73
73
}
74
74
75
+ function set_autocomplete ( names ) {
76
+ $ ( '.query-name' ) . autocomplete ( {
77
+ source : names
78
+ } ) ;
79
+ }
80
+
75
81
$ ( '.symbol-radio' ) . change ( function ( ) {
76
82
show_offset_diffs ( $ ( this ) ) ;
77
83
} ) ;
Original file line number Diff line number Diff line change 6
6
< title > libc database search</ title >
7
7
< link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css " integrity ="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u " crossorigin ="anonymous ">
8
8
< link rel ="stylesheet " href ="{{ url_for('static', filename='style.css') }} ">
9
+ < link rel ="stylesheet " href ="https://code.jquery.com/ui/1.12.1/themes/start/jquery-ui.css ">
9
10
< script type ="text/javascript " src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js "> </ script >
10
11
< script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js " integrity ="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa " crossorigin ="anonymous "> </ script >
12
+ < script src ="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js "> </ script >
11
13
< script type ="text/javascript " src ="{{ url_for('static', filename='URI.min.js') }} "> </ script >
12
14
</ head >
13
15
< body >
@@ -95,10 +97,14 @@ <h1 class="panel-title panel-title-inline">{{ lib }}</h1>
95
97
</ div >
96
98
</ div >
97
99
< script type ="text/javascript " src ="{{ url_for('static', filename='main.js') }} "> </ script >
98
- < script >
100
+ < script type =" text/javascript " >
99
101
{ % for name , addr in query . items ( ) % }
100
102
add_query ( "{{ name }}" , "{{ addr }}" ) ;
101
103
{ % endfor % }
102
104
</ script >
105
+ < script type ="text/javascript " src ="{{ url_for('static', filename='names.js') }} "> </ script >
106
+ < script type ="text/javascript ">
107
+ set_autocomplete ( names ) ;
108
+ </ script >
103
109
</ body >
104
110
</ html >
Original file line number Diff line number Diff line change
1
+ dbdir=libc-database/db
2
+ outfile=app/search/static/names.js
3
+
4
+ cat $dbdir /* .symbols \
5
+ | cut -d ' ' -f 1 \
6
+ | sort \
7
+ | uniq \
8
+ | awk ' \
9
+ BEGIN { print "var names = [" }
10
+ { printf "\"%s\",\n", $1 }
11
+ END { print "];" }' \
12
+ > $outfile
13
+ wc -l $outfile
You can’t perform that action at this time.
0 commit comments