Skip to content

Commit

Permalink
Merge branch 'master' into Likhita4403/issue251
Browse files Browse the repository at this point in the history
  • Loading branch information
Likhita4403 authored May 18, 2024
2 parents 32791c1 + 70b69c5 commit 685220f
Show file tree
Hide file tree
Showing 68 changed files with 4,008 additions and 199 deletions.
27 changes: 27 additions & 0 deletions Bookmark Extension/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// background.js

// Listen for changes to bookmarks and update stored bookmarks
chrome.bookmarks.onCreated.addListener(updateStoredBookmarks);
chrome.bookmarks.onRemoved.addListener(updateStoredBookmarks);
chrome.bookmarks.onChanged.addListener(updateStoredBookmarks);

// Sync bookmarks across devices using Chrome Storage API
function syncBookmarks() {
chrome.bookmarks.getTree(function(bookmarkTreeNodes) {
chrome.storage.sync.set({ 'bookmarks': bookmarkTreeNodes }, function() {
console.log('Bookmarks synced successfully.');
});
});
}

// Update stored bookmarks when changes occur
function updateStoredBookmarks() {
syncBookmarks();
}

// Initialize bookmark syncing on extension install or update
chrome.runtime.onInstalled.addListener(function(details) {
if (details.reason === 'install' || details.reason === 'update') {
syncBookmarks();
}
});
Binary file added Bookmark Extension/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bookmark Extension/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bookmark Extension/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions Bookmark Extension/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"manifest_version": 3,
"name": "Enhanced Bookmark Manager",
"version": "1.0",
"description": "An extension to enhance bookmark management in the browser.",
"permissions": ["storage", "bookmarks"],
"action": {
"default_popup": "popup.html",
"default_icon": "icon16.png"
},
"background": {
"service_worker": "background.js"
},
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"options_ui": {
"page": "options.html",
"open_in_tab": true
}
}

27 changes: 27 additions & 0 deletions Bookmark Extension/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Extension Options</title>
</head>
<body>
<h1>Extension Options</h1>
<p>This is where you can customize your extension settings.</p>

<h2>Bookmark Display Options</h2>
<label for="showTagsCheckbox">
<input type="checkbox" id="showTagsCheckbox"> Show tags with bookmarks
</label>

<h2>Sync Options</h2>
<label for="syncCheckbox">
<input type="checkbox" id="syncCheckbox"> Enable bookmark syncing across devices
</label>

<h2>Notification Options</h2>
<label for="notificationCheckbox">
<input type="checkbox" id="notificationCheckbox"> Enable notifications for new bookmarks
</label>
</body>
</html>
18 changes: 18 additions & 0 deletions Bookmark Extension/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Bookmark Manager</title>
<script src="popup.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Bookmark Manager</h1>
<img src="icon128.png" alt="Extension Logo">
<input type="text" id="bookmarkUrl" placeholder="Enter URL">
<input type="text" id="bookmarkTags" placeholder="Enter tags (comma-separated)">
<button class="btn" id="addBookmark">Add Bookmark</button>
<div id="status"></div>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions Bookmark Extension/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('addBookmark').addEventListener('click', function() {
var url = document.getElementById('bookmarkUrl').value;
var tags = document.getElementById('bookmarkTags').value.split(',').map(tag => tag.trim());

chrome.bookmarks.create({ 'title': url, 'url': url }, function(newBookmark) {
chrome.storage.sync.get('bookmarks', function(result) {
var bookmarks = result.bookmarks || [];
bookmarks.push({ id: newBookmark.id, url: url, tags: tags });
chrome.storage.sync.set({ 'bookmarks': bookmarks }, function() {
document.getElementById('status').textContent = 'Bookmark added successfully.';
});
});
});
});
});

20 changes: 20 additions & 0 deletions Bookmark Extension/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* styles.css */
.container {
text-align: center;
padding: 20px;
}

.btn {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
}

.btn:hover {
background-color: #0056b3;
}

5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ git checkout -b my-feature

**4.** Make Changes: Make your desired changes to the codebase.

```bash
git add .
git add <filename>
```

**5.** Commit Changes: Commit your changes with a descriptive commit message:

```bash
Expand Down
53 changes: 0 additions & 53 deletions Calculator/index.html

This file was deleted.

27 changes: 0 additions & 27 deletions Calculator/scripts/script.js

This file was deleted.

68 changes: 68 additions & 0 deletions Calculator/src/calci.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
body{
background-color: aliceblue;
}
*{
margin:0;
padding:0;
box-sizing:border-box;
background-color: #ecf0f3;
font-family: sans-serif;
outline:none;
}
.container{
height:100vh;
display:flex;
justify-content:center;
align-items:center;
}
.calci{
padding:15px;
border-radius:30px;
display:grid;
grid-template-columns: repeat(4,68px);
box-shadow: inset 5px 5px 12px #ffffff,
5px 5px 12px rgba(0,0,0,.16);
}
input{
grid-column:span 4 ;
height:60px;
width:250px;
background-color: #ecf0f3;
box-shadow: inset -5px -5px 12px #ffffff,
5px 5px 12px rgba(0,0,0,.16);
border:none;
border-radius:30px;
font-size: 50px;
text-align: end;
margin:auto;
margin-top:40px;
margin-bottom:30px;
padding:20px;
color:rgba(70,70,70);

}
input:hover{
background-color: aqua;
}
button{
height:48px;
width:48px;
background-color: #ecf0f3;
box-shadow: inset -5px -5px 12px #ffffff,
5px 5px 12px rgba(0,0,0,.16);
border:none;
border-radius:30px;
margin:8px;
font-size: 15px;
}
.equal{
width:115px;
border-radius: 40px;
background-color:#ecf0f3;
box-shadow: inset -5px -5px 12px #ffffff,
5px 5px 12px rgba(0,0,0,.16);
}
button:hover{
background-color:aqua;
}

56 changes: 56 additions & 0 deletions Calculator/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="calci.css">
</head>
<body>
<div class="container">
<div class="calci">
<input type="text" placeholder="0" id="output">
<button onclick="Clear()">C</button>
<button onclick="del()">DEL</button>
<button onclick="display('%')">%</button>
<button onclick="display('/')">/</button>
<button onclick="display('7')">7</button>
<button onclick="display('8')">8</button>
<button onclick="display('9')">9</button>
<button onclick="display('+')">+</button>
<button onclick="display('4')">4</button>
<button onclick="display('5')">5</button>
<button onclick="display('6')">6</button>
<button onclick="display('-')">-</button>
<button onclick="display('1')">1</button>
<button onclick="display('2')">2</button>
<button onclick="display('3')">3</button>
<button onclick="display('*')">*</button>
<button onclick="display('0')">0</button>
<button onclick="display('00')">00</button>
<button onclick="caliculate('=')" class="equal">=</button>

</div>
</div>
<script>
let output=document.getElementById('output');
function display(num){
output.value+=num;
}
function caliculate(){
try{
output.value=eval(output.value);
}
catch(err){
alert('Invalid');
}
}
function Clear(){
output.value="";
}
function del(){
output.value=output.value.slice(0,-1);
}
</script>
</body>
</html>
Loading

0 comments on commit 685220f

Please sign in to comment.