annotate src/main/webapp/resources/js/general.js @ 105:16a0796e3871 default tip

remove "console.log" from general.js
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Fri, 29 Sep 2017 16:18:02 +0200
parents b27a99201cbe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
77
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
1 function getChromeVersion(){
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
2
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
3 var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
4
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
5 return raw ? parseInt(raw[2], 10) : false;
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
6 }
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
7
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
8 function branchInExtractionInterface(
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
9 branchId, fileId,
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
10 sectionId,
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
11 sectionName,
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
12 bookId,
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
13 bookName,
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
14 userId, extractionInterfaceUrl){
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
15
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
16 // the input parameters contain fileId, since a branch means a text/many version of the text, of a section
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
17
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
18 var form = document.createElement("form");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
19 form.setAttribute("method", "post");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
20 form.setAttribute("action", extractionInterfaceUrl + "/Extractapp/TaggingText"); // hand to controller
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
21 form.setAttribute("target", "_blank");
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
22
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
23
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
24 var hiddenField0 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
25 hiddenField0.setAttribute("name", "branchId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
26 hiddenField0.setAttribute("value", branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
27 form.appendChild(hiddenField0);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
28
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
29 var hiddenField1 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
30 hiddenField1.setAttribute("name", "fileId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
31 hiddenField1.setAttribute("value", fileId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
32 form.appendChild(hiddenField1);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
33
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
34 var hiddenField2 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
35 hiddenField2.setAttribute("name", "userId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
36 hiddenField2.setAttribute("value", userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
37 form.appendChild(hiddenField2);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
38
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
39 var hiddenField3 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
40 hiddenField3.setAttribute("name", "sectionId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
41 hiddenField3.setAttribute("value", sectionId);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
42 form.appendChild(hiddenField3);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
43
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
44
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
45 var hiddenField4 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
46 hiddenField4.setAttribute("name", "sectionName");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
47 hiddenField4.setAttribute("value", sectionName);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
48 form.appendChild(hiddenField4);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
49
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
50 var hiddenField5 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
51 hiddenField5.setAttribute("name", "bookId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
52 hiddenField5.setAttribute("value", bookId);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
53 form.appendChild(hiddenField5);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
54
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
55 var hiddenField6 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
56 hiddenField6.setAttribute("name", "bookName");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
57 hiddenField6.setAttribute("value", bookName);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
58 form.appendChild(hiddenField6);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
59
77
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
60 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || getChromeVersion() > 55) {
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
61 document.body.appendChild(form);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
62 form.submit();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
63 document.body.removeChild(form);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
64 } else {
73
d0a5541d9d7e fix form submit issue in Chrome 56.x
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 55
diff changeset
65
76
6ad066ddf3fe fix form submit issue in Chrome 56.x, again
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 73
diff changeset
66 form.submit(); // works under IE, neither FF nor Chrome
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
67 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
68 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
69
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
70 function sectionInExtractionInterface(sectionId, sectionName, bookId, bookName, topicId, userId, extractionInterfaceUrl){
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
71
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
72 // the input parameters contain no fileId, since it's from searching result and haven't assigned topic Or saved
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
73
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
74 var form = document.createElement("form");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
75 form.setAttribute("method", "post");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
76 form.setAttribute("action", extractionInterfaceUrl + "/Extractapp/TaggingText"); // hand to controller
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
77 form.setAttribute("target", "_blank");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
78
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
79 var hiddenField2 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
80 hiddenField2.setAttribute("name", "userId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
81 hiddenField2.setAttribute("value", userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
82 form.appendChild(hiddenField2);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
83
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
84 var hiddenField3 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
85 hiddenField3.setAttribute("name", "sectionId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
86 hiddenField3.setAttribute("value", sectionId);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
87 form.appendChild(hiddenField3);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
88
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
89 var hiddenField4 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
90 hiddenField4.setAttribute("name", "sectionName");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
91 hiddenField4.setAttribute("value", sectionName);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
92 form.appendChild(hiddenField4);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
93
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
94 var hiddenField5 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
95 hiddenField5.setAttribute("name", "bookId");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
96 hiddenField5.setAttribute("value", bookId);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
97 form.appendChild(hiddenField5);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
98
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
99 var hiddenField6 = document.createElement("input");
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
100 hiddenField6.setAttribute("name", "bookName");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
101 hiddenField6.setAttribute("value", bookName);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
102 form.appendChild(hiddenField6);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
103
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
104 var hiddenField7 = document.createElement("input");
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
105 hiddenField7.setAttribute("name", "topic");
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
106 hiddenField7.setAttribute("value", topicId);
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
107 form.appendChild(hiddenField7);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
108
77
997601ee0c6e fix form submit issue above Chrome 56.x edition
Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
parents: 76
diff changeset
109 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || getChromeVersion() > 55) {
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
110 document.body.appendChild(form);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
111 form.submit();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
112 document.body.removeChild(form);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
113 } else {
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
114 form.submit(); // works under IE, neither FF nor Chrome
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
115 }
36
eab47936591a apply scrollbar to other tables as well
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 0
diff changeset
116 }
eab47936591a apply scrollbar to other tables as well
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 0
diff changeset
117
95
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
118 function onLoginClick(){
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
119
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
120 var loginId = $("#loginForm input[name=userName]").val(),
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
121 password = $("#loginForm input[name=password]").val();
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
122
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
123 if(loginId.trim() == '' || password.trim() == ""){
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
124 return;
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
125 }
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
126 $.ajax({
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
127 method: "POST",
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
128 url: "https://localgazetteers-test.mpiwg-berlin.mpg.de/lg-api/auth/login",
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
129 data: JSON.stringify({loginId: loginId, password: password}),
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
130 contentType: "application/json; charset=utf-8",
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
131 dataType: "json",
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
132 cache: false,
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
133 headers:{'Cache-Control': 'no-cache'}
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
134 })
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
135 .done(function( data ) {
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
136 window.localStorage.setItem("LG-Token", data.token);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
137 setAction('login', 'loginForm');
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
138 document.forms['loginForm'].submit();
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
139 })
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
140 .fail(function(obj) {
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
141 alert(obj.responseJSON.message);
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
142 });
b27a99201cbe New feature: new full text search with MySQL ngram parser (5.7.6 above)
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 77
diff changeset
143 }
36
eab47936591a apply scrollbar to other tables as well
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 0
diff changeset
144
eab47936591a apply scrollbar to other tables as well
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 0
diff changeset
145 $(document).ready(function() {
eab47936591a apply scrollbar to other tables as well
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 0
diff changeset
146 $('.double-scroll').doubleScroll();
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 36
diff changeset
147
73
d0a5541d9d7e fix form submit issue in Chrome 56.x
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents: 55
diff changeset
148 });