mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.3.1
This commit is contained in:
@@ -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.xtns.cite; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.*; import gplx.core.brys.fmtrs.*; import gplx.core.brys.args.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
|
||||
public class Ref_html_wtr {
|
||||
@@ -33,28 +34,28 @@ public class Ref_html_wtr {
|
||||
, Grp_id(itm)
|
||||
, itm_group_is_default
|
||||
? itm.Idx_major() + 1
|
||||
: (Object)grp_key_fmtr.Atrs_(cfg.Itm_grp_text(), itm.Group(), itm.Idx_major() + 1)
|
||||
: (Object)grp_key_fmtr.Set(cfg.Itm_grp_text(), itm.Group(), itm.Idx_major() + 1)
|
||||
);
|
||||
} private Bry_fmtr_arg_fmtr_objs grp_key_fmtr = Bry_fmtr_arg_.fmtr_null_();
|
||||
} private Bfr_arg__bry_fmtr grp_key_fmtr = Bfr_arg_.New_bry_fmtr__null();
|
||||
public Ref_html_wtr_cfg Cfg() {return cfg;} private Ref_html_wtr_cfg cfg;
|
||||
public void Init_by_wiki(Xowe_wiki wiki) {
|
||||
cfg.Init_by_wiki(wiki);
|
||||
}
|
||||
private Bry_fmtr_arg Itm_id(Ref_nde itm, boolean caller_is_ref) {
|
||||
private Bfr_arg Itm_id(Ref_nde itm, boolean caller_is_ref) {
|
||||
if (itm.Name() == Bry_.Empty)
|
||||
return itm_id_fmtr.Atrs_(cfg.Itm_id_uid(), itm.Uid());
|
||||
return itm_id_fmtr.Set(cfg.Itm_id_uid(), itm.Uid());
|
||||
else {
|
||||
if (caller_is_ref)
|
||||
return itm_id_fmtr.Atrs_(cfg.Itm_id_key_one(), itm.Name(), itm.Idx_major(), itm.Idx_minor());
|
||||
return itm_id_fmtr.Set(cfg.Itm_id_key_one(), itm.Name(), itm.Idx_major(), itm.Idx_minor());
|
||||
else
|
||||
return itm_id_fmtr.Atrs_(cfg.Itm_id_key_many(), itm.Name(), itm.Idx_major());
|
||||
return itm_id_fmtr.Set(cfg.Itm_id_key_many(), itm.Name(), itm.Idx_major());
|
||||
}
|
||||
} private Bry_fmtr_arg_fmtr_objs itm_id_fmtr = Bry_fmtr_arg_.fmtr_null_();
|
||||
private Bry_fmtr_arg Grp_id(Ref_nde itm) {
|
||||
} private Bfr_arg__bry_fmtr itm_id_fmtr = Bfr_arg_.New_bry_fmtr__null();
|
||||
private Bfr_arg Grp_id(Ref_nde itm) {
|
||||
return itm.Name() == Bry_.Empty // name is blank >>> uid
|
||||
? grp_id_fmtr.Atrs_(cfg.Grp_id_uid(), itm.Uid())
|
||||
: grp_id_fmtr.Atrs_(cfg.Grp_id_key(), itm.Name(), itm.Idx_major());
|
||||
} private Bry_fmtr_arg_fmtr_objs grp_id_fmtr = Bry_fmtr_arg_.fmtr_null_();
|
||||
? grp_id_fmtr.Set(cfg.Grp_id_uid(), itm.Uid())
|
||||
: grp_id_fmtr.Set(cfg.Grp_id_key(), itm.Name(), itm.Idx_major());
|
||||
} private Bfr_arg__bry_fmtr grp_id_fmtr = Bfr_arg_.New_bry_fmtr__null();
|
||||
private int List_len(Ref_nde itm) {
|
||||
int len = itm.Related_len();
|
||||
int rv = len;
|
||||
@@ -109,7 +110,7 @@ public class Ref_html_wtr {
|
||||
}
|
||||
private static Xoh_ref_list_fmtr grp_list_fmtr = new Xoh_ref_list_fmtr();
|
||||
}
|
||||
class Xoh_ref_list_fmtr implements Bry_fmtr_arg {
|
||||
class Xoh_ref_list_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
public void Init(Xowe_wiki wiki, Ref_html_wtr_cfg cfg, Ref_nde itm) {
|
||||
this.wiki = wiki; this.cfg = cfg; this.itm = itm;
|
||||
} private Xowe_wiki wiki; private Ref_nde itm; private Ref_html_wtr_cfg cfg;
|
||||
@@ -123,7 +124,7 @@ class Xoh_ref_list_fmtr implements Bry_fmtr_arg {
|
||||
return itm; // no itm has text; TODO:WARN
|
||||
}
|
||||
private boolean HasTxt(Ref_nde v) {return v.Body() != null && v.Body().Root_src().length > 0;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int related_len = itm.Related_len();
|
||||
Bry_fmtr itm_fmtr = cfg.Grp_html_list();
|
||||
Fmt(itm_fmtr, wiki, bfr, itm);
|
||||
@@ -142,9 +143,9 @@ class Xoh_ref_list_fmtr implements Bry_fmtr_arg {
|
||||
: wiki.Parser_mgr().Main().Parse_text_to_html(wiki.Parser_mgr().Ctx(), wiki.Msg_mgr().Val_by_key_args(Ref_html_wtr_cfg.Msg_backlabels_err, itm.Idx_minor()))
|
||||
;
|
||||
itm_fmtr.Bld_bfr_many(trg
|
||||
, fmtr.Atrs_(cfg.Itm_id_key_one(), itm.Name(), itm.Idx_major(), itm.Idx_minor())
|
||||
, fmtr.Set(cfg.Itm_id_key_one(), itm.Name(), itm.Idx_major(), itm.Idx_minor())
|
||||
, backlabel
|
||||
);
|
||||
}
|
||||
private Bry_fmtr_arg_fmtr_objs fmtr = Bry_fmtr_arg_.fmtr_null_();
|
||||
private Bfr_arg__bry_fmtr fmtr = Bfr_arg_.New_bry_fmtr__null();
|
||||
}
|
||||
|
||||
@@ -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.xtns.cite; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
public class Ref_html_wtr_cfg {
|
||||
public Bry_fmtr Itm_html() {return itm_html;} private Bry_fmtr itm_html; public Ref_html_wtr_cfg Itm_html_(String v) {itm_html = Bry_fmtr.new_(v, "itm_id", "grp_id", "grp_key"); return this;}
|
||||
public Bry_fmtr Itm_id_uid() {return itm_id_uid;} private Bry_fmtr itm_id_uid; public Ref_html_wtr_cfg Itm_id_uid_(String v) {itm_id_uid = Bry_fmtr.new_(v, "uid"); return this;}
|
||||
|
||||
@@ -17,45 +17,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.makes.*;
|
||||
public interface Gallery_box_w_fmtr_arg extends Bry_fmtr_arg {
|
||||
public interface Gallery_box_w_fmtr_arg extends gplx.core.brys.Bfr_arg {
|
||||
Gallery_box_w_fmtr_arg Init(int uid, int width);
|
||||
}
|
||||
class Gallery_box_w_fmtr_arg__basic implements Gallery_box_w_fmtr_arg {
|
||||
class Gallery_box_w_fmtr_arg__basic extends gplx.core.brys.Bfr_arg_base implements Gallery_box_w_fmtr_arg {
|
||||
private int width;
|
||||
public Gallery_box_w_fmtr_arg Init(int uid, int width) {this.width = width; return this;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
bfr.Add(Style_bgn);
|
||||
bfr.Add_int_variable(width);
|
||||
bfr.Add(Style_end);
|
||||
}
|
||||
private static final byte[] Style_bgn = Bry_.new_a7("style=\"width: "), Style_end = Bry_.new_a7("px\"");
|
||||
}
|
||||
class Gallery_box_w_fmtr_arg__hdump implements Gallery_box_w_fmtr_arg {
|
||||
class Gallery_box_w_fmtr_arg__hdump extends gplx.core.brys.Bfr_arg_base implements Gallery_box_w_fmtr_arg {
|
||||
private int uid;
|
||||
public Gallery_box_w_fmtr_arg Init(int uid, int width) {this.uid = uid; return this;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
bfr.Add(Xoh_make_trie_.Bry__gallery_box_w);
|
||||
bfr.Add_int_variable(uid);
|
||||
bfr.Add_byte_apos();
|
||||
}
|
||||
}
|
||||
interface Gallery_img_pad_fmtr_arg extends Bry_fmtr_arg {
|
||||
interface Gallery_img_pad_fmtr_arg extends gplx.core.brys.Bfr_arg {
|
||||
Gallery_img_pad_fmtr_arg Init(int uid, int vpad);
|
||||
}
|
||||
class Gallery_img_pad_fmtr_arg__basic implements Gallery_img_pad_fmtr_arg {
|
||||
class Gallery_img_pad_fmtr_arg__basic extends gplx.core.brys.Bfr_arg_base implements Gallery_img_pad_fmtr_arg {
|
||||
private int vpad;
|
||||
public Gallery_img_pad_fmtr_arg Init(int uid, int vpad) {this.vpad = vpad; return this;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
bfr.Add(Style_bgn);
|
||||
bfr.Add_int_variable(vpad);
|
||||
bfr.Add(Style_end);
|
||||
}
|
||||
private static final byte[] Style_bgn = Bry_.new_a7("style=\"margin:"), Style_end = Bry_.new_a7("px auto;\"");
|
||||
}
|
||||
class Gallery_img_pad_fmtr_arg__hdump implements Gallery_img_pad_fmtr_arg {
|
||||
class Gallery_img_pad_fmtr_arg__hdump extends gplx.core.brys.Bfr_arg_base implements Gallery_img_pad_fmtr_arg {
|
||||
private int uid;
|
||||
public Gallery_img_pad_fmtr_arg Init(int uid, int width) {this.uid = uid; return this;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
bfr.Add(Xoh_make_trie_.Bry__gallery_img_pad);
|
||||
bfr.Add_int_variable(uid);
|
||||
bfr.Add_byte_apos();
|
||||
|
||||
@@ -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.xtns.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.files.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*; import gplx.xowa.htmls.core.makes.imgs.*; import gplx.xowa.wikis.pages.*; import gplx.xowa.parsers.lnkis.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.parsers.*;
|
||||
@@ -119,7 +120,7 @@ public class Gallery_html_wtr {
|
||||
itm_bfr.Mkr_rls();
|
||||
tmp_bfr.Mkr_rls();
|
||||
int mgr_box_width_max = mgr_box_width_all < mgr_box_width_row ? mgr_box_width_row : mgr_box_width_all;
|
||||
Gallery_html_wtr_.Mgr_all_fmtr.Bld_bfr_many(bfr, mgr_elem_id, mgr_box_cls, Bry_fmtr_arg_.fmtr_(mgr_box_style, Bry_fmtr_arg_.int_(mgr_box_width_max)), itm_bfr);
|
||||
Gallery_html_wtr_.Mgr_all_fmtr.Bld_bfr_many(bfr, mgr_elem_id, mgr_box_cls, Bfr_arg_.New_bry_fmtr(mgr_box_style, Bfr_arg_.New_int(mgr_box_width_max)), itm_bfr);
|
||||
}
|
||||
}
|
||||
class Gallery_html_wtr_ {
|
||||
|
||||
@@ -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.xtns.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.modules.*; import gplx.xowa.files.*; import gplx.xowa.htmls.core.makes.*; import gplx.xowa.htmls.core.makes.imgs.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*; import gplx.xowa.parsers.lnkis.*;
|
||||
public abstract class Gallery_mgr_base {
|
||||
|
||||
@@ -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.xtns.hieros; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
class Hiero_html_wtr {
|
||||
private Hiero_phoneme_mgr phoneme_mgr;
|
||||
|
||||
@@ -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.xtns.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
class Imap_html_fmtrs {
|
||||
public static final Bry_fmtr
|
||||
All = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
|
||||
|
||||
@@ -16,10 +16,10 @@ 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.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.core.primitives.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*;
|
||||
import gplx.xowa.parsers.*;
|
||||
class Imap_img_fmtr_arg implements Bry_fmtr_arg {
|
||||
class Imap_img_fmtr_arg extends gplx.core.brys.Bfr_arg_base {
|
||||
private Xoh_wtr_ctx hctx; private Imap_map map; private Imap_xtn_mgr xtn_mgr;
|
||||
private int img_elem_id, img_w, img_h;
|
||||
private byte[] img_alt, img_src, img_cls, img_href;
|
||||
@@ -32,7 +32,7 @@ class Imap_img_fmtr_arg implements Bry_fmtr_arg {
|
||||
this.img_cls = img_cls;
|
||||
this.img_href = img_href;
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
Bry_fmtr fmtr = Imap_html_fmtrs.Img_anchor_none;
|
||||
byte[] anchor_href = Bry_.Empty, anchor_text = Bry_.Empty;
|
||||
Imap_itm_dflt itm_dflt = map.Dflt();
|
||||
|
||||
@@ -16,20 +16,21 @@ 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.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
class Imap_map_fmtr implements Bry_fmtr_arg {
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
class Imap_map_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
private int imap_id;
|
||||
public void Init(int imap_id, Imap_itm_shape[] shapes, double scale) {this.imap_id = imap_id; shapes_fmtr_arg.Init(shapes, scale);}
|
||||
public Imap_pts_fmtr_arg Pts_fmtr() {return shapes_fmtr_arg.Pts_fmtr();}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
Imap_html_fmtrs.Map.Bld_bfr_many(bfr, imap_id, shapes_fmtr_arg);
|
||||
}
|
||||
private static final Imap_shapes_fmtr shapes_fmtr_arg = new Imap_shapes_fmtr();
|
||||
}
|
||||
class Imap_shapes_fmtr implements Bry_fmtr_arg {
|
||||
class Imap_shapes_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Imap_itm_shape[] shapes;
|
||||
public void Init(Imap_itm_shape[] shapes, double scale) {this.shapes = shapes; pts_fmtr_arg.Scale_(scale);}
|
||||
public Imap_pts_fmtr_arg Pts_fmtr() {return pts_fmtr_arg;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int shapes_len = shapes.length;
|
||||
Bry_fmtr fmtr = Imap_html_fmtrs.Area;
|
||||
for (int i = 0; i < shapes_len; ++i) {
|
||||
|
||||
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
class Imap_pts_fmtr_arg implements Bry_fmtr_arg {
|
||||
class Imap_pts_fmtr_arg extends gplx.core.brys.Bfr_arg_base {
|
||||
private double scale = 1; private Double_obj_val[] pts;
|
||||
public void Scale_(double v) {this.scale = v;}
|
||||
public void Pts_(Double_obj_val[] v) {this.pts = v;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int pts_len = pts.length;
|
||||
for (int i = 0; i < pts_len; ++i) {
|
||||
Double_obj_val pt = pts[i];
|
||||
|
||||
@@ -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.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
public class Indicator_html_bldr implements Bry_fmtr_arg {
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
public class Indicator_html_bldr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Indicator_html_bldr_itm bldr_itm = new Indicator_html_bldr_itm();
|
||||
private Ordered_hash list = Ordered_hash_.New();
|
||||
public void Enabled_(boolean v) {enabled = v;} private boolean enabled = Bool_.Y;
|
||||
@@ -30,7 +31,7 @@ public class Indicator_html_bldr implements Bry_fmtr_arg {
|
||||
if (!enabled) return; // do not add if disabled; called from <page>; PAGE:en.s:The_Parochial_System_(Wilberforce,_1838); DATE:2015-04-29
|
||||
list.Add_if_dupe_use_nth(xnde.Name(), xnde); // Add_if_dupe_use_nth: 2nd indicator overwrites 1st; DATE:2015-04-29
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (list.Count() == 0) return; // do not build html if no items; DATE:2015-04-29
|
||||
bldr_itm.Init(list);
|
||||
fmtr_grp.Bld_bfr_many(bfr, bldr_itm);
|
||||
@@ -43,10 +44,10 @@ public class Indicator_html_bldr implements Bry_fmtr_arg {
|
||||
), "itms")
|
||||
;
|
||||
}
|
||||
class Indicator_html_bldr_itm implements Bry_fmtr_arg {
|
||||
class Indicator_html_bldr_itm extends gplx.core.brys.Bfr_arg_base {
|
||||
private Ordered_hash list;
|
||||
public void Init(Ordered_hash list) {this.list = list;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int list_len = list.Count();
|
||||
for (int i = list_len - 1; i > -1; --i) { // reverse order
|
||||
Indicator_xnde xnde = (Indicator_xnde)list.Get_at(i);
|
||||
|
||||
@@ -60,7 +60,7 @@ class Indicator_html_bldr_fxt {
|
||||
}
|
||||
public void Test_bld(String expd) {
|
||||
Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
page.Html_data().Indicators().Fmt__do(tmp_bfr);
|
||||
page.Html_data().Indicators().Bfr_arg__add(tmp_bfr);
|
||||
Tfds.Eq_str_lines(expd, tmp_bfr.To_str_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.xtns.insiders; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.wikis.pages.skins.*;
|
||||
import gplx.xowa.htmls.hrefs.*;
|
||||
@@ -32,7 +33,7 @@ class Insider_xtn_skin_itm implements Xopg_xtn_skin_itm {
|
||||
html_bldr.Bld_all(bfr, page, itms);
|
||||
}
|
||||
}
|
||||
public class Insider_html_bldr implements Bry_fmtr_arg {
|
||||
public class Insider_html_bldr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Insider_xtn_mgr xtn_mgr;
|
||||
private Bry_bfr tmp_ttl = Bry_bfr.reset_(255);
|
||||
private List_adp list; private int list_len;
|
||||
@@ -43,7 +44,7 @@ public class Insider_html_bldr implements Bry_fmtr_arg {
|
||||
hash.Clear();
|
||||
fmtr_grp.Bld_bfr_many(bfr, xtn_mgr.Msg_sidebar_ttl(), xtn_mgr.Msg_about_page(), xtn_mgr.Msg_about_ttl(), this);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
Xowe_wiki wiki = xtn_mgr.Wiki();
|
||||
Url_encoder href_encoder = Xoa_app_.Utl__encoder_mgr().Href();
|
||||
for (int i = 0; i < list_len; ++i) {
|
||||
|
||||
@@ -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.xtns.math; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.vnts.*;
|
||||
public class Xof_math_html_wtr {
|
||||
|
||||
@@ -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.xtns.math; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.core.strings.*; import gplx.core.consoles.*; import gplx.xowa.apps.progs.*;
|
||||
public class Xof_math_mgr implements GfoInvkAble {
|
||||
private Xoae_app app;
|
||||
|
||||
@@ -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.pfuncs.exprs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.btries.*;
|
||||
import gplx.core.btries.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*;
|
||||
import gplx.xowa.parsers.*;
|
||||
public class Pfunc_expr_shunter {
|
||||
|
||||
@@ -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.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.brys.*;
|
||||
class Pxd_eval_year {
|
||||
public static void Eval_at_pos_0(Pxd_parser tctx, Pxd_itm_int cur) {
|
||||
Pxd_itm[] data_ary = tctx.Data_ary();
|
||||
@@ -80,7 +81,7 @@ class Pxd_eval_seg {
|
||||
tctx.Seg_idxs_(itm, DateAdp_.SegIdx_year);
|
||||
return true;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_year, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_year, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_m(Pxd_parser tctx, Pxd_itm_int itm) {
|
||||
@@ -94,7 +95,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_month, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_month, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_d(Pxd_parser tctx, Pxd_itm_int itm) {
|
||||
@@ -108,7 +109,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_day, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_day, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_h(Pxd_parser tctx, Pxd_itm_int itm) {
|
||||
@@ -122,7 +123,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_hour, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_hour, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_n(Pxd_parser tctx, Pxd_itm_int itm) {
|
||||
@@ -136,7 +137,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_minute, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_minute, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_s(Pxd_parser tctx, Pxd_itm_int itm) {
|
||||
@@ -150,7 +151,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_second, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_second, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_tz_h(Pxd_parser tctx, Pxd_itm_int itm, boolean negative) {
|
||||
@@ -166,7 +167,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_hour, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_hour, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static boolean Eval_as_tz_m(Pxd_parser tctx, Pxd_itm_int itm, boolean negative) {
|
||||
@@ -182,7 +183,7 @@ class Pxd_eval_seg {
|
||||
}
|
||||
break;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_minute, Bry_fmtr_arg_.int_(val));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_minute, Bfr_arg_.New_int(val));
|
||||
return false;
|
||||
}
|
||||
public static byte Eval_as_tz_sym(Pxd_parser tctx, Pxd_itm[] tkns, Pxd_itm_int hour_itm) {
|
||||
@@ -195,7 +196,7 @@ class Pxd_eval_seg {
|
||||
break;
|
||||
case Pxd_itm_.Tid_dash: return Bool_.N_byte;
|
||||
}
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_timezone, Bry_fmtr_arg_.bry_("null"));
|
||||
tctx.Err_set(Pft_func_time_log.Invalid_timezone, Bfr_arg_.New_bry("null"));
|
||||
return Bool_.__byte;
|
||||
}
|
||||
}
|
||||
@@ -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.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.brys.*;
|
||||
interface Pxd_itm_int_interface extends Pxd_itm {
|
||||
int Xto_int_or(int or);
|
||||
}
|
||||
@@ -220,7 +221,7 @@ class Pxd_itm_int extends Pxd_itm_base implements Pxd_itm_int_interface {
|
||||
}
|
||||
private void Eval_unknown_at_pos_0(Pxd_parser tctx) { // NOTE: assumes dmy format
|
||||
Pxd_itm[] data_ary = tctx.Data_ary();
|
||||
if (tctx.Data_ary_len() < 2) {tctx.Err_set(Pft_func_time_log.Invalid_year, Bry_fmtr_arg_.int_(val)); return;}
|
||||
if (tctx.Data_ary_len() < 2) {tctx.Err_set(Pft_func_time_log.Invalid_year, Bfr_arg_.New_int(val)); return;}
|
||||
Pxd_itm_int itm_1 = Pxd_itm_int_.CastOrNull(data_ary[1]);
|
||||
if (itm_1 != null) { // if 1st itm to right is number, parse it as month
|
||||
if (!Pxd_eval_seg.Eval_as_m(tctx, itm_1)) return;
|
||||
|
||||
@@ -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.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.brys.*;
|
||||
class Pxd_itm_colon extends Pxd_itm_base {
|
||||
@Override public byte Tkn_tid() {return Pxd_itm_.Tid_colon;}
|
||||
@Override public int Eval_idx() {return 20;}
|
||||
@@ -26,7 +27,7 @@ class Pxd_itm_colon extends Pxd_itm_base {
|
||||
switch (colon_count) {
|
||||
case 1: // hh:mm
|
||||
itm_int = Pxd_itm_int_.GetNearest(tkns, this.Ary_idx(), Bool_.N);
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_hour, Bry_fmtr_arg_.bry_("null")); return;}
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_hour, Bfr_arg_.New_bry("null")); return;}
|
||||
if (!Pxd_eval_seg.Eval_as_h(state, itm_int)) return;
|
||||
itm_int = Pxd_itm_int_.GetNearest(tkns, this.Ary_idx(), true);
|
||||
if (!Pxd_eval_seg.Eval_as_n(state, itm_int)) return;
|
||||
@@ -37,13 +38,13 @@ class Pxd_itm_colon extends Pxd_itm_base {
|
||||
break;
|
||||
case 3: // +hh:mm; DATE:2014-08-26
|
||||
itm_int = Pxd_itm_int_.GetNearest(tkns, this.Ary_idx(), Bool_.N);
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_timezone, Bry_fmtr_arg_.bry_("null")); return;}
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_timezone, Bfr_arg_.New_bry("null")); return;}
|
||||
byte tz_positive_val = Pxd_eval_seg.Eval_as_tz_sym(state, tkns, itm_int);
|
||||
if (tz_positive_val == Bool_.__byte) return;
|
||||
boolean tz_negative = tz_positive_val == Bool_.N_byte;
|
||||
if (!Pxd_eval_seg.Eval_as_tz_h(state, itm_int, tz_negative)) return;
|
||||
itm_int = Pxd_itm_int_.GetNearest(tkns, this.Ary_idx(), Bool_.Y);
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_timezone, Bry_fmtr_arg_.bry_("null")); return;}
|
||||
if (itm_int == null) {state.Err_set(Pft_func_time_log.Invalid_timezone, Bfr_arg_.New_bry("null")); return;}
|
||||
if (tz_negative) itm_int.Val_(itm_int.Val() * -1);
|
||||
if (!Pxd_eval_seg.Eval_as_tz_m(state, itm_int, tz_negative)) return;
|
||||
break;
|
||||
|
||||
@@ -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.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.brys.*;
|
||||
class Pxd_itm_month_name extends Pxd_itm_base implements Pxd_itm_prototype {
|
||||
public Pxd_itm_month_name(int ary_idx, byte[] name, int seg_idx, int seg_val) {Ctor(ary_idx); this.name = name; Seg_idx_(seg_idx); this.seg_val = seg_val;} private byte[] name;
|
||||
@Override public byte Tkn_tid() {return Pxd_itm_.Tid_month_name;}
|
||||
@@ -231,10 +232,10 @@ class Pxd_itm_day_suffix extends Pxd_itm_base implements Pxd_itm_prototype {
|
||||
@Override public void Eval(Pxd_parser state) {
|
||||
Pxd_itm[] tkn_ary = state.Tkns();
|
||||
int tkn_idx = this.Ary_idx();
|
||||
if (tkn_idx == 0) state.Err_set(Pft_func_time_log.Invalid_day, Bry_fmtr_arg_.int_(Int_.Min_value));
|
||||
if (tkn_idx == 0) state.Err_set(Pft_func_time_log.Invalid_day, Bfr_arg_.New_int(Int_.Min_value));
|
||||
Pxd_itm day_itm = tkn_ary[tkn_idx - 1];
|
||||
if (day_itm.Seg_idx() != DateAdp_.SegIdx_day) {
|
||||
state.Err_set(Pft_func_time_log.Invalid_day, Bry_fmtr_arg_.int_(Int_.Min_value));
|
||||
state.Err_set(Pft_func_time_log.Invalid_day, Bfr_arg_.New_int(Int_.Min_value));
|
||||
}
|
||||
}
|
||||
public static final Pxd_itm_day_suffix Instance = new Pxd_itm_day_suffix(); Pxd_itm_day_suffix() {}
|
||||
@@ -290,7 +291,7 @@ class Pxd_itm_unit_relative extends Pxd_itm_base implements Pxd_itm_prototype {
|
||||
public Pxd_itm MakeNew(int ary_idx) {return new Pxd_itm_unit_relative(adj, ary_idx);}
|
||||
@Override public void Eval(Pxd_parser state) {
|
||||
Pxd_itm itm = Pxd_itm_.Find_fwd_by_tid(state.Tkns(), this.Ary_idx() + 1, Pxd_itm_.Tid_unit);
|
||||
if (itm == null) state.Err_set(Pft_func_time_log.Invalid_date, Bry_fmtr_arg_.int_(adj));
|
||||
if (itm == null) state.Err_set(Pft_func_time_log.Invalid_date, Bfr_arg_.New_int(adj));
|
||||
Pxd_itm_unit unit_tkn = (Pxd_itm_unit)itm;
|
||||
unit_tkn.Unit_seg_val_(adj);
|
||||
}
|
||||
@@ -350,7 +351,7 @@ class Pxd_itm_iso8601_t extends Pxd_itm_base implements Pxd_itm_prototype {
|
||||
@Override public void Eval(Pxd_parser state) {
|
||||
Pxd_itm hour = Next_non_ws_tkn(state.Tkns(), this.Ary_idx() + 1);
|
||||
if (hour != null && hour.Seg_idx() == DateAdp_.SegIdx_hour) return; // next item is hour
|
||||
state.Err_set(Pft_func_time_log.Invalid_hour, Bry_fmtr_arg_.bry_("T"));
|
||||
state.Err_set(Pft_func_time_log.Invalid_hour, Bfr_arg_.New_bry("T"));
|
||||
}
|
||||
@Override public void Time_ini(DateAdpBldr bldr) {}
|
||||
private static Pxd_itm Next_non_ws_tkn(Pxd_itm[] tkns, int bgn) {
|
||||
|
||||
@@ -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.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.btries.*; import gplx.core.log_msgs.*;
|
||||
import gplx.core.brys.*; import gplx.core.brys.fmtrs.*; import gplx.core.btries.*; import gplx.core.log_msgs.*;
|
||||
class Pxd_parser {
|
||||
byte[] src; int cur_pos, tkn_bgn_pos, src_len, tkn_type;
|
||||
public Pxd_itm[] Tkns() {return tkns;} Pxd_itm[] tkns;
|
||||
@@ -37,7 +37,7 @@ class Pxd_parser {
|
||||
if (seg_idx >= 0) // ignore Seg_idx_null and Seg_idx_skip
|
||||
seg_idxs[seg_idx] = val;
|
||||
}
|
||||
public void Err_set(Gfo_msg_itm itm, Bry_fmtr_arg... args) {
|
||||
public void Err_set(Gfo_msg_itm itm, Bfr_arg... args) {
|
||||
if (itm == null) return;
|
||||
Bry_fmtr fmtr = itm.Fmtr();
|
||||
fmtr.Bld_bfr(error_bfr, args);
|
||||
@@ -128,7 +128,7 @@ class Pxd_parser {
|
||||
}
|
||||
DateAdp Evaluate(byte[] src, Bry_bfr error) {
|
||||
if (tkns_len == 0) {
|
||||
Err_set(Pft_func_time_log.Invalid_day, Bry_fmtr_arg_.bry_(src));
|
||||
Err_set(Pft_func_time_log.Invalid_day, Bfr_arg_.New_bry(src));
|
||||
return null;
|
||||
}
|
||||
Pxd_itm[] eval_ary = Pxd_itm_sorter.XtoAryAndSort(tkns, tkns_len);
|
||||
|
||||
@@ -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.pfuncs.ttls; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.btries.*; import gplx.langs.htmls.encoders.*;
|
||||
import gplx.core.brys.*; import gplx.core.btries.*; import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.amps.*; import gplx.xowa.parsers.lnkes.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.lnkis.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Pfunc_anchorencode extends Pf_func_base { // EX: {{anchorencode:a b}} -> a+b
|
||||
@@ -25,8 +25,8 @@ public class Pfunc_anchorencode extends Pf_func_base { // EX: {{anchorencode:a b
|
||||
@Override public Pf_func New(int id, byte[] name) {return new Pfunc_anchorencode().Name_(name);}
|
||||
public static void Func_init(Xop_ctx ctx) {
|
||||
if (anchor_ctx != null) return;// NOTE: called by Scrib_uri
|
||||
encode_trie.Add(Byte_ascii.Colon, Bry_fmtr_arg_.byt_(Byte_ascii.Colon));
|
||||
encode_trie.Add(Byte_ascii.Space, Bry_fmtr_arg_.byt_(Byte_ascii.Underline));
|
||||
encode_trie.Add(Byte_ascii.Colon, Bfr_arg_.New_byte(Byte_ascii.Colon));
|
||||
encode_trie.Add(Byte_ascii.Space, Bfr_arg_.New_byte(Byte_ascii.Underline));
|
||||
anchor_ctx = Xop_ctx.new_sub_(ctx.Wiki());
|
||||
anchor_ctx.Para().Enabled_n_();
|
||||
anchor_tkn_mkr = anchor_ctx.Tkn_mkr();
|
||||
|
||||
@@ -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.proofreadPage; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.core.primitives.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.apps.cfgs.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
|
||||
@@ -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.xtns.relatedArticles; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.wikis.pages.skins.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
@@ -52,10 +53,10 @@ class Articles_itm {
|
||||
public byte[] Ttl() {return ttl;} private byte[] ttl;
|
||||
public byte[] Text() {return text;} private byte[] text;
|
||||
}
|
||||
class Articles_itm_fmtr implements Bry_fmtr_arg {
|
||||
class Articles_itm_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Xowe_wiki wiki; private List_adp itms;
|
||||
public void Init(Xowe_wiki wiki, List_adp itms) {this.wiki = wiki; this.itms = itms;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = itms.Count();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Articles_itm itm = (Articles_itm)itms.Get_at(i);
|
||||
|
||||
@@ -44,7 +44,7 @@ class Articles_func_fxt {
|
||||
fxt.Test_parse_page_all_str(raw, "");
|
||||
Xopg_xtn_skin_fmtr_arg fmtr_arg = new Xopg_xtn_skin_fmtr_arg(fxt.Page(), Xopg_xtn_skin_itm_tid.Tid_sidebar);
|
||||
Bry_bfr bfr = Bry_bfr.new_();
|
||||
fmtr_arg.Fmt__do(bfr);
|
||||
fmtr_arg.Bfr_arg__add(bfr);
|
||||
Tfds.Eq_str_lines(expd, bfr.To_str_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.xtns.relatedSites; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.wikis.pages.skins.*;
|
||||
import gplx.xowa.htmls.hrefs.*;
|
||||
class Sites_xtn_skin_itm implements Xopg_xtn_skin_itm {
|
||||
@@ -29,7 +30,7 @@ class Sites_xtn_skin_itm implements Xopg_xtn_skin_itm {
|
||||
html_bldr.Bld_all(bfr, page, itms);
|
||||
}
|
||||
}
|
||||
public class Sites_html_bldr implements Bry_fmtr_arg {
|
||||
public class Sites_html_bldr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Sites_xtn_mgr xtn_mgr;
|
||||
private Bry_bfr tmp_ttl = Bry_bfr.reset_(255);
|
||||
private List_adp list; private int list_len;
|
||||
@@ -41,7 +42,7 @@ public class Sites_html_bldr implements Bry_fmtr_arg {
|
||||
hash.Clear();
|
||||
fmtr_grp.Bld_bfr_many(bfr, xtn_mgr.Msg_related_sites(), this);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
Xowe_wiki wiki = xtn_mgr.Wiki();
|
||||
Xoh_href_parser href_parser = wiki.Appe().Html__href_parser();
|
||||
for (int i = 0; i < list_len; ++i) {
|
||||
|
||||
@@ -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.xtns.scores; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
public class Score_xtn_mgr extends Xox_mgr_base {
|
||||
@Override public byte[] Xtn_key() {return XTN_KEY;} public static final byte[] XTN_KEY = Bry_.new_a7("score");
|
||||
@Override public Xox_mgr Clone_new() {return new Score_xtn_mgr();}
|
||||
|
||||
@@ -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.xtns.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.*;
|
||||
import gplx.xowa.langs.kwds.*; import gplx.xowa.langs.msgs.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
|
||||
@@ -250,8 +250,8 @@ public class Scrib_lib_mw implements Scrib_lib {
|
||||
Xot_invk parent_frame = frame_tid == Scrib_frame_.Tid_current ? core.Frame_current() : core.Frame_parent();
|
||||
byte[] fnc_name = args.Pull_bry(1);
|
||||
int fnc_name_len = fnc_name.length;
|
||||
Bry_obj_ref argx_ref = Bry_obj_ref.null_();
|
||||
Bry_obj_ref fnc_name_ref = Bry_obj_ref.new_(fnc_name);
|
||||
Bry_obj_ref argx_ref = Bry_obj_ref.New_empty();
|
||||
Bry_obj_ref fnc_name_ref = Bry_obj_ref.New(fnc_name);
|
||||
KeyVal[] parser_func_args = CallParserFunction_parse_args(cur_wiki.Appe().Utl_num_parser(), argx_ref, fnc_name_ref, args.Ary());
|
||||
Xot_invk_mock frame = Xot_invk_mock.new_(parent_frame.Defn_tid(), 0, fnc_name, parser_func_args); // pass something as frame_ttl; choosng fnc_name; DATE:2014-09-21
|
||||
Xol_func_itm finder = cur_wiki.Lang().Func_regy().Find_defn(fnc_name, 0, fnc_name_len);
|
||||
|
||||
@@ -217,7 +217,7 @@ public class Scrib_lib_title implements Scrib_lib {
|
||||
rv[ 0] = KeyVal_.new_("isLocal" , true); // title.isLocal; NOTE: always true; passing "http:" also returns true; not sure how to handle "Interwiki::fetch( $this->mInterwiki )->isLocal()"
|
||||
rv[ 1] = KeyVal_.new_("interwiki" , xwiki_str); // $title->getInterwiki(),
|
||||
rv[ 2] = KeyVal_.new_("namespace" , ns.Id()); // $ns,
|
||||
rv[ 3] = KeyVal_.new_("nsText" , Xow_ns_canonical_.To_canonical_or_local(ns)); // $title->getNsText(), NOTE: needed b/c some modules expect English "Template"; PAGE:sh.w:Koprno DATE:2015-11-08
|
||||
rv[ 3] = KeyVal_.new_("nsText" , Xow_ns_canonical_.To_canonical_or_local_as_str(ns)); // $title->getNsText(), NOTE: needed b/c some modules expect English "Template"; PAGE:sh.w:Koprno DATE:2015-11-08
|
||||
rv[ 4] = KeyVal_.new_("text" , ttl.Page_txt()); // $title->getText(),
|
||||
rv[ 5] = KeyVal_.new_("fragment" , ttl.Anch_txt()); // $title->getFragment(),
|
||||
rv[ 6] = KeyVal_.new_("thePartialUrl" , ttl.Page_db()); // $title->getPartialUrl(),
|
||||
|
||||
@@ -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.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.regxs.*;
|
||||
public class Scrib_regx_converter {
|
||||
private List_adp capt_list = List_adp_.new_(), grps_parens = List_adp_.new_(); private List_adp grps_open = List_adp_.new_();
|
||||
|
||||
@@ -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.translates; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.core.primitives.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.langs.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
|
||||
@@ -101,14 +101,14 @@ public class Xop_languages_xnde implements Xox_xnde {
|
||||
;
|
||||
// "<img src=\"//bits.wikimedia.org/static-1.22wmf9/extensions/Translate/res/images/prog-1.png\" alt=\"~{img_alt}\" title=\"~{img_title}\" width=\"9\" height=\"9\" /> • "
|
||||
}
|
||||
class Xop_languages_fmtr implements Bry_fmtr_arg {
|
||||
class Xop_languages_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
public void Init(List_adp langs, Xowe_wiki wiki, Xoa_ttl root_ttl, byte[] cur_lang) {
|
||||
this.langs = langs;
|
||||
this.wiki = wiki;
|
||||
this.root_ttl = root_ttl;
|
||||
this.cur_lang = cur_lang;
|
||||
} private List_adp langs; private Xowe_wiki wiki; private Xoa_ttl root_ttl; private byte[] cur_lang;
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = langs.Count();
|
||||
Xoh_href_wtr href_wtr = wiki.Appe().Html__href_wtr();
|
||||
int ns_id = root_ttl.Ns().Id();
|
||||
|
||||
@@ -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.xtns.wdatas; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.xtns.wdatas.hwtrs.*;
|
||||
class Wdata_prop_val_visitor implements Wdata_claim_visitor {
|
||||
|
||||
@@ -150,7 +150,7 @@ public class Wdata_wiki_mgr_fxt {
|
||||
parser_fxt.Exec_parse_page_all_as_str(raw);
|
||||
Bry_bfr tmp_bfr = wiki.Appe().Utl__bfr_mkr().Get_b512();
|
||||
|
||||
wdata_lang_wtr.Page_(page).Fmt__do(tmp_bfr);
|
||||
wdata_lang_wtr.Page_(page).Bfr_arg__add(tmp_bfr);
|
||||
Tfds.Eq_str_lines(expd, tmp_bfr.To_str_and_rls());
|
||||
}
|
||||
public void Test_xwiki_links(String ttl, String... expd) {
|
||||
|
||||
@@ -19,9 +19,9 @@ package gplx.xowa.xtns.wdatas; import gplx.*; import gplx.xowa.*; import gplx.xo
|
||||
import gplx.langs.jsons.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.xwikis.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.xtns.wdatas.pfuncs.*;
|
||||
public class Wdata_xwiki_link_wtr implements Bry_fmtr_arg {
|
||||
public class Wdata_xwiki_link_wtr extends gplx.core.brys.Bfr_arg_base {
|
||||
public Wdata_xwiki_link_wtr Page_(Xoae_page page) {this.page = page; return this;} private Xoae_page page;
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
List_adp slink_list = page.Slink_list();
|
||||
Xoa_ttl page_ttl = page.Ttl();
|
||||
byte[] qid = Write_wdata_links(slink_list, page.Wikie(), page_ttl, page.Wdata_external_lang_links());
|
||||
|
||||
@@ -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.xtns.wdatas.core; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.xtns.wdatas.hwtrs.*;
|
||||
public class Wdata_claim_itm_time extends Wdata_claim_itm_core { public Wdata_claim_itm_time(int pid, byte snak_tid, byte[] time, byte[] timezone, byte[] before, byte[] after, byte[] precision, byte[] calendar) {
|
||||
this.Ctor(pid, snak_tid);
|
||||
|
||||
@@ -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.xtns.wdatas.core; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.xtns.wdatas.hwtrs.*;
|
||||
public class Wdata_date {
|
||||
public Wdata_date(long year, int month, int day, int hour, int minute, int second, int precision, int before, int after, boolean calendar_is_julian) {
|
||||
|
||||
@@ -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.wdatas.core; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import org.junit.*;
|
||||
import org.junit.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.jsons.*; import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.xtns.wdatas.parsers.*; import gplx.xowa.xtns.wdatas.hwtrs.*;
|
||||
public class Wdata_date_tst {
|
||||
@Before public void init() {fxt.Clear();} private Wdata_date_fxt fxt = new Wdata_date_fxt();
|
||||
|
||||
@@ -16,8 +16,9 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
class Wdata_fmtr__claim_grp implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__claim_grp extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_fmtr__claim_tbl fmtr_tbl = new Wdata_fmtr__claim_tbl(); private boolean is_empty;
|
||||
private Xoapi_toggle_itm toggle_itm;
|
||||
private Wdata_toc_data toc_data;
|
||||
@@ -33,7 +34,7 @@ class Wdata_fmtr__claim_grp implements Bry_fmtr_arg {
|
||||
toc_data.Make(list_count);
|
||||
fmtr_tbl.Init_by_wdoc(ttl, list);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (is_empty) return;
|
||||
fmtr.Bld_bfr_many(bfr, toc_data.Href(), toc_data.Text(), toggle_itm.Html_toggle_btn(), toggle_itm.Html_toggle_hdr(), fmtr_tbl);
|
||||
}
|
||||
@@ -48,7 +49,7 @@ class Wdata_fmtr__claim_grp implements Bry_fmtr_arg {
|
||||
, " </div>"
|
||||
), "hdr_href", "hdr_text", "toggle_btn", "toggle_hdr", "tbls");
|
||||
}
|
||||
class Wdata_fmtr__claim_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__claim_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_fmtr__claim_row fmtr_row = new Wdata_fmtr__claim_row(); private Wdata_lbl_mgr lbl_mgr;
|
||||
private Ordered_hash list; private byte[] ttl;
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_mgr) {this.lbl_mgr = lbl_mgr; fmtr_row.Init_by_ctor(lbl_mgr);}
|
||||
@@ -59,7 +60,7 @@ class Wdata_fmtr__claim_tbl implements Bry_fmtr_arg {
|
||||
this.list = list;
|
||||
this.ttl = ttl;
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = list.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Wdata_claim_grp grp = (Wdata_claim_grp)list.Get_at(i);
|
||||
@@ -81,7 +82,7 @@ class Wdata_fmtr__claim_tbl implements Bry_fmtr_arg {
|
||||
, " </div>"
|
||||
), "pid", "pid_lbl", "itms");
|
||||
}
|
||||
class Wdata_fmtr__claim_row implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__claim_row extends gplx.core.brys.Bfr_arg_base {
|
||||
private byte[] ttl;
|
||||
private Wdata_visitor__html_wtr claim_html_wtr = new Wdata_visitor__html_wtr();
|
||||
private Wdata_fmtr__qual_tbl fmtr_qual = new Wdata_fmtr__qual_tbl();
|
||||
@@ -101,7 +102,7 @@ class Wdata_fmtr__claim_row implements Bry_fmtr_arg {
|
||||
public void Init_by_grp(byte[] ttl, Wdata_claim_grp claim_grp) {
|
||||
this.ttl = ttl; this.claim_grp = claim_grp;
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = claim_grp.Len();
|
||||
claim_html_wtr.Init(ttl, tmp_bfr, msgs, lbl_mgr);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
@@ -143,7 +144,7 @@ class Wdata_fmtr__claim_row implements Bry_fmtr_arg {
|
||||
), "rank_name", "value", "qualifiers", "references"
|
||||
);
|
||||
}
|
||||
class Wdata_fmtr__qual_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__qual_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_fmtr__qual_row fmtr_row = new Wdata_fmtr__qual_row(); private Wdata_claim_itm_core claim;
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_mgr) {fmtr_row.Init_by_ctor(lbl_mgr);}
|
||||
public void Init_by_lang(Wdata_hwtr_msgs msgs) {
|
||||
@@ -153,7 +154,7 @@ class Wdata_fmtr__qual_tbl implements Bry_fmtr_arg {
|
||||
this.claim = claim;
|
||||
fmtr_row.Init_by_grp(ttl, claim.Qualifiers());
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (claim.Qualifiers() == null || claim.Qualifiers().Len() == 0) return;
|
||||
fmtr.Bld_bfr_many(bfr, fmtr_row);
|
||||
}
|
||||
@@ -165,14 +166,14 @@ class Wdata_fmtr__qual_tbl implements Bry_fmtr_arg {
|
||||
, " </div>"
|
||||
), "itms");
|
||||
}
|
||||
class Wdata_fmtr__qual_row implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__qual_row extends gplx.core.brys.Bfr_arg_base {
|
||||
private byte[] ttl; private Wdata_visitor__html_wtr claim_html_wtr = new Wdata_visitor__html_wtr();
|
||||
private Wdata_lbl_mgr lbl_mgr; private Wdata_hwtr_msgs msgs;
|
||||
private Wdata_claim_grp_list quals; private Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_mgr) {this.lbl_mgr = lbl_mgr;}
|
||||
public void Init_by_lang(Wdata_hwtr_msgs msgs) {this.msgs = msgs;}
|
||||
public void Init_by_grp(byte[] ttl, Wdata_claim_grp_list quals) {this.ttl = ttl; this.quals = quals;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = quals.Len();
|
||||
claim_html_wtr.Init(ttl, tmp_bfr, msgs, lbl_mgr);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
@@ -207,7 +208,7 @@ class Wdata_fmtr__qual_row implements Bry_fmtr_arg {
|
||||
), "pid", "pid_lbl", "value"
|
||||
);
|
||||
}
|
||||
class Wdata_fmtr__ref_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__ref_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_fmtr__ref_row fmtr_row = new Wdata_fmtr__ref_row(); private Wdata_claim_itm_core claim;
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_mgr) {fmtr_row.Init_by_ctor(lbl_mgr);}
|
||||
public void Init_by_lang(Wdata_hwtr_msgs msgs) {
|
||||
@@ -217,7 +218,7 @@ class Wdata_fmtr__ref_tbl implements Bry_fmtr_arg {
|
||||
this.claim = claim;
|
||||
fmtr_row.Init_by_grp(ttl, claim.References());
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (claim.References() == null) return;
|
||||
fmtr.Bld_bfr_many(bfr, fmtr_row);
|
||||
}
|
||||
@@ -239,7 +240,7 @@ class Wdata_fmtr__ref_tbl implements Bry_fmtr_arg {
|
||||
, " </div>"
|
||||
), "itms");
|
||||
}
|
||||
class Wdata_fmtr__ref_row implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__ref_row extends gplx.core.brys.Bfr_arg_base {
|
||||
private byte[] ttl; private Wdata_visitor__html_wtr claim_html_wtr = new Wdata_visitor__html_wtr();
|
||||
private Wdata_lbl_mgr lbl_mgr; private Wdata_hwtr_msgs msgs;
|
||||
private Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
@@ -247,7 +248,7 @@ class Wdata_fmtr__ref_row implements Bry_fmtr_arg {
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_mgr) {this.lbl_mgr = lbl_mgr;}
|
||||
public void Init_by_lang(Wdata_hwtr_msgs msgs) {this.msgs = msgs;}
|
||||
public void Init_by_grp(byte[] ttl, Wdata_references_grp[] ref_grps) {this.ttl = ttl; this.ref_grps = ref_grps;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = ref_grps.length;
|
||||
claim_html_wtr.Init(ttl, tmp_bfr, msgs, lbl_mgr);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
|
||||
@@ -16,8 +16,9 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.jsons.*; import gplx.xowa.htmls.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
class Wdata_fmtr__json implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__json extends gplx.core.brys.Bfr_arg_base {
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
private Xoapi_toggle_itm toggle_itm; private Wdata_toc_data toc_data; private Json_doc jdoc;
|
||||
public void Init_by_ctor(Wdata_toc_data toc_data, Xoapi_toggle_mgr toggle_mgr) {
|
||||
@@ -32,7 +33,7 @@ class Wdata_fmtr__json implements Bry_fmtr_arg {
|
||||
this.jdoc = jdoc;
|
||||
toc_data.Make(0);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (jdoc == null) return; // TEST: wdoc doesn't have jdoc
|
||||
jdoc.Root_nde().Print_as_json(tmp_bfr, 0);
|
||||
fmtr.Bld_bfr_many(bfr, toc_data.Href(), toc_data.Text(), toggle_itm.Html_toggle_btn(), toggle_itm.Html_toggle_hdr(), tmp_bfr.To_bry_and_clear());
|
||||
|
||||
@@ -16,9 +16,10 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.wikis.*; import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
class Wdata_fmtr__langtext_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__langtext_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_toc_data toc_data; private Wdata_lang_sorter lang_sorter; private Xoapi_toggle_itm toggle_itm; private Wdata_fmtr__langtext_row fmtr_row;
|
||||
private byte[] col_hdr_lang_name, col_hdr_lang_code, col_hdr_text; private int list_len;
|
||||
public void Init_by_ctor(Wdata_toc_data toc_data, Wdata_lang_sorter lang_sorter, Xoapi_toggle_mgr toggle_mgr, String toggle_itm_key, Wdata_fmtr__langtext_row fmtr_row) {
|
||||
@@ -36,7 +37,7 @@ class Wdata_fmtr__langtext_tbl implements Bry_fmtr_arg {
|
||||
list.Sort_by(lang_sorter);
|
||||
fmtr_row.Init_by_page(list);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (list_len == 0) return;
|
||||
fmtr.Bld_bfr_many(bfr, toc_data.Href(), toc_data.Text(), col_hdr_lang_name, col_hdr_lang_code, col_hdr_text, toggle_itm.Html_toggle_btn(), toggle_itm.Html_toggle_hdr(), fmtr_row);
|
||||
}
|
||||
@@ -54,13 +55,13 @@ class Wdata_fmtr__langtext_tbl implements Bry_fmtr_arg {
|
||||
), "hdr_href", "hdr_text", "hdr_lang_name", "hdr_lang_code", "hdr_page", "toggle_btn", "toggle_hdr", "rows"
|
||||
);
|
||||
}
|
||||
interface Wdata_fmtr__langtext_row extends Bry_fmtr_arg {
|
||||
interface Wdata_fmtr__langtext_row extends gplx.core.brys.Bfr_arg {
|
||||
void Init_by_page(Ordered_hash list);
|
||||
}
|
||||
class Wdata_fmtr__langtext_row_base implements Wdata_fmtr__langtext_row {
|
||||
class Wdata_fmtr__langtext_row_base extends gplx.core.brys.Bfr_arg_base implements Wdata_fmtr__langtext_row {
|
||||
private Ordered_hash list;
|
||||
public void Init_by_page(Ordered_hash list) {this.list = list;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = list.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Wdata_langtext_itm itm = (Wdata_langtext_itm)list.Get_at(i);
|
||||
@@ -92,10 +93,10 @@ class Wdata_fmtr__langtext_row_base implements Wdata_fmtr__langtext_row {
|
||||
// , " </span>"
|
||||
// , " </li>"
|
||||
}
|
||||
class Wdata_fmtr__alias_row implements Wdata_fmtr__langtext_row {
|
||||
class Wdata_fmtr__alias_row extends gplx.core.brys.Bfr_arg_base implements Wdata_fmtr__langtext_row {
|
||||
private Ordered_hash list;
|
||||
public void Init_by_page(Ordered_hash list) {this.list = list;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = list.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Wdata_alias_itm itm = (Wdata_alias_itm)list.Get_at(i);
|
||||
|
||||
@@ -16,9 +16,10 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.apps.apis.xowa.xtns.*;
|
||||
class Wdata_fmtr__oview_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__oview_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private Xoapi_wikibase wikibase_api; private Url_encoder href_encoder;
|
||||
private Wdata_fmtr__oview_alias_itm fmtr_aliases = new Wdata_fmtr__oview_alias_itm();
|
||||
private Bry_fmtr slink_fmtr = Bry_fmtr.new_("<a href='/site/~{domain_bry}/wiki/~{page_href}'>~{page_text}</a>", "domain_bry", "page_href", "page_text");
|
||||
@@ -33,7 +34,7 @@ class Wdata_fmtr__oview_tbl implements Bry_fmtr_arg {
|
||||
public void Init_by_wdoc(Wdata_doc wdoc) {
|
||||
this.wdoc = wdoc;
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
byte[][] core_langs = wikibase_api.Core_langs();
|
||||
byte[] oview_label = Wdata_langtext_itm.Get_text_or_empty(wdoc.Label_list(), core_langs);
|
||||
byte[] oview_descr = Wdata_langtext_itm.Get_text_or_empty(wdoc.Descr_list(), core_langs);
|
||||
@@ -76,10 +77,10 @@ class Wdata_fmtr__oview_tbl implements Bry_fmtr_arg {
|
||||
return Bry_.Ary_empty;
|
||||
}
|
||||
}
|
||||
class Wdata_fmtr__oview_alias_itm implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__oview_alias_itm extends gplx.core.brys.Bfr_arg_base {
|
||||
private byte[][] ary;
|
||||
public void Init_by_itm(byte[][] ary) {this.ary = ary;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (ary == null) return;
|
||||
int len = ary.length;
|
||||
for (int i = 0; i < len; ++i)
|
||||
|
||||
@@ -16,10 +16,11 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.encoders.*; import gplx.langs.htmls.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.xtns.wdatas.core.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.apps.apis.xowa.html.*; import gplx.xowa.wikis.xwikis.*;
|
||||
class Wdata_fmtr__slink_grp implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__slink_grp extends gplx.core.brys.Bfr_arg_base {
|
||||
private final Wdata_fmtr__slink_tbl fmtr_tbl = new Wdata_fmtr__slink_tbl(); private boolean is_empty;
|
||||
public void Init_by_ctor(Wdata_lang_sorter lang_sorter, Xoapi_toggle_mgr toggle_mgr, Wdata_lbl_mgr lbl_regy, Url_encoder href_encoder, Wdata_fmtr__toc_div fmtr_toc, Xow_xwiki_mgr xwiki_mgr) {
|
||||
fmtr_tbl.Init_by_ctor(lang_sorter, toggle_mgr, lbl_regy, href_encoder, fmtr_toc, xwiki_mgr);
|
||||
@@ -29,7 +30,7 @@ class Wdata_fmtr__slink_grp implements Bry_fmtr_arg {
|
||||
this.is_empty = list.Count() == 0; if (is_empty) return;
|
||||
fmtr_tbl.Init_by_wdoc(list);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (is_empty) return;
|
||||
fmtr.Bld_bfr_many(bfr, fmtr_tbl);
|
||||
}
|
||||
@@ -42,7 +43,7 @@ class Wdata_fmtr__slink_grp implements Bry_fmtr_arg {
|
||||
), "grps"
|
||||
);
|
||||
}
|
||||
class Wdata_fmtr__slink_tbl implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__slink_tbl extends gplx.core.brys.Bfr_arg_base {
|
||||
private final Wdata_fmtr__slink_row fmtr_row = new Wdata_fmtr__slink_row();
|
||||
private final Wdata_slink_grp[] grps = new Wdata_slink_grp[Wdata_slink_grp.Idx__len];
|
||||
private Wdata_lang_sorter lang_sorter; private Wdata_hwtr_msgs msgs;
|
||||
@@ -75,7 +76,7 @@ class Wdata_fmtr__slink_tbl implements Bry_fmtr_arg {
|
||||
grp.Rows().Sort_by(lang_sorter);
|
||||
}
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
for (int i = 0; i < Wdata_slink_grp.Idx__len; ++i) {
|
||||
Wdata_slink_grp grp = grps[i];
|
||||
if (grp.Rows().Count() == 0) continue;
|
||||
@@ -98,7 +99,7 @@ class Wdata_fmtr__slink_tbl implements Bry_fmtr_arg {
|
||||
), "hdr_href", "hdr_text", "hdr_lang", "hdr_wiki", "hdr_page", "toggle_btn", "toggle_hdr", "rows"
|
||||
);
|
||||
}
|
||||
class Wdata_fmtr__slink_row implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__slink_row extends gplx.core.brys.Bfr_arg_base {
|
||||
private final Wdata_fmtr__slink_badges fmtr_badges = new Wdata_fmtr__slink_badges(); private Xow_xwiki_mgr xwiki_mgr;
|
||||
private Url_encoder href_encoder; private Ordered_hash list;
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_regy, Url_encoder href_encoder, Xow_xwiki_mgr xwiki_mgr) {
|
||||
@@ -106,7 +107,7 @@ class Wdata_fmtr__slink_row implements Bry_fmtr_arg {
|
||||
fmtr_badges.Init_by_ctor(lbl_regy);
|
||||
}
|
||||
public void Init_by_page(Ordered_hash list) {this.list = list;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = list.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Wdata_sitelink_itm itm = (Wdata_sitelink_itm)list.Get_at(i);
|
||||
@@ -141,11 +142,11 @@ class Wdata_fmtr__slink_row implements Bry_fmtr_arg {
|
||||
), "lang_name", "lang_code", "wmf_key", "href_site", "href_domain", "href_page", "page_name", "badges"
|
||||
);
|
||||
}
|
||||
class Wdata_fmtr__slink_badges implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__slink_badges extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_lbl_mgr lbl_regy; private byte[][] badges;
|
||||
public void Init_by_ctor(Wdata_lbl_mgr lbl_regy) {this.lbl_regy = lbl_regy;}
|
||||
public void Init_by_itm(byte[][] badges) {this.badges = badges;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = badges.length;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
byte[] ttl = badges[i];
|
||||
|
||||
@@ -16,14 +16,15 @@ 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.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
class Wdata_fmtr__toc_div implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__toc_div extends gplx.core.brys.Bfr_arg_base {
|
||||
private final List_adp itms = List_adp_.new_(); private final Wdata_fmtr__toc_itm fmtr_itm = new Wdata_fmtr__toc_itm();
|
||||
private byte[] tbl_hdr;
|
||||
public void Init_by_lang(Wdata_hwtr_msgs msgs) {this.tbl_hdr = msgs.Toc_tbl_hdr();}
|
||||
public void Init_by_wdoc(Wdata_doc wdoc) {itms.Clear();}
|
||||
public void Add(Wdata_toc_data toc_data) {itms.Add(toc_data);}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int itms_len = itms.Count();
|
||||
if (itms_len <= gplx.xowa.htmls.tocs.Xow_hdr_mgr.Toc_min) return;
|
||||
fmtr_itm.Init_by_itm((Wdata_toc_data[])itms.To_ary_and_clear(Wdata_toc_data.class));
|
||||
@@ -40,10 +41,10 @@ class Wdata_fmtr__toc_div implements Bry_fmtr_arg {
|
||||
, " </div>"
|
||||
), "hdr", "itms");
|
||||
}
|
||||
class Wdata_fmtr__toc_itm implements Bry_fmtr_arg {
|
||||
class Wdata_fmtr__toc_itm extends gplx.core.brys.Bfr_arg_base {
|
||||
private Wdata_toc_data[] ary;
|
||||
public void Init_by_itm(Wdata_toc_data[] v) {this.ary = v;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = ary.length;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Wdata_toc_data itm = ary[i];
|
||||
|
||||
@@ -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.xtns.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.apps.apis.xowa.html.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.apps.apis.xowa.xtns.*;
|
||||
public class Wdata_hwtr_mgr {
|
||||
|
||||
@@ -316,7 +316,7 @@ class Wdata_hwtr_mgr_fxt {
|
||||
Wdata_fmtr__json fmtr_json = doc_hwtr.Fmtr_json();
|
||||
fmtr_json.Init_by_wdoc(wdoc.Jdoc());
|
||||
Bry_bfr tmp_bfr = Bry_bfr.new_();
|
||||
fmtr_json.Fmt__do(tmp_bfr);
|
||||
fmtr_json.Bfr_arg__add(tmp_bfr);
|
||||
Tfds.Eq_str_lines(expd, tmp_bfr.To_str_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.xtns.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.msgs.*;
|
||||
import gplx.xowa.wikis.domains.*;
|
||||
public class Wdata_hwtr_msgs {
|
||||
|
||||
@@ -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.xtns.wdatas.hwtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.xtns.wdatas.core.*;
|
||||
class Wdata_visitor__html_wtr implements Wdata_claim_visitor {
|
||||
private byte[] ttl; private Bry_bfr tmp_bfr; private Wdata_hwtr_msgs msgs; private Wdata_lbl_mgr lbl_mgr;
|
||||
|
||||
@@ -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.wdatas.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
|
||||
import gplx.core.net.*;
|
||||
import gplx.core.net.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.specials.*;
|
||||
import gplx.xowa.apps.urls.*;
|
||||
public class Wdata_itemByTitle_page implements Xows_page {
|
||||
|
||||
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.xtns.xowa_cmds; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import org.junit.*;
|
||||
import gplx.xowa.apps.gfs.*;
|
||||
import gplx.langs.gfs.*;
|
||||
public class Xop_xowa_cmd_tst {
|
||||
@Before public void init() {
|
||||
Xoa_gfs_mgr.Msg_parser_init();
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.xowa_cmds; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import org.junit.*;
|
||||
import gplx.xowa.apps.gfs.*;
|
||||
import gplx.xowa.apps.gfs.*; import gplx.langs.gfs.*;
|
||||
public class Xop_xowa_func_tst {
|
||||
@Before public void init() {
|
||||
Xoa_gfs_mgr.Msg_parser_init();
|
||||
|
||||
Reference in New Issue
Block a user