o'reilly - dojo the definitive guide

488 1.2K 0
o'reilly - dojo the definitive guide

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... usually includes the title, author, publisher, and ISBN For example: Dojo: The Definitive Guide, by Matthew A Russell Copyright 2008 Matthew A Russell, 97 8-0 -5 9 6-5 164 8-2 .” Preface | xxix If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com Safari® Books Online When you see a Safari® Books Online icon on the cover of... help change the tone of open source development to encourage collegial, civil discourse A project dedicated to building with the community and not to treat users as “them.” “They” are “us” and this book makes plain the open philosophy under which the toolkit was built, and by which we encourage all those reading it to help us evolve it for the future By the time I met Matthew Russell face-to-face, this... better experiences on top of the toolkit xiii These kinds of accomplishments aren’t the work of one person, or even a small team The number of people who have contributed to Dojo s evolution, believed in the project, and worked together to deliver a better Web are too numerous to mention We copied what we thought were the best bits of the structures of other projects, and the result has been a level... web page on the fly, and in doing so, makes it possible to provide a layer of insulation between the developer and the bare metal of the web browsers—even all of them at the same time This book is about Dojo, a JavaScript toolkit that provides that layer of insulation between you and the hard knocks of browser inconsistencies by leveraging JavaScript and other web technologies for all that they’re worth—not... commoditized, the Dojo community really stands out as different The organizations and individuals who make up the team of committers (not to mention the thousands of individual developers out there building real web sites and applications) all give Dojo a particular character and grounding for success Liberal (and clean) licensing Dojo is open source software that is liberally licensed under the terms of either... features for operations like animations and drag-and-drop; while they are incredibly useful, they just aren’t as common to all use cases as the machinery in Base One caveat about Part I of this book is that it defers a full-blown discussion of the parser until Chapter 11, when Dijit is introduced, because the most common use case of the parser is for parsing widgets The parser is briefly mentioned in a Chapter... drag-and-drop Part I includes the following chapters: Chapter 1, Toolkit Overview Provides a quick introduction to the toolkit including topics such as Dojo s architecture, how to get and install Dojo, how to get Dojo into a web page, and some sections that provide some examples so that you can see Dojo in action * As we’ll be discussing more in subsequent chapters, “across the wire” refers to the. .. All of us involved with Dojo have matured along with the Web, and with the release of Dojo 1.0 and this book, it’s safe to say that Dojo has fully arrived The roadmap documents we started so long ago now have all of the boxes checked, sites that serve billions of page views a month lean on Dojo for their entire user experience, and large teams of designers and developers work together to create better... further away than Base for production settings The kinds of features you’ll find in Core include animation machinery (dojo. fx), drag-and-drop facilities (dojo. dnd), a data management layer (dojo. data), cookie handling (dojo. cookie), and more Familiarity with the arsenal of tools in Base and Core is absolutely essential to becoming a productive Dojo developer, and the chances are good that this machinery... title to all contributions—thereby protecting all users of the toolkit from intellectual licensing conundrums The benefit of clean licensing is markedly not the case with several other popular JavaScript toolkits (that shall be left unnamed) Depth and breadth While some toolkits tackle specific pieces of a problem space, Dojo provides an end-to-end solution for development in the browser Everything from . h1" alt="" Dojo The Definitive Guide Other resources from O’Reilly Related titles Adding Ajax Ajax: The Definitive Guide CSS Cookbook ™ CSS: The Definitive Guide Dynamic HTML: The Definitive Reference JavaScript:. time-critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim- ply flip to the page you need. Try it today for free. Dojo The Definitive Guide Matthew. Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Dojo: The Definitive Guide, the image of a lion-tailed monkey, and related

Ngày đăng: 31/03/2014, 17:06

Từ khóa liên quan

Mục lục

  • Dojo: The Definitive Guide

  • Table of Contents

  • Foreword

  • Preface

    • Why Dojo?

    • What’s in This Book

    • What’s Not in This Book

    • Open Source Software Is Fluid

    • About You

      • Development Tools

      • Essential Working Knowledge

        • Closures

        • Context

        • Anonymous functions

    • Conventions Used in This Book

      • Style Conventions

    • Using Code Examples

    • Safari® Books Online

    • We’d Like to Hear from You

    • Acknowledgments

  • Part I

  • Toolkit Overview

    • Overview of Dojo’s Architecture

      • Base

      • Core

      • Dijit

      • DojoX

      • Util

    • Prepping for Development

      • Getting Dojo

        • Downloading an official release

        • Downloading from Subversion

        • AOL’s CDN

      • Debugging with Firebug

      • Browser Security Settings for Running Dojo Locally

      • Lightweight Server Responses

    • Terminology

    • Bootstrapping

      • dojo.addOnLoad

      • Configuration with djConfig

    • Exploring Dojo with Firebug

      • Exploring Base

        • dojo.byId

        • dojo.connect

      • Exploring Dijit

    • Summary

  • Language and Browser Utilities

    • Looking Up DOM Nodes

    • Type Checking

      • Duck Typing

    • String Utilities

    • Array Processing

      • Finding Locations of Elements

      • Testing Elements for a Condition

      • Iterating Over Elements

      • Transforming Elements

      • String-As-Function Style Arguments

    • Managing Source Code with Modules

      • Motivation for Managing the Mayhem

      • Custom Module Example Over XDomain

      • Fibonacci Example with Local Toolkit Installation

      • Building a Magic Genie Example Module

    • JavaScript Object Utilities

      • Mixins

      • Extending Object Prototypes

      • Cloning Objects

    • Manipulating Object Context

      • Partially Applying Parameters

      • Hitching an Object to a Specific Context

      • Delegation and Inheritance

    • DOM Utilities

      • Ancestry

      • Selectability

      • Styling Nodes

      • Manipulating Attributes

      • Placing Nodes

      • The Box Model

    • Browser Utilities

      • Cookies

      • Back Button Handling

    • Summary

  • Event Listeners and Pub/Sub Communication

    • Event and Keyboard Normalization

      • Mouse and Keyboard Event Normalization

      • Standardized Key Codes

    • Event Listeners

      • Event Propagation

      • Leveraging Closures with dojo.connect

        • One-time connections

        • Setting up connections within a loop

      • Connecting in Markup

    • Publish/Subscribe Communication

    • Summary

  • AJAX and Server Communication

    • Quick Overview of AJAX

      • JSON

    • AJAX Made Easy

      • XHR Examples

      • General Purpose XMLHttpRequest Calls

      • Hitching Up Callbacks

    • Deferreds

      • Deferred Examples Via CherryPy

        • Using Deferreds returned from XHR functions

        • Injecting Deferreds into XHR functions

        • Custom canceller

        • DeferredList

    • Form and HTTP Utilities

    • Cross-Site Scripting with JSONP

      • JSONP Primer

    • Core IO

      • Using JSONP with Dojo

        • Connecting to a Flickr data source

        • Getting back JavaScript from a JSONP call

      • IFRAME Transports

        • File downloads with IFRAMEs

        • Form submissions with IFRAMEs

        • Non-HTML response types

        • Manually creating a hidden IFRAME

    • JSON Remote Procedure Calls

      • JSON RPC Example

    • OpenAjax Hub

    • Summary

  • Node Manipulation

    • Query: One Size Fits All

      • Warm Up

      • State Tracking Example

        • The long, brittle way

        • The short, robust way

    • NodeList

      • Array-Like Methods

        • Chaining NodeList results

        • String-as-Function style Arguments

        • Enhanced filtering

      • Style

      • Placement

      • DOM Event Shortcuts

      • Animation

    • Creating NodeList Extensions

    • Behavior

    • Summary

  • Internationalization (i18n)

    • Introduction

    • Internationalizing a Module

      • Layout on Disk

      • Defining String Tables

      • Putting It All Together

        • Use build tools for snappy performance

    • Dates, Numbers, and Currency

      • Dates

      • Numbers

      • Currency

    • Summary

  • Drag-and-Drop

    • Dragging

      • Simple Moveables

      • Drag Events

      • Z-Indexing

      • Constrained Moveables

    • Dropping

      • Pure Targets

      • Custom Avatars

      • Drop Events

      • Scripting Droppables

    • Summary

  • Animation and Special Effects

    • Animation

      • Simple Fades

      • Animating Arbitrary CSS Properties

      • Programatically Controlling Animations

    • Core fx

      • Sliding

      • Wiping

      • Chaining and Combining

      • Toggling

    • Animation + Drag-and-Drop = Fun!

    • Colors

      • Creating and Blending Colors

      • Named Color Values Available Via Base

      • Additional Color Values Available Via Core

    • Summary

  • Data Abstraction

    • Shifting the Data Paradigm

    • Data API Overview

    • The APIs

      • The Read API

      • The Identity API

      • The Write API

      • The Notification API

    • Core Implementations of Data APIs

      • ItemFileReadStore

        • Hierarchical JSON and JSON with references

        • ItemFileReadStore walkthrough

        • Querying child items

        • ItemFileWriteStore

      • Serializing and Deserializing Custom Data Types

        • Implicit type-mapping

        • Custom type maps

    • Summary

  • Simulated Classes and Inheritance

    • JavaScript Is Not Java

    • One Problem, Many Solutions

      • Typical JavaScript Inheritance

      • Mixin Pattern

      • Delegation Pattern

    • Simulating Classes with Dojo

      • The Basic Class Creation Pattern

      • A Single Inheritance Example

        • A common gotcha with prototype-based inheritance

        • Calling an inherited method

    • Multiply Inheriting with Mixins

      • Multiple Inheritance Oddities

    • Summary

  • Part II

  • Dijit Overview

    • Motivation for Dijit

      • Low Coupling, High Cohesion

    • Accessibility (a11y)

      • Common a11y Issues

      • WAI-ARIA

    • Dijit for Designers

      • Themes

      • Nodes Versus Dijits, DOM Events Versus Dijit Methods

    • The Parser

      • Parsing a Widget When the Page Loads

      • Manually Parsing a Widget

      • Demystifying the Parser

    • Hands-on Dijit with NumberSpinner

      • Creating from Markup

      • Programmatic Creation

      • Lots of Niceties

      • Defining Methods in Markup

    • Overview of Stock Dijits

      • Form Dijits

      • Layout Dijits

      • Application Dijits

    • Dijit API Drive-By

    • Summary

  • Dijit Anatomy and Lifecycle

    • Dijit Anatomy

      • Web Development Review

      • Dijits to the Rescue

    • Dijit Lifecycle Methods

      • The _Widget Lifecycle

        • Lifecycle methods

        • Essential properties

      • Mixing in _Templated

        • Lifecycle methods

        • Essential properties

    • Your First Dijit: HelloWorld

      • HelloWorld Dijit (Take 1: Bare Bones)

        • HTML page

        • CSS

        • Template

        • JavaScript

      • HelloWorld Dijit (Take 2: Modifying The Template)

      • HelloWorld Dijit (Take 3: Interning the Template)

      • HelloWord Dijit (Take 4: Passing in Parameters)

      • HelloWorld Dijit (Take 5: Associating Events with Dijits)

    • Parent-Child Relationships with _Container and _Contained

    • Rapidly Prototyping Widgets in Markup

    • Summary

  • Form Widgets

    • Drive-By Form Review

    • Form Dijits

    • TextBox Variations

      • TextBox

      • ValidationTextBox

      • MappedTextBox and RangeBoundTextBox

      • TimeTextBox and DateTextBox

        • Commonalities between DateTextBox and TimeTextBox

        • Serializing data to the server

        • Don’t forget about inherited properties

        • NumberTextBox

        • NumberSpinner

        • CurrencyTextBox

        • ComboBox

    • FilteringSelect

    • MultiSelect

    • Textarea Variations

      • Textarea

      • SimpleTextarea

    • Button Variations

      • Button

      • ToggleButton

      • CheckBox

      • RadioButton

      • DropDownButton

      • ComboButton

    • Slider

      • HorizontalSlider

      • VerticalSlider

    • Form

      • HTML Form Tag Synopsis

      • Form

    • Summary

  • Layout Widgets

    • Layout Dijit Commonalities

      • Programmatic Creation

      • Keyboard Support

    • ContentPane

    • BorderContainer

    • StackContainer

      • Procrastination (a.k.a. Lazy Loading) May Yield Better Performance

    • TabContainer

    • AccordionContainer

    • Rendering and Visibility Considerations

    • Summary

  • Application Widgets

    • Tooltip

    • Dialog Widgets

      • Dialog

      • TooltipDialog

    • ProgressBar

    • ColorPalette

    • Toolbar

    • Menu

    • TitlePane

    • InlineEditBox

    • Tree

      • Simple Tree

      • Simple Forest

      • Responding to Click Events

      • Tree-Related APIs

      • Drag-and-Drop with the Tree

        • Drag-and-droppable Tree example

    • Editor

      • Editor Architecture

      • Editor Plug-Ins

    • Summary

  • Build Tools, Testing, and Production Considerations

    • Building

      • Running a Build

      • Build Profiles

        • Setting up a build profile

        • Setting up a (more clever) build profile

        • Standard build profile

        • ShrinkSafe optimization and other common options

    • Dojo Objective Harness (DOH)

      • Rhino Test Harness Without Dojo

      • Rhino Test Harness with Dojo

    • Browser-Based Test Harness

      • Browser Test Example

      • Asynchronous Browser Test Example

    • Performance Considerations

      • Benefits of XDomain builds

      • Don’t optimize prematurely

    • Summary

  • A Firebug Primer

    • Installation

    • To Allow or Not to Allow?

    • Now for the Fun Stuff

    • Inspect

    • Console

    • HTML and CSS

      • Script and DOM

    • Net

    • Go Forth and Dismantle

  • A Brief Survey of DojoX

  • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan