Mercurial > hg > extraction-interface
comparison views/Extractapp/TaggingText.php @ 66:e71a437ae49f extractapp
New: responsive. some css style
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Thu, 02 Apr 2015 16:33:46 +0200 |
| parents | f9ae94a9b041 |
| children | 3ada9334ebfc |
comparison
equal
deleted
inserted
replaced
| 65:f9ae94a9b041 | 66:e71a437ae49f |
|---|---|
| 139 // --- for sidebar--- | 139 // --- for sidebar--- |
| 140 //run once | 140 //run once |
| 141 var el=$('#follow-scroll'); | 141 var el=$('#follow-scroll'); |
| 142 var originalelpos=el.offset().top; // take it where it originally is on the page | 142 var originalelpos=el.offset().top; // take it where it originally is on the page |
| 143 | 143 |
| 144 | |
| 145 //run on scroll | 144 //run on scroll |
| 146 $(window).scroll(function(){ | 145 $(window).scroll(function(){ |
| 147 var el = $('#follow-scroll'); // important! (local) | 146 var el = $('#follow-scroll'); // important! (local) |
| 148 var elpos = el.offset().top; // take current situation | 147 var elpos = el.offset().top; // take current situation |
| 149 var windowpos = $(window).scrollTop(); | 148 var windowpos = $(window).scrollTop(); |
| 336 $('#TitletagType').val(lastAddTag); | 335 $('#TitletagType').val(lastAddTag); |
| 337 | 336 |
| 338 } | 337 } |
| 339 | 338 |
| 340 //e.stopPropagation(); | 339 //e.stopPropagation(); |
| 340 | |
| 341 | |
| 342 | |
| 341 }); | 343 }); |
| 342 | 344 |
| 343 | 345 |
| 344 // === for exporttable.php === | 346 // === for exporttable.php === |
| 345 function exportTable( range, container ) { | 347 function exportTable( range, container ) { |
| 664 var info = JSON.parse('<?php echo json_encode($info) ?>'); | 666 var info = JSON.parse('<?php echo json_encode($info) ?>'); |
| 665 | 667 |
| 666 | 668 |
| 667 $('#load_topic_div').html(""); | 669 $('#load_topic_div').html(""); |
| 668 $('#load_topic_div').css("display", "block"); | 670 $('#load_topic_div').css("display", "block"); |
| 669 | 671 /* |
| 670 $('#load_topic_div').css("border", "1px solid black"); | 672 $('#load_topic_div').css("border", "1px solid black"); |
| 671 $('#load_topic_div').css("background-color", "White"); | 673 $('#load_topic_div').css("background-color", "White"); |
| 672 $('#load_topic_div').css("width", "200px"); | 674 $('#load_topic_div').css("width", "200px"); |
| 673 $('#load_topic_div').css("height", "50px"); | 675 $('#load_topic_div').css("height", "50px"); |
| 674 $('#load_topic_div').css("top", "20px"); | 676 $('#load_topic_div').css("top", "20px"); |
| 675 $('#load_topic_div').css("left", "-200px"); | 677 $('#load_topic_div').css("left", "-200px"); |
| 676 | 678 */ |
| 677 | 679 |
| 678 var topic_select = document.createElement("select"); | 680 var topic_select = document.createElement("select"); |
| 679 topic_select.id = "loadTopiclist"; | 681 topic_select.id = "loadTopiclist"; |
| 680 var selected_topic = t[0]; | 682 var selected_topic = t[0]; |
| 681 topic_select.onchange = function(){ | 683 topic_select.onchange = function(){ |
| 832 _postForContineTagging(form); | 834 _postForContineTagging(form); |
| 833 | 835 |
| 834 | 836 |
| 835 } | 837 } |
| 836 | 838 |
| 837 | |
| 838 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) { | 839 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) { |
| 839 var wordlistArray = JSON.parse('<?php echo json_encode($wordlistArray) ?>'); | 840 var wordlistArray = JSON.parse('<?php echo json_encode($wordlistArray) ?>'); |
| 840 | 841 |
| 841 for (var i = 0; i < wordlistArray.length; i++) { | 842 for (var i = 0; i < wordlistArray.length; i++) { |
| 842 var wordlistValue = wordlistArray[i]; | 843 var wordlistValue = wordlistArray[i]; // wordlistValue is array(id, name, listString) |
| 843 if ($('#smartRegexPopUpSelectWord').val() == wordlistValue[0]) { | 844 if ($('#smartRegexPopUpSelectWord').val() == wordlistValue[0]) { |
| 844 var textarea_text = $('#smartRegexPopUpText').val(); | 845 var textarea_text = $('#smartRegexPopUpText').val(); |
| 845 // insert selected wordlist into textarea at cursor position | 846 // insert selected wordlist into textarea at cursor position |
| 846 var cursorPosition = $('#smartRegexPopUpText').prop("selectionStart"); | 847 var cursorPosition = $('#smartRegexPopUpText').prop("selectionStart"); |
| 847 // cut textarea_text by cursorPosition | 848 // cut textarea_text by cursorPosition |
| 848 var text_before_cursor = textarea_text.substring(0,cursorPosition); | 849 var text_before_cursor = textarea_text.substring(0,cursorPosition); |
| 850 | 851 |
| 851 // default length is 1, which means {1,1} | 852 // default length is 1, which means {1,1} |
| 852 $('#smartRegexPopUpText').val( text_before_cursor+"["+wordlistValue[2]+"]{1,1}"+text_after_cursor); | 853 $('#smartRegexPopUpText').val( text_before_cursor+"["+wordlistValue[2]+"]{1,1}"+text_after_cursor); |
| 853 } | 854 } |
| 854 } | 855 } |
| 855 | |
| 856 }); | 856 }); |
| 857 | |
| 858 | |
| 859 | 857 |
| 860 </script> | 858 </script> |
| 861 | 859 |
| 862 <div id="dialog-form" title="config tags for topic" style="position:fixed; top: 30px; "> | 860 <div id="dialog-form" title="config tags for topic" style="position:fixed; top: 30px; "> |
| 863 </div> | 861 </div> |
| 869 </div> | 867 </div> |
| 870 <div class="bg-info"> <?php echo $messages['info']; ?> </div> | 868 <div class="bg-info"> <?php echo $messages['info']; ?> </div> |
| 871 <div class="bg-default"> <?php echo $messages['debug']; ?> </div> | 869 <div class="bg-default"> <?php echo $messages['debug']; ?> </div> |
| 872 </div> | 870 </div> |
| 873 | 871 |
| 874 <table width="1270" border="1" style="margin:10 30 30 30;"> | 872 <table width="1270" border="1" style="margin:10 30 30 30; width:100%; max-width:1270px"> |
| 875 <tr> | 873 <tr> |
| 876 <td width="980" style="padding:0 5 0 5; margin: 0 5 0 5;"> | 874 <td width="980" style="padding:0 5 0 5; margin: 0 5 0 5;"> |
| 877 <div id="editable-area" class="area" style="max-width: 980"><?php echo $stringInput; ?></div> | 875 <div id="editable-area" class="area" style="max-width:980px; min-width:400px"><?php echo $stringInput; ?></div> |
| 878 </td> | 876 </td> |
| 879 <td width="290" valign="top"> | 877 <td width="290" valign="top" style="min-width:280px"> |
| 880 <div id="popups" style="position:absolute; width:300px; "> | 878 <div id="popups" style="position:absolute; width:300px; "> |
| 881 <div id="load_topic_div" style="position: absolute; display: none; z-index:2"></div> | 879 <div id="load_topic_div" class="popup-topic popup-frame"></div> |
| 882 <div id="load_regex_div" style="position: absolute; display: none; z-index:2;"></div> | 880 <div id="load_regex_div" class="popup-loadregex popup-frame"></div> |
| 883 <div id="smartRegexPopUpDiv" style="position: absolute; display: none; z-index:2"> | 881 <div id="smartRegexPopUpDiv" class="popup-regex popup-frame"> |
| 884 Name: <input id="smartRegexPopUpName"></input><br><br> | 882 Name: <input id="smartRegexPopUpName"></input><br><br> |
| 885 Word List: | 883 Word List: |
| 886 <select id="smartRegexPopUpSelectWord"> | 884 <select id="smartRegexPopUpSelectWord"> |
| 887 <option value="NULL" selected>無</option> | 885 <option value="NULL" selected>無</option> |
| 888 <?php | 886 <?php |
| 902 } | 900 } |
| 903 echo "<option value=\"title\">Title</option>\n"; | 901 echo "<option value=\"title\">Title</option>\n"; |
| 904 ?> | 902 ?> |
| 905 <option value="NOTAG">不標記</option> | 903 <option value="NOTAG">不標記</option> |
| 906 </select><br> | 904 </select><br> |
| 907 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info" style="">Add</button> | 905 <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info">Add</button> |
| 908 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success" style="">Edit/Update</button> | 906 <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success">Edit/Update</button> |
| 909 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger" style="">Delete</button> | 907 <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger">Delete</button> |
| 910 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default" style=""><<</button> | 908 <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default"><<</button> |
| 911 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default" style="">>></button> | 909 <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default">>></button> |
| 912 <button onclick="replaceSmartClose()" class="btn btn-default" style="">Close</button> | 910 <button onclick="replaceSmartClose()" class="btn btn-default" >Close</button> |
| 913 </div> | 911 </div> |
| 914 </div> | 912 </div> |
| 915 | 913 |
| 916 <div id="follow-scroll" style="position:absolute; height:680px; overflow:scroll; margin:0 5 15 5; max-width:280px"> | 914 <div id="follow-scroll"> |
| 917 <form action="javascript:void(0);"> | 915 <form action="javascript:void(0);"> |
| 918 <fieldset> | 916 <fieldset> |
| 919 <legend><h5 class="text-success"> Config Topic: </h5></legend> | 917 <legend><h5 class="text-success"> Config Topic: </h5></legend> |
| 920 <div> current topic is: <?php echo $topic_name['name_en']; ?> <br> | 918 <div> current topic is: <?php echo $topic_name['name_en']; ?> <br> |
| 921 (<?php echo $topic_name['name_ch']; ?>, <?php echo $topic_name['name_pinyin']; ?>) | 919 (<?php echo $topic_name['name_ch']; ?>, <?php echo $topic_name['name_pinyin']; ?>) |
