Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuyoshi Wiplay committed Sep 26, 2014
2 parents d72488d + 794d000 commit 907e8a1
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 167 deletions.
12 changes: 7 additions & 5 deletions src/jquery.picture.cut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/php/crop.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once('core\PictureCut.php');
require_once('core/PictureCut.php');

try {

Expand Down
2 changes: 1 addition & 1 deletion src/php/upload.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once('core\PictureCut.php');
require_once('core/PictureCut.php');

try {

Expand Down
298 changes: 138 additions & 160 deletions src/windows/core/window.pc.js
Original file line number Diff line number Diff line change
@@ -1,162 +1,140 @@
$(function(){
var $t = function (selector){ return $("#JtuyoshiCrop").find(selector); };
var SelectMudar_Orientacao=function () {

if ($t("#SelectOrientacao").val()=="Horizontal")
{

if ($t("#SelectProporcao").val()=="box") {
$(function() {
var $t = function(selector) {
return $("#JtuyoshiCrop").find(selector)
};
var SelectMudar_Orientacao = function() {
var CW,CH,CX,CY;
if ($t("#SelectOrientacao").val() == "Horizontal") {
if ($t("#SelectProporcao").val() == "box") {
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
}
CX = (($t("#Principal").width() - CW) / 2);
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") {
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;

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();
});

CX = (($t("#Principal").width() - CW) / 2);
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()) {
CW = ($t("#Principal").width() / 100) * 80;
CH = CW;
CX = (($t("#Principal").width() - CW) / 2);
CY = (($t("#Principal").height() - CH) / 2)
} else {
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,
"top": CY,
"width": CW,
"height": CH
}, 300).resizable("destroy").resizable({
containment: "parent",
minWidth: 100,
minHeight: 100
})
}
} else {
if ($t("#SelectProporcao").val() == "box") {
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,
"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") {
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,
"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()) {
CW = ($t("#Principal").width() / 100) * 80;
CH = CW;
CX = (($t("#Principal").width() - CW) / 2);
CY = (($t("#Principal").height() - CH) / 2)
} else {
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,
"top": CY,
"width": CW,
"height": CH
}, 300).resizable("destroy").resizable({
containment: "parent",
minWidth: 100,
minHeight: 100
})
}
}
};
$t("#SelectOrientacao, #SelectProporcao").change(function() {
SelectMudar_Orientacao()
})
});

0 comments on commit 907e8a1

Please sign in to comment.