1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.7.2.1'

This commit is contained in:
gnosygnu
2016-07-10 23:35:32 -04:00
parent f5f48bb9b1
commit b333db45f8
366 changed files with 4468 additions and 3460 deletions

View File

@@ -66,6 +66,7 @@ public class Srch_word_tbl implements Rls_able {
if (fld_link_count_score != Dbmeta_fld_itm.Key_null) {
try {link_count_score = rdr.Read_int(fld_link_count_score);}
catch (Exception e) {// handle 2016-05 and earlier wikis which stored value as double instead of int
Err_.Noop(e);
link_count_score = (int)rdr.Read_double(fld_link_count_score);
}
}

View File

@@ -60,14 +60,14 @@ public class Srch_special_page implements Xow_special_page, Gfo_invk, Gfo_evt_it
// get page directly from url
boolean fulltext_invoked = url.Qargs_mgr().Match(Qarg__fulltext, Qarg__fulltext__y);
Xoa_ttl search_ttl = Xoa_ttl.parse(wiki, search_raw);
Xoa_ttl search_ttl = Xoa_ttl.Parse(wiki, search_raw);
Xoae_page search_page = page;
if ( !fulltext_invoked
&& !Bry_.Eq(search_raw, Xow_special_meta_.Itm__search.Ttl_bry())) // do not lookup self else stack overflow; happens when going directly to Special:Search (from history)
search_page = wiki.Data_mgr().Load_page_by_ttl(search_ttl); // try to find page; EX:Special:Search?search=Earth -> en.w:Earth; needed for search suggest
// page not found, or explicit_search invoked
if (search_page.Missing() || fulltext_invoked) {
if (search_page.Db().Page().Exists_n() || fulltext_invoked) {
if (qargs_mgr.Cancel() != null) { // cancel any existing searches
search_mgr.Search__cancel(qargs_mgr.Cancel());
page.Tab_data().Cancel_show_y_();
@@ -81,10 +81,12 @@ public class Srch_special_page implements Xow_special_page, Gfo_invk, Gfo_evt_it
// page found; return it;
else {
wiki.Parser_mgr().Parse(search_page, true);
page.Data_raw_(search_page.Data_raw());
page.Db().Text().Text_bry_(search_page.Db().Text().Text_bry());
if (page.Root() != null) // NOTE: null when going from w:Earth -> q:Earth; DATE:2013-03-20
page.Root().Data_htm_(search_page.Root().Data_htm());
page.Ttl_(search_ttl).Url_(Xoa_url.new_(wiki.Domain_bry(), search_ttl.Full_txt_w_ttl_case())).Redirected_(true);
Xoa_url redirect_url = Xoa_url.New(wiki, search_ttl);
page.Ttl_(search_ttl).Url_(redirect_url);
page.Redirect().Itms__add__special(redirect_url, search_ttl);
}
}
private void Multi_wikis_changed() {

View File

@@ -50,7 +50,7 @@ public class Srch_special_searcher {
}
// generate html; note if async, this will just generate the page header
page.Data_raw_(html_page_bldr.Bld_page(tmp_bfr.To_bry_and_clear()));
page.Db().Text().Text_bry_(html_page_bldr.Bld_page(tmp_bfr.To_bry_and_clear()));
}
public void Search__done(Srch_special_cmd cmd) {
cancel_hash.Del(cmd.key);

View File

@@ -188,7 +188,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// public void Test_html_by_url(String ttl_str, String args_str, String expd_html) {
// wiki.Init_needed_(false);
// byte[] ttl_bry = Bry_.new_a7(ttl_str);
// Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry);
// Xoa_ttl ttl = Xoa_ttl.Parse(wiki, ttl_bry);
// Xoae_page page = Xoae_page.New_test(wiki, ttl);
// byte[] url_bry = Bry_.new_a7("http://en.wikipedia.org/wiki/Special:Search/" + ttl_str + args_str);
// Xoa_url url = wiki.Appe().Url_parser().Parse(url_bry);
@@ -200,7 +200,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Xow_url_parser_old url_parser = new Xow_url_parser_old();
// byte[] url_raw = Bry_.new_a7("Special:Search/" + ttl_str + ((match_tid == Srch_special_page.Match_tid_all) ? "" : "*") + "?fulltext=y" + Srch_rslt_row_sorter.Xto_url_arg(sort_tid) + "&xowa_page_size=1&xowa_page_index=" + page_idx);
// Xoa_url url = url_parser.Parse(url_raw);
// Xoa_ttl ttl = Xoa_ttl.parse(wiki, url_raw);
// Xoa_ttl ttl = Xoa_ttl.Parse(wiki, url_raw);
// Xoae_page page = wiki.Ctx().Page();
// search_mgr.Special__gen(url, page, wiki, ttl);
// Xosrh_rslt_grp cur_grp = search_mgr.Cur_grp();