<div dir="ltr">Hi, Marco --<div><br></div><div>The menu issue should now be fixed.</div><div><br></div><div>Thanks,</div><div>Robert</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 1:45 PM, Marco Monteiro <span dir="ltr"><<a href="mailto:marco@neniu.org" target="_blank">marco@neniu.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi, <span style="background:none repeat scroll 0% 0% yellow"><span style="background:none repeat scroll 0% 0% yellow"><span>Marko</span></span></span>!<br><br></div><div>Thanks for your help. The second method you described of adding it to my user <span style="background:none repeat scroll 0% 0% yellow"><span style="background:none repeat scroll 0% 0% yellow"><span>config</span></span></span> worked.<br><br>As for the first method (which, as you point out, is what I actually want to use so that the<br>worlds I create are usable by other users), I have a problem.<br><br></div><div>When I right click in the module list I just get the <span style="background:none repeat scroll 0% 0% yellow"><span style="background:none repeat scroll 0% 0% yellow"><span>morphic</span></span></span> halo (the same thing I get when I <span style="background:none repeat scroll 0% 0% yellow"><span style="background:none repeat scroll 0% 0% yellow"><span>Ctrl</span></span></span>+Left-Click).<br></div><div>If I select the menu from the halo, I cannot see an option to either "add to world requirements" or "add new file".<br></div><div>How can I configure Lively to show the context menu when right clicking? Or what other key combination can<br>I use to see the context menu?<br><br></div><div>By going over the Lively-101 again, I can see there that Right click should be <br>"<span style="color:rgb(0,0,0);font-family:monospace;font-size:19px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;display:inline!important;float:none;background-color:rgb(255,255,255)">ignored (some morphs provide a menu on right click)</span>"<br> but it's not ignored in my system. Is that makes any difference, I'm on Linux.<br></div><div><br></div><div>By the way, I'm using lively for doing presentation slides that require showing JavaScript code.<br>I've already created one about web messaging. I'm trying to clean it up so that I can share it on <a href="http://lively-web.org" target="_blank">lively-web.org</a>.<br></div><div><br>The great thing about lively for this use case is that I can create a slide that embeds some code<br></div><div>that I can run while doing the presentation; and then I can show the code. It's great.<br><br></div><div>I'm using the <span style="background:none repeat scroll 0% 0% yellow"><span style="background:none repeat scroll 0% 0% yellow"><span>PresentationController</span></span></span> part. I saw the Lively2Lively world from Robert's presentation<br>(<a href="http://lively-web.org/users/" target="_blank">http://lively-web.org/users/</a><span style="background:none repeat scroll 0% 0% yellow"><span>robertkrahn</span></span>/2013-08-17_Lively2Lively.html)  and knew that I want to use that.<br></div><div><br></div><div>I'm very new to Lively, but not to <span style="background:none repeat scroll 0% 0% yellow"><span>Morphic</span></span>. I've spent some time in 2004 playing with Squeak and reading up on<br></div><div>Smalltalk. I still have Squeak installed, and boot it up from time to time.<br><br></div><div>I even played with the original <span style="background:none repeat scroll 0% 0% yellow"><span>Morphic</span></span>, in Self, just to see it in the environment where it was invented.<br></div><div>It's very cool.<br><br></div><div>Funny that M<span style="background:none repeat scroll 0% 0% yellow"><span>orphic</span></span> ends up in a language with a heavy inspiration from Self (the prototypes, at least)<br>even though everyone wants classes instead; even M<span style="background:none repeat scroll 0% 0% yellow"><span>orphic</span> implementation</span>, it seems,<br>with it's Object.subclass, etc. :D<br></div><div><br></div>Thanks again.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 5:51 PM, Marko Röder <span dir="ltr"><<a href="mailto:m.roeder@photon-software.de" target="_blank">m.roeder@photon-software.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Marco -<div><br></div><div>I don’t think modify the bootstrap.js is what is necessary here. This is only for real core functionality that you would want in any page (also mine, etc.).</div><div>Modules are the way to go and as I can see, you already figured out quite a bit. Very good!</div><div><br></div><div>To create your own module, open the world menu and go to Tools -> System Code Browser. In the SCB, click on the … next to the two arrows (<, >) and go to your directory. Right click on your directory listing, select “add new file” and choose a name for your module. This will give you a JS (module) file that looks similar to the snippet of your original email. And yes, you can load an external library with exactly this additional <font face="Courier New">requiresLibs()</font> call. Additionally, you can add all the JS methods you want to have in all your worlds inside the <font face="Courier New">toRun(function() { … })</font> body.</div><div>If you still want to attach it to the (current) world, wrap it with <font face="Courier New">lively.whenLoaded(function(world) { … })</font> and attach it to <font face="Courier New">world</font>.</div><div>But you can also create your own classes in that module, add those methods there and reference your class from the calling side.</div><div><br></div><div>To make your module a requirement in your worlds, there are two ways.</div><div>1) In every world you want the code to run, open the SCB (described above), find the module, right click the module in the listing and select “add to world requirements”. Don’t forget to save the page. The code will be loaded immediately and the next time you load this world.</div><div>2) Add it to your user config (so that every world you load, no matter its dependencies) will have it. Open the SCB, go to your user directory and edit the config.js. Either put it in as a requirement in <font face="Courier New">requires('user.yourUsername.YourModule</font><span style="font-family:'Courier New'">'</span><font face="Courier New">)</font> or inside the toRun function do <font face="Courier New">module('user.yourUsername.YourModule').load(true);</font> (true = synchronous loading).</div><div>The drawback here is that only you will run your user config and if someone else tries to load your worlds, those dependencies will be missing. (So I encourage you to use (1) even though it means that you will have to add this dependency to all of your worlds manually.)</div><div><br></div><div>You can find some additional information on modules, classes, etc. in:</div><div><br></div><div><a href="http://lively-web.org/users/mroeder/lively-concepts.html" target="_blank">http://lively-web.org/users/mroeder/lively-concepts.html</a></div><div><a href="http://lively-web.org/users/robertkrahn/lively-cheat-sheet.html" target="_blank">http://lively-web.org/users/robertkrahn/lively-cheat-sheet.html</a></div><div><br></div><div>And, of course, let us know if you need any more help and keep us posted on what you are trying to build with Lively :-)!</div><div><br></div><div>Best,</div><div><br></div><div><span style="white-space:pre-wrap">  </span>- Marko ;-)</div><div><br></div><div><br></div><div>PS: I guess you have also seen <a href="http://lively-web.org/users/robertkrahn/Lively-101.html" target="_blank">http://lively-web.org/users/robertkrahn/Lively-101.html</a>. It does not really cover "low-level stuff” can be of good help!</div><div><br></div><div><br></div><div><blockquote type="cite"><div><div><div>On Jan 13, 2015, at 2:50 AM, Marco Monteiro <<a href="mailto:marco@neniu.org" target="_blank">marco@neniu.org</a>> wrote:</div><br></div></div><div><div><div><div dir="ltr"><div><div><div>Hello!<br><br></div>I've recently started playing with Lively and I have a couple of questions.<br><br>I have some helper JS methods that I want to use in different worlds. Currently I install the methods in the world morph and use $world.<method> in my code. I would like to extract these methods into a JS library file and import it into different worlds. By reading other posts in the mailing list, I found that, for example, <a href="http://lively-web.org/users/larswassermann/relax.html" target="_blank">http://lively-web.org/users/larswassermann/relax.html</a>, loads the <a href="http://lively-web.org/users/larswassermann/relax.js" target="_blank">http://lively-web.org/users/larswassermann/relax.js</a> file. I want to do the same thing in my worlds. How can I do that?  <br><br>I've been exploring and found the Preferences window. In that, I see a bootstrap group, which seems could be something that would allow me to add files JS files to the bootstrap, but when I try to edit the bootstrapFiles property, I get '["core/lively/Migration.js","core/liv...' in the editor, instead of the entire array.<br></div><br>Also, how can I load a generic JS library (for example<code><span><span> <a href="https://sdk.amazonaws.com/js/aws-sdk-2.1.5.min.js" target="_blank">https://sdk.amazonaws.com/js/aws-sdk-2.1.5.min.js</a></span></span></code>) into the world and have AWS (defined as a global variable in the library) be a global variable in my world?<br><br></div>I think I read in the mailing list an answer to this:<br><br>module(<my-module>).requires().requiresLib({<br>    url: "<a href="https://sdk.amazonaws.com/js/aws-sdk-2.1.5.min.js" target="_blank">https://sdk.amazonaws.com/js/aws-sdk-2.1.5.min.js</a>", loadTest: function() { return !!window.AWS; }<br>}).toRun(function() {<br><br>});<br><div><div><br>if I can load my own library (earlier question).<br><br>Is there any documentation or other resources for this kind of (lower level) stuff? For example, how the bootstrap process works, etc.<br><br></div><div>Thanks.<br></div></div></div></div></div>
_______________________________________________<br>lively-kernel mailing list<br><a href="mailto:lively-kernel@hpi.uni-potsdam.de" target="_blank">lively-kernel@hpi.uni-potsdam.de</a><br><a href="http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel" target="_blank">http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel</a><br></div></blockquote></div><br></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
lively-kernel mailing list<br>
<a href="mailto:lively-kernel@hpi.uni-potsdam.de">lively-kernel@hpi.uni-potsdam.de</a><br>
<a href="http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel" target="_blank">http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel</a><br>
<br></blockquote></div><br></div>