From d576e16cd7804e9651986be48c96c66c11ed06b2 Mon Sep 17 00:00:00 2001 From: Sebastian Benz Date: Fri, 23 Aug 2024 16:53:36 +0200 Subject: [PATCH] more clean up --- .../rollup.config.mjs | 12 ++++++------ .../sidepanel/index.css | 6 +++--- .../sidepanel/index.js | 15 --------------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/functional-samples/ai.gemini-on-device-summarization/rollup.config.mjs b/functional-samples/ai.gemini-on-device-summarization/rollup.config.mjs index 04057251a5..30f269f71f 100644 --- a/functional-samples/ai.gemini-on-device-summarization/rollup.config.mjs +++ b/functional-samples/ai.gemini-on-device-summarization/rollup.config.mjs @@ -1,11 +1,11 @@ -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import commonjs from "@rollup/plugin-commonjs"; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; export default { - input: "scripts/extract-content.js", + input: 'scripts/extract-content.js', output: { - dir: "dist/scripts", - format: "cjs", + dir: 'dist/scripts', + format: 'cjs' }, - plugins: [commonjs(), nodeResolve()], + plugins: [commonjs(), nodeResolve()] }; diff --git a/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.css b/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.css index e10ed469eb..3232c78a57 100644 --- a/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.css +++ b/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.css @@ -4,8 +4,8 @@ --bg-error: #f89696; } body { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, - Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, + Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; color: #1f1f1f; background-color: #fffbff; font-size: 16px; @@ -29,7 +29,7 @@ body { } .speech-bubble:after { - content: ""; + content: ''; position: absolute; bottom: 0; left: 50%; diff --git a/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.js b/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.js index 67c6f7b384..0342bf5af6 100644 --- a/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.js +++ b/functional-samples/ai.gemini-on-device-summarization/sidepanel/index.js @@ -34,7 +34,6 @@ async function onContentChange(newContent) { } showSummary('Loading...'); summary = await generateSummary(newContent); - summary = escapeHTML(summary); } else { summary = "There's nothing to summarize"; } @@ -99,17 +98,3 @@ async function updateWarning(warning) { warningElement.setAttribute('hidden', ''); } } - -function escapeHTML(str) { - return str.replace( - /[&<>'"]/g, - (tag) => - ({ - '&': '&', - '<': '<', - '>': '>', - "'": ''', - '"': '"' - })[tag] || tag - ); -}