Skip to content

Instantly share code, notes, and snippets.

@robinwarren
Last active January 28, 2022 17:15
Show Gist options
  • Save robinwarren/7a2398f7eea182d91dc7 to your computer and use it in GitHub Desktop.
Save robinwarren/7a2398f7eea182d91dc7 to your computer and use it in GitHub Desktop.

Revisions

  1. robinwarren revised this gist Oct 9, 2015. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions dashboard.html
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@ <h1>Trello Dashboard</h1>
    <select class="form-control" id="boards"></select>
    </div>
    </form>

    <div id="labels"></div>
    </div>
    </body>

    @@ -38,6 +40,24 @@ <h1>Trello Dashboard</h1>
    );
    };

    var loadedLabels = function(labels) {
    $.each(labels, function(index, label) {
    var label = $("<p><span class='badge' style='background:" + label.color + ";'>" + label.uses + "</span> " + label.name + "</p>");
    $('#labels').append(label)
    });
    };

    $('#boards').change(function() {
    var boardId = $("option:selected", this).val();
    $('#labels').empty();

    Trello.get(
    '/boards/' + boardId + '/labels',
    loadedLabels,
    function() { console.log("Failed to load labels"); }
    );
    });

    Trello.authorize({
    type: "popup",
    name: "Trello dashboard",
  2. robinwarren revised this gist Oct 9, 2015. 1 changed file with 27 additions and 4 deletions.
    31 changes: 27 additions & 4 deletions dashboard.html
    Original file line number Diff line number Diff line change
    @@ -6,23 +6,46 @@
    <body>
    <div class="container">
    <h1>Trello Dashboard</h1>
    <!-- We will be putting our dashboard right here -->

    <form class="form-horizontal" id="boards_form">
    <div class="form-group">
    <label class="control-label">Choose your board</label>
    <select class="form-control" id="boards"></select>
    </div>
    </form>
    </div>
    </body>

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="https://api.trello.com/1/client.js?key=[AppKey]"></script>

    <script type="text/javascript">
    var loadedBoards = function(boards) {
    $.each(boards, function(index, value) {
    $('#boards')
    .append($("<option></option>")
    .attr("value",value.id)
    .text(value.name));
    });
    };

    var loadBoards = function() {
    //Get the users boards
    Trello.get(
    '/members/me/boards/',
    loadedBoards,
    function() { console.log("Failed to load boards"); }
    );
    };

    Trello.authorize({
    type: "popup",
    name: "Trello dashboard",
    scope: {
    read: true,
    write: false
    },
    write: false },
    expiration: "never",
    success: function() { console.log("Successful authentication"); },
    success: loadBoards,
    error: function() { console.log("Failed authentication"); }
    });
    </script>
  3. robinwarren revised this gist Oct 9, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dashboard.html
    Original file line number Diff line number Diff line change
    @@ -22,8 +22,8 @@ <h1>Trello Dashboard</h1>
    write: false
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    success: function() { console.log("Successful authentication"); },
    error: function() { console.log("Failed authentication"); }
    });
    </script>
    </html>
  4. robinwarren revised this gist Oct 9, 2015. 1 changed file with 14 additions and 13 deletions.
    27 changes: 14 additions & 13 deletions dashboard.html
    Original file line number Diff line number Diff line change
    @@ -5,24 +5,25 @@
    </head>
    <body>
    <div class="container">
    <h1>Trello Dashboard</h1>
    <!-- We will be putting our dashboard right here -->
    <h1>Trello Dashboard</h1>
    <!-- We will be putting our dashboard right here -->
    </div>
    </body>

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="https://api.trello.com/1/client.js?key=[AppKey]"></script>

    <script type="text/javascript">
    Trello.authorize({
    type: "popup",
    name: "Trello dashboard",
    scope: {
    read: true,
    write: false
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    });
    type: "popup",
    name: "Trello dashboard",
    scope: {
    read: true,
    write: false
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    });
    </script>
    </html>
  5. robinwarren revised this gist Oct 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dashboard.html
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ <h1>Trello Dashboard</h1>
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    function() { console.log("Failed authentication"); }
    });
    </script>
    </html>
  6. robinwarren revised this gist Oct 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dashboard.html
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ <h1>Trello Dashboard</h1>
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    function() { console.log("Failed authentication"); }
    });
    </script>
    </html>
  7. robinwarren renamed this gist Oct 9, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. robinwarren revised this gist Oct 9, 2015. No changes.
  9. robinwarren revised this gist Oct 9, 2015. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions blank_dashboard.html
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,16 @@ <h1>Trello Dashboard</h1>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="https://api.trello.com/1/client.js?key=[AppKey]"></script>
    <script type="text/javascript">
    //This is where out JS code will go

    Trello.authorize({
    type: "popup",
    name: "Trello dashboard",
    scope: {
    read: true,
    write: false
    },
    expiration: "never",
    function() { console.log("Successful authentication"); },
    function() { console.log("Failed authentication"); }
    });
    </script>
    </html>
  10. robinwarren revised this gist Oct 9, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions blank_dashboard.html
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ <h1>Trello Dashboard</h1>
    </body>

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="https://api.trello.com/1/client.js?key=[AppKey]"></script>
    <script type="text/javascript">
    //This is where out JS code will go

  11. robinwarren created this gist Oct 9, 2015.
    18 changes: 18 additions & 0 deletions blank_dashboard.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <html>
    <head>
    <title>A Trello Dashboard</title>
    <link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    </head>
    <body>
    <div class="container">
    <h1>Trello Dashboard</h1>
    <!-- We will be putting our dashboard right here -->
    </div>
    </body>

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    //This is where out JS code will go

    </script>
    </html>