Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial import

  • Loading branch information...
commit 74f01b101e1e7c40c5f5f0dcdbd4ab9a2747f2df 0 parents
Duncan Gough authored

Showing 58 changed files with 10,195 additions and 0 deletions. Show diff stats Hide diff stats

  1. +4 0 .gitignore
  2. +32 0 Gemfile
  3. +134 0 Gemfile.lock
  4. +256 0 README
  5. +7 0 Rakefile
  6. +11 0 app/controllers/application_controller.rb
  7. +2 0  app/controllers/home_controller.rb
  8. +13 0 app/controllers/sessions_controller.rb
  9. +2 0  app/helpers/application_helper.rb
  10. +2 0  app/helpers/home_helper.rb
  11. +2 0  app/helpers/sessions_helper.rb
  12. +9 0 app/models/user.rb
  13. +8 0 app/views/home/index.html.erb
  14. +14 0 app/views/layouts/application.html.erb
  15. +4 0 config.ru
  16. +42 0 config/application.rb
  17. +6 0 config/boot.rb
  18. +24 0 config/database.yml
  19. +5 0 config/environment.rb
  20. +26 0 config/environments/development.rb
  21. +49 0 config/environments/production.rb
  22. +35 0 config/environments/test.rb
  23. +7 0 config/initializers/backtrace_silencers.rb
  24. +10 0 config/initializers/inflections.rb
  25. +5 0 config/initializers/mime_types.rb
  26. +3 0  config/initializers/omniauth.rb
  27. +7 0 config/initializers/secret_token.rb
  28. +8 0 config/initializers/session_store.rb
  29. +5 0 config/locales/en.yml
  30. +6 0 config/routes.rb
  31. +15 0 db/migrate/20110919105711_create_users.rb
  32. +23 0 db/schema.rb
  33. +7 0 db/seeds.rb
  34. +2 0  doc/README_FOR_APP
  35. 0  lib/tasks/.gitkeep
  36. +26 0 public/404.html
  37. +26 0 public/422.html
  38. +26 0 public/500.html
  39. 0  public/favicon.ico
  40. BIN  public/images/rails.png
  41. +2 0  public/javascripts/application.js
  42. +965 0 public/javascripts/controls.js
  43. +974 0 public/javascripts/dragdrop.js
  44. +1,123 0 public/javascripts/effects.js
  45. +6,001 0 public/javascripts/prototype.js
  46. +191 0 public/javascripts/rails.js
  47. +5 0 public/robots.txt
  48. 0  public/stylesheets/.gitkeep
  49. +6 0 script/rails
  50. +11 0 test/fixtures/users.yml
  51. +8 0 test/functional/home_controller_test.rb
  52. +8 0 test/functional/sessions_controller_test.rb
  53. +9 0 test/performance/browsing_test.rb
  54. +13 0 test/test_helper.rb
  55. +4 0 test/unit/helpers/home_helper_test.rb
  56. +4 0 test/unit/helpers/sessions_helper_test.rb
  57. +8 0 test/unit/user_test.rb
  58. 0  vendor/plugins/.gitkeep
4 .gitignore
... ... @@ -0,0 +1,4 @@
  1 +.bundle
  2 +db/*.sqlite3
  3 +log/*.log
  4 +tmp/
32 Gemfile
... ... @@ -0,0 +1,32 @@
  1 +source 'http://rubygems.org'
  2 +
  3 +gem 'rails', '3.0.10'
  4 +
  5 +# Bundle edge Rails instead:
  6 +# gem 'rails', :git => 'git://github.com/rails/rails.git'
  7 +
  8 +gem 'mysql2', '0.2.11'
  9 +gem 'omniauth'
  10 +
  11 +# Use unicorn as the web server
  12 +# gem 'unicorn'
  13 +
  14 +# Deploy with Capistrano
  15 +# gem 'capistrano'
  16 +
  17 +# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
  18 +# gem 'ruby-debug'
  19 +# gem 'ruby-debug19', :require => 'ruby-debug'
  20 +
  21 +# Bundle the extra gems:
  22 +# gem 'bj'
  23 +# gem 'nokogiri'
  24 +# gem 'sqlite3-ruby', :require => 'sqlite3'
  25 +# gem 'aws-s3', :require => 'aws/s3'
  26 +
  27 +# Bundle gems for the local environment. Make sure to
  28 +# put test-only gems in this group so their generators
  29 +# and rake tasks are available in development mode:
  30 +# group :development, :test do
  31 +# gem 'webrat'
  32 +# end
134 Gemfile.lock
... ... @@ -0,0 +1,134 @@
  1 +GEM
  2 + remote: http://rubygems.org/
  3 + specs:
  4 + abstract (1.0.0)
  5 + actionmailer (3.0.10)
  6 + actionpack (= 3.0.10)
  7 + mail (~> 2.2.19)
  8 + actionpack (3.0.10)
  9 + activemodel (= 3.0.10)
  10 + activesupport (= 3.0.10)
  11 + builder (~> 2.1.2)
  12 + erubis (~> 2.6.6)
  13 + i18n (~> 0.5.0)
  14 + rack (~> 1.2.1)
  15 + rack-mount (~> 0.6.14)
  16 + rack-test (~> 0.5.7)
  17 + tzinfo (~> 0.3.23)
  18 + activemodel (3.0.10)
  19 + activesupport (= 3.0.10)
  20 + builder (~> 2.1.2)
  21 + i18n (~> 0.5.0)
  22 + activerecord (3.0.10)
  23 + activemodel (= 3.0.10)
  24 + activesupport (= 3.0.10)
  25 + arel (~> 2.0.10)
  26 + tzinfo (~> 0.3.23)
  27 + activeresource (3.0.10)
  28 + activemodel (= 3.0.10)
  29 + activesupport (= 3.0.10)
  30 + activesupport (3.0.10)
  31 + addressable (2.2.4)
  32 + arel (2.0.10)
  33 + builder (2.1.2)
  34 + erubis (2.6.6)
  35 + abstract (>= 1.0.0)
  36 + faraday (0.6.1)
  37 + addressable (~> 2.2.4)
  38 + multipart-post (~> 1.1.0)
  39 + rack (>= 1.1.0, < 2)
  40 + i18n (0.5.0)
  41 + mail (2.2.19)
  42 + activesupport (>= 2.3.6)
  43 + i18n (>= 0.4.0)
  44 + mime-types (~> 1.16)
  45 + treetop (~> 1.4.8)
  46 + mime-types (1.16)
  47 + multi_json (1.0.3)
  48 + multi_xml (0.2.2)
  49 + multipart-post (1.1.3)
  50 + mysql2 (0.2.11)
  51 + net-ldap (0.2.2)
  52 + nokogiri (1.4.7)
  53 + oa-basic (0.2.6)
  54 + oa-core (= 0.2.6)
  55 + rest-client (~> 1.6.0)
  56 + oa-core (0.2.6)
  57 + oa-enterprise (0.2.6)
  58 + addressable (= 2.2.4)
  59 + net-ldap (~> 0.2.2)
  60 + nokogiri (~> 1.4.2)
  61 + oa-core (= 0.2.6)
  62 + pyu-ruby-sasl (~> 0.0.3.1)
  63 + rubyntlm (~> 0.1.1)
  64 + oa-more (0.2.6)
  65 + multi_json (~> 1.0.0)
  66 + oa-core (= 0.2.6)
  67 + rest-client (~> 1.6.0)
  68 + oa-oauth (0.2.6)
  69 + faraday (~> 0.6.1)
  70 + multi_json (~> 1.0.0)
  71 + multi_xml (~> 0.2.2)
  72 + oa-core (= 0.2.6)
  73 + oauth (~> 0.4.0)
  74 + oauth2 (~> 0.4.1)
  75 + oa-openid (0.2.6)
  76 + oa-core (= 0.2.6)
  77 + rack-openid (~> 1.3.1)
  78 + ruby-openid-apps-discovery (~> 1.2.0)
  79 + oauth (0.4.5)
  80 + oauth2 (0.4.1)
  81 + faraday (~> 0.6.1)
  82 + multi_json (>= 0.0.5)
  83 + omniauth (0.2.6)
  84 + oa-basic (= 0.2.6)
  85 + oa-core (= 0.2.6)
  86 + oa-enterprise (= 0.2.6)
  87 + oa-more (= 0.2.6)
  88 + oa-oauth (= 0.2.6)
  89 + oa-openid (= 0.2.6)
  90 + polyglot (0.3.2)
  91 + pyu-ruby-sasl (0.0.3.3)
  92 + rack (1.2.4)
  93 + rack-mount (0.6.14)
  94 + rack (>= 1.0.0)
  95 + rack-openid (1.3.1)
  96 + rack (>= 1.1.0)
  97 + ruby-openid (>= 2.1.8)
  98 + rack-test (0.5.7)
  99 + rack (>= 1.0)
  100 + rails (3.0.10)
  101 + actionmailer (= 3.0.10)
  102 + actionpack (= 3.0.10)
  103 + activerecord (= 3.0.10)
  104 + activeresource (= 3.0.10)
  105 + activesupport (= 3.0.10)
  106 + bundler (~> 1.0)
  107 + railties (= 3.0.10)
  108 + railties (3.0.10)
  109 + actionpack (= 3.0.10)
  110 + activesupport (= 3.0.10)
  111 + rake (>= 0.8.7)
  112 + rdoc (~> 3.4)
  113 + thor (~> 0.14.4)
  114 + rake (0.9.2)
  115 + rdoc (3.9.4)
  116 + rest-client (1.6.7)
  117 + mime-types (>= 1.16)
  118 + ruby-openid (2.1.8)
  119 + ruby-openid-apps-discovery (1.2.0)
  120 + ruby-openid (>= 2.1.7)
  121 + rubyntlm (0.1.1)
  122 + thor (0.14.6)
  123 + treetop (1.4.10)
  124 + polyglot
  125 + polyglot (>= 0.3.1)
  126 + tzinfo (0.3.29)
  127 +
  128 +PLATFORMS
  129 + ruby
  130 +
  131 +DEPENDENCIES
  132 + mysql2 (= 0.2.11)
  133 + omniauth
  134 + rails (= 3.0.10)
256 README
... ... @@ -0,0 +1,256 @@
  1 +== Welcome to Rails
  2 +
  3 +Rails is a web-application framework that includes everything needed to create
  4 +database-backed web applications according to the Model-View-Control pattern.
  5 +
  6 +This pattern splits the view (also called the presentation) into "dumb"
  7 +templates that are primarily responsible for inserting pre-built data in between
  8 +HTML tags. The model contains the "smart" domain objects (such as Account,
  9 +Product, Person, Post) that holds all the business logic and knows how to
  10 +persist themselves to a database. The controller handles the incoming requests
  11 +(such as Save New Account, Update Product, Show Post) by manipulating the model
  12 +and directing data to the view.
  13 +
  14 +In Rails, the model is handled by what's called an object-relational mapping
  15 +layer entitled Active Record. This layer allows you to present the data from
  16 +database rows as objects and embellish these data objects with business logic
  17 +methods. You can read more about Active Record in
  18 +link:files/vendor/rails/activerecord/README.html.
  19 +
  20 +The controller and view are handled by the Action Pack, which handles both
  21 +layers by its two parts: Action View and Action Controller. These two layers
  22 +are bundled in a single package due to their heavy interdependence. This is
  23 +unlike the relationship between the Active Record and Action Pack that is much
  24 +more separate. Each of these packages can be used independently outside of
  25 +Rails. You can read more about Action Pack in
  26 +link:files/vendor/rails/actionpack/README.html.
  27 +
  28 +
  29 +== Getting Started
  30 +
  31 +1. At the command prompt, create a new Rails application:
  32 + <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
  33 +
  34 +2. Change directory to <tt>myapp</tt> and start the web server:
  35 + <tt>cd myapp; rails server</tt> (run with --help for options)
  36 +
  37 +3. Go to http://localhost:3000/ and you'll see:
  38 + "Welcome aboard: You're riding Ruby on Rails!"
  39 +
  40 +4. Follow the guidelines to start developing your application. You can find
  41 +the following resources handy:
  42 +
  43 +* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
  44 +* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
  45 +
  46 +
  47 +== Debugging Rails
  48 +
  49 +Sometimes your application goes wrong. Fortunately there are a lot of tools that
  50 +will help you debug it and get it back on the rails.
  51 +
  52 +First area to check is the application log files. Have "tail -f" commands
  53 +running on the server.log and development.log. Rails will automatically display
  54 +debugging and runtime information to these files. Debugging info will also be
  55 +shown in the browser on requests from 127.0.0.1.
  56 +
  57 +You can also log your own messages directly into the log file from your code
  58 +using the Ruby logger class from inside your controllers. Example:
  59 +
  60 + class WeblogController < ActionController::Base
  61 + def destroy
  62 + @weblog = Weblog.find(params[:id])
  63 + @weblog.destroy
  64 + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
  65 + end
  66 + end
  67 +
  68 +The result will be a message in your log file along the lines of:
  69 +
  70 + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
  71 +
  72 +More information on how to use the logger is at http://www.ruby-doc.org/core/
  73 +
  74 +Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
  75 +several books available online as well:
  76 +
  77 +* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
  78 +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
  79 +
  80 +These two books will bring you up to speed on the Ruby language and also on
  81 +programming in general.
  82 +
  83 +
  84 +== Debugger
  85 +
  86 +Debugger support is available through the debugger command when you start your
  87 +Mongrel or WEBrick server with --debugger. This means that you can break out of
  88 +execution at any point in the code, investigate and change the model, and then,
  89 +resume execution! You need to install ruby-debug to run the server in debugging
  90 +mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
  91 +
  92 + class WeblogController < ActionController::Base
  93 + def index
  94 + @posts = Post.find(:all)
  95 + debugger
  96 + end
  97 + end
  98 +
  99 +So the controller will accept the action, run the first line, then present you
  100 +with a IRB prompt in the server window. Here you can do things like:
  101 +
  102 + >> @posts.inspect
  103 + => "[#<Post:0x14a6be8
  104 + @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
  105 + #<Post:0x14a6620
  106 + @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
  107 + >> @posts.first.title = "hello from a debugger"
  108 + => "hello from a debugger"
  109 +
  110 +...and even better, you can examine how your runtime objects actually work:
  111 +
  112 + >> f = @posts.first
  113 + => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
  114 + >> f.
  115 + Display all 152 possibilities? (y or n)
  116 +
  117 +Finally, when you're ready to resume execution, you can enter "cont".
  118 +
  119 +
  120 +== Console
  121 +
  122 +The console is a Ruby shell, which allows you to interact with your
  123 +application's domain model. Here you'll have all parts of the application
  124 +configured, just like it is when the application is running. You can inspect
  125 +domain models, change values, and save to the database. Starting the script
  126 +without arguments will launch it in the development environment.
  127 +
  128 +To start the console, run <tt>rails console</tt> from the application
  129 +directory.
  130 +
  131 +Options:
  132 +
  133 +* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
  134 + made to the database.
  135 +* Passing an environment name as an argument will load the corresponding
  136 + environment. Example: <tt>rails console production</tt>.
  137 +
  138 +To reload your controllers and models after launching the console run
  139 +<tt>reload!</tt>
  140 +
  141 +More information about irb can be found at:
  142 +link:http://www.rubycentral.com/pickaxe/irb.html
  143 +
  144 +
  145 +== dbconsole
  146 +
  147 +You can go to the command line of your database directly through <tt>rails
  148 +dbconsole</tt>. You would be connected to the database with the credentials
  149 +defined in database.yml. Starting the script without arguments will connect you
  150 +to the development database. Passing an argument will connect you to a different
  151 +database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
  152 +PostgreSQL and SQLite 3.
  153 +
  154 +== Description of Contents
  155 +
  156 +The default directory structure of a generated Ruby on Rails application:
  157 +
  158 + |-- app
  159 + | |-- controllers
  160 + | |-- helpers
  161 + | |-- mailers
  162 + | |-- models
  163 + | `-- views
  164 + | `-- layouts
  165 + |-- config
  166 + | |-- environments
  167 + | |-- initializers
  168 + | `-- locales
  169 + |-- db
  170 + |-- doc
  171 + |-- lib
  172 + | `-- tasks
  173 + |-- log
  174 + |-- public
  175 + | |-- images
  176 + | |-- javascripts
  177 + | `-- stylesheets
  178 + |-- script
  179 + |-- test
  180 + | |-- fixtures
  181 + | |-- functional
  182 + | |-- integration
  183 + | |-- performance
  184 + | `-- unit
  185 + |-- tmp
  186 + | |-- cache
  187 + | |-- pids
  188 + | |-- sessions
  189 + | `-- sockets
  190 + `-- vendor
  191 + `-- plugins
  192 +
  193 +app
  194 + Holds all the code that's specific to this particular application.
  195 +
  196 +app/controllers
  197 + Holds controllers that should be named like weblogs_controller.rb for
  198 + automated URL mapping. All controllers should descend from
  199 + ApplicationController which itself descends from ActionController::Base.
  200 +
  201 +app/models
  202 + Holds models that should be named like post.rb. Models descend from
  203 + ActiveRecord::Base by default.
  204 +
  205 +app/views
  206 + Holds the template files for the view that should be named like
  207 + weblogs/index.html.erb for the WeblogsController#index action. All views use
  208 + eRuby syntax by default.
  209 +
  210 +app/views/layouts
  211 + Holds the template files for layouts to be used with views. This models the
  212 + common header/footer method of wrapping views. In your views, define a layout
  213 + using the <tt>layout :default</tt> and create a file named default.html.erb.
  214 + Inside default.html.erb, call <% yield %> to render the view using this
  215 + layout.
  216 +
  217 +app/helpers
  218 + Holds view helpers that should be named like weblogs_helper.rb. These are
  219 + generated for you automatically when using generators for controllers.
  220 + Helpers can be used to wrap functionality for your views into methods.
  221 +
  222 +config
  223 + Configuration files for the Rails environment, the routing map, the database,
  224 + and other dependencies.
  225 +
  226 +db
  227 + Contains the database schema in schema.rb. db/migrate contains all the
  228 + sequence of Migrations for your schema.
  229 +
  230 +doc
  231 + This directory is where your application documentation will be stored when
  232 + generated using <tt>rake doc:app</tt>
  233 +
  234 +lib
  235 + Application specific libraries. Basically, any kind of custom code that
  236 + doesn't belong under controllers, models, or helpers. This directory is in
  237 + the load path.
  238 +
  239 +public
  240 + The directory available for the web server. Contains subdirectories for
  241 + images, stylesheets, and javascripts. Also contains the dispatchers and the
  242 + default HTML files. This should be set as the DOCUMENT_ROOT of your web
  243 + server.
  244 +
  245 +script
  246 + Helper scripts for automation and generation.
  247 +
  248 +test
  249 + Unit and functional tests along with fixtures. When using the rails generate
  250 + command, template test files will be generated for you and placed in this
  251 + directory.
  252 +
  253 +vendor
  254 + External libraries that the application depends on. Also includes the plugins
  255 + subdirectory. If the app has frozen rails, those gems also go here, under
  256 + vendor/rails/. This directory is in the load path.
7 Rakefile
... ... @@ -0,0 +1,7 @@
  1 +# Add your own tasks in files placed in lib/tasks ending in .rake,
  2 +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
  3 +
  4 +require File.expand_path('../config/application', __FILE__)
  5 +require 'rake'
  6 +
  7 +TumblrLogin::Application.load_tasks
11 app/controllers/application_controller.rb
... ... @@ -0,0 +1,11 @@
  1 +class ApplicationController < ActionController::Base
  2 + protect_from_forgery
  3 +
  4 + helper_method :current_user
  5 +
  6 + private
  7 +
  8 + def current_user
  9 + @current_user ||= User.find(session[:user_id]) if session[:user_id]
  10 + end
  11 +end
2  app/controllers/home_controller.rb
... ... @@ -0,0 +1,2 @@
  1 +class HomeController < ApplicationController
  2 +end
13 app/controllers/sessions_controller.rb
... ... @@ -0,0 +1,13 @@
  1 +class SessionsController < ApplicationController
  2 +def create
  3 + auth = request.env["omniauth.auth"]
  4 + user = User.find_by_provider_and_uid(auth["provider"], auth["uid"]) || User.create_with_omniauth(auth)
  5 + session[:user_id] = user.id
  6 + redirect_to root_url, :notice => "Signed in!"
  7 +end
  8 +
  9 +def destroy
  10 + session[:user_id] = nil
  11 + redirect_to root_url, :notice => "Signed out!"
  12 +end
  13 +end
2  app/helpers/application_helper.rb
... ... @@ -0,0 +1,2 @@
  1 +module ApplicationHelper
  2 +end
2  app/helpers/home_helper.rb
... ... @@ -0,0 +1,2 @@
  1 +module HomeHelper
  2 +end
2  app/helpers/sessions_helper.rb
... ... @@ -0,0 +1,2 @@
  1 +module SessionsHelper
  2 +end
9 app/models/user.rb
... ... @@ -0,0 +1,9 @@
  1 +class User < ActiveRecord::Base
  2 + def self.create_with_omniauth(auth)
  3 + create! do |user|
  4 + user.provider = auth["provider"]
  5 + user.uid = auth["uid"]
  6 + user.name = auth['user_info']['nickname']
  7 + end
  8 + end
  9 +end
8 app/views/home/index.html.erb
... ... @@ -0,0 +1,8 @@
  1 +TEST
  2 +
  3 +<% if current_user %>
  4 + Welcome <%= current_user.name %>!
  5 + <%= link_to "Sign Out", signout_path %>
  6 +<% else %>
  7 + <%= link_to "Sign in with tumblr", "/auth/tumblr" %>
  8 +<% end %>
14 app/views/layouts/application.html.erb
... ... @@ -0,0 +1,14 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>TumblrLogin</title>
  5 + <%= stylesheet_link_tag :all %>
  6 + <%= javascript_include_tag :defaults %>
  7 + <%= csrf_meta_tag %>
  8 +</head>
  9 +<body>
  10 +
  11 +<%= yield %>
  12 +
  13 +</body>
  14 +</html>
4 config.ru
... ... @@ -0,0 +1,4 @@
  1 +# This file is used by Rack-based servers to start the application.
  2 +
  3 +require ::File.expand_path('../config/environment', __FILE__)
  4 +run TumblrLogin::Application
42 config/application.rb
... ... @@ -0,0 +1,42 @@
  1 +require File.expand_path('../boot', __FILE__)
  2 +
  3 +require 'rails/all'
  4 +
  5 +# If you have a Gemfile, require the gems listed there, including any gems
  6 +# you've limited to :test, :development, or :production.
  7 +Bundler.require(:default, Rails.env) if defined?(Bundler)
  8 +
  9 +module TumblrLogin
  10 + class Application < Rails::Application
  11 + # Settings in config/environments/* take precedence over those specified here.
  12 + # Application configuration should go into files in config/initializers
  13 + # -- all .rb files in that directory are automatically loaded.
  14 +
  15 + # Custom directories with classes and modules you want to be autoloadable.
  16 + # config.autoload_paths += %W(#{config.root}/extras)
  17 +
  18 + # Only load the plugins named here, in the order given (default is alphabetical).
  19 + # :all can be used as a placeholder for all plugins not explicitly named.
  20 + # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
  21 +
  22 + # Activate observers that should always be running.
  23 + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  24 +
  25 + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  26 + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  27 + # config.time_zone = 'Central Time (US & Canada)'
  28 +
  29 + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  30 + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  31 + # config.i18n.default_locale = :de
  32 +
  33 + # JavaScript files you want as :defaults (application.js is always included).
  34 + # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
  35 +
  36 + # Configure the default encoding used in templates for Ruby 1.9.
  37 + config.encoding = "utf-8"
  38 +
  39 + # Configure sensitive parameters which will be filtered from the log file.
  40 + config.filter_parameters += [:password]
  41 + end
  42 +end
6 config/boot.rb
... ... @@ -0,0 +1,6 @@
  1 +require 'rubygems'
  2 +
  3 +# Set up gems listed in the Gemfile.
  4 +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
  5 +
  6 +require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
24 config/database.yml
... ... @@ -0,0 +1,24 @@
  1 +login: &login
  2 + adapter: mysql2
  3 + host: localhost
  4 + username: duncan
  5 + password: moriarty
  6 + encoding: utf8
  7 + collation: utf8_general_ci
  8 +
  9 +
  10 +development:
  11 + database: burberry_tumblr_development
  12 + <<: *login
  13 +
  14 +test: &test
  15 + database: burberry_tumblr_development
  16 + <<: *login
  17 +
  18 +production:
  19 + database: burberry_tumblr_development
  20 + <<: *login
  21 +
  22 +cucumber:
  23 + <<: *test
  24 +
5 config/environment.rb
... ... @@ -0,0 +1,5 @@
  1 +# Load the rails application
  2 +require File.expand_path('../application', __FILE__)
  3 +
  4 +# Initialize the rails application
  5 +TumblrLogin::Application.initialize!
26 config/environments/development.rb
... ... @@ -0,0 +1,26 @@
  1 +TumblrLogin::Application.configure do
  2 + # Settings specified here will take precedence over those in config/application.rb
  3 +
  4 + # In the development environment your application's code is reloaded on
  5 + # every request. This slows down response time but is perfect for development
  6 + # since you don't have to restart the webserver when you make code changes.
  7 + config.cache_classes = false
  8 +
  9 + # Log error messages when you accidentally call methods on nil.
  10 + config.whiny_nils = true
  11 +
  12 + # Show full error reports and disable caching
  13 + config.consider_all_requests_local = true
  14 + config.action_view.debug_rjs = true
  15 + config.action_controller.perform_caching = false
  16 +
  17 + # Don't care if the mailer can't send
  18 + config.action_mailer.raise_delivery_errors = false
  19 +
  20 + # Print deprecation notices to the Rails logger
  21 + config.active_support.deprecation = :log
  22 +
  23 + # Only use best-standards-support built into browsers
  24 + config.action_dispatch.best_standards_support = :builtin
  25 +end
  26 +
49 config/environments/production.rb
... ... @@ -0,0 +1,49 @@
  1 +TumblrLogin::Application.configure do
  2 + # Settings specified here will take precedence over those in config/application.rb
  3 +
  4 + # The production environment is meant for finished, "live" apps.
  5 + # Code is not reloaded between requests
  6 + config.cache_classes = true
  7 +
  8 + # Full error reports are disabled and caching is turned on
  9 + config.consider_all_requests_local = false
  10 + config.action_controller.perform_caching = true
  11 +
  12 + # Specifies the header that your server uses for sending files
  13 + config.action_dispatch.x_sendfile_header = "X-Sendfile"
  14 +
  15 + # For nginx:
  16 + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
  17 +
  18 + # If you have no front-end server that supports something like X-Sendfile,
  19 + # just comment this out and Rails will serve the files
  20 +
  21 + # See everything in the log (default is :info)
  22 + # config.log_level = :debug
  23 +
  24 + # Use a different logger for distributed setups
  25 + # config.logger = SyslogLogger.new
  26 +
  27 + # Use a different cache store in production
  28 + # config.cache_store = :mem_cache_store
  29 +
  30 + # Disable Rails's static asset server
  31 + # In production, Apache or nginx will already do this
  32 + config.serve_static_assets = false
  33 +
  34 + # Enable serving of images, stylesheets, and javascripts from an asset server
  35 + # config.action_controller.asset_host = "http://assets.example.com"
  36 +
  37 + # Disable delivery errors, bad email addresses will be ignored
  38 + # config.action_mailer.raise_delivery_errors = false
  39 +
  40 + # Enable threaded mode
  41 + # config.threadsafe!
  42 +
  43 + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  44 + # the I18n.default_locale when a translation can not be found)
  45 + config.i18n.fallbacks = true
  46 +
  47 + # Send deprecation notices to registered listeners
  48 + config.active_support.deprecation = :notify
  49 +end
35 config/environments/test.rb
... ... @@ -0,0 +1,35 @@
  1 +TumblrLogin::Application.configure do
  2 + # Settings specified here will take precedence over those in config/application.rb
  3 +
  4 + # The test environment is used exclusively to run your application's
  5 + # test suite. You never need to work with it otherwise. Remember that
  6 + # your test database is "scratch space" for the test suite and is wiped
  7 + # and recreated between test runs. Don't rely on the data there!
  8 + config.cache_classes = true
  9 +
  10 + # Log error messages when you accidentally call methods on nil.
  11 + config.whiny_nils = true
  12 +
  13 + # Show full error reports and disable caching
  14 + config.consider_all_requests_local = true
  15 + config.action_controller.perform_caching = false
  16 +
  17 + # Raise exceptions instead of rendering exception templates
  18 + config.action_dispatch.show_exceptions = false
  19 +
  20 + # Disable request forgery protection in test environment
  21 + config.action_controller.allow_forgery_protection = false
  22 +
  23 + # Tell Action Mailer not to deliver emails to the real world.
  24 + # The :test delivery method accumulates sent emails in the
  25 + # ActionMailer::Base.deliveries array.
  26 + config.action_mailer.delivery_method = :test
  27 +
  28 + # Use SQL instead of Active Record's schema dumper when creating the test database.
  29 + # This is necessary if your schema can't be completely dumped by the schema dumper,
  30 + # like if you have constraints or database-specific column types
  31 + # config.active_record.schema_format = :sql
  32 +
  33 + # Print deprecation notices to the stderr
  34 + config.active_support.deprecation = :stderr
  35 +end
7 config/initializers/backtrace_silencers.rb
... ... @@ -0,0 +1,7 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
  4 +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
  5 +
  6 +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
  7 +# Rails.backtrace_cleaner.remove_silencers!
10 config/initializers/inflections.rb
... ... @@ -0,0 +1,10 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new inflection rules using the following format
  4 +# (all these examples are active by default):
  5 +# ActiveSupport::Inflector.inflections do |inflect|
  6 +# inflect.plural /^(ox)$/i, '\1en'
  7 +# inflect.singular /^(ox)en/i, '\1'
  8 +# inflect.irregular 'person', 'people'
  9 +# inflect.uncountable %w( fish sheep )
  10 +# end
5 config/initializers/mime_types.rb
... ... @@ -0,0 +1,5 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new mime types for use in respond_to blocks:
  4 +# Mime::Type.register "text/richtext", :rtf
  5 +# Mime::Type.register_alias "text/html", :iphone
3  config/initializers/omniauth.rb
... ... @@ -0,0 +1,3 @@
  1 +Rails.application.config.middleware.use OmniAuth::Builder do
  2 + provider :tumblr, '9ZPGUwJu2TSUf6JNumf8oR03JGginxoCQA5acRTE6PqdXZ5cEv', 'YKmdmA8MEzmBuYxG4cUzKy6YfzwNK9UgRRPUQZqFuRAst8Eody'
  3 +end
7 config/initializers/secret_token.rb
... ... @@ -0,0 +1,7 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Your secret key for verifying the integrity of signed cookies.
  4 +# If you change this key, all old signed cookies will become invalid!
  5 +# Make sure the secret is at least 30 characters and all random,
  6 +# no regular words or you'll be exposed to dictionary attacks.
  7 +TumblrLogin::Application.config.secret_token = '39ccaaad42590e086e71218a3bc397da61eabf344db30a8ccd0014f9e1f0c1a049934c2252b6d5dc5cddaf99cd61547d9ca01cbe8b06ee5203769e6f70f72ae3'
8 config/initializers/session_store.rb
... ... @@ -0,0 +1,8 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +TumblrLogin::Application.config.session_store :cookie_store, :key => '_tumblr_login_session'
  4 +
  5 +# Use the database for sessions instead of the cookie-based default,
  6 +# which shouldn't be used to store highly confidential information
  7 +# (create the session table with "rails generate session_migration")
  8 +# TumblrLogin::Application.config.session_store :active_record_store
5 config/locales/en.yml
... ... @@ -0,0 +1,5 @@
  1 +# Sample localization file for English. Add more files in this directory for other locales.
  2 +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
  3 +
  4 +en:
  5 + hello: "Hello world"
6 config/routes.rb
... ... @@ -0,0 +1,6 @@
  1 +TumblrLogin::Application.routes.draw do
  2 + root :to => "home#index"
  3 +
  4 + match "/auth/:provider/callback" => "sessions#create"
  5 + match "/signout" => "sessions#destroy", :as => :signout
  6 +end
15 db/migrate/20110919105711_create_users.rb
... ... @@ -0,0 +1,15 @@
  1 +class CreateUsers < ActiveRecord::Migration
  2 + def self.up
  3 + create_table :users do |t|
  4 + t.string :provider
  5 + t.string :uid
  6 + t.string :name
  7 +
  8 + t.timestamps
  9 + end
  10 + end
  11 +
  12 + def self.down
  13 + drop_table :users
  14 + end
  15 +end
23 db/schema.rb
... ... @@ -0,0 +1,23 @@
  1 +# This file is auto-generated from the current state of the database. Instead
  2 +# of editing this file, please use the migrations feature of Active Record to
  3 +# incrementally modify your database, and then regenerate this schema definition.
  4 +#
  5 +# Note that this schema.rb definition is the authoritative source for your
  6 +# database schema. If you need to create the application database on another
  7 +# system, you should be using db:schema:load, not running all the migrations
  8 +# from scratch. The latter is a flawed and unsustainable approach (the more migrations
  9 +# you'll amass, the slower it'll run and the greater likelihood for issues).
  10 +#
  11 +# It's strongly recommended to check this file into your version control system.
  12 +
  13 +ActiveRecord::Schema.define(:version => 20110919105711) do
  14 +
  15 + create_table "users", :force => true do |t|
  16 + t.string "provider"
  17 + t.string "uid"
  18 + t.string "name"
  19 + t.datetime "created_at"
  20 + t.datetime "updated_at"
  21 + end
  22 +
  23 +end
7 db/seeds.rb
... ... @@ -0,0 +1,7 @@
  1 +# This file should contain all the record creation needed to seed the database with its default values.
  2 +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
  3 +#
  4 +# Examples:
  5 +#
  6 +# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
  7 +# Mayor.create(:name => 'Daley', :city => cities.first)
2  doc/README_FOR_APP
... ... @@ -0,0 +1,2 @@
  1 +Use this README file to introduce your application and point to useful places in the API for learning more.
  2 +Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
0  lib/tasks/.gitkeep
No changes.
26 public/404.html
... ... @@ -0,0 +1,26 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>The page you were looking for doesn't exist (404)</title>
  5 + <style type="text/css">
  6 + body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
  7 + div.dialog {
  8 + width: 25em;
  9 + padding: 0 4em;
  10 + margin: 4em auto 0 auto;
  11 + border: 1px solid #ccc;
  12 + border-right-color: #999;
  13 + border-bottom-color: #999;
  14 + }
  15 + h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  16 + </style>
  17 +</head>
  18 +
  19 +<body>
  20 + <!-- This file lives in public/404.html -->
  21 + <div class="dialog">
  22 + <h1>The page you were looking for doesn't exist.</h1>
  23 + <p>You may have mistyped the address or the page may have moved.</p>
  24 + </div>
  25 +</body>
  26 +</html>
26 public/422.html
... ... @@ -0,0 +1,26 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>The change you wanted was rejected (422)</title>
  5 + <style type="text/css">
  6 + body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
  7 + div.dialog {
  8 + width: 25em;
  9 + padding: 0 4em;
  10 + margin: 4em auto 0 auto;
  11 + border: 1px solid #ccc;
  12 + border-right-color: #999;
  13 + border-bottom-color: #999;
  14 + }
  15 + h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  16 + </style>
  17 +</head>
  18 +
  19 +<body>
  20 + <!-- This file lives in public/422.html -->
  21 + <div class="dialog">
  22 + <h1>The change you wanted was rejected.</h1>
  23 + <p>Maybe you tried to change something you didn't have access to.</p>
  24 + </div>
  25 +</body>
  26 +</html>
26 public/500.html
... ... @@ -0,0 +1,26 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>We're sorry, but something went wrong (500)</title>
  5 + <style type="text/css">
  6 + body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
  7 + div.dialog {
  8 + width: 25em;
  9 + padding: 0 4em;
  10 + margin: 4em auto 0 auto;
  11 + border: 1px solid #ccc;
  12 + border-right-color: #999;
  13 + border-bottom-color: #999;
  14 + }
  15 + h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  16 + </style>
  17 +</head>
  18 +
  19 +<body>
  20 + <!-- This file lives in public/500.html -->
  21 + <div class="dialog">
  22 + <h1>We're sorry, but something went wrong.</h1>
  23 + <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  24 + </div>
  25 +</body>
  26 +</html>
0  public/favicon.ico
No changes.
BIN  public/images/rails.png
2  public/javascripts/application.js
... ... @@ -0,0 +1,2 @@
  1 +// Place your application-specific JavaScript functions and classes here
  2 +// This file is automatically included by javascript_include_tag :defaults
965 public/javascripts/controls.js
... ... @@ -0,0 +1,965 @@
  1 +// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
  2 +
  3 +// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
  4 +// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
  5 +// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
  6 +// Contributors:
  7 +// Richard Livsey
  8 +// Rahul Bhargava
  9 +// Rob Wills
  10 +//
  11 +// script.aculo.us is freely distributable under the terms of an MIT-style license.
  12 +// For details, see the script.aculo.us web site: http://script.aculo.us/
  13 +
  14 +// Autocompleter.Base handles all the autocompletion functionality
  15 +// that's independent of the data source for autocompletion. This
  16 +// includes drawing the autocompletion menu, observing keyboard
  17 +// and mouse events, and similar.
  18 +//
  19 +// Specific autocompleters need to provide, at the very least,
  20 +// a getUpdatedChoices function that will be invoked every time
  21 +// the text inside the monitored textbox changes. This method
  22 +// should get the text for which to provide autocompletion by
  23 +// invoking this.getToken(), NOT by directly accessing
  24 +// this.element.value. This is to allow incremental tokenized
  25 +// autocompletion. Specific auto-completion logic (AJAX, etc)
  26 +// belongs in getUpdatedChoices.
  27 +//
  28 +// Tokenized incremental autocompletion is enabled automatically
  29 +// when an autocompleter is instantiated with the 'tokens' option
  30 +// in the options parameter, e.g.:
  31 +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
  32 +// will incrementally autocomplete with a comma as the token.
  33 +// Additionally, ',' in the above example can be replaced with
  34 +// a token array, e.g. { tokens: [',', '\n'] } which
  35 +// enables autocompletion on multiple tokens. This is most
  36 +// useful when one of the tokens is \n (a newline), as it
  37 +// allows smart autocompletion after linebreaks.
  38 +
  39 +if(typeof Effect == 'undefined')
  40 + throw("controls.js requires including script.aculo.us' effects.js library");
  41 +
  42 +var Autocompleter = { };
  43 +Autocompleter.Base = Class.create({
  44 + baseInitialize: function(element, update, options) {
  45 + element = $(element);
  46 + this.element = element;
  47 + this.update = $(update);
  48 + this.hasFocus = false;
  49 + this.changed = false;
  50 + this.active = false;
  51 + this.index = 0;
  52 + this.entryCount = 0;
  53 + this.oldElementValue = this.element.value;
  54 +
  55 + if(this.setOptions)
  56 + this.setOptions(options);
  57 + else
  58 + this.options = options || { };
  59 +
  60 + this.options.paramName = this.options.paramName || this.element.name;
  61 + this.options.tokens = this.options.tokens || [];
  62 + this.options.frequency = this.options.frequency || 0.4;
  63 + this.options.minChars = this.options.minChars || 1;
  64 + this.options.onShow = this.options.onShow ||
  65 + function(element, update){
  66 + if(!update.style.position || update.style.position=='absolute') {
  67 + update.style.position = 'absolute';
  68 + Position.clone(element, update, {
  69 + setHeight: false,
  70 + offsetTop: element.offsetHeight
  71 + });
  72 + }
  73 + Effect.Appear(update,{duration:0.15});
  74 + };
  75 + this.options.onHide = this.options.onHide ||
  76 + function(element, update){ new Effect.Fade(update,{duration:0.15}) };
  77 +
  78 + if(typeof(this.options.tokens) == 'string')
  79 + this.options.tokens = new Array(this.options.tokens);
  80 + // Force carriage returns as token delimiters anyway
  81 + if (!this.options.tokens.include('\n'))
  82 + this.options.tokens.push('\n');
  83 +
  84 + this.observer = null;
  85 +
  86 + this.element.setAttribute('autocomplete','off');
  87 +
  88 + Element.hide(this.update);
  89 +
  90 + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
  91 + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
  92 + },
  93 +
  94 + show: function() {
  95 + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
  96 + if(!this.iefix &&
  97 + (Prototype.Browser.IE) &&
  98 + (Element.getStyle(this.update, 'position')=='absolute')) {
  99 + new Insertion.After(this.update,
  100 + '<iframe id="' + this.update.id + '_iefix" '+
  101 + 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
  102 + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
  103 + this.iefix = $(this.update.id+'_iefix');
  104 + }
  105 + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
  106 + },
  107 +
  108 + fixIEOverlapping: function() {
  109 + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
  110 + this.iefix.style.zIndex = 1;
  111 + this.update.style.zIndex = 2;
  112 + Element.show(this.iefix);
  113 + },
  114 +
  115 + hide: function() {
  116 + this.stopIndicator();
  117 + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
  118 + if(this.iefix) Element.hide(this.iefix);
  119 + },
  120 +
  121 + startIndicator: function() {
  122 + if(this.options.indicator) Element.show(this.options.indicator);
  123 + },
  124 +
  125 + stopIndicator: function() {
  126 + if(this.options.indicator) Element.hide(this.options.indicator);
  127 + },
  128 +
  129 + onKeyPress: function(event) {
  130 + if(this.active)
  131 + switch(event.keyCode) {
  132 + case Event.KEY_TAB:
  133 + case Event.KEY_RETURN:
  134 + this.selectEntry();
  135 + Event.stop(event);
  136 + case Event.KEY_ESC:
  137 + this.hide();
  138 + this.active = false;
  139 + Event.stop(event);
  140 + return;
  141 + case Event.KEY_LEFT:
  142 + case Event.KEY_RIGHT:
  143 + return;
  144 + case Event.KEY_UP:
  145 + this.markPrevious();
  146 + this.render();
  147 + Event.stop(event);
  148 + return;
  149 + case Event.KEY_DOWN:
  150 + this.markNext();
  151 + this.render();
  152 + Event.stop(event);
  153 + return;
  154 + }
  155 + else
  156 + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
  157 + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
  158 +
  159 + this.changed = true;
  160 + this.hasFocus = true;
  161 +
  162 + if(this.observer) clearTimeout(this.observer);
  163 + this.observer =
  164 + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
  165 + },
  166 +
  167 + activate: function() {
  168 + this.changed = false;
  169 + this.hasFocus = true;
  170 + this.getUpdatedChoices();
  171 + },
  172 +
  173 + onHover: function(event) {
  174 + var element = Event.findElement(event, 'LI');
  175 + if(this.index != element.autocompleteIndex)
  176 + {
  177 + this.index = element.autocompleteIndex;
  178 + this.render();
  179 + }
  180 + Event.stop(event);
  181 + },
  182 +
  183 + onClick: function(event) {
  184 + var element = Event.findElement(event, 'LI');
  185 + this.index = element.autocompleteIndex;
  186 + this.selectEntry();
  187 + this.hide();
  188 + },
  189 +
  190 + onBlur: function(event) {
  191 + // needed to make click events working
  192 + setTimeout(this.hide.bind(this), 250);
  193 + this.hasFocus = false;
  194 + this.active = false;
  195 + },
  196 +
  197 + render: function() {
  198 + if(this.entryCount > 0) {
  199 + for (var i = 0; i < this.entryCount; i++)
  200 + this.index==i ?
  201 + Element.addClassName(this.getEntry(i),"selected") :
  202 + Element.removeClassName(this.getEntry(i),"selected");
  203 + if(this.hasFocus) {
  204 + this.show();
  205 + this.active = true;
  206 + }
  207 + } else {
  208 + this.active = false;
  209 + this.hide();
  210 + }
  211 + },
  212 +
  213 + markPrevious: function() {
  214 + if(this.index > 0) this.index--;
  215 + else this.index = this.entryCount-1;
  216 + this.getEntry(this.index).scrollIntoView(true);
  217 + },
  218 +
  219 + markNext: function() {
  220 + if(this.index < this.entryCount-1) this.index++;
  221 + else this.index = 0;
  222 + this.getEntry(this.index).scrollIntoView(false);
  223 + },
  224 +
  225 + getEntry: function(index) {
  226 + return this.update.firstChild.childNodes[index];
  227 + },
  228 +
  229 + getCurrentEntry: function() {
  230 + return this.getEntry(this.index);
  231 + },
  232 +
  233 + selectEntry: function() {