[795] | 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 | |
---|
| 9 | document.write('<script'); |
---|
| 10 | document.write(' language="javascript"'); |
---|
| 11 | document.write(' type="text/javascript"'); |
---|
| 12 | document.write(' src="' + _editor_url + '/htmlarea.js">'); |
---|
| 13 | document.write('</script>'); |
---|
| 14 | |
---|
| 15 | document.write('<script'); |
---|
| 16 | document.write(' language="javascript"'); |
---|
| 17 | document.write(' type="text/javascript"'); |
---|
| 18 | document.write(' src="' + _editor_url + '/plugins/CharacterMap/character-map.js">'); |
---|
| 19 | document.write('</script>'); |
---|
| 20 | |
---|
| 21 | document.write('<script'); |
---|
| 22 | document.write(' language="javascript"'); |
---|
| 23 | document.write(' type="text/javascript"'); |
---|
| 24 | document.write(' src="' + _editor_url + '/plugins/CharacterMap/lang/en.js">'); |
---|
| 25 | document.write('</script>'); |
---|
| 26 | |
---|
| 27 | function 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 | |
---|
| 63 | function 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 | } |
---|