From 306001f311a2db40c9d8ae2d4f00ed1328c913d7 Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Sun, 13 Nov 2016 10:59:51 -0500 Subject: [PATCH] Cfg: Add initial implementation for special --- .../src/gplx/xowa/addons/Xoax_addon_mgr.java | 1 + .../xowa/addons/apps/cfgs/Xoa_cfg_addon.java | 36 ++++++++++++++++++ .../xowa/addons/apps/cfgs/gui/Xogui_grp.java | 9 ++++- .../cfgs/specials/lists/Xocfg_list_html.java | 37 +++++++++++++++++++ .../specials/lists/Xocfg_list_special.java | 28 ++++++++++++++ 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 400_xowa/src/gplx/xowa/addons/apps/cfgs/Xoa_cfg_addon.java create mode 100644 400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_html.java create mode 100644 400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_special.java diff --git a/400_xowa/src/gplx/xowa/addons/Xoax_addon_mgr.java b/400_xowa/src/gplx/xowa/addons/Xoax_addon_mgr.java index aa21c164a..964cfdaee 100644 --- a/400_xowa/src/gplx/xowa/addons/Xoax_addon_mgr.java +++ b/400_xowa/src/gplx/xowa/addons/Xoax_addon_mgr.java @@ -56,6 +56,7 @@ public class Xoax_addon_mgr { , new gplx.xowa.addons.apps.helps.logs .Xolog_addon() , new gplx.xowa.addons.wikis.pages.syncs .Xosync_addon() , new gplx.xowa.addons.users.wikis.regys .Xou_regy_addon() + , new gplx.xowa.addons.apps.cfgs .Xoa_cfg_addon() // jsons ); diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/Xoa_cfg_addon.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/Xoa_cfg_addon.java new file mode 100644 index 000000000..c2c388179 --- /dev/null +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/Xoa_cfg_addon.java @@ -0,0 +1,36 @@ +/* +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 . +*/ +package gplx.xowa.addons.apps.cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; +import gplx.xowa.specials.*; import gplx.xowa.htmls.bridges.*; +import gplx.xowa.addons.apps.cfgs.specials.lists.*; +public class Xoa_cfg_addon implements Xoax_addon_itm, Xoax_addon_itm__special, Xoax_addon_itm__json { + public Xow_special_page[] Special_pages() { + return new Xow_special_page[] + { Xocfg_list_special.Prototype + }; + } + public Bridge_cmd_itm[] Json_cmds() { + return new Bridge_cmd_itm[] + { + }; + } + + public String Addon__key() {return ADDON__KEY;} private static final String ADDON__KEY = "xowa.app.cfg"; + public static void Init(Xoae_app app) { + } +} diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/gui/Xogui_grp.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/gui/Xogui_grp.java index c731a5e4c..4db1fde4c 100644 --- a/400_xowa/src/gplx/xowa/addons/apps/cfgs/gui/Xogui_grp.java +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/gui/Xogui_grp.java @@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ package gplx.xowa.addons.apps.cfgs.gui; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; -public class Xogui_grp implements Xogui_nde { +import gplx.langs.mustaches.*; +public class Xogui_grp implements Xogui_nde, Mustache_doc_itm { public Xogui_grp(int id, int sort, String key) { this.id = id; this.sort = sort; @@ -40,4 +41,10 @@ public class Xogui_grp implements Xogui_nde { } public void Itms__add(Xogui_itm itm) { } + public boolean Mustache__write(String key, Mustache_bfr bfr) { + return true; + } + public Mustache_doc_itm[] Mustache__subs(String key) { + return Mustache_doc_itm_.Ary__empty; + } } diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_html.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_html.java new file mode 100644 index 000000000..d2f517b7e --- /dev/null +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_html.java @@ -0,0 +1,37 @@ +/* +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 . +*/ +package gplx.xowa.addons.apps.cfgs.specials.lists; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import gplx.xowa.addons.apps.cfgs.specials.*; +import gplx.xowa.specials.*; import gplx.langs.mustaches.*; import gplx.xowa.wikis.pages.*; import gplx.xowa.wikis.pages.tags.*; +import gplx.xowa.addons.apps.cfgs.gui.*; +class Xocfg_list_html extends Xow_special_wtr__base { + @Override protected Io_url Get_addon_dir(Xoa_app app) {return app.Fsys_mgr().Http_root().GenSubDir_nest("bin", "any", "xowa", "addon", "app", "cfg", "list");} + @Override protected Io_url Get_mustache_fil(Io_url addon_dir) {return addon_dir.GenSubFil_nest("bin", "xocfg_list.mustache.html");} + @Override protected Mustache_doc_itm Bld_mustache_root(Xoa_app app) { + return new Xogui_grp(0, 0, "test"); + } + @Override protected void Bld_tags(Xoa_app app, Io_url addon_dir, Xopage_html_data page_data) { + Xopg_tag_mgr head_tags = page_data.Head_tags(); + Xopg_tag_wtr_.Add__xocss (head_tags, app.Fsys_mgr().Http_root()); + Xopg_tag_wtr_.Add__xohelp (head_tags, app.Fsys_mgr().Http_root()); + Xopg_tag_wtr_.Add__xolog (head_tags, app.Fsys_mgr().Http_root()); + Xopg_tag_wtr_.Add__xoajax (head_tags, app.Fsys_mgr().Http_root(), app); + + head_tags.Add(Xopg_tag_itm.New_css_file(addon_dir.GenSubFil_nest("bin", "xocfg_list.css"))); + head_tags.Add(Xopg_tag_itm.New_js_file(addon_dir.GenSubFil_nest("bin", "xocfg_list.js"))); + } +} diff --git a/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_special.java b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_special.java new file mode 100644 index 000000000..8b4181cc7 --- /dev/null +++ b/400_xowa/src/gplx/xowa/addons/apps/cfgs/specials/lists/Xocfg_list_special.java @@ -0,0 +1,28 @@ +/* +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 . +*/ +package gplx.xowa.addons.apps.cfgs.specials.lists; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*; import gplx.xowa.addons.apps.cfgs.specials.*; +import gplx.xowa.specials.*; import gplx.core.net.qargs.*; +public class Xocfg_list_special implements Xow_special_page { + public void Special__gen(Xow_wiki wiki, Xoa_page page, Xoa_url url, Xoa_ttl ttl) { + new Xocfg_list_html().Bld_page_by_mustache(wiki.App(), page, this); + } + Xocfg_list_special(Xow_special_meta special__meta) {this.special__meta = special__meta;} + public Xow_special_meta Special__meta() {return special__meta;} private final Xow_special_meta special__meta; + public Xow_special_page Special__clone() {return this;} + public static final Xow_special_page Prototype = new Xocfg_list_special(Xow_special_meta.New_xo("XowaCfgList", "Options")); +}