You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pavel Chernyak <fj...@fjfalcon.ru> on 2016/04/18 14:34:36 UTC

RequireJS, waitSeconds interval.

Greetings.
Is there any option for requirejs waitSeconds that can be configured in
appmodule or somehow set globaly for whole project?

-- 
With best regards,
Pavel Chernyakч

Re: RequireJS, waitSeconds interval.

Posted by Pavel Chernyak <fj...@fjfalcon.ru>.
Thank you, Charles. It work as it should.

-- 
With best regards,
Pavel Chernyak

Re: RequireJS, waitSeconds interval.

Posted by Charlouze <me...@charlouze.com>.
Hello,

You need to contribute a MarkupRendererFilter to the MarkupRenderer service.

This is the filter :

public class RequireJsConfigurator implements MarkupRendererFilter {
    private final static ModuleConfigurationCallback CALLBACK = new
ModuleConfigurationCallback() {
        @Override
        public JSONObject configure(final JSONObject configuration)
            configuration.put("waitSeconds", 15);
            return configuration;
        }
    };

    private final Environment environment;

    public RequireJsConfigurator(final Environment environment) {
        this.environment = environment;
    }

    @Override
    public void renderMarkup(final MarkupWriter writer, final
MarkupRenderer renderer) {
        final DocumentLinker linker =
environment.peekRequired(DocumentLinker.class);

        linker.addModuleConfigurationCallback(CALLBACK);

        renderer.renderMarkup(writer);
    }
}

and this is to add to the AppModule :

public static void contributeMarkupRenderer(final
OrderedConfiguration<MarkupRendererFilter> configuration) {
    configuration.addInstance("RequireJsConfigurator",
RequireJsConfigurator.class,

OrderConstraintBuilder.after("DocumentLinker").build());
}

I hope it'll help you.

Regards,
Charles

Le lun. 18 avr. 2016 à 14:34, Pavel Chernyak <fj...@fjfalcon.ru> a
écrit :

> Greetings.
> Is there any option for requirejs waitSeconds that can be configured in
> appmodule or somehow set globaly for whole project?
>
> --
> With best regards,
> Pavel Chernyakч
>