forked from robotframework/robotframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibdoc.html
More file actions
380 lines (352 loc) · 15.2 KB
/
libdoc.html
File metadata and controls
380 lines (352 loc) · 15.2 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="Generator" content="">
<link rel="icon" type="image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AAAAAAIAAAAcAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAA2gAAAP8AAAD7AAAAywAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN4AAAD/AAAAqwAAAP8AAACvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALIAAAD/AAAAsgAAAAAAAAC5AAAA/wAAAMoAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMkAAAD/AAAAvAAAAAAAAAAAAAAAAAAAAKwAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAArQAAAAAAAAAAwAMAAIABAAAf+AAAP/wAAD/8AAAgBAAAP/wAAD/8AAA//AAAJIwAADHEAAA//AAAP/wAAB/4AACAAQAAwAMAAA==">
<link rel="stylesheet" type="text/css" href="libdoc.css" media="all">
<link rel="stylesheet" type="text/css" href="pygments.css" media="all">
<link rel="stylesheet" type="text/css" href="print.css" media="print">
<link rel="stylesheet" type="text/css" href="../common/js_disabled.css" media="all">
<link rel="stylesheet" type="text/css" href="../common/doc_formatting.css" media="all">
<script type="text/javascript" src="../rebot/util.js"></script> <!-- TODO: Should util.js be moved under common? -->
<script type="text/javascript" src="../lib/jquery.min.js"></script>
<script type="text/javascript" src="../lib/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="../lib/jquery.highlight.min.js"></script>
<!-- JS MODEL --><script type="text/javascript" src="../testdata/libdoc.js"></script>
<title></title>
</head>
<body>
<div id="javascript-disabled">
<h1>Opening library documentation failed</h1>
<ul>
<li>Verify that you have <b>JavaScript enabled</b> in your browser.</li>
<li>Make sure you are using a <b>modern enough browser</b>. If using Internet Explorer, version 8 or newer is required.</li>
<li>Check are there messages in your browser's <b>JavaScript error log</b>. Please report the problem if you suspect you have encountered a bug.</li>
</ul>
</div>
<script type="text/javascript">
// Not using jQuery here for speed and to support ancient browsers.
document.getElementById('javascript-disabled').style.display = 'none';
</script>
<script type="text/javascript">
$(document).ready(function() {
parseTemplates();
document.title = libdoc.name;
renderTemplate('base', libdoc, $('body'));
if (libdoc.inits.length) {
renderTemplate('importing', libdoc);
}
renderTemplate('shortcuts', libdoc);
if (libdoc.contains_tags) {
renderTemplate('tags', libdoc);
}
renderTemplate('keywords', libdoc);
renderTemplate('footer', libdoc);
scrollToHash();
$(document).bind('keydown', handleKeydown);
});
function parseTemplates() {
$('script[type="text/x-jquery-tmpl"]').map(function (idx, elem) {
$.template(elem.id, elem.text);
});
}
function renderTemplate(name, arguments, container) {
if (!container) {
container = $('#' + name + '-container');
container.empty();
}
if (!arguments.search) {
arguments.search = false;
}
$.tmpl(name + '-template', arguments).appendTo(container);
}
function handleKeydown(event) {
event = event || window.event;
var keyCode = event.keyCode || event.which;
if (keyCode === 27) // esc
setTimeout(closeSearch, 0);
if (keyCode === 83 && $('#search').is(':hidden')) // s
setTimeout(openSearch, 0);
}
function scrollToHash() {
if (window.location.hash) {
var hash = window.location.hash.substring(1).replace('+', ' ');
window.location.hash = '';
window.location.hash = hash;
}
}
function tagSearch(tag) {
var include = {tags: true, tagsExact: true};
markMatches(tag, include);
highlightMatches(tag, include);
$('#keywords-container').find('.kw-row').addClass('hide-unmatched');
}
function doSearch() {
var string = $('#search-string').val();
var include = getIncludesAndDisableIfOnlyOneLeft();
if (string) {
markMatches(string, include);
highlightMatches(string, include);
setMatchVisibility();
} else {
resetKeywords();
}
}
function getIncludesAndDisableIfOnlyOneLeft() {
var name = $('#include-name');
var args = $('#include-args');
var doc = $('#include-doc');
var tags = $('#include-tags');
var include = {name: name.prop('checked'),
args: args.prop('checked'),
doc: doc.prop('checked'),
tags: !!tags.prop('checked')};
if ((!include.name) && (!include.args) && (!include.doc)) {
tags.prop('disabled', true);
} else if ((!include.name) && (!include.args) && (!include.tags)) {
doc.prop('disabled', true);
} else if ((!include.name) && (!include.doc) && (!include.tags)) {
args.prop('disabled', true);
} else if ((!include.args) && (!include.doc) && (!include.tags)) {
name.prop('disabled', true);
} else {
name.prop('disabled', false);
args.prop('disabled', false);
doc.prop('disabled', false);
tags.prop('disabled', false);
}
return include;
}
function markMatches(pattern, include) {
pattern = util.regexpEscape(pattern);
if (include.tagsExact) {
pattern = '^' + pattern + '$';
}
var regexp = new RegExp(pattern, 'i');
var test = regexp.test.bind(regexp);
var result = {contains_tags: libdoc.contains_tags};
var matchCount = 0;
result.keywords = util.map(libdoc.keywords, function (kw) {
kw = $.extend({}, kw);
kw.matched = (include.name && test(kw.name) ||
include.args && test(kw.args) ||
include.doc && test($(kw.doc).text()) ||
include.tags && util.any(util.map(kw.tags, test)));
if (kw.matched)
matchCount++;
return kw
});
renderTemplate('shortcuts', result);
renderTemplate('keywords', result);
if (libdoc.contains_tags) {
renderTemplate('tags', libdoc);
}
var ending = matchCount != 1 ? 's.' : '.';
$('#match-count').show().text(matchCount + ' matched keyword' + ending);
$('#altogether-count').hide();
if (matchCount == 0)
$('#keywords-container').find('table').empty();
}
function highlightMatches(string, include) {
var shortcuts = $('#shortcuts-container').find('.match');
var keywords = $('#keywords-container').find('.match');
if (include.name) {
shortcuts.highlight(string);
keywords.find('.kw').highlight(string);
}
if (include.args) {
keywords.find('.args').highlight(string);
}
if (include.doc) {
keywords.find('.doc').highlight(string);
}
if (include.tags) {
var matches = keywords.find('.tags').find('a').add(
$('#tags-container').find('a'));
if (include.tagsExact) {
matches = matches.filter(function (index, tag) {
return $(tag).text().toUpperCase() == string.toUpperCase();
});
}
matches.highlight(string);
}
}
function openSearch() {
$('#search').show();
$('#open-search').hide();
$('#search-string').focus().select();
$(document).scrollTop($("#Shortcuts").offset().top);
}
function closeSearch() {
$('#search').hide();
$('#open-search').show();
}
function resetSearch() {
$('#search-string').val('');
$('#include-name').prop('checked', true);
$('#include-args').prop('checked', true);
$('#include-doc').prop('checked', true);
$('#hide-unmatched').prop('checked', false);
resetKeywords();
}
function resetKeywords() {
renderTemplate('shortcuts', libdoc);
renderTemplate('keywords', libdoc);
if (libdoc.contains_tags) {
renderTemplate('tags', libdoc);
}
$('#match-count').hide();
$('#altogether-count').show();
}
function setMatchVisibility() {
var kws = $('#keywords-container').find('.kw-row');
var hide = $('#hide-unmatched').prop('checked');
kws.toggleClass('hide-unmatched', hide);
}
// http://stackoverflow.com/a/18484799
var delay = (function () {
var timer = 0;
return function(callback, ms) {
clearTimeout(timer);
timer = setTimeout(callback, ms);
};
})();
</script>
<script type="text/x-jquery-tmpl" id="base-template">
<h1>${name}</h1>
<table class="metadata">
{{if version}}<tr><th>Library version:</th><td>${version}</td></tr>{{/if}}
{{if scope}}<tr><th>Library scope:</th><td>${scope}</td></tr>{{/if}}
<tr><th>Named arguments:</th><td>{{if named_args}}supported{{else}}not supported{{/if}}</td></tr>
</table>
<div id="introduction-container">
<h2 id="Introduction">Introduction</h2>
<div class="doc">{{html doc}}</div>
</div>
<div id="importing-container"></div>
<div id="shortcuts-container"></div>
<div id="tags-container"></div>
<div id="keywords-container"></div>
<div id="footer-container"></div>
<form id="search" action="javascript:void(0)">
<fieldset>
<legend id="search-title">Search keywords</legend>
<input type="text" id="search-string" onkeyup="delay(doSearch, 500)">
<fieldset>
<legend>Search from</legend>
<input type="checkbox" id="include-name" onclick="doSearch()" checked>
<label for="include-name">Name</label>
<input type="checkbox" id="include-args" onclick="doSearch()" checked>
<label for="include-args">Arguments</label>
<input type="checkbox" id="include-doc" onclick="doSearch()" checked>
<label for="include-doc">Documentation</label>
{{if libdoc.contains_tags}}
<input type="checkbox" id="include-tags" onclick="doSearch()" checked>
<label for="include-tags">Tags</label>
{{/if}}
</fieldset>
<input type="checkbox" id="hide-unmatched" onclick="setMatchVisibility()" checked>
<label for="hide-unmatched">Hide unmatched keywords</label>
<div id="search-buttons">
<input type="button" value="Reset" onclick="resetSearch()"
title="Reset search">
<input type="button" value="Close" onclick="closeSearch()"
title="Close search (shortcut: <Esc>)">
</div>
</fieldset>
</form>
<div id="open-search" onclick="openSearch()" title="Search keywords (shortcut: s)"></div>
</script>
<script type="text/x-jquery-tmpl" id="importing-template">
<h2 id="Importing">Importing</h2>
<table border="1" class="keywords">
<tr>
<th class="args">Arguments</th>
<th class="doc">Documentation</th>
</tr>
{{each inits}}
<tr class="kw-row">
<td class="args">
{{each args}}
<span>${$value}</span>{{if $index < args.length-1}}, {{/if}}
{{/each}}
</td>
<td class="doc">{{html $value.doc}}</td>
</tr>
{{/each}}
</table>
</script>
<script type="text/x-jquery-tmpl" id="shortcuts-template">
<h2 id="Shortcuts">Shortcuts</h2>
<div class='shortcuts'>
{{each keywords}}
<a href="#${encodeURIComponent($value.name)}"
class="{{if $value.matched === false}}no-{{/if}}match"
title="${$value.shortdoc}">${$value.name}</a>
{{if $index < keywords.length-1}} · {{/if}}
{{/each}}
</div>
</script>
<script type="text/x-jquery-tmpl" id="tags-template">
<h2 id="Tags">Tags</h2>
<div class='shortcuts'>
{{each all_tags}}
<a href="javascript:tagSearch('${$value}')"
title="Show tests with this tag">${$value}</a> ·
{{/each}}
<a href="javascript:resetKeywords()" class="normal-first-letter"
title="Show all tests">[Reset]</a>
</div>
</script>
<script type="text/x-jquery-tmpl" id="keywords-template">
<h2 id="Keywords">Keywords</h2>
<table border="1" class="keywords">
<tr>
<th class="kw">Keyword</th>
<th class="args">Arguments</th>
{{if libdoc.contains_tags}}
<th class="tags">Tags</th>
{{/if}}
<th class="doc">Documentation</th>
</tr>
{{each keywords}}
{{tmpl($value) 'keyword-template'}}
{{/each}}
</table>
</script>
<script type="text/x-jquery-tmpl" id="keyword-template">
<tr class="kw-row {{if matched === false}}no-{{/if}}match">
<td class="kw">
<a name="${name}" href="#${encodeURIComponent(name)}"
title="Link to this keyword">${name}</a>
</td>
<td class="args">
{{each args}}
<span>${$value}</span>{{if $index < args.length-1}}, {{/if}}
{{/each}}
</td>
{{if libdoc.contains_tags}}
<td class="tags">
{{each tags}}
<a href="javascript:tagSearch('${$value}')"
title="Show tests with this tag">${$value}</a>{{if $index < tags.length-1}}, {{/if}}
{{/each}}
</td>
{{/if}}
<td class="doc">{{html doc}}</td>
</tr>
</script>
<script type="text/x-jquery-tmpl" id="footer-template">
<p class="footer">
<span id="altogether-count">Altogether ${keywords.length} keywords.</span>
<span id="match-count"></span>
<br>
Generated by <a href="http://robotframework.org/robotframework/#built-in-tools">Libdoc</a> on ${generated}.
</p>
</script>
</body>
</html>