# HG changeset patch # User Zoe Hong # Date 1428495764 -7200 # Node ID 359f48d58cbcdbb715f34bcc6c96bd315d0ce466 # Parent edb8a2e8ce842e1de6541a330d0fff93e5a7a0f9 New: hover on regex elem diff -r edb8a2e8ce84 -r 359f48d58cbc js/taggingtext.js --- 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'); + } + }); + */ } + + + // === diff -r edb8a2e8ce84 -r 359f48d58cbc models/extractapp.php --- 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 .= "\n"; $text .= "".$b[0]."\n"; $text .= "".$b[1]."\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) { diff -r edb8a2e8ce84 -r 359f48d58cbc views/Extractapp/TaggingText.php --- 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."); } + });