mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.3.1
This commit is contained in:
@@ -16,6 +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.htmls.portal; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.xwikis.*;
|
||||
import gplx.xowa.files.xfers.*;
|
||||
public class Xoa_available_wikis_mgr implements GfoInvkAble {
|
||||
|
||||
@@ -16,9 +16,10 @@ 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.htmls.portal; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.htmls.hrefs.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
public class Xoh_subpages_bldr implements Bry_fmtr_arg {
|
||||
public class Xoh_subpages_bldr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Bry_bfr tmp_bfr = Bry_bfr.reset_(255), ttl_bfr = Bry_bfr.reset_(255);
|
||||
private byte[][] segs;
|
||||
public byte[] Bld(Xow_ns_mgr ns_mgr, Xoa_ttl ttl) {
|
||||
@@ -33,7 +34,7 @@ public class Xoh_subpages_bldr implements Bry_fmtr_arg {
|
||||
fmtr_grp.Bld_bfr(tmp_bfr, this);
|
||||
return tmp_bfr.To_bry_and_clear();
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int segs_len = segs.length - 1; // last seg is current page; do not print
|
||||
for (int i = 0; i < segs_len; ++i) {
|
||||
byte[] dlm = null;
|
||||
|
||||
@@ -16,6 +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.htmls.portal; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import gplx.core.brys.*; import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*;
|
||||
import gplx.xowa.guis.*; import gplx.xowa.htmls.sidebar.*; import gplx.xowa.wikis.pages.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
@@ -73,7 +74,7 @@ public class Xow_portal_mgr implements GfoInvkAble {
|
||||
talk_cls = Xow_portal_mgr.Cls_selected_y;
|
||||
else
|
||||
subj_cls = Xow_portal_mgr.Cls_selected_y;
|
||||
Bry_fmtr_arg vnt_menu = null;
|
||||
Bfr_arg vnt_menu = null;
|
||||
Xol_vnt_mgr vnt_mgr = wiki.Lang().Vnt_mgr(); // VNT; DATE:2015-03-03
|
||||
if (vnt_mgr.Enabled()) {
|
||||
vnt_menu_fmtr.Init(vnt_mgr.Regy(), wiki.Domain_bry(), ttl.Full_db(), vnt_mgr.Cur_itm().Key());
|
||||
|
||||
@@ -16,15 +16,16 @@ 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.htmls.portal.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.portal.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.xowa.langs.vnts.*;
|
||||
public class Vnt_mnu_grp_fmtr implements Bry_fmtr_arg {
|
||||
public class Vnt_mnu_grp_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
private final Xolg_vnt_itm_fmtr itm_fmtr = new Xolg_vnt_itm_fmtr();
|
||||
private Xol_vnt_regy mgr; private byte[] page_vnt;
|
||||
public void Init(Xol_vnt_regy mgr, byte[] wiki_domain, byte[] page_href, byte[] page_vnt) {
|
||||
this.mgr = mgr; this.page_vnt = page_vnt;
|
||||
itm_fmtr.Init(mgr, wiki_domain, page_href, page_vnt);
|
||||
}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
Xol_vnt_itm mnu_itm = mgr.Get_by(page_vnt);
|
||||
fmtr.Bld_bfr_many(bfr, mnu_itm == null ? Bry_.Empty : mnu_itm.Name(), itm_fmtr);
|
||||
}
|
||||
@@ -40,10 +41,10 @@ public class Vnt_mnu_grp_fmtr implements Bry_fmtr_arg {
|
||||
), "grp_text", "itms"
|
||||
);
|
||||
}
|
||||
class Xolg_vnt_itm_fmtr implements Bry_fmtr_arg {
|
||||
class Xolg_vnt_itm_fmtr extends gplx.core.brys.Bfr_arg_base {
|
||||
private Xol_vnt_regy mgr; private byte[] wiki_domain, page_href, page_vnt;
|
||||
public void Init(Xol_vnt_regy mgr, byte[] wiki_domain, byte[] page_href, byte[] page_vnt) {this.mgr = mgr; this.wiki_domain = wiki_domain; this.page_href = page_href; this.page_vnt = page_vnt;}
|
||||
public void Fmt__do(Bry_bfr bfr) {
|
||||
@Override public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
int len = mgr.Len();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Xol_vnt_itm itm = mgr.Get_at(i); if (!itm.Visible()) continue;
|
||||
|
||||
@@ -61,7 +61,7 @@ class Vnt_mnu_grp_fmtr_fxt {
|
||||
Vnt_mnu_grp_fmtr vnt_grp_fmtr = new Vnt_mnu_grp_fmtr();
|
||||
Bry_bfr bfr = Bry_bfr.new_();
|
||||
vnt_grp_fmtr.Init(mgr, Bry_.new_u8(page_href), Bry_.new_a7("zh.wikipedia.org"), Bry_.new_u8(selected_vnt));
|
||||
vnt_grp_fmtr.Fmt__do(bfr);
|
||||
vnt_grp_fmtr.Bfr_arg__add(bfr);
|
||||
Tfds.Eq_str_lines(expd, bfr.To_str_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user