Skip to content

Commit

Permalink
Update copy btn logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
chunchet-ng committed Sep 25, 2023
1 parent 32723cc commit a40fd98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@ <h2 class="text-center title">Experiment Results</h1>
<h2 class="text-center title">BibTeX</h1>
<p class="text-start">If you wish to cite the ICDAR 2021 Competition on Integrated Circuit Text Spotting and Aesthetic
Assessment paper:</p>
<div class="text-primary border border-primary rounded p-3" id="bibtex_div">
<div class="text-primary border border-primary rounded p-3" id="bibtex_div_old">
<p class="m-0">
<button class="btn btn-primary float-end ms-2" onclick="copy_text()" id="bibtex_btn">
<div id="icon_div"><i class="fa-solid fa-copy"></i></div>
<button class="btn btn-primary float-end ms-2" onclick="copy_text('old')" id="bibtex_btn_old">
<div id="icon_div_old"><i class="fa-solid fa-copy"></i></div>
</button>
<span id="bibtex">
<span id="bibtex_old">
@inproceedings{icdar2021_ictext,<br/>
<span class="tab"></span>author= {Ng, Chun Chet and Nazaruddin, Akmalul Khairi Bin and Lee, Yeong Khang and Wang, Xinyu
<span class="tab"></span>and Liu, Yuliang and Chan, Chee Seng and Jin, Lianwen and Sun, Yipeng and Fan, Lixin},<br/>
Expand All @@ -381,12 +381,12 @@ <h2 class="text-center title">BibTeX</h1>
</p>
</div>
<p class="text-start pt-3">If you wish to cite the lastest version of the ICText dataset and AGCL:</p>
<div class="text-primary border border-primary rounded p-3" id="bibtex_div">
<p class="m-0">
<button class="btn btn-primary float-end ms-2" onclick="copy_text()" id="bibtex_btn">
<div id="icon_div"><i class="fa-solid fa-copy"></i></div>
<div class="text-primary border border-primary rounded p-3" id="bibtex_div_new">
<p class="mb-3">
<button class="btn btn-primary float-end ms-2" onclick="copy_text('new')" id="bibtex_btn_new">
<div id="icon_div_new"><i class="fa-solid fa-copy"></i></div>
</button>
<span id="bibtex">
<span id="bibtex_new">
Our paper is currently under review. We will update this section when it is published.
</span>
</p>
Expand Down
19 changes: 14 additions & 5 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,20 @@ function toggle_div(div) {
}
}

function copy_text() {
var copyText = document.getElementById("bibtex");
var btn = document.getElementById("bibtex_btn");
var icon_div = document.getElementById("icon_div");
var bibtex_div = document.getElementById("bibtex_div");
function copy_text(name) {

if (name == 'old') {
var copyText = document.getElementById("bibtex_old");
var btn = document.getElementById("bibtex_btn_old");
var icon_div = document.getElementById("icon_div_old");
var bibtex_div = document.getElementById("bibtex_div_old");
}
else {
var copyText = document.getElementById("bibtex_new");
var btn = document.getElementById("bibtex_btn_new");
var icon_div = document.getElementById("icon_div_new");
var bibtex_div = document.getElementById("bibtex_div_new");
}

const check_icon = document.createElement('i');
check_icon.classList.add('fa-solid');
Expand Down

0 comments on commit a40fd98

Please sign in to comment.