Kartographer: Hide markup from mapframe / maplink tags

v3.3.4
gnosygnu 8 years ago
parent 3971182fff
commit 55ea1fa39a

@ -353,6 +353,8 @@ public class Xoh_html_wtr {
case Xop_xnde_tag_.Tid__random_selection:
case Xop_xnde_tag_.Tid__tabber:
case Xop_xnde_tag_.Tid__tabview:
case Xop_xnde_tag_.Tid__mapframe:
case Xop_xnde_tag_.Tid__maplink:
Xox_xnde xtn = xnde.Xnde_xtn();
xtn.Xtn_write(bfr, app, ctx, this, hctx, page, xnde, src);
break;

@ -72,6 +72,8 @@ public class Xop_tkn_mkr {
public gplx.xowa.xtns.imaps.Imap_xnde Xnde__imageMap() {return new gplx.xowa.xtns.imaps.Imap_xnde();}
public gplx.xowa.xtns.hieros.Hiero_xnde Xnde__hiero() {return new gplx.xowa.xtns.hieros.Hiero_xnde();}
public gplx.xowa.xtns.graphs.Graph_xnde Xnde__graph() {return new gplx.xowa.xtns.graphs.Graph_xnde();}
public gplx.xowa.xtns.kartographers.Mapframe_xnde Xnde__mapframe() {return new gplx.xowa.xtns.kartographers.Mapframe_xnde();}
public gplx.xowa.xtns.kartographers.Maplink_xnde Xnde__maplink() {return new gplx.xowa.xtns.kartographers.Maplink_xnde();}
public gplx.xowa.xtns.proofreadPage.Pp_pages_nde Xnde__pages() {return new gplx.xowa.xtns.proofreadPage.Pp_pages_nde();}
public gplx.xowa.xtns.proofreadPage.Pp_pagelist_nde Xnde__pagelist() {return new gplx.xowa.xtns.proofreadPage.Pp_pagelist_nde();}
public gplx.xowa.xtns.proofreadPage.Pp_pagequality_nde Xnde__pagequality() {return new gplx.xowa.xtns.proofreadPage.Pp_pagequality_nde();}

@ -72,5 +72,7 @@ public class Xop_log_basic_wkr implements Gfo_invk {
, Tid_hiero = 5
, Tid_math = 6
, Tid_graph = 7
, Tid_mapframe = 8
, Tid_maplink = 9
;
}

@ -143,8 +143,10 @@ public class Xop_xnde_tag_ {
, Tid__tabber = 116
, Tid__tabview = 117
, Tid__xowa_wiki_setup = 118
, Tid__mapframe = 119
, Tid__maplink = 120
;
public static final int Tid__len = 119;
public static final int Tid__len = 121;
public static final Xop_xnde_tag[] Ary = new Xop_xnde_tag[Tid__len];
private static Xop_xnde_tag New(int id, String name) {
Xop_xnde_tag rv = new Xop_xnde_tag(id, name);
@ -271,5 +273,7 @@ public class Xop_xnde_tag_ {
, Tag__tabber = New(Tid__tabber, "tabber").Xtn_mw_()
, Tag__tabview = New(Tid__tabview, "tabview").Xtn_mw_()
, Tag__xowa_wiki_setup = New(Tid__xowa_wiki_setup, "xowa_Wiki_setup").Xtn_()
, Tag__mapframe = New(Tid__mapframe, "mapframe").Xtn_mw_()
, Tag__maplink = New(Tid__maplink, "maplink").Xtn_mw_()
;
}

@ -648,6 +648,8 @@ public class Xop_xnde_wkr implements Xop_ctx_wkr {
case Xop_xnde_tag_.Tid__xowa_html: xnde_xtn = tkn_mkr.Xnde__xowa_html(); break;
case Xop_xnde_tag_.Tid__xowa_wiki_setup: xnde_xtn = tkn_mkr.Xnde__xowa_wiki_setup(); break;
case Xop_xnde_tag_.Tid__graph: xnde_xtn = tkn_mkr.Xnde__graph(); break;
case Xop_xnde_tag_.Tid__mapframe: xnde_xtn = tkn_mkr.Xnde__mapframe(); break;
case Xop_xnde_tag_.Tid__maplink: xnde_xtn = tkn_mkr.Xnde__maplink(); break;
case Xop_xnde_tag_.Tid__random_selection: xnde_xtn = tkn_mkr.Xnde__random_selection(); break;
case Xop_xnde_tag_.Tid__tabber: xnde_xtn = tkn_mkr.Xnde__tabber(); break;
case Xop_xnde_tag_.Tid__tabview: xnde_xtn = tkn_mkr.Xnde__tabview(); break;

@ -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 <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.kartographers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.logs.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*;
public class Mapframe_xnde implements Xox_xnde {
public void Xatr__set(Xowe_wiki wiki, byte[] src, Mwh_atr_itm xatr, Object xatr_id_obj) {}
public void Xtn_parse(Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
ctx.Para().Process_block__xnde(xnde.Tag(), Xop_xnde_tag.Block_bgn);
boolean log_wkr_enabled = Log_wkr != Xop_log_basic_wkr.Null; if (log_wkr_enabled) Log_wkr.Log_end_xnde(ctx.Page(), Xop_log_basic_wkr.Tid_mapframe, src, xnde);
ctx.Para().Process_block__xnde(xnde.Tag(), Xop_xnde_tag.Block_end);
}
public void Xtn_write(Bry_bfr bfr, Xoae_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xoae_page wpg, Xop_xnde_tkn xnde, byte[] src) {
}
public static Xop_log_basic_wkr Log_wkr = Xop_log_basic_wkr.Null;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.kartographers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import org.junit.*;
public class Mapframe_xnde__tst {
private final Xop_fxt fxt = new Xop_fxt();
@Test public void Basic() {
fxt.Test__parse__tmpl_to_html(String_.Concat_lines_nl_skip_last
( "<mapframe latitude='42.68' longitude='-114.79' zoom='3'>"
, "{ 'type':'Feature'"
, ", 'geometry': {}"
, "</mapframe>"
), ""
);
}
}

@ -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 <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.kartographers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.logs.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*;
public class Maplink_xnde implements Xox_xnde {
public void Xatr__set(Xowe_wiki wiki, byte[] src, Mwh_atr_itm xatr, Object xatr_id_obj) {}
public void Xtn_parse(Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
ctx.Para().Process_block__xnde(xnde.Tag(), Xop_xnde_tag.Block_bgn);
boolean log_wkr_enabled = Log_wkr != Xop_log_basic_wkr.Null; if (log_wkr_enabled) Log_wkr.Log_end_xnde(ctx.Page(), Xop_log_basic_wkr.Tid_maplink, src, xnde);
ctx.Para().Process_block__xnde(xnde.Tag(), Xop_xnde_tag.Block_end);
}
public void Xtn_write(Bry_bfr bfr, Xoae_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xoae_page wpg, Xop_xnde_tkn xnde, byte[] src) {
}
public static Xop_log_basic_wkr Log_wkr = Xop_log_basic_wkr.Null;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.kartographers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import org.junit.*;
public class Maplink_xnde__tst {
private final Xop_fxt fxt = new Xop_fxt();
@Test public void Basic() {
fxt.Test__parse__tmpl_to_html(String_.Concat_lines_nl_skip_last
( "<maplink zoom=9 latitude=37.8013 longitude=-122.3988>"
, "{ 'type':'Feature'"
, ", 'geometry': {}"
, "</maplink>"
), ""
);
}
}
Loading…
Cancel
Save