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

v2.10.3.1

This commit is contained in:
gnosygnu
2015-10-18 22:17:57 -04:00
parent 8e18af05b6
commit 4f43f51b18
1935 changed files with 12500 additions and 12889 deletions

View File

@@ -16,14 +16,14 @@ 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.langs.htmls.*; import gplx.xowa.html.hdumps.abrvs.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.hdumps.abrvs.*;
public interface Gallery_box_w_fmtr_arg extends Bry_fmtr_arg {
Gallery_box_w_fmtr_arg Init(int uid, int width);
}
class Gallery_box_w_fmtr_arg__basic 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 XferAry(Bry_bfr bfr, int idx) {
public void Fmt__do(Bry_bfr bfr) {
bfr.Add(Style_bgn);
bfr.Add_int_variable(width);
bfr.Add(Style_end);
@@ -33,7 +33,7 @@ class Gallery_box_w_fmtr_arg__basic implements Gallery_box_w_fmtr_arg {
class Gallery_box_w_fmtr_arg__hdump 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 XferAry(Bry_bfr bfr, int idx) {
public void Fmt__do(Bry_bfr bfr) {
bfr.Add(Xohd_abrv_.Key_gallery_box_w);
bfr.Add_int_variable(uid);
bfr.Add_byte_apos();
@@ -45,7 +45,7 @@ interface Gallery_img_pad_fmtr_arg extends Bry_fmtr_arg {
class Gallery_img_pad_fmtr_arg__basic 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 XferAry(Bry_bfr bfr, int idx) {
public void Fmt__do(Bry_bfr bfr) {
bfr.Add(Style_bgn);
bfr.Add_int_variable(vpad);
bfr.Add(Style_end);
@@ -55,7 +55,7 @@ class Gallery_img_pad_fmtr_arg__basic implements Gallery_img_pad_fmtr_arg {
class Gallery_img_pad_fmtr_arg__hdump 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 XferAry(Bry_bfr bfr, int idx) {
public void Fmt__do(Bry_bfr bfr) {
bfr.Add(Xohd_abrv_.Key_gallery_img_pad);
bfr.Add_int_variable(uid);
bfr.Add_byte_apos();

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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.files.*; import gplx.xowa.html.*; import gplx.xowa.html.lnkis.*; import gplx.xowa.html.hdumps.core.*; import gplx.xowa.html.hdumps.pages.*; import gplx.xowa.parsers.lnkis.*;
import gplx.xowa.files.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.lnkis.*; import gplx.xowa.htmls.hdumps.core.*; import gplx.xowa.htmls.hdumps.pages.*; import gplx.xowa.parsers.lnkis.*;
import gplx.xowa.parsers.*;
public class Gallery_html_wtr {
private final Xoh_arg_img_core img_core_fmtr_basic = new Xoh_arg_img_core__basic(), img_core_fmtr_hdump = new Xoh_arg_img_core__hdump();

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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.files.*; import gplx.xowa.files.gui.*; import gplx.xowa.gui.views.*; import gplx.xowa.html.*;
import gplx.xowa.files.*; import gplx.xowa.files.gui.*; import gplx.xowa.guis.views.*; import gplx.xowa.htmls.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.lnkis.*;
public class Gallery_itm implements Js_img_wkr {
private Gallery_xnde xnde; private Xof_file_itm xfer_itm; private Xowe_wiki wiki; private Xop_ctx ctx; private byte[] src; private byte[] gallery_li_id_bry; private int gallery_itm_idx;
@@ -51,7 +51,7 @@ public class Gallery_itm implements Js_img_wkr {
try {
xfer_itm.Init_at_gallery_end(html_w, html_h, html_view_url, html_orig_url);
gallery_mgr.Write_html_itm(bfr, tmp_bfr, wiki.Appe(), wiki, ctx.Cur_page(), ctx, wiki.Html_mgr().Html_wtr(), Xoh_wtr_ctx.Basic, src, xnde, Bry_.Empty, gallery_itm_idx, xfer_itm, false);
String itm_html = bfr.Xto_str_and_clear();
String itm_html = bfr.To_str_and_clear();
js_wkr.Html_elem_replace_html(String_.new_u8(gallery_li_id_bry), itm_html);
if (gallery_itm_idx == xnde.Itms_len() - 1 && Gallery_mgr_base_.Mode_is_packed(xnde.Mode()))
page.Xtn_gallery_packed_exists_y_(); // set flag for packed_gallery; don't fire multiple times; PAGE:en.w:National_Sculpture_Museum_(Valladolid); DATE:2014-07-21

View File

@@ -17,8 +17,8 @@ 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.primitives.*; import gplx.core.btries.*;
import gplx.xowa.langs.*;
import gplx.xowa.nss.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.lnkis.*; import gplx.xowa.parsers.lnkis.redlinks.*; import gplx.xowa.parsers.tmpls.*;
import gplx.xowa.files.*;
public class Gallery_itm_parser {
@@ -31,7 +31,7 @@ public class Gallery_itm_parser {
private Bry_bfr caption_bfr = Bry_bfr.reset_(255); private int caption_bgn;
private Xop_ctx ctx;
public Gallery_itm_parser Init_by_wiki(Xowe_wiki wiki) {
this.wiki = wiki; Xol_lang lang = wiki.Lang();
this.wiki = wiki; Xol_lang_itm lang = wiki.Lang();
this.ctx = wiki.Parser_mgr().Ctx();
trie.Clear();
Byte_obj_ref tmp_bref = Byte_obj_ref.zero_();
@@ -52,7 +52,7 @@ public class Gallery_itm_parser {
byte cur_mode = Parse_itm();
if (cur_itm.Ttl() != null) {
if (caption_bfr.Len() > 0)
cur_itm.Caption_bry_(caption_bfr.Xto_bry_and_clear_and_trim());
cur_itm.Caption_bry_(caption_bfr.To_bry_and_clear_and_trim());
Make_lnki_tkn(mgr, xnde, src);
rv.Add(cur_itm);
cur_itm = new Gallery_itm();
@@ -226,9 +226,9 @@ public class Gallery_itm_parser {
}
private static final byte Fld_null = 0, Fld_ttl = 1, Fld_caption = 2, Fld_alt = 3, Fld_link = 4, Fld_page = 5;
private static final byte Mode_eos = 1, Mode_nl = 2, Mode_pipe = 3, Mode_text = 4;
private void Init_keyword(Byte_obj_ref tmp_bref, Xol_lang lang, int kwd_id, byte trie_key) {
private void Init_keyword(Byte_obj_ref tmp_bref, Xol_lang_itm lang, int kwd_id, byte trie_key) {
Xol_kwd_grp grp = lang.Kwd_mgr().Get_at(kwd_id);
if (grp == null) {Gfo_usr_dlg_.I.Warn_many("", "", "could not find gallery keyword: ~{0}", String_.new_u8(Xol_kwd_grp_.Bry_by_id(kwd_id))); return;}
if (grp == null) {Gfo_usr_dlg_.Instance.Warn_many("", "", "could not find gallery keyword: ~{0}", String_.new_u8(Xol_kwd_grp_.Bry_by_id(kwd_id))); return;}
Xol_kwd_itm[] itms = grp.Itms();
int len = itms.length;
Byte_obj_val trie_ref = Byte_obj_val.new_(trie_key);

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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import org.junit.*; import gplx.xowa.langs.*;
import org.junit.*; import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
public class Gallery_itm_parser_tst {
@Before public void init() {fxt.Init();} private Gallery_itm_parser_fxt fxt = new Gallery_itm_parser_fxt();
@Test public void All() {fxt.Test_parse("File:A.png|a|alt=b|link=c" , fxt.Expd("File:A.png", "a" , "b" , "c"));}
@@ -79,7 +79,7 @@ class Gallery_itm_parser_fxt {
public String[] Expd(String ttl, String caption) {return new String[] {ttl, caption, null, null, null};}
public String[] Expd(String ttl, String caption, String alt) {return new String[] {ttl, caption, alt, null, null};}
public String[] Expd(String ttl, String caption, String alt, String link) {return new String[] {ttl, caption, alt, link, null};}
public String[] Expd(String ttl, String caption, String alt, String link, int page) {return new String[] {ttl, caption, alt, link, Int_.Xto_str(page)};}
public String[] Expd(String ttl, String caption, String alt, String link, int page) {return new String[] {ttl, caption, alt, link, Int_.To_str(page)};}
public void Init_kwd_set(int kwd_id, String kwd_val) {
wiki.Lang().Kwd_mgr().Get_or_new(kwd_id).Itms()[0].Val_(Bry_.new_a7(kwd_val));
parser.Init_by_wiki(wiki);

View File

@@ -16,8 +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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.langs.htmls.*; import gplx.xowa.html.*; import gplx.xowa.html.modules.*; import gplx.xowa.files.*; import gplx.xowa.html.hdumps.abrvs.*; import gplx.xowa.html.hdumps.core.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.lnkis.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.modules.*; import gplx.xowa.files.*; import gplx.xowa.htmls.hdumps.abrvs.*; import gplx.xowa.htmls.hdumps.core.*;
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();
@@ -63,7 +63,7 @@ public abstract class Gallery_mgr_base {
page.Hdump_data().Imgs_add(new Xohd_data_itm__gallery_mgr(gallery_uid, max_width));
}
byte[] box_cls = Fmt_and_add(tmp_bfr, box_cls_fmtr, xnde.Atr_cls(), this.Tid_bry());
byte[] gallery_ul_id = tmp_bfr.Add(box_id_prefix_bry).Add_int_variable(gallery_uid).Xto_bry_and_clear();
byte[] gallery_ul_id = tmp_bfr.Add(box_id_prefix_bry).Add_int_variable(gallery_uid).To_bry_and_clear();
Box_hdr_write(bfr, wiki.Appe().Html_mgr().Whitelist_mgr(), src, gallery_ul_id, box_cls, box_style, xnde.Atrs_other(), hctx_is_hdump, gallery_uid);
byte[] box_caption = xnde.Atr_caption();
if (Bry_.Len_gt_0(box_caption)) box_caption_fmtr.Bld_bfr_many(bfr, box_caption);
@@ -91,7 +91,7 @@ public abstract class Gallery_mgr_base {
xfer_itm.Html_elem_tid_(Xof_html_elem.Tid_gallery_v2);
}
int img_uid = xfer_itm.Html_uid();
byte[] gallery_li_id = tmp_bfr.Add(itm_id_prefix_bry).Add_int_variable(img_uid).Xto_bry_and_clear();
byte[] gallery_li_id = tmp_bfr.Add(itm_id_prefix_bry).Add_int_variable(img_uid).To_bry_and_clear();
byte[] itm_html = Bry_.Empty;
int html_w_expand = xfer_itm.Html_w();
int html_h_expand = xfer_itm.Html_h();
@@ -131,7 +131,7 @@ public abstract class Gallery_mgr_base {
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);
tmp_bfr.Add(itm_divs_end_bry);
itm_html = tmp_bfr.Xto_bry_and_clear();
itm_html = tmp_bfr.To_bry_and_clear();
}
byte[] show_filenames_link = Bry_.Empty;
@@ -146,8 +146,8 @@ public abstract class Gallery_mgr_base {
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);
itm_caption = tmp_bfr.Xto_bry_and_clear();
itm_caption = tmp_bfr.Add(show_filenames_link).Add(itm_caption).Xto_bry_and_clear();
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);
bfr.Add(itm_li_end_bry);
if (hctx_is_hdump)
@@ -187,7 +187,7 @@ public abstract class Gallery_mgr_base {
tmp_bfr.Add_byte_space();
tmp_bfr.Add(trailer);
}
return tmp_bfr.Xto_bry_and_clear();
return tmp_bfr.To_bry_and_clear();
}
private static void Box_hdr_write(Bry_bfr bfr, Xop_xatr_whitelist_mgr whitelist_mgr, byte[] src, byte[] gallery_ul_uid, byte[] cls, byte[] style, List_adp xatr_list, boolean hctx_is_hdump, int uid) {
bfr.Add_byte(Byte_ascii.Lt).Add(Html_tag_.Ul_name_bry);
@@ -204,10 +204,10 @@ public abstract class Gallery_mgr_base {
if (xatr_list != null) {
int len = xatr_list.Count();
for (int i = 0; i < len; i++) {
Xop_xatr_itm xatr = (Xop_xatr_itm)xatr_list.Get_at(i);
Mwh_atr_itm xatr = (Mwh_atr_itm)xatr_list.Get_at(i);
if (!whitelist_mgr.Chk(Xop_xnde_tag_.Tid_ul, src, xatr)) continue;
byte[] key = xatr.Key_bry();
byte[] val = xatr.Val_as_bry(src);
byte[] val = xatr.Val_as_bry();
Html_wtr.Write_atr_bry(bfr, key, val);
}
}

View File

@@ -17,7 +17,7 @@ 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 org.junit.*;
import gplx.xowa.html.*; import gplx.xowa.files.fsdb.*;
import gplx.xowa.htmls.*; import gplx.xowa.files.fsdb.*;
public class Gallery_mgr_base_basic_tst {
private Gallery_mgr_base_fxt fxt = new Gallery_mgr_base_fxt();
@Before public void init() {fxt.Reset();}

View File

@@ -17,7 +17,7 @@ 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 org.junit.*;
import gplx.xowa.html.*;
import gplx.xowa.htmls.*;
public class Gallery_mgr_base_xnde_atrs_tst {
private Gallery_mgr_base_fxt fxt = new Gallery_mgr_base_fxt();
@Before public void init() {fxt.Reset();}

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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.files.*; import gplx.xowa.html.modules.*;
import gplx.xowa.files.*; import gplx.xowa.htmls.modules.*;
import gplx.xowa.parsers.lnkis.*;
public class Gallery_mgr_packed_base extends Gallery_mgr_base {
@Override public byte Tid() {return Gallery_mgr_base_.Packed_tid;}

View File

@@ -19,9 +19,9 @@ package gplx.xowa.xtns.gallery; import gplx.*; import gplx.xowa.*; import gplx.x
import gplx.core.primitives.*; import gplx.dbs.cfgs.*;
import gplx.fsdb.meta.*;
import gplx.xowa.parsers.logs.*;
import gplx.xowa.html.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
public class Gallery_xnde implements Xox_xnde, Xop_xnde_atr_parser {
import gplx.xowa.htmls.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*;
public class Gallery_xnde implements Xox_xnde, Mwh_atr_itm_owner {
private Gallery_xtn_mgr xtn_mgr;
public byte Mode() {return mode;} private byte mode;
public int Itm_w() {return itm_w;} private int itm_w = Null;
@@ -38,18 +38,18 @@ public class Gallery_xnde implements Xox_xnde, Xop_xnde_atr_parser {
public Gallery_itm Itms_get_at(int i) {return (Gallery_itm)itms.Get_at(i);}
public Gallery_mgr_base Gallery_mgr() {return gallery_mgr;} private Gallery_mgr_base gallery_mgr;
private boolean html_wtr_v1 = false;
public void Xatr_parse(Xowe_wiki wiki, byte[] src, Xop_xatr_itm xatr, Object xatr_key_obj) {
if (xatr_key_obj != null) {
Byte_obj_val xatr_key = (Byte_obj_val)xatr_key_obj;
switch (xatr_key.Val()) {
case Gallery_xnde_atrs.Mode_tid: mode = Gallery_mgr_base_.Get_or_traditional(xatr.Val_as_bry(src)); break;
case Gallery_xnde_atrs.Perrow_tid: itms_per_row = xatr.Val_as_int_or(src, Null); break;
case Gallery_xnde_atrs.Widths_tid: itm_w = xatr.Val_as_int_or(src, Null); break;
case Gallery_xnde_atrs.Heights_tid: itm_h = xatr.Val_as_int_or(src, Null); break;
case Gallery_xnde_atrs.Showfilename_tid: show_filename = xatr.Val_as_bool(src); break;
case Gallery_xnde_atrs.Caption_tid: if (!xatr.Tid_is_key_only()) atr_caption = xatr.Val_as_bry(src); break; // NOTE: do not create caption for key only; EX:<gallery caption=> PAGE:fr.w:Chronologie_du_si<73>ge_de_Paris_(1870); DATE:2014-08-15
case Gallery_xnde_atrs.Style_tid: atr_style = xatr.Val_as_bry(src); break;
case Gallery_xnde_atrs.Class_tid: atr_cls = xatr.Val_as_bry(src); break;
public void Xatr__set(Xowe_wiki wiki, byte[] src, Mwh_atr_itm xatr, Object xatr_id_obj) {
if (xatr_id_obj != null) {
Byte_obj_val xatr_id = (Byte_obj_val)xatr_id_obj;
switch (xatr_id.Val()) {
case Gallery_xnde_atrs.Mode_tid: mode = Gallery_mgr_base_.Get_or_traditional(xatr.Val_as_bry()); break;
case Gallery_xnde_atrs.Perrow_tid: itms_per_row = xatr.Val_as_int_or(Null); break;
case Gallery_xnde_atrs.Widths_tid: itm_w = xatr.Val_as_int_or(Null); break;
case Gallery_xnde_atrs.Heights_tid: itm_h = xatr.Val_as_int_or(Null); break;
case Gallery_xnde_atrs.Showfilename_tid: show_filename = xatr.Val_as_bool(); break;
case Gallery_xnde_atrs.Caption_tid: if (xatr.Key_exists()) atr_caption = xatr.Val_as_bry(); break; // NOTE: do not create caption for key only; EX:<gallery caption=> PAGE:fr.w:Chronologie_du_si<73>ge_de_Paris_(1870); DATE:2014-08-15
case Gallery_xnde_atrs.Style_tid: atr_style = xatr.Val_as_bry(); break;
case Gallery_xnde_atrs.Class_tid: atr_cls = xatr.Val_as_bry(); break;
}
}
else {
@@ -60,7 +60,7 @@ public class Gallery_xnde implements Xox_xnde, Xop_xnde_atr_parser {
public void Xtn_parse(Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
try {
ctx.Para().Process_block__xnde(xnde.Tag(), Xop_xnde_tag.Block_bgn); // cancel pre for <gallery>; DATE:2014-03-11
Xop_xatr_itm.Xatr_parse(wiki.Appe(), this, Gallery_xnde_atrs.Key_hash, wiki, src, xnde);
Xox_xnde_.Xatr__set(wiki, this, Gallery_xnde_atrs.Key_hash, src, xnde);
xtn_mgr = (Gallery_xtn_mgr)wiki.Xtn_mgr().Get_or_fail(Gallery_xtn_mgr.XTN_KEY);
Init_atrs(wiki);
gallery_mgr.Get_modules(ctx.Cur_page());
@@ -87,7 +87,7 @@ public class Gallery_xnde implements Xox_xnde, Xop_xnde_atr_parser {
}
private void Init_atrs(Xowe_wiki wiki) {
Db_cfg_hash cfg_grp = wiki.File_mgr().Cfg_get(Xof_fsdb_mgr_cfg.Grp_xowa);
if (cfg_grp.Get(Xof_fsdb_mgr_cfg.Key_gallery_fix_defaults).To_yn_or_n()) {
if (cfg_grp.Get_by(Xof_fsdb_mgr_cfg.Key_gallery_fix_defaults).To_yn_or_n()) {
if (itm_w == Gallery_xnde.Null && itm_h == Gallery_xnde.Null) // if no w/h specified, set both to default (just like v1)
itm_w = itm_h = Gallery_xnde.Default;
}
@@ -97,7 +97,7 @@ public class Gallery_xnde implements Xox_xnde, Xop_xnde_atr_parser {
}
gallery_mgr = Gallery_mgr_base_.New_by_mode(mode);
if ( !wiki.File_mgr().Version_1_y() // v2: fsdb
&& !cfg_grp.Get(Xof_fsdb_mgr_cfg.Key_gallery_packed).To_yn_or_n() // packed not supported
&& !cfg_grp.Get_by(Xof_fsdb_mgr_cfg.Key_gallery_packed).To_yn_or_n() // packed not supported
) {
gallery_mgr = Gallery_mgr_base_.New_by_mode(Gallery_mgr_base_.Traditional_tid); // always go to traditional
html_wtr_v1 = true;

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.gallery; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.html.modules.*;
import gplx.xowa.htmls.modules.*;
public class Gallery_xtn_mgr extends Xox_mgr_base {
@Override public byte[] Xtn_key() {return XTN_KEY;} public static final byte[] XTN_KEY = Bry_.new_a7("gallery");
@Override public Xox_mgr Clone_new() {return new Gallery_xtn_mgr();}