diff views/Extractapp/TaggingText.php @ 54:f9e7119339b2 extractapp

bug fixed: when addTagTitle, removing self-closing tag which causes error in coloring tag
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 30 Mar 2015 15:34:47 +0200
parents 840cdb52f476
children 5cf9720a2e25
line wrap: on
line diff
--- a/views/Extractapp/TaggingText.php	Thu Mar 26 17:25:46 2015 +0100
+++ b/views/Extractapp/TaggingText.php	Mon Mar 30 15:34:47 2015 +0200
@@ -281,7 +281,8 @@
    
     if ( $("#editTextId").html() != "Edit the text" ) return 0;
     var selection = getSelected();
-    range = getSelected().getRangeAt(0);
+
+    range = selection.getRangeAt(0);
     
     container = document.createElement("div");
     container.appendChild(selection.getRangeAt(0).cloneContents());
@@ -300,9 +301,7 @@
         if ( container.innerHTML.indexOf( "br" ) != -1 ) {
             var newselect = document.createElement("select");
             newselect.id = "TitletagType";
-            
-
-            console.log(JSON.parse('<?php echo json_encode($taglistArray) ?>'));
+            //console.log(JSON.parse('<?php echo json_encode($taglistArray) ?>'));
 
             <?php 
                 foreach ( $taglistArray as $taglistValue ) {
@@ -321,7 +320,6 @@
                 newdiv.innerHTML += "<input id=\"TitletagName\" value=\"\"></br>";
             }
 
-            console.log(" container innerHTML: "+ container.innerHTML );
 
             newdiv.innerHTML += "<button onclick=\"addTagTitle( range, container )\">Add Title Tag To Each Line</button></br>";
             
@@ -396,6 +394,7 @@
         $('#TitletagType').val(lastAddTag);
 
     }
+
     //e.stopPropagation();
 });
 
@@ -670,6 +669,7 @@
 
 function saveTextToLGService() {
 
+    // -------------
     var info = JSON.parse('<?php echo json_encode($info) ?>');
     var topic_id = JSON.parse('<?php echo json_encode($default_topic_id) ?>');
 
@@ -687,7 +687,7 @@
         if(mm<10) {
             mm='0'+mm
         } 
-        today = dd+'/'+mm+'/'+yyyy;
+        today = dd+'.'+mm+'.'+yyyy;
         var label = prompt("Please enter your label for this new branch", today);
         while (label == null) {
             alert("You haven't saved your editing.");