From 8f75cedf3c204ff8c3974a78a8edddbab6da5af6 Mon Sep 17 00:00:00 2001 From: skobkin Date: Thu, 20 Mar 2014 14:05:11 -0700 Subject: [PATCH] Visual editor CTRL+Enter fix. --- chrome_point_plus/js/point-plus.js | 13 ++++++++++++- chrome_point_plus/manifest.json | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index 8530dce..cdbc754 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -74,12 +74,23 @@ $(document).ready(function() { 'max-height': '100%' }); } - // WYSIWYG editor + // Visual editor if (options.option_visual_editor_post == true) { // Add classes $('#new-post-form #text-input, .post-content #text-input').addClass('markitup').css('height', '20em'); // Init $('.markitup').markItUp(mySettings); + + // Send by CTRL+Enter + if (options.option_ctrl_enter == true) { + // New post + $('#new-post-form #text-input, .post-content #text-input').on('keydown.point_plus', function(e) { + if (e.ctrlKey && (e.keyCode == 10 || e.keyCode == 13)) { + e.preventDefault(); + $(this).parents('#new-post-form,#post-edit-form').submit(); + } + }); + } } // Google search if (options.option_search_with_google == true) { diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 3b0b76c..3c64cb8 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.3", + "version": "1.4", "author": "Alexey Skobkin", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "description": "Some new features for point.im",