From 1eb6067c31f10c8da262fd8aef8d740b94d85137 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Tue, 5 Apr 2016 14:46:16 -0400 Subject: Improve (un)ordered list autocompletion for list construction --- view/js/autocomplete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'view/js') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index b4879d464..3e7e08b35 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -202,7 +202,7 @@ function submit_form(e) { $.fn.bbco_autocomplete = function(type) { if(type=='bbcode') { - var open_close_elements = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer']; + var open_close_elements = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'nobb', 'li', 'list', 'ul', 'ol', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer']; var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ]; var elements = open_close_elements.concat(open_elements); @@ -225,7 +225,11 @@ function submit_form(e) { index: 1, replace: function (element) { if(open_elements.indexOf(element) < 0) { + if(element === 'ol' || element === 'ul') { + return ['\[' + element + '\]' + '\n\[li\]', '\[/li\]\n' + '\[/' + element + '\]']; + } else { return ['\[' + element + '\]', '\[/' + element + '\]']; + } } else { return '\[' + element + '\] '; -- cgit v1.2.3