Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trelloexport.js #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions trelloexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ var $,
// Variables
var $excel_btn,
addInterval,
columnHeadings = ['List', 'Title', 'Description', 'Points', 'Due', 'Members', 'Labels', 'Card #'];
columnHeadings = ['List', 'Title', 'Description', 'Points Estimated', 'Points Spent', 'Due', 'Members', 'Labels', 'Card #'];

window.URL = window.webkitURL || window.URL;

function createExcelExport() {
"use strict";
// RegEx to find the points for users of TrelloScrum
var pointReg = /[\(](\x3f|\d*\.?\d+)([\)])\s?/m;
var spentReg = /[\[](\x3f|\d*\.?\d+)([\]])\s?/m;

$.getJSON($('a.js-export-json').attr('href'), function (data) {

Expand Down Expand Up @@ -78,6 +79,8 @@ function createExcelExport() {
var title = card.name,
parsed = title.match(pointReg),
points = parsed ? parsed[1] : '',
parsedSpent = title.match(spentReg),
spent = parsedSpent ? parsedSpent[1] : '',
due = card.due || '',
memberIDs,
memberInitials = [],
Expand All @@ -88,6 +91,7 @@ function createExcelExport() {
r;

title = title.replace(pointReg, '');
title = title.replace(spentReg, '');

// tag archived cards
if (card.closed) {
Expand Down Expand Up @@ -123,6 +127,7 @@ function createExcelExport() {
title,
card.desc,
points,
spent,
due,
memberInitials.toString(),
labels.toString(),
Expand Down Expand Up @@ -207,4 +212,4 @@ $(function () {
$(document).on('mouseup', ".js-share", function () {
addInterval = setInterval(addExportLink, 500);
});
});
});