summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrateek Saxena <prtksxna@gmail.com>2014-10-11 23:17:03 +0530
committerPrateek Saxena <prtksxna@gmail.com>2014-10-12 17:40:57 +0530
commit7b8953ee75a66d4c86bd82dec52fde4e9974a82a (patch)
tree261d8943102d570b1afe7040f9d82108c961cc75
parent000648fac8f8bda385f7020ad1d3adb3ca98315c (diff)
downloadetherpad-lite-7b8953ee75a66d4c86bd82dec52fde4e9974a82a.zip
Add keyboard shortcuts for ordered and unordered lists and update tooltips #1987
Ordered List: Ctrl-Shift-N Unordered List: Ctrl-Shift-L
-rw-r--r--src/locales/en.json4
-rw-r--r--src/static/js/ace2_inner.js16
2 files changed, 18 insertions, 2 deletions
diff --git a/src/locales/en.json b/src/locales/en.json
index 43de0bff..9f9cea84 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -6,8 +6,8 @@
"pad.toolbar.italic.title": "Italic (Ctrl-I)",
"pad.toolbar.underline.title": "Underline (Ctrl-U)",
"pad.toolbar.strikethrough.title": "Strikethrough (Ctrl-5)",
- "pad.toolbar.ol.title": "Ordered list",
- "pad.toolbar.ul.title": "Unordered List",
+ "pad.toolbar.ol.title": "Ordered list (Ctrl-Shift-N)",
+ "pad.toolbar.ul.title": "Unordered List (Ctrl-Shift-L)",
"pad.toolbar.indent.title": "Indent (TAB)",
"pad.toolbar.unindent.title": "Outdent (Shift+TAB)",
"pad.toolbar.undo.title": "Undo (Ctrl-Z)",
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index ac11b2e4..5244cbca 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -3749,6 +3749,22 @@ function Ace2Inner(){
toggleAttributeOnSelection('strikethrough');
specialHandled = true;
}
+ if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "L" && (evt.metaKey || evt.ctrlKey))
+ {
+ // cmd-shift-L (unorderedlist)
+ fastIncorp(9);
+ evt.preventDefault();
+ doInsertUnorderedList()
+ specialHandled = true;
+ }
+ if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "N" && (evt.metaKey || evt.ctrlKey))
+ {
+ // cmd-shift-N (orderedlist)
+ fastIncorp(9);
+ evt.preventDefault();
+ doInsertOrderedList()
+ specialHandled = true;
+ }
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "h" && (evt.ctrlKey))
{
// cmd-H (backspace)