1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-09-20 23:43:51 -04:00
parent 5fe27b5b3b
commit fa70c05354
1056 changed files with 8375 additions and 7095 deletions

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials; import gplx.*; import gplx.xowa.*;
import gplx.xowa.users.history.*;
import gplx.xowa.langs.*;
import gplx.xowa.specials.*;
import gplx.xowa.specials.allPages.*; import gplx.xowa.specials.search.*; import gplx.xowa.specials.nearby.*; import gplx.xowa.specials.randoms.*; import gplx.xowa.specials.statistics.*; import gplx.xowa.xtns.translates.*; import gplx.xowa.specials.movePage.*;
import gplx.xowa.specials.xowa.system_data.*; import gplx.xowa.specials.xowa.default_tab.*; import gplx.xowa.specials.xowa.popup_history.*; import gplx.xowa.specials.xowa.file_browsers.*; import gplx.xowa.specials.xowa.diags.*;
@@ -71,13 +72,13 @@ public class Xows_mgr {
hash.Add_str_obj(Xows_special_meta_.Key__diag , page_diag);
}
public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
int slash_pos = Bry_finder.Find_fwd(ttl.Page_txt_wo_qargs(), Xoa_ttl.Subpage_spr); // check for slash
int slash_pos = Bry_find_.Find_fwd(ttl.Page_txt_wo_qargs(), Xoa_ttl.Subpage_spr); // check for slash
byte[] special_name = slash_pos == Bry_.NotFound
? ttl.Base_txt_wo_qarg() // no slash found; use base_txt; ignore qry args and just get page_names; EX: Search/Earth?fulltext=y; Allpages?from=Earth...
: Bry_.Mid(ttl.Page_txt_wo_qargs(), 0, slash_pos); // slash found; use root page; EX: Special:ItemByTitle/enwiki/Earth
Object o = hash.Get_by_bry(special_name);
if (o == null) {
gplx.xowa.Xol_specials_itm special_itm = wiki.Lang().Specials_mgr().Get_by_alias(special_name);
Xol_specials_itm special_itm = wiki.Lang().Specials_mgr().Get_by_alias(special_name);
if (special_itm != null)
o = hash.Get_by_bry(special_itm.Special());
}

View File

@@ -17,6 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.allPages; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.primitives.*; import gplx.core.net.*;
import gplx.xowa.langs.*;
import gplx.xowa.nss.*;
import gplx.xowa.html.*; import gplx.xowa.html.hrefs.*; import gplx.xowa.html.lnkis.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.urls.*;
@@ -71,7 +73,7 @@ public class Xows_page_allpages implements GfoInvkAble, Bry_fmtr_arg, Xows_page
public int Rslt_list_len() {return rslt_list_len;} public void Rslt_list_len_(int v) {rslt_list_len = v;} private int rslt_list_len;
public Xowd_page_itm[] Rslt_list_ttls() {return rslt_list_ttls;} private Xowd_page_itm[] rslt_list_ttls;
public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
wiki.Ctx().Cur_page().Html_data().Display_ttl_(wiki.Msg_mgr().Val_by_id(Xol_msg_itm_.Id_sp_allpages_hdr));
wiki.Parser_mgr().Ctx().Cur_page().Html_data().Display_ttl_(wiki.Msg_mgr().Val_by_id(Xol_msg_itm_.Id_sp_allpages_hdr));
url.Page_bry_(Bry_.Add(Bry_.new_a7("Special:"), ttl.Page_txt_wo_qargs())); // HACK: need to re-set Page b/c href_wtr does not eliminate qargs; DATE:2013-02-08
if (wiki.Domain_tid() == Xow_domain_type_.Int__home) {wiki.Appe().Usr_dlg().Prog_many(GRP_KEY, "home.invalid", "AllPages not implemented for home wiki"); return;}
if (rslt_list_ttls == null) this.Itms_per_page_(itms_per_page);

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.allPages; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.core.net.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.nss.*;
import gplx.xowa.tdbs.hives.*;
public class Xows_page_allpages_tst {
@Before public void init() {fxt.Clear();} private Xows_page_allpages_fxt fxt = new Xows_page_allpages_fxt();
@@ -172,8 +173,8 @@ class Xows_page_allpages_fxt {
public Xows_page_allpages_fxt Test_special_gen() {
init_url = app.User().Wikii().Utl__url_parser().Parse(Xows_special_meta_.Itm__all_pages.Ttl_bry());
Xoa_ttl init_ttl = Make_init_ttl();
allpages.Special_gen(wiki, wiki.Ctx().Cur_page(), init_url, init_ttl);
if (expd_display_ttl != null) Tfds.Eq(expd_display_ttl, String_.new_u8(wiki.Ctx().Cur_page().Html_data().Display_ttl()));
allpages.Special_gen(wiki, wiki.Parser_mgr().Ctx().Cur_page(), init_url, init_ttl);
if (expd_display_ttl != null) Tfds.Eq(expd_display_ttl, String_.new_u8(wiki.Parser_mgr().Ctx().Cur_page().Html_data().Display_ttl()));
if (expd_address_page != null) Tfds.Eq(expd_address_page, String_.new_u8(init_url.Page_bry()));
return this;
}
@@ -190,8 +191,8 @@ class Xows_page_allpages_fxt {
} private Xoa_url init_url = Xoa_url.blank();
public Xows_page_allpages_fxt Test_build_html(String expd) {
Exec_build();
allpages.Build_html(wiki.Ctx().Cur_page());
Tfds.Eq_str_lines(expd, String_.new_a7(wiki.Ctx().Cur_page().Data_raw()));
allpages.Build_html(wiki.Parser_mgr().Ctx().Cur_page());
Tfds.Eq_str_lines(expd, String_.new_a7(wiki.Parser_mgr().Ctx().Cur_page().Data_raw()));
return this;
}
private void Exec_build() {

View File

@@ -17,7 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.movePage; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.langs.msgs.*;
import gplx.xowa.html.hrefs.*;
import gplx.xowa.nss.*;
import gplx.xowa.parsers.utils.*;
public class Move_page implements Xows_page {
private Move_trg_ns_list_fmtr ns_list_fmtr = new Move_trg_ns_list_fmtr();
@@ -65,11 +67,11 @@ public class Move_page implements Xows_page {
if (src_ttl == null) return Bry_.Empty;
ns_list_fmtr.Init_by_page(wiki, page, src_ttl);
Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_m001();
wiki.Parser().Parse_text_to_html(tmp_bfr, page, true, msg_mgr.Val_by_key_obj("movepagetext"));
wiki.Parser_mgr().Main().Parse_text_to_html(tmp_bfr, page, true, msg_mgr.Val_by_key_obj("movepagetext"));
fmtr_all.Bld_bfr_many(tmp_bfr
, msg_mgr.Val_by_key_obj("move-page-legend")
, Bry_.Add(Xoh_href_.Bry__wiki, src_ttl.Full_db())
, gplx.html.Html_utl.Escape_html_as_bry(src_ttl.Full_txt())
, gplx.langs.htmls.Html_utl.Escape_html_as_bry(src_ttl.Full_txt())
, src_ttl.Full_txt()
, msg_mgr.Val_by_key_obj("newtitle")
, ns_list_fmtr

View File

@@ -32,7 +32,7 @@ public class Nearby_mgr implements Xows_page {
public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
page.Data_raw_(Bld_html(wiki));
page.Html_data().Html_restricted_n_(); // [[Special:]] pages allow all HTML
// wiki.ParsePage(page, false); // do not clear else previous Search_text will be lost
// wiki.Parser_mgr().Parse(page, false); // do not clear else previous Search_text will be lost
}
byte[] Bld_html(Xowe_wiki wiki) {
form_fmtr.Bld_bfr_many(tmp_bfr);
@@ -94,7 +94,7 @@ public class Nearby_mgr implements Xows_page {
visited.Add_bry_bry(ttl_bry);
Xoae_page page = wiki.Data_mgr().Get_page(ttl, false);
if (page.Missing()) continue;
wiki.ParsePage(page, true);
wiki.Parser_mgr().Parse(page, true);
Ordered_hash lnkis = Ordered_hash_.new_bry_();
Collect_lnkis(lnkis, page.Root());
if (lnkis.Has(trg)) {
@@ -113,7 +113,7 @@ public class Nearby_mgr implements Xows_page {
if (next_pool.Count() > 0)
Examine_page(next_pool);
// ++pages_count;
// wiki.ParsePage(page, true);
// wiki.Parser_mgr().Parse(page, true);
// Ordered_hash lnkis = Ordered_hash_.new_bry_();
// int len = lnkis.Count();
// for (int i = 0; i < len; i++) {
@@ -134,7 +134,7 @@ public class Nearby_mgr implements Xows_page {
// Xoae_page page = wiki.Data_mgr().Get_page(ttl, false);
// if (page.Missing()) return;
// ++pages_count;
// wiki.ParsePage(page, true);
// wiki.Parser_mgr().Parse(page, true);
// Ordered_hash lnkis = Ordered_hash_.new_bry_();
// Collect_lnkis(lnkis, page.Root());
// if (lnkis.Has(trg)) {

View File

@@ -16,6 +16,7 @@ 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.specials.randoms; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.xowa.nss.*;
public class Xop_randomRootPage_page implements Xows_page {
public Xows_special_meta Special_meta() {return Xows_special_meta_.Itm__random_root_page;}
public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {

View File

@@ -44,7 +44,7 @@ class Xop_randomRootPage_page_fxt {
Tfds.Eq(expd, String_.new_a7(page.Data_raw()));
}
public static Xoae_page Test_special_open(Xowe_wiki wiki, Xows_page special_page, String special_url) {
Xoae_page page = wiki.Ctx().Cur_page();
Xoae_page page = wiki.Parser_mgr().Ctx().Cur_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));

View File

@@ -16,6 +16,7 @@ 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.specials.randoms; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.xowa.nss.*;
public class Xows_page_random implements Xows_page {
public Xows_page_random(Xowe_wiki wiki) {}
public Xows_special_meta Special_meta() {return Xows_special_meta_.Itm__random;}

View File

@@ -19,6 +19,7 @@ package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gpl
import gplx.core.net.*; import gplx.core.threads.*;
import gplx.gfui.*; import gplx.xowa.gui.*; import gplx.xowa.gui.views.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.core.js.*;
import gplx.xowa.nss.*;
public class Xog_search_suggest_mgr implements GfoInvkAble {
public Xog_search_suggest_mgr(Xoa_gui_mgr gui_mgr) {
this.app = gui_mgr.App();

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.xowa.tdbs.*; import gplx.xowa.tdbs.hives.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.nss.*;
public class Xosrh_page_mgr_tst {
@Before public void init() {fxt.Clear();} private Xosrh_page_mgr_fxt fxt = new Xosrh_page_mgr_fxt();
@Test public void Basic() {

View File

@@ -99,7 +99,7 @@ class Xosrh_qry_itm {
byte[] itm_ttl = itm.Ttl_page_db();
itm_ttl = wiki.Lang().Case_mgr().Case_build_lower(itm_ttl, 0, itm_ttl.length); // lowercase ttl (since all search words are lower-cased)
itm_ttl = Bry_.Replace(itm_ttl, Byte_ascii.Underline, Byte_ascii.Space); // replace _ with " " (assume user will use spaces in search term)
if (Bry_finder.Find_fwd(itm_ttl, word) != Bry_.NotFound)
if (Bry_find_.Find_fwd(itm_ttl, word) != Bry_.NotFound)
ids.Add(itm);
}
break;

View File

@@ -39,11 +39,11 @@ class Xosrh_scanner {
}
switch (cur_tid) {
case Xosrh_qry_tkn.Tid_space: // discard spaces
pos = Bry_finder.Find_fwd_while(src, pos, src_len, Byte_ascii.Space);
pos = Bry_find_.Find_fwd_while(src, pos, src_len, Byte_ascii.Space);
break;
case Xosrh_qry_tkn.Tid_quote: // find end quote and add as word
int quote_bgn = pos + 1;
int quote_end = Bry_finder.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
int quote_end = Bry_find_.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
if (quote_end == Bry_.NotFound) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
Tkns_add_word(Xosrh_qry_tkn.Tid_word_quoted, quote_bgn, quote_end);
pos = quote_end + 1; // +1 to place after quote
@@ -118,7 +118,7 @@ class Xosrh_scanner {
byte[] cur_word = Bry_.Mid(src, src_bgn, src_end);
byte[][] words = gplx.xowa.bldrs.cmds.texts.Xob_search_base.Split_ttl_into_words(null, tmp_list, tmp_bfr, cur_word);
int words_len = words.length;
if (words_len == 1 && !Bry_.Eq(words[0], cur_word) && Bry_finder.Find_fwd(cur_word, Byte_ascii.Star) == -1) {
if (words_len == 1 && !Bry_.Eq(words[0], cur_word) && Bry_find_.Find_fwd(cur_word, Byte_ascii.Star) == -1) {
tkns.Add(Xosrh_qry_tkn.new_bry_(tid, words[0]));
return;
}

View File

@@ -16,7 +16,7 @@ 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.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.regxs.*;
import gplx.langs.regxs.*;
public class Xows_db_matcher {
private final Gfo_pattern raw_pattern;
public Xows_db_matcher(int tid, byte[] raw, Xows_db_matcher lhs, Xows_db_matcher rhs) {
@@ -44,7 +44,7 @@ public class Xows_db_matcher {
return false;
}
case Xows_db_matcher.Tid_word_quote: // note that raw does not have quotes; EX: "B*" -> B*
return Bry_finder.Find_fwd(page_ttl_lc, raw) != Bry_finder.Not_found;
return Bry_find_.Find_fwd(page_ttl_lc, raw) != Bry_find_.Not_found;
case Xows_db_matcher.Tid_not:
return !rhs.Matches(page_ttl_lc, page_ttl_words);
case Xows_db_matcher.Tid_or:

View File

@@ -35,7 +35,7 @@ class Xows_db_matcher_bldr {
break;
case Xows_db_matcher.Tid_word_quote:
List_adp tmp = List_adp_.new_();
byte[][] words = Bry_.Split(matcher.Raw(), Byte_ascii.Space, Bool_.Y);
byte[][] words = Bry_split_.Split(matcher.Raw(), Byte_ascii.Space, Bool_.Y);
int words_len = words.length;
for (int i = 0; i < words_len; ++i) {
byte[] word = words[i];

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.primitives.*; import gplx.dbs.*;
import gplx.xowa.nss.*;
import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.langs.cases.*;
import gplx.gfui.*;
class Xows_db_wkr {
@@ -78,7 +79,7 @@ class Xows_db_wkr {
byte[] page_ttl = rdr.Read_bry_by_str(page_tbl.Fld_page_title());
// Io_mgr.I.AppendFilStr("C:\\temp.txt", String_.new_u8(word.Text()) + "|" + Int_.Xto_str(page_ns) + "|" + String_.new_u8(page_ttl) + "\n");
byte[] page_ttl_lc = case_mgr.Case_build_lower(Xoa_ttl.Replace_unders(page_ttl));
byte[][] page_ttl_words = Bry_.Split(page_ttl_lc, Byte_ascii.Space, Bool_.Y);
byte[][] page_ttl_words = Bry_split_.Split(page_ttl_lc, Byte_ascii.Space, Bool_.Y);
if (!matcher.Matches(page_ttl_lc, page_ttl_words)) continue; // ignore: ttl doesn't match matcher
int page_id = rdr.Read_int(page_tbl.Fld_page_id());
int page_len = rdr.Read_int(page_tbl.Fld_page_len());

View File

@@ -16,7 +16,7 @@ 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.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.html.*; import gplx.xowa.html.wtrs.*; import gplx.xowa.langs.numbers.*;
import gplx.langs.htmls.*; import gplx.xowa.html.wtrs.*; import gplx.xowa.langs.numbers.*;
class Xows_html_wkr {
private final Bry_bfr tmp_bfr = Bry_bfr.new_(255);
private Xows_ui_qry qry; private Xow_wiki wiki; private Xol_num_mgr num_mgr;

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.primitives.*;
import gplx.xowa.nss.*;
public class Xows_ns_mgr {
private final Ordered_hash ns_hash = Ordered_hash_.new_(); private final Int_obj_ref tmp_ns_id = Int_obj_ref.neg1_(); private final Bry_bfr tmp_bfr = Bry_bfr.reset_(32);
private boolean ns_all, ns_main;

View File

@@ -62,7 +62,7 @@ public class Xows_page__search implements Xows_page, GfoInvkAble, GfoEvObj {
if (Bry_.Len_eq_0(search_bry)) return; // emptry String; exit now, else null ref error; DATE:2015-08-11
if ( search_suggest_mgr.Auto_wildcard() // add * automatically if option set
&& wiki.Db_mgr().Tid() == gplx.xowa.dbs.Xodb_mgr_sql.Tid_sql // only apply to sql
&& Bry_finder.Find_fwd(search_bry, Byte_ascii.Star) == -1 // search term does not have asterisk
&& Bry_find_.Find_fwd(search_bry, Byte_ascii.Star) == -1 // search term does not have asterisk
)
search_bry = Bry_.Add(search_bry, Byte_ascii.Star);
// url.Page_bry_(Bry_.Add(Xows_special_meta_.Itm__search.Ttl_bry(), Byte_ascii.Slash_bry, search_bry));// HACK: need to re-set Page b/c href_parser does not eliminate qargs; DATE:2013-02-08
@@ -85,7 +85,7 @@ public class Xows_page__search implements Xows_page, GfoInvkAble, GfoEvObj {
}
// page found; return it;
else {
wiki.ParsePage(search_page, true);
wiki.Parser_mgr().Parse(search_page, true);
page.Data_raw_(search_page.Data_raw());
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());

View File

@@ -16,7 +16,7 @@ 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.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.html.*; import gplx.xowa.files.gui.*;
import gplx.langs.htmls.*; import gplx.xowa.files.gui.*;
class Xows_ui_async {
private final Xows_html_row html_row; private final Xog_js_wkr js_wkr;
private final Xows_db_row[] rows; private final int rows_len;

View File

@@ -16,7 +16,7 @@ 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.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.threads.*; import gplx.html.*;
import gplx.core.threads.*; import gplx.langs.htmls.*;
import gplx.xowa.wikis.*; import gplx.xowa.files.gui.*; import gplx.xowa.gui.views.*;
class Xows_ui_cmd implements GfoInvkAble, Cancelable, Xog_tab_close_lnr {
private final Xows_core mgr; private final Xows_ui_qry qry; private final Xows_ui_rslt rslt;

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.search.*;
import gplx.core.primitives.*;
import gplx.xowa.langs.*;
class Xows_text_parser__v1 {
private Xol_lang lang; private Bry_bfr bfr = Bry_bfr.new_(255);
private final Ordered_hash list = Ordered_hash_.new_bry_();

View File

@@ -73,13 +73,13 @@ class Xows_text_tkn__ellipsis implements Xows_text_tkn {
mgr.Word__add(bgn__ws, tkn_bgn); // add word; EX: "Dreams" in "Dreams..."
mgr.Bgn__ws_clear(); // clear ws flag, else space will create word; EX: "A... B"
}
int rv = Bry_finder.Find_fwd_while(src, tkn_end, src_end, ellipsis_byte);
int rv = Bry_find_.Find_fwd_while(src, tkn_end, src_end, ellipsis_byte);
mgr.Word__add(tkn_bgn, rv); // add ellipssis
return rv;
}
public static Xows_text_tkn new_(Btrie_slim_mgr trie, String ellipsis) {
byte[] bry = Bry_.new_u8(ellipsis);
Xows_text_tkn rv = new Xows_text_tkn__ellipsis(Bry_.Get_at_end_or_fail(bry));
Xows_text_tkn rv = new Xows_text_tkn__ellipsis(Bry_.Get_at_end(bry));
trie.Add_obj(bry, rv);
return rv;
}

View File

@@ -40,11 +40,11 @@ class Xow_search_scanner {
}
switch (cur_tid) {
case Xow_search_tkn.Tid_space: // discard spaces
pos = Bry_finder.Find_fwd_while(src, pos, src_len, Byte_ascii.Space);
pos = Bry_find_.Find_fwd_while(src, pos, src_len, Byte_ascii.Space);
break;
case Xow_search_tkn.Tid_quote: // find end quote and add as word
int quote_bgn = pos + 1;
int quote_end = Bry_finder.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
int quote_end = Bry_find_.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
if (quote_end == Bry_.NotFound) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
Tkns_add_word(Xow_search_tkn.Tid_word_quoted, quote_bgn, quote_end);
pos = quote_end + 1; // +1 to place after quote
@@ -121,7 +121,7 @@ class Xow_search_scanner {
int words_len = words.length;
if ( words_len == 1 // only one word
&& !Bry_.Eq(words[0], cur_word) // split word not same as raw
&& Bry_finder.Find_fwd(cur_word, Byte_ascii.Star) == -1 // no asterisk
&& Bry_find_.Find_fwd(cur_word, Byte_ascii.Star) == -1 // no asterisk
) {
tkns.Add(Xow_search_tkn.new_bry(tid, words[0]));
return;

View File

@@ -16,7 +16,8 @@ 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.specials.statistics; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.xowa.langs.numbers.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.numbers.*;
import gplx.xowa.nss.*;
public class Xop_statistics_page implements Xows_page {
private Xop_statistics_stats_page_grp stats_page = new Xop_statistics_stats_page_grp();
// private Xop_statistics_stats_wiki_grp stats_wiki = new Xop_statistics_stats_wiki_grp();

View File

@@ -16,7 +16,8 @@ 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.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.ios.*; import gplx.xowa2.apps.*; import gplx.xowa2.wikis.*;
import gplx.langs.htmls.encoders.*;
import gplx.ios.*; import gplx.xowa.apps.*; import gplx.xowa.wikis.*;
interface Xosp_fbrow_cmd {
Xosp_fbrow_cmd Make_new();
Xosp_fbrow_rslt Write_html(Xoa_url_arg_mgr arg_mgr, GfoInvkAble select_invkable);

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.system_data; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.core.primitives.*; import gplx.core.net.*;
import gplx.xowa.langs.*;
import gplx.xowa.urls.*;
public class System_data_page implements Xows_page {
private Gfo_qarg_mgr arg_hash = new Gfo_qarg_mgr();
@@ -28,7 +29,7 @@ public class System_data_page implements Xows_page {
Io_url file_url = Path_from_type(wiki, type_val.Val()); if (file_url == null) return;
Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_m001();
byte[] file_txt = Io_mgr.I.LoadFilBry(file_url);
file_txt = gplx.html.Html_utl.Escape_html_as_bry(file_txt, true, false, false, false, false); // escape < or "</pre>" in messages will cause pre to break
file_txt = gplx.langs.htmls.Html_utl.Escape_html_as_bry(file_txt, true, false, false, false, false); // escape < or "</pre>" in messages will cause pre to break
fmtr_all.Bld_bfr_many(tmp_bfr, file_url.Raw(), file_txt);
page.Data_raw_(tmp_bfr.To_bry_and_rls());
}