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 | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:h5="http://java.sun.com/jsf/composite/html5"> <h:head> <meta charset="UTF-8" /> <title>#{msgs.windowTitle}</title> </h:head> <h:body style="background: #fefeef"> <h3>#{msgs.heading}</h3> <h5:canvas id="paintingCanvas" width="300px" height="300px" penColor="#7F7" lineWidth="7"> #{msgs.canvasUnsupported} </h5:canvas> <h5:canvas id="secondPaintingCanvas" width="300px" height="300px" style="border: thick solid red"> #{msgs.canvasUnsupported} </h5:canvas> <h5:canvas id="smileyCanvas" library="application" script="smiley.js" width="300px" height="300px" style="border: thin solid red"> #{msgs.canvasUnsupported} </h5:canvas> </h:body> </html> |
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 | <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="id"/> <composite:attribute name="width"/> <composite:attribute name="height"/> <composite:attribute name="library" default="html5"/> <composite:attribute name="script" default="canvasDefault.js"/> <composite:attribute name="style" default="border: thin solid blue"/> <composite:attribute name="penColor" default="#7777FF"/> <composite:attribute name="lineWidth" default="2"/> </composite:interface> <composite:implementation> <canvas id="#{cc.id}" width="#{cc.attrs.width}" height="#{cc.attrs.height}" style="#{cc.attrs.style}"> <composite:insertChildren/> </canvas> <hutputScript library="#{cc.attrs.library}" name="#{cc.attrs.script}"/> <script> #{cc.attrs.script}.init('#{cc.id}', '#{cc.attrs.penColor}', '#{cc.attrs.lineWidth}') </script> </composite:implementation> </html> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |