~joebordes/chive/chive_lib_upgrade

« back to all changes in this revision

Viewing changes to yii/gii/assets/js/main.js

  • Committer: Joe Bordes
  • Date: 2011-08-22 18:24:26 UTC
  • Revision ID: joe@tsolucio.com-20110822182426-zrvpiuyvm20ybjki
Update yii framework 1.1.8 and associated libraries.
Update About page to reflect changes.
Basic testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$(document).ready(function() {
 
2
        if($('div.form.login').length) {  // in login page
 
3
                $('input#LoginForm_password').focus();
 
4
        }
 
5
 
 
6
        $('table.preview input[name="checkAll"]').click(function() {
 
7
                $('table.preview .confirm input').attr('checked', this.checked);
 
8
        });
 
9
 
 
10
        $('table.preview td.confirm input').click(function() {
 
11
                $('table.preview input[name="checkAll"]').attr('checked', !$('table.preview td.confirm input:not(:checked)').length);
 
12
        });
 
13
        $('table.preview input[name="checkAll"]').attr('checked', !$('table.preview td.confirm input:not(:checked)').length);
 
14
 
 
15
        $('.form .row.sticky input:not(.error), .form .row.sticky select:not(.error), .form .row.sticky textarea:not(.error)').each(function(){
 
16
                var value;
 
17
                if(this.tagName=='SELECT')
 
18
                        value=this.options[this.selectedIndex].text;
 
19
                else if(this.tagName=='TEXTAREA')
 
20
                        value=$(this).html();
 
21
                else
 
22
                        value=$(this).val();
 
23
                if(value=='')
 
24
                        value='[empty]';
 
25
                $(this).before('<div class="value">'+value+'</div>').hide();
 
26
        });
 
27
 
 
28
        $('.form.gii .row.sticky .value').live('click', function(){
 
29
                $(this).hide();
 
30
                $(this).next().show().get(0).focus();
 
31
        });
 
32
 
 
33
 
 
34
        $('.form.gii .row input, .form.gii .row textarea, .form.gii .row select, .with-tooltip').not('.no-tooltip, .no-tooltip *').tooltip({
 
35
            position: "center right",
 
36
                offset: [-2, 10]
 
37
        });
 
38
 
 
39
        $('.form.gii .row input').change(function(){
 
40
                $('.form.gii .feedback').hide();
 
41
                $('.form.gii input[name="generate"]').hide();
 
42
        });
 
43
 
 
44
        $('.form.gii .view-code').click(function(){
 
45
                var title=$(this).attr('rel');
 
46
                $.fancybox.showActivity();
 
47
                $.ajax({
 
48
                        type: 'POST',
 
49
                        cache: false,
 
50
                        url: $(this).attr('href'),
 
51
                        data: $('.form.gii form').serializeArray(),
 
52
                        success: function(data){
 
53
                                $.fancybox(data, {
 
54
                                        'title': title,
 
55
                                        'titlePosition': 'inside',
 
56
                                        'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
 
57
                                                return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();">close</a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + '</div>';
 
58
                                        },
 
59
                                        'showCloseButton': false,
 
60
                                        'autoDimensions': false,
 
61
                                        'width': 900,
 
62
                                        'height': 'auto',
 
63
                                        'onComplete':function(){
 
64
                                                $('#fancybox-inner').scrollTop(0);
 
65
                                        }
 
66
                                });
 
67
                        },
 
68
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
 
69
                                $.fancybox('<div class="error">'+XMLHttpRequest.responseText+'</div>');
 
70
                        }
 
71
                });
 
72
                return false;
 
73
        });
 
74
 
 
75
        $('#fancybox-inner .close-code').live('click', function(){
 
76
                $.fancybox.close();
 
77
                return false;
 
78
        });
 
79
});
 
 
b'\\ No newline at end of file'