Lively Kernel canvas
var worldInitializer = new philmaker.playground.WorldInitializer();
worldInitializer.initializePostscript();
var world = WorldMorph.current();
var morph = philmaker.foundation.Utility.getSubmorphByName(world, 'sticky-to-mark');
if (morph) {
philmaker.playground.Marker.mark(morph, new philmaker.foundation.Insets(-20, -10, 30, 20));
}
PasteUpMorph.prototype.onMouseDown = PasteUpMorph.prototype.onMouseDown.wrap(function(proceed, event) {
var result = proceed(event);
try {
var markers = philmaker.foundation.Utility.getSubmorphsByClass(world, philmaker.playground.Marker);
for (var i = 0; i < markers.length; i++) {
markers[i].remove();
}
} catch (e) {
console.warn('Removing markers failed.');
}
return result;
});
rating2) return -1;\r\tif (rating1 < rating2) return 1;\r\tif (rating1 == rating2) return 0;\r});\rvar position = records[0].getPosition();\rrecords.forEach(function(record) {\r\tposition.x = Math.min(position.x, record.getPosition().x);\r\tposition.y = Math.min(position.y, record.getPosition().y);\r});\rrecords.forEach(function(record) {\r\tvar title = philmaker.foundation.Utility.getSubmorphByName(record, 'title').textString;\r\trecord.setPosition(pt(position.x, position.y));\r\tposition.y = position.y + record.getExtent().y + 4;\r});\r"},{"id":14,"name":"Arrange Records by Completed","context":"WorldMorph","source":"var getStatusCode = function(record) {\r\tvar tags = philmaker.foundation.Utility.getSubmorphsByClass(record, philmaker.playground.TagMorph);\r\tfor (var i = 0; i < tags.length; i++) {\r\t\tvar value = tags[i].getValue();\r\t\tif (value == 'Complete') {\r\t\t\treturn 1;\r\t\t} else if (value == 'Incomplete') {\r\t\t\treturn 2;\r\t\t}\r\t}\r\treturn 0;\r};\rvar records = philmaker.playground.RecordAssistant.findAllRecords();\rrecords.sort(function(record1, record2) {\r\tvar status1 = getStatusCode(record1);\r\tvar status2 = getStatusCode(record2);\r\tif (status1 > status2) return -1;\r\tif (status1 < status2) return 1;\r\tif (status1 == status2) return 0;\r});\rvar position = records[0].getPosition();\rrecords.forEach(function(record) {\r\tposition.x = Math.min(position.x, record.getPosition().x);\r\tposition.y = Math.min(position.y, record.getPosition().y);\r});\rrecords.forEach(function(record) {\r\tvar title = philmaker.foundation.Utility.getSubmorphByName(record, 'title').textString;\r\trecord.setPosition(pt(position.x, position.y));\r\tposition.y = position.y + record.getExtent().y + 4;\r});\r"},{"id":15,"name":"Change Image","context":"philmaker.playground.BlogEntry","source":"var self = this;\nphilmaker.playground.PromptPanel.prompt({\n\tfields : {\n\t\timageUrl : {\n\t\t\tlabel : 'Image URL',\n\t\t\tvalue : 'http://www.marocga.com/albums/userpics/normal_dolphin11.jpg'\n\t\t},\n\t},\n\tcallback : function(fields) {\n\t\tself.setImageUrl(fields.imageUrl.value);\n\t},\n\tabove : null\n});"},{"id":16,"name":"Add Tag","context":"philmaker.playground.BlogEntry","source":"var self = this;\nphilmaker.playground.PromptPanel.prompt({\n\tfields : {\n\t\ttag : {\n\t\t\tlabel : 'Tag',\n\t\t\tvalue : 'Untitled'\n\t\t}\n\t},\n\tcallback : function(fields) {\n\t\tself.addTag(fields.tag.value);\n\t}\n});"},{"id":17,"name":"Modify World Extent (Experimental)","context":"WorldMorph","source":"console.log('hello');\rphilmaker.playground.PromptPanel.prompt({\r\tfields : {\r\t\tx : {\r\t\t\tvalue : ''\r\t\t},\r\t\ty : {\r\t\t\tvalue : '2000'\r\t\t}\r\t},\r\tcallback : function(fields) {\r\t\tvar x = undefined;\r\t\tif (! (fields.x.value == '')) {\r\t\t\tx = parseInt(fields.x.value);\r\t\t}\r\t\tvar y = undefined;\r\t\tif (! (fields.y.value == '')) {\r\t\t\ty = parseInt(fields.y.value);\r\t\t}\r\t\tphilmaker.foundation.Utility.modifyWorldExtent(x, y);\r\t}\r});"},{"id":18,"name":"Find Images of Dogs","context":"WorldMorph","source":"philmaker.foundation.Utility.clearImages();\rphilmaker.foundation.Utility.findImages('dogs');\r"},{"id":19,"name":"Make Toolbox Array","context":"WorldMorph","source":"philmaker.playground.PromptPanel.prompt({\n\tfields : {\n\t\tx : {\n\t\t\tvalue : 2\n\t\t},\n\t\ty : {\n\t\t\tvalue : 5\n\t\t},\n\t\tgap : {\n\t\t\tvalue : 10\r\t\t}\n\t},\n\tcallback : function(fields) {\n\t\tphilmaker.foundation.Utility.makeToolboxArray({\n\t\t\tx : parseInt(fields.x.value),\n\t\t\ty : parseInt(fields.y.value),\n\t\t\tspacing : parseInt(fields.gap.value)\n\t\t});\n\t}\n});"},{"id":21,"name":"Make Record Array","context":"WorldMorph","source":"\rvar specs = [{\r\tkind : 'Task',\r\ttitle : 'Take out the Trash',\r\trating : 8,\r\ttags : ['Chores', 'Incomplete']\r}, {\r\tkind : 'Task',\r\ttitle : 'Feed the Dog',\r\trating : 10,\r\ttags : ['Chores', 'Complete']\r}, {\r\tkind : 'Task',\r\ttitle : 'Water the Plants',\r\trating : 4,\r\ttags : ['Chores', 'Incomplete']\r}, {\r\tkind : 'Task',\r\ttitle : 'Fix the Car',\r\trating : 9,\r\ttags : ['Errands', 'Incomplete']\r}, {\r\tkind : 'Task',\r\ttitle : 'Buy More RAM',\r\trating : 2,\r\ttags : ['Errands', 'Complete']\r}, {\r\tkind : 'Task',\r\ttitle : 'Get a Haircut',\r\trating : 6,\r\ttags : ['Errands', 'Incomplete']\r}, {\r\tkind : 'Contact',\r\ttitle : 'Bullwinkle Moose',\r\trating : 1,\r\ttags : ['Fictional'],\r\tfields : [{\r\t\tname : 'address',\r\t\tvalue : 'Frostbite Falls, Minnesota'\r\t}, {\r\t\tname : 'phone',\r\t\tvalue : '(218) 555-1212'\r\t}]\r}];\r\rphilmaker.foundation.Utility.makeRecordArray({\r\tspecs : specs,\r\tspacing : 5\r});\r"},{"id":22,"name":"Find Images of Elmo","context":"WorldMorph","source":"philmaker.foundation.Utility.clearImages();\nphilmaker.foundation.Utility.findImages('Elmo');\n"},{"id":23,"name":"Find Images of Pizza","context":"WorldMorph","source":"philmaker.foundation.Utility.clearImages();\nphilmaker.foundation.Utility.findImages('pizza');\n"},{"id":24,"name":"Clear Images","context":"WorldMorph","source":"philmaker.foundation.Utility.clearImages();\r"},{"id":25,"name":"Find Any Images","context":"WorldMorph","source":"philmaker.playground.PromptPanel.prompt({\n\tfields : {\n\t\tquery : {\n\t\t\tlabel : 'Query',\n\t\t\tvalue : 'dogs'\n\t\t}\n\t},\n\tcallback : function(fields) {\n\t\tphilmaker.foundation.Utility.clearImages();\n\t\tphilmaker.foundation.Utility.findImages(fields.query.value);\n\t}\n});"}]})]]>
null
0.1
60
130.57494178643296
1.7857011595881527
null
null
null
null
Basis
24
2
true
null
2
null
0
null
null
1238733004400
213328
1
NaN
null
1238733004
null