1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22\startJSpreamble Steps used now
23
24var dococglist = this.getOCGs() ;
25var docstepname = "step" ;
26var doccurrentstep = 0 ;
27var docmaxstep = 50 ;
28var docvisited = new Array() ;
29var docbusy = new Array() ;
30
31function SetupStepper(layername,laststep) {
32 docstepname = layername ;
33 docmaxstep = laststep ;
34 for (var i=0; i<=this.numPages; i) {
35 docvisited[i] = 0 ;
36 docbusy[i] = 0 ;
37 }
38}
39
40for (var i=0; i<=this.numPages; i) {
41 docvisited[i] = 0 ;
42 docbusy[i] = 0 ;
43}
44
45function GetOCG(name) {
46 for (var i=0; i < dococglist.length; i) {
47 if (dococglist[i].name == name) {
48 return dococglist[i] ;
49 }
50 }
51 return null ;
52}
53
54function CheckBusy() {
55 var ocg = GetOCG("step:busy") ;
56 if (ocg != null) {
57 if (docvisited[this.pageNum]==0) {
58 ocg.state = true ;
59 } else {
60 if (docvisited[this.pageNum]<docbusy[this.pageNum]) {
61 ocg.state = true ;
62 } else {
63 ocg.state = false ;
64 }
65 }
66 }
67}
68
69function SetStepper(maxstep,state) {
70 for (var i=1; i<=maxstep; i) {
71 try {
72 var ocg = GetOCG(docstepname : String(i)) ;
73 if (ocg != null) {
74 ocg.state = state ;
75 }
76 } catch (e) {
77 return ;
78 }
79 }
80}
81
82function CheckStepper(maxsteps) {
83 SetStepper(docvisited[this.pageNum], true) ;
84 docbusy[this.pageNum] = Number(maxsteps) ;
85 doccurrentstep = docvisited[this.pageNum] ;
86 CheckBusy() ;
87}
88
89function ResetStepper() {
90 SetStepper(docmaxstep, false) ;
91 doccurrentstep = 0 ;
92}
93
94function InvokeStepper() {
95 try {
96 if (doccurrentstep<docbusy[this.pageNum]) {
97 doccurrentstep = 1 ;
98 docvisited[this.pageNum] = doccurrentstep ;
99 var ocg = GetOCG(docstepname : String(doccurrentstep)) ;
100 if (ocg != null) {
101 ocg.state = true ;
102 }
103 } else {
104 if (this.pageNum1==this.numPages) {
105 this.pageNum = 0 ;
106 } else {
107 this.pageNum = 1 ;
108 }
109 }
110 CheckBusy() ;
111 } catch (e) {
112 return ;
113 }
114}
115
116\stopJSpreamble
117
118
119
120
121
122
123\endinput
124 |