Merge branch 'master' into dev
This commit is contained in:
commit
1c9f773900
@ -197,3 +197,43 @@ function submit_form(e) {
|
|||||||
a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
|
a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
|
||||||
};
|
};
|
||||||
})( jQuery );
|
})( jQuery );
|
||||||
|
|
||||||
|
(function( $ ) {
|
||||||
|
$.fn.bbco_autocomplete = function(type) {
|
||||||
|
|
||||||
|
if(type=='bbcode') {
|
||||||
|
var open_close_elements = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'observer'];
|
||||||
|
var open_elements = ['observer.photo', 'observer.name', 'observer.url'];
|
||||||
|
|
||||||
|
var elements = open_close_elements.concat(open_elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type=='comanche') {
|
||||||
|
var elements = ['region', 'widget', 'var', 'template', 'css', 'js'];
|
||||||
|
}
|
||||||
|
|
||||||
|
bbco = {
|
||||||
|
match: /\[(\w*)$/,
|
||||||
|
search: function (term, callback) {
|
||||||
|
callback($.map(elements, function (element) {
|
||||||
|
return element.indexOf(term) === 0 ? element : null;
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
index: 1,
|
||||||
|
replace: function (element) {
|
||||||
|
if(open_elements.indexOf(element) < 0) {
|
||||||
|
return ['\[' + element + '\]', '\[/' + element + '\]'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return '\[' + element + '\] ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.attr('autocomplete','off');
|
||||||
|
var a = this.textcomplete([bbco], {className:'acpopup', zIndex:1020});
|
||||||
|
|
||||||
|
a.on('textComplete:select', function(e, value, strategy) { value; });
|
||||||
|
};
|
||||||
|
})( jQuery );
|
||||||
|
|
||||||
|
@ -617,6 +617,8 @@ function updateConvItems(mode,data) {
|
|||||||
|
|
||||||
/* autocomplete @nicknames */
|
/* autocomplete @nicknames */
|
||||||
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
||||||
|
/* autocomplete bbcode */
|
||||||
|
$(".comment-edit-form textarea").bbco_autocomplete('bbcode');
|
||||||
|
|
||||||
var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; }));
|
var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; }));
|
||||||
var bimgcount = bimgs.length;
|
var bimgcount = bimgs.length;
|
||||||
|
@ -11,6 +11,7 @@ function initEditor(cb){
|
|||||||
if(plaintext == 'none') {
|
if(plaintext == 'none') {
|
||||||
$("#profile-jot-text-loading").spin(false).hide();
|
$("#profile-jot-text-loading").spin(false).hide();
|
||||||
$("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
|
$("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
|
||||||
|
$("#profile-jot-text").bbco_autocomplete('bbcode'); // autocomplete bbcode
|
||||||
if(typeof channelId === 'undefined')
|
if(typeof channelId === 'undefined')
|
||||||
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
|
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user