/*global define, CKEDITOR */
/*jslint browser: true */

define(["ckeditor"], function () {
    "use strict";

    //open a simpler link dialog
    CKEDITOR.on("dialogDefinition", function (ev) {
        var dialogName = ev.data.name,
            dialogDefinition = ev.data.definition,
            infoTab;

        if (dialogName === "link") {
            dialogDefinition.removeContents("target");
            dialogDefinition.removeContents("advanced");

            infoTab = dialogDefinition.getContents("info");

            infoTab.remove("linkType");
            infoTab.remove("protocol");
        }
    });

    var config = {};

    config.customConfig = "";
    config.language = "pt_BR";
    config.height = "400px";
    config.allowedContent = "p b i br u s; a[!href]";
    config.entities = false;
    config.basicEntities = true;
    config.entities_greek = false;
    config.entities_latin = false;
    config.entities_additional = "";
    config.htmlEncodeOutput = false;
    config.removeButtons = "Anchor,Subscript,Superscript";

    config.toolbar = [
        {
            name: 'basicstyles',
            groups: ['basicstyles', 'cleanup' ],
            items: ['Bold', 'Italic', 'Underline', 'Strike', '-']
        },
        {
            name: 'links',
            items: [ 'Link', 'Unlink']
        },
        {
            name: 'clipboard',
            items : [ 'Undo', 'Redo' ]
        }
    ];

    config.toolbarGroups = [
        {
            name: 'basicstyles',
            groups: [ 'basicstyles', 'cleanup' ]
        },
        {
            name: 'links'
        }
    ];

    return config;
});

@@ -61,17 +61,17 @@
 ne(%5B
-%22
+'
 ckeditor
 %22%5D, 
@@ -66,17 +66,17 @@
 ckeditor
-%22
+'
 %5D, funct
@@ -88,17 +88,17 @@
 ) %7B%0A    
-%22
+'
 use stri
@@ -99,17 +99,17 @@
 e strict
-%22
+'
 ;%0A%0A    /
@@ -152,17 +152,17 @@
 ITOR.on(
-%22
+'
 dialogDe
@@ -169,17 +169,17 @@
 finition
-%22
+'
 , functi
@@ -331,14 +331,14 @@
 === 
-%22
+'
 link
-%22
+'
 ) %7B%0A
@@ -385,16 +385,16 @@
 nts(
-%22
+'
 target
-%22
+'
 );%0A 
@@ -440,17 +440,17 @@
 nts(
-%22
+'
 advanced
 %22);%0A
@@ -445,17 +445,17 @@
 advanced
-%22
+'
 );%0A%0A    
@@ -505,14 +505,14 @@
 nts(
-%22
+'
 info
-%22
+'
 );%0A%0A
@@ -542,17 +542,17 @@
 ove(
-%22
+'
 linkType
 %22);%0A
@@ -547,17 +547,17 @@
 linkType
-%22
+'
 );%0A     
@@ -582,17 +582,17 @@
 ove(
-%22
+'
 protocol
 %22);%0A
@@ -587,17 +587,17 @@
 protocol
-%22
+'
 );%0A     
@@ -658,18 +658,18 @@
 onfig = 
-%22%22
+''
 ;%0A    co
@@ -688,15 +688,15 @@
 e = 
-%22
+'
 pt_BR
-%22
+'
 ;%0A  
@@ -717,15 +717,15 @@
 t = 
-%22
+'
 400px
-%22
+'
 ;%0A  
@@ -750,17 +750,17 @@
 ntent = 
-%22
+'
 p b i br
@@ -773,17 +773,17 @@
 a%5B!href%5D
-%22
+'
 ;%0A    co
@@ -945,10 +945,10 @@
 l = 
-%22%22
+''
 ;%0A  
@@ -1009,17 +1009,17 @@
 ttons = 
-%22
+'
 Anchor,S
@@ -1042,9 +1042,9 @@
 ript
-%22
+'
 ;%0A%0A 
@@ -1153,17 +1153,16 @@
 cleanup'
- 
 %5D,%0A     
@@ -1290,17 +1290,16 @@
 items: %5B
- 
 'Link', 
@@ -1381,13 +1381,11 @@
 tems
- 
 : %5B
- 
 'Und
@@ -1394,17 +1394,16 @@
 , 'Redo'
- 
 %5D%0A      
@@ -1507,17 +1507,16 @@
 roups: %5B
- 
 'basicst
@@ -1531,17 +1531,16 @@
 cleanup'
- 
 %5D%0A      

improve ckeditor-config.js code style