From 13de3a9e03065ce3434bc1f4316385dedd3b165e Mon Sep 17 00:00:00 2001 From: Tuyoshi Wiplay Date: Tue, 23 Sep 2014 15:56:53 -0300 Subject: [PATCH 1/3] =?UTF-8?q?indenta=C3=A7=C3=A3o=20window.pc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/core/window.pc.js | 290 +++++++++++++++------------------- 1 file changed, 129 insertions(+), 161 deletions(-) diff --git a/src/windows/core/window.pc.js b/src/windows/core/window.pc.js index 39a1901..eb0ee09 100644 --- a/src/windows/core/window.pc.js +++ b/src/windows/core/window.pc.js @@ -1,162 +1,130 @@ -$(function(){ - var $t = function (selector){ return $("#JtuyoshiCrop").find(selector); }; - var SelectMudar_Orientacao=function () { - - if ($t("#SelectOrientacao").val()=="Horizontal") - { - - if ($t("#SelectProporcao").val()=="box") { - - var CH = (($t("#Principal").height() / 100) * 80); - var CW = (CH * 4) / 3; - - if(CW>$t("#Principal").width()) - { - CW = (($t("#Principal").width() / 100) * 80); - CH = (CW / 4) * 3; - } - - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300); - $t("#SelecaoRecorte") - .resizable("destroy") - .resizable({ - containment : "parent", - aspectRatio : 4/3, - minWidth : 100, - minHeight : 100 - }); - - - } else if ($t("#SelectProporcao").val()=="wide"){ - var CW = ($t("#Principal").width() / 100) * 80; - var CH = (CW / 16) * 9; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300); - $t("#SelecaoRecorte") - .resizable("destroy") - .resizable({ - containment : "parent", - aspectRatio : 16/9, - minWidth : 100, - minHeight : 100 - }); - - - } else{ - - if($t("#Principal").width()<$t("#Principal").height()){ - var CW = ($t("#Principal").width() / 100) * 80; - var CH = CW; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - } else { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = CH; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - }; - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300) - .resizable("destroy") - .resizable({ - containment : "parent", - minWidth :100, - minHeight :100 - }); - } - } else { - if ($t("#SelectProporcao").val()=="box") { - - - var CH = (($t("#Principal").height() / 100) * 60); - var CW = (CH * 3) / 4; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300) - .resizable("destroy") - .resizable({ - containment : "parent", - aspectRatio : 3/4, - minWidth : 100, - minHeight : 100 - }); - - - - $t("#SelecaoRecorte").resizable("option", "aspectRatio", 3 / 4); - - } else if ($t("#SelectProporcao").val()=="wide"){ - var CH = (($t("#Principal").height() / 100) * 80); - var CW = (CH * 9) / 16; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300) - .resizable("destroy") - .resizable({ - containment : "parent", - aspectRatio : 9/16, - minWidth : 100, - minHeight : 100 - }); - - } else { - - if($t("#Principal").width()<$t("#Principal").height()){ - var CW = ($t("#Principal").width() / 100) * 80; - var CH = CW; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - } else { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = CH; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); - }; - $t("#SelecaoRecorte").stop().animate({ - "left": CX, - "top": CY, - "width": CW, - "height": CH - }, 300) - .resizable("destroy") - .resizable({ - containment : "parent", - minWidth :100, - minHeight :100 - }); - } - } - }; - - $t("#SelectOrientacao, #SelectProporcao").change(function(){ - SelectMudar_Orientacao(); - }); - +$(function() { + var $t = function(selector) { + return $("#JtuyoshiCrop").find(selector) + }; + var SelectMudar_Orientacao = function() { + if ($t("#SelectOrientacao").val() == "Horizontal") { + if ($t("#SelectProporcao").val() == "box") { + var CH = (($t("#Principal").height() / 100) * 80); + var CW = (CH * 4) / 3; + if (CW > $t("#Principal").width()) { + CW = (($t("#Principal").width() / 100) * 80); + CH = (CW / 4) * 3 + } + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2); + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300); + $t("#SelecaoRecorte").resizable("destroy").resizable({ + containment: "parent", + aspectRatio: 4 / 3, + minWidth: 100, + minHeight: 100 + }) + } else if ($t("#SelectProporcao").val() == "wide") { + var CW = ($t("#Principal").width() / 100) * 80; + var CH = (CW / 16) * 9; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2); + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300); + $t("#SelecaoRecorte").resizable("destroy").resizable({ + containment: "parent", + aspectRatio: 16 / 9, + minWidth: 100, + minHeight: 100 + }) + } else { + if ($t("#Principal").width() < $t("#Principal").height()) { + var CW = ($t("#Principal").width() / 100) * 80; + var CH = CW; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2) + } else { + var CH = (($t("#Principal").height() / 100) * 80); + var CW = CH; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2) + }; + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300).resizable("destroy").resizable({ + containment: "parent", + minWidth: 100, + minHeight: 100 + }) + } + } else { + if ($t("#SelectProporcao").val() == "box") { + var CH = (($t("#Principal").height() / 100) * 60); + var CW = (CH * 3) / 4; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2); + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300).resizable("destroy").resizable({ + containment: "parent", + aspectRatio: 3 / 4, + minWidth: 100, + minHeight: 100 + }); + $t("#SelecaoRecorte").resizable("option", "aspectRatio", 3 / 4) + } else if ($t("#SelectProporcao").val() == "wide") { + var CH = (($t("#Principal").height() / 100) * 80); + var CW = (CH * 9) / 16; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2); + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300).resizable("destroy").resizable({ + containment: "parent", + aspectRatio: 9 / 16, + minWidth: 100, + minHeight: 100 + }) + } else { + if ($t("#Principal").width() < $t("#Principal").height()) { + var CW = ($t("#Principal").width() / 100) * 80; + var CH = CW; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2) + } else { + var CH = (($t("#Principal").height() / 100) * 80); + var CW = CH; + var CX = (($t("#Principal").width() - CW) / 2); + var CY = (($t("#Principal").height() - CH) / 2) + }; + $t("#SelecaoRecorte").stop().animate({ + "left": CX, + "top": CY, + "width": CW, + "height": CH + }, 300).resizable("destroy").resizable({ + containment: "parent", + minWidth: 100, + minHeight: 100 + }) + } + } + }; + $t("#SelectOrientacao, #SelectProporcao").change(function() { + SelectMudar_Orientacao() + }) }); \ No newline at end of file From fb09b0c322291c2db49f5ad6740ed2eae4d0796d Mon Sep 17 00:00:00 2001 From: Tuyoshi Casa Date: Wed, 24 Sep 2014 01:33:48 -0300 Subject: [PATCH 2/3] =?UTF-8?q?corre=C3=A7=C3=A3o=20bug=20require=5Fonce?= =?UTF-8?q?=20das=20paginas=20php=20com=20barra=20normal.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/php/crop.php | 2 +- src/php/upload.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/php/crop.php b/src/php/crop.php index a97edcc..085941a 100644 --- a/src/php/crop.php +++ b/src/php/crop.php @@ -1,6 +1,6 @@ Date: Fri, 26 Sep 2014 10:09:15 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Corre=C3=A7=C3=A3o=20do=20bug=20estoro=20da?= =?UTF-8?q?=20div=20#SelecaoRecorte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jquery.picture.cut.js | 12 +++--- src/windows/core/window.pc.js | 74 ++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/src/jquery.picture.cut.js b/src/jquery.picture.cut.js index dea8e3f..36e3970 100644 --- a/src/jquery.picture.cut.js +++ b/src/jquery.picture.cut.js @@ -324,6 +324,7 @@ $(function() { var TuyoshiCrop = function(element, response) { var response = response; var MontarSelecaoRecorte = function(SelecaoRecorte, state) { + var ElemSelectProporcao,ElemSelectOrientacao; var Swidth = (response.currentWidth / 100) * 80; var Sheight = (Swidth / 16) * 9; SelecaoRecorte.css({ @@ -332,9 +333,9 @@ $(function() { "left": (response.currentWidth - Swidth) / 2, "top": (response.currentHeight - Sheight) / 2 }); - if (state == "create") { - var ElemSelectProporcao = $("#JtuyoshiCrop #SelectProporcao"); - var ElemSelectOrientacao = $("#JtuyoshiCrop #SelectOrientacao"); + ElemSelectProporcao = $("#JtuyoshiCrop #SelectProporcao"); + ElemSelectOrientacao = $("#JtuyoshiCrop #SelectOrientacao"); + if (state == "create") { if (Options.CropModes.widescreen || Options.CropModes.letterbox || Options.CropModes.free) { ElemSelectProporcao.show() } else { @@ -404,8 +405,9 @@ $(function() { "height": Sheight, "left": (response.currentWidth - Swidth) / 2, "top": (response.currentHeight - Sheight) / 2 - }) - } + }); + }; + ElemSelectProporcao.change(); }; var Redimencionar_Janela = function() { if ((response.currentWidth + 80) > 410) { diff --git a/src/windows/core/window.pc.js b/src/windows/core/window.pc.js index eb0ee09..bdaa36e 100644 --- a/src/windows/core/window.pc.js +++ b/src/windows/core/window.pc.js @@ -3,16 +3,17 @@ $(function() { return $("#JtuyoshiCrop").find(selector) }; var SelectMudar_Orientacao = function() { + var CW,CH,CX,CY; if ($t("#SelectOrientacao").val() == "Horizontal") { if ($t("#SelectProporcao").val() == "box") { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = (CH * 4) / 3; + CH = (($t("#Principal").height() / 100) * 80); + CW = (CH * 4) / 3; if (CW > $t("#Principal").width()) { CW = (($t("#Principal").width() / 100) * 80); CH = (CW / 4) * 3 } - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2); $t("#SelecaoRecorte").stop().animate({ "left": CX, "top": CY, @@ -26,10 +27,19 @@ $(function() { minHeight: 100 }) } else if ($t("#SelectProporcao").val() == "wide") { - var CW = ($t("#Principal").width() / 100) * 80; - var CH = (CW / 16) * 9; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); + if ($t("#Principal").width() < $t("#Principal").height()) { + CW = ($t("#Principal").width() / 100) * 80; + CH = (CW / 16) * 9; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2); + } else { + + CH = ($t("#Principal").height() / 100) * 80; + CW = (CH*16)/9; + + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2); + }; $t("#SelecaoRecorte").stop().animate({ "left": CX, "top": CY, @@ -44,15 +54,15 @@ $(function() { }) } else { if ($t("#Principal").width() < $t("#Principal").height()) { - var CW = ($t("#Principal").width() / 100) * 80; - var CH = CW; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2) + CW = ($t("#Principal").width() / 100) * 80; + CH = CW; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2) } else { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = CH; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2) + CH = (($t("#Principal").height() / 100) * 80); + CW = CH; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2) }; $t("#SelecaoRecorte").stop().animate({ "left": CX, @@ -67,10 +77,10 @@ $(function() { } } else { if ($t("#SelectProporcao").val() == "box") { - var CH = (($t("#Principal").height() / 100) * 60); - var CW = (CH * 3) / 4; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); + CH = (($t("#Principal").height() / 100) * 60); + CW = (CH * 3) / 4; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2); $t("#SelecaoRecorte").stop().animate({ "left": CX, "top": CY, @@ -84,10 +94,10 @@ $(function() { }); $t("#SelecaoRecorte").resizable("option", "aspectRatio", 3 / 4) } else if ($t("#SelectProporcao").val() == "wide") { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = (CH * 9) / 16; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2); + CH = (($t("#Principal").height() / 100) * 80); + CW = (CH * 9) / 16; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2); $t("#SelecaoRecorte").stop().animate({ "left": CX, "top": CY, @@ -101,15 +111,15 @@ $(function() { }) } else { if ($t("#Principal").width() < $t("#Principal").height()) { - var CW = ($t("#Principal").width() / 100) * 80; - var CH = CW; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2) + CW = ($t("#Principal").width() / 100) * 80; + CH = CW; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2) } else { - var CH = (($t("#Principal").height() / 100) * 80); - var CW = CH; - var CX = (($t("#Principal").width() - CW) / 2); - var CY = (($t("#Principal").height() - CH) / 2) + CH = (($t("#Principal").height() / 100) * 80); + CW = CH; + CX = (($t("#Principal").width() - CW) / 2); + CY = (($t("#Principal").height() - CH) / 2) }; $t("#SelecaoRecorte").stop().animate({ "left": CX,