-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
179 lines (168 loc) · 8.7 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html>
<head>
<link rel="manifest" href="manifest.json" />
<script type="module">
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
const el = document.createElement('pwa-update');
document.body.appendChild(el);
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CGWJKN5SH2"></script>
<script>window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-CGWJKN5SH2');</script>
<script src="js/codemirror.js" type="text/javascript"></script>
<!-- HTML Meta Tags -->
<title>Fetch Xml Tester Tool Online</title>
<meta name="description" content="Test your fetchXml without need of providing your credentials. ">
<!-- Google / Search Engine Tags -->
<meta itemprop="name" content="Fetch Xml Tester Tool Online">
<meta itemprop="description" content="Test your fetchXml without need of providing your credentials. ">
<meta itemprop="image" content="https://github.com/AshV/FetchXmlTester/raw/master/logo.png">
<!-- Facebook Meta Tags -->
<meta property="og:url" content="https://www.ashishvishwakarma.com/FetchXmlTester">
<meta property="og:type" content="website">
<meta property="og:title" content="Fetch Xml Tester Tool Online">
<meta property="og:description" content="Test your fetchXml without need of providing your credentials. ">
<meta property="og:image" content="https://github.com/AshV/FetchXmlTester/raw/master/logo.png">
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Fetch Xml Tester Tool Online">
<meta name="twitter:description" content="Test your fetchXml without need of providing your credentials. ">
<meta name="twitter:image" content="https://github.com/AshV/FetchXmlTester/raw/master/logo.png">
<!-- Meta Tags Generated via http://heymeta.com -->
<meta name="keywords" content="fetchXML,Dynamics,CRM,365,CE,CX">
<meta name="author" content="Ashish Vishwakarma">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="styles/milligram.min.css" />
<link rel="stylesheet" type="text/css" href="styles/style.css" />
<link rel="stylesheet" type="text/css" href="styles/balloon.min.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:80%">
<div class="column column-20" style="position:relative">
<h2></h2>
<h2><fetchXml<font color="#9b4dca">/</font>></h2>
<h2><tester<font color="#9b4dca">/</font>></h2>
<h2><online<font color="#9b4dca">/</font>></h2>
<div style="bottom:0px; position:absolute;">
<a href="https://www.ashishvishwakarma.com/posts/">Read my articles!</a>
<br />
<a href="https://www.ashishvishwakarma.com/test-fetchxml-with-webapi-dynamics-365-fetchxml-tester/">Help?</a>
<br />
<a class="github-button" href="https://github.com/AshV" data-size="large" data-show-count="true" aria-label="Follow @AshV on GitHub">Follow @AshV</a>
<br />
<a class="github-button" href="https://github.com/AshV/FetchXmlTester" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star AshV/FetchXmlTester on GitHub">Star</a>
<br />
</div>
</div>
<div class="column column-80" data-balloon="Paste your fetchXml here to test." data-balloon-pos="left">
<div class="row">
<div class="column column-20">
<input id="open" style="width:100%" class="button-small button-outline" value="Open File" type="submit" onclick="loadFile()" />
</div>
<div class="column column-60">
<input id="queryName" type="text" placeholder="What is this query for?" />
</div>
<div class="column column-20">
<input id="save" style="width:100%" class="button button-outline" value="Save As File" type="submit" />
</div>
</div>
<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>
</div>
</div>
<div class="row">
<div class="column column-40" data-balloon="Dynanics 365 Url which is currently logged-in in same browser session." data-balloon-pos="up">
<input type="url" style="width:100%" class="btn" id="orgURL" placeholder="e.g https://OrganizationName.crm.dynamics.com" wrap="off"></input>
</div>
<div class="column column-20" data-balloon="Plural name of entity, please modify if Invalid" data-balloon-pos="top">
<input type="text" style="width:100%" class="btn" id="plural" placeholder="e.g. Entities" value="accounts" />
</div>
<div class="column column-20" data-balloon="Copy Query Tool Link To Share" data-balloon-pos="top">
<input id="copyLink" style="width:100%" class="button button-outline" value="Copy Query Link" type="submit" />
</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 class="row">
<div class="column column-20" data-balloon="Generated Requested URI, Click to Copy!" data-balloon-pos="up">
<input class="btn" id="requestURI" type="text" placeholder="generated request URI" data-clipboard-target="#requestURI" readonly />
</div>
<div class="column column-80">
<input id="testButton" style="width:100%" class="btn" value="Test FetchXML and Generate Request URI" type="submit" />
<br />
</div>
</div>
<div class="row">
<div style="bottom:0px; position:absolute;font-size:small;right:25px">
<a target="_blank" id="finalURI" href="http://AshV.ml">|</a> <b>FetchXml Tester Online</b> hosted with <font color="red">❤</font> by <a href="https://github.com/AshV/FetchXmlTester">GitHub</a>
</div>
</div>
<script src="js/script.js"></script>
<script src="js/clipboard.min.js" type="text/javascript"></script>
<script>new Clipboard('.btn');</script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea('fetchXml', {
height: "85%",
parserfile: "parsexml.js",
stylesheet: "css/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>