codesy/chrome-extension — pull request #17 by jdungan (2013-12-30 05:14:20+00:00)
Title: Abstracts the widget insertion to allow use on other sites tracking issues 

This changes adds widget insertion for sourceforge and bitbucket.

Changes (in rough order)
1) Changed extension to run on all pages by changing the manifest ( "matches" : [""]).
2) Rename the github.js to launch.js, meaning it plays each time the page is launched
3) Extended codesy.js to:
-add 'pages' object to describe behavior for each desired issue site
definition of the options used the launch.js

domain: A regex of that will be used to verify when to insert the widget (e.g. /.github.com/i)
target: Description of the element where the widget will be inserted
target.selector: A jquery selector that identifies the element (e.g. '.discussion-sidebar'}
target.containers: An array of html elements that the widget will be wrapped in the order of the array.
(e.g. [ '
','

])
before_append: Function that will be run after the target has been confirmed but before any DOM changes
after_append: Function that will be run after widget inserted

Order of successful insertion (bails quietly on failure at each step):

1) matches the URL against all page.domain regex. Resolves on the first match.
2) attempts to get the csrf token
3) tests for target element
4) retrieves the user's extension options
5) run the before_append function
6) append the form according to page object
7) run the after_append function

(Still need to update the widget with bid information from the server)

Other changes:
-moved css file to css directory
-moved the api call functions to codesy.api