mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.7.4.1
This commit is contained in:
@@ -77,7 +77,8 @@ public class Xog_html_js_cbk implements GfoInvkAble {
|
||||
try {
|
||||
int popups_id = Int_.Xby_double_(Double_.cast_(m.Args_getAt(0).Val()));
|
||||
byte[] href_bry = m.Args_getAt(1).Val_to_bry();
|
||||
return html_itm.Owner_tab().Page().Wiki().Html_mgr().Module_mgr().Popup_mgr().Show_init(href_bry, popups_id);
|
||||
byte[] tooltip_bry = m.Args_getAt(2).Val_to_bry();
|
||||
return html_itm.Owner_tab().Page().Wiki().Html_mgr().Module_mgr().Popup_mgr().Show_init(popups_id, href_bry, tooltip_bry);
|
||||
} catch (Exception e) {Err_.Noop(e); return null;}
|
||||
}
|
||||
private String[] Get_title_meta(Xow_wiki wiki, byte[] ttl_bry) {
|
||||
|
||||
@@ -33,13 +33,12 @@ class Xog_launcher_tabs {
|
||||
app.Gui_wtr().Log_wtr().Log_msg_to_session_direct(log_bfr.Xto_str());
|
||||
}
|
||||
private boolean Restore_tabs(Xoa_app app, Xow_wiki home_wiki, Xog_win_itm win, Io_fil_marker fil_marker) {
|
||||
Xog_tab_itm tab = win.Active_tab();
|
||||
String[] launch_urls = app.Api_root().App().Startup().Tabs().Calc_startup_strs();
|
||||
String[] launch_urls = app.Api_root().App().Startup().Tabs().Calc_startup_strs(app);
|
||||
try {
|
||||
int launch_urls_len = launch_urls.length;
|
||||
for (int i = 0; i < launch_urls_len; ++i) {
|
||||
String launch_url = launch_urls[i];
|
||||
tab = i == 0 ? win.Active_tab() : win.Tab_mgr().Tabs_new_init();
|
||||
Xog_tab_itm tab = win.Tab_mgr().Tabs_new_init();
|
||||
Launch_tab(tab, win, home_wiki, launch_url);
|
||||
}
|
||||
fil_marker.End();
|
||||
@@ -55,18 +54,11 @@ class Xog_launcher_tabs {
|
||||
Launch_tab(win.Active_tab(), win, home_wiki, gplx.xowa.users.Xouc_pages_mgr.Page_xowa);
|
||||
}
|
||||
private void Launch_tab(Xog_tab_itm tab, Xog_win_itm win, Xow_wiki home_wiki, String launch_str) {
|
||||
Xoa_page launch_page = Launch_page(win, home_wiki, launch_str);
|
||||
if (launch_page.Missing()) return;
|
||||
Xog_tab_itm_read_mgr.Show_page(tab, launch_page, false);
|
||||
tab.History_mgr().Add(launch_page);
|
||||
}
|
||||
private Xoa_page Launch_page(Xog_win_itm win, Xow_wiki home_wiki, String launch_str) {
|
||||
Xoa_url launch_url = Xoa_url_parser.Parse_from_url_bar(win.App(), home_wiki, launch_str);
|
||||
Xow_wiki launch_wiki = launch_url.Wiki();
|
||||
Xoa_ttl launch_ttl = Xoa_ttl.parse_(launch_wiki, launch_url.Page_bry());
|
||||
Xoa_page rv = launch_wiki.GetPageByTtl(launch_url, launch_ttl).Url_(launch_url); // FUTURE: .Url_() should not be called (needed for anchor); EX: en.wikipedia.org/Earth#Biosphere
|
||||
win.Active_page_(rv); // set to blank page
|
||||
return rv;
|
||||
tab.Page_(Xoa_page.new_(launch_wiki, launch_ttl)); // WORKAROUND: set the tab to an empty page, else null ref later; DATE:2014-07-23
|
||||
tab.Show_url_bgn(launch_url);
|
||||
}
|
||||
public static final Xog_launcher_tabs _ = new Xog_launcher_tabs(); Xog_launcher_tabs() {}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,11 @@ public class Xog_tab_itm implements GfoInvkAble {
|
||||
String page_ttl_str = String_.new_utf8_(page.Ttl().Raw());
|
||||
if (xfer_len > 0){
|
||||
usr_dlg.Prog_one("", "", "downloading images: ~{0}", xfer_len);
|
||||
try {page.File_queue().Exec(gplx.xowa.files.Xof_exec_tid.Tid_wiki_page, usr_dlg, wiki, page);}
|
||||
try {
|
||||
page.File_queue().Exec(gplx.xowa.files.Xof_exec_tid.Tid_wiki_page, usr_dlg, wiki, page);
|
||||
if (page.Html_data().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();
|
||||
}
|
||||
catch (Exception e) {usr_dlg.Warn_many("", "", "page.thread.image: page=~{0} err=~{1}", page_ttl_str, Err_.Message_gplx_brief(e));}
|
||||
}
|
||||
xfer_len = page.File_math().Count();
|
||||
|
||||
@@ -33,11 +33,9 @@ public class Xog_tab_itm_read_mgr {
|
||||
win.Usr_dlg().Prog_none("", "", "locating images");
|
||||
try {tab.Html_itm().Show(new_page);}
|
||||
catch (Exception e) {
|
||||
if (String_.Eq(Err_.Message_lang(e), "class org.eclipse.swt.SWTException Widget is disposed")) return; // ignore errors caused by user closing tab early; DATE:2014-07-26
|
||||
if (show_is_err) { // trying to show error page, but failed; don't show again, else recursion until out of memory; TODO:always load error page; no reason it should fail; WHEN:html_skin; DATE:2014-06-08
|
||||
String new_page_url = new_page.Url().Xto_full_str_safe();
|
||||
String err_msg = "fatal error trying to load error page; page=" + new_page_url;
|
||||
app.Usr_dlg().Warn_many("", "", err_msg);
|
||||
app.Gui_mgr().Kit().Ask_ok("", "", err_msg);
|
||||
app.Usr_dlg().Warn_many("", "", "fatal error trying to load error page; page=~{0} err=~{1}" + new_page.Url().Xto_full_str_safe(), Err_.Message_gplx(e));
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user