Skip to content

Commit

Permalink
added pad provider stripping and minified jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
Boaz Sender authored and Boaz Sender committed Feb 20, 2011
1 parent ff56c2f commit 7fa7f47
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
6 changes: 2 additions & 4 deletions background.html
Expand Up @@ -14,16 +14,14 @@
message: 'isEtherPad'

}, function( response ) {
console.log(response)

if ( response ) {

if ( localStorage.getItem('pads') ) {

var pads = JSON.parse( localStorage.getItem('pads') );

console.log(localStorage.getItem('pads').indexOf("http://typewith.me/html5-learning-concussion"))

if ( localStorage.getItem('pads').indexOf("http://typewith.me/html5-learning-concussion") != -1) {
if ( localStorage.getItem('pads').indexOf( curTab.url ) == -1) {

pads.push( {title: curTab.title, url: curTab.url } );

Expand Down
14 changes: 10 additions & 4 deletions chrome-browser-action.html
@@ -1,24 +1,30 @@
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script>
$(function(){
var bg = chrome.extension.getBackgroundPage(),
pads = JSON.parse( bg.localStorage.getItem('pads') );

for ( var pad in pads) {
var padUrl = pads[pad].url,
padTitle = pads[pad].title.indexOf(':') == -1 ? pads[pad].title : pads[pad].title.split(':')[1];

$('<li>', {
html: '<a href="' + pads[pad].url + '">' + pads[pad].title + '</a>'
html: '<a href="' + padUrl + '">' + padTitle + '</a>'
})
.appendTo('ul')

};

$('a').click(function(){

var path = $(this).attr('href');

chrome.tabs.create({
url: path
})

});

});
Expand Down
16 changes: 16 additions & 0 deletions jquery.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -9,7 +9,7 @@
},
"content_scripts" : [{
"js" : [
"jquery.js",
"jquery.min.js",
"app.js"
],
"matches": [
Expand Down

0 comments on commit 7fa7f47

Please sign in to comment.