Java Code Examples for org.apache.wicket.markup.head.IHeaderResponse#render()
The following examples show how to use
org.apache.wicket.markup.head.IHeaderResponse#render() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SourceLinesPage.java From onedev with MIT License | 6 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); Map<Day, Map<String, Integer>> lineIncrements = OneDev.getInstance(CommitInfoManager.class).getLineIncrements(getProject()); Map<Integer, Map<String, Integer>> data = new HashMap<>(); for (Map.Entry<Day, Map<String, Integer>> entry: lineIncrements.entrySet()) data.put(entry.getKey().getValue(), entry.getValue()); try { ObjectMapper mapper = OneDev.getInstance(ObjectMapper.class); String jsonOfData = mapper.writeValueAsString(data); String jsonOfDefaultBranch = mapper.writeValueAsString(getProject().getDefaultBranch()); String script = String.format("onedev.server.stats.sourceLines.onDomReady(%s, %s);", jsonOfData, jsonOfDefaultBranch); response.render(OnDomReadyHeaderItem.forScript(script)); } catch (JsonProcessingException e) { throw new RuntimeException(e); } }
Example 2
Source File: InfiniteScrollBehavior.java From onedev with MIT License | 6 votes |
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(JavaScriptReferenceHeaderItem.forReference(new InfiniteScrollResourceReference())); String itemSelector; if (getItemSelector() != null) itemSelector = "'"+JavaScriptEscape.escapeJavaScript(getItemSelector())+"'"; else itemSelector = "undefined"; // Run onload script as the container size might be adjusted in window resize event (which // happens before onload). An example is the issue board columns String script = String.format("onedev.server.infiniteScroll.onLoad('%s', %s, %s, %s);", component.getMarkupId(true), getCallbackFunction(explicit("offset"), explicit("count")), pageSize, itemSelector); response.render(OnLoadHeaderItem.forScript(script)); }
Example 3
Source File: CopyToClipboardLink.java From onedev with MIT License | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new CopyToClipboardResourceReference())); String script = String.format("onedev.server.copyToClipboard.onDomReady('%s', '%s');", getMarkupId(true), JavaScriptEscape.escapeJavaScript(textModel.getObject())); response.render(OnDomReadyHeaderItem.forScript(script)); }
Example 4
Source File: PlainEditPanel.java From onedev with MIT License | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new PlainEditResourceReference())); String script = String.format("onedev.server.plainEdit.onDomReady('%s', '%s');", getMarkupId(), fileName); response.render(OnDomReadyHeaderItem.forScript(script)); }
Example 5
Source File: DropdownLink.java From onedev with MIT License | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); String script = String.format("" + "$('#%s').on('click', function(e){" + " $(this).data('mouseX', e.pageX).data('mouseY', e.pageY);" + "});", getMarkupId()); response.render(OnDomReadyHeaderItem.forScript(script)); }
Example 6
Source File: AvatarUploadField.java From onedev with MIT License | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new AvatarUploadResourceReference())); String script = String.format("onedev.server.avatarUpload.onDomReady('%s', %s);", getMarkupId(), behavior.getCallbackFunction()); response.render(OnDomReadyHeaderItem.forScript(script)); }
Example 7
Source File: AssignmentListPanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new AssignmentListCssResourceReference())); }
Example 8
Source File: NewMilestonePage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new MilestonesResourceReference())); }
Example 9
Source File: ProjectTagsPage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new ProjectTagsResourceReference())); }
Example 10
Source File: NewUserPage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new UserCssResourceReference())); }
Example 11
Source File: RevisionSelector.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new RevisionSelectorResourceReference())); }
Example 12
Source File: FailsafeViewPanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new FailsafeResourceReference())); }
Example 13
Source File: ProjectPullRequestsPage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new ProjectPullRequestsCssResourceReference())); }
Example 14
Source File: GroupSingleChoice.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new GroupChoiceResourceReference())); }
Example 15
Source File: GeneralErrorPage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new ErrorPageResourceReference())); response.render(OnDomReadyHeaderItem.forScript("$('html,body').addClass('error');")); }
Example 16
Source File: ReferencedFromIssuePanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new TitleAndStatusCssResourceReference())); }
Example 17
Source File: ReferencedFromPullRequestPanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new TitleAndStatusCssResourceReference())); }
Example 18
Source File: ReviewListPanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new ReviewCssResourceReference())); }
Example 19
Source File: ProjectIssuesPage.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new ProjectIssuesCssResourceReference())); }
Example 20
Source File: SshKeyListPanel.java From onedev with MIT License | 4 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new SshKeyCssResourceReference())); }