-
Notifications
You must be signed in to change notification settings - Fork 918
Expand file tree
/
Copy pathsdotermpage.js
More file actions
70 lines (54 loc) · 2.18 KB
/
sdotermpage.js
File metadata and controls
70 lines (54 loc) · 2.18 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
$(document).ready(function(){
prettyPrint();
setTimeout(function(){
$(".atn:contains(itemscope), .atn:contains(itemtype), .atn:contains(itemprop), .atn:contains(itemid), .atn:contains(time), .atn:contains(datetime), .atn:contains(datetime), .tag:contains(time) ").addClass('new');
$('.new + .pun + .atv').addClass('curl');
window.structured = [];
$('.ds-tab.structure').on('loadstructuredview', async function(){
var $this = $(this);
$key = $this.data('ex');
if(window.structured.indexOf($key) == -1) {
window.structured.push($key);
$jdata = $('.payload.' + $key).html();
const html1 = await prettyMarkupHtml($jdata);
$('.structureout.' + $key).html( html1);
var val = await prettyMarkupText($jdata);
$('.structuretext.' + $key).html(val);
}
});
}, 500);
setTimeout(function(){
$(".atn:contains(property), .atn:contains(typeof) ").addClass('new');
$('.new + .pun + .atv').addClass('curl');
}, 500);
setTimeout(function() {
$('.ds-selector-tabs .selectors a').click(function() {
var $this = $(this);
var $p = $this.parents('.ds-selector-tabs');
$('.selected', $p).removeClass('selected');
$this.addClass('selected');
$('.ds-tab.' + $this.data('selects'), $p).addClass('selected').trigger('loadstructuredview');
});
}, 0);
clip = new ClipboardJS('.clip');
clip.on('success', function(e) {
$but = e.trigger.className;
$targ = $but.split(" ").pop();
var targsel = '.tooltiptext.' + $targ;
var tip = $(targsel);
tip.text('Copied!');
tip.addClass('show');
e.clearSelection();
setTimeout(function() {
tip.removeClass('show');
}, 2500);
});
clip.on('error', function(e) {
var tip = $('.tooltip .tooltiptext');
tip.text(fallbackMessage('copy'));
tip.addClass('show');
});
$('.tooltip .tooltiptext').mouseleave(function(){
$(this).removeClass('show');
});
});