changeset 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
files css/taggingtext.css js/taggingtext.js models/extractapp.php views/Extractapp/TaggingText.php
diffstat 4 files changed, 70 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/css/taggingtext.css	Thu Apr 02 11:45:09 2015 +0200
+++ b/css/taggingtext.css	Thu Apr 02 16:33:46 2015 +0200
@@ -10,18 +10,61 @@
 	background-color: #E7F3FF;
 
 }
-
 .bg-default{
 	background-color: #F4F4F4;
-
 }
 
 .info-board{
 	margin:10 30 10 30;
+	width: 100%;
+	max-width:1270px;
+	min-width: 680px;
 	border: 2px solid #A1A1A1;
     border-radius: 4px;
-	max-width:1270;
 	height:70px;
 	overflow:scroll;
 	overflow-x:hidden;
-}
\ No newline at end of file
+}
+#follow-scroll {
+	position:absolute; 
+	height:680px; 
+	overflow:scroll; 
+	margin:0 5 15 5; 
+	max-width:280px; 
+	border: 1px solid #A1A1A1;
+	border-radius: 4px;
+}
+
+.popup-frame {
+	position: absolute;
+	display: none; 
+	background-color: white;
+	border: 2px solid #A1A1A1;
+	border-radius: 4px;
+	padding: 5px;	
+}
+
+.popup-regex {
+	left: -400px;
+	width: 400px;
+	height: 300px;
+	top: 100px;
+	z-index: 2;
+}
+
+.popup-loadregex{
+	left: -300px;
+	width: 300px;
+	height: 70px;
+	top: 100px;
+	z-index: 2;
+
+}
+
+.popup-topic {
+	left: -200px;
+	width: 200px;
+	height: 50px;
+	top: 20px;
+	z-index: 2;
+}
--- a/js/taggingtext.js	Thu Apr 02 11:45:09 2015 +0200
+++ b/js/taggingtext.js	Thu Apr 02 16:33:46 2015 +0200
@@ -430,14 +430,7 @@
 
 function smartRegexNew() {
     $('#smartRegexPopUpDiv').css("display", "block");
-    $('#smartRegexPopUpDiv').css("background-color", "White");
-    $('#smartRegexPopUpDiv').css("width", "400px");
-    $('#smartRegexPopUpDiv').css("height", "300px");
-    $('#smartRegexPopUpDiv').css("top", "170px");
-    $('#smartRegexPopUpDiv').css("left", "-400px");
-    $('#smartRegexPopUpDiv').css("border", "1px solid black");
-    $('#smartRegexPopUpDiv').css("padding", "5px");
-    
+
     $('#smartRegexPopUpAdd').attr("disabled", false);
     $('#smartRegexPopUpEdit').attr("disabled", "disabled");
     $('#smartRegexPopUpDel').attr("disabled", "disabled");
@@ -517,15 +510,7 @@
 $(document).on("click", '#smartRegexShowDiv > span', function (e) {
     
     $('#smartRegexPopUpDiv').css("display", "block");
-    $('#smartRegexPopUpDiv').css("background-color", "White");
-    $('#smartRegexPopUpDiv').css("width", "400px");
-    $('#smartRegexPopUpDiv').css("height", "300px");
-    $('#smartRegexPopUpDiv').css("top", "100px");
-    $('#smartRegexPopUpDiv').css("left", "-400px");
-    $('#smartRegexPopUpDiv').css("border", "1px solid black");
-    //$('#smartRegexPopUpDiv').css("padding", "5px");    
     
-
     $('#smartRegexPopUpDiv').attr("editID", $(this).attr("id"));
     
     $('#smartRegexPopUpName').val($(this).text());
@@ -729,13 +714,7 @@
 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", "300px");
-    $('#load_regex_div').css("height", "70px");
-    $('#load_regex_div').css("top", "100px");
-    $('#load_regex_div').css("left", "-300px");
-    
+
     var newselect = document.createElement("select");
     newselect.id = "loadRegexSelect";
             
--- a/models/extractapp.php	Thu Apr 02 11:45:09 2015 +0200
+++ b/models/extractapp.php	Thu Apr 02 16:33:46 2015 +0200
@@ -269,7 +269,7 @@
         } else if ($status == "error") {
             // saving not success
             $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."<br>";
-            $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version. <br>";
+            $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version.";
 
             $response_currentFile = $response["currentFile"];
             $this->current_fileId = (string)$response_currentFile["id"];
--- a/views/Extractapp/TaggingText.php	Thu Apr 02 11:45:09 2015 +0200
+++ b/views/Extractapp/TaggingText.php	Thu Apr 02 16:33:46 2015 +0200
@@ -141,7 +141,6 @@
     var el=$('#follow-scroll');
     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)
@@ -338,6 +337,9 @@
     }
 
     //e.stopPropagation();
+
+
+
 });
 
 
@@ -666,14 +668,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("height", "50px");
     $('#load_topic_div').css("top", "20px");
     $('#load_topic_div').css("left", "-200px");
-    
+    */
 
     var topic_select = document.createElement("select");
     topic_select.id = "loadTopiclist";
@@ -834,13 +836,12 @@
         
 }
 
-
 $(document).on("change", '#smartRegexPopUpSelectWord', function (e) {
     var wordlistArray = JSON.parse('<?php echo json_encode($wordlistArray) ?>');
 
     for (var i = 0; i < wordlistArray.length; i++) {
-        var wordlistValue = wordlistArray[i];
-        if ($('#smartRegexPopUpSelectWord').val() == wordlistValue[0]) {
+        var wordlistValue = wordlistArray[i];   // wordlistValue is array(id, name, listString)
+        if ($('#smartRegexPopUpSelectWord').val() == wordlistValue[0]) {    
             var textarea_text = $('#smartRegexPopUpText').val();
             // insert selected wordlist into textarea at cursor position
             var cursorPosition = $('#smartRegexPopUpText').prop("selectionStart");
@@ -852,11 +853,8 @@
             $('#smartRegexPopUpText').val( text_before_cursor+"["+wordlistValue[2]+"]{1,1}"+text_after_cursor);
         }
     }
-
 });
 
-
-
 </script>
  
 <div id="dialog-form" title="config tags for topic" style="position:fixed; top: 30px; ">
@@ -871,16 +869,16 @@
     <div class="bg-default"> <?php echo $messages['debug']; ?> </div>
 </div>
 
-<table width="1270" border="1" style="margin:10 30 30 30;">
+<table width="1270" border="1" style="margin:10 30 30 30; width:100%; max-width:1270px">
     <tr>
         <td width="980" style="padding:0 5 0 5; margin: 0 5 0 5;">
-            <div id="editable-area" class="area" style="max-width: 980"><?php echo $stringInput; ?></div>
+            <div id="editable-area" class="area" style="max-width:980px; min-width:400px"><?php echo $stringInput; ?></div>
         </td>
-        <td width="290" valign="top">
+        <td width="290" valign="top" style="min-width:280px">
             <div id="popups" style="position:absolute; width:300px; ">
-                <div id="load_topic_div" style="position: absolute; display: none; z-index:2"></div>
-                <div id="load_regex_div" style="position: absolute; display: none; z-index:2;"></div>
-                <div id="smartRegexPopUpDiv" style="position: absolute; display: none; z-index:2">
+                <div id="load_topic_div" class="popup-topic popup-frame"></div>
+                <div id="load_regex_div" class="popup-loadregex popup-frame"></div>
+                <div id="smartRegexPopUpDiv" class="popup-regex popup-frame">
                     Name: <input id="smartRegexPopUpName"></input><br><br>
                     Word List: 
                     <select id="smartRegexPopUpSelectWord">
@@ -904,16 +902,16 @@
                     ?>
                     <option value="NOTAG">不標記</option>
                     </select><br>
-                    <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info" style="">Add</button>
-                    <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success" style="">Edit/Update</button>
-                    <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger" style="">Delete</button>
-                    <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default" style=""><<</button>
-                    <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default" style="">>></button>
-                    <button onclick="replaceSmartClose()" class="btn btn-default" style="">Close</button>
+                    <button id="smartRegexPopUpAdd" onclick="replaceSmartAdd()" class="btn btn-info">Add</button>
+                    <button id="smartRegexPopUpEdit" onclick="replaceSmartEdit()" class="btn btn-success">Edit/Update</button>
+                    <button id="smartRegexPopUpDel" onclick="replaceSmartDel()" class="btn btn-danger">Delete</button>
+                    <button id="smartRegexPopUpBack" onclick="replaceSmartBack()" class="btn btn-default"><<</button>
+                    <button id="smartRegexPopUpFor" onclick="replaceSmartFor()" class="btn btn-default">>></button>
+                    <button onclick="replaceSmartClose()" class="btn btn-default" >Close</button>
                 </div>
             </div>
 
-            <div id="follow-scroll" style="position:absolute; height:680px; overflow:scroll; margin:0 5 15 5; max-width:280px">
+            <div id="follow-scroll">
                 <form action="javascript:void(0);">   
                     <fieldset>
                         <legend><h5 class="text-success"> Config Topic: </h5></legend>