James Moger
2013-11-26 4fcac9d2cbdafb51e3ee9ca3b3da64fd86103174
src/main/java/com/gitblit/wicket/panels/BasePanel.java
@@ -22,7 +22,6 @@
import org.apache.wicket.Component;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.apache.wicket.protocol.http.request.WebClientInfo;
import com.gitblit.Constants;
import com.gitblit.GitBlit;
@@ -34,7 +33,7 @@
public abstract class BasePanel extends Panel {
   private static final long serialVersionUID = 1L;
   private transient TimeUtils timeUtils;
   public BasePanel(String wicketId) {
@@ -45,31 +44,18 @@
      return GitBlit.getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
            .getTimezone() : GitBlit.getTimezone();
   }
   protected TimeUtils getTimeUtils() {
      if (timeUtils == null) {
         ResourceBundle bundle;
         ResourceBundle bundle;
         try {
            bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", GitBlitWebSession.get().getLocale());
         } catch (Throwable t) {
            bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp");
         }
         timeUtils = new TimeUtils(bundle);
         timeUtils = new TimeUtils(bundle, getTimeZone());
      }
      return timeUtils;
   }
   protected boolean isWindows() {
      return isPlatform("windows");
   }
   protected boolean isMac() {
      return isPlatform("macintosh");
   }
   protected boolean isPlatform(String platform) {
      String ua = ((WebClientInfo) GitBlitWebSession.get().getClientInfo()).getUserAgent();
      return ua.toLowerCase().contains(platform);
   }
   protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {
@@ -88,6 +74,7 @@
         super(event, true, new Model<String>(msg));
      }
      @Override
      protected String newValue(final String currentValue, final String replacementValue) {
         String prefix = "var conf = confirm('" + replacementValue + "'); "
               + "if (!conf) return false; ";
@@ -104,12 +91,13 @@
      private static final long serialVersionUID = 1L;
      private String initialValue = "";
      public JavascriptTextPrompt(String event, String msg, String value) {
         super(event, true, new Model<String>(msg));
         initialValue = value;
      }
      @Override
      protected String newValue(final String currentValue, final String message) {
         String result = "var userText = prompt('" + message + "','"
               + (initialValue == null ? "" : initialValue) + "'); " + "return userText; ";