dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

Let developers specify an annotation that produces a dropdown menu with text to replace current text #270

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is probably something about new menuHook.
Action could be just placing new annotation (a selected by user from menu),
and then let robot replace text with selected.

Original issue reported on code.google.com by qwigly...@gmail.com on 8 Oct 2009 at 6:01

GoogleCodeExporter commented 9 years ago
You can place an annotation using annotateSelection:
http://wave-samples-gallery.appspot.com/about_app?app_id=35019

Do you mean something else?

Original comment by pamela.fox on 11 Oct 2009 at 2:20

GoogleCodeExporter commented 9 years ago
I meant creating context menues that appear above annotated text.
Such annotations should already exist to implement Spelly hints.
But they are yet undocumented.

Such hints may be usefull to do many other interesting things.
For instance - show translations from dictionary or transaltion memory.
When used from client-side, they may be usefull to leave some markup for robot 
(to
pocess/ignore the text).

It was discussed at some OH.

Original comment by qwigly...@gmail.com on 11 Oct 2009 at 3:15

GoogleCodeExporter commented 9 years ago
Okay, I see. You mean the drop-down menus that appear under the arrows for 
Spelly. 

What do you envision the API would look like for this? Spelly puts different 
words 
under each arrow, depending on the context. If you wanted to do that, you would 
need to 
request the relevant set of words from your robot. 

Certainly seems like something we want to let developers do, but I'm curious as 
to how 
you would like to do it.

Original comment by pamela.fox on 11 Oct 2009 at 3:19

GoogleCodeExporter commented 9 years ago
Seems like i've mixed up two things here:
- annotations' syntax to allow such menues (a set of words to replace selected 
text)
- creating menu to allow user to put new annotation from pre-defined set (a set 
of
key/values to annotateSelection).

Original comment by qwigly...@gmail.com on 11 Oct 2009 at 3:31

GoogleCodeExporter commented 9 years ago
Okay, so you can already use annotateSelection to annotate selected text with a 
key/value, and you can set annotations from a robot. So I believe the remaining 
desire 
is to be able to specify a type of annotation that would result in a drop-down 
menu?

Original comment by pamela.fox on 12 Oct 2009 at 12:05

GoogleCodeExporter commented 9 years ago
yes. that's it.

Original comment by qwigly...@gmail.com on 12 Oct 2009 at 2:17

GoogleCodeExporter commented 9 years ago
Okay, renaming and filing internally.

Original comment by pamela.fox on 12 Oct 2009 at 2:49

GoogleCodeExporter commented 9 years ago
The second case is creating menues to select annotations from predefined set, 
just like menues for "headings", "font size", "font face" and "alignment".
<extension
    name="Issuy"
    description="Marks text with various issue-like status">
  <menuHook location="toolbar" iconUrl="blabla.png" text="mark text like issue">
    <annotateSelection key="issue_status">
    <values>
     <value val="NeedsMoreInfo">discuss me!</value>
     <value val="Acknowledged">gone into mind</value>
    </values>
    </annotateSelection>
  </menuHook>
</extension>

This is probably another issue.

Original comment by qwigly...@gmail.com on 12 Oct 2009 at 3:14

GoogleCodeExporter commented 9 years ago
I'd like the robot to be notified of which menu item was selected, so that you 
can 
supply short menu items that result in much larger replacements. 

Original comment by spdenne on 14 Oct 2009 at 8:52

GoogleCodeExporter commented 9 years ago
@ spdenne
this is what second usecase is for - setting annotation without changing text.
in either case it should trigger DOCUMENT_CHANGED.
maybe event type like DOCUMENT_ANNOTATED will make sence

Original comment by qwigly...@gmail.com on 14 Oct 2009 at 10:23

GoogleCodeExporter commented 9 years ago
hm. extension installer guide says, that a hook can contain "one or more 
actions".
will it produce a menu if to put several annotateSelection actions there ?

Original comment by qwigly...@gmail.com on 14 Oct 2009 at 10:39

GoogleCodeExporter commented 9 years ago
My preference would be to receive FORM_BUTTON_CLICKED

Original comment by spdenne on 14 Oct 2009 at 10:41

GoogleCodeExporter commented 9 years ago
Are there some news about the topic?

I've noticed that Spelly changed annotations format.
Now it puts them as <?a spell="sp+3RukcbZkIu"?>
this is reference to node in xml document with suggestions, stored in the same 
wavelet in hidden blip (how?):
<doc>
<spell author="qmax@wavesandbox.com" id="sp+3RukcbZkIu" language="ru" 
state="sugg">
<sugg conf="0.0" score="32.26" type="suggest" word="нет"></sugg>
<sugg conf="0.0" score="30.53" type="original" word="аннет"></sugg>
</spell>
</doc>

Can we cheat the same way as Spelly to produce the same result?

Original comment by qwigly...@gmail.com on 3 Nov 2009 at 6:11

GoogleCodeExporter commented 9 years ago
I don't believe that it will work for anything other than the spell 
annotations, but 
you are welcome to try.
(And no, no official news on this topic. We will update when there is.)

Original comment by pamela.fox on 4 Nov 2009 at 12:05

GoogleCodeExporter commented 9 years ago
yep. fail.
blips other then text (ids b+...) seem to be unmodifiable
and there's no way to create custom xml anyway.

Original comment by qwigly...@gmail.com on 4 Nov 2009 at 1:33

GoogleCodeExporter commented 9 years ago
I want this so much for my Acronym Decoder robot. It has thousands of potential 
acronyms, many which have multiple meanings. The availability of the dropdown 
would 
allow me to handle multiple-case scenarios much more gracefully than I do 
currently.

Original comment by wonderso...@gmail.com on 30 Nov 2009 at 7:00