comparison src/main/webapp/pages/topicList.jsp @ 55:95bf4ac726e6

Topic synchronization with extraction-interface. new tables in LGService database
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 16 Feb 2016 15:09:40 +0100
parents a00efd5d9e77
children 4c8fed0d71cc
comparison
equal deleted inserted replaced
54:a00efd5d9e77 55:95bf4ac726e6
9 <head> 9 <head>
10 <jsp:include page="../componentes/headContent.jsp"/> 10 <jsp:include page="../componentes/headContent.jsp"/>
11 <script> 11 <script>
12 $(function() { 12 $(function() {
13 var dialogCreateTopic = $("#dialogCreateTopic").dialog( 13 var dialogCreateTopic = $("#dialogCreateTopic").dialog(
14 {autoOpen: false} 14 {
15 autoOpen: false,
16 width: "400px",
17 }
15 ); 18 );
19
16 $("#createTopic").button().on( "click", function() { 20 $("#createTopic").button().on( "click", function() {
17 dialogCreateTopic.dialog( "open" ); 21 dialogCreateTopic.dialog( "open" );
18 }); 22 });
19 23
24 $("#nameEn").on( "keydown", function( event ) {
25
26 var englishAlphabetAndWhiteSpace =/[A-Za-z 0-9]/g;
27
28 var key = String.fromCharCode(event.which);
29
30 // --- key code: ---
31 // space: 32, delete: 8, enter: 13, tab: 9
32 // [a-z]: 65-91
33 // [0-9]: 48-57
34 // esc: 27
35 // shift, ctr, alt: 16, 17, 18, 20
36 // cmd: 91
37
38
39 if (event.keyCode == 8 || event.keyCode == 9 || (event.keyCode >= 16 && event.keyCode <= 20) || event.keyCode == 27 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 91 || englishAlphabetAndWhiteSpace.test(key)) {
40 return true;
41 }
42
43 alert("Please type in English characters.");
44
45 // TODO: maybe delete those chars that are not Latin char, instead of delete them all
46 $("#nameEn").val("");
47
48 return false;
49 });
50
20 51
21 }); 52 });
53
22 54
23 </script> 55 </script>
24 </head> 56 </head>
25 57
26 <body> 58 <body>