[geary/wip/728002-webkit2: 102/105] Minor code updates.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/728002-webkit2: 102/105] Minor code updates.
- Date: Sun, 1 Jan 2017 23:58:26 +0000 (UTC)
commit b29b82467aac184179f22a2ff8cec3df26682278
Author: Michael James Gratton <mike vee net>
Date: Sun Jan 1 15:19:58 2017 +1100
Minor code updates.
src/client/components/client-web-view.vala | 10 ++++++++++
ui/composer-web-view.js | 18 ++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
---
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index 2e79771..6ad3cb4 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -6,6 +6,14 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
+/**
+ * Base class for all WebKit2 WebView instances used by the Geary client.
+ *
+ * This provides common functionality expected by the client for
+ * displaying HTML, such as common WebKit settings, desktop font
+ * integration, Inspector support, and remote and inline image
+ * handling.
+ */
public class ClientWebView : WebKit.WebView {
@@ -237,9 +245,11 @@ public class ClientWebView : WebKit.WebView {
register_message_handler(REMOTE_IMAGE_LOAD_BLOCKED_MESSAGE);
register_message_handler(SELECTION_CHANGED_MESSAGE);
+ // Manage zoom level
config.bind(Configuration.CONVERSATION_VIEWER_ZOOM_KEY, this, "zoom_level");
this.scroll_event.connect(on_scroll_event);
+ // Watch desktop font settings
Settings system_settings = config.gnome_interface;
system_settings.bind("document-font-name", this,
"document-font", SettingsBindFlags.DEFAULT);
diff --git a/ui/composer-web-view.js b/ui/composer-web-view.js
index 5e87dc3..324c5c3 100644
--- a/ui/composer-web-view.js
+++ b/ui/composer-web-view.js
@@ -113,12 +113,10 @@ ComposerPageState.htmlToFlowedText = function(root) {
for (let i = nbq - 1; i >= 0; i--) {
let bq = blockquotes.item(i);
let text = bq.innerText;
- console.log("Line: " + text);
if (text.substr(-1, 1) == "\n") {
text = text.slice(0, -1);
- console.log(" found expected newline at end of quote!");
} else {
- console.log(
+ console.debug(
" no newline at end of quote: " +
text.length > 0
? "0x" + text.codePointAt(text.length - 1).toString(16)
@@ -201,21 +199,21 @@ ComposerPageState.resolveNesting = function(text, values) {
);
return text.replace(tokenregex, function(match, p1, p2, p3, offset, str) {
let key = new Number(p2);
- let prevChar = p1;
- let nextChar = p3;
+ let prevChars = p1;
+ let nextChars = p3;
let insertNext = "";
// Make sure there's a newline before and after the quote.
- if (prevChar != "" && prevChar != "\n")
- prevChar = prevChar + "\n";
- if (nextChar != "" && nextChar != "\n")
+ if (prevChars != "" && prevChars != "\n")
+ prevChars = prevChars + "\n";
+ if (nextChars != "" && nextChars != "\n")
insertNext = "\n";
let value = "";
if (key >= 0 && key < values.length) {
let nested = ComposerPageState.resolveNesting(values[key], values);
- value = prevChar + ComposerPageState.quoteLines(nested) + insertNext;
+ value = prevChars + ComposerPageState.quoteLines(nested) + insertNext;
} else {
- console.log("Regex error in denesting blockquotes: Invalid key");
+ console.error("Regex error in denesting blockquotes: Invalid key");
}
return value;
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]