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

Cfg: Add more implementation for cfg_cache and pub / sub

This commit is contained in:
gnosygnu
2016-12-04 11:40:47 -05:00
parent f7558a6761
commit 585ef1c2ce
30 changed files with 195 additions and 98 deletions

View File

@@ -41,7 +41,8 @@ public class Xoh_html_wtr {
public void Init_by_wiki(Xowe_wiki wiki) {
cfg.Toc__show_(Bool_.Y).Lnki__title_(true).Lnki__visited_y_().Lnki__id_(Bool_.Y); // NOTE: set during Init_by_wiki, b/c all tests assume these are false
cfg.Section_editable_(wiki.Appe().Api_root().Addon().Parser__hdr__section_editable());
cfg.Section_editable_(wiki.App().Cfg().Bind_bool(wiki, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled, cfg));
ref_wtr.Init_by_wiki(wiki);
}
public void Init_by_page(Xop_ctx ctx, Xoh_wtr_ctx hctx, byte[] src, Xoae_page page) {

View File

@@ -16,10 +16,16 @@ 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.htmls.core.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*;
public class Xoh_html_wtr_cfg {
public class Xoh_html_wtr_cfg implements Gfo_invk {
public boolean Toc__show() {return toc__show;} public Xoh_html_wtr_cfg Toc__show_(boolean v) {toc__show = v; return this;} private boolean toc__show;
public boolean Lnki__id() {return lnki__id;} public Xoh_html_wtr_cfg Lnki__id_(boolean v) {lnki__id = v; return this;} private boolean lnki__id;
public boolean Lnki__title() {return lnki__title;} public Xoh_html_wtr_cfg Lnki__title_(boolean v) {lnki__title = v; return this;} private boolean lnki__title;
public boolean Lnki__visited() {return lnki__visited;} public Xoh_html_wtr_cfg Lnki__visited_y_() {lnki__visited = true; return this;} private boolean lnki__visited;
public boolean Section_editable() {return section_editable;} public Xoh_html_wtr_cfg Section_editable_(boolean v) {section_editable = v; return this;} private boolean section_editable;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled)) section_editable = m.ReadBool("v");
else return Gfo_invk_.Rv_unhandled;
return this;
}
}

View File

@@ -18,8 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.htmls.core.wkrs.hdrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.wkrs.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*; import gplx.xowa.parsers.hdrs.*;
public class Xoh_section_editable_ {
public static void Write_imt1(Bry_bfr bfr, Xop_ctx ctx, Xop_tkn_itm tkn) {
public static void Write_imt(Bry_bfr bfr, Xop_ctx ctx, Xop_tkn_itm tkn) {
Xop_hdr_tkn hdr_tkn = (Xop_hdr_tkn)tkn;
ctx.Wiki().Parser_mgr().Hdr__section_editable__imt_fmt().Bld_many_to_bry(bfr, hdr_tkn.Section_editable_page(), hdr_tkn.Section_editable_idx());
}
public static final String Cfg__section_editing__enabled = "section_editing.enabled";
}