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

@@ -41,7 +41,7 @@ public class Xowd_css_core_mgr {
}
conn.Txn_end();
}
catch (Exception e) {conn.Txn_cxl(); throw e;}
catch (Exception e) {conn.Txn_cxl(); throw Err_.new_exc(e, "css", "Xowd_css_core_mgr.Set failed", "key", key, "err", Err_.Message_gplx_log(e));}
}
public static boolean Get(Xowd_css_core_tbl core_tbl, Xowd_css_file_tbl file_tbl, Io_url css_dir, String key) {
String dbg = "enter";

View File

@@ -23,7 +23,7 @@ public class Rndm_root_special implements Xow_special_page {
Xow_ns ns = wiki.Ns_mgr().Names_get_or_main(ttl.Rest_txt());
// Rndm_addon.Get(wiki).Mgr().Regy().Get_rndm_page_by_ns(ns);
byte[] random_ttl_bry = wiki.Db_mgr().Load_mgr().Find_random_ttl(ns);
byte[] root_bry = Xoa_ttl.parse(wiki, random_ttl_bry).Root_txt();
byte[] root_bry = Xoa_ttl.Parse(wiki, random_ttl_bry).Root_txt();
wiki.Data_mgr().Redirect(page, ns.Gen_ttl(root_bry));
}

View File

@@ -42,13 +42,13 @@ class Rndm_root_special_fxt {
public void Test_open(String special_url, String expd) {
Xoae_page page = Test_special_open(wiki, special_page, special_url);
Tfds.Eq(expd, String_.new_a7(page.Url().Page_bry()));
Tfds.Eq(expd, String_.new_a7(page.Data_raw()));
Tfds.Eq(expd, String_.new_a7(page.Db().Text().Text_bry()));
}
public static Xoae_page Test_special_open(Xowe_wiki wiki, Xow_special_page special_page, String special_url) {
Xoae_page page = wiki.Parser_mgr().Ctx().Page();
Xoa_url url = wiki.Utl__url_parser().Parse(Bry_.new_u8(special_url));
page.Url_(url);
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.new_a7(special_url));
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, Bry_.new_a7(special_url));
page.Ttl_(ttl);
special_page.Special__gen(wiki, page, url, ttl);
return page;

View File

@@ -31,7 +31,8 @@ public class Xow_info_special implements Xow_special_page {
delete_wiki.Data__core_mgr().Rls(); // release connection if open
Delete_wiki_files(delete_wiki.Fsys_mgr().Root_dir());
}
page.Redirect_to_ttl_(gplx.xowa.addons.wikis.registrys.lists.Xow_list_special.Prototype.Special__meta().Ttl_bry());
Xoa_ttl redirect_ttl = wiki.Ttl_parse(gplx.xowa.addons.wikis.registrys.lists.Xow_list_special.Prototype.Special__meta().Ttl_bry());
page.Redirect().Itms__add__special(Xoa_url.New(wiki, redirect_ttl), redirect_ttl);
return;
}

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();