Permalink
Browse files

Add zoomer editor placehoder

  • Loading branch information...
1 parent 2193117 commit ca2821cb7cc20ecd7f7dd99be9b7c9b90aec593f @matfiz committed May 1, 2012
@@ -0,0 +1,5 @@
+//= require "swfobject"
+//= require "admin/zoomer"
+
+
+
@@ -0,0 +1,11 @@
+jQuery(document).ready(function($){
+ if (window.location.href.match(/\w*zoomer/).length > 0) {
+ var newImg = $("#image_location").data("imageSmall");
+ var imgName = newImg.replace(/\/\w*\/\w*\/\w*\/\w*\//,'');
+ var imgPath = newImg.replace(/\d*\/\w*\/\w*.\w{3}\?\d*$/,'');
+ var image_id = $("#image_location").data("imageId");
+
+ swfobject.embedSWF("/assets/swfs/zoomer_editor.swf", "zoomer_placehoder", "552", "460", "11.2.202","expressInstall.swf",{path_:imgPath, img_:imgName, id_:image_id});
+}
+})
+
Binary file not shown.
@@ -3,7 +3,7 @@ module Admin
ImagesController.class_eval do
def zoomer
@product = Spree::Product.find_by_permalink!(params[:product_id])
- @image = Spree::Image.find(params[:image_id])
+ @image = Spree::Image.find(params[:image_id]) if params[:image_id]
end
def read_data
@@ -3,7 +3,8 @@
%h2 Edycja opisów na zdjęciu produktu/wariantu
%p.small
Tu będzie opis działania zoomera
-%p
- = link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:large)
+%div{:data => {:"image-small" => "#{@image.attachment.url(:small)}", :"image-id" => "#{@image.id}" }, :id => "image_location"}
+ =# link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:large)
+%div#zoomer_placehoder
%p.form-buttons{"data-hook" => "buttons"}
- = link_to t(:cancel), admin_product_images_url(@product), :id => 'cancel_link'
+ = button_link_to "OK", admin_product_images_url(@product), :id => 'cancel_link'
@@ -1,3 +1,3 @@
module SpreeVariantOptions
- VERSION = "0.4.7"
+ VERSION = "0.4.8"
end

0 comments on commit ca2821c

Please sign in to comment.