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 +
87 "&UNICODEvsSYMBOL=" + top.UNICODEvsSYMBOL;
89 top.frames[0].document.links[0].search = search;
90 top.frames[0].document.links[1].search = search;
95 function refreshcicHeader(headerURL)
97 top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.cicuri;
101 function refreshtheoryHeader(headerURL)
103 top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.theoryuri;
107 function getCICMathMLKeys()
109 //Important note: do not modify this function without modifying makeURL
110 return escape("d_c,C1,G,C2,L");
113 function makeURL(type,uri,cicflags,typesflags)
116 var processorURL = top.processorURL;
117 var getterURL = top.getterURL;
118 var UNICODEvsSYMBOL = top.UNICODEvsSYMBOL;
119 var mode_list = mode.split(",");
124 var interfaceURL = top.topurl + "/html/cic/index.html";
125 var thinterfaceURL = top.topurl + "/html/theory/index.html";
127 var output = mode_list[0];
129 if (output == "raw") format = mode_list[1];
130 else format = mode_list[2];
132 if (output == "raw") {
134 if (format == "types") ext = ".types"
135 else if (format == "ann") ext = ".ann";
136 url = getterURL + "getxml?uri=" + uri + ext + "&format=" + mode_list[5] +
137 "&patch_dtd=" + mode_list[6];
139 if (format == "html" && type == "cic") {
140 //Important note: do not modify this function without modifying
142 keys = escape("d_c,C1,HC2,L")+"¶m.processorURL=" + escape(processorURL) +
143 "¶m.getterURL=" + escape(getterURL) +
144 "¶m.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) +
145 "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
146 "&prop.encoding=iso-8859-1" +
147 "&prop.media-type=text/html" +
148 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
149 "¶m.encoding=iso-8859-1" +
150 "¶m.media-type=text/html" +
151 "¶m.keys=" + escape("C1,HC2,L") +
152 "¶m.interfaceURL=" + escape(interfaceURL);
153 } else if (format == "html" && type == "theory") {
154 keys = escape("T1,T2,L,E")+
155 "¶m.processorURL=" + escape(processorURL) +
156 "¶m.getterURL=" + escape(getterURL) +
157 "¶m.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) +
158 "¶m.keys=" + escape("C1,HC2,L") +
159 "¶m.thkeys=" + escape("T1,T2,L,E") +
160 "¶m.embedkeys=" + escape("TC1,HC2,L") +
161 "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
162 "¶m.encoding=iso-8859-1" +
163 "¶m.thencoding=iso-8859-1" +
164 "¶m.media-type=text/html" +
165 "¶m.thmedia-type=text/html" +
166 "¶m.interfaceURL=" + escape(interfaceURL) +
167 "¶m.thinterfaceURL=" + escape(thinterfaceURL);
168 } else if (format == "mml_cont" && type == "cic") {
170 } else if (format == "mml_cont" && type == "theory") {
171 keys = escape("T1,L,E")+
173 "¶m.thkeys=T1,L,E" +
174 "¶m.embedkeys=TC1" +
176 "¶m.processorURL=" + escape(processorURL) +
177 "¶m.getterURL=" + escape(getterURL) +
178 "¶m.doctype-public=" +
180 "¶m.thencoding=iso-8859-1" +
181 "¶m.media-type=text/xml" +
182 "¶m.thmedia-type=text/html" +
183 "¶m.interfaceURL=" + escape(interfaceURL) +
184 "¶m.thinterfaceURL=" + escape(thinterfaceURL);
185 } else if (format == "mml_pres" && type == "cic") {
186 keys = escape("C1,G,C2,L")+
187 "¶m.processorURL=" + escape(processorURL) +
188 "¶m.getterURL=" + escape(getterURL) +
189 "&prop.doctype-public="+
191 "&prop.media-type=text/xml" +
192 "¶m.doctype-public=" +
194 "¶m.media-type=text/xml" +
195 "¶m.keys=" + escape("C1,G,C2,L") +
196 "¶m.interfaceURL=" + escape(interfaceURL);
197 } else if (format == "mml_pres" && type == "theory") {
198 keys = escape("T1,T2,L,E")+
199 "¶m.keys=C1,G,C2,L" +
200 "¶m.thkeys=T1,T2,L,E" +
201 "¶m.embedkeys=TC1,G,C2,L" +
202 "¶m.processorURL=" + escape(processorURL) +
203 "¶m.getterURL=" + escape(getterURL) +
204 "¶m.doctype-public=" +
206 "¶m.thencoding=iso-8859-1" +
207 "¶m.media-type=text/xml" +
208 "¶m.thmedia-type=text/html" +
209 "¶m.interfaceURL=" + escape(interfaceURL) +
210 "¶m.thinterfaceURL=" + escape(thinterfaceURL);
213 var naturalLanguage = typesflags;
214 if (typesflags != "NO" || type == "theory") {
215 naturalLanguage = mode_list[3];
217 var annotations = cicflags;
218 if (cicflags != "NO" || type == "theory") {
219 annotations = mode_list[4];
221 url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations;
226 else if (type == "cic")
227 return interfaceURL + "?url=" + escape(url);
228 else if (type == "theory")
229 return thinterfaceURL + "?url=" + escape(url)