diff develop/views/Extractapp/TaggingText.php @ 39:8347776a44fc extractapp

embedded topic, taglist,book metadata in file
author Zoe Hong <zhong@mpiwg-berlin.mpg.de
date Sun, 08 Mar 2015 22:28:21 +0100
parents e078e1500cc2
children 2e938dc046db
line wrap: on
line diff
--- a/develop/views/Extractapp/TaggingText.php	Fri Mar 06 17:56:48 2015 +0100
+++ b/develop/views/Extractapp/TaggingText.php	Sun Mar 08 22:28:21 2015 +0100
@@ -11,6 +11,7 @@
 $info = $viewmodel['info']; 
 $messages = $viewmodel['messages'];
 
+$taglist_infile = $viewmodel['taglist_infile'];
 
 ?>
 
@@ -61,7 +62,7 @@
 if (_GET['id']) {
     
     var info = JSON.parse('<?php echo json_encode($info) ?>');
-    var redirectUrl = "http://localhost:1080/localmonographs/develop/Extractapp/TaggingText";
+    var redirectUrl = "http://localhost:1080/extraction-interface/develop/Extractapp/TaggingText";
     var section_id = info['section_id'];
 
     var form = $('<form action="' + redirectUrl + '" method="post">' +
@@ -71,6 +72,18 @@
         $(form).submit();
 }
 // ====
+// --- check if taglist in file is up-to-date ---
+var check_taglist = JSON.parse('<?php echo json_encode($taglist_infile) ?>');
+if (check_taglist) {
+    // TODO: pop up to ask if load the latest taglist
+    var retVal = confirm("The tag list in the file is not up-to-date. \nDo you want to load file with new tag list?");
+    if( retVal == true ){
+        <?php $$taglistArray = $taglist_infile; ?>
+        alert("Load with new tag list.");
+    }else{
+        alert("You are using the old version of tag list.");
+    }
+}