commit
96aef6dbe2
@ -0,0 +1,66 @@
|
||||
<style type="text/css">
|
||||
#preview{width:360px;height:360px;border:1px solid #000;overflow:hidden;}
|
||||
#imghead {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function previewImage(file)
|
||||
{
|
||||
var MAXWIDTH = 360;
|
||||
var MAXHEIGHT = 360;
|
||||
var div = document.getElementById('preview');
|
||||
if (file.files && file.files[0])
|
||||
{
|
||||
div.innerHTML = '<img id=imghead>';
|
||||
var img = document.getElementById('imghead');
|
||||
img.onload = function(){
|
||||
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
||||
img.width = rect.width;
|
||||
img.height = rect.height;
|
||||
img.style.marginLeft = rect.left+'px';
|
||||
img.style.marginTop = rect.top+'px';
|
||||
}
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(evt){img.src = evt.target.result;}
|
||||
reader.readAsDataURL(file.files[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
|
||||
file.select();
|
||||
var src = document.selection.createRange().text;
|
||||
div.innerHTML = '<img id=imghead>';
|
||||
var img = document.getElementById('imghead');
|
||||
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
|
||||
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
||||
status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
|
||||
div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;margin-left:"+rect.left+"px;"+sFilter+src+"\"'></div>";
|
||||
}
|
||||
}
|
||||
function clacImgZoomParam( maxWidth, maxHeight, width, height ){
|
||||
var param = {top:0, left:0, width:width, height:height};
|
||||
if( width>maxWidth || height>maxHeight )
|
||||
{
|
||||
rateWidth = width / maxWidth;
|
||||
rateHeight = height / maxHeight;
|
||||
|
||||
if( rateWidth > rateHeight )
|
||||
{
|
||||
param.width = maxWidth;
|
||||
param.height = Math.round(height / rateWidth);
|
||||
}else
|
||||
{
|
||||
param.width = Math.round(width / rateHeight);
|
||||
param.height = maxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
param.left = Math.round((maxWidth - param.width) / 2);
|
||||
param.top = Math.round((maxHeight - param.height) / 2);
|
||||
return param;
|
||||
}
|
||||
</script>
|
||||
<div id="preview">
|
||||
<img id="imghead" width=100 height=100 border=0 src="file:///C:/Users/whimlex/Downloads/1.jpg">
|
||||
</div>
|
||||
<br/>
|
||||
<input type="file" onchange="previewImage(this)" />
|
@ -0,0 +1,22 @@
|
||||
|
||||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
|
||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||
<span style="float: left; width: 526px">
|
||||
<p><span style="color:#1b55a7; font-weight:bold;"><%= @invitor_name %></span> 邀请您加入项目:<span style="color:#1b55a7; font-weight:bold;"><%= @project_name %></span> </p>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
<p>点击“同意加入”按钮,即可快速加入项目!</p> <br/>
|
||||
<label class="mail_reply">
|
||||
<%= link_to( l(:label_agree_join_project), @project_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||
</label>
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||
</div>
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
<%= @invitor_name %>
|
||||
<%= @project_name %>
|
||||
<%= link_to( l(:label_apply_project), @project_url) %>
|
Loading…
Reference in new issue