mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v3.1.4.2
This commit is contained in:
@@ -24,7 +24,7 @@ public class Scrib_core {
|
||||
private Hash_adp_bry mods = Hash_adp_bry.cs();
|
||||
public Scrib_core(Xoae_app app, Xop_ctx ctx) {// NOTE: ctx needed for language reg
|
||||
this.app = app; this.ctx = ctx;
|
||||
this.wiki = ctx.Wiki(); this.page = ctx.Cur_page(); // NOTE: wiki / page needed for title reg; DATE:2014-02-05
|
||||
this.wiki = ctx.Wiki(); this.page = ctx.Page(); // NOTE: wiki / page needed for title reg; DATE:2014-02-05
|
||||
this.lang = wiki.Lang();
|
||||
this.Engine_(Scrib_engine_type.Type_lua, false); // TEST: default to lua
|
||||
fsys_mgr.Root_dir_(app.Fsys_mgr().Bin_xtns_dir().GenSubDir_nest("Scribunto"));
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Scrib_core_fxt {
|
||||
server.Clear();
|
||||
core.Proc_mgr().Clear();
|
||||
core.Frame_parent_(null);
|
||||
core.When_page_changed(wiki.Parser_mgr().Ctx().Cur_page());
|
||||
core.When_page_changed(wiki.Parser_mgr().Ctx().Page());
|
||||
expd_server_rcvd_list.Clear();
|
||||
return this;
|
||||
} private Xoae_app app; Xowe_wiki wiki; Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
|
||||
@@ -36,12 +36,12 @@ public class Scrib_invoke_func extends Pf_func_base {
|
||||
long log_time_bgn = 0;
|
||||
if (invoke_wkr != null) {
|
||||
log_time_bgn = Env_.TickCount();
|
||||
if (!invoke_wkr.Eval_bgn(ctx.Cur_page(), mod_name, fnc_name)) return;
|
||||
if (!invoke_wkr.Eval_bgn(ctx.Page(), mod_name, fnc_name)) return;
|
||||
}
|
||||
Scrib_core core = Scrib_core.Core();
|
||||
if (core == null) {
|
||||
core = Scrib_core.Core_new_(ctx.App(), ctx).Init();
|
||||
core.When_page_changed(ctx.Cur_page());
|
||||
core.When_page_changed(ctx.Page());
|
||||
}
|
||||
byte[] mod_raw = null;
|
||||
Scrib_lua_mod mod = core.Mods_get(mod_name);
|
||||
@@ -57,7 +57,7 @@ public class Scrib_invoke_func extends Pf_func_base {
|
||||
try {
|
||||
core.Invoke(wiki, ctx, src, caller, self, bfr, mod_name, mod_raw, fnc_name);
|
||||
if (invoke_wkr != null)
|
||||
invoke_wkr.Eval_end(ctx.Cur_page(), mod_name, fnc_name, log_time_bgn);
|
||||
invoke_wkr.Eval_end(ctx.Page(), mod_name, fnc_name, log_time_bgn);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
Err err = Err_.cast_or_make(e);
|
||||
@@ -67,7 +67,7 @@ public class Scrib_invoke_func extends Pf_func_base {
|
||||
if ( err_filter_mgr == null // no err_filter_mgr defined;
|
||||
|| err_filter_mgr.Count_eq_0( ) // err_filter_mgr exists, but no definitions
|
||||
|| !err_filter_mgr.Match(String_.new_u8(mod_name), String_.new_u8(fnc_name), err.To_str__msg_only())) // NOTE: must be To_str__msg_only; err_filter_mgr has defintion and it doesn't match current; print warn; DATE:2015-07-24
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "invoke failed: ~{0} ~{1} ~{2}", ctx.Cur_page().Ttl().Raw(), String_.new_u8(src, self.Src_bgn(), self.Src_end()), err.To_str__log());
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "invoke failed: ~{0} ~{1} ~{2}", ctx.Page().Ttl().Raw(), String_.new_u8(src, self.Src_bgn(), self.Src_end()), err.To_str__log());
|
||||
Scrib_core.Core_invalidate_when_page_changes(); // NOTE: invalidate core when page changes, not for rest of page, else page with many errors will be very slow due to multiple invalidations; PAGE:th.d:all; DATE:2014-10-03
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Scrib_proc_rslt {
|
||||
public KeyVal[] Ary() {return ary;}
|
||||
public String Fail_msg() {return fail_msg;} private String fail_msg;
|
||||
public boolean Init_fail(String v) {fail_msg = v; return false;}
|
||||
public boolean Init_null() {Init_obj(null); return true;}
|
||||
public boolean Init_null() {Init_obj(null); return true;} // return array(null);
|
||||
public boolean Init_str_empty() {Init_obj(""); return true;}
|
||||
public boolean Init_ary_empty() {ary = KeyVal_.Ary_empty; return true;}
|
||||
public boolean Init_obj(Object val) {
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Process_engine implements Scrib_engine {
|
||||
}
|
||||
else {
|
||||
bfr.Mkr_rls();
|
||||
// app.Usr_dlg().Warn_many("", "", "invalid dispatch: op=~{0} page=~{1}", op, String_.new_u8(core.Ctx().Cur_page().Page_ttl().Page_db()));
|
||||
// app.Usr_dlg().Warn_many("", "", "invalid dispatch: op=~{0} page=~{1}", op, String_.new_u8(core.Ctx().Page().Page_ttl().Page_db()));
|
||||
return KeyVal_.Ary_empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class Scrib_lib_message_data {
|
||||
if (exec_params) {
|
||||
byte[] data_ttl = title_bry;
|
||||
if (data_ttl == null)
|
||||
ttl = ctx.Cur_page().Ttl();
|
||||
ttl = ctx.Page().Ttl();
|
||||
else
|
||||
ttl = Xoa_ttl.parse(wiki, data_ttl);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class Scrib_lib_mw__invoke_tst {
|
||||
@Test public void CallParserFunction_displayTitle() { // PURPOSE: DISPLAYTITLE not being set when called through CallParserFunction; DATE:2013-08-05
|
||||
fxt.Init_page("{{#invoke:Mod_0|Prc_0}}");
|
||||
fxt.Test_lib_proc_kv(lib, Scrib_lib_mw.Invk_callParserFunction, Scrib_kv_utl_.base1_many_ary_("current", "DISPLAYTITLE", "''a''"), "");
|
||||
Tfds.Eq("<i>a</i>", String_.new_a7(fxt.Parser_fxt().Ctx().Cur_page().Html_data().Display_ttl()));
|
||||
Tfds.Eq("<i>a</i>", String_.new_a7(fxt.Parser_fxt().Ctx().Page().Html_data().Display_ttl()));
|
||||
}
|
||||
@Test public void ExpandTemplate_tmpl() {
|
||||
fxt.Init_page("{{#invoke:Mod_0|Prc_0}}");
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Scrib_lib_uri implements Scrib_lib {
|
||||
}
|
||||
private boolean Init_uri_for_page(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||
Xop_ctx ctx = core.Ctx();
|
||||
byte[] ttl_bry = ctx.Cur_page().Ttl().Raw();
|
||||
byte[] ttl_bry = ctx.Page().Ttl().Raw();
|
||||
Bry_bfr tmp_bfr = ctx.Wiki().Utl__bfr_mkr().Get_b512();
|
||||
Pfunc_urlfunc.UrlString(ctx, Pfunc_urlfunc.Tid_full, false, ttl_bry, tmp_bfr, Bry_.Empty);
|
||||
return rslt.Init_obj(tmp_bfr.To_bry_and_rls());
|
||||
|
||||
@@ -178,7 +178,7 @@ public class Scrib_lib_ustring implements Scrib_lib {
|
||||
public static Regx_adp RegxAdp_new_(Xop_ctx ctx, String regx) {
|
||||
Regx_adp rv = Regx_adp_.new_(regx);
|
||||
if (rv.Pattern_is_invalid()) {
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "regx is invalid: regx=~{0} page=~{1}", regx, String_.new_u8(ctx.Cur_page().Ttl().Page_db()));
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "regx is invalid: regx=~{0} page=~{1}", regx, String_.new_u8(ctx.Page().Ttl().Page_db()));
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user