jQuery(function($) { var effect = 0; var rotate = 0; var deg = 0; var mirrored_v = 0; var mirrored_h = 0; var data = new Array(); var effects = new Array(); var values = new Array(); $('#rotate_left').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; deg = deg + 90; $('#FotoliaOrder_rotate').val(deg); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); return false; }) $('#rotate_right').click(function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; deg = deg - 90; $('#FotoliaOrder_rotate').val(deg); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); $('#FotoliaOrder_rotate').val(deg); return false; }) $('#mirror_v').click(function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; (mirrored_v) ? mirrored_v = 0:mirrored_v = 1; $('#FotoliaOrder_mirror_v').val(mirrored_v); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); return false; }) $('#mirror_h').click(function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; /* odwroc zaznaczenie */ (mirrored_h) ? mirrored_h = 0:mirrored_h = 1; /* zapisz odbicie w formularzu */ $('#FotoliaOrder_mirror_h').val(mirrored_h); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); return false; }); $('#effect_bw').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; $('#FotoliaOrder_effect').val(1); $('.kreator_menu_single.effects ul li').css('background-image', 'none'); $(this).parent('li').css('background-image', 'url(/images/kreator_menu_bg_selected.png)'); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); $.post("/index.php/fotoliaOrder/updateUserOrder", $("#fotolia-order-form").serialize() ); return false; }); $('#effect_sepia').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; $('#FotoliaOrder_effect').val(2); $('.kreator_menu_single.effects ul li').css('background-image', 'none'); $(this).parent('li').css('background-image', 'url(/images/kreator_menu_bg_selected.png)'); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); $.post("/index.php/fotoliaOrder/updateUserOrder", $("#fotolia-order-form").serialize() ); return false; }); $('#effect_warm').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; $('#FotoliaOrder_effect').val(3); $('.kreator_menu_single.effects ul li').css('background-image', 'none'); $(this).parent('li').css('background-image', 'url(/images/kreator_menu_bg_selected.png)'); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); $.post("/index.php/fotoliaOrder/updateUserOrder", $("#fotolia-order-form").serialize() ); return false; }); $('#effect_cold').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); effects = []; values = []; $('#FotoliaOrder_effect').val(4); $('.kreator_menu_single.effects ul li').css('background-image', 'none'); $(this).parent('li').css('background-image', 'url(/images/kreator_menu_bg_selected.png)'); /* pobierz efekty */ rotate = $('#FotoliaOrder_rotate').val(); if (parseInt(rotate)) { effects.push('rotate'); values.push(rotate); } mirror_h = $('#FotoliaOrder_mirror_h').val(); if (parseInt(mirror_h)) { effects.push('mirror_h'); values.push(1); } mirror_v = $('#FotoliaOrder_mirror_v').val(); if (parseInt(mirror_v)) { effects.push('mirror_v'); values.push(1); } data = { 'type':effects, 'value':values, 'id':2572 } effect = $('#FotoliaOrder_effect').val(); if (effect > 0) data['effect'] = effect; $('.kreator_panel').html('

'); $.ajax({ type: "POST", url: "/index.php/photoFotolia/renderPhoto", data: data, success: function(answer){ $('.kreator_panel').html(answer); } }); $.post("/index.php/fotoliaOrder/updateUserOrder", $("#fotolia-order-form").serialize() ); return false; }); $('#effect_none').live('click',function() { // ias = $('#cropbox').imgAreaSelect({ // remove: true // }); rotate = $('#FotoliaOrder_rotate').val(); $('.kreator_menu_single.effects ul li').css('background-image', 'none'); $(this).parent('li').css('background-image', 'url(/images/kreator_menu_bg_selected.png)'); $('.kreator_panel').html('

'); var url = "/index.php/photoFotolia/renderPhoto/id/2572"; if (rotate > 0) url = url+'/rotate/90'; $.get(url, null, function(data){ $('.kreator_panel').html(data); }); $('#FotoliaOrder_effect').val(0); $.post("/index.php/fotoliaOrder/updateUserOrder", $("#fotolia-order-form").serialize() ); return false; }); });