1 | /* |
---|
2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. |
---|
3 | For licensing, see LICENSE.html or http://ckeditor.com/license |
---|
4 | */ |
---|
5 | |
---|
6 | /* |
---|
7 | * 31/05/2012 Tony Payne (1.0.1) |
---|
8 | * Max Window Height Reduced. |
---|
9 | * Image icon removed. |
---|
10 | * Built in Spell Checker replaced by ieSpell. |
---|
11 | * 14/06/2012 Tony Payne (1.0.2) |
---|
12 | * Add Browse Server to Link. |
---|
13 | */ |
---|
14 | |
---|
15 | /* Default all Links to "_blank" */ |
---|
16 | CKEDITOR.on('dialogDefinition', function ( ev ){ |
---|
17 | if(ev.data.name == 'link'){ |
---|
18 | ev.data.definition.getContents('target').get('linkTargetType')['default']='_blank'; |
---|
19 | } |
---|
20 | }); |
---|
21 | |
---|
22 | CKEDITOR.on( 'instanceReady', function( ev ) |
---|
23 | { |
---|
24 | var editor = ev.editor, |
---|
25 | dataProcessor = editor.dataProcessor, |
---|
26 | htmlFilter = dataProcessor && dataProcessor.htmlFilter; |
---|
27 | htmlFilter.addRules({ |
---|
28 | a : function ( element ){ |
---|
29 | element.attributes['target']="_blank"; |
---|
30 | } |
---|
31 | }); |
---|
32 | }); |
---|
33 | |
---|
34 | /* 14/06/2012 Tony Payne |
---|
35 | Function to read cookies |
---|
36 | */ |
---|
37 | function getCookie(c_name) |
---|
38 | { |
---|
39 | var i,x,y,ARRcookies=document.cookie.split(";"); |
---|
40 | for (i=0;i<ARRcookies.length;i++) |
---|
41 | { |
---|
42 | x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); |
---|
43 | y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); |
---|
44 | x=x.replace(/^\s+|\s+$/g,""); |
---|
45 | if (x==c_name) |
---|
46 | { |
---|
47 | return unescape(y); |
---|
48 | } |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | var programLocation = getCookie('ProgramLocation'); |
---|
53 | |
---|
54 | |
---|
55 | CKEDITOR.editorConfig = function( config ) |
---|
56 | { |
---|
57 | config.extraPlugins = 'autogrow,confighelper,tableresize,iespell'; |
---|
58 | config.autoGrow_onStartup = true; |
---|
59 | config.autoGrow_maxHeight = 300; |
---|
60 | config.autoGrow_minHeight = 50; |
---|
61 | config.toolbarCanCollapse = true; |
---|
62 | config.toolbarStartupExpanded = false; |
---|
63 | config.width = 800; |
---|
64 | config.height = 50; |
---|
65 | config.ResizeEnabled = true; |
---|
66 | config.resize_maxWidth = 800; |
---|
67 | config.resize_minHeight = 50; |
---|
68 | config.contentsCss = '../Stylesheets/QA.css'; |
---|
69 | config.enterMode = CKEDITOR.ENTER_BR; |
---|
70 | config.disableNativeSpellChecker = false; |
---|
71 | |
---|
72 | // Configure url for FileBrowser plugin |
---|
73 | var baseHref = 'http://www.drapertools.co.uk/'; |
---|
74 | //var fullPath = baseHref + 'qatest/php/'; |
---|
75 | var fullPath = baseHref + programLocation + '/php/'; |
---|
76 | config.filebrowserBrowseUrl = fullPath + 'ckeditor/filemanager/browser/default/browser.html?Connector=' + fullPath + 'ckeditor/filemanager/connectors/php/connector.php'; |
---|
77 | config.filebrowserImageBrowseUrl = fullPath + 'ckeditor/filemanager/browser/default/browser.html?Type=Image&Connector=' + fullPath + 'ckeditor/filemanager/connectors/php/connector.php'; |
---|
78 | config.filebrowserFlashBrowseUrl = fullPath + 'ckeditor/filemanager/browser/default/browser.html?Type=Flash&Connector=' + fullPath + 'ckeditor/filemanager/connectors/php/connector.php'; |
---|
79 | |
---|
80 | config.dialogFieldsDefaultValues = |
---|
81 | { |
---|
82 | table: |
---|
83 | { |
---|
84 | info: |
---|
85 | { |
---|
86 | txtWidth : '100%', |
---|
87 | txtCellSpace : '0', |
---|
88 | txtCellPad : '3' |
---|
89 | } |
---|
90 | }, |
---|
91 | cellProperties: |
---|
92 | { |
---|
93 | info: |
---|
94 | { |
---|
95 | vAlign : 'top' |
---|
96 | } |
---|
97 | } |
---|
98 | }; |
---|
99 | |
---|
100 | // Cut Down Version Of Special Characters |
---|
101 | config.specialChars = |
---|
102 | [ |
---|
103 | '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/', |
---|
104 | ':',';', |
---|
105 | '<','=','>','?','@', |
---|
106 | '[',']','^','_','`', |
---|
107 | '{','}','~', |
---|
108 | "€", "‘", "’", "“", "”", "–", "—", "¢", "£", "¨", "©", "ª", "®", "¯", "°", "²", "³", "´", "¶", "·", "¸", "¹", "º", "»", "×", "Ø", "÷", "Œ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈" |
---|
109 | ]; |
---|
110 | // Additional Draper Special Characters |
---|
111 | config.specialChars = config.specialChars.concat( [ "✓","µ","Ω","π","¼","½","¾" ]); |
---|
112 | // 1/8 - 7/8 - do not display correctly except in editor |
---|
113 | config.specialChars = config.specialChars.concat( [ "⅛","⅜","⅝","⅞" ] ); |
---|
114 | //config.specialChars = config.specialChars.concat( [ "⅛","⅜","⅝","⅞" ] ); |
---|
115 | |
---|
116 | |
---|
117 | config.toolbar = 'QAToolbar'; |
---|
118 | config.toolbar_QAToolbar = [ |
---|
119 | { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, |
---|
120 | { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, |
---|
121 | { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] }, |
---|
122 | { name: 'links', items : [ 'Link','Unlink'] }, |
---|
123 | '/', |
---|
124 | { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] }, |
---|
125 | { name: 'colors', items : [ 'TextColor','BGColor' ] }, |
---|
126 | { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','ieSpell'] }, |
---|
127 | { name: 'insert', items : [ 'Table','HorizontalRule','SpecialChar','Image' ] }, |
---|
128 | { name: 'document', items : [ 'Source' ] } |
---|
129 | ] ; |
---|
130 | |
---|
131 | |
---|
132 | }; |
---|
133 | |
---|
134 | |
---|
135 | |
---|