$(function(){
stepCount = 0;
console.log('%ci12bretro', 'font-weight: 900; font-size: 40px; color: #f00; text-shadow: 3px 3px 0 #000, 4px 4px 0 #fff; border-bottom: 8px double #f00; padding: 0 8px;');
console.log('%chttps://youtube.com/c/i12bretro', 'font-size: 9px; margin-left: 60px;');
stepsText = [];
$('textarea').each(function(i,e){
theTextarea = $(this);
theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
});
$('li').each(function(i,e){
pi = 0;
if(!$(this).hasClass('noCheckbox')){
var uuid = `li_${(Math.floor(Math.random() * Math.floor(1000000))).toString()}_${i.toString()}`;
$(this).contents().wrap(``);
$(this).prepend(``);
pi++;
}
stepCount = pi;
});
$('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
theElement = $(this);
var lines = theElement.html().split("\n");
theElement.empty();
for(l=0;l
$|
$|
$/g,'')).text());
theElement.append(`${lines[l]}`);
} else {
theElement.append(lines[l]);
}
}
});
$(document).on('click','input.copy-text',function(){
theButton = $(this);
$('input.copy-text').attr('src','images/clipboard.png');
$('span.copy-animation,span.copy-animation-ps,span.copy-animation-cmd').removeClass('copy-animation copy-animation-ps copy-animation-cmd');
try {
if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
$('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
} else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
$('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
} else {
$('#'+ theButton.attr('rel')).addClass('copy-animation');
}
console.log('%cCopied:', 'font-style: italic; color: #0f0;');
console.log(`%c${stepsText[theButton.data('step-index')]}`, 'margin-left: 25px;');
navigator.clipboard.writeText(stepsText[theButton.data('step-index')]);
theButton.attr('src','images/clipboard_active.png');
} catch(err) {
}
return false;
});
$(document).on('click','input.completeBox',function(){
theBox = $(this);
$('#'+ theBox.attr('rel')).addClass('strikethrough');
theBox.prop('disabled',true);
theBox.parent('li').prevAll().each(function(i,e){
theLI = $(this);
if(theLI.find('input[type=checkbox]').not(':checked')){
$('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
}
});
});
$('#gridContainer').append('