mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
split remaining utilities from shared
This commit is contained in:
9
common/script/libs/encodeiCalLink.js
Normal file
9
common/script/libs/encodeiCalLink.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
Encode the download link for .ics iCal file
|
||||
*/
|
||||
|
||||
module.exports = function(uid, apiToken) {
|
||||
var loc, ref;
|
||||
loc = (typeof window !== "undefined" && window !== null ? window.location.host : void 0) || (typeof process !== "undefined" && process !== null ? (ref = process.env) != null ? ref.BASE_URL : void 0 : void 0) || '';
|
||||
return encodeURIComponent("http://" + loc + "/v1/users/" + uid + "/calendar.ics?apiToken=" + apiToken);
|
||||
};
|
||||
Reference in New Issue
Block a user