# HG changeset patch # User Zoe Hong # Date 1427967909 -7200 # Node ID f9ae94a9b04100ac67f15cf837007fd573883e61 # Parent ca6bf3532830a77d50fab06b80d6ab2459241949 New: adding topic names: name_en, name_ch, name_pinyin diff -r ca6bf3532830 -r f9ae94a9b041 css/taggingtext.css --- a/css/taggingtext.css Wed Apr 01 15:13:37 2015 +0200 +++ b/css/taggingtext.css Thu Apr 02 11:45:09 2015 +0200 @@ -18,6 +18,8 @@ .info-board{ margin:10 30 10 30; + border: 2px solid #A1A1A1; + border-radius: 4px; max-width:1270; height:70px; overflow:scroll; diff -r ca6bf3532830 -r f9ae94a9b041 js/taggingtext.js --- a/js/taggingtext.js Wed Apr 01 15:13:37 2015 +0200 +++ b/js/taggingtext.js Thu Apr 02 11:45:09 2015 +0200 @@ -208,8 +208,8 @@ newdiv.id = "questionMarkId"; newdiv.setAttribute("class", "questionMarkClass"); - // set z-index to 4 to bring popup tag windwo to front - newdiv.style.cssText = 'top:'+eventObject.pageY+'; left:'+eventObject.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px; z-index:4'; + // set z-index to 3 to bring popup tag windwo to front + newdiv.style.cssText = 'top:'+eventObject.pageY+'; left:'+eventObject.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px; z-index:3'; newdiv.innerHTML = "Tag: "+tagName+"
Value: "+tagObject.text()+"
"; var newbutton = $('').mouseup(function (e2) { diff -r ca6bf3532830 -r f9ae94a9b041 models/extractapp.php --- a/models/extractapp.php Wed Apr 01 15:13:37 2015 +0200 +++ b/models/extractapp.php Thu Apr 02 11:45:09 2015 +0200 @@ -316,7 +316,7 @@ // text_content $text .= $text_content; - $text .= "\n"; + $text .= ""; return $text; } @@ -350,7 +350,7 @@ if ($_postdata['branchId'] == 0) { // -- new branch case - $require = "\n".$require."\n"; + $require = "".$require."\n"; } $require = $this->AppendMetaData($require); @@ -739,7 +739,9 @@ $topic = $postdata['topic']; $result = $this->GetTopicByID($topic); $row = mysql_fetch_assoc($result); - $topic_name = $row['name']; + $topic_name_en = $row['name_en']; + $topic_name_ch = $row['name_ch']; + $topic_name_pinyin = $row['name_pinyin']; /* $query = "SELECT taglist.*, topic_tag_relation.topic_id FROM taglist LEFT JOIN topic_tag_relation ON taglist.id = topic_tag_relation.tag_id ORDER BY `topic_id`"; @@ -813,7 +815,7 @@ $data = array(); //$data['taglistArray'] = $taglistArray; $data['topic'] = $topic; - $data['topic_name'] = $topic_name; + $data['topic_name'] = array('name_en'=>$topic_name_en,'name_ch'=>$topic_name_ch,'name_pinyin'=>$topic_name_pinyin); $data['tag_intopic'] = $tag_intopic; $data['tag_others'] = $tag_others; @@ -964,7 +966,8 @@ $topiclistArray = array(); $result = $this->GetTopiclist(); while ($row = mysql_fetch_assoc($result)) { - array_push($topiclistArray, array('id'=>$row['id'],'name'=>$row['name'],'tag'=>$row['tag'])); + //array_push($topiclistArray, array('id'=>$row['id'],'name'=>$row['name'],'tag'=>$row['tag'])); + array_push($topiclistArray, array('id'=>$row['id'],'tag'=>$row['tag'],'name_en'=>$row['name_en'],'name_ch'=>$row['name_ch'],'name_pinyin'=>$row['name_pinyin'],)); } return $topiclistArray; } @@ -980,7 +983,8 @@ private function GetTopicName($topic_id) { $result = $this->GetTopicByID($topic_id); $row = mysql_fetch_assoc($result); - $name = $row['name']; + //$name = $row['name']; + $name = array('name_en'=>$row['name_en'], 'name_ch'=>$row['name_ch'], 'name_pinyin'=>$row['name_pinyin']); return $name; } diff -r ca6bf3532830 -r f9ae94a9b041 views/Extractapp/ConfigTagsInTopic.php --- a/views/Extractapp/ConfigTagsInTopic.php Wed Apr 01 15:13:37 2015 +0200 +++ b/views/Extractapp/ConfigTagsInTopic.php Thu Apr 02 11:45:09 2015 +0200 @@ -2,7 +2,7 @@ // --- initialize --- //$taglistArray = $viewmodel['taglistArray']; $topic = $viewmodel['topic']; -$topic_name = $viewmodel['topic_name']; +$topic_name = $viewmodel['topic_name']; // array of names $tag_intopic = $viewmodel['tag_intopic']; $tag_others = $viewmodel['tag_others']; @@ -88,7 +88,7 @@
-

Topic:

+

Topic: (, )

diff -r ca6bf3532830 -r f9ae94a9b041 views/Extractapp/TaggingText.php --- a/views/Extractapp/TaggingText.php Wed Apr 01 15:13:37 2015 +0200 +++ b/views/Extractapp/TaggingText.php Thu Apr 02 11:45:09 2015 +0200 @@ -6,7 +6,7 @@ $section_id = $viewmodel['section_id']; $topiclistArray = $viewmodel['topiclistArray']; $default_topic_id = $viewmodel['default_topic_id']; -$topic_name = $viewmodel['topic_name']; +$topic_name = $viewmodel['topic_name']; // array of names $topic_tag = $viewmodel['topic_tag']; $info = $viewmodel['info']; $messages = $viewmodel['messages']; @@ -236,10 +236,8 @@ var newdiv = document.createElement("div"); newdiv.id = "tagItemDivId"; newdiv.setAttribute("class", "tagItemDivClass"); - newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px'; + newdiv.style.cssText = 'top:'+e.pageY+'; left:'+e.pageX+'; position:absolute; background-color: white; border:1px solid black; padding: 5px; z-index:4'; - newdiv.style.backgroundColor = "white"; - newdiv.style.zIndex = "3"; //console.log(selection.getRangeAt(0).cloneContents()); if ( container.innerHTML.indexOf( "br" ) != -1 ) { @@ -671,10 +669,10 @@ $('#load_topic_div').css("border", "1px solid black"); $('#load_topic_div').css("background-color", "White"); - $('#load_topic_div').css("width", "150px"); + $('#load_topic_div').css("width", "200px"); $('#load_topic_div').css("height", "50px"); $('#load_topic_div').css("top", "20px"); - $('#load_topic_div').css("left", "-150px"); + $('#load_topic_div').css("left", "-200px"); var topic_select = document.createElement("select"); @@ -709,10 +707,10 @@ //Create and append the options for (var i = 0; i < t.length; i++) { - console.log(t[i]['id']+","+t[i]['name']); + console.log(t[i]['id']+","+t[i]['name_ch']+","+t[i]['name_pinyin']+","+t[i]['name_en']); var option = document.createElement("option"); option.value = t[i]['id']; - option.text = t[i]['name']; + option.text = t[i]['name_en']+" ("+t[i]['name_ch']+", "+t[i]['name_pinyin']+")"; if (option.value == default_topic_id) { option.selected = true; }; @@ -865,15 +863,15 @@
-

-

+

+
-

-

-

+
+
+
-
+
@@ -919,7 +917,8 @@
Config Topic:
-
current topic is +
current topic is:
+ (, )