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,processorURL,interfaceURL)
19 var theoryuri = top.theoryuri;
20 var cicuri = top.cicuri;
22 var mode_list = mode.split(",");
23 var new_mode = output.options[output.selectedIndex].value;
24 var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&mode=";
26 if (new_mode != mode_list[0]) {
27 updateMode(0, new_mode);
28 if (new_mode == "raw") updateMode(2, format.options[format.selectedIndex].value);
29 else updateMode(1, format.options[format.selectedIndex].value);
32 processorURL + 'apply' +
34 '¶m.topurl=' + topurl +
36 escape(interfaceURL + '/html/library/control.html' + dest + top.mode);
42 function updateFormat(format,profile,processorURL,interfaceURL)
45 var mode_list = mode.split(",");
47 if (mode_list[0] == "raw") {
48 updateMode(1, format.options[format.selectedIndex].value);
50 updateMode(2, format.options[format.selectedIndex].value);
53 refreshReload(profile,processorURL,interfaceURL);
56 function updateNatural(checkbox,profile,processorURL,interfaceURL)
58 if (checkbox.checked) updateMode(3, "yes");
59 else updateMode(3, "no");
60 refreshReload(profile,processorURL,interfaceURL);
63 function updateAnnotations(checkbox,profile,processorURL,interfaceURL)
65 if (checkbox.checked) updateMode(4, "yes");
66 else updateMode(4, "no");
67 refreshReload(profile,processorURL,interfaceURL);
70 function updateCompressed(checkbox,profile,processorURL,interfaceURL)
72 if (checkbox.checked) updateMode(5, "gz");
73 else updateMode(5, "normal");
74 refreshReload(profile,processorURL,interfaceURL);
77 function updateDTDPatched(checkbox,profile,processorURL,interfaceURL)
79 if (checkbox.checked) updateMode(6, "yes");
80 else updateMode(6, "no");
81 refreshReload(profile,processorURL,interfaceURL);
84 function refreshReload(profile, processorURL, interfaceURL)
88 "&cicuri=" + top.cicuri +
89 "&theoryuri=" + top.theoryuri;
91 var href = processorURL +
94 '&profile=' + profile +
95 '¶m.profile=' + profile +
97 escape(interfaceURL + '/html/library/index.html' + search);
99 top.frames[0].document.links[0].href = href;
100 top.frames[0].document.links[1].href =
101 interfaceURL + '/html/index.html' + search;
106 function refreshcicHeader(headerURL)
108 top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.cicuri;
112 function refreshtheoryHeader(headerURL)
114 top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.theoryuri;
118 function getCICMathMLKeys()
120 return escape("d_c,C1,G,C2,L");
123 function getTheoryKeys()
125 return escape("T1,T2,L,E");
128 function getEmbedKeys()
130 return escape("d_c,TC1,HC2,L");
133 function getCICHTMLKeys()
135 return escape("d_c,C1,HC2,L");
138 function getCICProofTreeXHTMLMathMLKeys()
140 return escape("HAT,G,HAO,L");
143 function makeURL(type,uri,cicflags,typesflags,profile,processorURL,interfaceURL,getterURL)
146 var mode_list = mode.split(",");
151 var interfaceURLidx = interfaceURL + "/html/cic/index.html";
152 var thinterfaceURLidx = interfaceURL + "/html/theory/index.html";
154 var output = mode_list[0];
156 if (output == "raw") format = mode_list[1];
157 else format = mode_list[2];
159 if (output == "raw") {
162 if (format == "types") ext = ".types"
163 else if (format == "ann") ext = ".ann"
164 else if (format == "fwd") rdfprefix = "helm:rdf:www.cs.unibo.it/helm/rdf/forward//"
165 else if (format == "bwd") rdfprefix = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//";
166 url = getterURL + "getxml?uri=" + rdfprefix + uri + ext + "&format=" +
167 mode_list[5] + "&patch_dtd=" + mode_list[6];
169 var uri_len = uri.length;
170 if (format == "html" && type == "cic" && uri.substring(uri.length - 10, uri.length) == "proof_tree") {
171 keys = getCICProofTreeXHTMLMathMLKeys() +
172 "&profile=" + profile +
173 "&default.profile=" + profile +
174 "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN")+
175 "&prop.doctype-system="+escape("http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd")+
176 "&prop.encoding=iso-8859-1" +
177 "&prop.media-type=text/xml" +
179 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
180 "¶m.encoding=iso-8859-1" +
181 "¶m.media-type=text/html" +
182 "¶m.keys=" + getCICHTMLKeys() +
183 "¶m.framewidth=150";
184 } else if (format == "html" && type == "cic") {
185 keys = getCICHTMLKeys() +
186 "&profile=" + profile +
187 "¶m.profile=" + profile +
188 "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
189 "&prop.encoding=iso-8859-1" +
190 "&prop.media-type=text/html" +
191 "&prop.method=html" +
192 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
193 "¶m.encoding=iso-8859-1" +
194 "¶m.media-type=text/html" +
195 "¶m.keys=" + getCICHTMLKeys();
196 } else if (format == "html" && type == "theory") {
197 keys = getTheoryKeys()+
198 "&profile=" + profile +
199 "¶m.profile=" + profile +
200 "¶m.keys=" + getCICHTMLKeys() +
201 "¶m.thkeys=" + getTheoryKeys() +
202 "¶m.embedkeys=" + getEmbedKeys() +
203 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
204 "¶m.encoding=iso-8859-1" +
205 "¶m.thencoding=iso-8859-1" +
206 "¶m.media-type=text/html" +
207 "¶m.thmedia-type=text/html";
208 } else if (format == "mml_cont" && type == "cic") {
209 keys = escape("d_c,C1")+
210 "&profile=" + profile +
211 "¶m.profile=" + profile +
212 "&prop.doctype-public="+
213 "&prop.media-type=text/xml" +
214 "¶m.doctype-public=" +
216 "¶m.media-type=text/xml";
217 } else if (format == "mml_cont" && type == "theory") {
218 keys = escape("T1,L,E")+
219 "&profile=" + profile +
220 "¶m.profile=" + profile +
221 "¶m.keys=" + escape("d_c,C1") +
222 "¶m.thkeys=T1,L,E" +
223 "¶m.embedkeys=" + escape("d_c,TC1") +
224 "¶m.doctype-public=" +
226 "¶m.thencoding=iso-8859-1" +
227 "¶m.media-type=text/xml" +
228 "¶m.thmedia-type=text/html";
229 } else if (format == "mml_pres" && type == "cic") {
230 keys = getCICMathMLKeys()+
231 "&profile=" + profile +
232 "¶m.profile=" + profile +
233 "&prop.doctype-public="+
234 "&prop.media-type=text/xml" +
235 "¶m.doctype-public=" +
237 "¶m.media-type=text/xml" +
238 "¶m.keys=" + getCICMathMLKeys();
239 } else if (format == "mml_pres" && type == "theory") {
240 keys = getTheoryKeys()+
241 "&profile=" + profile +
242 "¶m.profile=" + profile +
243 "¶m.keys=" + getCICMathMLKeys() +
244 "¶m.thkeys=" + getTheoryKeys() +
245 "¶m.embedkeys=" + escape("d_c,TC1,G,C2,L") +
246 "¶m.doctype-public=" +
248 "¶m.thencoding=iso-8859-1" +
249 "¶m.media-type=text/xml" +
250 "¶m.thmedia-type=text/html";
256 else if (type == "cic")
257 return processorURL + "apply?keys=RT&xmluri=" + escape(interfaceURLidx) + "¶m.ignore=" + keys + "¶m.CICURI=" + uri;
258 else if (type == "theory")
259 return processorURL + "apply?keys=RT&xmluri=" + escape(thinterfaceURLidx) + "¶m.ignore=" + keys + "¶m.CICURI=" + uri;