aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreer <treer.git@the-bordello.com>2016-05-01 16:03:36 +1000
committerTreer <treer.git@the-bordello.com>2016-05-01 16:03:36 +1000
commit02d836301976fefc6b5ef5bd6ee9b061fa368992 (patch)
treeffccd2c11f8cbb7b23b398ceb23aeb2f03ce12c0
parent84d93cca6e2ac0b552a6f5c570fbcfce766200a1 (diff)
downloadvolse-hubzilla-02d836301976fefc6b5ef5bd6ee9b061fa368992.tar.gz
volse-hubzilla-02d836301976fefc6b5ef5bd6ee9b061fa368992.tar.bz2
volse-hubzilla-02d836301976fefc6b5ef5bd6ee9b061fa368992.zip
tweak dl bbcode in expanded autocomplete
-rw-r--r--view/js/autocomplete.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 41077d427..01d77e22f 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -143,8 +143,10 @@ function listNewLineAutocomplete(id) {
if (word != null) {
var textBefore = text.value.substring(0, caretPos);
var textAfter = text.value.substring(caretPos, text.length);
- $('#' + id).val(textBefore + '\r\n[*] ' + textAfter);
- setCaretPosition(text, caretPos + 5);
+ var textInsert = (word.indexOf('[/dl]') > 0) ? '\r\n[*= ' : '\r\n[*] ';
+
+ $('#' + id).val(textBefore + textInsert + textAfter);
+ setCaretPosition(text, caretPos + (textInsert.length - 1));
return true;
}
else {
@@ -296,10 +298,11 @@ function string2bb(element) {
replace: function (element) {
element = string2bb(element);
if(open_elements.indexOf(element) < 0) {
- if(element === 'list' || element === 'ol' || element === 'ul' || element === 'dl') {
- return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
- }
- else if(element === 'table') {
+ if(element === 'list' || element === 'ol' || element === 'ul') {
+ return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
+ } else if (element === 'dl') {
+ return ['\[' + element + '\]' + '\n\[*= Item name\] ', '\n\[/' + element + '\]'];
+ } else if(element === 'table') {
return ['\[' + element + '\]' + '\n\[tr\]', '\[/tr\]\n\[/' + element + '\]'];
}
else {