- [misc] Remove unused css and js files.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
#mainMenu .pull-left .checkbox-primary {display: inline-block; margin-left: 10px;}
|
||||
#projectsSummary {padding-left: 10px;}
|
||||
.main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child {padding-left: 8px;}
|
||||
.table tbody>tr>td .dropdown {display: inline-block; line-height: 1;}
|
||||
tbody.sortable > tr > td.sort-handler .table-nest-toggle:before {cursor: pointer !important;}
|
||||
.table .avatar {display: inline-block; top: 6px;}
|
||||
|
||||
label[for^="projectIdList"]:after {width: 14px; height:14px;}
|
||||
tbody.sortable > tr > td.sort-handler {color: #3c4353 !important;}
|
||||
|
||||
.has-prefix {position: relative; display: flex; align-items: center;}
|
||||
.has-prefix > span {flex: none;}
|
||||
.has-prefix > .icon-cards-view {padding-right: 4px;}
|
||||
|
||||
.has-suffix > a {max-width: calc(100% - 100px); padding-right: 5px; color: #0c60e1; display: inline-block;}
|
||||
|
||||
tr[data-type="project"].no-nest .c-name {padding-left: 12px;}
|
||||
div.checkbox-primary + span.table-nest-icon {margin-left: 0px !important;}
|
||||
|
||||
#checkAll + label.hover:after {border-width: 0px;}
|
||||
.c-budget {width:100px; text-align: right; padding-right:16px !important;}
|
||||
.c-status {width: 65px !important;}
|
||||
.icon-scrum.table-nest-toggle:after, .icon-waterfall.table-nest-toggle:after, .icon-kanban.table-nest-toggle:after, .icon-waterfallplus.table-nest-toggle:after, .icon-aglieplus.table-nest-toggle:after, .icon-ipd.table-nest-toggle:after {content: ''; border: 0;}
|
||||
@@ -1,7 +0,0 @@
|
||||
#budget {border-right: 0px;}
|
||||
#budget:focus {border-right: 1px solid #0c64eb;}
|
||||
#budgetUnit {border-left: 0px;}
|
||||
#budgetUnit:focus {border-left: 1px solid #0c64eb;}
|
||||
#dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;}
|
||||
#endList {vertical-align: top; padding-top: 13px;}
|
||||
[lang^=en] #endList {padding-top: 20px;}
|
||||
@@ -1,4 +0,0 @@
|
||||
#budget {border-right: 0px;}
|
||||
#budgetUnit {border-left: 0px;}
|
||||
#dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;}
|
||||
#endList {vertical-align: top; padding-top: 13px;}
|
||||
@@ -1,31 +0,0 @@
|
||||
.main-table .table {cursor: default;}
|
||||
.main-table .table td {background: #f5f5f5;}
|
||||
.main-table tbody>tr>td:first-child {padding: 0px 8px}
|
||||
|
||||
.lane-name {overflow: hidden; text-overflow: ellipsis; writing-mode: vertical-lr;}
|
||||
|
||||
.board-item {border: 1px solid #EBEBEB; padding: 5px 10px; cursor: default; border-radius: 2px; background-color: #fff;}
|
||||
.board-item:hover {border-color: #ccc;}
|
||||
.board-item {margin-top: 10px;}
|
||||
.board-item:last-child {margin-bottom: 10px;}
|
||||
|
||||
#kanban {overflow-y: auto;}
|
||||
#kanban tbody > tr > td {line-height: 24px;}
|
||||
#kanban tbody > tr > td{border-right: 3px solid #fff; border-bottom: 2px solid #fff;}
|
||||
#kanban thead > tr:first-child > th:not(:first-child) {border-right: 2px solid #fff; border-bottom: 2px solid #fff;}
|
||||
#kanban thead > tr:last-child > th {border: 2px solid #fff;}
|
||||
|
||||
.doing-td, .wait-project, .normal-plan, .normal-release {vertical-align: top !important;}
|
||||
|
||||
.doing-td .board:first-child{padding-top: 0; border-top: unset;}
|
||||
|
||||
.project-line {width: 100%; height: 2px; background: #fff}
|
||||
|
||||
.doing-td .table-row .table-col:last-child, .c-progress {width: 30px;}
|
||||
.doing-td .table-row .table-col:first-child {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
|
||||
.scroll {overflow-x: hidden; overflow-y: auto;}
|
||||
.fix-table-copy-wrapper thead > tr > th:first-child {background: none!important;}
|
||||
|
||||
#showSettingsBox {text-align:right; margin-top:-15px; margin-right:4px;}
|
||||
#showSettingsBox .checkbox-primary {display:inline-block;}
|
||||
@@ -1,13 +0,0 @@
|
||||
.main-table thead>tr:first-of-type>th {border-left: 1px solid #ddd;}
|
||||
.main-table thead>tr>th {padding: 0px 8px; line-height: 24px;}
|
||||
tbody.sortable > tr > td > span.sort-handler {color: #999;}
|
||||
.icon-move {color: #16a8f8;}
|
||||
.table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -4px;}
|
||||
.c-PO {width: 100px;}
|
||||
.c-story {width: 300px;}
|
||||
.c-bug {width: 150px;}
|
||||
.c-plan, .c-release {width: 80px;}
|
||||
.c-actions {width: 70px;}
|
||||
#productList .c-manager {padding-left: 20px;}
|
||||
#productList .c-manager a {top: 7px; left: 26px;}
|
||||
.statistic {margin-left: 10px; color: #838a9d; float: left; position: relative; line-height: 28px;}
|
||||
@@ -1,12 +0,0 @@
|
||||
.project-type-label.label-outline {width: 50px; min-width: 50px;}
|
||||
.project-type-label.label {overflow: unset !important; text-overflow: unset !important; white-space: unset !important;}
|
||||
[lang^='en'] .project-name > .label-warning {width: 55px !important;}
|
||||
|
||||
.has-prefix {position: relative; display: flex; align-items: center;}
|
||||
.has-prefix > span {flex: none;}
|
||||
.has-prefix > a {padding-left: 5px;}
|
||||
|
||||
.has-suffix > a {max-width: calc(100% - 100px); padding-right: 5px; color: #0c60e1; display: inline-block; max-width: calc(100% - 50px);}
|
||||
.c-budget {width:100px; text-align: right; padding-right:16px !important;}
|
||||
.c-manager {white-space: nowrap; overflow: hidden;}
|
||||
.c-manager a {top: 8px;}
|
||||
@@ -1,141 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
var orderList = orderBy.split('_');
|
||||
var orderField = orderList[0];
|
||||
var orderType = orderList[1];
|
||||
setTimeout(function()
|
||||
{
|
||||
$(document).find('.dtable-header div[data-col="' + orderField + '"] > a').addClass(orderType == 'asc' ? 'sort-up' : 'sort-down');
|
||||
}, 100);
|
||||
|
||||
$('input#editProject1').click(function()
|
||||
{
|
||||
var editProject = $(this).is(':checked') ? 1 : 0;
|
||||
$.cookie('editProject', editProject, {expires:config.cookieLife, path:config.webRoot});
|
||||
dtableWithZentao.render({checkable: editProject});
|
||||
});
|
||||
|
||||
if($.cookie('editProject') == 1) $('input#editProject1').prop('checked', 'true');
|
||||
var isEditMode = $('input#editProject1').is(':checked');
|
||||
var projectIdList = [];
|
||||
dtableWithZentao.render({
|
||||
checkable: isEditMode,
|
||||
canRowCheckable(id)
|
||||
{
|
||||
const rowInfo = this.getRowInfo(id);
|
||||
return rowInfo.data?.type === 'project';
|
||||
},
|
||||
footToolbar: {
|
||||
items: [
|
||||
{size: 'sm', text: editLang, btnType: 'primary', className: 'edit-btn'},
|
||||
],
|
||||
},
|
||||
footPager: {
|
||||
items: [
|
||||
{type: 'info', text: pagerLang.totalCountAB},
|
||||
{type: 'size-menu', text: pagerLang.pageSizeAB},
|
||||
{type: 'link', page: 'first', icon: 'icon-first-page', hint: pagerLang.firstPage},
|
||||
{type: 'link', page: 'prev', icon: 'icon-angle-left', hint: pagerLang.previousPage},
|
||||
{type: 'info', text: '{page}/{pageTotal}'},
|
||||
{type: 'link', page: 'next', icon: 'icon-angle-right', hint: pagerLang.nextPage},
|
||||
{type: 'link', page: 'last', icon: 'icon-last-page', hint: pagerLang.lastPage},
|
||||
],
|
||||
page: pageID,
|
||||
recTotal: recTotal,
|
||||
recPerPage: recPerPage,
|
||||
linkCreator: pagerLink,
|
||||
},
|
||||
footer() {
|
||||
const statistic = () => {
|
||||
const checkedCount = this.getChecks().length;
|
||||
const text = isEditMode && checkedCount ? checkedProjects.replace('%s', checkedCount) : programSummary;
|
||||
|
||||
projectIdList = this.getChecks();
|
||||
return [{children: text, className: 'text-dark'}];
|
||||
};
|
||||
if (isEditMode) {
|
||||
return [
|
||||
'checkbox',
|
||||
'toolbar',
|
||||
statistic,
|
||||
'flex',
|
||||
'pager',
|
||||
];
|
||||
}
|
||||
return [
|
||||
statistic,
|
||||
'flex',
|
||||
'pager',
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
$(document).on('click', ".dtable-footer .edit-btn.toolbar-item", function()
|
||||
{
|
||||
var batchEditLink = createLink('project', 'batchEdit');
|
||||
var tempform = document.createElement("form");
|
||||
tempform.action = batchEditLink;
|
||||
tempform.method = "post";
|
||||
tempform.style.display = "none";
|
||||
|
||||
var opt = document.createElement("input");
|
||||
opt.name = 'projectIdList';
|
||||
opt.value = projectIdList;
|
||||
|
||||
tempform.appendChild(opt);
|
||||
document.body.appendChild(tempform);
|
||||
tempform.submit();
|
||||
});
|
||||
|
||||
if(status == 'bySearch') $('.dtable-footer').hide();
|
||||
|
||||
/* Solve the problem that clicking the browser back button causes the checkbox to be selected by default. */
|
||||
setTimeout(function()
|
||||
{
|
||||
$(":checkbox[name^='projectIdList']").each(function()
|
||||
{
|
||||
$(this).prop('checked', false);
|
||||
});
|
||||
$('.table-footer #checkAll').prop('checked', false);
|
||||
}, 10);
|
||||
});
|
||||
|
||||
function showEditCheckbox(show)
|
||||
{
|
||||
$('.icon-project,.icon-waterfall,.icon-scrum,.icon-kanban,.icon-agileplus,.icon-waterfallplus').each(function()
|
||||
{
|
||||
$this = $(this);
|
||||
$tr = $(this).closest('tr');
|
||||
projectID = $tr.attr('data-id');
|
||||
if(show)
|
||||
{
|
||||
var marginLeft = $tr.find('td:first').find('span.table-nest-icon').css('margin-left');
|
||||
|
||||
$tr.find('td:first').prepend("<div class='checkbox-primary'><input type='checkbox' name='projectIdList[]' value='" + projectID + "' id='projectIdList" + projectID + "'/><label for='projectIdList" + projectID + "'></lable></div>");
|
||||
$tr.find('td:first').find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14');
|
||||
$tr.find('td:first').find('span.table-nest-icon').css('margin-left', '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
var marginLeft = $tr.find('td:first').find('.checkbox-primary').css('margin-left');
|
||||
$tr.find('td:first').find('span.table-nest-icon').css('margin-left', marginLeft);
|
||||
$tr.find('td:first').find('[name^="projectIdList"]').parent().remove();
|
||||
}
|
||||
});
|
||||
if(show && hasProject)
|
||||
{
|
||||
var tableFooter = "<div class='editCheckbox'><div class='checkbox-primary check-all'><input type='checkbox' id='checkAll' /><label>" + selectAll + "</label></div><div class='table-actions btn-toolbar'><button type='submit' class='btn'>" + edit + "</button></div></div>";
|
||||
$('#programForm').attr('action', createLink('project', 'batchEdit', 'from=program'));
|
||||
$('.table-footer').prepend(tableFooter).show();
|
||||
$('body').scroll();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#programForm').removeClass('has-row-checked');
|
||||
$('#projectsSummary').addClass('hidden');
|
||||
$('#programSummary').removeClass('hidden');
|
||||
$('#programForm').find('.editCheckbox').remove();
|
||||
if($('#programForm .pager').length == 0) $('.table-footer').hide();
|
||||
$('#programForm').removeAttr('action');
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
$('#isCat').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#longTimeBox').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#longTimeBox').addClass('hidden');
|
||||
$('#longTimeBox').find('#longTime').prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#longTime').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#end').val('').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('#end').change(function()
|
||||
{
|
||||
var beginDate = $('#begin').val();
|
||||
var endDate = $('#end').val();
|
||||
var begin = new Date(beginDate.replace(/-/g,"/"));
|
||||
var end = new Date(endDate.replace(/-/g,"/"));
|
||||
var time = end.getTime() - begin.getTime();
|
||||
var days = parseInt(time / (1000 * 60 * 60 * 24)) + 1;
|
||||
if(days != $("input:radio[name='delta']:checked").val()) $("input:radio[name='delta']:checked").attr('checked',false);
|
||||
})
|
||||
});
|
||||
|
||||
function setCopyProject(copiedProgramID)
|
||||
{
|
||||
location.href = createLink('program', 'create', 'template=' + template + '&programID=' + parentProgramID + '©ProgramID=' + copiedProgramID);
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
var endDate = $('#end').val();
|
||||
$('#isCat').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#longTimeBox').removeClass('hidden');
|
||||
$('#longTime').change();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#longTimeBox').addClass('hidden');
|
||||
$('#longTimeBox').find('#longTime').prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#longTime').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#end').val('').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').val(endDate).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('#end').change(function()
|
||||
{
|
||||
var beginDate = $('#begin').val();
|
||||
var endDate = $('#end').val();
|
||||
var begin = new Date(beginDate.replace(/-/g,"/"));
|
||||
var end = new Date(endDate.replace(/-/g,"/"));
|
||||
var time = end.getTime() - begin.getTime();
|
||||
var days = parseInt(time / (1000 * 60 * 60 * 24)) + 1;
|
||||
if(days != $("input:radio[name='delta']:checked").val()) $("input:radio[name='delta']:checked").attr('checked',false);
|
||||
})
|
||||
|
||||
$('#isCat').change();
|
||||
|
||||
$('#budgetUnit').change(function()
|
||||
{
|
||||
if($(this).val() != oldBudgetUnit)
|
||||
{
|
||||
$('#currentUnit').text(budgetUnitList[$(this).val()]);
|
||||
$('#changeUnitTip').modal({show: true});
|
||||
}
|
||||
})
|
||||
|
||||
$('#cancelBTN').click(function()
|
||||
{
|
||||
$('#syncPRJUnit').val('false');
|
||||
$('#exchangeRate').val('');
|
||||
})
|
||||
|
||||
$('#confirmBTN').click(function()
|
||||
{
|
||||
var exchangeRate = $('#rate').val();
|
||||
if(!exchangeRate)
|
||||
{
|
||||
bootbox.alert(exRateNotEmpty);
|
||||
return false;
|
||||
}
|
||||
else if(isNaN(exchangeRate))
|
||||
{
|
||||
bootbox.alert(exRateNum);
|
||||
return false;
|
||||
}
|
||||
else if(exchangeRate < 0)
|
||||
{
|
||||
bootbox.alert(exRateNotNegative);
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#syncPRJUnit').val('true');
|
||||
$('#exchangeRate').val(exchangeRate);
|
||||
$('#changeUnitTip').modal('hide');
|
||||
})
|
||||
|
||||
/* If end is longtime, set the default date to today */
|
||||
var today = $.zui.formatDate(new Date(), 'yyyy-MM-dd');
|
||||
if($('#end').val() == longTime) $('#end').val(today).datetimepicker('update').val(longTime);
|
||||
|
||||
$('#realBegan').datetimepicker('setEndDate', today);
|
||||
});
|
||||
@@ -1,173 +0,0 @@
|
||||
/**
|
||||
* Process kanban data
|
||||
* @param {string} key Kanban key, used as kanban id
|
||||
* @param {Object} programsData Programs data
|
||||
* @returns {Object} kanban data
|
||||
*/
|
||||
function processKanbanData(key, programsData)
|
||||
{
|
||||
var kanbanId = key;
|
||||
|
||||
/* Generate columns */
|
||||
var columns = [];
|
||||
var executionsCol;
|
||||
$.each(kanbanColumns, function(_, column)
|
||||
{
|
||||
var colType = column.type;
|
||||
column = $.extend({}, column,
|
||||
{
|
||||
kanban: kanbanId,
|
||||
id: kanbanId + '-' + column.type,
|
||||
parentType: (colType === 'doingProject' || colType === 'doingExecution') ? 'doing' : false,
|
||||
});
|
||||
|
||||
if(colType === 'doingProject')
|
||||
{
|
||||
columns.push(
|
||||
{
|
||||
kanban: kanbanId,
|
||||
id: kanbanId + '-doing',
|
||||
type: 'doing',
|
||||
asParent: true,
|
||||
name: doingText,
|
||||
count: ''
|
||||
});
|
||||
}
|
||||
else if(colType === 'doingExecution')
|
||||
{
|
||||
executionsCol = column;
|
||||
executionsCol.count = 0;
|
||||
}
|
||||
columns.push(column);
|
||||
});
|
||||
|
||||
/* Format lanes data */
|
||||
var lanes = [];
|
||||
$.each(programsData, function(programId, program)
|
||||
{
|
||||
var subLanes = [];
|
||||
|
||||
$.each(program.products, function(_, product)
|
||||
{
|
||||
var items = {};
|
||||
|
||||
/* unclosed products */
|
||||
var productID = product.id;
|
||||
var productItem = {id: 'product-' + productID, _id: productID, name: product.name, shadow: product.shadow};
|
||||
items.unclosedProduct = [productItem];
|
||||
|
||||
/* plans */
|
||||
items.unexpiredPlan = [];
|
||||
var plans = product.plans;
|
||||
if(plans)
|
||||
{
|
||||
$.each(plans, function(_, plan)
|
||||
{
|
||||
var planID = plan.id;
|
||||
items.unexpiredPlan.push($.extend({}, plan, {id: 'plan-' + planID, _id: planID}));
|
||||
});
|
||||
}
|
||||
|
||||
/* wait projects */
|
||||
items.waitProject = [];
|
||||
var waitProjects = product.projects && product.projects.wait;
|
||||
if(waitProjects)
|
||||
{
|
||||
$.each(waitProjects, function(_, project)
|
||||
{
|
||||
var projectID = project.id;
|
||||
var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID});
|
||||
items.waitProject.push(projectItem);
|
||||
});
|
||||
}
|
||||
|
||||
/* doing projects and executions */
|
||||
items.doingProject = [];
|
||||
var doingProjects = product.projects && product.projects.doing;
|
||||
if(doingProjects)
|
||||
{
|
||||
$.each(doingProjects, function(_, project)
|
||||
{
|
||||
var projectID = project.id;
|
||||
var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID, execution: null});
|
||||
items.doingProject.push(projectItem);
|
||||
|
||||
var execution = project.execution;
|
||||
if(!execution || !execution.id) return;
|
||||
|
||||
executionsCol.count++;
|
||||
projectItem.execution = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
|
||||
});
|
||||
}
|
||||
|
||||
/* normal release */
|
||||
items.normalRelease = [];
|
||||
var releases = product.releases;
|
||||
if(releases)
|
||||
{
|
||||
$.each(releases, function(_, release)
|
||||
{
|
||||
if(!release || !release.id) return;
|
||||
var releaseID = release.id;
|
||||
var releaseItem = $.extend({}, release, {id: 'release-' + releaseID, _id: releaseID});
|
||||
items.normalRelease.push(releaseItem);
|
||||
});
|
||||
}
|
||||
|
||||
subLanes.push({id: kanbanId + '-' + programId + '-' + productID, items: items});
|
||||
});
|
||||
|
||||
var programItem = $.extend({}, program, {id: programId, kanban: kanbanId, subLanes: subLanes});
|
||||
lanes.push(programItem);
|
||||
});
|
||||
|
||||
return {id: kanbanId, columns: columns, lanes: lanes};
|
||||
}
|
||||
|
||||
/** Calculate column height */
|
||||
function calcColHeight(col, lane, colCards, colHeight)
|
||||
{
|
||||
if (col.type !== 'doingProject') return colHeight;
|
||||
return colCards.length * 62;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init kanban.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initKanban()
|
||||
{
|
||||
$.each(kanbanGroup, function(key, programsData)
|
||||
{
|
||||
var $kanban = $('#kanban-' + key);
|
||||
if(!$kanban.length) return;
|
||||
$kanban.kanban(
|
||||
{
|
||||
data: processKanbanData(key, programsData),
|
||||
virtualize: true,
|
||||
virtualCardList: true,
|
||||
calcColHeight: calcColHeight
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
/* Init all kanbans */
|
||||
initKanban();
|
||||
|
||||
$('#showAllProjects').click(function()
|
||||
{
|
||||
var showAllProjects = $(this).prop('checked') ? 1 : 0;
|
||||
$.post(createLink('program', 'ajaxSetShowSetting'), {"showAllProjects": showAllProjects}, function()
|
||||
{
|
||||
$.get(createLink('program', 'kanban'), function(data)
|
||||
{
|
||||
$('#kanbanList').html($(data).find('#kanbanList').html());
|
||||
initKanban();
|
||||
});
|
||||
})
|
||||
})
|
||||
});
|
||||
@@ -1,114 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
$('input[name^="showEdit"]').click(function()
|
||||
{
|
||||
$.cookie('showProductBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
|
||||
setCheckbox();
|
||||
});
|
||||
setCheckbox();
|
||||
|
||||
$(":checkbox[name^='productIDList']").on('click', function()
|
||||
{
|
||||
updateStatistic();
|
||||
});
|
||||
|
||||
$(".check-all").on('click', function()
|
||||
{
|
||||
if($(":checkbox[name^='productIDList']:not(:checked)").length == 0)
|
||||
{
|
||||
$(":checkbox[name^='productIDList']").prop('checked', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(":checkbox[name^='productIDList']").prop('checked', true);
|
||||
}
|
||||
updateStatistic();
|
||||
});
|
||||
|
||||
$('.main-table').on('click', 'tr', function(e)
|
||||
{
|
||||
if($.cookie('showProductBatchEdit') == 1) updateStatistic();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Set batch edit checkbox.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setCheckbox()
|
||||
{
|
||||
$('#productListForm .checkbox-primary, #productListForm .check-all').hide();
|
||||
$('#productListForm .product-id').addClass('hidden');
|
||||
$(":checkbox[name^='productIDList']").prop('checked', false);
|
||||
$('.check-all, .sortable tr').removeClass('checked');
|
||||
if($.cookie('showProductBatchEdit') == 1)
|
||||
{
|
||||
$('#productListForm .checkbox-primary, #productListForm .check-all').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.table-actions').hide();
|
||||
$('#productListForm .product-id').removeClass('hidden');
|
||||
}
|
||||
updateStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a statistics prompt statement after the Edit button.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function addStatistic()
|
||||
{
|
||||
var checkedLength = $(":checkbox[name^='productIDList']:checked").length;
|
||||
if(checkedLength > 0)
|
||||
{
|
||||
var summary = checkedProducts.replace('%s', checkedLength);
|
||||
if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('products', 'product');
|
||||
|
||||
var statistic = "<div id='productsSummary' class='statistic'>" + summary + "</div>";
|
||||
$('#productsCount').hide();
|
||||
$('#productsSummary').remove();
|
||||
$('#editBtn').after(statistic);
|
||||
$('.table-actions').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.table-actions').hide();
|
||||
$('#productsCount').show();
|
||||
$('#productsSummary').addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Anti shake operation for jquery.
|
||||
*
|
||||
* @param fn $fn
|
||||
* @param delay $delay
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function debounce(fn, delay)
|
||||
{
|
||||
var timer = null;
|
||||
return function()
|
||||
{
|
||||
if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(fn, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update statistics.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function updateStatistic()
|
||||
{
|
||||
debounce(addStatistic(), 200)
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
$('#projectsForm').table(
|
||||
{
|
||||
replaceId: 'projectIdList',
|
||||
statisticCreator: function(table)
|
||||
{
|
||||
var $table = table.getTable();
|
||||
var $checkedRows = $table.find('tbody>tr.checked');
|
||||
var checkedTotal = $checkedRows.length;
|
||||
var statistics = summary;
|
||||
var checkedStatistics = checkedSummary.replace('%total%', checkedTotal);
|
||||
|
||||
if(browseType == 'all')
|
||||
{
|
||||
var checkedWait = $checkedRows.filter("[data-status=wait]").length;
|
||||
var checkedDoing = $checkedRows.filter("[data-status=doing]").length;
|
||||
var checkedSuspended = $checkedRows.filter("[data-status=suspended]").length;
|
||||
var checkedClosed = $checkedRows.filter("[data-status=closed]").length;
|
||||
|
||||
statistics = allSummary;
|
||||
checkedStatistics = checkedAllSummary.replace('%total%', checkedTotal)
|
||||
.replace('%wait%', checkedWait)
|
||||
.replace('%doing%', checkedDoing)
|
||||
.replace('%suspended%', checkedSuspended)
|
||||
.replace('%closed%', checkedClosed);
|
||||
}
|
||||
|
||||
return checkedTotal ? checkedStatistics : statistics;
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name^="showEdit"]').click(function()
|
||||
{
|
||||
$.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
|
||||
setCheckbox();
|
||||
});
|
||||
setCheckbox();
|
||||
|
||||
$(":checkbox[name^='projectIdList']").on('click', function()
|
||||
{
|
||||
updateStatistic()
|
||||
});
|
||||
|
||||
$(".check-all").on('click', function()
|
||||
{
|
||||
if($(":checkbox[name^='projectIdList']:not(:checked)").length == 0)
|
||||
{
|
||||
$(":checkbox[name^='projectIdList']").prop('checked', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(":checkbox[name^='projectIdList']").prop('checked', true);
|
||||
}
|
||||
updateStatistic()
|
||||
});
|
||||
|
||||
$('.main-table').on('click', 'tr', function(e)
|
||||
{
|
||||
if($.cookie('showProjectBatchEdit') == 1) updateStatistic();
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Set batch edit checkbox.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setCheckbox()
|
||||
{
|
||||
$('#projectsForm .checkbox-primary').hide();
|
||||
$(":checkbox[name^='projectIdList']").prop('checked', false);
|
||||
$('.check-all, .sortable tr').removeClass('checked');
|
||||
if($.cookie('showProjectBatchEdit') == 1)
|
||||
{
|
||||
$('#projectsForm .checkbox-primary').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.table-actions').hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a statistics prompt statement after the Edit button.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function addStatistic()
|
||||
{
|
||||
var checkedLength = $(":checkbox[name^='projectIdList']:checked").length;
|
||||
if(checkedLength > 0)
|
||||
{
|
||||
$('.table-actions').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.table-actions').hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Anti shake operation for jquery.
|
||||
*
|
||||
* @param fn $fn
|
||||
* @param delay $delay
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function debounce(fn, delay)
|
||||
{
|
||||
var timer = null;
|
||||
return function()
|
||||
{
|
||||
if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(fn, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update statistics.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function updateStatistic()
|
||||
{
|
||||
debounce(addStatistic(), 200)
|
||||
}
|
||||
Reference in New Issue
Block a user