Safely handle some oddities with older Jenkins versions and their description field

This commit is contained in:
R. Tyler Croy 2012-03-03 15:47:55 -08:00
parent e04891895d
commit 32b2b690d8
3 changed files with 220 additions and 218 deletions

View File

@ -1,75 +1,4 @@
smalltalk.addPackage('Niles', {});
smalltalk.addClass('Job', smalltalk.Object, ['description', 'url', 'buildable', 'stable', 'myname', 'page'], 'Niles');
smalltalk.addMethod(
unescape('_initialize'),
smalltalk.method({
selector: unescape('initialize'),
fn: function (){
var self=this;
(self['@description']="");
(self['@url']="");
(self['@buildable']=false);
(self['@stable']=false);
(self['@myname']="");
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_fromDictionary_'),
smalltalk.method({
selector: unescape('fromDictionary%3A'),
fn: function (aDictionary){
var self=this;
(self['@myname']=smalltalk.send(aDictionary, "_name", []));
(self['@url']=smalltalk.send(aDictionary, "_url", []));
(self['@description']=smalltalk.send(aDictionary, "_description", []));
(self['@buildable']=smalltalk.send(aDictionary, "_buildable", []));
((($receiver = smalltalk.send(smalltalk.send(aDictionary, "_color", []), "__eq", ["blue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@stable']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@stable']=true);})]));
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asListItem'),
smalltalk.method({
selector: unescape('asListItem'),
fn: function (){
var self=this;
var item=nil;
(item=(function($rec){smalltalk.send($rec, "_withLabel_", [self['@myname']]);return smalltalk.send($rec, "_withOnClick_", [(function(event){var page=nil;
(page=smalltalk.send(self, "_asPage", []));smalltalk.send(page, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);jQuery.mobile.changePage('#' + page._elementId());;return smalltalk.send(event, "_preventDefault", []);})]);})(smalltalk.send((smalltalk.JQListItem || JQListItem), "_new", [])));
((($receiver = self['@stable']).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(item, "_turnYellow", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(item, "_turnYellow", []);})]));
((($receiver = ((($receiver = smalltalk.send(self['@description'], "_size", [])).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})]));
return item;
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asPage'),
smalltalk.method({
selector: unescape('asPage'),
fn: function (){
var self=this;
return (($receiver = self['@page']) == nil || $receiver == undefined) ? (function(){return (self['@page']=(function($rec){smalltalk.send($rec, "_withContent_", [(function(html){return smalltalk.send(self, "_renderPageOn_", [html]);})]);return smalltalk.send($rec, "_named_", [self['@myname']]);})(smalltalk.send((smalltalk.JQPage || JQPage), "_new", [])));})() : $receiver;
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_renderPageOn_'),
smalltalk.method({
selector: unescape('renderPageOn%3A'),
fn: function (html){
var self=this;
smalltalk.send(html, "_with_", [smalltalk.send("I am the renderPageOn method for: ", "__comma", [self['@myname']])]);
return self;}
}),
smalltalk.Job);
smalltalk.addClass('NilesApp', smalltalk.Object, ['list'], 'Niles');
smalltalk.addMethod(
unescape('_clear'),
@ -123,3 +52,74 @@ return self;}
smalltalk.NilesApp.klass);
smalltalk.addClass('Job', smalltalk.Object, ['description', 'url', 'buildable', 'stable', 'myname', 'page'], 'Niles');
smalltalk.addMethod(
unescape('_initialize'),
smalltalk.method({
selector: unescape('initialize'),
fn: function (){
var self=this;
(self['@description']="");
(self['@url']="");
(self['@buildable']=false);
(self['@stable']=false);
(self['@myname']="");
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_fromDictionary_'),
smalltalk.method({
selector: unescape('fromDictionary%3A'),
fn: function (aDictionary){
var self=this;
(self['@myname']=smalltalk.send(aDictionary, "_name", []));
(self['@url']=smalltalk.send(aDictionary, "_url", []));
(self['@description']=(($receiver = smalltalk.send(aDictionary, "_at_", ["description"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver);
(self['@buildable']=smalltalk.send(aDictionary, "_buildable", []));
((($receiver = smalltalk.send(smalltalk.send(aDictionary, "_color", []), "__eq", ["blue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@stable']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@stable']=true);})]));
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asListItem'),
smalltalk.method({
selector: unescape('asListItem'),
fn: function (){
var self=this;
var item=nil;
(item=(function($rec){smalltalk.send($rec, "_withLabel_", [self['@myname']]);return smalltalk.send($rec, "_withOnClick_", [(function(event){var page=nil;
(page=smalltalk.send(self, "_asPage", []));smalltalk.send(page, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);jQuery.mobile.changePage('#' + page._elementId());;return smalltalk.send(event, "_preventDefault", []);})]);})(smalltalk.send((smalltalk.JQListItem || JQListItem), "_new", [])));
((($receiver = self['@stable']).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(item, "_turnYellow", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(item, "_turnYellow", []);})]));
((($receiver = ((($receiver = smalltalk.send(self['@description'], "_size", [])).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})]));
return item;
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asPage'),
smalltalk.method({
selector: unescape('asPage'),
fn: function (){
var self=this;
return (($receiver = self['@page']) == nil || $receiver == undefined) ? (function(){return (self['@page']=(function($rec){smalltalk.send($rec, "_withContent_", [(function(html){return smalltalk.send(self, "_renderPageOn_", [html]);})]);return smalltalk.send($rec, "_named_", [self['@myname']]);})(smalltalk.send((smalltalk.JQPage || JQPage), "_new", [])));})() : $receiver;
return self;}
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_renderPageOn_'),
smalltalk.method({
selector: unescape('renderPageOn%3A'),
fn: function (html){
var self=this;
smalltalk.send(html, "_with_", [smalltalk.send("I am the renderPageOn method for: ", "__comma", [self['@myname']])]);
return self;}
}),
smalltalk.Job);

View File

@ -1,100 +1,4 @@
smalltalk.addPackage('Niles', {});
smalltalk.addClass('Job', smalltalk.Object, ['description', 'url', 'buildable', 'stable', 'myname', 'page'], 'Niles');
smalltalk.addMethod(
unescape('_initialize'),
smalltalk.method({
selector: unescape('initialize'),
category: 'not yet classified',
fn: function (){
var self=this;
(self['@description']="");
(self['@url']="");
(self['@buildable']=false);
(self['@stable']=false);
(self['@myname']="");
return self;},
args: [],
source: unescape('initialize%0A%09description%20%3A%3D%20%27%27.%0A%09url%20%3A%3D%20%27%27.%0A%09buildable%20%3A%3D%20false.%0A%09stable%20%3A%3D%20false.%0A%09myname%20%3A%3D%20%27%27.'),
messageSends: [],
referencedClasses: []
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_fromDictionary_'),
smalltalk.method({
selector: unescape('fromDictionary%3A'),
category: 'not yet classified',
fn: function (aDictionary){
var self=this;
(self['@myname']=smalltalk.send(aDictionary, "_name", []));
(self['@url']=smalltalk.send(aDictionary, "_url", []));
(self['@description']=smalltalk.send(aDictionary, "_description", []));
(self['@buildable']=smalltalk.send(aDictionary, "_buildable", []));
((($receiver = smalltalk.send(smalltalk.send(aDictionary, "_color", []), "__eq", ["blue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@stable']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@stable']=true);})]));
return self;},
args: ["aDictionary"],
source: unescape('fromDictionary%3A%20aDictionary%0A%09myname%20%3A%3D%20aDictionary%20name.%0A%09url%20%3A%3D%20aDictionary%20url.%0A%09description%20%3A%3D%20aDictionary%20description.%0A%09buildable%20%3A%3D%20aDictionary%20buildable.%0A%09aDictionary%20color%20%3D%20%27blue%27%0A%09%09ifTrue%3A%20%5B%20stable%20%3A%3D%20true%20%5D.'),
messageSends: ["name", "url", "description", "buildable", "ifTrue:", unescape("%3D"), "color"],
referencedClasses: []
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asListItem'),
smalltalk.method({
selector: unescape('asListItem'),
category: 'not yet classified',
fn: function (){
var self=this;
var item=nil;
(item=(function($rec){smalltalk.send($rec, "_withLabel_", [self['@myname']]);return smalltalk.send($rec, "_withOnClick_", [(function(event){var page=nil;
(page=smalltalk.send(self, "_asPage", []));smalltalk.send(page, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);jQuery.mobile.changePage('#' + page._elementId());;return smalltalk.send(event, "_preventDefault", []);})]);})(smalltalk.send((smalltalk.JQListItem || JQListItem), "_new", [])));
((($receiver = self['@stable']).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(item, "_turnYellow", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(item, "_turnYellow", []);})]));
((($receiver = ((($receiver = smalltalk.send(self['@description'], "_size", [])).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})]));
return item;
return self;},
args: [],
source: unescape('asListItem%0A%09%22Return%20a%20JQListItem%20representing%20this%20Job%20object%22%0A%09%7C%20item%20%7C%0A%09item%20%3A%3D%20JQListItem%20new%0A%09%09%09withLabel%3A%20myname%3B%0A%09%09%09withOnClick%3A%20%5B%20%3Aevent%20%7C%0A%09%09%09%09%7C%20page%20%7C%0A%09%09%09%09page%20%3A%3D%20self%20asPage.%0A%09%09%09%09page%20appendToJQuery%3A%20%27body%27%20asJQuery.%0A%09%09%09%09%3CjQuery.mobile.changePage%28%27%23%27%20+%20page._elementId%28%29%29%3B%3E.%0A%09%09%09%09event%20preventDefault%20%5D.%0A%09stable%20ifFalse%3A%20%5B%20item%20turnYellow%20%5D.%0A%09description%20size%20%3E%200%0A%09%09%09%09ifTrue%3A%20%5B%20item%20withDescription%3A%20description%20%5D.%0A%09%5E%20item.'),
messageSends: ["withLabel:", "withOnClick:", "asPage", "appendToJQuery:", "asJQuery", "preventDefault", "new", "ifFalse:", "turnYellow", "ifTrue:", unescape("%3E"), "size", "withDescription:"],
referencedClasses: ["JQListItem"]
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asPage'),
smalltalk.method({
selector: unescape('asPage'),
category: 'not yet classified',
fn: function (){
var self=this;
return (($receiver = self['@page']) == nil || $receiver == undefined) ? (function(){return (self['@page']=(function($rec){smalltalk.send($rec, "_withContent_", [(function(html){return smalltalk.send(self, "_renderPageOn_", [html]);})]);return smalltalk.send($rec, "_named_", [self['@myname']]);})(smalltalk.send((smalltalk.JQPage || JQPage), "_new", [])));})() : $receiver;
return self;},
args: [],
source: unescape('asPage%0A%09%5E%20page%20ifNil%3A%20%5B%0A%09%09page%20%3A%3D%20JQPage%20new%0A%09%09%09%09withContent%3A%20%5B%20%3Ahtml%20%7C%20self%20renderPageOn%3A%20html%20%5D%3B%0A%09%09%09%09named%3A%20myname%5D.'),
messageSends: ["ifNil:", "withContent:", "renderPageOn:", "named:", "new"],
referencedClasses: ["JQPage"]
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_renderPageOn_'),
smalltalk.method({
selector: unescape('renderPageOn%3A'),
category: 'not yet classified',
fn: function (html){
var self=this;
smalltalk.send(html, "_with_", [smalltalk.send("I am the renderPageOn method for: ", "__comma", [self['@myname']])]);
return self;},
args: ["html"],
source: unescape('renderPageOn%3A%20html%0A%09html%20with%3A%20%27I%20am%20the%20renderPageOn%20method%20for%3A%20%27%2C%20myname.'),
messageSends: ["with:", unescape("%2C")],
referencedClasses: []
}),
smalltalk.Job);
smalltalk.addClass('NilesApp', smalltalk.Object, ['list'], 'Niles');
smalltalk.addMethod(
unescape('_clear'),
@ -168,3 +72,99 @@ referencedClasses: []
smalltalk.NilesApp.klass);
smalltalk.addClass('Job', smalltalk.Object, ['description', 'url', 'buildable', 'stable', 'myname', 'page'], 'Niles');
smalltalk.addMethod(
unescape('_initialize'),
smalltalk.method({
selector: unescape('initialize'),
category: 'not yet classified',
fn: function (){
var self=this;
(self['@description']="");
(self['@url']="");
(self['@buildable']=false);
(self['@stable']=false);
(self['@myname']="");
return self;},
args: [],
source: unescape('initialize%0A%09description%20%3A%3D%20%27%27.%0A%09url%20%3A%3D%20%27%27.%0A%09buildable%20%3A%3D%20false.%0A%09stable%20%3A%3D%20false.%0A%09myname%20%3A%3D%20%27%27.'),
messageSends: [],
referencedClasses: []
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_fromDictionary_'),
smalltalk.method({
selector: unescape('fromDictionary%3A'),
category: 'not yet classified',
fn: function (aDictionary){
var self=this;
(self['@myname']=smalltalk.send(aDictionary, "_name", []));
(self['@url']=smalltalk.send(aDictionary, "_url", []));
(self['@description']=(($receiver = smalltalk.send(aDictionary, "_at_", ["description"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver);
(self['@buildable']=smalltalk.send(aDictionary, "_buildable", []));
((($receiver = smalltalk.send(smalltalk.send(aDictionary, "_color", []), "__eq", ["blue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@stable']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@stable']=true);})]));
return self;},
args: ["aDictionary"],
source: unescape('fromDictionary%3A%20aDictionary%0A%09myname%20%3A%3D%20aDictionary%20name.%0A%09url%20%3A%3D%20aDictionary%20url.%0A%09%22For%20some%20reason%20with%20older%20versions%20of%20Jenkins%2C%20when%20you%20call%20%27aDictionary%20description%27%20a%20DoesNotUnderstandMessage%0A%09%20exception%20is%20raised%2C%20despite%20the%20Inspector%20/showing/%20a%20%27%60description%27%20message%20being%20apparently%20available.%22%0A%09description%20%3A%3D%20%28aDictionary%20at%3A%20%27description%27%29%20ifNil%3A%20%5B%20%27%27%20%5D.%0A%09buildable%20%3A%3D%20aDictionary%20buildable.%0A%09aDictionary%20color%20%3D%20%27blue%27%0A%09%09ifTrue%3A%20%5B%20stable%20%3A%3D%20true%20%5D.'),
messageSends: ["name", "url", "ifNil:", "at:", "buildable", "ifTrue:", unescape("%3D"), "color"],
referencedClasses: []
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asListItem'),
smalltalk.method({
selector: unescape('asListItem'),
category: 'not yet classified',
fn: function (){
var self=this;
var item=nil;
(item=(function($rec){smalltalk.send($rec, "_withLabel_", [self['@myname']]);return smalltalk.send($rec, "_withOnClick_", [(function(event){var page=nil;
(page=smalltalk.send(self, "_asPage", []));smalltalk.send(page, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);jQuery.mobile.changePage('#' + page._elementId());;return smalltalk.send(event, "_preventDefault", []);})]);})(smalltalk.send((smalltalk.JQListItem || JQListItem), "_new", [])));
((($receiver = self['@stable']).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(item, "_turnYellow", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(item, "_turnYellow", []);})]));
((($receiver = ((($receiver = smalltalk.send(self['@description'], "_size", [])).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(item, "_withDescription_", [self['@description']]);})]));
return item;
return self;},
args: [],
source: unescape('asListItem%0A%09%22Return%20a%20JQListItem%20representing%20this%20Job%20object%22%0A%09%7C%20item%20%7C%0A%09item%20%3A%3D%20JQListItem%20new%0A%09%09%09withLabel%3A%20myname%3B%0A%09%09%09withOnClick%3A%20%5B%20%3Aevent%20%7C%0A%09%09%09%09%7C%20page%20%7C%0A%09%09%09%09page%20%3A%3D%20self%20asPage.%0A%09%09%09%09page%20appendToJQuery%3A%20%27body%27%20asJQuery.%0A%09%09%09%09%3CjQuery.mobile.changePage%28%27%23%27%20+%20page._elementId%28%29%29%3B%3E.%0A%09%09%09%09event%20preventDefault%20%5D.%0A%09stable%20ifFalse%3A%20%5B%20item%20turnYellow%20%5D.%0A%09description%20size%20%3E%200%0A%09%09%09%09ifTrue%3A%20%5B%20item%20withDescription%3A%20description%20%5D.%0A%09%5E%20item.'),
messageSends: ["withLabel:", "withOnClick:", "asPage", "appendToJQuery:", "asJQuery", "preventDefault", "new", "ifFalse:", "turnYellow", "ifTrue:", unescape("%3E"), "size", "withDescription:"],
referencedClasses: ["JQListItem"]
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_asPage'),
smalltalk.method({
selector: unescape('asPage'),
category: 'not yet classified',
fn: function (){
var self=this;
return (($receiver = self['@page']) == nil || $receiver == undefined) ? (function(){return (self['@page']=(function($rec){smalltalk.send($rec, "_withContent_", [(function(html){return smalltalk.send(self, "_renderPageOn_", [html]);})]);return smalltalk.send($rec, "_named_", [self['@myname']]);})(smalltalk.send((smalltalk.JQPage || JQPage), "_new", [])));})() : $receiver;
return self;},
args: [],
source: unescape('asPage%0A%09%5E%20page%20ifNil%3A%20%5B%0A%09%09page%20%3A%3D%20JQPage%20new%0A%09%09%09%09withContent%3A%20%5B%20%3Ahtml%20%7C%20self%20renderPageOn%3A%20html%20%5D%3B%0A%09%09%09%09named%3A%20myname%5D.'),
messageSends: ["ifNil:", "withContent:", "renderPageOn:", "named:", "new"],
referencedClasses: ["JQPage"]
}),
smalltalk.Job);
smalltalk.addMethod(
unescape('_renderPageOn_'),
smalltalk.method({
selector: unescape('renderPageOn%3A'),
category: 'not yet classified',
fn: function (html){
var self=this;
smalltalk.send(html, "_with_", [smalltalk.send("I am the renderPageOn method for: ", "__comma", [self['@myname']])]);
return self;},
args: ["html"],
source: unescape('renderPageOn%3A%20html%0A%09html%20with%3A%20%27I%20am%20the%20renderPageOn%20method%20for%3A%20%27%2C%20myname.'),
messageSends: ["with:", unescape("%2C")],
referencedClasses: []
}),
smalltalk.Job);

View File

@ -1,55 +1,4 @@
Smalltalk current createPackage: 'Niles' properties: #{}!
Object subclass: #Job
instanceVariableNames: 'description url buildable stable myname page'
category: 'Niles'!
!Job methodsFor: 'not yet classified'!
initialize
description := ''.
url := ''.
buildable := false.
stable := false.
myname := ''.
!
fromDictionary: aDictionary
myname := aDictionary name.
url := aDictionary url.
description := aDictionary description.
buildable := aDictionary buildable.
aDictionary color = 'blue'
ifTrue: [ stable := true ].
!
asListItem
"Return a JQListItem representing this Job object"
| item |
item := JQListItem new
withLabel: myname;
withOnClick: [ :event |
| page |
page := self asPage.
page appendToJQuery: 'body' asJQuery.
<jQuery.mobile.changePage('#' + page._elementId());>.
event preventDefault ].
stable ifFalse: [ item turnYellow ].
description size > 0
ifTrue: [ item withDescription: description ].
^ item.
!
asPage
^ page ifNil: [
page := JQPage new
withContent: [ :html | self renderPageOn: html ];
named: myname].
!
renderPageOn: html
html with: 'I am the renderPageOn method for: ', myname.
! !
Object subclass: #NilesApp
instanceVariableNames: 'list'
category: 'Niles'!
@ -90,3 +39,56 @@ current
ifNil: [ app := super new ].
! !
Object subclass: #Job
instanceVariableNames: 'description url buildable stable myname page'
category: 'Niles'!
!Job methodsFor: 'not yet classified'!
initialize
description := ''.
url := ''.
buildable := false.
stable := false.
myname := ''.
!
fromDictionary: aDictionary
myname := aDictionary name.
url := aDictionary url.
"For some reason with older versions of Jenkins, when you call 'aDictionary description' a DoesNotUnderstandMessage
exception is raised, despite the Inspector /showing/ a '`description' message being apparently available."
description := (aDictionary at: 'description') ifNil: [ '' ].
buildable := aDictionary buildable.
aDictionary color = 'blue'
ifTrue: [ stable := true ].
!
asListItem
"Return a JQListItem representing this Job object"
| item |
item := JQListItem new
withLabel: myname;
withOnClick: [ :event |
| page |
page := self asPage.
page appendToJQuery: 'body' asJQuery.
<jQuery.mobile.changePage('#' + page._elementId());>.
event preventDefault ].
stable ifFalse: [ item turnYellow ].
description size > 0
ifTrue: [ item withDescription: description ].
^ item.
!
asPage
^ page ifNil: [
page := JQPage new
withContent: [ :html | self renderPageOn: html ];
named: myname].
!
renderPageOn: html
html with: 'I am the renderPageOn method for: ', myname.
! !