Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created January 25, 2012 21:33
Show Gist options
  • Save nerdyworm/1678923 to your computer and use it in GitHub Desktop.
Save nerdyworm/1678923 to your computer and use it in GitHub Desktop.
# Javascript
assets/javascripts/
# Backbone App
assets/javascripts/app/
assets/javascripts/app/application.js # javascript entry point
assets/javascripts/app/document_ready.js # single document ready entry point (i can dream right?)
# Vendor Extentsions
assets/javascripts/ext/{backbone,jquery,jquery-ui} # our hacks basically
# Core Objects, PagniatedCollection, Base Pipeline Models etc etc
assets/javascripts/app/core/
# Normal Backbone Stuff
assets/javascripts/app/models/
assets/javascripts/app/collection/
assets/javascripts/app/routers/
assets/javascripts/app/views/{deals,people,notes,companies,etc}
# Templates
assets/templates/{deals,people,notes,companies,etc}
# View helpers
assets/javascripts/app/helpers/
# Utility Functions
assets/javascripts/app/util/
# Vendor
assets/javascripts/vendor/
# or
vendor/assests/
# Javascript Namespace
# Instances of javascript objects in the running app
pl = {
app: # reference to the app instance
routers: [] # reference to all routers instances
collections: [] # global collections, i.e. people#index items, but not person/1/deals
# Account wide collections
custom_field_labels: []
deal_stages: []
# user specific stuff
user: {
sharees: []
}
}
# Objects that reference core objects get bound to window
# if it has a /name route then it it top level
window.Deal = Backbone.Model.extend({})
window.Deals = Backbone.Collection.extend({})
# Top Level function and objects
PL = { } # Bind all toplevel utility functions and non top level objects
PipelineDeals = {} # Also looks pleasing, maybe to much typing though
# Helpers
Helpers = {} # Bind all helper methods to this namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment