Ray's changes for image upload component and sign-in page
This commit is contained in:
1 parent
6831a3dbbb
commit
b80339d704
6 files changed
+223
-32
No files matched your search
@@ -6,6 +6,7 @@
|
||||
<%= javascript_include_tag "lib/date.format" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/jquery.imagesloaded" %>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -79,27 +80,29 @@
|
||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||
<%= image_tag @ad_image.file,:width=> "456",:height=>'700' rescue ''%>
|
||||
<script type="text/javascript">
|
||||
var picH = $('.upload-picture').width()/$('.upload-picture').find('img').attr("width")*$('.upload-picture').find('img').attr("height")
|
||||
var imgMarginTop = ($('.upload-picture').height()-picH)/2;
|
||||
var d = $('.upload-picture').height();
|
||||
if(imgMarginTop>0){
|
||||
imgMarginTop = 0;
|
||||
d = picH;
|
||||
$('.upload-picture').css({height:d})
|
||||
}
|
||||
$('.upload-picture').find('img').css({marginTop:imgMarginTop})
|
||||
$('.upload-picture').each(function (i){
|
||||
$(this).mouseenter(function(){
|
||||
var h= picH;
|
||||
$(this).stop().animate({height:h}, 500);
|
||||
$(this).find('img').stop().animate({marginTop:0}, 500);
|
||||
});
|
||||
$(this).mouseleave(function(){
|
||||
$(this).stop().animate({height:d}, 500);
|
||||
$(this).find('img').stop().animate({marginTop:imgMarginTop}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
$('.upload-picture').find('img').imagesLoaded(function(){;
|
||||
var picH = $('.upload-picture').width()/$('.upload-picture').find('img').width()*$('.upload-picture').find('img').height();
|
||||
var imgMarginTop = ($('.upload-picture').height()-picH)/2;
|
||||
var d = $('.upload-picture').height();
|
||||
if(imgMarginTop>0){
|
||||
imgMarginTop = 0;
|
||||
d = picH;
|
||||
$('.upload-picture').css({height:d})
|
||||
}
|
||||
$('.upload-picture').find('img').css({marginTop:imgMarginTop})
|
||||
$('.upload-picture').each(function (i){
|
||||
$(this).mouseenter(function(){
|
||||
var h= picH;
|
||||
$(this).stop().animate({height:h}, 500);
|
||||
$(this).find('img').stop().animate({marginTop:0}, 500);
|
||||
});
|
||||
$(this).mouseleave(function(){
|
||||
$(this).stop().animate({height:d}, 500);
|
||||
$(this).find('img').stop().animate({marginTop:imgMarginTop}, 500);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span>
|
||||
<div class="controls file-upload input-prepend">
|
||||
@@ -181,16 +184,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-success" type="submit">Preview/預覽</button>
|
||||
<button class="btn btn-primary" type="submit">Submit/送出</button>
|
||||
<button class="btn" type="reset">Cancel/取消</button>
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%>
|
||||
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
|
||||
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
|
||||
</div>
|
||||
</div>
|
||||
<!--Post End-->
|
||||
<div class="form-actions">
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%>
|
||||
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
|
||||
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -5,7 +5,7 @@
|
||||
<div id="container" class="sign-in">
|
||||
<%= form_for :user, :url => user_session_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
|
||||
<div class="content">
|
||||
<p class="notice hide">Notice</p>
|
||||
<p class="notice label label-warning">Notice</p>
|
||||
<p class="alert hide">You need to sign in or sign up before continuing.</p>
|
||||
<div class="main">
|
||||
<div class="control-group clear">
|
||||
|
||||
Reference in new issue
Block a user