Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add zoomer editor placehoder

  • Loading branch information...
commit ca2821cb7cc20ecd7f7dd99be9b7c9b90aec593f 1 parent 2193117
@matfiz authored
View
5 app/assets/javascripts/admin/spree_variant_options.js
@@ -0,0 +1,5 @@
+//= require "swfobject"
+//= require "admin/zoomer"
+
+
+
View
11 app/assets/javascripts/admin/zoomer.js
@@ -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});
+}
+})
+
View
BIN  app/assets/javascripts/swfs/zoomer_editor.swf
Binary file not shown
View
2  app/controllers/spree/admin/images_controller_decorator.rb
@@ -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
View
7 app/views/spree/admin/images/zoomer.html.haml
@@ -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'
View
2  lib/spree_variant_options/version.rb
@@ -1,3 +1,3 @@
module SpreeVariantOptions
- VERSION = "0.4.7"
+ VERSION = "0.4.8"
end
Please sign in to comment.
Something went wrong with that request. Please try again.