From 73476f82fb2d5f2df190976ce075e75017b57470 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Thu, 23 Apr 2020 15:39:00 -0700 Subject: [PATCH] --- App_Code/BundleConfig.vb | 4 + App_Code/ClsOIEventos.vb | 198 +- App_Code/ClsPaginas.vb | 3 +- App_Code/modExtensiones.vb | 8 + .../ion.rangeslider/css/ion.rangeSlider.css | 82 +- .../css/ion.rangeSlider.skinFlat.css | 31 +- .../css/ion.rangeSlider.skinHTML5.css | 124 + .../css/ion.rangeSlider.skinModern.css | 116 + .../css/ion.rangeSlider.skinNice.css | 31 +- .../css/ion.rangeSlider.skinSimple.css | 31 +- .../plugins/ion.rangeslider/css/normalize.css | 427 ++++ .../ion.rangeslider/img/sprite-skin-flat.png | Bin 352 -> 304 bytes .../img/sprite-skin-modern.png | Bin 0 -> 505 bytes .../ion.rangeslider/img/sprite-skin-nice.png | Bin 1022 -> 694 bytes .../img/sprite-skin-simple.png | Bin 385 -> 358 bytes .../ion.rangeslider/js/ion.rangeSlider.js | 2008 +++++++++++++++++ .../ion.rangeslider/js/ion.rangeSlider.min.js | 71 + .../css/ion.rangeSlider.Metronic.css | 87 + .../css/ion.rangeSlider.css | 126 ++ .../css/ion.rangeSlider.skinFlat.css | 89 + .../css/ion.rangeSlider.skinNice.css | 85 + .../css/ion.rangeSlider.skinSimple.css | 85 + .../css/normalize.min.css | 0 .../img/sprite-skin-flat.png | Bin 0 -> 352 bytes .../img/sprite-skin-nice.png | Bin 0 -> 1022 bytes .../img/sprite-skin-simple.png | Bin 0 -> 385 bytes .../js/.DS_Store | Bin .../js/ion-rangeSlider/ion.rangeSlider.js | 0 .../js/ion-rangeSlider/ion.rangeSlider.min.js | 0 .../ion.rangesliderOld/js/ion.rangeSlider.js | 1193 ++++++++++ .../js/ion.rangeSlider.min.js | 27 + .../js/vendor/jquery-1.11.0.min.js | 0 OI/TareaDetalle.aspx | 722 ++++++ OI/TareaDetalle.aspx.cs | 691 ++++++ Scripts/custom.js | 10 +- 35 files changed, 6190 insertions(+), 59 deletions(-) create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinHTML5.css create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinModern.css create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/css/normalize.css create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-modern.png create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.js create mode 100644 Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.min.js create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/css/ion.rangeSlider.Metronic.css create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/css/ion.rangeSlider.css create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/css/ion.rangeSlider.skinFlat.css create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/css/ion.rangeSlider.skinNice.css create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/css/ion.rangeSlider.skinSimple.css rename Metronic/assets/global/plugins/{ion.rangeslider => ion.rangesliderOld}/css/normalize.min.css (100%) create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-flat.png create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-nice.png create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-simple.png rename Metronic/assets/global/plugins/{ion.rangeslider => ion.rangesliderOld}/js/.DS_Store (100%) rename Metronic/assets/global/plugins/{ion.rangeslider => ion.rangesliderOld}/js/ion-rangeSlider/ion.rangeSlider.js (100%) rename Metronic/assets/global/plugins/{ion.rangeslider => ion.rangesliderOld}/js/ion-rangeSlider/ion.rangeSlider.min.js (100%) create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.js create mode 100644 Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.min.js rename Metronic/assets/global/plugins/{ion.rangeslider => ion.rangesliderOld}/js/vendor/jquery-1.11.0.min.js (100%) create mode 100644 OI/TareaDetalle.aspx create mode 100644 OI/TareaDetalle.aspx.cs diff --git a/App_Code/BundleConfig.vb b/App_Code/BundleConfig.vb index 96ebcff7a..e3da720f1 100644 --- a/App_Code/BundleConfig.vb +++ b/App_Code/BundleConfig.vb @@ -51,6 +51,7 @@ Public Class BundleConfig "~/Metronic/assets/admin/layout/scripts/demo.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -76,6 +77,7 @@ Public Class BundleConfig "~/Metronic/assets/layouts/global/scripts/quick-nav.min.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -198,6 +200,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", @@ -221,6 +224,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables2/extensions/KeyTable/css/keyTable.dataTables.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 4404872e7..73f8c4b6f 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -4,7 +4,18 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports Extensiones - +Public Enum OITipoEventos + Tarea = 1 + Agenda = 2 + Proyecto = 3 + Control_de_Versiones_de_Doctos = 4 + Minuta = 5 + Bitacora = 6 + Scrum = 7 + ISO = 8 + Soporte = 9 + Gastos_Mes = 10 +End Enum Public Class ClsOIEventos Implements IDisposable @@ -171,7 +182,192 @@ Public Class ClsOIEventos End Sub +#Region "oieventos2.0" + Public Function GetOI_Eventos2(cveEvento As Int32, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GetOI_Eventos2", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = cveEvento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + + Public Function AddOI_Eventos2(cveTipoEvento As OITipoEventos, asunto As String, descripcion As String, prioridad As Int32, cveUsuarioDe As Int32, cveUsuarioPara As Int32, + fechaInicio As String, fechaFin As String, cveRevision As Int32, archivo As String, cveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_AddOI_Eventos2", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@cveTipoEvento", SqlDbType.Int).Value = cveTipoEvento + .Add("@asunto", SqlDbType.VarChar).Value = asunto + .Add("@descripcion", SqlDbType.VarChar).Value = descripcion + .Add("@prioridad", SqlDbType.Int).Value = prioridad + .Add("@cveUsuarioDe", SqlDbType.Int).Value = cveUsuarioDe + .Add("@cveUsuarioPara", SqlDbType.Int).Value = cveUsuarioPara + .Add("@fechaInicio", SqlDbType.VarChar).Value = fechaInicio + .Add("@fechaFin", SqlDbType.VarChar).Value = fechaFin + .Add("@cveRevision", SqlDbType.Int).Value = cveRevision + .Add("@archivo", SqlDbType.VarChar).Value = archivo + .Add("@cveUsuarioIng", SqlDbType.Int).Value = cveUsuarioIng + .Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + Try + SqlAdapter.Fill(Data) + CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString().ToEntero() + Folio = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString().ToEntero() + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + Public Function UpdateEstatusEvento2(CveEventoEstatus As Integer, CveComentario As Integer, CveEvento As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_EventosEstatusUpdate2") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@pCveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus + .Add("@pCveComentario", SqlDbType.Int).Value = CveComentario + .Add("@pCveEvento", SqlDbType.Int).Value = CveEvento + .Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus en el Evento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#Region "CRUD_cheklist" + Public Function Getcheklist(cveEvento As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Addcheklist(cveEvento As Int32, eventoComentario As String, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@estatus", SqlDbType.Bit).Value = estatus + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistRemove", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function +#End Region + + Public Function AddUPEventoArchivo(CveEvento As Integer, Archivo As String, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OI_EventosArchivoAddUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@Archivo", SqlDbType.VarChar).Value = Archivo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UPEventoAAvance(CveEvento As Integer, Avance As Decimal, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OI_EventosAvanceUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@Avance", SqlDbType.Decimal).Value = Avance + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index f2783bffd..624b4cb6d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4405,6 +4405,7 @@ Public Class ClsPaginas 'OI #Region "OI" PaginaDict.Add("/OI/EventoDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/TareaDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Normatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/RepNormatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/Minutas.aspx".ToUpper(), -1) @@ -5165,7 +5166,7 @@ Public Class ClsPaginas For Each rpds As ReportDataSource In DataSource Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) If dt Is Nothing Then - dt = New DataTable + dt = New DataTable() Else dt = dt.Copy() End If diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 0a0c9935b..ed22628cc 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -569,6 +569,14 @@ Namespace Extensiones Else Return Nothing End If + End Function + + + + Public Function ToDateTimeExcat(Str As String, Optional format As String = "dd/MM/yyyy HH:mm") As DateTime + Dim fecha As DateTime = New DateTime() + DateTime.TryParseExact(Str, format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, fecha) + Return fecha End Function diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.css index 459da41e5..2b2b328ff 100644 --- a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.css +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider -// css version 1.9.2 +// css version 2.0.3 // © 2013-2014 Denis Ineshin | IonDen.com // ===================================================================================================================*/ @@ -8,62 +8,61 @@ .irs { position: relative; display: block; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .irs-line { position: relative; display: block; overflow: hidden; + outline: none !important; } .irs-line-left, .irs-line-mid, .irs-line-right { position: absolute; display: block; top: 0; } .irs-line-left { - left: 0; width: 10%; + left: 0; width: 11%; } .irs-line-mid { left: 9%; width: 82%; } .irs-line-right { - right: 0; width: 10%; + right: 0; width: 11%; } - .irs-diapason { + .irs-bar { position: absolute; display: block; - left: 0; width: 100%; + left: 0; width: 0; } + .irs-bar-edge { + position: absolute; display: block; + top: 0; left: 0; + } + + .irs-shadow { + position: absolute; display: none; + left: 0; width: 0; + } + .irs-slider { position: absolute; display: block; cursor: default; z-index: 1; } .irs-slider.single { - left: 10px; + } - .irs-slider.single:before { - position: absolute; display: block; content: ""; - top: -30%; left: -30%; - width: 160%; height: 160%; - background: rgba(0,0,0,0.0); - } .irs-slider.from { - left: 100px; + } - .irs-slider.from:before { - position: absolute; display: block; content: ""; - top: -30%; left: -30%; - width: 130%; height: 160%; - background: rgba(0,0,0,0.0); - } .irs-slider.to { - left: 300px; + } - .irs-slider.to:before { - position: absolute; display: block; content: ""; - top: -30%; left: 0; - width: 130%; height: 160%; - background: rgba(0,0,0,0.0); - } - .irs-slider.last { + .irs-slider.type_last { z-index: 2; } @@ -85,7 +84,6 @@ white-space: nowrap; } - .irs-grid { position: absolute; display: none; bottom: 0; left: 0; @@ -106,17 +104,17 @@ .irs-grid-text { position: absolute; bottom: 0; left: 0; - width: 100px; white-space: nowrap; text-align: center; font-size: 9px; line-height: 9px; + padding: 0 3px; color: #000; } .irs-disable-mask { position: absolute; display: block; - top: 0; left: 0; - width: 100%; height: 100%; + top: 0; left: -1%; + width: 102%; height: 100%; cursor: default; background: rgba(0,0,0,0.0); z-index: 2; @@ -124,3 +122,25 @@ .irs-disabled { opacity: 0.4; } +.lt-ie9 .irs-disabled { + filter: alpha(opacity=40); +} + + +.irs-hidden-input { + position: absolute !important; + display: block !important; + top: 0 !important; + left: 0 !important; + width: 0 !important; + height: 0 !important; + font-size: 0 !important; + line-height: 0 !important; + padding: 0 !important; + margin: 0 !important; + outline: none !important; + z-index: -9999 !important; + background: none !important; + border-style: solid !important; + border-color: transparent !important; +} diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinFlat.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinFlat.css index 0963c87a2..166314ec9 100644 --- a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinFlat.css +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinFlat.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Flat UI Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.3 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-flat.png) repeat-x; } @@ -36,19 +37,33 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 12px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 12px; width: 9px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 3px; top: 34px; + background: #000; + opacity: 0.25; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=25); +} .irs-slider { width: 16px; height: 18px; top: 22px; - background-position: 0 -90px; -} -#irs-active-slider, .irs-slider:hover { background-position: 0 -120px; } +.irs-slider.state_hover, .irs-slider:hover { + background-position: 0 -150px; +} .irs-min, .irs-max { color: #999; @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: #e1e4e9; + -moz-border-radius: 4px; border-radius: 4px; } @@ -65,6 +81,7 @@ text-shadow: none; padding: 1px 5px; background: #ed5565; + -moz-border-radius: 4px; border-radius: 4px; } .irs-from:after, .irs-to:after, .irs-single:after { diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinHTML5.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinHTML5.css new file mode 100644 index 000000000..740d4299f --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinHTML5.css @@ -0,0 +1,124 @@ +/* Ion.RangeSlider, Simple Skin +// css version 2.0.3 +// © Denis Ineshin, 2014 https://github.com/IonDen +// © guybowden, 2014 https://github.com/guybowden +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs { + height: 55px; +} +.irs-with-grid { + height: 75px; +} +.irs-line { + height: 10px; top: 33px; + background: #EEE; + background: linear-gradient(to bottom, #DDD -50%, #FFF 150%); /* W3C */ + border: 1px solid #CCC; + border-radius: 16px; + -moz-border-radius: 16px; +} + .irs-line-left { + height: 8px; + } + .irs-line-mid { + height: 8px; + } + .irs-line-right { + height: 8px; + } + +.irs-bar { + height: 10px; top: 33px; + border-top: 1px solid #428bca; + border-bottom: 1px solid #428bca; + background: #428bca; + background: linear-gradient(to top, rgba(66,139,202,1) 0%,rgba(127,195,232,1) 100%); /* W3C */ +} + .irs-bar-edge { + height: 10px; top: 33px; + width: 14px; + border: 1px solid #428bca; + border-right: 0; + background: #428bca; + background: linear-gradient(to top, rgba(66,139,202,1) 0%,rgba(127,195,232,1) 100%); /* W3C */ + border-radius: 16px 0 0 16px; + -moz-border-radius: 16px 0 0 16px; + } + +.irs-shadow { + height: 2px; top: 38px; + background: #000; + opacity: 0.3; + border-radius: 5px; + -moz-border-radius: 5px; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=30); +} + +.irs-slider { + top: 25px; + width: 27px; height: 27px; + border: 1px solid #AAA; + background: #DDD; + background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(220,220,220,1) 20%,rgba(255,255,255,1) 100%); /* W3C */ + border-radius: 27px; + -moz-border-radius: 27px; + box-shadow: 1px 1px 3px rgba(0,0,0,0.3); + cursor: pointer; +} + +.irs-slider.state_hover, .irs-slider:hover { + background: #FFF; +} + +.irs-min, .irs-max { + color: #333; + font-size: 12px; line-height: 1.333; + text-shadow: none; + top: 0; + padding: 1px 5px; + background: rgba(0,0,0,0.1); + border-radius: 3px; + -moz-border-radius: 3px; +} + +.lt-ie9 .irs-min, .lt-ie9 .irs-max { + background: #ccc; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 14px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: #428bca; + border-radius: 3px; + -moz-border-radius: 3px; +} +.lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { + background: #999; +} + +.irs-grid { + height: 27px; +} +.irs-grid-pol { + opacity: 0.5; + background: #428bca; +} +.irs-grid-pol.small { + background: #999; +} + +.irs-grid-text { + bottom: 5px; + color: #99a4ac; +} + +.irs-disabled { +} diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinModern.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinModern.css new file mode 100644 index 000000000..13009c14e --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinModern.css @@ -0,0 +1,116 @@ +/* Ion.RangeSlider, Modern Skin +// css version 2.0.3 +// © Denis Ineshin, 2014 https://github.com/IonDen +// ===================================================================================================================*/ + +/* ===================================================================================================================== +// Skin details */ + +.irs-line-mid, +.irs-line-left, +.irs-line-right, +.irs-bar, +.irs-bar-edge, +.irs-slider { + background: url(../img/sprite-skin-modern.png) repeat-x; +} + +.irs { + height: 50px; +} +.irs-with-grid { + height: 70px; +} +.irs-line { + height: 6px; top: 25px; +} + .irs-line-left { + height: 6px; + background-position: 0 -30px; + } + .irs-line-mid { + height: 6px; + background-position: 0 0; + } + .irs-line-right { + height: 6px; + background-position: 100% -30px; + } + +.irs-bar { + height: 6px; top: 25px; + background-position: 0 -60px; +} + .irs-bar-edge { + top: 25px; + height: 6px; width: 6px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 5px; top: 25px; + background: #000; + opacity: 0.25; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=25); +} + +.irs-slider { + width: 11px; height: 18px; + top: 31px; + background-position: 0 -120px; +} +.irs-slider.state_hover, .irs-slider:hover { + background-position: 0 -150px; +} + +.irs-min, .irs-max { + color: #999; + font-size: 10px; line-height: 1.333; + text-shadow: none; + top: 0; padding: 1px 3px; + background: #e1e4e9; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.irs-from, .irs-to, .irs-single { + color: #fff; + font-size: 10px; line-height: 1.333; + text-shadow: none; + padding: 1px 5px; + background: #20b426; + -moz-border-radius: 4px; + border-radius: 4px; +} +.irs-from:after, .irs-to:after, .irs-single:after { + position: absolute; display: block; content: ""; + bottom: -6px; left: 50%; + width: 0; height: 0; + margin-left: -3px; + overflow: hidden; + border: 3px solid transparent; + border-top-color: #20b426; +} + +.irs-grid { + height: 34px; +} +.irs-grid-pol { + background: #c0c0c0; +} +.irs-grid-text { + bottom: 12px; + color: #c0c0c0; +} + +.irs-disable-mask { + +} +.irs-disabled { + +} +.lt-ie9 .irs-disabled { + +} diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinNice.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinNice.css index d74bc11f3..57b20d1e8 100644 --- a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinNice.css +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinNice.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Nice Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.3 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-nice.png) repeat-x; } @@ -36,19 +37,33 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 8px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 8px; width: 11px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 1px; top: 34px; + background: #000; + opacity: 0.15; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=15); +} .irs-slider { width: 22px; height: 22px; top: 17px; - background-position: 0 -90px; -} -#irs-active-slider, .irs-slider:hover { background-position: 0 -120px; } +.irs-slider.state_hover, .irs-slider:hover { + background-position: 0 -150px; +} .irs-min, .irs-max { color: #999; @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: rgba(0,0,0,0.1); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-min, .lt-ie9 .irs-max { @@ -68,6 +84,7 @@ text-shadow: none; padding: 1px 5px; background: rgba(0,0,0,0.3); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinSimple.css b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinSimple.css index 38d1dfba8..34fc7e2e4 100644 --- a/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinSimple.css +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/ion.rangeSlider.skinSimple.css @@ -1,6 +1,6 @@ /* Ion.RangeSlider, Simple Skin -// css version 1.9.2 -// © 2013-2014 Denis Ineshin | IonDen.com +// css version 2.0.3 +// © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ /* ===================================================================================================================== @@ -9,7 +9,8 @@ .irs-line-mid, .irs-line-left, .irs-line-right, -.irs-diapason, +.irs-bar, +.irs-bar-edge, .irs-slider { background: url(../img/sprite-skin-simple.png) repeat-x; } @@ -36,19 +37,33 @@ background-position: 100% -30px; } -.irs-diapason { +.irs-bar { height: 6px; top: 25px; background-position: 0 -60px; } + .irs-bar-edge { + top: 25px; + height: 6px; width: 7px; + background-position: 0 -90px; + } + +.irs-shadow { + height: 1px; top: 34px; + background: #000; + opacity: 0.75; +} +.lt-ie9 .irs-shadow { + filter: alpha(opacity=75); +} .irs-slider { width: 8px; height: 15px; top: 21px; - background-position: 0 -90px; -} -#irs-active-slider, .irs-slider:hover { background-position: 0 -120px; } +.irs-slider.state_hover, .irs-slider:hover { + background-position: 0 -150px; +} .irs-min, .irs-max { color: #c0c0c0; @@ -56,6 +71,7 @@ text-shadow: none; top: 0; padding: 1px 3px; background: rgba(0,0,0,0.1); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-min, .lt-ie9 .irs-max { @@ -68,6 +84,7 @@ text-shadow: none; padding: 1px 5px; background: rgba(255,255,255,0.8); + -moz-border-radius: 3px; border-radius: 3px; } .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single { diff --git a/Metronic/assets/global/plugins/ion.rangeslider/css/normalize.css b/Metronic/assets/global/plugins/ion.rangeslider/css/normalize.css new file mode 100644 index 000000000..46f646a5c --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangeslider/css/normalize.css @@ -0,0 +1,427 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-flat.png b/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-flat.png index 3055db77f53a769b1f81971af56edfe6e78dde8f..0f11c7cb5dfa4ad54ac603fd2fc6afadea63efa3 100644 GIT binary patch delta 290 zcmaFBw1H`Yc>NX@W(Ed^hS~lEaktaqI0hMLs4&fwqfjtP2z?3@TW{Bm6yVxy}k& zSV{7GhM!IOe2>%aqTj!3mpvyaI5xGc;$*02=$Wz3_Ugkc=WK88yIZx%-TGU~cP{09 z%O?wH*&Jt@zv)1xR>1;B28oYe>W)n;oI`zYCXKPqETZOo4 zPBATCd7zPvA>qQao15O+{yuY`5qep_nzlrzG=twH?y z7AOJK$iSdg`ekD6S=0Bg9-p~)Y|Urg-PKz@PT0Kef}-ptMO)Jy)tv^vm8T;g)!xi doyiBv|6sh=Dt;-h=9&=5I8RqUmvv4FO#rrLh+hBz diff --git a/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-modern.png b/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-modern.png new file mode 100644 index 0000000000000000000000000000000000000000..c9060f2756791db4fcfebaa02bf1ca6b55ea7b5c GIT binary patch literal 505 zcmeAS@N?(olHy`uVBq!ia0y~yU}OQZw{S26N!RQ}KY^5efKP}kkbeF4!|8KZ4jewE zutn{{)&t1GKBslo~gD1;ZZ#p(z z@*vO%&XOR%UgJ#RdWmfsBPlU3IxN|2Okl z%v*U%k30S9`_hAq`-Gw{tPBcP>sDyu_`lT26KEO`tS`E0mz5!ZTQyht__jXXwU&Dn zoz7)z6`$YuRyEeEVmin(3=AK%=GSxq^(obKgZT^xxc^pGZ=YScd4bo3XgDmXZa&C;#!PXXKZ5R^|-!BiE#{LB!T6-}Z;+jJNX*W(EcZ*X%_<;sN%7tVtLM0nT1V-W79 z9eZXkTiZK*9+2BJZSIQoTW2m=^Z);UAb0A56@4@2|7T(O^7ZSTJ9qy4`SbSe+w0e_ z&tJLm|IM5KgMuc{TWXoq!defsO{65qFPLHfrBgqeVsFnma`2a%Gwbhn`zP+xl6dxv zfr0Ubr;B4q#jUru1B(|Kh_pQvX3lW97}X@?aOMAhW%H)gwY%ruy!maJ?fc@Vy7wjg zCglsbxXV0kXbxGy(I~)?sFs!_uACh^Z??Sd`MI^#QO1HmJHgZ$s_?^fK*i|=~V zfBm)N=GWPpyI(K7lso&FfY#G(Zr^S>-w<;HCgD)^mj640`12OJjQ84pA$eXQBoum^k zeNnqQ^Y??=7q_STO!4wRc)vAROKWNF^Yqx&My+qI{A9oD`M7IEbG`bDmy6P8msNd9 zlIYUx3%lPF@zw5CyOz|l``Q=NBx^!K79Vm?)V!tgFRgxsTl0QTm)T2{TlVX;``s^k za8zRLa>1MT-BRp(Pi$RrIIT0+m|dgqlK-Y%Z>{gQ?pqtWu66gUeAprrvi;Jj y_@39t1wFObR%||^vTY`_hYg$i zi2er!{TC4U&&T(lm-jyp&wmC6ncJJ?fWens666=mz{bYN;^ge&<{lQ;-Z^vDqW#xz z+`e=7)0dyWKpsQ~S1w<=c>dg(QzuUxJ9^~sp@RqZ?>o3DH$83lfyWQQYJdOw^&6(? z-P^YlCrp@lto$a>HYR>g7srr_xVJY0{VxYdw12Gk?`BBu5j03Rek?($LSla71PN2- zq(?j!J#OqR{V%s09oc&P@+OO~$7VcWo%8(qvbUj=_lc`7uY8i&(CAmV%I?>zenXbF zh8GS?^B12vDIxq@`I7UqPiN#S*J=2rm9_(|1OtaJPapqONRYRaeEIq3@6DGd%-!qb zGcCPwwT#qr&6IPgYGE((R6f6YySwhdy*+j{f|`~EGmkBLZ@zd>&*j3LFB_gjh8@e8 z?Bj3gd*tGE>k4a_xtc+d5jQ#84hTpvO;PIQGclA(-FbShim<3pN*DXx{Bt|^{8;0p zxAMmt3(qg}VVW9Nwm#ju^=Yd+*TlfYb^D^?SN$&DYPZ}WR64pWXLVrcglE^w-}>)< z{h2FZ>Bi*xjh9zwSQOscxc}vnjZVgQx3r$U_pvblve>N4T)t~l_kIh!Z=DsrJ~TKZ zY}?xFucudCyB!x8(KG4Ew>Ym;-a>Z-ik4rH>@}*~>7`s5x$J^Y-k+TYc{*Aqn|-4* zzWe!A$(xAffuReuGB8&&S z*K~qB5jsoDcj_{);H4`sg}mJR@afY6{Wn^7_wM+nx63j7<-^iU51_303ZUfQ+pUH6 sKsnjCSl-?BYcGXlt}=n@24!V?27U8=_x^tMP6rw5>FVdQ&MBb@0IhXYe*gdg diff --git a/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-simple.png b/Metronic/assets/global/plugins/ion.rangeslider/img/sprite-skin-simple.png index 3b7647d36a5191bb594441d2ebbf138526ec608b..0dc5e68ed807c752c81445f37409790dd71ecfae 100644 GIT binary patch delta 344 zcmV-e0jK_f1Lgvd7k{(_0{{R3fSXVF0000gP)t-s0000=o}DRnh2D%X4lqCwI!hHr zTNg)RmTg4(s7qtKyilj5K$xdCj;D}&C`C`N1b)GiE zYu;RO_e4?GXfdZ~5yvoL%K$-3UqLHx0dr42V;4RH2R>Z~K5YkHJv$y9TV5UOX}K=< zdJKN8@OJh&Gacvv#*!evUfG*!s)o< z|J`kOSk{XaGIW*Hz2~^>r)6qfoOh?_=`8N)CQ*G%K+Oyc0V^%--+jLDuD|$YZEZet z_4>Wj_vOC6f8bi~>!&7P5Be@gQd#-&)S*eOs{Zpbx5%)9btn8falp$&z>!7J1ws7q zI{97?B)#s-cdxoK$w<%pPaTvx6q+~?1W5Y7LFU7yi~i@H1aUlF{an^LB{Ts5$)k%g diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.js b/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.js new file mode 100644 index 000000000..5fd95243a --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.js @@ -0,0 +1,2008 @@ +// Ion.RangeSlider +// version 2.0.13 Build: 335 +// © Denis Ineshin, 2015 +// https://github.com/IonDen +// +// Project page: http://ionden.com/a/plugins/ion.rangeSlider/en.html +// GitHub page: https://github.com/IonDen/ion.rangeSlider +// +// Released under MIT licence: +// http://ionden.com/a/plugins/licence-en.html +// ===================================================================================================================== + +;(function ($, document, window, navigator, undefined) { + "use strict"; + + // ================================================================================================================= + // Service + + var plugin_count = 0; + + // IE8 fix + var is_old_ie = (function () { + var n = navigator.userAgent, + r = /msie\s\d+/i, + v; + if (n.search(r) > 0) { + v = r.exec(n).toString(); + v = v.split(" ")[1]; + if (v < 9) { + $("html").addClass("lt-ie9"); + return true; + } + } + return false; + } ()); + if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { + + var target = this; + var slice = [].slice; + + if (typeof target != "function") { + throw new TypeError(); + } + + var args = slice.call(arguments, 1), + bound = function () { + + if (this instanceof bound) { + + var F = function(){}; + F.prototype = target.prototype; + var self = new F(); + + var result = target.apply( + self, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return self; + + } else { + + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + + return bound; + }; + } + if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function(searchElement, fromIndex) { + var k; + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + var O = Object(this); + var len = O.length >>> 0; + if (len === 0) { + return -1; + } + var n = +fromIndex || 0; + if (Math.abs(n) === Infinity) { + n = 0; + } + if (n >= len) { + return -1; + } + k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); + while (k < len) { + if (k in O && O[k] === searchElement) { + return k; + } + k++; + } + return -1; + }; + } + + + + // ================================================================================================================= + // Template + + var base_html = + '' + + '' + + '01' + + '000' + + '' + + '' + + ''; + + var single_html = + '' + + '' + + ''; + + var double_html = + '' + + '' + + '' + + ''; + + var disable_html = + ''; + + + + // ================================================================================================================= + // Core + + /** + * Main plugin constructor + * + * @param input {object} + * @param options {object} + * @param plugin_count {number} + * @constructor + */ + var IonRangeSlider = function (input, options, plugin_count) { + this.VERSION = "2.0.13"; + this.input = input; + this.plugin_count = plugin_count; + this.current_plugin = 0; + this.calc_count = 0; + this.update_tm = 0; + this.old_from = 0; + this.old_to = 0; + this.raf_id = null; + this.dragging = false; + this.force_redraw = false; + this.is_key = false; + this.is_update = false; + this.is_start = true; + this.is_finish = false; + this.is_active = false; + this.is_resize = false; + this.is_click = false; + + this.$cache = { + win: $(window), + body: $(document.body), + input: $(input), + cont: null, + rs: null, + min: null, + max: null, + from: null, + to: null, + single: null, + bar: null, + line: null, + s_single: null, + s_from: null, + s_to: null, + shad_single: null, + shad_from: null, + shad_to: null, + edge: null, + grid: null, + grid_labels: [] + }; + + // get config data attributes + var $inp = this.$cache.input; + var data = { + type: $inp.data("type"), + + min: $inp.data("min"), + max: $inp.data("max"), + from: $inp.data("from"), + to: $inp.data("to"), + step: $inp.data("step"), + + min_interval: $inp.data("minInterval"), + max_interval: $inp.data("maxInterval"), + drag_interval: $inp.data("dragInterval"), + + values: $inp.data("values"), + + from_fixed: $inp.data("fromFixed"), + from_min: $inp.data("fromMin"), + from_max: $inp.data("fromMax"), + from_shadow: $inp.data("fromShadow"), + + to_fixed: $inp.data("toFixed"), + to_min: $inp.data("toMin"), + to_max: $inp.data("toMax"), + to_shadow: $inp.data("toShadow"), + + prettify_enabled: $inp.data("prettifyEnabled"), + prettify_separator: $inp.data("prettifySeparator"), + + force_edges: $inp.data("forceEdges"), + + keyboard: $inp.data("keyboard"), + keyboard_step: $inp.data("keyboardStep"), + + grid: $inp.data("grid"), + grid_margin: $inp.data("gridMargin"), + grid_num: $inp.data("gridNum"), + grid_snap: $inp.data("gridSnap"), + + hide_min_max: $inp.data("hideMinMax"), + hide_from_to: $inp.data("hideFromTo"), + + prefix: $inp.data("prefix"), + postfix: $inp.data("postfix"), + max_postfix: $inp.data("maxPostfix"), + decorate_both: $inp.data("decorateBoth"), + values_separator: $inp.data("valuesSeparator"), + + disable: $inp.data("disable") + }; + data.values = data.values && data.values.split(","); + + // get from and to out of input + var val = $inp.prop("value"); + if (val) { + val = val.split(";"); + + if (val[0] && val[0] == +val[0]) { + val[0] = +val[0]; + } + if (val[1] && val[1] == +val[1]) { + val[1] = +val[1]; + } + + if (options && options.values && options.values.length) { + data.from = val[0] && options.values.indexOf(val[0]); + data.to = val[1] && options.values.indexOf(val[1]); + } else { + data.from = val[0] && +val[0]; + data.to = val[1] && +val[1]; + } + } + + // JS config has a priority + options = $.extend(data, options); + + // get config from options + this.options = $.extend({ + type: "single", + + min: 10, + max: 100, + from: null, + to: null, + step: 1, + + min_interval: 0, + max_interval: 0, + drag_interval: false, + + values: [], + p_values: [], + + from_fixed: false, + from_min: null, + from_max: null, + from_shadow: false, + + to_fixed: false, + to_min: null, + to_max: null, + to_shadow: false, + + prettify_enabled: true, + prettify_separator: " ", + prettify: null, + + force_edges: false, + + keyboard: false, + keyboard_step: 5, + + grid: false, + grid_margin: true, + grid_num: 4, + grid_snap: false, + + hide_min_max: false, + hide_from_to: false, + + prefix: "", + postfix: "", + max_postfix: "", + decorate_both: true, + values_separator: " — ", + + disable: false, + + onStart: null, + onChange: null, + onFinish: null, + onUpdate: null + }, options); + + this.validate(); + + this.result = { + input: this.$cache.input, + slider: null, + + min: this.options.min, + max: this.options.max, + + from: this.options.from, + from_percent: 0, + from_value: null, + + to: this.options.to, + to_percent: 0, + to_value: null + }; + + this.coords = { + // left + x_gap: 0, + x_pointer: 0, + + // width + w_rs: 0, + w_rs_old: 0, + w_handle: 0, + + // percents + p_gap: 0, + p_gap_left: 0, + p_gap_right: 0, + p_step: 0, + p_pointer: 0, + p_handle: 0, + p_single: 0, + p_single_real: 0, + p_from: 0, + p_from_real: 0, + p_to: 0, + p_to_real: 0, + p_bar_x: 0, + p_bar_w: 0, + + // grid + grid_gap: 0, + big_num: 0, + big: [], + big_w: [], + big_p: [], + big_x: [] + }; + + this.labels = { + // width + w_min: 0, + w_max: 0, + w_from: 0, + w_to: 0, + w_single: 0, + + // percents + p_min: 0, + p_max: 0, + p_from: 0, + p_from_left: 0, + p_to: 0, + p_to_left: 0, + p_single: 0, + p_single_left: 0 + }; + + this.init(); + }; + + IonRangeSlider.prototype = { + init: function (is_update) { + this.coords.p_step = this.options.step / ((this.options.max - this.options.min) / 100); + this.target = "base"; + + this.toggleInput(); + this.append(); + this.setMinMax(); + + if (is_update) { + this.force_redraw = true; + this.calc(true); + + // callbacks called + this.callOnUpdate(); + } else { + this.force_redraw = true; + this.calc(true); + + // callbacks called + this.callOnStart(); + } + + this.updateScene(); + }, + + append: function () { + var container_html = ''; + this.$cache.input.before(container_html); + this.$cache.input.prop("readonly", true); + this.$cache.cont = this.$cache.input.prev(); + this.result.slider = this.$cache.cont; + + this.$cache.cont.html(base_html); + this.$cache.rs = this.$cache.cont.find(".irs"); + this.$cache.min = this.$cache.cont.find(".irs-min"); + this.$cache.max = this.$cache.cont.find(".irs-max"); + this.$cache.from = this.$cache.cont.find(".irs-from"); + this.$cache.to = this.$cache.cont.find(".irs-to"); + this.$cache.single = this.$cache.cont.find(".irs-single"); + this.$cache.bar = this.$cache.cont.find(".irs-bar"); + this.$cache.line = this.$cache.cont.find(".irs-line"); + this.$cache.grid = this.$cache.cont.find(".irs-grid"); + + if (this.options.type === "single") { + this.$cache.cont.append(single_html); + this.$cache.edge = this.$cache.cont.find(".irs-bar-edge"); + this.$cache.s_single = this.$cache.cont.find(".single"); + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.to[0].style.visibility = "hidden"; + this.$cache.shad_single = this.$cache.cont.find(".shadow-single"); + } else { + this.$cache.cont.append(double_html); + this.$cache.s_from = this.$cache.cont.find(".from"); + this.$cache.s_to = this.$cache.cont.find(".to"); + this.$cache.shad_from = this.$cache.cont.find(".shadow-from"); + this.$cache.shad_to = this.$cache.cont.find(".shadow-to"); + + this.setTopHandler(); + } + + if (this.options.hide_from_to) { + this.$cache.from[0].style.display = "none"; + this.$cache.to[0].style.display = "none"; + this.$cache.single[0].style.display = "none"; + } + + this.appendGrid(); + + if (this.options.disable) { + this.appendDisableMask(); + this.$cache.input[0].disabled = true; + } else { + this.$cache.cont.removeClass("irs-disabled"); + this.$cache.input[0].disabled = false; + this.bindEvents(); + } + }, + + setTopHandler: function () { + var min = this.options.min, + max = this.options.max, + from = this.options.from, + to = this.options.to; + + if (from > min && to === max) { + this.$cache.s_from.addClass("type_last"); + } else if (to < max) { + this.$cache.s_to.addClass("type_last"); + } + }, + + appendDisableMask: function () { + this.$cache.cont.append(disable_html); + this.$cache.cont.addClass("irs-disabled"); + }, + + remove: function () { + this.$cache.cont.remove(); + this.$cache.cont = null; + + this.$cache.line.off("keydown.irs_" + this.plugin_count); + + this.$cache.body.off("touchmove.irs_" + this.plugin_count); + this.$cache.body.off("mousemove.irs_" + this.plugin_count); + + this.$cache.win.off("touchend.irs_" + this.plugin_count); + this.$cache.win.off("mouseup.irs_" + this.plugin_count); + + if (is_old_ie) { + this.$cache.body.off("mouseup.irs_" + this.plugin_count); + this.$cache.body.off("mouseleave.irs_" + this.plugin_count); + } + + this.$cache.grid_labels = []; + this.coords.big = []; + this.coords.big_w = []; + this.coords.big_p = []; + this.coords.big_x = []; + + cancelAnimationFrame(this.raf_id); + }, + + bindEvents: function () { + this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)); + this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)); + + this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)); + this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); + + this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + + if (this.options.drag_interval && this.options.type === "double") { + this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); + this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); + } else { + this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } + + if (this.options.type === "single") { + this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + + this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.edge.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } else { + this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + + this.$cache.from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + + this.$cache.from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } + + if (this.options.keyboard) { + this.$cache.line.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")); + } + + if (is_old_ie) { + this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); + this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)); + } + }, + + pointerMove: function (e) { + if (!this.dragging) { + return; + } + + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; + this.coords.x_pointer = x - this.coords.x_gap; + + this.calc(); + }, + + pointerUp: function (e) { + if (this.current_plugin !== this.plugin_count) { + return; + } + + if (this.is_active) { + this.is_active = false; + } else { + return; + } + + // callbacks call + if ($.contains(this.$cache.cont[0], e.target) || this.dragging) { + this.is_finish = true; + this.callOnFinish(); + } + + this.$cache.cont.find(".state_hover").removeClass("state_hover"); + + this.force_redraw = true; + this.dragging = false; + + if (is_old_ie) { + $("*").prop("unselectable", false); + } + + this.updateScene(); + }, + + changeLevel: function (target) { + switch (target) { + case "single": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_single); + break; + case "from": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_from); + this.$cache.s_from.addClass("state_hover"); + this.$cache.s_from.addClass("type_last"); + this.$cache.s_to.removeClass("type_last"); + break; + case "to": + this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_to); + this.$cache.s_to.addClass("state_hover"); + this.$cache.s_to.addClass("type_last"); + this.$cache.s_from.removeClass("type_last"); + break; + case "both": + this.coords.p_gap_left = this.toFixed(this.coords.p_pointer - this.coords.p_from); + this.coords.p_gap_right = this.toFixed(this.coords.p_to - this.coords.p_pointer); + this.$cache.s_to.removeClass("type_last"); + this.$cache.s_from.removeClass("type_last"); + break; + } + }, + + pointerDown: function (target, e) { + e.preventDefault(); + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; + if (e.button === 2) { + return; + } + + this.current_plugin = this.plugin_count; + this.target = target; + + this.is_active = true; + this.dragging = true; + + this.coords.x_gap = this.$cache.rs.offset().left; + this.coords.x_pointer = x - this.coords.x_gap; + + this.calcPointer(); + this.changeLevel(target); + + if (is_old_ie) { + $("*").prop("unselectable", true); + } + + this.$cache.line.trigger("focus"); + + this.updateScene(); + }, + + pointerClick: function (target, e) { + e.preventDefault(); + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; + if (e.button === 2) { + return; + } + + this.current_plugin = this.plugin_count; + this.target = target; + + this.is_click = true; + this.coords.x_gap = this.$cache.rs.offset().left; + this.coords.x_pointer = +(x - this.coords.x_gap).toFixed(); + + this.force_redraw = true; + this.calc(); + + this.$cache.line.trigger("focus"); + }, + + key: function (target, e) { + if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { + return; + } + + switch (e.which) { + case 83: // W + case 65: // A + case 40: // DOWN + case 37: // LEFT + e.preventDefault(); + this.moveByKey(false); + break; + + case 87: // S + case 68: // D + case 38: // UP + case 39: // RIGHT + e.preventDefault(); + this.moveByKey(true); + break; + } + + return true; + }, + + // Move by key. Beta + // TODO: refactor than have plenty of time + moveByKey: function (right) { + var p = this.coords.p_pointer; + + if (right) { + p += this.options.keyboard_step; + } else { + p -= this.options.keyboard_step; + } + + this.coords.x_pointer = this.toFixed(this.coords.w_rs / 100 * p); + this.is_key = true; + this.calc(); + }, + + setMinMax: function () { + if (!this.options) { + return; + } + + if (this.options.hide_min_max) { + this.$cache.min[0].style.display = "none"; + this.$cache.max[0].style.display = "none"; + return; + } + + if (this.options.values.length) { + this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])); + this.$cache.max.html(this.decorate(this.options.p_values[this.options.max])); + } else { + this.$cache.min.html(this.decorate(this._prettify(this.options.min), this.options.min)); + this.$cache.max.html(this.decorate(this._prettify(this.options.max), this.options.max)); + } + + this.labels.w_min = this.$cache.min.outerWidth(false); + this.labels.w_max = this.$cache.max.outerWidth(false); + }, + + + + // ============================================================================================================= + // Calculations + + calc: function (update) { + if (!this.options) { + return; + } + + this.calc_count++; + + if (this.calc_count === 10 || update) { + this.calc_count = 0; + this.coords.w_rs = this.$cache.rs.outerWidth(false); + if (this.options.type === "single") { + this.coords.w_handle = this.$cache.s_single.outerWidth(false); + } else { + this.coords.w_handle = this.$cache.s_from.outerWidth(false); + } + } + + if (!this.coords.w_rs) { + return; + } + + this.calcPointer(); + + this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100); + var real_width = 100 - this.coords.p_handle, + real_x = this.toFixed(this.coords.p_pointer - this.coords.p_gap); + + if (this.target === "click") { + this.coords.p_gap = this.coords.p_handle / 2; + real_x = this.toFixed(this.coords.p_pointer - this.coords.p_gap); + this.target = this.chooseHandle(real_x); + } + + if (real_x < 0) { + real_x = 0; + } else if (real_x > real_width) { + real_x = real_width; + } + + switch (this.target) { + case "base": + var w = (this.options.max - this.options.min) / 100, + f = (this.result.from - this.options.min) / w, + t = (this.result.to - this.options.min) / w; + + this.coords.p_single_real = this.toFixed(f); + this.coords.p_from_real = this.toFixed(f); + this.coords.p_to_real = this.toFixed(t); + + this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max); + this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max); + this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max); + + this.coords.p_single = this.toFixed(f - (this.coords.p_handle / 100 * f)); + this.coords.p_from = this.toFixed(f - (this.coords.p_handle / 100 * f)); + this.coords.p_to = this.toFixed(t - (this.coords.p_handle / 100 * t)); + + this.target = null; + + break; + + case "single": + if (this.options.from_fixed) { + break; + } + + this.coords.p_single_real = this.calcWithStep(real_x / real_width * 100); + this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max); + this.coords.p_single = this.toFixed(this.coords.p_single_real / 100 * real_width); + + break; + + case "from": + if (this.options.from_fixed) { + break; + } + + this.coords.p_from_real = this.calcWithStep(real_x / real_width * 100); + if (this.coords.p_from_real > this.coords.p_to_real) { + this.coords.p_from_real = this.coords.p_to_real; + } + this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max); + this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"); + this.coords.p_from_real = this.checkMaxInterval(this.coords.p_from_real, this.coords.p_to_real, "from"); + this.coords.p_from = this.toFixed(this.coords.p_from_real / 100 * real_width); + + break; + + case "to": + if (this.options.to_fixed) { + break; + } + + this.coords.p_to_real = this.calcWithStep(real_x / real_width * 100); + if (this.coords.p_to_real < this.coords.p_from_real) { + this.coords.p_to_real = this.coords.p_from_real; + } + this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max); + this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"); + this.coords.p_to_real = this.checkMaxInterval(this.coords.p_to_real, this.coords.p_from_real, "to"); + this.coords.p_to = this.toFixed(this.coords.p_to_real / 100 * real_width); + + break; + + case "both": + if (this.options.from_fixed || this.options.to_fixed) { + break; + } + + real_x = this.toFixed(real_x + (this.coords.p_handle * 0.1)); + + this.coords.p_from_real = this.calcWithStep((real_x - this.coords.p_gap_left) / real_width * 100); + this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max); + this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"); + this.coords.p_from = this.toFixed(this.coords.p_from_real / 100 * real_width); + + this.coords.p_to_real = this.calcWithStep((real_x + this.coords.p_gap_right) / real_width * 100); + this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max); + this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"); + this.coords.p_to = this.toFixed(this.coords.p_to_real / 100 * real_width); + + break; + } + + if (this.options.type === "single") { + this.coords.p_bar_x = (this.coords.p_handle / 2); + this.coords.p_bar_w = this.coords.p_single; + + this.result.from_percent = this.coords.p_single_real; + this.result.from = this.calcReal(this.coords.p_single_real); + if (this.options.values.length) { + this.result.from_value = this.options.values[this.result.from]; + } + } else { + this.coords.p_bar_x = this.toFixed(this.coords.p_from + (this.coords.p_handle / 2)); + this.coords.p_bar_w = this.toFixed(this.coords.p_to - this.coords.p_from); + + this.result.from_percent = this.coords.p_from_real; + this.result.from = this.calcReal(this.coords.p_from_real); + this.result.to_percent = this.coords.p_to_real; + this.result.to = this.calcReal(this.coords.p_to_real); + if (this.options.values.length) { + this.result.from_value = this.options.values[this.result.from]; + this.result.to_value = this.options.values[this.result.to]; + } + } + + this.calcMinMax(); + this.calcLabels(); + }, + + calcPointer: function () { + if (!this.coords.w_rs) { + this.coords.p_pointer = 0; + return; + } + + if (this.coords.x_pointer < 0 || isNaN(this.coords.x_pointer) ) { + this.coords.x_pointer = 0; + } else if (this.coords.x_pointer > this.coords.w_rs) { + this.coords.x_pointer = this.coords.w_rs; + } + + this.coords.p_pointer = this.toFixed(this.coords.x_pointer / this.coords.w_rs * 100); + }, + + chooseHandle: function (real_x) { + if (this.options.type === "single") { + return "single"; + } else { + var m_point = this.coords.p_from_real + ((this.coords.p_to_real - this.coords.p_from_real) / 2); + if (real_x >= m_point) { + return this.options.to_fixed ? "from" : "to"; + } else { + return this.options.from_fixed ? "to" : "from"; + } + } + }, + + calcMinMax: function () { + if (!this.coords.w_rs) { + return; + } + + this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100; + this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100; + }, + + calcLabels: function () { + if (!this.coords.w_rs || this.options.hide_from_to) { + return; + } + + if (this.options.type === "single") { + + this.labels.w_single = this.$cache.single.outerWidth(false); + this.labels.p_single = this.labels.w_single / this.coords.w_rs * 100; + this.labels.p_single_left = this.coords.p_single + (this.coords.p_handle / 2) - (this.labels.p_single / 2); + this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single); + + } else { + + this.labels.w_from = this.$cache.from.outerWidth(false); + this.labels.p_from = this.labels.w_from / this.coords.w_rs * 100; + this.labels.p_from_left = this.coords.p_from + (this.coords.p_handle / 2) - (this.labels.p_from / 2); + this.labels.p_from_left = this.toFixed(this.labels.p_from_left); + this.labels.p_from_left = this.checkEdges(this.labels.p_from_left, this.labels.p_from); + + this.labels.w_to = this.$cache.to.outerWidth(false); + this.labels.p_to = this.labels.w_to / this.coords.w_rs * 100; + this.labels.p_to_left = this.coords.p_to + (this.coords.p_handle / 2) - (this.labels.p_to / 2); + this.labels.p_to_left = this.toFixed(this.labels.p_to_left); + this.labels.p_to_left = this.checkEdges(this.labels.p_to_left, this.labels.p_to); + + this.labels.w_single = this.$cache.single.outerWidth(false); + this.labels.p_single = this.labels.w_single / this.coords.w_rs * 100; + this.labels.p_single_left = ((this.labels.p_from_left + this.labels.p_to_left + this.labels.p_to) / 2) - (this.labels.p_single / 2); + this.labels.p_single_left = this.toFixed(this.labels.p_single_left); + this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single); + + } + }, + + + + // ============================================================================================================= + // Drawings + + updateScene: function () { + if (this.raf_id) { + cancelAnimationFrame(this.raf_id); + this.raf_id = null; + } + + clearTimeout(this.update_tm); + this.update_tm = null; + + if (!this.options) { + return; + } + + this.drawHandles(); + + if (this.is_active) { + this.raf_id = requestAnimationFrame(this.updateScene.bind(this)); + } else { + this.update_tm = setTimeout(this.updateScene.bind(this), 300); + } + }, + + drawHandles: function () { + this.coords.w_rs = this.$cache.rs.outerWidth(false); + + if (!this.coords.w_rs) { + return; + } + + if (this.coords.w_rs !== this.coords.w_rs_old) { + this.target = "base"; + this.is_resize = true; + } + + if (this.coords.w_rs !== this.coords.w_rs_old || this.force_redraw) { + this.setMinMax(); + this.calc(true); + this.drawLabels(); + if (this.options.grid) { + this.calcGridMargin(); + this.calcGridLabels(); + } + this.force_redraw = true; + this.coords.w_rs_old = this.coords.w_rs; + this.drawShadow(); + } + + if (!this.coords.w_rs) { + return; + } + + if (!this.dragging && !this.force_redraw && !this.is_key) { + return; + } + + if (this.old_from !== this.result.from || this.old_to !== this.result.to || this.force_redraw || this.is_key) { + + this.drawLabels(); + + this.$cache.bar[0].style.left = this.coords.p_bar_x + "%"; + this.$cache.bar[0].style.width = this.coords.p_bar_w + "%"; + + if (this.options.type === "single") { + this.$cache.s_single[0].style.left = this.coords.p_single + "%"; + + this.$cache.single[0].style.left = this.labels.p_single_left + "%"; + + if (this.options.values.length) { + this.$cache.input.prop("value", this.result.from_value); + this.$cache.input.data("from", this.result.from_value); + } else { + this.$cache.input.prop("value", this.result.from); + this.$cache.input.data("from", this.result.from); + } + } else { + this.$cache.s_from[0].style.left = this.coords.p_from + "%"; + this.$cache.s_to[0].style.left = this.coords.p_to + "%"; + + if (this.old_from !== this.result.from || this.force_redraw) { + this.$cache.from[0].style.left = this.labels.p_from_left + "%"; + } + if (this.old_to !== this.result.to || this.force_redraw) { + this.$cache.to[0].style.left = this.labels.p_to_left + "%"; + } + + this.$cache.single[0].style.left = this.labels.p_single_left + "%"; + + if (this.options.values.length) { + this.$cache.input.prop("value", this.result.from_value + ";" + this.result.to_value); + this.$cache.input.data("from", this.result.from_value); + this.$cache.input.data("to", this.result.to_value); + } else { + this.$cache.input.prop("value", this.result.from + ";" + this.result.to); + this.$cache.input.data("from", this.result.from); + this.$cache.input.data("to", this.result.to); + } + } + + if ((this.old_from !== this.result.from || this.old_to !== this.result.to) && !this.is_start) { + this.$cache.input.trigger("change"); + } + + this.old_from = this.result.from; + this.old_to = this.result.to; + + // callbacks call + if (!this.is_resize && !this.is_update && !this.is_start && !this.is_finish) { + this.callOnChange(); + } + if (this.is_key || this.is_click) { + this.callOnFinish(); + } + + this.is_update = false; + this.is_resize = false; + this.is_finish = false; + } + + this.is_start = false; + this.is_key = false; + this.is_click = false; + this.force_redraw = false; + }, + + // callbacks + callOnStart: function () { + if (this.options.onStart && typeof this.options.onStart === "function") { + this.options.onStart(this.result); + } + }, + callOnChange: function () { + if (this.options.onChange && typeof this.options.onChange === "function") { + this.options.onChange(this.result); + } + }, + callOnFinish: function () { + if (this.options.onFinish && typeof this.options.onFinish === "function") { + this.options.onFinish(this.result); + } + }, + callOnUpdate: function () { + if (this.options.onUpdate && typeof this.options.onUpdate === "function") { + this.options.onUpdate(this.result); + } + }, + + drawLabels: function () { + if (!this.options) { + return; + } + + var values_num = this.options.values.length, + p_values = this.options.p_values, + text_single, + text_from, + text_to; + + if (this.options.hide_from_to) { + return; + } + + if (this.options.type === "single") { + + if (values_num) { + text_single = this.decorate(p_values[this.result.from]); + this.$cache.single.html(text_single); + } else { + text_single = this.decorate(this._prettify(this.result.from), this.result.from); + this.$cache.single.html(text_single); + } + + this.calcLabels(); + + if (this.labels.p_single_left < this.labels.p_min + 1) { + this.$cache.min[0].style.visibility = "hidden"; + } else { + this.$cache.min[0].style.visibility = "visible"; + } + + if (this.labels.p_single_left + this.labels.p_single > 100 - this.labels.p_max - 1) { + this.$cache.max[0].style.visibility = "hidden"; + } else { + this.$cache.max[0].style.visibility = "visible"; + } + + } else { + + if (values_num) { + + if (this.options.decorate_both) { + text_single = this.decorate(p_values[this.result.from]); + text_single += this.options.values_separator; + text_single += this.decorate(p_values[this.result.to]); + } else { + text_single = this.decorate(p_values[this.result.from] + this.options.values_separator + p_values[this.result.to]); + } + text_from = this.decorate(p_values[this.result.from]); + text_to = this.decorate(p_values[this.result.to]); + + this.$cache.single.html(text_single); + this.$cache.from.html(text_from); + this.$cache.to.html(text_to); + + } else { + + if (this.options.decorate_both) { + text_single = this.decorate(this._prettify(this.result.from), this.result.from); + text_single += this.options.values_separator; + text_single += this.decorate(this._prettify(this.result.to), this.result.to); + } else { + text_single = this.decorate(this._prettify(this.result.from) + this.options.values_separator + this._prettify(this.result.to), this.result.to); + } + text_from = this.decorate(this._prettify(this.result.from), this.result.from); + text_to = this.decorate(this._prettify(this.result.to), this.result.to); + + this.$cache.single.html(text_single); + this.$cache.from.html(text_from); + this.$cache.to.html(text_to); + + } + + this.calcLabels(); + + var min = Math.min(this.labels.p_single_left, this.labels.p_from_left), + single_left = this.labels.p_single_left + this.labels.p_single, + to_left = this.labels.p_to_left + this.labels.p_to, + max = Math.max(single_left, to_left); + + if (this.labels.p_from_left + this.labels.p_from >= this.labels.p_to_left) { + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.to[0].style.visibility = "hidden"; + this.$cache.single[0].style.visibility = "visible"; + + if (this.result.from === this.result.to) { + this.$cache.from[0].style.visibility = "visible"; + this.$cache.single[0].style.visibility = "hidden"; + max = to_left; + } else { + this.$cache.from[0].style.visibility = "hidden"; + this.$cache.single[0].style.visibility = "visible"; + max = Math.max(single_left, to_left); + } + } else { + this.$cache.from[0].style.visibility = "visible"; + this.$cache.to[0].style.visibility = "visible"; + this.$cache.single[0].style.visibility = "hidden"; + } + + if (min < this.labels.p_min + 1) { + this.$cache.min[0].style.visibility = "hidden"; + } else { + this.$cache.min[0].style.visibility = "visible"; + } + + if (max > 100 - this.labels.p_max - 1) { + this.$cache.max[0].style.visibility = "hidden"; + } else { + this.$cache.max[0].style.visibility = "visible"; + } + + } + }, + + drawShadow: function () { + var o = this.options, + c = this.$cache, + + is_from_min = typeof o.from_min === "number" && !isNaN(o.from_min), + is_from_max = typeof o.from_max === "number" && !isNaN(o.from_max), + is_to_min = typeof o.to_min === "number" && !isNaN(o.to_min), + is_to_max = typeof o.to_max === "number" && !isNaN(o.to_max), + + from_min, + from_max, + to_min, + to_max; + + if (o.type === "single") { + if (o.from_shadow && (is_from_min || is_from_max)) { + from_min = this.calcPercent(is_from_min ? o.from_min : o.min); + from_max = this.calcPercent(is_from_max ? o.from_max : o.max) - from_min; + from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min)); + from_max = this.toFixed(from_max - (this.coords.p_handle / 100 * from_max)); + from_min = from_min + (this.coords.p_handle / 2); + + c.shad_single[0].style.display = "block"; + c.shad_single[0].style.left = from_min + "%"; + c.shad_single[0].style.width = from_max + "%"; + } else { + c.shad_single[0].style.display = "none"; + } + } else { + if (o.from_shadow && (is_from_min || is_from_max)) { + from_min = this.calcPercent(is_from_min ? o.from_min : o.min); + from_max = this.calcPercent(is_from_max ? o.from_max : o.max) - from_min; + from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min)); + from_max = this.toFixed(from_max - (this.coords.p_handle / 100 * from_max)); + from_min = from_min + (this.coords.p_handle / 2); + + c.shad_from[0].style.display = "block"; + c.shad_from[0].style.left = from_min + "%"; + c.shad_from[0].style.width = from_max + "%"; + } else { + c.shad_from[0].style.display = "none"; + } + + if (o.to_shadow && (is_to_min || is_to_max)) { + to_min = this.calcPercent(is_to_min ? o.to_min : o.min); + to_max = this.calcPercent(is_to_max ? o.to_max : o.max) - to_min; + to_min = this.toFixed(to_min - (this.coords.p_handle / 100 * to_min)); + to_max = this.toFixed(to_max - (this.coords.p_handle / 100 * to_max)); + to_min = to_min + (this.coords.p_handle / 2); + + c.shad_to[0].style.display = "block"; + c.shad_to[0].style.left = to_min + "%"; + c.shad_to[0].style.width = to_max + "%"; + } else { + c.shad_to[0].style.display = "none"; + } + } + }, + + + + // ============================================================================================================= + // Service methods + + toggleInput: function () { + this.$cache.input.toggleClass("irs-hidden-input"); + }, + + calcPercent: function (num) { + var w = (this.options.max - this.options.min) / 100, + percent = (num - this.options.min) / w; + + return this.toFixed(percent); + }, + + calcReal: function (percent) { + var min = this.options.min, + max = this.options.max, + min_decimals = min.toString().split(".")[1], + max_decimals = max.toString().split(".")[1], + min_length, max_length, + avg_decimals = 0, + abs = 0; + + if (percent === 0) { + return this.options.min; + } + if (percent === 100) { + return this.options.max; + } + + + if (min_decimals) { + min_length = min_decimals.length; + avg_decimals = min_length; + } + if (max_decimals) { + max_length = max_decimals.length; + avg_decimals = max_length; + } + if (min_length && max_length) { + avg_decimals = (min_length >= max_length) ? min_length : max_length; + } + + if (min < 0) { + abs = Math.abs(min); + min = +(min + abs).toFixed(avg_decimals); + max = +(max + abs).toFixed(avg_decimals); + } + + var number = ((max - min) / 100 * percent) + min, + string = this.options.step.toString().split(".")[1], + result; + + if (string) { + number = +number.toFixed(string.length); + } else { + number = number / this.options.step; + number = number * this.options.step; + + number = +number.toFixed(0); + } + + if (abs) { + number -= abs; + } + + if (string) { + result = +number.toFixed(string.length); + } else { + result = this.toFixed(number); + } + + if (result < this.options.min) { + result = this.options.min; + } else if (result > this.options.max) { + result = this.options.max; + } + + return result; + }, + + calcWithStep: function (percent) { + var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step; + + if (rounded > 100) { + rounded = 100; + } + if (percent === 100) { + rounded = 100; + } + + return this.toFixed(rounded); + }, + + checkMinInterval: function (p_current, p_next, type) { + var o = this.options, + current, + next; + + if (!o.min_interval) { + return p_current; + } + + current = this.calcReal(p_current); + next = this.calcReal(p_next); + + if (type === "from") { + + if (next - current < o.min_interval) { + current = next - o.min_interval; + } + + } else { + + if (current - next < o.min_interval) { + current = next + o.min_interval; + } + + } + + return this.calcPercent(current); + }, + + checkMaxInterval: function (p_current, p_next, type) { + var o = this.options, + current, + next; + + if (!o.max_interval) { + return p_current; + } + + current = this.calcReal(p_current); + next = this.calcReal(p_next); + + if (type === "from") { + + if (next - current > o.max_interval) { + current = next - o.max_interval; + } + + } else { + + if (current - next > o.max_interval) { + current = next + o.max_interval; + } + + } + + return this.calcPercent(current); + }, + + checkDiapason: function (p_num, min, max) { + var num = this.calcReal(p_num), + o = this.options; + + if (typeof min !== "number") { + min = o.min; + } + + if (typeof max !== "number") { + max = o.max; + } + + if (num < min) { + num = min; + } + + if (num > max) { + num = max; + } + + return this.calcPercent(num); + }, + + toFixed: function (num) { + num = num.toFixed(9); + return +num; + }, + + _prettify: function (num) { + if (!this.options.prettify_enabled) { + return num; + } + + if (this.options.prettify && typeof this.options.prettify === "function") { + return this.options.prettify(num); + } else { + return this.prettify(num); + } + }, + + prettify: function (num) { + var n = num.toString(); + return n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + this.options.prettify_separator); + }, + + checkEdges: function (left, width) { + if (!this.options.force_edges) { + return this.toFixed(left); + } + + if (left < 0) { + left = 0; + } else if (left > 100 - width) { + left = 100 - width; + } + + return this.toFixed(left); + }, + + validate: function () { + var o = this.options, + r = this.result, + v = o.values, + vl = v.length, + value, + i; + + if (typeof o.min === "string") o.min = +o.min; + if (typeof o.max === "string") o.max = +o.max; + if (typeof o.from === "string") o.from = +o.from; + if (typeof o.to === "string") o.to = +o.to; + if (typeof o.step === "string") o.step = +o.step; + + if (typeof o.from_min === "string") o.from_min = +o.from_min; + if (typeof o.from_max === "string") o.from_max = +o.from_max; + if (typeof o.to_min === "string") o.to_min = +o.to_min; + if (typeof o.to_max === "string") o.to_max = +o.to_max; + + if (typeof o.keyboard_step === "string") o.keyboard_step = +o.keyboard_step; + if (typeof o.grid_num === "string") o.grid_num = +o.grid_num; + + if (o.max <= o.min) { + if (o.min) { + o.max = o.min * 2; + } else { + o.max = o.min + 1; + } + o.step = 1; + } + + if (vl) { + o.p_values = []; + o.min = 0; + o.max = vl - 1; + o.step = 1; + o.grid_num = o.max; + o.grid_snap = true; + + + for (i = 0; i < vl; i++) { + value = +v[i]; + + if (!isNaN(value)) { + v[i] = value; + value = this._prettify(value); + } else { + value = v[i]; + } + + o.p_values.push(value); + } + } + + if (typeof o.from !== "number" || isNaN(o.from)) { + o.from = o.min; + } + + if (typeof o.to !== "number" || isNaN(o.from)) { + o.to = o.max; + } + + if (o.type === "single") { + + if (o.from < o.min) { + o.from = o.min; + } + + if (o.from > o.max) { + o.from = o.max; + } + + } else { + + if (o.from < o.min || o.from > o.max) { + o.from = o.min; + } + if (o.to > o.max || o.to < o.min) { + o.to = o.max; + } + if (o.from > o.to) { + o.from = o.to; + } + + } + + if (typeof o.step !== "number" || isNaN(o.step) || !o.step || o.step < 0) { + o.step = 1; + } + + if (typeof o.keyboard_step !== "number" || isNaN(o.keyboard_step) || !o.keyboard_step || o.keyboard_step < 0) { + o.keyboard_step = 5; + } + + if (typeof o.from_min === "number" && o.from < o.from_min) { + o.from = o.from_min; + } + + if (typeof o.from_max === "number" && o.from > o.from_max) { + o.from = o.from_max; + } + + if (typeof o.to_min === "number" && o.to < o.to_min) { + o.to = o.to_min; + } + + if (typeof o.to_max === "number" && o.from > o.to_max) { + o.to = o.to_max; + } + + if (r) { + if (r.min !== o.min) { + r.min = o.min; + } + + if (r.max !== o.max) { + r.max = o.max; + } + + if (r.from < r.min || r.from > r.max) { + r.from = o.from; + } + + if (r.to < r.min || r.to > r.max) { + r.to = o.to; + } + } + + if (typeof o.min_interval !== "number" || isNaN(o.min_interval) || !o.min_interval || o.min_interval < 0) { + o.min_interval = 0; + } + + if (typeof o.max_interval !== "number" || isNaN(o.max_interval) || !o.max_interval || o.max_interval < 0) { + o.max_interval = 0; + } + + if (o.min_interval && o.min_interval > o.max - o.min) { + o.min_interval = o.max - o.min; + } + + if (o.max_interval && o.max_interval > o.max - o.min) { + o.max_interval = o.max - o.min; + } + }, + + decorate: function (num, original) { + var decorated = "", + o = this.options; + + if (o.prefix) { + decorated += o.prefix; + } + + decorated += num; + + if (o.max_postfix) { + if (o.values.length && num === o.p_values[o.max]) { + decorated += o.max_postfix; + if (o.postfix) { + decorated += " "; + } + } else if (original === o.max) { + decorated += o.max_postfix; + if (o.postfix) { + decorated += " "; + } + } + } + + if (o.postfix) { + decorated += o.postfix; + } + + return decorated; + }, + + updateFrom: function () { + this.result.from = this.options.from; + this.result.from_percent = this.calcPercent(this.result.from); + if (this.options.values) { + this.result.from_value = this.options.values[this.result.from]; + } + }, + + updateTo: function () { + this.result.to = this.options.to; + this.result.to_percent = this.calcPercent(this.result.to); + if (this.options.values) { + this.result.to_value = this.options.values[this.result.to]; + } + }, + + updateResult: function () { + this.result.min = this.options.min; + this.result.max = this.options.max; + this.updateFrom(); + this.updateTo(); + }, + + + // ============================================================================================================= + // Grid + + appendGrid: function () { + if (!this.options.grid) { + return; + } + + var o = this.options, + i, z, + + total = o.max - o.min, + big_num = o.grid_num, + big_p = 0, + big_w = 0, + + small_max = 4, + local_small_max, + small_p, + small_w = 0, + + result, + html = ''; + + + + this.calcGridMargin(); + + if (o.grid_snap) { + big_num = total / o.step; + big_p = this.toFixed(o.step / (total / 100)); + } else { + big_p = this.toFixed(100 / big_num); + } + + if (big_num > 4) { + small_max = 3; + } + if (big_num > 7) { + small_max = 2; + } + if (big_num > 14) { + small_max = 1; + } + if (big_num > 28) { + small_max = 0; + } + + for (i = 0; i < big_num + 1; i++) { + local_small_max = small_max; + + big_w = this.toFixed(big_p * i); + + if (big_w > 100) { + big_w = 100; + + local_small_max -= 2; + if (local_small_max < 0) { + local_small_max = 0; + } + } + this.coords.big[i] = big_w; + + small_p = (big_w - (big_p * (i - 1))) / (local_small_max + 1); + + for (z = 1; z <= local_small_max; z++) { + if (big_w === 0) { + break; + } + + small_w = this.toFixed(big_w - (small_p * z)); + + html += ''; + } + + html += ''; + + result = this.calcReal(big_w); + if (o.values.length) { + result = o.p_values[result]; + } else { + result = this._prettify(result); + } + + html += '' + result + ''; + } + this.coords.big_num = Math.ceil(big_num + 1); + + + + this.$cache.cont.addClass("irs-with-grid"); + this.$cache.grid.html(html); + this.cacheGridLabels(); + }, + + cacheGridLabels: function () { + var $label, i, + num = this.coords.big_num; + + for (i = 0; i < num; i++) { + $label = this.$cache.grid.find(".js-grid-text-" + i); + this.$cache.grid_labels.push($label); + } + + this.calcGridLabels(); + }, + + calcGridLabels: function () { + var i, label, start = [], finish = [], + num = this.coords.big_num; + + for (i = 0; i < num; i++) { + this.coords.big_w[i] = this.$cache.grid_labels[i].outerWidth(false); + this.coords.big_p[i] = this.toFixed(this.coords.big_w[i] / this.coords.w_rs * 100); + this.coords.big_x[i] = this.toFixed(this.coords.big_p[i] / 2); + + start[i] = this.toFixed(this.coords.big[i] - this.coords.big_x[i]); + finish[i] = this.toFixed(start[i] + this.coords.big_p[i]); + } + + if (this.options.force_edges) { + if (start[0] < -this.coords.grid_gap) { + start[0] = -this.coords.grid_gap; + finish[0] = this.toFixed(start[0] + this.coords.big_p[0]); + + this.coords.big_x[0] = this.coords.grid_gap; + } + + if (finish[num - 1] > 100 + this.coords.grid_gap) { + finish[num - 1] = 100 + this.coords.grid_gap; + start[num - 1] = this.toFixed(finish[num - 1] - this.coords.big_p[num - 1]); + + this.coords.big_x[num - 1] = this.toFixed(this.coords.big_p[num - 1] - this.coords.grid_gap); + } + } + + this.calcGridCollision(2, start, finish); + this.calcGridCollision(4, start, finish); + + for (i = 0; i < num; i++) { + label = this.$cache.grid_labels[i][0]; + label.style.marginLeft = -this.coords.big_x[i] + "%"; + } + }, + + // Collisions Calc Beta + // TODO: Refactor then have plenty of time + calcGridCollision: function (step, start, finish) { + var i, next_i, label, + num = this.coords.big_num; + + for (i = 0; i < num; i += step) { + next_i = i + (step / 2); + if (next_i >= num) { + break; + } + + label = this.$cache.grid_labels[next_i][0]; + + if (finish[i] <= start[next_i]) { + label.style.visibility = "visible"; + } else { + label.style.visibility = "hidden"; + } + } + }, + + calcGridMargin: function () { + if (!this.options.grid_margin) { + return; + } + + this.coords.w_rs = this.$cache.rs.outerWidth(false); + if (!this.coords.w_rs) { + return; + } + + if (this.options.type === "single") { + this.coords.w_handle = this.$cache.s_single.outerWidth(false); + } else { + this.coords.w_handle = this.$cache.s_from.outerWidth(false); + } + this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100); + this.coords.grid_gap = this.toFixed((this.coords.p_handle / 2) - 0.1); + + this.$cache.grid[0].style.width = this.toFixed(100 - this.coords.p_handle) + "%"; + this.$cache.grid[0].style.left = this.coords.grid_gap + "%"; + }, + + + + // ============================================================================================================= + // Public methods + + update: function (options) { + if (!this.input) { + return; + } + + this.is_update = true; + + this.options.from = this.result.from; + this.options.to = this.result.to; + + this.options = $.extend(this.options, options); + this.validate(); + this.updateResult(options); + + this.toggleInput(); + this.remove(); + this.init(true); + }, + + reset: function () { + if (!this.input) { + return; + } + + this.updateResult(); + this.update(); + }, + + destroy: function () { + if (!this.input) { + return; + } + + this.toggleInput(); + this.$cache.input.prop("readonly", false); + $.data(this.input, "ionRangeSlider", null); + + this.remove(); + this.input = null; + this.options = null; + } + }; + + $.fn.ionRangeSlider = function (options) { + return this.each(function() { + if (!$.data(this, "ionRangeSlider")) { + $.data(this, "ionRangeSlider", new IonRangeSlider(this, options, plugin_count++)); + } + }); + }; + + + + // ================================================================================================================= + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating + + // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel + + // MIT license + + (function() { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] + || window[vendors[x]+'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) + window.requestAnimationFrame = function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + + if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; + }()); + +} (jQuery, document, window, navigator)); diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.min.js b/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.min.js new file mode 100644 index 000000000..73df723cd --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangeslider/js/ion.rangeSlider.min.js @@ -0,0 +1,71 @@ +// Ion.RangeSlider | version 2.0.13 | https://github.com/IonDen/ion.rangeSlider +;(function(e,r,h,t,v){var u=0,p=function(){var a=t.userAgent,b=/msie\s\d+/i;return 0a)?(e("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=[].slice;if("function"!=typeof b)throw new TypeError;var d=c.call(arguments,1),f=function(){if(this instanceof f){var g=function(){};g.prototype=b.prototype;var g=new g,l=b.apply(g,d.concat(c.call(arguments)));return Object(l)===l?l:g}return b.apply(a, +d.concat(c.call(arguments)))};return f});Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null==this)throw new TypeError('"this" is null or not defined');var d=Object(this),f=d.length>>>0;if(0===f)return-1;c=+b||0;Infinity===Math.abs(c)&&(c=0);if(c>=f)return-1;for(c=Math.max(0<=c?c:f-Math.abs(c),0);c');this.$cache.input.prop("readonly",!0);this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('01000'); +this.$cache.rs=this.$cache.cont.find(".irs");this.$cache.min=this.$cache.cont.find(".irs-min");this.$cache.max=this.$cache.cont.find(".irs-max");this.$cache.from=this.$cache.cont.find(".irs-from");this.$cache.to=this.$cache.cont.find(".irs-to");this.$cache.single=this.$cache.cont.find(".irs-single");this.$cache.bar=this.$cache.cont.find(".irs-bar");this.$cache.line=this.$cache.cont.find(".irs-line");this.$cache.grid=this.$cache.cont.find(".irs-grid");"single"===this.options.type?(this.$cache.cont.append(''), +this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(''),this.$cache.s_from=this.$cache.cont.find(".from"), +this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler());this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none");this.appendGrid();this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass("irs-disabled"),this.$cache.input[0].disabled= +!1,this.bindEvents())},setTopHandler:function(){var a=this.options.max,b=this.options.to;this.options.from>this.options.min&&b===a?this.$cache.s_from.addClass("type_last"):b');this.$cache.cont.addClass("irs-disabled")},remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off("keydown.irs_"+this.plugin_count);this.$cache.body.off("touchmove.irs_"+ +this.plugin_count);this.$cache.body.off("mousemove.irs_"+this.plugin_count);this.$cache.win.off("touchend.irs_"+this.plugin_count);this.$cache.win.off("mouseup.irs_"+this.plugin_count);p&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count));this.$cache.grid_labels=[];this.coords.big=[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.$cache.body.on("touchmove.irs_"+ +this.plugin_count,this.pointerMove.bind(this));this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.options.drag_interval&& +"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this, +"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+ +this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this, +"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+ +this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));if(this.options.keyboard)this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));p&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count, +this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))},pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX)-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;if(e.contains(this.$cache.cont[0],a.target)||this.dragging)this.is_finish=!0,this.callOnFinish();this.$cache.cont.find(".state_hover").removeClass("state_hover"); +this.force_redraw=!0;this.dragging=!1;p&&e("*").prop("unselectable",!1);this.updateScene()}},changeLevel:function(a){switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case "from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from);this.$cache.s_from.addClass("state_hover");this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer- +this.coords.p_to);this.$cache.s_to.addClass("state_hover");this.$cache.s_to.addClass("type_last");this.$cache.s_from.removeClass("type_last");break;case "both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.coords.p_gap_right=this.toFixed(this.coords.p_to-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},pointerDown:function(a,b){b.preventDefault();var c=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX; +2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.dragging=this.is_active=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=c-this.coords.x_gap,this.calcPointer(),this.changeLevel(a),p&&e("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),this.updateScene())},pointerClick:function(a,b){b.preventDefault();var c=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a, +this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(c-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer, +b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min), +this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},calc:function(a){if(this.options){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);if(this.coords.w_rs){this.calcPointer(); +this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100);a=100-this.coords.p_handle;var b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,b=this.toFixed(this.coords.p_pointer-this.coords.p_gap),this.target=this.chooseHandle(b));0>b?b=0:b>a&&(b=a);switch(this.target){case "base":b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real= +this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_from= +this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_to=this.toFixed(b-this.coords.p_handle/100*b);this.target=null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(b/a*100);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single=this.toFixed(this.coords.p_single_real/100*a);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(b/ +a*100);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from=this.toFixed(this.coords.p_from_real/100*a);break;case "to":if(this.options.to_fixed)break; +this.coords.p_to_real=this.calcWithStep(b/a*100);this.coords.p_to_realthis.coords.x_pointer||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real- +this.coords.p_from_real)/2?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+ +this.coords.p_handle/2-this.labels.p_single/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left= +this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left= +this.checkEdges(this.labels.p_single_left,this.labels.p_single))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null);clearTimeout(this.update_tm);this.update_tm=null;this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);if(this.coords.w_rs){this.coords.w_rs!==this.coords.w_rs_old&& +(this.target="base",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left= +this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left=this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from));else{this.$cache.s_from[0].style.left= +this.coords.p_from+"%";this.$cache.s_to[0].style.left=this.coords.p_to+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?(this.$cache.input.prop("value",this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value), +this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))}this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange();(this.is_key||this.is_click)&&this.callOnFinish(); +this.is_finish=this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}}},callOnStart:function(){if(this.options.onStart&&"function"===typeof this.options.onStart)this.options.onStart(this.result)},callOnChange:function(){if(this.options.onChange&&"function"===typeof this.options.onChange)this.options.onChange(this.result)},callOnFinish:function(){if(this.options.onFinish&&"function"===typeof this.options.onFinish)this.options.onFinish(this.result)},callOnUpdate:function(){if(this.options.onUpdate&& +"function"===typeof this.options.onUpdate)this.options.onUpdate(this.result)},drawLabels:function(){if(this.options){var a=this.options.values.length,b=this.options.p_values,c;if(!this.options.hide_from_to)if("single"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),c=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from),this.result.from),a+=this.options.values_separator, +a+=this.decorate(this._prettify(this.result.to),this.result.to)):a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.to),c=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(c);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+ +this.labels.p_single;c=this.labels.p_to_left+this.labels.p_to;var d=Math.max(a,c);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",d=c):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility= +"visible",d=Math.max(a,c))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b100-this.labels.p_max-1?"hidden":"visible"}}},drawShadow:function(){var a=this.options,b=this.$cache,c="number"===typeof a.from_min&&!isNaN(a.from_min),d="number"===typeof a.from_max&&!isNaN(a.from_max),f="number"=== +typeof a.to_min&&!isNaN(a.to_min),g="number"===typeof a.to_max&&!isNaN(a.to_max);"single"===a.type?a.from_shadow&&(c||d)?(c=this.calcPercent(c?a.from_min:a.min),d=this.calcPercent(d?a.from_max:a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=c+"%",b.shad_single[0].style.width=d+"%"):b.shad_single[0].style.display="none":(a.from_shadow&&(c||d)?(c=this.calcPercent(c? +a.from_min:a.min),d=this.calcPercent(d?a.from_max:a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_from[0].style.display="block",b.shad_from[0].style.left=c+"%",b.shad_from[0].style.width=d+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(f||g)?(f=this.calcPercent(f?a.to_min:a.min),a=this.calcPercent(g?a.to_max:a.max)-f,f=this.toFixed(f-this.coords.p_handle/100*f),a=this.toFixed(a-this.coords.p_handle/100*a), +f+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=f+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")},calcPercent:function(a){return this.toFixed((a-this.options.min)/((this.options.max-this.options.min)/100))},calcReal:function(a){var b=this.options.min,c=this.options.max,d=b.toString().split(".")[1],f=c.toString().split(".")[1],g,l,k=0,e=0;if(0===a)return this.options.min; +if(100===a)return this.options.max;d&&(k=g=d.length);f&&(k=l=f.length);g&&l&&(k=g>=l?g:l);0>b&&(e=Math.abs(b),b=+(b+e).toFixed(k),c=+(c+e).toFixed(k));a=(c-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));e&&(a-=e);e=b?+a.toFixed(b.length):this.toFixed(a);ethis.options.max&&(e=this.options.max);return e},calcWithStep:function(a){var b=Math.round(a/this.coords.p_step)* +this.coords.p_step;100d.max_interval&&(a=b-d.max_interval):a-b>d.max_interval&& +(a=b+d.max_interval);return this.calcPercent(a)},checkDiapason:function(a,b,c){a=this.calcReal(a);var d=this.options;"number"!==typeof b&&(b=d.min);"number"!==typeof c&&(c=d.max);ac&&(a=c);return this.calcPercent(a)},toFixed:function(a){a=a.toFixed(9);return+a},_prettify:function(a){return this.options.prettify_enabled?this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, +"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,c=a.values,d=c.length,f,g;"string"===typeof a.min&&(a.min=+a.min);"string"===typeof a.max&&(a.max=+a.max);"string"===typeof a.from&&(a.from=+a.from);"string"===typeof a.to&&(a.to=+a.to);"string"===typeof a.step&&(a.step=+a.step);"string"===typeof a.from_min&&(a.from_min=+a.from_min); +"string"===typeof a.from_max&&(a.from_max=+a.from_max);"string"===typeof a.to_min&&(a.to_min=+a.to_min);"string"===typeof a.to_max&&(a.to_max=+a.to_max);"string"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);"string"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<=a.min&&(a.max=a.min?2*a.min:a.min+1,a.step=1);if(d)for(a.p_values=[],a.min=0,a.max=d-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,g=0;ga.max&&(a.from=a.max);else{if(a.froma.max)a.from=a.min;if(a.to>a.max||a.toa.to&&(a.from=a.to)}if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;"number"===typeof a.from_min&& +a.froma.from_max&&(a.from=a.from_max);"number"===typeof a.to_min&&a.toa.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.fromb.max)b.from=a.from;if(b.tob.max)b.to=a.to}if("number"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if("number"!==typeof a.max_interval|| +isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval=a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var c="",d=this.options;d.prefix&&(c+=d.prefix);c+=a;d.max_postfix&&(d.values.length&&a===d.p_values[d.max]?(c+=d.max_postfix,d.postfix&&(c+=" ")):b===d.max&&(c+=d.max_postfix,d.postfix&&(c+=" ")));d.postfix&&(c+=d.postfix);return c},updateFrom:function(){this.result.from= +this.options.from;this.result.from_percent=this.calcPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.calcPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a= +this.options,b,c;b=a.max-a.min;var d=a.grid_num,f=0,g=0,e=4,k,h,m=0,n="";this.calcGridMargin();a.grid_snap?(d=b/a.step,f=this.toFixed(a.step/(b/100))):f=this.toFixed(100/d);4k&&(k=0));this.coords.big[b]=g;h=(g-f*(b-1))/(k+1);for(c=1;c<=k&&0!==g;c++)m=this.toFixed(g-h*c),n+='';n+=''; +m=this.calcReal(g);m=a.values.length?a.p_values[m]:this._prettify(m);n+=''+m+""}this.coords.big_num=Math.ceil(d+1);this.$cache.cont.addClass("irs-with-grid");this.$cache.grid.html(n);this.cacheGridLabels()}},cacheGridLabels:function(){var a,b,c=this.coords.big_num;for(b=0;b100+this.coords.grid_gap&&(c[d-1]=100+this.coords.grid_gap,b[d-1]=this.toFixed(c[d-1]-this.coords.big_p[d-1]),this.coords.big_x[d-1]=this.toFixed(this.coords.big_p[d-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,c);this.calcGridCollision(4,b,c);for(a=0;a=e)break;g=this.$cache.grid_labels[f][0];g.style.visibility= +c[d]<=b[f]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left= +this.coords.grid_gap+"%"))},update:function(a){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.options=e.extend(this.options,a),this.validate(),this.updateResult(a),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),e.data(this.input,"ionRangeSlider",null),this.remove(),this.options=this.input= +null)}};e.fn.ionRangeSlider=function(a){return this.each(function(){e.data(this,"ionRangeSlider")||e.data(this,"ionRangeSlider",new q(this,a,u++))})};(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c{yuY`5qep_nzlrzG=twH?y z7AOJK$iSdg`ekD6S=0Bg9-p~)Y|Urg-PKz@PT0Kef}-ptMO)Jy)tv^vm8T;g)!xi doyiBv|6sh=Dt;-h=9&=5I8RqUmvv4FO#rrLh+hBz literal 0 HcmV?d00001 diff --git a/Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-nice.png b/Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-nice.png new file mode 100644 index 0000000000000000000000000000000000000000..d62f81887e2de388a22efe13709d8377a442bf01 GIT binary patch literal 1022 zcmeAS@N?(olHy`uVBq!ia0y~yU}OQZr*SX?Nq&B|BR~P`0G|+7Ah&DE?4D_J&!0d4 z^5sh)NjbQF{rc_Ox9{A!^XAQ)w{PFR|M=;{r_Vs}<;$1v-@pI(@#E*upMU=R`TO_p zzkmP!1Hr9Z|8Ly*fBibp0px*a&z~b}T)AP}vUOXw?m4()-{D;ckI!GVasJAU^Hy${ zw_?NG73=3LUpH&%8X%gvWX+7ltEVkoId#E`Df5?2oV~bj#{Ayt^B^QJOn_`4>Yg$i zi2er!{TC4U&&T(lm-jyp&wmC6ncJJ?fWens666=mz{bYN;^ge&<{lQ;-Z^vDqW#xz z+`e=7)0dyWKpsQ~S1w<=c>dg(QzuUxJ9^~sp@RqZ?>o3DH$83lfyWQQYJdOw^&6(? z-P^YlCrp@lto$a>HYR>g7srr_xVJY0{VxYdw12Gk?`BBu5j03Rek?($LSla71PN2- zq(?j!J#OqR{V%s09oc&P@+OO~$7VcWo%8(qvbUj=_lc`7uY8i&(CAmV%I?>zenXbF zh8GS?^B12vDIxq@`I7UqPiN#S*J=2rm9_(|1OtaJPapqONRYRaeEIq3@6DGd%-!qb zGcCPwwT#qr&6IPgYGE((R6f6YySwhdy*+j{f|`~EGmkBLZ@zd>&*j3LFB_gjh8@e8 z?Bj3gd*tGE>k4a_xtc+d5jQ#84hTpvO;PIQGclA(-FbShim<3pN*DXx{Bt|^{8;0p zxAMmt3(qg}VVW9Nwm#ju^=Yd+*TlfYb^D^?SN$&DYPZ}WR64pWXLVrcglE^w-}>)< z{h2FZ>Bi*xjh9zwSQOscxc}vnjZVgQx3r$U_pvblve>N4T)t~l_kIh!Z=DsrJ~TKZ zY}?xFucudCyB!x8(KG4Ew>Ym;-a>Z-ik4rH>@}*~>7`s5x$J^Y-k+TYc{*Aqn|-4* zzWe!A$(xAffuReuGB8&&S z*K~qB5jsoDcj_{);H4`sg}mJR@afY6{Wn^7_wM+nx63j7<-^iU51_303ZUfQ+pUH6 sKsnjCSl-?BYcGXlt}=n@24!V?27U8=_x^tMP6rw5>FVdQ&MBb@0IhXYe*gdg literal 0 HcmV?d00001 diff --git a/Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-simple.png b/Metronic/assets/global/plugins/ion.rangesliderOld/img/sprite-skin-simple.png new file mode 100644 index 0000000000000000000000000000000000000000..3b7647d36a5191bb594441d2ebbf138526ec608b GIT binary patch literal 385 zcmeAS@N?(olHy`uVBq!ia0y~yU}OQZr*SX?Nq&B|BS5M&z$e7@|NsBVd-jB`UJ|@= zNx<@@eoK~mFIws`f0^r?Wll4f+fQ3=GkJyO#1&?JD@=M;+VoB~ZRyji>C`N1b)GiE zYu;RO_e4?GXfdZ~5yvoL%K$-3UqLHx0dr42V;4RH2R>Z~K5YkHJv$y9TV5UOX}K=< zdJKN8@OJh&Gacvv#*!evUfG*!s)o< z|J`kOSk{XaGIW*Hz2~^>r)6qfoOh?_=`8N)CQ*G%K+Oyc0V^%--+jLDuD|$YZEZet z_4>Wj_vOC6f8bi~>!&7P5Be@gQd#-&)S*eOs{Zpbx5%)9btn8falp$&z>!7J1ws7q zI{97?B)#s-cdxoK$w<%pPaTvx6q+~?1W5Y7LFU7yi~i@H1aUlF{an^LB{Ts5$)k%g literal 0 HcmV?d00001 diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/.DS_Store b/Metronic/assets/global/plugins/ion.rangesliderOld/js/.DS_Store similarity index 100% rename from Metronic/assets/global/plugins/ion.rangeslider/js/.DS_Store rename to Metronic/assets/global/plugins/ion.rangesliderOld/js/.DS_Store diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/ion-rangeSlider/ion.rangeSlider.js b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion-rangeSlider/ion.rangeSlider.js similarity index 100% rename from Metronic/assets/global/plugins/ion.rangeslider/js/ion-rangeSlider/ion.rangeSlider.js rename to Metronic/assets/global/plugins/ion.rangesliderOld/js/ion-rangeSlider/ion.rangeSlider.js diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/ion-rangeSlider/ion.rangeSlider.min.js b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion-rangeSlider/ion.rangeSlider.min.js similarity index 100% rename from Metronic/assets/global/plugins/ion.rangeslider/js/ion-rangeSlider/ion.rangeSlider.min.js rename to Metronic/assets/global/plugins/ion.rangesliderOld/js/ion-rangeSlider/ion.rangeSlider.min.js diff --git a/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.js b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.js new file mode 100644 index 000000000..2f80f177d --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.js @@ -0,0 +1,1193 @@ +// Ion.RangeSlider +// version 1.9.3 Build: 176 +// © 2013-2014 Denis Ineshin | IonDen.com +// +// Project page: http://ionden.com/a/plugins/ion.rangeSlider/ +// GitHub page: https://github.com/IonDen/ion.rangeSlider +// +// Released under MIT licence: +// http://ionden.com/a/plugins/licence-en.html +// ===================================================================================================================== + +(function ($, document, window, navigator) { + "use strict"; + + var plugin_count = 0, + current; + + var is_old_ie = (function () { + var n = navigator.userAgent, + r = /msie\s\d+/i, + v; + if (n.search(r) > 0) { + v = r.exec(n).toString(); + v = v.split(" ")[1]; + if (v < 9) { + return true; + } + } + return false; + }()); + var is_touch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); + + var testNumber = function (num) { + if (typeof num === "number") { + if (isNaN(num)) { + return null; + } else { + return num; + } + } else { + num = parseFloat(num); + if (isNaN(num)) { + return null; + } else { + return num; + } + } + }; + + var methods = { + init: function (options) { + + // irs = ion range slider css prefix + var baseHTML = + '' + + '' + + '01' + + '000' + + '' + + ''; + + var singleHTML = + ''; + + var doubleHTML = + '' + + '' + + ''; + + var disableHTML = + ''; + + + + return this.each(function () { + var settings = $.extend({ + min: null, + max: null, + from: null, + to: null, + type: "single", + step: null, + prefix: "", + postfix: "", + maxPostfix: "", + hasGrid: false, + gridMargin: 0, + hideMinMax: false, + hideFromTo: false, + prettify: true, + disable: false, + values: null, + onLoad: null, + onChange: null, + onFinish: null + }, options); + + + + var slider = $(this), + self = this, + allow_values = false, + value_array = null; + + if (slider.data("isActive")) { + return; + } + slider.data("isActive", true); + + plugin_count += 1; + this.plugin_count = plugin_count; + + + + // check default values + if (slider.prop("value")) { + value_array = slider.prop("value").split(";"); + } + + if (settings.type === "single") { + + if (value_array && value_array.length > 1) { + + if (typeof settings.min !== "number") { + settings.min = parseFloat(value_array[0]); + } else { + if (typeof settings.from !== "number") { + settings.from = parseFloat(value_array[0]); + } + } + + if (typeof settings.max !== "number") { + settings.max = parseFloat(value_array[1]); + } + + } else if (value_array && value_array.length === 1) { + + if (typeof settings.from !== "number") { + settings.from = parseFloat(value_array[0]); + } + + } + + } else if (settings.type === "double") { + + if (value_array && value_array.length > 1) { + + if (typeof settings.min !== "number") { + settings.min = parseFloat(value_array[0]); + } else { + if (typeof settings.from !== "number") { + settings.from = parseFloat(value_array[0]); + } + } + + if (typeof settings.max !== "number") { + settings.max = parseFloat(value_array[1]); + } else { + if (typeof settings.to !== "number") { + settings.to = parseFloat(value_array[1]); + } + } + + } else if (value_array && value_array.length === 1) { + + if (typeof settings.min !== "number") { + settings.min = parseFloat(value_array[0]); + } else { + if (typeof settings.from !== "number") { + settings.from = parseFloat(value_array[0]); + } + } + + } + + } + + + + // extend from data-* + if (typeof slider.data("min") === "number") { + settings.min = parseFloat(slider.data("min")); + } + if (typeof slider.data("max") === "number") { + settings.max = parseFloat(slider.data("max")); + } + if (typeof slider.data("from") === "number") { + settings.from = parseFloat(slider.data("from")); + } + if (typeof slider.data("to") === "number") { + settings.to = parseFloat(slider.data("to")); + } + if (slider.data("step")) { + settings.step = parseFloat(slider.data("step")); + } + if (slider.data("type")) { + settings.type = slider.data("type"); + } + if (slider.data("prefix")) { + settings.prefix = slider.data("prefix"); + } + if (slider.data("postfix")) { + settings.postfix = slider.data("postfix"); + } + if (slider.data("maxpostfix")) { + settings.maxPostfix = slider.data("maxpostfix"); + } + if (slider.data("hasgrid")) { + settings.hasGrid = slider.data("hasgrid"); + } + if (slider.data("gridmargin")) { + settings.gridMargin = +slider.data("gridmargin"); + } + if (slider.data("hideminmax")) { + settings.hideMinMax = slider.data("hideminmax"); + } + if (slider.data("hidefromto")) { + settings.hideFromTo = slider.data("hidefromto"); + } + if (slider.data("prettify")) { + settings.prettify = slider.data("prettify"); + } + if (slider.data("disable")) { + settings.disable = slider.data("disable"); + } + if (slider.data("values")) { + settings.values = slider.data("values").split(","); + } + + + + // Set Min and Max if no + settings.min = testNumber(settings.min); + if (!settings.min && settings.min !== 0) { + settings.min = 10; + } + + settings.max = testNumber(settings.max); + if (!settings.max && settings.max !== 0) { + settings.max = 100; + } + + + + // Set values + if (Object.prototype.toString.call(settings.values) !== "[object Array]") { + settings.values = null; + } + if (settings.values && settings.values.length > 0) { + settings.min = 0; + settings.max = settings.values.length - 1; + settings.step = 1; + allow_values = true; + } + + + + // Set From and To if no + settings.from = testNumber(settings.from); + if (!settings.from && settings.from !== 0) { + settings.from = settings.min; + } + + settings.to = testNumber(settings.to); + if (!settings.to && settings.to !== 0) { + settings.to = settings.max; + } + + + // Set step + settings.step = testNumber(settings.step); + if (!settings.step) { + settings.step = 1; + } + + + + // fix diapason + if (settings.from < settings.min) { + settings.from = settings.min; + } + if (settings.from > settings.max) { + settings.from = settings.min; + } + + if (settings.to < settings.min) { + settings.to = settings.max; + } + if (settings.to > settings.max) { + settings.to = settings.max; + } + + if (settings.type === "double") { + if (settings.from > settings.to) { + settings.from = settings.to; + } + if (settings.to < settings.from) { + settings.to = settings.from; + } + } + + + var prettify = function (num) { + var n = num.toString(); + if (settings.prettify) { + n = n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1 "); + } + return n; + }; + + + var containerHTML = ''; + slider[0].style.display = "none"; + slider.before(containerHTML); + + var $container = slider.prev(), + $body = $(document.body), + $window = $(window), + $rangeSlider, + $fieldMin, + $fieldMax, + $fieldFrom, + $fieldTo, + $fieldSingle, + $singleSlider, + $fromSlider, + $toSlider, + $activeSlider, + $diapason, + $grid; + + var allowDrag = false, + is_slider_active = false, + is_first_start = true, + numbers = {}; + + var mouseX = 0, + fieldMinWidth = 0, + fieldMaxWidth = 0, + normalWidth = 0, + fullWidth = 0, + sliderWidth = 0, + width = 0, + left = 0, + right = 0, + minusX = 0, + stepFloat = 0; + + + if (parseInt(settings.step, 10) !== parseFloat(settings.step)) { + stepFloat = settings.step.toString().split(".")[1]; + stepFloat = Math.pow(10, stepFloat.length); + } + + + + // public methods + this.updateData = function (options) { + $.extend(settings, options); + removeHTML(); + }; + this.removeSlider = function () { + $container.find("*").off(); + $window.off("mouseup.irs" + self.plugin_count); + $body.off("mouseup.irs" + self.plugin_count); + $body.off("mouseleave.irs" + self.plugin_count); + $body.off("mousemove.irs" + self.plugin_count); + $container.html("").remove(); + slider.data("isActive", false); + slider.show(); + }; + + + + + + // private methods + var removeHTML = function () { + $container.find("*").off(); + $window.off("mouseup.irs" + self.plugin_count); + $body.off("mouseup.irs" + self.plugin_count); + $body.off("mouseleave.irs" + self.plugin_count); + $body.off("mousemove.irs" + self.plugin_count); + $container.html(""); + + placeHTML(); + }; + var placeHTML = function () { + $container.html(baseHTML); + $rangeSlider = $container.find(".irs"); + + $fieldMin = $rangeSlider.find(".irs-min"); + $fieldMax = $rangeSlider.find(".irs-max"); + $fieldFrom = $rangeSlider.find(".irs-from"); + $fieldTo = $rangeSlider.find(".irs-to"); + $fieldSingle = $rangeSlider.find(".irs-single"); + $grid = $container.find(".irs-grid"); + + if (settings.hideFromTo) { + $fieldFrom[0].style.visibility = "hidden"; + $fieldTo[0].style.visibility = "hidden"; + $fieldSingle[0].style.visibility = "hidden"; + } + if (!settings.hideFromTo) { + $fieldFrom[0].style.visibility = "visible"; + $fieldTo[0].style.visibility = "visible"; + $fieldSingle[0].style.visibility = "visible"; + } + + if (settings.hideMinMax) { + $fieldMin[0].style.visibility = "hidden"; + $fieldMax[0].style.visibility = "hidden"; + + fieldMinWidth = 0; + fieldMaxWidth = 0; + } + if (!settings.hideMinMax) { + $fieldMin[0].style.visibility = "visible"; + $fieldMax[0].style.visibility = "visible"; + + if (settings.values) { + $fieldMin.html(settings.prefix + settings.values[0] + settings.postfix); + $fieldMax.html(settings.prefix + settings.values[settings.values.length - 1] + settings.maxPostfix + settings.postfix); + } else { + $fieldMin.html(settings.prefix + prettify(settings.min) + settings.postfix); + $fieldMax.html(settings.prefix + prettify(settings.max) + settings.maxPostfix + settings.postfix); + } + + fieldMinWidth = $fieldMin.outerWidth(false); + fieldMaxWidth = $fieldMax.outerWidth(false); + } + + bindEvents(); + }; + + var bindEvents = function () { + if (settings.type === "single") { + $rangeSlider.append(singleHTML); + + $singleSlider = $rangeSlider.find(".single"); + + $singleSlider.on("mousedown", function (e) { + e.preventDefault(); + e.stopPropagation(); + + calcDimensions(e, $(this), null); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + + if (is_old_ie) { + $("*").prop("unselectable", true); + } + }); + if (is_touch) { + $singleSlider.on("touchstart", function (e) { + e.preventDefault(); + e.stopPropagation(); + + calcDimensions(e.originalEvent.touches[0], $(this), null); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + }); + } + + } else if (settings.type === "double") { + $rangeSlider.append(doubleHTML); + + $fromSlider = $rangeSlider.find(".from"); + $toSlider = $rangeSlider.find(".to"); + $diapason = $rangeSlider.find(".irs-diapason"); + + setDiapason(); + + $fromSlider.on("mousedown", function (e) { + e.preventDefault(); + e.stopPropagation(); + + $(this).addClass("last"); + $toSlider.removeClass("last"); + calcDimensions(e, $(this), "from"); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + + if (is_old_ie) { + $("*").prop("unselectable", true); + } + }); + $toSlider.on("mousedown", function (e) { + e.preventDefault(); + e.stopPropagation(); + + $(this).addClass("last"); + $fromSlider.removeClass("last"); + calcDimensions(e, $(this), "to"); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + + if (is_old_ie) { + $("*").prop("unselectable", true); + } + }); + + if (is_touch) { + $fromSlider.on("touchstart", function (e) { + e.preventDefault(); + e.stopPropagation(); + + $(this).addClass("last"); + $toSlider.removeClass("last"); + calcDimensions(e.originalEvent.touches[0], $(this), "from"); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + }); + $toSlider.on("touchstart", function (e) { + e.preventDefault(); + e.stopPropagation(); + + $(this).addClass("last"); + $fromSlider.removeClass("last"); + calcDimensions(e.originalEvent.touches[0], $(this), "to"); + + allowDrag = true; + is_slider_active = true; + current = self.plugin_count; + }); + } + + if (settings.to === settings.max) { + $fromSlider.addClass("last"); + } + } + + var mouseup = function () { + if (current !== self.plugin_count) { + return; + } + + if (allowDrag) { + is_slider_active = false; + allowDrag = false; + $activeSlider.removeAttr("id"); + $activeSlider = null; + if (settings.type === "double") { + setDiapason(); + } + getNumbers(); + + if (is_old_ie) { + $("*").prop("unselectable", false); + } + } + }; + + $window.on("mouseup.irs" + self.plugin_count, function () { + mouseup(); + }); + + if (is_old_ie) { + $body.on("mouseleave.irs" + self.plugin_count, function () { + mouseup(); + }); + } + + + $body.on("mousemove.irs" + self.plugin_count, function (e) { + if (allowDrag) { + mouseX = e.pageX; + dragSlider(); + } + }); + + $container.on("mousedown", function () { + current = self.plugin_count; + }); + + $container.on("mouseup", function (e) { + if (current !== self.plugin_count) { + return; + } + + if (allowDrag || settings.disable) { + return; + } + + moveByClick(e.pageX); + }); + + if (is_touch) { + $window.on("touchend", function () { + if (allowDrag) { + is_slider_active = false; + allowDrag = false; + $activeSlider.removeAttr("id"); + $activeSlider = null; + if (settings.type === "double") { + setDiapason(); + } + getNumbers(); + } + }); + $window.on("touchmove", function (e) { + if (allowDrag) { + mouseX = e.originalEvent.touches[0].pageX; + dragSlider(); + } + }); + } + + getSize(); + setNumbers(); + if (settings.hasGrid) { + setGrid(); + } + if (settings.disable) { + setMask(); + } else { + removeMask(); + } + }; + + var getSize = function () { + normalWidth = $rangeSlider.width(); + if ($singleSlider) { + sliderWidth = $singleSlider.width(); + } else { + sliderWidth = $fromSlider.width(); + } + fullWidth = normalWidth - sliderWidth; + }; + + var calcDimensions = function (e, currentSlider, whichSlider) { + getSize(); + + is_first_start = false; + $activeSlider = currentSlider; + $activeSlider.prop("id", "irs-active-slider"); + + var _x1 = $activeSlider.offset().left, + _x2 = e.pageX - _x1; + minusX = _x1 + _x2 - $activeSlider.position().left; + + if (settings.type === "single") { + + width = $rangeSlider.width() - sliderWidth; + + } else if (settings.type === "double") { + + if (whichSlider === "from") { + left = 0; + right = parseInt($toSlider.css("left"), 10); + } else { + left = parseInt($fromSlider.css("left"), 10); + right = $rangeSlider.width() - sliderWidth; + } + + } + }; + + var setDiapason = function () { + var _w = $fromSlider.width(), + _x = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left, + _width = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left, + x = _x + (_w / 2), + w = _width - _x; + $diapason[0].style.left = x + "px"; + $diapason[0].style.width = w + "px"; + }; + + var dragSlider = function (manual_x) { + var x_pure = mouseX - minusX, + x; + + if (manual_x) { + x_pure = manual_x; + } else { + x_pure = mouseX - minusX; + } + + if (settings.type === "single") { + + if (x_pure < 0) { + x_pure = 0; + } + if (x_pure > width) { + x_pure = width; + } + + } else if (settings.type === "double") { + + if (x_pure < left) { + x_pure = left; + } + if (x_pure > right) { + x_pure = right; + } + setDiapason(); + + } + + $.data($activeSlider[0], "x", x_pure); + getNumbers(); + + x = Math.round(x_pure); + $activeSlider[0].style.left = x + "px"; + }; + + var getNumbers = function () { + var nums = { + input: slider, + slider: $container, + min: settings.min, + max: settings.max, + fromNumber: 0, + toNumber: 0, + fromPers: 0, + toPers: 0, + fromX: 0, + fromX_pure: 0, + toX: 0, + toX_pure: 0 + }; + var diapason = settings.max - settings.min, _from, _to; + + if (settings.type === "single") { + + nums.fromX = $.data($singleSlider[0], "x") || parseInt($singleSlider[0].style.left, 10) || $singleSlider.position().left; + nums.fromPers = nums.fromX / fullWidth * 100; + _from = (diapason / 100 * nums.fromPers) + settings.min; + nums.fromNumber = Math.round(_from / settings.step) * settings.step; + if (nums.fromNumber < settings.min) { + nums.fromNumber = settings.min; + } + if (nums.fromNumber > settings.max) { + nums.fromNumber = settings.max; + } + + if (stepFloat) { + nums.fromNumber = parseInt(nums.fromNumber * stepFloat, 10) / stepFloat; + } + + if (allow_values) { + nums.fromValue = settings.values[nums.fromNumber]; + } + + } else if (settings.type === "double") { + + nums.fromX = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left; + nums.fromPers = nums.fromX / fullWidth * 100; + _from = (diapason / 100 * nums.fromPers) + settings.min; + nums.fromNumber = Math.round(_from / settings.step) * settings.step; + if (nums.fromNumber < settings.min) { + nums.fromNumber = settings.min; + } + + nums.toX = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left; + nums.toPers = nums.toX / fullWidth * 100; + _to = (diapason / 100 * nums.toPers) + settings.min; + nums.toNumber = Math.round(_to / settings.step) * settings.step; + if (nums.toNumber > settings.max) { + nums.toNumber = settings.max; + } + + if (stepFloat) { + nums.fromNumber = parseInt(nums.fromNumber * stepFloat, 10) / stepFloat; + nums.toNumber = parseInt(nums.toNumber * stepFloat, 10) / stepFloat; + } + + if (allow_values) { + nums.fromValue = settings.values[nums.fromNumber]; + nums.toValue = settings.values[nums.toNumber]; + } + + } + + numbers = nums; + setFields(); + }; + + var setNumbers = function () { + var nums = { + input: slider, + slider: $container, + min: settings.min, + max: settings.max, + fromNumber: settings.from, + toNumber: settings.to, + fromPers: 0, + toPers: 0, + fromX: 0, + fromX_pure: 0, + toX: 0, + toX_pure: 0 + }; + var diapason = settings.max - settings.min; + + if (settings.type === "single") { + + nums.fromPers = (diapason !== 0) ? (nums.fromNumber - settings.min) / diapason * 100 : 0; + nums.fromX_pure = fullWidth / 100 * nums.fromPers; + nums.fromX = Math.round(nums.fromX_pure); + $singleSlider[0].style.left = nums.fromX + "px"; + $.data($singleSlider[0], "x", nums.fromX_pure); + + } else if (settings.type === "double") { + + nums.fromPers = (diapason !== 0) ? (nums.fromNumber - settings.min) / diapason * 100 : 0; + nums.fromX_pure = fullWidth / 100 * nums.fromPers; + nums.fromX = Math.round(nums.fromX_pure); + $fromSlider[0].style.left = nums.fromX + "px"; + $.data($fromSlider[0], "x", nums.fromX_pure); + + nums.toPers = (diapason !== 0) ? (nums.toNumber - settings.min) / diapason * 100 : 1; + nums.toX_pure = fullWidth / 100 * nums.toPers; + nums.toX = Math.round(nums.toX_pure); + $toSlider[0].style.left = nums.toX + "px"; + $.data($toSlider[0], "x", nums.toX_pure); + + setDiapason(); + + } + + numbers = nums; + setFields(); + }; + + var moveByClick = function (page_x) { + is_first_start = false; + + var x = page_x - $container.offset().left, + d = numbers.toX - numbers.fromX, + zero_point = numbers.fromX + (d / 2); + + left = 0; + width = $rangeSlider.width() - sliderWidth; + right = $rangeSlider.width() - sliderWidth; + + if (settings.type === "single") { + $activeSlider = $singleSlider; + $activeSlider.prop("id", "irs-active-slider"); + dragSlider(x); + } else if (settings.type === "double") { + if (x <= zero_point) { + $activeSlider = $fromSlider; + } else { + $activeSlider = $toSlider; + } + $activeSlider.prop("id", "irs-active-slider"); + dragSlider(x); + setDiapason(); + } + + $activeSlider.removeAttr("id"); + $activeSlider = null; + }; + + var setFields = function () { + var _from, _fromW, _fromX, + _to, _toW, _toX, + _single, _singleW, _singleX, + _slW = (sliderWidth / 2), + maxPostfix = ""; + + if (settings.type === "single") { + + if (numbers.fromNumber === settings.max) { + maxPostfix = settings.maxPostfix; + } else { + maxPostfix = ""; + } + + $fieldFrom[0].style.display = "none"; + $fieldTo[0].style.display = "none"; + + if (allow_values) { + _single = + settings.prefix + + settings.values[numbers.fromNumber] + + maxPostfix + + settings.postfix; + } else { + _single = + settings.prefix + + prettify(numbers.fromNumber) + + maxPostfix + + settings.postfix; + } + + $fieldSingle.html(_single); + + _singleW = $fieldSingle.outerWidth(false); + _singleX = numbers.fromX - (_singleW / 2) + _slW; + if (_singleX < 0) { + _singleX = 0; + } + if (_singleX > normalWidth - _singleW) { + _singleX = normalWidth - _singleW; + } + $fieldSingle[0].style.left = _singleX + "px"; + + if (!settings.hideMinMax && !settings.hideFromTo) { + if (_singleX < fieldMinWidth) { + $fieldMin[0].style.display = "none"; + } else { + $fieldMin[0].style.display = "block"; + } + + if (_singleX + _singleW > normalWidth - fieldMaxWidth) { + $fieldMax[0].style.display = "none"; + } else { + $fieldMax[0].style.display = "block"; + } + } + + slider.prop("value", parseFloat(numbers.fromNumber)); + + } else if (settings.type === "double") { + + if (numbers.fromNumber === settings.max) { + maxPostfix = settings.maxPostfix; + } else { + maxPostfix = ""; + } + + if (numbers.toNumber === settings.max) { + maxPostfix = settings.maxPostfix; + } else { + maxPostfix = ""; + } + + if (allow_values) { + _from = + settings.prefix + + settings.values[numbers.fromNumber] + + settings.postfix; + + _to = + settings.prefix + + settings.values[numbers.toNumber] + + maxPostfix + + settings.postfix; + + if (numbers.fromNumber !== numbers.toNumber) { + _single = + settings.prefix + + settings.values[numbers.fromNumber] + + " — " + settings.prefix + + settings.values[numbers.toNumber] + + maxPostfix + + settings.postfix; + } else { + _single = + settings.prefix + + settings.values[numbers.fromNumber] + + maxPostfix + + settings.postfix; + } + } else { + _from = + settings.prefix + + prettify(numbers.fromNumber) + + settings.postfix; + + _to = + settings.prefix + + prettify(numbers.toNumber) + + maxPostfix + + settings.postfix; + + if (numbers.fromNumber !== numbers.toNumber) { + _single = + settings.prefix + + prettify(numbers.fromNumber) + + " — " + settings.prefix + + prettify(numbers.toNumber) + + maxPostfix + + settings.postfix; + } else { + _single = + settings.prefix + + prettify(numbers.fromNumber) + + maxPostfix + + settings.postfix; + } + } + + $fieldFrom.html(_from); + $fieldTo.html(_to); + $fieldSingle.html(_single); + + _fromW = $fieldFrom.outerWidth(false); + _fromX = numbers.fromX - (_fromW / 2) + _slW; + if (_fromX < 0) { + _fromX = 0; + } + if (_fromX > normalWidth - _fromW) { + _fromX = normalWidth - _fromW; + } + $fieldFrom[0].style.left = _fromX + "px"; + + _toW = $fieldTo.outerWidth(false); + _toX = numbers.toX - (_toW / 2) + _slW; + if (_toX < 0) { + _toX = 0; + } + if (_toX > normalWidth - _toW) { + _toX = normalWidth - _toW; + } + $fieldTo[0].style.left = _toX + "px"; + + _singleW = $fieldSingle.outerWidth(false); + _singleX = numbers.fromX + ((numbers.toX - numbers.fromX) / 2) - (_singleW / 2) + _slW; + if (_singleX < 0) { + _singleX = 0; + } + if (_singleX > normalWidth - _singleW) { + _singleX = normalWidth - _singleW; + } + $fieldSingle[0].style.left = _singleX + "px"; + + if (_fromX + _fromW < _toX) { + $fieldSingle[0].style.display = "none"; + $fieldFrom[0].style.display = "block"; + $fieldTo[0].style.display = "block"; + } else { + $fieldSingle[0].style.display = "block"; + $fieldFrom[0].style.display = "none"; + $fieldTo[0].style.display = "none"; + } + + if (!settings.hideMinMax && !settings.hideFromTo) { + if (_singleX < fieldMinWidth || _fromX < fieldMinWidth) { + $fieldMin[0].style.display = "none"; + } else { + $fieldMin[0].style.display = "block"; + } + + if (_singleX + _singleW > normalWidth - fieldMaxWidth || _toX + _toW > normalWidth - fieldMaxWidth) { + $fieldMax[0].style.display = "none"; + } else { + $fieldMax[0].style.display = "block"; + } + } + + slider.prop("value", parseFloat(numbers.fromNumber) + ";" + parseFloat(numbers.toNumber)); + + } + + settings.from = numbers.fromNumber; + settings.to = numbers.toNumber; + callbacks(); + }; + + + var callbacks = function () { + // trigger onFinish function + if (typeof settings.onFinish === "function" && !is_slider_active && !is_first_start) { + settings.onFinish.call(this, numbers); + } + + // trigger onChange function + if (typeof settings.onChange === "function" && !is_first_start) { + settings.onChange.call(this, numbers); + } + + // trigger onLoad function + if (typeof settings.onLoad === "function" && !is_slider_active && is_first_start) { + settings.onLoad.call(this, numbers); + is_first_start = false; + } + }; + + + var setGrid = function () { + $container.addClass("irs-with-grid"); + + var i, + text = '', + step = 0, + tStep = 0, + gridHTML = '', + smNum = 20, + bigNum = 4, + cont_width = normalWidth - (settings.gridMargin * 2); + + + + for (i = 0; i <= smNum; i += 1) { + step = Math.floor(cont_width / smNum * i); + + if (step >= cont_width) { + step = cont_width - 1; + } + gridHTML += ''; + } + for (i = 0; i <= bigNum; i += 1) { + step = Math.floor(cont_width / bigNum * i); + + if (step >= cont_width) { + step = cont_width - 1; + } + gridHTML += ''; + + if (stepFloat) { + text = (settings.min + ((settings.max - settings.min) / bigNum * i)); + text = (text / settings.step) * settings.step; + text = parseInt(text * stepFloat, 10) / stepFloat; + } else { + text = Math.round(settings.min + ((settings.max - settings.min) / bigNum * i)); + text = Math.round(text / settings.step) * settings.step; + text = prettify(text); + } + + if (allow_values) { + if (settings.hideMinMax) { + text = Math.round(settings.min + ((settings.max - settings.min) / bigNum * i)); + text = Math.round(text / settings.step) * settings.step; + if (i === 0 || i === bigNum) { + text = settings.values[text]; + } else { + text = ""; + } + } else { + text = ""; + } + } + + if (i === 0) { + tStep = step; + gridHTML += '' + text + ''; + } else if (i === bigNum) { + tStep = step - 100; + gridHTML += '' + text + ''; + } else { + tStep = step - 50; + gridHTML += '' + text + ''; + } + } + + $grid.html(gridHTML); + $grid[0].style.left = settings.gridMargin + "px"; + }; + + + + // Disable state + var setMask = function () { + $container.addClass("irs-disabled"); + $container.append(disableHTML); + }; + + var removeMask = function () { + $container.removeClass("irs-disabled"); + $container.find(".irs-disable-mask").remove(); + }; + + + + placeHTML(); + }); + }, + update: function (options) { + return this.each(function () { + this.updateData(options); + }); + }, + remove: function () { + return this.each(function () { + this.removeSlider(); + }); + } + }; + + $.fn.ionRangeSlider = function (method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || !method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist for jQuery.ionRangeSlider'); + } + }; + +}(jQuery, document, window, navigator)); diff --git a/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.min.js b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.min.js new file mode 100644 index 000000000..a866d04af --- /dev/null +++ b/Metronic/assets/global/plugins/ion.rangesliderOld/js/ion.rangeSlider.min.js @@ -0,0 +1,27 @@ +// Ion.RangeSlider | version 1.9.3 | https://github.com/IonDen/ion.rangeSlider +(function(c,ea,aa,M){var ba=0,r,N=function(){var c=M.userAgent,a=/msie\s\d+/i;return 0c)?!0:!1}(),X="ontouchstart"in aa||0a.max&&(a.from=a.min);a.toa.max&&(a.to=a.max);"double"===a.type&&(a.from>a.to&&(a.from=a.to),a.to';e[0].style.display="none";e.before(g);var n=e.prev(),C=c(ea.body),P=c(aa),p,D,E,A,B,w,x,m,s,q,H,Y, +v=!1,y=!1,J=!0,f={},U=0,Q=0,R=0,t=0,F=0,G=0,V=0,S=0,T=0,Z=0,u=0;parseInt(a.step,10)!==parseFloat(a.step)&&(u=a.step.toString().split(".")[1],u=Math.pow(10,u.length));this.updateData=function(b){c.extend(a,b);n.find("*").off();P.off("mouseup.irs"+l.plugin_count);C.off("mouseup.irs"+l.plugin_count);C.off("mouseleave.irs"+l.plugin_count);C.off("mousemove.irs"+l.plugin_count);n.html("");M()};this.removeSlider=function(){n.find("*").off();P.off("mouseup.irs"+l.plugin_count);C.off("mouseup.irs"+l.plugin_count); +C.off("mouseleave.irs"+l.plugin_count);C.off("mousemove.irs"+l.plugin_count);n.html("").remove();e.data("isActive",!1);e.show()};var M=function(){n.html('01000');p= +n.find(".irs");D=p.find(".irs-min");E=p.find(".irs-max");A=p.find(".irs-from");B=p.find(".irs-to");w=p.find(".irs-single");Y=n.find(".irs-grid");a.hideFromTo&&(A[0].style.visibility="hidden",B[0].style.visibility="hidden",w[0].style.visibility="hidden");a.hideFromTo||(A[0].style.visibility="visible",B[0].style.visibility="visible",w[0].style.visibility="visible");a.hideMinMax&&(D[0].style.visibility="hidden",E[0].style.visibility="hidden",R=Q=0);a.hideMinMax||(D[0].style.visibility="visible",E[0].style.visibility= +"visible",a.values?(D.html(a.prefix+a.values[0]+a.postfix),E.html(a.prefix+a.values[a.values.length-1]+a.maxPostfix+a.postfix)):(D.html(a.prefix+z(a.min)+a.postfix),E.html(a.prefix+z(a.max)+a.maxPostfix+a.postfix)),Q=D.outerWidth(!1),R=E.outerWidth(!1));ga()},ga=function(){if("single"===a.type){if(p.append(''),x=p.find(".single"),x.on("mousedown",function(a){a.preventDefault();a.stopPropagation();K(a,c(this),null);y=v=!0;r=l.plugin_count;N&&c("*").prop("unselectable", +!0)}),X)x.on("touchstart",function(a){a.preventDefault();a.stopPropagation();K(a.originalEvent.touches[0],c(this),null);y=v=!0;r=l.plugin_count})}else"double"===a.type&&(p.append(''),m=p.find(".from"),s=p.find(".to"),H=p.find(".irs-diapason"),L(),m.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");s.removeClass("last");K(a,c(this),"from");y=v=!0;r=l.plugin_count; +N&&c("*").prop("unselectable",!0)}),s.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");m.removeClass("last");K(a,c(this),"to");y=v=!0;r=l.plugin_count;N&&c("*").prop("unselectable",!0)}),X&&(m.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");s.removeClass("last");K(a.originalEvent.touches[0],c(this),"from");y=v=!0;r=l.plugin_count}),s.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last"); +m.removeClass("last");K(a.originalEvent.touches[0],c(this),"to");y=v=!0;r=l.plugin_count})),a.to===a.max&&m.addClass("last"));var b=function(){r===l.plugin_count&&v&&(v=y=!1,q.removeAttr("id"),q=null,"double"===a.type&&L(),$(),N&&c("*").prop("unselectable",!1))};P.on("mouseup.irs"+l.plugin_count,function(){b()});if(N)C.on("mouseleave.irs"+l.plugin_count,function(){b()});C.on("mousemove.irs"+l.plugin_count,function(a){v&&(U=a.pageX,W())});n.on("mousedown",function(){r=l.plugin_count});n.on("mouseup", +function(b){if(r===l.plugin_count&&!v&&!a.disable){b=b.pageX;J=!1;b-=n.offset().left;var h=f.fromX+(f.toX-f.fromX)/2;S=0;V=p.width()-G;T=p.width()-G;"single"===a.type?(q=x,q.prop("id","irs-active-slider"),W(b)):"double"===a.type&&(q=b<=h?m:s,q.prop("id","irs-active-slider"),W(b),L());q.removeAttr("id");q=null}});X&&(P.on("touchend",function(){v&&(v=y=!1,q.removeAttr("id"),q=null,"double"===a.type&&L(),$())}),P.on("touchmove",function(a){v&&(U=a.originalEvent.touches[0].pageX,W())}));ca();ha();a.hasGrid&& +ia();a.disable?(n.addClass("irs-disabled"),n.append('')):(n.removeClass("irs-disabled"),n.find(".irs-disable-mask").remove())},ca=function(){t=p.width();G=x?x.width():m.width();F=t-G},K=function(b,d,h){ca();J=!1;q=d;q.prop("id","irs-active-slider");d=q.offset().left;Z=d+(b.pageX-d)-q.position().left;"single"===a.type?V=p.width()-G:"double"===a.type&&("from"===h?(S=0,T=parseInt(s.css("left"),10)):(S=parseInt(m.css("left"),10),T=p.width()-G))},L=function(){var a= +m.width(),d=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,h=(c.data(s[0],"x")||parseInt(s[0].style.left,10)||s.position().left)-d;H[0].style.left=d+a/2+"px";H[0].style.width=h+"px"},W=function(b){var d=U-Z,d=b?b:U-Z;"single"===a.type?(0>d&&(d=0),d>V&&(d=V)):"double"===a.type&&(dT&&(d=T),L());c.data(q[0],"x",d);$();b=Math.round(d);q[0].style.left=b+"px"},$=function(){var b={input:e,slider:n,min:a.min,max:a.max,fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,fromX_pure:0, +toX:0,toX_pure:0},d=a.max-a.min,h;"single"===a.type?(b.fromX=c.data(x[0],"x")||parseInt(x[0].style.left,10)||x.position().left,b.fromPers=b.fromX/F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumbera.max&&(b.fromNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber])):"double"===a.type&&(b.fromX=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,b.fromPers=b.fromX/ +F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumbera.max&&(b.toNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u,b.toNumber=parseInt(b.toNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber],b.toValue=a.values[b.toNumber]));f=b;da()},ha=function(){var b={input:e, +slider:n,min:a.min,max:a.max,fromNumber:a.from,toNumber:a.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},d=a.max-a.min;"single"===a.type?(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),x[0].style.left=b.fromX+"px",c.data(x[0],"x",b.fromX_pure)):"double"===a.type&&(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),m[0].style.left=b.fromX+"px",c.data(m[0],"x",b.fromX_pure), +b.toPers=0!==d?(b.toNumber-a.min)/d*100:1,b.toX_pure=F/100*b.toPers,b.toX=Math.round(b.toX_pure),s[0].style.left=b.toX+"px",c.data(s[0],"x",b.toX_pure),L());f=b;da()},da=function(){var b,d,h,c,g,k;k=G/2;h="";"single"===a.type?(h=f.fromNumber===a.max?a.maxPostfix:"",A[0].style.display="none",B[0].style.display="none",h=I?a.prefix+a.values[f.fromNumber]+h+a.postfix:a.prefix+z(f.fromNumber)+h+a.postfix,w.html(h),g=w.outerWidth(!1),k=f.fromX-g/2+k,0>k&&(k=0),k>t-g&&(k=t-g),w[0].style.left=k+"px",a.hideMinMax|| +a.hideFromTo||(D[0].style.display=kt-R?"none":"block"),e.prop("value",parseFloat(f.fromNumber))):"double"===a.type&&(h=f.toNumber===a.max?a.maxPostfix:"",I?(b=a.prefix+a.values[f.fromNumber]+a.postfix,d=a.prefix+a.values[f.toNumber]+h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+a.values[f.fromNumber]+" \u2014 "+a.prefix+a.values[f.toNumber]+h+a.postfix:a.prefix+a.values[f.fromNumber]+h+a.postfix):(b=a.prefix+z(f.fromNumber)+a.postfix,d=a.prefix+z(f.toNumber)+ +h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+z(f.fromNumber)+" \u2014 "+a.prefix+z(f.toNumber)+h+a.postfix:a.prefix+z(f.fromNumber)+h+a.postfix),A.html(b),B.html(d),w.html(h),b=A.outerWidth(!1),d=f.fromX-b/2+k,0>d&&(d=0),d>t-b&&(d=t-b),A[0].style.left=d+"px",h=B.outerWidth(!1),c=f.toX-h/2+k,0>c&&(c=0),c>t-h&&(c=t-h),B[0].style.left=c+"px",g=w.outerWidth(!1),k=f.fromX+(f.toX-f.fromX)/2-g/2+k,0>k&&(k=0),k>t-g&&(k=t-g),w[0].style.left=k+"px",d+bt-R||c+h>t-R?"none":"block"),e.prop("value",parseFloat(f.fromNumber)+";"+parseFloat(f.toNumber)));a.from=f.fromNumber;a.to=f.toNumber;ja()},ja=function(){"function"!==typeof a.onFinish||y||J||a.onFinish.call(this,f);"function"!==typeof a.onChange||J||a.onChange.call(this,f);"function"===typeof a.onLoad&& +!y&&J&&(a.onLoad.call(this,f),J=!1)},ia=function(){n.addClass("irs-with-grid");var b,d="",c=0,c=0,e="",f=t-2*a.gridMargin;for(b=0;20>=b;b+=1)c=Math.floor(f/20*b),c>=f&&(c=f-1),e+='';for(b=0;4>=b;b+=1)c=Math.floor(f/4*b),c>=f&&(c=f-1),e+='',u?(d=a.min+(a.max-a.min)/4*b,d=d/a.step*a.step,d=parseInt(d*u,10)/u):(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=z(d)), +I&&(a.hideMinMax?(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=0===b||4===b?a.values[d]:""):d=""),0===b?e+=''+d+"":4===b?(c-=100,e+=''+d+""):(c-=50,e+=''+d+"");Y.html(e);Y[0].style.left=a.gridMargin+"px"};M()}})},update:function(c){return this.each(function(){this.updateData(c)})}, +remove:function(){return this.each(function(){this.removeSlider()})}};c.fn.ionRangeSlider=function(r){if(H[r])return H[r].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof r&&r)c.error("Method "+r+" does not exist for jQuery.ionRangeSlider");else return H.init.apply(this,arguments)}})(jQuery,document,window,navigator); diff --git a/Metronic/assets/global/plugins/ion.rangeslider/js/vendor/jquery-1.11.0.min.js b/Metronic/assets/global/plugins/ion.rangesliderOld/js/vendor/jquery-1.11.0.min.js similarity index 100% rename from Metronic/assets/global/plugins/ion.rangeslider/js/vendor/jquery-1.11.0.min.js rename to Metronic/assets/global/plugins/ion.rangesliderOld/js/vendor/jquery-1.11.0.min.js diff --git a/OI/TareaDetalle.aspx b/OI/TareaDetalle.aspx new file mode 100644 index 000000000..ff7fe8719 --- /dev/null +++ b/OI/TareaDetalle.aspx @@ -0,0 +1,722 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TareaDetalle.aspx.cs" Inherits="OI_TareaDetalle" %> + + + + + + + + + + + + + + + + + + + + + + + + +
  • + Agregar CheckList
  • +
  • + Cambiar Estatus
  • +
  • + Agregar Comentario
  • +
  • + Agregar Tema
  • +
  • + Agregar Archivo
  • + +
    +
    +
    + + + + + +
    +
    + + +
    +
    + + Tarea +
    +
    + +
    +
    +
    +
    + + + +
    +
    + + + +
    + +
    +
    +

    Para

    +
    +
    + +
    +
    + + +
    +
    +

    C. C. Para

    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    +
    +
    + + + + + + + + Prioridad: + +
    +
    +
    +
    + + + + Tema: +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + Estatus +
    +
    + +
    +
    +
    + + + + +
    + + + Estatus: +
    +
    + Avance: + +
    + +
    +
    +
    +
    + + + +
    +
    + + Archivo +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + + + +
    +
    + + CheckList +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + Agregar + <%--Agregar--%> +
    +
    + + + + + + + + + + + <%--
    --%>
    +                                                
    +                                                     
    +                                                
    +                                                <%--
    --%> +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + Miembros +
    +
    + +
    +
    +
    + <%--
    +
    +
    + + + Usuario: +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + +
    Para
    jorge caudillo
    Con copia para
    Julian Moreno
    --%> + + + + + + Para + + + <%----%> + + + + + + C. C. Para + + + + + + Usuario + + + + + + Rol + + + + + + +
    +
    +
    +
    +
    + Guardar +
    +
    + +
    +
    + + Registro de actividades +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + +
    + + + + + + + + + diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs new file mode 100644 index 000000000..477602ab3 --- /dev/null +++ b/OI/TareaDetalle.aspx.cs @@ -0,0 +1,691 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_TareaDetalle : ClsPaginas +{ + #region Propiedades + public const string iddivAgregar = "divModalAgregarActividad"; + public const string iddivAgregarArchivo = "divModalAgregarArchivo"; + public const string iddivAgregarTema = "divModalAgregartema"; + public const string iddivCambiarEstatus = "divModalCambiarEstatus"; + public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } } + public int Folio { get { return ViewState["Folio"] != null ? ViewState["Folio"].ToString().ToEntero() : 0; } set { ViewState["Folio"] = value; } } + public decimal Avance { get { return ViewState["Avance"] != null ? ViewState["Avance"].ToString().ToEntero() : 0; } set { ViewState["Avance"] = value; } } + public int CveUsuarioPara { get { return ViewState["CveUsuarioPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioPara"] = value; } } + public int CveUsuarioCCPara { get { return ViewState["CveUsuarioCCPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioCCPara"] = value; } } + public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } } + + public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } } + public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + EsNuevo = true; + CveUsuarioPara = 0; + CveUsuarioCCPara = 0; + if (Request["Archivo"] != null) + { + string strArchivo = string.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ModExtensiones.Decripta(Request["Archivo"].ToString())); + if (System.IO.File.Exists(strArchivo)) + { + try + { + string filename = ModExtensiones.Decripta(Request["filename"].ToString()); + + System.IO.FileInfo file = new System.IO.FileInfo(strArchivo); + string mimeType = "text/plain"; + try { mimeType = MimeMapping.GetMimeMapping(strArchivo); } + catch (Exception) { } + // Response.Write(path) + Response.Clear(); + Response.ClearHeaders(); + Response.ClearContent(); + Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(filename)}"); + Response.AddHeader("Content-Length", file.Length.ToString()); + Response.ContentType = mimeType; + Response.Flush(); + Response.TransmitFile(file.FullName); + Response.End(); + } + catch (Exception) + { + this.RegistraScript("window.close();"); + } + } + else + { + this.RegistraScript("window.close();"); + } + } + else + { + + CargaTemas(); + CargaEstatus(); + cargaUsuarios(); + if (Request["CveEvento"] != null) + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); + } + if (RCveEvento > 0) + { + EsNuevo = false; + LoadTarea(); + } + else + { + LtlTitulo.Text = "Tarea Nueva"; + TxtArchivo.Visible = true; + CveUsuarioCCPara = UsuarioActual.CveUsuario; + } + SetUsuarios(); + HypArchivo.Visible = !TxtArchivo.Visible; + } + } + } + private void CargaTemas() + { + DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataBind(); + DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void CargaEstatus() + { + + DdlEventoEstatus.DataSource = GlobalDTOIEstatusEventos;//get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DDlEstatus.DataSource = DdlEventoEstatus.DataSource; + DdlEventoEstatus.DataBind(); + DDlEstatus.DataBind(); + DdlEventoEstatus.Enabled = false; + //DdlEventoEstatus.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void cargaUsuarios() + { + string FiltroAD = ""; + + GVUsuarios.DataSource = get_GlobalDTUsuarios().FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1 {1}", UsuarioActual.CveEmpresa, FiltroAD), "Rol ASC"); + GVUsuarios.DataBind(); + } + private void cargaActividades(ClsOIEventos ObjOI) + { + GvActividades.DataSource = null; + if (ObjOI.GetEventosComentarios(RCveEvento)) + { + GvActividades.DataSource = ObjOI.DtResultados; + } + GvActividades.DataBind(); + UpActividades.Update(); + } + private void SetUsuarios() + { + StringBuilder para = new StringBuilder(); + StringBuilder CCpara = new StringBuilder(); + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + chkpara.Checked = false; + chkCCpara.Checked = false; + + if (EsNuevo) + { + chkpara.Enabled = true; + chkCCpara.Enabled = true; + //if (CveUsuario == CveUsuarioCCPara) + //{ + // chkCCpara.Enabled = false; + //} + } + else + { + + chkpara.Enabled = false; + chkCCpara.Enabled = false; + } + + if (CveUsuario == CveUsuarioPara) + { + chkpara.Checked = true; + para.AppendFormat("\"{0}\"",gvRow.DataKey("Nombre").ToString()); + } + if (CveUsuario == CveUsuarioCCPara) + { + chkCCpara.Checked = true; + CCpara.AppendFormat("\"{0}\"", gvRow.DataKey("Nombre").ToString()); + } + + } + LtlPara.Text = para.ToString(); + LtlCCPara.Text = CCpara.ToString(); + } + } + + public void LoadTarea() + { + GVcheklist.DataSource = new System.Data.DataTable(); + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetOI_Eventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0) + { + PnlUsuarios.Visible = true; + portletMiembros.Visible = false; + LnkUpFile.Visible = true; + System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; + + Folio = drow["Folio"].ToString().ToEntero(); + Avance = drow["Avance"].ToString().ToDecimal(); + + TxtAsunto.Text = drow["Asunto"].ToString(); + TxtDescripcion.Text = drow["Descripcion"].ToString(); + DdlPrioridad.SelectedValueExist(drow["Prioridad"].ToString()); + txtFechaI.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaInicio"]); + txtFechaF.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaFin"]); + DdlTema.SelectedValueExist(drow["CveRevision"].ToString()); + DdlEventoEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + DDlEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + HypArchivo.Text = string.Format("{0}
    ", drow["Archivo"].ToString()); + HypArchivo.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())); + TxtArchivo.Visible = (drow["Archivo"].ToString().Length == 0); + portletArchivo.Visible = !TxtArchivo.Visible; + LnkUpFile.Text = (portletArchivo.Visible ? "Actualizar archivo" : "Agregar archivo"); + CveUsuarioCCPara = drow["CveUsuarioDe"].ToString().ToEntero(); + CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero(); + TxtAvance.Text = string.Format("{0:##0}", drow["Avance"]); + //OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara], + //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], + //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] + + LtlTitulo.Text = drow["Titulo"].ToString(); + if (ObjOI_E.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = ObjOI_E.DtResultados; + if (ObjOI_E.DtResultados.Rows.Count > 0) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + } + } + cargaActividades(ObjOI_E); + } + } + GVcheklist.DataBind(); + } + + protected void LnkGuardar_Click(object sender, EventArgs e) + { + if (EsNuevo) + { + string errorMessage = ""; + int cveUsuarioDe = -1; + int cveUsuarioPara = -1; + + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + if (chkpara.Checked) + { + cveUsuarioPara = CveUsuario; + } + if (chkCCpara.Checked) + { + cveUsuarioDe = CveUsuario; + } + } + } + + OITipoEventos cveTipoEvento = OITipoEventos.Tarea; + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + int prioridad = DdlPrioridad.SelectedValue.ToEntero(); + + + string fechaInicio = ""; + if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "no se ingreso una fecha de inicio valida"; + + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "no se ingreso una fecha fin valida"; + + } + else + { + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); + } + } + else + { + fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = DdlTema.SelectedValue.ToEntero(); + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in TxtArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "no se selecciono el miembro 'C C Para'"; + } + if (cveUsuarioPara <= 0) + { + errorMessage = "no se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, cveUsuarioIng, cveEmpresa); + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (Continuar) + { + foreach (System.Data.DataRow item in CheckListNew.Rows) + { + if (Continuar) + { + Continuar = objOI.Addcheklist(CveEvento, item["EventoComentario"].ToString(), UsuarioActual.CveUsuario); + + } + + } + } + if (Continuar && CveEvento > 0) + { + objOI.Commit(); + + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + } + else + { + this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia); + + } + } + } + + protected void LnkEliminarchek_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer; + + if (EsNuevo) + { + CheckListNew = CheckListNew.FiltraParametros(string.Format("CveEventoCheckList <> {0}", gvrow.DataKey("CveEventoCheckList"))); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + else + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Removecheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), UsuarioActual.CveUsuario)) + { + Alert("Se ha eliminado la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + } + protected void LnkAgregarCheckList_Click(object sender, EventArgs e) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + if (RCveEvento > 0) + { + + } + else + { + GVcheklist.Columns[0].Visible = false; + CheckListNew = new System.Data.DataTable(); + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Columns.Add("CveEventoCheckList", typeof(int)); + CheckListNew.Columns.Add("CveEvento", typeof(int)); + CheckListNew.Columns.Add("CveTipoEvento", typeof(int)); + CheckListNew.Columns.Add("EventoComentario", typeof(String)); + CheckListNew.Columns.Add("Estatus", typeof(bool)); + CheckListNew.Columns.Add("CveUsuario", typeof(int)); + CheckListNew.Columns.Add("Usuario", typeof(string)); + CheckListNew.Columns.Add("FechaIng", typeof(DateTime)); + + } + UpChkList.Update(); + } + protected void LnkAgregarchklistitem_Click(object sender, EventArgs e) + { + if (RCveEvento > 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Addcheklist(RCveEvento, TxtActividad.Text, UsuarioActual.CveUsuario)) + { + Alert("Se ha agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + + } + else + { + System.Data.DataRow drow = CheckListNew.NewRow(); + drow["CveEventoCheckList"] = chklistitemindex++; + drow["EventoComentario"] = TxtActividad.Text; + drow["Estatus"] = false; + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Rows.Add(drow); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + TxtActividad.Text = ""; + } + protected void ChkEstatus_CheckedChanged(object sender, EventArgs e) + { + CheckBox chk = (CheckBox)sender; + GridViewRow gvrow = (GridViewRow)chk.NamingContainer; + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario)) + { + Alert("Se actualizo el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + protected void LnkEditarCheck_Click(object sender, EventArgs e) + { + + } + + protected void BtnCambiarEstatus_Click(object sender, EventArgs e) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + + + if (objOI.UpdateEstatusEvento2(DDlEstatus.SelectedValue.ToEntero(), -1, RCveEvento, UsuarioActual.CveUsuario)) + { + //CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero); + + //if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1) + // EnviarCorreoCambioEstatus(false); + //CargaDatos(); + string mensaje = string.Format("Se cambio el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text); + DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue); + UpEstatus.Update(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus)); + Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion); + cargaActividades(objOI); + } + + } + + } + + protected void LnkcambiarEstatus_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivCambiarEstatus)); + + } + + + + protected void LnkSinfuncion_Click(object sender, EventArgs e) + { + + } + + protected void LnkAgregarTema_Click(object sender, EventArgs e) + { + + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema)); + + } + + protected void BtnAgregarTema_Click(object sender, EventArgs e) + { + + using (ClsOIEventos objoi = new ClsOIEventos()) + { + if (objoi.AddRevisionesEventos(TxtTema.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Alert("Tema agregada con éxito.", ModExtensiones.TipoMensaje.MsgInformacion); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarTema)); + TxtTema.Text = ""; + set_GlobalDTOIRevision(-1, objoi.DtResultados); + CargaTemas(); + UpContenido.Update(); + } + else { Alert("Ocurrió un error al agregar la revisión. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError); } + + } + } + + protected void LnkAgregarActividad_Click(object sender, EventArgs e) + { + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregar)); + } + + protected void BtnAgregarComentario_Click(object sender, EventArgs e) + { + string Comentario = TxtComentario.Text; + int CveComentario = 0; + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + using (ClsOIEventos objoi = new ClsOIEventos()) + { + CveComentario = objoi.AddEventoComentario(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario); + if (CveComentario > 0) { cargaActividades(objoi); } + } + Txtfilecomentario.Text = ""; + if (CveComentario > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}{2}", ruta, CveComentario, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregar)); + this.Alert("comentario agregado", ModExtensiones.TipoMensaje.ToastInformacion); + //this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + + } + + protected void GvActividades_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + HyperLink HplA = e.Row.FCHyperLink("HplA"); + string archivoname = e.Row.DBCampo("Archivo"); + string CveComentario = e.Row.DBCampo("CveEventoComentario"); + HplA.Visible = archivoname != ""; + if (HplA.Visible) + { + HplA.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, archivoname)), ModExtensiones.Encripta(archivoname)); + } + + } + //Visible='<%# Eval("Archivo").ToString() != "" %>' data-archivo ='<%# string.Format("",Eval("CveEventoComentario").ToString()) %>' + //string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())) + } + + protected void LnkUpFile_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarArchivo)); + + } + + protected void BtnActualizarArchivo_Click(object sender, EventArgs e) + { + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in txtActualizarArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + string rutafin = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + int index = 0; + while (System.IO.File.Exists(rutafin)) + { + archivoname = string.Format("{0}{1}", index++, archivoname); + rutafin = string.Format("{0}{1}", ruta, archivoname); + } + System.IO.File.Move(rutaarchivoOri, rutafin); + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario); + + } + if (continuar) + { + LoadTarea(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarArchivo)); + this.Alert("Archivo Actualizado", ModExtensiones.TipoMensaje.ToastInformacion); + } + UpContenido.Update(); + } + + protected void BtnUpAvance_Click(object sender, EventArgs e) + { + + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario); + if (continuar){ + if (objoi.DtResultados.Rows.Count > 0) + { + LtlTitulo.Text = objoi.DtResultados.Rows[0]["Titulo"].ToString(); + } + cargaActividades(objoi); + } + } + if (continuar) + { + this.Alert("Avance Actualizado", ModExtensiones.TipoMensaje.ToastInformacion); + + } + UpTitulo.Update(); + } +} \ No newline at end of file diff --git a/Scripts/custom.js b/Scripts/custom.js index 2e9e49583..4212ccf60 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1993,7 +1993,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); } - textoOld = texto + textoOld = texto; }; let GETPSALMACEN = function () { @@ -2016,10 +2016,10 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }; lupa.bind("click", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("copy paste cut", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("keyup ", function (e) { if (e.keyCode == 13) { buscaPS(Minput.val()); @@ -2027,7 +2027,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { } else { buscaPSTimer(Minput.val()); } - }) + }); PSModal.on('click', '.list-group-item ', function (e) { let $this = $(this).hasClass('list-group-item') ? $(this) : $(this).closest('.list-group-item'); @@ -2054,7 +2054,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); PSModal.on('shown.bs.modal', function () { Minput.focus(); - }) + }); PSModal.on('click', '.item-almacen', function (e) { let $this = $(this).hasClass('item-almacen') ? $(this) : $(this).closest('.item-almacen'); let cveps = $(PSModal.find('.active')).data('cve');