mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.1.1
This commit is contained in:
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
public interface Gxw_html extends GxwElem {
|
||||
void Html_doc_html_load_by_mem(String html);
|
||||
void Html_doc_html_load_by_url(String path, String html);
|
||||
void Html_doc_html_load_by_url(Io_url path, String html);
|
||||
byte Html_doc_html_load_tid(); void Html_doc_html_load_tid_(byte v);
|
||||
void Html_js_enabled_(boolean v);
|
||||
String Html_js_eval_proc_as_str (String name, Object... args);
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.gfui; import gplx.*;
|
||||
public class Gfui_html extends GfuiElemBase {
|
||||
public void Under_html_(Gxw_html v) {under = v;} private Gxw_html under;
|
||||
public void Html_doc_html_load_by_mem(String html) {under.Html_doc_html_load_by_mem(html);}
|
||||
public void Html_doc_html_load_by_url(String path, String html) {under.Html_doc_html_load_by_url(path, html);}
|
||||
public void Html_doc_html_load_by_url(Io_url path, String html) {under.Html_doc_html_load_by_url(path, html);}
|
||||
public byte Html_doc_html_load_tid() {return under.Html_doc_html_load_tid();}
|
||||
public void Html_doc_html_load_tid_(byte v) {under.Html_doc_html_load_tid_(v);}
|
||||
public void Html_js_enabled_(boolean v) {under.Html_js_enabled_(v);}
|
||||
|
||||
@@ -25,7 +25,7 @@ class Mem_html extends GxwTextMemo_lang implements Gxw_html { public void Html_
|
||||
this.SelBgn_set(0);
|
||||
html_doc_html_load_tid = Gxw_html_load_tid_.Tid_mem;
|
||||
}
|
||||
public void Html_doc_html_load_by_url(String path, String html) {
|
||||
public void Html_doc_html_load_by_url(Io_url path, String html) {
|
||||
html_doc_html_load_tid = Gxw_html_load_tid_.Tid_url;
|
||||
}
|
||||
public byte Html_doc_html_load_tid() {return html_doc_html_load_tid;} private byte html_doc_html_load_tid;
|
||||
|
||||
@@ -58,14 +58,17 @@ class Swt_html implements Gxw_html, Swt_control, FocusListener {
|
||||
@Override public Composite Under_composite() {return null;}
|
||||
@Override public Control Under_menu_control() {return browser;}
|
||||
public int Browser_tid() {return browser_tid;} private final int browser_tid;
|
||||
public String Load_by_url_path() {return load_by_url_path;} private String load_by_url_path;
|
||||
public void Html_doc_html_load_by_mem(String html) {
|
||||
html_doc_html_load_tid = Gxw_html_load_tid_.Tid_mem;
|
||||
this.html_doc_html_load_tid = Gxw_html_load_tid_.Tid_mem;
|
||||
this.load_by_url_path = null;
|
||||
browser.setText(html); // DBG: Io_mgr.I.SaveFilStr(Io_url_.new_fil_("C:\\temp.txt"), s)
|
||||
}
|
||||
public void Html_doc_html_load_by_url(String path, String html) {
|
||||
html_doc_html_load_tid = Gxw_html_load_tid_.Tid_url;
|
||||
public void Html_doc_html_load_by_url(Io_url path, String html) {
|
||||
this.html_doc_html_load_tid = Gxw_html_load_tid_.Tid_url;
|
||||
this.load_by_url_path = path.To_http_file_str();
|
||||
Io_mgr.I.SaveFilStr(path, html);
|
||||
browser.setUrl(path);
|
||||
browser.setUrl(path.Xto_api());
|
||||
}
|
||||
public byte Html_doc_html_load_tid() {return html_doc_html_load_tid;} private byte html_doc_html_load_tid;
|
||||
public void Html_doc_html_load_tid_(byte v) {html_doc_html_load_tid = v;}
|
||||
@@ -183,9 +186,10 @@ class Swt_html_lnr_status implements StatusTextListener {
|
||||
public Swt_html_lnr_status(Swt_html html_box) {this.html_box = html_box;} private Swt_html html_box;
|
||||
public void Host_set(GfoEvObj host) {this.host = host;} GfoEvObj host;
|
||||
@Override public void changed(StatusTextEvent ev) {
|
||||
if (html_box.Kit().Kit_mode__term())
|
||||
return; // shutting down raises status changed events; ignore, else SWT exception thrown; DATE:2014-05-29
|
||||
if (html_box.Kit().Kit_mode__term()) return; // shutting down raises status changed events; ignore, else SWT exception thrown; DATE:2014-05-29
|
||||
String ev_text = ev.text;
|
||||
String load_by_url_path = html_box.Load_by_url_path();
|
||||
if (load_by_url_path != null) ev_text = String_.Replace(ev_text, load_by_url_path, ""); // remove "C:/xowa/tab_1.html"
|
||||
// if (String_.Has(ev_text, "Loading [MathJax]")) return; // suppress MathJax messages; // NOTE: disabled for 2.1 (which no longer outputs messages to status); DATE:2013-05-03
|
||||
try {if (host != null) GfoEvMgr_.PubObj(host, Gfui_html.Evt_link_hover, "v", ev_text);}
|
||||
catch (Exception e) {html_box.Kit().Ask_ok("xowa.gui.html_box", "status.fail", Err_.Message_gplx_full(e));} // NOTE: must catch error or will cause app to lock; currently called inside displaySync
|
||||
|
||||
Reference in New Issue
Block a user