summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ball <cycomachead@gmail.com>2013-12-28 15:01:24 -0800
committerMichael Ball <cycomachead@gmail.com>2013-12-28 15:01:24 -0800
commit9f0f9dde37730dea46539c4c8971561a0a042354 (patch)
tree8127d4f6649f4b698aad9a165cc2ce66fb8f1a68
parentfaa8b4fe2243b1a8ef5cc4342183f4880b728a3d (diff)
downloadsnap-9f0f9dde37730dea46539c4c8971561a0a042354.tar.gz
snap-9f0f9dde37730dea46539c4c8971561a0a042354.zip
Add style tweaks per Nathan's comments.
-rw-r--r--blocks.js24
-rw-r--r--objects.js5
-rw-r--r--threads.js37
3 files changed, 31 insertions, 35 deletions
diff --git a/blocks.js b/blocks.js
index ed936d1..a1d80f5 100644
--- a/blocks.js
+++ b/blocks.js
@@ -817,21 +817,21 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
null, // text
false, // non-numeric
{
- 'Date' : ['Date'],
- 'Month' : ['Month'],
- 'Day of Month' : ['Day of Month'],
- 'Year' : ['Year'],
- 'Day of Week' : ['Day of Week'],
- 'Time' : ['Time'],
- 'Hour' : ['Hour'],
- 'Minute' : ['Minute'],
- 'Second' : ['Second'],
- 'Time in Milliseconds' : ['Time in Milliseconds'],
- 'UTC Time' : ['UTC Time'],
+ 'date' : ['date'],
+ 'month' : ['month'],
+ 'year' : ['year'],
+ 'day of month' : ['day of month'],
+ 'day of week' : ['day of week'],
+ 'time' : ['time'],
+ 'hour' : ['hour'],
+ 'minute' : ['minute'],
+ 'second' : ['second'],
+ 'time in milliseconds' : ['time in milliseconds'],
+ 'UTC time' : ['UTC time'],
},
true // read-only
);
- part.setContents('Date')
+ part.setContents('date');
break;
case '%delim':
part = new InputSlotMorph(
diff --git a/objects.js b/objects.js
index a2caedd..46be53c 100644
--- a/objects.js
+++ b/objects.js
@@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2013-December-27';
+modules.objects = '2013-December-28';
var SpriteMorph;
var StageMorph;
@@ -789,8 +789,7 @@ SpriteMorph.prototype.initBlocks = function () {
reportDate: {
type: 'reporter',
category: 'sensing',
- spec: 'get current %dates',
-
+ spec: 'get current %dates'
},
// Operators
diff --git a/threads.js b/threads.js
index 13fcff3..9192023 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2013-December-11';
+modules.threads = '2013-December-28';
var ThreadManager;
var Process;
@@ -2475,31 +2475,28 @@ Process.prototype.reportTimer = function () {
};
// Process Dates and times in Snap
+// Map block options to built-in functions
+var dateMap = {
+ 'date' : 'toLocaleDateString',
+ 'time' : 'toLocaleTimeString',
+ 'month' : 'getMonthName', // return a name, not a number
+ 'year' : 'getFullYear',
+ 'day of week' : 'getDayName', // return a name, not a number
+ 'day of month': 'getDate',
+ 'hour' : 'getHours',
+ 'minute' : 'getMinutes',
+ 'second' : 'getSeconds',
+ 'milliseconds' : 'getMilliseconds',
+ 'time in milliseconds' : 'getTime',
+ 'UTC time' : 'toUTCString' };
Process.prototype.reportDate = function (datefn) {
- // Map block options to built-in functions
- var dateMap = { 'Date' : 'toLocaleDateString',
- 'Time' : 'toLocaleTimeString',
- 'Month' : 'getMonthName', // return a name, not a number
- 'Day of Week' : 'getDayName', // return a name, not a number
- 'Day of Month': 'getDate',
- 'Year' : 'getFullYear',
- 'Hour' : 'getHours',
- 'Minute' : 'getMinutes',
- 'Second' : 'getSeconds',
- 'Milliseconds' : 'getMilliseconds',
- 'Time in Milliseconds' : 'getTime',
- 'UTC Time' : 'toUTCString' };
-
- if (!dateMap[datefn]) {
- return '';
- }
+ if (!dateMap[datefn]) { return ''; }
currDate = new Date();
- func = dateMap[datefn]
+ func = dateMap[datefn];
return currDate[func]();
-
}
// Process code mapping