Wicket
  1. Wicket
  2. WICKET-5208

Contribute jQuery 1.x or 2.x depending on the user agent

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 6.9.0, 7.0.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Wicket can use the ClientInfo to decide which version of jQuery do contribute - 2.0 works on all modern browsers (IE9+), while 1.x series still support IE 6/7/8.

      1. WICKET-5208.patch
        2 kB
        Martin Grigorov

        Activity

        Hide
        Martin Grigorov added a comment -

        Here is a possible solution.

        Show
        Martin Grigorov added a comment - Here is a possible solution.
        Hide
        Martin Grigorov added a comment -

        DynamicJQueryResourceReference is added.
        To use it do:

        MyApp#init()

        { ... getJavaScriptLibrarySettings().setJQueryReference(DynamicJQueryResourceReference.INSTANCE); ... }
        Show
        Martin Grigorov added a comment - DynamicJQueryResourceReference is added. To use it do: MyApp#init() { ... getJavaScriptLibrarySettings().setJQueryReference(DynamicJQueryResourceReference.INSTANCE); ... }
        Hide
        Martin Grigorov added a comment -

        To change the versions of jQuery use:

        public class CustomJQuery extends DynamicJQueryResourceReference
        {
        @Override
        protected String getVersion1()

        { return "jquery/jquery-1.11.0.min.js"; }

        @Override
        protected String getVersion2()

        { return "jquery/jquery-2.1.0.min.js"; }

        }

        getJavaScriptLibrarySettings().setJQueryReference(new CustomJQuery());

        Show
        Martin Grigorov added a comment - To change the versions of jQuery use: public class CustomJQuery extends DynamicJQueryResourceReference { @Override protected String getVersion1() { return "jquery/jquery-1.11.0.min.js"; } @Override protected String getVersion2() { return "jquery/jquery-2.1.0.min.js"; } } getJavaScriptLibrarySettings().setJQueryReference(new CustomJQuery());

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Martin Grigorov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development