github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

ihower / facebox_render

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 84
    • 5
  • Source
  • Commits
  • Network (5)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

FaceboxRender is a Rails plugin let you use lightbox seamlessly using Facebox library (http://famspam.com/facebox/) — Read more

  cancel

http://handlino.com/blog/2008/02/26/57/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

removed the '.html.erb' file extension to add support for other view 
types(i.e. haml).  Rails 2.3 is smart enough to understand. 
Blake Chambers (author)
Mon Jun 29 10:44:26 -0700 2009
commit  fd32302922bdb43a43aec67301534fc1865d1b85
tree    51b945b7564a04f9cde62c3f71249a29005e9231
parent  9c94728ae5af208330a7172d5be0d7066c8b9bf1
facebox_render /
name age
history
message
file README.txt Tue Jun 10 23:54:14 -0700 2008 update README [ihower]
file init.rb Tue Jun 10 23:48:23 -0700 2008 import from facebox-render [ihower]
directory lib/ Mon Jun 29 10:44:26 -0700 2009 removed the '.html.erb' file extension to add s... [Blake Chambers]
README.txt
Author:: Wen-Tien Chang(mailto:ihower@handlino.com)
Copyright:: Copyright (c) 2008 Handlino Inc.
Licensed under the MIT: http://www.opensource.org/licenses/mit-license.php

== Description ==
FaceboxRender plugin let you use lightbox seamlessly using Facebox library.
http://handlino.com/blog/2008/02/26/57/

== Install ==
 * download from http://github.com/ihower/facebox_render/
 * uncompress to /vendor/plugins/facebox_render
 
 Note that you must install Facebox first(see http://famspam.com/facebox/).
 
 1.Download jQuery (or you can try to install http://ennerchi.com/projects/jrails to replace Prototype library totally)
 2.Download facebox
 3.Copy facebox js file to /public/javascripts/
 4.Copy facebox css file to /public/styleshees/
 5.Copy facebox all image files to /public/facebox/
 6.Config your layout (stylesheet_link_tag and javascript_include_tag) to add these js,css files

= USAGE =

== Helper ==
We have facebox_link_to helper (it's will launch loading facebox first, send ajax request second)
or you can use link_to_remote, form_remote_tag...etc Ajax helper.
Don't use <a href="somelink" ref="facebox">

== Controller ==
Add "include FaceboxRender" to your controller, 
or simply put it at /app/controllers/application.rb

Then in your action:

respond_to do |format|
 format.html
 format.js { render_to_facebox }
end

By Default render the html without layout,
otherwise you can pass options[:template], options[:action], options[:partial] or options[:html] string.
Passing options[:msg] will pulsate a message.

If block given, it will yield after facebox script, eg:
  
render_to_facebox do |page|
  page << "alert('test')"
end

Besides render_facebox, we have close_facebox, redirect_from_facebox.

respond_to do |format|
 format.html
 format.js { close_facebox }
end
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server