[annotator-dev] Module Upgrade Qs

Randall Leeds tilgovi at hypothes.is
Fri Jul 3 04:59:33 UTC 2015


a) Don't call the editor extension, just pass it like so:
`editorExtensions: [categories().editorExtension]`.

b) The options should be accessible since it's closed over in the editor
extension definition, if it was passed into the categories function.

c) `editorExtensions` is an Array. Just pass multiple: `editorExtensions:
[extensionA, extensionB, ...]`.

Sorry for the delay. I got behind on Annotator mailing list messages.

On Thu, May 21, 2015 at 5:30 AM steph <steph at endpoint.com> wrote:

>  Hi,
>
>
> On 05/20/2015 06:12 PM, Randall Leeds wrote:
>
>  Just wanted to say I intend to follow up on this if no one else does.
> I'm sorry it's been a busy week.
>
>  Have you tracked this down yourself yet?
>
>
> No, I haven't. I don't want to spin my wheels here if these are simple
> question/answers.
>
> Thanks,
>
> Steph
>
>
>
>
>
>
>
>
> On Mon, May 18, 2015 at 7:16 AM, steph <steph at endpoint.com> wrote:
>
>> Hi,
>>
>> After reviewing the docs and working on upgrading an extension a bit, I
>> have a few questions.
>>
>> Here are some notes:
>> * I have a module called categories, which allows users to categorize
>> annotations. I initiate the module with the new syntax:
>> app.include(categories, { categories: /* SOME HASH */ });
>> This works fine, and I can verify the categories options values are fine.
>>
>> * I also need to modify the editor based on the values in /* SOME HASH
>> */. I'm trying to connect the gap between
>> https://annotator.readthedocs.org/en/latest/module-development.html to
>> https://github.com/openannotation/annotator/blob/master/src/ui/tags.js,
>> so I gather the call to the UI should look something like this:
>> app.include(annotator.ui.main, {
>>     editorExtensions: [categories().editorExtension()]
>> });
>>
>> * My editorExtension method starts like this:
>> function categories(options) {
>>   ....
>>   return {
>>     editorExtension: function(e) {
>>       ...
>>
>> There are a few problems with this:
>> a) While I can verify editorExtension is called, "e" is not defined in
>> it, so the editor methods (e.g. addField are not accessible). Am I calling
>> the editorExtension incorrectly?
>>
>> b) The options hash is not accessible from the editorExtension method, as
>> far as I can tell. It's unclear to me if I am supposed to initiate the
>> categories module before I call the ui.main module, or if that doesn't
>> matter. I'd prefer to have one canonical reference to the categories that
>> I'm working with, that is contained within my module.
>>
>> c) How does one use multiple editor extensions? For example, my app will
>> at the very least an editorExtension for both the tag and categories
>> module. Is this possible? If not, is it going to be possible?
>>
>> It would be great to see the tags module updated included in the release,
>> as that's a good model for making editor and viewer changes. While I'm
>> trying to reference this, the module development documentation isn't
>> fleshed out enough to cover interaction with the UI. I know it's an alpha
>> release and I'm the one dealing with growing pains here, but hopefully what
>> I'm learning here can help others.
>>
>> Thanks in advance,
>>
>> Steph
>>
>>
>>
>>
>> _______________________________________________
>> annotator-dev mailing list
>> annotator-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/annotator-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>>
>
>
>  _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150703/d05eecf7/attachment-0003.html>


More information about the annotator-dev mailing list