Created
May 5, 2014 20:22
-
-
Save methyl/11546527 to your computer and use it in GitHub Desktop.
rob.coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
construtor: -> | |
@api = GRG.api | |
getCardsFromChecklists: -> | |
@api.getCardChecklists @, @convertChecklistToCards | |
convertTasksChecklistToCards: (checklists) => | |
# use underscore.js bitch! | |
unless list = _(checklists).findWhere(name: GRG.Trello.Checklist.tasks.name) | |
console.log("Tasks checklist not found.") | |
return false | |
for item in list.checkItems when !(/^http/.test(item.name)) | |
@api.postCard({name: item.name, listId: @listId()}) | |
listId: => | |
@_apiCard().idList() | |
_apiCard: => | |
@_apiCard ?= @api.getCard @ #make meh sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment