Sha256: 977bdc699e92c51443ef9833cbe45114bad1b3ee80c1ce446397739bb7d78f7f
Contents?: true
Size: 1.34 KB
Versions: 5
Compression:
Stored size: 1.34 KB
Contents
.yui-b -box :class => "alt first_alt" do = link_to :profile_photo_change.l, upload_profile_photo_user_path(@user) -box do %h3=:profile_photo.l #previewWrap #yui-main -box :class => "yui-b" do %h3= :profile_photo_crop.l = image_tag( @photo.photo.url, :id => 'photo' ) = error_messages_for :photo = form_for(:photo, :url => crop_profile_photo_user_path(@user), :method => :put, :html => { :class => "MainForm" }) do |f| - [:crop_x, :crop_y, :crop_w, :crop_h].each do |attribute| %input{ :type=>"hidden", :name=>attribute, :id=>attribute, :size=>"4"} %p = submit_tag :update.l = :or.l = link_to :cancel_and_go_back_to_my_photos.l, user_photos_path(@user) -content_for :head_css -content_for :end_javascript do = javascript_include_tag "cropper" :javascript function onEndCrop( coords, dimensions ) { $( 'crop_x' ).value = coords.x1; $( 'crop_y' ).value = coords.y1; $( 'crop_w' ).value = dimensions.width; $( 'crop_h' ).value = dimensions.height; } function loadCropper() { new Cropper.ImgWithPreview( 'photo', { previewWrap: 'previewWrap', minWidth: 100, minHeight: 100, ratioDim: { x: 290, y: 290 }, onEndCrop: onEndCrop } ); } Event.observe( window, 'load', function() { loadCropper(); } );
Version data entries
5 entries across 5 versions & 1 rubygems