Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 20 | Rev 6694 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 20 Rev 6682
Línea 752... Línea 752...
752
 
752
 
753
    $('body').on('click', 'button.btn-refresh', function(e) {
753
    $('body').on('click', 'button.btn-refresh', function(e) {
754
        e.preventDefault();
754
        e.preventDefault();
755
        gridTable.api().ajax.reload(null, false);
755
        gridTable.api().ajax.reload(null, false);
-
 
756
    });
-
 
757
       	/*Script del editor (Aqui comienza el cielo y la tierra) */
-
 
758
		var imagenServidorNoticia;
-
 
759
		var scroll_altura,viente;
-
 
760
		var nombre_user = $(".perfil_u_nombre").text();
-
 
761
		var primer_nombre = nombre_user.split(" ")[0];
-
 
762
		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</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>'	
-
 
763
		
-
 
764
		$(document).on("click", ".info_noticia", function(e){
-
 
765
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
-
 
766
			console.log(imagenServidorNoticia.split(','))
-
 
767
			$('.background').val(imagenServidorNoticia.split(',')[1]);
-
 
768
            $('.imageType .file').val(imagenServidorNoticia.split(',')[1]);
-
 
769
			console.log($('.file').val())
-
 
770
			$(".c1").addClass("paso");
-
 
771
 
-
 
772
		
-
 
773
		})
-
 
774
 
-
 
775
		function iniciarEditor(campo, image=''){
-
 
776
		 cortar=false;
-
 
777
		recorte_listo=false;
-
 
778
		texto="";
-
 
779
		seis=true;
-
 
780
		color="#ffffff";
-
 
781
		texto_listo=false,siete=false;
-
 
782
		uno=true;
-
 
783
		size=48;
-
 
784
		cinco=true;
-
 
785
		xf=320,yf =480;
-
 
786
		negritas=false, bold="";
-
 
787
		shadow = true, nueve=true;
-
 
788
		italic=false, ita="";
-
 
789
		rectangulo=false, diez=false;
-
 
790
     	fontfamily="Arial";
-
 
791
     	r=0,g=0,b=0,a=1;
-
 
792
		window.clearInterval(editorNoticia);	
-
 
793
		setTimeout(function(){
-
 
794
			scroll_altura=$(".articulo_noticia").offset().top-110;
-
 
795
			anchoFondoOscuro = $(".articulo_noticia").width();
-
 
796
			altoFondoOscuro = $(".editor_imagenes").height();
-
 
797
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
-
 
798
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
-
 
799
		
-
 
800
		},navegacion(nuevoHtmlImagen,campo,image));
-
 
801
 
-
 
802
		}
-
 
803
 
-
 
804
		$(document).on("click", ".volver", function(){
-
 
805
		var nombre_user = $(".perfil_u_nombre").text();
-
 
806
		var primer_nombre = nombre_user.split(" ")[0];
-
 
807
		 cortar=false;
-
 
808
		cinco=true;
-
 
809
		recorte_listo=false;
-
 
810
		texto="";
-
 
811
		seis=true;
-
 
812
		color="#ffffff";
-
 
813
		texto_listo=false,siete=false;
-
 
814
		uno=true;
-
 
815
		size=48;
-
 
816
		xf=320,yf =480;
-
 
817
		negritas=false, bold="";
-
 
818
		shadow = true, nueve=true;
-
 
819
		italic=false, ita="";
-
 
820
		rectangulo=false, diez=false;
-
 
821
     	fontfamily="Arial";
-
 
822
     	r=0,g=0,b=0,a=1;
-
 
823
		 var imagenServidorNoticia;
-
 
824
         console.log(seleccionarCampo)
-
 
825
		window.clearInterval(editorNoticia);
-
 
826
		setTimeout(function(){
-
 
827
			scroll_altura=$(".articulo_noticia").offset().top-110;
-
 
828
			anchoFondoOscuro = $(".articulo_noticia").width();
-
 
829
			altoFondoOscuro = $(".editor_imagenes").height();
-
 
830
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
-
 
831
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
-
 
832
		
-
 
833
		},navegacion(nuevoHtmlImagen,seleccionarCampo));
-
 
834
		
-
 
835
		})
-
 
836
 
-
 
837
		function navegacion(nuevoHtmlImagen,campo,image='',reload=true){
-
 
838
                selectorElementoName=campo.find('#name')
-
 
839
 
-
 
840
                selectorElementoEditor=campo.find('#contenido');
-
 
841
				
-
 
842
				if(image!=''){
-
 
843
					const getBase64FromUrl = async (url) => {
-
 
844
						const data = await fetch(url);
-
 
845
						const blob = await data.blob();
-
 
846
						return new Promise((resolve) => {
-
 
847
							const reader = new FileReader();
-
 
848
							reader.readAsDataURL(blob); 
-
 
849
							reader.onloadend = function() {
-
 
850
							const base64data = reader.result;   
-
 
851
							resolve(base64data);
-
 
852
							}
-
 
853
						});
-
 
854
					}
-
 
855
 
-
 
856
					getBase64FromUrl(image).then(function(e){	
-
 
857
						selectorElementoName.trigger('change');
-
 
858
						$(".volver").css("display","block")
-
 
859
						$(".a1").addClass("paso");
-
 
860
						$(".titulo_pasos").html("LABEL_STEP_2");
-
 
861
						setTimeout(function(){
-
 
862
							recorte_listo=true;
-
 
863
							$(".fondo_oscuro").css("display","none");
-
 
864
							$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
-
 
865
							$(".recortar10").removeClass("recortar");
-
 
866
							$(".canvas").removeClass("recortar");
-
 
867
							$(".b1").addClass("paso");
-
 
868
							$(".titulo_pasos").html("LABEL_STEP_3");
-
 
869
							if(texto!=""){
-
 
870
								seis=true;
-
 
871
								siete=true;
-
 
872
							}
-
 
873
							cinco=true;
-
 
874
							dos=true;
-
 
875
							cuatro=true;
-
 
876
							actualizar();
-
 
877
					
-
 
878
						},editorNoticia(e));
-
 
879
						
-
 
880
						
-
 
881
					})
-
 
882
		
-
 
883
					setTimeout(function(){				
-
 
884
						$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
-
 
885
						selectorElementoName.trigger('change');
-
 
886
					},selectorElementoEditor.html(nuevoHtmlImagen));
-
 
887
				}else{
-
 
888
					setTimeout(function(){				
-
 
889
					    selectorElementoName.trigger('change');
-
 
890
					},selectorElementoEditor.html(nuevoHtmlImagen));
-
 
891
				}
-
 
892
			
-
 
893
		}
-
 
894
 
-
 
895
		$(window).on("scroll", function(){
-
 
896
			console.log(scroll_altura)
-
 
897
		if($(window).scrollTop()>scroll_altura){
-
 
898
			$("#cuadro_noticias").addClass("fixed");
-
 
899
		}else{
-
 
900
			$("#cuadro_noticias").removeClass("fixed");
-
 
901
		}
-
 
902
	})
-
 
903
 
-
 
904
	$(document).on("dragover", "#imagen_noticia", function(e){
-
 
905
		e.preventDefault();
-
 
906
		e.stopPropagation();
-
 
907
		$(this).css({"background":"rgba(0,0,0,.2)"})
-
 
908
	})
-
 
909
	$(document).on("drop", "#imagen_noticia", function(e){
-
 
910
		e.preventDefault();
-
 
911
		e.stopPropagation();
-
 
912
		$(this).css("background", "none");
-
 
913
		var archivo = e.originalEvent.dataTransfer.files;
-
 
914
		var img=archivo[0];
-
 
915
		if(img.type =="image/jpeg"||img.type =="image/png"){
-
 
916
			$(".modificar").removeClass("animated");
-
 
917
			var render = new FileReader();
-
 
918
			render.readAsDataURL(img);
-
 
919
			render.onload = function(e){
-
 
920
				$(".volver").css("display","block")
-
 
921
				$(".a1").addClass("paso");
-
 
922
				$(".titulo_pasos").html("LABEL_STEP_2");
-
 
923
				console.log(e.target.result)
-
 
924
				editorNoticia(e.target.result)
-
 
925
			}	
-
 
926
		}
-
 
927
	})	
-
 
928
	$(document).on("dragover", "body", function(e){
-
 
929
		e.preventDefault();
-
 
930
		e.stopPropagation();
-
 
931
	})
-
 
932
	$(document).on("drop", "body", function(e){
-
 
933
		e.preventDefault();
-
 
934
		e.stopPropagation();
-
 
935
	})	
-
 
936
 
-
 
937
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
-
 
938
	$(document).on("mouseover", ".editorNoticia", function(){
-
 
939
		$("body").css({"overflow": "hidden"});
-
 
940
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
-
 
941
		$(".barra,.footer").css("padding-right","17px")
-
 
942
		
-
 
943
 
-
 
944
	})
-
 
945
	$(document).on("mouseover", "#editorNoticia", function(){
-
 
946
		if(recorte_listo){
-
 
947
			ocho=true;	
-
 
948
		}
-
 
949
	})
-
 
950
	$(document).on("mouseout", "#editorNoticia", function(){
-
 
951
		if(recorte_listo){
-
 
952
			ocho=false;
-
 
953
			actualizar2()
-
 
954
		}
-
 
955
	})
-
 
956
	$(document).on("mouseout", ".editorNoticia",function(){
-
 
957
		$("body").css({"overflow": "auto"})
-
 
958
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
-
 
959
		$(".barra,.footer").css("padding-right","0px")
-
 
960
		
-
 
961
	})
-
 
962
	$(document).on('mousewheel', ".editorNoticia",function(e){
-
 
963
		var ruedita = e.originalEvent.wheelDelta 
-
 
964
		if(ruedita>0){
-
 
965
			scale = scale+(scale/10); 
-
 
966
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
967
		}else{
-
 
968
			scale = scale-(scale/10); 
-
 
969
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
970
		}
-
 
971
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
-
 
972
	})
-
 
973
	$(document).on("click", ".as", function(e){
-
 
974
		e.preventDefault();
-
 
975
		 scale = $(this).data("scale");
-
 
976
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
977
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
-
 
978
		
-
 
979
	})
-
 
980
	$(document).on("click", ".ps", function(e){
-
 
981
		e.preventDefault();
-
 
982
		$(".cantidades_scale").slideToggle(200).css("display", "block");
-
 
983
	})
-
 
984
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
-
 
985
		e.preventDefault();
-
 
986
		if(recorte_listo){
-
 
987
		$(".contenido_filter").slideToggle(200).css("display", "block");
-
 
988
		}
-
 
989
	})
-
 
990
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
-
 
991
		e.preventDefault();
-
 
992
		if(recorte_listo){
-
 
993
			$(".contenido_text").slideToggle(200).css("display", "block");
-
 
994
		}
-
 
995
	})
-
 
996
	
-
 
997
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
-
 
998
		e.preventDefault();
-
 
999
		if(cortar){
-
 
1000
			$(".contenido_cut").slideToggle(200).css("display", "block");
-
 
1001
		}
-
 
1002
		
-
 
1003
	})
-
 
1004
	$(document).on("click", "#menos_scale", function(e){
-
 
1005
		e.preventDefault();
-
 
1006
		scale = scale-(scale/10);
-
 
1007
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
1008
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
-
 
1009
	})
-
 
1010
 
-
 
1011
	$(document).on("click", "#mas_scale", function(e){
-
 
1012
		e.preventDefault();
-
 
1013
		scale = scale+(scale/10);
-
 
1014
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
1015
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
-
 
1016
	})
-
 
1017
	$(document).on("click", "#noche", function(){
-
 
1018
		$(".oa").removeClass("oa")
-
 
1019
		filter( .5,1.3,1.31,1.33,1.38);
-
 
1020
		$(this).addClass("oa")
-
 
1021
	})
-
 
1022
	$(document).on("click", "#sa", function(){
-
 
1023
		$(".oa").removeClass("oa")
-
 
1024
		filter( .7,1.1,1.64,1.66,1.50);
-
 
1025
		$(this).addClass("oa")
-
 
1026
	})
-
 
1027
	$(document).on("click", "#crema", function(){
-
 
1028
		$(".oa").removeClass("oa")
-
 
1029
		filter( .75,1,1.66,1.60,1.51);
-
 
1030
		$(this).addClass("oa")
-
 
1031
	})
-
 
1032
	$(document).on("click", "#setenta", function(){
-
 
1033
		$(".oa").removeClass("oa")
-
 
1034
		filter( .8,.75,1.60,1.66,1.58);
-
 
1035
		$(this).addClass("oa")
-
 
1036
	})
-
 
1037
	$(document).on("click", "#orange", function(){
-
 
1038
		$(".oa").removeClass("oa")
-
 
1039
		filter( .8,1,1.6,1.45,1.49);
-
 
1040
		$(this).addClass("oa")
-
 
1041
	})
-
 
1042
	$(document).on("click", "#relieve", function(){
-
 
1043
		$(".oa").removeClass("oa")
-
 
1044
		filter( .7,1.2,1.60,1.66,1.58);
-
 
1045
		$(this).addClass("oa")
-
 
1046
	})
-
 
1047
	$(document).on("click", "#bosque", function(){
-
 
1048
		$(".oa").removeClass("oa")
-
 
1049
		filter( .85,.75,1.47,1.66,1.54);
-
 
1050
		$(this).addClass("oa")
-
 
1051
	})
-
 
1052
	$(document).on("click", "#desierto", function(){
-
 
1053
		$(".oa").removeClass("oa")
-
 
1054
		filter( .8,.9,1.66,1.43,1.28);
-
 
1055
		$(this).addClass("oa")
-
 
1056
	})
-
 
1057
	$(document).on("click", "#villa", function(){
-
 
1058
		$(".oa").removeClass("oa")
-
 
1059
		filter( .8,.8,1.71,1.64,1.58);
-
 
1060
		$(this).addClass("oa")
-
 
1061
	})
-
 
1062
	$(document).on("click", "#magia", function(){
-
 
1063
		$(".oa").removeClass("oa")
-
 
1064
		filter( .7,1.2,1.49,1.49,1.6);
-
 
1065
		$(this).addClass("oa")
-
 
1066
	})
-
 
1067
	$(document).on("click", "#luz", function(){
-
 
1068
		$(".oa").removeClass("oa")
-
 
1069
		filter( .9,.9,1.45,1.54,1.54);
-
 
1070
		$(this).addClass("oa")
-
 
1071
	})
-
 
1072
	$(document).on("click", "#retoque", function(){
-
 
1073
		$(".oa").removeClass("oa")
-
 
1074
		filter( .9,1.3,1,1,1);
-
 
1075
		$(this).addClass("oa")
-
 
1076
	})
-
 
1077
	$(document).on("click", "#saturacion", function(){
-
 
1078
		$(".oa").removeClass("oa")
-
 
1079
		filter( 1,1.5,1,1,1);
-
 
1080
		$(this).addClass("oa")
-
 
1081
	})
-
 
1082
	$(document).on("click", "#rosa", function(){
-
 
1083
		$(".oa").removeClass("oa")
-
 
1084
		filter( .8,1.2,1.24,.99,1);
-
 
1085
		$(this).addClass("oa")
-
 
1086
	})
-
 
1087
	$(document).on("click", "#historia", function(){
-
 
1088
		$(".oa").removeClass("oa")
-
 
1089
		filter( .9,1.1,1.33,1.19,.91);
-
 
1090
		$(this).addClass("oa")
-
 
1091
	})
-
 
1092
	$(document).on("click", "#encantador", function(){
-
 
1093
		$(".oa").removeClass("oa")
-
 
1094
		filter( .9,1.2,26,-12,0,2);
-
 
1095
		$(this).addClass("oa")
-
 
1096
	})
-
 
1097
	$(document).on("click", "#emocion", function(){
-
 
1098
		$(".oa").removeClass("oa")
-
 
1099
		filter( 1.1,1.4,40,12,-6,2);
-
 
1100
		$(this).addClass("oa")
-
 
1101
	})
-
 
1102
	$(document).on("click", "#beige", function(){
-
 
1103
		$(".oa").removeClass("oa")
-
 
1104
		filter( .9,1.32,56,47,17,2);
-
 
1105
		$(this).addClass("oa")
-
 
1106
	})
-
 
1107
	$(document).on("click", "#fine", function(){
-
 
1108
		$(".oa").removeClass("oa")
-
 
1109
		filter( .87,1.19,55,37,23,2);
-
 
1110
		$(this).addClass("oa")
-
 
1111
	})
-
 
1112
	$(document).on("click", "#lord", function(){
-
 
1113
		$(".oa").removeClass("oa")
-
 
1114
		filter( 1.2,.9,67,13,-23,2);
-
 
1115
		$(this).addClass("oa")
-
 
1116
	})
-
 
1117
	$(document).on("click", "#70", function(){
-
 
1118
		$(".oa").removeClass("oa")
-
 
1119
		filter( 1.2,1.2,35,7,18,2);
-
 
1120
		$(this).addClass("oa")
-
 
1121
	})
-
 
1122
	$(document).on("click", "#arbol", function(){
-
 
1123
		$(".oa").removeClass("oa")
-
 
1124
		filter(.92,1.23,-11,11,11,2);
-
 
1125
		$(this).addClass("oa")
-
 
1126
	})
-
 
1127
	$(document).on("click", "#verano", function(){
-
 
1128
		$(".oa").removeClass("oa")
-
 
1129
		filter( 1,1.4,-3,-1,-12,2);
-
 
1130
		$(this).addClass("oa")
-
 
1131
	})
-
 
1132
	$(document).on("click", "#cf", function(){
-
 
1133
		$(".oa").removeClass("oa")
-
 
1134
		filter( .85,1.26,-15,2,-1,2);
-
 
1135
		$(this).addClass("oa")
-
 
1136
	})
-
 
1137
	$(document).on("click", "#angeles", function(){
-
 
1138
		$(".oa").removeClass("oa")
-
 
1139
		filter( 1,1.4,5,12,1,2);
-
 
1140
		$(this).addClass("oa")
-
 
1141
	})
-
 
1142
	$(document).on("click", "#caliente", function(){
-
 
1143
		$(".oa").removeClass("oa")
-
 
1144
		filter( .9,1.2,43,-17,-55,2);
-
 
1145
		$(this).addClass("oa")
-
 
1146
	})
-
 
1147
	$(document).on("click", "#otono", function(){
-
 
1148
		$(".oa").removeClass("oa")
-
 
1149
		filter( 1,1.29,29,26,17,2);
-
 
1150
		$(this).addClass("oa")
-
 
1151
	})
-
 
1152
	$(document).on("click", "#marzo", function(){
-
 
1153
		$(".oa").removeClass("oa")
-
 
1154
		filter( .85,1.3,43,25,-11,2);
-
 
1155
		$(this).addClass("oa")
-
 
1156
	})
-
 
1157
	$(document).on("click", "#pera", function(){
-
 
1158
		$(".oa").removeClass("oa")
-
 
1159
		filter( .8,1.25,31,41,12,2);
-
 
1160
		$(this).addClass("oa")
-
 
1161
	})
-
 
1162
	$(document).on("click", "#comun", function(){
-
 
1163
		$(".oa").removeClass("oa")
-
 
1164
		filter( 1,1.36,4,5,1,2);
-
 
1165
		$(this).addClass("oa")
-
 
1166
	})
-
 
1167
	$(document).on("click", "#oro", function(){
-
 
1168
		$(".oa").removeClass("oa")
-
 
1169
		filter( .9,1.3,37,-25,1,2);
-
 
1170
		$(this).addClass("oa")
-
 
1171
	})
-
 
1172
	$(document).on("click", "#gotico", function(){
-
 
1173
		$(".oa").removeClass("oa")
-
 
1174
		filter( 1.1,1.3,-47,-42,-30,2);
-
 
1175
		$(this).addClass("oa")
-
 
1176
	})
-
 
1177
	$(document).on("click", "#forestal", function(){
-
 
1178
		$(".oa").removeClass("oa")
-
 
1179
		filter( 1,1.4,-5,42,11,2);
-
 
1180
		$(this).addClass("oa")
-
 
1181
	})
-
 
1182
	$(document).on("click", "#luna", function(){
-
 
1183
		$(".oa").removeClass("oa")
-
 
1184
		filter( .9,1.2,-5,-7,4,2);
-
 
1185
		$(this).addClass("oa")
-
 
1186
	})
-
 
1187
	$(document).on("click", "#fiesta", function(){
-
 
1188
		$(".oa").removeClass("oa")
-
 
1189
		filter( 1.1,1.3,-1,-1,26,2);
-
 
1190
		$(this).addClass("oa")
-
 
1191
	})
-
 
1192
	$(document).on("click", "#gris", function(){
-
 
1193
		$(".oa").removeClass("oa")
-
 
1194
		filtergris(1,1)
-
 
1195
		$(this).addClass("oa")
-
 
1196
	})
-
 
1197
	$(document).on("click", "#lhs", function(){
-
 
1198
		$(".oa").removeClass("oa")
-
 
1199
		filtergris(.8,1.5);
-
 
1200
		$(this).addClass("oa")
-
 
1201
	})
-
 
1202
	$(document).on("click", "#normal", function(){
-
 
1203
		$(".oa").removeClass("oa")
-
 
1204
		$(this).addClass("oa")
-
 
1205
		filter();
-
 
1206
	})
-
 
1207
	var texto_listo=false,siete=false;
-
 
1208
	var texto;
-
 
1209
	$(document).on("keyup", "#texto_input", function(e){
-
 
1210
		e.preventDefault();
-
 
1211
		texto = $(this).val();
-
 
1212
		if(texto_actualizar){
-
 
1213
			siete=true;	
-
 
1214
		}
-
 
1215
		if(texto!=""){
-
 
1216
			texto_actualizar=true;
-
 
1217
			actualizar2();
-
 
1218
		}else{
-
 
1219
			actualizar2();
-
 
1220
		}
-
 
1221
 
-
 
1222
	})
-
 
1223
	var color="#ffffff";
-
 
1224
	$(document).on("change", "#color", function(){
-
 
1225
    	color=$(this).val();
-
 
1226
    	seis=true;
-
 
1227
    	actualizar2();
-
 
1228
    })
-
 
1229
    var size=48;
-
 
1230
    $(document).on("keyup change", "#font-size", function(){
-
 
1231
    	size=$(this).val();
-
 
1232
    	size = parseInt(size);
-
 
1233
    	seis=true;
-
 
1234
    	siete=true;
-
 
1235
    	actualizar2();
-
 
1236
    })
-
 
1237
    var negritas=false, bold="";
-
 
1238
    $(document).on("click", "#negritas", function(e){
-
 
1239
    	e.preventDefault();
-
 
1240
    	if(!negritas){
-
 
1241
    		bold="bold";
-
 
1242
    		$(this).addClass("fa");
-
 
1243
    		seis=true;
-
 
1244
    		siete=true;
-
 
1245
    		actualizar2();
-
 
1246
    		negritas=true;
-
 
1247
    	}else{
-
 
1248
    		bold="";
-
 
1249
    		$(this).removeClass("fa");
-
 
1250
    		seis=true;
-
 
1251
    		siete=true;
-
 
1252
    		actualizar2();
-
 
1253
    		negritas=false;
-
 
1254
    	}
-
 
1255
    })
-
 
1256
    var italic=false, ita="";
-
 
1257
     $(document).on("click", "#italic", function(e){
-
 
1258
    	e.preventDefault();
-
 
1259
    	if(!italic){
-
 
1260
    		ita="italic";
-
 
1261
    		$(this).addClass("fa");
-
 
1262
    		seis=true;
-
 
1263
    		siete=true;
-
 
1264
    		actualizar2();
-
 
1265
    		italic=true;
-
 
1266
    	}else{
-
 
1267
    		ita="";
-
 
1268
    		$(this).removeClass("fa");
-
 
1269
    		seis=true;
-
 
1270
    		siete=true;
-
 
1271
    		actualizar2();
-
 
1272
    		italic=false;
-
 
1273
    	}
-
 
1274
    })
-
 
1275
     var fontfamily="Arial";
-
 
1276
     $(document).on("click", ".fs", function(e){
-
 
1277
    	e.preventDefault();
-
 
1278
    	$(".at").removeClass("at");
-
 
1279
    	$(this).addClass("at");
-
 
1280
    	fontfamily= $(this).text();
-
 
1281
    	seis=true;
-
 
1282
    	siete=true;
-
 
1283
    	actualizar2();
-
 
1284
    	
-
 
1285
    })
-
 
1286
     var shadow = true, nueve=true;
-
 
1287
     $(document).on("click","#shadow", function(e){
-
 
1288
     	e.preventDefault();
-
 
1289
     	if(shadow){
-
 
1290
     		$(this).removeClass("fa");
-
 
1291
     		seis=true;
-
 
1292
     		nueve=false;
-
 
1293
     		actualizar2();
-
 
1294
     		shadow=false;
-
 
1295
     	}else{
-
 
1296
     		$(this).addClass("fa");
-
 
1297
     		seis=true;
-
 
1298
     		nueve=true;
-
 
1299
     		actualizar2();
-
 
1300
     		shadow=true;
-
 
1301
     	}
-
 
1302
 
-
 
1303
     })
-
 
1304
     var rectangulo=false, diez=false, colorrect="#000000";
-
 
1305
     $(document).on("click", "#rectangulo", function(e){
-
 
1306
     	e.preventDefault();
-
 
1307
     	if(!rectangulo){
-
 
1308
     		$(this).addClass("fa");
-
 
1309
     		diez=true;
-
 
1310
     		actualizar2();
-
 
1311
     		rectangulo=true;
-
 
1312
     	}else{
-
 
1313
     		$(this).removeClass("fa");
-
 
1314
     		diez=false;
-
 
1315
     		actualizar2();
-
 
1316
     		rectangulo=false;
-
 
1317
     	}
-
 
1318
 
-
 
1319
     })
-
 
1320
     var r=0,g=0,b=0;
-
 
1321
    $(document).on("change", "#colorrect", function(){
-
 
1322
    	colorrect=$(this).val();
-
 
1323
    	r=parseInt(colorrect.slice(1,3),16);
-
 
1324
    	g=parseInt(colorrect.slice(3,5),16);
-
 
1325
    	b=parseInt(colorrect.slice(5,7),16);
-
 
1326
    	seis=true;
-
 
1327
    	actualizar2();
-
 
1328
    })
-
 
1329
    var a=1;
-
 
1330
	
-
 
1331
    $(document).on("keyup change", "#opacidad", function(){
-
 
1332
    	a=$(this).val();
-
 
1333
    	a=a/100;
-
 
1334
    	seis=true;
-
 
1335
    	actualizar2();
-
 
1336
    })
-
 
1337
	var imaNoti = new Image();
-
 
1338
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
-
 
1339
		cuatro=false;
-
 
1340
		restaurar(brillo, contraste);
-
 
1341
		datos=imagenOriginal.data;
-
 
1342
		if(valor==2){
-
 
1343
			for (var i =  0; i <datos.length; i+=4) {
-
 
1344
				datos[i]=datos[i]+rojo;
-
 
1345
				datos[i+1]=datos[i+1]+verde;
-
 
1346
				datos[i+2]=datos[i+2]+azul;
-
 
1347
			}
-
 
1348
		}else{
-
 
1349
			for (var i =  0; i <datos.length; i+=4) {
-
 
1350
				datos[i]=datos[i]*rojo;
-
 
1351
				datos[i+1]=datos[i+1]*verde;
-
 
1352
				datos[i+2]=datos[i+2]*azul
-
 
1353
			}	
-
 
1354
		}
-
 
1355
		editor.putImageData(imagenOriginal,0,0)
-
 
1356
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
-
 
1357
	    imaNoti.src = imagenNoticia;
-
 
1358
		actualizar2();
-
 
1359
	}
-
 
1360
	function filtergris(brillo=1, contraste=1){
-
 
1361
		cuatro=false;
-
 
1362
		restaurar(brillo, contraste);
-
 
1363
		datos=imagenOriginal.data;
-
 
1364
		var auxiliar;
-
 
1365
		for (var i =  0; i <datos.length; i+=4) {
-
 
1366
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2]; 
-
 
1367
			datos[i]=auxiliar;
-
 
1368
			datos[i+1]=auxiliar;
-
 
1369
			datos[i+2]=auxiliar;
-
 
1370
		}	
-
 
1371
		
-
 
1372
		editor.putImageData(imagenOriginal,0,0)
-
 
1373
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
-
 
1374
	    imaNoti.src = imagenNoticia;
-
 
1375
		actualizar2();
-
 
1376
	}
-
 
1377
	function restaurar(brillo = 1, contraste=1){
-
 
1378
		editor.filter = "none"
-
 
1379
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
-
 
1380
		editor.fillStyle="rgba(255,255,255,1)"
-
 
1381
		editor.fillRect(0,0,ancho,alto);
-
 
1382
		editor.fillStyle=""+color+"";
-
 
1383
		var pxf=0,pyf=0;
-
 
1384
			if(xf>=(yf/recorte)){
-
 
1385
				pxf=xf/ancho;
-
 
1386
				pyf=yf/pxf;
-
 
1387
				py=(alto/2)-(pyf/2);
-
 
1388
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
-
 
1389
			}else{
-
 
1390
				pyf=yf/alto;
-
 
1391
				pxf=xf/pyf;
-
 
1392
				px=(ancho/2)-(pxf/2);
-
 
1393
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
-
 
1394
			}
-
 
1395
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
-
 
1396
	}
-
 
1397
	var ocho=false;
-
 
1398
	function actualizar2(){
-
 
1399
		if(recorte_listo){
-
 
1400
		if(cuatro){
-
 
1401
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
-
 
1402
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
-
 
1403
	    	imaNoti.src = imagenNoticia;
-
 
1404
	    	cuatro=false;
-
 
1405
		}
-
 
1406
		editor.filter = "none"
-
 
1407
		$(imaNoti).ready(function(e){	
-
 
1408
			noticia.drawImage(imaNoti,0,0,320,480);
-
 
1409
			editor.drawImage(imaNoti,0,0,ancho,alto)
-
 
1410
			if(texto_actualizar){
-
 
1411
				if(texto!=""){
-
 
1412
					if(seis){
-
 
1413
						ancho_imaNoti = imaNoti.width;
-
 
1414
						
-
 
1415
						scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
-
 
1416
						editor.fillStyle=""+color+"";
-
 
1417
						editor.strokeStyle="rgb(255,255,255)";
-
 
1418
						if(nueve){
-
 
1419
							editor.shadowColor="rgba(0,0,0,.5)";
-
 
1420
							editor.shadowOffsetX=6;
-
 
1421
							editor.shadowOffsetY=6;
-
 
1422
							editor.shadowBlur=6;
-
 
1423
							noticia.shadowColor="rgba(0,0,0,.5)";
-
 
1424
							noticia.shadowOffsetX=6*scale_noticia;
-
 
1425
							noticia.shadowOffsetY=6*scale_noticia;
-
 
1426
							noticia.shadowBlur=6*scale_noticia;
-
 
1427
						}else{
-
 
1428
							editor.shadowColor="rgba(0,0,0,0)";
-
 
1429
							noticia.shadowColor="rgba(0,0,0,0)";
-
 
1430
						}
-
 
1431
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
-
 
1432
						editor.textAlign="start";
-
 
1433
						editor.textBaseline="top";
-
 
1434
		
-
 
1435
						var sizeNoticia = size*scale_noticia;
-
 
1436
						noticia.fillStyle=""+color+"";
-
 
1437
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
-
 
1438
						noticia.textAlign="start";
-
 
1439
						noticia.textBaseline="top";
-
 
1440
						seis=false;
-
 
1441
					}
-
 
1442
					if(siete){
-
 
1443
						dimencionesTexto = editor.measureText(texto);
-
 
1444
						txf=dimencionesTexto.width+20;
-
 
1445
						tyf= (20+size);	
-
 
1446
						siete=false;
-
 
1447
					}
-
 
1448
					if(cinco){
-
 
1449
						dimencionesTexto = editor.measureText(texto);
-
 
1450
						if(xf>=(yf/recorte)){
-
 
1451
							tx=(xf/2)-(dimencionesTexto.width/2);
-
 
1452
							ty=(xf*recorte/2)-(size/2);
-
 
1453
						}else{
-
 
1454
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
-
 
1455
							ty=(yf/2)-(size/2);
-
 
1456
						}
-
 
1457
						
-
 
1458
						txf=dimencionesTexto.width+20;
-
 
1459
						tyf= size+20;	
-
 
1460
						cinco=false;
-
 
1461
					}
-
 
1462
					if(diez){
-
 
1463
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
-
 
1464
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
-
 
1465
						editor.fillRect(tx-10,ty-10,txf,tyf);
-
 
1466
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
-
 
1467
						editor.fillStyle=""+color+"";
-
 
1468
						noticia.fillStyle=""+color+"";
-
 
1469
 
-
 
1470
					}
-
 
1471
					editor.fillText(texto,tx,ty);
-
 
1472
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
-
 
1473
					if(ocho){
-
 
1474
						editor.strokeRect(tx-10,ty-10,txf,tyf)
-
 
1475
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
-
 
1476
						editor.fill();
-
 
1477
						editor.beginPath();
-
 
1478
					}
-
 
1479
					texto_listo=true;
-
 
1480
				}
-
 
1481
			}
-
 
1482
		})
-
 
1483
		
-
 
1484
	}
-
 
1485
	}
-
 
1486
	function actualizar(){
-
 
1487
			$(imagen).ready(function(e){
-
 
1488
				if(uno){
-
 
1489
					ancho=imagen.width, alto = imagen.height;
-
 
1490
					elemento.width = ancho;
-
 
1491
					elemento.height = alto;
-
 
1492
					$(".scale").css("display","flex");
-
 
1493
					mitadX=ancho/2;
-
 
1494
					mitadY=alto/2;
-
 
1495
					x=mitadX-xf/2;
-
 
1496
					y=mitadY-yf/2;
-
 
1497
					if(ancho<=alto){
-
 
1498
					 scale = -(((alto-450)/alto)-1);
-
 
1499
					 
-
 
1500
					}else{					
-
 
1501
					 scale = -(((ancho-500)/ancho)-1);
-
 
1502
					}
-
 
1503
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
1504
					$("#ancho").html(ancho+"px");
-
 
1505
					$("#alto").html(alto+"px");
-
 
1506
					uno=false;
-
 
1507
				}
-
 
1508
				if(dos){
-
 
1509
					
-
 
1510
					if(xf>=(yf/recorte)){
-
 
1511
						alto=xf*recorte;
-
 
1512
						ancho=xf;
-
 
1513
					}else{
-
 
1514
						ancho=yf/recorte;
-
 
1515
						alto=yf;
-
 
1516
 
-
 
1517
					}
-
 
1518
					elemento.width = ancho;
-
 
1519
					elemento.height = alto;
-
 
1520
					if(xf<=yf){
-
 
1521
					 scale = -(((yf-450)/yf)-1);
-
 
1522
					 
-
 
1523
					}else{					
-
 
1524
					 scale = -(((xf-500)/xf)-1);
-
 
1525
					}
-
 
1526
					
-
 
1527
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
-
 
1528
					$("#ancho").html(Math.round(xf)+"px");
-
 
1529
					$("#alto").html(Math.round(yf)+"px");
-
 
1530
					dos=false;
-
 
1531
				}
-
 
1532
 
-
 
1533
					var pxf=0,pyf=0;
-
 
1534
					noticia.fillStyle="rgba(255,255,255,1)"
-
 
1535
					noticia.fillRect(0,0,320,480);
-
 
1536
				if(xf>=(yf/recorte)){
-
 
1537
					pxf=xf/320;
-
 
1538
					pyf=yf/pxf;
-
 
1539
					py=(480/2)-(pyf/2);
-
 
1540
					noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
-
 
1541
				}else{
-
 
1542
					pyf=yf/480;
-
 
1543
					pxf=xf/pyf;
-
 
1544
					px=(320/2)-(pxf/2);
-
 
1545
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
-
 
1546
				}
-
 
1547
				
-
 
1548
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
-
 
1549
				if(!recorte_listo){
-
 
1550
					editor.drawImage(imagen,0,0,ancho,alto);
-
 
1551
					editor.fillStyle="rgba(0,0,0,.2)"
-
 
1552
					editor.fillRect(0,0,ancho,alto);
-
 
1553
					editor.fillStyle="rgba(255,255,255,.1)"
-
 
1554
					editor.fillRect(x,y,xf,yf);
-
 
1555
					editor.fillStyle="rgba(255,255,255,.5)"
-
 
1556
					editor.fillRect(x,y,16,16);
-
 
1557
					editor.fillRect((x+xf)-16,y,16,16);
-
 
1558
					editor.fillRect(x,y+yf-16,16,16);
-
 
1559
					editor.fillRect(x+xf-16,yf+y-16,16,16);
-
 
1560
					esta=true;
-
 
1561
				}else{
-
 
1562
					var pxf=0,pyf=0;
-
 
1563
					
-
 
1564
					editor.fillStyle="rgba(255,255,255,1)"
-
 
1565
					editor.fillRect(0,0,ancho,alto);
-
 
1566
					if(xf>=(yf/recorte)){
-
 
1567
						pxf=xf/ancho;
-
 
1568
						pyf=yf/pxf;
-
 
1569
						py=(alto/2)-(pyf/2);
-
 
1570
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
-
 
1571
					}else{
-
 
1572
						pyf=yf/alto;
-
 
1573
						pxf=xf/pyf;
-
 
1574
						px=(ancho/2)-(pxf/2);
-
 
1575
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
-
 
1576
				}
-
 
1577
					
-
 
1578
				}
-
 
1579
			})
-
 
1580
		}
-
 
1581
	var imagenOriginal;
-
 
1582
	var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
-
 
1583
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
-
 
1584
	var  mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
-
 
1585
	var translateX;
-
 
1586
		
-
 
1587
	$(document).on("click", ".recortar10", function(e){
-
 
1588
		
-
 
1589
		e.preventDefault();
-
 
1590
		recorte_listo=false;
-
 
1591
		uno=true;
-
 
1592
		$(".fondo_oscuro").css("display","block");
-
 
1593
		$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
-
 
1594
		$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
-
 
1595
		$(".contenido_text").css("display", "none");
-
 
1596
		$(".contenido_filter").css("display", "none");
-
 
1597
		$(".recortar10").addClass("recortar");
-
 
1598
		$(".canvas").addClass("recortar")
-
 
1599
		$(".oa").removeClass("oa");
-
 
1600
		$("#normal").addClass("oa");
-
 
1601
		$(".b1").removeClass("paso");
-
 
1602
		$(".titulo_pasos").html("LABEL_STEP_2");
-
 
1603
		window.clearInterval(actualizar2);
-
 
1604
		actualizar();
-
 
1605
 
-
 
1606
	})
-
 
1607
 
-
 
1608
	
-
 
1609
	blockCelda=true;
-
 
1610
	$(document).on("click", "#blockCelda", function(e){
-
 
1611
		e.preventDefault();
-
 
1612
		if(blockCelda){
-
 
1613
			$(this).html('<span class="fa fa-unlock"></span>')
-
 
1614
			
-
 
1615
			blockCelda=false;
-
 
1616
		}else{
-
 
1617
			$(this).html('<span class="fa fa-lock"></span>')
-
 
1618
			blockCelda=true;
-
 
1619
		}
-
 
1620
		t4=true;
-
 
1621
		
-
 
1622
	})
-
 
1623
	var imagen 
-
 
1624
	function editorNoticia(img){
-
 
1625
		 cortar=true;
-
 
1626
		imagen= new Image();
-
 
1627
		$(".canvas").html(canvas);
-
 
1628
		elemento = document.getElementById("editorNoticia");
-
 
1629
		editor = elemento.getContext("2d");
-
 
1630
		elemento2 = document.getElementById("imagen_noticias");
-
 
1631
		noticia = elemento2.getContext("2d");
-
 
1632
 
-
 
1633
		$(document).on("click", ".boton_marino.recortar",function(e){
-
 
1634
			e.preventDefault();
-
 
1635
			recorte_listo=true;
-
 
1636
			$(".fondo_oscuro").css("display","none");
-
 
1637
			$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
-
 
1638
			$(".recortar10").removeClass("recortar");
-
 
1639
			$(".canvas").removeClass("recortar");
-
 
1640
			$(".b1").addClass("paso");
-
 
1641
			$(".titulo_pasos").html("LABEL_STEP_3");
-
 
1642
			if(texto!=""){
-
 
1643
				seis=true;
-
 
1644
				siete=true;
-
 
1645
			}
-
 
1646
			cinco=true;
-
 
1647
			dos=true;
-
 
1648
			cuatro=true;
-
 
1649
			actualizar();
-
 
1650
		})
-
 
1651
 
-
 
1652
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
-
 
1653
		var mouse =[];
-
 
1654
 
-
 
1655
	
-
 
1656
		function raton(elemento, e){
-
 
1657
			return {
-
 
1658
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
-
 
1659
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
-
 
1660
			}
-
 
1661
		}
-
 
1662
 
-
 
1663
		imagen.src=img;
-
 
1664
		$(".recortar10").addClass("recortar");
-
 
1665
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
-
 
1666
		actualizar();
-
 
1667
 
-
 
1668
		$(elemento).mousemove(function(e){
-
 
1669
			mouse = raton(this, e);
-
 
1670
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
-
 
1671
			if(!recorte_listo){
-
 
1672
				if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
-
 
1673
			 		$(elemento).css("cursor","move");
-
 
1674
			 	}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
-
 
1675
			 		$(elemento).css("cursor","nw-resize");
-
 
1676
			 	}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
-
 
1677
			 		$(elemento).css("cursor","ne-resize");
-
 
1678
			 	}else if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
-
 
1679
			 		$(elemento).css("cursor","se-resize");
-
 
1680
			 	}else if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
-
 
1681
			 		$(elemento).css("cursor","sw-resize");
-
 
1682
			 	}else{
-
 
1683
			 		$(elemento).css("cursor","default");
-
 
1684
			 	}
-
 
1685
			}else if(texto_listo){
-
 
1686
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
-
 
1687
			 		$(elemento).css("cursor","move");
-
 
1688
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
-
 
1689
			 		$(elemento).css("cursor","pointer");
-
 
1690
			 	}else{
-
 
1691
			 		$(elemento).css("cursor","default");
-
 
1692
			 	}
-
 
1693
			}
-
 
1694
			else{
-
 
1695
				$(elemento).css("cursor","default");
-
 
1696
			}
-
 
1697
		})
-
 
1698
		$(elemento).mousedown(function(e){
-
 
1699
			mouse = raton(this, e);
-
 
1700
			if(!recorte_listo){
-
 
1701
				if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
-
 
1702
			 		cli = true;
-
 
1703
			 	}
-
 
1704
			 	if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
-
 
1705
			 		t4 = true;
-
 
1706
			 	}
-
 
1707
				if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
-
 
1708
			 		t3 = true;
-
 
1709
			 	}
-
 
1710
			 	if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
-
 
1711
			 		t1 = true;
-
 
1712
			 	}
-
 
1713
			 	if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
-
 
1714
			 		t2 = true;
-
 
1715
			 	}
-
 
1716
			}else if(texto_listo){
-
 
1717
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
-
 
1718
			 		tcli=true;
-
 
1719
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
-
 
1720
			 		rotar=true;
-
 
1721
			 	}
-
 
1722
			}		 	
-
 
1723
			
-
 
1724
		 })
-
 
1725
 
-
 
1726
		 $(elemento).mousemove(function(e){
-
 
1727
		 	mouse = raton(this, e);
-
 
1728
		 	if(!recorte_listo){
-
 
1729
			 	if(cli){
-
 
1730
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
-
 
1731
				 		y = (mouse.y-(yf/2));
-
 
1732
			 		}else{
-
 
1733
			 			if((mouse.y-(yf/2))<0){
-
 
1734
			 				y=0;
-
 
1735
			 			}
-
 
1736
			 			if((mouse.y+(yf/2))>alto){
-
 
1737
			 				y=alto-yf;
-
 
1738
			 			}
-
 
1739
			 		}
-
 
1740
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
-
 
1741
			 			x = (mouse.x-(xf/2));
-
 
1742
			 		}else{
-
 
1743
			 			if((mouse.x-(xf/2))<0){
-
 
1744
			 				x=0;
-
 
1745
			 			}
-
 
1746
			 			if((mouse.x+(xf/2))>ancho){
-
 
1747
			 				x=(ancho)-xf;
-
 
1748
			 			}
-
 
1749
			 		}	 			
-
 
1750
			 	}
-
 
1751
				if(blockCelda){
-
 
1752
			 	if(t4){
-
 
1753
			 		if(mouse.y<(alto-10)&&(x+xf)<=(ancho)){
-
 
1754
				 		if(Math.round(xf)>=50){
-
 
1755
							if(((mouse.y-y)/recorte)>50){
-
 
1756
				 				yf=mouse.y-y;	
-
 
1757
				 				xf=(yf/recorte);
-
 
1758
				 			}
-
 
1759
						}
-
 
1760
			 		}else{
-
 
1761
			 			if(mouse.y>=(alto-10)){
-
 
1762
			 				yf=alto-y;
-
 
1763
				 			xf=(yf/recorte);
-
 
1764
				 			t4=false;	
-
 
1765
			 			}
-
 
1766
			 			if(x+xf>(ancho)){
-
 
1767
			 				xf=(ancho)-x;
-
 
1768
				 			yf=(xf*recorte);
-
 
1769
				 			t4=false;	
-
 
1770
			 			}
-
 
1771
			 		}
-
 
1772
			 	}
-
 
1773
			 	if(t3){
-
 
1774
			 		if(mouse.y>0&&(x+xf)<=(ancho)){
-
 
1775
				 		if(Math.round(xf)>=50){
-
 
1776
							if(((yf+(y-mouse.y))/recorte)>50){
-
 
1777
					 			yf=yf+(y-mouse.y);
-
 
1778
					 			xf=(yf/recorte);
-
 
1779
					 			y=mouse.y;	
-
 
1780
				 			}
-
 
1781
				 		}
-
 
1782
 
-
 
1783
			 		}else{
-
 
1784
			 			if(mouse.y<=0) {
-
 
1785
			 				yf=yf+(y-mouse.y);
-
 
1786
				 			xf=(yf/recorte);
-
 
1787
			 				y=0;
-
 
1788
			 				t3=false;	
-
 
1789
			 			}
-
 
1790
			 			if(x+xf>(ancho)){
-
 
1791
			 				xf=(ancho)-x;
-
 
1792
				 			yf=xf*recorte;
-
 
1793
				 			t3=false;	
-
 
1794
			 			}
-
 
1795
			 		}
-
 
1796
			 	}
-
 
1797
			 	if(t2){
-
 
1798
			 		if(mouse.y<(alto-10)&&x>=0){
-
 
1799
				 		if(Math.round(xf)>=50){	
-
 
1800
							if(((mouse.y-y)/recorte)>50){
-
 
1801
					 			x=(x+(yf-(mouse.y-y))/recorte);
-
 
1802
					 			yf=mouse.y-y;
-
 
1803
					 			xf=(yf/recorte);
-
 
1804
				 			}
-
 
1805
					 	}
-
 
1806
				 		
-
 
1807
			 		}else{
-
 
1808
			 			if(mouse.y>=(alto-10)) {
-
 
1809
			 				yf=alto-y;
-
 
1810
				 			xf=(yf/recorte);
-
 
1811
				 			t2=false;
-
 
1812
			 			}
-
 
1813
			 			if(0>x){
-
 
1814
			 				x=0;
-
 
1815
			 				xf=mouse.y-y;
-
 
1816
				 			yf=(xf*recorte);
-
 
1817
				 			t2=false;
-
 
1818
			 			}
-
 
1819
			 		}
-
 
1820
			 	}
-
 
1821
			 	if(t1){
-
 
1822
			 		if(mouse.y>0&&x>=0){
-
 
1823
				 		if(Math.round(xf)>=50){	
-
 
1824
							if(((yf+(y-mouse.y))/recorte)>50){
-
 
1825
								yf=yf+(y-mouse.y);
-
 
1826
					 			xf=(yf/recorte);
-
 
1827
					 			x=(x-(y-mouse.y)/recorte);
-
 
1828
					 			y=mouse.y;
-
 
1829
							}
-
 
1830
				 		}
-
 
1831
			 		}else{
-
 
1832
			 			if(mouse.y<=0) {
-
 
1833
			 				yf=yf+(y-mouse.y);
-
 
1834
				 			xf=(yf/recorte);
-
 
1835
			 				y=0;
-
 
1836
			 				t1=false;	
-
 
1837
			 			}
-
 
1838
			 			if(0>x){
-
 
1839
			 				x=0;
-
 
1840
			 				xf=yf+(y-mouse.y);
-
 
1841
				 			yf=(xf*recorte);
-
 
1842
				 			t1=false;	
-
 
1843
			 			}
-
 
1844
			 		}
-
 
1845
			 	}
-
 
1846
				}else{
-
 
1847
				 if(t4){
-
 
1848
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x<=(ancho-(2/scale))){
-
 
1849
				 		
-
 
1850
							if((mouse.y-y)>50){
-
 
1851
				 				yf=mouse.y-y;	
-
 
1852
				 			}
-
 
1853
							if((mouse.x-x)>50){
-
 
1854
								xf=mouse.x-x;
-
 
1855
							}
-
 
1856
						
-
 
1857
			 		}else{
-
 
1858
			 			if(mouse.y>=(alto-10-(2/scale))){
-
 
1859
			 				yf=alto-y;
-
 
1860
			 			}
-
 
1861
			 			if(mouse.x>(ancho-(2/scale))){
-
 
1862
			 				xf=(ancho)-x;
-
 
1863
			 			}
-
 
1864
						 t4=false;	
-
 
1865
			 		}
-
 
1866
			 	}
-
 
1867
			 	if(t3){
-
 
1868
			 		if(mouse.y>(2/scale)&&mouse.x<=(ancho-(2/scale))){
-
 
1869
				 		
-
 
1870
							if((yf-(mouse.y-y))>50){
-
 
1871
				 				yf=yf-(mouse.y-y);
-
 
1872
								y=mouse.y;	
-
 
1873
				 			}
-
 
1874
							if((mouse.x-x)>50){
-
 
1875
								xf=mouse.x-x;
-
 
1876
							}
-
 
1877
				 		
-
 
1878
 
-
 
1879
			 		}else{
-
 
1880
						if(mouse.x>(ancho-(2/scale))){
-
 
1881
							xf=ancho-x;
-
 
1882
						}
-
 
1883
						if(mouse.y<=(2/scale)){
-
 
1884
							yf=yf-(mouse.y-y);
-
 
1885
							y=0;
-
 
1886
						}
-
 
1887
			 			t3=false;		
-
 
1888
			 		}
-
 
1889
			 	}
-
 
1890
				/* Izquierda abajo */
-
 
1891
			 	if(t2){
-
 
1892
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x>=(2/scale)){
-
 
1893
							 if((mouse.y-y)>50){
-
 
1894
								yf=mouse.y-y;
-
 
1895
				 			}
-
 
1896
							if((xf-(mouse.x-x))>50){
-
 
1897
								xf=xf-(mouse.x-x);
-
 
1898
								x=mouse.x
-
 
1899
							}
-
 
1900
			
-
 
1901
			 		}else{
-
 
1902
			 			if(mouse.y>=(alto-10-(2/scale))) {
-
 
1903
							yf=alto-y;
-
 
1904
			 			}
-
 
1905
 
-
 
1906
			 			if(mouse.x<(2/scale)){
-
 
1907
							xf=xf-(mouse.x-x);
-
 
1908
			 				x=0;
-
 
1909
			 			}
-
 
1910
						 t2=false;
-
 
1911
			 		}
-
 
1912
			 	}
-
 
1913
				/* izquierda arriba */
-
 
1914
			 	if(t1){
-
 
1915
			 		if(mouse.y>(2/scale)&&mouse.x>=(2/scale)){
-
 
1916
							
-
 
1917
							if((yf-(mouse.y-y))>50){
-
 
1918
				 				yf=yf-(mouse.y-y);
-
 
1919
								y=mouse.y;	
-
 
1920
				 			}
-
 
1921
							if((xf-(mouse.x-x))>50){
-
 
1922
								xf=xf-(mouse.x-x);
-
 
1923
								x=mouse.x
-
 
1924
							}
-
 
1925
				 		
-
 
1926
			 		}else{
-
 
1927
						if(mouse.y<=(2/scale)){
-
 
1928
							yf=yf-(mouse.y-y);
-
 
1929
							y=0;
-
 
1930
						}
-
 
1931
						 if(mouse.x<(2/scale)){
-
 
1932
							xf=xf-(mouse.x-x);
-
 
1933
			 				x=0;
-
 
1934
				 			
-
 
1935
			 			}
-
 
1936
						 t1=false;
-
 
1937
			 		}
-
 
1938
			 	}
-
 
1939
			}
-
 
1940
			 	
-
 
1941
		 	actualizar();
-
 
1942
		 	}else if(texto_listo){
-
 
1943
		 		if(tcli){
-
 
1944
		 			tx=mouse.x-(txf/2)
-
 
1945
		 			ty=mouse.y-(tyf/2)
-
 
1946
		 		}else if(rotar){
-
 
1947
 
-
 
1948
		 		}
-
 
1949
 
-
 
1950
		 		actualizar2();
-
 
1951
		 	}
-
 
1952
		 })
-
 
1953
		 $(elemento).mouseup(function(e){
-
 
1954
		 	if(!recorte_listo){
-
 
1955
			 	cli=false;
-
 
1956
			 	t1=false;
-
 
1957
			 	t2=false;
-
 
1958
			 	t3=false;
-
 
1959
			 	t4=false;
-
 
1960
		 	}else if (texto_listo) {
-
 
1961
		 		tcli=false;
-
 
1962
		 	}
-
 
1963
		 })
-
 
1964
 
-
 
1965
 
-
 
1966
	}
-
 
1967
	/* Titulo */
-
 
1968
	
-
 
1969
var titulo_noticia, censor_titulo = true, numero_titulo=0;
-
 
1970
	$(document).on("keyup change", "#name", function(e){
-
 
1971
	console.log(numero_titulo)
-
 
1972
	titulo_noticia = $(this).val();
-
 
1973
	titulo_elemento= $(".titulo_topico");
-
 
1974
	if(titulo_noticia!=""){
-
 
1975
		if(censor_titulo){
-
 
1976
			titulo_elemento.html(titulo_noticia);
-
 
1977
			if(titulo_elemento.height()>38){
-
 
1978
				var titulo_noticia2 = "";
-
 
1979
				for(var i =0; i <titulo_noticia.length;i++){
-
 
1980
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
-
 
1981
					titulo_elemento.html(titulo_noticia2);
-
 
1982
					if(titulo_elemento.height()>38){
-
 
1983
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
-
 
1984
						titulo_elemento.html(titulo_noticia2);
-
 
1985
						numero_titulo = titulo_noticia2.length;
-
 
1986
						censor_titulo=false;
-
 
1987
						break;
756
    });
1988
					}
-
 
1989
 
-
 
1990
				}
-
 
1991
			}else{
-
 
1992
				numero_titulo=0;
-
 
1993
			}
-
 
1994
		}else{
-
 
1995
			if(numero_titulo+1>=titulo_noticia.length){
-
 
1996
				titulo_elemento.html(titulo_noticia);
-
 
1997
				censor_titulo=true;
-
 
1998
			}
-
 
1999
		}
-
 
2000
	}else{
-
 
2001
		titulo_elemento.html("LABEL_TITLE");
-
 
2002
		censor_titulo = true;
-
 
2003
	}
Línea 757... Línea 2004...
757
        
2004
})     
758
 
2005
 
759
});
2006
});
760
JS;
2007
JS;