jlong / popupjs

A prototype/lowpro based Facebook-style windowing solution

This URL has Read+Write access

popupjs / test / index.haml
100644 55 lines (47 sloc) 1.8 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
!!!Strict
%html
  %head
    %title Test
    %link{:rel=>"stylesheet", :type=>"text/css", :href=>"/stylesheets/facebook.css"}/
    %script{:type=>"text/javascript", :src=>"/javascripts/prototype.js"}
    %script{:type=>"text/javascript", :src=>"/javascripts/effects.js"}
    / Required if you want draggable windows
    %script{:type=>"text/javascript", :src=>"/javascripts/dragdrop.js"}
    %script{:type=>"text/javascript", :src=>"/javascripts/lowpro.js"}
    %script{:type=>"text/javascript", :src=>"/javascripts/popup.js"}
    %script{:type=>"text/javascript"}
      :plain
        Event.addBehavior({ 'a.popup': Popup.TriggerBehavior() });
  %body
    %p
      %a.popup{:href=>"#test"} Popup
    
    %p
      %a.popup{:href=>"/test/ajax.haml"} Ajax Popup
    
    %p
      %a.popup{:href=>"#search"} Popup Input
    
    %p
      %a.popup{:href=>"#dragme"} Draggable
    
    %p
      %a.popup{:href=>"/test/draggable_ajax.haml"} Draggable Ajax Popup
    
    .popup#test{:style=>"display: none; width: 20em;"}
      %h3.title Popup Window
      .popup_content
        %p
          This little javascript library allows you to create Facebook-style
          popup windows with LowPro and Prototype.
        %p
          %a{:href=>"javascript: Element.closePopup('test')"} Close
    
    .popup#search{:style=>"display: none"}
      %h3.title Search
      .popup_content
        %form
          %p
            %input{:type=>"text", :name=>"query", :id=>"query", :value=>""}/
          %p
            %a{:href=>"javascript: Element.closePopup('search')"} Close
    
    .popup.draggable#dragme{:style=>"display: none"}
      %h3.title Drag Me
      .popup_content
        %p Try dragging me around by my title.
        %p
          %a{:href=>"javascript: Element.closePopup('dragme')"} Close