annotate develop/views/Extractapp/taggingtext.php @ 28:e6e9bdc4f256

update the saving response from LGService between different file version
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 03 Mar 2015 18:13:20 +0100
parents 4a29bccb6c59
children fc7342914cdf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
2 // --- initialize config file and input text ---
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 $stringInput = $viewmodel['stringInput'];
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 $wordlistArray = $viewmodel['wordlistArray'];
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 $taglistArray = $viewmodel['taglistArray'];
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 $section_id = $viewmodel['section_id'];
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
7 $topiclistArray = $viewmodel['topiclistArray'];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
8 $default_topic_id = $viewmodel['default_topic_id'];
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
9 $topic_name = $viewmodel['topic_name'];
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
10 $topic_tag = $viewmodel['topic_tag'];
26
579f03f8bee5 merge table books_info into table books (execute Home/Test)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
11 $info = $viewmodel['info'];
579f03f8bee5 merge table books_info into table books (execute Home/Test)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
12 $messages = $viewmodel['messages'];
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
13
9
584b1623e9ef TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 8
diff changeset
14
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
16
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 <html>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 <head>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 <title></title>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
20
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 <style>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 dynasty
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 color:red;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 nianhao
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 color:blue;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
30 name
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
31 {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
32 color:orange;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
33 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
34 #editable-area {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
35 line-height:160%;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
36 letter-spacing:1.5px;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
37 font-size:21px;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
38 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
39
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
40
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
41 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
42 // color on the tags
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
43 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
44 echo $taglistValue[2]."\n{\ncolor:".$taglistValue[3]."\n}\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
45
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
46 echo ".span_".$taglistValue[2]."\n{\nbackground-color:".$taglistValue[3]."\n}\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
47 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
48
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
49 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
50 </style>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
51
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
52
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
53 </head>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
54
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
55 <body>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
56
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
57 <script type="text/javascript">
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
58
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
59 // === This is only for developing on local machine ====
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
60 var _GET = JSON.parse('<?php echo json_encode($_GET) ?>');
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
61 if (_GET['id']) {
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
62
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
63 var info = JSON.parse('<?php echo json_encode($info) ?>');
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
64 var redirectUrl = "http://localhost:1080/localmonographs/develop/Extractapp/TaggingText";
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
65 var section_id = info['section_id'];
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
66
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
67 var form = $('<form action="' + redirectUrl + '" method="post">' +
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
68 '<input type="hidden" name="sectionId" value="'+section_id+'" />' +
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
69 '</form>');
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
70 $('body').append(form);
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
71 $(form).submit();
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
72 }
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
73 // ====
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
74
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
75
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
76 handleFileVersionConflict();
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
77 // Popup to proceeding the saving situations
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
78 function handleFileVersionConflict() {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
79 var info = JSON.parse('<?php echo json_encode($info) ?>');
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
80 console.log(info['current_fileId']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
81
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
82 if (info['current_fileId'] != 0){
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
83 // -- there might be conflicts between different version
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
84 var retVal = confirm('There were something happened/someone editing in the between of time.\nDo you want to force saving? (There might be conflicts between two versions.)');
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
85 if( retVal == true ){
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
86 // TODO: force saving with currentFileId
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
87 alert("You do the force saving!");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
88 //saveTextToLGService();
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
89
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
90 }else{
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
91 var loadLastest = confirm("Do you want to reload for the lastest version? (Your current editing will lost.)");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
92 if (loadLastest == true) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
93 // TODO: reload page with the currentFileId
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
94 alert("You will reload the latest version.");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
95
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
96 var form = document.createElement("form");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
97 form.setAttribute("method", "post");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
98 form.setAttribute("action", "./TaggingText"); // hand to controller
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
99 form.setAttribute("target", "_blank");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
100
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
101 var topic_id = JSON.parse('<?php echo json_encode($default_topic_id) ?>');
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
102
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
103 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
104 hiddenField.setAttribute("name", "topic");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
105 hiddenField.setAttribute("value", topic_id);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
106 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
107
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
108 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
109 hiddenField.setAttribute("name", "func");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
110 hiddenField.setAttribute("value", "Reload"); // reload
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
111 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
112
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
113
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
114
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
115 _postForContineTagging(form);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
116
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
117 // use the current_fileId to reload the latest version of text
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
118 console.log('reloaded');
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
119
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
120
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
121 } else {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
122 alert("Just a reminder, there is a new version for this branch.");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
123 }
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
124 }
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
125 }
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
126 return;
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
127
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
128 }
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
129
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
130 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
131 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
132 echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
133 echo "\t".'if ( $(this).prop("tagName").toLowerCase() != "'.$taglistValue[2].'" ) return 0;'."\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
134 echo "\t".'if ( $("#editTextId").html() != "Edit the text" ) return 0;'."\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
135 echo "\tremoveTagNewDiv( e, \"".$taglistValue[2]."\", $(this) );\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
136 echo "});\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
137 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
138 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
139
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
140 $(document).ready(function(){
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
141
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
142 // --- for sidebar---
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
143 //run once
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
144 var el=$('#follow-scroll');
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
145 var originalelpos=el.offset().top; // take it where it originally is on the page
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
146
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
147
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
148 //run on scroll
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
149 $(window).scroll(function(){
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
150 var el = $('#follow-scroll'); // important! (local)
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
151 var elpos = el.offset().top; // take current situation
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
152 var windowpos = $(window).scrollTop();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
153 var finaldestination = windowpos+originalelpos;
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
154 //el.stop().animate({'top':finaldestination},500);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
155 el.stop().animate({'top':finaldestination},0);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
156 });
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
157
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
158 //--- for popups ---
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
159 //run once
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
160 var el=$('#popups');
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
161 var originalelpos=el.offset().top; // take it where it originally is on the page
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
162
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
163 //run on scroll
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
164 $(window).scroll(function(){
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
165 var el = $('#popups'); // important! (local)
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
166 var elpos = el.offset().top; // take current situation
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
167 var windowpos = $(window).scrollTop();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
168 var finaldestination = windowpos+originalelpos;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
169 //el.stop().animate({'top':finaldestination},500);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
170 el.stop().animate({'top':finaldestination},0);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
171 });
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
172
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
173
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
174
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
175
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
176
26
579f03f8bee5 merge table books_info into table books (execute Home/Test)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
177 /*
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
178
20
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
179 // Popup choosing topic if first time to this section. without branchId
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
180 if (info['file_id'] == 0) { // or info['branchId'] == 0, means new file
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
181 // ask to choose topic
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
182 $.ajax({
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
183
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
184 });
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
185 var popup = document.getElementById('popup-window');
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
186
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
187 // alert('choose topic!');
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
188 }
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
189 */
20
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
190
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
191 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
192 $(document).on("click", "name", function (e) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
193
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
194 if ( $("#editTextId").html() != "Edit the text" ) return 0;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
195 if ( $(this).prop("tagName").toLowerCase() != "name" ) return 0;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
196
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
197 removeTagNewDiv( e, "name", $(this) );
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
198 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
199
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
200 $(document).on("mouseup", '#editable-area', function (e) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
201 $('.questionMarkClass').remove();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
202 $('.tagItemDivClass').remove();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
203
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
204 if ( $("#editTextId").html() != "Edit the text" ) return 0;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
205 var selection = getSelected();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
206 range = getSelected().getRangeAt(0);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
207
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
208 container = document.createElement("div");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
209 container.appendChild(selection.getRangeAt(0).cloneContents());
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
210
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
211 if(selection && (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
212
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
213 var newdiv = document.createElement("div");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
214 newdiv.id = "tagItemDivId";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
215 newdiv.setAttribute("class", "tagItemDivClass");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
216 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px';
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
217
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
218 newdiv.style.backgroundColor = "white";
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
219 newdiv.style.zIndex = 2;
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
220
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
221 //console.log(selection.getRangeAt(0).cloneContents());
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
222 if ( container.innerHTML.indexOf( "br" ) != -1 ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
223 var newselect = document.createElement("select");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
224 newselect.id = "TitletagType";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
225 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
226 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
227 echo "newselect.innerHTML += \"<option value='".$taglistValue[2]."'>".$taglistValue[1]."</option>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
228 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
229 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
230 newdiv.appendChild(newselect);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
231
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
232 //matchValue = .match();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
233 myRegexp = new RegExp("〈(.*?)〉", "g")
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
234 matchValue = myRegexp.exec(String(selection));
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
235
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
236 if ( matchValue != null ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
237 newdiv.innerHTML += "<input id=\"TitletagName\" value=\""+ matchValue[1] +"\"></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
238 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
239 newdiv.innerHTML += "<input id=\"TitletagName\" value=\"\"></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
240 }
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
241
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
242 console.log(" container innerHTML: "+ container.innerHTML );
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
243
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
244 newdiv.innerHTML += "<button onclick=\"addTagTitle( range, container )\">Add Title Tag To Each Line</button></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
245
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
246 /*
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
247 newdiv.innerHTML += "<button onclick=\"exportTable( range, container )\">Export As A Table</button></br></br>";
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
248 */
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
249
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
250 var newselect = document.createElement("select");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
251 newselect.id = "RemoveTitletagType";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
252 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
253 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
254 echo "newselect.innerHTML += \"<option value='".$taglistValue[2]."'>".$taglistValue[1]."</option>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
255 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
256 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
257 newdiv.appendChild(newselect);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
258
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
259 newdiv.innerHTML += "<input id=\"RemoveTitletagName\" value=\"\"></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
260 newdiv.innerHTML += "<button onclick=\"removeTagTitle( range, container )\">Remove</button></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
261 } else {
9
584b1623e9ef TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 8
diff changeset
262 // for pop up window on edit-area for tag list
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
263 newdiv.innerHTML = "Tag: "+String(selection)+"<br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
264
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
265 <?php
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
266 foreach ( $taglistArray as $taglistValue ) {
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
267
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
268 if ($taglistValue[2] == $topic_tag) {
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
269 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">[TopicTag]Tag as:".$taglistValue[1]."(necessary for this topic!)</button>\";\n";
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
270 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
271 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
272
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
273 /*
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
274 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
275 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
276 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
277 */
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
278 break;
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
279 }
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
280 }
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
281 ?>
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
282
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
283 newdiv.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection)+"' )\">Tag As Title</button></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
284
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
285 <?php
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
286
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
287 foreach ( $taglistArray as $taglistValue ) {
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
288 /*
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
289 if ( $taglistValue[2] == "person") {
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
290 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
291 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
292 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
293 } else */
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
294 if ($taglistValue[2] == $topic_tag) {
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
295 // pass
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
296 } else if ($taglistValue[2] == "post_time") {
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
297 echo "newdiv.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
298 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
299 } else if ($taglistValue[2] == "office") {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
300 echo "newdiv.innerHTML += \"<button accesskey=\\\"4\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
301 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
302 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
303 echo "newdiv.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
304 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
305 }
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
306
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
307 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
308 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
309 }
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
310
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
311 //$('#tagItemDivId').addClass(); // tagItemDivId is newdiv's id
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
312 $('body').append(newdiv);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
313
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
314 $('#TitletagType').val(lastAddTag);
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
315
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
316 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
317 //e.stopPropagation();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
318 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
319
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
320
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
321 // === for exporttable.php ===
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
322 function exportTable( range, container ) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
323 //MsgBox("enter function");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
324 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
325 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
326 form.setAttribute("action", "./ExportTable");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
327 form.setAttribute("target", "_blank");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
328
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
329 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
330 hiddenField.setAttribute("name", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
331 hiddenField.setAttribute("value", container.innerHTML);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
332 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
333
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
334 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
335 hiddenField.setAttribute("name", "sectionid");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
336 hiddenField.setAttribute("value", "<?php echo $section_id; ?>");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
337 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
338
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
339 var hiddenField2 = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
340 hiddenField2.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
341 hiddenField2.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
342 form.appendChild(hiddenField2);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
343
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
344 var info = JSON.parse( '<?php echo json_encode($info) ?>');
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
345
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
346 if (info) {
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
347 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
348 hiddenField.setAttribute("name", "bookId");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
349 hiddenField.setAttribute("value", info['book_id']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
350 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
351
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
352 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
353 hiddenField.setAttribute("name", "bookName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
354 hiddenField.setAttribute("value", info['book_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
355 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
356
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
357 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
358 hiddenField.setAttribute("name", "sectionName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
359 hiddenField.setAttribute("value", info['section_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
360 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
361
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
362 };
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
363
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
364 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
365 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
366 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
367 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
368 form.submit(); // works under IE and Chrome, but not FF
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
369 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
370 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
371
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
372 function exportPage(topic_id) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
373 var startPage = $('#exportPageStart').val();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
374 var endPage = $('#exportPageEnd').val();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
375
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
376 var el = document.getElementById("editable-area");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
377 var str="" + el.innerHTML;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
378
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
379 var regexText="【<a([^<>]*?)>"+startPage+"</a>】(.*?)【<a([^<>]*?)>"+endPage+"</a>】";
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
380
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
381 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
382 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
383 form.setAttribute("action", "./ExportTable");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
384 form.setAttribute("target", "_blank");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
385
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
386 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
387 hiddenField.setAttribute("name", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
388 hiddenField.setAttribute("value", str.match(new RegExp(regexText, "g")));
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
389 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
390
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
391 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
392 hiddenField.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
393 hiddenField.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
394 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
395
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
396 _postForContineTagging(form);
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
397
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
398
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
399 /*
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
400 var section_id = JSON.parse('<?php echo json_encode($section_id) ?>');
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
401 console.log("section_id: "+section_id+", topic_id: "+topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
402
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
403 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
404 hiddenField.setAttribute("name", "sectionId");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
405 hiddenField.setAttribute("value", section_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
406 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
407
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
408 var info = JSON.parse( '<?php echo json_encode($info) ?>');
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
409
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
410 if (info) {
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
411 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
412 hiddenField.setAttribute("name", "bookId");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
413 hiddenField.setAttribute("value", info['book_id']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
414 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
415
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
416 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
417 hiddenField.setAttribute("name", "bookName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
418 hiddenField.setAttribute("value", info['book_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
419 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
420
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
421 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
422 hiddenField.setAttribute("name", "sectionName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
423 hiddenField.setAttribute("value", info['section_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
424 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
425
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
426 };
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
427
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
428
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
429 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
430 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
431 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
432 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
433 form.submit(); // works under IE and Chrome, but not FF
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
434 }
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
435 */
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
436 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
437
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
438
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
439
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
440
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
441 function exportAll(topic_id) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
442 var el = document.getElementById("editable-area");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
443 var str= "" + el.innerHTML;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
444 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
445 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
446 form.setAttribute("action", "./ExportTable");//+section_id); // hand to controller
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
447 form.setAttribute("target", "_blank");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
448
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
449 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
450 hiddenField.setAttribute("name", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
451 hiddenField.setAttribute("value", str);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
452 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
453
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
454 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
455 hiddenField.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
456 hiddenField.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
457 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
458
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
459 _postForContineTagging(form);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
460 /*
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
461 var section_id = JSON.parse('<?php echo json_encode($section_id) ?>');
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
462 console.log("section_id: "+section_id+", topic_id: "+topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
463
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
464 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
465 hiddenField.setAttribute("name", "sectionId");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
466 hiddenField.setAttribute("value", section_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
467 form.appendChild(hiddenField);
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
468
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
469 var info = JSON.parse( '<?php echo json_encode($info) ?>');
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
470
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
471 if (info) {
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
472 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
473 hiddenField.setAttribute("name", "bookId");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
474 hiddenField.setAttribute("value", info['book_id']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
475 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
476
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
477 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
478 hiddenField.setAttribute("name", "bookName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
479 hiddenField.setAttribute("value", info['book_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
480 form.appendChild(hiddenField);
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
481
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
482 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
483 hiddenField.setAttribute("name", "sectionName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
484 hiddenField.setAttribute("value", info['section_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
485 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
486
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
487 };
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
488
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
489
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
490 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
491 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
492 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
493 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
494 form.submit(); // works under IE and Chrome, but not FF
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
495 }
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
496 */
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
497
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
498 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
499 // ===========
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
500
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
501
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
502 function tagwithOnlytag( range, stringSelection, tag ) {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
503 saveUndoText();
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
504 var topic_tag = JSON.parse('<?php echo json_encode($topic_tag) ?>');
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
505 var topic_tag2 = topic_tag+"2";
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
506
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
507 range.deleteContents();
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
508
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
509
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
510 if ( tag==topic_tag2) {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
511 var newdiv = document.createElement(topic_tag);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
512 newdiv.innerHTML = stringSelection;
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
513 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
514 var newdiv = document.createElement("br");
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
515 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
516
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
517 } else {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
518 var newdiv = document.createElement(tag);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
519 newdiv.innerHTML = stringSelection;
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
520 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
521 }
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
522
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
523 /*
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
524 if ( tag=="person2") {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
525 var newdiv = document.createElement("person");
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
526 newdiv.innerHTML = stringSelection;
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
527 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
528 var newdiv = document.createElement("br");
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
529 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
530 } else if (tag=="object2") {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
531 var newdiv = document.createElement("object");
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
532 newdiv.innerHTML = stringSelection;
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
533 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
534 var newdiv = document.createElement("br");
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
535 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
536
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
537 } else {
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
538 var newdiv = document.createElement(tag);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
539 newdiv.innerHTML = stringSelection;
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
540 range.insertNode(newdiv);
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
541 }
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
542 */
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
543
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
544 $('.tagItemDivClass').remove();
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
545 }
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
546
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
547
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
548
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
549
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
550 function replaceSmartRegex() {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
551 saveUndoText();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
552 var startPage = $('#regexPageStart2').val();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
553 var endPage = $('#regexPageEnd2').val();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
554
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
555 var el = document.getElementById("editable-area");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
556 var regexText=document.getElementById("regexText").value;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
557
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
558 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
559 foreach ( $wordlistArray as $wordlistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
560 echo "\tvar regexText1=\"List ".$wordlistValue[1]."\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
561 echo "\tregexText1 = preg_quote(regexText1);\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
562 echo "\tvar replaceText1=\"".$wordlistValue[2]."\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
563 echo "\tregexText = regexText.replace(new RegExp(regexText1, \"g\"), replaceText1);\n\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
564 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
565 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
566
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
567 var replaceText=document.getElementById("replaceText").value;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
568 var str="" + el.innerHTML;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
569
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
570 if ( startPage == "" ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
571 alert( "Tagged "+str.match(new RegExp(regexText, "g")).length+" entities!" );
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
572 el.innerHTML = str.replace(new RegExp(regexText, "g"), replaceText);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
573 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
574 var regexText2="【<a([^<>]*?)>"+startPage+"</a>】(.*?)【<a([^<>]*?)>"+endPage+"</a>】";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
575 var partString = ""+str.match(new RegExp(regexText2, "g"));
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
576 alert(partString);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
577
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
578 alert( "Tagged "+partString.match(new RegExp(regexText, "g")).length+" entities!" );
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
579 var resultString = partString.replace(new RegExp(regexText, "g"), replaceText);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
580
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
581 str="" + el.innerHTML;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
582 el.innerHTML = str.replace(new RegExp(regexText2, "g"), resultString);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
583 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
584 //document.styleSheets[0].addRule("tag001", "color:green;")
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
585 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
586
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
587
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
588
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
589 function saveTextToLGService() {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
590 var info = JSON.parse('<?php echo json_encode($info) ?>');
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
591 var topic_id = JSON.parse('<?php echo json_encode($default_topic_id) ?>');
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
592
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
593 // if this is a new branch, ask for label
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
594 if (info['branch_id'] == 0) {
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
595 var cnt = 0;
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
596 var label = prompt("Please enter your label for this new branch", "label for section "+info['section_id']);
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
597 while (label == null && cnt <= 3) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
598 cnt ++;
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
599 label = prompt("Please enter your label for this new branch (not empty)", "label for section "+info['section_id']);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
600 }
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
601 };
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
602
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
603
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
604
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
605 var form = document.createElement("form");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
606 form.setAttribute("method", "post");
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
607 form.setAttribute("action", "./TaggingText"); // hand to controller
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
608 form.setAttribute("target", "_self");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
609
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
610 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
611 hiddenField.setAttribute("name", "func");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
612 hiddenField.setAttribute("value", "SaveFullTextToLGService");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
613 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
614
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
615
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
616 var hiddenField = document.createElement("input");
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
617 hiddenField.setAttribute("name", "label");
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
618 hiddenField.setAttribute("value", label);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
619 form.appendChild(hiddenField);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
620
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
621 var hiddenField = document.createElement("input");
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
622 hiddenField.setAttribute("name", "topic_id");
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
623 hiddenField.setAttribute("value", topic_id);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
624 form.appendChild(hiddenField);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
625
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
626 _postForContineTagging(form);
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
627
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
628 /*
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
629
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
630 if (info) {
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
631 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
632 hiddenField.setAttribute("name", "fileId");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
633 hiddenField.setAttribute("value", info['file_id']);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
634 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
635 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
636 hiddenField.setAttribute("name", "branchId");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
637 hiddenField.setAttribute("value", info['branch_id']);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
638 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
639 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
640 hiddenField.setAttribute("name", "userId");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
641 hiddenField.setAttribute("value", info['user_id']);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
642 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
643 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
644 hiddenField.setAttribute("name", "sectionId");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
645 hiddenField.setAttribute("value", info['section_id']);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
646 form.appendChild(hiddenField);
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
647
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
648 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
649 hiddenField.setAttribute("name", "bookId");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
650 hiddenField.setAttribute("value", info['book_id']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
651 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
652 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
653 hiddenField.setAttribute("name", "sectionName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
654 hiddenField.setAttribute("value", info['section_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
655 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
656 var hiddenField = document.createElement("input");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
657 hiddenField.setAttribute("name", "bookName");
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
658 hiddenField.setAttribute("value", info['book_name']);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
659 form.appendChild(hiddenField);
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
660
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
661 }
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
662
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
663 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
664 hiddenField.setAttribute("name", "text");
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
665 var el = document.getElementById("editable-area");
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
666 //var text = encodeURIComponent(el.innerHTML);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
667 var text = el.innerHTML;
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
668 hiddenField.setAttribute("value", text);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
669 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
670
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
671 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
672 document.body.appendChild(form);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
673 form.submit();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
674 } else {
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
675 form.submit(); // works under IE and Chrome, but not FF
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
676 }
27
4a29bccb6c59 modify the SmartRegexSave method to prevent duplicated records in topic_regex_relation table and provide better promting to user to force saving regex file or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
677 */
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
678 }
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
679
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
680
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
681
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
682 function chooseTopic(default_topic_id) {
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
683 var t = JSON.parse( '<?php echo json_encode($topiclistArray) ?>' );
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
684 var info = JSON.parse('<?php echo json_encode($info) ?>');
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
685
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
686 $('#load_topic_div').html("");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
687 $('#load_topic_div').css("display", "block");
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
688
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
689 $('#load_topic_div').css("border", "1px solid black");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
690 $('#load_topic_div').css("background-color", "White");
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
691 $('#load_topic_div').css("width", "150px");
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
692 $('#load_topic_div').css("height", "50px");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
693 $('#load_topic_div').css("top", "20px");
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
694 $('#load_topic_div').css("left", "-150px");
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
695
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
696
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
697 var topic_select = document.createElement("select");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
698 topic_select.id = "loadTopiclist";
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
699 var selected_topic = t[0];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
700 topic_select.onchange = function(){
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
701
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
702 selected_topic = topic_select.options[topic_select.selectedIndex];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
703 console.log(selected_topic.text);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
704
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
705 var topic_id = selected_topic.value;
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
706
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
707 var form = document.createElement("form");
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
708 form.setAttribute("method", "post");
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
709 form.setAttribute("action", "./TaggingText"); // hand to controller
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
710 form.setAttribute("target", "_self");
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
711
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
712 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
713 hiddenField.setAttribute("name", "topic");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
714 hiddenField.setAttribute("value", topic_id);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
715 form.appendChild(hiddenField);
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
716
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
717 var hiddenField = document.createElement("input");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
718 hiddenField.setAttribute("name", "func");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
719 hiddenField.setAttribute("value", "ContinueTagging");
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
720 form.appendChild(hiddenField);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
721
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
722 _postForContineTagging(form);
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
723
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
724 };
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
725
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
726
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
727 //Create and append the options
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
728 for (var i = 0; i < t.length; i++) {
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
729 console.log(t[i]['id']+","+t[i]['name']);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
730 var option = document.createElement("option");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
731 option.value = t[i]['id'];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
732 option.text = t[i]['name'];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
733 if (option.value == default_topic_id) {
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
734 option.selected = true;
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
735 };
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
736 topic_select.appendChild(option);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
737 }
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
738
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
739 $('#load_topic_div').append(topic_select);
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
740
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
741 var newbutton = document.createElement("button");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
742 $(newbutton).html("Close");
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
743 $(newbutton).addClass("btn btn-xs btn-default");
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
744 $(newbutton).attr("onclick", "$('#load_topic_div').css(\"display\", \"none\");");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
745 $('#load_topic_div').append(newbutton);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
746
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
747 }
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
748
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
749 // --- for config tags in topic ---
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
750 function _postForContineTagging(form) {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
751 var hiddenField = document.createElement("input");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
752 hiddenField.setAttribute("name", "text");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
753 var el = document.getElementById("editable-area");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
754 var text = el.innerHTML;
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
755 hiddenField.setAttribute("value", text);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
756 form.appendChild(hiddenField);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
757
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
758 var info = JSON.parse( '<?php echo json_encode($info) ?>');
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
759
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
760 if (info) {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
761 // TODO: different field info array based on fileId(branchId) existing or not
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
762 if (info['file_id']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
763 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
764 hiddenField.setAttribute("name", "fileId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
765 hiddenField.setAttribute("value", info['file_id']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
766 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
767 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
768 if (info['branch_id']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
769 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
770 hiddenField.setAttribute("name", "branchId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
771 hiddenField.setAttribute("value", info['branch_id']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
772 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
773 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
774 if (info['user_id']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
775 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
776 hiddenField.setAttribute("name", "userId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
777 hiddenField.setAttribute("value", info['user_id']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
778 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
779 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
780 if (info['section_id']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
781 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
782 hiddenField.setAttribute("name", "sectionId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
783 hiddenField.setAttribute("value", info['section_id']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
784 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
785 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
786 if (info['book_id']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
787 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
788 hiddenField.setAttribute("name", "bookId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
789 hiddenField.setAttribute("value", info['book_id']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
790 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
791 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
792 if (info['section_name']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
793 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
794 hiddenField.setAttribute("name", "sectionName");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
795 hiddenField.setAttribute("value", info['section_name']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
796 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
797 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
798 if (info['book_name']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
799 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
800 hiddenField.setAttribute("name", "bookName");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
801 hiddenField.setAttribute("value", info['book_name']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
802 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
803 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
804 /*
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
805 if (info['current_fileId']) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
806 var hiddenField = document.createElement("input");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
807 hiddenField.setAttribute("name", "currentFileId");
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
808 hiddenField.setAttribute("value", info['current_fileId']);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
809 form.appendChild(hiddenField);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
810 };
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
811 */
25
4b6d2d7e706e update for the integration
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 24
diff changeset
812
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
813 }
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
814 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
815 document.body.appendChild(form);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
816 form.submit();
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
817 } else {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
818 form.submit(); // works under IE and Chrome, but not FF
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
819 }
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
820
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
821 }
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
822
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
823 function configTagsInTopic(topic_id) {
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
824 var form = document.createElement("form");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
825
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
826 form.setAttribute("method", "post");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
827 form.setAttribute("action", "./ConfigTagsInTopic"); // hand to controller
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
828 form.setAttribute("target", "_blank");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
829
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
830 var hiddenField = document.createElement("input");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
831 hiddenField.setAttribute("name", "topic");
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
832 hiddenField.setAttribute("value", topic_id);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
833 form.appendChild(hiddenField);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
834
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
835 _postForContineTagging(form);
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
836
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
837 if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
838 document.body.appendChild(form);
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
839 form.submit();
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
840 } else {
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
841 form.submit(); // works under IE and Chrome, but not FF
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 27
diff changeset
842 }
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
843 }
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
844
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
845
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
846
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
847 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) {
9
584b1623e9ef TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 8
diff changeset
848
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
849 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
850 foreach ( $wordlistArray as $wordlistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
851 echo "if ( $('#smartRegexPopUpSelectWord').val() == \"".$wordlistValue[0]."\") {";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
852 echo "$('#smartRegexPopUpText').val(\"".$wordlistValue[2]."\");";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
853 echo "}";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
854 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
855 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
856 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
857
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
858
16
fb948097de39 fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 15
diff changeset
859
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
860 </script>
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
861
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
862 <div id="dialog-form" title="config tags for topic" style="position:fixed; top: 30px; ">
20
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
863 </div>
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
864
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
865
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
866 <p class="bg-info" style="margin:10 30 10 30; max-width:1250"> <?php echo $messages; ?> </p>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
867
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
868 <table width="1270" border="1" style="margin:10 30 10 30;">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
869 <tr>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
870 <td width="980" style="padding:0 5 0 5; margin: 0 5 0 5;">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
871 <div id="editable-area" class="area" style="max-width: 980"><?php echo $stringInput; ?></div>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
872 </td>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
873 <td width="290" valign="top">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
874 <div id="popups" style="position:absolute; width:300px; ">
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
875 <div id="load_topic_div" style="position: absolute; display: none; z-index:2"></div>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
876 <div id="load_regex_div" style="position: absolute; display: none; z-index:2;"></div>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
877 <div id="smartRegexPopUpDiv" style="position: absolute; display: none; z-index:2">
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
878 Name: <input id="smartRegexPopUpName"></input><br><br>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
879 Word List:
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
880 <select id="smartRegexPopUpSelectWord">
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
881 <option value="NULL" selected>無</option>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
882 <?php
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
883 foreach ( $wordlistArray as $wordlistValue ) {
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
884 echo "<option value=\"".$wordlistValue[0]."\">".$wordlistValue[1]."</option>\n";
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
885 }
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
886 ?>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
887 </select>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
888 <br>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
889 OR (USE "|" TO SEPARATE WORDS):<br>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
890 <TEXTAREA id="smartRegexPopUpText" COLS=30 ROWS=4></TEXTAREA><br><br>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
891 Tag:
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
892 <select id="smartRegexPopUpSelectTag">
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
893 <?php
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
894 foreach ( $taglistArray as $taglistValue ) {
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
895 echo "<option value=\"".$taglistValue[2]."\">".$taglistValue[1]."</option>\n";
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
896 }
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
897 echo "<option value=\"title\">Title</option>\n";
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
898 ?>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
899 <option value="NOTAG">不標記</option>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
900 </select><br>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
901 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info" style="">Add</button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
902 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success" style="">Edit</button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
903 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger" style="">Delete</button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
904 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default" style=""><<</button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
905 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default" style="">>></button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
906 <button onclick="replaceSmartClose()" class="btn btn-default" style="">Close</button>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
907 </div>
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
908 </div>
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
909
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
910 <div id="follow-scroll" style="position:absolute; height:680px; overflow:scroll; margin:0 5 15 5; max-width:270px">
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
911 <form action="javascript:void(0);">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
912 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
913 <legend><h5 class="text-success"> Config Topic: </h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
914 <div> current topic is <?php echo $topic_name; ?>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
915 <button onclick="chooseTopic(<?php echo $default_topic_id; ?>)" class="btn btn-xs btn-default">Change</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
916 </div>
23
a879f6b9d166 modification for select-move-taglist: tags don't appear to be duplicated in other topics.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 21
diff changeset
917 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn btn-sm btn-default" style="">Manage Tags in topic</button></br>
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
918 </fieldset>
15
1f98c92ebbfb first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
919
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
920 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
921 <legend><h5 class="text-success"> Replace By <i><b>Smart Regex</b></i>©: </h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
922 <div id="smartRegexShowDiv"></div><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
923 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
924 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br>
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
925 <button onclick="replaceSmartRun()" style="height: 30px; width: 100px">Run</button>
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
926 <button onclick="replaceSmartRunWithBr()" style="height: 30px; width: 100px">Run(with Br)</button></br>
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
927 <button onclick="replaceSmartRunSpace()" style="height: 30px; width: 220px">Run(Allow space between Group)</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
928 <button onclick="smartRegexSave(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 70px">Save</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
929 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 70px">Load</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
930 <button onclick="smartRegexEmpty()" style="height: 30px; width: 70px">Clear</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
931 <!--
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
932 <button id="example" type="button" class="btn btn-sm btn-default" data-toggle="popover">Load</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
933 -->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
934 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
935
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
936 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
937 <legend><h5 class="text-success"> Tag by rule:</h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
938 <button onclick="tagNameWithLastName()" style="height: 30px; width: 220px">Tag Word Begin With Surname</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
939 <button onclick="tagNameWithLastName2()" style="height: 30px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
940 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>-->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
941 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>-->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
942 <button onclick="Undo()" style="height: 30px; width: 220px" id="buttonUndo" disabled="true">Undo</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
943 </fieldset>
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
944
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
945 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
946 <legend><h5 class="text-success"> Edit:</h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
947 <button onclick="saveTextToLGService()" style="height: 30px; width: 220px">Save to LGService</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
948
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
949 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>-->
24
b55f5d3564c4 add some regular expressions and wordlist for topic ??
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 23
diff changeset
950 <!-- save text in local. replaced by saveTextToLGService, which is also saving on copy in local in development stage -->
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
951 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
952 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
953 </br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
954 <button onclick="window.open('./EditWordlist')" style="height: 30px; width: 220px">Manage Word List</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
955 <!--
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
956 <button onclick="window.open('./EditTaglist')" style="height: 30px; width: 220px">Manage Tag List</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
957 -->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
958 <button onclick="editTaglist(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 220px">Manage Tag List</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
959 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
960
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
961 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
962 <legend><h5 class="text-success"> Export:</h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
963 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
964 <button onclick="exportPage(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
965 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
966 </fieldset>
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
967
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
968 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
969 <legend><h5 class="text-success"> Replace By <i><b>Regex</b></i>: </h5></legend>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
970 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
971 Regex: <input type="text" size="23" id="regexText"></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
972 Replace: <input type="text" size="23" id="replaceText"><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
973 <button onclick="replaceSmartRegex()">Replace!</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
974 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
975 </form>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
976 </div>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
977 </td>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
978 </tr>
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
979
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
980 </table>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
981
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
982
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
983
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
984
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
985 </body>
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
986
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
987 </html>