Merge lp:~replaceafill/schooltool/fck_fixes into lp:schooltool/flourish
- fck_fixes
- Merge into flourish
Proposed by
Douglas Cerna
Status: | Merged |
---|---|
Merged at revision: | 3278 |
Proposed branch: | lp:~replaceafill/schooltool/fck_fixes |
Merge into: | lp:schooltool/flourish |
Diff against target: |
1372 lines (+1261/-8) 8 files modified
src/schooltool/skin/flourish/instance/skin.zcml (+13/-5) src/schooltool/skin/flourish/resources/editor_config.js (+40/-0) src/schooltool/skin/flourish/resources/fckeditor/fck_dialog.css (+431/-0) src/schooltool/skin/flourish/resources/fckeditor/fck_dialog_ie6.js (+110/-0) src/schooltool/skin/flourish/resources/fckeditor/fck_editor.css (+463/-0) src/schooltool/skin/flourish/resources/fckeditor/fck_editorarea.css (+110/-0) src/schooltool/skin/flourish/widgets.py (+82/-2) src/schooltool/skin/flourish/widgets.zcml (+12/-1) |
To merge this branch: | bzr merge lp:~replaceafill/schooltool/fck_fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gediminas Paulauskas (community) | Approve | ||
Review via email: mp+86570@code.launchpad.net |
Commit message
Description of the change
Basically, I set a skin for the fck editor according to http://
For this I set a new resource library and new widgets for z3c.form and formlib.
To post a comment you must log in.
Revision history for this message
Gediminas Paulauskas (menesis) wrote : | # |
Beautiful.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/schooltool/skin/flourish/instance/skin.zcml' |
2 | --- src/schooltool/skin/flourish/instance/skin.zcml 2011-11-23 14:27:36 +0000 |
3 | +++ src/schooltool/skin/flourish/instance/skin.zcml 2011-12-21 15:04:26 +0000 |
4 | @@ -7,18 +7,26 @@ |
5 | |
6 | <!-- Skin resources --> |
7 | |
8 | - <configure package="schooltool.skin"> |
9 | + <configure package="schooltool.skin.flourish"> |
10 | |
11 | - <resource |
12 | - name="editor_config.js" |
13 | - file="resources/editor_config.js" |
14 | - layer="schooltool.skin.flourish.IFlourishLayer" /> |
15 | + <resource |
16 | + name="editor_config.js" |
17 | + file="resources/editor_config.js" |
18 | + layer="schooltool.skin.flourish.IFlourishLayer" /> |
19 | |
20 | <resource |
21 | name="favicon.ico" |
22 | file="resources/favicon.ico" |
23 | layer="schooltool.skin.flourish.IFlourishLayer" /> |
24 | |
25 | + <zope:resourceLibrary |
26 | + name="schooltool.skin.flourish-fckeditor" |
27 | + layer="schooltool.skin.flourish.IFlourishLayer"> |
28 | + <directory |
29 | + source="resources/fckeditor" |
30 | + /> |
31 | + </zope:resourceLibrary> |
32 | + |
33 | </configure> |
34 | |
35 | <!-- Error messages --> |
36 | |
37 | === added file 'src/schooltool/skin/flourish/resources/editor_config.js' |
38 | --- src/schooltool/skin/flourish/resources/editor_config.js 1970-01-01 00:00:00 +0000 |
39 | +++ src/schooltool/skin/flourish/resources/editor_config.js 2011-12-21 15:04:26 +0000 |
40 | @@ -0,0 +1,40 @@ |
41 | + |
42 | +// Base path screws up editor for sites using mod rewrite, like |
43 | +// http://example.com/something/schoooltool/... |
44 | +// See https://bugs.edge.launchpad.net/schooltool/+bug/258951 |
45 | +//FCKConfig.BasePath = '/@@/fckeditor/editor/'; |
46 | + |
47 | +FCKConfig.ToolbarSets["schooltool"] = [ |
48 | + ['Bold','Italic','RemoveFormat'], // 'Underline','StrikeThrough','-','Subscript','Superscript' |
49 | + //['Source'], |
50 | + ['Cut','Copy','PasteText'], // ,'Paste','PasteWord'], |
51 | + // ['SelectAll'], // , // for IE JS, unlike Python, never end a list with a comma! |
52 | + //['OrderedList','UnorderedList','-','Outdent','Indent'], |
53 | + //['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], |
54 | + //['Image','Link','Unlink','Anchor','Table','Rule'], |
55 | + ['Link'] |
56 | + //'/', |
57 | + //['Style','FontFormat','FontName','FontSize'], |
58 | + //['TextColor','BGColor'], |
59 | + //['About'] |
60 | + ]; |
61 | + |
62 | +// set faked table borders on table with border="0" |
63 | +FCKConfig.ShowBorders = true ; |
64 | + |
65 | +// The contextURL is set in the javascript template and used in the explorer |
66 | +// implementation |
67 | +FCKConfig.contextURL = window.top.top.contextURL; |
68 | + |
69 | +FCKConfig.LinkBrowser = false ; |
70 | +FCKConfig.LinkUpload = false ; |
71 | +FCKConfig.LinkDlgHideAdvanced = true; |
72 | +FCKConfig.LinkDlgHideTarget = true ; |
73 | + |
74 | +FCKConfig.ImageBrowser = false ; |
75 | + |
76 | +FCKConfig.ForcePasteAsPlainText = true ; |
77 | +// Once we update to CK editor 3.x, figure out a good combination of these |
78 | +// and maybe re-enable paste from Word |
79 | +//FCKConfig.pasteFromWordRemoveFontStyles |
80 | +//FCKConfig.pasteFromWordRemoveStyles |
81 | |
82 | === added directory 'src/schooltool/skin/flourish/resources/fckeditor' |
83 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/fck_dialog.css' |
84 | --- src/schooltool/skin/flourish/resources/fckeditor/fck_dialog.css 1970-01-01 00:00:00 +0000 |
85 | +++ src/schooltool/skin/flourish/resources/fckeditor/fck_dialog.css 2011-12-21 15:04:26 +0000 |
86 | @@ -0,0 +1,431 @@ |
87 | +/* |
88 | + * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
89 | + * Copyright (C) 2003-2009 Frederico Caldeira Knabben |
90 | + * |
91 | + * == BEGIN LICENSE == |
92 | + * |
93 | + * Licensed under the terms of any of the following licenses at your |
94 | + * choice: |
95 | + * |
96 | + * - GNU General Public License Version 2 or later (the "GPL") |
97 | + * http://www.gnu.org/licenses/gpl.html |
98 | + * |
99 | + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
100 | + * http://www.gnu.org/licenses/lgpl.html |
101 | + * |
102 | + * - Mozilla Public License Version 1.1 or later (the "MPL") |
103 | + * http://www.mozilla.org/MPL/MPL-1.1.html |
104 | + * |
105 | + * == END LICENSE == |
106 | + * |
107 | + * Styles used by the dialog boxes. |
108 | + */ |
109 | + |
110 | +html, body |
111 | +{ |
112 | + background-color: transparent; |
113 | + margin: 0px; |
114 | + padding: 0px; |
115 | +} |
116 | + |
117 | +body |
118 | +{ |
119 | + padding: 10px; |
120 | +} |
121 | + |
122 | +body, td, input, select, textarea |
123 | +{ |
124 | + |
125 | + font-size: 12px; |
126 | + font-family: Ubuntu, 'Microsoft Sans Serif' , Arial, Helvetica, Verdana; |
127 | +} |
128 | + |
129 | +input[type="text"] { |
130 | + background-color: #ffffff; |
131 | + border: 1px solid #ccc1c1; |
132 | + color: #333333; |
133 | +} |
134 | + |
135 | +select#cmbLinkType { |
136 | + width: 100%; |
137 | +} |
138 | + |
139 | +body, .BackColor |
140 | +{ |
141 | + background-color: #ffffff; |
142 | +} |
143 | + |
144 | +.PopupBody |
145 | +{ |
146 | + height: 100%; |
147 | + width: 100%; |
148 | + overflow: hidden; |
149 | + background-color: transparent; |
150 | + padding: 0px; |
151 | +} |
152 | + |
153 | +#header |
154 | +{ |
155 | + cursor: move; |
156 | +} |
157 | + |
158 | +.PopupTitle |
159 | +{ |
160 | + font-weight: bold; |
161 | + font-size: 14pt; |
162 | + color: #ffffff; |
163 | + background-color: #008C93; |
164 | + padding: 3px 10px 3px 10px; |
165 | +} |
166 | + |
167 | +.PopupButtons |
168 | +{ |
169 | + position: absolute; |
170 | + right: 0px; |
171 | + left: 0px; |
172 | + bottom: 0px; |
173 | + background-color: #ffffff; |
174 | + padding: 7px 10px 7px 10px; |
175 | +} |
176 | + |
177 | +.Button |
178 | +{ |
179 | + font-size: 14px; |
180 | + border-radius: 4px; |
181 | + background-color: #6C7B7C; |
182 | + border: 1px solid #6C7B7C; |
183 | + box-shadow: 0px 1px 6px #bbbbbb; |
184 | + color: #ffffff; |
185 | +} |
186 | + |
187 | +#btnOk |
188 | +{ |
189 | + background-color: #009499; |
190 | + border: 1px solid #009499; |
191 | + box-shadow: 0px 1px 6px #bbbbbb; |
192 | + color: #ffffff; |
193 | +} |
194 | + |
195 | +#btnOk:hover, .Button:hover |
196 | +{ |
197 | + background-color: #026B6E; |
198 | + border: 1px solid #026B6E; |
199 | +} |
200 | + |
201 | +#btnOk:active, .Button:active { |
202 | + background-color: #056163; |
203 | + border: 1px solid #056163; |
204 | + color: #aea79f; |
205 | +} |
206 | + |
207 | +.DarkBackground |
208 | +{ |
209 | + background-color: #eaead1; |
210 | +} |
211 | + |
212 | +.LightBackground |
213 | +{ |
214 | + background-color: #ffffbe; |
215 | +} |
216 | + |
217 | +.PopupTitleBorder |
218 | +{ |
219 | + border-bottom: #d5d59d 1px solid; |
220 | +} |
221 | + |
222 | +.PopupTabArea |
223 | +{ |
224 | + color: #ffffff; |
225 | + background-color: #008C93; |
226 | +} |
227 | + |
228 | +.PopupTabEmptyArea |
229 | +{ |
230 | + padding-left: 10px; |
231 | + border-bottom: #d5d59d 1px solid; |
232 | +} |
233 | + |
234 | +.PopupTab, .PopupTabSelected |
235 | +{ |
236 | + border-right: #d5d59d 1px solid; |
237 | + border-top: #d5d59d 1px solid; |
238 | + border-left: #d5d59d 1px solid; |
239 | + padding: 3px 5px 3px 5px; |
240 | + color: #333333; |
241 | +} |
242 | + |
243 | +.PopupTab |
244 | +{ |
245 | + margin-top: 1px; |
246 | + border-bottom: #d5d59d 1px solid; |
247 | + cursor: pointer; |
248 | + cursor: hand; |
249 | +} |
250 | + |
251 | +.PopupTabSelected |
252 | +{ |
253 | + font-weight: bold; |
254 | + cursor: default; |
255 | + padding-top: 4px; |
256 | + background-color: #ffffff; |
257 | +} |
258 | + |
259 | +.PopupSelectionBox |
260 | +{ |
261 | + border: #ff9933 1px solid !important; |
262 | + background-color: #fffacd !important; |
263 | + cursor: pointer; |
264 | + cursor: hand; |
265 | +} |
266 | + |
267 | +#tdBrowse |
268 | +{ |
269 | + vertical-align: bottom; |
270 | +} |
271 | + |
272 | +/** |
273 | + * Dialog frame related styles. |
274 | + */ |
275 | + |
276 | +.contents |
277 | +{ |
278 | + border: 1px solid #aaaaaa; |
279 | + position: absolute; |
280 | + top: 2px; |
281 | + left: 16px; |
282 | + right: 16px; |
283 | + bottom: 20px; |
284 | + background-color: #ffffff; |
285 | + overflow: hidden; |
286 | + z-index: 1; |
287 | + border-radius: 4px; |
288 | +} |
289 | + |
290 | +.tl, .tr, .tc, .bl, .br, .bc |
291 | +{ |
292 | + position: absolute; |
293 | + background-image: none; |
294 | + background-repeat: no-repeat; |
295 | +} |
296 | + |
297 | +* html .tl, * html .tr, * html .tc, * html .bl, * html .br, * html .bc |
298 | +{ |
299 | + background-image: none; |
300 | +} |
301 | + |
302 | +.ml, .mr |
303 | +{ |
304 | + position: absolute; |
305 | + background-image: none; |
306 | + background-repeat: repeat-y; |
307 | +} |
308 | + |
309 | +* html .ml, * html .mr |
310 | +{ |
311 | + background-image: none; |
312 | +} |
313 | + |
314 | +.rtl .ml, .rtl .mr |
315 | +{ |
316 | + position: absolute; |
317 | + background-image: none; |
318 | + background-repeat: repeat-y; |
319 | +} |
320 | + |
321 | +* html .rtl .ml, * html .rtl .mr |
322 | +{ |
323 | + background-image: none; |
324 | +} |
325 | + |
326 | +.tl |
327 | +{ |
328 | + top: 0px; |
329 | + left: 0px; |
330 | + width: 16px; |
331 | + height: 16px; |
332 | + background-position: -16px -16px; |
333 | +} |
334 | + |
335 | +.rtl .tl |
336 | +{ |
337 | + background-position: -16px -397px; |
338 | +} |
339 | + |
340 | +.tr |
341 | +{ |
342 | + top: 0px; |
343 | + right: 0px; |
344 | + width: 16px; |
345 | + height: 16px; |
346 | + background-position: -16px -76px; |
347 | +} |
348 | + |
349 | +.rtl .tr |
350 | +{ |
351 | + background-position: -16px -457px; |
352 | +} |
353 | + |
354 | +.tc |
355 | +{ |
356 | + top: 0px; |
357 | + right: 16px; |
358 | + left: 16px; |
359 | + height: 16px; |
360 | + background-position: 0px -136px; |
361 | + background-repeat: repeat-x; |
362 | +} |
363 | + |
364 | +.ml |
365 | +{ |
366 | + top: 16px; |
367 | + left: 0px; |
368 | + width: 16px; |
369 | + bottom: 51px; |
370 | + background-position: 0px 0px; |
371 | +} |
372 | + |
373 | +.mr |
374 | +{ |
375 | + top: 16px; |
376 | + right: 0px; |
377 | + width: 16px; |
378 | + bottom: 51px; |
379 | + background-position: -16px 0px; |
380 | +} |
381 | + |
382 | +.bl |
383 | +{ |
384 | + bottom: 0px; |
385 | + left: 0px; |
386 | + width: 30px; |
387 | + height: 51px; |
388 | + background-position: -16px -196px; |
389 | +} |
390 | + |
391 | +.rtl .bl |
392 | +{ |
393 | + background-position: -16px -517px; |
394 | +} |
395 | + |
396 | +.br |
397 | +{ |
398 | + bottom: 0px; |
399 | + right: 0px; |
400 | + width: 30px; |
401 | + height: 51px; |
402 | + background-position: -16px -263px; |
403 | +} |
404 | + |
405 | +.rtl .br |
406 | +{ |
407 | + background-position: -16px -584px; |
408 | +} |
409 | + |
410 | +.bc |
411 | +{ |
412 | + bottom: 0px; |
413 | + right: 30px; |
414 | + left: 30px; |
415 | + height: 51px; |
416 | + background-position: 0px -330px; |
417 | + background-repeat: repeat-x; |
418 | +} |
419 | + |
420 | +/* For IE6. Do not change it. */ |
421 | +* html .blocker |
422 | +{ |
423 | + position: absolute; |
424 | + width: 100%; |
425 | + height: 100%; |
426 | + z-index: 12; |
427 | + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); |
428 | +} |
429 | + |
430 | +/* The layer used to cover the dialog when opening a child dialog. */ |
431 | +.cover |
432 | +{ |
433 | + position: absolute; |
434 | + top: 0px; |
435 | + left: 14px; |
436 | + right: 14px; |
437 | + bottom: 18px; |
438 | + z-index: 11; |
439 | +} |
440 | + |
441 | +#closeButton |
442 | +{ |
443 | + position: absolute; |
444 | + right: 0px; |
445 | + top: 0px; |
446 | + margin-top: 5px; |
447 | + margin-right: 10px; |
448 | + width: 20px; |
449 | + height: 20px; |
450 | + cursor: pointer; |
451 | + background-image: url(images/sprites.png); |
452 | + background-repeat: no-repeat; |
453 | + background-position: -16px -651px; |
454 | +} |
455 | + |
456 | +* html #closeButton |
457 | +{ |
458 | + cursor: hand; |
459 | + background-image: url(images/sprites.gif); |
460 | +} |
461 | + |
462 | +.rtl #closeButton |
463 | +{ |
464 | + right: auto; |
465 | + left: 10px; |
466 | + margin-right: 0px; |
467 | +} |
468 | + |
469 | +#closeButton:hover |
470 | +{ |
471 | + background-position: -16px -687px; |
472 | +} |
473 | + |
474 | +#throbberBlock |
475 | +{ |
476 | + z-index: 10; |
477 | +} |
478 | + |
479 | +#throbberBlock div |
480 | +{ |
481 | + float: left; |
482 | + width: 8px; |
483 | + height: 9px; |
484 | + margin-left: 2px; |
485 | + margin-right: 2px; |
486 | + font-size: 1px; /* IE6 */ |
487 | +} |
488 | + |
489 | +/* |
490 | + Color Gradient Generator: |
491 | + http://www.herethere.net/~samson/php/color_gradient/?cbegin=737357&cend=E3E3C7&steps=4 |
492 | +*/ |
493 | + |
494 | +.throbber_1 |
495 | +{ |
496 | + background-color: #737357; |
497 | +} |
498 | + |
499 | +.throbber_2 |
500 | +{ |
501 | + background-color: #8f8f73; |
502 | +} |
503 | + |
504 | +.throbber_3 |
505 | +{ |
506 | + background-color: #abab8f; |
507 | +} |
508 | + |
509 | +.throbber_4 |
510 | +{ |
511 | + background-color: #c7c7ab; |
512 | +} |
513 | + |
514 | +.throbber_5 |
515 | +{ |
516 | + background-color: #e3e3c7; |
517 | +} |
518 | |
519 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/fck_dialog_ie6.js' |
520 | --- src/schooltool/skin/flourish/resources/fckeditor/fck_dialog_ie6.js 1970-01-01 00:00:00 +0000 |
521 | +++ src/schooltool/skin/flourish/resources/fckeditor/fck_dialog_ie6.js 2011-12-21 15:04:26 +0000 |
522 | @@ -0,0 +1,110 @@ |
523 | +/* |
524 | + * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
525 | + * Copyright (C) 2003-2009 Frederico Caldeira Knabben |
526 | + * |
527 | + * == BEGIN LICENSE == |
528 | + * |
529 | + * Licensed under the terms of any of the following licenses at your |
530 | + * choice: |
531 | + * |
532 | + * - GNU General Public License Version 2 or later (the "GPL") |
533 | + * http://www.gnu.org/licenses/gpl.html |
534 | + * |
535 | + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
536 | + * http://www.gnu.org/licenses/lgpl.html |
537 | + * |
538 | + * - Mozilla Public License Version 1.1 or later (the "MPL") |
539 | + * http://www.mozilla.org/MPL/MPL-1.1.html |
540 | + * |
541 | + * == END LICENSE == |
542 | + */ |
543 | + |
544 | +(function() |
545 | +{ |
546 | + // IE6 doens't handle absolute positioning properly (it is always in quirks |
547 | + // mode). This function fixes the sizes and positions of many elements that |
548 | + // compose the skin (this is skin specific). |
549 | + var fixSizes = window.DoResizeFixes = function() |
550 | + { |
551 | + var fckDlg = window.document.body ; |
552 | + |
553 | + for ( var i = 0 ; i < fckDlg.childNodes.length ; i++ ) |
554 | + { |
555 | + var child = fckDlg.childNodes[i] ; |
556 | + switch ( child.className ) |
557 | + { |
558 | + case 'contents' : |
559 | + child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 ) ; // -left -right |
560 | + child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 ) ; // -bottom -top |
561 | + break ; |
562 | + |
563 | + case 'blocker' : |
564 | + case 'cover' : |
565 | + child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 + 4 ) ; // -left -right + 4 |
566 | + child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 + 4 ) ; // -bottom -top + 4 |
567 | + break ; |
568 | + |
569 | + case 'tr' : |
570 | + child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ; |
571 | + break ; |
572 | + |
573 | + case 'tc' : |
574 | + child.style.width = Math.max( 0, fckDlg.clientWidth - 16 - 16 ) ; |
575 | + break ; |
576 | + |
577 | + case 'ml' : |
578 | + child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ; |
579 | + break ; |
580 | + |
581 | + case 'mr' : |
582 | + child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ; |
583 | + child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ; |
584 | + break ; |
585 | + |
586 | + case 'bl' : |
587 | + child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ; |
588 | + break ; |
589 | + |
590 | + case 'br' : |
591 | + child.style.left = Math.max( 0, fckDlg.clientWidth - 30 ) ; |
592 | + child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ; |
593 | + break ; |
594 | + |
595 | + case 'bc' : |
596 | + child.style.width = Math.max( 0, fckDlg.clientWidth - 30 - 30 ) ; |
597 | + child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ; |
598 | + break ; |
599 | + } |
600 | + } |
601 | + } |
602 | + |
603 | + var closeButtonOver = function() |
604 | + { |
605 | + this.style.backgroundPosition = '-16px -687px' ; |
606 | + } ; |
607 | + |
608 | + var closeButtonOut = function() |
609 | + { |
610 | + this.style.backgroundPosition = '-16px -651px' ; |
611 | + } ; |
612 | + |
613 | + var fixCloseButton = function() |
614 | + { |
615 | + var closeButton = document.getElementById ( 'closeButton' ) ; |
616 | + |
617 | + closeButton.onmouseover = closeButtonOver ; |
618 | + closeButton.onmouseout = closeButtonOut ; |
619 | + } |
620 | + |
621 | + var onLoad = function() |
622 | + { |
623 | + fixSizes() ; |
624 | + fixCloseButton() ; |
625 | + |
626 | + window.attachEvent( 'onresize', fixSizes ) ; |
627 | + window.detachEvent( 'onload', onLoad ) ; |
628 | + } |
629 | + |
630 | + window.attachEvent( 'onload', onLoad ) ; |
631 | + |
632 | +})() ; |
633 | |
634 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/fck_editor.css' |
635 | --- src/schooltool/skin/flourish/resources/fckeditor/fck_editor.css 1970-01-01 00:00:00 +0000 |
636 | +++ src/schooltool/skin/flourish/resources/fckeditor/fck_editor.css 2011-12-21 15:04:26 +0000 |
637 | @@ -0,0 +1,463 @@ |
638 | +/* |
639 | + * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
640 | + * Copyright (C) 2003-2009 Frederico Caldeira Knabben |
641 | + * |
642 | + * == BEGIN LICENSE == |
643 | + * |
644 | + * Licensed under the terms of any of the following licenses at your |
645 | + * choice: |
646 | + * |
647 | + * - GNU General Public License Version 2 or later (the "GPL") |
648 | + * http://www.gnu.org/licenses/gpl.html |
649 | + * |
650 | + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
651 | + * http://www.gnu.org/licenses/lgpl.html |
652 | + * |
653 | + * - Mozilla Public License Version 1.1 or later (the "MPL") |
654 | + * http://www.mozilla.org/MPL/MPL-1.1.html |
655 | + * |
656 | + * == END LICENSE == |
657 | + * |
658 | + * Styles used by the editor IFRAME and Toolbar. |
659 | + */ |
660 | + |
661 | +/* |
662 | + ### Basic Editor IFRAME Styles. |
663 | +*/ |
664 | + |
665 | +body |
666 | +{ |
667 | + padding: 0; |
668 | + margin: 0; |
669 | + background-color: #ffffff; |
670 | +} |
671 | + |
672 | +#xEditingArea |
673 | +{ |
674 | + border: #CCC1C1 1px solid; |
675 | +} |
676 | + |
677 | +.SourceField |
678 | +{ |
679 | + padding: 5px; |
680 | + margin: 0px; |
681 | + font-family: Monospace; |
682 | +} |
683 | + |
684 | +/* |
685 | + Toolbar |
686 | +*/ |
687 | + |
688 | +.TB_ToolbarSet, .TB_Expand, .TB_Collapse |
689 | +{ |
690 | + cursor: default; |
691 | + background-color: #E6E5E5; |
692 | +} |
693 | + |
694 | +.TB_ToolbarSet |
695 | +{ |
696 | + border-top: #CCC1C1 1px solid; |
697 | +} |
698 | + |
699 | +.TB_ToolbarSet TD |
700 | +{ |
701 | + font-size: 11px; |
702 | + font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; |
703 | +} |
704 | + |
705 | +.TB_Toolbar |
706 | +{ |
707 | + height: 24px; |
708 | + display: inline-table; /* inline = Opera jumping buttons bug */ |
709 | +} |
710 | + |
711 | +.TB_Separator |
712 | +{ |
713 | + width: 1px; |
714 | + height: 16px; |
715 | + margin: 2px; |
716 | + background-color: #E6E5E5; |
717 | +} |
718 | + |
719 | +.TB_Start |
720 | +{ |
721 | + background-image: url(images/toolbar.start.gif); |
722 | + margin: 2px; |
723 | + width: 3px; |
724 | + background-repeat: no-repeat; |
725 | + height: 16px; |
726 | +} |
727 | + |
728 | +.TB_End |
729 | +{ |
730 | + display: none; |
731 | +} |
732 | + |
733 | +.TB_ExpandImg |
734 | +{ |
735 | + background-image: url(images/toolbar.expand.gif); |
736 | + background-repeat: no-repeat; |
737 | +} |
738 | + |
739 | +.TB_CollapseImg |
740 | +{ |
741 | + background-image: url(images/toolbar.collapse.gif); |
742 | + background-repeat: no-repeat; |
743 | +} |
744 | + |
745 | +.TB_SideBorder |
746 | +{ |
747 | + background-color: #CCC1C1; |
748 | +} |
749 | + |
750 | +.TB_Expand, .TB_Collapse |
751 | +{ |
752 | + padding: 2px 2px 2px 2px; |
753 | + border: #CCC1C1 1px solid; |
754 | +} |
755 | + |
756 | +.TB_Collapse |
757 | +{ |
758 | + width: 5px; |
759 | +} |
760 | + |
761 | +.TB_Break |
762 | +{ |
763 | + height: 24px; /* IE needs the height to be set, otherwise no break */ |
764 | +} |
765 | + |
766 | +/* |
767 | + Toolbar Button |
768 | +*/ |
769 | + |
770 | +.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled |
771 | +{ |
772 | + border: #E6E5E5 1px solid; /* This is the default border */ |
773 | + height: 22px; /* The height is necessary, otherwise IE will not apply the alpha */ |
774 | +} |
775 | + |
776 | +.TB_Button_On |
777 | +{ |
778 | + border: #6C7B7C 1px solid; |
779 | + background-color: #6C7B7C; |
780 | +} |
781 | + |
782 | +.TB_Button_On_Over, .TB_Button_Off_Over |
783 | +{ |
784 | + border: #6C7B7C 1px solid; |
785 | + background-color: #6C7B7C; |
786 | +} |
787 | + |
788 | +.TB_Button_Off |
789 | +{ |
790 | + filter: alpha(opacity=70); /* IE */ |
791 | + opacity: 0.70; /* Safari, Opera and Mozilla */ |
792 | +} |
793 | + |
794 | +.TB_Button_Disabled |
795 | +{ |
796 | + filter: gray() alpha(opacity=30); /* IE */ |
797 | + opacity: 0.30; /* Safari, Opera and Mozilla */ |
798 | +} |
799 | + |
800 | +.TB_Button_Padding |
801 | +{ |
802 | + visibility: hidden; |
803 | + width: 3px; |
804 | + height: 22px; |
805 | +} |
806 | + |
807 | +.TB_Button_Image |
808 | +{ |
809 | + overflow: hidden; |
810 | + width: 16px; |
811 | + height: 16px; |
812 | + margin: 3px; |
813 | + background-repeat: no-repeat; |
814 | +} |
815 | + |
816 | +.TB_Button_Image img |
817 | +{ |
818 | + position: relative; |
819 | +} |
820 | + |
821 | +.TB_Button_Off .TB_Button_Text |
822 | +{ |
823 | + background-color: #efefde; /* Needed because of a bug on Clear Type */ |
824 | +} |
825 | + |
826 | +.TB_ConnectionLine |
827 | +{ |
828 | + background-color: #ffffff; |
829 | + height: 1px; |
830 | + margin-left: 1px; /* ltr */ |
831 | + margin-right: 1px; /* rtl */ |
832 | +} |
833 | + |
834 | +.TB_Text |
835 | +{ |
836 | + height: 22px; |
837 | +} |
838 | + |
839 | +.TB_Button_Off .TB_Text |
840 | +{ |
841 | + background-color: #efefde ; /* Needed because of a bug on ClearType */ |
842 | +} |
843 | + |
844 | +.TB_Button_On_Over .TB_Text |
845 | +{ |
846 | + background-color: #dff1ff ; /* Needed because of a bug on ClearType */ |
847 | +} |
848 | + |
849 | +/* |
850 | + Menu |
851 | +*/ |
852 | + |
853 | +.MN_Menu |
854 | +{ |
855 | + border: 1px solid #8f8f73; |
856 | + padding: 2px; |
857 | + background-color: #ffffff; |
858 | + cursor: default; |
859 | +} |
860 | + |
861 | +.MN_Menu, .MN_Menu .MN_Label |
862 | +{ |
863 | + font-size: 11px; |
864 | + font-family: Ubuntu, 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; |
865 | +} |
866 | + |
867 | +.MN_Item_Padding |
868 | +{ |
869 | + visibility: hidden; |
870 | + width: 3px; |
871 | + height: 20px; |
872 | +} |
873 | + |
874 | +.MN_Icon |
875 | +{ |
876 | + background-color: #e3e3c7; |
877 | + text-align: center; |
878 | + height: 20px; |
879 | +} |
880 | + |
881 | +.MN_Label |
882 | +{ |
883 | + padding-left: 3px; |
884 | + padding-right: 3px; |
885 | +} |
886 | + |
887 | +.MN_Separator |
888 | +{ |
889 | + height: 3px; |
890 | +} |
891 | + |
892 | +.MN_Separator_Line |
893 | +{ |
894 | + border-top: #b9b99d 1px solid; |
895 | +} |
896 | + |
897 | +.MN_Item .MN_Icon IMG |
898 | +{ |
899 | + filter: alpha(opacity=70); |
900 | + opacity: 0.70; |
901 | +} |
902 | + |
903 | +.MN_Item_Over |
904 | +{ |
905 | + color: #ffffff; |
906 | + background-color: #8f8f73; |
907 | +} |
908 | + |
909 | +.MN_Item_Over .MN_Icon |
910 | +{ |
911 | + background-color: #737357; |
912 | +} |
913 | + |
914 | +.MN_Item_Disabled IMG |
915 | +{ |
916 | + filter: gray() alpha(opacity=30); /* IE */ |
917 | + opacity: 0.30; /* Safari, Opera and Mozilla */ |
918 | +} |
919 | + |
920 | +.MN_Item_Disabled .MN_Label |
921 | +{ |
922 | + color: #b7b7b7; |
923 | +} |
924 | + |
925 | +.MN_Arrow |
926 | +{ |
927 | + padding-right: 3px; |
928 | + padding-left: 3px; |
929 | +} |
930 | + |
931 | +.MN_ConnectionLine |
932 | +{ |
933 | + background-color: #ffffff; |
934 | +} |
935 | + |
936 | +.Menu .TB_Button_On, .Menu .TB_Button_On_Over |
937 | +{ |
938 | + border: #8f8f73 1px solid; |
939 | + background-color: #ffffff; |
940 | +} |
941 | + |
942 | +/* |
943 | + ### Panel Styles |
944 | +*/ |
945 | + |
946 | +.FCK_Panel |
947 | +{ |
948 | + border: #8f8f73 1px solid; |
949 | + padding: 2px; |
950 | + background-color: #ffffff; |
951 | +} |
952 | + |
953 | +.FCK_Panel, .FCK_Panel TD |
954 | +{ |
955 | + font-family: Ubuntu, 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; |
956 | + font-size: 11px; |
957 | +} |
958 | + |
959 | +/* |
960 | + ### Special Combos |
961 | +*/ |
962 | + |
963 | +.SC_Panel |
964 | +{ |
965 | + overflow: auto; |
966 | + white-space: nowrap; |
967 | + cursor: default; |
968 | + border: 1px solid #8f8f73; |
969 | + padding-left: 2px; |
970 | + padding-right: 2px; |
971 | +} |
972 | + |
973 | +.SC_Panel, .SC_Panel TD |
974 | +{ |
975 | + font-size: 11px; |
976 | + font-family: Ubuntu, 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; |
977 | +} |
978 | + |
979 | +.SC_Item, .SC_ItemSelected |
980 | +{ |
981 | + margin-top: 2px; |
982 | + margin-bottom: 2px; |
983 | + background-position: left center; |
984 | + padding-left: 11px; |
985 | + padding-right: 3px; |
986 | + padding-top: 2px; |
987 | + padding-bottom: 2px; |
988 | + text-overflow: ellipsis; |
989 | + overflow: hidden; |
990 | + background-repeat: no-repeat; |
991 | + border: #dddddd 1px solid; |
992 | +} |
993 | + |
994 | +.SC_Item *, .SC_ItemSelected * |
995 | +{ |
996 | + margin-top: 0px; |
997 | + margin-bottom: 0px; |
998 | +} |
999 | + |
1000 | +.SC_ItemSelected |
1001 | +{ |
1002 | + border: #9a9afb 1px solid; |
1003 | + background-image: url(images/toolbar.arrowright.gif); |
1004 | +} |
1005 | + |
1006 | +.SC_ItemOver |
1007 | +{ |
1008 | + border: #316ac5 1px solid; |
1009 | +} |
1010 | + |
1011 | +.SC_Field |
1012 | +{ |
1013 | + border: #b7b7a6 1px solid; |
1014 | + cursor: default; |
1015 | +} |
1016 | + |
1017 | +.SC_FieldCaption |
1018 | +{ |
1019 | + overflow: visible; |
1020 | + padding-right: 5px; |
1021 | + padding-left: 5px; |
1022 | + opacity: 0.75; /* Safari, Opera and Mozilla */ |
1023 | + filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */ |
1024 | + height: 23px; |
1025 | + background-color: #efefde; |
1026 | +} |
1027 | + |
1028 | +.SC_FieldLabel |
1029 | +{ |
1030 | + white-space: nowrap; |
1031 | + padding: 2px; |
1032 | + width: 100%; |
1033 | + cursor: default; |
1034 | + background-color: #ffffff; |
1035 | + text-overflow: ellipsis; |
1036 | + overflow: hidden; |
1037 | +} |
1038 | + |
1039 | +.SC_FieldButton |
1040 | +{ |
1041 | + background-position: center center; |
1042 | + background-image: url(images/toolbar.buttonarrow.gif); |
1043 | + border-left: #b7b7a6 1px solid; |
1044 | + width: 14px; |
1045 | + background-repeat: no-repeat; |
1046 | +} |
1047 | + |
1048 | +.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption, .SC_FieldDisabled .TB_ButtonType_Text |
1049 | +{ |
1050 | + opacity: 0.30; /* Safari, Opera and Mozilla */ |
1051 | + filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */ |
1052 | +} |
1053 | + |
1054 | +.SC_FieldOver |
1055 | +{ |
1056 | + border: #316ac5 1px solid; |
1057 | +} |
1058 | + |
1059 | +.SC_FieldOver .SC_FieldButton |
1060 | +{ |
1061 | + border-left: #316ac5 1px solid; |
1062 | +} |
1063 | + |
1064 | +/* |
1065 | + ### Color Selector Panel |
1066 | +*/ |
1067 | + |
1068 | +.ColorBoxBorder |
1069 | +{ |
1070 | + border: #808080 1px solid; |
1071 | + position: static; |
1072 | +} |
1073 | + |
1074 | +.ColorBox |
1075 | +{ |
1076 | + font-size: 1px; |
1077 | + width: 10px; |
1078 | + position: static; |
1079 | + height: 10px; |
1080 | +} |
1081 | + |
1082 | +.ColorDeselected, .ColorSelected |
1083 | +{ |
1084 | + cursor: default; |
1085 | +} |
1086 | + |
1087 | +.ColorDeselected |
1088 | +{ |
1089 | + border: #ffffff 1px solid; |
1090 | + padding: 2px; |
1091 | + float: left; |
1092 | +} |
1093 | + |
1094 | +.ColorSelected |
1095 | +{ |
1096 | + border: #330066 1px solid; |
1097 | + padding: 2px; |
1098 | + float: left; |
1099 | + background-color: #c4cdd6; |
1100 | +} |
1101 | |
1102 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/fck_editorarea.css' |
1103 | --- src/schooltool/skin/flourish/resources/fckeditor/fck_editorarea.css 1970-01-01 00:00:00 +0000 |
1104 | +++ src/schooltool/skin/flourish/resources/fckeditor/fck_editorarea.css 2011-12-21 15:04:26 +0000 |
1105 | @@ -0,0 +1,110 @@ |
1106 | +/* |
1107 | + * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
1108 | + * Copyright (C) 2003-2009 Frederico Caldeira Knabben |
1109 | + * |
1110 | + * == BEGIN LICENSE == |
1111 | + * |
1112 | + * Licensed under the terms of any of the following licenses at your |
1113 | + * choice: |
1114 | + * |
1115 | + * - GNU General Public License Version 2 or later (the "GPL") |
1116 | + * http://www.gnu.org/licenses/gpl.html |
1117 | + * |
1118 | + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
1119 | + * http://www.gnu.org/licenses/lgpl.html |
1120 | + * |
1121 | + * - Mozilla Public License Version 1.1 or later (the "MPL") |
1122 | + * http://www.mozilla.org/MPL/MPL-1.1.html |
1123 | + * |
1124 | + * == END LICENSE == |
1125 | + * |
1126 | + * This is the default CSS file used by the editor area. It defines the |
1127 | + * initial font of the editor and background color. |
1128 | + * |
1129 | + * A user can configure the editor to use another CSS file. Just change |
1130 | + * the value of the FCKConfig.EditorAreaCSS key in the configuration |
1131 | + * file. |
1132 | + */ |
1133 | + |
1134 | +/** |
1135 | + * The "body" styles should match your editor web site, mainly regarding |
1136 | + * background color and font family and size. |
1137 | + */ |
1138 | + |
1139 | +body |
1140 | +{ |
1141 | + background-color: #ffffff; |
1142 | + padding: 5px 5px 5px 5px; |
1143 | + margin: 0px; |
1144 | +} |
1145 | + |
1146 | +body, td |
1147 | +{ |
1148 | + font-family: Ubuntu, Arial, Verdana, sans-serif; |
1149 | + font-size: 12px; |
1150 | +} |
1151 | + |
1152 | +a[href] |
1153 | +{ |
1154 | + color: -moz-hyperlinktext !important; /* For Firefox... mark as important, otherwise it becomes black */ |
1155 | + text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */ |
1156 | +} |
1157 | + |
1158 | +/** |
1159 | + * Just uncomment the following block if you want to avoid spaces between |
1160 | + * paragraphs. Remember to apply the same style in your output front end page. |
1161 | + */ |
1162 | + |
1163 | +/* |
1164 | +p, ul, li |
1165 | +{ |
1166 | + margin-top: 0px; |
1167 | + margin-bottom: 0px; |
1168 | +} |
1169 | +*/ |
1170 | + |
1171 | +/** |
1172 | + * Uncomment the following block, or only selected lines if appropriate, |
1173 | + * if you have some style items that would break the styles combo box. |
1174 | + * You can also write other CSS overrides inside the style block below |
1175 | + * as needed and they will be applied to inside the style combo only. |
1176 | + */ |
1177 | + |
1178 | +/* |
1179 | +.SC_Item *, .SC_ItemSelected * |
1180 | +{ |
1181 | + margin: 0px !important; |
1182 | + padding: 0px !important; |
1183 | + text-indent: 0px !important; |
1184 | + clip: auto !important; |
1185 | + position: static !important; |
1186 | +} |
1187 | +*/ |
1188 | + |
1189 | +/** |
1190 | + * The following are some sample styles used in the "Styles" toolbar command. |
1191 | + * You should instead remove them, and include the styles used by the site |
1192 | + * you are using the editor in. |
1193 | + */ |
1194 | + |
1195 | +.Bold |
1196 | +{ |
1197 | + font-weight: bold; |
1198 | +} |
1199 | + |
1200 | +.Title |
1201 | +{ |
1202 | + font-weight: bold; |
1203 | + font-size: 18px; |
1204 | + color: #cc3300; |
1205 | +} |
1206 | + |
1207 | +.Code |
1208 | +{ |
1209 | + border: #8b4513 1px solid; |
1210 | + padding-right: 5px; |
1211 | + padding-left: 5px; |
1212 | + color: #000066; |
1213 | + font-family: Ubuntu, 'Courier New' , Monospace; |
1214 | + background-color: #ff9933; |
1215 | +} |
1216 | |
1217 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/fck_strip.gif' |
1218 | Binary files src/schooltool/skin/flourish/resources/fckeditor/fck_strip.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/fck_strip.gif 2011-12-21 15:04:26 +0000 differ |
1219 | === added directory 'src/schooltool/skin/flourish/resources/fckeditor/images' |
1220 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.gif' |
1221 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.gif 2011-12-21 15:04:26 +0000 differ |
1222 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.png' |
1223 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.png 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.png 2011-12-21 15:04:26 +0000 differ |
1224 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.rtl.png' |
1225 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.rtl.png 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/dialog.sides.rtl.png 2011-12-21 15:04:26 +0000 differ |
1226 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/sprites.gif' |
1227 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/sprites.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/sprites.gif 2011-12-21 15:04:26 +0000 differ |
1228 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/sprites.png' |
1229 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/sprites.png 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/sprites.png 2011-12-21 15:04:26 +0000 differ |
1230 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.arrowright.gif' |
1231 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.arrowright.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.arrowright.gif 2011-12-21 15:04:26 +0000 differ |
1232 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.buttonarrow.gif' |
1233 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.buttonarrow.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.buttonarrow.gif 2011-12-21 15:04:26 +0000 differ |
1234 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.collapse.gif' |
1235 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.collapse.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.collapse.gif 2011-12-21 15:04:26 +0000 differ |
1236 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.end.gif' |
1237 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.end.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.end.gif 2011-12-21 15:04:26 +0000 differ |
1238 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.expand.gif' |
1239 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.expand.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.expand.gif 2011-12-21 15:04:26 +0000 differ |
1240 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.separator.gif' |
1241 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.separator.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.separator.gif 2011-12-21 15:04:26 +0000 differ |
1242 | === added file 'src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.start.gif' |
1243 | Binary files src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.start.gif 1970-01-01 00:00:00 +0000 and src/schooltool/skin/flourish/resources/fckeditor/images/toolbar.start.gif 2011-12-21 15:04:26 +0000 differ |
1244 | === modified file 'src/schooltool/skin/flourish/widgets.py' |
1245 | --- src/schooltool/skin/flourish/widgets.py 2011-09-14 13:18:02 +0000 |
1246 | +++ src/schooltool/skin/flourish/widgets.py 2011-12-21 15:04:26 +0000 |
1247 | @@ -24,10 +24,23 @@ |
1248 | import sys |
1249 | |
1250 | import zope.formlib.widgets |
1251 | -from zope.component import getUtility |
1252 | +from zope.component import getUtility, adapter |
1253 | +from zope.interface import implementer |
1254 | from zope.i18n.interfaces import INegotiator |
1255 | - |
1256 | +from zope.traversing.browser.absoluteurl import absoluteURL |
1257 | +from zope.schema.interfaces import IField |
1258 | + |
1259 | +from z3c.form.interfaces import IFieldWidget |
1260 | +from z3c.form.widget import ComputedWidgetAttribute, FieldWidget |
1261 | +import zc.resourcelibrary |
1262 | + |
1263 | +from schooltool.app.interfaces import ISchoolToolApplication |
1264 | +from schooltool.skin.widgets import FCKConfig |
1265 | +from schooltool.skin.widgets import IFckeditorWidget |
1266 | +from schooltool.skin.widgets import FckeditorFormlibWidget |
1267 | +from schooltool.skin.widgets import FckeditorZ3CFormWidget |
1268 | from schooltool.skin.flourish.resource import ResourceLibrary |
1269 | +from schooltool.skin.flourish.interfaces import IFlourishLayer |
1270 | |
1271 | |
1272 | class JQueryI18nLibrary(ResourceLibrary): |
1273 | @@ -73,3 +86,70 @@ |
1274 | |
1275 | class FormlibDateWidget(zope.formlib.widgets.DateWidget): |
1276 | cssClass="date-field" |
1277 | + |
1278 | + |
1279 | +Flourish_fckeditor_config = ComputedWidgetAttribute( |
1280 | + lambda a: FCKConfig(288, 160), |
1281 | + request=IFlourishLayer, |
1282 | + widget=IFckeditorWidget, |
1283 | + ) |
1284 | + |
1285 | + |
1286 | +class FlourishFckeditorScriptBase(object): |
1287 | + |
1288 | + @property |
1289 | + def script(self): |
1290 | + zc.resourcelibrary.need("fckeditor") |
1291 | + config = self.config |
1292 | + |
1293 | + app_url = absoluteURL(ISchoolToolApplication(None), self.request) |
1294 | + fck_config_path = '%s%s' % ( |
1295 | + app_url, config.path) |
1296 | + fck_editor_path = '%s/@@/fckeditor/%s/fckeditor/' % ( |
1297 | + app_url, self.fckversion) |
1298 | + fck_skin_path = '%s/@@/schooltool.skin.flourish-fckeditor/' % ( |
1299 | + app_url) |
1300 | + fck_editor_css_path = '%s%s' % (fck_skin_path, 'fck_editorarea.css') |
1301 | + |
1302 | + # XXX: using some values that may be not JS safe |
1303 | + return ''' |
1304 | + <script type="text/javascript" language="JavaScript"> |
1305 | + var %(variable)s = new FCKeditor( |
1306 | + "%(id)s", %(width)d, %(height)d, "%(toolbar)s"); |
1307 | + %(variable)s.BasePath = "%(fckBasePath)s"; |
1308 | + %(variable)s.Config["CustomConfigurationsPath"] = "%(customConfigPath)s"; |
1309 | + %(variable)s.Config["SkinPath"] = "%(fckSkinPath)s"; |
1310 | + %(variable)s.Config["EditorAreaCSS"] = "%(fckEditorAreaCSS)s"; |
1311 | + %(variable)s.ReplaceTextarea(); |
1312 | + </script> |
1313 | + ''' % { |
1314 | + 'id': self.element_id, |
1315 | + 'variable': self.editor_var_name, |
1316 | + 'width': config.width, |
1317 | + 'height': config.height, |
1318 | + 'toolbar': config.toolbar, |
1319 | + 'customConfigPath': fck_config_path, |
1320 | + 'fckBasePath': fck_editor_path, |
1321 | + 'fckSkinPath': fck_skin_path, |
1322 | + 'fckEditorAreaCSS': fck_editor_css_path, |
1323 | + } |
1324 | + |
1325 | + |
1326 | +class FlourishFckeditorFormlibWidget(FlourishFckeditorScriptBase, |
1327 | + FckeditorFormlibWidget): |
1328 | + |
1329 | + def __init__(self, *args, **kw): |
1330 | + super(FlourishFckeditorFormlibWidget, self).__init__(*args, **kw) |
1331 | + self.config = FCKConfig(288, 160) |
1332 | + |
1333 | + |
1334 | +class FlourishFckeditorZ3CFormWidget(FlourishFckeditorScriptBase, |
1335 | + FckeditorZ3CFormWidget): |
1336 | + |
1337 | + pass |
1338 | + |
1339 | + |
1340 | +@adapter(IField, IFlourishLayer) |
1341 | +@implementer(IFieldWidget) |
1342 | +def FlourishFckeditorFieldWidget(field, request): |
1343 | + return FieldWidget(field, FlourishFckeditorZ3CFormWidget(request)) |
1344 | |
1345 | === modified file 'src/schooltool/skin/flourish/widgets.zcml' |
1346 | --- src/schooltool/skin/flourish/widgets.zcml 2011-08-30 16:43:23 +0000 |
1347 | +++ src/schooltool/skin/flourish/widgets.zcml 2011-12-21 15:04:26 +0000 |
1348 | @@ -12,7 +12,7 @@ |
1349 | type="schooltool.skin.flourish.IFlourishLayer" |
1350 | for="zope.html.field.IHtmlFragmentField" |
1351 | provides="zope.app.form.interfaces.IInputWidget" |
1352 | - factory="schooltool.skin.widgets.FckeditorFormlibWidget" |
1353 | + factory=".widgets.FlourishFckeditorFormlibWidget" |
1354 | permission="zope.Public" |
1355 | /> |
1356 | |
1357 | @@ -45,4 +45,15 @@ |
1358 | schooltool.skin.flourish.IFlourishLayer" |
1359 | /> |
1360 | |
1361 | + <zope:adapter |
1362 | + factory=".widgets.FlourishFckeditorFieldWidget" |
1363 | + for="zope.html.field.IHtmlFragmentField |
1364 | + schooltool.skin.flourish.IFlourishLayer" |
1365 | + /> |
1366 | + |
1367 | + <zope:adapter |
1368 | + factory="schooltool.skin.flourish.widgets.Flourish_fckeditor_config" |
1369 | + name="config" |
1370 | + /> |
1371 | + |
1372 | </configure> |
Beautiful.