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-19 23:16:49 -04:00
parent 794b5a232f
commit 8e041d6e06
834 changed files with 4749 additions and 4461 deletions

View File

@@ -26,11 +26,11 @@ public class Xow_html_util implements GfoInvkAble {
String If_bool(String expr, String true_val, String false_val) {
Object o = wiki.Appe().Gfs_mgr().Run_str(expr);
try {return Bool_.cast_(o) ? true_val : false_val;}
catch (Exception e) {Exc_.Noop(e); return "expr failed: " + expr;}
catch (Exception e) {Err_.Noop(e); return "expr failed: " + expr;}
}
String If_yn(String expr, String true_val, String false_val) {
String o = String_.as_(wiki.Appe().Gfs_mgr().Run_str(expr));
try {return Yn.parse_(o) ? true_val : false_val;}
catch (Exception e) {Exc_.Noop(e); return "expr failed: " + expr;}
catch (Exception e) {Err_.Noop(e); return "expr failed: " + expr;}
}
}

View File

@@ -22,13 +22,13 @@ public class Xow_ns_case_ {
public static byte parse_(String s) {
if (String_.Eq(s, Key_1st)) return Id_1st;
else if (String_.Eq(s, Key_all)) return Id_all;
else throw Exc_.new_unhandled(s);
else throw Err_.new_unhandled(s);
}
public static String To_str(byte uid) {
switch (uid) {
case Id_all: return Key_all;
case Id_1st: return Key_1st;
default: throw Exc_.new_unhandled(uid);
default: throw Err_.new_unhandled(uid);
}
}
}

View File

@@ -19,7 +19,7 @@ package gplx.xowa; import gplx.*;
import gplx.core.primitives.*;
import gplx.xowa.wikis.*; import gplx.xowa.wikis.ttls.*; import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.xwikis.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.fsdb.meta.*; import gplx.fsdb.*;
import gplx.xowa.html.*; import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.html.xouis.tbls.*;
import gplx.xowa.html.*; import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.html.bridges.dbuis.tbls.*;
public interface Xow_wiki extends Xow_ttl_parser {
boolean Type_is_edit();
Xoa_app App();
@@ -41,7 +41,6 @@ public interface Xow_wiki extends Xow_ttl_parser {
Xow_hzip_mgr Html__hzip_mgr();
Xohd_hdump_rdr Html__hdump_rdr();
Xoh_page_wtr_mgr_base Html__page_wtr_mgr();
Xoui_tbl_mgr Html__xoui_tbl_mgr();
boolean Html__css_installing(); void Html__css_installing_(boolean v);
Xow_xwiki_mgr Xwiki_mgr();
Xow_wiki_props Props();

View File

@@ -48,10 +48,11 @@ public class Xow_wiki_props implements GfoInvkAble {
site_name = Bry_.Mid(siteinfo_misc, 0, pipe_0);
return this;
} private byte[] siteinfo_misc = Bry_.Empty;
public void Init_by_load(gplx.dbs.cfgs.Db_cfg_tbl cfg_tbl) {
public void Init_by_load(Xoa_app app, gplx.dbs.cfgs.Db_cfg_tbl cfg_tbl) {
this.main_page = cfg_tbl.Select_bry_or(Xow_cfg_consts.Grp__wiki_init, Xow_cfg_consts.Key__init__main_page, null);
if (main_page == null) {
Xoa_app_.Usr_dlg().Warn_many("", "", "mw_props.load; main_page not found; conn=~{0}", cfg_tbl.Conn().Conn_info().Xto_api());
if (main_page == null) { // main_page not found
if (!app.Bldr__running()) // not building; note that Init_by_load is called by bldr cmds like css; DATE:2015-07-13
Xoa_app_.Usr_dlg().Warn_many("", "", "mw_props.load; main_page not found; conn=~{0}", cfg_tbl.Conn().Conn_info().Xto_api());
this.main_page = Xoa_page_.Main_page_bry;
}
}

View File

@@ -22,7 +22,7 @@ import gplx.fsdb.*;
import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.fsdb.meta.*;
import gplx.xowa.langs.vnts.*; import gplx.xowa.gui.views.*; import gplx.xowa.wikis.xwikis.*;
import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.html.css.*; import gplx.xowa.html.ns_files.*; import gplx.xowa.html.xouis.tbls.*;
import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.html.css.*; import gplx.xowa.html.ns_files.*; import gplx.xowa.html.bridges.dbuis.tbls.*;
import gplx.xowa.setup.maints.*; import gplx.xowa.wikis.caches.*;
import gplx.xowa.bldrs.xmls.*; import gplx.xowa.xtns.pfuncs.*;
import gplx.xowa.tdbs.*;
@@ -96,7 +96,6 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
public Xow_hzip_mgr Html__hzip_mgr() {return html_mgr.Hzip_mgr();}
public Xohd_hdump_rdr Html__hdump_rdr() {return html_mgr__hdump_rdr;} private final Xohd_hdump_rdr html_mgr__hdump_rdr;
public Xoh_page_wtr_mgr_base Html__page_wtr_mgr() {return html_mgr.Page_wtr_mgr();}
public Xoui_tbl_mgr Html__xoui_tbl_mgr() {return html__xoui_tbl_mgr;} private final Xoui_tbl_mgr html__xoui_tbl_mgr = new Xoui_tbl_mgr();
public boolean Html__css_installing() {return html__css_installing;} public void Html__css_installing_(boolean v) {html__css_installing = v;} private boolean html__css_installing;
public Xow_xwiki_mgr Xwiki_mgr() {return xwiki_mgr;} private final Xow_xwiki_mgr xwiki_mgr;
public Xow_wiki_props Props() {return props;} private final Xow_wiki_props props = new Xow_wiki_props();
@@ -285,7 +284,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
else if (ctx.Match(k, Invk_cfg_gallery_)) return cfg_gallery;
else if (ctx.Match(k, Invk_commons_wiki_)) commons_wiki_key = m.ReadBry("v");
else if (ctx.Match(k, Invk_lang)) return lang;
else if (ctx.Match(k, Invk_lang_)) throw Exc_.new_deprecated("wiki.lang_");
else if (ctx.Match(k, Invk_lang_)) throw Err_.new_deprecated("wiki.lang_");
else if (ctx.Match(k, Invk_html)) return html_mgr;
else if (ctx.Match(k, Invk_gui)) return gui_mgr;
else if (ctx.Match(k, Invk_cfg_history)) return cfg_history;