/*********************************
* DESCRIPCIĆN:
* Creado por: Victor Villalobos, victor.villalobos@e-deas.com.co
* Copyright (c) 2014 E-DEAS LTDA. (www.e-deas.com.co)
* El uso de esta libreria esta reservador para este sitio y cualquier cambio o reutilizaciĆ³n debe ser autorizado por E-DEAS LTDA.
* Modificado por: Diego Campo, diegoc@e-deas.com.co
* Fecha Modif: 07.09.2016
**********************************/
function isFullMobile() { return UTILS.isMobile() && ( Modernizr.mq( "only screen and (max-device-width: 992px) " ) || Modernizr.mq( "only screen and (max-width: 992px) " ) ) ? !0 : !1 } function getImages() { if ( folder != null && folder.length > 0 ) { var n = UTILS.getSPAppWebUrl(), t = n.match( /^https:\/\/[^/]+/ ); n = n.substring( t[0].length, n.length ), EDEAS.spActions.getRestFiles( "ImagenesSlider", folder, "?$select=ListItemAllFields/ID,Name,ListItemAllFields/OData__Comments,ListItemAllFields/URL/Url,ListItemAllFields/RoutingPriority,ListItemAllFields/RoutingEnabled&$expand=ListItemAllFields,ListItemAllFields/URL", n ).done( function ( n ) { readAllData( n ), loadSlider() } ) } else $( "#app" ).css( "display", "none" ) } function readAllData( n ) { var t, e, u; try { var r = "", i = n.d.results, f = !1; for ( i.sort( function ( n, t ) { return parseFloat( n.ListItemAllFields.RoutingPriority ) - parseFloat( t.ListItemAllFields.RoutingPriority ) } ), t = 0; t < i.length; t++ ) i[t].ListItemAllFields.RoutingEnabled && ( f = !1, e = "", numberImagesMobile == 1 && isFullMobile() && ( e = ' style="width:560px !important;" ' ), r = i[t].ListItemAllFields.URL == null ? '
" : '
", i[t].ListItemAllFields.OData__Comments != null && i[t].ListItemAllFields.OData__Comments.length > 0 && ( r += "
' + i[t].ListItemAllFields.OData__Comments + "
", f = !0, existeAlgunCaption = !0 ), r += "
", $( "#e_slides" ).append( r ), f && ( u = "97%", i[t].ListItemAllFields.URL == null && ( u = "100%" ), numberImagesMobile == 1 && isFullMobile() ? ( left != null && left.length > 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).css( "left", parseInt( left ) + 150 ), u = 560 ) : left != null && left.length > 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).css( "left", left ), $( "#caption_" + i[t].ListItemAllFields.ID ).css( "width", u ), height != null && height.length > 0 && height != 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).css( "height", height ), isFullMobile() ? ( $( "#caption_" + i[t].ListItemAllFields.ID ).css( "transform", "scale(2)" ), topCaption != null && topCaption.length > 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).css( "top", parseInt( topCaption ) * 2.5 + parseInt( height ) ) ) : ( $( "#caption_" + i[t].ListItemAllFields.ID ).css( "transform", "scale(1)" ), topCaption != null && topCaption.length > 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).css( "top", topCaption ) ), topCaption == 0 && $( "#caption_" + i[t].ListItemAllFields.ID ).addClass( "bottomCaption" ) ) ) } catch ( o ) { alert( o.message + "Excepcion controlada" ) } } function loadSlider() { function n() { var t, u; navigator.userAgent.match( /(iPhone|iPod|iPad)/ ) ? ( t = screen.width, r || ( t = i.$Elmt.parentNode.clientWidth ), r = !1, t && i.$ScaleWidth( Math.min( t, 960 ) ) ) : ( u = document.body.clientWidth, u ? i.$ScaleWidth( Math.min( u, 960 ) ) : window.setTimeout( n, 30 ) ) } var t, u, i, r; ( time == null || time.length == 0 ) && ( time = 4e3 ), ( heightMax == null || heightMax.length == 0 ) && ( heightMax = 150 ), ( numberImages == null || numberImages.length == 0 ) && ( numberImages = 4 ), ( numberImagesMobile == null || numberImagesMobile.length == 0 ) && ( numberImagesMobile = 2 ), isFullMobile() && ( numberImages = numberImagesMobile, heightMax = heightMax * 2.5 ), numberImagesMobile == 1 && isFullMobile() ? ( $( "img" ).attr( "width", 560 ), $( ".slidesAnchor" ).css( "width", 560 ), $( ".lastDiv" ).css( "text-align", "center" ), $( ".img" ).attr( "width", 560 ) ) : ( $( "img" ).attr( "width", 960 / numberImages ), $( ".img" ).attr( "width", 960 / numberImages ) ), topCaption == 0 && existeAlgunCaption && ( t = 0, isFullMobile() && ( t = 30 ), $( "" ).appendTo( "head" ), heightMax = parseInt( heightMax ) + parseInt( height ) + t * 2.2 ), $( "#_body" ).css( { "max-height": heightMax } ), $( "#app" ).css( { "max-height": heightMax } ), $( "#slider1_container" ).css( { height: heightMax } ), $( "#e_slides" ).css( { height: heightMax } ), $( "img" ).attr( "height", heightMax ), $( ".img" ).attr( "height", heightMax ), $( "a" ).attr( "target", "_parent" ), $( "a[href='#']" ).attr( "target", "_self" ), u = { $AutoPlay: !0, $HWA: !1, $AutoPlaySteps: numberImages, $AutoPlayInterval: time, $PauseOnHover: 2, $ArrowKeyNavigation: !0, $SlideDuration: 160, $MinDragOffsetToSlide: 20, $SlideWidth: ( 860 - 5 * numberImages ) / numberImages, $SlideHeight: heightMax, $SlideSpacing: 8, $DisplayPieces: numberImages, $ParkingPosition: 0, $UISearchMode: 1, $PlayOrientation: 1, $DragOrientation: 1, $BulletNavigatorOptions: { $Class: $JssorBulletNavigator$, $ChanceToShow: 2, $AutoCenter: 0, $Steps: 1, $Lanes: 1, $SpacingX: 0, $SpacingY: 0, $Orientation: 1 }, $ArrowNavigatorOptions: { $Class: $JssorArrowNavigator$, $ChanceToShow: 2, $AutoCenter: 2, $Steps: 1 } }, i = new $JssorSlider$( "slider1_container", u ), r = !0, n(), navigator.userAgent.match( /(iPhone|iPod|iPad|BlackBerry|IEMobile)/ ) || $( window ).bind( "resize", n ), navigator.userAgent.match( /(iPhone|iPod|iPad)/ ) && ( $( window ).bind( "load", n ), $( window ).bind( "resize", n ), $( window ).bind( "orientationchange", n ) ), Communica.Part.init(), $( window ).resize( function () { Communica.Part.init() } ) } function getWebPartsParams() { height = UTILS.getQueryStringParameter( "alto" ), width = 0, topCaption = UTILS.getQueryStringParameter( "top" ), left = UTILS.getQueryStringParameter( "left" ), folder = UTILS.getQueryStringParameter( "carpeta" ), time = 1e5, heightMax = UTILS.getQueryStringParameter( "altom" ), numberImages = UTILS.getQueryStringParameter( "numeroimagenes" ), numberImagesMobile = UTILS.getQueryStringParameter( "numeroimagenesmovil" ), color = UTILS.getQueryStringParameter( "colorfondo" ) } var folder, time, heightMax, height, width, topCaption, left, numberImages, numberImagesMobile, color, existeAlgunCaption = !1; $( document ).ready( function () { getWebPartsParams(), getImages() } );