~joaopinto/apt-portal/pre-modules

« back to all changes in this revision

Viewing changes to applications/playdeb/static/js/page.games_list.js

  • Committer: Joao Pinto
  • Date: 2009-06-13 22:45:41 UTC
  • Revision ID: joao.pinto@getdeb.net-20090613224541-g1fpmbb9e9jg5u10
Initial commit for the cherrypy version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Javascript written by Tyler Mulligan
 
2
// http://www.detrition.net
 
3
 
 
4
// Load shadowbox skin
 
5
Shadowbox.loadSkin('classic', 'js/skin'); // use the "classic" skin
 
6
 
 
7
$(document).ready(function() {
 
8
        // Info Box
 
9
        $('.info_content').hide();
 
10
        $('.info_content p').hide();
 
11
        $('.info_content code').hide();
 
12
        $('.info_header h2 a').text("Click Here to Learn how to Install Games from PlayDeb");
 
13
        $('.info_header a').click(function () { 
 
14
      $('.info_content').slideToggle('fast');
 
15
      $('.info_content p').fadeIn(1200);
 
16
      $('.info_content code').fadeIn(1800);
 
17
          return false;
 
18
    });
 
19
 
 
20
        // Genre Dropdown
 
21
        $('#genre li').hover(
 
22
                function(){ $('ul', this).fadeIn('fast'); }, 
 
23
                function() { } 
 
24
        );
 
25
        if (document.all) {
 
26
                $('#genre li').hoverClass ('sfHover');
 
27
        }
 
28
        
 
29
        // Shadowbox
 
30
        var options = {
 
31
        resizeLgImages:     true,
 
32
        displayNav:         true,
 
33
        handleUnsupported:  'remove',
 
34
        enableKeys:                     true
 
35
    };
 
36
 
 
37
    Shadowbox.init(options);
 
38
        
 
39
        // Ratings
 
40
        $('.the_stars :radio.star').rating(); 
 
41
        
 
42
        // Tags
 
43
        $('.add_tag').hide();
 
44
        $('.add_new_tag').click(function () { 
 
45
                $(this).parent().children('.add_tag').fadeIn();
 
46
                return false;
 
47
    });
 
48
        $('.add_tag_submit').click(function () {
 
49
                //$(this).parent('.tags_container').children('.tags').fadeOut();
 
50
                $(this).parent().parent('.tags_container').children('.tags').fadeOut();
 
51
                $(this).parent().fadeOut();
 
52
                // Database requery - then:
 
53
                var newtag = $(this).parent().children('.add_tag_box').val()
 
54
                if (newtag=="") { newtag="new tag!" }
 
55
                $(this).parent().parent('.tags_container').children('.tags').append(", " + newtag );
 
56
                $(this).parent().parent('.tags_container').children('.tags').fadeIn();
 
57
        });
 
58
 
 
59
});
 
60
 
 
61
// Dropdown Function
 
62
$.fn.hoverClass = function(c) {
 
63
        return this.each(function(){
 
64
                $(this).hover( 
 
65
                        function() { $(this).addClass(c);  },
 
66
                        function() { $(this).removeClass(c); }
 
67
                );
 
68
        });
 
69
};