From 9b4a9e8e90ffd3f366b0b3a21fea384cbb9ef2d4 Mon Sep 17 00:00:00 2001 From: anmolkaur18 Date: Tue, 23 Jun 2020 10:07:20 +0530 Subject: [PATCH] solved issue #2 --- edit.html => HTML/edit.html | 0 popup.html => HTML/popup.html | 376 +++++++++---------- edit.js => Javascript/edit.js | 0 popup.js => Javascript/popup.js | 188 +++++----- README.md | 14 +- icons8-100.png => images/iconGirl.png | Bin images/{icons8-100.png => iconLargeGirl.png} | Bin icons8-19.png => images/iconSmallGirl.png | Bin logo.jpg => images/logo.jpg | Bin logosci.jpeg => images/logoSCI.jpeg | Bin ss.png => images/screenshot.png | Bin manifest.json | 6 +- 12 files changed, 295 insertions(+), 289 deletions(-) rename edit.html => HTML/edit.html (100%) rename popup.html => HTML/popup.html (96%) rename edit.js => Javascript/edit.js (100%) rename popup.js => Javascript/popup.js (97%) rename icons8-100.png => images/iconGirl.png (100%) rename images/{icons8-100.png => iconLargeGirl.png} (100%) rename icons8-19.png => images/iconSmallGirl.png (100%) rename logo.jpg => images/logo.jpg (100%) rename logosci.jpeg => images/logoSCI.jpeg (100%) rename ss.png => images/screenshot.png (100%) diff --git a/edit.html b/HTML/edit.html similarity index 100% rename from edit.html rename to HTML/edit.html diff --git a/popup.html b/HTML/popup.html similarity index 96% rename from popup.html rename to HTML/popup.html index 67f5715..9b01089 100644 --- a/popup.html +++ b/HTML/popup.html @@ -1,188 +1,188 @@ - - - - Quick Launcher - - - - - - - -
- -
-
- -
- -
-
Edit
-
- - - + + + + Quick Launcher + + + + + + + +
+ +
+
+ +
+ +
+
Edit
+
+ + + diff --git a/edit.js b/Javascript/edit.js similarity index 100% rename from edit.js rename to Javascript/edit.js diff --git a/popup.js b/Javascript/popup.js similarity index 97% rename from popup.js rename to Javascript/popup.js index 34c16cf..c4e98ee 100644 --- a/popup.js +++ b/Javascript/popup.js @@ -1,94 +1,94 @@ -var name_text = document.getElementById('name'); -var website_link = document.getElementById('website_link'); -var linkedin_link = document.getElementById('linkedin_link'); -var medium_link = document.getElementById('medium_link'); -var twitter_link = document.getElementById('twitter_link'); -var github_link = document.getElementById('github_link'); -var quora_link = document.getElementById('quora_link'); -var stackoverflow_link = document.getElementById('stackoverflow_link'); -var gitlab_link = document.getElementById('gitlab_link'); -var facebook_link = document.getElementById('facebook_link'); -var instagram_link = document.getElementById('instagram_link'); - -var array = ["name","website","linkedin","medium","twitter","github", "quora", "stackoverflow", "gitlab", "facebook", "instagram"]; - -function void_click(){ - void(0); -} -chrome.storage.sync.get(array,function(links){ - if(!chrome.runtime.error){ - console.log(links); - if(links.name) - name_text.innerHTML=links.name+"'s "; - - if(links.website) - website_link.href=links.website; - else - website_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.linkedin) - linkedin_link.href=links.linkedin; - else - linkedin_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.medium) - medium_link.href=links.medium; - else - medium_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.twitter) - twitter_link.href=links.twitter; - else - twitter_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.github) - github_link.href=links.github; - else - github_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.quora) - quora_link.href=links.quora; - else - quora_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.gitlab) - gitlab_link.href=links.gitlab; - else - gitlab_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.stackoverflow) - stackoverflow_link.href=links.stackoverflow; - else - stackoverflow_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.facebook) - facebook_link.href=links.facebook; - else - facebook_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - - if(links.instagram) - instagram_link.href=links.instagram; - else - instagram_link.addEventListener('click',function(event){ - event.preventDefault(); - }); - } -}); +var name_text = document.getElementById('name'); +var website_link = document.getElementById('website_link'); +var linkedin_link = document.getElementById('linkedin_link'); +var medium_link = document.getElementById('medium_link'); +var twitter_link = document.getElementById('twitter_link'); +var github_link = document.getElementById('github_link'); +var quora_link = document.getElementById('quora_link'); +var stackoverflow_link = document.getElementById('stackoverflow_link'); +var gitlab_link = document.getElementById('gitlab_link'); +var facebook_link = document.getElementById('facebook_link'); +var instagram_link = document.getElementById('instagram_link'); + +var array = ["name","website","linkedin","medium","twitter","github", "quora", "stackoverflow", "gitlab", "facebook", "instagram"]; + +function void_click(){ + void(0); +} +chrome.storage.sync.get(array,function(links){ + if(!chrome.runtime.error){ + console.log(links); + if(links.name) + name_text.innerHTML=links.name+"'s "; + + if(links.website) + website_link.href=links.website; + else + website_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.linkedin) + linkedin_link.href=links.linkedin; + else + linkedin_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.medium) + medium_link.href=links.medium; + else + medium_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.twitter) + twitter_link.href=links.twitter; + else + twitter_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.github) + github_link.href=links.github; + else + github_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.quora) + quora_link.href=links.quora; + else + quora_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.gitlab) + gitlab_link.href=links.gitlab; + else + gitlab_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.stackoverflow) + stackoverflow_link.href=links.stackoverflow; + else + stackoverflow_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.facebook) + facebook_link.href=links.facebook; + else + facebook_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + + if(links.instagram) + instagram_link.href=links.instagram; + else + instagram_link.addEventListener('click',function(event){ + event.preventDefault(); + }); + } +}); diff --git a/README.md b/README.md index 0429069..d4fc5e8 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,16 @@ This is motivated by [Traversy Media tutorial on Google Chrome Extention](https: . ├── ... ├── images - │── icons, logo and screenshots - │── manifest - │── popup.html - |── popup.js + │── icons + |── logos + |── screenshots + │── manifest.json + │── HTML + |── edit.html + |── popup.html + |── Javascript + |── edit.js + |── popus.js |── README └── ... diff --git a/icons8-100.png b/images/iconGirl.png similarity index 100% rename from icons8-100.png rename to images/iconGirl.png diff --git a/images/icons8-100.png b/images/iconLargeGirl.png similarity index 100% rename from images/icons8-100.png rename to images/iconLargeGirl.png diff --git a/icons8-19.png b/images/iconSmallGirl.png similarity index 100% rename from icons8-19.png rename to images/iconSmallGirl.png diff --git a/logo.jpg b/images/logo.jpg similarity index 100% rename from logo.jpg rename to images/logo.jpg diff --git a/logosci.jpeg b/images/logoSCI.jpeg similarity index 100% rename from logosci.jpeg rename to images/logoSCI.jpeg diff --git a/ss.png b/images/screenshot.png similarity index 100% rename from ss.png rename to images/screenshot.png diff --git a/manifest.json b/manifest.json index d28a949..1fed098 100644 --- a/manifest.json +++ b/manifest.json @@ -4,10 +4,10 @@ "name": "Profile Launcher", "description": "Quick launch Media", "version": "1.0.0", - "icons": { "128": "icons8-100.png" }, + "icons": { "128": "images/iconLargeGirl.png" }, "browser_action": { - "default_icon": "icons8-19.png", - "default_popup": "popup.html" + "default_icon": "images/iconSmallGirl.png", + "default_popup": "HTML/popup.html" }, "permissions": [ "activeTab",