notification.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <title>消息提醒</title>
  7. <script src="../../../js/jquery.js"></script>
  8. <style>
  9. body,html{padding:0px;margin:0px;font-size:14px}
  10. .close{height:20px;width:20px;display:block;text-align:center;line-height:18px;cursor:pointer;font-size:16px}
  11. .close:hover{background:#ff1118;color:white}
  12. table {
  13. border-spacing: 0;
  14. border-collapse: collapse;
  15. }
  16. </style>
  17. <script>
  18. $(document).ready(function(){
  19. winobj = nw.Window.get();
  20. winobj.moveTo(screen.width-355,screen.height-170);
  21. winobj.show();
  22. var nr = localStorage.getItem('xinhuoa_notification');
  23. if(nr){
  24. nr = unescape(nr);
  25. var da = JSON.parse(nr);
  26. var src = da.icon;
  27. if(src.substr(0,4)!='http')src='../../../'+src+'';
  28. $('#logodiv').attr('src', src);
  29. $('#titlediv').html(da.title);
  30. $('#messdiv').html(da.body);
  31. }
  32. });
  33. function winclose(){
  34. winobj.close(true);
  35. }
  36. function clickbody(){
  37. localStorage.setItem('xinhuoa_closelx', 'yes');
  38. winclose();
  39. }
  40. </script>
  41. </head>
  42. <body style="overflow:hidden;cursor:pointer" >
  43. <div style="position:absolute;right:2px;top:2px;-webkit-app-region:no-drag;z-index:5">
  44. <span onclick="winclose();" title="关闭" class="close">×</span>
  45. </div>
  46. <div style="height:10px"></div>
  47. <table border="0" style="margin:0px 8px" onclick="clickbody()">
  48. <tr valign="top">
  49. <td>
  50. <div style="width:80px;height:80px;overflow:hidden;margin:5px" align="center">
  51. <img src="../../../images/logo.png" id="logodiv" height="80px" width="80px">
  52. </div>
  53. </td>
  54. <td style="padding-left:5px">
  55. <div id="titlediv" style="font-size:16px;font-size:bold;line-height:20px;height:20px;overflow:hidden;margin-top:12px"></div>
  56. <div id="messdiv" style="font-size:14px;color:gray;line-height:20px;height:40px;overflow:hidden;margin-top:8px"></div>
  57. </td>
  58. </tr>
  59. </table>
  60. </body>
  61. </html>