Blame view

src/main/templates/notify.jspx 2.92 KB
bernard authored
1
<?xml version="1.0" encoding="UTF-8"?>
bernard authored
2 3 4 5 6 7 8 9 10 11
<f:root
        xmlns:f="http://jsf.exadel.com/template"
        xmlns:vcp=" http://jsf.exadel.com/vcp"
        xmlns:ui=" http://jsf.exadel.com/ui"
        xmlns:x=" http://jsf.exadel.com/vcp"
        xmlns:u="http://jsf.exadel.com/util"
        xmlns:h="http://jsf.exadel.com/header"
        component="org.richfaces.component.UINotify"
        baseclass="org.ajax4jsf.renderkit.HeaderResourcesRendererBase"
        class="org.richfaces.renderkit.html.NotifyRenderer">
bernard authored
12 13 14
    <jsp:directive.page import="javax.faces.application.FacesMessage"/>

    <h:scripts>/org/richfaces/renderkit/html/scripts/jquery-1.4.2.js,
bernard authored
15
        /org/richfaces/renderkit/html/scripts/jquery.pnotify.js</h:scripts>
bernard authored
16 17
    <h:styles>/org/richfaces/renderkit/html/css/jquery.pnotify.xcss</h:styles>
    <f:clientid var="clientId"/>
bernard authored
18
bernard authored
19 20 21
    <div id="#{clientId}">
        <jsp:scriptlet>
<![CDATA[
bernard authored
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
            variables.setVariable("details", component.getDetails());
            variables.setVariable("summary", component.getSummary());
            variables.setVariable("showHistory", component.isShowHistory());
            variables.setVariable("nonblocking", component.isNonblocking());
            variables.setVariable("shadow", component.isShowShadow());
            variables.setVariable("closeButton", component.isShowCloseButton());
            variables.setVariable("nonblockingOpacity", component.getNonblockingOpacity());
            variables.setVariable("appearAnimation", component.getAppearAnimation());
            variables.setVariable("hideAnimation", component.getHideAnimation());
            variables.setVariable("animationSpeed", component.getAnimationSpeed());
            variables.setVariable("stackDirVertical", component.getStackDirVertical());
            variables.setVariable("stackDirHorizontal", component.getStackDirHorizontal());
            variables.setVariable("stackPush", component.getStackPush());
            variables.setVariable("time", component.getStayTime() != null ? component.getStayTime() : 0);
            variables.setVariable("styleClass", component.getStyleClass() == null ? "" : component.getStyleClass());
bernard authored
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
]]>
        </jsp:scriptlet>
        <script type="text/javascript">
            jQuery.pnotify({
                pnotify_title: '#{summary}',
                pnotify_text :'#{details}',
                pnotify_addclass:'#{styleClass}',
                pnotify_hide:!#{sticky},
                pnotify_nonblock:#{nonblocking},
                pnotify_shadow:#{shadow},
                pnotify_closer:#{closeButton},
                pnotify_nonblock_opacity:#{nonblockingOpacity},
                pnotify_animation:{effect_in:'#{appearAnimation}',effect_out:'#{hideAnimation}'},
                pnotify_animate_speed:#{animationSpeed},
                pnotify_history:#{showHistory},
                pnotify_delay:#{time},
                pnotify_stack:#{stack}
            });
        </script>
    </div>
</f:root>