remove some cruft from initEditor();
This commit is contained in:
parent
7e99931733
commit
6d7e364a0d
@ -5,13 +5,14 @@ var plaintext = '{{$editselect}}';
|
|||||||
var pretext = '{{$pretext}}';
|
var pretext = '{{$pretext}}';
|
||||||
|
|
||||||
function initEditor(cb){
|
function initEditor(cb){
|
||||||
if (editor==false){
|
if(editor == false){
|
||||||
$("#profile-jot-text-loading").show();
|
$("#profile-jot-text-loading").show();
|
||||||
$("#profile-jot-reset").removeClass('d-none');
|
$("#profile-jot-reset").removeClass('d-none');
|
||||||
{{$geotag}}
|
{{$geotag}}
|
||||||
if(plaintext == 'none') {
|
if(plaintext == 'none') {
|
||||||
$("#profile-jot-text-loading").hide();
|
$("#profile-jot-text-loading").hide();
|
||||||
//$("#profile-jot-text").css({ 'height': 200 });
|
$(".jothidden").show();
|
||||||
|
$("#profile-jot-text").addClass('jot-expanded');
|
||||||
{{if $bbco_autocomplete}}
|
{{if $bbco_autocomplete}}
|
||||||
$("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode
|
$("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -22,82 +23,21 @@ function initEditor(cb){
|
|||||||
$("#profile-jot-text").editor_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
|
||||||
{{/if}}
|
{{/if}}
|
||||||
editor = true;
|
editor = true;
|
||||||
$("a#jot-perms-icon").colorbox({
|
|
||||||
'inline' : true,
|
|
||||||
'transition' : 'elastic'
|
|
||||||
});
|
|
||||||
$(".jothidden").show();
|
|
||||||
$("#profile-jot-text").addClass('jot-expanded');
|
|
||||||
if (typeof cb!="undefined") cb();
|
if (typeof cb!="undefined") cb();
|
||||||
if(pretext.length)
|
if(pretext.length)
|
||||||
addeditortext(pretext);
|
addeditortext(pretext);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tinyMCE.init({
|
editor = true;
|
||||||
theme : "advanced",
|
|
||||||
mode : "specific_textareas",
|
|
||||||
editor_selector: {{$editselect}},
|
|
||||||
auto_focus: "profile-jot-text",
|
|
||||||
plugins : "bbcode,paste,autoresize, inlinepopups",
|
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "center",
|
|
||||||
theme_advanced_blockformats : "blockquote,code",
|
|
||||||
gecko_spellcheck : true,
|
|
||||||
paste_text_sticky : true,
|
|
||||||
entity_encoding : "raw",
|
|
||||||
add_unload_trigger : false,
|
|
||||||
remove_linebreaks : false,
|
|
||||||
force_p_newlines : false,
|
|
||||||
force_br_newlines : true,
|
|
||||||
forced_root_block : '',
|
|
||||||
convert_urls: false,
|
|
||||||
content_css: "{{$baseurl}}/view/custom_tinymce.css",
|
|
||||||
theme_advanced_path : false,
|
|
||||||
file_browser_callback : "fcFileBrowser",
|
|
||||||
setup : function(ed) {
|
|
||||||
cPopup = null;
|
|
||||||
ed.onKeyDown.add(function(ed,e) {
|
|
||||||
if(cPopup !== null)
|
|
||||||
cPopup.onkey(e);
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.onKeyUp.add(function(ed, e) {
|
|
||||||
var txt = tinyMCE.activeEditor.getContent();
|
|
||||||
match = txt.match(/@([^ \n]+)$/);
|
|
||||||
if(match!==null) {
|
|
||||||
if(cPopup === null) {
|
|
||||||
cPopup = new ACPopup(this,baseurl+"/acl");
|
|
||||||
}
|
|
||||||
if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
|
|
||||||
if(! cPopup.ready) cPopup = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(cPopup !== null) { cPopup.close(); cPopup = null; }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.onInit.add(function(ed) {
|
|
||||||
ed.pasteAsPlainText = true;
|
|
||||||
$("#profile-jot-text-loading").hide();
|
|
||||||
$(".jothidden").show();
|
|
||||||
if (typeof cb!="undefined") cb();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
editor = true;
|
|
||||||
} else {
|
} else {
|
||||||
if (typeof cb!="undefined") cb();
|
if (typeof cb!="undefined") cb();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableOnUser(){
|
function enableOnUser(){
|
||||||
if (editor) return;
|
if(editor)
|
||||||
$(this).val("");
|
return;
|
||||||
|
|
||||||
initEditor();
|
initEditor();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -112,7 +52,6 @@ var activeCommentText = '';
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
/* enable tinymce on focus and click */
|
|
||||||
$("#profile-jot-text").focus(enableOnUser);
|
$("#profile-jot-text").focus(enableOnUser);
|
||||||
$("#profile-jot-text").click(enableOnUser);
|
$("#profile-jot-text").click(enableOnUser);
|
||||||
|
|
||||||
@ -361,7 +300,8 @@ var activeCommentText = '';
|
|||||||
function itemCancel() {
|
function itemCancel() {
|
||||||
$("#jot-title").val('');
|
$("#jot-title").val('');
|
||||||
$("#profile-jot-text").val('');
|
$("#profile-jot-text").val('');
|
||||||
$("#jot-category").val('');
|
$("#jot-category").tagsinput('removeAll');
|
||||||
|
|
||||||
postSaveChanges('clean');
|
postSaveChanges('clean');
|
||||||
|
|
||||||
{{if $reset}}
|
{{if $reset}}
|
||||||
|
Reference in New Issue
Block a user