Sha256: 5a52860b75f7603887f1d078f02061a444396176d676214a16522be423a2ebaf

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

require 'sinatra/base'
require 'haml'
require 'rack/jquery'
require 'rack/jquery_ui'

class App < Sinatra::Base

  enable :inline_templates
  use Rack::JQuery
  use Rack::JQueryUI

  get "/" do
    "RUNNING"
  end

  get "/google-cdn" do
    haml :index, :layout => :google
  end

  get "/media-temple-cdn" do
    haml :index, :layout => :mediatemple
  end

  get "/microsoft-cdn" do
    haml :index, :layout => :microsoft
  end

  get "/unspecified-cdn" do
    haml :index, :layout => :unspecified
  end
end

__END__

@@google
%html
  %head
    = Rack::JQuery.cdn( :google )
    = Rack::JQueryUI.cdn( :organisation => :google )
  = yield

@@microsoft
%html
  %head
    = Rack::JQuery.cdn( :microsoft )
    = Rack::JQueryUI.cdn( :organisation => :microsoft )
  = yield

@@mediatemple
%html
  %head
    = Rack::JQuery.cdn( :media_temple )
    = Rack::JQueryUI.cdn( :organisation => :media_temple )
  = yield

@@unspecified
%html
  %head
    = Rack::JQuery.cdn()
    = Rack::JQueryUI.cdn()
  = yield

@@index

%p.aclass
  "NOTHING TO SEE HERE… "
%p.aclass
  "MOVE ALONG… "
%p.aclass
  "MOVE ALONG… "
#placeholder
:javascript
  all_text = $('.aclass').text();
  $('#placeholder').text(all_text + " (draggable!)").mouseover(function() {
    $(this).css({ 'color': 'red', 'font-size': '150%' });    
  }).mouseout(function() {
    $(this).css({ 'color': 'blue', 'font-size': '100%' });
  }).draggable();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-jquery_ui-0.0.1 examples/config.rb