notify.jspx
2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<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">
<jsp:directive.page import="javax.faces.application.FacesMessage"/>
<h:scripts>/org/richfaces/renderkit/html/scripts/jquery-1.4.2.js,
/org/richfaces/renderkit/html/scripts/jquery.pnotify.js</h:scripts>
<h:styles>/org/richfaces/renderkit/html/css/jquery.pnotify.xcss</h:styles>
<f:clientid var="clientId"/>
<div id="#{clientId}">
<jsp:scriptlet>
<![CDATA[
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());
]]>
</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>