Skip to content

Dynamic matching option sets for FingerText. #24

Open
trusktr opened this Issue Feb 24, 2012 · 2 comments

2 participants

@trusktr
trusktr commented Feb 24, 2012

it'd be nice if we could select an option in one location and also select the corresponding option in another location.

This is my problem:
I have:

<div$[1[(opt)| id="$[![Unique ID]!]"| class="$[![Class Name]!]"| id="$[![Unique ID]!]" class="$[![Class Name]!]"]1]>
    $[![]!]
</div><!-- #$[![Unique ID]!] .$[![Class Name]!] -->[>END<]

After I am done inserting a tag I will see something like <!-- #UniqueID .ClassName --> if I choose the last option from the option set (it includes both id and class attributes). but if I choose the first option, I will be left with <!-- #UniqueID . --> and if I choose the second option, I will be left with <!-- # .ClassName --> when I am done inserting the tag.

It'd be neat if we could match option sets. For example, if we have $[2[(opt)|Option1|Option2|Option3]2] and somewhere else you have $[2[(opt)|OtherOption1|otherOption2|otherOption3]2], it'd be nice if the options sets get matched if they have the same number of options and same priority number. Since both option sets are number 2 and have the same number of options (three each), then when we choose an option during the first selection the corresponding option would appear at the location of the second selection.

If the numbers are different, or if the number of options doesn't match, then no matching would happen.

Here's an example:
Pretend we make a snippet like this:

<div $[1[(opt)|one|two|ONETWO]1]>
    $[![]!]
</div><!-- $[1[(opt)|ONE|TWO|OneTwo]1] -->

Currently when we type the triggertext for this snippet and press tab to insert the div element, we will be able to choose an option at the first location:

<div ONETWO>
    $[![]!]
</div><!-- $[1[(opt)|ONE|TWO|OneTwo]1] -->

It'd be nice if when we choose the third option in the first option set that the third option in the second option set also gets chosen like this:

<div ONETWO>
    $[![]!]
</div><!-- OneTwo -->

If we press the down arrow key to change the selected option of the first option set, then the second option set location would also be updated like this:

<div two>
    $[![]!]
</div><!-- TWO -->

Then, when we're done making our selection and press tab, we will be moved to the next hotspot like usual:

<div ONETWO>
    We type here now
</div><!-- OneTwo -->

If our template is like this:

<div $[1[(opt)|one|two|three]1]>
    $[![]!]
</div><!-- $[1[(opt)|ONE|TWO|THREE|FOUR]1] -->

or like this:

<div $[1[(opt)|one|two|three]1]>
    $[![]!]
</div><!-- $[2[(opt)|ONE|TWO|THREE]2] -->

then no matching would happen, and we would select the option for each option set separately, like the current functionality.

Now THAT would be frawsome (freackin' awesome)!

@erinata
Owner
erinata commented Feb 26, 2012

Honestly this one is difficult. I agree that it's awesome but I really cannot say that I can implement it now. Let this stay in the issue list so that I can think about it later.

@erinata
Owner
erinata commented Mar 15, 2012

um ....... it's too difficult for options items to dynamically match each others. However, I implemented a keyword hotspot named LASTOPTION, which MAY partially fulfill the feature requested?

It works as follow: The hotspot $[![(key)LASTOPTION]!] will yield anything that is chosen in the previous (opt)

say if you have a snippet

<div $[![(opt)|one|two|three]!]>
hello
</div><!-- $[![(key)LASTOPTION]!] -->

when you choose "one" or "two" or "three" in the (opt) hotspot, your choice will be automatically filled into
$[![(key)LASTOPTION]!]

You can call $[![(key)LASTOPTION]!] as many times as you want. But remember if you trigger another (opt), the record will be erased. Therefore you need to rank the triggering sequence with priority hotspots carefully when using it.

And there is another keyword hotspot named LASTLISTITEM, which is the LASTOPTION equivalent for (lis) hotspot

This feature is implemented in the nightly build 0.5.54.3

http://dl.dropbox.com/u/7429931/fingertext/FingerText%20-%200.5.54.3.zip

If you have time can you please try it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.