forked from kippt/kippt-chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a7efcfc
Showing
10 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2012 Kippt | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# kippt-chrome | ||
|
||
This is Kippt.com's official Chrome add-on. It's licensed under MIT and we accept improvements in pull-requests. | ||
|
||
## Building extension | ||
|
||
To build the extension, add the files to .zip and thne change the extension of the file to .oex | ||
|
||
NB. The extension will only play nice with pages that were loaded after the extension was activated. | ||
To be sure all works as it should, restart Opera after installing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="zepto.min.js" charset="utf-8"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
// Get user's selection | ||
chrome.tabs.getSelected(null, function(tab) { | ||
if (tab.url.indexOf('chrome://') == 0) { | ||
// Not tab content | ||
$('h1').show(); | ||
} else { | ||
// Show extension | ||
$('#iframe').show(); | ||
chrome.tabs.sendRequest(tab.id, {helper: 'get_note'}, function(response) { | ||
selected_note = response.note; | ||
}); | ||
} | ||
}); | ||
}); | ||
</script> | ||
<script type="text/javascript" src="kippt_iframe.js" charset="utf-8"></script> | ||
<style> | ||
html, body { | ||
width: 400px; | ||
height: 240px; | ||
margin: 0px; | ||
|
||
background: #FFF; | ||
padding: 0; | ||
margin: 0; | ||
overflow: hidden; | ||
-webkit-user-select: none; | ||
} | ||
|
||
h1 { | ||
display: none; | ||
font-size: 24px; | ||
color: #E0E0E0; | ||
margin: 25% 0; | ||
text-align: center; | ||
font-family: helvetica; | ||
} | ||
|
||
#iframe { | ||
display: none; | ||
width: 100%; | ||
height: 100%; | ||
text-align: center; | ||
font-family: helvetica; | ||
} | ||
|
||
#iframe h2 { | ||
color: #E0E0E0; | ||
font-size: 24px; | ||
font-weight: 300; | ||
margin-top: 95px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="iframe"> | ||
<h2>Loading...</h2> | ||
</div> | ||
<h1>Open a page to Kippt it</h1> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// http://code.google.com/chrome/extensions/messaging.html | ||
chrome.extension.onRequest.addListener( | ||
function(request, sender, sendResponse) { | ||
if (request.helper == 'get_note'){ | ||
sendResponse({note: document.getSelection().toString()}); | ||
} else { | ||
sendResponse({note: ''}); // snub them. | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$(function() { | ||
chrome.tabs.getSelected(null, function(tab) { | ||
chrome.tabs.sendRequest(tab.id, {helper: 'get_note'}, function(response) { | ||
selected_note = response.note; | ||
|
||
// Kippt iframe | ||
chrome.tabs.getSelected(null, function(tab){ | ||
var kippt_url = 'https://kippt.com/extensions/new'; | ||
var tab_url = tab.url; | ||
var tab_title = tab.title; | ||
var iframe_url = kippt_url + | ||
'?url=' + encodeURIComponent(tab_url) + | ||
'&title=' + encodeURIComponent(tab_title) + | ||
'¬es=' + encodeURIComponent(selected_note) + | ||
'&source=chrome'; | ||
|
||
kippt_iframe = document.createElement('iframe'); | ||
kippt_iframe.src = iframe_url; | ||
kippt_iframe.frameborder = '0'; | ||
kippt_iframe.width = '100%'; | ||
kippt_iframe.height = '100%'; | ||
$(kippt_iframe).attr('allowTransparency', 'true') | ||
$(kippt_iframe).attr('frameBorder', '0') | ||
$(kippt_iframe).attr('scrolling', 'no'); | ||
|
||
$('#iframe').html(kippt_iframe); | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "Kippt", | ||
"version": "1.0.5", | ||
|
||
"description": "Kippt.com's Chrome extension", | ||
"homepage_url": "https://kippt.com", | ||
"icons": { | ||
"16": "img/icon16.png", | ||
"48": "img/icon48.png", | ||
"128": "img/icon128.png" | ||
}, | ||
"permissions": [ | ||
"tabs" | ||
], | ||
|
||
"browser_action": { | ||
"default_icon": "img/icon16.png", | ||
"default_title": "Kippt it", | ||
"popup": "extension.html" | ||
}, | ||
"content_scripts": [{ | ||
"js": ["kippt_content.js"], | ||
"matches": ["http://*/*", "https://*/*"] | ||
}, | ||
{ | ||
"all_frames": true, | ||
"js": ["kippt_iframe.js"], | ||
"matches": ["https://kippt.com/extensions*"] | ||
}] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.