Browse Source

Updated no comment code preview

main
Gerard Balde 2 weeks ago
parent
commit
b02944381d
  1. 71
      index.html

71
index.html

@ -21,8 +21,8 @@
<thead class="table-dark">
<tr>
<th scope="col">#</th>
<th scope="col"></th>
<th scope="col">Second Column</th>
<th scope="col">First column</th>
<th scope="col">Second column</th>
<th scope="col" width="30%">Comment</th>
</tr>
</thead>
@ -42,29 +42,29 @@
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="a-html" role="tabpanel" aria-labelledby="a-html-tab">
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<ul class="nav nav-pills" id="pills-tab" role="tablist">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="btn btn-dark rounded-pill active" id="a-html-tab" data-bs-toggle="pill" data-bs-target="#a-html" type="button" role="tab" aria-controls="a-html" aria-selected="true">HTML</button>
<button class="nav-link active" id="pills-a-html-tab" data-bs-toggle="pill" data-bs-target="#pills-a-html" type="button" role="tab" aria-controls="pills-a-html" aria-selected="true">Home</button>
</li>
<!-- <li class="nav-item" role="presentation">
<button class="nav-link" id="a-react-tab" data-bs-toggle="pill" data-bs-target="#a-react" type="button" role="tab" aria-controls="a-react" aria-selected="false">React.js</button>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-a-react-tab" data-bs-toggle="pill" data-bs-target="#pills-a-react" type="button" role="tab" aria-controls="pills-a-react" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="a-vue-tab" data-bs-toggle="pill" data-bs-target="#a-vue" type="button" role="tab" aria-controls="a-vue" aria-selected="false">Vue.js</button>
</li> -->
<button class="nav-link" id="pills-a-vue-tab" data-bs-toggle="pill" data-bs-target="#pills-a-vue" type="button" role="tab" aria-controls="pills-a-vue" aria-selected="false">Contact</button>
</li>
<li class="nav-item ms-auto">
<button class="btn btn-outline-dark" onclick="copyToClipboard('a-html-code', this)">Copy</button>
<button class="btn btn-outline-dark" onclick="copyToClipboard(this)">Copy</button>
</li>
</ul>
</div>
<div class="card-body p-0" id="a-html-code">
<pre><code class="language-html">
<div class="card-body p-0">
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade active show" id="pills-a-html" role="tabpanel" aria-labelledby="pills-a-html-tab">
<pre class="mt-0"><code class="language-html">
&lt;table class="table table-hover table-bordered">
&lt;thead class="table-dark">
&lt;tr>
@ -89,12 +89,8 @@
&lt;/table>
</code></pre>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="tab-pane fade" id="a-react" role="tabpanel" aria-labelledby="a-react-tab">
<pre><code class="language-html">
<div class="tab-pane fade" id="pills-a-react" role="tabpanel" aria-labelledby="pills-a-react-tab">
<pre class="mt-0"><code class="language-html">
import React from 'react';
import './styles.css'; // Assuming you have a CSS file for styling
@ -104,8 +100,8 @@
&lt;thead>
&lt;tr>
&lt;th scope="col">#&lt;/th>
&lt;th scope="col">First Column&lt;/th>
&lt;th scope="col">Second Column&lt;/th>
&lt;th scope="col">First column&lt;/th>
&lt;th scope="col">Second column&lt;/th>
&lt;th scope="col" width="30%">Comment&lt;/th>
&lt;/tr>
&lt;/thead>
@ -128,15 +124,15 @@
export default MyTable;
</code></pre>
</div>
<div class="tab-pane fade" id="a-vue" role="tabpanel" aria-labelledby="a-vue-tab">
<code><pre class="language-html">
<div class="tab-pane fade" id="pills-a-vue" role="tabpanel" aria-labelledby="pills-a-vue-tab">
<pre class="mt-0"><code class="language-html">
&lt;template>
&lt;table class="table table-hover table-bordered">
&lt;thead>
&lt;tr>
&lt;th scope="col">#&lt;/th>
&lt;th scope="col">First Column&lt;/th>
&lt;th scope="col">Second Column&lt;/th>
&lt;th scope="col">First column&lt;/th>
&lt;th scope="col">Second column&lt;/th>
&lt;th scope="col" width="30%">Comment&lt;/th>
&lt;/tr>
&lt;/thead>
@ -162,8 +158,12 @@
&lt;style scoped>
/* Add your table-specific styles here */
&lt;/style>
</pre></code>
</div> -->
</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<h5 class="mt-5">Opened comment</h5>
@ -172,8 +172,8 @@
<thead class="table-dark">
<tr>
<th scope="col">#</th>
<th scope="col">First Column</th>
<th scope="col">Second Column</th>
<th scope="col">First column</th>
<th scope="col">Second column</th>
<th scope="col" width="30%">Comment</th>
</tr>
</thead>
@ -216,8 +216,8 @@
<thead class="table-dark">
<tr>
<th scope="col">#</th>
<th scope="col">First Column</th>
<th scope="col">Second Column</th>
<th scope="col">First column</th>
<th scope="col">Second column</th>
<th scope="col" width="30%">Comment</th>
</tr>
</thead>
@ -260,8 +260,8 @@
<thead class="table-dark">
<tr>
<th scope="col">#</th>
<th scope="col">First Column</th>
<th scope="col">Second Column</th>
<th scope="col">First column</th>
<th scope="col">Second column</th>
<th scope="col" width="30%">Comment</th>
</tr>
</thead>
@ -464,8 +464,9 @@
<script>
// Function to copy the code block content
function copyToClipboard(divId, element) {
const preElement = document.getElementById(divId).querySelector('pre code');
function copyToClipboard(element) {
const activeTabPane = document.querySelector('.tab-pane.fade.active.show');
const preElement = document.getElementById(activeTabPane.id).querySelector('pre code');
const codeText = preElement.textContent;
const tempElement = document.createElement('textarea');

Loading…
Cancel
Save