summaryrefslogtreecommitdiffstats
path: root/warehouse/src/main/webapp/WEB-INF/pages/appDev/searchDev.jsp
blob: 33ac523d3ee68b6c679c598982968ed15b906adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<style type="text/css">
	div.dataTables_wrapper div.dataTables_info {padding-top: 0.3em;white-space: nowrap;margin-left:120px;}
	a.page-link{height:calc(1.8125rem + 4px);margin-left:-5px;}
   .div{font-size:18px; color:#000;line-height:24px;white-space:nowrap;text-overflow:ellipsis;word-break:break-all;overflow:hidden;}
		.item,.carousel-caption{
			width: 100%;
			height: 300px;
		}
		.carousel-caption{
			left: 0;
			top: 0;
			padding: 0;
		}
		.mask {       
            position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;     
            z-index: 1002; left: 0px;     
            opacity:0.5; -moz-opacity:0.5;     
        } 
        
	</style>
<c:choose>
	<c:when test="${not empty modelErrors}">
		<div class="alert alert-danger" id="modalErrorArea" role="alert">
			&nbsp;${modelErrors}
		</div>
	</c:when>
	<c:otherwise>
		<div class="card mb-3" style="BACKGROUND-COLOR: transparent;color:white">
			<div class="alert alert-danger" id="modalErrorArea" role="alert"
				<c:choose>
						<c:when test="${not empty modelErrors}">style="display: block"</c:when>
						<c:otherwise>style="display: none"</c:otherwise>
						</c:choose>>
				<c:if test="${not empty modelErrors}">
							&nbsp;${modelErrors}
						</c:if>
			</div>
			<div class="card-header" style="height:250px;">
			    <div style="color:#00CACA;font-size:30px;">KeyWord</div><br>
			    <div class="row" >
		            <div class="input-group col-md-10">		  
						<input type="text" class="form-control size" id="t_keyWord" name="t_keyWord" value="" placeholder="please input keywords" style="height:50px;BACKGROUND-COLOR: transparent;color:white">
			            <button id="btn-save-edit" style="color:white;height:50px;width:50px;font-size:30px;border-color:white;background:none;" onclick="clean()">X</button>
					</div>
 					<div class="col-md-2">
					    <button class="btn btn-skin button-size" id="btn-search" style="color:white;height:50px;float:right" onclick="searchApp(this);">search</button>				 
					</div>
			    </div><br>
			    <div style="color:#00CACA;font-size:30px;">AppType</div>
					<input type="text" class="form-control" id="t_filePath" size="16" name="t_filePath" style="display:none;">
					<div style="overflow-x:scroll;white-space:nowrap;height:70px;display:none">
					    <c:forEach var="list" items="${appDeviceTypeList}">
						    <label class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="deviceTypeButton(${list.value})"><input style="display:none;" type="radio" name="deviceType" >${list.label}</label>
						</c:forEach>
					</div><br>
                    <div id="appType" style="color:gray;overflow-x:scroll;white-space:nowrap;height:70px;" class="test1">
                   		<button id="type-btn-all" class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white"" onclick="TypeButton(this,'');">Show All Types</button>
					    <c:forEach var="list" items="${appTypeList}">
							<button id="type-btn-signal" class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="TypeButton(this,${list.value});">${list.label}</button>
						</c:forEach>
					</div>
			</div>
			<div class="card-body">
			    <div id="appHeight" style="overflow-x:hidden;" class="test1">
			       <table id="example" cellspacing="0" style="width:100%;">
						<thead style="display:none">
							<tr><hr>
								<th>No.</th>
								<th>App Name</th>
								<th>Developer</th>
								<th>TypeId</th>
								<th id="textarea">App Abstract</th>
								<th>Manipulation</th>
							</tr>			
						</thead>
				    </table>
				</div>
				<div style="height:20px"></div>
			</div>
		</div>
	</c:otherwise>
</c:choose>
 
<script>
$(function() {
	$("#appHeight").height($(document).height()-520);
	$("#page-content").css("background-image","url(<%=basePath%>/image/AGL_HMI_Blue_Background_Car-01.png)");
	Commons.bindDateControl();
	Commons.appendRedAsterisk();
}); 

var appTypeFlag = false;
function searchApp(obj){
	debugger;
	if(appTypeFlag == false){
		$("#type-btn-all").css("background-color", "#00D096");
	}
	if(isInitTable == false){
		initData(false);
		isInitTable = true;
	}else if(isInitTable == true){
		$table.DataTable().ajax.reload();
	}
}

//appDeviceType
var deviceTypeButton = function(deviceTypeValue){
    $("input[name='deviceType']").parent().css('background-color','');
	$('#appType')[0].style.display="block";
	$table.DataTable().ajax.reload();
	$('input:radio[name="deviceType"]:checked').parent().css('background-color','#00D096');
	deviceTypeId = deviceTypeValue;
};

//appType
var TypeButton = function(obj, typeValue){
	TypeId = typeValue;
	debugger;
	$('button[id^="type-btn-"]').css("background-color", "");
    $(obj).css("background-color", "#00D096");
    appTypeFlag = true;
	searchApp(obj);
};

//Judge whether is the first time searched
var isInitTable = false;
var deviceTypeId = "";
var TypeId = "";
var $table = $('#example');
var $errorArea = $('#modalErrorArea');

 var strSub = function(str, subLen){
	if(str == null){
		return "";
	} 
	if(str.length > subLen){
		str = str.substring(0, subLen);
		appAbstract = str + "...";
		return appAbstract;
	}
	return str;
}; 

function clean(){
	$("#t_keyWord").val("");
}

</script>