use of org.apache.wicket.request.resource.JavaScriptResourceReference in project hale by halestudio.
the class OpenIdSelectorJsReference method getDependencies.
@Override
public Iterable<? extends HeaderItem> getDependencies() {
List<HeaderItem> deps = new ArrayList<HeaderItem>();
for (HeaderItem dep : super.getDependencies()) {
deps.add(dep);
}
deps.add(CssHeaderItem.forReference(OpenIdSelectorCssReference.INSTANCE));
deps.add(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OpenIdSelectorJsReference.class, "js/openid-jquery.js")));
return deps;
}
use of org.apache.wicket.request.resource.JavaScriptResourceReference in project openmeetings by apache.
the class Chat method renderHead.
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(Chat.class, "chat.js"))));
response.render(new PriorityHeaderItem(getNamedFunction("chatActivity", chatActivity, explicit(PARAM_TYPE), explicit(PARAM_ROOM_ID), explicit(PARAM_MSG_ID))));
if (showDashboardChat) {
StringBuilder sb = new StringBuilder(getReinit());
List<ChatMessage> list = new ArrayList<>(chatDao.getGlobal(0, 30));
for (Long roomId : cm.listRoomIds(getUserId())) {
Room r = roomDao.get(roomId);
sb.append(addRoom(r));
}
list.addAll(chatDao.getUserRecent(getUserId(), Date.from(Instant.now().minus(Duration.ofHours(1L))), 0, 30));
if (!list.isEmpty()) {
sb.append("Chat.addMessage(").append(getMessage(list).toString()).append(");");
}
response.render(OnDomReadyHeaderItem.forScript(sb.toString()));
}
}
Aggregations