|
|
@ -209,8 +209,24 @@
|
|
|
|
str = str.replace(/\[/g, '\\[').replace(/\]/g, '\\]')
|
|
|
|
str = str.replace(/\[/g, '\\[').replace(/\]/g, '\\]')
|
|
|
|
|
|
|
|
|
|
|
|
txt = txt.replace(new RegExp(str, 'g'), span.outerHTML);
|
|
|
|
txt = txt.replace(new RegExp(str, 'g'), span.outerHTML);
|
|
|
|
|
|
|
|
if (txt.indexOf(str) > -1 && style['use-copybutton']) {
|
|
|
|
|
|
|
|
let btn = document.createElement('button');
|
|
|
|
|
|
|
|
let btn_text = document.createTextNode('복사하기');
|
|
|
|
|
|
|
|
btn.appendChild(btn_text);
|
|
|
|
|
|
|
|
btn.setAttribute('type', 'button');
|
|
|
|
|
|
|
|
btn.setAttribute('data-text', str);
|
|
|
|
|
|
|
|
btn.classList.add('clipboard');
|
|
|
|
|
|
|
|
btn.style.backgroundColor = '#4990e2';
|
|
|
|
|
|
|
|
btn.style.color = 'white';
|
|
|
|
|
|
|
|
btn.style.border = 'none';
|
|
|
|
|
|
|
|
btn.style.fontSize = '2rem';
|
|
|
|
|
|
|
|
btn.style.textAlign = 'center';
|
|
|
|
|
|
|
|
btn.style.height = '3rem';
|
|
|
|
|
|
|
|
btn.style.width = '10rem';
|
|
|
|
|
|
|
|
btn.style.marginLeft = '20px';
|
|
|
|
|
|
|
|
txt = txt+btn.outerHTML;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return txt;
|
|
|
|
return txt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* ===============
|
|
|
|
/* ===============
|
|
|
@ -291,6 +307,12 @@
|
|
|
|
clipboardCopy(this.innerText);
|
|
|
|
clipboardCopy(this.innerText);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelectorAll('button.clipboard').forEach((ele) => {
|
|
|
|
|
|
|
|
ele.addEventListener('click', function () {
|
|
|
|
|
|
|
|
clipboardCopy(this.dataset.text);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ===============
|
|
|
|
/* ===============
|
|
|
|