aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-07 16:25:16 -0700
committerredmatrix <git@macgirvin.com>2016-04-07 16:25:16 -0700
commit516f776c94ee185ec23851fdaa577cf4f3949d93 (patch)
tree4a0a184838ccb4df4c402f28b987cf7bdb0400e5
parentcc62793d6f45ad29358e07e99bbbb10522658075 (diff)
parentcf84ff334444c09269fd77cf06dac44828bc9bae (diff)
downloadvolse-hubzilla-516f776c94ee185ec23851fdaa577cf4f3949d93.tar.gz
volse-hubzilla-516f776c94ee185ec23851fdaa577cf4f3949d93.tar.bz2
volse-hubzilla-516f776c94ee185ec23851fdaa577cf4f3949d93.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
-rw-r--r--view/css/conversation.css6
-rw-r--r--view/js/autocomplete.js17
2 files changed, 22 insertions, 1 deletions
diff --git a/view/css/conversation.css b/view/css/conversation.css
index 39c973c14..304e0f196 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -296,3 +296,9 @@ a.wall-item-name-link {
.event-label {
font-weight: bold;
}
+
+/* bb-code */
+
+.overline {
+ text-decoration: overline;
+}
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 36551dc42..0ba291004 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -149,6 +149,16 @@ function listNewLineAutocomplete(id) {
}
}
+function string2bb(element) {
+ if(element == 'bold') return 'b';
+ else if(element == 'italic') return 'i';
+ else if(element == 'underline') return 'u';
+ else if(element == 'overline') return 'o';
+ else if(element == 'strike') return 's';
+ else if(element == 'superscript') return 'sup';
+ else if(element == 'subscript') return 'sub';
+ else return element;
+}
/**
* jQuery plugin 'editor_autocomplete'
@@ -252,7 +262,7 @@ function listNewLineAutocomplete(id) {
$.fn.bbco_autocomplete = function(type) {
if(type=='bbcode') {
- 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_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'li', '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);
@@ -274,10 +284,14 @@ function listNewLineAutocomplete(id) {
},
index: 1,
replace: function (element) {
+ element = string2bb(element);
if(open_elements.indexOf(element) < 0) {
if(element === 'list' || element === 'ol' || element === 'ul') {
return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
}
+ else if(element === 'table') {
+ return ['\[' + element + '\]' + '\n\[tr\]', '\[/tr\]\n\[/' + element + '\]'];
+ }
else {
return ['\[' + element + '\]', '\[/' + element + '\]'];
}
@@ -292,6 +306,7 @@ function listNewLineAutocomplete(id) {
var a = this.textcomplete([bbco], {className:'acpopup', zIndex:1020});
a.on('textComplete:select', function(e, value, strategy) { value; });
+
$(this).keypress(function(e){
if (e.keyCode == 13) {
x = listNewLineAutocomplete(this.id);