changeset 70:359f48d58cbc extractapp

New: hover on regex elem
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 08 Apr 2015 14:22:44 +0200
parents edb8a2e8ce84
children 26d8c4c43d86
files js/taggingtext.js models/extractapp.php views/Extractapp/TaggingText.php
diffstat 3 files changed, 47 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/js/taggingtext.js	Tue Apr 07 16:12:23 2015 +0200
+++ b/js/taggingtext.js	Wed Apr 08 14:22:44 2015 +0200
@@ -440,6 +440,9 @@
 }
 
 function replaceSmartClose() {
+    $('#smartRegexShowDiv > span').css("border","1px solid black");
+
+
     $('#smartRegexPopUpDiv').css("display", "none");
     $("#smartRegexPopUpSelectWord").val("NULL");
     $("#smartRegexPopUpText").val("");
@@ -509,6 +512,8 @@
 
 $(document).on("click", '#smartRegexShowDiv > span', function (e) {
     
+    
+
     $('#smartRegexPopUpDiv').css("display", "block");
     
     $('#smartRegexPopUpDiv').attr("editID", $(this).attr("id"));
@@ -791,8 +796,9 @@
 function loadRegexAdd() {
     RegexLoadedName = $('#loadRegexSelect').val();
     var divName = "#div_"+RegexLoadedName;
-    var name = $(divName).html();
-    $('#smartRegexShowDiv').html(name);
+    var regex_content = $(divName).html();
+
+    $('#smartRegexShowDiv').html(regex_content);
     $('#load_regex_div').css("display", "none");
 
     // get the largest regex element index in the regex file
@@ -804,9 +810,45 @@
         if (r_id > max_id) {
             max_id = r_id;
         }
+
     }
     regex_element_index = max_id;
+
+
+    // hover on #smartRegexShowDiv > span, change border width
+    $("#smartRegexShowDiv > span").hover( function() {
+        // hover in
+        $(this).css("border","3px solid black");
+        }, function() {
+        // hover out
+        // TODO: if this is clicked...
+        $(this).css("border","1px solid black");
+    });
+    
+    /*
+    // TODO: click
+    $("#smartRegexShowDiv > span").click( function() {
+        $(this).css("border","3px double black");
+        console.log("Debug: clicked");
+    });
+
+
+    $('#smartRegexShowDiv > span').on({
+        mouseover: function(){
+            $(this).css("border","3px solid black");
+        },
+        mouseleave: function(){
+            $(this).css("border","1px solid black");
+        },
+        click: function(){
+            $(this).off('mouseleave');
+        }
+    });
+    */
 }
+
+
+
 // ===
 
 
--- a/models/extractapp.php	Tue Apr 07 16:12:23 2015 +0200
+++ b/models/extractapp.php	Wed Apr 08 14:22:44 2015 +0200
@@ -311,7 +311,6 @@
         // book meta data
         $book = $this->book_meta;
         foreach ($book as $b) {
-           
             $text .= "<book>\n";
             $text .= "<id>".$b[0]."</id>\n";
             $text .= "<name>".$b[1]."</name>\n";
@@ -1147,7 +1146,7 @@
         $book_metaArray = array();
         foreach ($book_meta as $row) {
             array_push($book_metaArray, array((string)$row->id,(string)$row->name,(string)$row->level1,(string)$row->level2,
-                (string)$row->period,(string)$row->dynasty,$row->start_year,$row->end_year,$row->line,
+                (string)$row->period,(string)$row->dynasty,(string)$row->start_year,(string)$row->end_year,(string)$row->line,
                 (string)$row->volume,(string)$row->author,(string)$row->edition,(string)$row->in_jibengujiku,(string)$row->admin_type ));
         }
         if ($book_metaArray) {
--- a/views/Extractapp/TaggingText.php	Tue Apr 07 16:12:23 2015 +0200
+++ b/views/Extractapp/TaggingText.php	Wed Apr 08 14:22:44 2015 +0200
@@ -205,9 +205,10 @@
 
         // TOOD: ask user to modify/decide tags
         // showing taglist_infile and taglistArray
-        alert("taglist is deprecated in the current file.");
+        alert("Warning: taglist is deprecated in the current file.");
 
     }
+   
 
 });