mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.2.1
This commit is contained in:
@@ -58,7 +58,7 @@ public class Gallery_html_wtr {
|
||||
byte[] itm_caption = Gallery_html_wtr_.Bld_caption(wiki, ctx, wtr, hctx, itm);
|
||||
Xoa_ttl itm_ttl = itm.Ttl();
|
||||
if ( itm_ttl != null // ttl does not have invalid characters
|
||||
&& itm_ttl.Ns().Id_file() // ttl is in file ns;
|
||||
&& itm_ttl.Ns().Id_is_file() // ttl is in file ns;
|
||||
) {
|
||||
Xop_lnki_tkn lnki = ctx.Tkn_mkr().Lnki(itm.Ttl_bgn(), itm.Ttl_end()).Ttl_(itm_ttl).W_(mgr.Itm_w()).H_(mgr.Itm_h());
|
||||
Xof_file_itm xfer_itm = wtr.Lnki_wtr().File_wtr().Lnki_eval(Xof_exec_tid.Tid_wiki_page, ctx, page, lnki);
|
||||
|
||||
@@ -179,8 +179,8 @@ public class Gallery_itm_parser {
|
||||
)
|
||||
cur_itm.Reset();
|
||||
else {
|
||||
if (!ttl.Ns().Id_file_or_media()) // ttl does not have "File:"; MW allows non-ns names; EX: "A.png" instead of "File:A.png"; DATE:2013-11-18
|
||||
ttl = Xoa_ttl.parse(wiki, Xow_ns_.Id_file, ttl_bry);
|
||||
if (!ttl.Ns().Id_is_file_or_media()) // ttl does not have "File:"; MW allows non-ns names; EX: "A.png" instead of "File:A.png"; DATE:2013-11-18
|
||||
ttl = Xoa_ttl.parse(wiki, Xow_ns_.Tid__file, ttl_bry);
|
||||
cur_itm.Ttl_(ttl);
|
||||
cur_itm.Ext_(Xof_ext_.new_by_ttl_(ttl_bry));
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ public abstract class Gallery_mgr_base {
|
||||
@gplx.Virtual public int Get_gb_width(int thm_w, int thm_h) {// REF.MW: getGBWidth; Width of gallerybox <li>. Generally is the width of the image, plus padding on image plus padding on gallerybox.s
|
||||
return itm_default_w + this.Get_thumb_padding() + this.Get_gb_padding();
|
||||
}
|
||||
@gplx.Virtual public void Get_modules(Xoae_page page) {} // REF.MW: getModules; Get a list of modules to include in the page.
|
||||
@gplx.Virtual public void Get_modules(Xoae_page page) { // REF.MW: getModules; Get a list of modules to include in the page.
|
||||
page.Html_data().Head_mgr().Itm__gallery_styles().Enabled_y_(); // enable styles or some galleries will show up as list items; PAGE:s.w:Gothic_architecture DATE:2015-11-06
|
||||
}
|
||||
@gplx.Virtual public void Init(int itms_per_row, int itm_default_w, int itm_default_h) {
|
||||
this.itms_per_row = itms_per_row;
|
||||
this.itm_default_w = itm_default_w;
|
||||
@@ -100,7 +102,7 @@ public abstract class Gallery_mgr_base {
|
||||
file_found = File_found_mode == Bool_.Y_byte;
|
||||
int vpad = -1, img_div_w = -1;
|
||||
if ( !hctx_is_hdump // always write img if hdump; DATE:2015-04-27
|
||||
&& ( !ttl.Ns().Id_file()
|
||||
&& ( !ttl.Ns().Id_is_file()
|
||||
|| !file_found
|
||||
)
|
||||
) { // itm is not a file, or is not found; write text
|
||||
@@ -190,7 +192,7 @@ public abstract class Gallery_mgr_base {
|
||||
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);
|
||||
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) {
|
||||
|
||||
@@ -57,7 +57,10 @@ public class Gallery_mgr_base_basic_tst {
|
||||
, " </li>"
|
||||
, "</ul>"
|
||||
));
|
||||
fxt.Test_html_modules_js("");
|
||||
fxt.Test_html_modules_js(String_.Concat_lines_nl_skip_last
|
||||
( ""
|
||||
, " <link rel=\"stylesheet\" href=\"file:///mem/xowa/bin/any/xowa/html/res/src/mediawiki.page/mediawiki.page.gallery.css\" type='text/css'>"
|
||||
));
|
||||
}
|
||||
@Test public void Tmpl() {
|
||||
fxt.Fxt().Init_defn_add("test_tmpl", "b");
|
||||
@@ -112,6 +115,7 @@ public class Gallery_mgr_base_basic_tst {
|
||||
fxt.Test_html_frag("<gallery mode=packed heights=300px>File:A.png|a</gallery>", "<ul id=\"xowa_gallery_ul_0\" class=\"gallery mw-gallery-packed\">");
|
||||
fxt.Test_html_modules_js(String_.Concat_lines_nl_skip_last
|
||||
( ""
|
||||
, " <link rel=\"stylesheet\" href=\"file:///mem/xowa/bin/any/xowa/html/res/src/mediawiki.page/mediawiki.page.gallery.css\" type='text/css'>"
|
||||
, " <script type='text/javascript'>"
|
||||
, " var xowa_global_values = {"
|
||||
, " 'gallery-packed-enabled' : true,"
|
||||
|
||||
@@ -28,6 +28,7 @@ public class Gallery_mgr_packed_base extends Gallery_mgr_base {
|
||||
}
|
||||
@Override public void Itms_per_row_(int v) {}
|
||||
@Override public void Get_modules(Xoae_page page) {
|
||||
super.Get_modules(page);
|
||||
page.Html_data().Head_mgr().Itm__gallery().Enabled_y_();
|
||||
}
|
||||
@Override public int Get_thumb_padding() {return 0;}
|
||||
|
||||
Reference in New Issue
Block a user