-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (110 loc) · 4.95 KB
/
index.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="js/codemirror.js" type="text/javascript"></script>
<title>FetchXMLToSQL | Convert fetchXml to SQL Online</title>
<link rel="stylesheet" type="text/css" href="styles/milligram.min.css" />
<link rel="stylesheet" type="text/css" href="styles/style.css" />
<style type="text/css">
.CodeMirror-line-numbers {
width: 2.2em;
color: #aaa;
background-color: #eee;
text-align: right;
padding-right: .3em;
font-size: 10pt;
font-family: monospace;
padding-top: .4em;
line-height: normal;
}
</style>
</head>
<body>
<div class="row" style="height:100%">
<div class="column column-20" style="position:relative">
<h2></h2>
<h2><font color="#9b4dca"><</font>fetchXml<font color="#9b4dca">/></font></h2>
<h2> to</h2>
<h2> <font color="#9b4dca">SQL</font></h2>
<input id="open" style="width:100%; margin-bottom:25px; margin-top:10px" class="button-small button-outline" value="Open a File" type="submit" onclick="loadFile()" />
<input type="url" style="width:100%; margin-bottom:5px;" class="btn" id="orgURL" placeholder="Enter Organization URL" wrap="off" />
<input id="addURL" style="width:100%" class="button-outline" value="Add URL" type="submit" onclick="" />
<div id="orgList"></div>
<div style="bottom:0px; position:absolute;">
<a href="https://www.ashishvishwakarma.com/test-fetchxml-with-webapi-dynamics-365-fetchxml-tester/">Help?</a>
</div>
</div>
<div class="column column-80" data-balloon="Paste your fetchXml here to test." data-balloon-pos="left">
<textarea id="fetchXml" wrap="off" autofocus><fetch mapping='logical'>
<entity name='account'>
<attribute name='accountid'/>
<attribute name='name'/>
<link-entity name='systemuser' to='owninguser'>
<filter type='and'>
<condition attribute='lastname' operator='ne' value='Cannon' />
</filter>
</link-entity>
</entity>
</fetch> </textarea>
<div class="row">
<div class="column column-80">
<input id="btnConvert" style="width:100%" class="btn" value="Convert FetchXML To SQL" type="submit" />
<br />
</div>
<div class="column column-20" data-balloon="Click to beautify/format fetchXml" data-balloon-pos="top">
<input id="beautify" style="width:100%" class="button button-outline" value="Beautify" type="submit" />
</div>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div style="bottom:0px; position:absolute;font-size:small;right:25px">
<a target="_blank" id="finalURI" href="https://AshishVishwakarma.com">|</a><a target="_blank" href="https://github.com/AshV/FetchXMLToSQL">FetchXMLToSQL</a> built with <font color="red">❤</font> by <a target="_blank" href="https://AshishVishwakarma.com">AshV</a>
</div>
</div>
<script src="js/script.js"></script>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea('fetchXml', {
height: "50%",
parserfile: "parsexml.js",
stylesheet: "styles/xmlcolors.css",
path: "js/",
continuousScanning: 500,
lineNumbers: true,
onChange: function () {
//fetchXmlOnchange();
}
});
</script>
<input style="position: absolute; top: -100px;" type="file" id="file-input" accept="text/plain,text/xml" />
<script>
function loadFile() {
document.getElementById('file-input').click();
}
function readSingleFile(e) {
var file = e.target.files[0];
if (!file) {
return;
}
var reader = new FileReader();
reader.onload = function (e) {
var contents = e.target.result;
displayContents(contents);
};
reader.readAsText(file);
}
function displayContents(contents) {
editor.setCode(contents);
var queryName = document.getElementById('file-input').value;
queryName = queryName.substring(queryName.lastIndexOf('\\') + 1);
document.getElementById('queryName').value = queryName;
document.title = queryName;
}
document.getElementById('file-input').addEventListener('change', readSingleFile, false);
</script>
</body>
</html>