A Pen by Michel Daviot on CodePen.
Created
May 21, 2014 09:02
-
-
Save tyrcho/12b44eb54f5a29fce042 to your computer and use it in GitHub Desktop.
A Pen by Michel Daviot.
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
<div class="contenzone"> | |
<div class="titlebar"> | |
<a href="aazeae">qsdqsd</a> | |
</div> | |
</div> | |
<div id="loggedout"> | |
<a id="connectLink" href="#">Connect To Trello</a> | |
</div> | |
<div id="loggedin"> | |
<div id="header"> | |
Logged in to as <span id="fullName"></span> | |
<a id="disconnect" href="#">Log Out</a> | |
</div> | |
<div id="output"></div> | |
</div> |
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
$( ".contenzone .titlebar a " ).not(".link").each (index, element) => | |
$(element).after('<p>test</p>') | |
console.log($(element).text()) | |
printBoard = (board) -> | |
console.log(board.id+"-"+board.name) | |
console.log (list.name+"-"+list.id) for list in board.lists | |
onAuthorize = -> | |
console.log("logged in") | |
updateLoggedIn() | |
$("#output").empty() | |
Trello.members.get "me", (member) -> | |
$("#fullName").text member.fullName | |
$cards = $("<div>").text("Loading Cards...").appendTo("#output") | |
Trello.get "members/me/boards?lists=open", (boards) -> | |
$cards.empty() | |
printBoard board for board in boards | |
#Trello.lists.get board.id, (elt) -> | |
# console.log(elt.name) | |
# $("<a>").attr( | |
# href: board.url | |
# target: "trello" | |
# ).addClass("card").text(board.id).appendTo $cards | |
updateLoggedIn = -> | |
isLoggedIn = Trello.authorized() | |
$("#loggedout").toggle not isLoggedIn | |
$("#loggedin").toggle isLoggedIn | |
return | |
logout = -> | |
Trello.deauthorize() | |
updateLoggedIn() | |
return | |
Trello.authorize | |
interactive: true | |
success: onAuthorize | |
$("#connectLink").click -> | |
Trello.authorize | |
type: "popup" | |
success: onAuthorize | |
$("#disconnect").click logout |
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
body { | |
font-family: arial; | |
font-size: 12px; | |
} | |
#loggedout { | |
text-align: center; | |
font-size: 20px; | |
padding-top: 30px; | |
} | |
#loggedin { | |
display: none; | |
} | |
#header { | |
padding: 4px; | |
border-bottom: 1px solid #000; | |
background: #eee; | |
} | |
#output { | |
padding: 4px; | |
} | |
.card { | |
display: block; | |
padding: 2px; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment