| Línea 1734... |
Línea 1734... |
| 1734 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
1734 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
| 1735 |
e.preventDefault();
|
1735 |
e.preventDefault();
|
| 1736 |
gridTable.api().ajax.reload(null, false);
|
1736 |
gridTable.api().ajax.reload(null, false);
|
| 1737 |
});
|
1737 |
});
|
| Línea -... |
Línea 1738... |
| - |
|
1738 |
|
| - |
|
1739 |
/*Script del editor (Aqui comienza el cielo y la tierra) */
|
| - |
|
1740 |
var imagenServidorNoticia;
|
| - |
|
1741 |
var scroll_altura,viente;
|
| - |
|
1742 |
var nombre_user = $(".perfil_u_nombre").text();
|
| - |
|
1743 |
var primer_nombre = nombre_user.split(" ")[0];
|
| - |
|
1744 |
var nuevoHtmlImagen='<div class="articulo_noticia animated fadeIn"><div class="pasos"><div class="titulo_pasos animated fadeInDown delay-04 fast">LABEL_STEP_1</div><div class="paso_opcion"><div class="responsing_cut"><div class="icon_cut"><span class="fa fa-scissors"></span></div><div class="contenido_cut"><div class="animated fadeInRight delay-04 fast"><div><div class="titulo_cut"><div>LABEL_CUT</div><div class="fa fa-times" id="cerrar_cut_modal"></div></div><div class="opcion_editor recortar10"><div>LABEL_CUT</div><div id="blockCelda"><span class="fa fa-lock"></span></div></div></div></div></div></div><div class="responsing_text"><div class="icon_text"><span class="fa fa-text-width"></span></div><div class="contenido_text"><div class="animated fadeInRight delay-04 fast"><div class="texto"><div class="titulo_text"><div>LABEL_ADD_TEXT</div><div class="fa fa-times" id="cerrar_text_modal"></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"><div class="fonts"><div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"></div><div class="fonts"><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">A</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"><div class="rectangulo">C</div></div><input type="color" name="" id="colorrect" value="#000000" class="" data-tooltip="Color del fondo"> <input type="number" name="" id="opacidad" max="100" min="1" step="1" value="100" class="" data-tooltip="Transparensia del fondo"></div><div class="fonts_style"><div class="fs at" id="arial">LABEL_FONT_ARIAL</div><div class="fs" id="calibri">LABEL_FONT_CALIBRI</div><div class="fs" id="forte">LABEL_FONT_FORTE</div><div class="fs" id="impact">LABEL_FONT_IMPACT</div><div class="fs" id="jokerman">LABEL_FONT_JOKERMAN</div><div class="fs" id="mb">LABEL_FONT_MV_BOLI</div><div class="fs" id="tnr">LABEL_FONT_TIMES_NEW_ROMAN</div><div class="fs" id="verdana">LABEL_FONT_VERDANA</div><div class="fs" id="vivaldi">LABEL_FONT_VIVALDI</div></div></div></div></div></div><div class="responsing_filtros"><div class="icon_filter"><span class="fa fa-eyedropper"></span></div><div class="contenido_filter"><div class="titulo_filtro"><div>LABEL_FILTERS</div><div class="fa fa-times" id="cerrar_filter_modal"></div></div><div class="opciones_imagen"><div class="opcion_editor oa" id="normal">LABEL_FILTER_NORMAL</div><div class="opcion_editor" id="noche">LABEL_FILTER_NIGHT</div><div class="opcion_editor" id="sa">LABEL_FILTER_SAINT_ANA</div><div class="opcion_editor" id="crema">LABEL_FILTER_CREAM</div><div class="opcion_editor" id="magia">LABEL_FILTER_MAGIC</div><div class="opcion_editor" id="relieve">LABEL_FILTER_RELIEF</div><div class="opcion_editor" id="luz">LABEL_FILTER_LIGHT</div><div class="opcion_editor" id="saturacion">LABEL_FILTER_SATURATION</div><div class="opcion_editor" id="retoque">LABEL_FILTER_RETOUCH</div><div class="opcion_editor" id="orange">LABEL_FILTER_ORANGE</div><div class="opcion_editor" id="setenta">LABEL_FILTER_WIND</div><div class="opcion_editor" id="desierto">LABEL_FILTER_DESERT</div><div class="opcion_editor" id="bosque">LABEL_FILTER_FOREST</div><div class="opcion_editor" id="villa">LABEL_FILTER_TOWN</div><div class="opcion_editor" id="rosa">LABEL_FILTER_PINK</div><div class="opcion_editor" id="historia">LABEL_FILTER_HISTORY</div><div class="opcion_editor" id="gris">LABEL_FILTER_GRAY</div><div class="opcion_editor" id="lhs">LABEL_FILTER_OLD_PICTURE</div><div class="opcion_editor" id="encantador">LABEL_FILTER_CHARMING</div><div class="opcion_editor" id="emocion">LABEL_FILTER_EMOTION</div><div class="opcion_editor" id="beige">LABEL_FILTER_BEIGE</div><div class="opcion_editor" id="fine">LABEL_FILTER_FINE</div><div class="opcion_editor" id="lord">LABEL_FILTER_LORD</div><div class="opcion_editor" id="70">LABEL_FILTER_70S</div><div class="opcion_editor" id="arbol">LABEL_FILTER_TREE</div><div class="opcion_editor" id="verano">LABEL_FILTER_SUMMER</div><div class="opcion_editor" id="cf">LABEL_FILTER_COLD_WEATHER</div><div class="opcion_editor" id="angeles">LABEL_FILTER_ANGELS</div><div class="opcion_editor" id="caliente">LABEL_FILTER_HOT</div><div class="opcion_editor" id="otono">LABEL_FILTER_FALL</div><div class="opcion_editor" id="marzo">LABEL_FILTER_MARCH</div><div class="opcion_editor" id="pera">LABEL_FILTER_PEAR</div><div class="opcion_editor" id="comun">LABEL_FILTER_COMMON</div><div class="opcion_editor" id="oro">LABEL_FILTER_GOLD</div><div class="opcion_editor" id="gotico">LABEL_FILTER_GOTHIC</div><div class="opcion_editor" id="forestal">LABEL_FILTER_FORESTRY</div><div class="opcion_editor" id="luna">LABEL_FILTER_MOON</div><div class="opcion_editor" id="fiesta">LABEL_FILTER_PARTY</div></div></div></div><div class="volver"><span class="icon-undo"></span>LABEL_START_OVER</div><div class="paso_1 paso animated bounceInDown delay-04 fast">1</div><div class="paso_2 a1 animated bounceInDown delay-06 fast">2</div><div class="paso_2 b1 animated bounceInDown delay-08 fast">3</div></div></div><div class="editor_imagenes"><div class="fondo_oscuro"></div><div class="editor_imagenes2"><div class="filtros animated fadeInLeft delay-04 fast"><div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div><div class="opciones_imagen"><div class="opcion_editor oa" id="normal">LABEL_FILTER_NORMAL</div><div class="opcion_editor" id="noche">LABEL_FILTER_NIGHT</div><div class="opcion_editor" id="sa">LABEL_FILTER_SAINT_ANA</div><div class="opcion_editor" id="crema">LABEL_FILTER_CREAM</div><div class="opcion_editor" id="magia">LABEL_FILTER_MAGIC</div><div class="opcion_editor" id="relieve">LABEL_FILTER_RELIEF</div><div class="opcion_editor" id="luz">LABEL_FILTER_LIGHT</div><div class="opcion_editor" id="saturacion">LABEL_FILTER_SATURATION</div><div class="opcion_editor" id="retoque">LABEL_FILTER_RETOUCH</div><div class="opcion_editor" id="orange">LABEL_FILTER_ORANGE</div><div class="opcion_editor" id="setenta">LABEL_FILTER_WIND</div><div class="opcion_editor" id="desierto">LABEL_FILTER_DESERT</div><div class="opcion_editor" id="bosque">LABEL_FILTER_FOREST</div><div class="opcion_editor" id="villa">LABEL_FILTER_TOWN</div><div class="opcion_editor" id="rosa">LABEL_FILTER_PINK</div><div class="opcion_editor" id="historia">LABEL_FILTER_HISTORY</div><div class="opcion_editor" id="gris">LABEL_FILTER_GRAY</div><div class="opcion_editor" id="lhs">LABEL_FILTER_OLD_PICTURE</div><div class="opcion_editor" id="encantador">LABEL_FILTER_CHARMING</div><div class="opcion_editor" id="emocion">LABEL_FILTER_EMOTION</div><div class="opcion_editor" id="beige">LABEL_FILTER_BEIGE</div><div class="opcion_editor" id="fine">LABEL_FILTER_FINE</div><div class="opcion_editor" id="lord">LABEL_FILTER_LORD</div><div class="opcion_editor" id="70">LABEL_FILTER_70S</div><div class="opcion_editor" id="arbol">LABEL_FILTER_TREE</div><div class="opcion_editor" id="verano">LABEL_FILTER_SUMMER</div><div class="opcion_editor" id="cf">LABEL_FILTER_COLD_WEATHER</div><div class="opcion_editor" id="angeles">LABEL_FILTER_ANGELS</div><div class="opcion_editor" id="caliente">LABEL_FILTER_HOT</div><div class="opcion_editor" id="otono">LABEL_FILTER_FALL</div><div class="opcion_editor" id="marzo">LABEL_FILTER_MARCH</div><div class="opcion_editor" id="pera">LABEL_FILTER_PEAR</div><div class="opcion_editor" id="comun">LABEL_FILTER_COMMON</div><div class="opcion_editor" id="oro">LABEL_FILTER_GOLD</div><div class="opcion_editor" id="gotico">LABEL_FILTER_GOTHIC</div><div class="opcion_editor" id="forestal">LABEL_FILTER_FORESTRY</div><div class="opcion_editor" id="luna">LABEL_FILTER_MOON</div><div class="opcion_editor" id="fiesta">LABEL_FILTER_PARTY</div></div></div><div class="canvas_imagen"><div class="canvas recortar"><div class="canvas_subir" id="imagen_noticia"><span class="icon-plus fa fa-plus"></span>LABEL_DRAG_IMAGE_HERE</div></div></div><div class="modificar animated fadeInRight delay-04 fast"><div><div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors"></span>LABEL_CUT</div><div class="opcion_editor recortar10"><div>LABEL_CUT</div><div id="blockCelda"><span class="fa fa-lock"></span></div></div></div><div class="texto"><div class="titulo_texto"><span class="icon-plus fa fa-text-width"></span>LABEL_ADD_TEXT</div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"><div class="fonts"><div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"></div><div class="fonts"><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">A</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"><div class="rectangulo">C</div></div><input type="color" name="" id="colorrect" value="#000000" class="" data-tooltip="Color del fondo"> <input type="number" name="" id="opacidad" max="100" min="1" step="1" value="100" class="" data-tooltip="Transparensia del fondo"></div><div class="fonts_style"><div class="fs at" id="arial">LABEL_FONT_ARIAL</div><div class="fs" id="calibri">LABEL_FONT_CALIBRI</div><div class="fs" id="forte">LABEL_FONT_FORTE</div><div class="fs" id="impact">LABEL_FONT_IMPACT</div><div class="fs" id="jokerman">LABEL_FONT_JOKERMAN</div><div class="fs" id="mb">LABEL_FONT_MV_BOLI</div><div class="fs" id="tnr">LABEL_FONT_TIMES_NEW_ROMAN</div><div class="fs" id="verdana">LABEL_FONT_VERDANA</div><div class="fs" id="vivaldi">LABEL_FONT_VIVALDI</div></div></div></div></div><div class="botones_dimenciones"><div class="scale"><div class="dimenciones"><div id="ancho">1240px</div><div>x</div><div id="alto">720px</div></div><div class="porciento"><div id="menos_scale"><span class="icon-minus fa fa-minus"></span></div><div class="ps"><ul class="cantidades_scale"><li data-scale="2" class="as">200%</li><li data-scale="1" class="as">100%</li><li data-scale="0.75" class="as">75%</li><li data-scale="0.5" class="as">50%</li><li data-scale="0.25" class="as">25%</li></ul><div id="porciento_scale">50%</div></div><div id="mas_scale"><span class="icon-plus fa fa-plus"></span></div></div></div><div class="botones"><button class="boton_normal" id="ir_atras">LABEL_GO_BACK</button><button class="boton_normal" id="boton_recortar">LABEL_DATATABLE_SNEXT</button></div></div></div></div><dav class="fixed_noticia"></dav><dav class="cuadro_noticias animated bounceInUp delay-04" id="cuadro_noticias"><dav class="relative"><div class="titulo_topico">LABEL_TITLE_TOPIC</div><canvas class="imagen_noticias" id="imagen_noticias" width="320" height="480"></canvas></dav><div class="progreso d-flex align-items-center justify-content-between"><progress value="0" max="100"></progress><span class="ml-2">0.0%</span></div></dav>'
|
| - |
|
1745 |
|
| - |
|
1746 |
$(document).on("click", ".info_noticia", function(e){
|
| - |
|
1747 |
imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
| - |
|
1748 |
console.log(imagenServidorNoticia.split(','))
|
| - |
|
1749 |
$('.file').val(imagenServidorNoticia.split(',')[1]);
|
| - |
|
1750 |
console.log($('.file').val())
|
| - |
|
1751 |
$(".c1").addClass("paso");
|
| - |
|
1752 |
|
| - |
|
1753 |
|
| - |
|
1754 |
})
|
| - |
|
1755 |
var edit;
|
| - |
|
1756 |
function iniciarEditor(add=true, image=''){
|
| - |
|
1757 |
cortar=false;
|
| - |
|
1758 |
recorte_listo=false;
|
| - |
|
1759 |
texto="";
|
| - |
|
1760 |
seis=true;
|
| - |
|
1761 |
color="#ffffff";
|
| - |
|
1762 |
texto_listo=false,siete=false;
|
| - |
|
1763 |
uno=true;
|
| - |
|
1764 |
size=48;
|
| - |
|
1765 |
cinco=true;
|
| - |
|
1766 |
xf=320,yf =480;
|
| - |
|
1767 |
negritas=false, bold="";
|
| - |
|
1768 |
shadow = true, nueve=true;
|
| - |
|
1769 |
italic=false, ita="";
|
| - |
|
1770 |
rectangulo=false, diez=false;
|
| - |
|
1771 |
fontfamily="Arial";
|
| - |
|
1772 |
r=0,g=0,b=0,a=1;
|
| - |
|
1773 |
edit=add;
|
| - |
|
1774 |
console.log(edit)
|
| - |
|
1775 |
window.clearInterval(editorNoticia);
|
| - |
|
1776 |
setTimeout(function(){
|
| - |
|
1777 |
scroll_altura=$(".articulo_noticia").offset().top-110;
|
| - |
|
1778 |
anchoFondoOscuro = $(".articulo_noticia").width();
|
| - |
|
1779 |
altoFondoOscuro = $(".editor_imagenes").height();
|
| - |
|
1780 |
$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
|
| - |
|
1781 |
$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
|
| - |
|
1782 |
|
| - |
|
1783 |
},navegacion(nuevoHtmlImagen,edit,image));
|
| - |
|
1784 |
|
| - |
|
1785 |
}
|
| - |
|
1786 |
|
| - |
|
1787 |
$(document).on("click", ".volver", function(){
|
| - |
|
1788 |
var nombre_user = $(".perfil_u_nombre").text();
|
| - |
|
1789 |
var primer_nombre = nombre_user.split(" ")[0];
|
| - |
|
1790 |
cortar=false;
|
| - |
|
1791 |
cinco=true;
|
| - |
|
1792 |
recorte_listo=false;
|
| - |
|
1793 |
texto="";
|
| - |
|
1794 |
seis=true;
|
| - |
|
1795 |
color="#ffffff";
|
| - |
|
1796 |
texto_listo=false,siete=false;
|
| - |
|
1797 |
uno=true;
|
| - |
|
1798 |
size=48;
|
| - |
|
1799 |
xf=320,yf =480;
|
| - |
|
1800 |
negritas=false, bold="";
|
| - |
|
1801 |
shadow = true, nueve=true;
|
| - |
|
1802 |
italic=false, ita="";
|
| - |
|
1803 |
rectangulo=false, diez=false;
|
| - |
|
1804 |
fontfamily="Arial";
|
| - |
|
1805 |
r=0,g=0,b=0,a=1;
|
| - |
|
1806 |
var imagenServidorNoticia;
|
| - |
|
1807 |
console.log(edit)
|
| - |
|
1808 |
window.clearInterval(editorNoticia);
|
| - |
|
1809 |
setTimeout(function(){
|
| - |
|
1810 |
scroll_altura=$(".articulo_noticia").offset().top-110;
|
| - |
|
1811 |
anchoFondoOscuro = $(".articulo_noticia").width();
|
| - |
|
1812 |
altoFondoOscuro = $(".editor_imagenes").height();
|
| - |
|
1813 |
$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
|
| - |
|
1814 |
$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
|
| - |
|
1815 |
|
| - |
|
1816 |
},navegacion(nuevoHtmlImagen,edit,'',false));
|
| - |
|
1817 |
|
| - |
|
1818 |
})
|
| - |
|
1819 |
|
| - |
|
1820 |
function navegacion(nuevoHtmlImagen,add,image,reload=true){
|
| - |
|
1821 |
if(add){
|
| - |
|
1822 |
$('#contenido2').html('')
|
| - |
|
1823 |
$('#contenido').html(nuevoHtmlImagen)
|
| - |
|
1824 |
|
| - |
|
1825 |
}else{
|
| - |
|
1826 |
if(reload){
|
| - |
|
1827 |
$('#contenido').html('')
|
| - |
|
1828 |
const getBase64FromUrl = async (url) => {
|
| - |
|
1829 |
const data = await fetch(url);
|
| - |
|
1830 |
const blob = await data.blob();
|
| - |
|
1831 |
return new Promise((resolve) => {
|
| - |
|
1832 |
const reader = new FileReader();
|
| - |
|
1833 |
reader.readAsDataURL(blob);
|
| - |
|
1834 |
reader.onloadend = function() {
|
| - |
|
1835 |
const base64data = reader.result;
|
| - |
|
1836 |
resolve(base64data);
|
| - |
|
1837 |
}
|
| - |
|
1838 |
});
|
| - |
|
1839 |
}
|
| - |
|
1840 |
|
| - |
|
1841 |
getBase64FromUrl(image).then(function(e){
|
| - |
|
1842 |
$('#form-topic-edit #name').trigger('change');
|
| - |
|
1843 |
$(".volver").css("display","block")
|
| - |
|
1844 |
$(".a1").addClass("paso");
|
| - |
|
1845 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
| - |
|
1846 |
setTimeout(function(){
|
| - |
|
1847 |
recorte_listo=true;
|
| - |
|
1848 |
$(".fondo_oscuro").css("display","none");
|
| - |
|
1849 |
$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
|
| - |
|
1850 |
$(".recortar10").removeClass("recortar");
|
| - |
|
1851 |
$(".canvas").removeClass("recortar");
|
| - |
|
1852 |
$(".b1").addClass("paso");
|
| - |
|
1853 |
$(".titulo_pasos").html("LABEL_STEP_3");
|
| - |
|
1854 |
if(texto!=""){
|
| - |
|
1855 |
seis=true;
|
| - |
|
1856 |
siete=true;
|
| - |
|
1857 |
}
|
| - |
|
1858 |
cinco=true;
|
| - |
|
1859 |
dos=true;
|
| - |
|
1860 |
cuatro=true;
|
| - |
|
1861 |
actualizar();
|
| - |
|
1862 |
|
| - |
|
1863 |
},editorNoticia(e));
|
| - |
|
1864 |
|
| - |
|
1865 |
|
| - |
|
1866 |
})
|
| - |
|
1867 |
|
| - |
|
1868 |
setTimeout(function(){
|
| - |
|
1869 |
$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
|
| - |
|
1870 |
$('#form-topic-edit #name').trigger('change');
|
| - |
|
1871 |
},$('#contenido2').html(nuevoHtmlImagen));
|
| - |
|
1872 |
}else{
|
| - |
|
1873 |
$('#contenido').html('')
|
| - |
|
1874 |
setTimeout(function(){
|
| - |
|
1875 |
$('#form-topic-edit #name').trigger('change');
|
| - |
|
1876 |
},$('#contenido2').html(nuevoHtmlImagen));
|
| - |
|
1877 |
}
|
| - |
|
1878 |
}
|
| - |
|
1879 |
}
|
| - |
|
1880 |
|
| - |
|
1881 |
$(window).on("scroll", function(){
|
| - |
|
1882 |
console.log(scroll_altura)
|
| - |
|
1883 |
if($(window).scrollTop()>scroll_altura){
|
| - |
|
1884 |
$("#cuadro_noticias").addClass("fixed");
|
| - |
|
1885 |
}else{
|
| - |
|
1886 |
$("#cuadro_noticias").removeClass("fixed");
|
| - |
|
1887 |
}
|
| - |
|
1888 |
})
|
| - |
|
1889 |
|
| - |
|
1890 |
$(document).on("dragover", "#imagen_noticia", function(e){
|
| - |
|
1891 |
e.preventDefault();
|
| - |
|
1892 |
e.stopPropagation();
|
| - |
|
1893 |
$(this).css({"background":"rgba(0,0,0,.2)"})
|
| - |
|
1894 |
})
|
| - |
|
1895 |
$(document).on("drop", "#imagen_noticia", function(e){
|
| - |
|
1896 |
e.preventDefault();
|
| - |
|
1897 |
e.stopPropagation();
|
| - |
|
1898 |
$(this).css("background", "none");
|
| - |
|
1899 |
var archivo = e.originalEvent.dataTransfer.files;
|
| - |
|
1900 |
var img=archivo[0];
|
| - |
|
1901 |
if(img.type =="image/jpeg"||img.type =="image/png"){
|
| - |
|
1902 |
$(".modificar").removeClass("animated");
|
| - |
|
1903 |
var render = new FileReader();
|
| - |
|
1904 |
render.readAsDataURL(img);
|
| - |
|
1905 |
render.onload = function(e){
|
| - |
|
1906 |
$(".volver").css("display","block")
|
| - |
|
1907 |
$(".a1").addClass("paso");
|
| - |
|
1908 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
| - |
|
1909 |
console.log(e.target.result)
|
| - |
|
1910 |
editorNoticia(e.target.result)
|
| - |
|
1911 |
}
|
| - |
|
1912 |
}
|
| - |
|
1913 |
})
|
| - |
|
1914 |
$(document).on("dragover", "body", function(e){
|
| - |
|
1915 |
e.preventDefault();
|
| - |
|
1916 |
e.stopPropagation();
|
| - |
|
1917 |
})
|
| - |
|
1918 |
$(document).on("drop", "body", function(e){
|
| - |
|
1919 |
e.preventDefault();
|
| - |
|
1920 |
e.stopPropagation();
|
| - |
|
1921 |
})
|
| - |
|
1922 |
|
| - |
|
1923 |
var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
|
| - |
|
1924 |
$(document).on("mouseover", ".editorNoticia", function(){
|
| - |
|
1925 |
$("body").css({"overflow": "hidden"});
|
| - |
|
1926 |
$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
|
| - |
|
1927 |
$(".barra,.footer").css("padding-right","17px")
|
| - |
|
1928 |
|
| - |
|
1929 |
|
| - |
|
1930 |
})
|
| - |
|
1931 |
$(document).on("mouseover", "#editorNoticia", function(){
|
| - |
|
1932 |
if(recorte_listo){
|
| - |
|
1933 |
ocho=true;
|
| - |
|
1934 |
}
|
| - |
|
1935 |
})
|
| - |
|
1936 |
$(document).on("mouseout", "#editorNoticia", function(){
|
| - |
|
1937 |
if(recorte_listo){
|
| - |
|
1938 |
ocho=false;
|
| - |
|
1939 |
actualizar2()
|
| - |
|
1940 |
}
|
| - |
|
1941 |
})
|
| - |
|
1942 |
$(document).on("mouseout", ".editorNoticia",function(){
|
| - |
|
1943 |
$("body").css({"overflow": "auto"})
|
| - |
|
1944 |
$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
|
| - |
|
1945 |
$(".barra,.footer").css("padding-right","0px")
|
| - |
|
1946 |
|
| - |
|
1947 |
})
|
| - |
|
1948 |
$(document).on('mousewheel', ".editorNoticia",function(e){
|
| - |
|
1949 |
var ruedita = e.originalEvent.wheelDelta
|
| - |
|
1950 |
if(ruedita>0){
|
| - |
|
1951 |
scale = scale+(scale/10);
|
| - |
|
1952 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
1953 |
}else{
|
| - |
|
1954 |
scale = scale-(scale/10);
|
| - |
|
1955 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
1956 |
}
|
| - |
|
1957 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
| - |
|
1958 |
})
|
| - |
|
1959 |
$(document).on("click", ".as", function(e){
|
| - |
|
1960 |
e.preventDefault();
|
| - |
|
1961 |
scale = $(this).data("scale");
|
| - |
|
1962 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
1963 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
| - |
|
1964 |
|
| - |
|
1965 |
})
|
| - |
|
1966 |
$(document).on("click", ".ps", function(e){
|
| - |
|
1967 |
e.preventDefault();
|
| - |
|
1968 |
$(".cantidades_scale").slideToggle(200).css("display", "block");
|
| - |
|
1969 |
})
|
| - |
|
1970 |
$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
|
| - |
|
1971 |
e.preventDefault();
|
| - |
|
1972 |
if(recorte_listo){
|
| - |
|
1973 |
$(".contenido_filter").slideToggle(200).css("display", "block");
|
| - |
|
1974 |
}
|
| - |
|
1975 |
})
|
| - |
|
1976 |
$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
|
| - |
|
1977 |
e.preventDefault();
|
| - |
|
1978 |
if(recorte_listo){
|
| - |
|
1979 |
$(".contenido_text").slideToggle(200).css("display", "block");
|
| - |
|
1980 |
}
|
| - |
|
1981 |
})
|
| - |
|
1982 |
|
| - |
|
1983 |
$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
|
| - |
|
1984 |
e.preventDefault();
|
| - |
|
1985 |
if(cortar){
|
| - |
|
1986 |
$(".contenido_cut").slideToggle(200).css("display", "block");
|
| - |
|
1987 |
}
|
| - |
|
1988 |
|
| - |
|
1989 |
})
|
| - |
|
1990 |
$(document).on("click", "#menos_scale", function(e){
|
| - |
|
1991 |
e.preventDefault();
|
| - |
|
1992 |
scale = scale-(scale/10);
|
| - |
|
1993 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
1994 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
| - |
|
1995 |
})
|
| - |
|
1996 |
|
| - |
|
1997 |
$(document).on("click", "#mas_scale", function(e){
|
| - |
|
1998 |
e.preventDefault();
|
| - |
|
1999 |
scale = scale+(scale/10);
|
| - |
|
2000 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
2001 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
| - |
|
2002 |
})
|
| - |
|
2003 |
$(document).on("click", "#noche", function(){
|
| - |
|
2004 |
$(".oa").removeClass("oa")
|
| - |
|
2005 |
filter( .5,1.3,1.31,1.33,1.38);
|
| - |
|
2006 |
$(this).addClass("oa")
|
| - |
|
2007 |
})
|
| - |
|
2008 |
$(document).on("click", "#sa", function(){
|
| - |
|
2009 |
$(".oa").removeClass("oa")
|
| - |
|
2010 |
filter( .7,1.1,1.64,1.66,1.50);
|
| - |
|
2011 |
$(this).addClass("oa")
|
| - |
|
2012 |
})
|
| - |
|
2013 |
$(document).on("click", "#crema", function(){
|
| - |
|
2014 |
$(".oa").removeClass("oa")
|
| - |
|
2015 |
filter( .75,1,1.66,1.60,1.51);
|
| - |
|
2016 |
$(this).addClass("oa")
|
| - |
|
2017 |
})
|
| - |
|
2018 |
$(document).on("click", "#setenta", function(){
|
| - |
|
2019 |
$(".oa").removeClass("oa")
|
| - |
|
2020 |
filter( .8,.75,1.60,1.66,1.58);
|
| - |
|
2021 |
$(this).addClass("oa")
|
| - |
|
2022 |
})
|
| - |
|
2023 |
$(document).on("click", "#orange", function(){
|
| - |
|
2024 |
$(".oa").removeClass("oa")
|
| - |
|
2025 |
filter( .8,1,1.6,1.45,1.49);
|
| - |
|
2026 |
$(this).addClass("oa")
|
| - |
|
2027 |
})
|
| - |
|
2028 |
$(document).on("click", "#relieve", function(){
|
| - |
|
2029 |
$(".oa").removeClass("oa")
|
| - |
|
2030 |
filter( .7,1.2,1.60,1.66,1.58);
|
| - |
|
2031 |
$(this).addClass("oa")
|
| - |
|
2032 |
})
|
| - |
|
2033 |
$(document).on("click", "#bosque", function(){
|
| - |
|
2034 |
$(".oa").removeClass("oa")
|
| - |
|
2035 |
filter( .85,.75,1.47,1.66,1.54);
|
| - |
|
2036 |
$(this).addClass("oa")
|
| - |
|
2037 |
})
|
| - |
|
2038 |
$(document).on("click", "#desierto", function(){
|
| - |
|
2039 |
$(".oa").removeClass("oa")
|
| - |
|
2040 |
filter( .8,.9,1.66,1.43,1.28);
|
| - |
|
2041 |
$(this).addClass("oa")
|
| - |
|
2042 |
})
|
| - |
|
2043 |
$(document).on("click", "#villa", function(){
|
| - |
|
2044 |
$(".oa").removeClass("oa")
|
| - |
|
2045 |
filter( .8,.8,1.71,1.64,1.58);
|
| - |
|
2046 |
$(this).addClass("oa")
|
| - |
|
2047 |
})
|
| - |
|
2048 |
$(document).on("click", "#magia", function(){
|
| - |
|
2049 |
$(".oa").removeClass("oa")
|
| - |
|
2050 |
filter( .7,1.2,1.49,1.49,1.6);
|
| - |
|
2051 |
$(this).addClass("oa")
|
| - |
|
2052 |
})
|
| - |
|
2053 |
$(document).on("click", "#luz", function(){
|
| - |
|
2054 |
$(".oa").removeClass("oa")
|
| - |
|
2055 |
filter( .9,.9,1.45,1.54,1.54);
|
| - |
|
2056 |
$(this).addClass("oa")
|
| - |
|
2057 |
})
|
| - |
|
2058 |
$(document).on("click", "#retoque", function(){
|
| - |
|
2059 |
$(".oa").removeClass("oa")
|
| - |
|
2060 |
filter( .9,1.3,1,1,1);
|
| - |
|
2061 |
$(this).addClass("oa")
|
| - |
|
2062 |
})
|
| - |
|
2063 |
$(document).on("click", "#saturacion", function(){
|
| - |
|
2064 |
$(".oa").removeClass("oa")
|
| - |
|
2065 |
filter( 1,1.5,1,1,1);
|
| - |
|
2066 |
$(this).addClass("oa")
|
| - |
|
2067 |
})
|
| - |
|
2068 |
$(document).on("click", "#rosa", function(){
|
| - |
|
2069 |
$(".oa").removeClass("oa")
|
| - |
|
2070 |
filter( .8,1.2,1.24,.99,1);
|
| - |
|
2071 |
$(this).addClass("oa")
|
| - |
|
2072 |
})
|
| - |
|
2073 |
$(document).on("click", "#historia", function(){
|
| - |
|
2074 |
$(".oa").removeClass("oa")
|
| - |
|
2075 |
filter( .9,1.1,1.33,1.19,.91);
|
| - |
|
2076 |
$(this).addClass("oa")
|
| - |
|
2077 |
})
|
| - |
|
2078 |
$(document).on("click", "#encantador", function(){
|
| - |
|
2079 |
$(".oa").removeClass("oa")
|
| - |
|
2080 |
filter( .9,1.2,26,-12,0,2);
|
| - |
|
2081 |
$(this).addClass("oa")
|
| - |
|
2082 |
})
|
| - |
|
2083 |
$(document).on("click", "#emocion", function(){
|
| - |
|
2084 |
$(".oa").removeClass("oa")
|
| - |
|
2085 |
filter( 1.1,1.4,40,12,-6,2);
|
| - |
|
2086 |
$(this).addClass("oa")
|
| - |
|
2087 |
})
|
| - |
|
2088 |
$(document).on("click", "#beige", function(){
|
| - |
|
2089 |
$(".oa").removeClass("oa")
|
| - |
|
2090 |
filter( .9,1.32,56,47,17,2);
|
| - |
|
2091 |
$(this).addClass("oa")
|
| - |
|
2092 |
})
|
| - |
|
2093 |
$(document).on("click", "#fine", function(){
|
| - |
|
2094 |
$(".oa").removeClass("oa")
|
| - |
|
2095 |
filter( .87,1.19,55,37,23,2);
|
| - |
|
2096 |
$(this).addClass("oa")
|
| - |
|
2097 |
})
|
| - |
|
2098 |
$(document).on("click", "#lord", function(){
|
| - |
|
2099 |
$(".oa").removeClass("oa")
|
| - |
|
2100 |
filter( 1.2,.9,67,13,-23,2);
|
| - |
|
2101 |
$(this).addClass("oa")
|
| - |
|
2102 |
})
|
| - |
|
2103 |
$(document).on("click", "#70", function(){
|
| - |
|
2104 |
$(".oa").removeClass("oa")
|
| - |
|
2105 |
filter( 1.2,1.2,35,7,18,2);
|
| - |
|
2106 |
$(this).addClass("oa")
|
| - |
|
2107 |
})
|
| - |
|
2108 |
$(document).on("click", "#arbol", function(){
|
| - |
|
2109 |
$(".oa").removeClass("oa")
|
| - |
|
2110 |
filter(.92,1.23,-11,11,11,2);
|
| - |
|
2111 |
$(this).addClass("oa")
|
| - |
|
2112 |
})
|
| - |
|
2113 |
$(document).on("click", "#verano", function(){
|
| - |
|
2114 |
$(".oa").removeClass("oa")
|
| - |
|
2115 |
filter( 1,1.4,-3,-1,-12,2);
|
| - |
|
2116 |
$(this).addClass("oa")
|
| - |
|
2117 |
})
|
| - |
|
2118 |
$(document).on("click", "#cf", function(){
|
| - |
|
2119 |
$(".oa").removeClass("oa")
|
| - |
|
2120 |
filter( .85,1.26,-15,2,-1,2);
|
| - |
|
2121 |
$(this).addClass("oa")
|
| - |
|
2122 |
})
|
| - |
|
2123 |
$(document).on("click", "#angeles", function(){
|
| - |
|
2124 |
$(".oa").removeClass("oa")
|
| - |
|
2125 |
filter( 1,1.4,5,12,1,2);
|
| - |
|
2126 |
$(this).addClass("oa")
|
| - |
|
2127 |
})
|
| - |
|
2128 |
$(document).on("click", "#caliente", function(){
|
| - |
|
2129 |
$(".oa").removeClass("oa")
|
| - |
|
2130 |
filter( .9,1.2,43,-17,-55,2);
|
| - |
|
2131 |
$(this).addClass("oa")
|
| - |
|
2132 |
})
|
| - |
|
2133 |
$(document).on("click", "#otono", function(){
|
| - |
|
2134 |
$(".oa").removeClass("oa")
|
| - |
|
2135 |
filter( 1,1.29,29,26,17,2);
|
| - |
|
2136 |
$(this).addClass("oa")
|
| - |
|
2137 |
})
|
| - |
|
2138 |
$(document).on("click", "#marzo", function(){
|
| - |
|
2139 |
$(".oa").removeClass("oa")
|
| - |
|
2140 |
filter( .85,1.3,43,25,-11,2);
|
| - |
|
2141 |
$(this).addClass("oa")
|
| - |
|
2142 |
})
|
| - |
|
2143 |
$(document).on("click", "#pera", function(){
|
| - |
|
2144 |
$(".oa").removeClass("oa")
|
| - |
|
2145 |
filter( .8,1.25,31,41,12,2);
|
| - |
|
2146 |
$(this).addClass("oa")
|
| - |
|
2147 |
})
|
| - |
|
2148 |
$(document).on("click", "#comun", function(){
|
| - |
|
2149 |
$(".oa").removeClass("oa")
|
| - |
|
2150 |
filter( 1,1.36,4,5,1,2);
|
| - |
|
2151 |
$(this).addClass("oa")
|
| - |
|
2152 |
})
|
| - |
|
2153 |
$(document).on("click", "#oro", function(){
|
| - |
|
2154 |
$(".oa").removeClass("oa")
|
| - |
|
2155 |
filter( .9,1.3,37,-25,1,2);
|
| - |
|
2156 |
$(this).addClass("oa")
|
| - |
|
2157 |
})
|
| - |
|
2158 |
$(document).on("click", "#gotico", function(){
|
| - |
|
2159 |
$(".oa").removeClass("oa")
|
| - |
|
2160 |
filter( 1.1,1.3,-47,-42,-30,2);
|
| - |
|
2161 |
$(this).addClass("oa")
|
| - |
|
2162 |
})
|
| - |
|
2163 |
$(document).on("click", "#forestal", function(){
|
| - |
|
2164 |
$(".oa").removeClass("oa")
|
| - |
|
2165 |
filter( 1,1.4,-5,42,11,2);
|
| - |
|
2166 |
$(this).addClass("oa")
|
| - |
|
2167 |
})
|
| - |
|
2168 |
$(document).on("click", "#luna", function(){
|
| - |
|
2169 |
$(".oa").removeClass("oa")
|
| - |
|
2170 |
filter( .9,1.2,-5,-7,4,2);
|
| - |
|
2171 |
$(this).addClass("oa")
|
| - |
|
2172 |
})
|
| - |
|
2173 |
$(document).on("click", "#fiesta", function(){
|
| - |
|
2174 |
$(".oa").removeClass("oa")
|
| - |
|
2175 |
filter( 1.1,1.3,-1,-1,26,2);
|
| - |
|
2176 |
$(this).addClass("oa")
|
| - |
|
2177 |
})
|
| - |
|
2178 |
$(document).on("click", "#gris", function(){
|
| - |
|
2179 |
$(".oa").removeClass("oa")
|
| - |
|
2180 |
filtergris(1,1)
|
| - |
|
2181 |
$(this).addClass("oa")
|
| - |
|
2182 |
})
|
| - |
|
2183 |
$(document).on("click", "#lhs", function(){
|
| - |
|
2184 |
$(".oa").removeClass("oa")
|
| - |
|
2185 |
filtergris(.8,1.5);
|
| - |
|
2186 |
$(this).addClass("oa")
|
| - |
|
2187 |
})
|
| - |
|
2188 |
$(document).on("click", "#normal", function(){
|
| - |
|
2189 |
$(".oa").removeClass("oa")
|
| - |
|
2190 |
$(this).addClass("oa")
|
| - |
|
2191 |
filter();
|
| - |
|
2192 |
})
|
| - |
|
2193 |
var texto_listo=false,siete=false;
|
| - |
|
2194 |
var texto;
|
| - |
|
2195 |
$(document).on("keyup", "#texto_input", function(e){
|
| - |
|
2196 |
e.preventDefault();
|
| - |
|
2197 |
texto = $(this).val();
|
| - |
|
2198 |
if(texto_actualizar){
|
| - |
|
2199 |
siete=true;
|
| - |
|
2200 |
}
|
| - |
|
2201 |
if(texto!=""){
|
| - |
|
2202 |
texto_actualizar=true;
|
| - |
|
2203 |
actualizar2();
|
| - |
|
2204 |
}else{
|
| - |
|
2205 |
actualizar2();
|
| - |
|
2206 |
}
|
| - |
|
2207 |
|
| - |
|
2208 |
})
|
| - |
|
2209 |
var color="#ffffff";
|
| - |
|
2210 |
$(document).on("change", "#color", function(){
|
| - |
|
2211 |
color=$(this).val();
|
| - |
|
2212 |
seis=true;
|
| - |
|
2213 |
actualizar2();
|
| - |
|
2214 |
})
|
| - |
|
2215 |
var size=48;
|
| - |
|
2216 |
$(document).on("keyup change", "#font-size", function(){
|
| - |
|
2217 |
size=$(this).val();
|
| - |
|
2218 |
size = parseInt(size);
|
| - |
|
2219 |
seis=true;
|
| - |
|
2220 |
siete=true;
|
| - |
|
2221 |
actualizar2();
|
| - |
|
2222 |
})
|
| - |
|
2223 |
var negritas=false, bold="";
|
| - |
|
2224 |
$(document).on("click", "#negritas", function(e){
|
| - |
|
2225 |
e.preventDefault();
|
| - |
|
2226 |
if(!negritas){
|
| - |
|
2227 |
bold="bold";
|
| - |
|
2228 |
$(this).addClass("fa");
|
| - |
|
2229 |
seis=true;
|
| - |
|
2230 |
siete=true;
|
| - |
|
2231 |
actualizar2();
|
| - |
|
2232 |
negritas=true;
|
| - |
|
2233 |
}else{
|
| - |
|
2234 |
bold="";
|
| - |
|
2235 |
$(this).removeClass("fa");
|
| - |
|
2236 |
seis=true;
|
| - |
|
2237 |
siete=true;
|
| - |
|
2238 |
actualizar2();
|
| - |
|
2239 |
negritas=false;
|
| - |
|
2240 |
}
|
| - |
|
2241 |
})
|
| - |
|
2242 |
var italic=false, ita="";
|
| - |
|
2243 |
$(document).on("click", "#italic", function(e){
|
| - |
|
2244 |
e.preventDefault();
|
| - |
|
2245 |
if(!italic){
|
| - |
|
2246 |
ita="italic";
|
| - |
|
2247 |
$(this).addClass("fa");
|
| - |
|
2248 |
seis=true;
|
| - |
|
2249 |
siete=true;
|
| - |
|
2250 |
actualizar2();
|
| - |
|
2251 |
italic=true;
|
| - |
|
2252 |
}else{
|
| - |
|
2253 |
ita="";
|
| - |
|
2254 |
$(this).removeClass("fa");
|
| - |
|
2255 |
seis=true;
|
| - |
|
2256 |
siete=true;
|
| - |
|
2257 |
actualizar2();
|
| - |
|
2258 |
italic=false;
|
| - |
|
2259 |
}
|
| - |
|
2260 |
})
|
| - |
|
2261 |
var fontfamily="Arial";
|
| - |
|
2262 |
$(document).on("click", ".fs", function(e){
|
| - |
|
2263 |
e.preventDefault();
|
| - |
|
2264 |
$(".at").removeClass("at");
|
| - |
|
2265 |
$(this).addClass("at");
|
| - |
|
2266 |
fontfamily= $(this).text();
|
| - |
|
2267 |
seis=true;
|
| - |
|
2268 |
siete=true;
|
| - |
|
2269 |
actualizar2();
|
| - |
|
2270 |
|
| - |
|
2271 |
})
|
| - |
|
2272 |
var shadow = true, nueve=true;
|
| - |
|
2273 |
$(document).on("click","#shadow", function(e){
|
| - |
|
2274 |
e.preventDefault();
|
| - |
|
2275 |
if(shadow){
|
| - |
|
2276 |
$(this).removeClass("fa");
|
| - |
|
2277 |
seis=true;
|
| - |
|
2278 |
nueve=false;
|
| - |
|
2279 |
actualizar2();
|
| - |
|
2280 |
shadow=false;
|
| - |
|
2281 |
}else{
|
| - |
|
2282 |
$(this).addClass("fa");
|
| - |
|
2283 |
seis=true;
|
| - |
|
2284 |
nueve=true;
|
| - |
|
2285 |
actualizar2();
|
| - |
|
2286 |
shadow=true;
|
| - |
|
2287 |
}
|
| - |
|
2288 |
|
| - |
|
2289 |
})
|
| - |
|
2290 |
var rectangulo=false, diez=false, colorrect="#000000";
|
| - |
|
2291 |
$(document).on("click", "#rectangulo", function(e){
|
| - |
|
2292 |
e.preventDefault();
|
| - |
|
2293 |
if(!rectangulo){
|
| - |
|
2294 |
$(this).addClass("fa");
|
| - |
|
2295 |
diez=true;
|
| - |
|
2296 |
actualizar2();
|
| - |
|
2297 |
rectangulo=true;
|
| - |
|
2298 |
}else{
|
| - |
|
2299 |
$(this).removeClass("fa");
|
| - |
|
2300 |
diez=false;
|
| - |
|
2301 |
actualizar2();
|
| - |
|
2302 |
rectangulo=false;
|
| - |
|
2303 |
}
|
| - |
|
2304 |
|
| - |
|
2305 |
})
|
| - |
|
2306 |
var r=0,g=0,b=0;
|
| - |
|
2307 |
$(document).on("change", "#colorrect", function(){
|
| - |
|
2308 |
colorrect=$(this).val();
|
| - |
|
2309 |
r=parseInt(colorrect.slice(1,3),16);
|
| - |
|
2310 |
g=parseInt(colorrect.slice(3,5),16);
|
| - |
|
2311 |
b=parseInt(colorrect.slice(5,7),16);
|
| - |
|
2312 |
seis=true;
|
| - |
|
2313 |
actualizar2();
|
| - |
|
2314 |
})
|
| - |
|
2315 |
var a=1;
|
| - |
|
2316 |
|
| - |
|
2317 |
$(document).on("keyup change", "#opacidad", function(){
|
| - |
|
2318 |
a=$(this).val();
|
| - |
|
2319 |
a=a/100;
|
| - |
|
2320 |
seis=true;
|
| - |
|
2321 |
actualizar2();
|
| - |
|
2322 |
})
|
| - |
|
2323 |
var imaNoti = new Image();
|
| - |
|
2324 |
function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
|
| - |
|
2325 |
cuatro=false;
|
| - |
|
2326 |
restaurar(brillo, contraste);
|
| - |
|
2327 |
datos=imagenOriginal.data;
|
| - |
|
2328 |
if(valor==2){
|
| - |
|
2329 |
for (var i = 0; i <datos.length; i+=4) {
|
| - |
|
2330 |
datos[i]=datos[i]+rojo;
|
| - |
|
2331 |
datos[i+1]=datos[i+1]+verde;
|
| - |
|
2332 |
datos[i+2]=datos[i+2]+azul;
|
| - |
|
2333 |
}
|
| - |
|
2334 |
}else{
|
| - |
|
2335 |
for (var i = 0; i <datos.length; i+=4) {
|
| - |
|
2336 |
datos[i]=datos[i]*rojo;
|
| - |
|
2337 |
datos[i+1]=datos[i+1]*verde;
|
| - |
|
2338 |
datos[i+2]=datos[i+2]*azul
|
| - |
|
2339 |
}
|
| - |
|
2340 |
}
|
| - |
|
2341 |
editor.putImageData(imagenOriginal,0,0)
|
| - |
|
2342 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
| - |
|
2343 |
imaNoti.src = imagenNoticia;
|
| - |
|
2344 |
actualizar2();
|
| - |
|
2345 |
}
|
| - |
|
2346 |
function filtergris(brillo=1, contraste=1){
|
| - |
|
2347 |
cuatro=false;
|
| - |
|
2348 |
restaurar(brillo, contraste);
|
| - |
|
2349 |
datos=imagenOriginal.data;
|
| - |
|
2350 |
var auxiliar;
|
| - |
|
2351 |
for (var i = 0; i <datos.length; i+=4) {
|
| - |
|
2352 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
|
| - |
|
2353 |
datos[i]=auxiliar;
|
| - |
|
2354 |
datos[i+1]=auxiliar;
|
| - |
|
2355 |
datos[i+2]=auxiliar;
|
| - |
|
2356 |
}
|
| - |
|
2357 |
|
| - |
|
2358 |
editor.putImageData(imagenOriginal,0,0)
|
| - |
|
2359 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
| - |
|
2360 |
imaNoti.src = imagenNoticia;
|
| - |
|
2361 |
actualizar2();
|
| - |
|
2362 |
}
|
| - |
|
2363 |
function restaurar(brillo = 1, contraste=1){
|
| - |
|
2364 |
editor.filter = "none"
|
| - |
|
2365 |
editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
|
| - |
|
2366 |
editor.fillStyle="rgba(255,255,255,1)"
|
| - |
|
2367 |
editor.fillRect(0,0,ancho,alto);
|
| - |
|
2368 |
editor.fillStyle=""+color+"";
|
| - |
|
2369 |
var pxf=0,pyf=0;
|
| - |
|
2370 |
if(xf>=(yf/recorte)){
|
| - |
|
2371 |
pxf=xf/ancho;
|
| - |
|
2372 |
pyf=yf/pxf;
|
| - |
|
2373 |
py=(alto/2)-(pyf/2);
|
| - |
|
2374 |
editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
|
| - |
|
2375 |
}else{
|
| - |
|
2376 |
pyf=yf/alto;
|
| - |
|
2377 |
pxf=xf/pyf;
|
| - |
|
2378 |
px=(ancho/2)-(pxf/2);
|
| - |
|
2379 |
editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
|
| - |
|
2380 |
}
|
| - |
|
2381 |
imagenOriginal = editor.getImageData(0,0,ancho,alto)
|
| - |
|
2382 |
}
|
| - |
|
2383 |
var ocho=false;
|
| - |
|
2384 |
function actualizar2(){
|
| - |
|
2385 |
if(recorte_listo){
|
| - |
|
2386 |
if(cuatro){
|
| - |
|
2387 |
imagenOriginal = editor.getImageData(0,0,ancho,alto)
|
| - |
|
2388 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
| - |
|
2389 |
imaNoti.src = imagenNoticia;
|
| - |
|
2390 |
cuatro=false;
|
| - |
|
2391 |
}
|
| - |
|
2392 |
editor.filter = "none"
|
| - |
|
2393 |
$(imaNoti).ready(function(e){
|
| - |
|
2394 |
noticia.drawImage(imaNoti,0,0,320,480);
|
| - |
|
2395 |
editor.drawImage(imaNoti,0,0,ancho,alto)
|
| - |
|
2396 |
if(texto_actualizar){
|
| - |
|
2397 |
if(texto!=""){
|
| - |
|
2398 |
if(seis){
|
| - |
|
2399 |
ancho_imaNoti = imaNoti.width;
|
| - |
|
2400 |
|
| - |
|
2401 |
scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
|
| - |
|
2402 |
editor.fillStyle=""+color+"";
|
| - |
|
2403 |
editor.strokeStyle="rgb(255,255,255)";
|
| - |
|
2404 |
if(nueve){
|
| - |
|
2405 |
editor.shadowColor="rgba(0,0,0,.5)";
|
| - |
|
2406 |
editor.shadowOffsetX=6;
|
| - |
|
2407 |
editor.shadowOffsetY=6;
|
| - |
|
2408 |
editor.shadowBlur=6;
|
| - |
|
2409 |
noticia.shadowColor="rgba(0,0,0,.5)";
|
| - |
|
2410 |
noticia.shadowOffsetX=6*scale_noticia;
|
| - |
|
2411 |
noticia.shadowOffsetY=6*scale_noticia;
|
| - |
|
2412 |
noticia.shadowBlur=6*scale_noticia;
|
| - |
|
2413 |
}else{
|
| - |
|
2414 |
editor.shadowColor="rgba(0,0,0,0)";
|
| - |
|
2415 |
noticia.shadowColor="rgba(0,0,0,0)";
|
| - |
|
2416 |
}
|
| - |
|
2417 |
editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
|
| - |
|
2418 |
editor.textAlign="start";
|
| - |
|
2419 |
editor.textBaseline="top";
|
| - |
|
2420 |
|
| - |
|
2421 |
var sizeNoticia = size*scale_noticia;
|
| - |
|
2422 |
noticia.fillStyle=""+color+"";
|
| - |
|
2423 |
noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
|
| - |
|
2424 |
noticia.textAlign="start";
|
| - |
|
2425 |
noticia.textBaseline="top";
|
| - |
|
2426 |
seis=false;
|
| - |
|
2427 |
}
|
| - |
|
2428 |
if(siete){
|
| - |
|
2429 |
dimencionesTexto = editor.measureText(texto);
|
| - |
|
2430 |
txf=dimencionesTexto.width+20;
|
| - |
|
2431 |
tyf= (20+size);
|
| - |
|
2432 |
siete=false;
|
| - |
|
2433 |
}
|
| - |
|
2434 |
if(cinco){
|
| - |
|
2435 |
dimencionesTexto = editor.measureText(texto);
|
| - |
|
2436 |
if(xf>=(yf/recorte)){
|
| - |
|
2437 |
tx=(xf/2)-(dimencionesTexto.width/2);
|
| - |
|
2438 |
ty=(xf*recorte/2)-(size/2);
|
| - |
|
2439 |
}else{
|
| - |
|
2440 |
tx=(yf/recorte/2)-(dimencionesTexto.width/2);
|
| - |
|
2441 |
ty=(yf/2)-(size/2);
|
| - |
|
2442 |
}
|
| - |
|
2443 |
|
| - |
|
2444 |
txf=dimencionesTexto.width+20;
|
| - |
|
2445 |
tyf= size+20;
|
| - |
|
2446 |
cinco=false;
|
| - |
|
2447 |
}
|
| - |
|
2448 |
if(diez){
|
| - |
|
2449 |
editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
|
| - |
|
2450 |
noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
|
| - |
|
2451 |
editor.fillRect(tx-10,ty-10,txf,tyf);
|
| - |
|
2452 |
noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
|
| - |
|
2453 |
editor.fillStyle=""+color+"";
|
| - |
|
2454 |
noticia.fillStyle=""+color+"";
|
| - |
|
2455 |
|
| - |
|
2456 |
}
|
| - |
|
2457 |
editor.fillText(texto,tx,ty);
|
| - |
|
2458 |
noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
|
| - |
|
2459 |
if(ocho){
|
| - |
|
2460 |
editor.strokeRect(tx-10,ty-10,txf,tyf)
|
| - |
|
2461 |
editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
|
| - |
|
2462 |
editor.fill();
|
| - |
|
2463 |
editor.beginPath();
|
| - |
|
2464 |
}
|
| - |
|
2465 |
texto_listo=true;
|
| - |
|
2466 |
}
|
| - |
|
2467 |
}
|
| - |
|
2468 |
})
|
| - |
|
2469 |
|
| - |
|
2470 |
}
|
| - |
|
2471 |
}
|
| - |
|
2472 |
function actualizar(){
|
| - |
|
2473 |
$(imagen).ready(function(e){
|
| - |
|
2474 |
if(uno){
|
| - |
|
2475 |
ancho=imagen.width, alto = imagen.height;
|
| - |
|
2476 |
elemento.width = ancho;
|
| - |
|
2477 |
elemento.height = alto;
|
| - |
|
2478 |
$(".scale").css("display","flex");
|
| - |
|
2479 |
mitadX=ancho/2;
|
| - |
|
2480 |
mitadY=alto/2;
|
| - |
|
2481 |
x=mitadX-xf/2;
|
| - |
|
2482 |
y=mitadY-yf/2;
|
| - |
|
2483 |
if(ancho<=alto){
|
| - |
|
2484 |
scale = -(((alto-450)/alto)-1);
|
| - |
|
2485 |
|
| - |
|
2486 |
}else{
|
| - |
|
2487 |
scale = -(((ancho-500)/ancho)-1);
|
| - |
|
2488 |
}
|
| - |
|
2489 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
2490 |
$("#ancho").html(ancho+"px");
|
| - |
|
2491 |
$("#alto").html(alto+"px");
|
| - |
|
2492 |
uno=false;
|
| - |
|
2493 |
}
|
| - |
|
2494 |
if(dos){
|
| - |
|
2495 |
|
| - |
|
2496 |
if(xf>=(yf/recorte)){
|
| - |
|
2497 |
alto=xf*recorte;
|
| - |
|
2498 |
ancho=xf;
|
| - |
|
2499 |
}else{
|
| - |
|
2500 |
ancho=yf/recorte;
|
| - |
|
2501 |
alto=yf;
|
| - |
|
2502 |
|
| - |
|
2503 |
}
|
| - |
|
2504 |
elemento.width = ancho;
|
| - |
|
2505 |
elemento.height = alto;
|
| - |
|
2506 |
if(xf<=yf){
|
| - |
|
2507 |
scale = -(((yf-450)/yf)-1);
|
| - |
|
2508 |
|
| - |
|
2509 |
}else{
|
| - |
|
2510 |
scale = -(((xf-500)/xf)-1);
|
| - |
|
2511 |
}
|
| - |
|
2512 |
|
| - |
|
2513 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
| - |
|
2514 |
$("#ancho").html(Math.round(xf)+"px");
|
| - |
|
2515 |
$("#alto").html(Math.round(yf)+"px");
|
| - |
|
2516 |
dos=false;
|
| - |
|
2517 |
}
|
| - |
|
2518 |
|
| - |
|
2519 |
var pxf=0,pyf=0;
|
| - |
|
2520 |
noticia.fillStyle="rgba(255,255,255,1)"
|
| - |
|
2521 |
noticia.fillRect(0,0,320,480);
|
| - |
|
2522 |
if(xf>=(yf/recorte)){
|
| - |
|
2523 |
pxf=xf/320;
|
| - |
|
2524 |
pyf=yf/pxf;
|
| - |
|
2525 |
py=(480/2)-(pyf/2);
|
| - |
|
2526 |
noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
|
| - |
|
2527 |
}else{
|
| - |
|
2528 |
pyf=yf/480;
|
| - |
|
2529 |
pxf=xf/pyf;
|
| - |
|
2530 |
px=(320/2)-(pxf/2);
|
| - |
|
2531 |
noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
|
| - |
|
2532 |
}
|
| - |
|
2533 |
|
| - |
|
2534 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
| - |
|
2535 |
if(!recorte_listo){
|
| - |
|
2536 |
editor.drawImage(imagen,0,0,ancho,alto);
|
| - |
|
2537 |
editor.fillStyle="rgba(0,0,0,.2)"
|
| - |
|
2538 |
editor.fillRect(0,0,ancho,alto);
|
| - |
|
2539 |
editor.fillStyle="rgba(255,255,255,.1)"
|
| - |
|
2540 |
editor.fillRect(x,y,xf,yf);
|
| - |
|
2541 |
editor.fillStyle="rgba(255,255,255,.5)"
|
| - |
|
2542 |
editor.fillRect(x,y,16,16);
|
| - |
|
2543 |
editor.fillRect((x+xf)-16,y,16,16);
|
| - |
|
2544 |
editor.fillRect(x,y+yf-16,16,16);
|
| - |
|
2545 |
editor.fillRect(x+xf-16,yf+y-16,16,16);
|
| - |
|
2546 |
esta=true;
|
| - |
|
2547 |
}else{
|
| - |
|
2548 |
var pxf=0,pyf=0;
|
| - |
|
2549 |
|
| - |
|
2550 |
editor.fillStyle="rgba(255,255,255,1)"
|
| - |
|
2551 |
editor.fillRect(0,0,ancho,alto);
|
| - |
|
2552 |
if(xf>=(yf/recorte)){
|
| - |
|
2553 |
pxf=xf/ancho;
|
| - |
|
2554 |
pyf=yf/pxf;
|
| - |
|
2555 |
py=(alto/2)-(pyf/2);
|
| - |
|
2556 |
editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
|
| - |
|
2557 |
}else{
|
| - |
|
2558 |
pyf=yf/alto;
|
| - |
|
2559 |
pxf=xf/pyf;
|
| - |
|
2560 |
px=(ancho/2)-(pxf/2);
|
| - |
|
2561 |
editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
|
| - |
|
2562 |
}
|
| - |
|
2563 |
|
| - |
|
2564 |
}
|
| - |
|
2565 |
})
|
| - |
|
2566 |
}
|
| - |
|
2567 |
var imagenOriginal;
|
| - |
|
2568 |
var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
| - |
|
2569 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
| - |
|
2570 |
var mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
| - |
|
2571 |
var translateX;
|
| - |
|
2572 |
|
| - |
|
2573 |
$(document).on("click", ".recortar10", function(e){
|
| - |
|
2574 |
|
| - |
|
2575 |
e.preventDefault();
|
| - |
|
2576 |
recorte_listo=false;
|
| - |
|
2577 |
uno=true;
|
| - |
|
2578 |
$(".fondo_oscuro").css("display","block");
|
| - |
|
2579 |
$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
|
| - |
|
2580 |
$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
|
| - |
|
2581 |
$(".contenido_text").css("display", "none");
|
| - |
|
2582 |
$(".contenido_filter").css("display", "none");
|
| - |
|
2583 |
$(".recortar10").addClass("recortar");
|
| - |
|
2584 |
$(".canvas").addClass("recortar")
|
| - |
|
2585 |
$(".oa").removeClass("oa");
|
| - |
|
2586 |
$("#normal").addClass("oa");
|
| - |
|
2587 |
$(".b1").removeClass("paso");
|
| - |
|
2588 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
| - |
|
2589 |
window.clearInterval(actualizar2);
|
| - |
|
2590 |
actualizar();
|
| - |
|
2591 |
|
| - |
|
2592 |
})
|
| - |
|
2593 |
|
| - |
|
2594 |
|
| - |
|
2595 |
blockCelda=true;
|
| - |
|
2596 |
$(document).on("click", "#blockCelda", function(e){
|
| - |
|
2597 |
e.preventDefault();
|
| - |
|
2598 |
if(blockCelda){
|
| - |
|
2599 |
$(this).html('<span class="fa fa-unlock"></span>')
|
| - |
|
2600 |
|
| - |
|
2601 |
blockCelda=false;
|
| - |
|
2602 |
}else{
|
| - |
|
2603 |
$(this).html('<span class="fa fa-lock"></span>')
|
| - |
|
2604 |
blockCelda=true;
|
| - |
|
2605 |
}
|
| - |
|
2606 |
t4=true;
|
| - |
|
2607 |
|
| - |
|
2608 |
})
|
| - |
|
2609 |
var imagen
|
| - |
|
2610 |
function editorNoticia(img){
|
| - |
|
2611 |
cortar=true;
|
| - |
|
2612 |
imagen= new Image();
|
| - |
|
2613 |
$(".canvas").html(canvas);
|
| - |
|
2614 |
elemento = document.getElementById("editorNoticia");
|
| - |
|
2615 |
editor = elemento.getContext("2d");
|
| - |
|
2616 |
elemento2 = document.getElementById("imagen_noticias");
|
| - |
|
2617 |
noticia = elemento2.getContext("2d");
|
| - |
|
2618 |
|
| - |
|
2619 |
$(document).on("click", ".boton_marino.recortar",function(e){
|
| - |
|
2620 |
e.preventDefault();
|
| - |
|
2621 |
recorte_listo=true;
|
| - |
|
2622 |
$(".fondo_oscuro").css("display","none");
|
| - |
|
2623 |
$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
|
| - |
|
2624 |
$(".recortar10").removeClass("recortar");
|
| - |
|
2625 |
$(".canvas").removeClass("recortar");
|
| - |
|
2626 |
$(".b1").addClass("paso");
|
| - |
|
2627 |
$(".titulo_pasos").html("LABEL_STEP_3");
|
| - |
|
2628 |
if(texto!=""){
|
| - |
|
2629 |
seis=true;
|
| - |
|
2630 |
siete=true;
|
| - |
|
2631 |
}
|
| - |
|
2632 |
cinco=true;
|
| - |
|
2633 |
dos=true;
|
| - |
|
2634 |
cuatro=true;
|
| - |
|
2635 |
actualizar();
|
| - |
|
2636 |
})
|
| - |
|
2637 |
|
| - |
|
2638 |
var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
|
| - |
|
2639 |
var mouse =[];
|
| - |
|
2640 |
|
| - |
|
2641 |
|
| - |
|
2642 |
function raton(elemento, e){
|
| - |
|
2643 |
return {
|
| - |
|
2644 |
x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
|
| - |
|
2645 |
y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
|
| - |
|
2646 |
}
|
| - |
|
2647 |
}
|
| - |
|
2648 |
|
| - |
|
2649 |
imagen.src=img;
|
| - |
|
2650 |
$(".recortar10").addClass("recortar");
|
| - |
|
2651 |
$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
|
| - |
|
2652 |
actualizar();
|
| - |
|
2653 |
|
| - |
|
2654 |
$(elemento).mousemove(function(e){
|
| - |
|
2655 |
mouse = raton(this, e);
|
| - |
|
2656 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
|
| - |
|
2657 |
if(!recorte_listo){
|
| - |
|
2658 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
| - |
|
2659 |
$(elemento).css("cursor","move");
|
| - |
|
2660 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
| - |
|
2661 |
$(elemento).css("cursor","nw-resize");
|
| - |
|
2662 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
| - |
|
2663 |
$(elemento).css("cursor","ne-resize");
|
| - |
|
2664 |
}else if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
| - |
|
2665 |
$(elemento).css("cursor","se-resize");
|
| - |
|
2666 |
}else if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
| - |
|
2667 |
$(elemento).css("cursor","sw-resize");
|
| - |
|
2668 |
}else{
|
| - |
|
2669 |
$(elemento).css("cursor","default");
|
| - |
|
2670 |
}
|
| - |
|
2671 |
}else if(texto_listo){
|
| - |
|
2672 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
| - |
|
2673 |
$(elemento).css("cursor","move");
|
| - |
|
2674 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
| - |
|
2675 |
$(elemento).css("cursor","pointer");
|
| - |
|
2676 |
}else{
|
| - |
|
2677 |
$(elemento).css("cursor","default");
|
| - |
|
2678 |
}
|
| - |
|
2679 |
}
|
| - |
|
2680 |
else{
|
| - |
|
2681 |
$(elemento).css("cursor","default");
|
| - |
|
2682 |
}
|
| - |
|
2683 |
})
|
| - |
|
2684 |
$(elemento).mousedown(function(e){
|
| - |
|
2685 |
mouse = raton(this, e);
|
| - |
|
2686 |
if(!recorte_listo){
|
| - |
|
2687 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
| - |
|
2688 |
cli = true;
|
| - |
|
2689 |
}
|
| - |
|
2690 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
| - |
|
2691 |
t4 = true;
|
| - |
|
2692 |
}
|
| - |
|
2693 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
| - |
|
2694 |
t3 = true;
|
| - |
|
2695 |
}
|
| - |
|
2696 |
if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
| - |
|
2697 |
t1 = true;
|
| - |
|
2698 |
}
|
| - |
|
2699 |
if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
| - |
|
2700 |
t2 = true;
|
| - |
|
2701 |
}
|
| - |
|
2702 |
}else if(texto_listo){
|
| - |
|
2703 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
| - |
|
2704 |
tcli=true;
|
| - |
|
2705 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
| - |
|
2706 |
rotar=true;
|
| - |
|
2707 |
}
|
| - |
|
2708 |
}
|
| - |
|
2709 |
|
| - |
|
2710 |
})
|
| - |
|
2711 |
|
| - |
|
2712 |
$(elemento).mousemove(function(e){
|
| - |
|
2713 |
mouse = raton(this, e);
|
| - |
|
2714 |
if(!recorte_listo){
|
| - |
|
2715 |
if(cli){
|
| - |
|
2716 |
if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
|
| - |
|
2717 |
y = (mouse.y-(yf/2));
|
| - |
|
2718 |
}else{
|
| - |
|
2719 |
if((mouse.y-(yf/2))<0){
|
| - |
|
2720 |
y=0;
|
| - |
|
2721 |
}
|
| - |
|
2722 |
if((mouse.y+(yf/2))>alto){
|
| - |
|
2723 |
y=alto-yf;
|
| - |
|
2724 |
}
|
| - |
|
2725 |
}
|
| - |
|
2726 |
if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
|
| - |
|
2727 |
x = (mouse.x-(xf/2));
|
| - |
|
2728 |
}else{
|
| - |
|
2729 |
if((mouse.x-(xf/2))<0){
|
| - |
|
2730 |
x=0;
|
| - |
|
2731 |
}
|
| - |
|
2732 |
if((mouse.x+(xf/2))>ancho){
|
| - |
|
2733 |
x=(ancho)-xf;
|
| - |
|
2734 |
}
|
| - |
|
2735 |
}
|
| - |
|
2736 |
}
|
| - |
|
2737 |
if(blockCelda){
|
| - |
|
2738 |
if(t4){
|
| - |
|
2739 |
if(mouse.y<(alto-10)&&(x+xf)<=(ancho)){
|
| - |
|
2740 |
if(Math.round(xf)>=50){
|
| - |
|
2741 |
if(((mouse.y-y)/recorte)>50){
|
| - |
|
2742 |
yf=mouse.y-y;
|
| - |
|
2743 |
xf=(yf/recorte);
|
| - |
|
2744 |
}
|
| - |
|
2745 |
}
|
| - |
|
2746 |
}else{
|
| - |
|
2747 |
if(mouse.y>=(alto-10)){
|
| - |
|
2748 |
yf=alto-y;
|
| - |
|
2749 |
xf=(yf/recorte);
|
| - |
|
2750 |
t4=false;
|
| - |
|
2751 |
}
|
| - |
|
2752 |
if(x+xf>(ancho)){
|
| - |
|
2753 |
xf=(ancho)-x;
|
| - |
|
2754 |
yf=(xf*recorte);
|
| - |
|
2755 |
t4=false;
|
| - |
|
2756 |
}
|
| - |
|
2757 |
}
|
| - |
|
2758 |
}
|
| - |
|
2759 |
if(t3){
|
| - |
|
2760 |
if(mouse.y>0&&(x+xf)<=(ancho)){
|
| - |
|
2761 |
if(Math.round(xf)>=50){
|
| - |
|
2762 |
if(((yf+(y-mouse.y))/recorte)>50){
|
| - |
|
2763 |
yf=yf+(y-mouse.y);
|
| - |
|
2764 |
xf=(yf/recorte);
|
| - |
|
2765 |
y=mouse.y;
|
| - |
|
2766 |
}
|
| - |
|
2767 |
}
|
| - |
|
2768 |
|
| - |
|
2769 |
}else{
|
| - |
|
2770 |
if(mouse.y<=0) {
|
| - |
|
2771 |
yf=yf+(y-mouse.y);
|
| - |
|
2772 |
xf=(yf/recorte);
|
| - |
|
2773 |
y=0;
|
| - |
|
2774 |
t3=false;
|
| - |
|
2775 |
}
|
| - |
|
2776 |
if(x+xf>(ancho)){
|
| - |
|
2777 |
xf=(ancho)-x;
|
| - |
|
2778 |
yf=xf*recorte;
|
| - |
|
2779 |
t3=false;
|
| - |
|
2780 |
}
|
| - |
|
2781 |
}
|
| - |
|
2782 |
}
|
| - |
|
2783 |
if(t2){
|
| - |
|
2784 |
if(mouse.y<(alto-10)&&x>=0){
|
| - |
|
2785 |
if(Math.round(xf)>=50){
|
| - |
|
2786 |
if(((mouse.y-y)/recorte)>50){
|
| - |
|
2787 |
x=(x+(yf-(mouse.y-y))/recorte);
|
| - |
|
2788 |
yf=mouse.y-y;
|
| - |
|
2789 |
xf=(yf/recorte);
|
| - |
|
2790 |
}
|
| - |
|
2791 |
}
|
| - |
|
2792 |
|
| - |
|
2793 |
}else{
|
| - |
|
2794 |
if(mouse.y>=(alto-10)) {
|
| - |
|
2795 |
yf=alto-y;
|
| - |
|
2796 |
xf=(yf/recorte);
|
| - |
|
2797 |
t2=false;
|
| - |
|
2798 |
}
|
| - |
|
2799 |
if(0>x){
|
| - |
|
2800 |
x=0;
|
| - |
|
2801 |
xf=mouse.y-y;
|
| - |
|
2802 |
yf=(xf*recorte);
|
| - |
|
2803 |
t2=false;
|
| - |
|
2804 |
}
|
| - |
|
2805 |
}
|
| - |
|
2806 |
}
|
| - |
|
2807 |
if(t1){
|
| - |
|
2808 |
if(mouse.y>0&&x>=0){
|
| - |
|
2809 |
if(Math.round(xf)>=50){
|
| - |
|
2810 |
if(((yf+(y-mouse.y))/recorte)>50){
|
| - |
|
2811 |
yf=yf+(y-mouse.y);
|
| - |
|
2812 |
xf=(yf/recorte);
|
| - |
|
2813 |
x=(x-(y-mouse.y)/recorte);
|
| - |
|
2814 |
y=mouse.y;
|
| - |
|
2815 |
}
|
| - |
|
2816 |
}
|
| - |
|
2817 |
}else{
|
| - |
|
2818 |
if(mouse.y<=0) {
|
| - |
|
2819 |
yf=yf+(y-mouse.y);
|
| - |
|
2820 |
xf=(yf/recorte);
|
| - |
|
2821 |
y=0;
|
| - |
|
2822 |
t1=false;
|
| - |
|
2823 |
}
|
| - |
|
2824 |
if(0>x){
|
| - |
|
2825 |
x=0;
|
| - |
|
2826 |
xf=yf+(y-mouse.y);
|
| - |
|
2827 |
yf=(xf*recorte);
|
| - |
|
2828 |
t1=false;
|
| - |
|
2829 |
}
|
| - |
|
2830 |
}
|
| - |
|
2831 |
}
|
| - |
|
2832 |
}else{
|
| - |
|
2833 |
if(t4){
|
| - |
|
2834 |
if(mouse.y<(alto-10-(2/scale))&&mouse.x<=(ancho-(2/scale))){
|
| - |
|
2835 |
|
| - |
|
2836 |
if((mouse.y-y)>50){
|
| - |
|
2837 |
yf=mouse.y-y;
|
| - |
|
2838 |
}
|
| - |
|
2839 |
if((mouse.x-x)>50){
|
| - |
|
2840 |
xf=mouse.x-x;
|
| - |
|
2841 |
}
|
| - |
|
2842 |
|
| - |
|
2843 |
}else{
|
| - |
|
2844 |
if(mouse.y>=(alto-10-(2/scale))){
|
| - |
|
2845 |
yf=alto-y;
|
| - |
|
2846 |
}
|
| - |
|
2847 |
if(mouse.x>(ancho-(2/scale))){
|
| - |
|
2848 |
xf=(ancho)-x;
|
| - |
|
2849 |
}
|
| - |
|
2850 |
t4=false;
|
| - |
|
2851 |
}
|
| - |
|
2852 |
}
|
| - |
|
2853 |
if(t3){
|
| - |
|
2854 |
if(mouse.y>(2/scale)&&mouse.x<=(ancho-(2/scale))){
|
| - |
|
2855 |
|
| - |
|
2856 |
if((yf-(mouse.y-y))>50){
|
| - |
|
2857 |
yf=yf-(mouse.y-y);
|
| - |
|
2858 |
y=mouse.y;
|
| - |
|
2859 |
}
|
| - |
|
2860 |
if((mouse.x-x)>50){
|
| - |
|
2861 |
xf=mouse.x-x;
|
| - |
|
2862 |
}
|
| - |
|
2863 |
|
| - |
|
2864 |
|
| - |
|
2865 |
}else{
|
| - |
|
2866 |
if(mouse.x>(ancho-(2/scale))){
|
| - |
|
2867 |
xf=ancho-x;
|
| - |
|
2868 |
}
|
| - |
|
2869 |
if(mouse.y<=(2/scale)){
|
| - |
|
2870 |
yf=yf-(mouse.y-y);
|
| - |
|
2871 |
y=0;
|
| - |
|
2872 |
}
|
| - |
|
2873 |
t3=false;
|
| - |
|
2874 |
}
|
| - |
|
2875 |
}
|
| - |
|
2876 |
/* Izquierda abajo */
|
| - |
|
2877 |
if(t2){
|
| - |
|
2878 |
if(mouse.y<(alto-10-(2/scale))&&mouse.x>=(2/scale)){
|
| - |
|
2879 |
if((mouse.y-y)>50){
|
| - |
|
2880 |
yf=mouse.y-y;
|
| - |
|
2881 |
}
|
| - |
|
2882 |
if((xf-(mouse.x-x))>50){
|
| - |
|
2883 |
xf=xf-(mouse.x-x);
|
| - |
|
2884 |
x=mouse.x
|
| - |
|
2885 |
}
|
| - |
|
2886 |
|
| - |
|
2887 |
}else{
|
| - |
|
2888 |
if(mouse.y>=(alto-10-(2/scale))) {
|
| - |
|
2889 |
yf=alto-y;
|
| - |
|
2890 |
}
|
| - |
|
2891 |
|
| - |
|
2892 |
if(mouse.x<(2/scale)){
|
| - |
|
2893 |
xf=xf-(mouse.x-x);
|
| - |
|
2894 |
x=0;
|
| - |
|
2895 |
}
|
| - |
|
2896 |
t2=false;
|
| - |
|
2897 |
}
|
| - |
|
2898 |
}
|
| - |
|
2899 |
/* izquierda arriba */
|
| - |
|
2900 |
if(t1){
|
| - |
|
2901 |
if(mouse.y>(2/scale)&&mouse.x>=(2/scale)){
|
| - |
|
2902 |
|
| - |
|
2903 |
if((yf-(mouse.y-y))>50){
|
| - |
|
2904 |
yf=yf-(mouse.y-y);
|
| - |
|
2905 |
y=mouse.y;
|
| - |
|
2906 |
}
|
| - |
|
2907 |
if((xf-(mouse.x-x))>50){
|
| - |
|
2908 |
xf=xf-(mouse.x-x);
|
| - |
|
2909 |
x=mouse.x
|
| - |
|
2910 |
}
|
| - |
|
2911 |
|
| - |
|
2912 |
}else{
|
| - |
|
2913 |
if(mouse.y<=(2/scale)){
|
| - |
|
2914 |
yf=yf-(mouse.y-y);
|
| - |
|
2915 |
y=0;
|
| - |
|
2916 |
}
|
| - |
|
2917 |
if(mouse.x<(2/scale)){
|
| - |
|
2918 |
xf=xf-(mouse.x-x);
|
| - |
|
2919 |
x=0;
|
| - |
|
2920 |
|
| - |
|
2921 |
}
|
| - |
|
2922 |
t1=false;
|
| - |
|
2923 |
}
|
| - |
|
2924 |
}
|
| - |
|
2925 |
}
|
| - |
|
2926 |
|
| - |
|
2927 |
actualizar();
|
| - |
|
2928 |
}else if(texto_listo){
|
| - |
|
2929 |
if(tcli){
|
| - |
|
2930 |
tx=mouse.x-(txf/2)
|
| - |
|
2931 |
ty=mouse.y-(tyf/2)
|
| - |
|
2932 |
}else if(rotar){
|
| - |
|
2933 |
|
| - |
|
2934 |
}
|
| - |
|
2935 |
|
| - |
|
2936 |
actualizar2();
|
| - |
|
2937 |
}
|
| - |
|
2938 |
})
|
| - |
|
2939 |
$(elemento).mouseup(function(e){
|
| - |
|
2940 |
if(!recorte_listo){
|
| - |
|
2941 |
cli=false;
|
| - |
|
2942 |
t1=false;
|
| - |
|
2943 |
t2=false;
|
| - |
|
2944 |
t3=false;
|
| - |
|
2945 |
t4=false;
|
| - |
|
2946 |
}else if (texto_listo) {
|
| - |
|
2947 |
tcli=false;
|
| - |
|
2948 |
}
|
| - |
|
2949 |
})
|
| - |
|
2950 |
|
| - |
|
2951 |
|
| - |
|
2952 |
}
|
| - |
|
2953 |
/* Titulo */
|
| - |
|
2954 |
|
| - |
|
2955 |
var titulo_noticia, censor_titulo = true, numero_titulo=0;
|
| - |
|
2956 |
$(document).on("keyup change", "#name", function(e){
|
| - |
|
2957 |
console.log(numero_titulo)
|
| - |
|
2958 |
titulo_noticia = $(this).val();
|
| - |
|
2959 |
titulo_elemento= $(".titulo_topico");
|
| - |
|
2960 |
if(titulo_noticia!=""){
|
| - |
|
2961 |
if(censor_titulo){
|
| - |
|
2962 |
titulo_elemento.html(titulo_noticia);
|
| - |
|
2963 |
if(titulo_elemento.height()>38){
|
| - |
|
2964 |
var titulo_noticia2 = "";
|
| - |
|
2965 |
for(var i =0; i <titulo_noticia.length;i++){
|
| - |
|
2966 |
titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
|
| - |
|
2967 |
titulo_elemento.html(titulo_noticia2);
|
| - |
|
2968 |
if(titulo_elemento.height()>38){
|
| - |
|
2969 |
titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
|
| - |
|
2970 |
titulo_elemento.html(titulo_noticia2);
|
| - |
|
2971 |
numero_titulo = titulo_noticia2.length;
|
| - |
|
2972 |
censor_titulo=false;
|
| - |
|
2973 |
break;
|
| - |
|
2974 |
}
|
| - |
|
2975 |
|
| - |
|
2976 |
}
|
| - |
|
2977 |
}else{
|
| - |
|
2978 |
numero_titulo=0;
|
| - |
|
2979 |
}
|
| - |
|
2980 |
}else{
|
| - |
|
2981 |
if(numero_titulo+1>=titulo_noticia.length){
|
| - |
|
2982 |
titulo_elemento.html(titulo_noticia);
|
| - |
|
2983 |
censor_titulo=true;
|
| - |
|
2984 |
}
|
| - |
|
2985 |
}
|
| - |
|
2986 |
}else{
|
| - |
|
2987 |
titulo_elemento.html("LABEL_TITLE_TOPIC");
|
| - |
|
2988 |
censor_titulo = true;
|
| - |
|
2989 |
}
|
| - |
|
2990 |
})
|
| 1738 |
|
2991 |
|
| 1739 |
});
|
2992 |
});
|
| 1740 |
JS;
|
2993 |
JS;
|
| 1741 |
$this->inlineScript()->captureEnd();
|
2994 |
$this->inlineScript()->captureEnd();
|