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

quirkey / sammy

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 352
    • 27
  • Source
  • Commits
  • Network (27)
  • Issues (4)
  • Downloads (7)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (11)
    • 1.4
    • extend_hack
    • gh-pages
    • master ✓
    • mustache
    • nativehashchange
    • next
    • nextwithout1.4
    • noengine
    • redirect_fix
    • storage
  • Tags (7)
    • v0.4.1
    • v0.4.0
    • v0.3.0
    • v0.2.1
    • v0.2.0
    • v0.1.4
    • v0.1.3
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.

Sammy is a tiny javascript framework built on top of jQuery, It's RESTful Evented Javascript. — Read more

  cancel

http://code.quirkey.com/sammy

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

This URL has Read+Write access

Submodule-tastic 
quirkey (author)
Sun Feb 07 17:39:47 -0800 2010
commit  3b75b49d327addb118d0c40f9308dd8ba1818bc6
tree    4e38ae57952516dc020d4e5f44409c392a9bee8f
parent  df8e5c791649fc9d5db818ab2837422641b4e22f
sammy /
name age
history
message
file .gitignore Thu Sep 03 20:51:56 -0700 2009 Changes to the way logging works Sammy.addLogg... [quirkey]
file .gitmodules Sat Sep 26 14:56:34 -0700 2009 Added self-referential site dir for a submodule... [quirkey]
file HISTORY Mon Jan 11 19:06:43 -0800 2010 Pushing Sammy 0.4.1 [quirkey]
file LICENSE Mon May 11 07:56:20 -0700 2009 Added MIT License. Also first draft of README [quirkey]
file README.md Fri Dec 11 21:27:56 -0800 2009 Added a ton of documentation to Sammy.Mustache [quirkey]
file Rakefile Mon Jan 11 19:06:43 -0800 2010 Pushing Sammy 0.4.1 [quirkey]
directory examples/ Sun Dec 27 10:21:25 -0800 2009 Updated sammy [quirkey]
directory lib/ Mon Jan 11 19:06:43 -0800 2010 Pushing Sammy 0.4.1 [quirkey]
submodule site - 2064d74 Sun Feb 07 17:39:47 -0800 2010 Submodule-tastic [quirkey]
directory test/ Mon Jan 11 18:37:21 -0800 2010 Fixed failing IE test [quirkey]
directory vendor/ Sun Feb 07 17:39:47 -0800 2010 Submodule-tastic [quirkey]
README.md

Sammy

http://code.quirkey.com/sammy

Description

Sammy is a tiny javascript framework built on top of jQuery inspired by Ruby's Sinatra.

Installation

Download sammy.js and install it in your public javascripts directory. Include it in your document AFTER jquery.

Usage

Like Sinatra, a Sammy application revolves around 'routes'. Routes in Sammy are a little different, though. Not only can you define 'get' and 'post' routes, but you can also bind routes to custom events triggered by your application.

You set up a Sammy Application by passing a Function to the $.sammy (which is a shortcut for the Sammy.Application constructor).

$.sammy(function() {

  this.get('#/', function() {
    $('#main').text('Welcome!');
  });

});

Inside the 'app' function() this is the Application. This is where you can configure the application and add routes.

Above, we defined a get() route. When the browser is pointed to #/ the function passed to that route will be run. Inside the route function, this is a Sammy.EventContext. EventContext has a bunch of special methods and properties including a params hash, the ability to redirect, render partials, and more.

Once you've defined an application the only thing left to do is run it. The best-practice behavior is to encapulate run() in a document.ready block:

var app = $.sammy(...)

$(function() {
  app.run();
});

This will guarantee that the DOM is loaded before we try to apply functionality to it.

Dependencies

Sammy requires jQuery >= 1.3.2 Get it from: http://jquery.com

More!

Learn!

  • Intro
  • Docs
  • Examples
  • More Resources

Keep informed!

  • Follow @sammy_js
  • Join the mailing list
  • Chat with us in #sammy

Authors

Sammy.js was created and is maintained by Aaron Quint with additional features and fixes contributed by these talented individuals:

  • Frank Prößdorf / endor
  • Alexander Lang / langalex
  • Scott McMillin / scottymac
  • ZhangJinzhu / jinzhu
  • Jesse Hallett / hallettj
  • Jonathan Vaught / gravelpup
  • Jason Davies / jasondavies
  • Russell Jones / CodeOfficer
  • Geoff Longman

License

Sammy is covered by the MIT License. See LICENSE for more information.

Sammy includes code originally created by John Resig (Class implementation) and Greg Borenstien (srender).

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