Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1011448 // jsNotification [OLD]

JavaX fragment (include)

static S jsNotification(S title, S text) {
  ret hjavascript([[
    if (!window.Notification) alert("Notifications not available");
    else {
      alert("Permission: " + Notification.permission);
      if (Notification.permission !== "denied")
        Notification.requestPermission(function(status) {
          var n = new Notification("TITLE", { 
            body: "TEXT"
          }); 
        });
    }
  ]].replace([["TITLE"]], jsQuote(title)).replace([["TEXT"]], jsQuote(text)));
}

Author comment

Began life as a copy of #1008991

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1011448
Snippet name: jsNotification [OLD]
Eternal ID of this version: #1011448/4
Text MD5: 1e3ff2f3899ae73e74944c83e9543f7a
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-26 16:17:03
Source code size: 502 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 448 / 461
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)