mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.8.2.1
This commit is contained in:
@@ -46,6 +46,7 @@ public class Xop_lnki_tkn extends Xop_tkn_itm_base {
|
||||
public int Html_id() {return html_id;} public Xop_lnki_tkn Html_id_(int v) {html_id = v; return this;} private int html_id;
|
||||
public int Pipe_count() {return pipe_count;} private int pipe_count;
|
||||
public boolean Pipe_count_is_zero() {return pipe_count++ == 0;}
|
||||
public boolean Xtn_sites_link() {return xtn_sites_link;} public void Xtn_sites_link_(boolean v) {xtn_sites_link = v;} private boolean xtn_sites_link;
|
||||
public Xoh_lnki_file_wkr Lnki_file_wkr() {return lnki_file_wkr;} public void Lnki_file_wkr_(Xoh_lnki_file_wkr v) {lnki_file_wkr = v;} private Xoh_lnki_file_wkr lnki_file_wkr;
|
||||
public byte[] Ttl_ary() {
|
||||
return ttl.ForceLiteralLink() || nsId != Xow_ns_.Id_main // if [[:]] or non-main (Category, Template)
|
||||
|
||||
@@ -17,12 +17,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.core.btries.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.parsers.lnkis.redlinks.*; import gplx.xowa.xtns.pfuncs.ttls.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.parsers.lnkis.redlinks.*; import gplx.xowa.xtns.pfuncs.ttls.*; import gplx.xowa.xtns.relatedSites.*;
|
||||
public class Xop_lnki_wkr implements Xop_ctx_wkr, Xop_arg_wkr {
|
||||
private Arg_bldr arg_bldr = Arg_bldr._;
|
||||
private NumberParser number_parser = new NumberParser();
|
||||
private Sites_regy_mgr sites_regy_mgr;
|
||||
public void Ctor_ctx(Xop_ctx ctx) {}
|
||||
public void Page_bgn(Xop_ctx ctx, Xop_root_tkn root) {}
|
||||
public void Page_bgn(Xop_ctx ctx, Xop_root_tkn root) {
|
||||
sites_regy_mgr = ctx.Wiki().Xtn_mgr().Xtn_sites().Regy_mgr(); if (!sites_regy_mgr.Xtn_mgr().Enabled()) sites_regy_mgr = null; // sets sites_xtn_mgr status for page; see below
|
||||
}
|
||||
public void Page_end(Xop_ctx ctx, Xop_root_tkn root, byte[] src, int src_len) {}
|
||||
public Xop_lnki_logger File_wkr() {return file_wkr;} public Xop_lnki_wkr File_wkr_(Xop_lnki_logger v) {file_wkr = v; return this;} private Xop_lnki_logger file_wkr;
|
||||
public void Auto_close(Xop_ctx ctx, Xop_tkn_mkr tkn_mkr, Xop_root_tkn root, byte[] src, int src_len, int bgn_pos, int cur_pos, Xop_tkn_itm tkn) {
|
||||
@@ -69,6 +72,12 @@ public class Xop_lnki_wkr implements Xop_ctx_wkr, Xop_arg_wkr {
|
||||
ctx.Cur_page().Lnki_list().Add(lnki);
|
||||
if (file_wkr != null) file_wkr.Wkr_exec(ctx, src, lnki, gplx.xowa.bldrs.files.Xob_lnki_src_tid.Tid_file);
|
||||
}
|
||||
Xoa_ttl lnki_ttl = lnki.Ttl();
|
||||
if ( lnki_ttl.Wik_bgn() != -1 // lnki is xwiki
|
||||
&& sites_regy_mgr != null // relatedSites xtn is enabled
|
||||
) {
|
||||
lnki.Xtn_sites_link_(sites_regy_mgr.Match(ctx.Cur_page(), lnki_ttl));
|
||||
}
|
||||
return cur_pos;
|
||||
}
|
||||
public boolean Args_add(Xop_ctx ctx, byte[] src, Xop_tkn_itm tkn, Arg_nde_tkn arg, int arg_idx) {
|
||||
|
||||
Reference in New Issue
Block a user