dimka3210
Легенда
--tracker.tpl
find
PHP:
<a class="menu-root" href="#tr-options">{L_DISPLAYING_OPTIONS}</a>
PHP:
<span style="color: #006699; cursor: pointer;" id="multi-download">· Массовая закачка</span>
find
PHP:
<th class="{sorter: 'digit'}" title="{L_SIZE}"><b class="tbs-text">{L_SIZE}</b></th>
PHP:
<th style="display: none;" title="Multi Download" attr="MD"><b>M D</b></th>
find
PHP:
<td class="row4 small nowrap">
PHP:
<td class="row4 small nowrap" attr="download">
find
PHP:
<td class="catBottom" colspan="{TOR_COLSPAN}"> </td>
PHP:
<td class="catBottom" colspan="{TOR_COLSPAN}" align="center"> <input type="button" value="Скачать" class="bold long" id="multiDownloadsAction" style="display: none;"> </td>
--main.js
find(~350 line)
PHP:
.filter('.error').one('focus', function(){
$(this).removeClass('error');
PHP:
/* Tracker */
jQuery("#multi-download").click(function(){
jQuery("th[attr=MD]").show();
jQuery("#multi-download").hide();
var i = 0;
var jTorTable = jQuery("#tor-tbl");
var aTd = jQuery("[attr=download]", jTorTable);
var aIdsDownloads = {};
if(aTd.length){
aTd.each(function(){
aIdsDownloads[i] = jQuery("a", jQuery(this)).attr("href");
jQuery(this).after("<td class=\"row4\"><input type=\"checkbox\" name=\"downloadsArray\" value=\""+ aIdsDownloads[i] +"\"></td>");
i++;
});
var jInput = jQuery("#multiDownloadsAction");
jInput.show();
}else{
alert("Нет ни одной раздачи.");
}
});
jQuery("#multiDownloadsAction").click(function(){
var aIds = {};
var i = 0;
var jACheckbox = jQuery("input[name=downloadsArray]:checked");
if(jACheckbox.length){
jACheckbox.each(function(){
aIds[i] = jQuery(this).val();
window.open(aIds[i], "download_"+i);
i++;
});
}else{
alert("Не выбрано ни одной раздачи.");
}
});
По просьбе Gemini_13