mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 16:45:41 +00:00
Fix js/css path (paste)
Fix collapse layout animation (web) Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
576a543703
commit
7e65c403f7
3 changed files with 23 additions and 7 deletions
24
src/index.ts
24
src/index.ts
|
@ -23,8 +23,8 @@ import dedent from 'dedent-js';
|
|||
|
||||
// Constants
|
||||
const SERVICE_URL = 'pb.nekoul.com';
|
||||
const PASTE_INDEX_HTML_URL_v1 = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v1/paste.html';
|
||||
const PASTE_INDEX_HTML_URL = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v2/paste.html';
|
||||
const PASTE_WEB_URL_v1 = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v1';
|
||||
const PASTE_WEB_URL = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v2';
|
||||
const UUID_LENGTH = 4;
|
||||
|
||||
export interface Env {
|
||||
|
@ -69,7 +69,23 @@ export default {
|
|||
}
|
||||
|
||||
if (path === '/v1' && method == 'GET') {
|
||||
return await fetch(PASTE_INDEX_HTML_URL_v1, {
|
||||
return await fetch(PASTE_WEB_URL_v1 + '/paste.html', {
|
||||
cf: {
|
||||
cacheEverything: true,
|
||||
},
|
||||
}).then(value => {
|
||||
return new Response(value.body, {
|
||||
// Add the correct content-type to response header
|
||||
headers: {
|
||||
'content-type': 'text/html; charset=UTF-8;',
|
||||
'cache-control': 'public, max-age=172800',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (/\/(js|css)\/.*$/.test(path) && method == 'GET') {
|
||||
return await fetch(PASTE_WEB_URL + path, {
|
||||
cf: {
|
||||
cacheEverything: true,
|
||||
},
|
||||
|
@ -88,7 +104,7 @@ export default {
|
|||
switch (method) {
|
||||
// Fetch the HTML for uploading text/file
|
||||
case 'GET': {
|
||||
return await fetch(PASTE_INDEX_HTML_URL, {
|
||||
return await fetch(PASTE_WEB_URL + '/paste.html', {
|
||||
cf: {
|
||||
cacheEverything: true,
|
||||
},
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
.card-header .fa {
|
||||
.card-header .fa-chevron-down {
|
||||
transition: .3s transform ease-in-out;
|
||||
}
|
||||
|
||||
.card-header .collapsed .fa {
|
||||
.card-header .collapsed .fa-chevron-down {
|
||||
transform: rotate(90deg);
|
||||
}
|
|
@ -112,7 +112,7 @@
|
|||
<div class="card-header mb-3">
|
||||
<span data-bs-toggle="collapse" data-bs-target="#advanced_settings_layout" aria-expanded="false"
|
||||
aria-controls="advanced_settings_layout" id="advanced_settings_control"
|
||||
class="d-block">
|
||||
class="d-block collapsed">
|
||||
<i class="fa fa-chevron-down pull-right mt-1"></i>
|
||||
Advanced Settings
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue