annotate develop/views/Extractapp/taggingtext.php @ 21:c805470cefee

Remove bootstrap.TaggingText UI layout modification
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 24 Feb 2015 16:09:59 +0100
parents 04db1dd9d10d
children a879f6b9d166
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'];
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
11 $info = $viewmodel['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
12 $messages = $viewmodel['messages'];
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
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
76 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
77 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
78 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
79 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
80 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
81 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
82 echo "});\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
83 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
84 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
85
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
86 $(document).ready(function(){
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
87
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
88 // --- for sidebar---
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
89 //run once
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
90 var el=$('#follow-scroll');
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
91 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
92
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
93
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
94 //run on scroll
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
95 $(window).scroll(function(){
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
96 var el = $('#follow-scroll'); // important! (local)
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
97 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
98 var windowpos = $(window).scrollTop();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
99 var finaldestination = windowpos+originalelpos;
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
100 //el.stop().animate({'top':finaldestination},500);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
101 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
102 });
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
103
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
104 //--- for popups ---
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
105 //run once
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
106 var el=$('#popups');
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
107 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
108
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
109 //run on scroll
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
110 $(window).scroll(function(){
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
111 var el = $('#popups'); // important! (local)
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
112 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
113 var windowpos = $(window).scrollTop();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
114 var finaldestination = windowpos+originalelpos;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
115 //el.stop().animate({'top':finaldestination},500);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
116 el.stop().animate({'top':finaldestination},0);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
117 });
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
118
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
119
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
120
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
121
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
122
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
123
20
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
124 // 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
125 var info = JSON.parse('<?php echo json_encode($info) ?>');
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
126 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
127 // 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
128 $.ajax({
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
129
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
130 });
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
131 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
132
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
133 // alert('choose topic!');
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
134 };
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
135
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
136 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
137 $(document).on("click", "name", function (e) {
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 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
140 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
141
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
142 removeTagNewDiv( e, "name", $(this) );
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
143 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
144
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
145 $(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
146 $('.questionMarkClass').remove();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
147 $('.tagItemDivClass').remove();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
148
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
149 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
150
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
151 var selection = getSelected();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
152 range = getSelected().getRangeAt(0);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
153
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
154 container = document.createElement("div");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
155 container.appendChild(selection.getRangeAt(0).cloneContents());
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
156
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
157 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
158
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
159 var newdiv = document.createElement("div");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
160 newdiv.id = "tagItemDivId";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
161 newdiv.setAttribute("class", "tagItemDivClass");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
162 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px';
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
163 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
164 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
165
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
166 //console.log(selection.getRangeAt(0).cloneContents());
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
167 if ( container.innerHTML.indexOf( "br" ) != -1 ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
168 var newselect = document.createElement("select");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
169 newselect.id = "TitletagType";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
170 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
171 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
172 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
173 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
174 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
175 newdiv.appendChild(newselect);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
176
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
177 //matchValue = .match();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
178 myRegexp = new RegExp("〈(.*?)〉", "g")
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
179 matchValue = myRegexp.exec(String(selection));
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
180
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
181 if ( matchValue != null ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
182 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
183 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
184 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
185 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
186 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
187
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
188 newdiv.innerHTML += "<button onclick=\"exportTable( range, container )\">Export As A Table</button></br></br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
189
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
190 var newselect = document.createElement("select");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
191 newselect.id = "RemoveTitletagType";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
192 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
193 foreach ( $taglistArray as $taglistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
194 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
195 }
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 newdiv.appendChild(newselect);
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 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
200 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
201 } else {
9
584b1623e9ef TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 8
diff changeset
202 // 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
203 newdiv.innerHTML = "Tag: "+String(selection)+"<br>";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
204
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
205 <?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
206 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
207 if ($taglistValue[2] == $topic_tag) {
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
208 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\" class='btn btn-xs btn-primary'>[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
209 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
210 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\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
211 break;
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
212 }
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
213 }
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
214 ?>
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
215
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
216 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
217
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
218 <?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
219
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
220 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
221 /*
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
222 if ( $taglistValue[2] == "person") {
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
223 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
224 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
225 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
226 } else */
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
227 if ($taglistValue[2] == $topic_tag) {
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
228 // 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
229 } 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
230 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
231 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
232 } else if ($taglistValue[2] == "office") {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
233 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
234 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
235 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
236 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
237 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
238 }
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
239
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
240 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
241 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
242 }
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
243
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
244 $('#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
245 $('body').append(newdiv);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
246
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
247 $('#TitletagType').val(lastAddTag);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
248 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
249 //e.stopPropagation();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
250 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
251
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
252
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
253 // === for exporttable.php ===
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
254 function exportTable( range, container ) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
255 //MsgBox("enter function");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
256 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
257 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
258 form.setAttribute("action", "./ExportTable");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
259 form.setAttribute("target", "_blank");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
260
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
261 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
262 hiddenField.setAttribute("name", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
263 hiddenField.setAttribute("value", container.innerHTML);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
264 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
265
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
266 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
267 hiddenField.setAttribute("name", "sectionid");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
268 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
269 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
270
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
271 var hiddenField2 = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
272 hiddenField2.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
273 hiddenField2.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
274 form.appendChild(hiddenField2);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
275
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
276 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
277 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
278 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
279 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
280 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
281 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
282 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
283
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
284 function exportPage(topic_id) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
285 var startPage = $('#exportPageStart').val();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
286 var endPage = $('#exportPageEnd').val();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
287
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
288 var el = document.getElementById("editable-area");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
289 var str="" + el.innerHTML;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
290
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
291 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
292
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
293 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
294 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
295 form.setAttribute("action", "./ExportTable");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
296 form.setAttribute("target", "_blank");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
297
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
298 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
299 hiddenField.setAttribute("name", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
300 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
301 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
302
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
303 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
304 hiddenField.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
305 hiddenField.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
306 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
307
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
308 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
309 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
310
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
311 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
312 hiddenField.setAttribute("name", "sectionId");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
313 hiddenField.setAttribute("value", section_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
314 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
315
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
316
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
317 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
318 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
319 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
320 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
321 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
322 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
323 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
324
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
325 function exportAll(topic_id) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
326 var el = document.getElementById("editable-area");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
327 var str= "" + el.innerHTML;
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
328 var form = document.createElement("form");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
329 form.setAttribute("method", "post");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
330 //form.setAttribute("action", "exportTable.php");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
331 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
332 form.setAttribute("target", "_blank");
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", "content");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
336 hiddenField.setAttribute("value", str);
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 hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
340 hiddenField.setAttribute("name", "topic");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
341 hiddenField.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(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
343
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
344 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
345 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
346
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
347 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
348 hiddenField.setAttribute("name", "sectionId");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
349 hiddenField.setAttribute("value", section_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
350 form.appendChild(hiddenField);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
351
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
352 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
353 document.body.appendChild(form);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
354 form.submit();
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
355 } else {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
356 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
357 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
358
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
359
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
360 }
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
361 // ===========
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
362
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
363 function replaceSmartRegex() {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
364 saveUndoText();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
365 var startPage = $('#regexPageStart2').val();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
366 var endPage = $('#regexPageEnd2').val();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
367
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
368 var el = document.getElementById("editable-area");
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
369 var regexText=document.getElementById("regexText").value;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
370
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
371 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
372 foreach ( $wordlistArray as $wordlistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
373 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
374 echo "\tregexText1 = preg_quote(regexText1);\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
375 echo "\tvar replaceText1=\"".$wordlistValue[2]."\";\n";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
376 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
377 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
378 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
379
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
380 var replaceText=document.getElementById("replaceText").value;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
381 var str="" + el.innerHTML;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
382
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
383 if ( startPage == "" ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
384 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
385 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
386 } else {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
387 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
388 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
389 alert(partString);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
390
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
391 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
392 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
393
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
394 str="" + el.innerHTML;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
395 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
396 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
397 //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
398 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
399
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
400
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
401
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
402 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
403 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
404 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
405
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
406 // 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
407 if (info['branch_id'] == 0) {
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
408 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
409 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
410 while (label == null && cnt <= 3) {
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
411 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
412 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
413 }
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
414 };
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
415
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
416
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
417 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
418 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
419 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
420
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
421 // form.setAttribute("action", "./"+info['section_id']); // 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
422 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
423
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
424 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
425 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
426 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
427 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
428
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
429 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
430 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
431 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
432 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
433 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
434 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
435 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
436 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
437 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
438 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
439 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
440 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
441 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
442 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
443 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
444 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
445 form.appendChild(hiddenField);
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
446
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
447
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
448 }
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
449 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
450 hiddenField.setAttribute("name", "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
451 hiddenField.setAttribute("value", 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
452 form.appendChild(hiddenField);
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
453
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
454 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
455 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
456 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
457 //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
458 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
459 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
460 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
461
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
462 var hiddenField = document.createElement("input");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
463 hiddenField.setAttribute("name", "topic_id");
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
464 hiddenField.setAttribute("value", topic_id);
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
465 form.appendChild(hiddenField);
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
466
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
467 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
468 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
469 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
470 } 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
471 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
472 }
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
473
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
474 }
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
475
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
476
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
477
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
478 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
479 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
480 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
481
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
482 $('#load_topic_div').html("");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
483 $('#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
484
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
485 $('#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
486 $('#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
487 $('#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
488 $('#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
489 $('#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
490 $('#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
491
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
492
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
493 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
494 topic_select.id = "loadTopiclist";
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
495 var selected_topic = t[0];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
496 topic_select.onchange = function(){
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
497
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
498 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
499 console.log(selected_topic.text);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
500
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
501 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
502
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
503 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
504 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
505 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
506 form.setAttribute("target", "_self");
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
507
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
508 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
509 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
510 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
511 form.appendChild(hiddenField);
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
512
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
513 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
514 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
515 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
516 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
517
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
518 _postForContineTagging(form);
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
519
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
520 };
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
521
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
522 //Create and append the options
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
523 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
524 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
525 var option = document.createElement("option");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
526 option.value = t[i]['id'];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
527 option.text = t[i]['name'];
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
528 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
529 option.selected = true;
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
530 };
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
531 topic_select.appendChild(option);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
532 }
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
533
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
534 $('#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
535
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
536 var newbutton = document.createElement("button");
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
537 $(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
538 $(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
539 $(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
540 $('#load_topic_div').append(newbutton);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
541
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
542 }
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
543
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
544 // --- 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
545 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
546 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
547 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
548 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
549 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
550 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
551 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
552
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
553 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
554
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
555 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
556 // TODO: different field info array based on fileId(branchId) existing or not
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
557 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
558 hiddenField.setAttribute("name", "fileId");
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
559 hiddenField.setAttribute("value", info['file_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
560 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
561 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
562 hiddenField.setAttribute("name", "branchId");
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
563 hiddenField.setAttribute("value", info['branch_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
564 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
565 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
566 hiddenField.setAttribute("name", "userId");
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
567 hiddenField.setAttribute("value", info['user_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
568 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
569 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
570 hiddenField.setAttribute("name", "sectionId");
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
571 hiddenField.setAttribute("value", 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
572 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
573
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
574 }
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
575
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
576 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
577 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
578 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
579 } 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
580 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
581 }
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
582
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
583 }
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
584
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
585 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
586 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
587
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
588 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
589 //form.setAttribute("action", "exportTable.php");
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 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
591 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
592
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
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 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
595 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
596 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
597 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
598
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 _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
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 }
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
602
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
603
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
604
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
605 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) {
9
584b1623e9ef TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 8
diff changeset
606
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
607 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
608 foreach ( $wordlistArray as $wordlistValue ) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
609 echo "if ( $('#smartRegexPopUpSelectWord').val() == \"".$wordlistValue[0]."\") {";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
610 echo "$('#smartRegexPopUpText').val(\"".$wordlistValue[2]."\");";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
611 echo "}";
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
612 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
613 ?>
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
614 });
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
615
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
616
16
fb948097de39 fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 15
diff changeset
617
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
618 </script>
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
619
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
620
20
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
621 <div id="popup-window" style="display: none; background-color:white; height:300px; width:300px; margin:200 0 0 200;position:fixed; z-index:2">
04db1dd9d10d update topic_regex_relation table when saving (new) regex file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
622 </div>
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
623
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
624
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
625 <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
626
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
627 <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
628 <tr>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
629 <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
630 <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
631 </td>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
632 <td width="290" valign="top">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
633 <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
634 <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
635 <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
636 <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
637 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
638 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
639 <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
640 <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
641 <?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
642 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
643 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
644 }
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
645 ?>
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
646 </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
647 <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
648 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
649 <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
650 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
651 <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
652 <?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
653 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
654 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
655 }
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
656 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
657 ?>
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
658 <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
659 </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
660 <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
661 <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
662 <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
663 <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
664 <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
665 <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
666 </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
667 </div>
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
668
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
669 <div id="follow-scroll" style="position:absolute; height:680px; overflow:scroll;margin:0 5 5 5; max-width:270px">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
670 <form action="javascript:void(0);">
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
671 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
672 <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
673 <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
674 <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
675 </div>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
676 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn btn-sm btn-default" style="">Config Tags</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
677 </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
678
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
679 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
680 <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
681 <div id="smartRegexShowDiv"></div><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
682 <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
683 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
684 <button onclick="replaceSmartRun()" style="height: 30px; width: 220px">Run</button></br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
685 <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
686 <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
687 <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
688 <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
689 <!--
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
690 <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
691 -->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
692 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
693
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
694 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
695 <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
696 <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
697 <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
698 <!--<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
699 <!--<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
700 <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
701 </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
702
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
703 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
704 <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
705 <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
706
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
707 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>-->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
708 <!-- save text in local. replaced by saveTextToLGService, which is also saving on copy in local in development stage
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
709 <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
710 -->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
711 <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
712 </br>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
713 <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
714 <!--
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
715 <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
716 -->
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
717 <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
718 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
719
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
720 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
721 <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
722 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
723 <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
724 <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
725 </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
726
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
727 <fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
728 <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
729 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
730 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
731 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
732 <button onclick="replaceSmartRegex()">Replace!</button>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
733 </fieldset>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
734 </form>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
735 </div>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
736 </td>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
737 </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
738
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
739 </table>
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
740
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 20
diff changeset
741
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
742
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
743
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
744 </body>
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 9
diff changeset
745
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
746 </html>