<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>上传</title>
<!-- 当前页面 -->
<link type="text/css" href="${config.statie}ui/admin/images/admin.css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
  <div class="area">
    <h2>
      <i>文件预览</i>
    </h2>
    <div class="area-content">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
        <tr>
          <td align="center" valign="middle">调用地址：
            <gen:if test="${attachment.fileExte == 'mp3' || attachment.fileExte == 'flv' || attachment.fileExte == 'mp4' || attachment.fileExte == 'm3u8'}">
            <input name="url" type="text" class="text small" value="${config.path}editor!player.gen?id=${attachment.id}" size="100" readonly="readonly" />
            <gen:else />
            <input name="url" type="text" class="text small" value="${attachment.url}" size="100" readonly="readonly" />
            </gen:if>
            &nbsp;<a href="javascript:void(0);" class="copy" title="复制">复制</a></td>
        </tr>
        <tr class="border-top">
          <td align="center" valign="middle"><gen:if test="${attachment.fileExte == 'mp3' || attachment.fileExte == 'flv' || attachment.fileExte == 'mp4' || attachment.fileExte == 'm3u8'}"><iframe src="${config.path}editor!player.gen?id=${attachment.id}" width="550" height="400" frameborder="0" allowfullscreen="true"></iframe>
          <gen:elseif test="${attachment.isImage == 1}" />
          <img src="${attachment.url}" style="max-width:600px;" alt="${attachment.name}" />
          <gen:else />${attachment.name}</gen:if></td>
        </tr>
        <tr class="border-top">
          <td align="center" valign="middle">调用地址：
            <gen:if test="${attachment.fileExte == 'mp3' || attachment.fileExte == 'flv' || attachment.fileExte == 'mp4' || attachment.fileExte == 'm3u8'}">
            <input name="url" type="text" class="text small" value="${config.path}editor!player.gen?id=${attachment.id}" size="100" readonly="readonly" />
            <gen:else />
            <input name="url" type="text" class="text small" value="${attachment.url}" size="100" readonly="readonly" />
            </gen:if>
            &nbsp;<a href="javascript:void(0);" class="copy" title="复制">复制</a></td>
        </tr>
      </table>
    </div>
  </div>
</div>
<!-- 必备插件 -->
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.form.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.timers.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.tablecolor.js"></script>
<!-- 日期插件 -->
<script type="text/javascript" src="${config.statie}js/datePicker/WdatePicker.js"></script>
<!-- 弹窗插件 -->
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.js?self=true"></script>
<script type="text/javascript" src="${config.statie}js/dialog/jquery.dialog.plugins.js"></script>
<!-- UI界面必备 -->
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ready.js"></script>
<!-- 当前页面 -->
<script type="text/javascript">
// document.domain = "jspgen.com";// 调用
$(document).ready(function(){
	// 变量
	var $copy = $('.table a.copy');
	
	// 复制
	$copy.bind('click', function () {
		var $tr = $(this).closest('tr'), $url = $tr.find('input[name="url"]');
		var copy = grapes.copyText($url.val());
		if(!copy) $url.select();
		return ;
	});
	// 全选
	$('input[name="url"').bind('click', function () {
		$(this).select();
	});
	
	/**
	// 确定按钮(批量)
	$dialogApi.button({id:'valueOk', name:'确定', callback:ok});
	function ok() {
		var ids = grapes.values($check.attr('for'), ',');
		if(grapes.isEmpty(ids)){
			$dialog.alert('至少需要选择一条数据…'); return false;
		}
		$temp = $checkItem.filter(':checked').closest('tr');
		$temp.each(function(){
			$dialogApi.callback({to:'${param.to}', url:$(this).attr('url')});
		});
		$dialogApi.close();
	}
	*/
});
</script>
</body>
</html>