From bfaeb0bbfd8310707c1b02649664ae9d983e3a3b Mon Sep 17 00:00:00 2001 From: Jose Marcenaro Date: Sat, 2 Nov 2013 14:23:44 -0300 Subject: [PATCH 1/2] Added support for Assembla tickets From an Assembla ticket page (in full page mode or as a modal dialog) adds a card in the format #nn ticket_title --- README.md | 1 + trello_bookmarklet.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index efbbf4e..8cf020e 100755 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This is a bookmarklet you - FogBugz cases - JIRA issues - GitHub issues and commits + - Assembla tickets - The selected text from an arbitrary URL - ... more? I'm happy to take pull requests that add support for other websites! diff --git a/trello_bookmarklet.js b/trello_bookmarklet.js index 91c045d..45b4d33 100755 --- a/trello_bookmarklet.js +++ b/trello_bookmarklet.js @@ -12,6 +12,11 @@ // We're looking at a FogBugz case name = goBug.ixBug + ": " + goBug.sTitle + } else if ($('span.ticket-number').length && $('div.ticket-summary h1').length){ + + // we're looking at an Assembla ticket + name = $('span.ticket-number').text().trim() + ' '+ $('div.ticket-summary h1').text().trim(); + } else if ($("#issue_header_summary").length){ // We're looking at a JIRA case in an older JIRA installation From 159b5b6d57f9341f02f058990480ac8b0a9eb27e Mon Sep 17 00:00:00 2001 From: Jose Marcenaro Date: Sat, 2 Nov 2013 14:29:54 -0300 Subject: [PATCH 2/2] Update readme.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8cf020e..bae8549 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ +This is a fork from danlec/Trello-Bookmarklet to add support for Assembla tickets. + +It adds a card with the name "#nn ticket_title" based on the current Assembla ticket (as modal popup or in full page mode) + ```javascript -javascript:(function(a){window.trelloAppKey="optional";window.trelloIdList="optional";var b=a.createElement("script");b.src="https://raw.github.com/danlec/Trello-Bookmarklet/master/trello_bookmarklet.js";a.getElementsByTagName("head")[0].appendChild(b)})(document); +javascript:(function(a){window.trelloAppKey="optional";window.trelloIdList="optional";var b=a.createElement("script");b.src="https://raw.github.com/josemarcenaro/Trello-Bookmarklet/master/trello_bookmarklet.js";a.getElementsByTagName("head")[0].appendChild(b)})(document); ``` This is a bookmarklet you can use to create a card in Trello from ... @@ -32,4 +36,4 @@ and prepending `javascript:` to the front. If you'd rather not add your appKey and idList for every new domain, you can modify the bookmarklet and include values for `window.trelloAppKey` and `window.trelloIdList` (currently both have the value `"optional"`) -**Note:** This basic concept originated with https://github.com/markdrago/cardorizer; this approach doesn't require you to run a server \ No newline at end of file +**Note:** This basic concept originated with https://github.com/markdrago/cardorizer; this approach doesn't require you to run a server