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

'v3.7.3.1'

This commit is contained in:
gnosygnu
2016-07-17 21:10:59 -04:00
parent b333db45f8
commit 7a851a41a5
290 changed files with 3048 additions and 2124 deletions

View File

@@ -92,15 +92,20 @@ public class Xou_history_mgr implements Gfo_invk {
Io_mgr.Instance.SaveFilBry(app.Usere().Fsys_mgr().App_data_history_fil(), ary);
}
public Ordered_hash Archive(Xoae_app app) {
// sort all itms; other init
itms.Sort_by(sorter);
int itms_len = itms.Count();
Ordered_hash current_itms = Ordered_hash_.New_bry();
Ordered_hash archive_itms = Ordered_hash_.New_bry();
// iterate over all itms
int itms_len = itms.Count();
for (int i = 0; i < itms_len; i++) {
Xou_history_itm itm = (Xou_history_itm)itms.Get_at(i);
Ordered_hash itms_hash = (i < current_itms_reset) ? current_itms : archive_itms;
itms_hash.Add(itm.Key(), itm);
Xou_history_itm itm = (Xou_history_itm)itms.Get_at(i);
Ordered_hash itms_hash = (i < current_itms_reset) ? current_itms : archive_itms; // if < cutoff, add to current file; else add to archive
itms_hash.Add_if_dupe_use_nth(itm.Key(), itm); // NOTE: dupes should not exist, but if they do, ignore it; else app won't close on first time; DATE:2016-07-14
}
// save archive
byte[] ary = Xou_history_itm_srl.Save(archive_itms);
Io_url url = app.Usere().Fsys_mgr().App_data_history_fil().GenNewNameOnly(DateAdp_.Now().XtoStr_fmt_yyyyMMdd_HHmmss_fff());
Io_mgr.Instance.SaveFilBry(url, ary);

View File

@@ -105,7 +105,7 @@ public class Prefs_mgr implements Gfo_invk {
private byte[] Parse_wikitext_to_html(byte[] src) {
Xowe_wiki wiki = app.Usere().Wiki(); // NOTE: this limits prefs to home_wiki only
Xop_root_tkn root = new Xop_root_tkn();
Xop_ctx ctx = Xop_ctx.new_main_page(wiki); // NOTE: always create new ctx; do not reuse existing, else popup will clear out existing page's prefs; DATE:2015-04-29
Xop_ctx ctx = Xop_ctx.New__top(wiki); // NOTE: always create new ctx; do not reuse existing, else popup will clear out existing page's prefs; DATE:2015-04-29
wiki.Parser_mgr().Main().Parse_text_to_wdom(root, ctx, ctx.Tkn_mkr(), src, 0);
return root.Data_mid();
}