Permalink
Browse files

Idea for launching link fetcher using autocomplete. Not functional.

  • Loading branch information...
anaqreon committed Apr 7, 2016
1 parent e41082d commit 66f70730e0a87ac8d52d682c24e748707143ba87
Showing with 13 additions and 7 deletions.
  1. +13 −7 view/js/autocomplete.js
View
@@ -252,7 +252,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 = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'nobb', 'li', 'list', 'ul', 'url', '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);
@@ -275,12 +275,18 @@ function listNewLineAutocomplete(id) {
index: 1,
replace: function (element) {
if(open_elements.indexOf(element) < 0) {
if(element === 'list' || element === 'ol' || element === 'ul') {
return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
}
else {
return ['\[' + element + '\]', '\[/' + element + '\]'];
}
switch (element) {
case 'list':
case 'ol':
case 'ul':
return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
case 'url':
var textAreaId = document.activeElement.id;
textAreaId.split("-").pop();
insertCommentURL(textAreaId.split("-").pop(), textAreaId);
default:
return ['\[' + element + '\]', '\[/' + element + '\]'];
}
}
else {
return '\[' + element + '\] ';

0 comments on commit 66f7073

Please sign in to comment.