Mercurial > hg > extraction-interface
annotate develop/views/Extractapp/taggingtext.php @ 16:fb948097de39
fix bug: Edittaglist is working on Firefox.
fix bug: name of regex used to show with strange <span id="transmark"></span> showing only on FF but not Saf. Change it to use "document.getElementById(id).textContent to get the pure text string.
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 20 Feb 2015 16:39:08 +0100 |
parents | 1f98c92ebbfb |
children | 82f8c6bd2b69 |
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(){ |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
87 //run once |
16
fb948097de39
fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
88 /* no need, fixed sidebar |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
89 var el=$('#follow-scroll'); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
90 var originalelpos=el.offset().top; // take it where it originally is on the page |
16
fb948097de39
fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
91 */ |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
92 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
93 //run on scroll |
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
|
94 /* |
6
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; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
100 el.stop().animate({'top':finaldestination},500); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
101 }); |
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
|
102 */ |
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
|
103 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
104 }); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
105 $(document).on("click", "name", function (e) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
106 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
107 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
|
108 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
|
109 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
110 removeTagNewDiv( e, "name", $(this) ); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
111 }); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
112 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
113 $(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
|
114 $('.questionMarkClass').remove(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
115 $('.tagItemDivClass').remove(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
116 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
117 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
|
118 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
119 var selection = getSelected(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
120 range = getSelected().getRangeAt(0); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
121 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
122 container = document.createElement("div"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
123 container.appendChild(selection.getRangeAt(0).cloneContents()); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
124 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
125 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
|
126 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
127 var newdiv = document.createElement("div"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
128 newdiv.id = "tagItemDivId"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
129 newdiv.setAttribute("class", "tagItemDivClass"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
130 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
|
131 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
|
132 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
|
133 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
134 //console.log(selection.getRangeAt(0).cloneContents()); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
135 if ( container.innerHTML.indexOf( "br" ) != -1 ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
136 var newselect = document.createElement("select"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
137 newselect.id = "TitletagType"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
138 <?php |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
139 foreach ( $taglistArray as $taglistValue ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
140 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
|
141 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
142 ?> |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
143 newdiv.appendChild(newselect); |
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 //matchValue = .match(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
146 myRegexp = new RegExp("〈(.*?)〉", "g") |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
147 matchValue = myRegexp.exec(String(selection)); |
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 ( matchValue != null ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
150 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
|
151 } else { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
152 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
|
153 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
154 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
|
155 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
156 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
|
157 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
158 var newselect = document.createElement("select"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
159 newselect.id = "RemoveTitletagType"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
160 <?php |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
161 foreach ( $taglistArray as $taglistValue ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
162 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
|
163 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
164 ?> |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
165 newdiv.appendChild(newselect); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
166 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
167 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
|
168 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
|
169 } else { |
9
584b1623e9ef
TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
8
diff
changeset
|
170 // 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
|
171 newdiv.innerHTML = "Tag: "+String(selection)+"<br>"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
172 |
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
|
173 <?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
|
174 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 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
|
180 } |
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
|
181 } |
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
|
182 ?> |
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
|
183 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
184 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
|
185 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
186 <?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
|
187 |
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
|
188 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
|
189 /* |
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
|
190 if ( $taglistValue[2] == "person") { |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
191 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
|
192 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
|
193 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
|
194 } 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
|
195 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
|
196 // 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
|
197 } 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
|
198 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
|
199 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
|
200 } else if ($taglistValue[2] == "office") { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
201 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
|
202 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
|
203 } else { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
204 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
|
205 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
|
206 } |
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 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
208 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
209 ?> |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
210 } |
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
|
211 |
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
|
212 $('#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
|
213 $('body').append(newdiv); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
214 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
215 $('#TitletagType').val(lastAddTag); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
216 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
217 //e.stopPropagation(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
218 }); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
219 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
220 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
221 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
222 function replaceSmartRegex() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
223 saveUndoText(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
224 var startPage = $('#regexPageStart2').val(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
225 var endPage = $('#regexPageEnd2').val(); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
226 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
227 var el = document.getElementById("editable-area"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
228 var regexText=document.getElementById("regexText").value; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
229 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
230 <?php |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
231 foreach ( $wordlistArray as $wordlistValue ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
232 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
|
233 echo "\tregexText1 = preg_quote(regexText1);\n"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
234 echo "\tvar replaceText1=\"".$wordlistValue[2]."\";\n"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
235 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
|
236 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
237 ?> |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
238 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
239 var replaceText=document.getElementById("replaceText").value; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
240 var str="" + el.innerHTML; |
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 if ( startPage == "" ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
243 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
|
244 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
|
245 } else { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
246 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
|
247 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
|
248 alert(partString); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
249 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
250 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
|
251 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
|
252 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
253 str="" + el.innerHTML; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
254 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
|
255 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
256 //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
|
257 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
258 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
259 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
260 |
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
|
261 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
|
262 var info = JSON.parse('<?php echo json_encode($info) ?>'); |
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
|
263 |
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
|
264 |
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
|
265 // 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
|
266 if (info['branch_id'] == 0) { |
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
|
267 var label = prompt("Please enter your label for this new branch", "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
|
268 while (label == null) { |
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
|
269 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
|
270 } |
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
|
271 }; |
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
|
272 |
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
|
273 |
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
|
274 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
|
275 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
|
276 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
|
277 |
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
|
278 // 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
|
279 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
|
280 |
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
|
281 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
|
282 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
|
283 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
|
284 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
|
285 |
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
|
286 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 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
|
303 |
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
|
304 |
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
|
305 } |
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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 |
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
|
311 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
|
312 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
|
313 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
|
314 //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
|
315 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
|
316 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
|
317 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
|
318 |
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
|
319 |
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
|
320 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
|
321 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
|
322 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
|
323 } 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
|
324 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
|
325 } |
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
|
326 |
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
|
327 } |
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
|
328 |
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
|
329 |
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
|
330 |
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
|
331 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
|
332 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
|
333 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
|
334 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
335 $('#load_topic_div').html(""); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
336 $('#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
|
337 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
338 $('#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
|
339 $('#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
|
340 $('#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
|
341 $('#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
|
342 $('#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
|
343 $('#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
|
344 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
345 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
346 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
|
347 topic_select.id = "loadTopiclist"; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
348 var selected_topic = t[0]; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
349 topic_select.onchange = function(){ |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
350 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
351 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
|
352 console.log(selected_topic.text); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
353 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
354 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
|
355 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
356 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
|
357 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
|
358 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
|
359 form.setAttribute("target", "_self"); |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
360 |
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
|
361 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
|
362 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
|
363 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
|
364 form.appendChild(hiddenField); |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
365 |
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
|
366 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
|
367 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
|
368 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
|
369 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
|
370 |
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
|
371 _postForContineTagging(form); |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
372 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
373 }; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
374 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
375 //Create and append the options |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
376 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
|
377 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
|
378 var option = document.createElement("option"); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
379 option.value = t[i]['id']; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
380 option.text = t[i]['name']; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
381 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
|
382 option.selected = true; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
383 }; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
384 topic_select.appendChild(option); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
385 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
386 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
387 $('#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
|
388 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
389 var newbutton = document.createElement("button"); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
390 $(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
|
391 $(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
|
392 $(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
|
393 $('#load_topic_div').append(newbutton); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
394 |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
395 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
396 |
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
|
397 // --- 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
|
398 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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 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
|
404 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
|
405 |
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 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
|
407 |
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
|
408 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
|
409 // 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
|
410 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 |
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
|
427 } |
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
|
428 |
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
|
429 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
|
430 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
|
431 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
|
432 } 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
|
433 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
|
434 } |
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
|
435 |
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
|
436 } |
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
|
437 |
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
|
438 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
|
439 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
|
440 |
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
|
441 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
|
442 //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
|
443 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
|
444 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
|
445 |
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 |
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
|
447 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
|
448 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
|
449 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
|
450 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
|
451 |
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 _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
|
453 |
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
|
454 } |
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
|
455 |
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 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
457 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
458 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) { |
9
584b1623e9ef
TOC correction list page updated
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
8
diff
changeset
|
459 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
460 <?php |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
461 foreach ( $wordlistArray as $wordlistValue ) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
462 echo "if ( $('#smartRegexPopUpSelectWord').val() == \"".$wordlistValue[0]."\") {"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
463 echo "$('#smartRegexPopUpText').val(\"".$wordlistValue[2]."\");"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
464 echo "}"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
465 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
466 ?> |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
467 }); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
468 |
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
|
469 |
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
|
470 // init for popover used in bootstrap |
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
|
471 $(function () { |
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
|
472 $('[data-toggle="popover"]').popover() |
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
|
473 }) |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
474 |
16
fb948097de39
fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
475 |
fb948097de39
fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
476 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
477 </script> |
15
1f98c92ebbfb
first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
478 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
479 |
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
|
480 <div class="container-fluid"> |
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
|
481 <div class="row"> |
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
|
482 <div class="col-xs-8 col-sm-8 col-md-8 col-lg-7 col-lg-offset-1" style="position:fixed; height:30px; z-index:99"> |
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
|
483 <p class="bg-info"> <?php echo $messages; ?> </p> |
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
|
484 <div id="popups" style="position:relative; width:300px; margin-left: 100%"> |
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
|
485 <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
|
486 <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
|
487 <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
|
488 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
|
489 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
|
490 <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
|
491 <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
|
492 <?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
|
493 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
|
494 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
|
495 } |
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
|
496 ?> |
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
|
497 </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
|
498 <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
|
499 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
|
500 <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
|
501 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
|
502 <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
|
503 <?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
|
504 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
|
505 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
|
506 } |
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
|
507 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
|
508 ?> |
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
|
509 <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
|
510 </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
|
511 <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
|
512 <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
|
513 <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
|
514 <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
|
515 <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
|
516 <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
|
517 </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
|
518 |
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
|
519 </div> |
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
|
520 </div> |
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
|
521 |
16
fb948097de39
fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
522 <div id="follow-scroll" class="col-xs-4 col-xs-offset-8 col-sm-4 col-sm-offset-8 col-md-4 col-md-offset-8 col-lg-3 col-lg-offset-8" style="position:fixed; width:100%; height:700px; overflow:scroll;"> |
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
|
523 <form action="javascript:void(0);"> |
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
|
524 <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
|
525 <legend><h5 class="text-success"> Config Topic: </h5></legend> |
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
|
526 <div> current topic is <?php echo $topic_name; ?> |
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
|
527 <button onclick="chooseTopic(<?php echo $default_topic_id; ?>)" class="btn btn-xs btn-default">Change</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
|
528 </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
|
529 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn btn-sm btn-default" style="">Config Tags</button></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
|
530 </fieldset> |
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
|
531 |
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
|
532 <fieldset> |
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
|
533 <legend><h5 class="text-success"> Replace By <i><b>Smart Regex</b></i>©: </h5></legend> |
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
|
534 <div id="smartRegexShowDiv"></div><br> |
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 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br> |
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
|
536 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> |
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
|
537 <button onclick="replaceSmartRun()" style="height: 30px; width: 220px">Run</button></br> |
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
|
538 <button onclick="replaceSmartRunSpace()" style="height: 30px; width: 220px">Run(Allow space between Group)</button></br> |
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
|
539 <button onclick="smartRegexSave()" style="height: 30px; width: 70px">Save</button> |
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
|
540 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 70px">Load</button> |
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
|
541 <button onclick="smartRegexEmpty()" style="height: 30px; width: 70px">Clear</button></br> |
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
|
542 <!-- |
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
|
543 <button id="example" type="button" class="btn btn-sm btn-default" data-toggle="popover">Load</button> |
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 --> |
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 </fieldset> |
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 |
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 <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
|
548 <legend><h5 class="text-success"> Tag by rule:</h5></legend> |
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
|
549 <button onclick="tagNameWithLastName()" style="height: 30px; width: 220px">Tag Word Begin With Surname</button></br> |
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 <button onclick="tagNameWithLastName2()" style="height: 30px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br> |
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 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>--> |
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 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>--> |
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 <button onclick="Undo()" style="height: 30px; width: 220px" id="buttonUndo" disabled="true">Undo</button> |
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 </fieldset> |
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 |
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 <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
|
557 <legend><h5 class="text-success"> Edit:</h5></legend> |
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
|
558 <button onclick="saveTextToLGService()" style="height: 30px; width: 220px">Save to LGService</button></br> |
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 |
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 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> |
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 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> |
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 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br> |
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 </br> |
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 <button onclick="window.open('./EditWordlist')" style="height: 30px; width: 220px">Manage Word List</button></br> |
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 <button onclick="window.open('./EditTaglist')" style="height: 30px; width: 220px">Manage Tag List</button></br> |
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 </fieldset> |
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 |
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 <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
|
569 <legend><h5 class="text-success"> Export:</h5></legend> |
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
|
570 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> |
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 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> |
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 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br> |
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 </fieldset> |
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 <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
|
576 <legend><h5 class="text-success"> Replace By <i><b>Regex</b></i>: </h5></legend> |
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
|
577 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> |
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 Regex: <input type="text" size="30" id="regexText"></br> |
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 Replace: <input type="text" size="30" id="replaceText"><br> |
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 <button onclick="replaceSmartRegex()">Replace!</button> |
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 </fieldset> |
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 </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
|
583 </div> |
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 </div> |
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
|
585 |
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
|
586 <div class="row" style="margin-top:30px;"> |
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
|
587 <div id="editable-area" class="col-xs-8 col-sm-8 col-md-8 col-lg-7 col-lg-offset-1" style="z-index:1"> |
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
|
588 <?php echo $stringInput; ?> |
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
|
589 </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
|
590 </div> |
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
|
591 |
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 </div> |
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 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
595 </body> |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
9
diff
changeset
|
596 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
597 </html> |