Remove formalize behavior, remove all styling stuff from BasePage and move it to brand provider.

git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1239538 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/BasePage.java b/core/src/main/java/org/apache/karaf/webconsole/core/BasePage.java
index 0354e85..ebf828c 100644
--- a/core/src/main/java/org/apache/karaf/webconsole/core/BasePage.java
+++ b/core/src/main/java/org/apache/karaf/webconsole/core/BasePage.java
@@ -24,7 +24,6 @@
 import org.apache.karaf.webconsole.core.dashboard.DashboardPage;
 import org.apache.karaf.webconsole.core.internal.LanguagePanel;
 import org.apache.wicket.behavior.IBehavior;
-import org.apache.wicket.markup.html.CSSPackageResource;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
@@ -47,12 +46,8 @@
     // list of supported Locales - should be replaced by resolver/detector or something similar
     private IModel<List<Locale>> supportedLocales = new ListModel<Locale>(Arrays.asList(Locale.FRENCH, Locale.ENGLISH));
 
-    @SuppressWarnings("serial")
     public BasePage() {
-        add(CSSPackageResource.getHeaderContribution(BasePage.class, "style.css"));
-        add(CSSPackageResource.getHeaderContribution(BasePage.class, "grid.css"));
-
-        Link homeLink = new BookmarkablePageLink("homeLink", DashboardPage.class);
+        Link<DashboardPage> homeLink = new BookmarkablePageLink<DashboardPage>("homeLink", DashboardPage.class);
         homeLink.add(brandProvider.getHeaderImage("logo"));
         add(homeLink);
 
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/behavior/FormalizeBehavior.java b/core/src/main/java/org/apache/karaf/webconsole/core/behavior/FormalizeBehavior.java
deleted file mode 100644
index 7d54384..0000000
--- a/core/src/main/java/org/apache/karaf/webconsole/core/behavior/FormalizeBehavior.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.apache.karaf.webconsole.core.behavior;
-
-import org.apache.wicket.markup.html.CSSPackageResource;
-import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.JavascriptPackageResource;
-
-public class FormalizeBehavior extends CompositeHeaderContributor {
-
-    public FormalizeBehavior() {
-        super(new JQueryBehavior());
-    }
-
-    @Override
-    protected IHeaderContributor[] getOwnHeaderContributors() {
-        return new IHeaderContributor[] {
-            CSSPackageResource.getHeaderContribution(FormalizeBehavior.class, "formalize/formalize.css"),
-            // formalize don't have releases, so we need to use git hash
-            JavascriptPackageResource.getHeaderContribution(FormalizeBehavior.class, "formalize/jquery.formalize-b9528e8.min.js"),
-        };
-    }
-
-}
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java b/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
index 96cc71c..9b7c670 100644
--- a/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
+++ b/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
@@ -21,11 +21,11 @@
 import java.util.List;
 
 import org.apache.karaf.webconsole.core.BasePage;
-import org.apache.karaf.webconsole.core.behavior.FormalizeBehavior;
 import org.apache.wicket.Page;
 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.behavior.IBehavior;
 import org.apache.wicket.behavior.SimpleAttributeModifier;
+import org.apache.wicket.markup.html.CSSPackageResource;
 import org.apache.wicket.markup.html.image.Image;
 
 public class DefaultBrandProvider implements BrandProvider, Serializable /* for tests mainly */ {
@@ -44,7 +44,8 @@
     }
 
     public void modify(Page page) {
-        page.add(new FormalizeBehavior());
+        page.add(CSSPackageResource.getHeaderContribution(BasePage.class, "style.css"));
+        page.add(CSSPackageResource.getHeaderContribution(BasePage.class, "grid.css"));
     }
 
 }
diff --git a/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/formalize.css b/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/formalize.css
deleted file mode 100644
index 2abfe35..0000000
--- a/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/formalize.css
+++ /dev/null
@@ -1,374 +0,0 @@
-.input_tiny {
-  width: 50px;
-}
-
-.input_small {
-  width: 100px;
-}
-
-.input_medium {
-  width: 150px;
-}
-
-.input_large {
-  width: 200px;
-}
-
-.input_xlarge {
-  width: 250px;
-}
-
-.input_xxlarge {
-  width: 300px;
-}
-
-.input_full {
-  width: 100%;
-}
-
-.input_full_wrap {
-  display: block;
-  padding-right: 8px;
-}
-
-::-moz-focus-inner {
-  border: 0;
-  padding: 0;
-}
-
-input[type="search"]::-webkit-search-decoration {
-  display: none;
-}
-
-input[type="radio"],
-input[type="checkbox"] {
-  position: relative;
-  vertical-align: top;
-  top: 3px;
-  top: 0 \0;
-  *top: -3px;
-}
-
-@media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 1024px) {
-  input[type="radio"],
-  input[type="checkbox"] {
-    vertical-align: baseline;
-    top: 2px;
-  }
-}
-@media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 480px) {
-  input[type="radio"],
-  input[type="checkbox"] {
-    vertical-align: baseline;
-    top: 0;
-  }
-}
-@media (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 480px) {
-  input[type="radio"],
-  input[type="checkbox"] {
-    vertical-align: baseline;
-    top: 0;
-  }
-}
-input,
-button,
-select,
-textarea {
-  margin: 0;
-  vertical-align: middle;
-}
-
-button:focus,
-input:focus,
-select:focus,
-textarea:focus {
-  -webkit-box-shadow: #0066ff 0 0 7px 0;
-  -moz-box-shadow: #0066ff 0 0 7px 0;
-  -o-box-shadow: #0066ff 0 0 7px 0;
-  box-shadow: #0066ff 0 0 7px 0;
-  z-index: 1;
-}
-
-input[type="file"]:focus, input[type="file"]:active,
-input[type="radio"]:focus,
-input[type="radio"]:active,
-input[type="checkbox"]:focus,
-input[type="checkbox"]:active {
-  -webkit-box-shadow: none;
-  -moz-box-shadow: none;
-  -o-box-shadow: none;
-  box-shadow: none;
-}
-
-button,
-input[type="reset"],
-input[type="submit"],
-input[type="button"] {
-  -webkit-appearance: none;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  -ms-border-radius: 4px;
-  -o-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-background-clip: padding;
-  -moz-background-clip: padding;
-  -ms-background-clip: padding-box;
-  -o-background-clip: padding-box;
-  background-clip: padding-box;
-  background: #dddddd url('../images/button.png?1298351022') repeat-x;
-  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #dddddd));
-  background-image: -webkit-linear-gradient(#ffffff, #dddddd);
-  background-image: -moz-linear-gradient(#ffffff, #dddddd);
-  background-image: -o-linear-gradient(#ffffff, #dddddd);
-  background-image: -ms-linear-gradient(#ffffff, #dddddd);
-  background-image: linear-gradient(#ffffff, #dddddd);
-  border: 1px solid;
-  border-color: #dddddd #bbbbbb #999999;
-  cursor: pointer;
-  color: #333333;
-  font: bold 12px/1.3 "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
-  outline: 0;
-  overflow: visible;
-  padding: 3px 10px;
-  text-shadow: white 0 1px 1px;
-  width: auto;
-  *padding-top: 2px;
-  *padding-bottom: 0;
-}
-button:hover,
-input[type="reset"]:hover,
-input[type="submit"]:hover,
-input[type="button"]:hover {
-  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #eeeeee), color-stop(100%, #cccccc));
-  background-image: -webkit-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
-  background-image: -moz-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
-  background-image: -o-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
-  background-image: -ms-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
-  background-image: linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
-}
-button:active,
-input[type="reset"]:active,
-input[type="submit"]:active,
-input[type="button"]:active {
-  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #dddddd), color-stop(100%, #eeeeee));
-  background-image: -webkit-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
-  background-image: -moz-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
-  background-image: -o-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
-  background-image: -ms-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
-  background-image: linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
-  -webkit-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
-  -moz-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
-  -o-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
-  box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
-  border-color: #999999 #bbbbbb #dddddd;
-}
-
-button {
-  *padding-top: 1px;
-  *padding-bottom: 1px;
-}
-
-textarea,
-select,
-input[type="date"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="email"],
-input[type="month"],
-input[type="number"],
-input[type="password"],
-input[type="search"],
-input[type="tel"],
-input[type="text"],
-input[type="time"],
-input[type="url"],
-input[type="week"] {
-  -webkit-box-sizing: border-box;
-  -moz-box-sizing: border-box;
-  -ms-box-sizing: border-box;
-  box-sizing: border-box;
-  -webkit-background-clip: padding;
-  -moz-background-clip: padding;
-  -ms-background-clip: padding-box;
-  -o-background-clip: padding-box;
-  background-clip: padding-box;
-  -webkit-border-radius: 0;
-  -moz-border-radius: 0;
-  -ms-border-radius: 0;
-  -o-border-radius: 0;
-  border-radius: 0;
-  -webkit-appearance: none;
-  background-color: white;
-  border: 1px solid;
-  border-color: #848484 #c1c1c1 #e1e1e1;
-  color: black;
-  outline: 0;
-  padding: 2px 3px;
-  text-align: left;
-  font-size: 13px;
-  font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
-  height: 1.8em;
-  *padding-top: 2px;
-  *padding-bottom: 1px;
-  *height: auto;
-}
-textarea[disabled],
-select[disabled],
-input[type="date"][disabled],
-input[type="datetime"][disabled],
-input[type="datetime-local"][disabled],
-input[type="email"][disabled],
-input[type="month"][disabled],
-input[type="number"][disabled],
-input[type="password"][disabled],
-input[type="search"][disabled],
-input[type="tel"][disabled],
-input[type="text"][disabled],
-input[type="time"][disabled],
-input[type="url"][disabled],
-input[type="week"][disabled] {
-  background-color: #eeeeee;
-}
-
-button[disabled],
-input[disabled],
-select[disabled],
-select[disabled] option,
-select[disabled] optgroup,
-textarea[disabled] {
-  -webkit-box-shadow: none;
-  -moz-box-shadow: none;
-  -o-box-shadow: none;
-  box-shadow: none;
-  -moz-user-select: -moz-none;
-  -webkit-user-select: none;
-  -khtml-user-select: none;
-  user-select: none;
-  color: #888888;
-  cursor: default;
-}
-
-::-webkit-input-placeholder {
-  color: #888888;
-}
-
-input:-moz-placeholder,
-textarea:-moz-placeholder {
-  color: #888888;
-}
-
-input.placeholder_text,
-textarea.placeholder_text {
-  color: #888888;
-}
-
-:invalid {
-  -webkit-box-shadow: none;
-  -moz-box-shadow: none;
-  -o-box-shadow: none;
-  box-shadow: none;
-}
-
-textarea,
-select[size],
-select[multiple] {
-  height: auto;
-}
-
-@media (-webkit-min-device-pixel-ratio: 0) {
-  select[size],
-  select[multiple] {
-    background-image: none;
-    padding-right: 3px;
-  }
-
-  select,
-  select[size="0"],
-  select[size="1"] {
-    background-image: url('../images/select_arrow.gif?1298351050');
-    background-repeat: no-repeat;
-    background-position: right center;
-    padding-right: 20px;
-    height: 1.8em;
-  }
-
-  ::-webkit-validation-bubble-message {
-    -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
-    box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, black));
-    border: 1px solid;
-    border-color: #747474 #5e5e5e #4f4f4f;
-    color: white;
-    font: 13px/17px "Lucida Grande", Arial, "Liberation Sans", FreeSans, sans-serif;
-    overflow: hidden;
-    padding: 15px 15px 17px;
-    text-shadow: black 0 0 1px;
-    height: 16px;
-  }
-
-  ::-webkit-validation-bubble-arrow,
-  ::-webkit-validation-bubble-top-outer-arrow,
-  ::-webkit-validation-bubble-top-inner-arrow {
-    -webkit-box-shadow: none;
-    box-shadow: none;
-    background: #666666;
-    border: 0;
-  }
-}
-textarea {
-  min-height: 40px;
-  overflow: auto;
-  resize: vertical;
-  width: 100%;
-}
-
-optgroup {
-  color: black;
-  font-style: normal;
-  font-weight: normal;
-}
-
-.ie6_button,
-* html button {
-  background: #dddddd url('../images/button.png?1298351022') repeat-x;
-  border: 1px solid;
-  border-color: #dddddd #bbbbbb #999999;
-  cursor: pointer;
-  color: #333333;
-  font: bold 12px/1.2 Arial, sans-serif;
-  padding: 2px 10px 0px;
-  overflow: visible;
-  width: auto;
-}
-
-* html button {
-  padding-top: 1px;
-  padding-bottom: 1px;
-}
-
-.ie6_input,
-* html textarea,
-* html select {
-  background: white;
-  border: 1px solid;
-  border-color: #848484 #c1c1c1 #e1e1e1;
-  color: black;
-  padding: 2px 3px 1px;
-  font-size: 13px;
-  font-family: Arial, sans-serif;
-  vertical-align: top;
-}
-
-* html select {
-  margin-top: 1px;
-}
-
-.placeholder_text,
-.ie6_input_disabled,
-.ie6_button_disabled {
-  color: #888888;
-}
-
-.ie6_input_disabled {
-  background: #eeeeee;
-}
diff --git a/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/jquery.formalize-b9528e8.min.js b/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/jquery.formalize-b9528e8.min.js
deleted file mode 100644
index 55540ee..0000000
--- a/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/formalize/jquery.formalize-b9528e8.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var FORMALIZE=function(a,b,c){var d="placeholder"in c.createElement("input"),e="autofocus"in c.createElement("input"),f=!!a.browser.msie&&parseInt(a.browser.version,10)===6,g=!!a.browser.msie&&parseInt(a.browser.version,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){g&&a("textarea, input.input_full").length&&a("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(f&&a("input, select, textarea").length){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a("input").each(function(){var d=a(this);this.getAttribute("type").match(b)?(d.addClass("ie6_button"),this.disabled&&d.addClass("ie6_button_disabled")):this.getAttribute("type").match(c)&&(d.addClass("ie6_input"),this.disabled&&d.addClass("ie6_input_disabled"))}),a("textarea, select").each(function(){this.disabled&&a(this).addClass("ie6_input_disabled")})}},autofocus:function(){e||!a(":input[autofocus]").length||a(":input[autofocus]:visible:first").focus()},placeholder:function(){!d&&!!a(":input[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),a(":input[placeholder]").each(function(){if(this.type!=="password"){var b=a(this),c=b.attr("placeholder");b.focus(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),b.closest("form").submit(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).bind("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}}))}},misc:{add_placeholder:function(){d||!a(":input[placeholder]").length||a(":input[placeholder]").each(function(){if(this.type!=="password"){var b=a(this),c=b.attr("placeholder");(!b.val()||b.val()===c)&&b.val(c).addClass("placeholder_text")}})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()})
\ No newline at end of file