comparison src/main/webapp/resources/js/general.js @ 0:3e62083dbcbf

First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 23 Apr 2015 15:46:01 +0200
parents
children eab47936591a
comparison
equal deleted inserted replaced
-1:000000000000 0:3e62083dbcbf
1 function branchInExtractionInterface(
2 branchId, fileId,
3 sectionId,
4 sectionName,
5 bookId,
6 bookName,
7 userId, extractionInterfaceUrl){
8
9 var form = document.createElement("form");
10 form.setAttribute("method", "post");
11 form.setAttribute("action", extractionInterfaceUrl + "/Extractapp/TaggingText"); // hand to controller
12 form.setAttribute("target", "_blank");
13
14
15 var hiddenField0 = document.createElement("input");
16 hiddenField0.setAttribute("name", "branchId");
17 hiddenField0.setAttribute("value", branchId);
18 form.appendChild(hiddenField0);
19
20 var hiddenField1 = document.createElement("input");
21 hiddenField1.setAttribute("name", "fileId");
22 hiddenField1.setAttribute("value", fileId);
23 form.appendChild(hiddenField1);
24
25 var hiddenField2 = document.createElement("input");
26 hiddenField2.setAttribute("name", "userId");
27 hiddenField2.setAttribute("value", userId);
28 form.appendChild(hiddenField2);
29
30 var hiddenField3 = document.createElement("input");
31 hiddenField3.setAttribute("name", "sectionId");
32 hiddenField3.setAttribute("value", sectionId);
33 form.appendChild(hiddenField3);
34
35
36 var hiddenField4 = document.createElement("input");
37 hiddenField4.setAttribute("name", "sectionName");
38 hiddenField4.setAttribute("value", sectionName);
39 form.appendChild(hiddenField4);
40
41 var hiddenField5 = document.createElement("input");
42 hiddenField5.setAttribute("name", "bookId");
43 hiddenField5.setAttribute("value", bookId);
44 form.appendChild(hiddenField5);
45
46 var hiddenField6 = document.createElement("input");
47 hiddenField6.setAttribute("name", "bookName");
48 hiddenField6.setAttribute("value", bookName);
49 form.appendChild(hiddenField6);
50
51 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
52 document.body.appendChild(form);
53 form.submit();
54 document.body.removeChild(form);
55 } else {
56 form.submit(); // works under IE and Chrome, but not FF
57 }
58 }
59
60 function sectionInExtractionInterface(sectionId, sectionName, bookId, bookName, userId, extractionInterfaceUrl){
61
62 var form = document.createElement("form");
63 form.setAttribute("method", "post");
64 form.setAttribute("action", extractionInterfaceUrl + "/Extractapp/TaggingText"); // hand to controller
65 form.setAttribute("target", "_blank");
66
67 var hiddenField2 = document.createElement("input");
68 hiddenField2.setAttribute("name", "userId");
69 hiddenField2.setAttribute("value", userId);
70 form.appendChild(hiddenField2);
71
72 var hiddenField3 = document.createElement("input");
73 hiddenField3.setAttribute("name", "sectionId");
74 hiddenField3.setAttribute("value", sectionId);
75 form.appendChild(hiddenField3);
76
77 var hiddenField4 = document.createElement("input");
78 hiddenField4.setAttribute("name", "sectionName");
79 hiddenField4.setAttribute("value", sectionName);
80 form.appendChild(hiddenField4);
81
82 var hiddenField5 = document.createElement("input");
83 hiddenField5.setAttribute("name", "bookId");
84 hiddenField5.setAttribute("value", bookId);
85 form.appendChild(hiddenField5);
86
87 var hiddenField6 = document.createElement("input");
88 hiddenField6.setAttribute("name", "bookName");
89 hiddenField6.setAttribute("value", bookName);
90 form.appendChild(hiddenField6);
91
92 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
93 document.body.appendChild(form);
94 form.submit();
95 document.body.removeChild(form);
96 } else {
97 form.submit(); // works under IE and Chrome, but not FF
98 }
99 }