Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 199: | Line 199: | ||
== Bill's scratchpad == | == Bill's scratchpad == | ||
=== Straw model for a future wiki development tree home === | |||
{| class="wikitable" | |||
! Author !! Development tree home | |||
|- | |||
| Bill || [[dev/author/Bill]] | |||
|- | |||
| Beth || [[dev/author/Beth]] | |||
|- | |||
| Ernst || [[dev/author/Ernst]] | |||
|- | |||
| Alan || [[dev/author/Alan]] | |||
|} | |||
Possible future development home: [[dev]] | |||
Possible team page review home: [[dev/review]] | |||
Possible team page review home: [[dev/stage]] | |||
Possible author home trees: [[dev/author]] | |||
Possible tree home for Bill: [[dev/author/Bill]] | |||
Possible tree home for Beth: [[dev/author/Beth]] | |||
Possible tree home for Ernst: [[dev/author/Ernst]] | |||
Possible tree home for Alan: [[dev/author/Alan]] | |||
{| class="wikitable" | {| class="wikitable" | ||
! Colors | ! Colors | ||
|- bgcolor="#E8F0E8" | |- bgcolor="#E8F0E8" | ||
| | | | ||
=== Sergio's photographic equipment email === | === Sergio's photographic equipment email === | ||
I have a LOT of camera equipment (Camera, Lens, Filters, tripods, bags, etc.). I want to be able to create records of all of this equipment for personal inventory as well as insurance purposes. | I have a LOT of camera equipment (Camera, Lens, Filters, tripods, bags, etc.). I want to be able to create records of all of this equipment for personal inventory as well as insurance purposes. | ||
Line 246: | Line 275: | ||
<hr><hr> | <hr><hr> | ||
=== Saved Wiki22 banner menu === | |||
The saved Wiki22 banner menu, complete, but pointing to Wiki22 pages under development, is at [[Dev: Wiki22 BannerMenu]]. | |||
=== Example: Making a Shared library function available & call-in it from a trigger or action === | |||
{| class="wikitable" | {| class="wikitable" | ||
! From forum email | ! From forum email | ||
|+ Considering scripting Memento | |+ Considering scripting Memento | ||
|- bgcolor="#E8F0E8" | |- bgcolor="#E8F0E8" | ||
| | | stary-@live.com, Aug 10 2021 | ||
If you want to extend Memento with JavaScript, I suggest you read the wiki, so you can learn how to do it. If you want to use the simplest scripts, you could try using a JavaScript field, but it doesn't have fancy global functions like set() or link() or libByName(), but it does have simple global functions like field(); | If you want to extend Memento with JavaScript, I suggest you read the wiki, so you can learn how to do it. If you want to use the simplest scripts, you could try using a JavaScript field, but it doesn't have fancy global functions like set() or link() or libByName(), but it does have simple global functions like field(); | ||
Line 276: | Line 309: | ||
https://wiki.mementodatabase.com/index.php/How:Write_scripts_in_JavaScript_for_Memento, or... | https://wiki.mementodatabase.com/index.php/How:Write_scripts_in_JavaScript_for_Memento, or... | ||
https://wiki.mementodatabase.com/index.php/Tips:Using_JavaScript_in_Memento | https://wiki.mementodatabase.com/index.php/Tips:Using_JavaScript_in_Memento | ||
|- bgcolor="#E8F0E8" | |||
| | |||
For a shared function definition, it should be... | |||
<pre> | |||
function sub(fieldname, fieldvalue) { | |||
entry().set(fieldName, fieldValue); | |||
} | |||
</pre> | |||
Then call that in a trigger, action, or whatever with this... | |||
<pre> | |||
sub("name", "bullet"); | |||
</pre> | |||
On Tue, Aug 10, 2021, 16:34 Bill Crews <bill.crews@gmail.com> wrote: | |||
Hide quoted text | |||
We know only what we can glean ... That there is a field named "name" and a value "bullet" that you want to go into that field. If it's a shared script, why does it call a global function field()? There is no such global function. There must be a "current entry" for that, and shared scripts (like most other things) don't work for JavaScript fields. | |||
If you tell us more, we can be of more help, but all I can do is guess that the following is what you want... | |||
It must be a trigger script or an action script located in an entry. This enables the entry() global function to work, so there is a "current" entry. | |||
So, <code> entry().set("name", "bullet"); </code> is all the script you need, if your objective is to set that field's value to "button". If you're wanting to do something else, you might consider telling what that is. | |||
|} | |} | ||