Mercurial > hg > extraction-interface
comparison develop/views/Extractapp/taggingtext.php @ 15:1f98c92ebbfb
first version of UI layout. Very roughly, but works in the fixed sidebar, head line, popups and so on.
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Thu, 19 Feb 2015 18:11:11 +0100 |
| parents | ac77748bb813 |
| children | fb948097de39 |
comparison
equal
deleted
inserted
replaced
| 14:ac77748bb813 | 15:1f98c92ebbfb |
|---|---|
| 4 $wordlistArray = $viewmodel['wordlistArray']; | 4 $wordlistArray = $viewmodel['wordlistArray']; |
| 5 $taglistArray = $viewmodel['taglistArray']; | 5 $taglistArray = $viewmodel['taglistArray']; |
| 6 $section_id = $viewmodel['section_id']; | 6 $section_id = $viewmodel['section_id']; |
| 7 $topiclistArray = $viewmodel['topiclistArray']; | 7 $topiclistArray = $viewmodel['topiclistArray']; |
| 8 $default_topic_id = $viewmodel['default_topic_id']; | 8 $default_topic_id = $viewmodel['default_topic_id']; |
| 9 $topic_name = $viewmodel['topic_name']; | |
| 9 $topic_tag = $viewmodel['topic_tag']; | 10 $topic_tag = $viewmodel['topic_tag']; |
| 10 $info = $viewmodel['info']; | 11 $info = $viewmodel['info']; |
| 11 $messages = $viewmodel['messages']; | 12 $messages = $viewmodel['messages']; |
| 12 | 13 |
| 13 | 14 |
| 123 | 124 |
| 124 var newdiv = document.createElement("div"); | 125 var newdiv = document.createElement("div"); |
| 125 newdiv.id = "tagItemDivId"; | 126 newdiv.id = "tagItemDivId"; |
| 126 newdiv.setAttribute("class", "tagItemDivClass"); | 127 newdiv.setAttribute("class", "tagItemDivClass"); |
| 127 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px'; | 128 newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px'; |
| 128 | 129 newdiv.style.backgroundColor = "white"; |
| 130 newdiv.style.zIndex = 2; | |
| 131 | |
| 129 //console.log(selection.getRangeAt(0).cloneContents()); | 132 //console.log(selection.getRangeAt(0).cloneContents()); |
| 130 if ( container.innerHTML.indexOf( "br" ) != -1 ) { | 133 if ( container.innerHTML.indexOf( "br" ) != -1 ) { |
| 131 var newselect = document.createElement("select"); | 134 var newselect = document.createElement("select"); |
| 132 newselect.id = "TitletagType"; | 135 newselect.id = "TitletagType"; |
| 133 <?php | 136 <?php |
| 166 newdiv.innerHTML = "Tag: "+String(selection)+"<br>"; | 169 newdiv.innerHTML = "Tag: "+String(selection)+"<br>"; |
| 167 | 170 |
| 168 <?php | 171 <?php |
| 169 foreach ( $taglistArray as $taglistValue ) { | 172 foreach ( $taglistArray as $taglistValue ) { |
| 170 if ($taglistValue[2] == $topic_tag) { | 173 if ($taglistValue[2] == $topic_tag) { |
| 171 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."2' )\\\">[TopicTag]Tag as:".$taglistValue[1]."(necessary for this topic!)</button>\";\n"; | 174 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"; |
| 172 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n"; | 175 echo "newdiv.innerHTML += \"<button accesskey=\\\"1\\\" onclick=\\\"tagwithOnlytag( range, '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(No BR)</button>\";\n"; |
| 173 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; | 176 echo "newdiv.innerHTML += \"<button onclick=\\\"tagStringWithTag( '\"+String(selection)+\"', '".$taglistValue[2]."' )\\\">Tag as:".$taglistValue[1]."(ALL)</button></br>\";\n"; |
| 174 break; | 177 break; |
| 175 } | 178 } |
| 176 } | 179 } |
| 201 } | 204 } |
| 202 | 205 |
| 203 } | 206 } |
| 204 ?> | 207 ?> |
| 205 } | 208 } |
| 209 | |
| 210 $('#tagItemDivId').addClass(); // tagItemDivId is newdiv's id | |
| 206 $('body').append(newdiv); | 211 $('body').append(newdiv); |
| 207 | 212 |
| 208 $('#TitletagType').val(lastAddTag); | 213 $('#TitletagType').val(lastAddTag); |
| 209 } | 214 } |
| 210 //e.stopPropagation(); | 215 //e.stopPropagation(); |
| 321 | 326 |
| 322 | 327 |
| 323 | 328 |
| 324 function chooseTopic(default_topic_id) { | 329 function chooseTopic(default_topic_id) { |
| 325 var t = JSON.parse( '<?php echo json_encode($topiclistArray) ?>' ); | 330 var t = JSON.parse( '<?php echo json_encode($topiclistArray) ?>' ); |
| 326 | |
| 327 var info = JSON.parse('<?php echo json_encode($info) ?>'); | 331 var info = JSON.parse('<?php echo json_encode($info) ?>'); |
| 328 | |
| 329 | 332 |
| 330 $('#load_topic_div').html(""); | 333 $('#load_topic_div').html(""); |
| 331 $('#load_topic_div').css("display", "block"); | 334 $('#load_topic_div').css("display", "block"); |
| 332 | 335 |
| 333 $('#load_topic_div').css("border", "1px solid black"); | 336 $('#load_topic_div').css("border", "1px solid black"); |
| 334 $('#load_topic_div').css("background-color", "White"); | 337 $('#load_topic_div').css("background-color", "White"); |
| 335 $('#load_topic_div').css("width", "150px"); | 338 $('#load_topic_div').css("width", "150px"); |
| 336 $('#load_topic_div').css("height", "50px"); | 339 $('#load_topic_div').css("height", "50px"); |
| 337 $('#load_topic_div').css("top", "20px"); | 340 $('#load_topic_div').css("top", "20px"); |
| 338 $('#load_topic_div').css("left", "-150px"); | 341 $('#load_topic_div').css("left", "-150px"); |
| 339 | 342 |
| 340 | 343 |
| 341 var topic_select = document.createElement("select"); | 344 var topic_select = document.createElement("select"); |
| 342 topic_select.id = "loadTopiclist"; | 345 topic_select.id = "loadTopiclist"; |
| 343 var selected_topic = t[0]; | 346 var selected_topic = t[0]; |
| 344 topic_select.onchange = function(){ | 347 topic_select.onchange = function(){ |
| 345 | 348 |
| 346 | |
| 347 selected_topic = topic_select.options[topic_select.selectedIndex]; | 349 selected_topic = topic_select.options[topic_select.selectedIndex]; |
| 348 console.log(selected_topic.text); | 350 console.log(selected_topic.text); |
| 349 | 351 |
| 350 var topic_id = selected_topic.value; | 352 var topic_id = selected_topic.value; |
| 351 // var topic_name = selected_topic.text; | |
| 352 | |
| 353 | 353 |
| 354 var form = document.createElement("form"); | 354 var form = document.createElement("form"); |
| 355 form.setAttribute("method", "post"); | 355 form.setAttribute("method", "post"); |
| 356 form.setAttribute("action", "./TaggingText"); // hand to controller | 356 form.setAttribute("action", "./TaggingText"); // hand to controller |
| 357 //form.setAttribute("action", "./"+section_id); // hand to controller | |
| 358 form.setAttribute("target", "_self"); | 357 form.setAttribute("target", "_self"); |
| 359 | 358 |
| 360 var hiddenField = document.createElement("input"); | 359 var hiddenField = document.createElement("input"); |
| 361 hiddenField.setAttribute("name", "topic"); | 360 hiddenField.setAttribute("name", "topic"); |
| 362 hiddenField.setAttribute("value", topic_id); | 361 hiddenField.setAttribute("value", topic_id); |
| 367 hiddenField.setAttribute("value", "ContinueTagging"); | 366 hiddenField.setAttribute("value", "ContinueTagging"); |
| 368 form.appendChild(hiddenField); | 367 form.appendChild(hiddenField); |
| 369 | 368 |
| 370 _postForContineTagging(form); | 369 _postForContineTagging(form); |
| 371 | 370 |
| 372 | |
| 373 }; | 371 }; |
| 374 | |
| 375 | 372 |
| 376 //Create and append the options | 373 //Create and append the options |
| 377 for (var i = 0; i < t.length; i++) { | 374 for (var i = 0; i < t.length; i++) { |
| 378 console.log(t[i]['id']+","+t[i]['name']); | 375 console.log(t[i]['id']+","+t[i]['name']); |
| 379 var option = document.createElement("option"); | 376 var option = document.createElement("option"); |
| 385 topic_select.appendChild(option); | 382 topic_select.appendChild(option); |
| 386 } | 383 } |
| 387 | 384 |
| 388 $('#load_topic_div').append(topic_select); | 385 $('#load_topic_div').append(topic_select); |
| 389 | 386 |
| 390 | |
| 391 var newbutton = document.createElement("button"); | 387 var newbutton = document.createElement("button"); |
| 392 $(newbutton).html("Close"); | 388 $(newbutton).html("Close"); |
| 393 $(newbutton).addClass("btn btn-default"); | 389 $(newbutton).addClass("btn btn-xs btn-default"); |
| 394 $(newbutton).attr("onclick", "$('#load_topic_div').css(\"display\", \"none\");"); | 390 $(newbutton).attr("onclick", "$('#load_topic_div').css(\"display\", \"none\");"); |
| 395 $('#load_topic_div').append(newbutton); | 391 $('#load_topic_div').append(newbutton); |
| 396 | 392 |
| 397 } | 393 } |
| 398 | 394 |
| 486 $(function () { | 482 $(function () { |
| 487 $('[data-toggle="popover"]').popover() | 483 $('[data-toggle="popover"]').popover() |
| 488 }) | 484 }) |
| 489 | 485 |
| 490 </script> | 486 </script> |
| 487 | |
| 491 | 488 |
| 492 <div class="container-fluid"> | 489 <div class="container-fluid"> |
| 493 <div class="row"> | 490 <div class="row"> |
| 494 <div class="col-xs-12 col-sm-12 col-md-12 col-lg-10 col-lg-offset-1"> | 491 <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"> |
| 495 <p class="bg-primary"> <?php echo $messages; ?> </p> | 492 <p class="bg-info"> <?php echo $messages; ?> </p> |
| 493 <div id="popups" style="position:relative; width:300px; margin-left: 100%"> | |
| 494 <div id="load_topic_div" style="position: absolute; display: none; z-index:2"></div> | |
| 495 <div id="load_regex_div" style="position: absolute; display: none; z-index:2;"></div> | |
| 496 <div id="smartRegexPopUpDiv" style="position: absolute; display: none; z-index:2"> | |
| 497 Name: <input id="smartRegexPopUpName"></input><br><br> | |
| 498 Word List: | |
| 499 <select id="smartRegexPopUpSelectWord"> | |
| 500 <option value="NULL" selected>無</option> | |
| 501 <?php | |
| 502 foreach ( $wordlistArray as $wordlistValue ) { | |
| 503 echo "<option value=\"".$wordlistValue[0]."\">".$wordlistValue[1]."</option>\n"; | |
| 504 } | |
| 505 ?> | |
| 506 </select> | |
| 507 <br> | |
| 508 OR (USE "|" TO SEPARATE WORDS):<br> | |
| 509 <TEXTAREA id="smartRegexPopUpText" COLS=30 ROWS=4></TEXTAREA><br><br> | |
| 510 Tag: | |
| 511 <select id="smartRegexPopUpSelectTag"> | |
| 512 <?php | |
| 513 foreach ( $taglistArray as $taglistValue ) { | |
| 514 echo "<option value=\"".$taglistValue[2]."\">".$taglistValue[1]."</option>\n"; | |
| 515 } | |
| 516 echo "<option value=\"title\">Title</option>\n"; | |
| 517 ?> | |
| 518 <option value="NOTAG">不標記</option> | |
| 519 </select><br> | |
| 520 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info" style="">Add</button> | |
| 521 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success" style="">Edit</button> | |
| 522 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger" style="">Delete</button> | |
| 523 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default" style=""><<</button> | |
| 524 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default" style="">>></button> | |
| 525 <button onclick="replaceSmartClose()" class="btn btn-default" style="">Close</button> | |
| 526 </div> | |
| 527 | |
| 528 </div> | |
| 496 </div> | 529 </div> |
| 497 </div> | 530 |
| 498 | 531 |
| 499 <div class="row"> | 532 <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-4 col-lg-offset-8" style="position:fixed; width:300px; height:900px; overflow:scroll; float:right"> |
| 500 <div id="editable-area" class="col-xs-8 col-sm-8 col-md-8 col-lg-7 col-lg-offset-1"><?php echo $stringInput; ?> | |
| 501 </div> | |
| 502 <div id="follow-scroll" class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> | |
| 503 <div id="load_topic_div" style="position: absolute; display: none"></div> | |
| 504 <div id="load_regex_div" style="position: absolute; display: none"></div> | |
| 505 <div id="smartRegexPopUpDiv" style="position: absolute; display: none"> | |
| 506 Name: <input id="smartRegexPopUpName"></input><br><br> | |
| 507 Word List: | |
| 508 <select id="smartRegexPopUpSelectWord"> | |
| 509 <option value="NULL" selected>無</option> | |
| 510 <?php | |
| 511 foreach ( $wordlistArray as $wordlistValue ) { | |
| 512 echo "<option value=\"".$wordlistValue[0]."\">".$wordlistValue[1]."</option>\n"; | |
| 513 } | |
| 514 ?> | |
| 515 </select> | |
| 516 <br> | |
| 517 OR (USE "|" TO SEPARATE WORDS):<br> | |
| 518 <TEXTAREA id="smartRegexPopUpText" COLS=30 ROWS=4></TEXTAREA><br><br> | |
| 519 Tag: | |
| 520 <select id="smartRegexPopUpSelectTag"> | |
| 521 <?php | |
| 522 foreach ( $taglistArray as $taglistValue ) { | |
| 523 echo "<option value=\"".$taglistValue[2]."\">".$taglistValue[1]."</option>\n"; | |
| 524 } | |
| 525 echo "<option value=\"title\">Title</option>\n"; | |
| 526 ?> | |
| 527 <option value="NOTAG">不標記</option> | |
| 528 </select><br> | |
| 529 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info" style="">Add</button> | |
| 530 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success" style="">Edit</button> | |
| 531 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-warning" style="">Delete</button> | |
| 532 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default" style=""><<</button> | |
| 533 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default" style="">>></button> | |
| 534 <button onclick="replaceSmartClose()" class="btn btn-default" style="">Close</button> | |
| 535 </div> | |
| 536 | |
| 537 <form action="javascript:void(0);"> | 533 <form action="javascript:void(0);"> |
| 538 | |
| 539 <h4 class="text-success"> Config Topic</h4> | |
| 540 <button onclick="chooseTopic(<?php echo $default_topic_id; ?>)" class="btn-">Choose Topic</button> | |
| 541 | |
| 542 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" style="">Config Tags</button></br> | |
| 543 | |
| 544 <fieldset> | 534 <fieldset> |
| 545 <legend><h4 class="text-success"> Replace By <i><b>Smart Regex</b></i>©: </h4></legend> | 535 <legend><h5 class="text-success"> Config Topic: </h5></legend> |
| 536 <div> current topic is <?php echo $topic_name; ?> | |
| 537 <button onclick="chooseTopic(<?php echo $default_topic_id; ?>)" class="btn btn-xs btn-default">Change</button> | |
| 538 </div> | |
| 539 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" class="btn btn-sm btn-default" style="">Config Tags</button></br> | |
| 540 </fieldset> | |
| 541 | |
| 542 <fieldset> | |
| 543 <legend><h5 class="text-success"> Replace By <i><b>Smart Regex</b></i>©: </h5></legend> | |
| 546 <div id="smartRegexShowDiv"></div><br> | 544 <div id="smartRegexShowDiv"></div><br> |
| 547 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br> | 545 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br> |
| 548 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> | 546 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> |
| 549 <button onclick="replaceSmartRun()" style="height: 30px; width: 220px">Run</button></br> | 547 <button onclick="replaceSmartRun()" style="height: 30px; width: 220px">Run</button></br> |
| 550 <button onclick="replaceSmartRunSpace()" style="height: 30px; width: 220px">Run(Allow space between Group)</button></br> | 548 <button onclick="replaceSmartRunSpace()" style="height: 30px; width: 220px">Run(Allow space between Group)</button></br> |
| 551 <button onclick="smartRegexSave()" style="height: 30px; width: 70px">Save</button> | 549 <button onclick="smartRegexSave()" style="height: 30px; width: 70px">Save</button> |
| 552 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 70px">Load</button> | 550 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" style="height: 30px; width: 70px">Load</button> |
| 553 <button onclick="smartRegexEmpty()" style="height: 30px; width: 70px">Clear</button></br> | 551 <button onclick="smartRegexEmpty()" style="height: 30px; width: 70px">Clear</button></br> |
| 554 | |
| 555 <!-- | 552 <!-- |
| 556 <button id="example" type="button" class="btn btn-sm btn-default" data-toggle="popover">Load</button> | 553 <button id="example" type="button" class="btn btn-sm btn-default" data-toggle="popover">Load</button> |
| 557 --> | 554 --> |
| 558 | |
| 559 </fieldset> | 555 </fieldset> |
| 560 | 556 |
| 561 <fieldset> | 557 <fieldset> |
| 562 <legend><h4 class="text-success"> Tag by rule:</h4></legend> | 558 <legend><h5 class="text-success"> Tag by rule:</h5></legend> |
| 563 <button onclick="tagNameWithLastName()" style="height: 30px; width: 220px">Tag Word Begin With Surname</button></br> | 559 <button onclick="tagNameWithLastName()" style="height: 30px; width: 220px">Tag Word Begin With Surname</button></br> |
| 564 <button onclick="tagNameWithLastName2()" style="height: 30px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br> | 560 <button onclick="tagNameWithLastName2()" style="height: 30px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br> |
| 565 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>--> | 561 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>--> |
| 566 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>--> | 562 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>--> |
| 567 <button onclick="Undo()" style="height: 30px; width: 220px" id="buttonUndo" disabled="true">Undo</button> | 563 <button onclick="Undo()" style="height: 30px; width: 220px" id="buttonUndo" disabled="true">Undo</button> |
| 568 </fieldset> | 564 </fieldset> |
| 569 | 565 |
| 570 <fieldset> | 566 <fieldset> |
| 571 <legend><h4 class="text-success"> Edit:</h4></legend> | 567 <legend><h5 class="text-success"> Edit:</h5></legend> |
| 572 <button onclick="saveTextToLGService()" style="height: 30px; width: 220px">Save to LGService</button></br> | 568 <button onclick="saveTextToLGService()" style="height: 30px; width: 220px">Save to LGService</button></br> |
| 573 | 569 |
| 574 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> | 570 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> |
| 575 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> | 571 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> |
| 576 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br> | 572 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br> |
| 578 <button onclick="window.open('./EditWordlist')" style="height: 30px; width: 220px">Manage Word List</button></br> | 574 <button onclick="window.open('./EditWordlist')" style="height: 30px; width: 220px">Manage Word List</button></br> |
| 579 <button onclick="window.open('./EditTaglist')" style="height: 30px; width: 220px">Manage Tag List</button></br> | 575 <button onclick="window.open('./EditTaglist')" style="height: 30px; width: 220px">Manage Tag List</button></br> |
| 580 </fieldset> | 576 </fieldset> |
| 581 | 577 |
| 582 <fieldset> | 578 <fieldset> |
| 583 <legend><h4 class="text-success"> Export:</h4></legend> | 579 <legend><h5 class="text-success"> Export:</h5></legend> |
| 584 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> | 580 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> |
| 585 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> | 581 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> |
| 586 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br> | 582 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br> |
| 587 </fieldset> | 583 </fieldset> |
| 588 | 584 |
| 589 <fieldset> | 585 <fieldset> |
| 590 <legend><h4 class="text-success"> Replace By <i><b>Regex</b></i>: </h4></legend> | 586 <legend><h5 class="text-success"> Replace By <i><b>Regex</b></i>: </h5></legend> |
| 591 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> | 587 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> |
| 592 Regex: <input type="text" size="30" id="regexText"></br> | 588 Regex: <input type="text" size="30" id="regexText"></br> |
| 593 Replace: <input type="text" size="30" id="replaceText"><br> | 589 Replace: <input type="text" size="30" id="replaceText"><br> |
| 594 <button onclick="replaceSmartRegex()">Replace!</button> | 590 <button onclick="replaceSmartRegex()">Replace!</button> |
| 595 </fieldset> | 591 </fieldset> |
| 596 </form> | 592 </form> |
| 597 </div> | 593 </div> |
| 598 </div> | 594 </div> |
| 595 | |
| 596 <div class="row" style="margin-top:30px;"> | |
| 597 <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"> | |
| 598 <?php echo $stringInput; ?> | |
| 599 </div> | |
| 600 </div> | |
| 599 | 601 |
| 600 </div> | 602 </div> |
| 601 | 603 |
| 602 | 604 |
| 603 <table width="1250" border="1"> | |
| 604 <tr> | |
| 605 <td width="980"> | |
| 606 <div id="editable-area" class="area" style="max-width: 980"><?php echo $stringInput; ?></div> | |
| 607 </td> | |
| 608 <td width="270" valign="top"> | |
| 609 <div id="follow-scroll" style="position:absolute; width: 220" width="220"> | |
| 610 <div id="load_regex_div" style="position: absolute; display: none"></div> | |
| 611 <div id="load_topic_div" style="position: absolute; display: none"></div> | |
| 612 <div id="smartRegexPopUpDiv" style="position: absolute; display: none"> | |
| 613 Name: <input id="smartRegexPopUpName"></input><br><br> | |
| 614 Word List: | |
| 615 <select id="smartRegexPopUpSelectWord"> | |
| 616 <option value="NULL" selected>無</option> | |
| 617 <?php | |
| 618 foreach ( $wordlistArray as $wordlistValue ) { | |
| 619 echo "<option value=\"".$wordlistValue[0]."\">".$wordlistValue[1]."</option>\n"; | |
| 620 } | |
| 621 ?> | |
| 622 </select> | |
| 623 <br> | |
| 624 OR (USE "|" TO SEPARATE WORDS):<br> | |
| 625 <TEXTAREA id="smartRegexPopUpText" COLS=30 ROWS=4></TEXTAREA><br><br> | |
| 626 Tag: | |
| 627 <select id="smartRegexPopUpSelectTag"> | |
| 628 <?php | |
| 629 foreach ( $taglistArray as $taglistValue ) { | |
| 630 echo "<option value=\"".$taglistValue[2]."\">".$taglistValue[1]."</option>\n"; | |
| 631 } | |
| 632 echo "<option value=\"title\">Title</option>\n"; | |
| 633 ?> | |
| 634 <option value="NOTAG">不標記</option> | |
| 635 </select><br> | |
| 636 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" style="height: 30px; width: 50px">Add</button> | |
| 637 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" style="height: 30px; width: 50px">Edit</button> | |
| 638 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" style="height: 30px; width: 50px">Delete</button> | |
| 639 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" style="height: 30px; width: 50px"><<</button> | |
| 640 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" style="height: 30px; width: 50px">>></button> | |
| 641 <button onclick="replaceSmartClose()" style="height: 30px; width: 50px">Close</button> | |
| 642 </div> | |
| 643 <form action="javascript:void(0);"> | |
| 644 <button onclick="chooseTopic(<?php echo $default_topic_id; ?>)">Choose Topic</button> | |
| 645 <button onclick="configTagsInTopic(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Config Tag List for Topic</button></br> | |
| 646 <fieldset> | |
| 647 <legend>Replace By <i><b>Smart Regex</b></i>©:</legend> | |
| 648 <div id="smartRegexShowDiv"></div><br> | |
| 649 <button onclick="smartRegexNew()" style="height: 30px; width: 220px">Add Regex Group</button></br> | |
| 650 Range: <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> | |
| 651 <button onclick="replaceSmartRun()" style="height: 30px; width: 220px">Run</button></br> | |
| 652 <button onclick="replaceSmartRunSpace()" style="height: 30px; width: 220px">Run(Allow space between Group)</button></br> | |
| 653 <button onclick="smartRegexSave()" style="height: 30px; width: 70px">Save</button> | |
| 654 <button onclick="smartRegexLoad()" style="height: 30px; width: 70px">Load</button> | |
| 655 <button onclick="smartRegexEmpty()" style="height: 30px; width: 70px">Clear</button></br> | |
| 656 </fieldset> | |
| 657 | |
| 658 <fieldset> | |
| 659 <legend>Tag by rule:</legend> | |
| 660 <button onclick="tagNameWithLastName()" style="height: 30px; width: 220px">Tag Word Begin With Surname</button></br> | |
| 661 <button onclick="tagNameWithLastName2()" style="height: 30px; width: 170px">Tag Word Begin With</button><input type="text" size="2" id="surname"></br> | |
| 662 <!--<button onclick="tagTime()" style="height: 30px; width: 220px">Tag Time</button></br>--> | |
| 663 <!--<button onclick="tagBiogAddr()" style="height: 30px; width: 220px">Tag BiogAddr</button></br>--> | |
| 664 <button onclick="Undo()" style="height: 30px; width: 220px" id="buttonUndo" disabled="true">Undo</button> | |
| 665 </fieldset> | |
| 666 | |
| 667 <fieldset> | |
| 668 <legend>Edit:</legend> | |
| 669 <button onclick="saveTextToLGService()" style="height: 30px; width: 220px">Save to LGService</button></br> | |
| 670 | |
| 671 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> | |
| 672 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> | |
| 673 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br> | |
| 674 </br> | |
| 675 <button onclick="window.open('./EditWordlist')" style="height: 30px; width: 220px">Manage Word List</button></br> | |
| 676 <button onclick="window.open('./EditTaglist')" style="height: 30px; width: 220px">Manage Tag List</button></br> | |
| 677 </fieldset> | |
| 678 | |
| 679 <fieldset> | |
| 680 <legend>Export:</legend> | |
| 681 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> | |
| 682 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> | |
| 683 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br> | |
| 684 </fieldset> | |
| 685 | |
| 686 <fieldset> | |
| 687 <legend>Replace By <i><b>Regex</b></i>:</legend> | |
| 688 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> | |
| 689 Regex: <input type="text" size="30" id="regexText"></br> | |
| 690 Replace: <input type="text" size="30" id="replaceText"><br> | |
| 691 <button onclick="replaceSmartRegex()">Replace!</button> | |
| 692 </fieldset> | |
| 693 </form> | |
| 694 </div> | |
| 695 </td> | |
| 696 </tr> | |
| 697 </table> | |
| 698 | |
| 699 | |
| 700 | |
| 701 </body> | 605 </body> |
| 702 | 606 |
| 703 </html> | 607 </html> |
