request from a url, please not the cors.
This commit is contained in:
1 parent
7091cc92c9
commit
2d5f7ac7b6
2 files changed
+15
-13
No files matched your search
+1
-1
@@ -9,7 +9,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- <input type="text" id="ics_file"> -->
|
||||
<input type="text" id="ics_file">
|
||||
<input type="button" value="hi" id="ics_run">
|
||||
<div id="calendar"></div>
|
||||
</body>
|
||||
|
||||
+14
-12
@@ -2,24 +2,26 @@ import { Calendar } from "@fullcalendar/core";
|
||||
import iCalendarPlugin from "@fullcalendar/icalendar";
|
||||
import listPlugin from "@fullcalendar/list";
|
||||
|
||||
// const text_field = document.getElementById("ics_file");
|
||||
const text_field = document.getElementById("ics_file");
|
||||
|
||||
const confirm_button = document.getElementById("ics_run");
|
||||
|
||||
const cal = document.getElementById("calendar");
|
||||
|
||||
const on_click = (e) => {
|
||||
console.log("nawgh", e);
|
||||
const calendar = new Calendar(cal, {
|
||||
plugins: [listPlugin, iCalendarPlugin],
|
||||
initialView: "listWeek",
|
||||
events: {
|
||||
url: "/public/basic.ics",
|
||||
format: "ics",
|
||||
},
|
||||
});
|
||||
const on_click = (_e) => {
|
||||
console.log("nawgh:", text_field.value);
|
||||
if (text_field.value) {
|
||||
const calendar = new Calendar(cal, {
|
||||
plugins: [listPlugin, iCalendarPlugin],
|
||||
initialView: "listWeek",
|
||||
events: {
|
||||
url: text_field.value,
|
||||
format: "ics",
|
||||
},
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
calendar.render();
|
||||
}
|
||||
};
|
||||
|
||||
confirm_button.addEventListener("click", on_click);
|
||||
Reference in new issue
Block a user