Search in sources :

Example 11 with JavaScriptResourceReference

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;
}
Also used : JavaScriptResourceReference(org.apache.wicket.request.resource.JavaScriptResourceReference) ArrayList(java.util.ArrayList) HeaderItem(org.apache.wicket.markup.head.HeaderItem) CssHeaderItem(org.apache.wicket.markup.head.CssHeaderItem) JavaScriptHeaderItem(org.apache.wicket.markup.head.JavaScriptHeaderItem)

Example 12 with JavaScriptResourceReference

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()));
    }
}
Also used : PriorityHeaderItem(org.apache.wicket.markup.head.PriorityHeaderItem) ChatMessage(org.apache.openmeetings.db.entity.basic.ChatMessage) JavaScriptResourceReference(org.apache.wicket.request.resource.JavaScriptResourceReference) ArrayList(java.util.ArrayList) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

JavaScriptResourceReference (org.apache.wicket.request.resource.JavaScriptResourceReference)12 PriorityHeaderItem (org.apache.wicket.markup.head.PriorityHeaderItem)6 ArrayList (java.util.ArrayList)3 HeaderItem (org.apache.wicket.markup.head.HeaderItem)2 JavaScriptHeaderItem (org.apache.wicket.markup.head.JavaScriptHeaderItem)2 JQueryPluginResourceReference (org.apache.wicket.resource.JQueryPluginResourceReference)2 Chart (br.com.digilabs.jqplot.Chart)1 BarChart (br.com.digilabs.jqplot.chart.BarChart)1 PieChart (br.com.digilabs.jqplot.chart.PieChart)1 Highlighter (br.com.digilabs.jqplot.elements.Highlighter)1 ChatMessage (org.apache.openmeetings.db.entity.basic.ChatMessage)1 Room (org.apache.openmeetings.db.entity.room.Room)1 DefaultJavaScriptCompressor (org.apache.wicket.javascript.DefaultJavaScriptCompressor)1 IJavaScriptCompressor (org.apache.wicket.javascript.IJavaScriptCompressor)1 CssHeaderItem (org.apache.wicket.markup.head.CssHeaderItem)1 JavaScriptReferenceHeaderItem (org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem)1 FilteredHeaderItem (org.apache.wicket.markup.head.filter.FilteredHeaderItem)1 MockApplication (org.apache.wicket.mock.MockApplication)1 CssResourceReference (org.apache.wicket.request.resource.CssResourceReference)1