diff options
| author | jmoenig <jens@moenig.org> | 2013-07-02 16:51:42 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-07-02 16:51:42 +0200 |
| commit | 1061fa4437884f7fca2487e5c36c717778174eb7 (patch) | |
| tree | c6bd02dae1f234f55651f823d062975b13c59d47 | |
| parent | 78f416be9a4d42517a4b6a5bb801394c6c3e30c1 (diff) | |
| download | snap-yow-1061fa4437884f7fca2487e5c36c717778174eb7.tar.gz snap-yow-1061fa4437884f7fca2487e5c36c717778174eb7.zip | |
GUI: import libraries feature
in the project menu, libraries for
* Iteration, composition,
* List utilities,
* Variadic reporters,
* Words, sentences
| -rw-r--r-- | gui.js | 47 | ||||
| -rwxr-xr-x | history.txt | 3 | ||||
| -rw-r--r-- | lang-de.js | 6 | ||||
| -rw-r--r-- | locale.js | 4 |
4 files changed, 55 insertions, 5 deletions
@@ -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) @@ -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...': @@ -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 = { |
