diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/js/local.js b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/js/local.js index a303a7c5..38dc1e54 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/js/local.js +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/js/local.js @@ -76,4 +76,37 @@ $(document).on('ready', function(){ 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) { + + } + }); + } }); \ No newline at end of file diff --git a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig index 72ae0ee8..4fb12b52 100644 --- a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig +++ b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig @@ -116,13 +116,9 @@ $( "#sendbtn" ).click(function() { var data = CKEDITOR.instances["chat_message"].getData(); 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 %} });