source: branches/1.2/workflow/js/jscode/rtf.js @ 1349

Revision 1349, 2.1 KB checked in by niltonneto, 15 years ago (diff)

Ticket #561 - Inclusão do módulo Workflow faltante nessa versão.

  • Property svn:executable set to *
Line 
1// Esse arquivo serve para customizar o editor RTF existente na API do eGroupWare.
2// Foram escondidos alguns botões e também foi traduzido para o português - BR algumas palavras que faltavam.
3// Autor: Nilton E. Buhrer Neto
4// Modificado para uso no workflow
5
6_editor_url = "workflow/js/htmlarea";
7_editor_lang = "pt_br";
8
9document.write('<script');
10document.write(' language="javascript"');
11document.write(' type="text/javascript"');
12document.write(' src="' + _editor_url + '/htmlarea.js">');
13document.write('</script>');
14
15document.write('<script');
16document.write(' language="javascript"');
17document.write(' type="text/javascript"');
18document.write(' src="' + _editor_url + '/plugins/CharacterMap/character-map.js">');
19document.write('</script>');
20
21document.write('<script');
22document.write(' language="javascript"');
23document.write(' type="text/javascript"');
24document.write(' src="' + _editor_url + '/plugins/CharacterMap/lang/en.js">');
25document.write('</script>');
26
27function initDocument(fieldName)
28{
29        if (typeof(this.editor) == "undefined")
30                this.editor = new Array();
31        if (!fieldName)
32                fieldName = "body_rtf";
33
34        var numberOfEditors = this.editor.length;
35
36        this.editor[numberOfEditors] = new HTMLArea(fieldName);
37        this.editor[numberOfEditors].config.formatblock = {
38                "Título 1": "h1",
39                "Título 2": "h2",
40                "Título 3": "h3",
41                "Título 4": "h4",
42                "Título 5": "h5",
43                "Título 6": "h6",
44                "Normal": "p",
45                "Endereço": "address",
46                "Pré-formatado": "pre"
47        };
48
49        this.editor[numberOfEditors].config.hideSomeButtons(" insertimage about cut copy paste htmlmode popupeditor showhelp ");
50
51        this.editor[numberOfEditors].config.height="600";
52        if(screen.width >= 1024)
53                this.editor[numberOfEditors].config.width="713";
54        else
55                this.editor[numberOfEditors].config.width="642";
56
57        this.editor[numberOfEditors].config.statusBar = false;
58        this.editor[numberOfEditors].registerPlugin("CharacterMap");
59
60        this.editor[numberOfEditors].generate();
61}
62
63function endDocument()
64{
65        editor = (this.editor) ? this.editor : parent.editor;
66        for (var i = 0; i < editor.length; i++)
67                editor[i]._textArea.value = editor[i].getInnerHTML();
68}
Note: See TracBrowser for help on using the repository browser.