63
|
1 $('div.block[id*=search]').livequery(function(){
|
|
2 var searchblock = $(this);
|
|
3
|
|
4 // displaying the search result list
|
|
5 searchblock.find("#searchblock_button").live('click',function(){
|
|
6 searchblock.find("#searchresults").removeClass("hidden");
|
|
7 });
|
|
8
|
|
9
|
|
10 // opening the selected search result
|
|
11 $(this).find("#search_open_button").click(function(){
|
|
12 addBlock("blocks/table","table");
|
|
13 var segment = $(this).parents().filter(".block");
|
|
14 foldBlock(segment);
|
|
15 });
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20 tables = new Array();
|
|
21 tables[0] = "<TABLE class=\"preview\"><TR> <TH> Place </TH> <TH> Date </TH> <TH> gis_id </TH></TR><TR> <TD> Beijing</TD> <TD> 1848</TD> <TD> 131451</TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
|
|
22 tables[1] = "<TABLE class=\"preview\"><TR> <TH> Page </TH> <TH> description </TH> <TH>source</TH><TH> gis_id </TH></TR><TR> <TD> 71</TD> <TD> A description of the [...]</TD> <TD> The Big Book of [...]</TD> <TD> 93128 </TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
|
|
23 tables[2] = "<TABLE class=\"preview\"><TR> <TH> callno </TH> <TH> object </TH> <TH> kind </TH> <TH> title </TH> <TH> ... </TH></TR><TR> <TD> printing 25 </TD> <TD> book</TD> <TD> xylograph</TD> <TD>Huang Ming dianli</TD><TD>...</TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
|
|
24 tbl_index = 2;
|
|
25
|
|
26 stats = new Array();
|
|
27 stats[0] = "114 datasets<br/><b>3 Columns:</b> Place, Date, gis_id";
|
|
28 stats[1] = "37 datasets<br/><b>4 Columns:</b> Page, description, source, gis_id";
|
|
29 stats[2] = "53 datasets<br/><b>7 Columns:</b> callno, object, kind, title, dynasty, reign_period, production_begin_year";
|
|
30
|
|
31 $("#resultlist li").live("click", function(){
|
|
32 tbl_index ++;
|
|
33 tbl_index = tbl_index%3;
|
|
34 $("#preview").empty();
|
|
35 $("#preview").append(stats[tbl_index]+'<hr noshade/>'+tables[tbl_index]);
|
|
36 });
|
|
37
|
|
38 });
|