summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-07-02 16:51:42 +0200
committerjmoenig <jens@moenig.org>2013-07-02 16:51:42 +0200
commit1061fa4437884f7fca2487e5c36c717778174eb7 (patch)
treec6bd02dae1f234f55651f823d062975b13c59d47
parent78f416be9a4d42517a4b6a5bb801394c6c3e30c1 (diff)
downloadsnap-byow-1061fa4437884f7fca2487e5c36c717778174eb7.tar.gz
snap-byow-1061fa4437884f7fca2487e5c36c717778174eb7.zip
GUI: import libraries feature
in the project menu, libraries for * Iteration, composition, * List utilities, * Variadic reporters, * Words, sentences
-rw-r--r--gui.js47
-rwxr-xr-xhistory.txt3
-rw-r--r--lang-de.js6
-rw-r--r--locale.js4
4 files changed, 55 insertions, 5 deletions
diff --git a/gui.js b/gui.js
index 11cecf6..6e303c5 100644
--- a/gui.js
+++ b/gui.js
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2013-June-28';
+modules.gui = '2013-July-02';
// Declarations
@@ -2315,6 +2315,51 @@ IDE_Morph.prototype.projectMenu = function () {
},
'load the official library of\npowerful blocks'
);
+ menu.addItem(
+ 'Libraries...',
+ function () {
+ var menu = new MenuMorph(this, 'Import library');
+
+ function loadLib(name) {
+ var url = 'http://snap.berkeley.edu/snapsource/libraries/'
+ + name
+ + '.xml',
+ request = new XMLHttpRequest();
+ request.open('GET', url, false);
+ request.send();
+ if (request.status === 200) {
+ return myself.droppedText(request.responseText, name);
+ }
+ throw new Error('unable to retrieve ' + url);
+ }
+
+ menu.addItem(
+ 'Iteration, composition...',
+ function () {
+ loadLib('iteration-composition');
+ }
+ );
+ menu.addItem(
+ 'List utilities...',
+ function () {
+ loadLib('list-utilities');
+ }
+ );
+ menu.addItem(
+ 'Variadic reporters...',
+ function () {
+ loadLib('variadic-reporters');
+ }
+ );
+ menu.addItem(
+ 'Words, sentences...',
+ function () {
+ loadLib('word-sentence');
+ }
+ );
+ menu.popup(world, pos);
+ }
+ );
menu.popup(world, pos);
};
diff --git a/history.txt b/history.txt
index 52ecaa9..61e7306 100755
--- a/history.txt
+++ b/history.txt
@@ -1776,4 +1776,5 @@ ______
130702
------
-* Objects: took out "security margin" in Costume's shrinkWrap() method b/c Chrome no longer needs it -> fixed empty costume bug when drawing over the paint editor's bounds \ No newline at end of file
+* Objects: took out "security margin" in Costume's shrinkWrap() method b/c Chrome no longer needs it -> fixed empty costume bug when drawing over the paint editor's bounds
+* GUI: Import libraries feature (in the project menu)
diff --git a/lang-de.js b/lang-de.js
index f6d4d57..17cd62f 100644
--- a/lang-de.js
+++ b/lang-de.js
@@ -185,7 +185,7 @@ SnapTranslator.dict.de = {
'translator_e-mail':
'jens@moenig.org', // optional
'last_changed':
- '2013-05-14', // this, too, will appear in the Translators tab
+ '2013-07-02', // this, too, will appear in the Translators tab
// GUI
// control bar:
@@ -657,6 +657,10 @@ SnapTranslator.dict.de = {
'Tools laden',
'load the official library of\npowerful blocks':
'das offizielle Modul mit\nm\u00e4chtigen Bl\u00f6cken laden',
+ 'Libraries...':
+ 'Module...',
+ 'Import library':
+ 'Modul laden',
// cloud menu
'Login...':
diff --git a/locale.js b/locale.js
index 3e2a9fb..5edcfcc 100644
--- a/locale.js
+++ b/locale.js
@@ -42,7 +42,7 @@
/*global modules, contains*/
-modules.locale = '2013-May-14';
+modules.locale = '2013-July-02';
// Global stuff
@@ -149,7 +149,7 @@ SnapTranslator.dict.de = {
'translator_e-mail':
'jens@moenig.org',
'last_changed':
- '2013-05-14'
+ '2013-07-02'
};
SnapTranslator.dict.it = {