Mercurial > hg > extraction-interface
changeset 103:2cc65ff46174 extractapp
minor fixed
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 25 Jul 2016 17:10:16 +0200 |
parents | 6ba742b712b0 |
children | e542b161d907 |
files | config/config.php css/taggingtext.css data/regex_files/product_name_started_with_space.txt js/taggingtext.js views/Extractapp/EditTaglist.php views/Extractapp/TaggingText.php |
diffstat | 6 files changed, 52 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/config/config.php Wed May 25 11:29:28 2016 +0200 +++ b/config/config.php Mon Jul 25 17:10:16 2016 +0200 @@ -24,7 +24,7 @@ $mysql_server = "localhost"; $mysql_user = "root"; $mysql_password = "admin"; - $server_host = "http://localgazetteers.mpiwg-berlin.mpg.de/"; + $server_host = "http://localgazetteers-test.mpiwg-berlin.mpg.de/"; $lgserver_url = $server_host."LGServices/"; } else {
--- a/css/taggingtext.css Wed May 25 11:29:28 2016 +0200 +++ b/css/taggingtext.css Mon Jul 25 17:10:16 2016 +0200 @@ -143,3 +143,18 @@ .editable { cursor: hand; } + + +#loading{ + position:fixed; + z-index:2000; + background:rgba(0,0,0,0.5); + color:#fff; + width:100vw; + height:100vh; + padding:300px 0; + text-align:center; + vertical-align:middle; + font-size:20px; + line-height:20px; +}
--- a/data/regex_files/product_name_started_with_space.txt Wed May 25 11:29:28 2016 +0200 +++ b/data/regex_files/product_name_started_with_space.txt Mon Jul 25 17:10:16 2016 +0200 @@ -1,1 +1,1 @@ -<span regexreplace="NOTAG" regextext="○" id="regex_elem_1" class="span_NOTAG" style="border: 1px solid black; width: 100px;">空白</span><span class="span_product_name" id="regex_elem_2" regextext="[^○如即而之有<>〈〉【】]{1,3}" regexreplace="product_name" style="border: 1px solid black; width: 100px;">物產名</span><span class="span_NOTAG" id="regex_elem_3" regextext="○" regexreplace="NOTAG" style="border: 1px solid black; width: 100px;">空白</span> \ No newline at end of file +<span regexreplace="NOTAG" regextext="○" id="regex_elem_1" class="span_NOTAG" style="border: 1px solid black; width: 100px;">空白</span><span class="span_product_name" id="regex_elem_2" regextext="[^○如即而之有<>〈〉【】]{1,3}" regexreplace="product_name" style="border: 1px solid black; width: 100px;">物產</span><span class="span_NOTAG" id="regex_elem_3" regextext="○" regexreplace="NOTAG" style="border: 1px solid black; width: 100px;">空白</span> \ No newline at end of file
--- a/js/taggingtext.js Wed May 25 11:29:28 2016 +0200 +++ b/js/taggingtext.js Mon Jul 25 17:10:16 2016 +0200 @@ -208,6 +208,8 @@ } function Undo() { + $("#loading").show(); + if ( stringBeforeChangeStack.length > 0 ) { var el = document.getElementById("editable-area"); el.innerHTML = stringBeforeChangeStack.pop(); @@ -215,6 +217,8 @@ var el = document.getElementById("buttonUndo"); el.disabled = true; } + + $("#loading").hide(); } function saveUndoText() { @@ -431,6 +435,8 @@ } function tagStringWithTag( stringValue, tag ) { + $('#loading').show(); + saveUndoText(); var el = document.getElementById("editable-area"); @@ -450,6 +456,8 @@ $('.tagItemDivClass').remove(); alert( "Tagged "+str.match(new RegExp(regexText, "g")).length+" entities!" ); el.innerHTML = str.replace(new RegExp(regexText, "g"), replaceText); + + $('#loading').hide(); } @@ -946,6 +954,8 @@ function replaceSmartRunWithBr() { + $("#loading").show(); + var replaceSmartRegexString = ""; var replaceSmartReplaceString = ""; var count=1; @@ -991,10 +1001,15 @@ str="" + el.innerHTML; el.innerHTML = str.replace(new RegExp(regexText, "g"), resultString); } + + $("#loading").hide(); + } function replaceSmartRun() { + $("#loading").show(); + var replaceSmartRegexString = ""; var replaceSmartReplaceString = ""; var count=1; @@ -1039,9 +1054,13 @@ str="" + el.innerHTML; el.innerHTML = str.replace(new RegExp(regexText, "g"), resultString); } + + $("#loading").hide(); } function replaceSmartRunSpace() { + + $("#loading").show(); var replaceSmartRegexString = ""; var replaceSmartReplaceString = ""; @@ -1085,6 +1104,8 @@ //alert( "Tagged "+str.match(new RegExp(replaceSmartRegexString, "g")).length+" entities!" ); //el.innerHTML = str.replace(new RegExp(replaceSmartRegexString, "g"), replaceSmartReplaceString); + + $("#loading").hide(); } function smartRegexSave(topic_id) {
--- a/views/Extractapp/EditTaglist.php Wed May 25 11:29:28 2016 +0200 +++ b/views/Extractapp/EditTaglist.php Mon Jul 25 17:10:16 2016 +0200 @@ -407,10 +407,12 @@ if ( $("#input"+this.id).length > 0 ) { return; } - var topic_tag_id = JSON.parse('<?php echo json_encode($topic_tag_id) ?>'); + /* if (this.id == "tdName"+topic_tag_id || this.id == "tdNameID") { return; } + */ + //var startPageValue = this.innerHTML; var startPageValue = this.textContent; this.innerHTML="";
--- a/views/Extractapp/TaggingText.php Wed May 25 11:29:28 2016 +0200 +++ b/views/Extractapp/TaggingText.php Mon Jul 25 17:10:16 2016 +0200 @@ -218,6 +218,9 @@ */ $(document).ready(function(){ + + $("#loading").hide(); + // --- for sidebar--- //run once var el=$('#follow-scroll'); @@ -271,7 +274,7 @@ var info = JSON.parse('<?php echo json_encode($info) ?>'); // 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 - $( "#save_text_to_LGService_id").text( "Create(Save) Branch to LGService" ); + $( "#save_text_to_LGService_id").text( "Create(Save) Task to LGService" ); } handleFileVersionConflict(); @@ -902,6 +905,8 @@ function tagwithOnlytag( range, selection, tag ) { + $('#loading').show(); + saveUndoText(); var topic_tag = JSON.parse('<?php echo json_encode($topic_tag) ?>'); var topic_tag2 = topic_tag+"2"; @@ -936,6 +941,8 @@ $('.tagItemDivClass').remove(); + + $('#loading').hide(); } function tagwithOnlytag_old( range, stringSelection, tag ) { @@ -960,6 +967,7 @@ $('.tagItemDivClass').remove(); + } function replaceSmartRegex() { @@ -1039,7 +1047,7 @@ } - var label = prompt("Please enter your label for this new branch", default_label); + var label = prompt("Please enter your label for this new task", default_label); while (label == null) { alert("You haven't saved your editing."); return; @@ -1372,6 +1380,7 @@ </fieldset> --> +<div id="loading">...</div> <div class="info-board"> <div class="bg-danger"><strong><?php echo $messages['error']; ?> </strong></div> @@ -1384,7 +1393,6 @@ --> </div> - <table border="1" style="margin:10 30 30 30; width:100%; max-width:1270px; min-width:680px"> <tr> <td style="padding:0 5 0 5; margin: 0 5 0 5;">