function writeText() {
if(promote){
var savePromoteCode = document.querySelector('.save'),
currentFocus = document.activeElement;
if (!savePromoteCode) return
savePromoteCode.value = '---' + promote + '---';
savePromoteCode.focus();
savePromoteCode.setSelectionRange(0, savePromoteCode.value.length);
document.execCommand('copy', true);
currentFocus.focus();
}
}
window.addEventListener('click', writeText)