1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Html: Change message from 'was last modified' to 'was last edited' [#321]

This commit is contained in:
gnosygnu 2019-01-10 23:12:09 -05:00
parent 85478ad7e7
commit 8cd39534a6
2 changed files with 13 additions and 3 deletions

View File

@ -22,6 +22,7 @@ import gplx.xowa.xtns.pagebanners.*;
import gplx.xowa.apps.gfs.*; import gplx.xowa.htmls.portal.*;
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.*;
import gplx.xowa.htmls.core.*;
import gplx.xowa.xtns.pfuncs.times.*;
public class Xoh_page_wtr_wkr {
private final Object thread_lock_1 = new Object(), thread_lock_2 = new Object();
private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(255);
@ -78,8 +79,15 @@ public class Xoh_page_wtr_wkr {
if (root_dir_bry == null) this.root_dir_bry = app.Fsys_mgr().Root_dir().To_http_file_bry();
Xoa_ttl page_ttl = page.Ttl(); int page_ns_id = page_ttl.Ns().Id();
byte page_tid = Xow_page_tid.Identify(wiki.Domain_tid(), page_ns_id, page_ttl.Page_db());
// write modified_on; handle invalid dates
DateAdp modified_on = page.Db().Page().Modified_on();
byte[] modified_on_msg = wiki.Msg_mgr().Val_by_id_args(Xol_msg_itm_.Id_portal_lastmodified, modified_on.XtoStr_fmt_yyyy_MM_dd(), modified_on.XtoStr_fmt_HHmm());
byte[] modified_on_msg = Bry_.Empty;
if (modified_on != DateAdp_.MinValue) {
wiki.Parser_mgr().Date_fmt_bldr().Format(tmp_bfr, wiki, wiki.Lang(), modified_on, Pft_func_formatdate.Fmt_dmy);
modified_on_msg = wiki.Msg_mgr().Val_by_key_args(Key_lastmodifiedat, tmp_bfr.To_bry_and_clear(), modified_on.XtoStr_fmt_HHmm());
}
byte[] page_body_class = Xoh_page_body_cls.Calc(tmp_bfr, page_ttl, page_tid);
// byte[] html_content_editable = wiki.Gui_mgr().Cfg_browser().Content_editable() ? Content_editable_bry : Bry_.Empty;
byte[] html_content_editable = Bry_.Empty;
@ -243,5 +251,6 @@ public class Xoh_page_wtr_wkr {
if (data_raw_len > 0) // do not add nl if empty String
bfr.Add_byte_nl(); // per MW:EditPage.php: "Ensure there's a newline at the end, otherwise adding lines is awkward."
}
// private static final byte[] Content_editable_bry = Bry_.new_a7(" contenteditable=\"true\"");
private static final byte[] Key_lastmodifiedat = Bry_.new_a7("lastmodifiedat");
}

View File

@ -41,8 +41,9 @@ public class Pft_func_formatdate extends Pf_func_base {
ctx.Wiki().Parser_mgr().Date_fmt_bldr().Format(bfr, ctx.Wiki(), ctx.Lang(), date, (Pft_fmt_itm[])o);
}
private static final Pft_fmt_itm[] Fmt_itms_default = new Pft_fmt_itm[0];
public static final Pft_fmt_itm[] Fmt_dmy = new Pft_fmt_itm[] {Pft_fmt_itm_.Day_int, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Year_len4};
private static final Btrie_fast_mgr trie = Btrie_fast_mgr.cs()
.Add("dmy" , new Pft_fmt_itm[] {Pft_fmt_itm_.Day_int, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Year_len4})
.Add("dmy" , Fmt_dmy)
.Add("mdy" , new Pft_fmt_itm[] {Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Day_int, Pft_fmt_itm_.Byte_comma, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Year_len4})
.Add("ymd" , new Pft_fmt_itm[] {Pft_fmt_itm_.Year_len4, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Day_int})
.Add("ISO 8601" , new Pft_fmt_itm[] {Pft_fmt_itm_.Year_len4, Pft_fmt_itm_.Byte_dash, Pft_fmt_itm_.Month_int_len2, Pft_fmt_itm_.Byte_dash, Pft_fmt_itm_.Day_int_len2})