Skip to content

Commit

Permalink
Merge branch 'master' into scroll_top
Browse files Browse the repository at this point in the history
  • Loading branch information
deeheem authored Mar 17, 2018
2 parents a8afc85 + d82df1b commit fe23b55
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 18 deletions.
17 changes: 16 additions & 1 deletion code/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.create({
'url': chrome.extension.getURL('popup.html')
}, function(tab) {
localStorage.setItem("openThroughWeb", "no");
});
});
//it listens to messages sent by content scripts
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.clicked == "true")
{
chrome.tabs.create({
'url': chrome.extension.getURL('popup.html')
}, function(tab) {

});
});
localStorage.setItem("value", request.value);//saves the query that user has selected
localStorage.setItem("openThroughWeb", "yes");
sendResponse({mesg: "response received"});
}
});
38 changes: 38 additions & 0 deletions code/contentScript.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions code/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,16 @@ ul.share-buttons .sr-only{

#scrollBtn:hover {
background-color: #555;
}

#share-buttons img {
width: 35px;
padding: 5px;
}

#share-footer{
background-color:#FFFA79;
margin:-2px -50px 0 -50px;
text-align:center;
border-radius:0 0 10px 10px;
}
27 changes: 23 additions & 4 deletions code/js/popup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions code/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"48": "icon/icon.png",
"128": "icon/icon.png"
},
"content_scripts": [
{
"matches": ["https://*/*"],
"js": ["js/jquery.js","contentScript.js"]
}
],
"content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'",
"short_name": "World's first offline search engine: Quark"
}
34 changes: 21 additions & 13 deletions code/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="input-group">
<input id="search" class="form-control text-center" type="search" size="128" placeholder="Search any code; Try: sorting">
</div>
<div id="pop-tags"></div>
<div id="pop-tags"></div>
<center>
<ul class="share-buttons">
<span style="weight:2;vertical-align: middle;"><b>Share Via</b></span>
Expand Down Expand Up @@ -96,13 +96,13 @@


<div id="front">
<h1 style="text-align: center;">World's first Offline Search Engine</h1>
<hr>
<img id="fact" src="image/1.jpg" alt="Enjoy our daily code fact" style="width:50vw; height:50vh; position: relative; left: 50%; transform: translate(-50%, 0%);"/>
<h1 style="text-align: center;">World's first Offline Search Engine</h1>
<hr>
<img id="fact" src="image/1.jpg" alt="Enjoy our daily code fact" style="width:50vw; height:50vh; position: relative; left: 50%; transform: translate(-50%, 0%);"/>

<hr>
</div>
<hr>
</div>

<div id="no_of_results"></div>

Expand All @@ -126,12 +126,20 @@ <h1 style="text-align: center;">World's first Offline Search Engine</h1>

<div id="help_popup">
<div id="popup">
<form action="#" id="form" method="post" name="form">
<img id="close" src="image/12.png" >
<h2>Welcome to Quark!</h2>
<hr>
<h6>This is the World's first offline code Search Engine presented by <a target="_blank" title="Works only when you are online" href="https://github.com/OpenGenus/">OpenGenus</a>. <br> <br> Now search code for any algorithm or data-structure in your favorite language even when you are not connected to the internet! <br> <br> Add frequently visited codes easily to your favorites by clicking on the star icon. <br> <br> Have any suggestions? Feel free to share your valuable feedback at this <a target="_blank" title="Works only when you are online" href="https://discourse.opengenus.org/t/feedback-for-quark/125">Discourse topic</a>! <br> <br> </h6>
</form>
<form action="#" id="form" method="post" name="form">
<img id="close" src="image/12.png" >
<h2>Welcome to Quark!</h2>
<hr>
<h6>This is the World's first offline code Search Engine presented by <a target="_blank" title="Works only when you are online" href="https://github.com/OpenGenus/">OpenGenus</a>. <br> <br> Now search code for any algorithm or data-structure in your favorite language even when you are not connected to the internet! <br> <br> Add frequently visited codes easily to your favorites by clicking on the star icon. <br> <br> Have any suggestions? Feel free to share your valuable feedback at this <a target="_blank" title="Works only when you are online" href="https://discourse.opengenus.org/t/feedback-for-quark/125">Discourse topic</a>! <br> <br> </h6>
<hr>
<div id="share-footer" >
<p align="center" style="padding-top: 8px; margin-bottom: 2px"><b> Share Quark </b></p>
<a class="btn btn-default" target= "_blank" href="http://www.facebook.com/sharer.php?u=https://chrome.google.com/webstore/detail/opengenus-offline-search/lfoloadpfjildomeafpdopahkdaoofbn&quote=%23OpenGenus%20Quark%3A%20World%27s%20first%20offline%20search%20engine%20to%20enable%20you%20to%20learn%20offline"><img id="share-buttons" src="image/Facebook.png" alt="Facebook" ></img></a>
<a class="btn btn-default" target= "_blank" href="http://twitter.com/share?text=OpenGenus%20Quark%3A%20World%27s%20first%20offline%20search%20engine%20to%20enable%20you%20to%20learn%20offline&url=https:%2F%2Fchrome.google.com/webstore/detail/opengenus-offline-search/lfoloadpfjildomeafpdopahkdaoofbn"><img id="share-buttons" src="image/Twitter.png" alt="Twitter"></img></a>
<a class="btn btn-default" target= "_blank" href="http://plus.google.com/share?url=https://chrome.google.com/webstore/detail/opengenus-offline-search/lfoloadpfjildomeafpdopahkdaoofbn"><img id="share-buttons" src="image/Google+.png" alt="Google+"></a>
<a class="btn btn-default" target= "_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A//chrome.google.com/webstore/detail/opengenus-offline-search/lfoloadpfjildomeafpdopahkdaoofbn&title=%23OpenGenus%20Quark%3A%20World%27s%20first%20offline%20search%20engine%20to%20enable%20you%20to%20learn%20offline&summary=&source="><img id="share-buttons" src="image/LinkedIn.png" alt="LinkedIn"></img></a>
</div>
</form>
</div>
</div>

Expand Down

0 comments on commit fe23b55

Please sign in to comment.