OpenCores
URL https://opencores.org/ocsvn/cpu8080/cpu8080/trunk

Subversion Repositories cpu8080

[/] [cpu8080/] [trunk/] [project/] [cpu8080_html/] [fit/] [applet.js] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 samiam9512
    var tmpStr = "";
2
    var waitWin;
3
 
4
    function openWait() {
5
     waitWin = window.open("wait.htm", "wait",
6
                          "toolbar=no,location=no,"+
7
                             "directories=no,status=no,menubar=no,scrollbars=no,"+
8
                             "resizable=no,width=300,height=50" );
9
    }
10
 
11
    function closeWait() { if (waitWin) waitWin.close(); }
12
 
13
    function setMsg(msg){
14
 
15
       parent.leftnav.setAppletMsg( msg );
16
       // now send it reload forces
17
       // call to applet paint
18
        location.reload();
19
    }
20
 
21
    function getMsg(){
22
 
23
        return( parent.leftnav.getAppletMsg() );
24
    }
25
 
26
    function resetMsg(){ parent.leftnav.setAppletMsg(""); }
27
 
28
    function printAppletPkg() {
29
        if( isNS() ){
30
             setMsg("cmd printPkg ");
31
         }
32
         else{
33
             document.ChipViewerApplet.PrintPkg();
34
         }
35
    }
36
 
37
    function showAppletGraphicMC(mc) {
38
        if( isNS() ){
39
             setMsg("cmd showMac " + mc);
40
         }
41
         else{
42
             document.ChipViewerApplet.ShowMac(mc);
43
         }
44
    }
45
 
46
    function ShowMC() { showAppletGraphicMC(tmpStr); }
47
 
48
    function showAppletGraphicFB(fb) {
49
         if( isNS() ){
50
            setMsg("cmd showFB " + fb);
51
         }
52
         else{
53
             document.ChipViewerApplet.ShowFB(fb);
54
         }
55
    }
56
 
57
    function showAppletGraphicPin(pin) {
58
         if( isNS() ){
59
            setMsg("cmd showPin " + pin);
60
         }
61
         else{
62
             document.ChipViewerApplet.ShowPin(pin);
63
         }
64
    }
65
 
66
    function ShowFB() { showAppletGraphicFB(tmpStr); }
67
 
68
    function isNS() {
69
      return ((navigator.appName.indexOf("Netscape") >= 0) && (parseFloat(navigator.appVersion) < 5) ) ? true : false;
70
    }
71
 
72
    function isIE(){
73
        var agt=navigator.userAgent.toLowerCase();
74
        return( ( (agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) ) ? true: false );
75
    }
76
 
77
    function waitUntilOK() {
78
      if (!waitWin) openWait();
79
      if (isNS()) {
80
        if (document.ChipViewerApplet.isActive()) closeWait();
81
        else  settimeout("waitUntilOK()",100);
82
      }
83
      else {
84
        if (document.ChipViewerApplet.readyState == 4) closeWait();
85
        else  settimeout("waitUntilOK()",100);
86
      }
87
    }
88
 
89
 
90
    // check that the applet if file has been generated
91
    // this can only be done if the applets been loaded.
92
    function fileExists(fileName){
93
 
94
        if( document.ChipViewerApplet.readyState != 4 ) {
95
            window.alert("Navigation disabled until the applet is loaded." );
96
        }
97
        if( isIE() ){
98
            if( parent.leftnav.getAppletPermission() == 1 ){
99
                if( document.ChipViewerApplet.TestFileExists(fileName) == 1 ){
100
                    window.alert("file exist tests true" );
101
                    return( true );
102
                }
103
            }
104
            else{
105
                window.alert("file exist returns true no permission" );
106
                return( true );
107
            }
108
        }
109
        else{
110
            return( true );
111
        }
112
        window.alert("file exist returns false" );
113
        return( false );
114
    }
115
 
116
 
117
 
118
    function setPermission(){
119
 
120
        if( isIE() ){
121
            if( document.ChipViewerApplet.granted() ){
122
                parent.leftnav.setAppletPermission();
123
            }
124
        }
125
        else{
126
            return( true );
127
        }
128
    }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.