From 7a3a65bb09808ffa817b9c940d2dd70b414f4f29 Mon Sep 17 00:00:00 2001 From: Nicolas Hohm Date: Sat, 14 Nov 2015 17:25:31 +0100 Subject: [PATCH 1/2] Improve message completion * Disable browser autocomplete for message field * Add client setting to customize string to append after tab completion Resolves: #297 --- CHANGELOG.md | 5 +++++ client/index.html | 11 ++++++++++- client/js/shout.js | 20 +++++++++++++++++--- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9ff2f9..fcc50c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +Unreleased +========== + +* Improve message completion + 0.51.2 / 2015-09-18 ================== diff --git a/client/index.html b/client/index.html index b774a2a3..100c91d5 100644 --- a/client/index.html +++ b/client/index.html @@ -258,6 +258,15 @@

Notifications

+
+

Other

+
+
+
+ + +
+

About Shout

@@ -278,7 +287,7 @@

About Shout

- +
diff --git a/client/js/shout.js b/client/js/shout.js index c3560284..4657f60d 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -347,6 +347,7 @@ $(function() { part: true, thumbnails: true, quit: true, + afterComplete: '', }, $.cookie("settings")); for (var i in options) { @@ -358,7 +359,11 @@ $(function() { settings.on("change", "input", function() { var self = $(this); var name = self.attr("name"); - options[name] = self.prop("checked"); + if (self.is(':checkbox')) { + options[name] = self.prop("checked"); + } else { + options[name] = self.val(); + } $.cookie( "settings", options, { @@ -378,6 +383,9 @@ $(function() { if (name === "colors") { chat.toggleClass("no-colors", !self.prop("checked")); } + if (name === "afterComplete") { + initTabCompletion(); + } }).find("input") .trigger("change"); @@ -404,8 +412,14 @@ $(function() { }); var input = $("#input") - .history() - .tab(complete, {hint: false}); + .history(); + + initTabCompletion(); + + function initTabCompletion() { + var settings = $.cookie("settings") || {}; + $("#input").tab(complete, {hint: false, after: settings.afterComplete}); + } var form = $("#form"); From 4920d91d589caeba68a0a45aabedf30caa52842a Mon Sep 17 00:00:00 2001 From: Nicolas Hohm Date: Sat, 14 Nov 2015 17:40:57 +0100 Subject: [PATCH 2/2] Fix style issues --- client/js/shout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/js/shout.js b/client/js/shout.js index 4657f60d..fd33d78e 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -347,7 +347,7 @@ $(function() { part: true, thumbnails: true, quit: true, - afterComplete: '', + afterComplete: "", }, $.cookie("settings")); for (var i in options) { @@ -359,7 +359,7 @@ $(function() { settings.on("change", "input", function() { var self = $(this); var name = self.attr("name"); - if (self.is(':checkbox')) { + if (self.is(":checkbox")) { options[name] = self.prop("checked"); } else { options[name] = self.val();