"
+ ));
+ }
}
diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
index 5714d4815..996e8d5d9 100644
--- a/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
+++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
@@ -51,10 +51,11 @@ public class Nowiki_escape_itm {
trie_new_itm(rv, Byte_ascii.Brack_bgn_bry , Xop_amp_trie.Bry_xowa_brack_bgn);
trie_new_itm(rv, Byte_ascii.Brack_end_bry , Xop_amp_trie.Bry_xowa_brack_end); // PAGE:en.w: Tall_poppy_syndrome DATE:2014-07-23
trie_new_itm(rv, Byte_ascii.Pipe_bry , Xop_amp_trie.Bry_xowa_pipe);
- trie_new_itm(rv, Byte_ascii.Apos_bry , Xop_amp_trie.Bry_xowa_apos); // NOTE: for backward compatibility, use ' note that amp_wkr will turn ' -> ' but ' -> '; DATE:2014-07-03
+ trie_new_itm(rv, Byte_ascii.Apos_bry , Xop_amp_trie.Bry_xowa_apos); // NOTE: for backward compatibility, use ' note that amp_wkr will turn ' -> ' but ' -> '; DATE:2014-07-03
trie_new_itm(rv, Byte_ascii.Colon_bry , Xop_amp_trie.Bry_xowa_colon);
trie_new_itm(rv, Byte_ascii.Underline_bry , Xop_amp_trie.Bry_xowa_underline);
trie_new_itm(rv, Byte_ascii.Asterisk_bry , Xop_amp_trie.Bry_xowa_asterisk);
+ trie_new_itm(rv, Byte_ascii.Dash_bry , Xop_amp_trie.Bry_xowa_dash); // needed to handle "|-"; PAGE:de.w:Liste_von_Vereinen_und_Vereinigungen_von_Gl�ubigen_(r�misch-katholische_Kirche) DATE:2015-01-08
trie_new_itm(rv, Byte_ascii.Space_bry , Xop_amp_trie.Bry_xowa_space);
trie_new_itm(rv, Byte_ascii.NewLine_bry , Xop_amp_trie.Bry_xowa_nl);
trie_new_itm(rv, Pre_bry , Pre_bry);
diff --git a/400_xowa/src/gplx/xowa/servers/Gxw_html_server.java b/400_xowa/src/gplx/xowa/servers/Gxw_html_server.java
index 771545fa9..69c75faf3 100644
--- a/400_xowa/src/gplx/xowa/servers/Gxw_html_server.java
+++ b/400_xowa/src/gplx/xowa/servers/Gxw_html_server.java
@@ -92,4 +92,8 @@ public class Gxw_html_server implements Gxw_html {
mem_kit.New_html_impl_prototype_(new Gxw_html_server(app.Usr_dlg(), wtr)); // NOTE: set prototype before calling Kit_
app.Gui_mgr().Kit_(mem_kit);
}
+ public static void Assert_tab(Xoa_app app, Xoa_page page) {
+ if (app.Gui_mgr().Browser_win().Active_tab() == null) // no active tab
+ app.Gui_mgr().Browser_win().Tab_mgr().Tabs_new_init(page); // create at least one active tab; DATE:2014-07-30
+ }
}
diff --git a/400_xowa/src/gplx/xowa/servers/http/Http_server_mgr.java b/400_xowa/src/gplx/xowa/servers/http/Http_server_mgr.java
index fe89963b7..85ae5e895 100644
--- a/400_xowa/src/gplx/xowa/servers/http/Http_server_mgr.java
+++ b/400_xowa/src/gplx/xowa/servers/http/Http_server_mgr.java
@@ -78,8 +78,7 @@ public class Http_server_mgr implements GfoInvkAble {
Xoa_url page_url = app.Url_parser().Parse(page_ttl); // get the url (needed for query args)
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, page_ttl); // get the ttl
Xoa_page page = wiki.GetPageByTtl(page_url, ttl); // get page and parse it
- if (app.Gui_mgr().Browser_win().Active_tab() == null) // no active tab
- app.Gui_mgr().Browser_win().Tab_mgr().Tabs_new_init(page); // create at least one active tab; DATE:2014-07-30
+ Gxw_html_server.Assert_tab(app, page); // HACK: assert at least 1 tab
app.Gui_mgr().Browser_win().Active_page_(page); // HACK: init gui_mgr's page for output (which server ordinarily doesn't need)
if (page.Missing()) { // if page does not exist, replace with message; else null_ref error; DATE:2014-03-08
page.Data_raw_(Bry_.new_ascii_("'''Page not found.'''"));
diff --git a/400_xowa/src/gplx/xowa/servers/tcp/Xosrv_server.java b/400_xowa/src/gplx/xowa/servers/tcp/Xosrv_server.java
index 0996a7b32..707e7ca58 100644
--- a/400_xowa/src/gplx/xowa/servers/tcp/Xosrv_server.java
+++ b/400_xowa/src/gplx/xowa/servers/tcp/Xosrv_server.java
@@ -65,7 +65,7 @@ public class Xosrv_server implements GfoInvkAble {
}
private String Exec_cmd(String msg_text) {
Object rv_obj = app.Gfs_mgr().Run_str(msg_text);
- String rv = ClassAdp_.Eq_typeSafe(rv_obj, String_.ClassOf) ? (String)rv_obj : Object_.Xto_str_strict_or_null(rv_obj);
+ String rv = ClassAdp_.Eq_typeSafe(rv_obj, String_.Cls_ref_type) ? (String)rv_obj : Object_.Xto_str_strict_or_null(rv_obj);
return rv;
}
public String Exec_js(byte[] sender, byte[] msg_text) {
diff --git a/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_itm.java b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_itm.java
new file mode 100644
index 000000000..4393ae9ca
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_itm.java
@@ -0,0 +1,26 @@
+/*
+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.setup.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.setup.*;
+public class Wmf_latest_itm {
+ public Wmf_latest_itm(byte[] name, DateAdp date, long size) {
+ this.name = name; this.date = date; this.size = size;
+ }
+ public byte[] Name() {return name;} private final byte[] name;
+ public DateAdp Date() {return date;} private final DateAdp date;
+ public long Size() {return size;} private final long size;
+}
\ No newline at end of file
diff --git a/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser.java b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser.java
new file mode 100644
index 000000000..c9fa9b911
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser.java
@@ -0,0 +1,65 @@
+/*
+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.setup.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.setup.*;
+import gplx.core.btries.*; import gplx.ios.*;
+public class Wmf_latest_parser {
+ private OrderedHash hash = OrderedHash_.new_bry_();
+ public int Count() {return hash.Count();}
+ public Wmf_latest_itm Get_at(int i) {return (Wmf_latest_itm)hash.FetchAt(i);}
+ public Wmf_latest_itm Get_by(byte[] k) {return (Wmf_latest_itm)hash.Fetch(k);}
+ public Wmf_latest_itm[] Xto_ary() {return (Wmf_latest_itm[])hash.Xto_ary(Wmf_latest_itm.class);}
+ public void Parse(byte[] src) {
+ hash.Clear();
+ Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
+ byte[] name_bgn_bry = Bry_.new_ascii_("
");
+ byte[] size_bgn_bry = Bry_.new_ascii_("
");
+ Btrie_slim_mgr date_trie = Btrie_slim_mgr.cs_()
+ .Add_bry("Jan", "01").Add_bry("Feb", "02").Add_bry("Mar", "03").Add_bry("Apr", "04").Add_bry("May", "05").Add_bry("Jun", "06")
+ .Add_bry("Jul", "07").Add_bry("Aug", "08").Add_bry("Sep", "09").Add_bry("Oct", "10").Add_bry("Nov", "11").Add_bry("Dec", "12")
+ ;
+ Btrie_slim_mgr size_trie = Btrie_slim_mgr.cs_()
+ .Add_bry("B", " B").Add_bry("K", " KB").Add_bry("M", " MB").Add_bry("G", " GB");
+ byte[] date_or = Bry_.new_ascii_("1970-01-01");
+ byte[] size_or = Bry_.new_ascii_("0 B");
+ int size_end = 0; int src_len = src.length;
+ while (true) {
+ int name_bgn = Bry_finder.Move_fwd(src, name_bgn_bry, size_end, src_len); if (name_bgn == Bry_finder.Not_found) break;
+ int name_end = Bry_finder.Find_fwd(src, Byte_ascii.Quote, name_bgn, src_len);
+ byte[] name = Bry_.Mid(src, name_bgn, name_end);
+ int date_bgn = Bry_finder.Move_fwd(src, date_bgn_bry, name_end, src_len); if (date_bgn == Bry_finder.Not_found) {Gfo_usr_dlg_._.Warn_many("", "", "date_bgn not found"); break;}
+ int date_end = Bry_finder.Find_fwd(src, Byte_ascii.Lt, date_bgn, src_len);
+ byte[] date_bry = Bry_.Mid(src, date_bgn, date_end);
+ DateAdp date = DateAdp_.parse_fmt(String_.new_ascii_(Replace_or(tmp_bfr, date_trie, date_bry, 5, date_or)), "yyyy-MM-dd hh:mm:ss");
+ int size_bgn = Bry_finder.Move_fwd(src, size_bgn_bry, date_end, src_len); if (size_bgn == Bry_finder.Not_found) {Gfo_usr_dlg_._.Warn_many("", "", "size_bgn not found"); break;}
+ size_end = Bry_finder.Find_fwd(src, Byte_ascii.Lt, size_bgn, src_len);
+ byte[] size_bry = Bry_.Mid(src, size_bgn, size_end);
+ long size = Io_size_.parse_or_(String_.new_ascii_(Replace_or(tmp_bfr, size_trie, size_bry, size_bry.length - 1, size_or)), 0);
+ Wmf_latest_itm itm = new Wmf_latest_itm(name, date, size);
+ hash.Add(name, itm);
+ }
+ }
+ private static byte[] Replace_or(Bry_bfr tmp_bfr, Btrie_slim_mgr trie, byte[] src, int pos, byte[] or) {
+ int src_len = src.length;
+ Object o = trie.Match_bgn(src, pos, src_len); if (o == null) return or;
+ tmp_bfr.Add_mid(src, 0, pos);
+ tmp_bfr.Add((byte[])o);
+ tmp_bfr.Add_mid(src, trie.Match_pos(), src_len);
+ return tmp_bfr.Xto_bry_and_clear();
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser_tst.java b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser_tst.java
new file mode 100644
index 000000000..b0239029a
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/setup/maints/Wmf_latest_parser_tst.java
@@ -0,0 +1,53 @@
+/*
+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.setup.maints; import gplx.*; import gplx.xowa.*; import gplx.xowa.setup.*;
+import org.junit.*; import gplx.ios.*;
+public class Wmf_latest_parser_tst {
+ @Before public void init() {fxt.Clear();} private Wmf_latest_parser_fxt fxt = new Wmf_latest_parser_fxt();
+ @Test public void Parse() {
+ fxt.Test_parse
+ ( "
"
+ ), "selected_html", "path_enc", "name", "size", "modified"
+ );
+}
+class Xosp_fbrow_cmd__err implements Xosp_fbrow_cmd {
+ public Xosp_fbrow_cmd Make_new() {return this;}
+ public Xosp_fbrow_rslt Write_html(Xoa_url_arg_mgr arg_mgr, GfoInvkAble select_invkable) {return Rslt;}
+ private static final Xosp_fbrow_rslt Rslt = new Xosp_fbrow_rslt(Bry_.Empty, Bry_.new_utf8_("url has unknown cmd"));
+ public static final Xosp_fbrow_cmd__err I = new Xosp_fbrow_cmd__err(); Xosp_fbrow_cmd__err() {}
+}
+class Xosp_fbrow_cmd__wiki_add extends Xosp_fbrow_cmd__base {
+ @Override protected byte[] Cmd_src() {return Regy_key;}
+ @Override protected String Cmd_gui() {return "import";}
+ @Override public Xosp_fbrow_cmd Make_new() {return new Xosp_fbrow_cmd__wiki_add();}
+ @Override protected void Process_itm(Xosp_fbrow_data_sub itm) {
+ byte[] url_bry = itm.Url().RawBry();
+ if (!Bry_.HasAtEnd(url_bry, Ext_sqlite3_000)) itm.Selectable_(false);
+ }
+ @Override protected Xosp_fbrow_rslt Write_html_selected(Xoa_url_arg_mgr arg_mgr, String selected, GfoInvkAble select_invkable) {
+ String[] wikis = String_.Split(selected, ";");
+ String path_str = arg_mgr.Read_str_or_null("path");
+ Xowv_wiki wiki = (Xowv_wiki)GfoInvkAble_.InvkCmd_val(select_invkable, Xoav_wiki_mgr.Invk_import_by_fil, path_str + wikis[0]);
+ Bry_bfr bfr = Bry_bfr.reset_(255);
+ done_fmtr.Bld_bfr_many(bfr, wiki.Domain_str());
+ return new Xosp_fbrow_rslt(Bry_.Empty, bfr.Xto_bry_and_clear());
+ }
+ private static final Bry_fmtr done_fmtr = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
+ ( "~{domain} Main Page"
+ )
+ , "domain");
+ private static final byte[] Ext_sqlite3_000 = Bry_.new_ascii_(".000.sqlite3");
+ public static final byte[] Regy_key = Bry_.new_ascii_("xowa.wiki.add");
+ public static final Xosp_fbrow_cmd__wiki_add I = new Xosp_fbrow_cmd__wiki_add();
+}
+class Xosp_fbrow_cmd__root_set extends Xosp_fbrow_cmd__base {
+ @Override protected byte[] Cmd_src() {return Regy_key;}
+ @Override protected String Cmd_gui() {return "set root dir";}
+ @Override public Xosp_fbrow_cmd Make_new() {return new Xosp_fbrow_cmd__root_set();}
+ @Override protected void Process_itm(Xosp_fbrow_data_sub itm) {
+ if (itm.Url().Type_fil()) itm.Selectable_(false);
+ }
+ @Override protected Xosp_fbrow_rslt Write_html_selected(Xoa_url_arg_mgr arg_mgr, String selected, GfoInvkAble select_invkable) {
+ return new Xosp_fbrow_rslt(Bry_.Empty, Bry_.new_utf8_(selected));
+ }
+ public static final byte[] Regy_key = Bry_.new_ascii_("xowa.fsys.root_");
+ public static final Xosp_fbrow_cmd__root_set I = new Xosp_fbrow_cmd__root_set();
+}
diff --git a/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_data_dir.java b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_data_dir.java
new file mode 100644
index 000000000..4fbbecbe4
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_data_dir.java
@@ -0,0 +1,61 @@
+/*
+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.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
+import gplx.ios.*;
+class Xosp_fbrow_data_dir {
+ private final OrderedHash hash = OrderedHash_.new_();
+ public Xosp_fbrow_data_dir(Io_url url) {this.url = url;}
+ public Io_url Url() {return url;} private final Io_url url;
+ public int Count() {return hash.Count();}
+ public Xosp_fbrow_data_sub Get_at(int i) {return (Xosp_fbrow_data_sub)hash.FetchAt(i);}
+ public void Add(Xosp_fbrow_data_sub itm) {hash.Add(itm.Url().NameAndExt(), itm);}
+ public static Xosp_fbrow_data_dir new_(IoItmDir owner) {
+ Xosp_fbrow_data_dir rv = new Xosp_fbrow_data_dir(owner.Url());
+ new_subs(rv, Bool_.Y, owner.SubDirs());
+ new_subs(rv, Bool_.N, owner.SubFils());
+ return rv;
+ }
+ private static void new_subs(Xosp_fbrow_data_dir owner, boolean dir, IoItmList itms) {
+ int len = itms.Count();
+ for (int i = 0; i < len; ++i) {
+ IoItm_base src = (IoItm_base)itms.FetchAt(i);
+ Io_url src_url = src.Url();
+ if (String_.HasAtBgn(src_url.NameAndExt(), ".")) continue; // ignore hidden "." files; NameAndExt() b/c ".ext" has NameOnly of ""; EX: "/dir/.hidden"
+ Xosp_fbrow_data_sub trg = null;
+ if (dir)
+ trg = new Xosp_fbrow_data_sub(src_url, -1, null);
+ else {
+ IoItmFil fil = (IoItmFil)src;
+ trg = new Xosp_fbrow_data_sub(src_url, fil.Size(), fil.ModifiedTime());
+ }
+ owner.Add(trg);
+ }
+ }
+}
+class Xosp_fbrow_data_sub {
+ public Xosp_fbrow_data_sub(Io_url url, long size, DateAdp modified) {
+ this.url = url; this.size = size; this.modified = modified;
+ this.tid_is_dir = url.Type_dir();
+ }
+ public boolean Selectable() {return selectable;} public void Selectable_(boolean v) {selectable = v;} private boolean selectable = true;
+ public String Selectable_style() {return selectable ? "" : "none";}
+ public boolean Tid_is_dir() {return tid_is_dir;} private final boolean tid_is_dir;
+ public Io_url Url() {return url;} private final Io_url url;
+ public long Size() {return size;} private final long size;
+ public DateAdp Modified() {return modified;} private final DateAdp modified;
+}
diff --git a/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_rslt.java b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_rslt.java
new file mode 100644
index 000000000..42570406c
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_rslt.java
@@ -0,0 +1,24 @@
+/*
+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.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
+public class Xosp_fbrow_rslt {
+ public Xosp_fbrow_rslt(byte[] html_head, byte[] html_body) {this.html_head = html_head; this.html_body = html_body;}
+ public byte[] Html_head() {return html_head;} private final byte[] html_head;
+ public byte[] Html_body() {return html_body;} private final byte[] html_body;
+ public static Xosp_fbrow_rslt err_(String msg) {return new Xosp_fbrow_rslt(Bry_.Empty, Bry_.new_utf8_(msg));}
+}
diff --git a/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special.java b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special.java
new file mode 100644
index 000000000..e03841395
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special.java
@@ -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 .
+*/
+package gplx.xowa.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
+import gplx.xowa.specials.*; import gplx.ios.*;
+public class Xosp_fbrow_special implements Xows_page {
+ private static final Xoa_url_arg_mgr url_args = new Xoa_url_arg_mgr(null);
+ public void Special_gen(Xoa_url url, Xoa_page page, Xow_wiki wiki, Xoa_ttl ttl) {
+ Xosp_fbrow_rslt rslt = Gen(url.Args(), GfoInvkAble_.Null);
+ page.Html_data().Html_restricted_n_();
+ page.Html_data().Custom_head_end_concat(rslt.Html_head());
+ page.Data_raw_(rslt.Html_body());
+ }
+ public static Xosp_fbrow_rslt Gen(Gfo_url_arg[] args, GfoInvkAble select_invkable) {
+ url_args.Init(args);
+ byte[] cmd_bry = url_args.Read_bry_or_empty(Arg_cmd);
+ Xosp_fbrow_cmd cmd = (Xosp_fbrow_cmd)cmd_regy.Get_by_bry(cmd_bry); if (cmd == null) cmd = Xosp_fbrow_cmd__err.I;
+ return cmd.Make_new().Write_html(url_args, select_invkable);
+ }
+ private static final byte[] Arg_cmd = Bry_.new_ascii_("cmd");
+ private static final Hash_adp_bry cmd_regy = Hash_adp_bry.cs_()
+ .Add_bry_obj(Xosp_fbrow_cmd__wiki_add.Regy_key, Xosp_fbrow_cmd__wiki_add.I)
+ .Add_bry_obj(Xosp_fbrow_cmd__root_set.Regy_key, Xosp_fbrow_cmd__root_set.I)
+ ;
+ public static final byte[] Ttl_name_bry = Bry_.new_ascii_("XowaFileBrowser");
+}
diff --git a/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special_tst.java b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special_tst.java
new file mode 100644
index 000000000..720f0eeaf
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/specials/xowa/file_browsers/Xosp_fbrow_special_tst.java
@@ -0,0 +1,145 @@
+/*
+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.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
+import org.junit.*; import gplx.ios.*;
+public class Xosp_fbrow_special_tst {
+ @Before public void init() {fxt.Clear();} private Xosp_fbrow_special_fxt fxt = new Xosp_fbrow_special_fxt();
+ @Test public void Basic() {
+ fxt.Init_dir(fxt.Make_dir());
+ fxt.Test_nav("mem/root/dir/", String_.Concat_lines_nl_skip_last
+ ( "
"
+ ));
+ }
+}
+class Io_itm_bldr {
+ public IoItmDir Root(Io_url url, IoItm_base... subs) {
+ IoItmDir rv = IoItmDir_.top_(url);
+ Init_dir(rv, url.NameAndExt(), subs);
+ return rv;
+ }
+ public IoItmDir Dir(String name, IoItm_base... subs) {
+ IoItmDir rv = IoItmDir_.sub_(name);
+ Init_dir(rv, name, subs);
+ return rv;
+ }
+ public IoItmFil Fil(String name, int size, String date) {return IoItmFil_.sub_(name, size, DateAdp_.parse_iso8561(date));}
+ private void Init_dir(IoItmDir rv, String name, IoItm_base... subs) {
+ int len = subs.length;
+ for (int i = 0; i < len; ++i) {
+ IoItm_base sub = subs[i];
+ IoItmList sub_list = sub.Type_fil() ? rv.SubFils() : rv.SubDirs();
+ sub.OwnerDir_set(rv);
+ sub_list.Add(sub);
+ }
+ }
+}
+class Xosp_fbrow_special_fxt {
+ private Io_itm_bldr bldr = new Io_itm_bldr();
+ public void Clear() {}
+ public IoItmDir Make_dir() {
+ return bldr.Root(Io_url_.mem_dir_("mem/root/dir/")
+ , bldr.Dir("a"
+ , bldr.Fil("a1.txt", 11, "2011-01-01")
+ , bldr.Fil("a2.txt", 12, "2011-01-02")
+ , bldr.Fil("a3.txt", 13, "2011-01-03")
+ )
+ , bldr.Dir("b"
+ , bldr.Fil("b1.txt", 21, "2011-02-01")
+ , bldr.Fil("b2.txt", 22, "2011-02-02")
+ , bldr.Fil("b3.txt", 23, "2011-02-03")
+ )
+ , bldr.Fil("1.txt", 1, "2001-01-01")
+ , bldr.Fil("2.txt", 2, "2004-01-02")
+ , bldr.Fil("3.000.sqlite3", 3, "2004-01-03")
+ );
+ }
+ public void Init_dir(IoItmDir dir) {
+ IoItmDir_.Make(dir);
+ }
+ public void Test_nav(String path, String expd) {
+ Xoa_url_arg_mgr args_mgr = new Xoa_url_arg_mgr(null);
+ Xoa_url url = Xoa_url.new_(Bry_.Empty, Bry_.Empty).Args_(Gfo_url_arg.Ary("cmd", "xowa.wiki.add", "mode", "view", "path", path));
+ args_mgr.Init(url.Args());
+ Xosp_fbrow_cmd__wiki_add cmd = new Xosp_fbrow_cmd__wiki_add();
+ byte[] actl = cmd.Write_html(args_mgr, GfoInvkAble_.Null).Html_body();
+ Tfds.Eq_str_lines(expd, String_.new_utf8_(actl));
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/specials/xowa/system_data/System_data_page.java b/400_xowa/src/gplx/xowa/specials/xowa/system_data/System_data_page.java
index 8706aeb47..e3a2bed2e 100644
--- a/400_xowa/src/gplx/xowa/specials/xowa/system_data/System_data_page.java
+++ b/400_xowa/src/gplx/xowa/specials/xowa/system_data/System_data_page.java
@@ -44,7 +44,6 @@ public class System_data_page implements Xows_page {
private static final byte[] Arg_type = Bry_.new_ascii_("type");
private static final byte Type_log_session = 1, Type_cfg_app = 2, Type_cfg_lang = 3, Type_cfg_user = 4, Type_cfg_custom = 5, Type_usr_history = 6;
-
private static final Hash_adp_bry type_hash = Hash_adp_bry.cs_()
.Add_str_byte("log_session" , Type_log_session)
.Add_str_byte("cfg_app" , Type_cfg_app)
diff --git a/400_xowa/src/gplx/xowa/users/Xou_user.java b/400_xowa/src/gplx/xowa/users/Xou_user.java
index aa21e1e0a..4d26991b8 100644
--- a/400_xowa/src/gplx/xowa/users/Xou_user.java
+++ b/400_xowa/src/gplx/xowa/users/Xou_user.java
@@ -17,6 +17,7 @@ along with this program. If not, see .
*/
package gplx.xowa.users; import gplx.*; import gplx.xowa.*;
import gplx.xowa.wikis.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.users.dbs.*; import gplx.xowa.users.history.*; import gplx.xowa.xtns.scribunto.*;
+import gplx.xowa.users.data.*;
public class Xou_user implements GfoEvMgrOwner, GfoInvkAble {
public Xou_user(Xoa_app app, Io_url user_dir) {
this.evMgr = GfoEvMgr.new_(this);
@@ -33,6 +34,7 @@ public class Xou_user implements GfoEvMgrOwner, GfoInvkAble {
public byte[] Key_bry() {return key_bry;} private byte[] key_bry;
public void Key_str_(String v) {this.key_str = v; this.key_bry = Bry_.new_utf8_(v);}
public GfoEvMgr EvMgr() {return evMgr;} private final GfoEvMgr evMgr;
+ public Xoud_data_mgr Data_mgr() {return data_mgr;} private Xoud_data_mgr data_mgr = new Xoud_data_mgr();
public Xol_lang Lang() {if (lang == null) {lang = app.Lang_mgr().Get_by_key_or_new(app.Sys_cfg().Lang()); lang.Init_by_load();} return lang;} private Xol_lang lang;
public void Lang_(Xol_lang v) {
lang = v;
@@ -58,6 +60,7 @@ public class Xou_user implements GfoEvMgrOwner, GfoInvkAble {
if (!Env_.Mode_testing()) {
db_mgr.App_init();
this.Available_from_fsys();
+ // data_mgr.Init_by_app(app);
}
}
public void App_term() {
diff --git a/400_xowa/src/gplx/xowa/users/Xou_user_.java b/400_xowa/src/gplx/xowa/users/Xou_user_.java
index 3db99a8e3..58a71fde0 100644
--- a/400_xowa/src/gplx/xowa/users/Xou_user_.java
+++ b/400_xowa/src/gplx/xowa/users/Xou_user_.java
@@ -37,17 +37,17 @@ class Xou_user_ {
home_wiki.Db_mgr().Save_mgr().Data_create(Xoa_ttl.parse_(home_wiki, Bry_.new_ascii_("Data:Bookmarks")), Bry_.new_ascii_(Bookmarks_text));
}
public static final String User_system_cfg_text = String_.Concat_lines_nl
- ( "app.scripts.txns.get('user.prefs.general').version_('" + Xoa_app_.Version + "').bgn();"
- , "app.files.download.enabled_('n');"
- , "app.files.math.enabled_('y');"
- , "app.files.math.renderer_('mathjax');"
- , "app.scripts.txns.get('user.prefs.general').end();\n"
- );
+ ( "app.scripts.txns.get('user.prefs.general').version_('" + Xoa_app_.Version + "').bgn();"
+ , "app.files.download.enabled_('y');" // default to true; DATE:2015-01-05
+ , "app.files.math.enabled_('y');"
+ , "app.files.math.renderer_('mathjax');"
+ , "app.scripts.txns.get('user.prefs.general').end();\n"
+ );
public static final String Bookmarks_text = String_.Concat_lines_nl
- ( "Bookmarks are added automatically to the bottom of the page. All other text is not modified."
- , ""
- , "Please delete bookmarks by editing this page."
- );
+ ( "Bookmarks are added automatically to the bottom of the page. All other text is not modified."
+ , ""
+ , "Please delete bookmarks by editing this page."
+ );
private static Xow_ns_mgr ns_home_(Xol_case_mgr case_mgr) {
Xow_ns_mgr rv = new Xow_ns_mgr(case_mgr);
rv = rv.Add_new(-2, "Media").Add_new(-1, "Special").Add_new(0, "").Add_new(1, "Talk").Add_new(2, "User").Add_new(3, "User talk").Add_new(4, "Wikipedia").Add_new(5, "Wikipedia talk")
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_row.java b/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_row.java
new file mode 100644
index 000000000..f5fc02e10
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_row.java
@@ -0,0 +1,31 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+public class Xoud_bmk_row {
+ public Xoud_bmk_row(int bmk_id, int bmk_sort, String bmk_wiki, String bmk_page, String bmk_qarg, String bmk_wtxt, DateAdp bmk_time, int bmk_count) {
+ this.bmk_id = bmk_id; this.bmk_sort = bmk_sort; this.bmk_wiki = bmk_wiki; this.bmk_page = bmk_page; this.bmk_qarg = bmk_qarg; this.bmk_wtxt = bmk_wtxt; this.bmk_time = bmk_time; this.bmk_count = bmk_count;
+ }
+ public int Bmk_id() {return bmk_id;} private final int bmk_id;
+ public int Bmk_sort() {return bmk_sort;} private final int bmk_sort;
+ public String Bmk_wiki() {return bmk_wiki;} private final String bmk_wiki;
+ public String Bmk_page() {return bmk_page;} private final String bmk_page;
+ public String Bmk_qarg() {return bmk_qarg;} private final String bmk_qarg;
+ public String Bmk_wtxt() {return bmk_wtxt;} private final String bmk_wtxt;
+ public DateAdp Bmk_time() {return bmk_time;} private final DateAdp bmk_time;
+ public int Bmk_count() {return bmk_count;} private final int bmk_count;
+}
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_tbl.java b/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_tbl.java
new file mode 100644
index 000000000..9f52589af
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_bmk_tbl.java
@@ -0,0 +1,80 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+import gplx.dbs.*;
+public class Xoud_bmk_tbl {
+ private Db_stmt stmt_select, stmt_insert, stmt_delete;
+ public Db_conn Conn() {return conn;} public Xoud_bmk_tbl Conn_(Db_conn v) {this.Rls_all(); conn = v; return this;} private Db_conn conn;
+ @gplx.Virtual public void Insert(int sort, String wiki, String page, String qarg, String wtxt, DateAdp time, int count) {
+ if (stmt_insert == null) stmt_insert = Db_stmt_.new_insert_(conn, Tbl_name, Flds__all);
+ try {
+ stmt_insert.Clear().Val_int(sort).Val_str(wiki).Val_str(page).Val_str(qarg).Val_str(wtxt).Val_str(time.XtoStr_fmt_iso_8561()).Val_int(count).Exec_insert();
+ }
+ catch (Exception exc) {stmt_insert = null; throw Err_.err_(exc, "stmt failed");} // must reset stmt, else next call will fail
+ }
+ @gplx.Virtual public void Delete(int id) {
+ if (stmt_delete == null) stmt_delete = Db_stmt_.new_delete_(conn, Tbl_name, Fld_bmk_id);
+ try {stmt_delete.Clear().Val_int(id).Exec_delete();}
+ catch (Exception exc) {stmt_delete = null; throw Err_.err_(exc, "stmt failed");} // must reset stmt, else next call will fail
+ }
+ @gplx.Virtual public void Select_all(ListAdp rv) {
+ if (stmt_select == null) stmt_select = Db_stmt_.new_select_as_rdr(conn, Db_qry__select_in_tbl.new_(Tbl_name, null, Flds__all));
+ try {
+ Db_rdr rdr = stmt_select.Clear().Exec_select_as_rdr();
+ while (rdr.Move_next()) {
+ Xoud_bmk_row row = Make_row(rdr);
+ rv.Add(row);
+ }
+ rdr.Rls();
+ }
+ catch (Exception exc) {stmt_select = null; throw Err_.err_(exc, "stmt failed");} // must reset stmt, else next call will fail
+ }
+ private Xoud_bmk_row Make_row(Db_rdr rdr) {
+ return new Xoud_bmk_row
+ ( rdr.Read_int(0)
+ , rdr.Read_int(1)
+ , rdr.Read_str(2)
+ , rdr.Read_str(3)
+ , rdr.Read_str(4)
+ , rdr.Read_str(5)
+ , rdr.Read_date_by_str(6)
+ , rdr.Read_int(7)
+ );
+ }
+ public void Rls_all() {
+ if (stmt_select != null) {stmt_select.Rls(); stmt_select = null;}
+ if (stmt_insert != null) {stmt_insert.Rls(); stmt_insert = null;}
+ if (stmt_delete != null) {stmt_delete.Rls(); stmt_delete = null;}
+ conn = null;
+ }
+ public static final String Tbl_name = "cfg_bmk", Fld_bmk_id = "bmk_id", Fld_bmk_count = "bmk_count", Fld_bmk_sort = "bmk_sort"
+ , Fld_bmk_time = "bmk_time", Fld_bmk_wiki = "bmk_wiki", Fld_bmk_page = "bmk_page", Fld_bmk_qarg = "bmk_qarg", Fld_bmk_wtxt = "bmk_wtxt";
+ public static final String[] Flds__all = new String[] {Fld_bmk_id, Fld_bmk_sort, Fld_bmk_wiki, Fld_bmk_page, Fld_bmk_qarg, Fld_bmk_wtxt, Fld_bmk_time, Fld_bmk_count};
+ public static final String Tbl_sql = String_.Concat_lines_nl
+ ( "CREATE TABLE cfg_bmk"
+ , "( bmk_id integer NOT NULL PRIMARY KEY AUTOINCREMENT"
+ , ", bmk_sort integer NOT NULL"
+ , ", bmk_wiki nvarchar(255) NOT NULL"
+ , ", bmk_page nvarchar(255) NOT NULL"
+ , ", bmk_qarg nvarchar(255) NOT NULL"
+ , ", bmk_wtxt nvarchar(255) NOT NULL"
+ , ", bmk_time nvarchar(20) NOT NULL"
+ , ", bmk_count integer NOT NULL"
+ , ");"
+ );
+}
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_data_mgr.java b/400_xowa/src/gplx/xowa/users/data/Xoud_data_mgr.java
new file mode 100644
index 000000000..274734eaa
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_data_mgr.java
@@ -0,0 +1,39 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+import gplx.threads.*; import gplx.dbs.*; import gplx.dbs.schemas.updates.*; import gplx.dbs.schemas.*;
+import gplx.xowa2.users.data.*;
+public class Xoud_data_mgr {
+ private Gfdb_db_base user_db = new Gfdb_db_base();
+ public Xoud_regy_mgr Regy_mgr() {return regy_mgr;} private final Xoud_regy_mgr regy_mgr = new Xoud_regy_mgr();
+ public Xoud_history_mgr History_mgr() {return history_mgr;} private final Xoud_history_mgr history_mgr = new Xoud_history_mgr();
+ public Xoud_site_mgr Site_mgr() {return site_mgr;} private final Xoud_site_mgr site_mgr = new Xoud_site_mgr();
+ public void Init_by_boot(Db_conn user_db_provider) {
+ user_db.Schema().Loader_(Schema_loader_mgr_.Sqlite);
+ Init_user_db_changes(user_db.Schema().Updater());
+ user_db.Init(user_db_provider);
+ regy_mgr.Init(user_db_provider);
+ site_mgr.Init(user_db_provider);
+ history_mgr.History_tbl().Conn_(user_db_provider);
+ }
+ private void Init_user_db_changes(Schema_update_mgr updater) {
+ updater.Add(Schema_update_cmd_.Make_tbl_create(Xoud_regy_tbl.Tbl_name , Xoud_regy_tbl.Tbl_sql , Xoud_regy_tbl.Idx_core));
+ updater.Add(Schema_update_cmd_.Make_tbl_create(Xoud_history_tbl.Tbl_name, Xoud_history_tbl.Tbl_sql , Xoud_history_tbl.Idx_core));
+ updater.Add(Schema_update_cmd_.Make_tbl_create(Xoud_site_tbl.Tbl_name , Xoud_site_tbl.Tbl_sql));
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_history_mgr.java b/400_xowa/src/gplx/xowa/users/data/Xoud_history_mgr.java
new file mode 100644
index 000000000..1c636f532
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_history_mgr.java
@@ -0,0 +1,52 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+import gplx.threads.*;
+public class Xoud_history_mgr implements GfoInvkAble {
+ public Xoud_history_tbl History_tbl() {return history_tbl;} private final Xoud_history_tbl history_tbl = new Xoud_history_tbl();
+ public void Update_async(Gfo_async_mgr async_mgr, Xoa_ttl ttl, Xoa_url url) {
+// if (Skip_history(ttl)) return;
+// async_mgr.Queue(this, Invk_update, "wiki", String_.new_utf8_(url.Wiki_bry()), "page", String_.new_utf8_(url.Page_bry()), "qarg", String_.new_utf8_(url.Args_all_as_bry()));
+ }
+ private void Update(String wiki, String page, String qarg) {
+ Xoud_history_row row = history_tbl.Select_by_page(wiki, page, qarg);
+ DateAdp time = DateAdp_.Now();
+ if (row == null)
+ history_tbl.Insert(wiki, page, qarg, time, 1);
+ else
+ history_tbl.Update(wiki, page, qarg, time, row.History_count() + 1);
+ }
+ public void Select(ListAdp rv, int top) {
+ history_tbl.Select_by_top(rv, top);
+ }
+ public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
+ if (ctx.Match(k, Invk_update)) Update(m.ReadStr("wiki"), m.ReadStr("page"), m.ReadStr("qarg"));
+ else return GfoInvkAble_.Rv_unhandled;
+ return this;
+ } private static final String Invk_update = "update";
+ public static boolean Skip_history(Xoa_ttl ttl) {
+ byte[] page_db = ttl.Page_db();
+ return ( ttl.Ns().Id_special()
+ && ( Bry_.Eq(page_db, gplx.xowa.users.history.Xou_history_mgr.Ttl_name) // do not add XowaPageHistory to history
+ || Bry_.Eq(page_db, gplx.xowa.specials.xowa.popup_history.Popup_history_page.Ttl_name_bry)
+ || Bry_.Eq(page_db, gplx.xowa.specials.xowa.default_tab.Default_tab_page.Ttl_name_bry)
+ || Bry_.Eq(page_db, Xoud_history_special.Ttl_name)
+ )
+ );
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_history_row.java b/400_xowa/src/gplx/xowa/users/data/Xoud_history_row.java
new file mode 100644
index 000000000..7835c2b41
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_history_row.java
@@ -0,0 +1,32 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+public class Xoud_history_row {
+ public Xoud_history_row(String history_wiki, String history_page, String history_qarg, DateAdp history_time, int history_count) {
+ this.history_wiki = history_wiki;
+ this.history_page = history_page;
+ this.history_qarg = history_qarg;
+ this.history_time = history_time;
+ this.history_count = history_count;
+ }
+ public String History_wiki() {return history_wiki;} private final String history_wiki;
+ public String History_page() {return history_page;} private final String history_page;
+ public String History_qarg() {return history_qarg;} private final String history_qarg;
+ public DateAdp History_time() {return history_time;} private final DateAdp history_time;
+ public int History_count() {return history_count;} private final int history_count;
+}
diff --git a/400_xowa/src/gplx/xowa/users/data/Xoud_history_special.java b/400_xowa/src/gplx/xowa/users/data/Xoud_history_special.java
new file mode 100644
index 000000000..3120b26b6
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/users/data/Xoud_history_special.java
@@ -0,0 +1,59 @@
+/*
+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.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
+import gplx.xowa.specials.*;
+public class Xoud_history_special implements Bry_fmtr_arg, Xows_page {
+ private ListAdp rows = ListAdp_.new_();
+ public void Special_gen(Xoa_url calling_url, Xoa_page page, Xow_wiki wiki, Xoa_ttl ttl) {
+ Xoa_app app = wiki.App();
+ Xoud_history_mgr mgr = app.User().Data_mgr().History_mgr();
+ mgr.Select(rows, 100);
+ Bry_bfr bfr = app.Utl_bry_bfr_mkr().Get_m001();
+ html_grp.Bld_bfr_many(bfr, this);
+ page.Data_raw_(bfr.Mkr_rls().Xto_bry_and_clear());
+ }
+ public void XferAry(Bry_bfr bfr, int idx) {
+ int len = rows.Count();
+ for (int i = 0; i < len; i++) {
+ Xoud_history_row row = (Xoud_history_row)rows.FetchAt(i);
+ html_itm.Bld_bfr_many(bfr, row.History_wiki(), row.History_page(), row.History_count(), row.History_time().XtoStr_fmt_yyyy_MM_dd_HH_mm());
+ }
+ }
+ private static Bry_fmtr html_grp = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
+ ( "