# HG changeset patch # User Zoe Hong # Date 1426517379 -3600 # Node ID b3ca5d2b4d3f86d985bede0931745fbfa81817a4 # Parent 3d6b8fb7335def24ac0a4f07ed71980d216934c6 bug fix: edit and save regex. But a jquery issue in Chrome diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/classes/basemodel.php --- a/develop/classes/basemodel.php Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/classes/basemodel.php Mon Mar 16 15:49:39 2015 +0100 @@ -34,7 +34,7 @@ die ('Can\'t use foo : ' . mysql_error()); } - $this->topic = 1; // set the default topic to person (人物) + $this->topic = 2; // set the default topic to product_name (物產) } protected function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/data/regex_files/product_name.txt --- a/develop/data/regex_files/product_name.txt Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/data/regex_files/product_name.txt Mon Mar 16 15:49:39 2015 +0100 @@ -1,1 +1,1 @@ - 物產名 \ No newline at end of file +物產 \ No newline at end of file diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/data/regex_files/product_name_started_with_space.txt --- a/develop/data/regex_files/product_name_started_with_space.txt Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/data/regex_files/product_name_started_with_space.txt Mon Mar 16 15:49:39 2015 +0100 @@ -1,1 +1,1 @@ - 空白 物產 空白 \ No newline at end of file + 空白 物產名 空白 \ No newline at end of file diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/data/regex_files/zhishu.txt --- a/develop/data/regex_files/zhishu.txt Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/data/regex_files/zhishu.txt Mon Mar 16 15:49:39 2015 +0100 @@ -1,1 +1,1 @@ - 空白 之屬 \ No newline at end of file +空白某之屬 \ No newline at end of file diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/js/taggingtext.js --- a/develop/js/taggingtext.js Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/js/taggingtext.js Mon Mar 16 15:49:39 2015 +0100 @@ -428,7 +428,10 @@ $('#smartRegexShowDiv > #'+thisObject).attr("class", "span_"+$("#smartRegexPopUpSelectTag").val()); $('#smartRegexShowDiv > #'+thisObject).attr("regexText", $("#smartRegexPopUpText").val()); $('#smartRegexShowDiv > #'+thisObject).attr("regexReplace", $("#smartRegexPopUpSelectTag").val()); -} + // using .text() to modify the change of the name also // not work on chrome? + $('#smartRegexShowDiv > #'+thisObject).text($("#smartRegexPopUpName").val()); // smartRgextPopUpName.val() is the name of this regex + +} function replaceSmartDel() { thisObject = $('#smartRegexPopUpDiv').attr("editID"); @@ -639,8 +642,9 @@ } function smartRegexSave(topic_id) { - console.log(topic_id); + console.log("topic_id"+topic_id); var name=prompt("Please enter this Regex name",RegexLoadedName); + if (name!=null){ $.ajax({ type : 'POST', diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/models/extractapp.php --- a/develop/models/extractapp.php Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/models/extractapp.php Mon Mar 16 15:49:39 2015 +0100 @@ -9,7 +9,7 @@ } protected $section_id = 0, $data_path, $file_id = 0, $current_fileId=0, - $branch_id = 0, $user_id = 0, $lg_text = "", $topic = 0, $taglist_infile = "", $book_meta = ""; + $branch_id = 0, $user_id = 0, $lg_text = "", $topic, $taglist_infile = "", $book_meta = ""; public $messages = ""; private function Initialize($_urlvalues) { @@ -411,7 +411,7 @@ $require = $this->AppendMetaData($require); //saving in my local machine in developing phrase - //file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); + file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); } // ------ @@ -459,7 +459,7 @@ // execute the request // **** commended to DEBUG *** - $output = curl_exec($ch); + //$output = curl_exec($ch); // ***** // output the profile information - includes the header diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/views/Extractapp/TaggingText.php --- a/develop/views/Extractapp/TaggingText.php Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/views/Extractapp/TaggingText.php Mon Mar 16 15:49:39 2015 +0100 @@ -216,7 +216,9 @@ ''); $('body').append(form); $(form).submit(); - } else { + } + + // --- TODO: check if taglist in file is up-to-date --- /* var taglist_infile = JSON.parse(''); @@ -237,18 +239,22 @@ } */ + + var info = JSON.parse(''); + + // the first time to this section. without branch_id and file_id + if (info['file_id'] == 0) { // or info['branch_id'] == 0, means new file + $( "#saveTextToLGService_id").text( "Create(Save) Branch to LGService" ); + } - handleFileVersionConflict(); - /* - - // Popup choosing topic if first time to this section. without branchId - if (info['file_id'] == 0) { // or info['branchId'] == 0, means new file + // Popup choosing topic if first time to this section. without branch_id + if (info['file_id'] == 0) { // or info['branch_id'] == 0, means new file // ask to choose topic $.ajax({ @@ -258,6 +264,8 @@ // alert('choose topic!'); } */ + + }); $(document).on("click", "name", function (e) { @@ -662,21 +670,33 @@ function saveTextToLGService() { + var info = JSON.parse(''); var topic_id = JSON.parse(''); // if this is a new branch, ask for label if (info['branch_id'] == 0) { - var cnt = 0; - var label = prompt("Please enter your label for this new branch", "section"+info['section_id']); - while (label == null && cnt <= 3) { - cnt ++; - label = prompt("Please enter your label for this new branch (not empty)", "section"+info['section_id']); + //var label = prompt("Please enter your label for this new branch", "section"+info['section_id']); + var today = new Date(); + var dd = today.getDate(); + var mm = today.getMonth()+1; //January is 0! + var yyyy = today.getFullYear(); + + if(dd<10) { + dd='0'+dd + } + if(mm<10) { + mm='0'+mm + } + 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."); + return; + // label = prompt("Please enter your label for this new branch (not empty)", "section"+info['section_id']); } }; - - var form = document.createElement("form"); form.setAttribute("method", "post"); form.setAttribute("action", "./TaggingText"); // hand to controller @@ -998,7 +1018,7 @@
- + @@ -1043,7 +1063,8 @@
Edit:
-
+ +
diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/views/maintemplate.php --- a/develop/views/maintemplate.php Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/views/maintemplate.php Mon Mar 16 15:49:39 2015 +0100 @@ -1,7 +1,6 @@ - diff -r 3d6b8fb7335d -r b3ca5d2b4d3f develop/views/maintemplate_local.php --- a/develop/views/maintemplate_local.php Fri Mar 13 14:47:23 2015 +0100 +++ b/develop/views/maintemplate_local.php Mon Mar 16 15:49:39 2015 +0100 @@ -2,7 +2,6 @@ -