mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Html: Add option to hide xowa-alt in html db
This commit is contained in:
parent
1dbe526051
commit
1db737405f
@ -30,8 +30,8 @@ public class Xoa_app_ {
|
||||
}
|
||||
}
|
||||
public static final String Name = "xowa";
|
||||
public static final int Version_id = 533;
|
||||
public static final String Version = "4.5.11.1707";
|
||||
public static final int Version_id = 534;
|
||||
public static final String Version = "4.5.12.1707";
|
||||
public static String Build_date = "2012-12-30 00:00:00";
|
||||
public static String Build_date_fmt = "yyyy-MM-dd HH:mm:ss";
|
||||
public static String Op_sys_str;
|
||||
|
@ -100,9 +100,11 @@ public class Xoh_file_fmtr__basic implements Xoh_file_fmtr {
|
||||
public Bry_fmt Fmt_thumb_part_alt() {return fmt__thumb_part_alt;} private final Bry_fmt fmt__thumb_part_alt = Bry_fmt.Auto
|
||||
(String_.Concat_lines_nl_skip_last
|
||||
( ""
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">~{html}"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
));
|
||||
|
||||
public byte[] Bld_thumb_part_magnify(byte[] a_href, byte[] a_title) {
|
||||
|
@ -54,9 +54,11 @@ public class Xoh_file_wtr__audio__tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, "<div class=\"magnify\"><a href=\"/wiki/File:A.oga\" class=\"internal\" title=\"Enlarge\"></a></div>a"
|
||||
, " </div>"
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">b"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, "</div>"
|
||||
, ""
|
||||
@ -76,9 +78,11 @@ public class Xoh_file_wtr__audio__tst {
|
||||
, " </div>"
|
||||
, " <div class=\"thumbcaption\">a"
|
||||
, " </div>"
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">b"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,9 @@ public class Xoh_file_wtr__basic implements Gfo_invk {
|
||||
this.caption_fmtr = new Xoh_lnki_text_fmtr(wiki.Utl__bfr_mkr(), html_wtr);
|
||||
this.html_fmtr = fmtr__basic;
|
||||
}
|
||||
public boolean Alt_show_in_html() {return alt_show_in_html;} private boolean alt_show_in_html;
|
||||
public void Init_by_wiki(Xowe_wiki wiki) {
|
||||
wiki.App().Cfg().Bind_many_wiki(this, wiki, Cfg__alt_in_caption, Cfg__alt_defaults_to_caption);
|
||||
wiki.App().Cfg().Bind_many_wiki(this, wiki, Cfg__alt_in_caption, Cfg__alt_defaults_to_caption, Cfg__alt_show_in_html);
|
||||
}
|
||||
public void Init_by_page(Xoh_wtr_ctx hctx, Xoae_page page) {
|
||||
this.page = page;
|
||||
@ -271,12 +272,15 @@ public class Xoh_file_wtr__basic implements Gfo_invk {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Cfg__alt_in_caption)) alt_in_caption = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Cfg__alt_defaults_to_caption)) alt_defaults_to_caption = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Cfg__alt_show_in_html)) alt_show_in_html = m.ReadYn("v");
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
Cfg__alt_in_caption = "xowa.html.alt.show_in_caption"
|
||||
, Cfg__alt_defaults_to_caption = "xowa.html.alt.empty_alt_uses_caption";
|
||||
, Cfg__alt_defaults_to_caption = "xowa.html.alt.empty_alt_uses_caption"
|
||||
, Cfg__alt_show_in_html = "xowa.html.alt.show_in_html"
|
||||
;
|
||||
|
||||
private static final byte[]
|
||||
Div_center_bgn = Bry_.new_a7("<div class=\"center\">")
|
||||
|
@ -168,9 +168,11 @@ public class Xoh_file_wtr__image__basic__tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, "<div class=\"magnify\"><a href=\"/wiki/File:A.png\" class=\"internal\" title=\"Enlarge\"></a></div>"
|
||||
, " </div>"
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">b <a href=\"/wiki/C\">c</a> d"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, "</div>"
|
||||
, ""
|
||||
|
@ -91,9 +91,11 @@ public class Xoh_file_wtr__video__tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, "<div class=\"magnify\"><a href=\"/wiki/File:A.ogv\" class=\"internal\" title=\"Enlarge\"></a></div>bcd"
|
||||
, " </div>"
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">efg"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, "</div>"
|
||||
, ""
|
||||
@ -115,9 +117,11 @@ public class Xoh_file_wtr__video__tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, "<div class=\"magnify\"><a href=\"/wiki/File:A.webm\" class=\"internal\" title=\"Enlarge\"></a></div>a"
|
||||
, " </div>"
|
||||
, " <div class=\"xowa_alt_text\">"
|
||||
, " <hr/>"
|
||||
, " <div class=\"thumbcaption\">b"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, " </div>"
|
||||
, "</div>"
|
||||
, ""
|
||||
|
@ -37,5 +37,6 @@ public class Xoh_head_itm_ {
|
||||
, Key__server = Bry_.new_a7("server")
|
||||
, Key__tabber = Bry_.new_a7("tabber")
|
||||
, Key__xo_elem = Bry_.new_a7("xo.elem")
|
||||
, Key__page_cfg = Bry_.new_a7("page_cfg")
|
||||
;
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.htmls.heads; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import gplx.xowa.guis.*;
|
||||
public class Xoh_head_itm__page_cfg extends Xoh_head_itm__base {
|
||||
@Override public byte[] Key() {return Xoh_head_itm_.Key__page_cfg;}
|
||||
@Override public int Flags() {return Flag__css_text;}
|
||||
@Override public void Write_css_text(Xoae_app app, Xowe_wiki wiki, Xoae_page page, Xoh_head_wtr wtr) {
|
||||
wtr.Write_css_style_itm(Css_alt_text_display_none);
|
||||
}
|
||||
private static final byte[] Css_alt_text_display_none = Bry_.new_u8(String_.Concat_lines_nl
|
||||
( ".xowa_alt_text {"
|
||||
, " display:none;"
|
||||
, "}"
|
||||
));
|
||||
}
|
@ -31,7 +31,7 @@ public class Xoh_head_mgr implements gplx.core.brys.Bfr_arg {
|
||||
public Xoh_head_mgr() {
|
||||
Itms_add(itm__css, itm__globals, itm__xo_elem, itm__server, itm__popups, itm__toc, itm__collapsible, itm__navframe, itm__gallery, itm__gallery_styles
|
||||
, itm__mathjax, itm__graph, itm__hiero, itm__top_icon, itm__title_rewrite, itm__search_suggest, itm__timeline
|
||||
, itm__dbui, itm__pgbnr, itm__tabber
|
||||
, itm__dbui, itm__pgbnr, itm__tabber, itm__page_cfg
|
||||
);
|
||||
}
|
||||
public Xoh_head_itm__css Itm__css() {return itm__css;} private final Xoh_head_itm__css itm__css = new Xoh_head_itm__css();
|
||||
@ -54,6 +54,7 @@ public class Xoh_head_mgr implements gplx.core.brys.Bfr_arg {
|
||||
public Xoh_head_itm__dbui Itm__dbui() {return itm__dbui;} private final Xoh_head_itm__dbui itm__dbui = new Xoh_head_itm__dbui();
|
||||
public Xoh_head_itm__pgbnr Itm__pgbnr() {return itm__pgbnr;} private final Xoh_head_itm__pgbnr itm__pgbnr = new Xoh_head_itm__pgbnr();
|
||||
public Xoh_head_itm__tabber Itm__tabber() {return itm__tabber;} private final Xoh_head_itm__tabber itm__tabber = new Xoh_head_itm__tabber();
|
||||
public Xoh_head_itm__page_cfg Itm__page_cfg() {return itm__page_cfg;} private final Xoh_head_itm__page_cfg itm__page_cfg = new Xoh_head_itm__page_cfg();
|
||||
public Xoh_head_mgr Init(Xoae_app app, Xowe_wiki wiki, Xoae_page page) {
|
||||
this.app = app; this.wiki = wiki; this.page = page;
|
||||
return this;
|
||||
@ -63,6 +64,7 @@ public class Xoh_head_mgr implements gplx.core.brys.Bfr_arg {
|
||||
if (wiki.Html_mgr().Head_mgr().Itm__top_icon().Enabled_y()) itm__top_icon.Enabled_y_();
|
||||
if (wiki.Html_mgr().Head_mgr().Itm__title_rewrite().Enabled_y()) itm__title_rewrite.Enabled_y_();
|
||||
if (app.Addon_mgr().Itms__search__htmlbar().Enabled()) itm__search_suggest.Enabled_y_();
|
||||
if (!wiki.Html_mgr().Html_wtr().Lnki_wtr().File_wtr().File_wtr().Alt_show_in_html()) itm__page_cfg.Enabled_y_();
|
||||
itm__css.Enabled_y_();
|
||||
itm__globals.Enabled_y_(); // for now, always mark this and rest as exists; DATE:2014-06-09
|
||||
itm__xo_elem.Enabled_y_();
|
||||
|
Loading…
Reference in New Issue
Block a user