gotify-firefox

Send push notifications to your Gotify server from Firefox
git clone git://fossdaily.xyz/gotify-firefox
Log | Files | Refs | README | LICENSE

gotify.js (532B)


      1 "use strict";
      2 
      3 var gotify = {};
      4 gotify.currentPayload = {};
      5 
      6 gotify.log = function (message) {
      7   var line;
      8   if (message instanceof Object || message instanceof Array) {
      9     line = message;
     10   } else {
     11     line = new Date().toLocaleString() + " - " + message;
     12   }
     13 
     14   console.log(line);
     15 };
     16 
     17 gotify.buildMessageObject = function (title, message) {
     18   if (title === null || title === "") {
     19     return "message=" + message + "&priority=5";
     20   }
     21 
     22   return "title=" + title + "&message=" + message + "&priority=5";
     23 };