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

'v3.6.4.1'

This commit is contained in:
gnosygnu
2016-06-26 01:10:38 -04:00
parent 8afc115176
commit b3c2d3bb5f
108 changed files with 1813 additions and 873 deletions

View File

@@ -33,25 +33,6 @@ public class Load_page_wkr implements Gfo_thread_wkr {
// wait_for_popups; free mem check;
this.page = wiki.Page_mgr().Load_page(url, ttl, tab);
// DELETE:v3.6.4
// Xoa_app_.Usr_dlg().Log_many("", "", "page.load: url=~{0}", url.To_str());
// Wait_for_popups();
// Xowe_wiki_.Rls_mem_if_needed(wiki);
//
// // load page meta; wait_for_popups
// this.page = wiki.Data_mgr().Load_page_and_parse(url, ttl, wiki.Lang(), tab, false);
// boolean hdump_exists = page.Revision_data().Html_db_id() != -1 && wiki.Appe().Api_root().Wiki().Hdump().Read_preferred();
// page.Html_data().Hdump_exists_(hdump_exists);
// Wait_for_popups();
//
// // load page text
// boolean parse = true;
// if (hdump_exists) {
// wiki.Html__hdump_mgr().Load_mgr().Load_by_edit(page);
// parse = Bry_.Len_eq_0(page.Hdump_data().Body()); // NOTE: need to check if actually empty
// }
// if (parse)
// wiki.Parser_mgr().Parse(page, false);
// launch thread to show page
Gfo_invk_.Invk_by_val(tab.Cmd_sync(), Xog_tab_itm.Invk_show_url_loaded_swt, this);
@@ -64,12 +45,6 @@ public class Load_page_wkr implements Gfo_thread_wkr {
Running_(false);
}
}
// DELETE:v3.6.4
// private static void Wait_for_popups() {// HACK: wait for popups to finish, else thread errors due to popups and loader mutating cached items
// int wait_count = 0;
// while (gplx.xowa.htmls.modules.popups.Xow_popup_mgr.Running() && ++wait_count < 100)
// Thread_adp_.Sleep(10);
// }
private static final Object thread_lock = new Object(); private static boolean running = false;
public static boolean Running() {
boolean rv = false;

View File

@@ -220,62 +220,6 @@ public class Xog_tab_itm implements Gfo_invk {
wkr.Wiki().Appe().Thread_mgr_old().Page_load_mgr().Resume();
}
}
// DELETE:v3.6.4
// public void Async() {
// if (page == null) return; // TEST: occurs during Xog_win_mgr_tst
// Xowe_wiki wiki = page.Wikie(); Xoae_app app = wiki.Appe(); Xog_win_itm win_itm = tab_mgr.Win(); Gfo_usr_dlg usr_dlg = win_itm.Usr_dlg();
// app.Usr_dlg().Log_many("", "", "page.async: url=~{0}", page.Url().To_str());
// if (page.Url().Anch_str() != null) html_itm.Scroll_page_by_id_gui(page.Url().Anch_str());
// if (usr_dlg.Canceled()) {usr_dlg.Prog_none("", "", ""); app.Log_wtr().Queue_enabled_(false); return;}
// int xfer_len = 0;
// xfer_len = page.File_queue().Count();
// String page_ttl_str = String_.new_u8(page.Ttl().Raw());
// if (xfer_len > 0){
// usr_dlg.Prog_one("", "", "downloading images: ~{0}", xfer_len);
// try {
// page.File_queue().Exec(wiki, page);
// if (page.Html_data().Xtn_gallery_packed_exists()) // packed_gallery exists; fire js once; PAGE:en.w:National_Sculpture_Museum_(Valladolid); DATE:2014-07-21
// html_itm.Html_gallery_packed_exec();
// if ( page.Html_data().Xtn_imap_exists() // imap exists; DATE:2014-08-07
// && page.Html_data().Head_mgr().Itm__popups().Enabled()
// )
// html_itm.Html_popups_bind_hover_to_doc(); // rebind all elements to popup
// }
// catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.image: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_full(e));}
// }
// xfer_len = page.File_math().Count();
// if (xfer_len > 0){
// try {
// usr_dlg.Prog_one("", "", "generating math: ~{0}", xfer_len);
// for (int i = 0; i < xfer_len; i++) {
// if (usr_dlg.Canceled()) {usr_dlg.Prog_none("", "", ""); app.Log_wtr().Queue_enabled_(false); return;}
// gplx.xowa.xtns.math.Xof_math_itm itm = (gplx.xowa.xtns.math.Xof_math_itm)page.File_math().Get_at(i);
// String queue_msg = usr_dlg.Prog_many("", "", "generating math ~{0} of ~{1}: ~{2}", i + List_adp_.Base1, xfer_len, String_.new_u8(itm.Math()));
// app.File_mgr().Math_mgr().MakePng(itm.Math(), itm.Hash(), itm.Png_url(), queue_msg);
// gplx.gfui.SizeAdp size = app.File_mgr().Img_mgr().Wkr_query_img_size().Exec(itm.Png_url());
// html_itm.Html_img_update("xowa_math_img_" + itm.Id(), itm.Png_url().To_http_file_str(), size.Width(), size.Height());
// html_itm.Html_elem_delete("xowa_math_txt_" + itm.Id());
// }
// page.File_math().Clear();
// }
// catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.math: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_full(e));}
// }
// if (page.Html_cmd_mgr().Count() > 0) {
// try {page.Html_cmd_mgr().Exec(app, page);}
// catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.cmds: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_full(e));}
// }
// try {
// if (page.Tab_data().Tab() != null) { // needed b/c Preview has page.Tab of null which causes null_ref error in redlinks
// Xopg_redlink_mgr redlinks_wkr = new Xopg_redlink_mgr(page, html_itm);
// Thread_adp_.Start_by_key(gplx.xowa.apps.Xoa_thread_.Key_page_redlink, redlinks_wkr, gplx.xowa.wikis.pages.lnkis.Xopg_redlink_mgr.Invk_run);
// usr_dlg.Prog_none("", "imgs.done", "");
// }
// } catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.redlinks: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_full(e));}
// try {app.File_mgr().Cache_mgr().Compress_check();}
// catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.cache: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_full(e));}
// app.Usere().User_db_mgr().Cache_mgr().Page_end(app.Wiki_mgr());
// app.Log_wtr().Queue_enabled_(false);
// }
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_show_url_loaded_swt)) this.Show_url_loaded((Load_page_wkr)m.ReadObj("v"));
else if (ctx.Match(k, Invk_show_url_failed_swt)) this.Show_url_failed((Load_page_wkr)m.ReadObj("v"));
@@ -291,7 +235,6 @@ class Load_files_wkr implements Gfo_thread_wkr {
public boolean Thread__resume() {return true;}
public void Thread__exec() {
try {Xog_async_wkr.Async(tab);}
// try {tab.Async();} // DELETE:v3.6.4
catch (Exception e) {
tab.Tab_mgr().Win().App().Usr_dlg().Warn_many("error while running file wkr; page=~{0} err=~{1}", tab.Page().Url().To_str(), Err_.Message_gplx_full(e));
}

View File

@@ -68,7 +68,6 @@ public class Xog_win_itm implements Gfo_invk, Gfo_evt_itm {
else if (ctx.Match(k, Gfui_html.Evt_win_resized)) Refresh_win_size();
else if (ctx.Match(k, Invk_page_refresh)) Page__refresh();
else if (ctx.Match(k, Invk_page_async_exec)) Xog_async_wkr.Async(((Xog_tab_itm)m.ReadObj("v")));
// else if (ctx.Match(k, Invk_page_async_exec)) ((Xog_tab_itm)m.ReadObj("v")).Async(); // DELETE:v3.6.4
else if (ctx.Match(k, Invk_page_view_read)) Page__mode_(Xopg_page_.Tid_read);
else if (ctx.Match(k, Invk_page_view_edit)) Page__mode_(Xopg_page_.Tid_edit);
else if (ctx.Match(k, Invk_page_view_html)) Page__mode_(Xopg_page_.Tid_html);