diff --git a/submissions/ToggledDevPortal/DevPortal-main/auth.js b/submissions/ToggledDevPortal/DevPortal-main/auth.js new file mode 100644 index 00000000..aea94e86 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/auth.js @@ -0,0 +1 @@ +const user = await getUserInfo() \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/background.js b/submissions/ToggledDevPortal/DevPortal-main/background.js new file mode 100644 index 00000000..b001d554 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/background.js @@ -0,0 +1,40 @@ +// background.js + +// Listen for messages from the content script (content.js) +chrome.runtime.onMessage.addListener(async function (message, sender, sendResponse) { + if (message.redirect) { + // Redirect the user to your extension's page + chrome.tabs.create({ url: 'integrations.html?ghun=' + message.redirect }, function (tab) { + // Send a response back to the content script to indicate successful redirection + sendResponse({ success: true }); + }); + } + + if (message.replit) { + + // Redirect the user to your extension's page + chrome.tabs.create({ url: 'integrations.html?repl=' + message.replit }, function (tab) { + // Send a response back to the content script to indicate successful redirection + sendResponse({ success: true }); + }); + } + + if (message.openai) { + // Redirect the user to your extension's page + chrome.tabs.create({ url: 'productivity.html?openai=' + message.openai }, function (tab) { + // Send a response back to the content script to indicate successful redirection + sendResponse({ success: true }); + }); + } + + if (message.sub1) { + // Redirect the user to your extension's page + chrome.tabs.create({ url: 'purchased.html?purchased=' + message.sub1 }, function (tab) { + // Send a response back to the content script to indicate successful redirection + sendResponse({ success: true }); + }); + } + // To ensure sendResponse is called asynchronously + return true; + }); + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/browser.js b/submissions/ToggledDevPortal/DevPortal-main/browser.js new file mode 100644 index 00000000..f5f7cd9c --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/browser.js @@ -0,0 +1,65 @@ +// Function to fetch the title and favicon of a website +async function fetchTitleAndFavicon(url) { + try { + const response = await fetch('http://zymono.com/gettitleandfavicon', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ url }), + }); + + const data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + return null; + } + } + +document.getElementById('google').addEventListener('click', function() { + set('https://www.google.com/search?q=') +}) +document.getElementById('ddg').addEventListener('click', function() { + set('https://duckduckgo.com/&q=') +}) +document.getElementById('bing').addEventListener('click', function() { + set('https://www.bing.com/search?q=') +}) + +document.getElementById('ai').addEventListener('click', function() { + set('https://www.perplexity.ai/search?q=') +}) +document.getElementById('custom').addEventListener('click', function() { + const prompt = window.prompt('Enter a search engine url. (Include /search?q=)') + + if (prompt) { + set(prompt) + window.location = 'browsers.html' + } +}) + +function set(url) { + chrome.storage.sync.set({ searchEngine: url }, () => { + // Update the search form on the homepage + // const searchForm = chrome.extension.getViews({ type: "tab" })[0]?.document.getElementById('searchForm'); + // if (searchForm) { + // searchForm.action = searchEngineURL; + // } + alert('Settings saved successfully!'); + }); +} + + chrome.storage.sync.get(['searchEngine'], result => { + const targetURL = result.searchEngine; +fetchTitleAndFavicon(targetURL) + .then(data => { + if (data) { + if (!['google', 'duck', 'bing'].some(substring => targetURL.includes(substring))) { + document.getElementById('ct').innerText = data.title; + } + } else { + console.log('Failed to fetch data.'); + } + }); + }); \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/browsers.html b/submissions/ToggledDevPortal/DevPortal-main/browsers.html new file mode 100644 index 00000000..f491403e --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/browsers.html @@ -0,0 +1,362 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

Intergrations and connected apps

+

Supercharge your workflow and connect the tools you use every day.

+
+ +
+
+ + +
+
+
+
+
+ +

Google

+
+
+
+

The most powerful search engine.

+
+ +
+
+
+
+ +

DuckDuckGo

+
+ +
+
+

The best privacy-oriented search engine.

+
+ +
+
+
+
+ +

Bing

+
+
+
+

Why are you even thinking about using this?

+
+ +
+ + + +
+
+
+
+
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/content.js b/submissions/ToggledDevPortal/DevPortal-main/content.js new file mode 100644 index 00000000..ae43f63e --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/content.js @@ -0,0 +1,26 @@ +// content.js + +// Listen for messages from the webpage +window.addEventListener('message', function (event) { + if (event.source === window && event.data.from === 'your_website') { + // Send a message to the background script (Service Worker) + console.log(event.data.user) + chrome.runtime.sendMessage({ redirect: event.data.user }, function (response) { + // This callback function is optional, you can handle the response if needed. + if (response && response.success) { + console.log('Redirection successful!'); + } + }); + } + if (event.source === window && event.data.from === 'replauth') { + // Send a message to the background script (Service Worker) + console.log(event.data.user) + chrome.runtime.sendMessage({ replit: JSON.stringify(event.data.info) }, function (response) { + // This callback function is optional, you can handle the response if needed. + if (response && response.success) { + console.log('Redirection successful!'); + } + }); + } + }); + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/custom.html b/submissions/ToggledDevPortal/DevPortal-main/custom.html new file mode 100644 index 00000000..e69de29b diff --git a/submissions/ToggledDevPortal/DevPortal-main/custom.js b/submissions/ToggledDevPortal/DevPortal-main/custom.js new file mode 100644 index 00000000..40325135 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/custom.js @@ -0,0 +1,17 @@ +Dropzone.options.uploadForm = { + init: function() { + this.on("success", function(file, response) { + // Handle successful upload + console.log("Upload success:", response); + if (response.manifestContent) { + console.log("Manifest Content:", response.manifestContent); + } else { + console.log("manifest.json not found in the selected folder."); + } + }); + + this.on("error", function(file, errorMessage) { + console.error("Upload error:", errorMessage); + }); + } + }; \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/ghlogin.js b/submissions/ToggledDevPortal/DevPortal-main/ghlogin.js new file mode 100644 index 00000000..22e86180 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/ghlogin.js @@ -0,0 +1,52 @@ + // Replace 'YOUR_USERNAME_HERE' with your GitHub username + let username = false; + chrome.storage.sync.get(['github'], result => { + username = result.github; + console.log(username) + if (!username) { + window.location = 'integrations.html' + } + + // GitHub API URL to fetch user repositories + const apiUrl = `https://api.github.com/users/${username}/repos`; + + // Fetch the data from the GitHub API + fetch(apiUrl) + .then(response => response.json()) + .then(data => { + // Process the data and display repositories + const repoList = document.getElementById('repo-list'); + data.forEach(repo => { + const a = `
+
+
+ +

${repo.name}

+
+
+
+

${repo.description}.

+
+ +
` + + const cards = document.getElementById('id') + cards.innerHTML += a + }); + }) + .catch(error => { + console.error('Error fetching data:', error); + }); + + }); + try { + chrome.storage.sync.get(['snippet'], result => { + if (!result.snippet == true) { + document.getElementById('snippetbtn').remove() + } + }) + } catch {} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/github.html b/submissions/ToggledDevPortal/DevPortal-main/github.html new file mode 100644 index 00000000..8d30854b --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/github.html @@ -0,0 +1,124 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Toggled Dev

+ +
+ +
+
+

+

Supercharge your browser and connect the tools you use every day.

+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/githublogin.html b/submissions/ToggledDevPortal/DevPortal-main/githublogin.html new file mode 100644 index 00000000..4c50d52b --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/githublogin.html @@ -0,0 +1,16 @@ + + + + Github Repositories + + +

Github Repositories

+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/homepage.css b/submissions/ToggledDevPortal/DevPortal-main/homepage.css new file mode 100644 index 00000000..81554c6f --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/homepage.css @@ -0,0 +1,976 @@ +@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"); +:root { + --c-text-primary: #282a32; + --c-text-secondary: #686b87; + --c-text-action: #404089; + --c-accent-primary: #434ce8; + --c-border-primary: #eff1f6; + --c-background-primary: #ffffff; + --c-background-secondary: #fdfcff; + --c-background-tertiary: #ecf3fe; + --c-background-quaternary: #e9ecf4; + --news-bgc: #b4b4b4; + + --primary-light: #8abdff; + --primary: #6d5dfc; + --primary-dark: #5b0eeb; + --white: #FFFFFF; + --greyLight-1: #E4EBF5; + --greyLight-2: #c8d0e7; + --greyLight-3: #bec8e4; + --greyDark: #9baacf; +} + +@media (prefers-color-scheme: dark) { + :root { + --c-text-primary: #e8e8e8; + --c-text-secondary: #b1b1b1; + --c-text-action: #d3d3e8; + --c-accent-primary: #8484ff; + --c-border-primary: #36363d; + --c-background-primary: #282a36; + --c-background-secondary: #1e1f29; + --c-background-tertiary: #2b2c3b; + --c-background-quaternary: #44475a; + --news-bgc: #14151a; + + --primary-light: #8abdff; + --primary: #6d5dfc; + --primary-dark: #5b0eeb; + --white: #FFFFFF; + --greyLight-1: #E4EBF5; + --greyLight-2: #c8d0e7; + --greyLight-3: #bec8e4; + --greyDark: #9baacf; + } + + /* EDITURL POPUP */ + +.popup { + display: none; + position: fixed; + z-index: 999; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; +} + +.popup-content { + margin: auto; + padding: 20px; + border-radius: 5px; + box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.3); + width: 70%; + max-width: 600px; + color: #8484ff; +} + +/* Styles for labels */ +label { + display: block; + margin-top: 10px; + font-size: 18px; + font-weight: 500; + color: #8484ff; +} + +/* Styles for input fields */ +input[type="text"], input[type="url"] { + border: 1px solid #fff; + padding: 8px; + font-size: 16px; + border-radius: 3px; + width: 100%; + box-sizing: border-box; + margin-top: 5px; + background-color: #282a36; + outline-width: 10px; + outline-color: #2c3e50; + color: #fff; + margin-right: 5px;; + display: inline-block; +} + +/* Styles for helper text */ +.helper-text { + font-size: 14px; + color: #ccc; +} + +/* Styles for buttons */ +.popupfield { + border: none; + background-color: #8484ff; + color: #fff; + padding: 10px 20px; + font-size: 16px; + border-radius: 3px; + cursor: pointer; + margin-right: 10px; + transition: background-color 0.3s ease; +} + +.popupfield button:hover { + background-color: #6161ae; +} + +.popupfield[type="submit"] { + background-color: #1abc9c; +} + +.popupfield[type="submit"]:hover { + background-color: #16a085; +} + +} + + +body { + line-height: 1.5; + min-height: 100vh; + font-family: "Be Vietnam Pro", sans-serif; + background-color: var(--c-background-secondary); + color: var(--c-text-primary); +} + +img { + display: block; + max-width: 100%; +} + +:focus { + outline: 0; +} + +.responsive-wrapper { + width: 90%; + max-width: 1280px; + margin-left: auto; + margin-right: auto; +} + +.header { + display: flex; + align-items: center; + height: 80px; + border-bottom: 1px solid var(--c-border-primary); + background-color: var(--c-background-primary); +} + +.header-content { + display: flex; + align-items: center; +} +.header-content > a { + display: none; +} +@media (max-width: 1200px) { + .header-content { + justify-content: space-between; + } + .header-content > a { + display: inline-flex; + } +} + +.header-logo { + margin-right: 2.5rem; +} +.header-logo a { + display: flex; + align-items: center; +} +.header-logo a div { + flex-shrink: 0; + position: relative; +} +.header-logo a div:after { + display: block; + content: ""; + position: absolute; + left: 0; + top: auto; + right: 0; + bottom: 0; + overflow: hidden; + height: 50%; +} + +.header-navigation { + display: flex; + flex-grow: 1; + align-items: center; + justify-content: space-between; +} +@media (max-width: 1200px) { + .header-navigation { + display: none; + } +} + +.header-navigation-links { + display: flex; + align-items: center; +} +.header-navigation-links a { + text-decoration: none; + color: var(--c-text-action); + font-weight: 500; + transition: 0.15s ease; +} +.header-navigation-links a + * { + margin-left: 1.5rem; +} +.header-navigation-links a:hover, .header-navigation-links a:focus { + color: var(--c-accent-primary); +} + +.header-navigation-actions { + display: flex; + align-items: center; +} +.header-navigation-actions > .avatar { + margin-left: 0.75rem; +} +.header-navigation-actions > .icon-button + .icon-button { + margin-left: 0.25rem; +} +.header-navigation-actions > .button + .icon-button { + margin-left: 1rem; +} + +.button { + cursor: pointer; + font: inherit; + color: inherit; + text-decoration: none; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 1em; + height: 40px; + border-radius: 8px; + line-height: 1; + border: 2px solid var(--c-border-primary); + color: var(--c-text-action); + font-size: 0.875rem; + transition: 0.15s ease; + background-color: var(--c-background-primary); +} +.button i { + margin-right: 0.5rem; + font-size: 1.25em; +} +.button span { + font-weight: 500; +} +.button:hover, .button:focus { + border-color: var(--c-accent-primary); + color: var(--c-accent-primary); +} + +.icon-button { + font: inherit; + color: inherit; + text-decoration: none; + display: inline-flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 8px; + color: var(--c-text-action); + transition: 0.15s ease; +} +.icon-button i { + font-size: 1.25em; +} +.icon-button:focus, .icon-button:hover { + background-color: var(--c-background-tertiary); + color: var(--c-accent-primary); +} + +.avatar { + display: inline-flex; + align-items: center; + justify-content: center; + width: 44px; + height: 44px; + border-radius: 50%; + overflow: hidden; +} + +.main { + padding-top: 3rem; +} + +.main-header { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; +} +.main-header h1 { + font-size: 1.75rem; + font-weight: 600; + line-height: 1.25; +} +@media (max-width: 550px) { + .main-header h1 { + margin-bottom: 1rem; + } +} + +.search { + position: relative; + display: flex; + align-items: center; + width: 100%; + max-width: 550px; +} +.search input { + font: inherit; + color: inherit; + text-decoration: none; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 1em 0 36px; + height: 40px; + border-radius: 8px; + border: 2px solid var(--c-border-primary); + color: var(--c-text-action); + font-size: 0.875rem; + transition: 0.15s ease; + width: 100%; + line-height: 1; +} +.search input::-moz-placeholder { + color: var(--c-text-action); +} +.search input:-ms-input-placeholder { + color: var(--c-text-action); +} +.search input::placeholder { + color: var(--c-text-action); +} +.search input:focus, .search input:hover { + border-color: var(--c-accent-primary); +} +.search button { + display: inline-flex; + align-items: center; + justify-content: center; + border: 0; + background-color: transparent; + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + font-size: 1.25em; + color: var(--c-text-action); + padding: 0; + height: 40px; +} + +.horizontal-tabs { + margin-top: 1.5rem; + display: flex; + align-items: center; + overflow-x: auto; +} +@media (max-width: 1000px) { + .horizontal-tabs { + scrollbar-width: none; + position: relative; + } + .horizontal-tabs::-webkit-scrollbar { + display: none; + } +} +.horizontal-tabs a { + display: inline-flex; + flex-shrink: 0; + align-items: center; + height: 48px; + padding: 0 0.25rem; + font-weight: 500; + color: inherit; + border-bottom: 3px solid transparent; + text-decoration: none; + transition: 0.15s ease; +} +.horizontal-tabs a:hover, .horizontal-tabs a:focus, .horizontal-tabs a.active { + color: var(--c-accent-primary); + border-bottom-color: var(--c-accent-primary); +} +.horizontal-tabs a + * { + margin-left: 1rem; +} + +.content-header { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + padding-top: 3rem; + margin-top: -1px; + /* border-top: 1px solid var(--c-border-primary); */ +} + +.content-header-intro h2 { + font-size: 1.25rem; + font-weight: 600; +} +.content-header-intro p { + color: var(--c-text-secondary); + margin-top: 0.25rem; + font-size: 0.875rem; + margin-bottom: 1rem; +} + +@media (min-width: 800px) { + .content-header-actions a:first-child { + display: none; + } +} + +.content { + border-top: 1px solid var(--c-border-primary); + margin-top: 2rem; + display: flex; + align-items: flex-start; +} + +.content-panel { + display: none; + max-width: 280px; + width: 25%; + padding: 2rem 1rem 2rem 0; + margin-right: 3rem; +} +@media (min-width: 800px) { + .content-panel { + display: block; + } +} + +.vertical-tabs { + display: flex; + flex-direction: column; +} +.vertical-tabs a { + display: flex; + align-items: center; + padding: 0.75em 1em; + background-color: transparent; + border-radius: 8px; + text-decoration: none; + font-weight: 500; + color: var(--c-text-action); + transition: 0.15s ease; +} +.vertical-tabs a:hover, .vertical-tabs a:focus, .vertical-tabs a.active { + background-color: var(--c-background-tertiary); + color: var(--c-accent-primary); +} +.vertical-tabs a + * { + margin-top: 0.25rem; +} + +.content-main { + padding-top: 2rem; + padding-bottom: 6rem; + flex-grow: 1; +} + +.card-grid { + display: grid; + grid-template-columns: repeat(1, 1fr); + -moz-column-gap: 1.5rem; + column-gap: 1.5rem; + row-gap: 1.5rem; +} +@media (min-width: 600px) { + .card-grid { + grid-template-columns: repeat(2, 1fr); + } +} +@media (min-width: 1200px) { + .card-grid { + grid-template-columns: repeat(3, 1fr); + } +} + +.card { + background-color: var(--c-background-primary); + box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.05); + border-radius: 8px; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.card-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + padding: 1.5rem 1.25rem 1rem 1.25rem; +} +.card-header div { + display: flex; + align-items: center; +} +.card-header div span { + width: 40px; + height: 40px; + border-radius: 8px; + display: inline-flex; + align-items: center; + justify-content: center; +} +.card-header div span img { + max-height: 100%; +} +.card-header div h3 { + margin-left: 0.75rem; + font-weight: 500; +} + +.toggle span { + display: block; + width: 40px; + height: 24px; + border-radius: 99em; + background-color: var(--c-background-quaternary); + box-shadow: inset 1px 1px 1px 0 rgba(0, 0, 0, 0.05); + position: relative; + transition: 0.15s ease; +} +.toggle span:before { + content: ""; + display: block; + position: absolute; + left: 3px; + top: 3px; + height: 18px; + width: 18px; + background-color: var(--c-background-primary); + border-radius: 50%; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15); + transition: 0.15s ease; +} +.toggle input { + clip: rect(0 0 0 0); + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +} +.toggle input:checked + span { + background-color: var(--c-accent-primary); +} +.toggle input:checked + span:before { + transform: translateX(calc(100% - 2px)); +} +.toggle input:focus + span { + box-shadow: 0 0 0 4px var(--c-background-tertiary); +} + +.card-body { + padding: 1rem 1.25rem; + font-size: 0.875rem; +} + +.card-footer { + margin-top: auto; + padding: 1rem 1.25rem; + display: flex; + align-items: center; + justify-content: flex-end; + border-top: 1px solid var(--c-border-primary); +} +.card-footer p { + padding-right: 10px; +} +.card-footer a { + color: var(--c-text-action); + text-decoration: none; + font-weight: 500; + font-size: 0.875rem; +} + +html::-webkit-scrollbar { + width: 12px; +} +html::-webkit-scrollbar-thumb { + background-color: var(--c-text-primary); + border: 4px solid var(--c-background-primary); + border-radius: 99em; +} + +.btn { + background: none; + border: none; + transition-duration: 0.3s; + border-radius: 5px; +} +.btn:hover { + background-color: #575757; + border: none; +} + +a:hover { + cursor:pointer; +} + +/* EDITURL POPUP */ + +.popup { + display: none; + position: fixed; + z-index: 999; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0, 0, 0, 0.5); +} + +.popup-content { + background-color: #fff; + margin: auto; + padding: 20px; + border-radius: 5px; + box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.3); + width: 70%; + max-width: 600px; +} + +/* Styles for labels */ +label { + display: block; + margin-top: 10px; + font-size: 18px; + font-weight: 500; +} + +/* Styles for input fields */ +input[type="text"], input[type="url"] { + border: 1px solid #ccc; + padding: 8px; + font-size: 16px; + border-radius: 3px; + width: 100%; + box-sizing: border-box; + margin-top: 5px; +} + +/* Styles for helper text */ +.helper-text { + font-size: 14px; + color: #888; +} + +/* Styles for buttons */ +.popupfield { + border: none; + background-color: #4caf50; + color: #fff; + padding: 10px 20px; + font-size: 16px; + border-radius: 3px; + cursor: pointer; + margin-right: 10px; + transition: background-color 0.3s ease; +} + +.popupfield:hover { + background-color: #3e8e41; +} + +.popupfield[type="submit"] { + background-color: #007bff; +} + +.popupfield[type="submit"]:hover { + background-color: #0069d9; +} + +:root { + --background-color: #fefefe; + --text-color: #333; +} + +@media (prefers-color-scheme: dark) { + :root { + --background-color: #333; + --text-color: #fefefe; + } +} + +.popup-content { + background-color: var(--background-color); + color: var(--text-color); + /* rest of the styles */ +} + +.my-popup { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0,0,0,0.4); +} + +.my-popup .popup-content { + background-color: #fefefe; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 80%; + max-width: 600px; + color: black; + box-shadow: 0 0 10px rgba(0,0,0,0.3); +} + +.my-popup .close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; + transition: color 0.2s ease; +} + +.my-popup .close:hover, +.my-popup .close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +.my-button { + display: inline-block; + padding: 10px 20px; + font-size: 16px; + font-weight: bold; + text-align: center; + text-transform: uppercase; + color: #fff; + background-color: #4CAF50; + border: none; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.2s ease; +} + +.my-button:hover, +.my-button:focus { + background-color: #3e8e41; +} + +.my-button:active { + background-color: #367835; +} + +.nf { + color: #aaa; + float: right; + transition: color 0.2s ease; +} + +.nf h1 { + padding-top: 10px; + font-size: 25px; + transition: color 0.2s ease; +} + +.nf p { + padding-top: 15px; + padding-bottom: 15px; + font-size: 18px; + transition: color 0.2s ease; +} + +select { + border: 1px solid #fff; + padding: 8px; + font-size: 16px; + border-radius: 3px; + width: 100%; + box-sizing: border-box; + margin-top: 5px; + background-color: #282a36; + outline-width: 10px; + outline-color: #2c3e50; + color: #fff; +} + +.del { + margin-right: 10px; +} + +/* .button a { + text-decoration: none; + display: flex; + color: white; +} */ + +/* Styles for news articles */ +.news { + background-color: var(--news-bgc); + box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.05); + border-radius: 8px; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.news-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + padding: 1.5rem 1.25rem 1rem 1.25rem; +} +.news-header div { + display: flex; + align-items: center; +} +.news-header div span { + width: 40px; + height: 40px; + border-radius: 8px; + display: inline-flex; + align-items: center; + justify-content: center; +} +.news-header div span img { + max-height: 100%; +} +.news-header div h3 { + margin-left: 0.75rem; + font-weight: 500; +} + +.news-body { + padding: 1rem 1.25rem; + font-size: 0.875rem; +} + + +.news-footer { + margin-top: auto; + padding: 1rem 1.25rem; + display: flex; + align-items: center; + justify-content: flex-end; + border-top: 1px solid var(--c-border-primary); +} +.news-footer p { + padding-right: 10px; +} +.news-footer a { + color: var(--c-text-action); + text-decoration: none; + font-weight: 500; + font-size: 0.875rem; +} + +#logo { + max-width: 400px; +} + +.components { + width: 75rem; + height: 40rem; + border-radius: 3rem; + box-shadow: 0.8rem 0.8rem 1.4rem var(--greyLight-2), -0.2rem -0.2rem 1.8rem var(--white); + padding: 4rem; + display: grid; + grid-template-columns: 17.6rem 19rem 20.4rem; + grid-template-rows: repeat(autofit, -webkit-min-content); + grid-template-rows: repeat(autofit, min-content); + grid-column-gap: 5rem; + grid-row-gap: 2.5rem; + align-items: center; +} + + + +/* RANGE-SLIDER */ +.slider { + grid-column: 3/4; + grid-row: 5/6; + align-self: center; + display: flex; + flex-direction: column; +} +.slider__box { + width: 100%; + height: 1rem; + cursor: pointer; + box-shadow: inset 0.2rem 0.2rem 0.5rem var(--greyLight-2), inset -0.2rem -0.2rem 0.5rem var(--white); + border-radius: 1rem; + position: relative; + display: flex; + justify-content: center; + align-items: center; +} +.slider__btn { + width: 2rem; + height: 2rem; + border-radius: 50%; + background: var(--white); + position: absolute; + box-shadow: 0px 0.1rem 0.3rem 0px var(--greyLight-3); + z-index: 200; + display: flex; + justify-content: center; + align-items: center; +} +.slider__btn:hover ~ .slider__tooltip { + opacity: 1; +} +.slider__btn::after { + content: ""; + position: absolute; + width: 0.8rem; + height: 0.8rem; + border-radius: 50%; + box-shadow: inset 0.2rem 0.2rem 0.5rem var(--greyLight-2), inset -0.2rem -0.2rem 0.5rem var(--white); +} +.slider__color { + height: 100%; + width: 50%; + position: absolute; + left: 0; + z-index: 100; + border-radius: inherit; + background: var(--primary); + background: linear-gradient(-1deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%); +} +.slider__tooltip { + position: absolute; + top: 2.6rem; + height: 2.5rem; + width: 3rem; + border-radius: 0.6rem; + display: flex; + justify-content: center; + align-items: center; + font-size: 1.2rem; + color: var(--primary); + box-shadow: 0.3rem 0.3rem 0.6rem var(--greyLight-2), -0.2rem -0.2rem 0.5rem var(--white); + opacity: 0; + transition: opacity 0.3s ease; +} diff --git a/submissions/ToggledDevPortal/DevPortal-main/homepage.html b/submissions/ToggledDevPortal/DevPortal-main/homepage.html new file mode 100644 index 00000000..9877edc5 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/homepage.html @@ -0,0 +1,253 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Toggled Dev

+ +
+
+ Home + Integrations + +
+
+
+ + + +
+ +
+
+ +
+ +
+ + + + + +
+
+
+ +

Codepen

+
+
+ +
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +

API Playground

+
+
+ +
+ +
+
+
+ + + + +
+
+
+ +
+ + +
+
+
+
+
+ + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/homepage.js b/submissions/ToggledDevPortal/DevPortal-main/homepage.js new file mode 100644 index 00000000..9c9febae --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/homepage.js @@ -0,0 +1,791 @@ +// // Populate the Todo List (Example items, can be saved to storage in the actual extension) +// const todoItems = ['Learn JavaScript', 'Build a Chrome Extension', 'Contribute to Open Source']; +// const todoList = document.getElementById('todoList'); +// todoItems.forEach(item => { +// const li = document.createElement('li'); +// li.textContent = item; +// todoList.appendChild(li); +// }); + +//Define Popups Array +const popups = {}; + +async function fetchTitleAndFavicon(url) { + try { + const response = await fetch('http://zymono.com/gettitleandfavicon', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ url }), + }); + + const data = await response.json(); + return data; + } catch (error) { + console.error('Error fetching data:', error); + return null; + } +} + +function getBaseUrl(url) { + // If the URL is not provided, use the current page's URL + if (!url) { + url = window.location.href; + } + + // Parse the URL to get its components + const parsedURL = new URL(url); + + // Combine the protocol, hostname, and port (if applicable) to form the base URL + const baseUrl = `${parsedURL.protocol}//${parsedURL.hostname}${parsedURL.port ? ':' + parsedURL.port : ''}`; + + return baseUrl; +} +try { + if (!String(window.location).includes('inte')) { + chrome.storage.sync.get(['stack'], result => { + if (!result.stack == true) { + document.getElementById('stackoverflow').remove() + } + }) + chrome.storage.sync.get(['replit'], result => { + if (!result.replit == true) { + document.getElementById('replit').remove() + } + }) + chrome.storage.sync.get(['github'], result => { + if (!result.github == true) { + document.getElementById('github').remove() + document.getElementById('githubbtn').remove() + } + }) + chrome.storage.sync.get(['snippet'], result => { + if (!result.snippet == true) { + document.getElementById('snippetbtn').remove() + } + }) + chrome.storage.sync.get(['lighthouse'], result => { + if (!result.lighthouse == true) { + document.getElementById('lighthouse').remove() + } + }) + chrome.storage.sync.get(['codepen'], result => { + if (!result.codepen == true) { + document.getElementById('codepen').remove() + } + }) + chrome.storage.sync.get(['playground'], result => { + if (!result.playground == true) { + document.getElementById('playground').remove() + } + }) + chrome.storage.sync.get(['openai'], result => { + if (!result.openai == true) { + document.getElementById('openai').remove() + } + }) + } +} catch { } + +try { + chrome.storage.sync.get(['tabs'], result => { + if (result.tabs) { + const tabs = JSON.parse(result.tabs) + + tabs.forEach(function (tab, index) { + const tabElement = document.createElement('a') + const tabsDiv = document.getElementById('tabs') + tabElement.href = tab + + fetchTitleAndFavicon(tab) + .then(data => { + if (String(data.favicon).includes('https://') || String(data.favicon).includes('http://')) { + tabElement.innerHTML = ` ${data.title}` + tabElement.classList.add('button') + tabElement.classList.add('del') + tabsDiv.append(tabElement) + } else if (String(data.favicon).includes('chrome-extension') || String(data.favicon).includes('found')) { + console.log('chrome') + tabElement.innerHTML = ` ${data.title}` + tabElement.classList.add('button') + tabElement.classList.add('del') + tabsDiv.append(tabElement) + } else { + console.log('ese') + tabElement.innerHTML = ` ${data.title}` + tabElement.classList.add('button') + tabElement.classList.add('del') + tabsDiv.append(tabElement) + } + }) + }) + } + }) +} catch { } + +// setTimeout(function() { +// document.querySelectorAll('.del').addEventListener('load', function() { +// const tabs = document.querySelectorAll('.del') + +// tabs.forEach(function(tab) { +// tab.addEventListener('contextmenu', function() { +// event.preventDefault(); +// alert('hello') +// chrome.storage.sync.get(['tabs'], result => { +// if (result.tabs) { + +// } +// }) +// }) +// }) +// }) +/* The above code is using JavaScript to set a timeout of 200 milliseconds before executing the code +inside the function. */ +// }, 200) +// chrome.storage.sync.get(['goal'], result => { +// if (result.goal) { +// fetchTitleAndFavicon(result.goal) +// .then(data => { +// if (String(data.favicon).includes('https://') || String(data.favicon).includes('http://')) { +// console.log(result.goal) +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } else if (String(data.favicon).includes('chrome-extension') || String(data.favicon).includes('found')) { +// console.log('chrome') +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } else { +// console.log('ese') +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } +// }) + + + +// } +// }) +// } + +let search; +chrome.storage.sync.get(['searchEngine'], result => { + search = result.searchEngine || 'https://www.google.com/search?q='; + console.log(search) +}); + +// document.addEventListener('keyup', function(event) { +// if (event.key === 'Shift') { +// shiftKeyPressed = false; +// chrome.storage.sync.get(['goal'], result => { +// if (result.goal) { +// fetchTitleAndFavicon(result.goal) +// .then(data => { +// if (String(data.favicon).includes('https://') || String(data.favicon).includes('http://')) { +// console.log(result.goal) +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } else if (String(data.favicon).includes('chrome-extension') || String(data.favicon).includes('found')) { +// console.log('chrome') +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } else { +// console.log('ese') +// document.getElementById('goal').innerHTML = ` ${data.title}` +// } +// }) +// } +// }) + +// document.getElementById('goal').addEventListener('click', function() { + +// }) +// } +// }); +// document.addEventListener('keydown', function(event) { +// if (event.key === 'Shift') { +// shiftKeyPressed = true; +// document.getElementById('goal').addEventListener('click', function() { +// const prompt = window.prompt('Enter a url for your goal.', 'E.g. https://edx.org/school/google/') + +// if (prompt == 'delete') { +// chrome.storage.sync.remove(['goal']) +// location.reload() +// } + +// if (prompt) { +// chrome.storage.sync.set({ goal: prompt }, () => { +// location.reload() +// }) +// } +// }) +// } +// }); + +try { + if (String(search).includes('ai')) { + document.getElementById('o').innerText = 'Ask' + } + document.getElementById('o').addEventListener('click', function () { + window.location = `${search}${document.getElementById('i').value}` + }) + document.getElementById('so').addEventListener('click', function () { + window.location = `https://stackoverflow.com/search?q=${document.getElementById('soi').value}` + }) + document.getElementById('ro').addEventListener('click', function () { + window.location = `https://replit.com/search?query=${document.getElementById('ri').value}&category=Files&hasCurrentUser=true` + }) + document.getElementById('gho').addEventListener('click', function () { + window.location = `https://github.com/search?q=${document.getElementById('ghi').value}&category=Files` + }) + document.getElementById('lgr').addEventListener('click', function () { + window.location = `https://googlechrome.github.io/lighthouse/viewer/?psiurl=${encodeURIComponent(document.getElementById('lurl').value)}&strategy=desktop&category=performance&category=accessibility&category=best-practices&category=seo&category=pwa&utm_source=lh-chrome-ext` + }) + + + // document.getElementById('goal').addEventListener('click', function() { + // const prompt = window.prompt('Enter a url for your goal.', 'E.g. https://edx.org/school/google/') + + // if (prompt == 'delete') { + // chrome.storage.sync.remove(['goal']) + // location.reload() + // } + + // if (prompt) { + // chrome.storage.sync.set({ goal: prompt }, () => { + // location.reload() + // }) + // } + // }) + + // document.getElementById('cpo').addEventListener('click', function() { + // // window.location = `https://github.com/search?q=${document.getElementById('cpi').value}&category=Files` + // fetch("https://codepen.io/pen/define", { + // method: "POST", + // target: "_blank", + // headers: { + // "Content-Type": "application/json" + // }, + // body: JSON.stringify({ + // title: "New Dev Pen!", + // description: "New Codepen project created with the Zymono Developer Portal.", + // html: document.getElementById('cpi').value + // }) + // }) + // }) +} catch { } + +// try { +// if (!window.localStorage.getItem('github')) { +// document.getElementById('githubbtn').remove() +// } +// } catch {} + + +try { + document.getElementById("i").addEventListener("keypress", function (event) { + if (event.keyCode === 13 || event.which === 13) { + // The Enter key was pressed + var inputValue = event.target.value; + window.location = `${search}${document.getElementById('i').value}` + } + }); + document.getElementById("soi").addEventListener("keypress", function (event) { + if (event.keyCode === 13 || event.which === 13) { + // The Enter key was pressed + var inputValue = event.target.value; + window.location = `https://stackoverflow.com/search?q=${document.getElementById('soi').value}` + } + }); + document.getElementById("ri").addEventListener("keypress", function (event) { + if (event.keyCode === 13 || event.which === 13) { + // The Enter key was pressed + var inputValue = event.target.value; + window.location = `https://replit.com/search?query=${document.getElementById('ri').value}&category=Files&hasCurrentUser=true` + } + }); + document.getElementById("ghi").addEventListener("keypress", function (event) { + if (event.keyCode === 13 || event.which === 13) { + // The Enter key was pressed + var inputValue = event.target.value; + window.location = `https://github.com/search?q=${document.getElementById('ghi').value}&category=Files` + } + }); + document.getElementById('cpi').addEventListener('keyup', function () { + document.getElementById('cpb').value = `{"title": "New Dev Pen!", "html": "${document.getElementById('cpi').value}"}` + }) + + document.getElementById('purl').addEventListener('keyup', function () { + document.getElementById('pform').action = document.getElementById('purl').value + }) + document.getElementById('ptype').addEventListener('keyup', function () { + document.getElementById('pform').method = document.getElementById('ptype').value + }) + // document.getElementById("cpi").addEventListener("keypress", function(event) { + // if (event.keyCode === 13 || event.which === 13) { + // // The Enter key was pressed + // var inputValue = event.target.value; + // fetch("https://codepen.io/pen/define", { + // method: "POST", + // target: "_blank", + // headers: { + // "Content-Type": "application/json" + // }, + // body: JSON.stringify({ + // title: "New Dev Pen!", + // description: "New Codepen project created with the Zymono Developer Portal.", + // html: document.getElementById('cpi').value + // }) + // }) + // } + // }); +} catch { } + +window.onload = function () { + document.getElementById('i').focus(); + document.getElementById('i').click() +}; +// let i = false; +// document.addEventListener('keydown', function(event) { +// const pressedKey = event.key; +// if (!i) { +// document.getElementById('i').value == event.key +// document.getElementById('i').focus(); +// document.getElementById('i').click() + +// i = true; +// return +// } + +// }); +// const accessToken = ""; + +// const fetchData = async () => { +// const url = "https://api.dropboxapi.com/2/file_requests/list_v2"; +// const limit = 1000; + +// try { +// const response = await fetch(url, { +// method: "POST", +// headers: { +// Authorization: `Bearer ${accessToken}`, +// "Content-Type": "application/json" +// }, +// body: JSON.stringify({ limit }) +// }); + +// if (!response.ok) { +// throw new Error(`Request failed with status: ${response.status}`); +// } + +// const data = await response.json(); +// console.log(data); // Use the response data as needed +// } catch (error) { +// console.error("Error fetching data:", error); +// } +// }; + +// fetchData(); + +try { + chrome.storage.sync.get(['news'], result => { + if (result.news) { + const apiUrl = 'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'; + const articleBaseUrl = 'https://hacker-news.firebaseio.com/v0/item/'; + + fetch(apiUrl) + .then((response) => response.json()) + .then((data) => { + // Shuffle the article IDs randomly + const shuffledIds = data.sort(() => Math.random() - 0.5).slice(0, 30); + + const articlesContainer = document.getElementById('cards'); + const promises = shuffledIds.map((id) => + fetch(`${articleBaseUrl}${id}.json`).then((response) => response.json()) + ); + + Promise.all(promises) + .then((articles) => { + console.log(articles) + articles = articles.filter((article) => article && article.type === 'story' && article.text); + + articles.slice(0, 3).forEach((article) => { + const trimmedText = article.text.length > 300 ? `${article.text.slice(0, 300)}...` : article.text; + + const articleElement = document.createElement('article'); + articleElement.className = 'news'; + articleElement.innerHTML = ` +
+
+ +

${article.title}

+
+
+
+ ${trimmedText} +
+ + `; + articlesContainer.insertBefore(articleElement, document.getElementById('insert')); + }); + }) + .catch((error) => console.error('Error fetching articles:', error)); + }) + .catch((error) => console.error('Error fetching article IDs:', error)); + } + }) +} catch { } + +window.addEventListener('hashchange', handleHashChange); + +function handleHashChange() { + console.log(window.location.hash) + const articleBaseUrl = 'https://hacker-news.firebaseio.com/v0/item/'; + // This function will be called whenever the hash in the URL changes. + // You can add your logic here to respond to the hash change. + if (String(window.location.hash).includes('news-')) { + const hash = String(window.location.hash).split('news-') + + const id = hash[1] + console.log(id) + + fetch(`${articleBaseUrl}${id}.json`) + .then((response) => response.json()) + .then((article) => { + console.log(article) + + let button = `` + + if (article.id) { + button += ` + View Post + ` + } + + if (article.url) { + button += ` + Go to URL + ` + } + + + const html = ` +
+ +
` + + + document.querySelector('body').innerHTML += html + document.getElementById('close').addEventListener('click', function () { + document.getElementById('close').parentElement.parentElement.remove() + window.location = '#' + }) + }) + .catch((error) => { + console.error('Error fetching data:', error); + // Optionally, you can alert an error message if something goes wrong during the fetch. + alert('Error fetching data. Please try again later.'); + }); + + } + + if (String(window.location.hash).includes('popup-')) { + const hash = String(window.location.hash).split('popup-') + console.log(popups[hash[1]]) + + const html = ` + ` + + + document.querySelector('body').innerHTML += html + document.getElementById('close').addEventListener('click', function () { + document.getElementById('close').parentElement.parentElement.remove() + window.location = '#' + }) + } + // Or call a specific function to handle the hash change + // handleHashChangeLogic(window.location.hash); +} + +/*
+
+
+ +

News

+
+
+ +
+ + Hello I am a news article + +
+ +
*/ + +// GET REPLIT USER INFO + +try { + chrome.storage.sync.get(['replpfp', 'replname', 'replbio', 'replurl'], result => { + if (result.replpfp) { + document.getElementById('replpfp').src = result.replpfp + document.getElementById('replurl').href = result.replurl + '?newRepl' + document.getElementById('replname').innerText = `Replit: ${result.replname}` + } + }) + + // script.js + const developerJokes = [ + "Why do programmers prefer dark mode? Because light attracts bugs!", + "Why did the developer go broke? Because he used up all his cache!", + "Why did the developer quit his job? He didn't get arrays.", + "Why do programmers always mix up Christmas and Halloween? Because Oct 31 == Dec 25!", + "Why do developers prefer to work in the dark? Because light travels faster than sound, and they want to appear bright until you hear them speak.", + "Why don't programmers like nature? It has too many bugs.", + "Why do developers prefer dark chocolate? Because it's byte-sized!", + "Why was the JavaScript developer sad? Because he didn't `null`ify his feelings.", + "Why do C# developers keep their windows open? Because they want to catch all the exceptions!", + "Why did the developer break up with his git repository? It had too many conflicts and couldn't commit.", + "Why do developers always mix up their left and right? Because they're always using `=` instead of `==`.", + "Why do Java developers wear glasses? Because they can't C#!", + "Why do developers always bring their umbrellas? In case it starts raining functions.", + "Why do programmers always mix up Christmas and Halloween? Because Oct 31 == Dec 25!", + "Why don't developers get along with their managers? Because they don't appreciate their constant refactoring.", + "Why don't front-end developers like nature? It has too many bugs they can't style.", + "Why was the developer's computer cold? It left its Windows open!", + "Why did the developer go broke? Because he didn't have enough cache flow!", + "Why do developers prefer dark mode? Because light attracts bugs!", + "Why do developers prefer Git in their version control? Because they can branch out easily when they have commitment issues.", + "Why do programmers always mix up their Halloween and Christmas decorations? Because Oct 31 == Dec 25!", + "Why don't programmers like to play hide and seek? Because good players are hard to find.", + "Use Toggled at toggled.tech", + "Why do programmers always mix up Christmas and Halloween? Because Oct 31 == Dec 25!", + "Why did the developer start using tabs instead of spaces? Because he wanted to break free!", + 'Why do developers prefer dark themes? Because they find them more "comforting" during debugging sessions.', + "Why was the computer cold? It left its Windows open!", + "Why do Java developers always wear glasses? Because they don't C#!", + 'Why do developers bring their umbrellas? Because they expect some "JavaScript" showers.', + "Why was the web developer so cold? His stylesheets were in the Arctic.", + 'Why do C# developers keep their windows open? Because they want to "catch" all the bugs.', + `Why did the developer go broke? Because he didn't get "arrays" in life.`, + ]; + + // Add more jokes here (up to 31) + + chrome.storage.sync.get(['jokes'], result => { + if (result.jokes) { + function getJokeOfTheDay() { + const currentDate = new Date(); + const jokeIndex = currentDate.getDate() % developerJokes.length; + return developerJokes[jokeIndex]; + } + + function displayJoke() { + const jokeContainer = document.getElementById('joke-container'); + // let joke = localStorage.getItem('developer_joke'); + const joke = getJokeOfTheDay(); + + jokeContainer.innerHTML = `

${joke}

`; + } + + displayJoke(); + } + }) + + + // Check if dark mode is enabled + function isDarkModeEnabled() { + return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + } + + // Check if light mode is enabled + function isLightModeEnabled() { + return window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches; + } + + // Example usage + if (isDarkModeEnabled()) { + console.log("Dark mode is enabled."); + document.getElementById('logo').src = 'images/Toggled-Light-Left.png' + // Your dark mode specific code here + } else if (isLightModeEnabled()) { + console.log("Light mode is enabled."); + document.getElementById('logo').src = 'images/Toggled-Left.png' + // Your light mode specific code here + } else { + console.log("Color scheme preference not detected."); + document.getElementById('logo').src = 'images/Toggled.png' + // Handle the case when the preference is not explicitly set. + } +} catch { } + +function pin() { + chrome.storage.sync.get(['pin'], result => { + if (result.pin) { + if (!window.sessionStorage.getItem('pass') && result.pin) { + const bg = document.createElement('div') + bg.setAttribute('style', 'display: block; background-color: white; position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 999999;') + + document.querySelector('html').append(bg) + + setTimeout(function () { + if (window.prompt('Enter your pin!') == window.atob(result.pin)) { + bg.remove() + window.sessionStorage.setItem('pass', 'true') + } else { + pin() + } + }, 2) + } + } + }) +} + +pin() + +async function fetchAndParseModules() { + chrome.storage.sync.get({ modules: [] }, async (data) => { + const modules = data.modules; + + if (modules.length === 0) { + console.log("No modules found."); + return; + } + + for (const url of modules) { + try { + const response = await fetch(url); + if (!response.ok) { + console.error(`Failed to fetch module: ${url}`); + continue; + } + + const scriptContent = await response.text(); + // console.log(`Module from ${url}:\n`, scriptContent); + const content = JSON.parse(scriptContent) + + // Get details + const details = content.details; + const blocks = content.blocks; + + if (details) { + console.log("Extracted App Details:", details); + } else { + console.error("Failed to extract app details."); + return "No details" + } + + if (blocks) { + // console.log("Extracted Blocks:", blocks); + + blocks.forEach((block) => { + document.getElementById("cards").innerHTML += `
+
+
+ +

${block.title}

+
+
+ + +
+ ${block.content} +
+ +
` + }) + } + + if (content.popups) { + const popups1 = content.popups; + console.log("Extracted Popups:", popups1); + popups1.forEach((popup) => { + popups[popup.id] = popup; + }) + } + + if (content.panels) { + const panels = content.panels; + // console.log("Extracted Panels:", panels); + document.getElementById("homeTab").addEventListener('click', () => { + document.getElementById("cards").style.display = ''; + document.getElementById("customPanel").style.display = 'none'; + document.querySelector("#vertical-tabs .active").classList.remove("active"); + document.getElementById("homeTab").classList.add("active"); + document.getElementById("customPanel").innerHTML = '' + }) + + panels.forEach((panel) => { + const panelElement = document.createElement('a'); + panelElement.href = '#'; + panelElement.textContent = panel.title; + panelElement.addEventListener('click', () => { + document.getElementById("cards").style.display = 'none'; + document.getElementById("customPanel").style.display = ''; + document.querySelector("#vertical-tabs .active").classList.remove("active"); + panelElement.classList.add("active"); + + panel.blocks.forEach((block) => { + document.getElementById("customPanel").innerHTML += `
+
+
+ +

${block.title}

+
+
+ + +
+ ${block.content} +
+ +
` + }) + + }) + document.getElementById("vertical-tabs").appendChild(panelElement); + }) + } + + } catch (error) { + console.warn(`Error fetching module from ${url}:`, error); + } + } + }); +} + +// Function to convert a JavaScript object-like string to valid JSON +function normalizeJavaScriptObject(jsObjectString) { + return JSON.parse( + jsObjectString + .replace(/(\w+):/g, '"$1":') // Quote unquoted keys + .replace(/'/g, '"') // Convert single quotes to double quotes + ); +} + + +// Call the function to fetch and parse modules +fetchAndParseModules(); + diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/DevPortal.png b/submissions/ToggledDevPortal/DevPortal-main/images/DevPortal.png new file mode 100644 index 00000000..b971242f Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/DevPortal.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Left.png b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Left.png new file mode 100644 index 00000000..4da1eb00 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Left.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light-Left.png b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light-Left.png new file mode 100644 index 00000000..7c4829e9 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light-Left.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light.png b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light.png new file mode 100644 index 00000000..8bd3017b Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled-Light.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/Toggled.png b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled.png new file mode 100644 index 00000000..22a6995d Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/Toggled.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/api.png b/submissions/ToggledDevPortal/DevPortal-main/images/api.png new file mode 100644 index 00000000..715329be Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/api.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/icon128.png b/submissions/ToggledDevPortal/DevPortal-main/images/icon128.png new file mode 100644 index 00000000..9120dce5 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/icon128.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/icon48.png b/submissions/ToggledDevPortal/DevPortal-main/images/icon48.png new file mode 100644 index 00000000..c1a73ec4 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/icon48.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/images/jokes.png b/submissions/ToggledDevPortal/DevPortal-main/images/jokes.png new file mode 100644 index 00000000..7e138497 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/images/jokes.png differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/int.js b/submissions/ToggledDevPortal/DevPortal-main/int.js new file mode 100644 index 00000000..d4a94ea1 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/int.js @@ -0,0 +1,126 @@ +let search1 = false; +chrome.storage.sync.get(['github'], result => { + search1 = result.github; + console.log(search1) + if (search1) { + document.getElementById('gh').checked = true + document.getElementById('ghint').remove() + } + }); + +if (search1) { + document.getElementById('gh').checked = true + document.getElementById('ghint').remove() +} + +if(new URLSearchParams(window.location.search).get('ghun')) { + // window.localStorage.setItem('github', new URLSearchParams(window.location.search).get('ghun')) + chrome.storage.sync.set({ github: new URLSearchParams(window.location.search).get('ghun') }, () => { + window.location = 'integrations.html' + }) +} + +if(new URLSearchParams(window.location.search).get('repl')) { + // window.localStorage.setItem('github', new URLSearchParams(window.location.search).get('ghun')) + const user = JSON.parse(new URLSearchParams(window.location.search).get('repl')) + + const name = user.user + const uid = user.uid + const url = user.url + const pfp = user.pfp + const bio = user.bio + const teams = user.teams + const roles = user.roles + + chrome.storage.sync.set({ replname: name }, () => { + chrome.storage.sync.set({ repluid: uid }, () => { + chrome.storage.sync.set({ replurl: url }, () => { + chrome.storage.sync.set({ replpfp: pfp }, () => { + chrome.storage.sync.set({ replbio: bio }, () => { + chrome.storage.sync.set({ replit: true }, () => { + window.location = 'integrations.html' + }) + }) + }) + }) + }) + }) +} + +document.getElementById('so').addEventListener('click', function() { + chrome.storage.sync.set({ stack: true }, () => { + window.location = 'integrations.html' + }) +}) +document.getElementById('repl').addEventListener('click', function() { + window.location = 'https://developer-portal.cosmixcom.repl.co' + // chrome.storage.sync.set({ replit: true }, () => { + // window.location = 'integrations.html' + // }) +}) +document.getElementById('pen').addEventListener('click', function() { + chrome.storage.sync.set({ codepen: true }, () => { + window.location = 'integrations.html' + }) +}) +document.getElementById('pg').addEventListener('click', function() { + chrome.storage.sync.set({ playground: true }, () => { + window.location = 'integrations.html' + }) +}) + +chrome.storage.sync.get(['stack'], result => { + if (result.stack == true) { + document.getElementById('so').innerText = 'Disable Integration' + document.getElementById('st').checked = true + + document.getElementById('so').addEventListener('click', function() { + chrome.storage.sync.set({ stack: false }, () => { + window.location = 'integrations.html' + }) + }) + } + }) + chrome.storage.sync.get(['replit'], result => { + if (result.replit == true) { + document.getElementById('repl').innerText = 'Disable Integration' + document.getElementById('rt').checked = true + + document.getElementById('repl').addEventListener('click', function() { + chrome.storage.sync.set({ replit: false }, () => { + window.location = 'integrations.html' + }) + }) + } + }) + + chrome.storage.sync.get(['codepen'], result => { + if (result.codepen == true) { + document.getElementById('pen').innerText = 'Disable Integration' + document.getElementById('ct').checked = true + + document.getElementById('pen').addEventListener('click', function() { + chrome.storage.sync.set({ codepen: false }, () => { + window.location = 'integrations.html' + }) + }) + } + }) + + chrome.storage.sync.get(['playground'], result => { + if (result.playground == true) { + document.getElementById('pg').innerText = 'Disable Integration' + document.getElementById('pt').checked = true + + document.getElementById('pg').addEventListener('click', function() { + chrome.storage.sync.set({ playground: false }, () => { + window.location = 'integrations.html' + }) + }) + } + }) +// chrome.storage.sync.get(['github'], result => { +// if (!result.stack == true) { +// document.getElementById('github').remove() +// } +// }) \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/integrations.html b/submissions/ToggledDevPortal/DevPortal-main/integrations.html new file mode 100644 index 00000000..4cf771b7 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/integrations.html @@ -0,0 +1,401 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

Intergrations and connected apps

+

Supercharge your workflow and connect the tools you use every day.

+
+ +
+
+ +
+
+ +
+
+
+ +

GitHub

+
+ +
+
+

Find and open your GitHub Repositories or search code Repositories.

+
+ +
+
+
+
+ +

Stack Overflow

+
+ +
+ +
+ Search your coding needs on Stack Overflow +
+ +
+
+
+
+ +

Replit

+
+ +
+ +
+ Search projects on Replit.com. +
+ +
+
+
+
+ +

Codepen

+
+ +
+ +
+ Create new codepen projects seamlessly. +
+ +
+
+
+
+ +

API Playground

+
+ +
+ +
+ Send API requests to external sites quickly. +
+ +
+ +
+
+
+
+
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/func/gpt.js b/submissions/ToggledDevPortal/DevPortal-main/js/func/gpt.js new file mode 100644 index 00000000..43ccefc2 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/func/gpt.js @@ -0,0 +1,48 @@ +if (String(window.location).includes('openai') && String(window.location).includes('?toggledAuth')) { + // document.querySelector('[data-cy="header-new-repl-btn"]').click() + setTimeout(function() { + // document.querySelector('[data-cy="create-repl-title-input"]').disabled = false + const un = document.querySelector('[data-headlessui-state]').querySelector('.grow').innerHTML + + chrome.runtime.sendMessage({ openai: un }, function (response) { + // This callback function is optional, you can handle the response if needed. + if (response && response.success) { + console.log('Redirection successful!'); + window.close() + } + }); + }, 400) + // setTimeout(function() { + // document.querySelector('[data-cy="create-repl-title-input"]').placeholder = 'Name your DevPortal Repl' + // }, 1000) +} + +if (String(window.location).includes('openai') && String(window.location).includes('?new')) { + // document.querySelector('[data-cy="header-new-repl-btn"]').click() + setTimeout(function() { + // document.querySelector('[data-cy="create-repl-title-input"]').disabled = false + document.getElementById('prompt-textarea').click() + document.getElementById('prompt-textarea').innerHTML = new URLSearchParams(window.location.search).get('new') + document.getElementById('prompt-textarea').value = new URLSearchParams(window.location.search).get('new') + // Create a new KeyboardEvent for space key +const event = new KeyboardEvent('keydown', { + key: ' ', // Key you want to simulate (space) + keyCode: 32, // Key code for space key + which: 32 // Which key +}); + +// Dispatch the event to a target element (e.g., a text input) +const targetElement = document.getElementById('prompt-textarea'); +targetElement.dispatchEvent(event); + + + const btn = document.getElementById('prompt-textarea').parentElement.querySelector('button') + btn.disabled = false + btn.click() + + + }, 2000) + // setTimeout(function() { + // document.querySelector('[data-cy="create-repl-title-input"]').placeholder = 'Name your DevPortal Repl' + // }, 1000) +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/func/replit.js b/submissions/ToggledDevPortal/DevPortal-main/js/func/replit.js new file mode 100644 index 00000000..cad0771a --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/func/replit.js @@ -0,0 +1,10 @@ +if (String(window.location).includes('replit') && String(window.location).includes('?newRepl')) { + document.querySelector('[data-cy="header-new-repl-btn"]').click() + setTimeout(function() { + // document.querySelector('[data-cy="create-repl-title-input"]').disabled = false + document.querySelector('[data-cy="create-repl-title-input"]').placeholder = 'Name your DevPortal Repl' + }, 400) + setTimeout(function() { + document.querySelector('[data-cy="create-repl-title-input"]').placeholder = 'Name your DevPortal Repl' + }, 1000) +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/func/zymono.js b/submissions/ToggledDevPortal/DevPortal-main/js/func/zymono.js new file mode 100644 index 00000000..f019aecf --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/func/zymono.js @@ -0,0 +1,24 @@ +if (String(window.location).includes('pay.zymono') && String(window.location).includes('#') && String(window.location).includes('%')) { + chrome.runtime.sendMessage({ sub1: true }, function (response) { + // This callback function is optional, you can handle the response if needed. + if (response && response.success) { + console.log('Redirection successful!'); + window.close() + } + }); +} + +window.addEventListener('hashchange', handleHashChange); + +function handleHashChange() { + console.log(window.location.hash) + if (String(window.location).includes('pay.zymono') && String(window.location).includes('#') && String(window.location).includes('%')) { + chrome.runtime.sendMessage({ sub1: true }, function (response) { + // This callback function is optional, you can handle the response if nee14ded. + if (response && response.success) { + console.log('Redirection successful!'); + window.close() + } + }); + } +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/popup.js b/submissions/ToggledDevPortal/DevPortal-main/js/popup.js new file mode 100644 index 00000000..90fe7623 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/popup.js @@ -0,0 +1,4 @@ +// document.getElementById('openNewTabButton').addEventListener('click', function() { + chrome.tabs.create({ url: 'chrome://newtab' }); +// }); + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/prod.js b/submissions/ToggledDevPortal/DevPortal-main/js/prod.js new file mode 100644 index 00000000..5967ad35 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/prod.js @@ -0,0 +1,123 @@ +// let search1 = false; +// chrome.storage.sync.get(['github'], result => { +// search1 = result.github; +// console.log(search1) +// if (search1) { +// document.getElementById('gh').checked = true +// document.getElementById('ghint').remove() +// } +// }); + +// if (search1) { +// document.getElementById('gh').checked = true +// document.getElementById('ghint').remove() +// } +document.getElementById('ghint').addEventListener('click', function() { + chrome.storage.sync.set({ news: true }, () => { + window.location = 'productivity.html' + }) +}) + +chrome.storage.sync.get(['news'], result => { + if (result.news == true) { + document.getElementById('ghint').innerText = 'Disable Integration' + document.getElementById('gh').checked = true + + document.getElementById('ghint').addEventListener('click', function() { + chrome.storage.sync.set({ news: false }, () => { + window.location = 'productivity.html' + }) + }) + } + }) + + document.getElementById('sint').addEventListener('click', function() { + chrome.storage.sync.set({ snippet: true }, () => { + window.location = 'productivity.html' + }) +}) + +chrome.storage.sync.get(['snippet'], result => { + if (result.snippet == true) { + document.getElementById('sint').innerText = 'Disable Integration' + document.getElementById('sch').checked = true + + document.getElementById('sint').addEventListener('click', function() { + chrome.storage.sync.set({ snippet: false }, () => { + window.location = 'productivity.html' + }) + }) + } + }) + +document.getElementById('lint').addEventListener('click', function() { + chrome.storage.sync.set({ lighthouse: true }, () => { + window.location = 'productivity.html' + }) +}) + +chrome.storage.sync.get(['lighthouse'], result => { + if (result.lighthouse == true) { + document.getElementById('lint').innerText = 'Disable Integration' + document.getElementById('lch').checked = true + + document.getElementById('lint').addEventListener('click', function() { + chrome.storage.sync.set({ lighthouse: false }, () => { + window.location = 'productivity.html' + }) + }) + } + }) + + document.getElementById('jokes').addEventListener('click', function() { + chrome.storage.sync.set({ jokes: true }, () => { + window.location = 'productivity.html' + }) +}) + +chrome.storage.sync.get(['jokes'], result => { + if (result.jokes == true) { + document.getElementById('jokes').innerText = 'Disable Integration' + document.getElementById('jt').checked = true + + document.getElementById('jokes').addEventListener('click', function() { + chrome.storage.sync.set({ jokes: false }, () => { + window.location = 'productivity.html' + }) + }) + } +}) +// chrome.storage.sync.get(['github'], result => { +// if (!result.stack == true) { +// document.getElementById('github').remove() +// } +// }) + +document.getElementById('openai').addEventListener('click', function() { + if (window.confirm('By clicking "Ok" you agree for toggled to vist ChatGPT on your behalf and scrape your profile picture and name from the page.')) { + window.location = 'https://chat.openai.com/?toggledAuth' + } +}) + +chrome.storage.sync.get(['openai'], result => { + if (result.openai) { + document.getElementById('openai').innerText = 'Disable Integration' + document.getElementById('ot').checked = true + console.log(result.openai) + + document.getElementById('openai').addEventListener('click', function() { + chrome.storage.sync.set({ openai: false }, () => { + window.location = 'productivity.html' + }) + }) + } +}) + +if (new URLSearchParams(window.location.search).get('openai')) { + chrome.storage.sync.set({ openai: new URLSearchParams(window.location.search).get('openai') }, () => { + window.location = 'productivity.html' + // chrome.storage.sync.set({ openaipfp: new URLSearchParams(window.location.search).get('pfp') }, () => { + // window.location = 'productivity.html' + // }) +}) +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/snippets.js b/submissions/ToggledDevPortal/DevPortal-main/js/snippets.js new file mode 100644 index 00000000..c7fe7c9f --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/snippets.js @@ -0,0 +1,155 @@ +chrome.storage.sync.get(['snippets'], result => { + if (result.snippets) { + console.log(result.snippets) + const snippets = JSON.parse(result.snippets) + + snippets.forEach(snippet => { + const trimmedCode = snippet.code.length > 300 ? `${snippet.code.slice(0, 300)}...` : snippet.code; + + const a = `
+
+
+ +

${snippet.name}

+
+
+
+

${trimmedCode}

+
+ +
` + + const cards = document.getElementById('id') + cards.innerHTML += a + }); + } +}) + +document.getElementById('new').addEventListener('click', function() { + const prompt = window.prompt('Please choose a name for your code snippet...') + + if (prompt) { + const prompt2 = window.prompt('Please choose enter code for your snippet...') + if (prompt2) { + chrome.storage.sync.get(['snippets'], result => { + if (result.snippets) { + const snippets = JSON.parse(result.snippets) + snippets.push({ + name: prompt, + code: prompt2 + }) + chrome.storage.sync.set({ snippets: JSON.stringify(snippets) }, () => { + window.location = 'snippets.html' + }) + } else { + const snippets = [] + snippets.push({ + name: prompt, + code: prompt2 + }) + chrome.storage.sync.set({ snippets: JSON.stringify(snippets) }, () => { + window.location = 'snippets.html' + }) + } + }) + } + } +}) + +function copyToClipboard(text) { + // Create a temporary textarea element to hold the text + const textarea = document.createElement('textarea'); + textarea.value = text; + + // Make the textarea hidden from the user + textarea.style.position = 'absolute'; + textarea.style.left = '-9999px'; + + // Append the textarea to the DOM + document.body.appendChild(textarea); + + // Select and copy the text from the textarea + textarea.select(); + document.execCommand('copy'); + + // Remove the temporary textarea + document.body.removeChild(textarea); + +} + +function handleHashChange() { + console.log(window.location.hash) + // This function will be called whenever the hash in the URL changes. + // You can add your logic here to respond to the hash change. + if (String(window.location.hash).includes('snippets-')) { + const hash = String(window.location.hash).split('#snippets-')[1] + copyToClipboard(window.btoa(hash)) + if (window.confirm(`Send this code to another DevPortal user for them to import. (It has been copied to your clipboard) + +${window.btoa(hash)}`)) { + window.location = '#' + } else { + window.location = '#' + } + } + if (String(window.location.hash).includes('del-')) { + const hash = String(window.location.hash).split('#del-')[1] + chrome.storage.sync.get(['snippets'], result => { + if (result.snippets) { + const snippets = JSON.parse(result.snippets) + let objectToDelete = window.atob(hash); + +// Find the index of the object in the array + let indexToDelete = snippets.findIndex((obj) => obj.id === objectToDelete.id); + + snippets.splice(indexToDelete, 1); + chrome.storage.sync.set({ snippets: JSON.stringify(snippets) }, () => { + window.location = 'snippets.html' + }) + } else { + alert("Cannot delete a snippet that doesn't exist!") + } + }) + } + } + + window.addEventListener('hashchange', handleHashChange); + + document.getElementById('import').addEventListener('click', function() { + const prompt = window.prompt('Please enter a snippet code.') + + if (prompt) { + // const prompt2 = window.prompt('Please choose enter code for your snippet...') + + chrome.storage.sync.get(['snippets'], result => { + if (result.snippets) { + const snippets = JSON.parse(result.snippets) + snippets.push({ + name: `Snippet ${snippets.length}`, + code: window.atob(prompt) + }) + chrome.storage.sync.set({ snippets: JSON.stringify(snippets) }, () => { + window.location = 'snippets.html' + }) + } else { + const snippets = [] + snippets.push({ + name: `Snippet ${snippets.length}`, + code: window.atob(prompt) + }) + chrome.storage.sync.set({ snippets: JSON.stringify(snippets) }, () => { + window.location = 'snippets.html' + }) + } + }) + } +}) + +// chrome.storage.sync.set({ snippets: JSON.stringify([]) }, () => { +// }) \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/js/upload.js b/submissions/ToggledDevPortal/DevPortal-main/js/upload.js new file mode 100644 index 00000000..e245bbb4 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/js/upload.js @@ -0,0 +1,70 @@ +document.getElementById("uploadForm").addEventListener("submit", function(event) { + event.preventDefault(); + + const fileInput = document.getElementById("fileInput"); + const outputDiv = document.getElementById("output"); + + if (fileInput.files.length === 0) { + outputDiv.textContent = "Please select a folder with a manifest file."; + return; + } + + // Find the manifest file in the uploaded folder + const manifestFile = findManifestFile(fileInput.files); + + if (!manifestFile) { + outputDiv.textContent = "Manifest file not found."; + return; + } + + // Get the folder path of the manifest file + const folderPath = manifestFile.webkitRelativePath.replace("manifest.json", ""); + + + // Read the manifest file + const reader = new FileReader(); + + reader.onload = function(event) { + const manifestContent = event.target.result; + try { + const manifestData = JSON.parse(manifestContent); + const name = manifestData.name; + const version = manifestData.version; + + const logo = manifestData.logo; + const logoFileName = logo.split('/')[1] // Update with the actual image filename + // Load and display the image + const logoPath = folderPath + logoFileName; + const imageBlob = getFileBlob(logoPath, fileInput.files); + const imageUrl = URL.createObjectURL(imageBlob); + + outputDiv.innerHTML = ` +

Name: ${name}

+

Version: ${version}

+ Logo + `; + } catch (error) { + outputDiv.textContent = "Error reading manifest file."; + } + }; + + reader.readAsText(manifestFile); +}); + +function findManifestFile(files) { + for (const file of files) { + if (file.name === "manifest.json") { + return file; + } + } + return null; +} + +function getFileBlob(filePath, fileList) { + for (const file of fileList) { + if (file.webkitRelativePath === filePath) { + return file; + } + } + return null; +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/manifest.json b/submissions/ToggledDevPortal/DevPortal-main/manifest.json new file mode 100644 index 00000000..da940a26 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/manifest.json @@ -0,0 +1,48 @@ +{ + "action": { + "default_popup": "popup.html" + }, + "background": { + "service_worker": "background.js" + }, + "chrome_url_overrides": { + "newtab": "homepage.html" + }, + "content_scripts": [ { + "js": [ "content.js" ], + "matches": [ "" ] + }, { + "js": [ "content.js" ], + "matches": [ "*://*.cosmixcom.repl.co/*" ] + }, { + "js": [ "js/func/replit.js" ], + "matches": [ "*://*.replit.com/*" ] + }, { + "js": [ "js/func/gpt.js" ], + "matches": [ "*://*.openai.com/*" ] + }, { + "js": [ "js/func/zymono.js" ], + "matches": [ "*://*.zymono.com/*" ] + } ], + "description": "A portal into a developers dream.", + "icons": { + "128": "images/icon128.png", + "48": "images/icon48.png", + "500": "images/DevPortal.png" + }, + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiJZGXj3NTU0qcCVoa0kJbIVeQzp6iyrcQLDl6P9vRAcD1TLfE5R+FW67veHElwMnQN2K/3yOSS0okgtOc4QnuhPkvYLT0WCuQ5UBug0JWGEMS9D+MdxPuRxH3Mt+q1HTxV3oZmI0ntraiUiuaXjObUJj9R+7VidQLjBKrQHTYf5qQffxGd9CbLTYezT7CM7uIDoPpPhPUSFUmE0MVl27d/enxPfg8otoIiYGVrTojqLP66D3eMY9+Drn+H8HQqmpKUHLbTKKAqOPyuLCFpX3jXk5UigX8rhMILkkCMGwn/4sL0QqOWbtHYqtLvUj6SRQBSyh52LhZ8nx4lOhwgtjIwIDAQAB", + "manifest_version": 3, + "name": "Toggled Dev", + "options_ui": { + "page": "options.html" + }, + "permissions": ["storage", "clipboardRead" ], + "update_url": "https://clients2.google.com/service/update2/crx", + "version": "3.1", + "web_accessible_resources": [ + { + "resources": ["sandbox.html"], + "matches": [""] + } + ] +} \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/official.html b/submissions/ToggledDevPortal/DevPortal-main/official.html new file mode 100644 index 00000000..b6936855 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/official.html @@ -0,0 +1,469 @@ + + + + + + New Dev Tab + + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

Intergrations and connected apps

+

Supercharge your workflow and connect the tools you use every day.

+
+ +
+
+ + +
+
+
+
+
+ +

Bookmarks

+
+ +
+
+

Bookmark a page in Toggled.

+
+ +
+ + + +
+
+
+ +

Tranfer Data

+
+ +
+
+

Transfer data to another device.

+
+ +
+ + +
+
+
+ +

Module Importer

+
+ +
+
+

Import third party modules.

+
+ +
+ + + + + + + + + + + + +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/official.js b/submissions/ToggledDevPortal/DevPortal-main/official.js new file mode 100644 index 00000000..95dbcc76 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/official.js @@ -0,0 +1,150 @@ +chrome.storage.sync.get(['tabs'], result => { + if (result.tabs) { + const tabs = JSON.parse(result.tabs) + document.getElementById('save').addEventListener('click', function() { + const url = document.getElementById('url').value + tabs.push(url) + chrome.storage.sync.set({ tabs: JSON.stringify(tabs) }, () => { + document.getElementById('todo-popup').style.display = 'none' + }) + }) + console.log(tabs) + } else { + const tabs = [] + document.getElementById('save').addEventListener('click', function() { + const url = document.getElementById('url').value + tabs.push(url) + chrome.storage.sync.set({ tabs: JSON.stringify(tabs) }, () => { + document.getElementById('todo-popup').style.display = 'none' + }) + }) + console.log('no tabs') + } +}) + +document.getElementById('devportal').addEventListener('click', function() { + document.getElementById('todo-popup').style.display = 'block' +}) + +document.getElementById('close').addEventListener('click', function() { + document.getElementById('todo-popup').style.display = 'none' +}) + +document.getElementById('remove').addEventListener('click', function() { + chrome.storage.sync.set({ tabs: false }, () => { + document.getElementById('todo-popup').style.display = 'none' +}) +}) + +chrome.storage.sync.get(['pin'], result => { + if (result.pin) { + // document.getElementById('pin').innerText = 'Edit Integration' + // document.getElementById('pt').checked = true + + // document.getElementById('pin').addEventListener('click', function() { + // chrome.storage.sync.set({ pin: false }, () => { + // window.location = 'official.html' + // }) + // }) + } +}) + +function copyToClipboard(text) { + navigator.clipboard.writeText(text).then( + function() { + console.log("Text copied to clipboard"); + }, + function(err) { + console.error("Unable to copy text:", err); + } + ); +} + +// document.getElementById('pin').addEventListener('click', function() { +// document.getElementById('lock-popup').style.display = 'block' +// }) + +// document.getElementById('lockclose').addEventListener('click', function() { +// document.getElementById('lock-popup').style.display = 'none' +// }) + +// document.getElementById('disable').addEventListener('click', function() { +// chrome.storage.sync.set({ pin: false }, () => { +// document.getElementById('lock-popup').style.display = 'none' +// window.location = 'official.html' +// }) +// }) + +// document.getElementById('pinLock').addEventListener('submit', function() { +// chrome.storage.sync.set({ pin: window.btoa(document.getElementById('pass').value) }, () => { +// window.location = 'official.html' +// }) +// }) + +chrome.storage.sync.get(null, function(items) { + var allKeys = Object.keys(items); + // console.log(allKeys); + // console.log(items); + document.getElementById('transfer-code').value = window.btoa(JSON.stringify(items)) +}); + +document.getElementById('transferclose').addEventListener('click', function() { + document.getElementById('transfer-popup').style.display = 'none' +}) + +document.getElementById('transfer-trigger').addEventListener('click', function() { + document.getElementById('transfer-popup').style.display = 'block' +}) + +document.getElementById('transfer-code').style.cursor = 'pointer' + +document.getElementById('transfer-code').addEventListener('click', function() { + const code = document.getElementById('transfer-code').value + + copyToClipboard(code) + + document.getElementById('transfer-code').value = 'Copied' +}) + +document.getElementById('transfer').addEventListener('submit', function() { + event.preventDefault() + chrome.storage.sync.set(JSON.parse(window.atob(document.getElementById('trans-code').value)), () => { + window.location = 'official.html' +}) +}) + + +// chrome.storage.sync.remove('tabs') + +document.getElementById('modules').addEventListener('click', () => { + document.getElementById('mi-popup').style.display = 'block'; +}) + +document.getElementById('closeMo').addEventListener('click', () => { + document.getElementById('mi-popup').style.display = 'none'; +}) + +document.getElementById('addModule').addEventListener('click', () => { + const url = document.getElementById("moduleUrl").value; + + if (!url) { + alert("Please enter a valid URL."); + return; + } + + const confirmDownload = true; + if (confirmDownload) { + chrome.storage.sync.get({ modules: [] }, (data) => { + let modules = data.modules; + + if (!modules.includes(url)) { + modules.push(url); + chrome.storage.sync.set({ modules }, () => { + alert("Module added successfully."); + }); + } else { + alert("This module is already added."); + } + }); + } +}); diff --git a/submissions/ToggledDevPortal/DevPortal-main/official.zip b/submissions/ToggledDevPortal/DevPortal-main/official.zip new file mode 100644 index 00000000..b1449491 Binary files /dev/null and b/submissions/ToggledDevPortal/DevPortal-main/official.zip differ diff --git a/submissions/ToggledDevPortal/DevPortal-main/options.html b/submissions/ToggledDevPortal/DevPortal-main/options.html new file mode 100644 index 00000000..0cf30188 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/options.html @@ -0,0 +1,17 @@ + + + + Extension Settings + + +

Extension Settings

+
+ + + +
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/options.js b/submissions/ToggledDevPortal/DevPortal-main/options.js new file mode 100644 index 00000000..7f1ab3f6 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/options.js @@ -0,0 +1,19 @@ +// Load and save the search engine setting +const optionsForm = document.getElementById('optionsForm'); +const searchEngineInput = optionsForm.searchEngine; + +// Load the saved search engine URL and populate the input field + +// Save the search engine URL when the user submits the form +optionsForm.addEventListener('submit', event => { + event.preventDefault(); + const searchEngineURL = searchEngineInput.value; + chrome.storage.sync.set({ searchEngine: searchEngineURL }, () => { + // Update the search form on the homepage + const searchForm = chrome.extension.getViews({ type: "tab" })[0]?.document.getElementById('searchForm'); + if (searchForm) { + searchForm.action = searchEngineURL; + } + alert('Settings saved successfully!'); + }); +}); diff --git a/submissions/ToggledDevPortal/DevPortal-main/popup.html b/submissions/ToggledDevPortal/DevPortal-main/popup.html new file mode 100644 index 00000000..ba13b158 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/popup.html @@ -0,0 +1,11 @@ + + + + Extension Popup + + + + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/productivity.html b/submissions/ToggledDevPortal/DevPortal-main/productivity.html new file mode 100644 index 00000000..ed14592e --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/productivity.html @@ -0,0 +1,397 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

Intergrations and connected apps

+

Supercharge your workflow and connect the tools you use every day.

+
+ +
+
+ +
+
+ +
+
+
+ +

News

+
+ +
+
+

Display up to three tech articles on the homepage.

+
+ +
+
+
+
+ +

Snippet Manager

+
+ +
+
+

Manage code snippets better and faster.

+
+ +
+
+
+
+ +

Lighthouse

+
+ +
+
+

Lighthouse is a tool for improving the performance and quality of your web apps.

+
+ +
+
+
+
+ +

Developer Jokes

+
+ +
+
+

A new joke for each day of the week.

+
+ +
+
+
+
+ +

OpenAI

+
+ +
+
+

Link OpenAI's ChatGPT to your account.

+
+ +
+ +
+
+
+
+
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/replauth.html b/submissions/ToggledDevPortal/DevPortal-main/replauth.html new file mode 100644 index 00000000..ff8d0d30 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/replauth.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/sandbox.html b/submissions/ToggledDevPortal/DevPortal-main/sandbox.html new file mode 100644 index 00000000..8c3ad03c --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/sandbox.html @@ -0,0 +1,13 @@ + + + + + Sandbox + + + +

Sandboxed Parser

+ + diff --git a/submissions/ToggledDevPortal/DevPortal-main/sandbox.js b/submissions/ToggledDevPortal/DevPortal-main/sandbox.js new file mode 100644 index 00000000..294034f3 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/sandbox.js @@ -0,0 +1,15 @@ +window.addEventListener("message", (event) => { + if (event.data.action === "parse") { + try { + // Convert received script to an object safely + const appInstance = new Function(`"use strict"; return (${event.data.script})`)(); + const details = appInstance.details; + const blocks = appInstance.exporter ? appInstance.exporter() : []; + + // Send the parsed data back to the extension + event.source.postMessage({ action: "parsed", details, blocks }, event.origin); + } catch (error) { + event.source.postMessage({ action: "error", error: error.message }, event.origin); + } + } + }); \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/snippets.html b/submissions/ToggledDevPortal/DevPortal-main/snippets.html new file mode 100644 index 00000000..08665e7a --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/snippets.html @@ -0,0 +1,123 @@ + + + + + New Dev Tab + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

+

Supercharge your browser and connect the tools you use every day.

+ New SnippetImport Snippet +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + + + + diff --git a/submissions/ToggledDevPortal/DevPortal-main/unof b/submissions/ToggledDevPortal/DevPortal-main/unof new file mode 100644 index 00000000..e69de29b diff --git a/submissions/ToggledDevPortal/DevPortal-main/unofficial.html b/submissions/ToggledDevPortal/DevPortal-main/unofficial.html new file mode 100644 index 00000000..001dd117 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/unofficial.html @@ -0,0 +1,451 @@ + + + + + + New Dev Tab + + + + + + + + +
+
+
+

Settings

+ +
+ +
+
+

Intergrations and connected apps

+

Supercharge your workflow and connect the tools you use every day.

+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/unofficial.js b/submissions/ToggledDevPortal/DevPortal-main/unofficial.js new file mode 100644 index 00000000..233928c8 --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/unofficial.js @@ -0,0 +1,167 @@ +async function fetchAndParseModules() { + chrome.storage.sync.get({ modules: [] }, async (data) => { + const modules = data.modules; + + if (modules.length === 0) { + console.log("No modules found."); + return; + } + + for (const url of modules) { + console.log(url) + try { + const response = await fetch(url); + if (!response.ok) { + console.error(`Failed to fetch module: ${url}`); + document.getElementById("card-grid").innerHTML += `
+
+
+

Unkown Module

+
+ +
+
+

${url}

+
+ +
` + + setTimeout(() => { + document.getElementById(`remove-${window.btoa(url)}`).addEventListener('click', () => { + chrome.storage.sync.get({ modules: [] }, (data) => { + let modules = data.modules; + modules = modules.filter(module => module !== url) + chrome.storage.sync.set({ modules }, () => { + alert("Module removed successfully."); + window.location.reload(); + }); + }); + }) + }, 200) + continue; + } + + const scriptContent = await response.text(); + // console.log(`Module from ${url}:\n`, scriptContent); + const content = JSON.parse(scriptContent) + + // Get details + const details = content.details; + const blocks = content.blocks; + + if (details) { + console.log("Extracted App Details:", details); + + document.getElementById("card-grid").innerHTML += `
+
+
+ +

${details.name}

+
+ +
+
+

${details.description}

+
+ +
` + + setTimeout(() => { + document.getElementById(`remove-${window.btoa(url)}`).addEventListener('click', () => { + chrome.storage.sync.get({ modules: [] }, (data) => { + let modules = data.modules; + modules = modules.filter(module => module !== url) + chrome.storage.sync.set({ modules }, () => { + alert("Module removed successfully."); + window.location.reload(); + }); + }); + }) + }, 200) + } else { + console.log("No details found for module from", url); + document.getElementById("card-grid").innerHTML += `
+
+
+

Unkown Module

+
+ +
+
+

${url}

+
+ +
` + + setTimeout(() => { + document.getElementById(`remove-${window.btoa(url)}`).addEventListener('click', () => { + chrome.storage.sync.get({ modules: [] }, (data) => { + let modules = data.modules; + modules = modules.filter(module => module !== url) + chrome.storage.sync.set({ modules }, () => { + alert("Module removed successfully."); + window.location.reload(); + }); + }); + }) + }, 200) + // return "No details" + } + + } catch (error) { + console.warn(`Error fetching module from ${url}:`, error); + document.getElementById("card-grid").innerHTML += `
+
+
+

Unkown Module

+
+ +
+
+

${url}

+
+ +
` + + setTimeout(() => { + document.getElementById(`remove-${window.btoa(url)}`).addEventListener('click', () => { + chrome.storage.sync.get({ modules: [] }, (data) => { + let modules = data.modules; + modules = modules.filter(module => module !== url) + chrome.storage.sync.set({ modules }, () => { + alert("Module removed successfully."); + window.location.reload(); + }); + }); + }) + }, 200) + } + } + }); + } + + + // Call the function to fetch and parse modules + fetchAndParseModules(); + + \ No newline at end of file diff --git a/submissions/ToggledDevPortal/DevPortal-main/uploadext.html b/submissions/ToggledDevPortal/DevPortal-main/uploadext.html new file mode 100644 index 00000000..95e46afe --- /dev/null +++ b/submissions/ToggledDevPortal/DevPortal-main/uploadext.html @@ -0,0 +1,15 @@ + + + + Upload and Read Manifest + + +

Upload Folder with Manifest

+
+ + +
+
+ + +