1 function updateMode(i, s)
4 var mode_list = mode.split(",");
8 for (j = 0; j < mode_list.length; j++) {
10 else res += mode_list[j];
11 if (j < mode_list.length - 1) res += ",";
17 function updateOutput(output,format)
19 var theoryuri = top.theoryuri;
20 var cicuri = top.cicuri;
22 var topurl = top.topurl;
23 var processorURL = top.processorURL;
24 var getterURL = top.getterURL;
25 var mode_list = mode.split(",");
26 var new_mode = output.options[output.selectedIndex].value;
27 var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&topurl=" + topurl + "&processorURL=" + processorURL + "&getterURL=" + getterURL + "&mode=";
29 if (new_mode != mode_list[0]) {
30 updateMode(0, new_mode);
31 if (new_mode == "raw") updateMode(2, format.options[format.selectedIndex].value);
32 else updateMode(1, format.options[format.selectedIndex].value);
33 location.search = dest + top.mode;
37 function updateFormat(format)
40 var mode_list = mode.split(",");
42 if (mode_list[0] == "raw") {
43 updateMode(1, format.options[format.selectedIndex].value);
45 updateMode(2, format.options[format.selectedIndex].value);
51 function updateNatural(checkbox)
53 if (checkbox.checked) updateMode(3, "yes");
54 else updateMode(3, "no");
58 function updateAnnotations(checkbox)
60 if (checkbox.checked) updateMode(4, "yes");
61 else updateMode(4, "no");
65 function updateCompressed(checkbox)
67 if (checkbox.checked) updateMode(5, "gz");
68 else updateMode(5, "normal");
72 function updateDTDPatched(checkbox)
74 if (checkbox.checked) updateMode(6, "yes");
75 else updateMode(6, "no");
79 function refreshReload()
83 "&cicuri=" + top.cicuri +
84 "&theoryuri=" + top.theoryuri +
85 "&processorURL=" + top.processorURL +
86 "&getterURL=" + top.getterURL;
88 top.frames[0].document.links[0].search = search;
89 top.frames[0].document.links[1].search = search;
94 function refreshcicHeader(headerURL)
96 top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.cicuri;
100 function refreshtheoryHeader(headerURL)
102 top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.theoryuri;
106 function makeURL(type,uri,cicflags,typesflags)
109 var processorURL = top.processorURL;
110 var getterURL = top.getterURL;
111 var mode_list = mode.split(",");
116 var interfaceURL = chopSlash(chopSlash(top.topurl)) + "/cic/index.html";
118 var output = mode_list[0];
120 if (output == "raw") format = mode_list[1];
121 else format = mode_list[2];
123 if (output == "raw") {
125 if (format == "types") ext = ".types"
126 else if (format == "ann") ext = ".ann";
127 url = getterURL + "getxml?uri=" + uri + ext + "&format=" + mode_list[5] +
128 "&patch_dtd=" + mode_list[6];
130 if (format == "html" && type == "cic") {
131 keys = escape("C1,HC2,L")+"¶m.processorURL=" + escape(processorURL) +
132 "¶m.getterURL=" + escape(getterURL) +
133 "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
134 "&prop.encoding=iso-8859-1" +
135 "&prop.media-type=text/html" +
136 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
137 "¶m.encoding=iso-8859-1" +
138 "¶m.media-type=text/html" +
139 "¶m.keys=" + escape("C1,HC2,L") +
140 "¶m.interfaceURL=" + escape(interfaceURL);
141 } else if (format == "html" && type == "theory") {
142 keys = escape("T1,T2,L,E")+"¶m.processorURL=" + escape(processorURL) +
143 "¶m.getterURL=" + escape(getterURL) +
144 "¶m.thkeys=" + escape("TC1,HC2,L") +
145 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
146 "¶m.encoding=iso-8859-1" +
147 "¶m.media-type=text/html" +
148 "¶m.keys=" + escape("C1,HC2,L") +
149 "¶m.interfaceURL=" + escape(interfaceURL);
150 } else if (format == "mml_cont" && type == "cic") {
152 } else if (format == "mml_cont" && type == "theory") {
153 keys = escape("T1,E")+"¶m.keys=C1¶m.thkeys=TC1";
154 } else if (format == "mml_pres" && type == "cic") {
155 keys = escape("C1,C2,L")+"¶m.processorURL=" + escape(processorURL) +
156 "¶m.getterURL=" + escape(getterURL) +
157 "&prop.doctype-public="+
159 "&prop.media-type=text/xml" +
160 "¶m.doctype-public=" +
162 "¶m.media-type=text/xml" +
163 "¶m.keys=" + escape("C1,C2,L") +
164 "¶m.interfaceURL=" + escape(interfaceURL);
165 } else if (format == "mml_pres" && type == "theory") {
166 keys = escape("T1,T2,L,E")+"¶m.keys=C1,C2,L¶m.thkeys=TC1,C2,L" +
167 "¶m.processorURL=" + escape(processorURL) +
168 "¶m.getterURL=" + escape(getterURL) +
169 "¶m.doctype-public=" +
171 "¶m.media-type=text/xml" +
172 "¶m.interfaceURL=" + escape(interfaceURL);
175 var naturalLanguage = typesflags;
176 if (typesflags != "NO" || type == "theory") {
177 naturalLanguage = mode_list[3];
179 var annotations = cicflags;
180 if (cicflags != "NO" || type == "theory") {
181 annotations = mode_list[4];
183 url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations;
186 return interfaceURL + "?url=" + escape(url);