From 6ac2fbf4f714c1679b1541299b6159d709bfdfce Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 15 Apr 2013 07:16:49 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2JS=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/views/scripts/data/view.phtml | 190 ++++++------------ htdocs/js/metadata-view.js | 112 +++++++++++ 2 files changed, 177 insertions(+), 125 deletions(-) diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml index b080ce0e..cc3cf15f 100755 --- a/application/default/views/scripts/data/view.phtml +++ b/application/default/views/scripts/data/view.phtml @@ -127,10 +127,10 @@ if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
-
@@ -392,131 +392,71 @@ endforeach;

Cannot find the metadata.

diff --git a/htdocs/js/metadata-view.js b/htdocs/js/metadata-view.js index ee5e5c7f..ab1c6fa7 100644 --- a/htdocs/js/metadata-view.js +++ b/htdocs/js/metadata-view.js @@ -1,3 +1,33 @@ +function literature_get(page,uuid){ + $.ajax({ + type:"GET", + url:"/service/literature/uuid/"+uuid, + data:'page='+page, + success:function(html){$('#literature-list').html('
    '+html+'
');}, + beforeSend:function(){$('#literature-list').html('加载中');} + }); +} + +function recommend_get(page,uuid){ + $.ajax({ + type:"GET", + url:"/service/recommend/uuid/"+uuid, + data:'page='+page, + success:function(html){$('#recommend').html('');}, + beforeSend:function(){$('#recommend').html('加载中');} + }); +} + +function related_get(page,uuid){ + $.ajax({ + type:"GET", + url:"/service/related/uuid/"+uuid, + data:'page='+page, + success:function(html){$('#related').html('
    '+html+'
');}, + beforeSend:function(){$('#related').html('加载中');} + }); +} + function postcomment(){ var url="/data/postcomment"; var date = $('#postcommentform').serialize(); @@ -163,4 +193,86 @@ function onDataVersionLoad(data){ function Alert(html){ $.colorbox({'innerWidth':'50%','html':'

'+html+'

'}); +} + +function getFileList_h(uuid){ + html ='
' + + '
' + + '
' + + '
加载中...
' + + '
    ' + + '
' + + '
' + + '
' + +'
'; + $.colorbox({width:"80%",height:"80%",html:html}); + $.getJSON("/service/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(); + }); +} + +function ajaxpage_get(page,uuid){ + var url = "/data/comment/uuid/"+uuid; + data='page='+page; + $.ajax({ + type:"GET", + url:url, + data:data, + success:function(html){$('#allcomments').html(html);}, + beforeSend:function(){$('#allcomments').html('评论加载中');} + }); +}; + +//map +//加载地图 +function initialize() { + var myLatlng = new google.maps.LatLng(bound.lat,bound.lng); + + zoomlevel = bound.zoom; + + var myOptions = { + zoom: zoomlevel, + center: myLatlng, + mapTypeId: google.maps.MapTypeId.HYBRID + } + map = new google.maps.Map(document.getElementById(mapElementID), myOptions); + + setRectangle(bound.east,bound.west,bound.south,bound.north); +} + +function setRectangle(east,west,south,north){ + + bounds = new google.maps.LatLngBounds( + new google.maps.LatLng(south,west), + new google.maps.LatLng(north,east) + ); + + rectangle = new google.maps.Rectangle({ + bounds: bounds, + editable: false + }); + + rectangle.setMap(map); + + var bounds = new google.maps.LatLngBounds(); + bounds.extend(new google.maps.LatLng(south, west)); + bounds.extend(new google.maps.LatLng(north,east)); + map.fitBounds(bounds); } \ No newline at end of file