本文整理匯總了Java中org.apache.wicket.markup.head.IHeaderResponse類的典型用法代碼示例。如果您正苦於以下問題:Java IHeaderResponse類的具體用法?Java IHeaderResponse怎麽用?Java IHeaderResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IHeaderResponse類屬於org.apache.wicket.markup.head包,在下文中一共展示了IHeaderResponse類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
String encodedAttachmentSupport;
if (getAttachmentSupport() != null) {
encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtils.serialize(getAttachmentSupport()));
encodedAttachmentSupport = StringUtils.deleteWhitespace(encodedAttachmentSupport);
encodedAttachmentSupport = StringEscapeUtils.escapeEcmaScript(encodedAttachmentSupport);
encodedAttachmentSupport = "'" + encodedAttachmentSupport + "'";
} else {
encodedAttachmentSupport = "undefined";
}
String callback = ajaxBehavior.getCallbackFunction(explicit("action"), explicit("param1"), explicit("param2"),
explicit("param3")).toString();
String autosaveKey = getAutosaveKey();
if (autosaveKey != null)
autosaveKey = "'" + JavaScriptEscape.escapeJavaScript(autosaveKey) + "'";
else
autosaveKey = "undefined";
String script = String.format("gitplex.server.markdown.onDomReady('%s', %s, %d, %s, %d, %b, %b, %s);",
container.getMarkupId(),
callback,
ATWHO_LIMIT,
encodedAttachmentSupport,
getAttachmentSupport()!=null?getAttachmentSupport().getAttachmentMaxSize():0,
getUserMentionSupport() != null,
getPullRequestReferenceSupport() != null,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.markdown.onWindowLoad('%s');", container.getMarkupId());
response.render(OnLoadHeaderItem.forScript(script));
}
示例2: renderInitializationScript
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
protected void renderInitializationScript(IHeaderResponse response) {
T value;
if (getWebRequest().getRequestParameters().getParameterNames().contains(getInputName())) {
convertInput();
value = getConvertedInput();
} else {
value = getModelObject();
}
if (value != null) {
JsonBuilder selection = new JsonBuilder();
try {
selection.object();
getProvider().toJson(value, selection);
selection.endObject();
} catch (JSONException e) {
throw new RuntimeException("Error converting model object to Json", e);
}
response.render(OnDomReadyHeaderItem.forScript(
JQuery.execute("$('#%s').select2('data', %s);", getJquerySafeMarkupId(), selection.toJson())));
}
}
示例3: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new SourceEditResourceReference()));
String autosaveKey = JavaScriptEscape.escapeJavaScript(context.getAutosaveKey());
String jsonOfMark = context.getMark()!=null?getJson(context.getMark()):"undefined";
String script = String.format("gitplex.server.sourceEdit.onDomReady('%s', '%s', %s, '%s', %s, '%s', %b, '%s');",
sourceFormComponent.getMarkupId(),
JavaScriptEscape.escapeJavaScript(context.getNewPath()),
jsonOfMark,
sourceFormat.getIndentType(),
sourceFormat.getTabSize(),
sourceFormat.getLineWrapMode(),
context.getMode() == Mode.EDIT,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.sourceEdit.onWindowLoad('%s', %s, '%s');",
sourceFormComponent.getMarkupId(), jsonOfMark, autosaveKey);
response.render(OnLoadHeaderItem.forScript(script));
}
示例4: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = "Wicket.Event.subscribe(\"/websocket/message\", function(jqEvent, message) {\n"
+ " message = JSON.parse(message);\n"
+ " if (message.type == 'step') updateStep(message); else { Karate.Ajax.DebugWindow.logInfo(message.text); }\n"
+ "});\n"
+ "function updateStep(message){ var btn = jQuery('#' + message.buttonId); btn.addClass('btn-success'); }";
response.render(JavaScriptHeaderItem.forScript(script, "karate-ws-js"));
response.render(JavaScriptHeaderItem.forReference(KarateJsResourceReference.INSTANCE));
}
示例5: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
String script = String.format("gitplex.server.setupCollapse('%s', '%s')", component.getMarkupId(), target.getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例6: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// we delay show feedback with a timer as some other script may scroll the window
response.render(OnDomReadyHeaderItem.forScript("setTimeout('gitplex.server.showSessionFeedback();', 1);"));
}
示例7: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(JavaScriptReferenceHeaderItem.forReference(new InfiniteScrollResourceReference()));
CharSequence url = RequestCycle.get().urlFor(new PackageResourceReference(
InfiniteScrollBehavior.class, "ajax-indicator.gif"), new PageParameters());
String script = String.format("gitplex.infiniteScroll.init('%s', %s, '%s', %s);",
component.getMarkupId(true), getCallbackFunction(explicit("page")), url, pageSize);
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例8: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(JavaScriptHeaderItem.forReference(new InputAssistResourceReference()));
String script = String.format("gitplex.server.inputassist.init('%s', %s);",
getComponent().getMarkupId(true),
getCallbackFunction(explicit("type"), explicit("input"), explicit("caret")));
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例9: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
response.render(JavaScriptReferenceHeaderItem.forReference(new DragDropResourceReference()));
String script = String.format("gitplex.server.dragdrop.setupDroppable('#%s', %s, %s);",
component.getMarkupId(), getAccept(), getCallbackFunction(explicit("dragData")));
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例10: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
String script = String.format("gitplex.server.autoHeight('#%s', %d);",
component.getMarkupId(), bottomOffset);
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例11: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(JavaScriptHeaderItem.forReference(new CopyClipboardResourceReference()));
String script = String.format("gitplex.server.copyclipboard.init('%s', '%s');",
component.getMarkupId(true), JavaScriptEscape.escapeJavaScript(textModel.getObject()));
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例12: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(Component component, IHeaderResponse response) {
for (IAjaxCallListener listener: listeners) {
if (listener instanceof IComponentAwareHeaderContributor) {
IComponentAwareHeaderContributor headerContributor = (IComponentAwareHeaderContributor) listener;
headerContributor.renderHead(component, response);
}
}
}
示例13: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
CharSequence callback = behavior.getCallbackFunction(
explicit(SourcePositionTrackExtension.DATA_START_ATTRIBUTE),
explicit(TASK_CHECKED));
String script = String.format("gitplex.server.markdown.onViewerDomReady('%s', %s, '%s');",
getMarkupId(),
contentVersionSupport!=null?callback:"undefined",
SourcePositionTrackExtension.DATA_START_ATTRIBUTE);
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例14: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptReferenceHeaderItem.forReference(new SourceFormatResourceReference()));
String script = String.format("gitplex.server.sourceFormat.init('%s');", getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例15: renderHead
import org.apache.wicket.markup.head.IHeaderResponse; //導入依賴的package包/類
@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));
}