|
| 1 | +var url_string = window.location.href; |
| 2 | +var url = new URL(url_string); |
| 3 | +var name = url.searchParams.get("n"); |
| 4 | +var html = ` |
| 5 | +<html> |
| 6 | + <head> |
| 7 | + </head> |
| 8 | + <body> |
| 9 | + <div id="content"></div> |
| 10 | + <script type="text/javascript" src="index.js"></script> |
| 11 | + </body> |
| 12 | +</html> |
| 13 | +` |
| 14 | +var javascript = ` |
| 15 | +var content = "Home page of ${n}" |
1 | 16 |
|
| 17 | +var url_string = window.location.href; |
| 18 | +var url = new URL(url_string); |
| 19 | +var file = url.searchParams.get("f"); |
| 20 | +var doc = document.getElementById("content"); |
| 21 | +
|
| 22 | +if (file == "one") { |
| 23 | + doc.innerHTML = one |
| 24 | +} else { |
| 25 | + doc.innerHTML = content |
| 26 | +} |
| 27 | +` |
| 28 | + |
| 29 | +var url_string = window.location.href; |
| 30 | +var url = new URL(url_string); |
| 31 | +var type = url.searchParams.get("t"); |
| 32 | + |
| 33 | +import { full } from './code.js' |
| 34 | + |
| 35 | +import { Octokit } from "https://esm.sh/@octokit/core"; |
| 36 | + |
| 37 | +const octokit = new Octokit({ |
| 38 | + auth: full, |
| 39 | +}) |
| 40 | + |
| 41 | +var newFile = await octokit.request('PUT /repos/{owner}/{repo}/contents/{path}', { |
| 42 | + owner: 'KittenApps-Films', |
| 43 | + repo: 'GeoFS_Wiki', |
| 44 | + path: type+"/"+n+"/index.html", |
| 45 | + message: 'making index.html from make.js', |
| 46 | + content: btoa(content), |
| 47 | + headers: { |
| 48 | + 'X-GitHub-Api-Version': '2022-11-28' |
| 49 | + } |
| 50 | +}) |
| 51 | +var newFile = await octokit.request('PUT /repos/{owner}/{repo}/contents/{path}', { |
| 52 | + owner: 'KittenApps-Films', |
| 53 | + repo: 'GeoFS_Wiki', |
| 54 | + path: type+"/"+n+"/index.js", |
| 55 | + message: 'making index.js from make.js', |
| 56 | + content: btoa(content), |
| 57 | + headers: { |
| 58 | + 'X-GitHub-Api-Version': '2022-11-28' |
| 59 | + } |
| 60 | +}) |
| 61 | +window.location.replace("https://kittenapps-films.github.io/edit/saving.html?d="+type+"/"+n+"/index.html"); |
0 commit comments