comparison develop/views/Extractapp/taggingtext.php @ 13:cc36a20a68ab

automatically decide which rows (what data) should be shown in the exporting table based on the topic.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 17 Feb 2015 15:25:11 +0100
parents e82ca7375e93
children ac77748bb813
comparison
equal deleted inserted replaced
12:e82ca7375e93 13:cc36a20a68ab
52 52
53 <body> 53 <body>
54 54
55 <script type="text/javascript"> 55 <script type="text/javascript">
56 56
57 // === This is only for developing on local machine ====
58 var _GET = JSON.parse('<?php echo json_encode($_GET) ?>');
59 if (_GET['id']) {
60
61 var info = JSON.parse('<?php echo json_encode($info) ?>');
62 var redirectUrl = "http://141.14.239.50:1080/localmonographs/develop/Extractapp/TaggingText";
63 var section_id = info['section_id'];
64
65 var form = $('<form action="' + redirectUrl + '" method="post">' +
66 '<input type="hidden" name="sectionId" value="'+section_id+'" />' +
67 '</form>');
68 $('body').append(form);
69 $(form).submit();
70 }
71 // ====
57 72
58 73
59 <?php 74 <?php
60 foreach ( $taglistArray as $taglistValue ) { 75 foreach ( $taglistArray as $taglistValue ) {
61 echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n"; 76 echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n";
235 var x; 250 var x;
236 var name=prompt("Please enter this Regex name",RegexLoadedName); 251 var name=prompt("Please enter this Regex name",RegexLoadedName);
237 if (name!=null){ 252 if (name!=null){
238 $.ajax({ 253 $.ajax({
239 type : 'POST', 254 type : 'POST',
240 url : '../../models/_extractapp_func.php', 255 url : '../models/_extractapp_func.php',
241 async : false, 256 async : false,
242 data : 'func=SmartRegexSave'+'&text='+encodeURIComponent($('#smartRegexShowDiv').html())+'&filename='+name 257 data : 'func=SmartRegexSave'+'&text='+encodeURIComponent($('#smartRegexShowDiv').html())+'&filename='+name
243 }).done(function(result) { 258 }).done(function(result) {
244 alert("Saved!"); 259 alert("Saved!");
245 }); 260 });
288 } 303 }
289 304
290 } 305 }
291 306
292 307
308
309
293 // === for config tags in topic === 310 // === for config tags in topic ===
294 function configTagsInTopic(topic_id) { 311 function configTagsInTopic(topic_id) {
295 var form = document.createElement("form"); 312 var form = document.createElement("form");
296 313
297 form.setAttribute("method", "post"); 314 form.setAttribute("method", "post");
298 //form.setAttribute("action", "exportTable.php"); 315 //form.setAttribute("action", "exportTable.php");
299 form.setAttribute("action", "../ConfigTagsInTopic"); // hand to controller 316 form.setAttribute("action", "./ConfigTagsInTopic"); // hand to controller
300 form.setAttribute("target", "_blank"); 317 form.setAttribute("target", "_blank");
301 318
302 319
303 var hiddenField = document.createElement("input"); 320 var hiddenField = document.createElement("input");
304 hiddenField.setAttribute("name", "topic"); 321 hiddenField.setAttribute("name", "topic");
416 // var topic_name = selected_topic.text; 433 // var topic_name = selected_topic.text;
417 434
418 435
419 var form = document.createElement("form"); 436 var form = document.createElement("form");
420 form.setAttribute("method", "post"); 437 form.setAttribute("method", "post");
421 form.setAttribute("action", "./"+info['section_id']); // hand to controller 438 form.setAttribute("action", "./TaggingText"); // hand to controller
422 //form.setAttribute("action", "./"+section_id); // hand to controller 439 //form.setAttribute("action", "./"+section_id); // hand to controller
423 form.setAttribute("target", "_self"); 440 form.setAttribute("target", "_self");
424 441
425 var hiddenField = document.createElement("input"); 442 var hiddenField = document.createElement("input");
426 hiddenField.setAttribute("name", "topic"); 443 hiddenField.setAttribute("name", "topic");
544 561
545 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>--> 562 <!--<button onclick="cleanUpTextArea()" style="height: 30px; width: 220px">Reform the text</button></br>-->
546 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> 563 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br>
547 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br> 564 <button onclick="editText()" id="editTextId" style="height: 30px; width: 220px">Edit the text</button></br>
548 </br> 565 </br>
549 <button onclick="window.open('../EditWordlist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Word List</button></br> 566 <button onclick="window.open('./EditWordlist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Word List</button></br>
550 <button onclick="window.open('../EditTaglist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Tag List</button></br> 567 <button onclick="window.open('./EditTaglist/<?php echo $section_id;?>')" style="height: 30px; width: 220px">Manage Tag List</button></br>
551 </fieldset> 568 </fieldset>
552 569
553 <fieldset> 570 <fieldset>
554 <legend>Export:</legend> 571 <legend>Export:</legend>
555 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br> 572 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"><br>
556 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br> 573 <button onclick="exportPage()" style="height: 30px; width: 220px">Export</button></br>
557 <button onclick="exportAll(<?php echo $section_id;?>,<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br> 574 <button onclick="exportAll(<?php echo $default_topic_id;?>)" style="height: 30px; width: 220px">Export All</button></br>
558 </fieldset> 575 </fieldset>
559 576
560 <fieldset> 577 <fieldset>
561 <legend>Replace By <i><b>Regex</b></i>:</legend> 578 <legend>Replace By <i><b>Regex</b></i>:</legend>
562 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br> 579 Range: <input type="text" size="5" id="regexPageStart2">to<input type="text" size="5" id="regexPageEnd2"><br>