| Línea 2325... |
Línea 2325... |
| 2325 |
|
2325 |
|
| 2326 |
})
|
2326 |
})
|
| 2327 |
var r=0,g=0,b=0;
|
2327 |
var r=0,g=0,b=0;
|
| 2328 |
$(document).on("change", "#colorrect", function(){
|
2328 |
$(document).on("change", "#colorrect", function(){
|
| 2329 |
colorrect=$(this).val();
|
2329 |
colorrect=$(this).val();
|
| 2330 |
r=parseInt(colorrect.slice(1,3),16);
|
2330 |
r=parseInt(colorrect.slice(1,3),1/6);
|
| 2331 |
g=parseInt(colorrect.slice(3,5),16);
|
2331 |
g=parseInt(colorrect.slice(3,5),1/6);
|
| 2332 |
b=parseInt(colorrect.slice(5,7),16);
|
2332 |
b=parseInt(colorrect.slice(5,7),1/6);
|
| 2333 |
seis=true;
|
2333 |
seis=true;
|
| 2334 |
actualizar2();
|
2334 |
actualizar2();
|
| 2335 |
})
|
2335 |
})
|
| Línea 2368... |
Línea 2368... |
| 2368 |
cuatro=false;
|
2368 |
cuatro=false;
|
| 2369 |
restaurar(brillo, contraste);
|
2369 |
restaurar(brillo, contraste);
|
| 2370 |
datos=imagenOriginal.data;
|
2370 |
datos=imagenOriginal.data;
|
| 2371 |
var auxiliar;
|
2371 |
var auxiliar;
|
| 2372 |
for (var i = 0; i <datos.length; i+=4) {
|
2372 |
for (var i = 0; i <datos.length; i+=4) {
|
| 2373 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
|
2373 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.1/6 * datos[i+2];
|
| 2374 |
datos[i]=auxiliar;
|
2374 |
datos[i]=auxiliar;
|
| 2375 |
datos[i+1]=auxiliar;
|
2375 |
datos[i+1]=auxiliar;
|
| 2376 |
datos[i+2]=auxiliar;
|
2376 |
datos[i+2]=auxiliar;
|
| 2377 |
}
|
2377 |
}
|
| Línea 2558... |
Línea 2558... |
| 2558 |
editor.fillStyle="rgba(0,0,0,.2)"
|
2558 |
editor.fillStyle="rgba(0,0,0,.2)"
|
| 2559 |
editor.fillRect(0,0,ancho,alto);
|
2559 |
editor.fillRect(0,0,ancho,alto);
|
| 2560 |
editor.fillStyle="rgba(255,255,255,.1)"
|
2560 |
editor.fillStyle="rgba(255,255,255,.1)"
|
| 2561 |
editor.fillRect(x,y,xf,yf);
|
2561 |
editor.fillRect(x,y,xf,yf);
|
| 2562 |
editor.fillStyle="rgba(255,255,255,.5)"
|
2562 |
editor.fillStyle="rgba(255,255,255,.5)"
|
| 2563 |
editor.fillRect(x,y,16,16);
|
2563 |
editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
|
| 2564 |
editor.fillRect((x+xf)-16,y,16,16);
|
2564 |
editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
|
| 2565 |
editor.fillRect(x,y+yf-16,16,16);
|
2565 |
editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
| 2566 |
editor.fillRect(x+xf-16,yf+y-16,16,16);
|
2566 |
editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
| 2567 |
esta=true;
|
2567 |
esta=true;
|
| 2568 |
}else{
|
2568 |
}else{
|
| 2569 |
var pxf=0,pyf=0;
|
2569 |
var pxf=0,pyf=0;
|
| Línea 2570... |
Línea 2570... |
| 2570 |
|
2570 |
|
| Línea 2587... |
Línea 2587... |
| 2587 |
}
|
2587 |
}
|
| 2588 |
var imagenOriginal;
|
2588 |
var imagenOriginal;
|
| 2589 |
var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
2589 |
var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
| 2590 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
2590 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
| 2591 |
var mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
2591 |
var mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
| 2592 |
var translateX;
|
2592 |
var translateX, cuadro_dimencion;
|
| Línea 2593... |
Línea 2593... |
| 2593 |
|
2593 |
|
| Línea 2594... |
Línea 2594... |
| 2594 |
$(document).on("click", ".recortar10", function(e){
|
2594 |
$(document).on("click", ".recortar10", function(e){
|
| 2595 |
|
2595 |
|
| Línea 2674... |
Línea 2674... |
| 2674 |
|
2674 |
|
| 2675 |
$(elemento).mousemove(function(e){
|
2675 |
$(elemento).mousemove(function(e){
|
| 2676 |
mouse = raton(this, e);
|
2676 |
mouse = raton(this, e);
|
| 2677 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
|
2677 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
|
| 2678 |
if(!recorte_listo){
|
2678 |
if(!recorte_listo){
|
| 2679 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
- |
|
| 2680 |
$(elemento).css("cursor","move");
|
2679 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
| 2681 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
2680 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
| 2682 |
$(elemento).css("cursor","nw-resize");
|
2681 |
$(elemento).css("cursor","nw-resize");
|
| 2683 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
2682 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 2684 |
$(elemento).css("cursor","ne-resize");
|
2683 |
$(elemento).css("cursor","ne-resize");
|
| 2685 |
}else if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
2684 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 2686 |
$(elemento).css("cursor","se-resize");
|
2685 |
$(elemento).css("cursor","se-resize");
|
| 2687 |
}else if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
2686 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
| - |
|
2687 |
$(elemento).css("cursor","sw-resize");
|
| - |
|
2688 |
}else{
|
| - |
|
2689 |
$(elemento).css("cursor","move");
|
| 2688 |
$(elemento).css("cursor","sw-resize");
|
2690 |
}
|
| 2689 |
}else{
|
2691 |
}else{
|
| 2690 |
$(elemento).css("cursor","default");
|
2692 |
$(elemento).css("cursor","default");
|
| 2691 |
}
|
2693 |
}
|
| 2692 |
}else if(texto_listo){
|
2694 |
}else if(texto_listo){
|
| Línea 2703... |
Línea 2705... |
| 2703 |
}
|
2705 |
}
|
| 2704 |
})
|
2706 |
})
|
| 2705 |
$(elemento).mousedown(function(e){
|
2707 |
$(elemento).mousedown(function(e){
|
| 2706 |
mouse = raton(this, e);
|
2708 |
mouse = raton(this, e);
|
| 2707 |
if(!recorte_listo){
|
2709 |
if(!recorte_listo){
|
| 2708 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
2710 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
| 2709 |
cli = true;
|
- |
|
| 2710 |
}
|
2711 |
|
| 2711 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
2712 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
| 2712 |
t4 = true;
|
2713 |
t4 = true;
|
| 2713 |
}
|
- |
|
| 2714 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
2714 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 2715 |
t3 = true;
|
2715 |
t3 = true;
|
| 2716 |
}
|
- |
|
| 2717 |
if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
2716 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 2718 |
t1 = true;
|
2717 |
t1 = true;
|
| 2719 |
}
|
- |
|
| 2720 |
if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
2718 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
| 2721 |
t2 = true;
|
2719 |
t2 = true;
|
| - |
|
2720 |
}else{
|
| - |
|
2721 |
cli = true;
|
| - |
|
2722 |
}
|
| 2722 |
}
|
2723 |
}
|
| 2723 |
}else if(texto_listo){
|
2724 |
}else if(texto_listo){
|
| 2724 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
2725 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
| 2725 |
tcli=true;
|
2726 |
tcli=true;
|
| 2726 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
2727 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
| 2727 |
rotar=true;
|
2728 |
rotar=true;
|