-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacroEditor.html
80 lines (68 loc) · 1.75 KB
/
macroEditor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="ac.js" type="text/javascript"></script>
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/5.9.12/css/aui.min.css" media="all">
<style type="text/css">
body {
font-family: Arial, sans-serif;
overflow: hidden;
height: 100%;
width: 100%;
margin: 0;
}
</style>
<script type="text/javascript">
var baseUrl = AC.getUrlParam('xdm_e', true) + AC.getUrlParam('cp', true);
var connectUrl = baseUrl + '/atlassian-connect';
var macroDialog = null;
var head = document.getElementsByTagName("head")[0];
function loadAtlassianApi()
{
var script = document.createElement("script");
script.src = connectUrl + '/all.js';
script.setAttribute('data-options', 'resize:false;margin:false');
script.onload = function()
{
AP.require([ "confluence", "dialog" ], function(confluence, dialog)
{
function onSubmit()
{
var macroParams =
{
count : '2'
};
// Second save macro when editor exits
confluence.saveMacro(macroParams);
confluence.closeMacroEditor();
return true;
}
confluence.getMacroData(function(macroParams)
{
var macroParams =
{
count : '1'
};
// First save macro when editor is launched
confluence.saveMacro(macroParams);
});
macroDialog = dialog;
dialog.getButton("submit").bind(onSubmit);
});
};
head.appendChild(script);
}
loadAtlassianApi();
</script>
</head>
<body style="height : 600px">
<div style="height : 100%;">
<div style="height : 100%; width : 350px;border-right : 1px solid #cccccc;float : left;">
</div>
<div id="preview" style="height : 100%; float : left;">
</div>
</div>
</body>
</html>