That would still require me to do some code in every page they want to use jquery stuff in. But what do you think of the possibility of the JQuery headercontributor to "scan" the <wicket:head> section using a regexp or something, and not add jquery if the regexp matches? Can I get to the <wicket:head> stuff from a header-contributor?

Somewhere along the lines of this, in JQueryBehaviour:

    public static final Pattern JQUERY_REGEXP = 
Pattern.compile("<script.*?src=\".*jquery.*\\.js>");


    public void renderHead(IHeaderResponse response) {
            super.renderHead(response);
            
if(!JQUERY_REGEXP.matcher(response.getResponse().toString()).matches()) {
                    response.renderJavascriptReference(JQUERY_JS);
                    if 
(Application.DEVELOPMENT.equals(Application.get().getConfigurationType())) {
                        response.renderJavascriptReference(JQUERY_DEBUG_JS);
                    }
            }
    }

.. or am I on the wrong track? :)

-- Edvin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to