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

@@ -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)) {