]>
git.proxmox.com Git - pmg-gui.git/blob - js/ViewMailHeaders.js
2 Ext
.define('PMG.ViewMailHeaders', {
3 extend
: 'Ext.window.Window',
4 alias
: 'widget.pmgViewMailHeaders',
23 xclass
: 'Ext.app.ViewController',
25 init: function(view
) {
27 var panel
= view
.lookupReference('contentPanel');
29 Proxmox
.Utils
.API2Request({
33 success: function(response
, opts
) {
34 var data
= response
.result
.data
;
35 var from = data
.match(/^FROM:\s*(.*\S)\s*$/mi);
37 view
.lookupReference('fromField').setValue(from[1]);
39 var to
= data
.match(/^TO:\s*(.*\S)\s*$/mi);
41 view
.lookupReference('toField').setValue(to
[1]);
43 var subject
= data
.match(/^SUBJECT:\s*(.*\S)\s*$/mi);
45 view
.lookupReference('subjectField').setValue(subject
[1]);
47 panel
.update(Ext
.String
.htmlEncode(data
));
49 failure: function (response
, opts
) {
51 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
61 fieldLabel
: gettext('From'),
62 reference
: 'fromField',
68 fieldLabel
: gettext('To'),
75 fieldLabel
: gettext('Subject'),
76 reference
: 'subjectField',
81 xtype
: 'displayfield',
82 fieldLabel
: gettext('Header')
87 reference
: 'contentPanel',
90 bodyStyle
: 'white-space:pre'