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-03-01 21:59:12 -05:00
parent f495595da4
commit d279c70606
346 changed files with 3516 additions and 2970 deletions

View File

@@ -136,7 +136,7 @@ public class Xoa_url_parser {
}
public static Xoa_url Parse_url(Xoae_app app, Xowe_wiki cur_wiki, byte[] raw, int bgn, int end, boolean from_url_bar) {return Parse_url(Xoa_url.blank_(), app, cur_wiki, raw, bgn, end, from_url_bar);}
public static Xoa_url Parse_url(Xoa_url rv, Xoae_app app, Xowe_wiki cur_wiki, byte[] raw, int bgn, int end, boolean from_url_bar) {
Xowe_wiki wiki = null; Bry_bfr_mkr bfr_mkr = app.Utl_bry_bfr_mkr();
Xowe_wiki wiki = null; Bry_bfr_mkr bfr_mkr = app.Utl__bfr_mkr();
byte[] cur_wiki_key = cur_wiki.Domain_bry();
byte[] page_bry = Bry_.Empty;
boolean page_is_main_page = false;
@@ -210,7 +210,7 @@ public class Xoa_url_parser {
page_bry = Xoa_page_.Main_page_bry_empty;
}
if (rv.Anchor_bry() != null) {
byte[] anchor_bry = Xoa_app_.Utl_encoder_mgr().Id().Encode(rv.Anchor_bry()); // reencode for anchors (which use . encoding, not % encoding); PAGE:en.w:Enlightenment_Spain#Enlightened_despotism_.281759%E2%80%931788.29
byte[] anchor_bry = Xoa_app_.Utl__encoder_mgr().Id().Encode(rv.Anchor_bry()); // reencode for anchors (which use . encoding, not % encoding); PAGE:en.w:Enlightenment_Spain#Enlightened_despotism_.281759%E2%80%931788.29
rv.Anchor_bry_(anchor_bry);
}
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, page_bry);

View File

@@ -48,7 +48,7 @@ public class Xoh_href_parser {
bgn = file_slash_end = Bry_.While_fwd(raw, Byte_ascii.Slash, tmp_url.Protocol_bry().length, raw_len);
rv.Tid_(Xoh_href.Tid_xowa);
rv.Wiki_(wiki.Domain_bry()); // wiki is always the current wiki
byte[] page = Xoa_app_.Utl_encoder_mgr().Gfs().Decode(Bry_.Mid(raw, bgn, raw_len));
byte[] page = Xoa_app_.Utl__encoder_mgr().Gfs().Decode(Bry_.Mid(raw, bgn, raw_len));
rv.Page_(page); // page is everything after "/xcmd/"; individual cmds will do further parsing; note that it should be decoded; EX: %20 -> " "; also note that anchor (#) or query params (?) are not parsed; the entire String will be reparsed later
return;
}

View File

@@ -196,7 +196,7 @@ class Xoh_href_parser_fxt {
wiki = Xoa_app_fxt.wiki_tst_(app);
wiki.Xwiki_mgr().Add_bulk(Bry_.new_ascii_("wikt|en.wiktionary.org"));
app.User().Wiki().Xwiki_mgr().Add_bulk(Bry_.new_ascii_("en.wiktionary.org|en.wiktionary.org"));
href_parser = new Xoh_href_parser(Xoa_app_.Utl_encoder_mgr().Href(), app.Url_parser().Url_parser());
href_parser = new Xoh_href_parser(Xoa_app_.Utl__encoder_mgr().Href(), app.Url_parser().Url_parser());
}
public Xoae_app App() {return app;} private Xoae_app app;
public Xoh_href_parser_fxt Init_xwiki_alias(String alias, String domain) {