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

'v3.6.3.4'

This commit is contained in:
gnosygnu
2016-06-22 15:55:05 -04:00
parent 04af0accdb
commit 8afc115176
27 changed files with 535 additions and 519 deletions

View File

@@ -32,24 +32,26 @@ public class Load_page_wkr implements Gfo_thread_wkr {
Running_(true);
// wait_for_popups; free mem check;
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);
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);
@@ -62,11 +64,12 @@ public class Load_page_wkr implements Gfo_thread_wkr {
Running_(false);
}
}
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);
}
// 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

@@ -113,7 +113,7 @@ public class Xog_html_itm implements Xog_js_wkr, Gfo_invk, Gfo_evt_itm {
Gfo_invk_.Invk_by_msg(cmd_sync, Invk_html_elem_atr_set, m);
}
}
public void Html_redlink(String html_uid) {Html_doc_atr_append_or_set(html_uid, "class", gplx.xowa.htmls.core.wkrs.lnkis.htmls.Xoh_redlink_utl.New_str);}
public void Html_redlink(String html_uid) {Html_doc_atr_append_or_set(html_uid, "class", gplx.xowa.wikis.pages.lnkis.Xoh_redlink_utl.New_str);}
private void Html_doc_atr_append_or_set(String elem_id, String atr_key, String atr_val) {
GfoMsg m = GfoMsg_.new_cast_(Invk_html_doc_atr_append_or_set).Add("elem_id", elem_id).Add("atr_key", atr_key).Add("atr_val", atr_val);
Gfo_invk_.Invk_by_msg(cmd_sync, Invk_html_doc_atr_append_or_set, m);

View File

@@ -220,6 +220,7 @@ 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();
@@ -290,7 +291,7 @@ 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();}
// 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,7 @@ 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();
// 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);