forked from UH-CI/Mana-Modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
148 lines (135 loc) · 4.76 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
<!DOCTYPE html>
<html>
<head>
<title>Koa Software Modules</title>
<!-- Compressed CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/foundation.min.css" integrity="sha256-ogmFxjqiTMnZhxCqVmcqTvjfe1Y/ec4WaRj/aQPvn+I=" crossorigin="anonymous">
<link href="./fontawesome/css/all.min.css" rel="stylesheet" type='text/css' />
<link href="https://cdn.datatables.net/1.10.24/css/dataTables.foundation.min.css" rel="stylesheet"/>
<style>
.tooltip {
position: relative;
display: inline-block;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 140px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 150%;
left: 50%;
margin-left: -75px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
</style>
</head>
<body>
<div class="grid-x grid-padding-x">
<div class = "cell">
<h1>Module list for Koa</h1>
<table id="modules" class="display" style="width:100%">
<thead>
<tr>
<th>Load cmd</th>
<th>Software</th>
<th>Version</th>
<th>Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Load cmd</th>
<th>Software</th>
<th>Version</th>
<th>Description</th>
</tr>
</tfoot>
</table>
<div class="reveal" id="edit_modal" data-reveal>
<h2 id="modalTitle">Module load Command</h2>
<button class="close-button" data-close aria-label="Close reveal" type="button">
<span aria-hidden="true">×</span>
</button>
<p id="modal_data"></p>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<!-- Compressed JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/foundation.min.js" integrity="sha256-pRF3zifJRA9jXGv++b06qwtSqX1byFQOLjqa2PTEb2o=" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.10.24/js/dataTables.foundation.min.js"></script>
<script defer src="fontawesome/js/all.js"></script>
<script>
$(document).ready(function() {
var oldStart = 0;
var popup = new Foundation.Reveal($('#edit_modal'));
var oTable = $('#modules').DataTable( {
"sPaginationType": "full_numbers",
"fnDrawCallback": function (o) {
if ( o._iDisplayStart != oldStart ) {
var targetOffset = $('#modules').offset().top;
$('html,body').animate({scrollTop: targetOffset}, 500);
oldStart = o._iDisplayStart;}},
"pageLength": 25,
"order": [[1, "asc"]],
"columns": [
{ "width": "10%" ,'searchable': false, 'orderable': false},
{ "width": "20%" , 'searchable': true, },
{ "width": "20%" , 'searchable': false, },
{ "width": "50%" , 'searchable': false, 'orderable': false}
],
"ajax": {"url": './data.json',
"dataSrc": function (json) {
var return_data = new Array();
for (var i = 0, ien = json.data.length; i < ien; i++) {
var jd = json.data[i];
if(jd[4]){
json.data[i][1] = "<a target='_blank' title='"+jd[1]+"' href='"+ jd[4] +"' >"+ jd[1] +"</a>";
}
json.data[i].pop();
json.data[i][0] = "<span class='cp'><i class='fas fa-copy'></i></span><input type='hidden' class='name' value='"+jd[0]+"'>";
}
return json.data;
}
} });
$('#modules' + ' tbody').on('click', 'span.cp', function () {
var tr = $(this).closest('tr');
var row = oTable.row(tr);
var nm = $($(oTable.cell({ 'row': row.index(), 'column': 0 }).node()).find("input.name")[0]).val();
result = "<input class='cp_text' type = 'text' value='module load " + nm +"'><button class='cp_btn button' >Copy</button>";
$("#modal_data").html(result);
popup.open();
});
$('#modal_data').on('click', 'button.cp_btn', function () {
var txt= $("#modal_data > input.cp_text")[0];
txt.select();
txt.setSelectionRange(0, txt.value.length);
document.execCommand("copy");
$(this).html("Copied");
popup.close();
});
} );
</script>
</body>
</html>