diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/js/autocomplete.js | 16 | ||||
-rw-r--r-- | view/js/main.js | 2 | ||||
-rwxr-xr-x | view/tpl/display-head.tpl | 4 | ||||
-rwxr-xr-x | view/tpl/jot-header.tpl | 4 | ||||
-rwxr-xr-x | view/tpl/msg-header.tpl | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index e68356057..1fa20cc3b 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -3,7 +3,7 @@ * * require jQuery, jquery.textcomplete */ -function mysearch(term, callback, backend_url, extra_channels) { +function contact_search(term, callback, backend_url, extra_channels) { var postdata = { start:0, count:100, @@ -25,11 +25,11 @@ function mysearch(term, callback, backend_url, extra_channels) { }).fail(function () {callback([]); }); // Callback must be invoked even if something went wrong. } -function format(item) { +function contact_format(item) { return "<div class='{0}' title='{4}'><img src='{1}'>{2} ({3})</div>".format(item.taggable, item.photo, item.name, ((item.label) ? item.nick + ' ' + item.label : item.nick), item.link ) } -function replace(item) { +function editor_replace(item) { // $2 ensures that prefix (@,@!) is preserved var id = item.id; // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way. @@ -40,19 +40,19 @@ function replace(item) { } /** - * jQuery plugin 'contact_autocomplete' + * jQuery plugin 'editor_autocomplete' */ (function( $ ){ - $.fn.contact_autocomplete = function(backend_url, extra_channels) { + $.fn.editor_autocomplete = function(backend_url, extra_channels) { if (typeof extra_channels === 'undefined') extra_channels = false; // Autocomplete contacts contacts = { match: /(^|\s)(@\!*)([^ \n]+)$/, index: 3, - search: function(term, callback) { mysearch(term, callback, backend_url, extra_channels); }, - replace: replace, - template: format, + search: function(term, callback) { contact_search(term, callback, backend_url, extra_channels); }, + replace: editor_replace, + template: contact_format, } smilies = { diff --git a/view/js/main.js b/view/js/main.js index 85aea9875..5e3fb2bff 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -574,7 +574,7 @@ function updateConvItems(mode,data) { } /* autocomplete @nicknames */ - $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl?f=&n=1"); + $(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); var bimgs = $(".wall-item-body img").not(function() { return this.complete; }); var bimgcount = bimgs.length; diff --git a/view/tpl/display-head.tpl b/view/tpl/display-head.tpl index 007d33fe8..913784d98 100755 --- a/view/tpl/display-head.tpl +++ b/view/tpl/display-head.tpl @@ -1,8 +1,8 @@ <script> $(document).ready(function() { - $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl?f=&n=1"); + $(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); // make auto-complete work in more places - $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl?f=&n=1"); + $(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); }); </script> diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 8d26fc653..678d16a71 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -11,9 +11,9 @@ function initEditor(cb){ $("#profile-jot-text-loading").spin(false).hide(); $("#profile-jot-text").css({ 'height': 200, 'color': '#000' }); if(typeof channelId === 'undefined') - $("#profile-jot-text").contact_autocomplete(baseurl+"/acl"); + $("#profile-jot-text").editor_autocomplete(baseurl+"/acl"); else - $("#profile-jot-text").contact_autocomplete(baseurl+"/acl",[channelId]); // Also gives suggestions from current channel's connections + $("#profile-jot-text").editor_autocomplete(baseurl+"/acl",[channelId]); // Also gives suggestions from current channel's connections editor = true; $("a#jot-perms-icon").colorbox({ 'inline' : true, diff --git a/view/tpl/msg-header.tpl b/view/tpl/msg-header.tpl index 85fa51b0a..e1d1c6d23 100755 --- a/view/tpl/msg-header.tpl +++ b/view/tpl/msg-header.tpl @@ -41,7 +41,7 @@ if(plaintext != 'none') { }); } else - $("#prvmail-text").contact_autocomplete(baseurl+"/acl"); + $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); </script> |