changeset 93:a05491461199 extractapp

bug fixed: solve the nested tagging issue
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Fri, 02 Oct 2015 12:18:34 +0200
parents f5b0cd4f25b2
children b0cecc104639
files js/taggingtext.js views/Extractapp/TaggingText.php
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/js/taggingtext.js	Mon Sep 14 14:39:03 2015 +0200
+++ b/js/taggingtext.js	Fri Oct 02 12:18:34 2015 +0200
@@ -238,13 +238,13 @@
 
 
 function removeTagNewDiv( eventObject, tagName, tagObject ) {
-    // TODO: nesting tag representaion
+    saveUndoText();
 
-    saveUndoText();
     var newdiv = document.createElement("div");
-    $(newdiv).id = "questionMarkId";
+    //$(newdiv).id = "questionMarkId";    
     $(newdiv).attr("class", "questionMarkClass");
 
+    
     // set z-index to 3 to bring popup tag windwo to front
     newdiv.style.cssText = 'top:'+eventObject.pageY+'; left:'+eventObject.pageX+';';
     
@@ -315,6 +315,8 @@
     newbutton.appendTo(newdiv);
     
     tagObject.append(newdiv);
+
+
 }
 
 function saveText(section_id) {
--- a/views/Extractapp/TaggingText.php	Mon Sep 14 14:39:03 2015 +0200
+++ b/views/Extractapp/TaggingText.php	Fri Oct 02 12:18:34 2015 +0200
@@ -57,6 +57,7 @@
     <meta http-equiv="no-cache">
     <meta http-equiv="Expires" content="-1">
     <meta http-equiv="Cache-Control" content="no-cache">
+
 <style>
 dynasty
 {
@@ -87,7 +88,6 @@
 ?>
 </style>
 
-
 </head>
 
 <body>
@@ -170,20 +170,22 @@
 var taglistArray = JSON.parse('<?php echo json_encode($taglistArray) ?>');
 for (var i = 0; i < taglistArray.length; i++) {
     var taglistValue = taglistArray[i];
-
+    
+  
     $(document).on("click", taglistValue[2], function (e) {
         if ($("#editTextId").html() != "Edit the text") return 0;
         var tagName = $(this).prop("tagName").toLowerCase();
-        /*
-        if ($(this).prop("tagName").toLowerCase() != taglistValue[2]) {
-            return 0;
-        }
-        */
+        //if (tagName != taglistValue[2]) return 0;
+    
         // pop_remove_tag_window is a global variable which indicates if to show the remove-popup-window
         if (pop_remove_tag_window) {
             removeTagNewDiv( e, tagName , $(this));
         };
-    });
+        return false;  
+  });
+  
+
+
 };
 
 /*