Bug Tracker

Ticket #2225: index.html

File index.html, 2.2 kB (added by hansolo, 8 months ago)
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<link rel="stylesheet" href="css/main.css" type="text/css" media="screen" />
5<script type="text/javascript" src="js/jquery.js"></script>
6<script type="text/javascript" src="js/jquery.jcache.js"></script>
7<script type="text/javascript">
8function tog(divID)
9{
10    theDiv = document.getElementById(divID);
11    theDiv.style.display = theDiv.style.display == 'block' ? 'none' : 'block';
12}
13
14$.jCache.maxSize = 10;
15
16blubb = function(theType, theURL, theData, divContent, divLoading){ 
17    if (theType == "") theType = "GET";
18    divContent = "#" + divContent;
19    divLoading = "#" + divLoading;
20   
21    var cache_key = theURL;
22           
23   
24    if (theType.toUpperCase() == "GET" && $.jCache.hasItem(cache_key))
25    {
26        $(divContent).fadeOut("slow", function(){
27                $(divContent).html($.jCache.getItem(cache_key));
28                $(divContent).fadeIn("slow");
29            }
30        );
31       
32        return;
33    }
34       
35    $(divContent).hide("slow", function(){
36        $(divLoading).show("slow", function(){     
37            $.ajax({
38                type: theType,
39                url: theURL,
40                data: theData,
41                success: function(msg){
42                   
43                    if (theType.toUpperCase() == "GET")
44                    {
45                        $.jCache.setItem(cache_key, msg);
46                    }
47                   
48                    $(divLoading).hide("slow", function(){
49                        $(divContent).html(msg);
50                        $(divContent).show("slow");
51                    });
52                },
53                error: function(){
54                    $(divLoading).hide("slow", function(){
55                        $(divContent).html("<p>error!</p>");
56                        $(divContent).show("slow");
57                    });
58                }
59            });
60        });
61    });
62}
63
64function loadFakeData(zahl)
65{
66   blubb("", 'content/content'+zahl+'.html', '', "demoContent", "demoLoading");
67}
68</script>
69
70
71<link rel="stylesheet" type="text/css" href="test/toggleElements.css" />
72<script type="text/javascript" src="test/jquery.toggleElements.pack.js"></script>
73    <script type="text/javascript">
74    $(document).ready(function(){
75        $('div.toggler-1').toggleElements( );
76    });
77    </script>
78   
79</head>
80<body>
81
82            <div id="divDemo">
83                <div id="demoContent">
84
85                </div>
86               
87                <div id="demoLoading" style="display: none">
88                    <img src="images/icons/loading.gif" />
89                </div>
90            </div>     
91
92</body>
93</html>