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

'v3.3.4.1'

This commit is contained in:
gnosygnu
2016-03-27 23:44:59 -04:00
parent de67253a9c
commit baaef32df2
903 changed files with 13339 additions and 8695 deletions

View File

@@ -29,7 +29,7 @@ public class Xoa_app_eval_tst {
class Xoa_app_eval_fxt {
public void Clear() {
if (app == null) {
app = Xoa_app_fxt.app_();
app = Xoa_app_fxt.Make__app__edit();
fmtr = Bry_fmtr.new_();
eval = new Xoa_app_eval();
fmtr.Eval_mgr_(eval);

View File

@@ -31,7 +31,7 @@ public class Xoa_sys_cfg implements GfoInvkAble {
return this;
} private byte[] lang_key = Xol_lang_itm_.Key_en;
public int Options_version() {return options_version;} public Xoa_sys_cfg Options_version_(int v) {options_version = v; return this;} private int options_version = 1;
public KeyVal[] Options_lang_list() {if (options_lang_list == null) options_lang_list = Options_list_lang_.new_(); return options_lang_list;} private KeyVal[] options_lang_list;
public Keyval[] Options_lang_list() {if (options_lang_list == null) options_lang_list = Options_list_lang_.new_(); return options_lang_list;} private Keyval[] options_lang_list;
public long Free_mem_when() {return free_mem_when;} long free_mem_when;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_version)) return Xoa_app_.Version;
@@ -49,7 +49,7 @@ public class Xoa_sys_cfg implements GfoInvkAble {
, Invk_lang = "lang", Invk_lang_ = "lang_", Invk_lang_list = "lang_list";
}
class Options_list_lang_ {
public static KeyVal[] new_() {
public static Keyval[] new_() {
Ordered_hash translated = Ordered_hash_.New_bry();
List_adp untranslated = List_adp_.new_();
Add_itm_many(translated, Xol_lang_stub_.Id_en, Xol_lang_stub_.Id_de, Xol_lang_stub_.Id_pl, Xol_lang_stub_.Id_zh_hans, Xol_lang_stub_.Id_zh_hant); // add langs with translations first, so they alphabetize to top of list
@@ -61,7 +61,7 @@ class Options_list_lang_ {
}
untranslated.Sort_by(Xol_lang_stub_.Comparer_key);
KeyVal[] rv = new KeyVal[len];
Keyval[] rv = new Keyval[len];
int translated_max = translated.Count();
for (int i = 0; i < translated_max; i++)
rv[i] = new_itm((Xol_lang_stub)translated.Get_at(i));
@@ -70,10 +70,10 @@ class Options_list_lang_ {
rv[i] = new_itm((Xol_lang_stub)untranslated.Get_at(i - translated_max));
return rv;
}
private static KeyVal new_itm(Xol_lang_stub itm) {
private static Keyval new_itm(Xol_lang_stub itm) {
String key_str = String_.new_u8(itm.Key());
String name_str = String_.new_u8(itm.Canonical_name());
return KeyVal_.new_(key_str, name_str + " [" + key_str + "]");
return Keyval_.new_(key_str, name_str + " [" + key_str + "]");
}
private static void Add_itm_many(Ordered_hash translated, int... langs) {
int langs_len = langs.length;

View File

@@ -74,7 +74,6 @@ public class Xoav_app implements Xoa_app, GfoInvkAble {
public Bry_bfr_mkr Utl__bfr_mkr() {return Xoa_app_.Utl__bfr_mkr();}
public Json_parser Utl__json_parser() {return utl__json_parser;} private final Json_parser utl__json_parser = new Json_parser();
public boolean Bldr__running() {return bldr__running;} public void Bldr__running_(boolean v) {this.bldr__running = v;} private boolean bldr__running;
public Xop_amp_mgr Utl_amp_mgr() {return utl_amp_mgr;} private Xop_amp_mgr utl_amp_mgr = Xop_amp_mgr.Instance;
public Xol_case_mgr Utl_case_mgr() {return utl_case_mgr;} private Xol_case_mgr utl_case_mgr = Xol_case_mgr_.U8();
// public Gfo_url_encoder Utl_encoder_fsys() {return utl_encoder_fsys;} private Gfo_url_encoder utl_encoder_fsys = Gfo_url_encoder.New_fsys_lnx();

View File

@@ -50,10 +50,10 @@ xowa {
gui {
browser {
url {
focus();
exec_by_paste();
exec_new_tab_by_paste();
restore();
focus();
exec_by_paste();
exec_new_tab_by_paste();
restore();
exec();
}
search {
@@ -61,45 +61,45 @@ xowa {
exec();
}
tabs {
new_dflt__at_dflt__focus_y();
new_link__at_dflt__focus_n();
new_link__at_dflt__focus_y();
new_href__at_dflt__focus_y();
new_dupe__at_dflt__focus_y();
close_cur();
select_bwd();
select_fwd();
move_bwd();
move_fwd();
close_others();
close_to_bgn();
close_to_end();
close_undo();
pin_toggle();
select_by_idx_1();
select_by_idx_2();
select_by_idx_3();
select_by_idx_4();
select_by_idx_5();
select_by_idx_6();
select_by_idx_7();
select_by_idx_8();
new_dflt__at_dflt__focus_y();
new_link__at_dflt__focus_n();
new_link__at_dflt__focus_y();
new_href__at_dflt__focus_y();
new_dupe__at_dflt__focus_y();
close_cur();
select_bwd();
select_fwd();
move_bwd();
move_fwd();
close_others();
close_to_bgn();
close_to_end();
close_undo();
pin_toggle();
select_by_idx_1();
select_by_idx_2();
select_by_idx_3();
select_by_idx_4();
select_by_idx_5();
select_by_idx_6();
select_by_idx_7();
select_by_idx_8();
select_by_idx_9();
}
html {
focus();
selection_focus_toggle();
focus();
selection_focus_toggle();
load_tid; // [mem,url]
}
find {
show();
show_by_paste();
hide();
exec();
type();
find_bwd();
find_fwd();
case_toggle();
show();
show_by_paste();
hide();
exec();
type();
find_bwd();
find_fwd();
case_toggle();
wrap_toggle();
}
prog {
@@ -107,11 +107,11 @@ xowa {
show_short_link;
}
info {
focus();
clear();
launch();
warn_enabled;
note_enabled;
focus();
clear();
launch();
warn_enabled;
note_enabled;
}
prog_log {
show();
@@ -124,30 +124,30 @@ xowa {
}
page {
edit {
copy();
select_all();
save();
save_draft();
preview();
focus_edit_box();
dbg_tmpl();
dbg_html();
exec();
}
selection {
copy();
select_all();
save_file_as();
}
view {
mode_read();
mode_edit();
mode_html();
reload();
refresh();
print();
save_as();
}
copy();
select_all();
save();
save_draft();
preview();
focus_edit_box();
dbg_tmpl();
dbg_html();
exec();
}
selection {
copy();
select_all();
save_file_as();
}
view {
mode_read();
mode_edit();
mode_html();
reload();
refresh();
print();
save_as();
}
}
}
html {

View File

@@ -40,16 +40,17 @@ public class Xoapi_root implements GfoInvkAble {
html_api.Page().Toggle_mgr().Img_dir_(img_dir);
usr_api.Init_by_app(app);
}
public Xoapi_app App() {return app_api;} private final Xoapi_app app_api = new Xoapi_app();
public Xoapi_nav Nav() {return nav_api;} private final Xoapi_nav nav_api = new Xoapi_nav();
public Xoapi_gui Gui() {return gui_api;} private final Xoapi_gui gui_api = new Xoapi_gui();
public Xoapi_html Html() {return html_api;} private final Xoapi_html html_api = new Xoapi_html();
public Xoapi_bldr Bldr() {return bldr_api;} private final Xoapi_bldr bldr_api = new Xoapi_bldr();
public Xoapi_net Net() {return net_api;} private final Xoapi_net net_api = new Xoapi_net();
public Xoapi_usr Usr() {return usr_api;} private final Xoapi_usr usr_api = new Xoapi_usr();
public Xoapi_special Special() {return special_api;} private final Xoapi_special special_api = new Xoapi_special();
public Xoapi_xtns Xtns() {return xtns_api;} private final Xoapi_xtns xtns_api = new Xoapi_xtns();
public Xoapi_app_wikis Wikis() {return app_wikis;} private final Xoapi_app_wikis app_wikis = new Xoapi_app_wikis();
public Xoapi_addon Addon() {return addon_api;} private final Xoapi_addon addon_api = new Xoapi_addon();
public Xoapi_app App() {return app_api;} private final Xoapi_app app_api = new Xoapi_app();
public Xoapi_nav Nav() {return nav_api;} private final Xoapi_nav nav_api = new Xoapi_nav();
public Xoapi_gui Gui() {return gui_api;} private final Xoapi_gui gui_api = new Xoapi_gui();
public Xoapi_html Html() {return html_api;} private final Xoapi_html html_api = new Xoapi_html();
public Xoapi_bldr Bldr() {return bldr_api;} private final Xoapi_bldr bldr_api = new Xoapi_bldr();
public Xoapi_net Net() {return net_api;} private final Xoapi_net net_api = new Xoapi_net();
public Xoapi_usr Usr() {return usr_api;} private final Xoapi_usr usr_api = new Xoapi_usr();
public Xoapi_special Special() {return special_api;} private final Xoapi_special special_api = new Xoapi_special();
public Xoapi_xtns Xtns() {return xtns_api;} private final Xoapi_xtns xtns_api = new Xoapi_xtns();
public Xoapi_app_wikis Wikis() {return app_wikis;} private final Xoapi_app_wikis app_wikis = new Xoapi_app_wikis();
public String Test_str() {return test_str;} public void Test_str_(String v) {test_str = v;} private String test_str; // TEST
private void Exec(String key) {
Xog_cmd_itm cmd_itm = app.Gui_mgr().Cmd_mgr().Get_or_null(key);
@@ -58,6 +59,7 @@ public class Xoapi_root implements GfoInvkAble {
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_app)) return app_api;
else if (ctx.Match(k, Invk_addon)) return addon_api;
else if (ctx.Match(k, Invk_bldr)) return bldr_api;
else if (ctx.Match(k, Invk_nav)) return nav_api;
else if (ctx.Match(k, Invk_gui)) return gui_api;
@@ -74,7 +76,8 @@ public class Xoapi_root implements GfoInvkAble {
}
private static final String
Invk_exec = "exec"
, Invk_app = "app", Invk_bldr = "bldr", Invk_nav = "nav", Invk_gui = "gui", Invk_html = "html", Invk_net = "net", Invk_usr = "usr", Invk_special = "special", Invk_xtns = "xtns"
, Invk_app = "app", Invk_addon = "addon"
, Invk_bldr = "bldr", Invk_nav = "nav", Invk_gui = "gui", Invk_html = "html", Invk_net = "net", Invk_usr = "usr", Invk_special = "special", Invk_xtns = "xtns"
, Invk_test_str = "test_str", Invk_test_str_ = "test_str_"
, Invk_wikis = "wikis"
;

View File

@@ -0,0 +1,28 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
import gplx.xowa.apps.apis.xowa.addons.*;
public class Xoapi_addon implements GfoInvkAble {
public void Ctor_by_app(Xoa_app app) {}
public Xoapi_search_addon Search() {return search;} private final Xoapi_search_addon search = new Xoapi_search_addon();
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk__search)) return search;
else return GfoInvkAble_.Rv_unhandled;
}
private static final String Invk__search = "search";
}

View File

@@ -0,0 +1,39 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.addons; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.domains.crts.*;
import gplx.xowa.apps.apis.xowa.addons.searchs.*;
public class Xoapi_search_addon implements GfoInvkAble {
public Xoapi_search_addon() {}
public Xoapi_url_bar Url_bar() {return url_bar;} private final Xoapi_url_bar url_bar = new Xoapi_url_bar();
@gplx.Internal protected Xoapi_search_box Search_box() {return search_box;} private final Xoapi_search_box search_box = new Xoapi_search_box();
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk__url_bar)) return url_bar;
else if (ctx.Match(k, Invk__search_box)) return search_box;
else return GfoInvkAble_.Rv_unhandled;
}
private static final String
Invk__url_bar = "url_bar"
, Invk__search_box = "search_box"
;
}
class Xoapi_search_box implements GfoInvkAble {
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
return null;
}
}

View File

@@ -0,0 +1,34 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.addons.searchs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.addons.*;
public class Xoapi_search_mode_ {
public static final int Tid__title_full = 0, Tid__title_word = 1;
public static final String Str__title_full = "title.full", Str__title_word = "title.word";
public static String To_str(int v) {
switch (v) {
case Tid__title_full: return Str__title_full;
case Tid__title_word: return Str__title_word;
default: throw Err_.new_unhandled_default(v);
}
}
public static int To_int(String v) {
if (String_.Eq(v, Str__title_full)) return Tid__title_full;
else if (String_.Eq(v, Str__title_word)) return Tid__title_word;
else throw Err_.new_unhandled_default(v);
}
}

View File

@@ -0,0 +1,78 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.addons.searchs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.addons.*;
import gplx.xowa.addons.searchs.searchers.*; import gplx.xowa.addons.searchs.searchers.crts.*;
public class Xoapi_url_bar implements GfoInvkAble, GfoEvMgrOwner {
public Xoapi_url_bar() {
this.evMgr = GfoEvMgr.new_(this);
}
public GfoEvMgr EvMgr() {return evMgr;} private final GfoEvMgr evMgr;
public boolean Enabled() {return enabled;} private boolean enabled = true;
public int Search_mode() {return search_mode;} private int search_mode = Xoapi_search_mode_.Tid__title_word;
public int Max_results() {return max_results;} private int max_results = 10;
public boolean Auto_wildcard() {return auto_wildcard;} private boolean auto_wildcard = true;
public Srch_ns_mgr Ns_mgr() {return ns_mgr;} private final Srch_ns_mgr ns_mgr = new Srch_ns_mgr().Add_main_if_empty();
public Srch_crt_scanner_syms Syms() {return syms;} private Srch_crt_scanner_syms syms = Srch_search_mgr.Scanner_syms;
public Keyval[] Operators() {return symbols;} private Keyval[] symbols = Keyval_.Ary_empty;
public int Visible_rows() {return visible_rows;} private int visible_rows = 10;
public int Jump_len() {return jump_len;} private int jump_len = 5;
private void Ns_ids_(String s) {
int[] ns_ids = Int_.Ary_empty;
if (String_.Eq(s, "*")) {} // leave as int[0]; ns_mgr will interpret as wildcard
else {
ns_ids = Int_.Ary_parse(s, ",");
}
ns_mgr.Add_by_int_ids(ns_ids);
GfoEvMgr_.Pub(this, Evt__ns_ids_changed);
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk__enabled)) return Yn.To_str(enabled);
else if (ctx.Match(k, Invk__enabled_)) enabled = m.ReadBool("v");
else if (ctx.Match(k, Invk__search_mode)) return Xoapi_search_mode_.To_str(search_mode);
else if (ctx.Match(k, Invk__search_mode_)) search_mode = Xoapi_search_mode_.To_int(m.ReadStr("v"));
else if (ctx.Match(k, Invk__max_results)) return Int_.To_str(max_results);
else if (ctx.Match(k, Invk__max_results_)) max_results = m.ReadInt("v");
else if (ctx.Match(k, Invk__auto_wildcard)) return Yn.To_str(auto_wildcard);
else if (ctx.Match(k, Invk__auto_wildcard_)) auto_wildcard = m.ReadBool("v");
else if (ctx.Match(k, Invk__ns_ids)) return Int_.To_str(ns_mgr.To_int_ary(), "|");
else if (ctx.Match(k, Invk__ns_ids_)) Ns_ids_(m.ReadStr("v"));
else if (ctx.Match(k, Invk__symbols)) return String_.new_u8(syms.To_bry());
else if (ctx.Match(k, Invk__symbols_)) syms.Parse(m.ReadBry("v"));
else if (ctx.Match(k, Invk__visible_rows)) return Int_.To_str(visible_rows);
else if (ctx.Match(k, Invk__visible_rows_)) {visible_rows = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt__visible_rows_changed, visible_rows);}
else if (ctx.Match(k, Invk__jump_len)) return Int_.To_str(jump_len);
else if (ctx.Match(k, Invk__jump_len_)) {jump_len = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt__jump_len_changed, jump_len);}
else return GfoInvkAble_.Rv_unhandled;
return this;
}
private static final String
Invk__enabled = "enabled" , Invk__enabled_ = "enabled_"
, Invk__search_mode = "search_mode" , Invk__search_mode_ = "search_mode_"
, Invk__max_results = "max_results" , Invk__max_results_ = "max_results_"
, Invk__auto_wildcard = "auto_wildcard" , Invk__auto_wildcard_ = "auto_wildcard_"
, Invk__ns_ids = "ns_ids" , Invk__ns_ids_ = "ns_ids_"
, Invk__symbols = "symbols" , Invk__symbols_ = "symbols_"
, Invk__visible_rows = "visible_rows" , Invk__visible_rows_ = "visible_rows_"
, Invk__jump_len = "jump_len" , Invk__jump_len_ = "jump_len_"
;
public static final String
Evt__visible_rows_changed = "visible_rows_changed"
, Evt__jump_len_changed = "jump_len_changed"
, Evt__ns_ids_changed = "ns_ids_changed"
;
}

View File

@@ -16,8 +16,9 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.bldrs.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*;
import gplx.core.ios.*; import gplx.xowa.wikis.data.*;
import gplx.core.ios.*; import gplx.xowa.wikis.data.*; import gplx.xowa.apps.apis.xowa.bldrs.imports.page_ranks.*;
public class Xoapi_import implements GfoInvkAble {
public Xoapi_page_rank Page_rank() {return page_rank;} private final Xoapi_page_rank page_rank = new Xoapi_page_rank();
public long Layout_all_max() {return layout_all_max;} private long layout_all_max = 0; // disable by default; may set to 200 MB in future
public long Layout_text_max() {return layout_text_max;} private long layout_text_max = Io_size_.To_long_by_int_mb(1500); // 1.5 GB
public long Layout_html_max() {return layout_html_max;} private long layout_html_max = Io_size_.To_long_by_int_mb(1500); // 1.5 GB
@@ -77,10 +78,11 @@ public class Xoapi_import implements GfoInvkAble {
else if (ctx.Match(k, Invk_hzip_mode_is_b256_)) hzip_mode_is_b256 = m.ReadYn("v");
else if (ctx.Match(k, Invk_user_name)) return user_name;
else if (ctx.Match(k, Invk_user_name_)) user_name = m.ReadStr("v");
else if (ctx.Match(k, Invk_page_rank)) return page_rank;
else return GfoInvkAble_.Rv_unhandled;
return this;
}
private static KeyVal[] Options_zip_tid__list = KeyVal_.Ary(KeyVal_.new_("raw", "text"), KeyVal_.new_("gzip"), KeyVal_.new_("bzip2"));
private static Keyval[] Options_zip_tid__list = Keyval_.Ary(Keyval_.new_("raw", "text"), Keyval_.new_("gzip"), Keyval_.new_("bzip2"));
private static final String
Invk_layout_all_max = "layout_all_max" , Invk_layout_all_max_ = "layout_all_max_"
, Invk_layout_text_max = "layout_text_max" , Invk_layout_text_max_ = "layout_text_max_"
@@ -96,6 +98,7 @@ public class Xoapi_import implements GfoInvkAble {
, Invk_user_name = "user_name" , Invk_user_name_ = "user_name_"
, Invk_hzip_enabled = "hzip_enabled" , Invk_hzip_enabled_ = "hzip_enabled_"
, Invk_hzip_mode_is_b256 = "hzip_mode_is_b256" , Invk_hzip_mode_is_b256_ = "hzip_mode_is_b256_"
, Invk_page_rank = "page_rank"
;
public static final byte[] Ns_file_map__each = Bry_.new_a7("<each>");
}

View File

@@ -0,0 +1,30 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.bldrs.imports.page_ranks; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*; import gplx.xowa.apps.apis.xowa.bldrs.imports.*;
public class Xoapi_page_rank implements GfoInvkAble {
public int Iteration_max() {return iteration_max;} private int iteration_max = 0;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_iteration_max)) return Int_.To_str(iteration_max);
else if (ctx.Match(k, Invk_iteration_max_)) iteration_max = m.ReadInt("v");
else return GfoInvkAble_.Rv_unhandled;
return this;
}
private static final String
Invk_iteration_max = "iteration_max" , Invk_iteration_max_ = "iteration_max_"
;
}

View File

@@ -40,7 +40,7 @@ public class Xoapi_font implements GfoInvkAble {
app.Gui_mgr().Win_cfg().Font().Size_(gui_font_size);
app.Cfg_mgr().Set_by_app("app.gui.win_opts.font.size", Float_.To_str(gui_font_size));
app.Cfg_mgr().Db_save_txt();
app.Gui_mgr().Browser_win().Page__reload(); // NOTE: force reload; needed if viewing Help:Options/HTML, else Font size won't update
app.Gui_mgr().Browser_win().Page__reload(); // NOTE: force reload; needed if viewing home/wiki/Options/HTML, else Font size won't update
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_increase)) this.Increase();

View File

@@ -40,7 +40,8 @@ public class Xoapi_find implements GfoInvkAble {
}
class Xog_find_box {
private Xoae_app app; private Xog_win_itm win; private GfuiTextBox find_box;
private String prv_find_text; private boolean dir_fwd = true, case_match = false, wrap_search = true;
private String prv_find_text = ""; // NOTE: must set to "", else will fail during Hide
private boolean dir_fwd = true, case_match = false, wrap_search = true;
public Xog_find_box(Xoae_app app) {
this.app = app;
this.win = app.Gui_mgr().Browser_win();
@@ -66,7 +67,7 @@ class Xog_find_box {
win.Usr_dlg().Prog_direct("Find direction changed to " + (fwd ? "forward" : "backward"));
}
public void Exec() {
prv_find_text = find_box.Text();
prv_find_text = find_box.Text();
Exec_find(prv_find_text, Bool_.Y);
}
private void Exec_find(String find, boolean highlight_matches) {

View File

@@ -18,9 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
import gplx.gfui.*; import gplx.xowa.guis.views.*; import gplx.core.envs.*;
public class Xoapi_url implements GfoInvkAble {
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
private GfuiTextBox Url_box() {return app.Gui_mgr().Browser_win().Url_box();}
public void Focus() {this.Url_box().Focus_select_all();}
private Xoae_app app;
private Xoapi_url_searcher url_searcher;
public void Init_by_kit(Xoae_app app) {
this.app = app;
this.url_searcher = new Xoapi_url_searcher(app);
}
private GfuiComboBox Url_box() {return app.Gui_mgr().Browser_win().Url_box();}
public void Focus() {this.Url_box().Focus(); this.Url_box().Sel_(0, String_.Len(this.Url_box().Text()));}
public void Exec() {Exec_wkr(Bool_.N, this.Url_box().Text());}
public void Exec_by_paste() {Exec_wkr(Bool_.N, ClipboardAdp_.GetText());}
public void Exec_new_tab_by_paste() {Exec_wkr(Bool_.Y, ClipboardAdp_.GetText());}
@@ -28,15 +33,29 @@ public class Xoapi_url implements GfoInvkAble {
Xog_tab_itm tab = app.Gui_mgr().Browser_win().Active_tab(); if (tab == Xog_tab_itm_.Null) return;
this.Url_box().Text_(tab.Page().Url().To_str());
}
public void Type() {
url_searcher.Search();
}
private void Exec_wkr(boolean new_tab, String urls_text) {
if (Op_sys.Cur().Tid_is_wnt())
urls_text = String_.Replace(urls_text, Op_sys.Wnt.Nl_str(), Op_sys.Lnx.Nl_str());
String[] urls = String_.Split(String_.Trim(urls_text), Op_sys.Lnx.Nl_str());
int urls_len = urls.length;
if (urls_len == 0) return;
if (urls_len == 1) {
if (urls_len == 1) { // 1 url; most cases
String url = urls[0];
this.Url_box().Text_(url);
gplx.core.threads.Thread_adp_.Sleep(1); // HACK: sleep 1 ms, else rapid keystrokes may cause last keystroke to not register; EX: typing "w:" may show just "w" instead of "w:"; DATE:2016-03-27
GfuiComboBox combo = this.Url_box();
String[] itms_ary = combo.DataSource_as_str_ary();
if ( itms_ary.length > 0 // results exist...
&& combo.List_visible()) { // and dropdown is visible; use selected-item
int sel_idx = combo.List_sel_idx(); // get selected item
if (sel_idx == -1) sel_idx = 0; // if nothing selected, default to 1st; allows typing first few characters and picking 1st item from list
String itms_sel = itms_ary[sel_idx];
// if (String_.Has(String_.Lower(itms_sel), String_.Lower(url))) // make sure itms_sel contains url; handles slow machines, where dropdown may not be updated yet
url = Xog_win_itm.Remove_redirect_if_exists(itms_sel);
}
combo.Text_(url);
app.Gui_mgr().Browser_win().Page__navigate_by_url_bar(url);
}
else {
@@ -54,9 +73,10 @@ public class Xoapi_url implements GfoInvkAble {
else if (ctx.Match(k, Invk_exec_by_paste)) this.Exec_by_paste();
else if (ctx.Match(k, Invk_exec_new_tab_by_paste)) this.Exec_new_tab_by_paste();
else if (ctx.Match(k, Invk_restore)) this.Restore();
else if (ctx.Match(k, Invk_type)) this.Type();
else return GfoInvkAble_.Rv_unhandled;
return this;
}
private static final String Invk_focus = "focus", Invk_exec_by_paste = "exec_by_paste", Invk_exec_new_tab_by_paste = "exec_new_tab_by_paste", Invk_restore = "restore";
private static final String Invk_focus = "focus", Invk_exec_by_paste = "exec_by_paste", Invk_exec_new_tab_by_paste = "exec_new_tab_by_paste", Invk_restore = "restore", Invk_type = "type";
public static final String Invk_exec = "exec";
}

View File

@@ -0,0 +1,74 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
import gplx.gfui.*;
import gplx.xowa.addons.searchs.*; import gplx.xowa.addons.searchs.searchers.*; import gplx.xowa.addons.searchs.searchers.cbks.*;
import gplx.xowa.apps.apis.xowa.addons.searchs.*;
import gplx.xowa.guis.views.*;
class Xoapi_url_searcher implements GfoEvObj {
private final Xoae_app app;
private final Xoapi_url_bar url_bar_api; private Srch_search_addon addon;
private final GfuiComboBox url_bar;
public Xoapi_url_searcher(Xoae_app app) { // called by Init_by_kit
this.app = app;
this.evMgr = GfoEvMgr.new_(this);
this.url_bar = app.Gui_mgr().Browser_win().Url_box();
this.url_bar_api = app.Api_root().Addon().Search().Url_bar();
GfoEvMgr_.SubSame_many(url_bar_api, this, Xoapi_url_bar.Evt__jump_len_changed, Xoapi_url_bar.Evt__visible_rows_changed, Xoapi_url_bar.Evt__ns_ids_changed);
url_bar.Items__jump_len_(url_bar_api.Jump_len());
url_bar.Items__visible_rows_(url_bar_api.Visible_rows());
}
public GfoEvMgr EvMgr() {return evMgr;} private final GfoEvMgr evMgr;
public void Search() {
if (!url_bar_api.Enabled()) return;
Xog_tab_itm active_tab = app.Gui_mgr().Browser_win().Tab_mgr().Active_tab(); if (active_tab == null) return;
Xow_wiki wiki = active_tab.Wiki();
String search_str = url_bar.Text();
url_bar.Text_fallback_(search_str);
// remove "en.wikipedia.org/wiki/"
// String url_bgn = wiki.Domain_str() + gplx.xowa.htmls.hrefs.Xoh_href_.Str__wiki;
// if (String_.Has_at_bgn(search_str, url_bgn))
// search_str = String_.Mid(search_str, String_.Len(url_bgn));
if (String_.Len_eq_0(search_str)) {
url_bar.Items__update(String_.Ary_empty);
return;
}
if (addon == null) {
addon = Srch_search_addon.Get(wiki);
}
else {
if (!Bry_.Eq(wiki.Domain_bry(), addon.Wiki_domain())) // NOTE: url_bar_api caches addon at wiki level; need to check if wiki has changed
addon = Srch_search_addon.Get(wiki);
}
if (addon.Db_mgr().Cfg().Version_id__needs_upgrade()) return; // exit early, else will flash "searching" message below; note that url-bar should not trigger upgrade;
url_bar.List_sel_idx_(0); // clear selected list item; EX: search "a" -> page down; sel is row #5 -> search "b" -> sel should not be #5; DATE:2016-03-24
if (!url_bar.List_visible()) url_bar.Items__size_to_fit(url_bar_api.Max_results()); // resize offscreen; handles 1st search when dropdown flashes briefly in middle of screen before being moved under bar; DATE:2016-03-24
Srch_search_qry qry = Srch_search_qry.New__url_bar(wiki, url_bar_api, Bry_.new_u8(search_str));
Srch_rslt_cbk__url_bar cbk = new Srch_rslt_cbk__url_bar(app, url_bar, url_bar_api);
Xoa_app_.Usr_dlg().Prog_one("", "", "searching (please wait): ~{0}", search_str);
addon.Search(qry, cbk);
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Xoapi_url_bar.Evt__jump_len_changed)) {url_bar.Items__jump_len_(m.ReadInt("v"));}
else if (ctx.Match(k, Xoapi_url_bar.Evt__visible_rows_changed)) {url_bar.Items__visible_rows_(m.ReadInt("v"));}
else if (ctx.Match(k, Xoapi_url_bar.Evt__ns_ids_changed)) {if (addon != null) addon.Clear_rslts_cache();} // invalidate cache when ns changes; else ns_0 rslts will show up in ns_100; DATE:2016-03-24
return this;
}
}

View File

@@ -182,7 +182,7 @@ public class Xoapi_popups implements GfoInvkAble, GfoEvMgrOwner {
, Evt_html_fmtr_wiki_changed = "html_fmtr_wiki_changed"
, Evt_html_fmtr_next_sect_changed = "html_fmtr_next_sect_changed"
;
public static final byte[]
public static final byte[]
Dflt_xnde_ignore_ids = Bry_.new_a7("coordinates")
, Dflt_tmpl_keeplist = Bry_.new_a7("en.wikipedia.org|formatnum;age;age_in_days;age_in_years_and_days*;nts;number_table_sorting*;as_of;oldstyledatedy;gregorian_serial_date;currentminute;currentsecond;dmca;spaced_ndash;trim;month*;convert*;worldpop*;ipa*;lang*;nowrap*;h:*;mvar;math;vgy;audio;iso_639_name;transl;translate;linktext;zh;nihongo*;japanese_name;ko-hhrm;mp|\n")
, Dflt_html_fmtr_popup = Bry_.new_a7(String_.Concat_lines_nl_skip_last
@@ -204,7 +204,7 @@ public class Xoapi_popups implements GfoInvkAble, GfoEvMgrOwner {
, " <span><a href='xowa-cmd:xowa.api.html.modules.popups.show_more(\"~{popup_id}\");' title='~{<>msgs.get('api-xowa.html.modules.popups.show_more-tip');<>}'><img src='~{xowa_root_dir}bin/any/xowa/html/res/src/xowa/popups/imgs/show_more.png'></a></span>"
, " <span><a href='xowa-cmd:xowa.api.html.modules.popups.show_all (\"~{popup_id}\");' title='~{<>msgs.get('api-xowa.html.modules.popups.show_all-tip');<>}'> <img src='~{xowa_root_dir}bin/any/xowa/html/res/src/xowa/popups/imgs/show_all.png' ></a></span>"
, " <span><a href='/wiki/Special:XowaPopupHistory' title='~{<>msgs.get('api-xowa.html.modules.popups.history-tip');<>}'><img src='~{xowa_root_dir}bin/any/xowa/file/app.menu/history/show.png'></a></span>"
, " <span><a href='xowa-cmd:xowa.api.gui.browser.tabs.new_link__at_dflt__focus_y(\"home/wiki/Help:Options/Popups\");' title='~{<>msgs.get('api-xowa.nav.cfg.main-name');<>}'><img src='~{xowa_root_dir}bin/any/xowa/file/app.menu/tools/options.png'></a></span>"
, " <span><a href='xowa-cmd:xowa.api.gui.browser.tabs.new_link__at_dflt__focus_y(\"home/wiki/Options/Popups\");' title='~{<>msgs.get('api-xowa.nav.cfg.main-name');<>}'><img src='~{xowa_root_dir}bin/any/xowa/file/app.menu/tools/options.png'></a></span>" // HOME
, " </div>"
, "</div>"
))
@@ -212,13 +212,13 @@ public class Xoapi_popups implements GfoInvkAble, GfoEvMgrOwner {
, Dflt_html_fmtr_wiki = Bry_.new_a7("\n <span class='data_key'>~{<>msgs.get('api-xowa.html.modules.popups.msgs.wiki-name');<>}</span><span class='data_val'>~{wiki_val}</span>")
, Dflt_html_fmtr_next_sect = Bry_.new_a7("\n\n<span class='next_sect'>~{<>msgs.get('api-xowa.html.modules.popups.msgs.next_sect-name');<>}~{next_sect_val}</span>")
;
public static final String[]
public static final String[]
Dflt_html_fmtr_popup_keys = String_.Ary("content", "page_lang_ltr", "page_url", "page_title", "popup_id", "wiki_item", "page_size", "edit_time", "view_time_item", "xowa_root_dir")
, Dflt_html_fmtr_viewed_keys = String_.Ary("viewed_val")
, Dflt_html_fmtr_wiki_keys = String_.Ary("wiki_val")
, Dflt_html_fmtr_next_sect_keys = String_.Ary("next_sect_val")
;
public static final byte[]
public static final byte[]
Dflt_ns_allowed = Bry_.Empty
;
public static final int

View File

@@ -18,15 +18,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.apps.apis.xowa.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.domains.crts.*;
public class Xoapi_search implements GfoInvkAble, GfoEvMgrOwner {
private final Xow_domain_crt_kv_itm_mgr multi_wikis_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_wikis_bry = Dflt_multi_wikis_bry;
private final Xow_domain_crt_kv_itm_mgr multi_sorts_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_sorts_bry = Dflt_multi_sorts_bry;
private final Xow_domain_crt_kv_itm_mgr multi_wikis_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_wikis_bry = Dflt_multi_wikis_bry;
private final Xow_domain_crt_kv_itm_mgr multi_sorts_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_sorts_bry = Dflt_multi_sorts_bry;
public Xoapi_search() {
this.evMgr = GfoEvMgr.new_(this);
multi_wikis_mgr.Parse_as_itms(multi_wikis_bry);
multi_sorts_mgr.Parse_as_arys(multi_sorts_bry);
}
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
public int Results_per_page() {return results_per_page;} private int results_per_page = 20;
public int Results_per_page() {return results_per_page;} private int results_per_page = 100;
public boolean Async_db() {return async_db;} private boolean async_db = true;
public void Multi_wikis_bry_(byte[] v) {
if (!multi_wikis_mgr.Parse_as_itms(v)) return;
@@ -66,7 +66,7 @@ public class Xoapi_search implements GfoInvkAble, GfoEvMgrOwner {
Evt_multi_wikis_changed = "multi_wikis_changed"
, Evt_multi_sorts_changed = "multi_sorts_changed"
;
public static final byte[]
public static final byte[]
Dflt_multi_wikis_bry = Bry_.new_a7("<any>|<self>")
, Dflt_multi_sorts_bry = Bry_.new_a7("<any>|<self>,*.wikipedia,*.wikivoyage,*.wiktionary,*.wikisource,*.wikiquote,*.wikibooks,*.wikiversity,*.wikinews")
;

View File

@@ -35,5 +35,5 @@ public class Xoapi_startup_tabs_tid_ {
else if (String_.Eq(s, Key_custom)) return Tid_custom;
else throw Err_.new_unimplemented();
}
public static KeyVal[] Options__list = KeyVal_.Ary(KeyVal_.new_(Key_blank), KeyVal_.new_(Key_xowa), KeyVal_.new_(Key_previous), KeyVal_.new_(Key_custom));
public static Keyval[] Options__list = Keyval_.Ary(Keyval_.new_(Key_blank), Keyval_.new_(Key_xowa), Keyval_.new_(Key_previous), Keyval_.new_(Key_custom));
}

View File

@@ -23,10 +23,10 @@ public class Xoapi_cache implements GfoInvkAble {
private String Info() {
cache_mgr.Page_bgn();
Bry_bfr bfr = Bry_bfr.new_(255);
KeyVal[] ary = cache_mgr.Info();
Keyval[] ary = cache_mgr.Info();
int len = ary.length;
for (int i = 0; i < len; ++i) {
KeyVal kv = ary[i];
Keyval kv = ary[i];
bfr.Add_str_a7(kv.Key()).Add_str_a7(": ").Add_str_u8(kv.Val_to_str_or_empty()).Add_byte_nl();
}
return bfr.To_str_and_clear();

View File

@@ -43,7 +43,7 @@ public class Xoa_cfg_mgr_tst {
class Xoa_cfg_mgr_fxt {
public void Clear() {
// if (app == null) {
app = Xoa_app_fxt.app_();
app = Xoa_app_fxt.Make__app__edit();
cfg_mgr = app.Cfg_mgr();
// }
} private Xoae_app app; Xoa_cfg_mgr cfg_mgr;

View File

@@ -46,5 +46,5 @@ class Xocfg_new_tab_pos {
default: throw Err_.new_unhandled(v);
}
}
public static KeyVal[] Options__all = KeyVal_.Ary(KeyVal_.new_(Key_all_bgn), KeyVal_.new_(Key_all_end), KeyVal_.new_(Key_cur_prv), KeyVal_.new_(Key_cur_nxt));
public static Keyval[] Options__all = Keyval_.Ary(Keyval_.new_(Key_all_bgn), Keyval_.new_(Key_all_end), Keyval_.new_(Key_cur_prv), Keyval_.new_(Key_cur_nxt));
}

View File

@@ -28,8 +28,8 @@ public class Xoa_fmtr_itm_tst {
class Xoa_fmtr_itm_fxt {
private Xoae_app app; private Xoa_fmtr_itm itm;
public void Clear() {
app = Xoa_app_fxt.app_();
Xoa_app_fxt.wiki_tst_(app); // create enwiki
app = Xoa_app_fxt.Make__app__edit();
Xoa_app_fxt.Make__wiki__edit(app); // create enwiki
itm = new Xoa_fmtr_itm(app);
GfsCore.Instance.MsgParser_(gplx.langs.gfs.Gfs_msg_bldr.Instance);
}

View File

@@ -32,5 +32,5 @@ class File_retrieve_mode {
else throw Err_.new_unimplemented();
}
public static final byte Mode_skip = 1, Mode_wait = 2, Mode_async_server = 3;
public static KeyVal[] Options__list = KeyVal_.Ary(KeyVal_.new_("wait"), KeyVal_.new_("skip"), KeyVal_.new_("async_server", "async server"));
public static Keyval[] Options__list = Keyval_.Ary(Keyval_.new_("wait"), Keyval_.new_("skip"), Keyval_.new_("async_server", "async server"));
}

View File

@@ -30,7 +30,7 @@ public class Http_server_wkr__tst {
class Http_server_wkr__fxt {
private Xoae_app app;
public void Clear() {
this.app = Xoa_app_fxt.app_();
this.app = Xoa_app_fxt.Make__app__edit();
}
public void Init_wiki_main_page(String domain, String main_page) {
Xowe_wiki wiki = app.Wiki_mgr().Get_by_or_make(Bry_.new_u8(domain));

View File

@@ -29,7 +29,7 @@ public class Xosrv_server_tst {
}
class Xosrv_server_fxt {
public Xosrv_server_fxt Clear() {
app = Xoa_app_fxt.app_();
app = Xoa_app_fxt.Make__app__edit();
Xoa_app_fxt.Init_gui(app, null); // NOTE: null wiki does not matter for test
return this;
} private Xoae_app app;

View File

@@ -74,9 +74,9 @@ class Xoa_site_cfg_mgr_fxt {
public Xoa_site_cfg_mgr_fxt() {
// Xoa_app_.Usr_dlg_(Xoa_app_.usr_dlg_console_());
Xoa_test_.Inet__init();
this.app = Xoa_app_fxt.app_();
this.wiki = Xoa_app_fxt.wiki_tst_(app);
Xoa_test_.Db__init__mem(wiki);
this.app = Xoa_app_fxt.Make__app__edit();
this.wiki = Xoa_app_fxt.Make__wiki__edit(app);
Xoa_test_.Init__db__edit(wiki);
this.cfg_tbl = wiki.Data__core_mgr().Tbl__cfg();
this.site_cfg_mgr = app.Site_cfg_mgr();
}

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url__basic__tst {
private final Xoa_url_fxt fxt = new Xoa_url_fxt();
private final Xoa_url_fxt fxt = new Xoa_url_fxt();
@Test public void Eq_page() {
fxt.Test_eq_page(Bool_.Y, "en.wikipedia.org/wiki/A?redirect=yes", "en.wikipedia.org/wiki/A?redirect=yes");
fxt.Test_eq_page(Bool_.N, "en.wikipedia.org/wiki/A?redirect=no" , "en.wikipedia.org/wiki/A?redirect=yes");
}
}
class Xoa_url_fxt extends Xoa_url_parser_fxt { public void Test_eq_page(boolean expd, String lhs_str, String rhs_str) {
class Xoa_url_fxt extends Xow_url_parser_fxt { public void Test_eq_page(boolean expd, String lhs_str, String rhs_str) {
Xoa_url lhs_url = parser.Parse(Bry_.new_u8(lhs_str));
Xoa_url rhs_url = parser.Parse(Bry_.new_u8(rhs_str));
Tfds.Eq_bool(expd, lhs_url.Eq_page(rhs_url), "Eq_page");

View File

@@ -19,7 +19,7 @@ package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa
import org.junit.*; import gplx.xowa.htmls.hrefs.*;
import gplx.xowa.wikis.nss.*;
public class Xoa_url__to_str__tst {
private final Xoa_url__to_str__fxt fxt = new Xoa_url__to_str__fxt();
private final Xoa_url__to_str__fxt fxt = new Xoa_url__to_str__fxt();
@Test public void Http() {fxt.Chk_to_str_href(Bool_.N, "http://a.org/b" , "http://a.org/b");}
@Test public void File() {fxt.Chk_to_str_href(Bool_.N, "file:///C/xowa/file/a.png" , "file:///C/xowa/file/a.png");}
@Test public void Abrv__page() {fxt.Chk_to_str_href(Bool_.N, "/wiki/A" , "A");}
@@ -46,11 +46,11 @@ public class Xoa_url__to_str__tst {
}
@Test public void Unknown() {fxt.Chk_to_str_href(Bool_.N, "/wiki/{{{extlink}}}" , "");} // {{{extlink}}} not a valid title; return empty
}
class Xoa_url__to_str__fxt extends Xoa_url_parser_fxt { private final Xoh_href_parser href_parser = new Xoh_href_parser();
class Xoa_url__to_str__fxt extends Xow_url_parser_fxt { private final Xoh_href_parser href_parser = new Xoh_href_parser();
public void Chk_to_str_href(boolean full, String raw, String expd) {Chk_to_str_href(cur_wiki, full, raw, expd);}
public void Chk_to_str_href(Xowe_wiki wiki, boolean full, String raw, String expd) {
href_parser.Parse_as_url(actl_url, Bry_.new_u8(raw), wiki, Bry__page);
this.Chk_to_str(full, expd);
}
private static final byte[] Bry__page = Bry_.new_a7("Page_1");
private static final byte[] Bry__page = Bry_.new_a7("Page_1");
}

View File

@@ -21,19 +21,19 @@ import gplx.xowa.htmls.hrefs.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.vnts.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.files.*;
public class Xoa_url_parser {
private final Gfo_url_encoder encoder;
private final Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
private final Gfo_url_parser url_parser = new Gfo_url_parser(); private final Gfo_url gfo_url = new Gfo_url();
private final Xoa_app app; private final Xow_wiki wiki; private final byte[] domain_bry;
public class Xow_url_parser {
private final Gfo_url_encoder encoder;
private final Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
private final Gfo_url_parser url_parser = new Gfo_url_parser(); private final Gfo_url gfo_url = new Gfo_url();
private final Xoa_app app; private final Xow_wiki wiki; private final byte[] domain_bry;
private byte tmp_protocol_tid;
private int tmp_tid;
private byte[] tmp_raw, tmp_wiki, tmp_page, tmp_anch, tmp_protocol_bry; private Gfo_qarg_itm[] tmp_qargs;
private byte[][] tmp_segs; private int tmp_segs_len;
private boolean tmp_protocol_is_relative, tmp_page_is_main, tmp_wiki_is_missing;
private byte[] tmp_vnt;
private final Xol_vnt_mgr vnt_mgr;
public Xoa_url_parser(Xow_wiki wiki) {
private final Xol_vnt_mgr vnt_mgr;
public Xow_url_parser(Xow_wiki wiki) {
this.app = wiki.App();
this.wiki = wiki; this.domain_bry = wiki.Domain_bry();
this.encoder = gplx.langs.htmls.encoders.Gfo_url_encoder_.Xourl;
@@ -53,6 +53,8 @@ public class Xoa_url_parser {
Xow_wiki wiki_itm = app.Wiki_mgri().Get_by_or_make_init_y(wiki_bry); // NOTE: must call Init to load Main_Page; only call if from url_bar, else all sister wikis will be loaded when parsing Sister_wikis panel
rv.Page_bry_(wiki_itm.Props().Main_page());
}
Xoa_ttl ttl = wiki.Ttl_parse(rv.Page_bry()); // parse to ttl to get proper casing; EX: "earth" -> "Earth" x> "earth"; DATE:2016-03-25
rv.Page_bry_(ttl.Full_db());
return rv;
}
public Gfo_url_parser Url_parser() {return url_parser;}
@@ -302,13 +304,13 @@ public class Xoa_url_parser {
if (v[pos + 2] != Byte_ascii.Dot) return v;
return Bry_.Add(Bry_.Mid(v, 0, pos), Bry_.Mid(v, pos + 2)); // skip ".m"
}
private static final byte[] Qarg__title = Bry_.new_a7("title");
private static final byte[]
private static final byte[] Qarg__title = Bry_.new_a7("title");
private static final byte[]
Bry_upload_wikimedia_org = Bry_.new_a7("upload.wikimedia.org")
, Bry_file = Bry_.new_a7("File:") // NOTE: File does not need i18n; is a canonical namespace
, Bry_wiki = Bry_.new_a7("wiki")
;
public static final byte[]
public static final byte[]
Bry_dot_org = Bry_.new_a7(".org")
;
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__proto_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__proto_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Relative() {
tstr.Run_parse("//en.wikipedia.org/wiki/A").Chk_wiki("en.wikipedia.org").Chk_page("A");
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__qarg_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__qarg_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Redirect() {
tstr.Run_parse("A?redirect=no").Chk_wiki("en.wikipedia.org").Chk_page("A").Chk_qargs("?redirect=no");
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__ttl_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__ttl_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Name() {
tstr.Run_parse("A").Chk_wiki("en.wikipedia.org").Chk_page("A");
}

View File

@@ -17,25 +17,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__url_bar_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__url_bar_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Basic() {
tstr.Run_parse_from_url_bar("Page_1").Chk_to_str("en.wikipedia.org/wiki/Page_1"); // basic
tstr.Run_parse_from_url_bar("Page_1").Chk_to_str("en.wikipedia.org/wiki/Page_1"); // basic
}
@Test public void Lang() {
tstr.Prep_add_xwiki_to_user("uk", "uk.wikipedia.org");
tstr.Run_parse_from_url_bar("uk").Chk_to_str("en.wikipedia.org/wiki/uk"); // lang-like page (uk=Ukraine) should not try to open wiki; DATE:2014-02-07
tstr.Run_parse_from_url_bar("uk").Chk_to_str("en.wikipedia.org/wiki/Uk"); // lang-like page (uk=Ukraine) should not try to open wiki; DATE:2014-02-07
}
@Test public void Lang_like() {
tstr.Prep_add_xwiki_to_user("uk", "uk.wikipedia.org", "http://~{1}.wikipedia.org"); // NOTE: fmt needed for Type_is_lang
tstr.Run_parse_from_url_bar("uk/A").Chk_to_str("en.wikipedia.org/wiki/uk/A"); // uk/A should not try be interpreted as wiki="uk" page="A"; DATE:2014-04-26
tstr.Run_parse_from_url_bar("uk/A").Chk_to_str("en.wikipedia.org/wiki/Uk/A"); // uk/A should not try be interpreted as wiki="uk" page="A"; DATE:2014-04-26
}
@Test public void Macro() {
tstr.Prep_add_xwiki_to_user("fr.wikisource.org");
tstr.Run_parse_from_url_bar("fr.s:Auteur:Shakespeare").Chk_to_str("fr.wikisource.org/wiki/Auteur:Shakespeare"); // url_macros
}
@Test public void Main_page__home() {
tstr.Run_parse_from_url_bar("home").Chk_to_str("en.wikipedia.org/wiki/home"); // home should go to current wiki's home; DATE:2014-02-09
tstr.Run_parse_from_url_bar("home").Chk_to_str("en.wikipedia.org/wiki/Home"); // home should go to current wiki's home; DATE:2014-02-09
tstr.Run_parse_from_url_bar("home/wiki/Main_Page").Chk_to_str("home/wiki/Main_Page"); // home Main_Page should go to home; DATE:2014-02-09
}
@Test public void Main_page__zhw() {
@@ -52,7 +52,7 @@ public class Xoa_url_parser__url_bar_tst {
tstr.Run_parse_from_url_bar("A." ).Chk_to_str("en.wikipedia.org/wiki/A."); // bounds-check: 1
tstr.Run_parse_from_url_bar("A.b" ).Chk_to_str("en.wikipedia.org/wiki/A.b"); // bounds-check: 2
tstr.Run_parse_from_url_bar("A.b.m." ).Chk_to_str("en.wikipedia.org/wiki/A.b.m."); // false-match
tstr.Run_parse_from_url_bar("en.x.wikipedia.org/wiki/A" ).Chk_to_str("en.wikipedia.org/wiki/en.x.wikipedia.org/wiki/A"); // fail
tstr.Run_parse_from_url_bar("en.x.wikipedia.org/wiki/A" ).Chk_to_str("en.wikipedia.org/wiki/En.x.wikipedia.org/wiki/A"); // fail
}
@Test public void Missing_page() {
tstr.Run_parse_from_url_bar("http://a.org").Chk_is_null(); // unknown wiki; return null;
@@ -60,6 +60,9 @@ public class Xoa_url_parser__url_bar_tst {
}
@Test public void Invalid_names() {
tstr.Run_parse_from_url_bar("http://a/b/c").Chk_is_null(); // unknown url
tstr.Run_parse_from_url_bar("war").Chk_to_str("en.wikipedia.org/wiki/war"); // word looks like lang, but is actually page; default to current
tstr.Run_parse_from_url_bar("war").Chk_to_str("en.wikipedia.org/wiki/War"); // word looks like lang, but is actually page; default to current
}
@Test public void Proper_case() {
tstr.Run_parse_from_url_bar("a" ).Chk_to_str("en.wikipedia.org/wiki/A"); // "a" -> "A" x> "a"
}
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__wiki_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__wiki_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Basic() {
tstr.Run_parse("en.wikipedia.org/wiki/A").Chk_tid(Xoa_url_.Tid_page).Chk_wiki("en.wikipedia.org").Chk_page("A");
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*;
public class Xoa_url_parser__xcmd_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__xcmd_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Basic() {
tstr.Run_parse("xowa-cmd:xowa.app.version").Chk_tid(Xoa_url_.Tid_xcmd).Chk_page("xowa.app.version");
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import org.junit.*; import gplx.xowa.wikis.nss.*;
public class Xoa_url_parser__xwiki_tst {
private final Xoa_url_parser_fxt tstr = new Xoa_url_parser_fxt();
public class Xow_url_parser__xwiki_tst {
private final Xow_url_parser_fxt tstr = new Xow_url_parser_fxt();
@Test public void Commons() { // PURPOSE: "C" was being picked up as an xwiki to commons; PAGE:no.b:C/Variabler; DATE:2014-10-14
tstr.Prep_add_xwiki_to_user("c", "commons.wikimedia.org"); // add alias of "c"
tstr.Run_parse("C/D").Chk_tid(Xoa_url_.Tid_page).Chk_wiki("en.wikipedia.org").Chk_page("C/D"); // should use current wiki (enwiki), not xwiki to commons; also, page should be "C/D", not "D"

View File

@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import gplx.xowa.wikis.nss.*;
public class Xoa_url_parser_fxt {
protected final Xoae_app app; protected final Xowe_wiki cur_wiki;
protected final Xoa_url_parser parser;
public class Xow_url_parser_fxt {
protected final Xoae_app app; protected final Xowe_wiki cur_wiki;
protected final Xow_url_parser parser;
protected Xoa_url actl_url;
public Xoa_url_parser_fxt() {
this.app = Xoa_app_fxt.app_();
public Xow_url_parser_fxt() {
this.app = Xoa_app_fxt.Make__app__edit();
this.cur_wiki = Prep_create_wiki("en.wikipedia.org");
this.parser = cur_wiki.Utl__url_parser();
this.actl_url = Xoa_url.blank(); // default to blank for subclasses
@@ -30,53 +30,53 @@ public class Xoa_url_parser_fxt {
public Xoae_app App() {return app;}
public Xowe_wiki Wiki() {return cur_wiki;}
public Xowe_wiki Prep_create_wiki(String domain) {
Xowe_wiki rv = Xoa_app_fxt.wiki_(app, domain);
Xowe_wiki rv = Xoa_app_fxt.Make__wiki__edit(app, domain);
Prep_add_xwiki_to_user(domain);
return rv;
}
public Xoa_url_parser_fxt Prep_add_xwiki_to_wiki(String alias, String domain) {return Prep_xwiki(cur_wiki, alias, domain, null);}
public Xoa_url_parser_fxt Prep_add_xwiki_to_wiki(String alias, String domain, String fmt) {return Prep_xwiki(cur_wiki, alias, domain, fmt);}
public Xoa_url_parser_fxt Prep_add_xwiki_to_user(String domain) {return Prep_xwiki(app.Usere().Wiki(), domain, domain, null);}
public Xoa_url_parser_fxt Prep_add_xwiki_to_user(String alias, String domain) {return Prep_xwiki(app.Usere().Wiki(), alias, domain, null);}
public Xoa_url_parser_fxt Prep_add_xwiki_to_user(String alias, String domain, String fmt) {return Prep_xwiki(app.Usere().Wiki(), alias, domain, fmt);}
public Xoa_url_parser_fxt Prep_xwiki(Xow_wiki wiki, String alias, String domain, String fmt) {
public Xow_url_parser_fxt Prep_add_xwiki_to_wiki(String alias, String domain) {return Prep_xwiki(cur_wiki, alias, domain, null);}
public Xow_url_parser_fxt Prep_add_xwiki_to_wiki(String alias, String domain, String fmt) {return Prep_xwiki(cur_wiki, alias, domain, fmt);}
public Xow_url_parser_fxt Prep_add_xwiki_to_user(String domain) {return Prep_xwiki(app.Usere().Wiki(), domain, domain, null);}
public Xow_url_parser_fxt Prep_add_xwiki_to_user(String alias, String domain) {return Prep_xwiki(app.Usere().Wiki(), alias, domain, null);}
public Xow_url_parser_fxt Prep_add_xwiki_to_user(String alias, String domain, String fmt) {return Prep_xwiki(app.Usere().Wiki(), alias, domain, fmt);}
public Xow_url_parser_fxt Prep_xwiki(Xow_wiki wiki, String alias, String domain, String fmt) {
wiki.Xwiki_mgr().Add_by_atrs(Bry_.new_u8(alias), Bry_.new_u8(domain), Bry_.new_u8_safe(fmt));
return this;
}
public Xow_ns_mgr Prep_get_ns_mgr_from_meta(String wiki) {
return app.Dbmeta_mgr().Ns__get_or_load(Bry_.new_u8(wiki));
}
public Xoa_url_parser_fxt Run_parse(String actl_str) {return Run_parse(cur_wiki, actl_str);}
public Xoa_url_parser_fxt Run_parse(Xow_wiki wiki, String actl_str) {
public Xow_url_parser_fxt Run_parse(String actl_str) {return Run_parse(cur_wiki, actl_str);}
public Xow_url_parser_fxt Run_parse(Xow_wiki wiki, String actl_str) {
this.actl_url = wiki.Utl__url_parser().Parse(Bry_.new_u8(actl_str));
return this;
}
public Xoa_url_parser_fxt Run_parse_reuse(String actl_str) {
public Xow_url_parser_fxt Run_parse_reuse(String actl_str) {
this.actl_url = parser.Parse(Bry_.new_u8(actl_str));
return this;
}
public Xoa_url_parser_fxt Run_parse_from_url_bar(String raw) {
public Xow_url_parser_fxt Run_parse_from_url_bar(String raw) {
this.actl_url = parser.Parse_by_urlbar_or_null(raw);
return this;
}
public Xoa_url_parser_fxt Chk_tid(int v) {Tfds.Eq_int(v, actl_url.Tid() , "tid"); return this;}
public Xoa_url_parser_fxt Chk_is_null() {Tfds.Eq_bool(true, actl_url == null); return this;}
public Xoa_url_parser_fxt Chk_vnt(String v) {Tfds.Eq_str(v, actl_url.Vnt_bry() , "vnt"); return this;}
public Xoa_url_parser_fxt Chk_wiki(String v) {Tfds.Eq_str(v, actl_url.Wiki_bry() , "wiki"); return this;}
public Xoa_url_parser_fxt Chk_wiki_is_missing(boolean v) {Tfds.Eq_bool(v, actl_url.Wiki_is_missing(), "wiki_is_missing"); return this;}
public Xoa_url_parser_fxt Chk_page(String v) {Tfds.Eq_str(v, actl_url.Page_bry() , "page"); return this;}
public Xoa_url_parser_fxt Chk_qargs(String v) {Tfds.Eq_str(v, actl_url.Qargs_mgr().To_bry(), "qargs"); return this;}
public Xoa_url_parser_fxt Chk_page_is_main_y() {return Chk_page_is_main(Bool_.Y);}
public Xoa_url_parser_fxt Chk_page_is_main_n() {return Chk_page_is_main(Bool_.N);}
public Xoa_url_parser_fxt Chk_page_is_main(boolean v) {Tfds.Eq_bool(v, actl_url.Page_is_main() , "page_is_main"); return this;}
public Xoa_url_parser_fxt Chk_anch(String v) {Tfds.Eq_str(v, actl_url.Anch_bry(), "anch"); return this;}
public Xoa_url_parser_fxt Chk_action_is_edit_y() {return Chk_action_is_edit_(Bool_.Y);}
public Xoa_url_parser_fxt Chk_action_is_edit_n() {return Chk_action_is_edit_(Bool_.N);}
private Xoa_url_parser_fxt Chk_action_is_edit_(boolean v) {Tfds.Eq_bool(v, actl_url.Qargs_mgr().Match(Xoa_url_.Qarg__action, Xoa_url_.Qarg__action__edit), "action_is_edit"); return this;}
public Xoa_url_parser_fxt Chk_to_str(String v) {return Chk_to_str(Bool_.Y, v);}
public Xoa_url_parser_fxt Chk_to_str(boolean full, String v) {Tfds.Eq_str(v, actl_url.To_bry(full, Bool_.Y), "To_bry"); return this;}
public Xoa_url_parser_fxt Chk_build_str_is_same() {
Xoa_url_parser parser = new Xoa_url_parser(cur_wiki);
public Xow_url_parser_fxt Chk_tid(int v) {Tfds.Eq_int(v, actl_url.Tid() , "tid"); return this;}
public Xow_url_parser_fxt Chk_is_null() {Tfds.Eq_bool(true, actl_url == null); return this;}
public Xow_url_parser_fxt Chk_vnt(String v) {Tfds.Eq_str(v, actl_url.Vnt_bry() , "vnt"); return this;}
public Xow_url_parser_fxt Chk_wiki(String v) {Tfds.Eq_str(v, actl_url.Wiki_bry() , "wiki"); return this;}
public Xow_url_parser_fxt Chk_wiki_is_missing(boolean v) {Tfds.Eq_bool(v, actl_url.Wiki_is_missing(), "wiki_is_missing"); return this;}
public Xow_url_parser_fxt Chk_page(String v) {Tfds.Eq_str(v, actl_url.Page_bry() , "page"); return this;}
public Xow_url_parser_fxt Chk_qargs(String v) {Tfds.Eq_str(v, actl_url.Qargs_mgr().To_bry(), "qargs"); return this;}
public Xow_url_parser_fxt Chk_page_is_main_y() {return Chk_page_is_main(Bool_.Y);}
public Xow_url_parser_fxt Chk_page_is_main_n() {return Chk_page_is_main(Bool_.N);}
public Xow_url_parser_fxt Chk_page_is_main(boolean v) {Tfds.Eq_bool(v, actl_url.Page_is_main() , "page_is_main"); return this;}
public Xow_url_parser_fxt Chk_anch(String v) {Tfds.Eq_str(v, actl_url.Anch_bry(), "anch"); return this;}
public Xow_url_parser_fxt Chk_action_is_edit_y() {return Chk_action_is_edit_(Bool_.Y);}
public Xow_url_parser_fxt Chk_action_is_edit_n() {return Chk_action_is_edit_(Bool_.N);}
private Xow_url_parser_fxt Chk_action_is_edit_(boolean v) {Tfds.Eq_bool(v, actl_url.Qargs_mgr().Match(Xoa_url_.Qarg__action, Xoa_url_.Qarg__action__edit), "action_is_edit"); return this;}
public Xow_url_parser_fxt Chk_to_str(String v) {return Chk_to_str(Bool_.Y, v);}
public Xow_url_parser_fxt Chk_to_str(boolean full, String v) {Tfds.Eq_str(v, actl_url.To_bry(full, Bool_.Y), "To_bry"); return this;}
public Xow_url_parser_fxt Chk_build_str_is_same() {
Xow_url_parser parser = new Xow_url_parser(cur_wiki);
Tfds.Eq_str(actl_url.Raw(), parser.Build_str(actl_url), "build_str");
return this;
}