|
@@ -5,69 +5,88 @@ permalink: "faq.html"
|
|
parent: Overview
|
|
parent: Overview
|
|
---
|
|
---
|
|
|
|
|
|
-### Q: How do I get back the Helios IDE after I have closed it
|
|
|
|
|
|
+#### How do I start a new Amber project?
|
|
|
|
+
|
|
|
|
+You can see the steps [described here](/getting-started.html) which are basically:
|
|
|
|
+
|
|
|
|
+1. `npm install -g amber-cli`
|
|
|
|
+2. `mkdir newProjectDir`
|
|
|
|
+3. `cd newProjectDir`
|
|
|
|
+4. `amber init`
|
|
|
|
+5. `amber serve`
|
|
|
|
+
|
|
|
|
+And visit [http://localhost:4000](http://localhost:4000)
|
|
|
|
+
|
|
|
|
+Here is also a terminal screencast doing just that:
|
|
|
|
+
|
|
|
|
+<iframe src="http://showterm.io/457dc8b24df38d67e421d#fast" width="640" height="480"></iframe>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#### How do I get back the Helios IDE after I have closed it?
|
|
|
|
|
|
Press this sequence of keys: Shift, Shift, Ctrl, Shift.
|
|
Press this sequence of keys: Shift, Shift, Ctrl, Shift.
|
|
A dialog should appear with "Legacy IDE" and "Helios IDE" buttons.
|
|
A dialog should appear with "Legacy IDE" and "Helios IDE" buttons.
|
|
|
|
|
|
In case the above did not work, evaluate the following in the JavaScript console:
|
|
In case the above did not work, evaluate the following in the JavaScript console:
|
|
|
|
|
|
- require('amber/helpers').popupHelios()
|
|
|
|
|
|
+`require('amber/helpers').popupHelios()`
|
|
|
|
|
|
|
|
|
|
-### Q: What version is the amber website running?
|
|
|
|
|
|
+#### What version is the Amber website running?
|
|
|
|
|
|
-1. Open IDE at http://amber-lang.net/.
|
|
|
|
-2. Go to Workspace tab.
|
|
|
|
-3. Print-it ``Smalltalk version``.
|
|
|
|
-4.
|
|
|
|
|
|
+1. Open IDE at [http://amber-lang.net/](http://amber-lang.net/).
|
|
|
|
+2. Go to the Workspace tab.
|
|
|
|
+3. Print or inspect the expression ``Smalltalk version``.
|
|
|
|
|
|
-### How do I install the latest Amber version?
|
|
|
|
|
|
+#### How do I install the latest Amber version?
|
|
|
|
|
|
-'Latest' often means the 'latest stable'. If this is the case go for
|
|
|
|
|
|
+For the **latest stable**, go for
|
|
|
|
|
|
- npm -g install amber-cli
|
|
|
|
|
|
+`npm -g install amber-cli`
|
|
|
|
|
|
-If you mean really the prereleases,
|
|
|
|
|
|
+If you want the **latest prerelease**, go for
|
|
|
|
|
|
- npm -g install amber-cli@bleedingedge
|
|
|
|
|
|
+`npm -g install amber-cli@bleedingedge`
|
|
|
|
|
|
-should install the last prerelease (but not the stable version even if it is newer).
|
|
|
|
|
|
+Note that bleedingedge will *not* install the stable version even if it is newer.
|
|
|
|
|
|
-Use `npm info amber-cli` to find out which version is latest and which one is bleedingedge, if you are unsure.
|
|
|
|
|
|
+If you want to be sure which version is latest and which one is bleedingedge use:
|
|
|
|
+`npm info amber-cli` and you will find them in the `dist-tags` section.
|
|
|
|
|
|
|
|
+#### How do I update Amber?
|
|
|
|
|
|
-### How do I update Amber?
|
|
|
|
|
|
+1. ``npm install -g amber-cli`` will get it fixed for all new projects and
|
|
|
|
|
|
-- ``npm install -g amber-cli`` will get it fixed for all new projects and
|
|
|
|
|
|
+2. ``npm update amber-dev`` in every project dir will fix it for current projects
|
|
|
|
|
|
-- ``npm update amber-dev`` in every project dir will fix it for current projects
|
|
|
|
|
|
+3. `bower install` in every project dir will fix it for current projects
|
|
|
|
|
|
|
|
|
|
-### How do I get the text value of an input field?
|
|
|
|
|
|
+#### How do I get the text value of an input field?
|
|
|
|
|
|
-Assuming I have a field with an id of #field1, how do I get the text value of it?
|
|
|
|
|
|
+If you have `<input id="field1" ...`, the way to get its value is `'#field1' asJQuery val`.
|
|
|
|
|
|
-Answer:
|
|
|
|
|
|
+#### How can I 'call' JavaScript functions from my Amber code?
|
|
|
|
|
|
- '#field1' asJQuery val
|
|
|
|
|
|
+To allow you to use JavaScript from your Amber code, Amber uses a proxy that will route Smalltalk messages as JavaScript calls as transparent as possible. For example, _all_ JavaScript methods in jQuery are available to you this way:
|
|
|
|
|
|
-Note:
|
|
|
|
|
|
+**Without arguments**:
|
|
|
|
|
|
-All Javascript methods in jQuery are available to you this way.
|
|
|
|
|
|
+`'#element-id' asJQuery hide`
|
|
|
|
+`'#element-id' asJQuery show`
|
|
|
|
|
|
-Multi parameter functions are then mapped like:
|
|
|
|
|
|
+**With one argument**:
|
|
|
|
|
|
- aQuery.sampleFunc (a,b,c);
|
|
|
|
|
|
+`'#element-id' asJQuery attr: 'data' put: 'some-value'`
|
|
|
|
|
|
- aQuery sampleFunc: a and: b and: c.
|
|
|
|
|
|
+**With many arguments**:
|
|
|
|
|
|
-The ``and:`` can be whatever. The only thing that matters is the first part of the keyword selector which has to match the function name.
|
|
|
|
|
|
+`aQuery.sampleFunc(a,b,c);` translates to `aQuery sampleFunc: a andThis: b andThat: c.`
|
|
|
|
|
|
|
|
+In the previous examples, the `put:` and the ``andThis:andThat:`` part of the Smalltalk selector can be named any way you want. For JavaScript functions the names in that part of the keyword are ignored. Amber needs only the first part of the selector matching the JavaScript function name.
|
|
|
|
|
|
|
|
+#### Where can I find more questions and answers?
|
|
|
|
|
|
-### More questions and answers
|
|
|
|
|
|
+You can try the [wiki](https://github.com/amber-smalltalk/amber/wiki/FAQ) or join the Amber's chat group [here](https://gitter.im/amber-smalltalk/amber).
|
|
|
|
|
|
-On the wiki
|
|
|
|
-https://github.com/amber-smalltalk/amber/wiki/FAQ
|
|
|
|
|
|
|