1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-07-12 21:10:02 -04:00
commit 794b5a232f
3099 changed files with 238212 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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.wikis.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
public class Xow_module_base implements GfoInvkAble {
public byte Enabled() {return enabled;} private byte enabled = Bool_.__byte;
public boolean Enabled_y() {return enabled == Bool_.Y_byte;}
public boolean Enabled_n() {return enabled == Bool_.N_byte;}
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_enabled)) return Yn.Xto_nullable_str(enabled);
else if (ctx.Match(k, Invk_enabled_)) enabled = Yn.Xto_nullable_byte(m.ReadStr("v"));
else return GfoInvkAble_.Rv_unhandled;
return this;
}
private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_";
}

View File

@@ -0,0 +1,40 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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.wikis.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
import gplx.xowa.html.modules.*; import gplx.xowa.html.modules.popups.*;
public class Xow_module_mgr implements GfoInvkAble {
private Hash_adp_bry regy = Hash_adp_bry.cs_();
public Xow_module_mgr(Xowe_wiki wiki) {
this.popup_mgr = new Xow_popup_mgr(wiki);
regy.Add_bry_obj(Xoh_module_itm_.Key_top_icon , itm__top_icon);
regy.Add_bry_obj(Xoh_module_itm_.Key_navframe , itm__navframe);
regy.Add_bry_obj(Xoh_module_itm_.Key_title_rewrite , itm__title_rewrite);
}
public void Init_by_wiki(Xowe_wiki wiki) {
popup_mgr.Init_by_wiki(wiki);
}
public Xow_module_base Itm__top_icon() {return itm__top_icon;} private Xow_module_base itm__top_icon = new Xow_module_base();
public Xow_module_base Itm__navframe() {return itm__navframe;} private Xow_module_base itm__navframe = new Xow_module_base();
public Xow_module_base Itm__title_rewrite() {return itm__title_rewrite;} private Xow_module_base itm__title_rewrite = new Xow_module_base();
public Xow_popup_mgr Popup_mgr() {return popup_mgr;} private Xow_popup_mgr popup_mgr;
public Xow_module_base Get(byte[] key) {return (Xow_module_base)regy.Get_by_bry(key);}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_get)) return Get(m.ReadBry("v"));
else return GfoInvkAble_.Rv_unhandled;
} private static final String Invk_get = "get";
}