diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml
index f7544afa..2b476b2b 100755
--- a/application/default/views/scripts/data/view.phtml
+++ b/application/default/views/scripts/data/view.phtml
@@ -9,11 +9,12 @@
$this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
- $this->headScript()->appendFile('/js/prototype.js');
- $this->headScript()->appendFile('/js/OpenLayers.js');
- $this->headScript()->appendFile('/js/window.js');
+ $this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
+ $this->headScript()->appendFile('/static/js/jquery.thickbox.js');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
+ $this->headLink()->appendStylesheet('/static/css/thickbox.css');
+
?>
metadata;if ($md):?>
-
+
@@ -283,40 +285,93 @@ echo '';
//ajax download
function todownload(ft)
{
- var request_url = "/data/todownload/uuid/uuid;?>/ft/"+ft;
- if($('todownloadform')) {var request_pars = $('todownloadform').serialize();}else{var request_pars = '';}
-
- var myAjax = new Ajax.Updater('returninfo', request_url,{
- method : 'get',
- parameters : request_pars,
- onFailure : reportError,
- onLoading : loading,
- onComplete : done,
- evalScripts: true
+ var url = "/data/todownload/uuid/uuid;?>/ft/"+ft;
+ if($('#todownloadform')) var date = $('#todownloadform').serialize();
+ $.ajax({
+ type:"GET",
+ url:url,
+ data:date,
+ success:function(html){
+ $('#returninfo').html(html);
+ },
+ beforeSend:function(){
+ $('#returninfo').html('
');
+ }
});
}
//ajax comment
-function loading(){$('loading').style.display = 'block';}
-function done(){$('loading').style.display = 'none';}
-function reportError(request){alert('Sorry. There was an error.');}
function ajaxpage(page){
- var request_pars = 'page='+page; //请求参数
- var myAjax = new Ajax.Updater('allcomments', '/data/comment/uuid/= $md->uuid; ?>',{
- method : 'get', // http 请求方法,get or post
- parameters : request_pars, // 请求参数
- onFailure : reportError, // 失败的时候调用 reportError 函数处理
- onLoading : loading, // 加载时
- onComplete : done // 读取完毕
- });
+ var url = "/data/comment/uuid/= $md->uuid; ?>";
+ data='page='+page;
+ $.ajax({
+ type:"GET",
+ url:url,
+ data:data,
+ success:function(html){$('#allcomments').html(html);},
+ beforeSend:function(){$('#allcomments').html('
评论加载中');}
+ });
+};ajaxpage(0);
+function getFileList(){
+ var tw = ($(window).width() - $('#window-outter').width())/2;
+ $('#window-inner').css('min-height','450px');
+ $('#window-outter').css({'right':tw});
+ $('#window-outter').show();
+ $.getJSON("/filelist/uuid/uuid;?>", function(data) {
+ var items = [];
+ if(data.length>0)
+ {
+ $.each(data, function(key, val) {
+ if(val['filename'].match(/\/$/))
+ {
+ items.push('
+ ' + val['filename'] + '');
+ }else{
+ items.push('
' + val['filename'] + '');
+ }
+ });
+ }else{
+ items.push('
暂无数据');
+ }
+ $('#file-list').html(items.join(''));
+ })
+ .complete(function() {$('#window-loading').hide();});
}
-ajaxpage(0);
- //google map
- var map = new GMap2(document.getElementById("watermap"));
- var plotbounds=new GLatLngBounds(new GLatLng(= $md->south; ?>,= $md->west; ?>),new GLatLng(= $md->north; ?>,= $md->east; ?>));
- var zoomlevel=map.getBoundsZoomLevel(plotbounds);
- zoomlevel--;
+function getSubFileList(uuid,id,depth){
+ if($("#div_"+id).length>0)
+ {
+ $('#span_'+id).html('+');
+ $("#div_"+id).remove();
+ return false;
+ }
+ $('
', {
+ 'style':'max-height:400px; overflow:scroll; overflow-x:hidden;',
+ 'id': 'div_'+id,
+ html: '
加载中'
+ }).appendTo('#li_'+id);
+ url="/filelist/sub/uuid/"+uuid+"/subpath/"+id+"/depth/"+depth;
+ $.getJSON(url, function(data) {
+ var items = [];
+ $.each(data, function(key, val) {
+ if(val['filename'].match(/\/$/))
+ {
+ items.push('
+ ' + val['filename'] + '');
+ }else{
+ items.push('
' + val['filename'] + '');
+ }
+ });
+ $("#div_"+id).html(items.join(''));
+ }).complete(function(){
+ if($("#div_"+id)){
+ $('#span_'+id).html('-');
+ }
+ });
+}
+//google map
+var map = new GMap2(document.getElementById("watermap"));
+var plotbounds=new GLatLngBounds(new GLatLng(= $md->south; ?>,= $md->west; ?>),new GLatLng(= $md->north; ?>,= $md->east; ?>));
+var zoomlevel=map.getBoundsZoomLevel(plotbounds);
+zoomlevel--;
north==$md->south) : ?>
- zoomlevel=10;
+ zoomlevel=10;
if (zoomlevel>16) zoomlevel=16;
map.setCenter(new GLatLng(= ($md->south+$md->north)/2; ?>,= ($md->east+$md->west)/2; ?>), zoomlevel);