| | |
| | | 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.self().settings().getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();
|
| | | return GitBlit.getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
|
| | | .getTimezone() : TimeZone.getDefault();
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | | public class JavascriptEventConfirmation extends AttributeModifier {
|
| | | public static class JavascriptEventConfirmation extends AttributeModifier {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | protected String newValue(final String currentValue, final String replacementValue) {
|
| | | String prefix = "var conf = confirm('" + replacementValue + "'); " + "if (!conf) return false; ";
|
| | | String prefix = "var conf = confirm('" + replacementValue + "'); "
|
| | | + "if (!conf) return false; ";
|
| | | String result = prefix;
|
| | | if (currentValue != null) {
|
| | | result = prefix + currentValue;
|
| | |
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|