diff options
| author | jmoenig <jens@moenig.org> | 2013-03-19 12:09:55 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-03-19 12:09:55 +0100 |
| commit | a67b2e238164a60988e9bb89d644b3923b0f696b (patch) | |
| tree | ba5f7be2bac14c8f2fdec1dff18740b82c2ded54 | |
| parent | 3f19a21cadf059ec17abc939739e98642239a08f (diff) | |
| download | snap-a67b2e238164a60988e9bb89d644b3923b0f696b.tar.gz snap-a67b2e238164a60988e9bb89d644b3923b0f696b.zip | |
motd support
On startup Snap! looks for http://snap.berkeley.edu/motd.txt, if it
exists it is shown in a dialog box
| -rw-r--r-- | gui.js | 23 | ||||
| -rwxr-xr-x | history.txt | 3 |
2 files changed, 18 insertions, 8 deletions
@@ -149,7 +149,7 @@ IDE_Morph.prototype.init = function (isAutoFill) { }; IDE_Morph.prototype.openIn = function (world) { - var hash, usr; + var hash, usr, motd; this.buildPanes(); world.add(this); @@ -191,13 +191,22 @@ IDE_Morph.prototype.openIn = function (world) { this.reactToWorldResize(world.bounds); function getURL(url) { - var request = new XMLHttpRequest(); - request.open('GET', url, false); - request.send(); - if (request.status === 200) { - return request.responseText; + try { + var request = new XMLHttpRequest(); + request.open('GET', url, false); + request.send(); + if (request.status === 200) { + return request.responseText; + } + throw new Error('unable to retrieve ' + url); + } catch (err) { + return; } - throw new Error('unable to retrieve ' + url); + } + + motd = getURL('http://snap.berkeley.edu/motd.txt'); + if (motd) { + this.inform('Snap!', motd); } if (location.hash.substr(0, 6) === '#open:') { diff --git a/history.txt b/history.txt index b90771d..7150151 100755 --- a/history.txt +++ b/history.txt @@ -1535,4 +1535,5 @@ ______ ------ * Blocks: SyntaxElementMorph fixLayout() optimization for active highlights * Russian translation!! Yay, thanks, Svetlana Ptashnaya!! -* Store, GUI, Blocks: Scaling support for Comments and serialization/deserialization
\ No newline at end of file +* Store, GUI, Blocks: Scaling support for Comments and serialization/deserialization +* GUI: motd support: On startup Snap! looks for http://snap.berkeley.edu/motd.txt, if it exists it is shown in a dialog box
\ No newline at end of file |
