Table of Contents for
JavaScript Web Applications
Close
Version ebook
/
Retour
JavaScript Web Applications
by Alex MacCaw
Published by O'Reilly Media, Inc., 2011
Cover
JavaScript Web Applications
JavaScript Web Applications
Preface
1. MVC and Classes
2. Events and Observing
3. Models and Data
4. Controllers and State
5. Views and Templating
6. Dependency Management
7. Working with Files
8. The Real-Time Web
9. Testing and Debugging
10. Deploying
11. The Spine Library
12. The Backbone Library
13. EmberJS
A. jQuery Primer
B. CSS Extensions
C. CSS3 Reference
Index
About the Author
Colophon
Copyright
JavaScript Web Applications
Table of Contents
Preface
Who Is This Book For?
How This Book Is Organized
Conventions Used in This Book
Accompanying Files
Code Conventions
jQuery Examples
Holla
Author’s Note
Safari® Books Online
How to Contact Us
1. MVC and Classes
Early Days
Adding Structure
What Is MVC?
The Model
The View
The Controller
Toward Modularity, Creating Classes
Adding Functions to Classes
Adding Methods to Our Class Library
Class Inheritance Using Prototype
Adding Inheritance to Our Class Library
Function Invocation
Controlling Scope in Our Class Library
Adding Private Functions
Class Libraries
2. Events and Observing
Listening to Events
Event Ordering
Canceling Events
The Event Object
Event Libraries
Context Change
Delegating Events
Custom Events
Custom Events and jQuery Plug-Ins
Non-DOM Events
3. Models and Data
MVC and Namespacing
Building an ORM
Prototypal Inheritance
Adding ORM Properties
Persisting Records
Adding ID Support
Addressing References
Loading in Data
Including Data Inline
Loading Data with Ajax
JSONP
Security with Cross-Domain Requests
Populating Our ORM
Storing Data Locally
Adding Local Storage to Our ORM
Submitting New Records to the Server
4. Controllers and State
Module Pattern
Global Import
Global Export
Adding a Bit of Context
Abstracting into a Library
Loading Controllers After the Document
Accessing Views
Delegating Events
State Machines
Routing
Using the URL’s Hash
Detecting Hash Changes
Ajax Crawling
Using the HTML5 History API
5. Views and Templating
Dynamically Rendering Views
Templates
Template Helpers
Template Storage
Binding
Binding Up Models
6. Dependency Management
CommonJS
Declaring a Module
Modules and the Browser
Module Loaders
Yabble
RequireJS
Wrapping Up Modules
Module Alternatives
LABjs
FUBCs
7. Working with Files
Browser Support
Getting Information About Files
File Inputs
Drag and Drop
Dragging
Dropping
Cancel Default Drag/Drop
Copy and Paste
Copying
Pasting
Reading Files
Blobs and Slices
Custom Browse Buttons
Uploading Files
Ajax Progress
jQuery Drag and Drop Uploader
Creating a Drop Area
Uploading the File
8. The Real-Time Web
Real Time’s History
WebSockets
Node.js and Socket.IO
Real-Time Architecture
Perceived Speed
9. Testing and Debugging
Unit Testing
Assertions
QUnit
Jasmine
Drivers
Headless Testing
Zombie
Ichabod
Distributed Testing
Providing Support
Inspectors
Web Inspector
Firebug
The Console
Console Helpers
Using the Debugger
Analyzing Network Requests
Profile and Timing
10. Deploying
Performance
Caching
Minification
Gzip Compression
Using a CDN
Auditors
Resources
11. The Spine Library
Setup
Classes
Instantiation
Extending Classes
Context
Events
Models
Fetching Records
Model Events
Validation
Persistence
Controllers
Elements
Delegating Events
Controller Events
Global Events
The Render Pattern
The Element Pattern
Building a Contacts Manager
Contact Model
Sidebar Controller
Contacts Controller
App Controller
12. The Backbone Library
Models
Models and Attributes
Collections
Controlling a Collection’s Order
Views
Rendering Views
Delegating Events
Binding and Context
Controllers
Syncing with the Server
Populating Collections
On the Server Side
Custom Behavior
Building a To-Do List
13. EmberJS
The Application
Models
The Store
The Adapter
Defining Models
Defining Relationships
Templates
Built-in Helpers
Custom Helpers
Controllers
Responding to Actions
Model Controllers
Array Controllers
Router
Defining Routes
Resource Routes
Dynamic Segments
Changing Routes
Building a To-Do List
A. jQuery Primer
DOM Traversal
DOM Manipulation
Events
Ajax
Being a Good Citizen
Extensions
Creating a Growl jQuery Plug-in
B. CSS Extensions
Variables
Mixins
Nested Rules
Including Other Stylesheets
Colors
How Do I Use Less?
Via the Command Line
Via Rack
Via JavaScript
Less.app
C. CSS3 Reference
Prefixes
Colors
Rounded Corners
Drop Shadows
Text Shadow
Gradients
Multiple Backgrounds
Selectors
Nth Child
Direct Descendants
Selector Negation
Transitions
Border Images
Box Sizing
Transformations
Flexible Box Model
Fonts
Graceful Degradation
Modernizr
Google Chrome Frame
Creating a Layout
Index
About the Author
Colophon
Copyright