Mercurial > hg > extraction-interface
comparison views/Extractapp/TaggingText.php @ 100:8a97db7b9108 extractapp
bug fixed: edit text
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 02 May 2016 15:47:03 +0200 |
parents | c3e149277b58 |
children | a264460c77ca |
comparison
equal
deleted
inserted
replaced
99:c3e149277b58 | 100:8a97db7b9108 |
---|---|
171 for (var i = 0; i < taglistArray.length; i++) { | 171 for (var i = 0; i < taglistArray.length; i++) { |
172 var taglistValue = taglistArray[i]; | 172 var taglistValue = taglistArray[i]; |
173 | 173 |
174 | 174 |
175 $(document).on("click", taglistValue[2], function (e, taglistValue) { | 175 $(document).on("click", taglistValue[2], function (e, taglistValue) { |
176 if ($("#editTextId").html() != "Edit the text") return 0; | 176 if ($("#editTextId").html() != "Edit text") return 0; |
177 var tag = $(this).prop("tagName").toLowerCase(); | 177 var tag = $(this).prop("tagName").toLowerCase(); |
178 //if (tagName != taglistValue[2]) return 0; | 178 //if (tagName != taglistValue[2]) return 0; |
179 | 179 |
180 // pop_remove_tag_window is a global variable which indicates if to show the remove-popup-window | 180 // pop_remove_tag_window is a global variable which indicates if to show the remove-popup-window |
181 if (pop_remove_tag_window) { | 181 if (pop_remove_tag_window) { |
192 /* | 192 /* |
193 <?php | 193 <?php |
194 foreach ( $taglistArray as $taglistValue ) { | 194 foreach ( $taglistArray as $taglistValue ) { |
195 echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n"; | 195 echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n"; |
196 echo "\t".'if ( $(this).prop("tagName").toLowerCase() != "'.$taglistValue[2].'" ) return 0;'."\n"; | 196 echo "\t".'if ( $(this).prop("tagName").toLowerCase() != "'.$taglistValue[2].'" ) return 0;'."\n"; |
197 echo "\t".'if ( $("#editTextId").html() != "Edit the text" ) return 0;'."\n"; | 197 echo "\t".'if ( $("#editTextId").html() != "Edit text" ) return 0;'."\n"; |
198 echo "\tremoveTagNewDiv( e, \"".$taglistValue[2]."\", $(this) );\n"; | 198 echo "\tremoveTagNewDiv( e, \"".$taglistValue[2]."\", $(this) );\n"; |
199 echo "});\n"; | 199 echo "});\n"; |
200 } | 200 } |
201 ?> | 201 ?> |
202 */ | 202 */ |
280 | 280 |
281 $(document).on("mouseup", '#editable-area', function (e) { | 281 $(document).on("mouseup", '#editable-area', function (e) { |
282 $('.questionMarkClass').remove(); | 282 $('.questionMarkClass').remove(); |
283 $('.tagItemDivClass').remove(); | 283 $('.tagItemDivClass').remove(); |
284 | 284 |
285 if ( $("#editTextId").html() != "Edit the text" ) return 0; | 285 if ( $("#editTextId").html() != "Edit text" ) return 0; |
286 | 286 |
287 //var selection = getSelected(); | 287 //var selection = getSelected(); |
288 selection = getSelected(); // selection is a global variable | 288 selection = getSelected(); // selection is a global variable |
289 | 289 |
290 range = selection.getRangeAt(0); // range is a global variable | 290 range = selection.getRangeAt(0); // range is a global variable |
1512 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> | 1512 <button onclick="saveText(<?php echo $section_id; ?>)" style="height: 30px; width: 220px">Save the text</button></br> |
1513 --> | 1513 --> |
1514 <div class="collapse in" id="tool_edit"> | 1514 <div class="collapse in" id="tool_edit"> |
1515 <button onclick="editText()" id="editTextId" class="btn btn-default">Edit text</button> | 1515 <button onclick="editText()" id="editTextId" class="btn btn-default">Edit text</button> |
1516 <button onclick="Undo()" class="btn btn-default" id="buttonUndo" disabled="true">Undo changes</button> | 1516 <button onclick="Undo()" class="btn btn-default" id="buttonUndo" disabled="true">Undo changes</button> |
1517 | 1517 |
1518 | |
1519 <button onclick="saveTextToLGService()" id="save_text_to_LGService_id" class="btn btn-default btn-block">Save to LGService</button> | 1518 <button onclick="saveTextToLGService()" id="save_text_to_LGService_id" class="btn btn-default btn-block">Save to LGService</button> |
1520 <button onclick="exportAll(<?php echo $default_topic_id;?>)" class="btn btn-default btn-block">Export All</button> | 1519 <button onclick="exportAll(<?php echo $default_topic_id;?>)" class="btn btn-default btn-block">Export All</button> |
1521 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"> | 1520 Page: <input type="text" size="5" id="exportPageStart">to<input type="text" size="5" id="exportPageEnd"> |
1522 <button onclick="exportPage(<?php echo $default_topic_id;?>)" class="btn btn-default btn-sm">Export</button></br> | 1521 <button onclick="exportPage(<?php echo $default_topic_id;?>)" class="btn btn-default btn-sm">Export</button></br> |
1523 </div> | 1522 </div> |
1537 <!-- rename "Search by Patterns (Smart Regex)" to "Compile a new Regex"--> | 1536 <!-- rename "Search by Patterns (Smart Regex)" to "Compile a new Regex"--> |
1538 | 1537 |
1539 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" class="btn btn-default">Load</button> | 1538 <button onclick="smartRegexLoad(<?php echo $default_topic_id; ?>)" class="btn btn-default">Load</button> |
1540 <button onclick="smartRegexSave(<?php echo $default_topic_id; ?>)" class="btn btn-default">Save</button> | 1539 <button onclick="smartRegexSave(<?php echo $default_topic_id; ?>)" class="btn btn-default">Save</button> |
1541 <button onclick="smartRegexEmpty()" class="btn btn-default">Clear</button></br></br> | 1540 <button onclick="smartRegexEmpty()" class="btn btn-default">Clear</button></br></br> |
1542 Tag only for this range: <br> | 1541 Tag only for this range: </br> |
1543 <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"><br> | 1542 <input type="text" size="5" id="regexPageStart">to<input type="text" size="5" id="regexPageEnd"></br> |
1544 <button onclick="replaceSmartRun()" class="btn btn-default">Tag</button> | 1543 <button onclick="replaceSmartRun()" class="btn btn-default">Tag</button> |
1545 <button onclick="replaceSmartRunWithBr()" class="btn btn-default">Tag (with line break)</button> | 1544 <button onclick="replaceSmartRunWithBr()" class="btn btn-default">Tag (with line break)</button> |
1546 <!-- <button onclick="replaceSmartRunSpace()" class="btn-lg">Run(Allow space between Group)</button></br> | 1545 <!-- <button onclick="replaceSmartRunSpace()" class="btn-lg">Run(Allow space between Group)</button></br> |
1547 --> | 1546 --> |
1548 <button onclick="replaceSmartRunSpace()" class="btn btn-default btn-block">Tag (Allow space within block)</button></br> | 1547 <button onclick="replaceSmartRunSpace()" class="btn btn-default btn-block">Tag (Allow space within block)</button></br> |