# HG changeset patch # User Zoe Hong # Date 1424340447 -3600 # Node ID ac77748bb8136e0d9a4b3bc9485b499db43d5d61 # Parent cc36a20a68ab16660e2e19dc2b741b447cc50956 - Load regex files based on current topic. Only show the regex in this topic. To do that, it needs to lookup a table called 'topic_regex_relation' which has the relation of topic and regex filename in filesystem. - Extractapp UI with some layout modification: button, popup window, responsive (by bootstrap now). It was just for quick prototyping. diff -r cc36a20a68ab -r ac77748bb813 develop/classes/basecontroller.php --- a/develop/classes/basecontroller.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/classes/basecontroller.php Thu Feb 19 11:07:27 2015 +0100 @@ -20,9 +20,20 @@ $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; if ($fullview) { require('views/maintemplate.php'); + require($viewloc); } else { require($viewloc); } } + + protected function ReturnView_localtest($viewmodel, $fullview) { + $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; + if ($fullview) { + require('views/maintemplate_local.php'); + require($viewloc); + } else { + require($viewloc); + } + } } ?> \ No newline at end of file diff -r cc36a20a68ab -r ac77748bb813 develop/classes/basemodel.php --- a/develop/classes/basemodel.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/classes/basemodel.php Thu Feb 19 11:07:27 2015 +0100 @@ -10,6 +10,8 @@ protected $save_to_LGService_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/save"; protected $save_new_to_LGService_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/saveNew"; + + public function __construct() { global $mysql_database, $mysql_server, $mysql_user, $mysql_password, $systemNAME; $this->systemNAME = $systemNAME; diff -r cc36a20a68ab -r ac77748bb813 develop/controllers/extractapp.php --- a/develop/controllers/extractapp.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/controllers/extractapp.php Thu Feb 19 11:07:27 2015 +0100 @@ -20,29 +20,36 @@ switch ($this->postdata['func']) { case 'SaveFullText': $viewmodel->SaveFullText($this->postdata); - $this->ReturnView($viewmodel->StartTagging(), false); + $this->ReturnView($viewmodel->StartTagging(), true); break; case 'SaveFullTextToLGService': - echo "[Z] SaveFullTextToLGService! "; + $viewmodel->messages .= "[Z] SaveFullTextToLGService! "; $viewmodel->GetInfoFromPreviousPage($this->postdata); $response = $viewmodel->SaveFullTextToLGService($this->postdata); $viewmodel->UpdateInfoByResponseFromLGService($response); // update file_id, branch_id, user_id - $this->ReturnView($viewmodel->StartTagging(), false); + $this->ReturnView($viewmodel->StartTagging(), true); + break; + + case 'SmartRegexLoad': + $viewmodel->SmartRegexLoad($this->postdata['topic_id']); + break; + case 'SmartRegexSave': + $viewmodel->SmartRegexSave($this->postdata); break; case 'ContinueTagging': - echo "[Z] (Countinue tagging) "; + $viewmodel->messages .= "[Z] (Countinue tagging) "; if ($this->postdata['topic']) { $viewmodel->SetTopic($this->postdata['topic']); } $viewmodel->GetInfoFromPreviousPage($this->postdata); - $this->ReturnView($viewmodel->StartTagging(), false); + $this->ReturnView($viewmodel->StartTagging(), true); break; + default: // first time visit extraction interface from LGService - // TODO: get the _post data from Jorge's service - echo "[Z] Welcome to Extraction Interface. "; + $viewmodel->messages .= "[Z] Welcome to Extraction Interface. "; if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) { // get text from fileId, from LGService @@ -56,15 +63,15 @@ } else if (is_numeric($this->urlvalues['id'])) { // get text from local file system (for development stage only) $viewmodel->GetTextFromLocal($this->urlvalues['id']); + $this->ReturnView_localtest($viewmodel->StartTagging(), true); + break; } else { - var_dump($this->postdata); - - echo "wrong url!!"; + $viewmodel->messages .= "wrong url!!"; return; } - $this->ReturnView($viewmodel->StartTagging(), false); + $this->ReturnView($viewmodel->StartTagging(), true); break; } @@ -75,7 +82,7 @@ protected function ExportTable() { //$viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; - $this->ReturnView($viewmodel->ExportTable($this->postdata), false); + $this->ReturnView($viewmodel->ExportTable($this->postdata), true); } @@ -84,13 +91,13 @@ $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'AddNewList': - $this->ReturnView($viewmodel->AddNewList($this->postdata), false); + $this->ReturnView($viewmodel->AddNewList($this->postdata), true); break; case 'SaveWordlist': - $this->ReturnView($viewmodel->SaveWordlist($this->postdata), false); + $this->ReturnView($viewmodel->SaveWordlist($this->postdata), true); break; default: // EditWordlist - $this->ReturnView($viewmodel->EditWordlist($this->urlvalues), false); + $this->ReturnView($viewmodel->EditWordlist(), true); break; } } @@ -101,16 +108,16 @@ $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'NewTagElement': - $this->ReturnView($viewmodel->NewTagElement($this->postdata), false); + $this->ReturnView($viewmodel->NewTagElement($this->postdata), true); break; case 'SaveTagElement': - $this->ReturnView($viewmodel->SaveTagElement($this->postdata), false); + $this->ReturnView($viewmodel->SaveTagElement($this->postdata), true); break; case 'DeleteTag': - $this->ReturnView($viewmodel->DeleteTag($this->postdata), false); + $this->ReturnView($viewmodel->DeleteTag($this->postdata), true); break; default: // EditTaglist - $this->ReturnView($viewmodel->EditTaglist($this->urlvalues), false); + $this->ReturnView($viewmodel->EditTaglist(), true); break; } } @@ -124,7 +131,7 @@ break; default: - $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), false); + $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true); break; } } @@ -134,6 +141,8 @@ $this->ReturnView($viewmodel->Test(), true); } + + } diff -r cc36a20a68ab -r ac77748bb813 develop/index.php --- a/develop/index.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/index.php Thu Feb 19 11:07:27 2015 +0100 @@ -1,36 +1,11 @@ - - - - - - - - - - - - - - - - - -CreateController(); $controller->ExecuteAction(); - ?> - - - - \ No newline at end of file diff -r cc36a20a68ab -r ac77748bb813 develop/js/taggingtext.js --- a/develop/js/taggingtext.js Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/js/taggingtext.js Thu Feb 19 11:07:27 2015 +0100 @@ -310,6 +310,8 @@ //document.styleSheets[0].addRule("tag001", "color:green;") } + + //Tagging Items function getSelected() { if(window.getSelection) { @@ -419,8 +421,8 @@ $('#smartRegexPopUpDiv').css("background-color", "White"); $('#smartRegexPopUpDiv').css("width", "400px"); $('#smartRegexPopUpDiv').css("height", "300px"); - $('#smartRegexPopUpDiv').css("top", "100px"); - $('#smartRegexPopUpDiv').css("left", "-200px"); + $('#smartRegexPopUpDiv').css("top", "170px"); + $('#smartRegexPopUpDiv').css("left", "-400px"); $('#smartRegexPopUpDiv').css("border", "1px solid black"); $('#smartRegexPopUpDiv').css("padding", "5px"); @@ -600,21 +602,63 @@ //el.innerHTML = str.replace(new RegExp(replaceSmartRegexString, "g"), replaceSmartReplaceString); } +function smartRegexSave() { + var x; + var name=prompt("Please enter this Regex name",RegexLoadedName); + if (name!=null){ + $.ajax({ + type : 'POST', + url : './TaggingText', + async : false, + data : 'func=SmartRegexSave'+'&text='+encodeURIComponent($('#smartRegexShowDiv').html())+'&filename='+name, + error: function (result) { + alert("Error when saving"); + } + }).done(function(result) { + alert("Saved!"); + }); + } +} -function smartRegexLoad(section_id) { +function smartRegexLoad(topic_id) { $('#load_regex_div').html(""); $('#load_regex_div').css("display", "block"); $('#load_regex_div').css("border", "1px solid black"); $('#load_regex_div').css("background-color", "White"); - $('#load_regex_div').css("width", "200px"); - $('#load_regex_div').css("height", "150px"); + $('#load_regex_div').css("width", "300px"); + $('#load_regex_div').css("height", "70px"); $('#load_regex_div').css("top", "100px"); - $('#load_regex_div').css("left", "-200px"); + $('#load_regex_div').css("left", "-300px"); var newselect = document.createElement("select"); newselect.id = "loadRegexSelect"; + $.ajax({ + type: 'POST', + url: './TaggingText', + dataType: 'json', + data: "func=SmartRegexLoad&topic_id="+topic_id, + //cache: false, + success: function (data) { + $.each(data, function(index, element) { + newselect.innerHTML += "\n"; + //alert(index); + //alert(element); + var newdiv = document.createElement("div"); + $(newdiv).css("display", "none"); + $(newdiv).html(element); + $(newdiv).attr("id", "div_"+index); + $('#load_regex_div').append(newdiv); + }); + + }, + error: function (data) { + console.log("SmartRegexLoad fails"); + } + }); + + /* $.ajax({ type: 'POST', url: '../models/_extractapp_func.php', @@ -639,14 +683,17 @@ } }); + */ $('#load_regex_div').append(newselect); var newbutton = document.createElement("button"); $(newbutton).html("Load"); + $(newbutton).addClass("btn btn-info"); $(newbutton).attr("onclick", "loadRegexAdd()"); $('#load_regex_div').append(newbutton); var newbutton = document.createElement("button"); $(newbutton).html("Close"); + $(newbutton).addClass("btn btn-default"); $(newbutton).attr("onclick", "$('#load_regex_div').css(\"display\", \"none\");"); $('#load_regex_div').append(newbutton); } @@ -806,7 +853,7 @@ function showListContent( id ) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = process; - xhr.open("POST", "../../data/wordlist/"+id+".txt?t=" + Math.random(), true); + xhr.open("POST", "../data/wordlist/"+id+".txt?t=" + Math.random(), true); // TODO: should show the latest wordlist file. eg. id_timestamp.txt, rather than open the original id.txt file @@ -843,5 +890,6 @@ // ============ +// diff -r cc36a20a68ab -r ac77748bb813 develop/models/extractapp.php --- a/develop/models/extractapp.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/models/extractapp.php Thu Feb 19 11:07:27 2015 +0100 @@ -8,7 +8,8 @@ return array("Index Value 1", "Value 2", "Value 3"); } - protected $section_id=0, $data_path, $file_id=0, $branch_id=0, $user_id=0, $lg_text=""; + protected $section_id = 0, $data_path, $file_id = 0, $branch_id = 0, $user_id = 0, $lg_text = ""; + public $messages = ""; private function Initialize($_urlvalues) { $this->SetSectionId($_urlvalues); @@ -61,7 +62,7 @@ public function GetTextFromLocal($_id){ $this->section_id = $_id; - echo "DEBUG: from my local"."
"; + $this->messages .= "DEBUG: from my local"."
"; $this->lg_text = $this->GetSectionContent(); } @@ -157,7 +158,8 @@ $data['topic_tag'] = $this->GetTopicTag($this->GetTopic()); $data['info'] = array('file_id'=>$this->file_id, 'user_id'=>$this->user_id, 'branch_id'=>$this->branch_id, 'section_id'=>$this->section_id); - + $data['messages'] = $this->messages; + return $data; } @@ -191,12 +193,11 @@ $response_file = $response["file"]; $response_branch = $response["branch"]; - $this->file_id = (string)$response_file["id"]; // should updated - echo "file_id: ".$this->file_id; - echo "
"; + $this->file_id = (string)$response_file["id"]; $this->branch_id = (string)$response_branch["id"]; - echo "branch_id: ".$this->branch_id; - echo "
"; + + $this->messages .= "file_id: ".$this->file_id."
"; + $this->messages .= "branch_id: ".$this->branch_id."
"; } public function SaveFullTextToLGService($_postdata) { @@ -225,7 +226,6 @@ file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); } - echo getcwd()."
"; // ------ @@ -250,9 +250,9 @@ //"userId" => $_postdata['userId'], // TODO: change userId when we can query by sectionId from LGService using search "userId" => "12", - // "label" => $_postdata['label'], + "label" => $_postdata['label'], // TODO: ask user for lable - "label" => "label for section ".$_postdata['sectionId'], + //"label" => "label for section ".$_postdata['sectionId'], ); $save_url = $this->save_new_to_LGService_url; } @@ -286,7 +286,68 @@ return $response; } - + + // --- for regex ---- + public function GetRegexFilenameById($topic_id) { + $query = sprintf("SELECT regex_filename FROM `topic_regex_relation` WHERE topic_id=\"%s\"", $topic_id); + $result = mysql_query($query); + if (!$result) { + return json_encode("Failed during selecting topic_regex_relation table."); + } + + $filenames = array(); + while ($row = mysql_fetch_assoc($result)) { + array_push($filenames, $row['regex_filename']); + } + + return $filenames; + } + public function SmartRegexLoad($topic_id) { + + // Load regex file based on current topic. Only shows the regex in this topic -- + $filenames = $this->GetRegexFilenameById($topic_id); + + // Get regex file from filesystem ---- + $data_path = "./data/"; // get the current file path, which is getcwd(), and concatenate with "/data/" + $returnArray = array(); + $files1 = scandir($data_path."regex_files"); + foreach ( $files1 as $file ) { + if ( $file != "." && $file != ".." && $file != ".DS_Store") { + foreach ($filenames as $filename) { + if ($file == $filename) { + $returnArray[preg_replace("/\.txt/", "", $file)] = file_get_contents( $data_path."regex_files/".$file ); + break; + } + } + } + } + echo json_encode($returnArray); + return; + } + + + public function SmartRegexSave($_postdata) { + if ($_postdata['text']){ + /* + $date = date('Y_m_d_H_i_s', time()); + if ( file_exists("regex_files/".$_POST['filename'].".txt") ) { + $oldFile = file_get_contents("regex_files/".$_POST['filename'].".txt"); + file_put_contents("regex_files/".$_POST['filename']."_".$date.".txt", $oldFile); + } + */ + $data_path = "./data/"; // get the current file path, which is getcwd(), and concatenate with "/data/" + + if (get_magic_quotes_gpc()) { + $require = stripslashes($_postdata['text']); + } else { + $require = $_postdata['text']; + } + + file_put_contents( $data_path."regex_files/".$_postdata['filename'].".txt", $require); + } + } + + // === for export table === public function ExportTable($postdata) { // $this->Initialize($urlvalues); @@ -413,7 +474,7 @@ } // === for manage tag list === - public function EditTaglist($urlvalues) { + public function EditTaglist() { // $this->Initialize($urlvalues); $result = $this->GetTaglist(); $taglistArray = array(); @@ -565,7 +626,7 @@ // =========================== // === for manage wordlist === - public function EditWordlist($urlvalues) { + public function EditWordlist() { $result = $this->GetWordlist(); $wordlistArray = array(); while ($row = mysql_fetch_assoc($result)) { @@ -702,9 +763,6 @@ $section_id = $this->GetSectionId(); $section_info = $this->GetSectionInfo(); - var_dump($section_id); - var_dump($section_info); - $bookId = $section_info['bookId']; $startPage = $section_info['startPage']; $endPage = $section_info['endPage']; diff -r cc36a20a68ab -r ac77748bb813 develop/views/Extractapp/edittaglist.php --- a/develop/views/Extractapp/edittaglist.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/views/Extractapp/edittaglist.php Thu Feb 19 11:07:27 2015 +0100 @@ -1,16 +1,17 @@ - - - - - + + + + + diff -r cc36a20a68ab -r ac77748bb813 develop/views/Extractapp/index.php --- a/develop/views/Extractapp/index.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/views/Extractapp/index.php Thu Feb 19 11:07:27 2015 +0100 @@ -1,7 +1,28 @@ -

Extractapp/index.php

+ + + + + - + + + + + + + + + + + + + + + + \ No newline at end of file diff -r cc36a20a68ab -r ac77748bb813 develop/views/Extractapp/taggingtext.php --- a/develop/views/Extractapp/taggingtext.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/views/Extractapp/taggingtext.php Thu Feb 19 11:07:27 2015 +0100 @@ -8,7 +8,8 @@ $default_topic_id = $viewmodel['default_topic_id']; $topic_tag = $viewmodel['topic_tag']; $info = $viewmodel['info']; -var_dump($info); +$messages = $viewmodel['messages']; + ?> @@ -59,7 +60,7 @@ if (_GET['id']) { var info = JSON.parse(''); - var redirectUrl = "http://141.14.239.50:1080/localmonographs/develop/Extractapp/TaggingText"; + var redirectUrl = "http://localhost:1080/localmonographs/develop/Extractapp/TaggingText"; var section_id = info['section_id']; var form = $('
' + @@ -87,6 +88,7 @@ var originalelpos=el.offset().top; // take it where it originally is on the page //run on scroll + /* $(window).scroll(function(){ var el = $('#follow-scroll'); // important! (local) var elpos = el.offset().top; // take current situation @@ -94,6 +96,8 @@ var finaldestination = windowpos+originalelpos; el.stop().animate({'top':finaldestination},500); }); + */ + }); $(document).on("click", "name", function (e) { @@ -246,118 +250,25 @@ } -function smartRegexSave() { - var x; - var name=prompt("Please enter this Regex name",RegexLoadedName); - if (name!=null){ - $.ajax({ - type : 'POST', - url : '../models/_extractapp_func.php', - async : false, - data : 'func=SmartRegexSave'+'&text='+encodeURIComponent($('#smartRegexShowDiv').html())+'&filename='+name - }).done(function(result) { - alert("Saved!"); - }); - } -} -function _postForContineTagging(form) { - - - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "text"); - var el = document.getElementById("editable-area"); - var text = el.innerHTML; - hiddenField.setAttribute("value", text); - form.appendChild(hiddenField); - - var info = JSON.parse( ''); - - if (info) { - // TODO: different field info array based on fileId(branchId) existing or not - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "fileId"); - hiddenField.setAttribute("value", info['file_id']); - form.appendChild(hiddenField); - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "branchId"); - hiddenField.setAttribute("value", info['branch_id']); - form.appendChild(hiddenField); - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "userId"); - hiddenField.setAttribute("value", info['user_id']); - form.appendChild(hiddenField); - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "sectionId"); - hiddenField.setAttribute("value", info['section_id']); - form.appendChild(hiddenField); - - - } - - if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { - document.body.appendChild(form); - form.submit(); - } else { - form.submit(); // works under IE and Chrome, but not FF - } - -} +function saveTextToLGService() { + var info = JSON.parse(''); - - -// === for config tags in topic === -function configTagsInTopic(topic_id) { - var form = document.createElement("form"); - - form.setAttribute("method", "post"); - //form.setAttribute("action", "exportTable.php"); - form.setAttribute("action", "./ConfigTagsInTopic"); // hand to controller - form.setAttribute("target", "_blank"); + // if this is a new branch, ask for label + if (info['branch_id'] == 0) { + var label = prompt("Please enter your label for this new branch", "label for section "+info['section_id']); + while (label == null) { + label = prompt("Please enter your label for this new branch (not empty)", "label for section "+info['section_id']); + } + }; - var hiddenField = document.createElement("input"); - hiddenField.setAttribute("name", "topic"); - hiddenField.setAttribute("value", topic_id); - form.appendChild(hiddenField); - - _postForContineTagging(form); - -} - - -function saveTextToLGService(section_id) { - var info = JSON.parse(''); - - var el = document.getElementById("editable-area"); - - /* - $.ajax({ - url : './TaggingText/'+section_id, - async : false, - type : 'POST', - data : 'func=SaveFullTextToLGService'+'&text='+el.innerHTML+'&fileId='+info['file_id']+'&branchId='+info['branch_id']+'&userId='+info['user_id']+'§ionId='+info['section_id'], - success: function (result) { - console.log(result); - }, - error: function (data) { - console.log("error when saving to LGService!"); - } - }).done(function(result) { - alert("Saved!"); - console.log("result: "+result); - }); - - */ - - - var form = document.createElement("form"); form.setAttribute("method", "post"); - // form.setAttribute("action", "./"); // hand to controller + form.setAttribute("action", "./TaggingText"); // hand to controller - form.setAttribute("action", "./"+info['section_id']); // hand to controller + // form.setAttribute("action", "./"+info['section_id']); // hand to controller form.setAttribute("target", "_self"); var hiddenField = document.createElement("input"); @@ -382,12 +293,17 @@ hiddenField.setAttribute("name", "sectionId"); hiddenField.setAttribute("value", info['section_id']); form.appendChild(hiddenField); + } + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "label"); + hiddenField.setAttribute("value", label); + form.appendChild(hiddenField); var hiddenField = document.createElement("input"); hiddenField.setAttribute("name", "text"); - //var el = document.getElementById("editable-area"); + var el = document.getElementById("editable-area"); //var text = encodeURIComponent(el.innerHTML); var text = el.innerHTML; hiddenField.setAttribute("value", text); @@ -413,12 +329,14 @@ $('#load_topic_div').html(""); $('#load_topic_div').css("display", "block"); + $('#load_topic_div').css("border", "1px solid black"); $('#load_topic_div').css("background-color", "White"); - $('#load_topic_div').css("width", "200px"); + $('#load_topic_div').css("width", "150px"); $('#load_topic_div').css("height", "50px"); $('#load_topic_div').css("top", "20px"); - $('#load_topic_div').css("left", "-200px"); + $('#load_topic_div').css("left", "-150px"); + var topic_select = document.createElement("select"); topic_select.id = "loadTopiclist"; @@ -468,14 +386,76 @@ } $('#load_topic_div').append(topic_select); + var newbutton = document.createElement("button"); $(newbutton).html("Close"); + $(newbutton).addClass("btn btn-default"); $(newbutton).attr("onclick", "$('#load_topic_div').css(\"display\", \"none\");"); $('#load_topic_div').append(newbutton); } +// --- for config tags in topic --- +function _postForContineTagging(form) { + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "text"); + var el = document.getElementById("editable-area"); + var text = el.innerHTML; + hiddenField.setAttribute("value", text); + form.appendChild(hiddenField); + + var info = JSON.parse( ''); + + if (info) { + // TODO: different field info array based on fileId(branchId) existing or not + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "fileId"); + hiddenField.setAttribute("value", info['file_id']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "branchId"); + hiddenField.setAttribute("value", info['branch_id']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "userId"); + hiddenField.setAttribute("value", info['user_id']); + form.appendChild(hiddenField); + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "sectionId"); + hiddenField.setAttribute("value", info['section_id']); + form.appendChild(hiddenField); + + } + + if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { + document.body.appendChild(form); + form.submit(); + } else { + form.submit(); // works under IE and Chrome, but not FF + } + +} + +function configTagsInTopic(topic_id) { + var form = document.createElement("form"); + + form.setAttribute("method", "post"); + //form.setAttribute("action", "exportTable.php"); + form.setAttribute("action", "./ConfigTagsInTopic"); // hand to controller + form.setAttribute("target", "_blank"); + + + var hiddenField = document.createElement("input"); + hiddenField.setAttribute("name", "topic"); + hiddenField.setAttribute("value", topic_id); + form.appendChild(hiddenField); + + _postForContineTagging(form); + +} + + $(document).on("change", '#smartRegexPopUpSelectWord', function (e) { @@ -488,9 +468,138 @@ ?> }); +$(function () { + + $('#example').popover({ + //selector: '.has-popover' + content: function () { + return; + }, + //template: output_content, + title: "Load Regex" + }); +}) + + + +// init for popover used in bootstrap +$(function () { + $('[data-toggle="popover"]').popover() +}) +
+
+
+

+
+
+ +
+
+
+
+ + + + + + +

Config Topic

+ + +
+ +
+

Replace By Smart Regex©:

+

+
+ Range: to
+
+
+ + +
+ + + +
+ +
+

Tag by rule:

+
+
+ + + +
+ +
+

Edit:

+
+ + +
+
+
+
+
+
+ +
+

Export:

+ Page: to
+
+
+
+ +
+

Replace By Regex:

+ Range: to
+ Regex:
+ Replace:
+ +
+ +
+
+ +
+ +
@@ -542,7 +651,7 @@

- +
@@ -557,14 +666,14 @@
Edit: -
+



-
-
+
+
@@ -586,6 +695,9 @@
+ + + diff -r cc36a20a68ab -r ac77748bb813 develop/views/maintemplate.php --- a/develop/views/maintemplate.php Tue Feb 17 15:25:11 2015 +0100 +++ b/develop/views/maintemplate.php Thu Feb 19 11:07:27 2015 +0100 @@ -1,15 +1,28 @@ + + - + + + + + + + + + + + + + + - - + \ No newline at end of file