guardian/frontend — pull request #23 by commuterjoy (2012-07-30 22:02:42+00:00)
Title: Javascript refactor

For discussion rather than merging ....

* Deleted a lot of stuff that I think is not really finished or I can't see the reason for it being around, see notes below.
* Added some basic Jasmine test coverage.
* Compatible with https://github.com/guardian/sbt-requirejs/pull/1
* Nicer JS pattern - see ./modules/related.js

![](http://24.media.tumblr.com/tumblr_m7xyigHPmp1r3gb3zo1_400.gif)

### Structure

./common.js - application bootstrap
./vendor - 3rd party libaries
./modules - our AMD modules
./tests - jasmine tests
./tests/spec - test spec's
./tests/vendor - 3rd party test libaries
./tests/fixtures - test fixtures
./tests/mocks - mock amd modules

### Notes

master-branch/detect/detect.js - migrated
master-branch/detect/images.js - migrated
master-branch/libs/ads.js -- removing, pending more discussion about writeCapture
master-branch/libs/analytics.js -- todo?
master-branch/libs/expanderBinder.js -- todo?
master-branch/libs/g.js -- todo, polyfill for old browser? remove?
master-branch/libs/guardianUtils.js -- shorthands, todo
master-branch/order.js - todo?
master-branch/related.js -- migrated
master-branch/mostPopular.js -- migrated

### Removed

master-branch/optimizely.js -- removing, we aren't using this
master-branch/util.js -- removing, gone with the bonzo/qwery combination instead
master-branch/order.js
master-branch/libs/fetchDiscussion.js -- removing, we need to move this to server generated html
master-branch/libs/discussionBinder.js -- ditto
master-branch/commonPlugins.js -- mostly just a loader for other modules. could split out 'debug' later

### Misc

master-branch/libs/writeCapture.js -- pending coversation about adverts. really don't want this.
master-branch/libs/writeCaptureNoLibSupport.js -- ditto
master-branch/libs/ads.js -- removing, pending more discussion about writeCapture