mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.4.3.1'
This commit is contained in:
@@ -60,20 +60,6 @@ public class Xopg_html_data {
|
||||
public byte[] Custom_html() {return custom_html;} public Xopg_html_data Custom_html_(byte[] v) {custom_html = v; return this;} private byte[] custom_html;
|
||||
public byte[] Custom_body() {return custom_body;} public Xopg_html_data Custom_body_(byte[] v) {custom_body = v; return this;} private byte[] custom_body;
|
||||
public byte[] Custom_tab_name() {return custom_tab_name;} public Xopg_html_data Custom_tab_name_(byte[] v) {custom_tab_name = v; return this;} private byte[] custom_tab_name;
|
||||
public byte[] Custom_head_end() {return custom_head_end;}
|
||||
public byte[] Custom_html_end() {return custom_html_end;}
|
||||
public void Custom_head_end_concat(byte[] v) {
|
||||
if (v == null)
|
||||
custom_head_end = v;
|
||||
else
|
||||
custom_head_end = Bry_.Add(custom_head_end, v);
|
||||
} private byte[] custom_head_end;
|
||||
public void Custom_html_end_concat(byte[] v) {
|
||||
if (v == null)
|
||||
custom_html_end = v;
|
||||
else
|
||||
custom_html_end = Bry_.Add(custom_html_end, v);
|
||||
} private byte[] custom_html_end;
|
||||
public void Clear() {
|
||||
html_restricted = true;
|
||||
display_ttl = content_sub = display_ttl_vnt = null;
|
||||
@@ -88,7 +74,7 @@ public class Xopg_html_data {
|
||||
xtn_scribunto_dbg = Bry_.Empty;
|
||||
xtn_pgbnr = null;
|
||||
module_mgr.Clear();
|
||||
custom_html = custom_html_end = custom_head_end = custom_tab_name = null;
|
||||
custom_html = custom_tab_name = null;
|
||||
if (ctg_hash != null) ctg_hash.Clear();
|
||||
indicators.Clear();
|
||||
this.mode_wtxt_shown = false;
|
||||
|
||||
@@ -19,15 +19,15 @@ package gplx.xowa.wikis.pages; import gplx.*; import gplx.xowa.*; import gplx.xo
|
||||
import gplx.core.brys.*; import gplx.core.brys.fmtrs.*;
|
||||
public class Xopg_page_heading implements Bfr_arg {
|
||||
private Xopg_html_data html_data;
|
||||
private Xoa_ttl page_ttl;
|
||||
public Xopg_page_heading Init(Xoae_page page) {
|
||||
this.html_data = page.Html_data();
|
||||
this.page_ttl = page.Ttl();
|
||||
private byte[] display_title;
|
||||
public Xopg_page_heading Init(Xopg_html_data html_data, byte[] display_title) {
|
||||
this.html_data = html_data;
|
||||
this.display_title = display_title;
|
||||
return this;
|
||||
}
|
||||
public void Bfr_arg__add(Bry_bfr bfr) {
|
||||
if (html_data.Xtn_pgbnr() != null) return; // pgbnr exists; don't add title
|
||||
fmtr.Bld_many(bfr, page_ttl.Page_txt());
|
||||
fmtr.Bld_many(bfr, display_title);
|
||||
}
|
||||
private final Bry_fmt fmtr = Bry_fmt.New(Bry_.New_u8_nl_apos("<h1 id='firstHeading' class='firstHeading'><span>~{page_title}</span></h1>"), "page_title");
|
||||
private final Bry_fmt fmtr = Bry_fmt.New(Bry_.New_u8_nl_apos("<h1 id='firstHeading' class='firstHeading'><span>~{page_title}</span></h1>"), "page_title");
|
||||
}
|
||||
|
||||
@@ -16,18 +16,19 @@ 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.wikis.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
|
||||
import gplx.langs.htmls.*;
|
||||
public class Xopg_tag_itm {
|
||||
public Xopg_tag_itm(String name, String text, Keyval... atrs_ary) {
|
||||
public Xopg_tag_itm(byte[] name, byte[] text, Keyval... atrs_ary) {
|
||||
this.Name = name;
|
||||
this.Text = text;
|
||||
this.Atrs_ary = atrs_ary;
|
||||
}
|
||||
public final String Name;
|
||||
public final String Text;
|
||||
public final byte[] Name;
|
||||
public final byte[] Text;
|
||||
public final Keyval[] Atrs_ary;
|
||||
public void To_html(Bry_bfr bfr) {
|
||||
bfr.Add_byte(Byte_ascii.Angle_bgn);
|
||||
bfr.Add_str_a7(Name);
|
||||
bfr.Add(Name);
|
||||
int len = Atrs_ary.length;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
bfr.Add_byte_space();
|
||||
@@ -39,20 +40,27 @@ public class Xopg_tag_itm {
|
||||
bfr.Add_byte(Byte_ascii.Quote);
|
||||
}
|
||||
bfr.Add_byte(Byte_ascii.Angle_end);
|
||||
if (String_.Eq(Name, "link")) return;
|
||||
if (Text != null) bfr.Add_str_u8(Text);
|
||||
if (Bry_.Eq(Name, Gfh_tag_.Bry__link)) return;
|
||||
if (Text != null) {
|
||||
bfr.Add_byte_nl();
|
||||
bfr.Add(Text);
|
||||
bfr.Add_byte_nl();
|
||||
}
|
||||
bfr.Add_byte(Byte_ascii.Angle_bgn).Add_byte(Byte_ascii.Slash);
|
||||
bfr.Add_str_a7(Name);
|
||||
bfr.Add(Name);
|
||||
bfr.Add_byte(Byte_ascii.Angle_end);
|
||||
}
|
||||
|
||||
public static Xopg_tag_itm New_css(Io_url href) {
|
||||
return new Xopg_tag_itm("link" , null, Keyval_.new_("type", "text/css"), Keyval_.new_("rel", "stylesheet"), Keyval_.new_("href", href.To_http_file_str()));
|
||||
public static Xopg_tag_itm New_css_file(Io_url href) {
|
||||
return new Xopg_tag_itm(Gfh_tag_.Bry__link , null, Keyval_.new_("type", "text/css"), Keyval_.new_("rel", "stylesheet"), Keyval_.new_("href", href.To_http_file_str()));
|
||||
}
|
||||
public static Xopg_tag_itm New_script_file(Io_url src) {
|
||||
return new Xopg_tag_itm("script", null, Keyval_.new_("type", "text/javascript"), Keyval_.new_("src", src.To_http_file_str()));
|
||||
public static Xopg_tag_itm New_css_code(byte[] code) {
|
||||
return new Xopg_tag_itm(Gfh_tag_.Bry__style , code, Keyval_.new_("type", "text/css"));
|
||||
}
|
||||
public static Xopg_tag_itm New_script_code(String code) {
|
||||
return new Xopg_tag_itm("script", code, Keyval_.new_("type", "text/javascript"));
|
||||
public static Xopg_tag_itm New_js_file(Io_url src) {
|
||||
return new Xopg_tag_itm(Gfh_tag_.Bry__script , null, Keyval_.new_("type", "text/javascript"), Keyval_.new_("src", src.To_http_file_str()));
|
||||
}
|
||||
public static Xopg_tag_itm New_js_code(byte[] code) {
|
||||
return new Xopg_tag_itm(Gfh_tag_.Bry__script , code, Keyval_.new_("type", "text/javascript"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,17 @@ public class Xopg_tag_mgr {
|
||||
}
|
||||
return bfr.To_bry_and_clear();
|
||||
}
|
||||
public byte[] To_html__style(Bry_bfr bfr) {
|
||||
int len = this.Len();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Xopg_tag_itm tag = this.Get_at(i);
|
||||
if ( Bry_.Eq(tag.Name, gplx.langs.htmls.Gfh_tag_.Bry__style)
|
||||
&& tag.Text != null
|
||||
) {
|
||||
tag.To_html(bfr);
|
||||
bfr.Add_byte_nl();
|
||||
}
|
||||
}
|
||||
return bfr.To_bry_and_clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user