comparison views/Extractapp/TaggingText.php @ 87:fb5049fc5dd7 extractapp_dev

New:(1)UI(2)generate simple regex by examples(3)coordinates in book metadata
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 02 Jun 2015 16:52:05 +0200
parents 0141df465205
children e681d693240e
comparison
equal deleted inserted replaced
86:0141df465205 87:fb5049fc5dd7
214 //el.stop().animate({'top':finaldestination},500); 214 //el.stop().animate({'top':finaldestination},500);
215 el.stop().animate({'top':finaldestination},0); 215 el.stop().animate({'top':finaldestination},0);
216 }); 216 });
217 // --- 217 // ---
218 218
219
219 //--- for popups --- 220 //--- for popups ---
220 //run once 221 //run once
221 var el=$('#popups'); 222 var el=$('#popups');
222 var originalelpos=el.offset().top; // take it where it originally is on the page 223 var originalelpos=el.offset().top; // take it where it originally is on the page
223 224
250 251
251 // --- handle file version conflict --- 252 // --- handle file version conflict ---
252 var info = JSON.parse('<?php echo json_encode($info) ?>'); 253 var info = JSON.parse('<?php echo json_encode($info) ?>');
253 // the first time to this section. without branch_id and file_id 254 // the first time to this section. without branch_id and file_id
254 if (info['file_id'] == 0) { // or info['branch_id'] == 0, means new file 255 if (info['file_id'] == 0) { // or info['branch_id'] == 0, means new file
255 $( "#saveTextToLGService_id").text( "Create(Save) Branch to LGService" ); 256 $( "#save_text_to_LGService_id").text( "Create(Save) Branch to LGService" );
256 257
257 } 258 }
258 handleFileVersionConflict(); 259 handleFileVersionConflict();
259 260
260 // --- handle taglist deprecation --- 261 // --- handle taglist deprecation ---
269 console.log("Debug: taglistArray length=" + taglistArray.length); 270 console.log("Debug: taglistArray length=" + taglistArray.length);
270 console.log(taglistArray); 271 console.log(taglistArray);
271 272
272 // TOOD: ask user to modify/decide tags 273 // TOOD: ask user to modify/decide tags
273 // showing taglist_infile and taglistArray 274 // showing taglist_infile and taglistArray
274 alert("Warning: taglist is deprecated in the current file."); 275 //alert("Warning: taglist is deprecated in the current file.");
275 276
276 } 277 }
277 278
278 279
279 }); 280 });
288 range = selection.getRangeAt(0); 289 range = selection.getRangeAt(0);
289 290
290 container = document.createElement("div"); 291 container = document.createElement("div");
291 container.appendChild(selection.getRangeAt(0).cloneContents()); 292 container.appendChild(selection.getRangeAt(0).cloneContents());
292 293
293 if(selection && (selection = new String(selection).replace(/^\s+|\s+$/g,''))) { 294 if(selection && (selection_plain = new String(selection).replace(/^\s+|\s+$/g,''))) {
294 try{ 295 try{
295 var newdiv = document.createElement("div"); 296 var newdiv = document.createElement("div");
296 newdiv.id = "tagItemDivId"; 297 //newdiv.id = "tagItemDivId";
297 newdiv.setAttribute("class", "tagItemDivClass"); 298 //newdiv.setAttribute("class", "tagItemDivClass");
298 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px; z-index:4'; 299 $(newdiv).id = "tagItemDivId";
299 300 $(newdiv).addClass("tagItemDivClass");
301 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+';';
300 //console.log(selection.getRangeAt(0).cloneContents()); 302 //console.log(selection.getRangeAt(0).cloneContents());
301 if ( container.innerHTML.indexOf( "br" ) != -1 ) { 303 if ( container.innerHTML.indexOf( "br" ) != -1 ) {
304 // when selected words containing tags (i.e. has 'br' in the selected string),
305 // which means user want to apply Title / or tags all in once at each line
306 // This may not be the best checking solution, since 'br' also appears between not-tagged words
307
302 var newselect = document.createElement("select"); 308 var newselect = document.createElement("select");
303 newselect.id = "TitletagType"; 309 newselect.id = "TitletagType";
304 //console.log(JSON.parse('<?php echo json_encode($taglistArray) ?>')); 310 //console.log(JSON.parse('<?php echo json_encode($taglistArray) ?>'));
305 311
306 <?php 312 <?php
317 if ( matchValue != null ) { 323 if ( matchValue != null ) {
318 newdiv.innerHTML += "<input id=\"TitletagName\" value=\""+ matchValue[1] +"\"></br>"; 324 newdiv.innerHTML += "<input id=\"TitletagName\" value=\""+ matchValue[1] +"\"></br>";
319 } else { 325 } else {
320 newdiv.innerHTML += "<input id=\"TitletagName\" value=\"\"></br>"; 326 newdiv.innerHTML += "<input id=\"TitletagName\" value=\"\"></br>";
321 } 327 }
322
323
324 newdiv.innerHTML += "<button onclick=\"addTagTitle( range, container )\">Add Title Tag To Each Line</button></br>"; 328 newdiv.innerHTML += "<button onclick=\"addTagTitle( range, container )\">Add Title Tag To Each Line</button></br>";
325 329
326 /* 330 /*
327 newdiv.innerHTML += "<button onclick=\"exportTable( range, container )\">Export As A Table</button></br></br>"; 331 newdiv.innerHTML += "<button onclick=\"exportTable( range, container )\">Export As A Table</button></br></br>";
328 */ 332 */
338 342
339 newdiv.innerHTML += "<input id=\"RemoveTitletagName\" value=\"\"></br>"; 343 newdiv.innerHTML += "<input id=\"RemoveTitletagName\" value=\"\"></br>";
340 newdiv.innerHTML += "<button onclick=\"removeTagTitle( range, container )\">Remove</button></br>"; 344 newdiv.innerHTML += "<button onclick=\"removeTagTitle( range, container )\">Remove</button></br>";
341 } else { 345 } else {
342 // for pop up window on edit-area for tag list 346 // for pop up window on edit-area for tag list
343 newdiv.innerHTML = "Tagging word: "+String(selection)+"<br>"; 347 // newdiv.innerHTML = "Tagging word: "+String(selection)+"<br>";
344 348 var tagging_words = document.createElement("div");
349 $(tagging_words).addClass("bg-info");
350 $(tagging_words).text("Tagging words: " + String(selection_plain));
351
352 newdiv.appendChild(tagging_words);
353
354 var tagging_tags = document.createElement("div");
355 $(tagging_tags).addClass("bg-white");
356 $(tagging_tags).text("Tag as: ");
357
358 tagging_tags.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection_plain)+"' )\">Title</button></br>";
359
345 <?php 360 <?php
346 foreach ( $taglistArray as $taglistValue ) { 361 foreach ( $taglistArray as $taglistValue ) {
347
348 if ($taglistValue[2] == $topic_tag) { 362 if ($taglistValue[2] == $topic_tag) {
349 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n"; 363 echo "tagging_tags.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection_plain)+\"', '".$taglistValue[2]."2' )\\\">".$taglistValue[1]."</button>\";\n";
350 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(without new line)</button>\";\n"; 364 echo "tagging_tags.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection_plain)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."(without new line)</button>\";\n";
351 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; 365 echo "tagging_tags.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection_plain)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."(ALL)</button></br>\";\n";
352
353 /*
354 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
355 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
356 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
357 */
358 break; 366 break;
359 } 367 }
360 } 368 }
369 foreach ( $taglistArray as $taglistValue ) {
370 if ($taglistValue[2] == $topic_tag) {
371 // pass
372 } else if ($taglistValue[2] == "post_time") {
373 echo "tagging_tags.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
374 echo "tagging_tags.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
375 } else if ($taglistValue[2] == "office") {
376 echo "tagging_tags.innerHTML += \"<button accesskey=\\\"4\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."</button>\";\n";
377 echo "tagging_tags.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."(ALL)</button></br>\";\n";
378 } else {
379 echo "tagging_tags.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."</button>\";\n";
380 echo "tagging_tags.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">".$taglistValue[1]."(ALL)</button></br>\";\n";
381 }
382 }
361 ?> 383 ?>
362 384
363 newdiv.innerHTML += "<button accesskey=\"2\" onclick=\"tagwithtitle( range, '"+String(selection)+"' )\">Tag As Title</button></br>"; 385 newdiv.appendChild(tagging_tags);
364 386 // add selected words to generator regex
365 <?php 387 genRegexBySelection(newdiv, selection); // append button to newdiv and handle the selection words
366 388
367 foreach ( $taglistArray as $taglistValue ) {
368 /*
369 if ( $taglistValue[2] == "person") {
370 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n";
371 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
372 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
373 } else */
374 if ($taglistValue[2] == $topic_tag) {
375 // pass
376 } else if ($taglistValue[2] == "post_time") {
377 echo "newdiv.innerHTML += \"<button accesskey=\\\"3\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
378 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
379 } else if ($taglistValue[2] == "office") {
380 echo "newdiv.innerHTML += \"<button accesskey=\\\"4\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
381 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
382 } else {
383 echo "newdiv.innerHTML += \"<button onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."</button>\";\n";
384 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n";
385 }
386
387 }
388 ?>
389 } 389 }
390 390
391 //$('#tagItemDivId').addClass(); // tagItemDivId is newdiv's id 391 //$('#tagItemDivId').addClass(); // tagItemDivId is newdiv's id
392 $('body').append(newdiv); 392 $('body').append(newdiv);
393
394 $('#TitletagType').val(lastAddTag); 393 $('#TitletagType').val(lastAddTag);
395 394
396 // selected some words, so hide popping up remove-tag-window 395 // selected some words, so hide popping up remove-tag-window
397 pop_remove_tag_window = false; // questionMarkID 396 pop_remove_tag_window = false; // questionMarkID
398 } 397 }
403 } else { 402 } else {
404 // without selecting any word, so pop up remove-tag-window 403 // without selecting any word, so pop up remove-tag-window
405 pop_remove_tag_window = true; 404 pop_remove_tag_window = true;
406 } 405 }
407 406
408
409
410 //e.stopPropagation(); 407 //e.stopPropagation();
411
412
413
414 }); 408 });
415
416 409
417 // === for exporttable.php === 410 // === for exporttable.php ===
418 function exportTable( range, container ) { 411 function exportTable( range, container ) {
419 //MsgBox("enter function"); 412 //MsgBox("enter function");
420 var form = document.createElement("form"); 413 var form = document.createElement("form");
706 699
707 function chooseTopic(default_topic_id) { 700 function chooseTopic(default_topic_id) {
708 var t = JSON.parse( '<?php echo json_encode($topiclistArray) ?>' ); 701 var t = JSON.parse( '<?php echo json_encode($topiclistArray) ?>' );
709 var info = JSON.parse('<?php echo json_encode($info) ?>'); 702 var info = JSON.parse('<?php echo json_encode($info) ?>');
710 703
711
712 $('#load_topic_div').html(""); 704 $('#load_topic_div').html("");
713 $('#load_topic_div').css("display", "block"); 705 var popup_status = $('#load_topic_div').css("display");
706 if (popup_status == "block") {
707 $('#load_topic_div').css("display", "none");
708 } else {
709 $('#load_topic_div').css("display", "block");
710 }
714 /* 711 /*
715 $('#load_topic_div').css("border", "1px solid black"); 712 $('#load_topic_div').css("border", "1px solid black");
716 $('#load_topic_div').css("background-color", "White"); 713 $('#load_topic_div').css("background-color", "White");
717 $('#load_topic_div').css("width", "200px"); 714 $('#load_topic_div').css("width", "200px");
718 $('#load_topic_div').css("height", "50px"); 715 $('#load_topic_div').css("height", "50px");
901 } 898 }
902 }); 899 });
903 900
904 901
905 </script> 902 </script>
906 903
907 <div id="dialog-form" title="config tags for topic" style="position:fixed; top: 30px; "> 904
908 </div> 905 <!--
906 <fieldset class="info-board">
907 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#info_board">Information <span class="caret"></span></h5></legend>
908 <div id="info_board" class="collapse in">
909 <div class="bg-danger"><strong><?php echo $messages['error']; ?> </strong></div>
910 <div class="bg-warning"> <?php echo $messages['warning']; ?>
911 <button id="reloadTextButton" onclick="reloadText(<?php echo $default_topic_id; ?>)" style="display:none;">Latest Version</button>
912 </div>
913 <div class="bg-info"> <?php echo $messages['info']; ?> </div>
914 <div class="bg-default"> <?php echo $messages['debug']; ?> </div>
915 </div>
916 </fieldset>
917
918 -->
909 919
910 <div class="info-board"> 920 <div class="info-board">
911 <div class="bg-danger"><strong><?php echo $messages['error']; ?> </strong></div> 921 <div class="bg-danger"><strong><?php echo $messages['error']; ?> </strong></div>
912 <div class="bg-warning"> <?php echo $messages['warning']; ?> 922 <div class="bg-warning"> <?php echo $messages['warning']; ?>
913 <button id="reloadTextButton" onclick="reloadText(<?php echo $default_topic_id; ?>)" style="display:none;">Latest Version</button> 923 <button id="reloadTextButton" onclick="reloadText(<?php echo $default_topic_id; ?>)" style="display:none;">Latest Version</button>
914 </div> 924 </div>
915 <div class="bg-info"> <?php echo $messages['info']; ?> </div> 925 <div class="bg-info"> <?php echo $messages['info']; ?> </div>
916 <div class="bg-default"> <?php echo $messages['debug']; ?> </div> 926 <div class="bg-default"> <?php echo $messages['debug']; ?> </div>
917 </div> 927 </div>
928
918 929
919 <table border="1" style="margin:10 30 30 30; width:100%; max-width:1270px; min-width:680px"> 930 <table border="1" style="margin:10 30 30 30; width:100%; max-width:1270px; min-width:680px">
920 <tr> 931 <tr>
921 <td style="padding:0 5 0 5; margin: 0 5 0 5;"> 932 <td style="padding:0 5 0 5; margin: 0 5 0 5;">
922 <div id="editable-area" class="area" style="max-width:980px; min-width:400px"><?php echo $stringInput; ?></div> 933 <div id="editable-area" class="area" style="max-width:980px; min-width:400px"><?php echo $stringInput; ?></div>
923 </td> 934 </td>
924 <td valign="top" style="min-width:280px; padding:0 5 0 5; margin:0 5 0 5;"> 935 <td valign="top" style="min-width:280px; padding:0 5 0 5; margin:0 5 0 5;">
925 <div id="popups" style="position:absolute; width:300px; "> 936 <div id="popups" style="position:absolute; width:300px; ">
926 <div id="load_topic_div" class="popup-topic popup-frame"></div> 937 <div id="load_topic_div" class="popup-topic popup-frame"></div>
927 <div id="load_regex_div" class="popup-loadregex popup-frame"></div> 938 <div id="load_regex_div" class="popup-loadregex popup-frame"></div>
939 <div id="regex_generator" class="popup-regex popup-frame">
940 <h3>Gen Regex</h3>
941 <div>Pattern 1:
942 <div id="regex_pattern1" class="bg-info"></div>
943 </div>
944 <div>Pattern 2:
945 <div id="regex_pattern2" class="bg-info"></div>
946 </div>
947 <div>Suggested Regex:
948 <div id="generated_regex" class="bg-success"></div>
949 </div>
950 <button onclick="genRegexWindowClose()" class="btn btn-default btn-xs">Close</button>
951 <div id="regex_generator_error_msg" class="bg-white"></div>
952 </div>
928 <div id="smartRegexPopUpDiv" class="popup-regex popup-frame"> 953 <div id="smartRegexPopUpDiv" class="popup-regex popup-frame">
929 Name: <input id="smartRegexPopUpName"></input><br><br> 954 Name: <input id="smartRegexPopUpName"></input><br><br>
930 Word List: 955 Word List:
931 <select id="smartRegexPopUpSelectWord"> 956 <select id="smartRegexPopUpSelectWord">
932 <option value="NULL" selected>無</option> 957 <option value="NULL" selected>無</option>
958 </div> 983 </div>
959 </div> 984 </div>
960 985
961 <div id="follow-scroll"> 986 <div id="follow-scroll">
962 <form action="javascript:void(0);"> 987 <form action="javascript:void(0);">
963 <fieldset> 988 <fieldset class="tool-frame">
964 <legend><h5 class="text-success"> Topic: </h5></legend> 989 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_topic"> Topic: <span class="caret"></span></h5></legend>
965 <div> Current topic is: <br> 990 <div id="tool_topic" class="collapse in">
966 <?php echo $topic_name['name_en']; ?> 991 <div> Current topic is: <br>
967 (<?php echo $topic_name['name_ch']; ?>, <?php echo $topic_name['name_pinyin']; ?>) 992 <?php echo $topic_name['name_en']; ?>
968 <button onclick="chooseTopic(<?php echo $default_topic_id;?>)" class="btn-xs">Change</button> 993 (<?php echo $topic_name['name_ch']; ?>, <?php echo $topic_name['name_pinyin']; ?>)
994 <button onclick="chooseTopic(<?php echo $default_topic_id;?>)" class="btn btn-default btn-xs">Change</button>
995 </div>
996 <div>The topic tag is: <?php echo $topic_tag_ch;?>(<?php echo $topic_tag;?>)</div>
997 <button onclick="editTaglist(<?php echo $default_topic_id; ?>)" class="btn btn-default btn-block">Edit Tag List</button>
998 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn btn-default btn-block">Select Existing Tags</button>
969 </div> 999 </div>
970 <div>The topic tag is: <?php echo $topic_tag_ch;?>(<?php echo $topic_tag;?>)</div>
971 </fieldset> 1000 </fieldset>
972 1001
973 <fieldset> 1002 <fieldset class="tool-frame">
974 <legend><h5 class="text-success"> Replace By <i><b>Smart Regex</b></i>©: </h5></legend> 1003 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_regex"> Replace By <i><b>Smart Regex</b></i>©: <span class="caret"></span></h5></legend>
975 <div id="smartRegexShowDiv"></div><br> 1004
976 <!-- <button onclick="smartRegexNew()" class="btn-lg">Add Regex Group</button></br> 1005 <div id="tool_regex" class="collapse in">
977 --> 1006 <div id="smartRegexShowDiv"></div><br>
978 <button onclick="smartRegexNew()" class="btn-lg">Search by Patterns (Smart Regex)</button></br> 1007 <!-- <button onclick="smartRegexNew()" class="btn-lg">Add Regex Group</button></br>
979 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> 1008 -->
980 <button onclick="replaceSmartRun()" class="btn-sm">Run</button> 1009 <button onclick="smartRegexNew()" id="smart_regex_new_id" class="btn btn-default btn-block">Search by Patterns (Smart Regex)</button>
981 <button onclick="replaceSmartRunWithBr()" class="btn-md">Run(in new line)</button></br> 1010
982 <!-- <button onclick="replaceSmartRunSpace()" class="btn-lg">Run(Allow space between Group)</button></br> 1011 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" class="btn btn-default">Load</button>
983 --> 1012 <button onclick="smartRegexSave(<?php echo $default_topic_id; ?>)" class="btn btn-default">Save</button>
984 <button onclick="replaceSmartRunSpace()" class="btn-lg">Run(Allow space between block)</button></br> 1013 <button onclick="smartRegexEmpty()" class="btn btn-default">Clear</button></br>
985 <button onclick="smartRegexSave(<?php echo $default_topic_id; ?>)" class="btn-sm">Save</button> 1014
986 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" class="btn-sm">Load</button> 1015
987 <button onclick="smartRegexEmpty()" class="btn-sm">Clear</button></br> 1016 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br>
1017 <button onclick="replaceSmartRun()" class="btn btn-default">Run</button>
1018 <button onclick="replaceSmartRunWithBr()" class="btn btn-default">Run(in new line)</button></br>
1019 <!-- <button onclick="replaceSmartRunSpace()" class="btn-lg">Run(Allow space between Group)</button></br>
1020 -->
1021 <button onclick="replaceSmartRunSpace()" class="btn btn-default">Run(Allow space between block)</button></br>
1022 <button onclick="Undo()" class="btn btn-default btn-block" id="buttonUndo" disabled="true">Undo</button>
1023
1024 <!-- developing...-->
1025 <button onclick="genRegexWindowOpen()" id="gen_regex_window_open_id" class="btn btn-default">Open GenRegex(test)</button></br>
1026 </div>
988 </fieldset> 1027 </fieldset>
989 1028
990 <fieldset> 1029
991 <legend><h5 class="text-success"> Tag by rule:</h5></legend> 1030 <?php
992 <button onclick="tagNameWithLastName()" class="btn-lg">Tag Word Begin With Surname</button></br> 1031 if ($default_topic_id == 1) {
993 <button onclick="tagNameWithLastName2()" style="height: 35px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br> 1032 ?>
1033 <fieldset class="tool-frame">
1034 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_rule"> Tag by rule: <span class="caret"></span></h5></legend>
1035 <div id="tool_rule" class="collapse out">
1036 <button onclick="tagNameWithLastName()" class="btn btn-default">Tag Word Begin With Surname</button></br>
1037 <button onclick="tagNameWithLastName2()" class="btn btn-default btn-sm">Tag Word Begin With</button> <input type="text" size="2" id="surname">
1038 </div>
994 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>--> 1039 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>-->
995 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>--> 1040 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>-->
996 <button onclick="Undo()" class="btn-lg" id="buttonUndo" disabled="true">Undo</button>
997 </fieldset> 1041 </fieldset>
998 1042
999 <fieldset> 1043 <?php }?>
1000 <legend><h5 class="text-success"> Save:</h5></legend> 1044
1001 <button onclick="saveTextToLGService()" id="saveTextToLGService_id" class="btn-lg">Save to LGService</button></br> 1045 <fieldset class="tool-frame">
1002 </fieldset> 1046 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_edit"> Edit: <span class="caret"></span></h5></legend>
1003
1004 <fieldset>
1005 <legend><h5 class="text-success"> Edit:</h5></legend>
1006 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> 1047 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>-->
1007 <!-- save text in local. replaced by saveTextToLGService, which is also saving on copy in local in development stage --> 1048 <!-- save text in local. replaced by saveTextToLGService, which is also saving on copy in local in development stage -->
1008 <!-- 1049 <!--
1009 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> 1050 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br>
1010 --> 1051 -->
1011 1052 <div class="collapse out" id="tool_edit">
1012 <button onclick="editText()" id="editTextId" class="btn-lg">Edit the text</button></br> 1053 <button onclick="editText()" id="editTextId" class="btn btn-default btn-block">Edit the text</button>
1013 </br> 1054 <button onclick="window.open('./EditWordlist')" class="btn btn-default btn-block">Edit WordList</button>
1014 <button onclick="window.open('./EditWordlist')" class="btn-lg">Edit Word List</button></br> 1055 </div>
1015 <button onclick="editTaglist(<?php echo $default_topic_id; ?>)" class="btn-lg">Edit Tag List</button></br>
1016 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn-lg">Select Existing Tags</button></br>
1017 </fieldset> 1056 </fieldset>
1018 1057
1019 <fieldset> 1058 <fieldset class="tool-frame">
1020 <legend><h5 class="text-success"> Export:</h5></legend> 1059 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_save"> Save and Export: <span class="caret"></span></h5></legend>
1021 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"> 1060 <div class="collapse in" id="tool_save">
1022 <button onclick="exportPage(<?php echo $default_topic_id;?>)" class="btn-sm">Export</button></br> 1061 <button onclick="saveTextToLGService()" id="save_text_to_LGService_id" class="btn btn-default btn-block">Save to LGService</button>
1023 <button onclick="exportAll(<?php echo $default_topic_id;?>)" class="btn-lg">Export All</button></br> 1062 <button onclick="exportAll(<?php echo $default_topic_id;?>)" class="btn btn-default btn-block">Export All</button>
1063 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd">
1064 <button onclick="exportPage(<?php echo $default_topic_id;?>)" class="btn btn-default btn-sm">Export</button></br>
1065 </div>
1024 </fieldset> 1066 </fieldset>
1025 1067
1026 <fieldset> 1068 <fieldset class="tool-frame">
1027 <legend><h5 class="text-success"> Replace By <i><b>Regex</b></i>: </h5></legend> 1069 <legend><h5 class="tool-topic" data-toggle="collapse" data-target="#tool_replace_by"> Replace By <i><b>Regex</b></i>: <span class="caret"></span></h5></legend>
1028 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> 1070 <div class="collapse out" id="tool_replace_by">
1029 Regex: <input type="text" size="23" id="regexText"></br> 1071 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br>
1030 Replace: <input type="text" size="23" id="replaceText"><br> 1072 Regex: <input type="text" size="23" id="regexText"></br>
1031 <button onclick="replaceSmartRegex()">Replace!</button> 1073 Replace: <input type="text" size="23" id="replaceText"><br>
1074 <button onclick="replaceSmartRegex()" class="btn btn-default btn-sm">Replace!</button>
1075 </div>
1032 </fieldset> 1076 </fieldset>
1033 </form> 1077 </form>
1034 </div> 1078 </div>
1035 </td> 1079 </td>
1036 </tr> 1080 </tr>