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

v2.12.1.1

This commit is contained in:
gnosygnu
2015-12-06 23:12:52 -05:00
parent 097e6c7f80
commit 9509363f46
337 changed files with 3473 additions and 1917 deletions

View File

@@ -81,7 +81,7 @@ public class Xoa_gui_mgr implements GfoEvObj, GfoInvkAble {
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_kit)) return kit;
else if (ctx.Match(k, Invk_kit_)) this.kit = Gfui_kit_.Get_by_key(m.ReadStrOr("v", Gfui_kit_.Swt().Key()));
else if (ctx.Match(k, Invk_run)) Run(RlsAble_.Null);
else if (ctx.Match(k, Invk_run)) Run(Rls_able_.Null);
else if (ctx.Match(k, Invk_browser_type)) kit.Cfg_set("HtmlBox", "BrowserType", gplx.gfui.Swt_kit.Cfg_Html_BrowserType_parse(m.ReadStr("v")));
else if (ctx.Match(k, Invk_xul_runner_path_)) kit.Cfg_set("HtmlBox", "XulRunnerPath", Bry_fmtr_eval_mgr_.Eval_url(app.Url_cmd_eval(), m.ReadBry("v")).Xto_api());
else if (ctx.Match(k, Invk_bnds)) return bnd_mgr;
@@ -94,7 +94,7 @@ public class Xoa_gui_mgr implements GfoEvObj, GfoInvkAble {
else if (ctx.Match(k, Invk_menus)) return menu_mgr;
else if (ctx.Match(k, Invk_cmds)) return cmd_mgr;
else if (ctx.Match(k, Invk_url_macros)) return url_macro_mgr;
else if (ctx.Match(k, Xoue_user.Evt_lang_changed)) Lang_changed((Xol_lang_itm)m.ReadObj("v", ParseAble_.Null));
else if (ctx.Match(k, Xoue_user.Evt_lang_changed)) Lang_changed((Xol_lang_itm)m.ReadObj("v", null));
else throw Err_.new_unhandled(k);
return this;
}
@@ -103,7 +103,7 @@ public class Xoa_gui_mgr implements GfoEvObj, GfoInvkAble {
, Invk_main_win = "main_win", Invk_browser_win = "browser_win", Invk_bnds = "bnds"
, Invk_bindings = "bindings", Invk_win_opts = "win_opts", Invk_layout = "layout", Invk_html = "html"
, Invk_search_suggest = "search_suggest", Invk_menus = "menus", Invk_cmds = "cmds", Invk_url_macros = "url_macros";
public void Run(RlsAble splash_win) {
public void Run(Rls_able splash_win) {
Gfo_log_bfr log_bfr = app.Log_bfr();
try {
Xoa_gui_mgr ui_mgr = app.Gui_mgr();

View File

@@ -72,7 +72,7 @@ class Xog_history_stack_fxt {
public Xog_history_stack_fxt Exec_add_one(String ttl_str, String arg_str) {
byte[] ttl_bry = Bry_.new_u8(ttl_str);
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry);
Xoae_page page = Xoae_page.test_(wiki, ttl);
Xoae_page page = Xoae_page.New_test(wiki, ttl);
byte[] url_bry = ttl_bry;
if (arg_str != null) url_bry = Bry_.Add(url_bry, Bry_.new_u8(arg_str));
Xoa_url url = app.User().Wikii().Utl__url_parser().Parse(url_bry);

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.guis.urls; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*;
import gplx.core.net.*; import gplx.core.envs.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*;
import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.doms.*;
import gplx.langs.htmls.encoders.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.doms.*;
import gplx.xowa.guis.views.*;
public class Xog_url_wkr {
private final Xoa_url tmp_url = Xoa_url.blank();
@@ -60,12 +60,16 @@ public class Xog_url_wkr {
}
private Xoa_url Exec_url_file(Xoae_app app, Xowe_wiki cur_wiki, Xoae_page page, Xog_win_itm win, byte[] href_bry) { // EX: file:///xowa/A.png
Xowe_wiki wiki = (Xowe_wiki)page.Commons_mgr().Source_wiki_or(cur_wiki);
Io_url href_url = Io_url_.http_any_(String_.new_u8(gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Decode(href_bry)), Op_sys.Cur().Tid_is_wnt());
Io_url href_url = Io_url_.http_any_(String_.new_u8(Gfo_url_encoder_.Http_url.Decode(href_bry)), Op_sys.Cur().Tid_is_wnt());
gplx.gfui.Gfui_html html_box = win.Active_html_box();
byte[] href_bry_encoded = Gfo_url_encoder_.Fsys_lnx.Encode(href_bry); // encode to href_bry; note must encode to same href_bry as Xof_url_bldr, which uses Gfo_url_encoder_.Fsys_lnx; PAGE:en.w:File:Volc<6C>n_Chimborazo,_"El_Taita_Chimborazo".jpg DATE:2015-12-06
String xowa_ttl = wiki.Gui_mgr().Cfg_browser().Content_editable()
? html_box.Html_js_eval_proc_as_str(Xog_js_procs.Selection__get_active_for_editable_mode, gplx.xowa.htmls.Xoh_consts.Atr_xowa_title_str, null)
: Xoh_dom_.Title_by_href(href_bry, Bry_.new_u8(html_box.Html_js_eval_proc_as_str(Xog_js_procs.Doc__root_html_get)));
if (xowa_ttl == null) {app.Gui_mgr().Kit().Ask_ok("", "", "could not find find anchor with href in html: href=~{0}", href_bry); return Rslt_handled;}
: Xoh_dom_.Title_by_href(href_bry_encoded, Bry_.new_u8(html_box.Html_js_eval_proc_as_str(Xog_js_procs.Doc__root_html_get)));
if (xowa_ttl == null) {
app.Gui_mgr().Kit().Ask_ok("", "", "could not find anchor with href in html: href=~{0}", href_bry);
return Rslt_handled;
}
byte[] lnki_ttl = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Decode(Xoa_ttl.Replace_spaces(Bry_.new_u8(xowa_ttl)));
Xof_fsdb_itm fsdb = Xof_orig_file_downloader.Make_fsdb(wiki, lnki_ttl, img_size, url_bldr);
if (!Io_mgr.Instance.ExistsFil(href_url)) {

View File

@@ -63,7 +63,7 @@ class Xog_launcher_tabs {
Xoa_url launch_url = home_wiki.Utl__url_parser().Parse_by_urlbar_or_null(launch_str); if (launch_url == null) return;
Xowe_wiki launch_wiki = (Xowe_wiki)app.Wiki_mgr().Get_by_key_or_make_init_y(launch_url.Wiki_bry());
Xoa_ttl launch_ttl = Xoa_ttl.parse(launch_wiki, launch_url.Page_bry());
Xog_tab_itm tab = win.Tab_mgr().Tabs_new_init(launch_wiki, Xoae_page.new_(launch_wiki, launch_ttl)); // WORKAROUND: set the tab to an empty page, else null ref later; DATE:2014-07-23
Xog_tab_itm tab = win.Tab_mgr().Tabs_new_init(launch_wiki, Xoae_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 Instance = new Xog_launcher_tabs(); Xog_launcher_tabs() {}

View File

@@ -141,7 +141,7 @@ public class Xog_tab_itm implements GfoInvkAble {
wiki.Parser_mgr().Ctx().Cur_page_(page);
if (page.Missing()) {
if (wiki.Db_mgr().Save_mgr().Create_enabled()) {
page = Xoae_page.create_(wiki, ttl);
page = Xoae_page.New_edit(wiki, ttl);
view_mode = Xopg_page_.Tid_edit;
history_mgr.Add(page); // NOTE: must put new_page on stack so that pressing back will pop new_page, not previous page
Xog_tab_itm_read_mgr.Show_page(this, page, false);

View File

@@ -52,7 +52,7 @@ public class Xog_tab_itm_edit_mgr {
Xog_html_itm html_itm = tab.Html_itm();
byte[] new_text = Get_new_text(tab);
Xoae_page new_page = Xoae_page.new_(wiki, page.Ttl());
Xoae_page new_page = Xoae_page.New(wiki, page.Ttl());
new_page.Revision_data().Id_(page.Revision_data().Id()); // NOTE: page_id needed for sqlite (was not needed for xdat)
new_page.Data_raw_(new_text);
wiki.Parser_mgr().Parse(new_page, true); // refresh html
@@ -102,7 +102,7 @@ public class Xog_tab_itm_edit_mgr {
ctx.Defn_trace().Clear(); // TODO: move_me
ctx.Defn_trace_(Xot_defn_trace_dbg.Instance);
Xoa_ttl ttl = page.Ttl();
Xoae_page new_page = Xoae_page.new_(wiki, ttl);
Xoae_page new_page = Xoae_page.New(wiki, ttl);
byte[] data = tab.Html_itm().Get_elem_value_for_edit_box_as_bry();
new_page.Data_raw_(data);
wiki.Parser_mgr().Parse(new_page, true);

View File

@@ -79,7 +79,7 @@ public class Xog_tab_mgr implements GfoEvObj {
Xowe_wiki cur_wiki = active_tab_is_null ? win.App().Usere().Wiki() : active_tab.Wiki();
Xoa_ttl ttl = Xoa_ttl.parse(cur_wiki, Xows_special_meta_.Itm__default_tab.Ttl_bry());
Xoa_url url = cur_wiki.Utl__url_parser().Parse_by_urlbar_or_null(ttl.Full_db_as_str()); if (url == null) throw Err_.new_("url", "invalid url", "url", url);
Xog_tab_itm rv = Tabs_new(focus, active_tab_is_null, cur_wiki, Xoae_page.new_(cur_wiki, ttl));
Xog_tab_itm rv = Tabs_new(focus, active_tab_is_null, cur_wiki, Xoae_page.New(cur_wiki, ttl));
rv.Page_update_ui();
rv.Show_url_bgn(url);
return rv;
@@ -218,7 +218,7 @@ public class Xog_tab_mgr implements GfoEvObj {
}
public void Tabs_new_link(String link, boolean focus) {
Xowe_wiki wiki = active_tab.Wiki();
Xog_tab_itm new_tab = Tabs_new(focus, false, wiki, Xoae_page.new_(wiki, active_tab.Page().Ttl())); // NOTE: do not use ttl from link, else middle-clicking pages with anchors won't work; DATE:2015-05-03
Xog_tab_itm new_tab = Tabs_new(focus, false, wiki, Xoae_page.New(wiki, active_tab.Page().Ttl())); // NOTE: do not use ttl from link, else middle-clicking pages with anchors won't work; DATE:2015-05-03
Xoa_url url = wiki.Utl__url_parser().Parse_by_urlbar_or_null(link); if (url == null) return; // NOTE: link must be of form domain/wiki/page; DATE:2014-05-27
new_tab.Show_url_bgn(url);
if (focus)

View File

@@ -77,7 +77,7 @@ public class Xog_error_win extends JFrame implements GfoInvkAble {
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_send_mail)) {
try {
Gfo_url_encoder url_encoder = gplx.langs.htmls.encoders.Gfo_url_encoder_.Fsys_safe;
Gfo_url_encoder url_encoder = gplx.langs.htmls.encoders.Gfo_url_encoder_.Fsys_wnt;
String subject = url_encoder.Encode_str("XOWA boot error: " + error_data.Err_msg());
String body = url_encoder.Encode_str(error_data.Err_details());
Desktop.getDesktop().mail(new URI("mailto:gnosygnu+xowa_error_boot@gmail.com?subject=" + subject + "&body=" + body));

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.guis.views.boots; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*;
import java.awt.*;
import java.awt.event.*;
public class Xog_splash_win implements RlsAble {
public class Xog_splash_win implements Rls_able {
private SplashScreen splash;
private Graphics2D graphics; private boolean graphics_init = true;
public Xog_splash_win(boolean app_mode_is_gui) {