kopia lustrzana https://github.com/backface/turtlestitch
Add style tweaks per Nathan's comments.
rodzic
faa8b4fe22
commit
9f0f9dde37
24
blocks.js
24
blocks.js
|
@ -817,21 +817,21 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
||||||
null, // text
|
null, // text
|
||||||
false, // non-numeric
|
false, // non-numeric
|
||||||
{
|
{
|
||||||
'Date' : ['Date'],
|
'date' : ['date'],
|
||||||
'Month' : ['Month'],
|
'month' : ['month'],
|
||||||
'Day of Month' : ['Day of Month'],
|
'year' : ['year'],
|
||||||
'Year' : ['Year'],
|
'day of month' : ['day of month'],
|
||||||
'Day of Week' : ['Day of Week'],
|
'day of week' : ['day of week'],
|
||||||
'Time' : ['Time'],
|
'time' : ['time'],
|
||||||
'Hour' : ['Hour'],
|
'hour' : ['hour'],
|
||||||
'Minute' : ['Minute'],
|
'minute' : ['minute'],
|
||||||
'Second' : ['Second'],
|
'second' : ['second'],
|
||||||
'Time in Milliseconds' : ['Time in Milliseconds'],
|
'time in milliseconds' : ['time in milliseconds'],
|
||||||
'UTC Time' : ['UTC Time'],
|
'UTC time' : ['UTC time'],
|
||||||
},
|
},
|
||||||
true // read-only
|
true // read-only
|
||||||
);
|
);
|
||||||
part.setContents('Date')
|
part.setContents('date');
|
||||||
break;
|
break;
|
||||||
case '%delim':
|
case '%delim':
|
||||||
part = new InputSlotMorph(
|
part = new InputSlotMorph(
|
||||||
|
|
|
@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.objects = '2013-December-27';
|
modules.objects = '2013-December-28';
|
||||||
|
|
||||||
var SpriteMorph;
|
var SpriteMorph;
|
||||||
var StageMorph;
|
var StageMorph;
|
||||||
|
@ -789,8 +789,7 @@ SpriteMorph.prototype.initBlocks = function () {
|
||||||
reportDate: {
|
reportDate: {
|
||||||
type: 'reporter',
|
type: 'reporter',
|
||||||
category: 'sensing',
|
category: 'sensing',
|
||||||
spec: 'get current %dates',
|
spec: 'get current %dates'
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
|
|
37
threads.js
37
threads.js
|
@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.threads = '2013-December-11';
|
modules.threads = '2013-December-28';
|
||||||
|
|
||||||
var ThreadManager;
|
var ThreadManager;
|
||||||
var Process;
|
var Process;
|
||||||
|
@ -2475,31 +2475,28 @@ Process.prototype.reportTimer = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Process Dates and times in Snap
|
// 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) {
|
Process.prototype.reportDate = function (datefn) {
|
||||||
// Map block options to built-in functions
|
if (!dateMap[datefn]) { return ''; }
|
||||||
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 '';
|
|
||||||
}
|
|
||||||
|
|
||||||
currDate = new Date();
|
currDate = new Date();
|
||||||
func = dateMap[datefn]
|
func = dateMap[datefn];
|
||||||
|
|
||||||
return currDate[func]();
|
return currDate[func]();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process code mapping
|
// Process code mapping
|
||||||
|
|
Ładowanie…
Reference in New Issue