mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.lst; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Lst_pfunc_lst extends Pf_func_base {
|
||||
@Override public int Id() {return Xol_kwd_grp_.Id_lst;}
|
||||
@@ -29,5 +29,5 @@ public class Lst_pfunc_lst extends Pf_func_base {
|
||||
byte[] sect_end = Pf_func_.Eval_arg_or(ctx, src, caller, self, args_len, 1, Lst_pfunc_wkr.Null_arg);
|
||||
new Lst_pfunc_wkr().Init_include(src_ttl_bry, sect_bgn, sect_end).Exec(bfr, ctx);
|
||||
}
|
||||
public static final Lst_pfunc_lst _ = new Lst_pfunc_lst(); Lst_pfunc_lst() {}
|
||||
public static final Lst_pfunc_lst Instance = new Lst_pfunc_lst(); Lst_pfunc_lst() {}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class Lst_pfunc_lst_fxt {
|
||||
if (fxt == null) fxt = new Xop_fxt();
|
||||
fxt.Reset();
|
||||
fxt.Wiki().Cache_mgr().Free_mem_all();
|
||||
Io_mgr.I.InitEngine_mem();
|
||||
Io_mgr.Instance.InitEngine_mem();
|
||||
return this;
|
||||
}
|
||||
public Xop_fxt Fxt() {return fxt;} private Xop_fxt fxt;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.lst; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Lst_pfunc_lstx extends Pf_func_base {
|
||||
@Override public int Id() {return Xol_kwd_grp_.Id_lstx;}
|
||||
@@ -29,5 +29,5 @@ public class Lst_pfunc_lstx extends Pf_func_base {
|
||||
byte[] sect_replace = Pf_func_.Eval_arg_or(ctx, src, caller, self, args_len, 1, Lst_pfunc_wkr.Null_arg);
|
||||
new Lst_pfunc_wkr().Init_exclude(src_ttl_bry, sect_exclude, sect_replace).Exec(bfr, ctx);
|
||||
}
|
||||
public static final Lst_pfunc_lstx _ = new Lst_pfunc_lstx(); Lst_pfunc_lstx() {}
|
||||
public static final Lst_pfunc_lstx Instance = new Lst_pfunc_lstx(); Lst_pfunc_lstx() {}
|
||||
}
|
||||
|
||||
@@ -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.xtns.lst; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.xowa.nss.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Lst_pfunc_wkr {
|
||||
private boolean mode_include = true;
|
||||
|
||||
@@ -17,37 +17,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.lst; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.html.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
|
||||
public class Lst_section_nde implements Xox_xnde, Xop_xnde_atr_parser {
|
||||
import gplx.xowa.langs.*; import gplx.xowa.htmls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*;
|
||||
public class Lst_section_nde implements Xox_xnde, Mwh_atr_itm_owner {
|
||||
public byte[] Section_name() {return section_name;} private byte[] section_name;
|
||||
public void Xatr_parse(Xowe_wiki wiki, byte[] src, Xop_xatr_itm xatr, Object xatr_obj) {
|
||||
if (xatr_obj == null) return;
|
||||
byte xatr_tid = ((Byte_obj_val)xatr_obj).Val();
|
||||
switch (xatr_tid) {
|
||||
public void Xatr__set(Xowe_wiki wiki, byte[] src, Mwh_atr_itm xatr, Object xatr_id_obj) {
|
||||
if (xatr_id_obj == null) return;
|
||||
byte xatr_id = ((Byte_obj_val)xatr_id_obj).Val();
|
||||
switch (xatr_id) {
|
||||
case Xatr_name: case Xatr_bgn: case Xatr_end:
|
||||
section_name = xatr.Val_as_bry(src); name_tid = xatr_tid; break;
|
||||
section_name = xatr.Val_as_bry(); name_tid = xatr_id; break;
|
||||
}
|
||||
}
|
||||
public Xop_xnde_tkn Xnde() {return xnde;} private Xop_xnde_tkn xnde;
|
||||
public byte Name_tid() {return name_tid;} private byte name_tid;
|
||||
public void Xtn_parse(Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
|
||||
Xoae_app app = ctx.App();
|
||||
Xop_xatr_itm[] atrs = Xop_xatr_itm.Xatr_parse(app, this, wiki.Lang().Xatrs_section(), wiki, src, xnde);
|
||||
Mwh_atr_itm[] atrs = Xox_xnde_.Xatr__set(wiki, this, wiki.Lang().Xatrs_section(), src, xnde);
|
||||
this.xnde = xnde;
|
||||
xnde.Atrs_ary_(atrs);
|
||||
ctx.Lst_section_mgr().Add(this);
|
||||
}
|
||||
public void Xtn_write(Bry_bfr bfr, Xoae_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xop_xnde_tkn xnde, byte[] src) {} // NOTE: write nothing; <section> is just a bookmark
|
||||
public static final byte Xatr_name = 0, Xatr_bgn = 1, Xatr_end = 2;
|
||||
public static Hash_adp_bry new_xatrs_(Xol_lang lang) {
|
||||
public static Hash_adp_bry new_xatrs_(Xol_lang_itm lang) {
|
||||
Hash_adp_bry rv = Hash_adp_bry.ci_u8(lang.Case_mgr()); // UTF8:see xatrs below
|
||||
rv.Add_str_byte("name", Lst_section_nde.Xatr_name);
|
||||
Xatrs_add(rv, "begin", "end");
|
||||
switch (lang.Lang_id()) { // NOTE: as of v315572b, i18n is done directly in code, not in magic.php; am wary of adding keywords for general words like begin/end, so adding them manually per language; DATE:2013-02-09
|
||||
case Xol_lang_itm_.Id_de: Xatrs_add(rv, "Anfang", "Ende"); break;
|
||||
case Xol_lang_itm_.Id_he: Xatrs_add(rv, "התחלה", "סוף"); break;
|
||||
case Xol_lang_itm_.Id_pt: Xatrs_add(rv, "começo", "fim"); break;
|
||||
case Xol_lang_stub_.Id_de: Xatrs_add(rv, "Anfang", "Ende"); break;
|
||||
case Xol_lang_stub_.Id_he: Xatrs_add(rv, "התחלה", "סוף"); break;
|
||||
case Xol_lang_stub_.Id_pt: Xatrs_add(rv, "começo", "fim"); break;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Lst_section_nde_tst {
|
||||
fxt.Test_parse_page_all_str("a<section name=\"b\">c</section>d", "ad");
|
||||
}
|
||||
@Test public void German() { // PURPOSE: non-english tags for section DATE:2014-07-18
|
||||
fxt.Lang_by_id_(Xol_lang_itm_.Id_de);
|
||||
fxt.Lang_by_id_(Xol_lang_stub_.Id_de);
|
||||
fxt.Test_parse_page_all_str("a<abschnitt name=\"b\">c</abschnitt>d" , "ad"); // check that German works
|
||||
fxt.Test_parse_page_all_str("a<section name=\"b\">c</section>d" , "ad"); // check that English still works
|
||||
fxt.Test_parse_page_all_str("a<trecho name=\"b\">c</trecho>d" , "a<trecho name="b">c</trecho>d"); // check that Portuguese does not work
|
||||
|
||||
Reference in New Issue
Block a user