plan98
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add delete functionality and normalize synthia

+216 -139
+51
client.js
··· 272 272 let file 273 273 let statusCode = Status.Success 274 274 275 + if(request.method === 'DELETE') { 276 + if(pathname.startsWith('/private/camera-roll')) { 277 + return handleCameraRollDestroy(request) 278 + } 279 + 280 + if(pathname.startsWith('/private/sketch-pad')) { 281 + return handleSketchPadDestroy(request) 282 + } 283 + 284 + if(pathname.startsWith('/private/time-machine')) { 285 + return handleTimeMachineDestroy(request) 286 + } 287 + } 288 + 275 289 if(request.method === 'POST') { 276 290 277 291 if(pathname === '/plan98/subscribe') { ··· 635 649 } 636 650 } 637 651 652 + async function handleTimeMachineDestroy(request) { 653 + try { 654 + const { pathname } = new URL(request.url); 655 + // Delete the file 656 + await Deno.remove(`./client${pathname}`); 638 657 658 + return new Response('Time machine log deleted successfully', { status: 200 }); 659 + } catch (error) { 660 + console.error('Error deleting time machine log:', error); 661 + return new Response('Error saving time machine log', { status: 500 }); 662 + } 663 + } 664 + 665 + async function handleCameraRollDestroy(request) { 666 + try { 667 + const { pathname } = new URL(request.url); 668 + // Delete the file 669 + await Deno.remove(`./client${pathname}`); 670 + 671 + return new Response('Picture deleted successfully', { status: 200 }); 672 + } catch (error) { 673 + console.error('Error deleting picturee:', error); 674 + return new Response('Error deleting picture', { status: 500 }); 675 + } 676 + } 677 + 678 + async function handleSketchPadDestroy(request) { 679 + try { 680 + const { pathname } = new URL(request.url); 681 + // Delete the file 682 + await Deno.remove(`./client${pathname}`); 683 + 684 + return new Response('Sketch deleted successfully', { status: 200 }); 685 + } catch (error) { 686 + console.error('Error deleting sketch:', error); 687 + return new Response('Error deleting sketch', { status: 500 }); 688 + } 689 + } 639 690 640 691 const byPath = (x) => x.path 641 692 const byName = (x) => x.name
+17 -17
client/public/elves/paper-pocket.js
··· 1063 1063 </div> 1064 1064 </div> 1065 1065 <div class="selectbox-selector"> 1066 - <div class="standard-button selectbox-view"> 1066 + <div class="old-button selectbox-view"> 1067 1067 ${value} 1068 1068 </div> 1069 1069 <select data-settings name="${key}"> ··· 1103 1103 return ` 1104 1104 <paper-pocket static="true"> 1105 1105 <div class="share-actions"> 1106 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/clip-board?q=${encodeURIComponent(operation)}"> 1106 + <a class="old-button -smol" target="_blank" href="/app/clip-board?q=${encodeURIComponent(operation)}"> 1107 1107 clipboard 1108 1108 </a> 1109 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/time-machine?q=${encodeURIComponent(operation)}"> 1109 + <a class="old-button -smol" target="_blank" href="/app/time-machine?q=${encodeURIComponent(operation)}"> 1110 1110 journal 1111 1111 </a> 1112 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/e-mail?q=${encodeURIComponent(operation)}"> 1112 + <a class="old-button -smol" target="_blank" href="/app/e-mail?q=${encodeURIComponent(operation)}"> 1113 1113 email 1114 1114 </a> 1115 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/blue-sky?q=${encodeURIComponent(operation)}"> 1115 + <a class="old-button -smol" target="_blank" href="/app/blue-sky?q=${encodeURIComponent(operation)}"> 1116 1116 bluesky 1117 1117 </a> 1118 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/cool-chat?q=${encodeURIComponent(operation)}"> 1118 + <a class="old-button -smol" target="_blank" href="/app/cool-chat?q=${encodeURIComponent(operation)}"> 1119 1119 chat 1120 1120 </a> 1121 - <a class="av-link-button standard-button -outlined -smol" target="_blank" href="/app/ur-shell?q=${encodeURIComponent(operation)}"> 1121 + <a class="old-button -smol" target="_blank" href="/app/ur-shell?q=${encodeURIComponent(operation)}"> 1122 1122 shell 1123 1123 </a> 1124 1124 </div> 1125 1125 <div class="search-bar"> 1126 1126 <input class="search-input" name="prompt" data-bind="synthia" value="${operation}" /> 1127 - <button class="standard-button" data-search="${encodeURIComponent(operation)}"> 1127 + <button class="old-button" data-search="${encodeURIComponent(operation)}"> 1128 1128 <sl-icon name="search"></sl-icon> 1129 1129 </button> 1130 1130 </div> ··· 1134 1134 return ` 1135 1135 <div class="av -chip"> 1136 1136 <div class="av-cta"> 1137 - <a class="av-link-button standard-button -smol" target="_blank" href="${searchEngineMap[key].url}${encodeURIComponent(operation)}"> 1137 + <a class="old-button -smol" target="_blank" href="${searchEngineMap[key].url}${encodeURIComponent(operation)}"> 1138 1138 Ask 1139 1139 </a> 1140 1140 </div> ··· 1146 1146 }).join('')} 1147 1147 <div class="av -chip"> 1148 1148 <div class="av-cta"> 1149 - <a class="av-link-button standard-button -smol" target="_blank" href="/app/js-repl?q=${encodeURIComponent(operation)}"> 1149 + <a class="old-button -smol" target="_blank" href="/app/js-repl?q=${encodeURIComponent(operation)}"> 1150 1150 Run 1151 1151 </a> 1152 1152 </div> ··· 1158 1158 1159 1159 <div class="av -chip"> 1160 1160 <div class="av-cta"> 1161 - <a class="av-link-button standard-button -smol" target="_blank" href="/app/luau-repl?q=${encodeURIComponent(operation)}"> 1161 + <a class="old-button -smol" target="_blank" href="/app/luau-repl?q=${encodeURIComponent(operation)}"> 1162 1162 Run 1163 1163 </a> 1164 1164 </div> ··· 1171 1171 <div class="llm-grid"> 1172 1172 <div class="av -snapshot"> 1173 1173 <div class="av-cta"> 1174 - <a class="av-link-button standard-button" target="_blank" href="/app/hello-ollama?model=llama3.2:3b&q=${encodeURIComponent(operation)}"> 1174 + <a class="old-button" target="_blank" href="/app/hello-ollama?model=llama3.2:3b&q=${encodeURIComponent(operation)}"> 1175 1175 Ask 1176 1176 </a> 1177 1177 </div> ··· 1184 1184 1185 1185 <div class="av -snapshot"> 1186 1186 <div class="av-cta"> 1187 - <a class="av-link-button standard-button" target="_blank" href="/app/hello-ollama?model=gemma3:1b&q=${encodeURIComponent(operation)}"> 1187 + <a class="old-button" target="_blank" href="/app/hello-ollama?model=gemma3:1b&q=${encodeURIComponent(operation)}"> 1188 1188 Ask 1189 1189 </a> 1190 1190 </div> ··· 1196 1196 1197 1197 <div class="av -snapshot"> 1198 1198 <div class="av-cta"> 1199 - <a class="av-link-button standard-button" target="_blank" href="/app/hello-ollama?model=mistral:7b&q=${encodeURIComponent(operation)}"> 1199 + <a class="old-button" target="_blank" href="/app/hello-ollama?model=mistral:7b&q=${encodeURIComponent(operation)}"> 1200 1200 Ask 1201 1201 </a> 1202 1202 </div> ··· 1208 1208 1209 1209 <div class="av -snapshot"> 1210 1210 <div class="av-cta"> 1211 - <a class="av-link-button standard-button" target="_blank" href="/app/hello-ollama?model=deepseek-r1:1.5b&q=${encodeURIComponent(operation)}"> 1211 + <a class="old-button" target="_blank" href="/app/hello-ollama?model=deepseek-r1:1.5b&q=${encodeURIComponent(operation)}"> 1212 1212 Ask 1213 1213 </a> 1214 1214 </div> ··· 1242 1242 ${list.map(({ label, url }) => { 1243 1243 return ` 1244 1244 <div class="mega-footer-item"> 1245 - <a class="mega-footer-link standard-button" href="${url}"> 1245 + <a class="old-button old-button" href="${url}"> 1246 1246 ${label} 1247 1247 </a> 1248 1248 </div> ··· 1264 1264 <div class="av-description">The end has come and it is time to face the music</div> 1265 1265 </div> 1266 1266 <div class="av-cta"> 1267 - <a class="av-link-button standard-button" target="_blank" href="/app/paper-pocket?rom=final-boss"> 1267 + <a class="old-button" target="_blank" href="/app/paper-pocket?rom=final-boss"> 1268 1268 Play 1269 1269 </a> 1270 1270 </div>
+42 -8
client/public/elves/time-machine.js
··· 1030 1030 </div> 1031 1031 1032 1032 <div class="past-toggle-wrapper"> 1033 - <button class="link-button" data-past-toggle> 1033 + <button class="standard-button" data-past-toggle> 1034 1034 ${pastEnabled?'Hide Past':'View Past'} 1035 1035 </button> 1036 1036 </div> ··· 1335 1335 }); 1336 1336 } 1337 1337 1338 - $.when('click', '[data-destroy]', async (event) => { 1339 - event.preventDefault() 1340 - const { destroy } = event.target.dataset 1341 - }) 1338 + export function destroy(context) { 1339 + if(!context) return 1340 + 1341 + const authorization = btoa(plan98.env.PLAN98_USERNAME + ':' + plan98.env.PLAN98_PASSWORD); 1342 + 1343 + // Attempt to upload to server 1344 + fetch(`/private/time-machine${context.path}`, { 1345 + method: 'DELETE', 1346 + headers: { 1347 + "Content-Type": "application/json", 1348 + "Authorization": `Basic ${authorization}` 1349 + } 1350 + }).then(response => { 1351 + if (!response.ok) { 1352 + // Explicitly throw for non-200 responses 1353 + throw new Error(`HTTP error! status: ${response.status}`); 1354 + } 1355 + fate() 1356 + }).catch(error => { 1357 + console.warn(error); 1358 + }); 1359 + } 1360 + 1342 1361 1343 1362 $.when('submit', '[action="post"]', async (event) => { 1344 1363 event.preventDefault() ··· 1354 1373 toast('Incomplete information, please try again.', { type: 'error' }) 1355 1374 } 1356 1375 }) 1376 + 1377 + $.when('click', '[data-destroy]', async (event) => { 1378 + event.preventDefault() 1379 + try { 1380 + destroy({ path: event.target.dataset.destroy }) 1381 + hideModal() 1382 + toast('Destroyed!', { type: 'success' }) 1383 + } catch(e) { 1384 + toast('Error!' + e.message, { type: 'error' }) 1385 + } 1386 + }) 1387 + 1357 1388 1358 1389 $.when('click', '[data-view]', (event) => { 1359 1390 event.preventDefault() ··· 1492 1523 top: 0; 1493 1524 padding: .5rem; 1494 1525 text-align: center; 1526 + z-index: 1; 1495 1527 } 1496 1528 1497 1529 & .era-label { ··· 1709 1741 } 1710 1742 1711 1743 & .view-event { 1712 - border: 2px solid black; 1713 - background: linear-gradient(rgba(0,0,0,.05),rgba(0,0,0,.05)), white; 1744 + border: 1px solid black; 1745 + background: white; 1714 1746 border-radius: 3px; 1715 1747 color: rgba(0,0,0,.85); 1716 1748 padding: .5rem; 1717 1749 font-weight: bold; 1718 1750 display: inline-block; 1719 1751 text-align: left; 1752 + transform: scale(.95); 1753 + transition: transform ease-in-out 100ms; 1720 1754 } 1721 1755 1722 1756 & .view-event img, ··· 1731 1765 1732 1766 & .view-event:hover, 1733 1767 & .view-event:focus { 1734 - background: var(--root-theme, mediumseagreen); 1735 1768 color: rgba(0,0,0,.85); 1769 + transform: scale(1); 1736 1770 } 1737 1771 1738 1772 & .view-event[data-show="${eventTypes.journal}"] {
+106 -114
client/public/styles/system.css
··· 917 917 position: relative; 918 918 } 919 919 920 - .standard-button { 921 - border: none; 922 - border-radius: 3px; 923 - border: 1px solid var(--root-theme, mediumseagreen); 924 - background: 925 - linear-gradient(335deg, var(--root-theme, mediumseagreen), rgba(0,0,0,.45) 20%, rgba(0,0,0,.75)), 926 - linear-gradient(-65deg, rgba(255,255,255,.5), rgba(255,255,255,.15)), 927 - var(--root-theme, mediumseagreen); 928 - color: rgba(255,255,255,.85); 929 - padding: .5rem; 930 - font-weight: bold; 931 - position: relative; 932 - } 933 - 934 - .standard-button:hover, 935 - .standard-button:focus { 936 - color: rgba(255,255,255,.85); 937 - background: 938 - linear-gradient(335deg, var(--root-theme, mediumseagreen), rgba(255,255,255,.15) 20%, rgba(255,255,255,.25)), 939 - linear-gradient(-65deg, rgba(0,0,0,.35), rgba(255,255,255,.35)), 940 - var(--root-theme, mediumseagreen); 941 - } 942 - 943 - .standard-button.-clear { 944 - -webkit-background-clip: text; 945 - -webkit-text-fill-color: transparent; 946 - } 947 - 948 - .standard-button.-outlined { 949 - border: 1px solid var(--root-theme, mediumseagreen); 950 - -webkit-background-clip: text; 951 - -webkit-text-fill-color: transparent; 952 - } 953 - 954 - .standard-button.-small { 955 - padding: .25rem .5rem; 956 - font-size: 1rem; 957 - } 958 - 959 - .standard-button.-smol { 960 - padding: 0 4px; 961 - font-size: 1rem; 962 - font-weight: normal; 963 - } 964 - 965 - .standard-input { 966 - border: 1px solid rgba(0,0,0,.15); 967 - border-radius: 3px; 968 - color: rgba(0,0,0,.85); 969 - padding: .5rem; 970 - } 971 - 972 - 973 - .old-button::after, 974 - .standard-button::after { 975 - content: ''; 976 - position: absolute; 977 - inset: 0; 978 - pointer-events: none; 979 - z-index: 10000; 980 - background: var(--root-theme, transparent); 981 - mix-blend-mode: soft-light; 982 - opacity: .75; 983 - } 984 - 985 - 986 - .old-button, 987 - .old-button:link, 988 - .old-button:visited { 989 - background: rgba(0,0,0,.1); 990 - border: 2px solid; 991 - border-top-color: rgba(255,255,255,.5); 992 - border-left-color: rgba(255,255,255,.5); 993 - border-bottom-color: rgba(0,0,0,.5); 994 - border-right-color: rgba(0,0,0,.5); 995 - text-decoration: none; 996 - padding: .25rem .5rem; 997 - color: rgba(0,0,0,.85); 998 - } 999 - 1000 - .old-button:hover, 1001 - .old-button:focus { 1002 - color: mediumseagreen; 1003 - } 1004 - 1005 - .old-button:active { 1006 - text-decoration: none; 1007 - color: firebrick; 1008 - background: rgba(0,0,0,.8); 1009 - border-bottom-color: rgba(255,255,255,.5); 1010 - border-right-color: rgba(255,255,255,.5); 1011 - border-top-color: rgba(0,0,0,.5); 1012 - border-left-color: rgba(0,0,0,.5); 1013 - } 1014 - 1015 - 1016 - 1017 920 .mega-footer { 1018 921 padding: 1rem 0; 1019 922 } ··· 1045 948 display: inline-block; 1046 949 } 1047 950 1048 - .mega-footer-link:link { 951 + .old-button:link { 1049 952 display: inline-block; 1050 953 } 1051 - .mega-footer-link:link, 1052 - .mega-footer-link:visited { 954 + .old-button:link, 955 + .old-button:visited { 1053 956 background: rgba(0,0,0,.1); 1054 957 border: 2px solid; 1055 958 border-top-color: rgba(255,255,255,.5); ··· 1061 964 color: rgba(0,0,0,.85); 1062 965 } 1063 966 1064 - .mega-footer-link:hover, 1065 - .mega-footer-link:focus { 967 + .old-button:hover, 968 + .old-button:focus { 1066 969 background: rgba(0,0,0,.2); 1067 970 } 1068 971 1069 - .mega-footer-link:active { 972 + .old-button:active { 1070 973 text-decoration: none; 1071 974 background: rgba(0,0,0,.4); 1072 975 border-bottom-color: rgba(255,255,255,.5); ··· 1099 1002 border-radius: .5rem; 1100 1003 } 1101 1004 1102 - 1103 - .av-link-button:link, 1104 - .av-link-button:visited, 1105 - .av-link-button:hover, 1106 - .av-link-button:focus { 1107 - text-decoration: none; 1108 - color: white; 1109 - white-space: nowrap; 1110 - display: inline-block; 1111 - } 1112 - 1113 1005 .av.-banner .av-cta { 1114 1006 place-self: center; 1115 1007 } ··· 1125 1017 .av-description { 1126 1018 font-weight: 100; 1127 1019 } 1020 + 1021 + .standard-button { 1022 + border: none; 1023 + border-radius: 3px; 1024 + border: 1px solid var(--root-theme, mediumseagreen); 1025 + background: 1026 + linear-gradient(335deg, var(--root-theme, mediumseagreen), rgba(0,0,0,.45) 20%, rgba(0,0,0,.75)), 1027 + linear-gradient(-65deg, rgba(255,255,255,.5), rgba(255,255,255,.15)), 1028 + var(--root-theme, mediumseagreen); 1029 + color: rgba(255,255,255,.85); 1030 + padding: .5rem; 1031 + font-weight: bold; 1032 + position: relative; 1033 + } 1034 + 1035 + .standard-button:hover, 1036 + .standard-button:focus { 1037 + color: rgba(255,255,255,.85); 1038 + background: 1039 + linear-gradient(335deg, var(--root-theme, mediumseagreen), rgba(255,255,255,.15) 20%, rgba(255,255,255,.25)), 1040 + linear-gradient(-65deg, rgba(0,0,0,.35), rgba(255,255,255,.35)), 1041 + var(--root-theme, mediumseagreen); 1042 + } 1043 + 1044 + .standard-input { 1045 + border: 1px solid rgba(0,0,0,.15); 1046 + border-radius: 3px; 1047 + color: rgba(0,0,0,.85); 1048 + padding: .5rem; 1049 + } 1050 + 1051 + 1052 + .old-button::after, 1053 + .standard-button::after { 1054 + content: ''; 1055 + position: absolute; 1056 + inset: 0; 1057 + pointer-events: none; 1058 + z-index: 10000; 1059 + background: var(--root-theme, transparent); 1060 + mix-blend-mode: soft-light; 1061 + opacity: .75; 1062 + } 1063 + 1064 + 1065 + .old-button, 1066 + .old-button:link, 1067 + .old-button:visited { 1068 + background: rgba(0,0,0,.1); 1069 + border: 2px solid; 1070 + border-top-color: rgba(255,255,255,.5); 1071 + border-left-color: rgba(255,255,255,.5); 1072 + border-bottom-color: rgba(0,0,0,.5); 1073 + border-right-color: rgba(0,0,0,.5); 1074 + text-decoration: none; 1075 + padding: .25rem .5rem; 1076 + color: rgba(0,0,0,.85); 1077 + position: relative; 1078 + } 1079 + 1080 + .old-button:hover, 1081 + .old-button:focus { 1082 + color: mediumseagreen; 1083 + } 1084 + 1085 + .old-button:active { 1086 + text-decoration: none; 1087 + color: firebrick; 1088 + background: rgba(0,0,0,.8); 1089 + border-bottom-color: rgba(255,255,255,.5); 1090 + border-right-color: rgba(255,255,255,.5); 1091 + border-top-color: rgba(0,0,0,.5); 1092 + border-left-color: rgba(0,0,0,.5); 1093 + } 1094 + 1095 + .standard-button.-clear { 1096 + -webkit-background-clip: text; 1097 + -webkit-text-fill-color: transparent; 1098 + } 1099 + 1100 + .standard-button.-outlined, 1101 + .old-button.-outlined { 1102 + border: 1px solid var(--root-theme, mediumseagreen); 1103 + -webkit-background-clip: text; 1104 + -webkit-text-fill-color: transparent; 1105 + } 1106 + 1107 + .standard-button.-small { 1108 + padding: .25rem .5rem; 1109 + font-size: 1rem; 1110 + } 1111 + 1112 + .standard-button.-smol, 1113 + .old-button.-smol { 1114 + padding: 0 4px; 1115 + font-size: 1rem; 1116 + font-weight: normal; 1117 + } 1118 + 1119 +