-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring/1090 upgrade jscookie webjars (#1091)
* wicket-bootstrap#1090 Upgraded JS Cookie library from 1.3.1 to 3.0.5 * wicket-bootstrap#1090 Removed jquery.cookie.js (cherry picked from commit 22d2334) Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
- Loading branch information
1 parent
e5a8df3
commit a1f5ed2
Showing
3 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 29 additions & 3 deletions
32
...ilecoders/wicket/extensions/markup/html/bootstrap/references/JQueryCookieJsReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,41 @@ | ||
package de.agilecoders.wicket.extensions.markup.html.bootstrap.references; | ||
|
||
import org.apache.wicket.resource.JQueryPluginResourceReference; | ||
import de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference; | ||
import org.apache.wicket.Application; | ||
import org.apache.wicket.markup.head.HeaderItem; | ||
import org.apache.wicket.markup.head.JavaScriptHeaderItem; | ||
import org.apache.wicket.request.resource.ResourceReference; | ||
import org.apache.wicket.resource.JQueryResourceReference; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A JavaScript resource reference that contributes the jquery.cookie.js. | ||
*/ | ||
public class JQueryCookieJsReference extends JQueryPluginResourceReference { | ||
public class JQueryCookieJsReference extends WebjarsJavaScriptResourceReference { | ||
|
||
public static final JQueryCookieJsReference INSTANCE = new JQueryCookieJsReference(); | ||
|
||
public JQueryCookieJsReference() { | ||
super(JQueryCookieJsReference.class, "js/jquery.cookie.js"); | ||
super("js-cookie/current/dist/js.cookie.min.js"); | ||
} | ||
|
||
@Override | ||
public List<HeaderItem> getDependencies() | ||
{ | ||
final ResourceReference backingLibraryReference; | ||
if (Application.exists()) | ||
{ | ||
backingLibraryReference = Application.get() | ||
.getJavaScriptLibrarySettings() | ||
.getJQueryReference(); | ||
} | ||
else | ||
{ | ||
backingLibraryReference = JQueryResourceReference.getV3(); | ||
} | ||
List<HeaderItem> dependencies = super.getDependencies(); | ||
dependencies.add(JavaScriptHeaderItem.forReference(backingLibraryReference)); | ||
return dependencies; | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
...ava/de/agilecoders/wicket/extensions/markup/html/bootstrap/references/js/jquery.cookie.js
This file was deleted.
Oops, something went wrong.