This commit is contained in:
afornerot 2019-07-17 15:13:49 +02:00
parent 3467eea83d
commit 58aa6c3d86
2 changed files with 35 additions and 6 deletions

View File

@ -76,4 +76,37 @@ $(document).on('ready', function(){
return false; return false;
}); });
if( typeof CKEDITOR !== 'undefined') {
CKEDITOR.on('dialogDefinition', function(ev) {
try {
/* this just gets the name of the dialog */
var dialogName = ev.data.name;
/* this just gets the contents of the opened dialog */
var dialogDefinition = ev.data.definition;
/* Make sure that the dialog opened is the link plugin ... otherwise do nothing */
if(dialogName == 'link') {
/* Getting the contents of the Target tab */
var informationTab = dialogDefinition.getContents('target');
/* Getting the contents of the dropdown field "Target" so we can set it */
var targetField = informationTab.get('linkTargetType');
/* Now that we have the field, we just set the default to _blank */
targetField['default'] = '_blank';
}
dialogDefinition.onShow = function() {
this.move(this.getPosition().x,0); // Top center
};
} catch(exception) {
}
});
}
}); });

View File

@ -116,13 +116,9 @@
$( "#sendbtn" ).click(function() { $( "#sendbtn" ).click(function() {
var data = CKEDITOR.instances["chat_message"].getData(); var data = CKEDITOR.instances["chat_message"].getData();
if(data) session.publish("websocket/channel/{{groupid}}", data); if(data) session.publish("websocket/channel/{{groupid}}", data);
}); CKEDITOR.instances["chat_message"].setData('');
/* });
session.publish("websocket/channel/{{groupid}}", "This is a message!");
session.publish("websocket/channel/{{groupid}}", "This is a message!");
*/
}) })
{% endif %} {% endif %}
}); });