backbone js blueprints burgess 2014 06 25 Lập trình Java

256 42 0
backbone js blueprints burgess 2014 06 25 Lập trình Java

Đ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

CuuDuongThanCong.com https://fb.com/tailieudientucntt Backbone.js Blueprints Understand Backbone.js pragmatically by building seven different applications from scratch Andrew Burgess BIRMINGHAM - MUMBAI CuuDuongThanCong.com https://fb.com/tailieudientucntt Backbone.js Blueprints Copyright © 2014 Packt Publishing All rights reserved No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews Every effort has been made in the preparation of this book to ensure the accuracy of the information presented However, the information contained in this book is sold without warranty, either express or implied Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals However, Packt Publishing cannot guarantee the accuracy of this information First published: May 2014 Production Reference: 1130514 Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK ISBN 978-1-78328-699-7 www.packtpub.com Cover Image by Duraid Fatouhi (duraidfatouhi@yahoo.com) CuuDuongThanCong.com https://fb.com/tailieudientucntt Credits Author Andrew Burgess Reviewers Project Coordinator Wendell Palmer Proofreaders Marc D Bodley Simran Bhogal Ivano Malavolta Ameesha Green Lorenzo Pisani Commissioning Editor Gregory Wild Acquisition Editor Gregory Wild Content Development Editors Balaji Naidu Larissa Pinto Indexer Hemangini Bari Graphics Yuvraj Mannari Production Coordinator Aparna Bhagat Cover Work Aparna Bhagat Technical Editors Miloni Dutia Siddhi Rane Copy Editors Sayanee Mukherjee Deepa Nambiar Laxmi Subramanian CuuDuongThanCong.com https://fb.com/tailieudientucntt About the Author Andrew Burgess writes code and writes about code While he dabbles with around half a dozen different programming languages, JavaScript is his favorite and is also his first love He's been writing tutorials for Nettuts+ since 2009, and he has been creating screencasts for Tuts+ since 2012 He's written a few small e-books on other web development topics; some of them are: • Getting Good with Git, Rockable Press • Getting Good with JavaScript, Rockable Press • Getting Good with PHP, Rockable Press I'd like to thank Gregory Wild, Wendell Palmer, Larissa Pinto, and all the other great people from Packt Publishing, for making the bookwriting process such a breeze Thanks have to go to Jeremy Ashkenas for creating the amazing Backbone and Underscore libraries Finally, and most importantly, I must thank my family for being so understanding with the crazy schedule that writing a book gives you CuuDuongThanCong.com https://fb.com/tailieudientucntt About the Reviewers Marc D Bodley is a passionate User Experience Engineer and a jack-of-all-trades developer with over eight years of experience within JavaScript and frontend technologies He is excited to see JavaScript being adopted as more of a mainstream development language and not just an accessory to development He is equally excited to see the structure and thought process of more conventional, strongly typed languages being applied to JavaScript to bring order to what is potentially a large and disorganized JS-driven code base He has worked on large- and small-scale applications for a range of organizations, from Belk.com, to start-up style data-heavy applications, and continues to look for, learn, and enforce JavaScript and programming best practices He is grateful to be a contributor towards this effort Ivano Malavolta is postdoctoral researcher at the Gran Sasso Science Institute, Italy He has a PhD in Computer Science from the University of L'Aquila, Italy Currently, his research activity is positioned in three main fields: software architecture, Model-Driven Engineering, and mobile-enabled systems He has co-authored scientific publications in international journals, and international conferences, and workshops in using these themes He is a program committee member and reviewer of international conferences and journals in his fields of interest Ivano is an instructor at the University of L'Aquila, and he is teaching these topics in dedicated courses for both the Bachelor's and Master's degree students He is a strong advocate of applying academic research results in real scenarios, and he is working on projects that have been awarded as the most innovative solutions in both national and international venues He is a member of the ACM and the IEEE Lorenzo Pisani is a software engineer with over a decade of experience in developing applications with PHP, MySQL, and JavaScript As a huge advocate of open source software, he publishes just about everything he builds, outside of work, to his GitHub profile (https://github.com/Zeelot) for others to use and learn from CuuDuongThanCong.com https://fb.com/tailieudientucntt www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub com and as a print book customer, you are entitled to a discount on the eBook copy Get in touch with us at service@packtpub.com for more details At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library Here, you can access, read, and search across Packt's entire library of books Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books Simply use your login credentials for immediate access CuuDuongThanCong.com https://fb.com/tailieudientucntt Table of Contents Preface 1 Chapter 1: Building a Simple Blog Setting up the application Starting with the server Creating the template 11 Adding the public folder 12 Beginning the Backbone code 13 Creating a model and collection 13 Performing a quick and dirty test 15 Writing some views 16 The PostListView class 17 The PostsListView class 18 Using our views 19 Creating a router 20 Viewing a post 23 Creating new posts 26 Adding comments 28 Serving comments 29 Comment views 30 Summary 34 Chapter 2: Building a Photo-sharing Application Creating user accounts Creating our application navigation Uploading photos Sending photos from the server to the client Creating profile pages Creating the individual photo page CuuDuongThanCong.com https://fb.com/tailieudientucntt 37 37 45 48 54 55 58 Table of Contents Following users 62 Displaying a followed user's photos 67 Summary 69 Chapter 3: Building a Live Data Dashboard 71 Planning our application 72 Setting up precompiled templates 72 Creating the models 74 Creating controls 76 Including Bootstrap 78 Starting the router 78 Building the CreateEventView class 80 Creating the events table 84 Deleting a record 88 Editing event records 89 Making it live 94 Sorting events 96 Summary 100 Chapter 4: Building a Calendar 101 Chapter 5: Building a Chat Application 135 Planning our application 101 Creating the model and collection 102 Creating the month view 106 Building the week row 108 Building the day cells 112 Creating the individual day screen 116 Writing the server code 132 Summary 134 Outlining the application Setting up the application Preparing our template A word about Socket.IO Creating modules Creating users Building the layout Starting the router Letting users join the fun Joining a room Building the chat module Back to the controller 135 136 137 137 138 140 142 144 146 152 158 161 [ ii ] CuuDuongThanCong.com https://fb.com/tailieudientucntt Table of Contents Adding some other routes 162 Writing CSS 164 Summary 167 Chapter 6: Building a Podcast Application 169 Chapter 7: Building a Game 201 What are we building? 169 Building user accounts 170 Subscribing to and storing podcasts 174 Preparing index.ejs 182 Creating our models and collections 183 Building the navigation 185 Displaying podcasts 186 Creating a layout 189 Beginning the router 190 Subscribing to new podcasts 190 Displaying the list of episodes 193 Displaying episodes 198 Summary 200 What are we building? 201 User accounts 202 Templates 203 Creating the game data 205 Writing the models 207 Splitting up words 208 Writing the tokens view 211 Views of the clues 215 Creating the guess view 218 Building the info view 224 Wrapping our views in a GameView class 228 Starting the router 229 Creating the home view 230 Building a scoreboard 232 Writing the navigation 235 Adding new words 236 Summary 238 Index 239 [ iii ] CuuDuongThanCong.com https://fb.com/tailieudientucntt ... a large and disorganized JS-driven code base He has worked on large- and small-scale applications for a range of organizations, from Belk.com, to start-up style data-heavy applications, and continues... Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK ISBN 97 8-1 -7 832 8-6 9 9-7 www.packtpub.com Cover Image by Duraid Fatouhi (duraidfatouhi@yahoo.com) CuuDuongThanCong.com... https://fb.com/tailieudientucntt About the Reviewers Marc D Bodley is a passionate User Experience Engineer and a jack-of-all-trades developer with over eight years of experience within JavaScript and frontend technologies

Ngày đăng: 29/08/2020, 11:27

Mục lục

  • Chapter 1: Building a Simple Blog

    • Setting up the application

    • Starting with the server

    • Adding the public folder

    • Beginning the Backbone code

      • Creating a model and collection

      • Performing a quick and dirty test

      • Writing some views

        • The PostListView class

        • Chapter 2: Building a Photo-sharing Application

          • Creating user accounts

          • Creating our application navigation

          • Sending photos from the server to the client

          • Creating the individual photo page

          • Displaying a followed user's photos

          • Chapter 3: Building a Live Data Dashboard

            • Planning our application

            • Setting up precompiled templates

            • Building the CreateEventView class

            • Creating the events table

            • Chapter 4: Building a Calendar

              • Planning our application

              • Creating the model and collection

              • Creating the month view

                • Building the week row

                • Building the day cells

                • Creating the individual day screen

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

Tài liệu liên quan