| | |
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | | import org.apache.wicket.model.Model;
|
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.utils.JGitUtils.SearchType;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
|
| | |
| | |
|
| | | protected TimeZone getTimeZone() {
|
| | | return GitBlit.getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
|
| | | .getTimezone() : TimeZone.getDefault();
|
| | | .getTimezone() : GitBlit.getTimezone();
|
| | | }
|
| | |
|
| | | protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {
|
| | | if (searchType.equals(SearchType.AUTHOR)) {
|
| | | protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {
|
| | | if (searchType.equals(Constants.SearchType.AUTHOR)) {
|
| | | WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
|
| | | } else if (searchType.equals(SearchType.COMMITTER)) {
|
| | | } else if (searchType.equals(Constants.SearchType.COMMITTER)) {
|
| | | WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);
|
| | | }
|
| | | }
|
| | |
| | | return result;
|
| | | }
|
| | | }
|
| | |
|
| | | public static class JavascriptTextPrompt extends AttributeModifier {
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | protected String newValue(final String currentValue, final String message) {
|
| | | String result = "var userText = prompt('" + message + "','"
|
| | | + (initialValue == null ? "" : initialValue) + "'); " + "return userText; ";
|
| | | return result;
|
| | | }
|
| | | }
|
| | | }
|