kopia lustrzana https://github.com/backface/turtlestitch
"plain block prototype labels" preference setting
hide / show the (+) symbols in the block editorpull/3/merge
rodzic
4e501e00ad
commit
020cac64b1
11
byob.js
11
byob.js
|
@ -105,7 +105,7 @@ CommentMorph, localize, CSlotMorph, SpeechBubbleMorph, MorphicPreferences*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2013-September-18';
|
||||
modules.byob = '2013-October-04';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -2081,6 +2081,10 @@ BlockLabelPlaceHolderMorph.prototype = new StringMorph();
|
|||
BlockLabelPlaceHolderMorph.prototype.constructor = BlockLabelPlaceHolderMorph;
|
||||
BlockLabelPlaceHolderMorph.uber = StringMorph.prototype;
|
||||
|
||||
// BlockLabelPlaceHolderMorph preferences settings
|
||||
|
||||
BlockLabelPlaceHolderMorph.prototype.plainLabel = false; // always show (+)
|
||||
|
||||
// BlockLabelPlaceHolderMorph instance creation:
|
||||
|
||||
function BlockLabelPlaceHolderMorph() {
|
||||
|
@ -2101,6 +2105,11 @@ BlockLabelPlaceHolderMorph.prototype.init = function () {
|
|||
BlockLabelPlaceHolderMorph.prototype.drawNew = function () {
|
||||
var context, width, x, y, cx, cy;
|
||||
|
||||
// set my text contents depending on the "plainLabel" flag
|
||||
if (this.plainLabel) {
|
||||
this.text = this.isHighlighted ? ' + ' : '';
|
||||
}
|
||||
|
||||
// initialize my surface property
|
||||
this.image = newCanvas();
|
||||
context = this.image.getContext('2d');
|
||||
|
|
29
gui.js
29
gui.js
|
@ -64,11 +64,11 @@ standardSettings, Sound, BlockMorph, ToggleMorph, InputSlotDialogMorph,
|
|||
ScriptsMorph, isNil, SymbolMorph, BlockExportDialogMorph,
|
||||
BlockImportDialogMorph, SnapTranslator, localize, List, InputSlotMorph,
|
||||
SnapCloud, Uint8Array, HandleMorph, SVG_Costume, fontHeight, hex_sha512,
|
||||
sb, CommentMorph, CommandBlockMorph*/
|
||||
sb, CommentMorph, CommandBlockMorph, BlockLabelPlaceHolderMorph*/
|
||||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.gui = '2013-September-19';
|
||||
modules.gui = '2013-October-04';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -1701,7 +1701,8 @@ IDE_Morph.prototype.applySavedSettings = function () {
|
|||
zoom = this.getSetting('zoom'),
|
||||
language = this.getSetting('language'),
|
||||
click = this.getSetting('click'),
|
||||
longform = this.getSetting('longform');
|
||||
longform = this.getSetting('longform'),
|
||||
plainprototype = this.getSetting('plainprototype');
|
||||
|
||||
// design
|
||||
if (design === 'flat') {
|
||||
|
@ -1733,6 +1734,11 @@ IDE_Morph.prototype.applySavedSettings = function () {
|
|||
if (longform) {
|
||||
InputSlotDialogMorph.prototype.isLaunchingExpanded = true;
|
||||
}
|
||||
|
||||
// plain prototype labels
|
||||
if (plainprototype) {
|
||||
BlockLabelPlaceHolderMorph.prototype.plainLabel = true;
|
||||
}
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.saveSetting = function (key, value) {
|
||||
|
@ -2095,6 +2101,13 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
'uncheck to use the input\ndialog in short form',
|
||||
'check to always show slot\ntypes in the input dialog'
|
||||
);
|
||||
addPreference(
|
||||
'Plain prototype labels',
|
||||
'togglePlainPrototypeLabels',
|
||||
BlockLabelPlaceHolderMorph.prototype.plainLabel,
|
||||
'uncheck to always show (+) symbols\nin block prototype labels',
|
||||
'check to hide (+) symbols\nin block prototype labels'
|
||||
);
|
||||
addPreference(
|
||||
'Virtual keyboard',
|
||||
'toggleVirtualKeyboard',
|
||||
|
@ -3043,6 +3056,16 @@ IDE_Morph.prototype.toggleLongFormInputDialog = function () {
|
|||
}
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.togglePlainPrototypeLabels = function () {
|
||||
BlockLabelPlaceHolderMorph.prototype.plainLabel =
|
||||
!BlockLabelPlaceHolderMorph.prototype.plainLabel;
|
||||
if (BlockLabelPlaceHolderMorph.prototype.plainLabel) {
|
||||
this.saveSetting('plainprototype', true);
|
||||
} else {
|
||||
this.removeSetting('plainprototype');
|
||||
}
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.togglePreferEmptySlotDrops = function () {
|
||||
ScriptsMorph.prototype.isPreferringEmptySlots =
|
||||
!ScriptsMorph.prototype.isPreferringEmptySlots;
|
||||
|
|
|
@ -1939,3 +1939,4 @@ ______
|
|||
* Threads: Type-check the SPLIT block's input before eval'ing it
|
||||
* Objects: Prevent watcher cells from growing wider as their contents becomes taller
|
||||
* Objects: Keep watchers onstage when hiding/showing them, fixes #195
|
||||
* BYOB, GUI, locale: New preference setting for plain block prototype labels
|
||||
|
|
|
@ -185,7 +185,7 @@ SnapTranslator.dict.de = {
|
|||
'translator_e-mail':
|
||||
'jens@moenig.org', // optional
|
||||
'last_changed':
|
||||
'2013-09-16', // this, too, will appear in the Translators tab
|
||||
'2013-10-04', // this, too, will appear in the Translators tab
|
||||
|
||||
// GUI
|
||||
// control bar:
|
||||
|
@ -705,6 +705,12 @@ SnapTranslator.dict.de = {
|
|||
+ 'zu erm\u00f6glichen',
|
||||
'Long form input dialog':
|
||||
'Ausf\u00fchrlicher Input-Dialog',
|
||||
'Plain prototype labels':
|
||||
'Einfache Prototyp-Beschriftung',
|
||||
'uncheck to always show (+) symbols\nin block prototype labels':
|
||||
'ausschalten, um (+) Zeichen\nim Blockeditor zu verbergen',
|
||||
'check to hide (+) symbols\nin block prototype labels':
|
||||
'einschalten, um (+) Zeichen\nim Blockeditor immer anzuzeigen',
|
||||
'check to always show slot\ntypes in the input dialog':
|
||||
'einschalten, um immer die Datentypen\nim Input-Dialog zu sehen',
|
||||
'uncheck to use the input\ndialog in short form':
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
/*global modules, contains*/
|
||||
|
||||
modules.locale = '2013-August-17';
|
||||
modules.locale = '2013-October-04';
|
||||
|
||||
// Global stuff
|
||||
|
||||
|
@ -149,7 +149,7 @@ SnapTranslator.dict.de = {
|
|||
'translator_e-mail':
|
||||
'jens@moenig.org',
|
||||
'last_changed':
|
||||
'2013-09-16'
|
||||
'2013-10-04'
|
||||
};
|
||||
|
||||
SnapTranslator.dict.it = {
|
||||
|
|
Ładowanie…
Reference in New Issue