Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ node_modules
/chrome
README.html
/prod
/build
Binary file modified build/codesy.xpi
Binary file not shown.
Binary file modified build/codesy.zip
Binary file not shown.
43 changes: 23 additions & 20 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,21 @@ var manifest = function (options){
}

settings = {
static_files: {
source: './static'
},
dev_server: {
domain: '127.0.0.1',
port: '8443'
},
firefox: {
source: './src/firefox'
},
chrome: {
source: './src/chrome',
destination: './chrome'
}
source: './src',
static_files: {
source: './static'
},
dev_server: {
domain: '127.0.0.1',
port: '8443'
},
firefox: {
source: './src/firefox'
},
chrome: {
source: './src/chrome',
destination: './chrome'
}
}

options = {
Expand Down Expand Up @@ -146,15 +147,17 @@ gulp.task('chrome-dev-manifest', new manifest(options.chrome.manifest));
gulp.task('chrome-coffee', new compile_coffee(options.chrome.coffee_files));

gulp.task('dev-chrome', ['chrome-static', 'chrome-dev-manifest', 'chrome-coffee'], function() {
console.log("start watching src/chrome")
gulp.watch(settings.chrome.source + '/manifest.json', ['chrome-dev-manifest'])
gulp.watch([settings.chrome.source + '/*.coffee', './src/*.coffee'], ['chrome-coffee'])
console.log("start watching src/chrome")
gulp.watch(settings.source + '/manifest.json', ['chrome-dev-manifest'])
gulp.watch(settings.chrome.source + '/manifest_additions.json', ['chrome-dev-manifest'])
gulp.watch([settings.chrome.source + '/*.coffee', './src/*.coffee'], ['chrome-coffee'])
})

gulp.task('dev-firefox', ['firefox-dev-xpi'], function() {
console.log("start watching " + settings.firefox.source)
gulp.watch(settings.firefox.source + '/manifest.json', ['firefox-dev-xpi'])
gulp.watch([settings.firefox.source + '/*.coffee', './src/*.coffee'], ['firefox-dev-xpi'])
console.log("start watching " + settings.firefox.source)
gulp.watch(settings.source + '/manifest.json', ['firefox-dev-xpi'])
gulp.watch(settings.firefox.source + '/manifest_additions.json', ['firefox-dev-xpi'])
gulp.watch([settings.firefox.source + '/*.coffee', './src/*.coffee'], ['firefox-dev-xpi'])
})


Expand Down
10 changes: 1 addition & 9 deletions src/chrome/manifest_additions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,5 @@
"js/csp.js"
]
},
"icons": {
"128": "img/icon128.png",
"16": "img/icon16.png",
"48": "img/icon48.png"
},
"version_name": "invitation-only beta",
"web_accessible_resources": [
"js/jquery-2.0.3.min.js"
]
"version_name": "invitation-only beta"
}
2 changes: 1 addition & 1 deletion src/csp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cspAppender = (domain) ->
for header in details.responseHeaders
if @isCSP header.name.toUpperCase()
for type in types
header.value = header.value.replace(type, type + " " + @domain)
header.value = header.value.replace(type, type + " 'self' " + @domain)
{responseHeaders: details.responseHeaders}

codesyAppender = new cspAppender ""
Expand Down
1 change: 0 additions & 1 deletion src/firefox/manifest_additions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"id": "codesy@codesy.io"
}
},
"author": "Luke Crouch",
"background": {
"scripts": [
"js/csp.js",
Expand Down
15 changes: 12 additions & 3 deletions src/issue.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ console.time 'codesy issue load'
codesy =
href : ""
rx : /https:\/\/github.com\/.*\/issues\/[1-9]+/g
css:
attr:
rel:"stylesheet"
type:"text/css"
href:""
iframe :
attr:
id : "codesy_iframe"
Expand All @@ -28,13 +33,17 @@ else # firefox
codesy.domain = message.domain
codesy.newpage()

codesy.loadcss = () ->
console.log("codesy newpage: iFrame loaded")
codesy.css.attr.href = chrome.extension.getURL "css/iframe.css"
$("head").append $('<link>').attr(codesy.css.attr)

codesy.newpage = () ->
$("#"+codesy.iframe.attr.id).remove()
if codesy.rx.test window.location.href
codesy.iframe.attr.src = codesy.bid_url window.location.href
$('body').append $('<iframe>').attr(codesy.iframe.attr)
$("head").append('<link rel="stylesheet" type="text/css" href="'+codesy.domain+'/static/css/codesy-iframe.css">')
console.log("codesy newpage: iFrame added")
new_iframe = $('body').append $('<iframe>').attr(codesy.iframe.attr)
new_iframe.ready(codesy.loadcss)
else
console.log "codesy newpage: not an issue"

Expand Down
14 changes: 12 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "codesy.io",
"version": "0.0.0.3",
"author": "founders@codesy.io",
"description": "codesy is a pay-what-you-want market for the open source community to encourage coders to fix important bugs.",
"manifest_version": 2,
"name": "codesy.io",
"permissions": [
"https://*.codesy.io/",
"*://codesy-stage.herokuapp.com/",
Expand Down Expand Up @@ -34,5 +36,13 @@
]
}
],
"version": "0.0.0.2"
"icons": {
"128": "img/icon128.png",
"16": "img/icon16.png",
"48": "img/icon48.png",
"64": "img/icon64.png"
},
"web_accessible_resources": [
"css/iframe.css"
]
}
14 changes: 14 additions & 0 deletions static/css/iframe.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* This is the style for the iframe added to issue pages */
#codesy_iframe {
visibility: visible !important;
width: 256px;
max-width: 256px;
height: 276px;
overflow: hidden;
position: fixed;
bottom: .25em;
right: .25em;
background-color: transparent;
border: 0px;
z-index: 100;
}