notification.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. $('#logodiv').attr('src', da.icon);
  27. $('#titlediv').html(da.title);
  28. $('#messdiv').html(da.body);
  29. }
  30. });
  31. function winclose(){
  32. winobj.close(true);
  33. }
  34. function clickbody(){
  35. localStorage.setItem('xinhuoa_closelx', 'yes');
  36. winclose();
  37. }
  38. </script>
  39. </head>
  40. <body style="overflow:hidden;cursor:pointer" >
  41. <div style="position:absolute;right:2px;top:2px;-webkit-app-region:no-drag;z-index:5">
  42. <span onclick="winclose();" title="关闭" class="close">×</span>
  43. </div>
  44. <div style="height:10px"></div>
  45. <table border="0" style="margin:0px 8px" onclick="clickbody()">
  46. <tr valign="top">
  47. <td>
  48. <div style="width:80px;height:80px;overflow:hidden;margin:5px" align="center">
  49. <img src="../../../images/logo.png" id="logodiv" height="80px" width="80px">
  50. </div>
  51. </td>
  52. <td style="padding-left:5px">
  53. <div id="titlediv" style="font-size:16px;font-size:bold;line-height:20px;height:20px;overflow:hidden;margin-top:12px"></div>
  54. <div id="messdiv" style="font-size:14px;color:gray;line-height:20px;height:40px;overflow:hidden;margin-top:8px"></div>
  55. </td>
  56. </tr>
  57. </table>
  58. </body>
  59. </html>