Re-enable rich/plain text editing toggke for WK2.
This commit is contained in:
parent
7063907688
commit
6933f3b6f2
4 changed files with 12 additions and 15 deletions
|
|
@ -173,8 +173,10 @@ public class ComposerWebView : ClientWebView {
|
|||
/**
|
||||
* Sets whether the editor is in rich text or plain text mode.
|
||||
*/
|
||||
public void enable_rich_text(bool enabled) {
|
||||
// XXX
|
||||
public void set_rich_text(bool enabled) {
|
||||
this.run_javascript.begin(
|
||||
"geary.setRichText(%s);".printf(enabled ? "true" : "false"), null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1679,7 +1679,7 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
|
||||
this.menu_button.menu_model = (compose_as_html) ? this.html_menu : this.plain_menu;
|
||||
|
||||
this.editor.enable_rich_text(compose_as_html);
|
||||
this.editor.set_rich_text(compose_as_html);
|
||||
|
||||
GearyApplication.instance.config.compose_as_html = compose_as_html;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,18 +92,6 @@ namespace Util.Composer {
|
|||
// return offset > 0 ? document.create_text_node(node_value[0:index]) : null;
|
||||
// }
|
||||
|
||||
public void enable_rich_text(WebKit.WebPage page, bool is_enabled) {
|
||||
// WebKit.DOM.DOMTokenList body_classes = this.editor.get_dom_document().body.get_class_list();
|
||||
// try {
|
||||
// if (is_enabled)
|
||||
// body_classes.remove("plain");
|
||||
// else
|
||||
// body_classes.add("plain");
|
||||
// } catch (Error error) {
|
||||
// debug("Error setting composer style: %s", error.message);
|
||||
// }
|
||||
}
|
||||
|
||||
public void undo_blockquote_style(WebKit.WebPage page) {
|
||||
try {
|
||||
WebKit.DOM.NodeList node_list = page.get_dom_document().query_selector_all(
|
||||
|
|
|
|||
|
|
@ -59,6 +59,13 @@ ComposerPageState.prototype = {
|
|||
},
|
||||
getText: function() {
|
||||
return document.getElementById(ComposerPageState.BODY_ID).innerText;
|
||||
},
|
||||
setRichText: function(enabled) {
|
||||
if (enabled) {
|
||||
document.body.classList.remove("plain");
|
||||
} else {
|
||||
document.body.classList.add("plain");
|
||||
}
|
||||
}
|
||||
// private static void on_link_clicked(WebKit.DOM.Element element, WebKit.DOM.Event event,
|
||||
// ComposerWidget composer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue