You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.3 KiB

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