1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

v2.11.4.1

This commit is contained in:
gnosygnu
2015-11-22 21:39:33 -05:00
parent 8a5d58a973
commit 097e6c7f80
581 changed files with 2897 additions and 2097 deletions

View File

@@ -20,7 +20,7 @@ package gplx.xowa.xtns.dynamicPageList; import gplx.*; import gplx.xowa.*; impor
// public byte[] Ttl_bry() {return ttl_bry;} public Dpl_page Ttl_bry_(byte[] v) {ttl_bry = v; return this;} private byte[] ttl_bry;
// }
import gplx.xowa.wikis.data.tbls.*;
class Dpl_page_sorter implements gplx.lists.ComparerAble {
class Dpl_page_sorter implements gplx.core.lists.ComparerAble {
public Dpl_page_sorter(Dpl_itm itm) {this.itm = itm;} private Dpl_itm itm;
public int compare(Object lhsObj, Object rhsObj) {
Xowd_page_itm lhs = (Xowd_page_itm)lhsObj;

View File

@@ -119,7 +119,7 @@ class Dpl_page_finder {
int itms_len = ctg_mgr.Total();
for (int i = 0; i < itms_len; i++) {
Xoctg_view_itm ctg_itm = ctg_mgr.Itms()[i];
int ctg_itm_id = ctg_itm.Id();
int ctg_itm_id = ctg_itm.Page_id();
if (list.Has(tmp_id.Val_(ctg_itm_id))) continue;
list.Add(Int_obj_ref.new_(ctg_itm_id), ctg_itm);
// if (ctg_tid == Xoa_ctg_mgr.Tid_subc) { // recurse subcategories
@@ -148,12 +148,12 @@ class Dpl_page_finder {
for (int j = 0; j < found_len; j++) { // if new_page is in cur, add it
Xoctg_view_itm cur_itm = (Xoctg_view_itm)cur_regy.Get_at(j);
if (ns_filter != Dpl_itm.Ns_filter_null && ns_filter != cur_itm.Ttl().Ns().Id()) continue;
tmp_id.Val_(cur_itm.Id()); // set tmp_id, since it will be used at least once
tmp_id.Val_(cur_itm.Page_id()); // set tmp_id, since it will be used at least once
if (exclude_pages.Has(tmp_id)) continue; // ignore excluded pages
if (i != 0) { // skip logic for first ctg (which doesn't have a predecessor)
if (!old_regy.Has(tmp_id)) continue; // cur_itm not in old_regy; ignore
}
new_regy.Add_as_key_and_val(Int_obj_ref.new_(cur_itm.Id()));
new_regy.Add_as_key_and_val(Int_obj_ref.new_(cur_itm.Page_id()));
}
}
}

View File

@@ -30,15 +30,15 @@ class Gallery_box_w_fmtr_arg__basic extends gplx.core.brys.Bfr_arg_base implemen
}
private static final byte[] Style_bgn = Bry_.new_a7("style=\"width: "), Style_end = Bry_.new_a7("px\"");
}
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;}
@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();
}
}
// class Gallery_box_w_fmtr_arg__hdump : gplx.core.brys.Bfr_arg_base, 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 override 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 gplx.core.brys.Bfr_arg {
Gallery_img_pad_fmtr_arg Init(int uid, int vpad);
}
@@ -52,12 +52,12 @@ class Gallery_img_pad_fmtr_arg__basic extends gplx.core.brys.Bfr_arg_base implem
}
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 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;}
@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();
}
}
// class Gallery_img_pad_fmtr_arg__hdump : gplx.core.brys.Bfr_arg_base, 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 override 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();
// }
// }

View File

@@ -172,7 +172,7 @@ public class Gallery_itm_parser {
case Fld_ttl:
cur_itm.Ttl_end_(fld_end);
byte[] ttl_bry = Bry_.Mid(src, cur_itm.Ttl_bgn(), fld_end);
ttl_bry = Xoa_app_.Utl__encoder_mgr().Http_url_ttl().Decode(ttl_bry); // NOTE: must decode url-encoded entries; EX: "A%28b%29.png" -> "A(b).png"; DATE:2014-01-01
ttl_bry = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url_ttl.Decode(ttl_bry); // NOTE: must decode url-encoded entries; EX: "A%28b%29.png" -> "A(b).png"; DATE:2014-01-01
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry);
if ( ttl == null // invalid ttl; EX: "<invalid>"
|| ttl.Anch_bgn() == 1 // anchor-only ttl; EX: "#invalid"; DATE:2014-03-18

View File

@@ -20,8 +20,8 @@ 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 {
private Gallery_box_w_fmtr_arg__basic box_w_fmtr__basic = new Gallery_box_w_fmtr_arg__basic(); private Gallery_box_w_fmtr_arg__hdump box_w_fmtr__hdump = new Gallery_box_w_fmtr_arg__hdump();
private Gallery_img_pad_fmtr_arg__basic img_pad_fmtr__basic = new Gallery_img_pad_fmtr_arg__basic(); private Gallery_img_pad_fmtr_arg__hdump img_pad_fmtr__hdump = new Gallery_img_pad_fmtr_arg__hdump();
private Gallery_box_w_fmtr_arg__basic box_w_fmtr__basic = new Gallery_box_w_fmtr_arg__basic(); // private Gallery_box_w_fmtr_arg__hdump box_w_fmtr__hdump = new Gallery_box_w_fmtr_arg__hdump();
private Gallery_img_pad_fmtr_arg__basic img_pad_fmtr__basic = new Gallery_img_pad_fmtr_arg__basic(); // private Gallery_img_pad_fmtr_arg__hdump img_pad_fmtr__hdump = new Gallery_img_pad_fmtr_arg__hdump();
public abstract byte Tid();
public abstract byte[] Tid_bry();
@gplx.Virtual public boolean Tid_is_packed() {return false;}
@@ -129,7 +129,8 @@ public abstract class Gallery_mgr_base {
xfer_itm.Init_at_gallery_bgn(html_w_normal, html_h_normal, html_w_expand);// NOTE: file_w should be set to expanded width so js can resize if gallery
img_div_w = this.Get_thumb_div_width(html_w_expand);
itm_div0_fmtr.Bld_bfr_many(tmp_bfr, img_div_w);
Gallery_img_pad_fmtr_arg vpad_fmtr = hctx_is_hdump ? (Gallery_img_pad_fmtr_arg)img_pad_fmtr__hdump : (Gallery_img_pad_fmtr_arg)img_pad_fmtr__basic;
// Gallery_img_pad_fmtr_arg vpad_fmtr = hctx_is_hdump ? (Gallery_img_pad_fmtr_arg)img_pad_fmtr__hdump : (Gallery_img_pad_fmtr_arg)img_pad_fmtr__basic;
Gallery_img_pad_fmtr_arg vpad_fmtr = img_pad_fmtr__basic;
vpad = this.Get_vpad(itm_default_h, html_h_expand);
itm_div1_fmtr.Bld_bfr_many(tmp_bfr, vpad_fmtr.Init(img_uid, vpad)); // <div style="margin:~{vpad}px auto;">
wiki.Html_mgr().Html_wtr().Lnki_wtr().Write_file(tmp_bfr, ctx, hctx, src, lnki, xfer_itm, alt);
@@ -145,10 +146,11 @@ public abstract class Gallery_mgr_base {
); // MW:passes know,noclasses which isn't relevant to XO
}
int itm_div_width = this.Get_gb_width(html_w_expand, html_h_expand);
Gallery_box_w_fmtr_arg box_w_fmtr_arg = hctx_is_hdump ? (Gallery_box_w_fmtr_arg)box_w_fmtr__hdump : (Gallery_box_w_fmtr_arg)box_w_fmtr__basic;
// Gallery_box_w_fmtr_arg box_w_fmtr_arg = hctx_is_hdump ? (Gallery_box_w_fmtr_arg)box_w_fmtr__hdump : (Gallery_box_w_fmtr_arg)box_w_fmtr__basic;
Gallery_box_w_fmtr_arg box_w_fmtr_arg = box_w_fmtr__basic;
itm_li_bgn_fmtr.Bld_bfr_many(bfr, gallery_li_id, box_w_fmtr_arg.Init(img_uid, itm_div_width));
bfr.Add(itm_html);
wiki.Parser_mgr().Main().Parse_text_to_html(tmp_bfr, page, true, itm_caption);
wiki.Parser_mgr().Main().Parse_text_to_html(tmp_bfr, page, hctx, true, itm_caption);
itm_caption = tmp_bfr.To_bry_and_clear();
itm_caption = tmp_bfr.Add(show_filenames_link).Add(itm_caption).To_bry_and_clear();
Wrap_gallery_text(bfr, itm_caption, html_w_expand, html_h_expand);
@@ -180,7 +182,7 @@ public abstract class Gallery_mgr_base {
private static final byte[]
itm_li_end_bry = Bry_.new_a7 ( "\n </div>"
+ "\n </li>")
+ "\n </li>")
, box_html_end_bry = Bry_.new_a7 ( "\n</ul>")
, itm_divs_end_bry = Bry_.new_a7 ( "\n </div>\n </div>")
;
@@ -196,13 +198,13 @@ public abstract class Gallery_mgr_base {
bfr.Add_byte(Byte_ascii.Lt).Add(Html_tag_.Bry__ul);
Html_wtr.Write_atr_bry(bfr, Html_atr_.Bry__id, gallery_ul_uid);
Html_wtr.Write_atr_bry(bfr, Html_atr_.Bry__class, cls);
if (hctx_is_hdump) {
bfr.Add_byte_space();
bfr.Add(Xoh_make_trie_.Bry__gallery_box_max);
bfr.Add_int_variable(uid);
bfr.Add_byte_apos();
}
else
// if (hctx_is_hdump) {
// bfr.Add_byte_space();
// bfr.Add(Xoh_make_trie_.Bry__gallery_box_max);
// bfr.Add_int_variable(uid);
// bfr.Add_byte_apos();
// }
// else
Html_wtr.Write_atr_bry(bfr, Html_atr_.Bry__style, style);
if (xatr_list != null) {
int len = xatr_list.Count();

View File

@@ -46,7 +46,7 @@ public class Insider_html_bldr extends gplx.core.brys.Bfr_arg_base {
}
@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();
Gfo_url_encoder href_encoder = gplx.langs.htmls.encoders.Gfo_url_encoder_.Href;
for (int i = 0; i < list_len; ++i) {
byte[] itm = (byte[])list.Get_at(i);
Xoa_ttl user_ttl = Xoa_ttl.parse(wiki, Xow_ns_.Tid__user, itm);

View File

@@ -16,12 +16,12 @@ 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.*;
import gplx.core.brys.fmtrs.*; import gplx.core.strings.*; import gplx.core.consoles.*; import gplx.core.envs.*;
import gplx.xowa.apps.progs.*;
public class Xof_math_mgr implements GfoInvkAble {
private Xoae_app app;
public ProcessAdp Cmd_convert_tex_to_dvi() {return cmd_convert_tex_to_dvi;} private ProcessAdp cmd_convert_tex_to_dvi = new ProcessAdp();
public ProcessAdp Cmd_convert_dvi_to_png() {return cmd_convert_dvi_to_png;} private ProcessAdp cmd_convert_dvi_to_png = new ProcessAdp();
public Process_adp Cmd_convert_tex_to_dvi() {return cmd_convert_tex_to_dvi;} private Process_adp cmd_convert_tex_to_dvi = new Process_adp();
public Process_adp Cmd_convert_dvi_to_png() {return cmd_convert_dvi_to_png;} private Process_adp cmd_convert_dvi_to_png = new Process_adp();
public void Init_by_app(Xoae_app app) {
this.app = app;
Xoa_prog_mgr app_mgr = app.Prog_mgr();

View File

@@ -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.ifs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
import gplx.core.envs.*;
import gplx.xowa.bldrs.wms.apis.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.wikis.nss.*;
public class Pfunc_ifexist_mgr {

View File

@@ -24,7 +24,7 @@ public class Pfunc_urldecode extends Pf_func_base {
@Override public boolean Func_require_colon_arg() {return true;}
@Override public void Func_evaluate(Xop_ctx ctx, byte[] src, Xot_invk caller, Xot_invk self, Bry_bfr bfr) {
byte[] encoded = Eval_argx(ctx, src, caller, self);
byte[] decoded = Xoa_app_.Utl__encoder_mgr().Http_url().Decode(encoded);
byte[] decoded = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Decode(encoded);
bfr.Add(decoded);
}
}

View File

@@ -118,7 +118,7 @@ class Pxd_itm_int_mhs_6 extends Pxd_itm_base implements Pxd_itm_int_interface {
bldr.Seg_set(DateAdp_.SegIdx_second , Bry_.To_int_or(src, 4, 6, 0));
}
}
class Pxd_itm_sorter implements gplx.lists.ComparerAble {
class Pxd_itm_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Pxd_itm lhs = (Pxd_itm)lhsObj;
Pxd_itm rhs = (Pxd_itm)rhsObj;

View File

@@ -47,10 +47,9 @@ public class Pfunc_anchorencode extends Pf_func_base { // EX: {{anchorencode:a b
Tkn(src, sub, root, i, tmp_bfr);
}
byte[] unencoded = tmp_bfr.To_bry_and_clear();
encoder.Encode(tmp_bfr, unencoded);
Gfo_url_encoder_.Id.Encode(tmp_bfr, unencoded);
bfr.Add_bfr_and_clear(tmp_bfr);
}
private static Url_encoder encoder = Url_encoder.new_html_id_();
private static void Tkn(byte[] src, Xop_tkn_itm sub, Xop_tkn_grp grp, int sub_idx, Bry_bfr tmp_bfr) {
switch (sub.Tkn_tid()) {
case Xop_tkn_itm_.Tid_lnke: Lnke(src, (Xop_lnke_tkn)sub, tmp_bfr); break; // FUTURE: need to move number to lnke_tkn so that number will be correct/consistent?

View File

@@ -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.ttls; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
import gplx.core.envs.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*;

View File

@@ -22,7 +22,7 @@ public class Pfunc_urlencode extends Pf_func_base { // EX: {{urlencode:a b}} ->
@Override public boolean Func_require_colon_arg() {return true;}
@Override public void Func_evaluate(Xop_ctx ctx, byte[] src, Xot_invk caller, Xot_invk self, Bry_bfr bb) {
byte[] val_ary = Eval_argx(ctx, src, caller, self); if (val_ary == Bry_.Empty) return;
Xoa_app_.Utl__encoder_mgr().Http_url().Encode(urlEncodeBfr, val_ary);
gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Encode(urlEncodeBfr, val_ary);
bb.Add_bfr_and_preserve(urlEncodeBfr);
urlEncodeBfr.Clear();
} private Bry_bfr urlEncodeBfr = Bry_bfr.new_(128);

View File

@@ -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.poems; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.*;
import gplx.core.brys.*; import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
public class Poem_nde implements Xox_xnde {
private Xop_root_tkn xtn_root;

View File

@@ -55,7 +55,7 @@ public class Sites_html_bldr extends gplx.core.brys.Bfr_arg_base {
}
}
private static byte[] Xto_href(Bry_bfr tmp_bfr, Bry_fmtr url_fmtr, Xoh_href_parser href_parser, Xowe_wiki wiki, Xow_xwiki_itm xwiki_itm, byte[] ttl_page_db) {
Xoa_app_.Utl__encoder_mgr().Href().Encode(tmp_bfr, ttl_page_db);
gplx.langs.htmls.encoders.Gfo_url_encoder_.Href.Encode(tmp_bfr, ttl_page_db);
byte[] rv = url_fmtr.Fmt_(xwiki_itm.Url_fmt()).Bld_bry_many(tmp_bfr, tmp_bfr.To_bry_and_clear());
if (xwiki_itm.Domain_tid() != Xow_domain_tid_.Int__other)
rv = Bry_.Add(Xoh_href_.Bry__site, rv);

View File

@@ -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.scores; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.core.primitives.*;
import gplx.core.primitives.*; import gplx.core.envs.*;
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.files.*;
import gplx.xowa.guis.views.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.logs.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*; import gplx.xowa.parsers.lnkis.*;
@@ -60,7 +60,7 @@ public class Score_xnde implements Xox_xnde, Mwh_atr_itm_owner, Xoh_cmd_itm {
Xowe_wiki wiki = ctx.Wiki(); Xoae_page page = ctx.Cur_page();
Score_xtn_mgr score_xtn = (Score_xtn_mgr)wiki.Xtn_mgr().Get_or_fail(Score_xtn_mgr.XTN_KEY);
if (!score_xtn.Enabled()) {Html_write_code_as_pre(bfr, app); return;}
ProcessAdp ly_process = app.Prog_mgr().App_lilypond();
Process_adp ly_process = app.Prog_mgr().App_lilypond();
if (ly_process.Exe_exists() == Bool_.__byte && ly_process.Exe_url() != null) { // TEST: ly_process.Exe_url() is null
boolean exists = Io_mgr.Instance.ExistsFil(ly_process.Exe_url());
ly_process.Exe_exists_(exists ? Bool_.Y_byte : Bool_.N_byte);
@@ -115,12 +115,12 @@ public class Score_xnde implements Xox_xnde, Mwh_atr_itm_owner, Xoh_cmd_itm {
Score_xtn_mgr score_xtn = (Score_xtn_mgr)wiki.Xtn_mgr().Get_or_fail(Score_xtn_mgr.XTN_KEY);
Io_url ly_file = output_dir.GenSubFil(sha1_prefix + ".ly");
byte[] ly_text = null;
ProcessAdp ly_process = app.Prog_mgr().App_lilypond();
Process_adp ly_process = app.Prog_mgr().App_lilypond();
if (Score_xtn_mgr.Lilypond_version == null) Score_xtn_mgr.Lilypond_version = Get_lilypond_version(ly_process);
if (lang_is_abc) {
Io_url abc_file = output_dir.GenSubFil(sha1_prefix + ".abc");
Io_mgr.Instance.SaveFilBry(abc_file, code);
ProcessAdp abc2ly_process = app.Prog_mgr().App_abc2ly();
Process_adp abc2ly_process = app.Prog_mgr().App_abc2ly();
if (!abc2ly_process.Run(abc_file, ly_file).Exit_code_pass()) {
fail_msg = abc2ly_process.Rslt_out();
app.Usr_dlg().Warn_many("", "", "abc2ly failed: ~{0}", fail_msg);
@@ -143,7 +143,7 @@ public class Score_xnde implements Xox_xnde, Mwh_atr_itm_owner, Xoh_cmd_itm {
return;
}
if (output_ogg) {
ProcessAdp timidity_process = app.Prog_mgr().App_convert_midi_to_ogg();
Process_adp timidity_process = app.Prog_mgr().App_convert_midi_to_ogg();
Io_url ogg_file = ly_file.GenNewExt(".ogg");
if (!timidity_process.Run(ly_file.GenNewExt(".midi"), ogg_file).Exit_code_pass()) { // NOTE: do not exit; timidity currently not working for windows
fail_msg = timidity_process.Rslt_out();
@@ -170,9 +170,9 @@ public class Score_xnde implements Xox_xnde, Mwh_atr_itm_owner, Xoh_cmd_itm {
html_itm.Html_atr_set(html_id_pre, "textContent", fail_msg);
}
}
byte[] Get_lilypond_version(ProcessAdp lilypond_process) {
byte[] Get_lilypond_version(Process_adp lilypond_process) {
try {
ProcessAdp lilypond_version_proc = new ProcessAdp().Exe_url_(lilypond_process.Exe_url()).Args_str_("--version").Prog_dlg_(lilypond_process.Prog_dlg()).Run_mode_(ProcessAdp.Run_mode_sync_block);
Process_adp lilypond_version_proc = new Process_adp().Exe_url_(lilypond_process.Exe_url()).Args_str_("--version").Prog_dlg_(lilypond_process.Prog_dlg()).Run_mode_(Process_adp.Run_mode_sync_block);
lilypond_version_proc.Run();
return Get_lilypond_version(lilypond_version_proc.Rslt_out());
}

View File

@@ -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.envs.*;
import gplx.xowa.langs.*;
import gplx.xowa.xtns.scribunto.libs.*; import gplx.xowa.xtns.scribunto.engines.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;

View File

@@ -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.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.core.brys.fmtrs.*;
import gplx.core.brys.fmtrs.*; import gplx.core.envs.*;
import gplx.langs.htmls.*;
import gplx.xowa.langs.kwds.*; import gplx.xowa.langs.msgs.*;
import gplx.xowa.wikis.nss.*;

View File

@@ -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.engines.luaj; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*; import gplx.xowa.xtns.scribunto.engines.*;
import gplx.core.envs.*;
import org.luaj.vm2.*; import org.luaj.vm2.lib.*; import org.luaj.vm2.lib.jse.*;
import gplx.xowa.xtns.scribunto.engines.process.*;
public class Luaj_server implements Scrib_server {

View File

@@ -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.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
import gplx.core.primitives.*;
import gplx.core.primitives.*; import gplx.core.envs.*; import gplx.core.errs.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.funcs.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
public class Scrib_lib_mw implements Scrib_lib {
@@ -377,7 +377,7 @@ public class Scrib_lib_mw implements Scrib_lib {
return rslt.Init_ary_empty();
}
}
class Scrib_lib_mw_callParserFunction_sorter implements gplx.lists.ComparerAble {
class Scrib_lib_mw_callParserFunction_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
KeyVal lhs = (KeyVal)lhsObj;
KeyVal rhs = (KeyVal)rhsObj;

View File

@@ -30,7 +30,7 @@ public class Scrib_lib_mw__invoke_tst {
@Test public void GetAllExpandedArguments_ws_prm_key_missing() { // PURPOSE: do not trim val if key missing; parameterized value ("{{{1}}}")
fxt.Init_tmpl("{{#invoke:Mod_0|Prc_0|{{{1}}}}}");
fxt.Init_page("{{test| a }}");
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getAllExpandedArguments, Object_.Ary("current"), "\n a"); // " a " -> " a" // tmpl.trim_end: always trim end; DATE:2015-11-07
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getAllExpandedArguments, Object_.Ary("current"), "\n a "); // " a " -> " a "
}
@Test public void GetAllExpandedArguments__ignore_empty_key() {// PURPOSE: ignore arguents that have an empty key (|=8|); EX:w:Fool's_mate; DATE:2014-03-05
fxt.Init_tmpl("{{#invoke:Mod_0|Prc_0}}");
@@ -45,7 +45,7 @@ public class Scrib_lib_mw__invoke_tst {
}
@Test public void GetExpandedArgument_ws_key_missing() { // PURPOSE: do not trim val if key missing; literal value
fxt.Init_page("{{#invoke:Mod_0|Prc_0| a }}");
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getExpandedArgument, Object_.Ary("current", "1") , " a"); // " a " -> " a" // tmpl.trim_end: always trim end; DATE:2015-11-07
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getExpandedArgument, Object_.Ary("current", "1") , " a "); // " a " -> " a "
}
@Test public void GetExpandedArgument_ws_key_prm_key_exists() { // PURPOSE: trim val if key exists; parameterized value ("key={{{1}}}")
fxt.Init_tmpl("{{#invoke:Mod_0|Prc_0|key1={{{1}}}}}");
@@ -55,7 +55,7 @@ public class Scrib_lib_mw__invoke_tst {
@Test public void GetExpandedArgument_ws_key_prm_key_missing() { // PURPOSE: do not trim val if key missing; parameterized value ("{{{1}}}")
fxt.Init_tmpl("{{#invoke:Mod_0|Prc_0|{{{1}}}}}");
fxt.Init_page("{{test| a }}");
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getExpandedArgument, Object_.Ary("current", "1") , " a"); // " a " -> " a" // tmpl.trim_end: always trim end; DATE:2015-11-07
fxt.Test_lib_proc(lib, Scrib_lib_mw.Invk_getExpandedArgument, Object_.Ary("current", "1") , " a "); // " a " -> " a "
}
@Test public void Preprocess() {
this.Init_preprocess();

View File

@@ -188,7 +188,7 @@ class Scrib_lib_text__json_util {
Opt__force_assoc = 1
;
}
class KeyVal__sorter__key_is_numeric implements gplx.lists.ComparerAble {
class KeyVal__sorter__key_is_numeric implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
KeyVal lhs_itm = (KeyVal)lhsObj;
KeyVal rhs_itm = (KeyVal)rhsObj;

View File

@@ -181,7 +181,7 @@ public class Wdata_wiki_mgr implements GfoEvObj, GfoInvkAble {
Xoapi_toggle_mgr toggle_mgr = app.Api_root().Html().Page().Toggle_mgr();
Xoapi_wikibase wikibase_api = app.Api_root().Xtns().Wikibase();
hwtr_mgr = new Wdata_hwtr_mgr();
hwtr_mgr.Init_by_ctor(wikibase_api, new Wdata_lbl_wkr_wiki(wikibase_api, this), Xoa_app_.Utl__encoder_mgr().Href(), toggle_mgr, app.Usere().Wiki().Xwiki_mgr());
hwtr_mgr.Init_by_ctor(wikibase_api, new Wdata_lbl_wkr_wiki(wikibase_api, this), gplx.langs.htmls.encoders.Gfo_url_encoder_.Href, toggle_mgr, app.Usere().Wiki().Xwiki_mgr());
this.Hwtr_msgs_make();
GfoEvMgr_.SubSame_many(app.Usere(), this, Xoue_user.Evt_lang_changed);
}

View File

@@ -72,7 +72,7 @@ public class Wdata_xwiki_link_wtr extends gplx.core.brys.Bfr_arg_base {
}
public static final byte[] Qid_null = Bry_.Empty; // NOTE: return Empty, not null else Bry_fmtr will fail
}
class Xoa_ttl_sorter implements gplx.lists.ComparerAble {
class Xoa_ttl_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Xoa_ttl lhs = (Xoa_ttl)lhsObj, rhs = (Xoa_ttl)rhsObj;
return Bry_.Compare(lhs.Raw(), rhs.Raw());

View File

@@ -17,7 +17,7 @@ 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.xowa.apps.apis.xowa.xtns.*;
public class Wdata_lang_sorter implements GfoEvObj, gplx.lists.ComparerAble {
public class Wdata_lang_sorter implements GfoEvObj, gplx.core.lists.ComparerAble {
private Hash_adp_bry hash = Hash_adp_bry.cs();
public Wdata_lang_sorter() {evMgr = GfoEvMgr.new_(this);}
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;

View File

@@ -20,13 +20,13 @@ 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 extends gplx.core.brys.Bfr_arg_base {
private Xoapi_wikibase wikibase_api; private Url_encoder href_encoder;
private Xoapi_wikibase wikibase_api; private Gfo_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");
private Bry_bfr tmp_bfr = Bry_bfr.new_(255);
private Wdata_doc wdoc;
private byte[] hdr_alias_y, hdr_alias_n;
public void Init_by_ctor(Xoapi_wikibase wikibase_api, Url_encoder href_encoder) {this.wikibase_api = wikibase_api; this.href_encoder = href_encoder;}
public void Init_by_ctor(Xoapi_wikibase wikibase_api, Gfo_url_encoder href_encoder) {this.wikibase_api = wikibase_api; this.href_encoder = href_encoder;}
public void Init_by_lang(byte[] lang_0, Wdata_hwtr_msgs msgs) {
this.hdr_alias_y = msgs.Oview_alias_y();
this.hdr_alias_n = msgs.Oview_alias_n();

View File

@@ -22,7 +22,7 @@ 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 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) {
public void Init_by_ctor(Wdata_lang_sorter lang_sorter, Xoapi_toggle_mgr toggle_mgr, Wdata_lbl_mgr lbl_regy, Gfo_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);
}
public void Init_by_lang(Wdata_hwtr_msgs msgs) {fmtr_tbl.Init_by_lang(msgs);}
@@ -47,7 +47,7 @@ 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;
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) {
public void Init_by_ctor(Wdata_lang_sorter lang_sorter, Xoapi_toggle_mgr toggle_mgr, Wdata_lbl_mgr lbl_regy, Gfo_url_encoder href_encoder, Wdata_fmtr__toc_div fmtr_toc, Xow_xwiki_mgr xwiki_mgr) {
this.lang_sorter = lang_sorter;
fmtr_row.Init_by_ctor(lbl_regy, href_encoder, xwiki_mgr);
for (int i = 0; i < Wdata_slink_grp.Idx__len; ++i) {
@@ -101,8 +101,8 @@ class Wdata_fmtr__slink_tbl extends gplx.core.brys.Bfr_arg_base {
}
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) {
private Gfo_url_encoder href_encoder; private Ordered_hash list;
public void Init_by_ctor(Wdata_lbl_mgr lbl_regy, Gfo_url_encoder href_encoder, Xow_xwiki_mgr xwiki_mgr) {
this.href_encoder = href_encoder; this.xwiki_mgr = xwiki_mgr;
fmtr_badges.Init_by_ctor(lbl_regy);
}

View File

@@ -62,10 +62,10 @@ class Wdata_fmtr__toc_itm extends gplx.core.brys.Bfr_arg_base {
}
class Wdata_toc_data {
private final Wdata_fmtr__toc_div fmtr_toc;
private final Url_encoder href_encoder;
private final Gfo_url_encoder href_encoder;
private final Bry_fmtr text_fmtr = Bry_fmtr.new_("~{orig} <sup><small>(~{len})</small></sup>", "orig", "len");
private final Bry_bfr tmp_bfr = Bry_bfr.new_(8);
public Wdata_toc_data(Wdata_fmtr__toc_div fmtr_toc, Url_encoder href_encoder) {this.fmtr_toc = fmtr_toc; this.href_encoder = href_encoder;}
public Wdata_toc_data(Wdata_fmtr__toc_div fmtr_toc, Gfo_url_encoder href_encoder) {this.fmtr_toc = fmtr_toc; this.href_encoder = href_encoder;}
public Wdata_toc_data Make(int itms_len) {
this.text = itms_len_enable ? text_fmtr.Bld_bry_many(tmp_bfr, orig, itms_len) : orig;
this.href = href_encoder.Encode(orig);

View File

@@ -33,7 +33,7 @@ public class Wdata_hwtr_mgr {
public Bry_fmtr Fmtr_main() {return fmtr_main;} private final Bry_fmtr fmtr_main = Bry_fmtr.new_("~{oview}~{toc}~{claims}~{links}~{labels}~{descriptions}~{aliases}~{json}", "oview", "toc", "claims", "links", "labels", "descriptions", "aliases", "json");
public Wdata_hwtr_msgs Msgs() {return msgs;} private Wdata_hwtr_msgs msgs;
@gplx.Internal protected Wdata_lbl_mgr Lbl_mgr() {return lbl_mgr;} private final Wdata_lbl_mgr lbl_mgr = new Wdata_lbl_mgr();
public void Init_by_ctor(Xoapi_wikibase wikibase_api, Wdata_lbl_wkr lbl_wkr, Url_encoder href_encoder, Xoapi_toggle_mgr toggle_mgr, Xow_xwiki_mgr xwiki_mgr) {
public void Init_by_ctor(Xoapi_wikibase wikibase_api, Wdata_lbl_wkr lbl_wkr, Gfo_url_encoder href_encoder, Xoapi_toggle_mgr toggle_mgr, Xow_xwiki_mgr xwiki_mgr) {
lbl_mgr.Wkr_(lbl_wkr);
fmtr_oview.Init_by_ctor(wikibase_api, href_encoder);
fmtr_claim.Init_by_ctor(new Wdata_toc_data(fmtr_toc, href_encoder), toggle_mgr, lbl_mgr);

View File

@@ -290,7 +290,7 @@ class Wdata_hwtr_mgr_fxt {
Xoapi_toggle_mgr toggle_mgr = new Xoapi_toggle_mgr();
wdata_fxt.Init();
toggle_mgr.Ctor_by_app(wdata_fxt.App()); // must init, else null error
doc_hwtr.Init_by_ctor(new Xoapi_wikibase(), new Wdata_lbl_wkr__test(resolved_ttls), Url_encoder.new_html_href_mw_(), toggle_mgr, new Xow_xwiki_mgr(wdata_fxt.Wiki()));
doc_hwtr.Init_by_ctor(new Xoapi_wikibase(), new Wdata_lbl_wkr__test(resolved_ttls), Gfo_url_encoder_.Href, toggle_mgr, new Xow_xwiki_mgr(wdata_fxt.Wiki()));
doc_hwtr.Init_by_lang(msgs);
}
resolved_ttls.Clear();

View File

@@ -16,8 +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.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
import gplx.core.ios.*;
import gplx.core.criterias.*;
import gplx.core.ios.*; import gplx.core.criterias.*; import gplx.core.envs.*;
class Io_stream_rdr_mgr {
public static Io_stream_rdr Get_rdr_or_null(Io_url src_fil, Io_url src_dir, Io_stream_unzip_mgr unzip_mgr, String... filter_ary) {
IoItmFil src_itm = null;
@@ -60,8 +59,8 @@ class Io_stream_rdr_mgr {
}
class Io_stream_unzip_mgr {
private final String[] zip_exts;
private final boolean stdout_enabled; private final ProcessAdp stdout_process;
public Io_stream_unzip_mgr(boolean stdout_enabled, ProcessAdp stdout_process, String[] zip_exts) {
private final boolean stdout_enabled; private final Process_adp stdout_process;
public Io_stream_unzip_mgr(boolean stdout_enabled, Process_adp stdout_process, String[] zip_exts) {
this.stdout_enabled = stdout_enabled; this.stdout_process = stdout_process; this.zip_exts = zip_exts;
}
public boolean Handles(Io_url url) {return String_.In(url.Ext(), zip_exts);}

View File

@@ -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.pfuncs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
import gplx.core.envs.*;
import gplx.langs.jsons.*; import gplx.core.primitives.*;
import gplx.xowa.parsers.logs.*; import gplx.xowa.xtns.pfuncs.*; import gplx.xowa.xtns.wdatas.core.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;

View File

@@ -56,7 +56,7 @@ public class Wdata_itemByTitle_page implements Xows_page {
page.Html_data().Html_restricted_n_(); // [[Special:]] pages allow all HTML
}
private static boolean Navigate(Gfo_usr_dlg usr_dlg, Xoae_app app, Wdata_wiki_mgr wdata_mgr, Xoae_page page, byte[] site_bry, byte[] page_bry) {
page_bry = Xoa_app_.Utl__encoder_mgr().Http_url().Decode(page_bry); // NOTE: space is converted to + on postback to url; decode
page_bry = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Decode(page_bry); // NOTE: space is converted to + on postback to url; decode
byte[] wiki_domain = Xow_abrv_wm_.Parse_to_domain_bry(site_bry); if (wiki_domain == null) {usr_dlg.Warn_many("", "", "site_bry parse failed; site_bry:~{0}", String_.new_u8(site_bry)); return false;}
Xowe_wiki wiki = app.Wiki_mgr().Get_by_key_or_make(wiki_domain); if (wiki == null) {usr_dlg.Warn_many("", "", "wiki_domain does not exist; wiki_domain:~{0}", String_.new_u8(wiki_domain)); return false;}
Xoa_ttl wdata_ttl = Xoa_ttl.parse(wiki, page_bry); if (wdata_ttl == null) {usr_dlg.Warn_many("", "", "ttl is invalid; ttl:~{0}", String_.new_u8(page_bry)); return false;}