Add support for rendering the Markdown in issues via the Markdown Resin drop (powered by the Showdown parser)

Fixes #45
This commit is contained in:
R. Tyler Croy 2012-03-24 18:21:13 -07:00
parent d4c36409b8
commit 7c154da1ce
5 changed files with 29 additions and 26 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "drops/github"]
path = drops/github
url = git://github.com/rtyler/github-resindrop.git
[submodule "drops/markdown"]
path = drops/markdown
url = git://github.com/rtyler/markdown-resindrop.git

1
drops/markdown Submodule

@ -0,0 +1 @@
Subproject commit a6e666a5c2717adc0add6327d678118c872c08b0

View File

@ -85,6 +85,7 @@ fn: function (){
var self=this;
(self['@issueApi']=smalltalk.send(smalltalk.send((smalltalk.Issues || Issues), "_new", []), "_setToken_", [self['@token']]));
(self['@userApi']=smalltalk.send(smalltalk.send((smalltalk.Users || Users), "_new", []), "_setToken_", [self['@token']]));
smalltalk.send(self, "_showSpinner", []);
smalltalk.send(self['@userApi'], "_fetchCurrent_", [(function(data){(self['@userData']=data);return smalltalk.send(smalltalk.send(unescape("%23logout-username"), "_asJQuery", []), "_text_", [smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(data, "_at_", ["login"])]), "__comma", [unescape("%29")])]);})]);
smalltalk.send(self, "_refresh", []);
smalltalk.send(self, "_startRefreshTimer", []);
@ -139,7 +140,7 @@ var self=this;
smalltalk.send(self, "_flushColumns", []);
smalltalk.send(self['@issueApi'], "_issues_loadAll_", [(function(issue){var tile=nil;
var issueId=nil;
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(self['@issueMap'], "_at_put_", [issueId, tile]);smalltalk.send(self['@knownRepos'], "_add_", [smalltalk.send(issue, "_projectName", [])]);((($receiver = smalltalk.send(self, "_inProgress_", [smalltalk.send(issue, "_labels", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);})() : (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);}), (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})]));(($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;return smalltalk.send(self, "_updateFilter", []);}), false]);
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(self['@issueMap'], "_at_put_", [issueId, tile]);smalltalk.send(self['@knownRepos'], "_add_", [smalltalk.send(issue, "_projectName", [])]);((($receiver = smalltalk.send(self, "_inProgress_", [smalltalk.send(issue, "_labels", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);})() : (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);}), (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})]));(($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;smalltalk.send(self, "_updateFilter", []);return smalltalk.send(self, "_hideSpinner", []);}), false]);
smalltalk.send(self['@issueApi'], "_recentlyClosed_loadAll_", [(function(issue){var tile=nil;
var issueId=nil;
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(tile, "_setClosed", []);smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23closedissues"), "_asJQuery", [])]);return (($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;}), false]);
@ -487,7 +488,6 @@ var self=this;
var dialog=nil;
(dialog=smalltalk.send(smalltalk.send((smalltalk.IssueDetailDialog || IssueDetailDialog), "_new", []), "_withIssue_", [self['@model']]));
smalltalk.send(dialog, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("clicked%20%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])])]);
return self;}
}),
smalltalk.IssueTile);
@ -582,7 +582,7 @@ smalltalk.method({
selector: unescape('renderOn%3A'),
fn: function (html){
var self=this;
(function($rec){smalltalk.send($rec, "_at_put_", ["title", smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])]), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(self['@model'], "_title", [])])]);smalltalk.send($rec, "_id_", [self['@elementId']]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [smalltalk.send(smalltalk.send(self['@model'], "_body", []), "_asString", [])]);smalltalk.send(html, "_hr", []);smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", ["Comments:"]);smalltalk.send(html, "_hr", []);(function($rec){smalltalk.send($rec, "_id_", ["comments"]);return smalltalk.send($rec, "_style_", [unescape("overflow%3A%20auto%3B%20max-height%3A%20300px")]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_style_", [unescape("float%3A%20right%3B")]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_href_", [smalltalk.send(self['@model'], "_url", [])]);return smalltalk.send($rec, "_with_", ["view on GitHub"]);})(smalltalk.send(html, "_a", []));})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_div", []));
(function($rec){smalltalk.send($rec, "_at_put_", ["title", smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])]), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(self['@model'], "_title", [])])]);smalltalk.send($rec, "_id_", [self['@elementId']]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [smalltalk.send((smalltalk.Markdown || Markdown), "_asTagBrush_", [smalltalk.send(smalltalk.send(self['@model'], "_body", []), "_asString", [])])]);smalltalk.send(html, "_hr", []);smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", ["Comments:"]);smalltalk.send(html, "_hr", []);(function($rec){smalltalk.send($rec, "_id_", ["comments"]);return smalltalk.send($rec, "_style_", [unescape("overflow%3A%20auto%3B%20max-height%3A%20300px")]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_style_", [unescape("float%3A%20right%3B")]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_href_", [smalltalk.send(self['@model'], "_url", [])]);return smalltalk.send($rec, "_with_", ["view on GitHub"]);})(smalltalk.send(html, "_a", []));})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_div", []));
smalltalk.send(self, "_becomeDialog", []);
smalltalk.send(self['@model'], "_loadComments_", [(function(comments){return smalltalk.send(comments, "_do_", [(function(comment){return smalltalk.send((function(html){return smalltalk.send(self, "_renderComment_onto_", [comment, html]);}), "_appendToJQuery_", [smalltalk.send(unescape("%23comments"), "_asJQuery", [])]);})]);})]);
return self;}
@ -607,7 +607,7 @@ smalltalk.method({
selector: unescape('renderComment%3Aonto%3A'),
fn: function (comment, html){
var self=this;
(function($rec){smalltalk.send($rec, "_class_", ["comment_detail"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", [smalltalk.send("By: ", "__comma", [smalltalk.send(comment, "_login", [])])]);return smalltalk.send(smalltalk.send(comment, "_body", []), "_linesDo_", [(function(line){return smalltalk.send(smalltalk.send(html, "_p", []), "_with_", [line]);})]);})]);})(smalltalk.send(html, "_div", []));
(function($rec){smalltalk.send($rec, "_class_", ["comment_detail"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", [smalltalk.send("By: ", "__comma", [smalltalk.send(comment, "_login", [])])]);return smalltalk.send(html, "_with_", [smalltalk.send((smalltalk.Markdown || Markdown), "_asTagBrush_", [smalltalk.send(comment, "_body", [])])]);})]);})(smalltalk.send(html, "_div", []));
smalltalk.send(html, "_hr", []);
return self;}
}),

View File

@ -116,14 +116,15 @@ fn: function (){
var self=this;
(self['@issueApi']=smalltalk.send(smalltalk.send((smalltalk.Issues || Issues), "_new", []), "_setToken_", [self['@token']]));
(self['@userApi']=smalltalk.send(smalltalk.send((smalltalk.Users || Users), "_new", []), "_setToken_", [self['@token']]));
smalltalk.send(self, "_showSpinner", []);
smalltalk.send(self['@userApi'], "_fetchCurrent_", [(function(data){(self['@userData']=data);return smalltalk.send(smalltalk.send(unescape("%23logout-username"), "_asJQuery", []), "_text_", [smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(data, "_at_", ["login"])]), "__comma", [unescape("%29")])]);})]);
smalltalk.send(self, "_refresh", []);
smalltalk.send(self, "_startRefreshTimer", []);
smalltalk.send(smalltalk.send(".issuecolumn", "_asJQuery", []), "_droppable_", [smalltalk.HashedCollection._fromPairs_([smalltalk.send("tolerance", "__minus_gt", ["pointer"]),smalltalk.send("drop", "__minus_gt", [(function(event, ui){return smalltalk.send(self, "_handleDrop_with_", [event, ui]);})])])]);
return self;},
args: [],
source: unescape('bootstrap%0A%09issueApi%20%3A%3D%20Issues%20new%20setToken%3A%20token.%0A%09userApi%20%3A%3D%20Users%20new%20setToken%3A%20token.%0A%09userApi%20fetchCurrent%3A%20%5B%20%3Adata%20%7C%20userData%20%3A%3D%20data.%20%27%23logout-username%27%20asJQuery%20text%3A%20%28%27%28%27%2C%20%28data%20at%3A%20%27login%27%29%2C%20%27%29%27%29%20%5D.%0A%09self%20refresh.%0A%09self%20startRefreshTimer.%0A%09%27.issuecolumn%27%20asJQuery%20droppable%3A%20%23%7B%27tolerance%27%20-%3E%20%27pointer%27.%0A%09%09%27drop%27%20-%3E%20%5B%20%3Aevent%20%3Aui%20%7C%20self%20handleDrop%3A%20event%20with%3A%20ui%5D%7D.'),
messageSends: ["setToken:", "new", "fetchCurrent:", "text:", "asJQuery", unescape("%2C"), "at:", "refresh", "startRefreshTimer", "droppable:", unescape("-%3E"), "handleDrop:with:"],
source: unescape('bootstrap%0A%09issueApi%20%3A%3D%20Issues%20new%20setToken%3A%20token.%0A%09userApi%20%3A%3D%20Users%20new%20setToken%3A%20token.%0A%09self%20showSpinner.%0A%09userApi%20fetchCurrent%3A%20%5B%20%3Adata%20%7C%20userData%20%3A%3D%20data.%20%27%23logout-username%27%20asJQuery%20text%3A%20%28%27%28%27%2C%20%28data%20at%3A%20%27login%27%29%2C%20%27%29%27%29%20%5D.%0A%09self%20refresh.%0A%09self%20startRefreshTimer.%0A%09%27.issuecolumn%27%20asJQuery%20droppable%3A%20%23%7B%27tolerance%27%20-%3E%20%27pointer%27.%0A%09%09%27drop%27%20-%3E%20%5B%20%3Aevent%20%3Aui%20%7C%20self%20handleDrop%3A%20event%20with%3A%20ui%5D%7D.'),
messageSends: ["setToken:", "new", "showSpinner", "fetchCurrent:", "text:", "asJQuery", unescape("%2C"), "at:", "refresh", "startRefreshTimer", "droppable:", unescape("-%3E"), "handleDrop:with:"],
referencedClasses: ["Issues", "Users"]
}),
smalltalk.HubboardApp);
@ -185,14 +186,14 @@ var self=this;
smalltalk.send(self, "_flushColumns", []);
smalltalk.send(self['@issueApi'], "_issues_loadAll_", [(function(issue){var tile=nil;
var issueId=nil;
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(self['@issueMap'], "_at_put_", [issueId, tile]);smalltalk.send(self['@knownRepos'], "_add_", [smalltalk.send(issue, "_projectName", [])]);((($receiver = smalltalk.send(self, "_inProgress_", [smalltalk.send(issue, "_labels", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);})() : (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);}), (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})]));(($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;return smalltalk.send(self, "_updateFilter", []);}), false]);
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(self['@issueMap'], "_at_put_", [issueId, tile]);smalltalk.send(self['@knownRepos'], "_add_", [smalltalk.send(issue, "_projectName", [])]);((($receiver = smalltalk.send(self, "_inProgress_", [smalltalk.send(issue, "_labels", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);})() : (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(tile, "_setOpen", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23openissues"), "_asJQuery", [])]);}), (function(){smalltalk.send(tile, "_setInProgress", []);return smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23inprogressissues"), "_asJQuery", [])]);})]));(($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;smalltalk.send(self, "_updateFilter", []);return smalltalk.send(self, "_hideSpinner", []);}), false]);
smalltalk.send(self['@issueApi'], "_recentlyClosed_loadAll_", [(function(issue){var tile=nil;
var issueId=nil;
(issueId=smalltalk.send(issue, "_issueId", []));(tile=smalltalk.send(self['@issueMap'], "_at_ifAbsent_", [issueId, (function(){return smalltalk.send((smalltalk.IssueTile || IssueTile), "_new", []);})]));smalltalk.send(tile, "_withModel_", [issue]);smalltalk.send(tile, "_setClosed", []);smalltalk.send(tile, "_appendToJQuery_", [smalltalk.send(unescape("%23closedissues"), "_asJQuery", [])]);return (($receiver = self['@currentProject']) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(self['@currentProject'], "__eq", [smalltalk.send(issue, "_projectName", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(tile, "_asJQuery", []), "_hide", []);})]));})() : nil;}), false]);
return self;},
args: [],
source: unescape('refresh%0A%09self%20flushColumns.%0A%0A%09issueApi%20issues%3A%20%5B%20%3Aissue%20%7C%0A%09%09%09%7C%20tile%20issueId%20%7C%0A%09%09%09issueId%20%3A%3D%20issue%20issueId.%0A%09%09%09tile%20%3A%3D%20issueMap%20at%3A%20issueId%20ifAbsent%3A%20%5B%20IssueTile%20new%20%5D.%0A%09%09%09tile%20withModel%3A%20issue.%0A%09%09%09issueMap%20at%3A%20issueId%20put%3A%20tile.%0A%09%09%09knownRepos%20add%3A%20%28issue%20projectName%29.%0A%09%09%09%28self%20inProgress%3A%20%28issue%20labels%29%29%0A%09%09%09%09%09ifFalse%3A%20%5B%20tile%20setOpen.%20tile%20appendToJQuery%3A%20%28%27%23openissues%27%20asJQuery%29%20%5D%0A%09%09%09%09%09ifTrue%3A%20%5B%20tile%20setInProgress.%20tile%20appendToJQuery%3A%20%28%27%23inprogressissues%27%20asJQuery%29%20%5D.%0A%09%09%09currentProject%20ifNotNil%3A%20%5B%0A%09%09%09%09currentProject%20%3D%20%28issue%20projectName%29%20ifFalse%3A%20%5Btile%20asJQuery%20hide%5D.%0A%09%09%09%5D.%0A%09%09%09self%20updateFilter.%20%22This%20might%20prove%20to%20be%20CPU%20intensive%22%0A%09%09%5D%20loadAll%3A%20false.%0A%0A%09issueApi%20recentlyClosed%3A%20%5B%20%3Aissue%20%7C%0A%09%09%09%7C%20tile%20issueId%20%7C%0A%09%09%09issueId%20%3A%3D%20issue%20issueId.%0A%09%09%09tile%20%3A%3D%20issueMap%20at%3A%20issueId%20ifAbsent%3A%20%5B%20IssueTile%20new%20%5D.%0A%09%09%09tile%20withModel%3A%20issue.%0A%09%09%09tile%20setClosed.%0A%09%09%09tile%20appendToJQuery%3A%20%28%27%23closedissues%27%20asJQuery%29.%0A%09%09%09currentProject%20ifNotNil%3A%20%5B%0A%09%09%09%09currentProject%20%3D%20%28issue%20projectName%29%20ifFalse%3A%20%5Btile%20asJQuery%20hide%5D.%0A%09%09%09%5D%0A%09%5D%20loadAll%3A%20false.'),
messageSends: ["flushColumns", "issues:loadAll:", "issueId", "at:ifAbsent:", "new", "withModel:", "at:put:", "add:", "projectName", "ifFalse:ifTrue:", "inProgress:", "labels", "setOpen", "appendToJQuery:", "asJQuery", "setInProgress", "ifNotNil:", "ifFalse:", unescape("%3D"), "hide", "updateFilter", "recentlyClosed:loadAll:", "setClosed"],
source: unescape('refresh%0A%09self%20flushColumns.%0A%0A%09issueApi%20issues%3A%20%5B%20%3Aissue%20%7C%0A%09%09%09%7C%20tile%20issueId%20%7C%0A%09%09%09issueId%20%3A%3D%20issue%20issueId.%0A%09%09%09tile%20%3A%3D%20issueMap%20at%3A%20issueId%20ifAbsent%3A%20%5B%20IssueTile%20new%20%5D.%0A%09%09%09tile%20withModel%3A%20issue.%0A%09%09%09issueMap%20at%3A%20issueId%20put%3A%20tile.%0A%09%09%09knownRepos%20add%3A%20%28issue%20projectName%29.%0A%09%09%09%28self%20inProgress%3A%20%28issue%20labels%29%29%0A%09%09%09%09%09ifFalse%3A%20%5B%20tile%20setOpen.%20tile%20appendToJQuery%3A%20%28%27%23openissues%27%20asJQuery%29%20%5D%0A%09%09%09%09%09ifTrue%3A%20%5B%20tile%20setInProgress.%20tile%20appendToJQuery%3A%20%28%27%23inprogressissues%27%20asJQuery%29%20%5D.%0A%09%09%09currentProject%20ifNotNil%3A%20%5B%0A%09%09%09%09currentProject%20%3D%20%28issue%20projectName%29%20ifFalse%3A%20%5Btile%20asJQuery%20hide%5D.%0A%09%09%09%5D.%0A%09%09%09self%20updateFilter.%0A%09%09%09self%20hideSpinner.%0A%09%09%5D%20loadAll%3A%20false.%0A%0A%09issueApi%20recentlyClosed%3A%20%5B%20%3Aissue%20%7C%0A%09%09%09%7C%20tile%20issueId%20%7C%0A%09%09%09issueId%20%3A%3D%20issue%20issueId.%0A%09%09%09tile%20%3A%3D%20issueMap%20at%3A%20issueId%20ifAbsent%3A%20%5B%20IssueTile%20new%20%5D.%0A%09%09%09tile%20withModel%3A%20issue.%0A%09%09%09tile%20setClosed.%0A%09%09%09tile%20appendToJQuery%3A%20%28%27%23closedissues%27%20asJQuery%29.%0A%09%09%09currentProject%20ifNotNil%3A%20%5B%0A%09%09%09%09currentProject%20%3D%20%28issue%20projectName%29%20ifFalse%3A%20%5Btile%20asJQuery%20hide%5D.%0A%09%09%09%5D%0A%09%5D%20loadAll%3A%20false.'),
messageSends: ["flushColumns", "issues:loadAll:", "issueId", "at:ifAbsent:", "new", "withModel:", "at:put:", "add:", "projectName", "ifFalse:ifTrue:", "inProgress:", "labels", "setOpen", "appendToJQuery:", "asJQuery", "setInProgress", "ifNotNil:", "ifFalse:", unescape("%3D"), "hide", "updateFilter", "hideSpinner", "recentlyClosed:loadAll:", "setClosed"],
referencedClasses: ["IssueTile"]
}),
smalltalk.HubboardApp);
@ -668,11 +669,10 @@ var self=this;
var dialog=nil;
(dialog=smalltalk.send(smalltalk.send((smalltalk.IssueDetailDialog || IssueDetailDialog), "_new", []), "_withIssue_", [self['@model']]));
smalltalk.send(dialog, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("clicked%20%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])])]);
return self;},
args: ["onClickEvent"],
source: unescape('viewIssue%3A%20onClickEvent%0A%09%7C%20dialog%20%7C%0A%09dialog%20%3A%3D%20IssueDetailDialog%20new%20withIssue%3A%20model.%0A%09dialog%20appendToJQuery%3A%20%27body%27%20asJQuery.%0A%09console%20log%3A%20%27clicked%20%23%27%2C%20%28model%20number%29.%0A%09'),
messageSends: ["withIssue:", "new", "appendToJQuery:", "asJQuery", "log:", unescape("%2C"), "number"],
source: unescape('viewIssue%3A%20onClickEvent%0A%09%7C%20dialog%20%7C%0A%09dialog%20%3A%3D%20IssueDetailDialog%20new%20withIssue%3A%20model.%0A%09dialog%20appendToJQuery%3A%20%27body%27%20asJQuery.%0A%09'),
messageSends: ["withIssue:", "new", "appendToJQuery:", "asJQuery"],
referencedClasses: ["IssueDetailDialog"]
}),
smalltalk.IssueTile);
@ -798,14 +798,14 @@ selector: unescape('renderOn%3A'),
category: 'rendering',
fn: function (html){
var self=this;
(function($rec){smalltalk.send($rec, "_at_put_", ["title", smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])]), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(self['@model'], "_title", [])])]);smalltalk.send($rec, "_id_", [self['@elementId']]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [smalltalk.send(smalltalk.send(self['@model'], "_body", []), "_asString", [])]);smalltalk.send(html, "_hr", []);smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", ["Comments:"]);smalltalk.send(html, "_hr", []);(function($rec){smalltalk.send($rec, "_id_", ["comments"]);return smalltalk.send($rec, "_style_", [unescape("overflow%3A%20auto%3B%20max-height%3A%20300px")]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_style_", [unescape("float%3A%20right%3B")]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_href_", [smalltalk.send(self['@model'], "_url", [])]);return smalltalk.send($rec, "_with_", ["view on GitHub"]);})(smalltalk.send(html, "_a", []));})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_div", []));
(function($rec){smalltalk.send($rec, "_at_put_", ["title", smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self['@model'], "_number", [])]), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(self['@model'], "_title", [])])]);smalltalk.send($rec, "_id_", [self['@elementId']]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [smalltalk.send((smalltalk.Markdown || Markdown), "_asTagBrush_", [smalltalk.send(smalltalk.send(self['@model'], "_body", []), "_asString", [])])]);smalltalk.send(html, "_hr", []);smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", ["Comments:"]);smalltalk.send(html, "_hr", []);(function($rec){smalltalk.send($rec, "_id_", ["comments"]);return smalltalk.send($rec, "_style_", [unescape("overflow%3A%20auto%3B%20max-height%3A%20300px")]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_style_", [unescape("float%3A%20right%3B")]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_href_", [smalltalk.send(self['@model'], "_url", [])]);return smalltalk.send($rec, "_with_", ["view on GitHub"]);})(smalltalk.send(html, "_a", []));})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_div", []));
smalltalk.send(self, "_becomeDialog", []);
smalltalk.send(self['@model'], "_loadComments_", [(function(comments){return smalltalk.send(comments, "_do_", [(function(comment){return smalltalk.send((function(html){return smalltalk.send(self, "_renderComment_onto_", [comment, html]);}), "_appendToJQuery_", [smalltalk.send(unescape("%23comments"), "_asJQuery", [])]);})]);})]);
return self;},
args: ["html"],
source: unescape('renderOn%3A%20html%0A%09html%20div%0A%09%09at%3A%20%27title%27%20put%3A%20%27%23%27%2C%20%28model%20number%29%2C%20%27%20-%20%27%2C%20%28model%20title%29%3B%0A%09%09id%3A%20elementId%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20div%20with%3A%20%28model%20body%20asString%29.%0A%09%09%09html%20hr.%0A%09%09%09html%20strong%20with%3A%20%27Comments%3A%27.%0A%09%09%09html%20hr.%0A%09%09%09html%20div%20id%3A%20%27comments%27%3B%20style%3A%20%27overflow%3A%20auto%3B%20max-height%3A%20300px%27.%0A%09%09%09html%20div%0A%09%09%09%09style%3A%20%27float%3A%20right%3B%27%3B%0A%09%09%09%09with%3A%20%5B%20html%20a%20href%3A%20%28model%20url%29%3B%20with%3A%20%27view%20on%20GitHub%27%5D.%0A%09%5D.%0A%0A%09self%20becomeDialog.%0A%0A%09model%20loadComments%3A%20%5B%20%3Acomments%20%7C%20comments%20do%3A%20%5B%20%3Acomment%20%7C%20%5B%20%3Ahtml%20%7C%20self%20renderComment%3A%20comment%20onto%3A%20html%20%5D%20appendToJQuery%3A%20%27%23comments%27%20asJQuery%20%5D%20%5D.'),
messageSends: ["at:put:", unescape("%2C"), "number", "title", "id:", "with:", "div", "asString", "body", "hr", "strong", "style:", "href:", "url", "a", "becomeDialog", "loadComments:", "do:", "appendToJQuery:", "renderComment:onto:", "asJQuery"],
referencedClasses: []
source: unescape('renderOn%3A%20html%0A%09html%20div%0A%09%09at%3A%20%27title%27%20put%3A%20%27%23%27%2C%20%28model%20number%29%2C%20%27%20-%20%27%2C%20%28model%20title%29%3B%0A%09%09id%3A%20elementId%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20div%20with%3A%20%28Markdown%20asTagBrush%3A%20%28model%20body%20asString%29%29.%0A%09%09%09html%20hr.%0A%09%09%09html%20strong%20with%3A%20%27Comments%3A%27.%0A%09%09%09html%20hr.%0A%09%09%09html%20div%20id%3A%20%27comments%27%3B%20style%3A%20%27overflow%3A%20auto%3B%20max-height%3A%20300px%27.%0A%09%09%09html%20div%0A%09%09%09%09style%3A%20%27float%3A%20right%3B%27%3B%0A%09%09%09%09with%3A%20%5B%20html%20a%20href%3A%20%28model%20url%29%3B%20with%3A%20%27view%20on%20GitHub%27%5D.%0A%09%5D.%0A%0A%09self%20becomeDialog.%0A%0A%09model%20loadComments%3A%20%5B%20%3Acomments%20%7C%20comments%20do%3A%20%5B%20%3Acomment%20%7C%20%5B%20%3Ahtml%20%7C%20self%20renderComment%3A%20comment%20onto%3A%20html%20%5D%20appendToJQuery%3A%20%27%23comments%27%20asJQuery%20%5D%20%5D.'),
messageSends: ["at:put:", unescape("%2C"), "number", "title", "id:", "with:", "div", "asTagBrush:", "asString", "body", "hr", "strong", "style:", "href:", "url", "a", "becomeDialog", "loadComments:", "do:", "appendToJQuery:", "renderComment:onto:", "asJQuery"],
referencedClasses: ["Markdown"]
}),
smalltalk.IssueDetailDialog);
@ -833,13 +833,13 @@ selector: unescape('renderComment%3Aonto%3A'),
category: 'rendering',
fn: function (comment, html){
var self=this;
(function($rec){smalltalk.send($rec, "_class_", ["comment_detail"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", [smalltalk.send("By: ", "__comma", [smalltalk.send(comment, "_login", [])])]);return smalltalk.send(smalltalk.send(comment, "_body", []), "_linesDo_", [(function(line){return smalltalk.send(smalltalk.send(html, "_p", []), "_with_", [line]);})]);})]);})(smalltalk.send(html, "_div", []));
(function($rec){smalltalk.send($rec, "_class_", ["comment_detail"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_strong", []), "_with_", [smalltalk.send("By: ", "__comma", [smalltalk.send(comment, "_login", [])])]);return smalltalk.send(html, "_with_", [smalltalk.send((smalltalk.Markdown || Markdown), "_asTagBrush_", [smalltalk.send(comment, "_body", [])])]);})]);})(smalltalk.send(html, "_div", []));
smalltalk.send(html, "_hr", []);
return self;},
args: ["comment", "html"],
source: unescape('renderComment%3A%20comment%20onto%3A%20html%0A%0A%09html%20div%0A%09%09class%3A%20%27comment_detail%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20strong%20with%3A%20%27By%3A%20%27%2C%20%28comment%20login%29.%0A%09%09%09comment%20body%20linesDo%3A%20%5B%20%3Aline%20%7C%0A%09%09%09%09html%20p%20with%3A%20line.%0A%09%09%09%5D.%0A%09%09%5D.%0A%0A%09html%20hr.'),
messageSends: ["class:", "with:", "strong", unescape("%2C"), "login", "linesDo:", "body", "p", "div", "hr"],
referencedClasses: []
source: unescape('renderComment%3A%20comment%20onto%3A%20html%0A%0A%09html%20div%0A%09%09class%3A%20%27comment_detail%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20strong%20with%3A%20%27By%3A%20%27%2C%20%28comment%20login%29.%0A%09%09%09html%20with%3A%20%28Markdown%20asTagBrush%3A%20%28comment%20body%29%29.%0A%09%09%5D.%0A%0A%09html%20hr.'),
messageSends: ["class:", "with:", "strong", unescape("%2C"), "login", "asTagBrush:", "body", "div", "hr"],
referencedClasses: ["Markdown"]
}),
smalltalk.IssueDetailDialog);

View File

@ -111,7 +111,8 @@ refresh
currentProject ifNotNil: [
currentProject = (issue projectName) ifFalse: [tile asJQuery hide].
].
self updateFilter. "This might prove to be CPU intensive"
self updateFilter.
self hideSpinner.
] loadAll: false.
issueApi recentlyClosed: [ :issue |
@ -175,6 +176,7 @@ initialize
bootstrap
issueApi := Issues new setToken: token.
userApi := Users new setToken: token.
self showSpinner.
userApi fetchCurrent: [ :data | userData := data. '#logout-username' asJQuery text: ('(', (data at: 'login'), ')') ].
self refresh.
self startRefreshTimer.
@ -266,7 +268,6 @@ viewIssue: onClickEvent
| dialog |
dialog := IssueDetailDialog new withIssue: model.
dialog appendToJQuery: 'body' asJQuery.
console log: 'clicked #', (model number).
! !
!IssueTile methodsFor: 'initializers'!
@ -500,7 +501,7 @@ renderOn: html
at: 'title' put: '#', (model number), ' - ', (model title);
id: elementId;
with: [
html div with: (model body asString).
html div with: (Markdown asTagBrush: (model body asString)).
html hr.
html strong with: 'Comments:'.
html hr.
@ -521,9 +522,7 @@ renderComment: comment onto: html
class: 'comment_detail';
with: [
html strong with: 'By: ', (comment login).
comment body linesDo: [ :line |
html p with: line.
].
html with: (Markdown asTagBrush: (comment body)).
].
html hr.