~ubuntu-branches/ubuntu/natty/prewikka/natty

« back to all changes in this revision

Viewing changes to htdocs/js/functions.js

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2008-07-02 16:49:06 UTC
  • mfrom: (6.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080702164906-q2bkfn6i40hd95tt
Tags: 0.9.14-2
* Update watch file
* Bump Standards version to 3.8.0 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
var cur_visible = null;
2
 
 
3
 
function toggleVisibility(section_id) {
4
 
        section = document.getElementById(section_id);
 
1
var autorefresh_possible = true;
 
2
 
 
3
$(document).ready(function(){
 
4
  var $cache = null;
 
5
  var $cachef = null;
 
6
 
 
7
  $.fn.popupUnique = function(animshow, animhide) {
 
8
        if ( this.is(':visible') ) {
 
9
                $cachef($cache);
 
10
                $cache = null;
 
11
                autorefresh_possible = true;
 
12
        } else {
 
13
                autorefresh_possible = false;
 
14
 
 
15
                animshow(this);
 
16
                if ( $cache )
 
17
                        $cachef($cache);
 
18
                $cachef = animhide;
 
19
                $cache = this;
 
20
        }
5
21
        
6
 
        if ( section.style.display != 'block' ) {
7
 
                section.style.display = 'block';
8
 
        } else {
9
 
                section.style.display = 'none';
10
 
        }
11
 
}
12
 
 
13
 
 
14
 
function toggleVisibilityUnique(section_id) 
15
 
{
16
 
        if ( cur_visible )
17
 
                cur_visible.style.display = 'none';
18
 
 
19
 
        section = document.getElementById(section_id);
20
 
        if ( cur_visible == section ) {
21
 
                cur_visible = null;
22
 
                return;
23
 
        }
24
 
 
25
 
        toggleVisibility(section_id);
26
 
 
27
 
        if ( section.style.display == 'block' )
28
 
                cur_visible = section;
29
 
        else
30
 
                cur_visible = null;
31
 
}
32
 
 
33
 
 
34
 
function toggleFilteredColumnVisibility(column_id) {
35
 
        columns = new Array("classification", "source", "target", "analyzer");
36
 
 
37
 
        for ( var i=0; i < columns.length; i++ ) {
38
 
                popup = document.getElementById(columns[i]);
39
 
 
40
 
                if ( column_id == columns[i] ) {
41
 
                        if ( popup.style.display != 'block' ) {
42
 
                                popup.style.display = 'block';
43
 
                        } else {
44
 
                                popup.style.display = 'none';
45
 
                        }
46
 
                } else {
47
 
                        popup.style.display = 'none';
48
 
                }
49
 
        }
50
 
}
51
 
 
52
 
function checkBoxByName(name, value) {
53
 
        for (var i = 0; i < document.forms[0].elements.length; i++ ) {
54
 
                var elem = document.forms[0].elements[i];
55
 
                
56
 
                if ( elem.name == name ) {
57
 
                        elem.checked = value;
58
 
                }
59
 
        }
60
 
}
 
22
        return false;
 
23
  };
 
24
 
 
25
  $.fn.check = function(mode){
 
26
        return this.each(function() { this.checked = mode; } );
 
27
  };
 
28
 
 
29
  $(".popup_menu_toggle").click(function(){
 
30
    $(this).next().popupUnique(function(data){data.show('fast')}, function(data){data.hide('fast')});
 
31
  });
 
32
 
 
33
 
 
34
 if ( navigator.userAgent.indexOf("Konqueror") != -1 )
 
35
        $(".popup_menu").hide();
 
36
});