fork download
  1. var WebNotifications = {
  2. _getPermission: function() {
  3. if (!Notification || Notification.permission === 'denied') {
  4. return false;
  5. } else if (Notification.permission === 'granted') {
  6. return true;
  7. } else {
  8. Notification.requestPermission(function (status) {
  9. if (Notification.permission !== status) {
  10. Notification.permission = status;
  11. }
  12. });
  13. if (Notification.permission === 'granted') {
  14. return true;
  15. }
  16. return false;
  17. }
  18. },
  19.  
  20. notify: function(msg) {
  21. if (this._getPermission()) {
  22. var n = new Notification("gray", { tag: "gray", body: msg });
  23. } else {
  24. alert(msg);
  25. }
  26. }
  27. };
  28.  
  29. // ここからマークと通知処理の抜粋
  30. // 自レス番号の配列作成
  31. var numbers = [];
  32. myIDs.forEach(function(id){
  33. var idnums = idData[id];
  34. if (idnums) numbers = numbers.concat(idnums);
  35. });
  36. numbers = uniqueArray(numbers.concat(myPosts));
  37.  
  38. var repCount = 0;
  39. numbers.forEach(function(resNumber){
  40. // 自レスをマーク
  41. resArray[resNumber].classList.add('my-post');
  42.  
  43. var repnums = tbData[resNumber];
  44. if (repnums) repnums.forEach(function(reply){
  45. // 返信レスの処理
  46. resArray[reply].classList.add('reply-to-me');
  47. if (resArray[reply].getAttribute("new")) {
  48. repCount++;
  49. }
  50. });
  51. });
  52.  
  53. // 返信通知
  54. if (Pref.MyAndRepNotifyReply && (repCount > 0)) {
  55. var msg = message("myandrep_notify_new_reply") + " ( " + repCount + " res )";
  56. WebNotifications.notify(msg);
  57. }
  58. // ここまで
Runtime error #stdin #stdout #stderr 0.49s 322432KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: uncaught JavaScript runtime exception: ReferenceError: "myIDs" is not defined.