viresh-ratnakar / exolve

Online interactive crossword software in JavaScript
MIT License
71 stars 15 forks source link

Perhaps this is a genric javascript/web design question... But is it possible to activate "first clue" at page load or something similar? #51

Closed erikstar closed 3 years ago

erikstar commented 3 years ago

After some hard core struggeling I managed to achive the thing I want in #50 with rearrangement of all clues as "nodir-clues".

So if I now could have the "first clue" highlighted and "active" (pinkish) at page load then all my demands should be solved! (for the moment :)

So if you check the https://fripp.changeip.org/melodikryss/melodikryss2/lost_95.html and click on the upper left corner square [1], then you will get to my first clue (song). It is just a coincidence it is numbered 1. And then I have buttons for hearing the question, and the actual song. And then I will have this fixed for all clues, now it is just test.

If you click on 9d, you can see a more special one with turning words. And you can see my notation for the turning clues L <-> d, V <-> a.

As you see I turn off the automatic labeling.

If you check the source you can see it is rather much work for skipping the across and down and convert them to nodirs, but it works! But honestly is for me very unclear how it can actually...

I have this in the code: exolve-nodir:

a9 #a8 #a7 [1], [2], [16] 1L, 2L, 16L bla bla bla

b9 #b8 #b7 [2] See [1]

g2 #g1 [16] See [1]

.....

a9 #b9 #c9 #d9 #e9 [1], [5] 1V, 5V jada jada jada

g9 #h9 #i9 #j9 [5] See [1]

....

For me it is very magic how the "see [1]" can understand which one it should refer to... But it works :)

Thanks again for this excellent code!

/Erik S, Sweden

viresh-ratnakar commented 3 years ago

Oh, from customizeExolve() you can call a function to activate the cell, like this:

function customizeExolve(p) {
     // ... other customizations
     p.cellActivator(0,0)
}

Also, the text "see [1]" is not doing anything. You can leave it blank or write whatever you want. The actual linking of the clues is happening in

#a9 #a8 #a7 [1], [2], [16] 1L, 2L, 16L bla bla bla

Which says add [2], [16] as linked child clues to [1].

erikstar commented 3 years ago

Thank you for the cellActivator-variant and also for explaing the "see-stuff". I feel stupid now. BUT I really think it is hard to achive what I really want, BUT.... I think I solved it in a very kludge-like way.

So the thing I think is problematic is the reference in nodir-clues. This is from the same example: exolve-nodir: ...

a9 #b9 #c9 #d9 #e9 [1], [5] 1V, 5V bla bla

g9 #h9 #i9 #j9 [5] jada

...

g9 #g8 #g7 #g6 #g5 #g4 [5] Banan

...

In this case everything works as excpected, but if I want the last [5] to actually be before this multiclue... how to do? It seems to start from top.

So if I change it to

g9 #g8 #g7 #g6 #g5 #g4 [5] Banan

...

a9 #b9 #c9 #d9 #e9 [1], [5] 1V, 5V bla bla

g9 #h9 #i9 #j9 [5] jada

...

The linked clue will be using the wrong [5]

erikstar commented 3 years ago

So now my kludge solution! :)

g9 #g8 #g7 #g6 #g5 #g4 [5d] Banan

...

a9 #b9 #c9 #d9 #e9 [1], [5] 1V, 5V bla bla

g9 #h9 #i9 #j9 [5] jada

...

Then it will work! As long as I don't use it for reference I can change the "5d" to anything. It is the last text that will be placed.

Perhaps I am the only one interested in this... but still... :-)

viresh-ratnakar commented 3 years ago

Closing out old bugs that I did take some action on. If I haven't fixed every aspect as expected, apologies, but please open a new bug (hard for me to parse out what remains to be fixed).