Tapping List Entry to launch Hyperlink?

246 views
Skip to first unread message

Gabriel

unread,
Dec 22, 2024, 7:21:27β€―PM12/22/24
to mementodatabase
For Memento on Android, I've created a Library for managing my web bookmarks, including a field for the Site Name (as a Text data type), and a separate field for the URL (as a Hyperlink data type). I have set the database to List View, and only the site name is visible for each entry. Is there a way to click on the entry to launch the Hyperlink, rather than having to click into the entry to then click on the Hyperlink field?

Mmm

unread,
Dec 23, 2024, 2:12:19β€―AM12/23/24
to mementodatabase
Как ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ ссылку Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ:

Π”ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ скрипт ДСйствиС записи Π² спискС ΠΈ установитС для Π½Π΅Π³ΠΎ Ρ„ΠΈΠ»ΡŒΡ‚Ρ€, ΠΊΠΎΠ³Π΄Π° ΠΏΠΎΠ»Π΅ с URL Π½Π΅ пустоС.Β 

Π¨Π°Π±Π»ΠΎΠ½ с ΠΏΡ€ΠΈΠΌΠ΅Ρ€ΠΎΠΌ:

понСдСльник, 23 дСкабря 2024β€―Π³. Π² 03:21:27 UTC+3, Gabriel:

Mmm

unread,
Dec 23, 2024, 2:19:56β€―AM12/23/24
to mementodatabase
Ошибся со ссылкой...Β 

Бсылка Π½Π° скрипт:
понСдСльник, 23 дСкабря 2024β€―Π³. Π² 10:12:19 UTC+3, Mmm:

Gabriel

unread,
Dec 23, 2024, 11:02:36β€―AM12/23/24
to mementodatabase
I was able to get this to work. Thank you!

David Gilmore

unread,
Dec 23, 2024, 11:13:11β€―AM12/23/24
to mementodatabase
I actually do something similar. I have a library (called "Databases") that has the list of all of my other libraries. The Databases library has the name, last date and time the library was opened, and other useful information about the library. "Databases" can also be utilized to hold global data for libraries that need them. The other reason for Databases to exist is that it also acts like a library launcher.

There are several ways to "launch" the database. You could create a trigger on "Opening an Entry View Card", "Before window display". The problem with this method is that is kind of locks out being able to view or edit the actual entry.

The method I use for launching is to create a checkbox field ("Launch") in "Databases", and make that checkbox editable in the List screen. The check box will appear to the left in the list view. The user then checks that box to launch the library. Then create a trigger "Updating a field", "Before saving the entry". The code in that trigger is:

var e = entry();
if (e.field("Launch")) { // see if launch has been set
Β  e.set("Launch", false); Β // Reset launch for next time
Β  libByName(e.field("Name")).show(); // Show designated library
}

You can use instead the hyperlink code Mmm showed you.

RG T

unread,
Dec 23, 2024, 2:27:02β€―PM12/23/24
to David Gilmore, mementodatabase
Bonjour David,
Je rebondis sur votre dernier post. En fait j'ai une ébauche de bibliothèque qui compile toutes mes autres bibliothèques comme la votre. Je vais intégrer votre script, par contre je n'ai pas résolu l'affichage de la date et heure de modification ainsi que s'il est possible d'afficher le nombre d'enregistrements, d'ailleurs si c'est possible? our l'instant je fais ça en manuel.
J'aimerai bien voir votre faΓ§on de faire.
Merci
TRG

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mementodatabase/06eb02bd-ddc6-4db8-b18e-38d783f8e257n%40googlegroups.com.

David Gilmore

unread,
Dec 24, 2024, 11:01:47β€―AM12/24/24
to mementodatabase
TRG,

I have each library update the "Databases" library LastOpened field when that library opens (using an OpenLibrary trigger). That way the date last opened is set in "Databases", and no polling of each library is necessary. I use the Moment library to format the datetime when displaying it in the list view.

I have not done the number of records. And I do not see a way of fetching the number of records from externally. I guess you could have the library update the "Databases" library each time it adds or deletes entries. Seems like a lot of overhead though.

Bill Crews

unread,
Dec 24, 2024, 11:27:31β€―AM12/24/24
to David Gilmore, mementodatabase
Get library with lib(), libByName(), or libById(). Then...

let entries = lib.entries();
let nentries = entries.length;

I know of no way to do this without opening & fetching the entire library into an array.Β 


David Gilmore

unread,
Dec 24, 2024, 6:21:31β€―PM12/24/24
to mementodatabase
What Bill showed you is the simple way to do get the count. But is does have one drawback, in that fetching those entries causes that library to be opened, which means your last opened date would be set to the current time and date.

Bill Crews

unread,
Dec 24, 2024, 6:31:58β€―PM12/24/24
to David Gilmore, mementodatabase

Mmm

unread,
Dec 25, 2024, 2:13:44β€―AM12/25/24
to mementodatabase
>>> But is does have one drawback, in that fetching those entries causes that library to be opened, which means your last opened date would be set to the current time and date.
Β 
НС согласСн с этим ΡƒΡ‚Π²Π΅Ρ€ΠΆΠ΄Π΅Π½ΠΈΠ΅ΠΌ.Β 

Π‘ΠΎΠ±Ρ‹Ρ‚ΠΈΠ΅ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ Π½Π΅ наступаСт.Β 
А врСмя послСднСго открытия Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ ΠΏΡ€Π΅Π΄Π»Π°Π³Π°Π΅Ρ‚Π΅ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡ‚ΡŒ Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€ΠΎΠΌ этого события (ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ).Β 
ΠŸΡ€ΠΎΠ²Π΅Ρ€ΡŒΡ‚Π΅ скрипт Π‘ΠΈΠ»Π»Π° Π² условиях своих Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ.Β 

срСда, 25 дСкабря 2024β€―Π³. Π² 02:31:58 UTC+3, bill....@gmail.com:

David Gilmore

unread,
Dec 25, 2024, 10:46:54β€―AM12/25/24
to mementodatabase
Mmm,

I have tried it. Even accessing a library via a link will trigger the open.

RG T

unread,
Dec 25, 2024, 11:18:07β€―AM12/25/24
to David Gilmore, Mmm, mementodatabase
Bonjour,
Je ne donne pas mon avis, il s'agit de simples constatations. Je suis peut-Γͺtre hors sujet.
J'ai tΓ©lΓ©chargΓ© la base exemple de Mmm. Si je cliques sur l'icΓ΄ne la page web s'ouvre. En refermant je consulte la vignette la date et heure sont identiques qu'avant ouverture. J'ouvre la base sans rien modifier, lΓ  aussi rien ne change sur la vignette. Par contre si je modifie l'enregistrement, la date et heure change. VoilΓ  simple constatations je ne suis pas assez performant en javascript il y a peut Γͺtre des choses qui m'Γ©chappent.
Bonnes fΓͺtes.
TRG

Mmm

unread,
Dec 25, 2024, 11:37:57β€―AM12/25/24
to mementodatabase
ВСроятно Π΅ΡΡ‚ΡŒ Π½Π΅Π΄ΠΎΠΏΠΎΠ½ΠΈΠΌΠ°Π½ΠΈΠ΅.

Π‘ΠΈΠ»Π» ΡƒΠΊΠ°Π·Π°Π» Π½Π° способ опрСдСлСния количСства записСй Π² Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ΅. Π­Ρ‚ΠΎ общСизвСстныС, Π·Π°Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Π΅ ΠΏΡ€ΠΈΠ΅ΠΌΡ‹...
https://groups.google.com/g/mementodatabase/c/2CX4UFCDqAc/m/1sqwnw1pAwAJ

Π’Ρ‹ ΡƒΠΊΠ°Π·Π°Π»ΠΈ Π½Π° нСдостаток, якобы этот способ ΠΏΡ€ΠΈΠ²ΠΎΠ΄ΠΈΡ‚ ΠΊ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΠΈΡŽ инспСктируСмой Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ.
https://groups.google.com/g/mementodatabase/c/2CX4UFCDqAc/m/4SExEKV_AwAJ

А здСсь описан способ, ΠΊΠ°ΠΊ ΠΎΠ±Π½ΠΎΠ²ΠΈΡ‚ΡŒ врСмя открытия Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π° ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ.
https://groups.google.com/g/mementodatabase/c/CMLfDL7wxvE/m/FCFGmAhpAwAJ

ΠŸΡ€ΠΈΠ²ΠΎΠΆΡƒ ΠΏΡ€ΠΈΠΌΠ΅Ρ€ Ρ€Π°Π±ΠΎΡ‚Ρ‹ Π±Π°Π·ΠΎΠ²ΠΎΠΉ ΠΈ рядовой Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ.
Базовая Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ°:
1. прСдСляСт количСство записСй Π² рядовой Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ΅,
2. создаСт Π½ΠΎΠ²ΡƒΡŽ запись Π² рядовой Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ΅,
3. ΠΎΡ‚ΠΊΡ€Ρ‹Π²Π°Π΅Ρ‚ Ρ€ΡΠ΄ΠΎΠ²ΡƒΡŽ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΡƒ.

Ни Π² ΠΏΠ΅Ρ€Π²ΠΎΠΌ, Π½ΠΈ Π²ΠΎ Π²Ρ‚ΠΎΡ€ΠΎΠΌ случаС Π½Π΅ срабатываСт Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ Π² рядовой Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ΅.
Он срабатываСт Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π² случаС Π΅Π΅ открытия ΠΈ заполняСт ΠΏΠΎΠ»Π΅ "LastOpen" Π² Π±Π°Π·ΠΎΠ²ΠΎΠΉ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ΅.

Π’ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ послС тСстирования, Π’Π°ΡˆΠ΅ ΠΌΠ½Π΅Π½ΠΈΠ΅ измСнится.

Π‘ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ для тСстов Π²ΠΎ Π²Π»ΠΎΠΆΠ΅Π½ΠΈΠΈ.
Алгоритм:
1. Π£ΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ. Записи ΡΠΎΠ·Π΄Π°Π²Π°Ρ‚ΡŒ Π½Π΅ Π½ΡƒΠΆΠ½ΠΎ.
2. ΠžΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΡƒ Test lib.
3. ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ Π² Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΡƒ All bases ΠΈ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ скрипты для записи "Test lib".

срСда, 25 дСкабря 2024β€―Π³. Π² 19:18:07 UTC+3, trg...@gmail.com:
All_bases.mlt2

Mmm

unread,
Dec 25, 2024, 11:46:24β€―AM12/25/24
to mementodatabase
Π‘ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° ΠΈΠ· этого сообщСния 

Π½Π΅ опрСдСляСт врСмя послСднСго открытия Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ.
Она опрСдСляСт врСмя послСднСй ΠΌΠΎΠ΄ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΠΈ любой ΠΈΠ· записСй Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ ΠΈ совпадаСт с ΠΏΠ΅Ρ€Π²ΠΎΠΉ записью Π² ИБВОРИИ.

ΠœΡ‹ с Π”Π°Π²ΠΈΠ΄ΠΎΠΌ обсуТдаСм врСмя послСднСго открытия Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ.

срСда, 25 дСкабря 2024β€―Π³. Π² 19:37:57 UTC+3, Mmm:

David Gilmore

unread,
Dec 25, 2024, 12:25:43β€―PM12/25/24
to mementodatabase
Okay, my previous test must not have been accurate. Coming in through a link does not trigger then "openlibrary" trigger. Oops. Everything else seems to.

My testing was done by putting the following code in an "OpenLibrary" trigger, then tried the different access methods for that library.

message(lib().title + " has just been opened");
Reply all
Reply to author
Forward
0 new messages