From e2b4d33627d5f4cf5f68eb087059d86c78eec41e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 9 Apr 2016 12:16:42 +0200 Subject: some work on comanche autocomplete --- view/js/autocomplete.js | 9 ++++++++- view/tpl/jot-header.tpl | 6 +++++- view/tpl/jot.tpl | 2 ++ view/tpl/pdledit.tpl | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 0ba291004..a4a1fdf51 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -269,7 +269,14 @@ function string2bb(element) { } if(type=='comanche') { - var open_close_elements = ['region', 'widget', 'var', 'template', 'css', 'js']; + var open_close_elements = ['region', 'layout', 'template', 'theme', 'widget', 'block', 'menu', 'var', 'css', 'js', 'authored', 'comment', 'webpage']; + var open_elements = []; + + var elements = open_close_elements.concat(open_elements); + } + + if(type=='comanche-block') { + var open_close_elements = ['menu', 'var']; var open_elements = []; var elements = open_close_elements.concat(open_elements); diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2b62f2407..769923a51 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -11,11 +11,15 @@ function initEditor(cb){ if(plaintext == 'none') { $("#profile-jot-text-loading").spin(false).hide(); $("#profile-jot-text").css({ 'height': 200, 'color': '#000' }); - $("#profile-jot-text").bbco_autocomplete('bbcode'); // autocomplete bbcode + {{if $bbco_autocomplete}} + $("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode + {{/if}} + {{if $editor_autocomplete}} if(typeof channelId === 'undefined') $("#profile-jot-text").editor_autocomplete(baseurl+"/acl"); else $("#profile-jot-text").editor_autocomplete(baseurl+"/acl",[channelId]); // Also gives suggestions from current channel's connections + {{/if}} editor = true; $("a#jot-perms-icon").colorbox({ 'inline' : true, diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index dea75efa9..026c586a0 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -48,6 +48,7 @@ {{/if}}
+ {{if $bbcode}}
+ {{/if}} {{if $visitor}} -- cgit v1.2.3