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

'v3.6.3.1'

This commit is contained in:
gnosygnu
2016-06-19 23:58:10 -04:00
parent 96636f3161
commit d4e8590345
1960 changed files with 20790 additions and 9272 deletions

View File

@@ -16,18 +16,18 @@ 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.specials.allPages; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.core.brys.fmtrs.*;
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.core.net.qargs.*; import gplx.core.brys.fmtrs.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.apps.urls.*;
public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, GfoInvkAble, Xows_page {
public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, Gfo_invk, Xow_special_page {
public Xows_page_allpages(Xowe_wiki wiki) {
this.wiki = wiki;
html_itm_fmtr = new Xos_pagelist_html_itm_fmtr(this, wiki);
} private Xos_pagelist_html_itm_fmtr html_itm_fmtr;
public Xows_special_meta Special__meta() {return Xows_special_meta_.Itm__all_pages;}
public Xow_special_meta Special__meta() {return Xow_special_meta_.Itm__all_pages;}
public Xowe_wiki Wiki() {return wiki;} private Xowe_wiki wiki;
public Bry_fmtr Html_all() {return html_all;} Bry_fmtr html_all = Bry_fmtr.new_(String_.Concat_lines_nl
( "<table class=\"mw-allpages-table-form\">"
@@ -81,7 +81,7 @@ public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, GfoInvkAble,
boolean found = Build_data(url, ttl); if (!found) return;
Build_html(page);
}
private static byte[] Get_from(Gfo_qarg_mgr arg_hash, Xowe_wiki wiki, Xoa_url url, Xoa_ttl ttl) {
private static byte[] Get_from(Gfo_qarg_mgr_old arg_hash, Xowe_wiki wiki, Xoa_url url, Xoa_ttl ttl) {
return ttl.Leaf_bgn() == -1
? arg_hash.Get_val_bry_or(Bry_arg_from, null)
: ttl.Leaf_url()
@@ -105,11 +105,11 @@ public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, GfoInvkAble,
arg_hash.Set_val_by_bry(Bry_arg_from, from_ttl.Page_db());
url.Qargs_ary_(arg_hash.To_ary());
}
Int_obj_ref rslt_len = Int_obj_ref.new_(rslt_list_len);
Int_obj_ref rslt_len = Int_obj_ref.New(rslt_list_len);
Xowd_page_itm rslt_nxt2 = new Xowd_page_itm();
Xowd_page_itm rslt_prv2 = new Xowd_page_itm();
int all_pages_min = 0;// no minimum for all pages
List_adp rslt_list = List_adp_.new_();
List_adp rslt_list = List_adp_.New();
wiki.Db_mgr().Load_mgr().Load_ttls_for_all_pages(Cancelable_.Never, rslt_list, rslt_nxt2, rslt_prv2, rslt_len, init_ns, from_ttl.Page_db(), itms_per_page, all_pages_min, itms_per_page, !hide_redirects_val, true);
rslt_list_len = rslt_len.Val();
for (int i = 0; i < rslt_list_len; i++)
@@ -117,7 +117,7 @@ public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, GfoInvkAble,
rslt_nxt = rslt_nxt2;
rslt_prv = rslt_prv2;
return true;
} private Gfo_qarg_mgr arg_hash = new Gfo_qarg_mgr();
} private Gfo_qarg_mgr_old arg_hash = new Gfo_qarg_mgr_old();
private static final byte[] Bry_arg_from = Bry_.new_a7("from"), Bry_arg_ns = Bry_.new_a7("namespace"), Bry_arg_hideredirects = Bry_.new_a7("hideredirects");
public Xow_ns Init_ns() {return init_ns;} private Xow_ns init_ns;
public void Build_html(Xoae_page page) {
@@ -161,14 +161,14 @@ public class Xows_page_allpages implements gplx.core.brys.Bfr_arg, GfoInvkAble,
else if (ctx.Match(k, Invk_itms_per_page_)) Itms_per_page_(m.ReadInt("v"));
else if (ctx.Match(k, Invk_itms_per_grp_)) itms_per_grp = m.ReadInt("v");
else if (ctx.Match(k, Invk_show_redirects_)) show_redirects = m.ReadYn("v");
else return GfoInvkAble_.Rv_unhandled;
else return Gfo_invk_.Rv_unhandled;
return this;
}
public static final String Invk_html_all_ = "html_all_", Invk_html_list_grp_ = "html_list_grp_", Invk_html_list_itm_normal_ = "html_list_itm_normal_", Invk_html_list_itm_redirect_ = "html_list_itm_redirect_"
, Invk_itms_per_page_ = "itms_per_page_", Invk_itms_per_grp_ = "itms_per_grp_", Invk_show_redirects_ = "show_redirects_";
public static final String GRP_KEY = "xowa.special.allpages";
public Xows_page Special__clone() {return this;}
public Xow_special_page Special__clone() {return this;}
}
class Xos_pagelist_html_itm_fmtr implements gplx.core.brys.Bfr_arg {
public Xos_pagelist_html_itm_fmtr(Xows_page_allpages mgr, Xowe_wiki wiki) {

View File

@@ -16,7 +16,7 @@ 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.specials.allPages; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.core.net.*; import gplx.xowa.wikis.data.tbls.*;
import org.junit.*; import gplx.core.net.*; import gplx.core.net.qargs.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.wikis.tdbs.hives.*;
public class Xows_page_allpages_tst {
@@ -127,7 +127,7 @@ class Xows_page_allpages_fxt {
app = Xoa_app_fxt.Make__app__edit();
wiki = Xoa_app_fxt.Make__wiki__edit(app);
allpages = wiki.Special_mgr().Page_allpages();
GfoInvkAble_.InvkCmd_val(allpages, Xows_page_allpages.Invk_itms_per_page_, 5);
Gfo_invk_.Invk_by_val(allpages, Xows_page_allpages.Invk_itms_per_page_, 5);
}
init_ttl_leaf = "";
expd_prv = expd_nxt = null;
@@ -136,10 +136,10 @@ class Xows_page_allpages_fxt {
return this;
} private Xoae_app app;
public Xowe_wiki Wiki() {return wiki;} private Xowe_wiki wiki; Xows_page_allpages allpages;
public Xows_page_allpages_fxt Init_arg(String key, String val) {init_args.Add(new Gfo_qarg_itm(Bry_.new_a7(key), Bry_.new_a7(val))); return this;} private List_adp init_args = List_adp_.new_();
public Xows_page_allpages_fxt Init_arg(String key, String val) {init_args.Add(new Gfo_qarg_itm(Bry_.new_a7(key), Bry_.new_a7(val))); return this;} private List_adp init_args = List_adp_.New();
public Xows_page_allpages_fxt Init_ttl_leaf(String val) {init_ttl_leaf = val; return this;} private String init_ttl_leaf;
public Xows_page_allpages_fxt Init_itms_per_page(int v) {init_itms_per_page = v; return this;} private int init_itms_per_page = 5;
public Xows_page_allpages_fxt Expd_arg(String key, String val) {expd_args.Add(new Gfo_qarg_itm(Bry_.new_a7(key), Bry_.new_a7(val))); return this;} private List_adp expd_args = List_adp_.new_();
public Xows_page_allpages_fxt Expd_arg(String key, String val) {expd_args.Add(new Gfo_qarg_itm(Bry_.new_a7(key), Bry_.new_a7(val))); return this;} private List_adp expd_args = List_adp_.New();
public Xows_page_allpages_fxt Expd_prv(String v) {expd_prv = v; return this;} private String expd_prv;
public Xows_page_allpages_fxt Expd_nxt(String v) {expd_nxt = v; return this;} private String expd_nxt;
public Xows_page_allpages_fxt Expd_ttls(String... v) {expd_ttls = v; return this;} private String[] expd_ttls;
@@ -171,7 +171,7 @@ class Xows_page_allpages_fxt {
return rv;
}
public Xows_page_allpages_fxt Test_special_gen() {
init_url = app.User().Wikii().Utl__url_parser().Parse(Xows_special_meta_.Itm__all_pages.Ttl_bry());
init_url = app.User().Wikii().Utl__url_parser().Parse(Xow_special_meta_.Itm__all_pages.Ttl_bry());
Xoa_ttl init_ttl = Make_init_ttl();
allpages.Special__gen(wiki, wiki.Parser_mgr().Ctx().Page(), init_url, init_ttl);
if (expd_display_ttl != null) Tfds.Eq(expd_display_ttl, String_.new_u8(wiki.Parser_mgr().Ctx().Page().Html_data().Display_ttl()));
@@ -202,5 +202,5 @@ class Xows_page_allpages_fxt {
Xoa_ttl init_ttl = Make_init_ttl();
allpages.Build_data(init_url, init_ttl);
}
private Xoa_ttl Make_init_ttl() {return Xoa_ttl.parse(wiki, Bry_.new_u8(Xows_special_meta_.Itm__all_pages.Ttl_str() + init_ttl_leaf));}
private Xoa_ttl Make_init_ttl() {return Xoa_ttl.parse(wiki, Bry_.new_u8(Xow_special_meta_.Itm__all_pages.Ttl_str() + init_ttl_leaf));}
}