Explorar el Código

fix #1549 add advance.js

Shinsuke Sugaya hace 7 años
padre
commit
22a509f8cd
Se han modificado 2 ficheros con 43 adiciones y 17 borrados
  1. 1 17
      src/main/webapp/WEB-INF/view/advance.jsp
  2. 42 0
      src/main/webapp/js/advance.js

+ 1 - 17
src/main/webapp/WEB-INF/view/advance.jsp

@@ -329,27 +329,11 @@
 			</div>
 			<jsp:include page="footer.jsp" />
 		</div>
-		<div id="searchOptions" class="control-options">
-			<div class="container">
-				<jsp:include page="searchOptions.jsp" />
-				<div>
-					<button type="button" class="btn btn-secondary" id="searchOptionsClearButton">
-						<la:message key="labels.search_options_clear" />
-					</button>
-					<button type="button" class="btn btn-secondary pull-right" data-toggle="control-options"
-						data-target="#searchOptions" id="searchOptionsCloseButton"
-					>
-						<i class="fa fa-times-circle"></i>
-						<la:message key="labels.search_options_close" />
-					</button>
-				</div>
-			</div>
-		</div>
 	</la:form>
 	<input type="hidden" id="contextPath" value="${contextPath}" />
 	<script type="text/javascript" src="${fe:url('/js/jquery-3.2.1.min.js')}"></script>
 	<script type="text/javascript" src="${fe:url('/js/bootstrap.js')}"></script>
 	<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
-	<script type="text/javascript" src="${fe:url('/js/index.js')}"></script>
+	<script type="text/javascript" src="${fe:url('/js/advance.js')}"></script>
 </body>
 </html>

+ 42 - 0
src/main/webapp/js/advance.js

@@ -0,0 +1,42 @@
+$(function() {
+	var $searchButton = $('#searchButton');
+	var contextPath = $('#contextPath').val();
+
+	$('#searchForm').on('submit', function(e) {
+		$searchButton.attr('disabled', true);
+		setTimeout(function() {
+			$searchButton.attr('disabled', false);
+		}, 3000);
+		return true;
+	});
+
+	if (typeof $.fn.suggestor === 'function') {
+		$('#as_q')
+				.suggestor(
+						{
+							ajaxinfo : {
+								url : contextPath + '/suggest',
+								fn : '_default,content,title',
+								num : 10,
+								lang : $('#langSearchOption').val()
+							},
+							boxCssInfo : {
+								border : '1px solid rgba(82, 168, 236, 0.5)',
+								'-webkit-box-shadow' : '0 1px 1px 0px rgba(0, 0, 0, 0.1), 0 3px 2px 0px rgba(82, 168, 236, 0.2)',
+								'-moz-box-shadow' : '0 1px 1px 0px rgba(0, 0, 0, 0.1), 0 3px 2px 0px rgba(82, 168, 236, 0.2)',
+								'box-shadow' : '0 1px 1px 0px rgba(0, 0, 0, 0.1), 0 3px 2px 0px rgba(82, 168, 236, 0.2)',
+								'background-color' : '#fff',
+								'z-index' : '10000'
+							},
+							listSelectedCssInfo : {
+								'background-color' : 'rgba(82, 168, 236, 0.1)'
+							},
+							listDeselectedCssInfo : {
+								'background-color' : '#ffffff'
+							},
+							minterm : 1,
+							adjustWidthVal : 11,
+							searchForm : $('#searchForm')
+						});
+	}
+});