# HG changeset patch # User Zoe Hong # Date 1470396895 -7200 # Node ID e542b161d907e8303216d399559672a0d49325bb # Parent 2cc65ff4617454517e6499a41de0ca5ac61a792c bug fixed: for only lowercase accepted in html tag. diff -r 2cc65ff46174 -r e542b161d907 controllers/extractapp.php --- a/controllers/extractapp.php Mon Jul 25 17:10:16 2016 +0200 +++ b/controllers/extractapp.php Fri Aug 05 13:34:55 2016 +0200 @@ -82,7 +82,9 @@ $viewmodel->messages['info'] .= "SaveFullTextToLGService! "; $viewmodel->SetInfoFromPreviousPage($this->postdata); $response = $viewmodel->SaveFullTextToLGService($this->postdata); + $viewmodel->UpdateInfoResponsedFromLGService($response); // update file_id, branch_id, user_id + $viewmodel->SetTextFromFileId(); } $this->ReturnView($viewmodel->StartTagging(), true); diff -r 2cc65ff46174 -r e542b161d907 models/extractapp.php --- a/models/extractapp.php Mon Jul 25 17:10:16 2016 +0200 +++ b/models/extractapp.php Fri Aug 05 13:34:55 2016 +0200 @@ -408,6 +408,7 @@ } + public function UpdateInfoResponsedFromLGService($response) { /** * @@ -431,9 +432,11 @@ $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."
"; $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version."; + // TODO shouldnt reload latest file from the LGService... + // pass the orignal text? + $response_currentFile = $response["currentFile"]; $this->current_fileId = (string)$response_currentFile["id"]; - } @@ -1295,7 +1298,14 @@ $result = $this->GetTopicById($topic_id); $row = mysql_fetch_assoc($result); $tag = $row['tag']; - return $tag; + + // TODO need to reconstruct the structure for topic tag considering user may use Uppercase but only lowercase accpetable in html tag that why we store only lowercase in Taglist.tag field in database table. + // Temporate solution is we replace " " with "_" and .lowercase(), which are as the same as we do in LGServices when create a topic and also create the correpsonding topic tag + + $tag = str_replace(' ', '_', $tag); + return strtolower($tag); + + //return $tag; } private function GetTopicName($topic_id) { $result = $this->GetTopicById($topic_id); diff -r 2cc65ff46174 -r e542b161d907 views/Extractapp/EditTaglist.php --- a/views/Extractapp/EditTaglist.php Mon Jul 25 17:10:16 2016 +0200 +++ b/views/Extractapp/EditTaglist.php Fri Aug 05 13:34:55 2016 +0200 @@ -64,7 +64,7 @@ console.log(".englishOnly"); - var englishAlphabet =/[A-Za-z0-9]/g; + var englishAlphabet =/[a-z0-9]/g; var key = String.fromCharCode(event.which); @@ -82,7 +82,7 @@ } - alert("Please type in English characters."); + alert("Please type in (lowercase) English characters."); $(this).val(""); @@ -445,7 +445,7 @@ newTextBox.setAttribute("size","20"); newTextBox.setAttribute("class","englishOnly"); - newTextBox.setAttribute("placeholder","English characters only"); + newTextBox.setAttribute("placeholder","Lowercase English characters only"); this.appendChild(newTextBox).value=startPageValue; diff -r 2cc65ff46174 -r e542b161d907 views/Extractapp/TaggingText.php --- a/views/Extractapp/TaggingText.php Mon Jul 25 17:10:16 2016 +0200 +++ b/views/Extractapp/TaggingText.php Fri Aug 05 13:34:55 2016 +0200 @@ -381,8 +381,13 @@ console.log(selection); + console.log(JSON.parse('')); + + console.log(JSON.parse('')); + ".$taglistValue[1]."\";\n"; @@ -912,8 +917,9 @@ var topic_tag2 = topic_tag+"2"; var documentFragment = range.extractContents(); - + console.log("topic_tag: "+ topic_tag + ", topic_tag2: " + topic_tag2); + var stringSelection = "" var childNodes = documentFragment.childNodes for (var i = 0; i < childNodes.length; i++){ @@ -924,6 +930,11 @@ } } + + + //console.log("stringSelection: " + stringSelection); + + range.deleteContents(); if ( tag==topic_tag2) {