diff --git a/.gitignore b/.gitignore index a3e8e0702..b14cc0feb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,270 +1,12 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -web.config -Log.txt -LogMail.txt -LogPenske.txt -LogTimbrado.txt -[Mm]enu/ -[Tt]emp/ -[Ee]mpresas/ -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -project.fragment.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -#*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml -*.sln - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc -/Utilerias +################################################################################ +# Este archivo .gitignore ha sido creado automáticamente por Microsoft(R) Visual Studio. +################################################################################ + +/Empresas +/Menu +/Web.config +/Log.txt +/.vs/localhost/v14/.suo +/LogMail.txt +/.vs +/packages diff --git a/.vs/SIGGIT/v14/.suo b/.vs/SIGGIT/v14/.suo new file mode 100644 index 000000000..fea5bbe7e Binary files /dev/null and b/.vs/SIGGIT/v14/.suo differ diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 1da48e7a6..a7f69b063 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2921,6 +2921,23 @@ Public Class ClsCompras Return Retorno End Function + Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasFechaVencimientoUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la fecha de vencimiento de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + #Region "REPORTE PUE SIN PAGO" Public Function GetPUESinPago(FI As DateTime, FF As DateTime, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a643b79af..653c048d5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4351,6 +4351,7 @@ Public Class ClsPaginas PaginaDict.Add("/Sistemas/PermisosPorUsuario.aspx".ToUpper(), 700) PaginaDict.Add("/Sistemas/Cierre.aspx".ToUpper(), 713) PaginaDict.Add("/Sistemas/CatTareasProgramadas.aspx".ToUpper(), -1) + PaginaDict.Add("/Sistemas/ConfiguracionEmpresa.aspx".ToUpper(), 683) #End Region #Region "Ventas" 'VENTAS diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index c7465b9e7..c94f491b2 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -1796,6 +1796,87 @@ Public Class ClsProductosServicios End Function #End Region +#Region "Porcentaje Marcas de Productos" + Public Function GetPorcentajeMarcas(CveCliente As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PorcentajeMarcasGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los porcentajes de las Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddPorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PorcentajeMarcasAdd") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto + .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 porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdatePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PorcentajeMarcasUpdate") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RemovePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PorcentajeMarcasRemove") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region #Region "IDisposable Support" diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 448b3e53a..9f55d50e7 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -568,6 +568,26 @@ Public Class ClsVentas Return Retorno End Function + Public Function UpdateVentaRealizarDevolucion(CveVenta As Integer, RealizarDevolucion As Boolean, CveAlmacenDevolucion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_VentasRealizarDevolucionUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@RealizarDevolucion", SqlDbType.Bit).Value = RealizarDevolucion + .Add("@CveAlmacenDevolucion", SqlDbType.Int).Value = CveAlmacenDevolucion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus de devolución.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function UpdateEstatusRefacturacion(CveVenta As Integer, CveEstatusRefacturacion As Integer) As Boolean Dim Retorno As Boolean = False @@ -835,6 +855,20 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetRemisionesXCancelar(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RemisionesXCancelarGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar las remisiones x cancelar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function AddRemisionesXCancelar(CveVenta As Integer, CveVentaRemision As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RemisionesXCancelarAdd") @@ -3596,6 +3630,23 @@ Public Class ClsVentas Return retorno End Function + Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva + .Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al traspasar las ventas aplicadas al nuevo anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + #Region " AUTORIZACION DESCUENTOS " Public Function AutorizacionDescuentosGet(CveAutorizacionDescuento As Integer, CveEmpresa As Integer) As Boolean diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 2f8659c84..954c278f3 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -285,9 +285,9 @@ Namespace Modelos Public Property CveProveedor As Integer Public Property CveMoneda As Integer - End Class - - + End Class + + #Region " OBJETOS Ventas" Public Enum TipoMensajeRespuesta TextoLimpio = 0 @@ -316,7 +316,7 @@ Namespace Modelos Public Sub New(ObjsClsPaginas As ClsPaginas, Optional Row As Data.DataRow = Nothing) If Row IsNot Nothing Then - SetValues(Row) + setValues(Row) Else IniciaValores() End If @@ -330,7 +330,7 @@ Namespace Modelos Dim ObjVentas As New ClsVentas() If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - SetValues(ObjVentas.DtResultados.Rows(0)) + setValues(ObjVentas.DtResultados.Rows(0)) SetMetodoPago(ObjsClsPaginas) SetMoneda(ObjsClsPaginas) End If @@ -344,7 +344,7 @@ Namespace Modelos Me.RemisionesLista = New List(Of Integer) Me.ListaMensajes = New List(Of String) If Row IsNot Nothing Then - SetValues(Row) + setValues(Row) Else IniciaValores() End If @@ -361,13 +361,13 @@ Namespace Modelos Me.RemisionesLista = New List(Of Integer) Me.ListaMensajes = New List(Of String) If Row IsNot Nothing Then - SetValues(Row) + setValues(Row) Else IniciaValores() End If Timbre = New CFDITimbre End Sub - Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, DirectorioServidor As String) + Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "") Me.UsuarioActual = UsuarioActual Me.CveVenta = CveVenta Me.CveEmpresa = CveEmpresa @@ -375,10 +375,11 @@ Namespace Modelos Me.RemisionesLista = New List(Of Integer) Me.ListaMensajes = New List(Of String) Me.FolioFiscal = "" + IniciaValores() Dim ObjVentas As New ClsVentas() If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - SetValues(ObjVentas.DtResultados.Rows(0)) + setValues(ObjVentas.DtResultados.Rows(0)) SetMetodoPago() SetMoneda() SetSubProyecto() @@ -389,7 +390,11 @@ Namespace Modelos If ObjVentas.GetVentaDetalle(CveVenta) Then Me.DtDetalle = ObjVentas.DtResultados.Copy() End If - ObjVentas.Dispose() + ObjVentas.Dispose() + IniciaValoresVentas() + If String.IsNullOrEmpty(DirectorioServidor) Then + DirectorioServidor = HttpContext.Current.Server.MapPath("/") + End If Me.DirectorioServidor = DirectorioServidor Timbre = New CFDITimbre End Sub @@ -439,6 +444,43 @@ Namespace Modelos Me.IEPS = 0 Me.CveAlmacenTraspasoOrigen = 0 End Sub + Private Sub IniciaValoresVentas() + If CveVenta > 0 AndAlso CveEmpresa > 0 Then + Me.DtAnticipos = New DataTable() + Dim ObjVentas As New ClsVentas + 'CARGA PROMOCIONES + If ObjVentas.GetPromocionesPS(-1, Me.Fecha, Me.CveSubProyecto, CveCliente, Me.CveVendedor, Me.CveEmpresa) Then + Me.DtPromociones = ObjVentas.DtResultados.Copy() + End If + 'CARGA FIRMAS + If ObjVentas.GetVentasFirmas(CveVenta) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + DtFirmas = ObjVentas.DtResultados.Copy() + End If + End If + ObjVentas.Dispose() + Me.DtPagos = New DataTable() + Me.DtRemisiones = New DataTable() + Me.DtInventario = New DataTable() + Me.DtRemisionesPS = New DataTable() + Me.DtPedidos2 = New DataTable() + Me.DtPedidos2PS = New DataTable() + Me.DTOrdenesCompraPS = New DataTable() + Me.DtCotizacionesPS = New DataTable() + Me.DtDocumentacionCliente = New DataTable() + Me.DtContratosSerieDetalle = New DataTable() + Me.DtRemConceptosSurtidos = New DataTable() + Me.DtImpuestosLocales = New DataTable() + Me.DtOtrosConceptos = New DataTable() + Me.CveContratoSecciones = "" + 'Me.DtInventario = DtDetalle.FiltraParametros("CveTipoPS = 2") + + If Me.RealizarDevolucionAlmacen Then + Me.CveAlmacenDevolucion = Me.CveAlmacenDevolucionVenta + End If + + End If + End Sub Public Class MMensajeFactura Sub New() CveVenta = -1 @@ -942,8 +984,8 @@ Namespace Modelos Return Retorno - End Function - + End Function + #Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO " Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean Dim ProcesoCorrecto As Boolean = True @@ -1742,7 +1784,9 @@ Namespace Modelos End If End If End Sub - Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi, Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing) As Boolean + Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi, + Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, + Optional ByRef DtRemisionesRelacionadas As DataTable = Nothing, Optional SeCancelaRemisionProceso As Boolean = False, Optional CancelarRemisiones As Boolean = False, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing) As Boolean Dim ErrorPrepoliza As Boolean = False Try @@ -1761,7 +1805,7 @@ Namespace Modelos CvePlantilaPoliza = 4 ElseIf ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then CvePlantilaPoliza = 7 - ElseIf ObjFactura.TipoDocto = "Rem" Then + ElseIf ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then CvePlantilaPoliza = 4 End If @@ -1793,12 +1837,22 @@ Namespace Modelos Dim CveSubProyectoVenta = ObjFactura.CveSubProyecto Dim CveSubProyectoContabilizar As Integer Dim IdCtaIVAXTrasladar As Integer = 0 - Dim IdCtaIVATrasladado As Integer = 0 - - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero + Dim IdCtaIVATrasladado As Integer = 0 + Dim CveCuentaIVAxTrasladar As Integer = 0 + Dim CveCuentaIVATrasladado As Integer = 0 + Dim SeContabiliza As Boolean = True + + If (UsuarioActual.Empresa.Funcionalidad(343) = "1" AndAlso ObjFactura.TipoDocto = "Ant") Then + SeContabiliza = False End If + + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then + IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero + CveCuentaIVAxTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVAXTrasladar").ToString.ToEntero + IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero + CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString.ToEntero + End If + Dim UsaComplementariaClientes As Boolean = False If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True @@ -1818,7 +1872,7 @@ Namespace Modelos Select Case ConceptoContable Case 1 'Cliente - If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem") Then + If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then importeMovimiento = ((ObjFactura.Total - ObjFactura.TotalOtrosConceptos) * ValorMultiplicador) importeMX = (importeMovimiento * tipoCambio * Multiplicador) FechaMovimiento = ObjFactura.FechaPago @@ -1847,20 +1901,52 @@ Namespace Modelos CveCuentaCliente = CveCuenta End If - Case 3 'Cliente - - If ObjFactura.TipoDocto = "Ant" Then - importeMovimiento = (ObjFactura.SubTotal * ValorMultiplicador) - importeMX = importeMovimiento * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos - CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos - CveSubProyectoContabilizar = CveSubProyectoVenta - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + Case 3 'Cliente + + If ObjFactura.TipoDocto = "Ant" Then + ConceptoContable = If(UsuarioActual.CveEmpresa.Contiene(1, 119), 95, ConceptoContable) + importeMovimiento = ObjFactura.SubTotal * ValorMultiplicador + importeMX = importeMovimiento * tipoCambio * Multiplicador + FechaMovimiento = ObjFactura.FechaPago + IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos + CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos + CveSubProyectoContabilizar = CveSubProyectoVenta + If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" End If + Case 190 'Remisión del cliente - If ObjFactura.TipoDocto = "Rem" Then + If ObjFactura.TipoDocto = "Rem" Then + importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador + importeMX = importeMovimiento * tipoCambio * Multiplicador + FechaMovimiento = ObjFactura.FechaPago + CveSubProyectoContabilizar = CveSubProyectoVenta + If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + + If tipoCambio = 1 Then + IdCtaContable = ObjFactura.Cliente.IdCtaContClientes + CveCuenta = ObjFactura.Cliente.CveCuentaClientes + Else + IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera + CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera + End If + IdCtaContableCliente = IdCtaContable + CveCuentaCliente = CveCuenta + + If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 190, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 193, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then + ErrorPrepoliza = True + End If + Else + ErrorPrepoliza = True + End If + + importeMovimiento = 0 + ObjFactura.SeGuardoPrePoliza = True + End If + Case 277 'Remisión del cliente + + If ObjFactura.TipoDocto = "RNC" Then importeMovimiento = ((ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador) importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago @@ -1877,8 +1963,8 @@ Namespace Modelos IdCtaContableCliente = IdCtaContable CveCuentaCliente = CveCuenta - If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 190, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 193, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then + If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 277, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 278, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True End If Else @@ -1889,6 +1975,7 @@ Namespace Modelos ObjFactura.SeGuardoPrePoliza = True End If + Case 12 'Nota de Credito If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then importeMovimiento = (ObjFactura.Total * ValorMultiplicador) @@ -2287,7 +2374,7 @@ Namespace Modelos importeMovimiento = 0 Case 4 'Venta Clasificacion - If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev") Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev", "RNC") Then Dim ConceptoContableAplicar = 4 Dim CveVentaAplicar = ObjFactura.CveVenta @@ -2442,7 +2529,7 @@ Namespace Modelos importeMovimiento = 0 Case 103 'Descuento - If Not ObjFactura.TipoDocto.Contiene("Rem") AndAlso ObjFactura.CveTipoAmortizacionAnticipo = -1 Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoAmortizacionAnticipo = -1 Then importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador) importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador @@ -2480,7 +2567,7 @@ Namespace Modelos End If Case 8 'Ret IVA por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.RetIVA * ValorMultiplicador) importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago @@ -2511,7 +2598,7 @@ Namespace Modelos End If Case 9 'Ret ISR por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.RetISR * ValorMultiplicador) importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago @@ -2541,7 +2628,7 @@ Namespace Modelos End If End If Case 13 'Iva por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.IVA * ValorMultiplicador) importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) FechaMovimiento = ObjFactura.FechaPago @@ -2554,7 +2641,7 @@ Namespace Modelos Case 38 'IEPS por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then + If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.IEPS * ValorMultiplicador) importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) FechaMovimiento = ObjFactura.Fecha @@ -2569,104 +2656,102 @@ Namespace Modelos End If - Case 30 'PAGO - BANCOS - If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then - - For Each DrPago As DataRow In DtPagos.Rows - CveIEPago = -1 - - FolioIE = -1 - FolioIE = ObjBancos.GetNextFolio(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero) - If Not FolioIE > 0 Then - ErrorPrepoliza = True - Exit For - End If - - CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", ObjFactura.Folio), DrPago("Importe").ToString.ToDouble, ObjFactura.CveMoneda, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte) - - If CveIEPago > 0 Then - - importeMovimiento = (DrPago("Importe").ToString.ToDecimal * ValorMultiplicador) - importeMX = importeMovimiento * tipoCambio * Multiplicador - IdCtaContable = 0 - CveCuenta = 0 - CveSubProyectoContabilizar = CveSubProyectoVenta - Dim PorcentajeImpuestoPago As Decimal = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal - - - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows.Count = 1 Then - IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContable").ToString.ToEntero - CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero - End If - - If IdCtaContable <= 0 Then - CuentasContablesInvalidas.AppendFormat("
{0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero) - idCuentaContabilizacion = 0 - End If - - If CveCuenta <= 0 Then - CuentasContablesInvalidasSIG.AppendFormat("
{0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero) - CveCuentaContabilizacion = 0 - End If - - 'BANCOS - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then - ErrorPrepoliza = True - Exit For - End If - - 'CLIENTES - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then - ErrorPrepoliza = True - Exit For - End If - - 'IVA X TRASLADAR - Dim IdCtaContableIVAXTrasladar As Integer = 0 - IdCtaContableIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaContableIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then - ErrorPrepoliza = True - Exit For - End If - - 'IVA PAGADO - Dim IdCtaContableIVATrasladado As Integer = 0 - IdCtaContableIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaContableIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIVATrasladado, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then - ErrorPrepoliza = True - Exit For - End If - - 'IEPS X TRASLADAR - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar) Then - ErrorPrepoliza = True - Exit For - End If - - 'IEPS PAGADO - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSTrasladado, CveSubProyecto:=CveSubProyectoContabilizar) Then - ErrorPrepoliza = True - Exit For - End If - - - Else - ErrorPrepoliza = True - Exit For - End If - - Next - - importeMovimiento = 0 + Case 30 'PAGO - BANCOS + If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then + + For Each DrPago As DataRow In DtPagos.Rows + CveIEPago = -1 + + FolioIE = -1 + FolioIE = ObjBancos.GetNextFolio(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero) + If Not FolioIE > 0 Then + ErrorPrepoliza = True + Exit For + End If + + CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", ObjFactura.Folio), DrPago("Importe").ToString.ToDouble, ObjFactura.CveMoneda, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte) + + If CveIEPago > 0 Then + + importeMovimiento = DrPago("Importe").ToString.ToDecimal * ValorMultiplicador + importeMX = importeMovimiento * tipoCambio * Multiplicador + IdCtaContable = 0 + CveCuenta = 0 + CveSubProyectoContabilizar = CveSubProyectoVenta + Dim PorcentajeImpuestoPago As Decimal = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal + + + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows.Count = 1 Then + IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + + If IdCtaContable <= 0 Then + CuentasContablesInvalidas.AppendFormat("
{0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero) + idCuentaContabilizacion = 0 + End If + + If CveCuenta <= 0 Then + CuentasContablesInvalidasSIG.AppendFormat("
{0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero) + CveCuentaContabilizacion = 0 + End If + + 'BANCOS + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then + ErrorPrepoliza = True + Exit For + End If + + 'CLIENTES + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then + ErrorPrepoliza = True + Exit For + End If + + 'IVA X TRASLADAR + IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) + CveCuentaIVAxTrasladar = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar) + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVAxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then + ErrorPrepoliza = True + Exit For + End If + + 'IVA PAGADO + IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) + CveCuentaIVATrasladado = If(CveCuentaIVATrasladado > 0, CveCuentaIVATrasladado, UsuarioActual.Empresa.CveCuentaIVATrasladado) + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVATrasladado, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then + ErrorPrepoliza = True + Exit For + End If + + 'IEPS X TRASLADAR + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar) Then + ErrorPrepoliza = True + Exit For + End If + + 'IEPS PAGADO + Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSTrasladado, CveSubProyecto:=CveSubProyectoContabilizar) Then + ErrorPrepoliza = True + Exit For + End If + + Else + ErrorPrepoliza = True + Exit For + End If + + Next + + importeMovimiento = 0 End If - End Select If importeMovimiento <> 0 And Not ErrorPrepoliza Then @@ -2697,44 +2782,60 @@ Namespace Modelos End If - 'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora - If RemisionesLista.Count > 0 Then - For Each CveRemision As Integer In RemisionesLista - If Not ObjConta.TraspasarSaldosRemision(CveRemision, ObjFactura.CvePrePoliza, ObjFactura.CveVenta) Then - ErrorPrepoliza = True - End If - - 'Factura - If Not ObjEventos.AddEventoBitacora($"Sustituye a: Folio Factura", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then - ErrorPrepoliza = True - End If - - 'Remision - If Not ObjEventos.AddEventoBitacora($"Refacturacion en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then - ErrorPrepoliza = True - End If - - If ErrorPrepoliza Then - Exit For - End If - Next + If DtRemisionesRelacionadas Is Nothing Then + If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + DtRemisionesRelacionadas = ObjVentas.DtResultados.Copy() + End If End If - 'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO - If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 Then ' se debe de excluir cuando es refacturación - If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - For Each Dr As DataRow In ObjVentas.DtResultados.Rows - If Not ObjConta.TraspasarSaldosRemision(Dr("CveVenta").ToString.ToEntero, ObjFactura.CvePrePoliza, ObjFactura.CveVenta, 1) Then - ErrorPrepoliza = True - End If - - 'Remision - If Not ObjEventos.AddEventoBitacora($"Facturación cancelada en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Dr("CveVenta").ToString.ToEntero) Then - ErrorPrepoliza = True - End If - - Next + 'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora + If (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then + + If ObjFactura.RemisionesLista.Count = 0 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) Then + For Each Row As DataRow In DtRemisionesRelacionadas.Rows + ObjFactura.RemisionesLista.Add(Row("CveVenta").ToString().ToEntero()) + Next + End If + + If ObjFactura.RemisionesLista.Count > 0 Then + For Each CveRemision As Integer In RemisionesLista + If Not ObjConta.TraspasarSaldosRemision(CveRemision, ObjFactura.CvePrePoliza, ObjFactura.CveVenta) Then + ErrorPrepoliza = True + End If + + 'Factura + If Not ObjEventos.AddEventoBitacora($"Sustituye a: Folio Factura", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then + ErrorPrepoliza = True + End If + + 'Remision + If Not ObjEventos.AddEventoBitacora($"Refacturacion en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then + ErrorPrepoliza = True + End If + + If ErrorPrepoliza Then + Exit For + End If + Next + End If + + 'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO + If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso Then ' se debe de excluir cuando es refacturación + For Each Dr As DataRow In DtRemisionesRelacionadas.Rows + + Dim DebeCancelar As Boolean = CancelarRemisiones AndAlso ListaRemisionesCancelar.Any(Function(CveRemision) CveRemision = Dr("CveVenta").ToString.ToEntero()) + + If Not DebeCancelar Then + If Not ObjConta.TraspasarSaldosRemision(Dr("CveVenta").ToString.ToEntero, ObjFactura.CvePrePoliza, ObjFactura.CveVenta, 1) Then + ErrorPrepoliza = True + End If + If Not ObjEventos.AddEventoBitacora($"Facturación cancelada en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Dr("CveVenta").ToString.ToEntero) Then + ErrorPrepoliza = True + End If + End If + Next End If + End If @@ -3231,7 +3332,7 @@ Namespace Modelos If factura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() - Dim IDPoliza As Integer = -1 ' GenerarPolizaAC(ObjAC, Me) + Dim IDPoliza As Integer = GenerarPolizaAC(factura, ObjAC) If IDPoliza > 0 Then @@ -3253,7 +3354,7 @@ Namespace Modelos Private Function GuardarVentaImpuestosLocales(factura As Modelos.Factura, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, Optional ValorMultiplicador As Integer = 1) As Boolean Dim ErrorPrepoliza As Boolean = False - If DtImpuestosLocales IsNot Nothing AndAlso factura.CvePrePoliza > 0 AndAlso Not factura.TipoDocto.Contiene("Cot", "Rem") Then + If factura.DtImpuestosLocales IsNot Nothing AndAlso factura.CvePrePoliza > 0 AndAlso Not factura.TipoDocto.Contiene("Cot", "Rem") Then Dim Importe As Decimal Dim IdCtaContable, CveCuenta As Integer @@ -3261,7 +3362,7 @@ Namespace Modelos Dim tipoCambio As Decimal Dim CveSubProyectoContabilizar As Integer = factura.CveSubProyecto - For Each RowIL As DataRow In DtImpuestosLocales.Rows + For Each RowIL As DataRow In factura.DtImpuestosLocales.Rows If RowIL("TipoImpuesto").ToString.ToEntero > 0 Then Importe = RowIL("Importe").ToString.ToDecimal * ValorMultiplicador @@ -3417,321 +3518,977 @@ Namespace Modelos End If End Function - Private Function DecodeBase64(ByVal strXMLCodificado As String) As String + Private Shared Function DecodeBase64(ByVal strXMLCodificado As String) As String Try Dim decbuff As Byte() = Convert.FromBase64String(strXMLCodificado) Return System.Text.Encoding.UTF8.GetString(decbuff) Catch Return "" End Try - End Function - Public Function CancelarDocumento() As MMensajeFactura - Dim Retorno As New MMensajeFactura() - Retorno.CveVenta = CveVenta - Retorno.CveEstatus = Me.CveEstatus - Retorno.TieneError = False - - - If CveVenta <= 0 Then - Retorno.Mensajes.Add("Se debe asingar una CveVenta") - Retorno.TieneError = True - Return Retorno - End If - - 'CARGA REMISIONES DE LA VENTA DEVUELTA - Dim DtDevRem As New DataTable - Dim ObjInventarioTemporal As New ClsInventarios() - If ObjInventarioTemporal.GetDevolucionRemisionesCanceladas(CveVenta) Then - DtDevRem = ObjInventarioTemporal.DtResultados.FiltraParametros("CantidadSurtida > 0") - Else - Retorno.Mensajes.Add("Ocurrió un error al verificar los movimientos de almacén relacionados al documento.") - ObjInventarioTemporal.Dispose() - Retorno.TieneError = True - Return Retorno - End If - ObjInventarioTemporal.Dispose() - - If (DtInventario IsNot Nothing AndAlso DtInventario.Rows.Count > 0 AndAlso EsDevolucionVenta.Contiene(0, 1)) Then ' [COMENTADO IPP 3 Agosto 2017] | AndAlso Not (DdlTipoComprobante.SelectedValue.Contiene("Rem", "DPe")) | REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN - Retorno.Mensajes.Add("La factura no se puede cancelar debido a que tiene movimientos de inventario.") - Retorno.TieneError = True - Return Retorno - End If - - Dim CancelacionFecha As Date - Dim CancelacionAcuse As String = "" - Dim MensajeError As String = "" - Dim ObjCancelacion As New Timbrado - Dim TotalT As Decimal = Total - Dim RFCReceptor As String = Me.Cliente.RFC - Dim CvePACCancelacion As Integer = Me.UsuarioActual.Empresa.CvePAC - Dim CveEstatus As Integer = 4 - Dim IDPoliza As Integer = -1 - Dim CvePrePoliza As Integer - Dim CvePlantillaPoliza As Integer - Dim ErrorCancelar As Boolean = False - - Dim Continuar As Boolean = False - Dim ContinuarCancelacion As Boolean = False - Dim ObtenerAcuse As Boolean = False - Dim RequiereAceptacion As Boolean = False - Try - If FolioFiscal <> "" Then - If Me.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then - - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion) - If Vigencia IsNot Nothing Then - If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then - Retorno.Mensajes.Add("Esta factura no es cancelable.") - Retorno.TieneError = True - Return Retorno - End If - If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then - ContinuarCancelacion = False - ObtenerAcuse = True - Dim solicitud = New WSGF.Service1SoapClient() - Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal) - - If acuse.Estado = 0 Then - Dim xmlAcuse = New System.Xml.XmlDocument() - xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64)) - CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText - CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate() - CveEstatus = 5 - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - CveEstatus = 4 - End If - ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then - - If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then - CveEstatus = 20 - ContinuarCancelacion = False - ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then - CveEstatus = 20 - ContinuarCancelacion = True - RequiereAceptacion = True - ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then - ContinuarCancelacion = True - End If - - Else - If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then - ContinuarCancelacion = True - Else - Retorno.Mensajes.Add("La factura no se puede cancelar debido a que no se encontro su estatus en el SAT.") - Retorno.TieneError = True - Return Retorno - End If - End If - Else - Alert("No se pudo comprobar la vigencia de la factura.", TipoMensaje.MsgAdvertencia) - End If - - If Not ObtenerAcuse Then - If ContinuarCancelacion Then - If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then - 'Generamos el acuse y mandamos mail de con el acuse de cancelación - DF 13/01/2017 - If RequiereAceptacion Then - CancelacionFecha = Now.Date - CancelacionAcuse = "" - CveEstatus = 20 - Else - CancelacionFecha = ObjCancelacion.CancelacionFecha - CancelacionAcuse = ObjCancelacion.CancelacionAcuse - CveEstatus = 5 - End If - Else - Retorno.Mensajes.Add("La factura no se pudo cancelar ante el SAT") - Retorno.TieneError = True - Return Retorno - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - Catch ex As Exception - MensajeError = "Ocurrió un Error al Cancelar la factura con los servicios del SAT." - GuardaLog($"{MensajeError} - Error:{ex.Message}") - Alert(MensajeError, TipoMensaje.MsgError) - Retorno.TieneError = True - End Try - - Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL() - Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) - Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) - Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL()) - Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL()) - Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL()) - Dim ObjAC As ClsContPAQi = Nothing - - If UsuarioActual.Empresa.UsaAC Then - ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() - End If - - Try - If Me.TipoDocto.Contiene("Egs", "Dev") Then - CvePlantillaPoliza = 7 - ElseIf Me.TipoDocto.Contiene("Ing", "Rem", "Ant") Then - CvePlantillaPoliza = 4 - Else - CvePlantillaPoliza = 4 - End If - - If (Me.Saldo > 0 AndAlso CveEstatus.Contiene(4, 5)) OrElse CvePlantillaPoliza = 7 Then - 'RMF. 2018.08.08 cuando se cancela, la póliza debe de ser de diario - CvePrePoliza = ObjConta.AddPrePolizas("Ventas/CancelarDocumento", CvePlantillaPoliza, Me.Total, Me.Total, Me.CveMoneda, Now, Me.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) - Me.CvePrePoliza = CvePrePoliza - - 'CANCELAR PAGOS - If Me.TipoDocto.Contiene("Egs", "Dev") Then - If Not ErrorCancelar Then - If Not ObjConta.PrePolizasCancelarPagos(CveDevolucion, CvePrePoliza) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al generar la prepoliza de cancelación de pago." - End If - End If - End If - - 'CANCELA PREPOLIZA - If Not ErrorCancelar Then - ErrorCancelar = ProcesoPrepolizas(Me, ObjConta, -1, DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos) - MensajeError = "Ocurrió un error al generar la prepoliza de cancelación." - End If - - 'CANCELA IMPUESTOS LOCALES - If Not ErrorCancelar Then - ErrorCancelar = GuardarVentaImpuestosLocales(Me, ObjVentas, ObjConta, -1) - MensajeError = "Ocurrió un error al cancelar los impuestos locales." - End If - End If - - 'CANCELA CONTRATOS - If Not ErrorCancelar Then - ErrorList = New List(Of String) - If Me.CveContrato > 0 AndAlso Me.TipoDocto.Contiene("Ing", "Ant") Then - GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, -1, True) - ErrorCancelar = ErrorList.Count > 0 - MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato." - ElseIf Me.CveContrato > 0 AndAlso Me.TipoDocto.Contiene("Egs", "Dev") Then - GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, 1, True) - ErrorCancelar = ErrorList.Count > 0 - MensajeError = "Ocurrió un error al cancelar los avances del contrato." - End If - End If - - - 'DESVINCULA REMISIONES PREDECESORAS - If Not ErrorCancelar Then - If Me.TipoDocto.Contiene("Ing", "Ant") Then - If Not ObjVentas.LiberarRemisionesFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las remisiones." - End If - End If - End If - - 'DESVINCULA COTIZACIONES PREDECESORAS - If Not ErrorCancelar Then - If Me.TipoDocto.Contiene("Ing", "Ant", "Rem") Then - If Not ObjVentas.LiberarCotizacionesFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las cotizaciones." - End If - End If - End If - - 'DESVINCULA PEDIDOS2 PREDECESORES - If Not ErrorCancelar Then - If Me.TipoDocto.Contiene("Ing", "Ant", "Rem") Then - If Not ObjVentas.LiberarPedidos2Facturados(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular los pedidos." - End If - End If - End If - - 'DESVINCULA OCs PREDECESORAS - If Not ErrorCancelar Then - If Me.TipoDocto = "Ing" Then - If Not ObjVentas.LiberarOCFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las Ordenes de Compra." - End If - End If - End If - - 'ELIMINA LAS VENTAS DETALLE DE LA DEVOLUCION - If Not ErrorCancelar Then - If Me.TipoDocto = "Dev" Then - If Not ObjVentas.RemoveVentaDetalleDevolucion(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al eliminar las ventas detalle devolución." - End If - End If - End If - - 'POLIZA DE CANCELACION - If Not ErrorCancelar Then - 'If UsuarioActual.Empresa.UsaAC Then - ' IDPoliza = GenerarPolizaAC(ObjAC, True) - ' If IDPoliza <= 0 Then - ' ErrorCancelar = True - ' MensajeError = "Ocurrió un error al generar la poliza de cancelación." - ' End If - 'End If - End If - - 'ACTUALIZA ESTATUS - If Not ErrorCancelar Then - Select Case Me.TipoDocto - Case "Rem" - CveEstatus = 12 - Case "Com" - CveEstatus = 9 - End Select - - If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar el estatus de cancelación." - End If - End If - - If Not ErrorCancelar Then - ObjVentas.Commit() - If ObjAC IsNot Nothing Then ObjAC.Commit() - Me.CveEstatus = CveEstatus - Retorno.CveEstatus = CveEstatus - Retorno.Mensajes.Add("La factura se cancelo correctamente") - Else - Retorno.Mensajes.Add(MensajeError) - ObjVentas.RollBack() - If ObjAC IsNot Nothing Then ObjAC.RollBack() - End If - Catch ex As Exception - GuardaLog(ex.ToString()) - ObjVentas.RollBack() - If ObjAC IsNot Nothing Then ObjAC.RollBack() - Finally - - ObjVentas.Dispose() - ObjBancos.Dispose() - ObjInventario.Dispose() - ObjContrato.Dispose() - ObjConta.Dispose() - If ObjAC IsNot Nothing Then ObjAC.Dispose() - Retorno.TieneError = ErrorCancelar - End Try - Return Retorno + End Function + Public Class MCancelacionVentaMensaje + Public Property HuboError As Boolean = False + Public Property TipoMensaje As TipoMensaje + Public Property Mensaje As String + Public Property CveEstatus As Integer + End Class + ''' + ''' Ejecuta los procesos pendientes para concluir la cancelacion de la factura + ''' + ''' + ''' + ''' + ''' + Public Function EjecutarCancelacionPendiente(CveEstatus As Integer, FechaCancelacion As DateTime, AcuseCancelacion As String) As MCancelacionVentaMensaje + Dim ListaRemisionesCancelar As New List(Of Integer) + Dim ObjVentas As New ClsVentas() + If ObjVentas.GetRemisionesXCancelar(Me.CveVenta) Then + For Each Row As DataRow In ObjVentas.DtResultados.Rows + ListaRemisionesCancelar.Add(Row("CveVentaRemision").ToString().ToEntero()) + Next + End If + ObjVentas.Dispose() + + + Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=Me.RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusFacturaAsignado:=CveEstatus, FechaCancelacion:=FechaCancelacion.ToString("dd/MM/yyyy hh:mm:ss"), AcuseCancelacion:=AcuseCancelacion) + End Function + ''' + ''' Cancela la factura para poder realizar la refacturacion + ''' + ''' + Public Function CancelarPorRefacturacion() As MCancelacionVentaMensaje + Return CancelarVenta(Me, Me.UsuarioActual, EsRefacturacion:=True) + End Function + ''' + ''' Cancela la factura y realiza las operaciones correspondientes + ''' + ''' + ''' + ''' + Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing) As MCancelacionVentaMensaje + Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar) + End Function + + Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False, + Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, + Optional FechaCancelacion As String = "-1", Optional AcuseCancelacion As String = "") As MCancelacionVentaMensaje + Dim Retorno As New MCancelacionVentaMensaje() + Dim ErrorList As New List(Of String) + + Dim CveVenta As Integer = ObjFactura.CveVenta + + Dim EsRemisionFacturada As Boolean = False + Dim TieneRemisionesRelacionadas As Boolean = False + Dim CancelarRemisiones As Boolean = ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 + + Dim TieneAlmacen As Boolean = False + + 'VALIDA QUE LA FACTURA NO TENGA PAGOS + If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then + Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + Dim ObjInv As New ClsInventarios + If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then + TieneAlmacen = ObjInv.DtResultados.Rows.Count > 0 + End If + ObjInv.Dispose() + + 'CARGA AS NOTAS DE CREDITO VINCULADAS + Dim DTDocumentosRelacionados As New DataTable + If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") Then + Dim ObjVentasAntNC As New ClsVentas + If ObjVentasAntNC.GetVentasAntNC(ObjFactura.CveVenta, -1) Then + DTDocumentosRelacionados = ObjVentasAntNC.DtResultados.Copy() + End If + ObjVentasAntNC.Dispose() + End If + + 'LA VALIDACION DE SALDOS CUANDO ES REFACTURACION SE HACE ANTES ASI QUE SI ES REFACTURACION IGNORAMOS ESTA CONDICION, SI ES ANTICIPO VERIFICA QUE NO ESTÉ APLICADO + If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.Pagado > 0 AndAlso DTDocumentosRelacionados.Rows.Count > 0 Then + Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + 'SI LA REMISION ESTA FACTURADA NO SE PUEDE CANCELAR + If ObjFactura.TipoDocto = "Rem" Then + Dim ObjV As New ClsVentas + If ObjV.VerificarRemisionFacturada(ObjFactura.CveVenta) Then + EsRemisionFacturada = ObjV.DtResultados.Rows.Count > 0 + End If + ObjV.Dispose() + + If EsRemisionFacturada Then + Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + End If + + 'CARGA REMISIONES DE LA VENTA DEVUELTA + Dim DtDevRem As New DataTable + If Not EsRefacturacion Then + Dim ObjInventarioTemporal As New ClsInventarios() + If ObjInventarioTemporal.GetDevolucionRemisionesCanceladas(ObjFactura.CveVenta) Then + DtDevRem = ObjInventarioTemporal.DtResultados + Else + ObjInventarioTemporal.Dispose() + + Retorno.Mensaje = "Ocurrió un error al verificar los movimientos de almacén relacionados al documento." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + ObjInventarioTemporal.Dispose() + End If + + 'CARGA REMISIONES + Dim DtRemisionesRelacionadas As New DataTable() + Dim ObjVentasRem As New ClsVentas + If ObjVentasRem.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) Then + DtRemisionesRelacionadas = ObjVentasRem.DtResultados.Copy() + TieneRemisionesRelacionadas = DtRemisionesRelacionadas.Rows.Count > 0 + End If + ObjVentasRem.Dispose() + + 'SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA + If ObjFactura.TipoDocto.Contiene("Rem") And DtRemisionesRelacionadas.Rows.Count > 0 Then + Retorno.Mensaje = "La remision no debe tener ninguna factura relacionada para poder cancelarla." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + 'CUANDO SE CANCELA, Y TIENE RELACIONADA UNA REMISIÓN, Y ESTA NO SE CANCELARÁ. DEBE DE HACER EN AUTOMÁTICO LOS MOVIMIENTOS AL ALMACEN DE ENTREGA POR ADELANTADO + Dim RevivirRemisiones = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count)) + + 'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN + If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen > 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then + + Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene movimientos de inventario." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + + Dim CancelacionFecha As Date + Dim FolioFiscal As String = ObjFactura.FolioFiscal + Dim CancelacionAcuse As String = "" + Dim MensajeError As String = "" + Dim ObjCancelacion As New Timbrado + Dim TotalT As Decimal = ObjFactura.Total + Dim RFCReceptor As String = ObjFactura.Cliente.RFC + Dim CvePACCancelacion As Integer = ObjFactura.CvePAC + Dim CveEstatus As Integer = 4 + Dim IDPoliza As Integer = -1 + Dim CvePrePoliza As Integer + Dim CvePlantillaPoliza As Integer + Dim ErrorCancelar As Boolean = False + + Dim Continuar As Boolean = False + Dim ContinuarCancelacion As Boolean = False + Dim ObtenerAcuse As Boolean = False + Dim RequiereAceptacion As Boolean = False + Dim Mensaje As String = "" + + If CveEstatusFacturaAsignado <= 0 Then + Try + If ObjFactura.FolioFiscal <> "" Then + If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then + + Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion) + + If Vigencia IsNot Nothing Then + If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then + Retorno.Mensaje = "Esta factura no es cancelable." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then + ContinuarCancelacion = False + ObtenerAcuse = True + Dim solicitud = New WSGF.Service1SoapClient() + Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal) + + If acuse.Estado = 0 Then + Dim xmlAcuse = New System.Xml.XmlDocument() + xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64)) + CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText + CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate() + CveEstatus = 5 + Else + CancelacionFecha = Now.Date + CancelacionAcuse = "" + CveEstatus = 5 + End If + + ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then + + If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then + CveEstatus = 20 + ContinuarCancelacion = False + ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then + CveEstatus = 20 + ContinuarCancelacion = True + RequiereAceptacion = True + ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then + ContinuarCancelacion = True + CveEstatus = 5 + End If + + Else + If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then + ContinuarCancelacion = True + CveEstatus = 5 + Else + CveEstatus = 20 + ContinuarCancelacion = False + CancelacionFecha = Now.Date + CancelacionAcuse = "" + End If + End If + Else + Retorno.Mensaje = "No se pudo comprobar la vigencia de la factura." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + + If Not ObtenerAcuse Then + If ContinuarCancelacion Then + If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then + 'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN + If RequiereAceptacion Then + CancelacionFecha = Now.Date + CancelacionAcuse = "" + CveEstatus = 20 + + Else + CancelacionFecha = ObjCancelacion.CancelacionFecha + CancelacionAcuse = ObjCancelacion.CancelacionAcuse + CveEstatus = 5 + End If + Else + Retorno.Mensaje = "La factura no se pudo cancelar ante el SAT." + Retorno.TipoMensaje = TipoMensaje.MsgError + + Return Retorno + End If + Else + CancelacionFecha = Now.Date + CancelacionAcuse = "" + End If + End If + Else + CancelacionFecha = Now.Date + CancelacionAcuse = "" + End If + Else + CancelacionFecha = Now.Date + CancelacionAcuse = "" + End If + Catch ex As Exception + MensajeError = "Ocurrió un Error al Cancelar la factura con los servicios del SAT." + ModExtensiones.GuardaLog($"{MensajeError} - Error:{ex.Message}") + + Retorno.Mensaje = MensajeError + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + Retorno.HuboError = True + + Return Retorno + End Try + Else + CveEstatus = CveEstatusFacturaAsignado + CancelacionFecha = FechaCancelacion.ToDateTime() + CancelacionAcuse = AcuseCancelacion + End If + + 'SI ES CANCELACION EN PROCESO CANCELA EL PROCESO DE LAS REMISIONES + Dim SeCancelaRemisionProceso = (CveEstatus = 20 AndAlso TieneRemisionesRelacionadas AndAlso CancelarRemisiones) + + Retorno.CveEstatus = CveEstatus + + Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL() + Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) + Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) + Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL()) + Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL()) + Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL()) + Dim ObjAC As ClsContPAQi = Nothing + If UsuarioActual.Empresa.UsaAC Then + ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() + End If + + + Try + If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then + CvePlantillaPoliza = 7 + ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then + CvePlantillaPoliza = 4 + Else + CvePlantillaPoliza = 4 + End If + + 'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO + If (((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse CvePlantillaPoliza = 7 Then + + 'CUANDO SE CANCELA, LA PÓLIZA DEBE DE SER DE DIARIO + CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) + ObjFactura.CvePrePoliza = CvePrePoliza + + 'CANCELAR PAGOS + If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then + If Not ErrorCancelar Then + If Not ObjConta.PrePolizasCancelarPagos(ObjFactura.CveDevolucion, CvePrePoliza) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al generar la prepoliza de cancelación de pago." + End If + End If + End If + + 'CANCELA PREPOLIZA + If Not ErrorCancelar Then + ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, + SeCancelaRemisionProceso:=SeCancelaRemisionProceso, CancelarRemisiones:=CancelarRemisiones, ListaRemisionesCancelar:=ListaRemisionesCancelar) + MensajeError = "Ocurrió un error al generar la prepoliza de cancelación." + End If + + 'CANCELA IMPUESTOS LOCALES + If Not ErrorCancelar Then + ErrorCancelar = GuardarVentaImpuestosLocales(ObjFactura, ObjVentas, ObjConta, -1) + MensajeError = "Ocurrió un error al cancelar los impuestos locales." + End If + + End If + + 'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO + If Not EsRefacturacion AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20) Then + + 'DEVOLUCION DE ALMACEN + If Not ErrorCancelar AndAlso TieneAlmacen Then + Dim TieneSalida As Boolean = False + Dim DtDatos As New DataTable + Dim DtExistencias As New DataTable + + 'CUANDO SE VAYA A REALIZAR LA DEVOLUCION AQUI DEBE MARCALA PARA NO SOLICITARLA DE NUEVO, SI NO LA SOLICITARA + If ObjFactura.EsDevolucionVenta = 0 Then + Dim EstatusDevolucion = 1 + If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al solicitar la devolucion de almacen." + End If + End If + + If Not ErrorCancelar AndAlso ObjInventario.EntregaAlmacenGet(CveVenta) Then + If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + DtDatos = ObjInventario.DtResultados + DtDatos.Columns.Add("Consec", GetType(Integer)) + DtDatos.Columns.Add("CantidadGV", GetType(Double)) + DtDatos.Columns.Add("CantidadTraspaso", GetType(Double)) + Dim Index = 1 + For Each Dr As DataRow In DtDatos.Rows + Dr("Consec") = Index + Dr("CantidadGV") = Dr("CantidadF") + Index += 1 + Next + + If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 AndAlso ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString.ToEntero > 0 Then + Dim Filtro As String + Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString + Case "Ing", "Ped" + Filtro = "CveConcepto = 3" + Case "Dev" + Filtro = "CveConcepto = 3" + Case Else + Filtro = "CveConcepto = 9" + End Select + + If ObjInventario.GetInv_Mov(ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}") + + If DtExistencias.Rows.Count > 0 Then + TieneSalida = True + End If + + Else + ErrorCancelar = True + MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." + End If + End If + + End If + End If + + If Not ErrorCancelar AndAlso TieneSalida Then + + + Dim DtTraspasos As New DataTable + DtTraspasos.Columns.Add("CveAlmacen", GetType(Integer)) + DtTraspasos.Columns.Add("Almacen", GetType(String)) + DtTraspasos.Columns.Add("CveMovimientoSalida", GetType(Integer)) + DtTraspasos.Columns.Add("FolioSalida", GetType(Integer)) + DtTraspasos.Columns.Add("CveMovimientoEntrada", GetType(Integer)) + DtTraspasos.Columns.Add("FolioEntrada", GetType(Integer)) + + Dim ConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE + Dim CveMovimiento As Integer = 0 + Dim Folio As Integer = 0 + Dim CantidadPendiente As Decimal = 0 + + If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then + Dim CveAlmacenDevolucion = ObjFactura.CveAlmacenDevolucion + + CveMovimiento = ObjInventario.AddMovimiento(CveAlmacenDevolucion, ConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1) + Folio = ObjInventario.Folio + + 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) + If CveMovimiento > 0 Then + + 'ES EL MOVIMIENTO PRINCIPAL + CantidadPendiente = 0 + For Each Dr As DataRow In DtDatos.Rows + CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal + If CantidadPendiente > 0 Then + Dim PU As Decimal = 0 + + If DtExistencias IsNot Nothing Then + PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." + Exit For + End If + + End If + Next + Else + MensajeError = "Ocurrió un error al agregar el movimiento" + ErrorCancelar = True + End If + + 'GENERA PREPOLIZA DEL MOVIMIENTO DE DEVOLUCION + If Not ErrorCancelar Then + Dim DtCostos As DataTable = Nothing + Dim ValorInventario As Decimal = 0 + If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + DtCostos = ObjInventario.DtResultados + + Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) + Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero + Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero + Dim IdCtaContable As Integer = 0 + Dim CveCuenta As Integer = 0 + If tmpCostos.Rows.Count > 0 Then + + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then + Dim Fecha As Date = Now + Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero + Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString + Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString + Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL() + Dim TotalCostoAcumulado As Decimal = 0 + Dim cont As Integer = 1 + + Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + 'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER) + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() + TotalCostoAcumulado += ValorInventario + + 'CUANDO ES EL ÚLTIMO MOVIMIENTO Y HAY DIFERENCIAS EN LOS IMPORTES + If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then + ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) + End If + + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + + If Not ErrorCancelar Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, -1 * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then + ErrorCancelar = True + End If + End If + + cont += 1 + Next + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto, CveCuenta:=CveCuentaAlmacen) Then + ErrorCancelar = True + End If + + 'AUTOCONTA - EL MOVIMIENTO 1 ES EL DE VENTA + + Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" + + If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto = "Ant" Then + AutoConta = False + End If + + If AutoConta And Not ErrorCancelar Then + Dim ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) + + If IdCtaContable > 0 Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al contabilizar la prepoliza." + End If + Else + Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia) + End If + + ObjContPaq.Dispose() + End If + + Else + ErrorCancelar = True + MensajeError = "Ocurrió un Error al ingresar las prepolizas" + End If + + End If + End If + End If + + 'If Not ErrorCancelar AndAlso RevivirRemisiones Then + ' If Not GeneraMovimientosApartados(ObjInventario, DtTraspasos) Then + ' ErrorCancelar = True + ' MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados" + ' End If + 'End If + + 'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION + If Not ErrorCancelar AndAlso RevivirRemisiones Then + If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión" + End If + End If + + If Not ErrorCancelar Then + 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) + If CveMovimiento > 0 AndAlso RealizarDevolucionAlmacen Then + If Not ErrorCancelar Then + If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then + MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." + ErrorCancelar = True + End If + End If + + 'AGREGA BITACORA A VENTA + If Not ErrorCancelar Then + Dim MensajeBitacora = "Devuelta" + If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then + ErrorCancelar = True + End If + End If + End If + End If + + End If + End If + End If + + 'CANCELA CONTRATOS + If Not ErrorCancelar Then + If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then + ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, -1, True) + ErrorCancelar = ErrorList.Count > 0 + MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato." + ElseIf ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then + ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, 1, True) + ErrorCancelar = ErrorList.Count > 0 + MensajeError = "Ocurrió un error al cancelar los avances del contrato." + End If + End If + + 'DESVINCULA COTIZACIONES FACTURADAS + If Not ErrorCancelar Then + If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") Then + If Not ObjVentas.LiberarCotizacionesFacturadas(CveVenta) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al desvincular las cotizaciones." + End If + End If + End If + + 'DESVINCULA PEDIDOS2 PREDECESORES + If Not ErrorCancelar Then + If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") Then + If Not ObjVentas.LiberarPedidos2Facturados(CveVenta) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al desvincular los pedidos." + End If + End If + End If + + 'DESVINCULA OCs PREDECESORAS + If Not ErrorCancelar Then + If ObjFactura.TipoDocto = "Ing" Then + If Not ObjVentas.LiberarOCFacturadas(CveVenta) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al desvincular las Ordenes de Compra." + End If + End If + End If + + 'ELIMINA LAS VENTAS DETALLE DE LA DEVOLUCION + If Not ErrorCancelar Then + If ObjFactura.TipoDocto = "Dev" Then + If Not ObjVentas.RemoveVentaDetalleDevolucion(CveVenta) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al eliminar las ventas detalle devolución." + End If + End If + End If + + 'POLIZA DE CANCELACION + If Not ErrorCancelar Then + If UsuarioActual.Empresa.UsaAC Then + IDPoliza = GenerarPolizaAC(ObjFactura, ObjAC, True) + If IDPoliza <= 0 Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al generar la poliza de cancelación." + End If + End If + End If + + 'DESVINCULA REMISIONES PREDECESORAS + If Not ErrorCancelar Then + If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso RevivirRemisiones Then + For Each Row As DataRow In DtRemisionesRelacionadas.Rows + Dim PuedeLiberar As Boolean = (ListaRemisionesCancelar Is Nothing) OrElse (Not ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = Row("CveVenta").ToString().ToEntero())) + If PuedeLiberar Then + If Not ObjVentas.LiberarRemisionesFacturadas(CveVenta, Row("CveVenta").ToString().ToEntero()) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al desvincular las remisiones." + End If + End If + Next + End If + End If + + Else + 'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE + If Not ErrorCancelar Then + If RealizarDevolucionAlmacen AndAlso CveAlmacenDevolucion > 0 Then + If Not ObjVentas.UpdateVentaRealizarDevolucion(CveVenta, RealizarDevolucionAlmacen, CveAlmacenDevolucion) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al marcar la venta para devolución" + End If + End If + End If + + End If + + Dim CveEstatusRefacturacion As Integer = 0 + 'ACTUALIZA ESTATUS + If Not ErrorCancelar Then + Select Case ObjFactura.TipoDocto + Case "Rem" + CveEstatus = 12 + Case "Com" + CveEstatus = 9 + End Select + '0 Sin Refacturacion, 1 Refacturacion en Proceso, 3. Refacturación en proceso sin aceptación + If EsRefacturacion Then + If CveEstatus = 5 Then + CveEstatusRefacturacion = 3 ' refacturación en proceso sin autorización de cancelación + Else + CveEstatusRefacturacion = 1 ' refacturación en proceso con autorización de cancelación + End If + End If + + + If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, + CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al guardar el estatus de cancelación." + End If + + If CancelarRemisiones Then + If SeCancelaRemisionProceso Then + For Each CveRemisionCancelar In ListaRemisionesCancelar + If Not ObjVentas.AddRemisionesXCancelar(CveVenta, CveRemisionCancelar) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al guardar la remisión x cancelar." + End If + Next + + If Not ObjVentas.UpdateCancelaRemision(CveVenta, SeCancelaRemisionProceso) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al actualizar que la remision sea cancelable." + End If + + Else + + For Each CveRemisionCancelar In ListaRemisionesCancelar + If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, CveRemisionCancelar) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al guardar el estatus de cancelación de la remisión." + End If + Next + + End If + End If + + End If + + Catch ex As Exception + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar el documento" + OnError("Ocurrió un error al cancelar el documento", ex) + Finally + If Not ErrorCancelar Then + ObjVentas.Commit() + If ObjAC IsNot Nothing Then ObjAC.Commit() + + If CveEstatus = 5 Then + Dim MensajeAlert As New StringBuilder + MensajeAlert.Append("El Documento se canceló correctamente.") + MensajeAlert.Append($"
Imprimir Acuse") + MensajeAlert.Append("

¿Desea enviar el Acuse de Cancelación al Cliente?") + + Retorno.Mensaje = MensajeAlert.ToString + Retorno.HuboError = False + Retorno.TipoMensaje = TipoMensaje.MsgConfirmacion + + Else + If Not EsRefacturacion Then + Retorno.Mensaje = "El documento se canceló exitosamente" + Retorno.HuboError = False + Retorno.TipoMensaje = TipoMensaje.MsgInformacion + End If + End If + + Me.CveEstatus = CveEstatus + Else + ObjVentas.RollBack() + If ObjAC IsNot Nothing Then ObjAC.RollBack() + + Retorno.Mensaje = MensajeError + Retorno.HuboError = True + Retorno.TipoMensaje = TipoMensaje.MsgError + + End If + + Retorno.CveEstatus = CveEstatus + + ObjVentas.Dispose() + ObjBancos.Dispose() + ObjInventario.Dispose() + ObjContrato.Dispose() + ObjConta.Dispose() + If ObjAC IsNot Nothing Then ObjAC.Dispose() + End Try + + Return Retorno + End Function + Private Function GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento As Integer, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios, ByRef DtDevRem As DataTable, ByRef ListaRemisionesCancelar As List(Of Integer)) As Boolean + Dim ErrorCancelar As Boolean = False + + Dim DtMovtosDev As New DataTable + Dim CveAlmacenTraspasoDestinoDevRem = -1 + + Dim CveVentaDetalleRem = -1 + Dim CantidadDevolver As Decimal = 0 + Dim CantidadRem As Decimal = 0 + Dim CveMovimientoSalidaDevRem As Integer = 0 + Dim FolioMovimientoSalidaDevRem As Integer = 0 + Dim CveMovimientoEntradaDevRem As Integer = 0 + Dim FolioMovimientoEntradaDevRem As Integer = 0 + + 'CARGA REMISIONES DE LA VENTA DEVUELTA + If ObjInventario.GetDevolucionRemisionesFacturadas(CveVenta) Then + DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0") + Else + ErrorCancelar = True + End If + + 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA + If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + DtMovtosDev = ObjInventario.DtResultados + Else + ErrorCancelar = True + End If + + If Not ErrorCancelar Then + If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then + + For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows + + 'CHECO SI NO SE VA A CANCELAR + Dim SeCancela As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = DrMovtos("CveRem").ToString.ToEntero())) + + If Not SeCancela Then + + CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero + + If Not CveAlmacenTraspasoDestinoDevRem > 0 Then + ErrorCancelar = True + Exit For + End If + + 'SALIDA GENERAL + CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) + FolioMovimientoSalidaDevRem = ObjInventario.Folio + + 'ENTRADA ADELANTADO + CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion) + FolioMovimientoEntradaDevRem = ObjInventario.Folio + + If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then + ErrorCancelar = True + Exit For + End If + + 'SALIDA POR TRAPASO DE GENERAL + For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows + CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero + CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal + + If Not CveVentaDetalleRem > 0 Then + ErrorCancelar = True + Exit For + End If + + For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next + + If ErrorCancelar Then + Exit For + End If + Next + + If ErrorCancelar Then + Exit For + End If + + 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next + + If ErrorCancelar Then + Exit For + End If + + Else + ErrorCancelar = True + Exit For + End If + + + If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then + ErrorCancelar = True + Exit For + End If + + End If + + Next + End If + End If + + Return Not ErrorCancelar + End Function + + Private Function GeneraMovimientosApartados(ByRef ObjInventario As ClsInventarios, ByRef DtTraspasos As DataTable) As Boolean + Dim ErrorCancelar As Boolean = False + If Not ErrorCancelar Then + If ObjInventario.VentasAlmacenApartadosGet(CveVenta) Then + + Dim DtTempApartados = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 9", "CveAlmacen") + Dim CveMovimientoSalidaApartado = -1 + Dim CveAlmacenApartado = -1 + Dim CveAlmacenOrigen = CveAlmacenDevolucion + Dim FolioSalida As Integer = 0, FolioEntrada = 0, CveMovimientoSalida = 0, CveMovimientoEntradaApartado = 0 + + For Each Dr As DataRow In DtTempApartados.Rows + + If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then + CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveVendedor:=1, CveCliente:=CveCliente, CveAlmacenDestino:=Dr("CveAlmacen").ToString.ToEntero) + FolioSalida = ObjInventario.Folio + CveAlmacenApartado = Dr("CveAlmacen").ToString.ToEntero + + Dim DrMovto = DtTraspasos.NewRow + DrMovto("Almacen") = Dr("Almacen").ToString.ToEntero + DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString.ToEntero + DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado + DrMovto("FolioSalida") = FolioSalida + DtTraspasos.Rows.Add(DrMovto) + End If + + If Not CveMovimientoSalidaApartado > 0 Then + ErrorCancelar = True + Exit For + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next + + If Not ErrorCancelar Then + For Each Dr1 As DataRow In DtTraspasos.Rows + CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString.ToEntero + + CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", CveAlmacenDestino:=CveAlmacenDevolucion, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:="", CveContrato:=CveContrato, CveVendedor:=-1, CveCliente:=CveCliente) + FolioEntrada = ObjInventario.Folio + + If Not CveMovimientoEntradaApartado > 0 Then + ErrorCancelar = True + Exit For + End If + + Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado + Dr1("FolioEntrada") = FolioEntrada + + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next + End If + + If ErrorCancelar Then Exit For + Next + End If + Else + ErrorCancelar = True + End If + End If + + Return Not ErrorCancelar + End Function + + + Public Function CancelarDocumento() As MMensajeFactura + Dim Retorno As New MMensajeFactura() + + CancelarVenta(Me, UsuarioActual) + + Return Retorno End Function Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean @@ -3800,11 +4557,11 @@ Namespace Modelos If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC) Then 'falta verificar traer el acuse y reenviarlo If UsuarioActual.Empresa.UsaAC Then - 'IDPoliza = GenerarPolizaAC(ObjAC, True) - 'If IDPoliza <= 0 Then - ' Mensaje = "No se pudo generar la poliza" - ' ErrorCancelar = True - 'End If + IDPoliza = GenerarPolizaAC(Me, ObjAC, True) + If IDPoliza <= 0 Then + Mensaje = "No se pudo generar la poliza" + ErrorCancelar = True + End If End If If Not ErrorCancelar Then @@ -3835,168 +4592,117 @@ Namespace Modelos End If Return ProcesoCorrecto - End Function - + End Function + Private Function GenerarPolizaAC(ObjFactura As Modelos.Factura, ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer + Dim Retorno As Integer = 0 + Dim IDPoliza As Integer = 0 + + Dim ErrorAC As Boolean = False + 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() + Dim Fecha As Date = ObjFactura.Fecha + Dim Concepto As String = String.Format("GD {0}", ObjFactura.Cliente.Nombre) + Dim Paridad As Integer = 1 + Dim TipoMovto As Boolean = False + + If CancelacionIngreso Then + Concepto = String.Format("Cancelación GD {0}", ObjFactura.Cliente.Nombre) + Paridad = -1 + TipoMovto = True + End If + + Dim TipoPoliza = If(ObjFactura.TipoDocto = "OP" Or ObjFactura.TipoDocto = "Com", 3, 1) + + IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, ObjFactura.Total * 2, ObjFactura.Total * 2, UsuarioActual.CveUsuario, Fecha) + Dim dr As DataRow + + Dim CtaCliente As Integer = ObjFactura.Cliente.IdCtaContClientes + Dim CtaISSSTESON As Integer = 643 + Dim CtaISPT As Integer = 1745 + + + If IDPoliza > 0 Then + + 'Orden de PAGO + If ObjFactura.TipoDocto = "OP" Then + 'ORDEN DE PAGO + If ObjFactura.Num3 = 1 Then + 'ISSSTESON + + If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then + If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then + ErrorAC = True + End If + Else + ErrorAC = True + End If + + Else + 'ISPT + + If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then + If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then + ErrorAC = True + End If + Else + ErrorAC = True + End If + End If + + ' NORMAL + Else + Dim DTPresupuestoIngresos As New DataTable + Dim AC As New ClsAC + If AC.GetPresupuestoIngresos(-1, Now.Year, True, UsuarioActual.CveEmpresa) Then + DTPresupuestoIngresos = AC.DtResultados.Copy() + End If + AC.Dispose() + + For Each grp As DataRow In DtDetalleAC.Rows + dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp("CvePresupuestoIngreso"))) + Concepto = String.Format("{0} - {1}: {2}", ObjFactura.Cliente.Nombre, ObjFactura.TipoDocumento, ObjFactura.Folio) + + If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString.ToEntero, False, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then + If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString.ToEntero, True, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then + 'CARGO la deuda del cliente + If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then + 'abono, + If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString.ToEntero, Not TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then + ErrorAC = True + End If + Else + ErrorAC = True + End If + Else + ErrorAC = True + End If + Else + ErrorAC = True + End If + Next + End If + + Else + ErrorAC = True + End If + + If Not ErrorAC Then + ObjAC.AjustaPoliza(IDPoliza) + + Retorno = IDPoliza + Else + Retorno = -1 + 'Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError) + End If + + Return Retorno + + End Function + #End Region - - -#Region "Claves" - - Public Property CveVenta As Integer - Public Property CveEmpresa As Integer - Public Property CveSucursal As Integer 'sucursal de la empresa que factura - Public Property CveSubProyecto As Integer - Public Property CveAlmacenRecepcionUsados As Integer = -1 - Public Property CveDireccionEnvio As Integer - Public Property RefacturacionGeneroNC As Boolean = False - 'Public Property Sucursal As SucursalModel - Public Property SubProyecto As Modelos.SubProyectoModel - - Public DtDetalle As Data.DataTable - Public DtAjustes As Data.DataTable - Public DtRecepcionUsados As Data.DataTable - Public DtVentasNC As Data.DataTable - Public DtDeduccion As Data.DataTable - Public DtFirmas As Data.DataTable - Public DtDesgloseImpuestos As Data.DataTable - Public DtDocumentosRelacionados As Data.DataTable - Public DtNCVinculadas As Data.DataTable - - Public DtAnticipos As Data.DataTable - Public DtPromociones As Data.DataTable - Public DtImpuestosLocales As Data.DataTable - Public DtPagos As Data.DataTable - Public DtRemisionesPS As Data.DataTable - Public DtRemisiones As Data.DataTable - Public DtPedidos2 As Data.DataTable - Public DtPedidos2PS As Data.DataTable - Public DTOrdenesCompraPS As Data.DataTable - Public DtCotizacionesPS As Data.DataTable - Public DtDocumentacionCliente As Data.DataTable - Public DtContratosSerieDetalle As Data.DataTable - Public DtOtrosConceptos As Data.DataTable - Public DtInventario As Data.DataTable - Public DtRemConceptosSurtidos As Data.DataTable - Public Property UsadosBonificacion As List(Of Integer) - Public Property TipoBonificacion As Integer = 0 - Public Property Timbre As CFDITimbre - Public Property CveCliente As Integer - Public Property Cliente As Modelos.ClienteModel - Public Property SubProyectoMatriz As Modelos.SubProyectoModel - - Public Sub SetSubProyecto() - If CveSubProyecto > 0 Then - SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) - End If - End Sub - Public Sub SetSubProyectoMatriz() - Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") - If Not IsNothing(Row) Then - SubProyectoMatriz = New Modelos.SubProyectoModel(Row) - End If - End Sub - Public Sub SetCliente() - If CveCliente > 0 Then - Cliente = New Modelos.ClienteModel(CveCliente, CveEmpresa) - End If - End Sub - Public Sub SetMoneda() - If CveMoneda > 0 Then - Dim dr As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) - If Not IsNothing(dr) Then - Moneda = dr("Moneda").ToString() - MonedaSAT = dr("AbreviaturaSAT").ToString() - MonedaAbreviatura = dr("Abreviatura").ToString() - End If - End If - End Sub - Public Sub SetMetodoPago() - If CveMetodoPago > 0 AndAlso Not IsNothing(GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then - MetodoPago = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() - ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() - End If - End Sub - Public Sub SetMoneda(ObjClsPaginas As ClsPaginas) - If Not IsNothing(ObjClsPaginas) Then - Dim dr As DataRow = ObjClsPaginas.GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) - If Not IsNothing(dr) Then - Moneda = dr("Moneda").ToString() - MonedaSAT = dr("AbreviaturaSAT").ToString() - MonedaAbreviatura = dr("Abreviatura").ToString() - End If - End If - End Sub - Public Sub SetMetodoPago(ObjClsPaginas As ClsPaginas) - If Not IsNothing(ObjClsPaginas) Then - If Not IsNothing(ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then - MetodoPago = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() - ClaveMetodoPagoSAT = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() - End If - End If - End Sub - Public Sub SetSubProyecto(obj As ClsPaginas) - If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then - SubProyecto = New Modelos.SubProyectoModel(obj.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) - End If - End Sub - Public Sub SetSubProyectoMatriz(obj As ClsPaginas) - If Not IsNothing(obj) Then - Dim Row As Data.DataRow = obj.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") - If Not IsNothing(Row) Then - SubProyectoMatriz = New Modelos.SubProyectoModel(Row) - End If - End If - End Sub - - Public Property CveClienteSucursal As Integer - Public Property ClienteSucursal As Modelos.SucursalModel - Public Property EnviarA As Modelos.EnviarAModel - Public Property NumeroContrato As String - Public Property PedidoContrato As String - Public Property OrdenCompra As String = "-1" - Public Property CveMetodoPago As Integer - Public Property MetodoPago As String - Public Property ClaveMetodoPagoSAT As String - Public Property CveMetodoPago33 As Integer - Public Property MetodoPago33 As String - Public Property CveFormaPago33 As Integer - Public Property MetodoPagoSAT33 As String - Public Property FormaPago33 As String - Public Property FormaPagoSAT33 As String - Public Property UsoCFDI As String = "" - Public Property CveUsoCFDI As Integer - Public Property ClaveUsoCFDI As String = "" - Public Property CveTipoRelacion As Integer = -1 - Public Property CveEstatusFactura As Integer - Public Property CveVendedor As Integer - Public Property VendedorCodigo As String - Public Property CveSucursalEjecucion As Integer - Public Property FechaEjecucion As Date - Public Property CveSucursalCobranza As Integer - - Public Property CveSubProyectoCobranza As Integer - Public Property CveSubProyectoEjecucion As Integer - Public Property CveOS As Integer - Public Property CveContrato As Integer - Public Property CveVentaPadre As Integer - Public Property CvePrePoliza As Integer - Public Property Entrega As String - Public Property TiempoEntrega As String - Public Property Vigencia As Date - Public Property TipoEstatus As Integer - Public Property CveCondicionEntrega As Integer - Public Property CondicionEntrega As String - - Public Property TipoRelacion As String - Public Property UUIDRelacionados As List(Of String) - - - Public Property CveVentaRelacion As Integer = -1 - Public Property ImporteRelacion As Decimal - - -#End Region - 'Ventas + + +#Region "P R O P I E D A D E S" + Public Property NuevaFactura As Integer Public Property EnviarCorreo As Boolean = False Public Property ErrorList As List(Of String) @@ -4041,10 +4747,55 @@ Namespace Modelos Public Property CvePSAmortizacion As Integer Public Property SaldoVentaDevolucion As Decimal Public Property Saldo As Decimal + Public Property SaldoAlmacen As Decimal + Public Property CvePAC As Integer Public Property CveAnticipo As Integer Public Property RemisionesLista As List(Of Integer) Public Property CveAlmacen As Integer + Public Property CveAlmacenDevolucion As Integer + Public Property CveVenta As Integer + Public Property CveEmpresa As Integer + Public Property CveSucursal As Integer 'sucursal de la empresa que factura + Public Property CveSubProyecto As Integer + Public Property CveAlmacenRecepcionUsados As Integer = -1 + Public Property CveDireccionEnvio As Integer + Public Property RefacturacionGeneroNC As Boolean = False + Public Property Pagado As Decimal + 'Public Property Sucursal As SucursalModel + Public Property SubProyecto As Modelos.SubProyectoModel + Public DtDetalle As Data.DataTable + Public DtDetalleAC As Data.DataTable + Public DtAjustes As Data.DataTable + Public DtRecepcionUsados As Data.DataTable + Public DtVentasNC As Data.DataTable + Public DtDeduccion As Data.DataTable + Public DtFirmas As Data.DataTable + Public DtDesgloseImpuestos As Data.DataTable + Public DtDocumentosRelacionados As Data.DataTable + Public DtNCVinculadas As Data.DataTable + + Public DtAnticipos As Data.DataTable + Public DtPromociones As Data.DataTable + Public DtImpuestosLocales As Data.DataTable + Public DtPagos As Data.DataTable + Public DtRemisionesPS As Data.DataTable + Public DtRemisiones As Data.DataTable + Public DtPedidos2 As Data.DataTable + Public DtPedidos2PS As Data.DataTable + Public DTOrdenesCompraPS As Data.DataTable + Public DtCotizacionesPS As Data.DataTable + Public DtDocumentacionCliente As Data.DataTable + Public DtContratosSerieDetalle As Data.DataTable + Public DtOtrosConceptos As Data.DataTable + Public DtInventario As Data.DataTable + Public DtRemConceptosSurtidos As Data.DataTable + Public Property UsadosBonificacion As List(Of Integer) + Public Property TipoBonificacion As Integer = 0 + Public Property Timbre As CFDITimbre + Public Property CveCliente As Integer + Public Property Cliente As Modelos.ClienteModel + Public Property SubProyectoMatriz As Modelos.SubProyectoModel 'CFDi Public Property Version As String @@ -4071,7 +4822,8 @@ Namespace Modelos Public Property SeTimbro As String Public Property TipoDocto As String Public Property RefDocto As String - + Public Property RealizarDevolucionAlmacen As Boolean + Public Property CveAlmacenDevolucionVenta As Integer Public Property TipoDocumento As String @@ -4205,9 +4957,9 @@ Namespace Modelos End Get End Property - Public Property MotivoDescuento As String - - + Public Property MotivoDescuento As String + + #Region "Totales" Public Property SubTotal As Decimal Public Property Descuento As Decimal @@ -4220,10 +4972,10 @@ Namespace Modelos Public Property IEPS As Decimal Public Property Total As Decimal - Public Property Otros As Decimal - + Public Property Otros As Decimal + #Region "Totales por Tipo de cambio" - + Public ReadOnly Property SubTotalTC As Decimal Get If ConvertirPesos Then @@ -4305,7 +5057,7 @@ Namespace Modelos Return Otros End If End Get - End Property + End Property #End Region #End Region Public Property AtencionA As String @@ -4354,10 +5106,124 @@ Namespace Modelos Public Property ComplementoINE As Modelos.ComplementoINE Public Property FordGSDB As String = "" Public Property FordASN As String = "" - Public Property FemsaFactura As Modelos.FemsaFactura + Public Property FemsaFactura As Modelos.FemsaFactura + + Public Sub SetSubProyecto() + If CveSubProyecto > 0 Then + SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) + End If + End Sub + Public Sub SetSubProyectoMatriz() + Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") + If Not IsNothing(Row) Then + SubProyectoMatriz = New Modelos.SubProyectoModel(Row) + End If + End Sub + Public Sub SetCliente() + If CveCliente > 0 Then + Cliente = New Modelos.ClienteModel(CveCliente, CveEmpresa) + End If + End Sub + Public Sub SetMoneda() + If CveMoneda > 0 Then + Dim dr As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) + If Not IsNothing(dr) Then + Moneda = dr("Moneda").ToString() + MonedaSAT = dr("AbreviaturaSAT").ToString() + MonedaAbreviatura = dr("Abreviatura").ToString() + End If + End If + End Sub + Public Sub SetMetodoPago() + If CveMetodoPago > 0 AndAlso Not IsNothing(GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then + MetodoPago = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() + ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() + End If + End Sub + Public Sub SetMoneda(ObjClsPaginas As ClsPaginas) + If Not IsNothing(ObjClsPaginas) Then + Dim dr As DataRow = ObjClsPaginas.GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) + If Not IsNothing(dr) Then + Moneda = dr("Moneda").ToString() + MonedaSAT = dr("AbreviaturaSAT").ToString() + MonedaAbreviatura = dr("Abreviatura").ToString() + End If + End If + End Sub + Public Sub SetMetodoPago(ObjClsPaginas As ClsPaginas) + If Not IsNothing(ObjClsPaginas) Then + If Not IsNothing(ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then + MetodoPago = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() + ClaveMetodoPagoSAT = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() + End If + End If + End Sub + Public Sub SetSubProyecto(obj As ClsPaginas) + If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then + SubProyecto = New Modelos.SubProyectoModel(obj.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) + End If + End Sub + Public Sub SetSubProyectoMatriz(obj As ClsPaginas) + If Not IsNothing(obj) Then + Dim Row As Data.DataRow = obj.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") + If Not IsNothing(Row) Then + SubProyectoMatriz = New Modelos.SubProyectoModel(Row) + End If + End If + End Sub + Public Property CveClienteSucursal As Integer + Public Property ClienteSucursal As Modelos.SucursalModel + Public Property EnviarA As Modelos.EnviarAModel + Public Property NumeroContrato As String + Public Property PedidoContrato As String + Public Property OrdenCompra As String = "-1" + Public Property CveMetodoPago As Integer + Public Property MetodoPago As String + Public Property ClaveMetodoPagoSAT As String + Public Property CveMetodoPago33 As Integer + Public Property MetodoPago33 As String + Public Property CveFormaPago33 As Integer + Public Property MetodoPagoSAT33 As String + Public Property FormaPago33 As String + Public Property FormaPagoSAT33 As String + Public Property UsoCFDI As String = "" + Public Property CveUsoCFDI As Integer + Public Property ClaveUsoCFDI As String = "" + Public Property CveTipoRelacion As Integer = -1 + Public Property CveEstatusFactura As Integer + Public Property CveVendedor As Integer + Public Property VendedorCodigo As String + Public Property CveSucursalEjecucion As Integer + Public Property FechaEjecucion As Date + Public Property CveSucursalCobranza As Integer + + Public Property CveSubProyectoCobranza As Integer + Public Property CveSubProyectoEjecucion As Integer + Public Property CveOS As Integer + Public Property CveContrato As Integer + Public Property CveVentaPadre As Integer + Public Property CvePrePoliza As Integer + Public Property Entrega As String + Public Property TiempoEntrega As String + Public Property Vigencia As Date + Public Property TipoEstatus As Integer + Public Property CveCondicionEntrega As Integer + Public Property CondicionEntrega As String + + Public Property TipoRelacion As String + Public Property UUIDRelacionados As List(Of String) + + + Public Property CveVentaRelacion As Integer = -1 + Public Property ImporteRelacion As Decimal + + +#End Region + + #Region "IDisposable Support" - 'Atributos de la clase + 'Atributos de la clase Private disposedValue As Boolean = False ' IDisposable @@ -4398,9 +5264,9 @@ Namespace Modelos ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) - End Sub + End Sub #End Region - + #Region "G L O B A L - D T" Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Get @@ -4585,10 +5451,10 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTPSATPS") = value End Set - End Property - + End Property + #Region "GLOBALES DE SAT COMERCIO EXTERIOR" - + Property GlobalDTClavePedimento() As DataTable Get GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable) @@ -4698,10 +5564,10 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTColonia") = value End Set - End Property - + End Property + #End Region - + Property GlobalDTPSATUM() As DataTable Get GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable) @@ -5886,9 +6752,9 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value End Set - End Property - - + End Property + + #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get @@ -5924,9 +6790,9 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value End Set - End Property + End Property #End Region - + #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable Get @@ -5967,9 +6833,9 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get @@ -6062,10 +6928,10 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralPaises() As DataTable Get @@ -6153,10 +7019,10 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTGralColectivas") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get @@ -6365,8 +7231,8 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosTipos") = value End Set - End Property - + End Property + #Region " DT PROSPECTOS SOLICITUDES" Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable Get @@ -6433,15 +7299,15 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value End Set - End Property - + End Property + #End Region #End Region - + #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" - + #Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************" - + Property GlobalDTAC_RubrosIngreso() As DataTable Get GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable) @@ -6697,11 +7563,11 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value End Set - End Property - - + End Property + + #End Region - + Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -6780,9 +7646,9 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get @@ -6819,11 +7685,11 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value End Set - End Property - - + End Property + + #End Region - + #Region "F I N A N Z A S " Property GlobalDTFinan_RazonesFinancieras() As DataTable Get @@ -6832,10 +7698,10 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value End Set - End Property + End Property #End Region - - + + #Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************" Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable Get @@ -6889,9 +7755,9 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTContaConceptosContables") = value End Set - End Property + End Property #End Region - + #Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" Property GlobalDTAsistenciaDetalle() As DataTable Get @@ -7043,13 +7909,13 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoBuzon") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - C O M B U S T I B L E S ***********" - - - + + + Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -7088,11 +7954,11 @@ Namespace Modelos Set(ByVal value As DataTable) HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - M A N T E N I M I E N T O S ***********" - + Property GlobalDTMantenimientosTipos() As DataTable Get GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) @@ -7131,13 +7997,13 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value End Set - End Property - + End Property + #End Region - - + + #Region "*********** D T - T A L L E R E S ***********" - + Property GlobalDTTalleresTipos() As DataTable Get GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable) @@ -7154,12 +8020,12 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTTalleres") = value End Set - End Property - + End Property + #End Region - + #Region "*********** D T - D I S T R I B U I D O R E S ***********" - + Property GlobalDTDistribuidoresTipos() As DataTable Get GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable) @@ -7176,11 +8042,11 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTDistribuidores") = value End Set - End Property - + End Property + #End Region - - + + Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -7242,27 +8108,27 @@ Namespace Modelos Set(value As DataTable) HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos") = value End Set - End Property + End Property Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, - Optional PorcentajeIVA As Double = -1) As DataTable - - Get - Dim Str As StringBuilder = New StringBuilder() - If CveEmpresa <> -1 Or CveClasicacionPorcentaje <> -1 Or CveClasicacion <> -1 Or PorcentajeIVA <> -1 Then - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) - If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) - If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTClasificacionPorcentaje = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value - End Set + Optional PorcentajeIVA As Double = -1) As DataTable + + Get + Dim Str As StringBuilder = New StringBuilder() + If CveEmpresa <> -1 Or CveClasicacionPorcentaje <> -1 Or CveClasicacion <> -1 Or PorcentajeIVA <> -1 Then + If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) + If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) + If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) + If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTClasificacionPorcentaje = Dv.ToTable + Dv.Dispose() + Else + GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable) + End If + End Get + Set(value As DataTable) + HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value + End Set End Property Property GlobalDTPaqueterias() As DataTable Get @@ -7274,9 +8140,9 @@ Namespace Modelos End Property Public Property CveContratoSecciones As String - Public Property CveEstatus As Integer + Public Property CveEstatus As Integer #End Region - + End Class @@ -7294,7 +8160,7 @@ Namespace Modelos MyBase.New() End Sub Public Sub New(Row As System.Data.DataRow) - SetValues(Row) + setValues(Row) End Sub Public Property AplicaFEMSA As Boolean = False 'AplicaFEMSA @@ -7341,7 +8207,7 @@ Namespace Modelos End Sub Public Sub New(Row As System.Data.DataRow) SetDefaultValues() - SetValues(Row) + setValues(Row) End Sub Public ReadOnly Property LugarExp As String @@ -7468,13 +8334,13 @@ Namespace Modelos End Sub Public Sub New(Row As Data.DataRow) SetDefaultValues() - SetValues(Row) + setValues(Row) End Sub Public Sub New(CveCliente As Integer, CveEmpresa As Integer) SetDefaultValues() Dim ObjCliente As New ClsClientes() If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, -1, TipoCliente:=-1) AndAlso ObjCliente.DtResultados.Rows.Count > 0 Then - SetValues(ObjCliente.DtResultados.Rows(0)) + setValues(ObjCliente.DtResultados.Rows(0)) End If ObjCliente.Dispose() End Sub @@ -7581,7 +8447,7 @@ Namespace Modelos End Sub Public Sub New(Row As System.Data.DataRow) SetDefaultValues() - SetValues(Row) + setValues(Row) End Sub Public ReadOnly Property LugarExp As String @@ -7602,12 +8468,12 @@ Namespace Modelos Public Property EnvioPedidoContrato As String Public Property EnvioCP As String Public Property EnvioTel As String - End Class - + End Class + #End Region - + #Region "Personal" - + Public Class RH_PersonalRequerido Public Sub New() CveRequerimiento = -1 @@ -7631,11 +8497,11 @@ Namespace Modelos Public Property Usuario As String Public Property CveEmpresa As Integer - End Class + End Class #End Region - + #Region "E FACTURAS" - Public Class eFactura + Public Class eFactura #Region "Propiedades" Public Property CveEmpresa() As Integer Get @@ -7911,326 +8777,326 @@ Namespace Modelos m_DirectorioTemporal = Value End Set End Property - Private m_DirectorioTemporal As String + Private m_DirectorioTemporal As String #End Region - End Class - - - ' Public Class ClsValidaCFDi - ' Implements IDisposable - - '#Region "Campos" - ' 'Campos - ' Private LFolioFiscal As String - ' Private LRFCEmisor As String - ' Private LRFCReceptor As String - ' ' Para detectar llamadas redundantes - ' Private disposedValue As Boolean = False - '#End Region - - '#Region "Propiedades" - ' 'Propiedades - ' Public Property EsValida() As Integer - ' Get - ' Return m_EsValida - ' End Get - ' Set - ' m_EsValida = Value - ' End Set - ' End Property - ' Private m_EsValida As Integer - ' Public Property Efecto() As String - ' Get - ' Return m_Efecto - ' End Get - ' Set - ' m_Efecto = Value - ' End Set - ' End Property - ' Private m_Efecto As String - ' Public Property FechaEmision() As String - ' Get - ' Return m_FechaEmision - ' End Get - ' Set - ' m_FechaEmision = Value - ' End Set - ' End Property - ' Private m_FechaEmision As String - ' Public Property FolioFiscal() As String - ' Get - ' Return m_FolioFiscal - ' End Get - ' Set - ' m_FolioFiscal = Value - ' End Set - ' End Property - ' Private m_FolioFiscal As String - ' Public Property Estado() As String - ' Get - ' Return m_Estado - ' End Get - ' Set - ' m_Estado = Value - ' End Set - ' End Property - ' Private m_Estado As String - ' Public Property RFCEmisor() As String - ' Get - ' Return m_RFCEmisor - ' End Get - ' Set - ' m_RFCEmisor = Value - ' End Set - ' End Property - ' Private m_RFCEmisor As String - ' Public Property Emisor() As String - ' Get - ' Return m_Emisor - ' End Get - ' Set - ' m_Emisor = Value - ' End Set - ' End Property - ' Private m_Emisor As String - ' Public Property RFCReceptor() As String - ' Get - ' Return m_RFCReceptor - ' End Get - ' Set - ' m_RFCReceptor = Value - ' End Set - ' End Property - ' Private m_RFCReceptor As String - ' Public Property Receptor() As String - ' Get - ' Return m_Receptor - ' End Get - ' Set - ' m_Receptor = Value - ' End Set - ' End Property - ' Private m_Receptor As String - ' Public Property RFCPAC() As String - ' Get - ' Return m_RFCPAC - ' End Get - ' Set - ' m_RFCPAC = Value - ' End Set - ' End Property - ' Private m_RFCPAC As String - ' Public Property FechaCertificacion() As String - ' Get - ' Return m_FechaCertificacion - ' End Get - ' Set - ' m_FechaCertificacion = Value - ' End Set - ' End Property - ' Private m_FechaCertificacion As String - ' Public Property Monto() As Double - ' Get - ' Return m_Monto - ' End Get - ' Set - ' m_Monto = Value - ' End Set - ' End Property - ' Private m_Monto As Double - ' Public Property FechaCancelacion() As String - ' Get - ' Return m_FechaCancelacion - ' End Get - ' Set - ' m_FechaCancelacion = Value - ' End Set - ' End Property - ' Private m_FechaCancelacion As String - ' Public Property ResponseHTML() As String - ' Get - ' Return m_ResponseHTML - ' End Get - ' Set - ' m_ResponseHTML = Value - ' End Set - ' End Property - ' Private m_ResponseHTML As String - '#End Region - - - ' 'Public Sub New() - ' 'End Sub - - ' 'Public Sub New(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, MontoTotal As Double, Fecha As String) - ' ' Me.LFolioFiscal = FolioFiscal - ' ' Me.LRFCEmisor = RFCEmisor - ' ' Me.LRFCReceptor = RFCReceptor - ' ' Verificar() - ' ' ' valida que este vigente y que el total coincida entre el xml y la pagina - ' ' If EsValida = 1 AndAlso Math.Abs(Me.Monto - MontoTotal) <0.01 AndAlso Me.FechaEmision= Fecha Then - ' ' EsValida = 1 - ' ' End If - ' 'End Sub - - ' 'Public Function Verificar(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, MontoTotal As Double, Fecha As System.DateTime) As Integer - ' ' Me.LFolioFiscal = FolioFiscal - ' ' Me.LRFCEmisor = RFCEmisor - ' ' Me.LRFCReceptor = RFCReceptor - ' ' Verificar() - ' ' ' valida que este vigente y que el total coincida entre el xml y la pagina - ' ' If EsValida = 1 AndAlso Math.Abs(Me.Monto - MontoTotal) < 0.01 AndAlso Me.FechaEmision.ToDate() = Fecha Then - ' ' EsValida = 1 - ' ' End If - ' ' Return Me.EsValida - ' 'End Function - - ' 'Private Sub Verificar() - - ' ' Try - ' ' Dim URL As String = "https://verificacfdi.facturaelectronica.sat.gob.mx/" - ' ' Dim Captcha As String = "86347" - ' ' Dim PostData As String = String.Format("ctl00%24ScriptManager1=ctl00%24MainContent%24UpnlBusqueda%7Cctl00%24MainContent%24BtnBusqueda&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=4XIkDFIZJUcFomimZq9eTLrdtnhIAGlsq6y0rtQuJT37JwifEc%2FW5maVQfV4be%2B4NQhS%2F%2FyWBSZzL5CyT1G1n7QcKgYNWEBpVwB63yZO4GEPtkhlMnxHIX%2BVxggo%2Fer8r5tKDnW%2FvXWy0%2BZTkT0xTcXs7bDk%2F9J3p8kUPusbOcuaNmov7RxCXqW5%2F2DKoYrkc0Jn4A6N0ndsdtjVuD3fH8wGQ5kaKpMxmr6Nyr4mO98kc%2Bbd8AkKR458juZEzpgmmifqg61Ho7LLzuq02TCN3jDbPH4MQ79m8mh%2BYDxeZi%2BVG%2FbOjGECspr6aKxLT0zuzlQX5ZWVKenYv1Ei0YQkfhrmsNWqUwBWUAFeZwziDX2d0HNp&__VIEWSTATEGENERATOR=CA0B0334&__VIEWSTATEENCRYPTED=&ctl00%24MainContent%24TxtUUID={0}&ctl00%24MainContent%24TxtRfcEmisor={1}&ctl00%24MainContent%24TxtRfcReceptor={2}&ctl00%24MainContent%24TxTCaptchaNumbers={3}&__ASYNCPOST=true&ctl00%24MainContent%24BtnBusqueda=Verificar%20CFDI", LFolioFiscal, LRFCEmisor, LRFCReceptor, Captcha) - ' ' Dim Encoding As Encoding = Encoding.UTF8 - ' ' Dim Data As Byte() = Encoding.GetBytes(PostData) - ' ' Dim Request As HttpWebRequest = Nothing - - ' ' Request = DirectCast(WebRequest.Create(URL), HttpWebRequest) - ' ' Request.Method = "POST" - ' ' Request.Accept = "*/*" - ' ' Request.Headers.Add("X-Requested-With", "XMLHttpRequest") - ' ' Request.Headers.Add("X-MicrosoftAjax", "Delta=true") - ' ' Request.ContentType = "application/x-www-form-urlencoded; charset=utf-8" - ' ' Request.Referer = "https://verificacfdi.facturaelectronica.sat.gob.mx/" - ' ' Request.Headers.Add("Accept-Language", "es-mx") - ' ' Request.Headers.Add("Accept-Encoding", "gzip, deflate") - ' ' Request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0)" - ' ' Request.Host = "verificacfdi.facturaelectronica.sat.gob.mx" - ' ' Request.Headers.Add("Pragma", "no-cache") - ' ' Request.ServicePoint.Expect100Continue = False - ' ' Request.KeepAlive = True - ' ' Request.ContentLength = Data.Length - - ' ' Dim OutStream As Stream = Request.GetRequestStream() - ' ' OutStream.Write(Data, 0, Data.Length) - ' ' OutStream.Close() - ' ' Dim Response = DirectCast(Request.GetResponse(), HttpWebResponse) - - ' ' Dim InStream As Stream = Nothing - ' ' Select Case Response.ContentEncoding.ToUpperInvariant() - ' ' Case "GZIP" - ' ' InStream = New GZipStream(Response.GetResponseStream(), CompressionMode.Decompress) - ' ' Exit Select - ' ' Case "DEFLATE" - ' ' InStream = New DeflateStream(Response.GetResponseStream(), CompressionMode.Decompress) - ' ' Exit Select - ' ' Case Else - ' ' InStream = Response.GetResponseStream() - ' ' Exit Select - ' ' End Select - - ' ' Dim SR As New StreamReader(InStream, Encoding) - ' ' Dim DataBack As String = SR.ReadToEnd() - - ' ' ProcesarDatos(DataBack) - ' ' Catch ex As Exception - ' ' ModExtensiones.GuardaLog("'ERROR : No se pudo Validar la factura:" + ex.Message) - ' ' End Try - ' 'End Sub - - ' 'Private Sub ProcesarDatos(HTML As String) - ' ' Dim tValida As Integer = -1 - ' ' EsValida = 0 - ' ' ' No tiene Error - ' ' If (HTML.Contains("El Comprobante NO se encuentra registrado")) Then - ' ' HTML = "No se encontró el CFDi" - ' ' 'Se validó - ' ' tValida = 0 - ' ' Else - ' ' Dim i As Integer = HTML.IndexOf("
") - - ' ' If i >= 0 Then - ' ' HTML = HTML.Substring(i) - ' ' HTML = HTML.Substring(0, HTML.IndexOf("
")) - ' ' HTML = HTML.Replace(" ", " ") - ' ' tValida = 1 - ' ' Me.ResponseHTML = HTML - - ' ' End If - ' ' End If - - ' ' 'Cargo estructura de la clase - ' ' If tValida = 1 Then - ' ' Me.Efecto = ExtraeDatos(HTML, "ctl00_MainContent_LblEfectoComprobante"">", 10) - ' ' Me.FechaEmision = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaEmision"">", 19) - ' ' Me.FolioFiscal = ExtraeDatos(HTML, "ctl00_MainContent_LblUuid"">", 40) - ' ' Me.Estado = ExtraeDatos(HTML, "ctl00_MainContent_LblEstado"">", 15) - ' ' Me.RFCEmisor = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcEmisor"">", 13) - ' ' Me.Emisor = ExtraeDatos(HTML, "ctl00_MainContent_LblNombreEmisor"">", 200) - ' ' Me.RFCReceptor = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcReceptor"">", 13) - ' ' Me.Receptor = ExtraeDatos(HTML, "ctl00_MainContent_LblNombreReceptor"">", 200) - ' ' Me.RFCPAC = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcPac"">", 13) - ' ' Me.FechaCertificacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCertificacion"">", 19) - ' ' Me.Monto = ExtraeDatos(HTML, "ctl00_MainContent_LblMonto"">", 15).ToDouble() - ' ' Me.FechaCancelacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCancelacion"">", 19) - ' ' If Estado.ToLower() = "vigente" Then - ' ' EsValida = 1 - ' ' End If - - ' ' If Estado.ToLower() = "cancelado" Then - ' ' EsValida = 2 - ' ' End If - ' ' End If - ' 'End Sub - - ' 'Private Function ExtraeDatos(HTML As String, Container As String, MaxLength As Integer) As String - ' ' Dim DataBack As String = String.Empty - ' ' 'Código HTML: $ = '$', : = ':' - ' ' For i As Integer = 0 To HTML.IndexOf(Container) + MaxLength - ' ' If HTML.Substring(HTML.IndexOf(Container) + Container.Length - 1, i).Trim().EndsWith("") Then - ' ' DataBack = HTML.Substring(HTML.IndexOf(Container) + Container.Length, i - 1).Replace("", "").Trim().Replace("$", "").Replace(":", ":").Replace("/", "/") - ' ' ' TODO: might not be correct. Was : Exit For - ' ' Exit For - ' ' Else - ' ' i = i + 1 - ' ' End If - ' ' Next - - ' ' Return DataBack.Trim() - ' 'End Function - - '#Region " IDisposable Support " - ' ' IDisposable - ' Protected Overridable Sub Dispose(disposing As Boolean) - ' If Not disposedValue Then - ' ' TODO: Liberar otro estado (objetos administrados). - ' If disposing Then - - ' ' TODO: Liberar su propio estado (objetos no administrados). - ' ' TODO: Establecer campos grandes como Null. - ' End If - ' End If - ' disposedValue = True - ' End Sub - - ' ' Visual Basic agregó este código para implementar correctamente el modelo descartable. - ' Public Sub Dispose() - ' ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). - ' Dispose(True) - ' GC.SuppressFinalize(Me) - ' End Sub - - ' Private Sub IDisposable_Dispose() Implements IDisposable.Dispose - ' Throw New NotImplementedException() - ' End Sub - '#End Region - - ' End Class - + End Class + + + ' Public Class ClsValidaCFDi + ' Implements IDisposable + + '#Region "Campos" + ' 'Campos + ' Private LFolioFiscal As String + ' Private LRFCEmisor As String + ' Private LRFCReceptor As String + ' ' Para detectar llamadas redundantes + ' Private disposedValue As Boolean = False + '#End Region + + '#Region "Propiedades" + ' 'Propiedades + ' Public Property EsValida() As Integer + ' Get + ' Return m_EsValida + ' End Get + ' Set + ' m_EsValida = Value + ' End Set + ' End Property + ' Private m_EsValida As Integer + ' Public Property Efecto() As String + ' Get + ' Return m_Efecto + ' End Get + ' Set + ' m_Efecto = Value + ' End Set + ' End Property + ' Private m_Efecto As String + ' Public Property FechaEmision() As String + ' Get + ' Return m_FechaEmision + ' End Get + ' Set + ' m_FechaEmision = Value + ' End Set + ' End Property + ' Private m_FechaEmision As String + ' Public Property FolioFiscal() As String + ' Get + ' Return m_FolioFiscal + ' End Get + ' Set + ' m_FolioFiscal = Value + ' End Set + ' End Property + ' Private m_FolioFiscal As String + ' Public Property Estado() As String + ' Get + ' Return m_Estado + ' End Get + ' Set + ' m_Estado = Value + ' End Set + ' End Property + ' Private m_Estado As String + ' Public Property RFCEmisor() As String + ' Get + ' Return m_RFCEmisor + ' End Get + ' Set + ' m_RFCEmisor = Value + ' End Set + ' End Property + ' Private m_RFCEmisor As String + ' Public Property Emisor() As String + ' Get + ' Return m_Emisor + ' End Get + ' Set + ' m_Emisor = Value + ' End Set + ' End Property + ' Private m_Emisor As String + ' Public Property RFCReceptor() As String + ' Get + ' Return m_RFCReceptor + ' End Get + ' Set + ' m_RFCReceptor = Value + ' End Set + ' End Property + ' Private m_RFCReceptor As String + ' Public Property Receptor() As String + ' Get + ' Return m_Receptor + ' End Get + ' Set + ' m_Receptor = Value + ' End Set + ' End Property + ' Private m_Receptor As String + ' Public Property RFCPAC() As String + ' Get + ' Return m_RFCPAC + ' End Get + ' Set + ' m_RFCPAC = Value + ' End Set + ' End Property + ' Private m_RFCPAC As String + ' Public Property FechaCertificacion() As String + ' Get + ' Return m_FechaCertificacion + ' End Get + ' Set + ' m_FechaCertificacion = Value + ' End Set + ' End Property + ' Private m_FechaCertificacion As String + ' Public Property Monto() As Double + ' Get + ' Return m_Monto + ' End Get + ' Set + ' m_Monto = Value + ' End Set + ' End Property + ' Private m_Monto As Double + ' Public Property FechaCancelacion() As String + ' Get + ' Return m_FechaCancelacion + ' End Get + ' Set + ' m_FechaCancelacion = Value + ' End Set + ' End Property + ' Private m_FechaCancelacion As String + ' Public Property ResponseHTML() As String + ' Get + ' Return m_ResponseHTML + ' End Get + ' Set + ' m_ResponseHTML = Value + ' End Set + ' End Property + ' Private m_ResponseHTML As String + '#End Region + + + ' 'Public Sub New() + ' 'End Sub + + ' 'Public Sub New(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, MontoTotal As Double, Fecha As String) + ' ' Me.LFolioFiscal = FolioFiscal + ' ' Me.LRFCEmisor = RFCEmisor + ' ' Me.LRFCReceptor = RFCReceptor + ' ' Verificar() + ' ' ' valida que este vigente y que el total coincida entre el xml y la pagina + ' ' If EsValida = 1 AndAlso Math.Abs(Me.Monto - MontoTotal) <0.01 AndAlso Me.FechaEmision= Fecha Then + ' ' EsValida = 1 + ' ' End If + ' 'End Sub + + ' 'Public Function Verificar(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, MontoTotal As Double, Fecha As System.DateTime) As Integer + ' ' Me.LFolioFiscal = FolioFiscal + ' ' Me.LRFCEmisor = RFCEmisor + ' ' Me.LRFCReceptor = RFCReceptor + ' ' Verificar() + ' ' ' valida que este vigente y que el total coincida entre el xml y la pagina + ' ' If EsValida = 1 AndAlso Math.Abs(Me.Monto - MontoTotal) < 0.01 AndAlso Me.FechaEmision.ToDate() = Fecha Then + ' ' EsValida = 1 + ' ' End If + ' ' Return Me.EsValida + ' 'End Function + + ' 'Private Sub Verificar() + + ' ' Try + ' ' Dim URL As String = "https://verificacfdi.facturaelectronica.sat.gob.mx/" + ' ' Dim Captcha As String = "86347" + ' ' Dim PostData As String = String.Format("ctl00%24ScriptManager1=ctl00%24MainContent%24UpnlBusqueda%7Cctl00%24MainContent%24BtnBusqueda&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=4XIkDFIZJUcFomimZq9eTLrdtnhIAGlsq6y0rtQuJT37JwifEc%2FW5maVQfV4be%2B4NQhS%2F%2FyWBSZzL5CyT1G1n7QcKgYNWEBpVwB63yZO4GEPtkhlMnxHIX%2BVxggo%2Fer8r5tKDnW%2FvXWy0%2BZTkT0xTcXs7bDk%2F9J3p8kUPusbOcuaNmov7RxCXqW5%2F2DKoYrkc0Jn4A6N0ndsdtjVuD3fH8wGQ5kaKpMxmr6Nyr4mO98kc%2Bbd8AkKR458juZEzpgmmifqg61Ho7LLzuq02TCN3jDbPH4MQ79m8mh%2BYDxeZi%2BVG%2FbOjGECspr6aKxLT0zuzlQX5ZWVKenYv1Ei0YQkfhrmsNWqUwBWUAFeZwziDX2d0HNp&__VIEWSTATEGENERATOR=CA0B0334&__VIEWSTATEENCRYPTED=&ctl00%24MainContent%24TxtUUID={0}&ctl00%24MainContent%24TxtRfcEmisor={1}&ctl00%24MainContent%24TxtRfcReceptor={2}&ctl00%24MainContent%24TxTCaptchaNumbers={3}&__ASYNCPOST=true&ctl00%24MainContent%24BtnBusqueda=Verificar%20CFDI", LFolioFiscal, LRFCEmisor, LRFCReceptor, Captcha) + ' ' Dim Encoding As Encoding = Encoding.UTF8 + ' ' Dim Data As Byte() = Encoding.GetBytes(PostData) + ' ' Dim Request As HttpWebRequest = Nothing + + ' ' Request = DirectCast(WebRequest.Create(URL), HttpWebRequest) + ' ' Request.Method = "POST" + ' ' Request.Accept = "*/*" + ' ' Request.Headers.Add("X-Requested-With", "XMLHttpRequest") + ' ' Request.Headers.Add("X-MicrosoftAjax", "Delta=true") + ' ' Request.ContentType = "application/x-www-form-urlencoded; charset=utf-8" + ' ' Request.Referer = "https://verificacfdi.facturaelectronica.sat.gob.mx/" + ' ' Request.Headers.Add("Accept-Language", "es-mx") + ' ' Request.Headers.Add("Accept-Encoding", "gzip, deflate") + ' ' Request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0)" + ' ' Request.Host = "verificacfdi.facturaelectronica.sat.gob.mx" + ' ' Request.Headers.Add("Pragma", "no-cache") + ' ' Request.ServicePoint.Expect100Continue = False + ' ' Request.KeepAlive = True + ' ' Request.ContentLength = Data.Length + + ' ' Dim OutStream As Stream = Request.GetRequestStream() + ' ' OutStream.Write(Data, 0, Data.Length) + ' ' OutStream.Close() + ' ' Dim Response = DirectCast(Request.GetResponse(), HttpWebResponse) + + ' ' Dim InStream As Stream = Nothing + ' ' Select Case Response.ContentEncoding.ToUpperInvariant() + ' ' Case "GZIP" + ' ' InStream = New GZipStream(Response.GetResponseStream(), CompressionMode.Decompress) + ' ' Exit Select + ' ' Case "DEFLATE" + ' ' InStream = New DeflateStream(Response.GetResponseStream(), CompressionMode.Decompress) + ' ' Exit Select + ' ' Case Else + ' ' InStream = Response.GetResponseStream() + ' ' Exit Select + ' ' End Select + + ' ' Dim SR As New StreamReader(InStream, Encoding) + ' ' Dim DataBack As String = SR.ReadToEnd() + + ' ' ProcesarDatos(DataBack) + ' ' Catch ex As Exception + ' ' ModExtensiones.GuardaLog("'ERROR : No se pudo Validar la factura:" + ex.Message) + ' ' End Try + ' 'End Sub + + ' 'Private Sub ProcesarDatos(HTML As String) + ' ' Dim tValida As Integer = -1 + ' ' EsValida = 0 + ' ' ' No tiene Error + ' ' If (HTML.Contains("El Comprobante NO se encuentra registrado")) Then + ' ' HTML = "No se encontró el CFDi" + ' ' 'Se validó + ' ' tValida = 0 + ' ' Else + ' ' Dim i As Integer = HTML.IndexOf("
") + + ' ' If i >= 0 Then + ' ' HTML = HTML.Substring(i) + ' ' HTML = HTML.Substring(0, HTML.IndexOf("
")) + ' ' HTML = HTML.Replace(" ", " ") + ' ' tValida = 1 + ' ' Me.ResponseHTML = HTML + + ' ' End If + ' ' End If + + ' ' 'Cargo estructura de la clase + ' ' If tValida = 1 Then + ' ' Me.Efecto = ExtraeDatos(HTML, "ctl00_MainContent_LblEfectoComprobante"">", 10) + ' ' Me.FechaEmision = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaEmision"">", 19) + ' ' Me.FolioFiscal = ExtraeDatos(HTML, "ctl00_MainContent_LblUuid"">", 40) + ' ' Me.Estado = ExtraeDatos(HTML, "ctl00_MainContent_LblEstado"">", 15) + ' ' Me.RFCEmisor = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcEmisor"">", 13) + ' ' Me.Emisor = ExtraeDatos(HTML, "ctl00_MainContent_LblNombreEmisor"">", 200) + ' ' Me.RFCReceptor = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcReceptor"">", 13) + ' ' Me.Receptor = ExtraeDatos(HTML, "ctl00_MainContent_LblNombreReceptor"">", 200) + ' ' Me.RFCPAC = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcPac"">", 13) + ' ' Me.FechaCertificacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCertificacion"">", 19) + ' ' Me.Monto = ExtraeDatos(HTML, "ctl00_MainContent_LblMonto"">", 15).ToDouble() + ' ' Me.FechaCancelacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCancelacion"">", 19) + ' ' If Estado.ToLower() = "vigente" Then + ' ' EsValida = 1 + ' ' End If + + ' ' If Estado.ToLower() = "cancelado" Then + ' ' EsValida = 2 + ' ' End If + ' ' End If + ' 'End Sub + + ' 'Private Function ExtraeDatos(HTML As String, Container As String, MaxLength As Integer) As String + ' ' Dim DataBack As String = String.Empty + ' ' 'Código HTML: $ = '$', : = ':' + ' ' For i As Integer = 0 To HTML.IndexOf(Container) + MaxLength + ' ' If HTML.Substring(HTML.IndexOf(Container) + Container.Length - 1, i).Trim().EndsWith("") Then + ' ' DataBack = HTML.Substring(HTML.IndexOf(Container) + Container.Length, i - 1).Replace("", "").Trim().Replace("$", "").Replace(":", ":").Replace("/", "/") + ' ' ' TODO: might not be correct. Was : Exit For + ' ' Exit For + ' ' Else + ' ' i = i + 1 + ' ' End If + ' ' Next + + ' ' Return DataBack.Trim() + ' 'End Function + + '#Region " IDisposable Support " + ' ' IDisposable + ' Protected Overridable Sub Dispose(disposing As Boolean) + ' If Not disposedValue Then + ' ' TODO: Liberar otro estado (objetos administrados). + ' If disposing Then + + ' ' TODO: Liberar su propio estado (objetos no administrados). + ' ' TODO: Establecer campos grandes como Null. + ' End If + ' End If + ' disposedValue = True + ' End Sub + + ' ' Visual Basic agregó este código para implementar correctamente el modelo descartable. + ' Public Sub Dispose() + ' ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). + ' Dispose(True) + ' GC.SuppressFinalize(Me) + ' End Sub + + ' Private Sub IDisposable_Dispose() Implements IDisposable.Dispose + ' Throw New NotImplementedException() + ' End Sub + '#End Region + + ' End Class + #End Region - + #Region "A P L I C A C I O N E S" - + Public Class MCliente Public Property CveCliente As Integer Public Property Nombre As String @@ -8534,7 +9400,7 @@ Namespace Modelos Public Property RequiereAFInsumo As Boolean Public Property RequierePersonal As Boolean Public Property EsAcumulador As Boolean - End Class - + End Class + #End Region End Namespace \ No newline at end of file diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index beab9c9ec..aa6c11579 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -36,8 +36,6 @@ Partial Class Bancos_CuentasBancariasDetalle DdlUsuarios.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "Nombre") DdlUsuarios.DataBind() - - If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then ViewState("CveCuenta") = Request("CveCuenta") diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 873ea911d..57d76e13f 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -656,23 +656,7 @@ Partial Class Bancos_IE RBL.Items.Add(New ListItem("Acreedores Diversos", "AC")) End If - '08/05/2018 - Se deshabilita opcion Eliminar IE si tiene un complemento de pago relacionado - If CveIE = -1 Or (CveIE > 0 AndAlso VerificaComplementos(False)) Then - LnkEliminar.Visible = False - If CveIE > 0 Then - LnkCancelar.Visible = False - If UsuarioActual.TienePermisoProceso(85) Then - LnkCancelarComplemento.Visible = True - LnkCancelarComplementoImporte.Visible = True - End If - 'LnkEliminarComplemento.NavigateUrl = String.Format("/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}", CveIE, CveCliente) - End If - Else - LnkEliminar.Visible = True - LnkCancelarComplemento.Visible = False - LnkCancelarComplementoImporte.Visible = False - End If If TabCancelacion.Visible Then LnkCancelar.Visible = False @@ -1101,33 +1085,52 @@ Partial Class Bancos_IE BtnGuardar.Enabled = False End If + '2019-08-28 unificados vista de controles complemento (Cancelado, conciliciado, Con complemento vigente, sin complemento vigente) + Dim ExistenComplementosVigentes As Boolean = VerificaComplementos(True) + Dim ExistenComplementos As Boolean = VerificaComplementos(False) - If Not ChkConciliado.Checked Then + If Not ChkConciliado.Checked And ObjIE.CveEstatusIE <> 2 Then - If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then + If (Not ExistenComplementosVigentes) Then + + If UsuarioActual.TienePermisoProceso(99) Then ' Proceso 99 Editar IE + BtnEditar.Visible = True + PermisoComplementoVigente = True + End If + DVGenerarComplementoModal.Visible = True BtnEditar.Visible = True - PermisoComplementoVigente = True Else - BtnEditar.Visible = True + + If UsuarioActual.TienePermisoProceso(99) Then + BtnEditar.Visible = True + PermisoComplementoVigente = True + Else + BtnEditar.Visible = False + End If + + LnkEliminar.Visible = False + LnkCancelar.Visible = False + + LnkCancelarComplemento.Visible = True + LnkCancelarComplementoImporte.Visible = True + End If - UpGuardar.Update() + Else + BtnEditar.Visible = False + LnkEliminar.Visible = False + LnkCancelarComplemento.Visible = False + LnkCancelarComplementoImporte.Visible = False + DVGenerarComplementoModal.Visible = False End If + UpGuardar.Update() + + End If + - End If - - 'If CveIE > 0 Then - ' DdlProveedores.Visible = False - ' LblBeneficiario.Visible = True - ' LblBeneficiario.Text = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {CveProveedor}")(0)("RazonSocial").ToString - 'End If - - - - RecargaGlobalCuentasBancarias() ObjIE.Dispose() ObjIE2.Dispose() @@ -1207,10 +1210,10 @@ Partial Class Bancos_IE If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 And UsuarioActual.Empresa.UsaContabilidad Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False - ElseIf CveCuentaBeneficiario = 0 And UsuarioActual.Empresa.UsaContabilidadSIG Then + ElseIf CveCuentaBeneficiario = 0 AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then Alert("El Beneficiario no tiene cuenta contable vinculada en SIG. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False Else @@ -1260,7 +1263,7 @@ Partial Class Bancos_IE End If If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.UsaContabilidad Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False ElseIf CveCuentaBeneficiario = 0 AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then @@ -1320,7 +1323,7 @@ Partial Class Bancos_IE CveCuentaBeneficiario = ObjPersonal.CveCuentaPersonal If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.UsaContabilidad Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False ElseIf CveCuentaBeneficiario = 0 AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then @@ -1419,7 +1422,7 @@ Partial Class Bancos_IE DivTarjeta.Visible = False End If - If Not IDCtaContable > 0 AndAlso UsuarioActual.Empresa.UsaContabilidad Then + If Not IDCtaContable > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then Alert("La Cuenta Bancaria no tiene asignada una cuenta contable", TipoMensaje.MsgAdvertencia) End If @@ -3768,10 +3771,10 @@ Partial Class Bancos_IE End If Dim Banc As New ClsBancos - Banc.IniciaTransacSQL() + Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL()) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() End If @@ -3782,7 +3785,7 @@ Partial Class Bancos_IE Dim IdPolizaNueva = -1 Dim FolioPolizaNueva = -1 - If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad)) Then + If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then If ObjAC Is Nothing Then ErrorCancelar = True @@ -3831,20 +3834,38 @@ Partial Class Bancos_IE Else - 'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS - For Each dr As DataRow In dt.Rows - If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then - ErrorCancelar = True - MensajeError = "Error al actualizar Movimientos con importe 0" - Exit For - End If - Next + 'SE COMENTO PARA PODER DESBLOQUEAR LA PREPOLIZA Y CREAR UNA NUEVA POLIZA + ''LIMPIA POLIZA PONIENDO IMPORTE EN CEROS + 'For Each dr As DataRow In dt.Rows + ' If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then + ' ErrorCancelar = True + ' MensajeError = "Error al actualizar Movimientos con importe 0" + ' Exit For + ' End If + 'Next - 'AJUSTA POLIZA - If Not ErrorCancelar Then - If Not ObjAC.AjustaPoliza(IDPoliza) Then + ''AJUSTA POLIZA + 'If Not ErrorCancelar Then + ' If Not ObjAC.AjustaPoliza(IDPoliza) Then + ' ErrorCancelar = True + ' MensajeError = "Error al ajustar poliza negativa" + ' End If + 'End If + + If ObjAC.RemovePoliza(IDPoliza) Then + If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then ErrorCancelar = True - MensajeError = "Error al ajustar poliza negativa" + MensajeError = "Error al desvincular poliza." + End If + Else + ErrorCancelar = True + MensajeError = "Error al eliminar poliza." + End If + + If Not ErrorCancelar Then + If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ErrorCancelar = True + MensajeError = "Error al desbloquear prepoliza." End If End If @@ -3856,6 +3877,11 @@ Partial Class Bancos_IE End If End If + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + ErrorCancelar = True + MensajeError = "Error al contabilizar poliza" + End If + End If End If @@ -3955,6 +3981,7 @@ Partial Class Bancos_IE If ObjAC IsNot Nothing Then ObjAC.Dispose() Banc.Dispose() + ObjConta.Dispose() End Sub Protected Sub BtnDevueltoIE_Click(sender As Object, e As EventArgs) @@ -3981,7 +4008,7 @@ Partial Class Bancos_IE Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() End If @@ -3991,7 +4018,7 @@ Partial Class Bancos_IE Dim IdPolizaNueva = -1 Dim FolioPolizaNueva = -1 - If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad)) Then + If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then If ObjAC Is Nothing Then ErrorCancelar = True @@ -4311,7 +4338,7 @@ Partial Class Bancos_IE Dim ErrorCompra = False 'Elimina la poliza - If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IDPoliza > 0 Then + If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then If Not ObjAC.RemovePoliza(IDPoliza) Then ErrorCompra = True End If @@ -4674,6 +4701,9 @@ Partial Class Bancos_IE End Sub Private Sub BtnRemove_Click(sender As Object, e As EventArgs) Handles BtnRemove.Click + + + If Not TxtDescripcion.Text = "" Then If ChkConciliado.Checked Then Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError) @@ -4698,7 +4728,7 @@ Partial Class Bancos_IE End If End If - If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IDPoliza > 0 Then + If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() If Not ObjAC.RemovePoliza(IDPoliza) Then @@ -5624,15 +5654,24 @@ Partial Class Bancos_IE Private Sub ControlesEdicion() + Dim ExistenComplementosVigentes As Boolean = VerificaComplementos(True) If PermisoComplementoVigente Then - DdlTipoTransaccion.Enabled = True - LblCuenta.Visible = False - DdlCuenta.Enabled = True - DdlCuenta.Visible = True - TxtFolio.Enabled = True - TxtObservaciones.Enabled = True + If ExistenComplementosVigentes Then + TxtFolio.Enabled = True + TxtObservaciones.Enabled = True + Else + + DdlTipoTransaccion.Enabled = True + LblCuenta.Visible = False + DdlCuenta.Enabled = True + DdlCuenta.Visible = True + TxtFolio.Enabled = True + TxtObservaciones.Enabled = True + + End If + UpDatos.Update() CargaCuentasDepositoClientes() diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index dec829379..29c9eeb36 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -199,7 +199,7 @@
-
+
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 1f8d4b125..31c39936b 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -310,9 +310,6 @@ Partial Class Bancos_ProveedoresAbonar ViewState("CveCuentaRetISR") = 0 End If - 'If UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122,145) Then - ' rowComisiones.Visible = True - 'End If IdCuenta = 0 CveCuentaB = 0 diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 85648f022..3b9d4b659 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -654,23 +654,23 @@ <%-- 0 --%> - + <%-- 1 --%> - + <%-- 2 --%> - + <%-- 3 --%> - +
@@ -683,9 +683,9 @@ <%-- 4 --%> - + <%-- 5 --%> - + @@ -694,11 +694,11 @@ <%-- 6 --%> - + <%-- 7 --%> - + <%-- 8 --%> - + @@ -2228,7 +2228,7 @@ Fecha Pago: - +
@@ -2248,6 +2248,9 @@
+ + + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f9d14b40f..02bb186f9 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2634,6 +2634,7 @@ Partial Class Compras_Compras DdlPS.Enabled = True TxtObsPS.Enabled = True LbAgregar.Enabled = True + LnkUpdateFechaPago.Visible = True End If BtnGuardar.Visible = False @@ -9947,18 +9948,18 @@ Partial Class Compras_Compras If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then If e.Row.RowIndex = 0 Then - e.Row.Cells(0).Width = Unit.Pixel(15) - e.Row.Cells(1).Width = Unit.Pixel(45) - e.Row.Cells(2).Width = Unit.Pixel(70) - e.Row.Cells(3).Width = Unit.Pixel(230) - e.Row.Cells(4).Width = Unit.Pixel(202) - e.Row.Cells(5).Width = Unit.Pixel(155) - e.Row.Cells(6).Width = Unit.Pixel(155) - e.Row.Cells(7).Width = Unit.Pixel(50) - e.Row.Cells(8).Width = Unit.Pixel(80) - e.Row.Cells(9).Width = Unit.Pixel(80) - e.Row.Cells(10).Width = Unit.Pixel(43) - e.Row.Cells(11).Width = Unit.Pixel(43) + 'e.Row.Cells(0).Width = Unit.Pixel(15) + 'e.Row.Cells(1).Width = Unit.Pixel(45) + 'e.Row.Cells(2).Width = Unit.Pixel(70) + 'e.Row.Cells(3).Width = Unit.Pixel(230) + 'e.Row.Cells(4).Width = Unit.Pixel(202) + 'e.Row.Cells(5).Width = Unit.Pixel(155) + 'e.Row.Cells(6).Width = Unit.Pixel(155) + 'e.Row.Cells(7).Width = Unit.Pixel(50) + 'e.Row.Cells(8).Width = Unit.Pixel(80) + 'e.Row.Cells(9).Width = Unit.Pixel(80) + 'e.Row.Cells(10).Width = Unit.Pixel(43) + 'e.Row.Cells(11).Width = Unit.Pixel(43) If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0) e.Row.Cells(12).Width = Unit.Pixel(150) @@ -14521,7 +14522,7 @@ Partial Class Compras_Compras End If End If - If (HdnIEPSModificadoOC.Value.ToDecimal <> LbIEPSOC2.Text.ToDecimal) Then + If Math.Abs(HdnIEPSModificadoOC.Value.ToDecimal - LbIEPSOC2.Text.ToDecimal) > 0.05 Then Alert($"Hay una diferencia de IEPS entre la factura y la OC. Dif: {HdnIEPSModificadoOC.Value.ToDecimal - LbIEPSOC2.Text.ToDecimal}", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -18816,4 +18817,26 @@ Partial Class Compras_Compras AddPS2(EsNoDeducible:=EsNoDeducible) End Sub + Protected Sub LnkUpdateFechaPago_Click(sender As Object, e As EventArgs) + Dim ObjComp As New ClsCompras + Dim FechaPagoAnterior As String = "" + + If ObjComp.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + If ObjComp.DtResultados.Rows.Count > 0 Then + FechaPagoAnterior = ObjComp.DtResultados.Rows(0)("FechaVencimiento").ToString.ToDate.ToShortDateString + End If + End If + + If FechaPagoAnterior = TxtFechaPago.Text Then + Alert("La fecha de pago seleccionada es igual que la anterior.", TipoMensaje.MsgAdvertencia) + ObjComp.Dispose() + Exit Sub + End If + + If ObjComp.UpdateFechaVencimientoCompra(CveCompra, TxtFechaPago.Text.ToDate, UsuarioActual.CveEmpresa) Then + Alert("Fecha de pago actualizada correctamente.") + End If + + ObjComp.Dispose() + End Sub End Class \ No newline at end of file diff --git a/Empresas/119/Formatos/RepClientesCxC.rpt b/Empresas/119/Formatos/RepClientesCxC.rpt index 246d65950..f8e06f121 100644 Binary files a/Empresas/119/Formatos/RepClientesCxC.rpt and b/Empresas/119/Formatos/RepClientesCxC.rpt differ diff --git a/Empresas/137/Formatos/RepClientesCxC.rpt b/Empresas/137/Formatos/RepClientesCxC.rpt index 132388990..e73183a2d 100644 Binary files a/Empresas/137/Formatos/RepClientesCxC.rpt and b/Empresas/137/Formatos/RepClientesCxC.rpt differ diff --git a/Empresas/72/Formatos/RepClientesCxC.rpt b/Empresas/72/Formatos/RepClientesCxC.rpt index 3328a6999..7138b6374 100644 Binary files a/Empresas/72/Formatos/RepClientesCxC.rpt and b/Empresas/72/Formatos/RepClientesCxC.rpt differ diff --git a/Empresas/80/Formatos/RepClientesCxC.rpt b/Empresas/80/Formatos/RepClientesCxC.rpt index dd01f9438..627ab3e5c 100644 Binary files a/Empresas/80/Formatos/RepClientesCxC.rpt and b/Empresas/80/Formatos/RepClientesCxC.rpt differ diff --git a/Empresas/Grales/Formatos/RepClientesCxC.rpt b/Empresas/Grales/Formatos/RepClientesCxC.rpt index f7308a548..85aa597c6 100644 Binary files a/Empresas/Grales/Formatos/RepClientesCxC.rpt and b/Empresas/Grales/Formatos/RepClientesCxC.rpt differ diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 7ffc1911c..be0979ef5 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1561,6 +1561,7 @@ Partial Class General_SaldosIniciales End If Else mensajeError = $"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}""" + Throw New Exception() End If Next Else diff --git a/Global.asax b/Global.asax index f69cea9f7..dcb70128c 100644 --- a/Global.asax +++ b/Global.asax @@ -183,7 +183,7 @@ 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing If ObjBancos.GetBancos_TiposTransaccion(-1) Then Application("GlobalDTTipoTransacciones") = ObjBancos.DtResultados Else Application("GlobalDTTipoTransacciones") = Nothing - If ObjBancos.GetBancos_EstatusIE() Then Application("GlobalDTEstatusIE") = ObjBancos.DtResultados Else Application("GlobalDTEstatusIE") = Nothing + If ObjBancos.GetBancos_EstatusIE() Then Application("GlobalDTBancosEstatusIE") = ObjBancos.DtResultados Else Application("GlobalDTBancosEstatusIE") = Nothing If ObjBancos.GetBancos() Then Application("GlobalDTBancos") = ObjBancos.DtResultados Else Application("GlobalDTBancos") = Nothing If ObjBancos.GetBancos_TiposCuenta() Then Application("GlobalDTTipoCuenta") = ObjBancos.DtResultados Else Application("GlobalDTTipoCuenta") = Nothing ObjBancos.Dispose() diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index be7cc478a..130eb6006 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1058,7 +1058,7 @@ Partial Class Inventarios_EntradasSalidas ObjConta.IniciaTransacSQL() End If - If ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, TxtDescripcion.Text, "Inventarios", TxtFolio.Text + " / " + DdlConcepto.SelectedItem.Text) Then + If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, TxtDescripcion.Text, "Inventarios", TxtFolio.Text + " / " + DdlConcepto.SelectedItem.Text) Then TieneError = True End If diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index 829a76939..289615efa 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -152,10 +152,14 @@ Partial Class Inventarios_KardexAlmacen dt = Nothing Return dt Exit Function - End If - End If - - ObjMovimientos.Dispose() + End If + Else + ObjMovimientos.Dispose() + Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError) + Exit Function + End If + + GvDatos.DataBind() For index = 3 To GvDatos.Rows(0).Cells.Count - 1 diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 82bc8cde7..ed0f11905 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2346,16 +2346,18 @@ Partial Class Inventarios_RecepcionAlmacen End If 'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA - If Not ErrorMovInv And CvePrePolizaCompra > 0 Then + If Not ErrorMovInv Then - If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then - If Not ObjConta.PrePolizaUnificacion(CvePrePolizaCompra, CvePrePoliza) Then - ErrorMovInv = True - MensajeError = "Error al unificar los conceptos contables" + If CvePrePolizaCompra > 0 Then + If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then + If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then + ErrorMovInv = True + MensajeError = "Error al unificar los conceptos contables" + End If End If End If - If UsuarioActual.Empresa.Funcionalidad(220) <> "" Or UsuarioActual.CveEmpresa = 119 Then + If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then ErrorMovInv = True MensajeError = "Error al simplificar los conceptos contables" @@ -2458,17 +2460,20 @@ Partial Class Inventarios_RecepcionAlmacen End If 'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA - If Not ErrorMovInv And CvePrePolizaCompra > 0 Then + If Not ErrorMovInv Then - If UsuarioActual.Empresa.Funcionalidad(219) = "1" Or UsuarioActual.CveEmpresa = 119 Then - If Not ObjConta.PrePolizaUnificacion(CvePrePolizaCompra, CvePrePoliza) Then - ErrorMovInv = True - MensajeError = "Error al unificar los conceptos contables" + If CvePrePolizaCompra > 0 Then + If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then + If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then + ErrorMovInv = True + MensajeError = "Error al unificar los conceptos contables" + End If End If End If - If UsuarioActual.Empresa.Funcionalidad(220) <> "" Or UsuarioActual.CveEmpresa = 119 Then - If Not ObjConta.PrePolizaSimplificacion(CvePrePolizaCompra, UsuarioActual.CveEmpresa) Then + + If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then + If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then ErrorMovInv = True MensajeError = "Error al simplificar los conceptos contables" End If @@ -2743,6 +2748,17 @@ Partial Class Inventarios_RecepcionAlmacen End If End If + If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) + ObjContaAC.IniciaTransacSQL() + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then + MensajeError = $"
Movimiento contabilizado en el folio: {ObjConta.ContaFolio}
" + Else + ErrorMovInv = True + MensajeError = "Error al contabilizar los conceptos contables" + End If + End If + 'FINAL If Not ErrorMovInv Then diff --git a/LogMail.txt b/LogMail.txt new file mode 100644 index 000000000..def4d02c0 --- /dev/null +++ b/LogMail.txt @@ -0,0 +1 @@ + 28/08/2019:04:44 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 79 28/08/2019:05:48 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 80 \ No newline at end of file diff --git a/Sistemas/ConfiguracionEmpresa.aspx b/Sistemas/ConfiguracionEmpresa.aspx new file mode 100644 index 000000000..ca36a2e4c --- /dev/null +++ b/Sistemas/ConfiguracionEmpresa.aspx @@ -0,0 +1,121 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ConfiguracionEmpresa.aspx.vb" Inherits="Sistemas_ConfiguracionEmpresa" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + +
+
+
+
+
+ + Cuenta +
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + +
Clientes: + + + + +
Clave de Empresa: + + + +
Razón Social: + + + +
+
+
+
+ + + + + + + + + + + + + +
+ + +
+
+
+ +
+ +
+ + + + + + + +
+ +
+
+ + +
+ + + + diff --git a/Sistemas/ConfiguracionEmpresa.aspx.vb b/Sistemas/ConfiguracionEmpresa.aspx.vb new file mode 100644 index 000000000..2089a9192 --- /dev/null +++ b/Sistemas/ConfiguracionEmpresa.aspx.vb @@ -0,0 +1,23 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports System.Runtime.InteropServices +Imports System.IO + +Partial Class Sistemas_ConfiguracionEmpresa + Inherits ClsPaginas + +#Region " PROPIEDADES " + +#End Region + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + + + End If + End Sub +End Class diff --git a/Sistemas/PopUpAddUsuario.aspx b/Sistemas/PopUpAddUsuario.aspx index 7dd9651a7..9d685feb4 100644 --- a/Sistemas/PopUpAddUsuario.aspx +++ b/Sistemas/PopUpAddUsuario.aspx @@ -69,7 +69,6 @@
-
diff --git a/Sistemas/PopUpAddUsuario.aspx.vb b/Sistemas/PopUpAddUsuario.aspx.vb index 110869def..c99a8cbf3 100644 --- a/Sistemas/PopUpAddUsuario.aspx.vb +++ b/Sistemas/PopUpAddUsuario.aspx.vb @@ -716,6 +716,7 @@ Partial Class Sistemas_PopUpAddUsuario GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros($"CvePlataforma = 6") ElseIf UsuarioActual.Empresa.CvePlataforma = 1 And CveProveedor > 0 Then GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros($"CvePlataforma = 7") + BtnDefaultPWD.Visible = True ElseIf UsuarioActual.Empresa.CvePlataforma = 3 Then GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros("CveModulo = 433") End If @@ -855,4 +856,5 @@ Partial Class Sistemas_PopUpAddUsuario CargaComandos() UpDatos.Update() End Sub + End Class diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 40f948510..371c4b76a 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -255,10 +255,18 @@ + + +
  • + +
  • +
    +
    +
  • - +
  • @@ -266,7 +274,7 @@
  • - +
  • @@ -1129,9 +1137,9 @@ - + Factura - + @@ -1678,7 +1686,7 @@ - + @@ -5464,7 +5472,142 @@
    <%-- END MODAL UNIFICAR EMPRESA CRM --%> - <%-- MODAL MODIFICAR PORCENTAJE PRECIOS --%> + <%-- MODAL MODIFICAR PORCENTAJE MARCAS --%> + + <%-- FIN MODAL MODIFICAR PORCENTAJE MARCAS --%> + + <%-- MODAL MODIFICAR PRECIOS PS --%>
    - <%-- FIN MODAL IMPORTAR SALDOS --%> + <%-- FIN MODAL MODIFICAR PRECIOS PS --%> + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 34f83d72e..81f813eae 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1253,7 +1253,8 @@ Partial Class Clientes 'CargaFormaPago33() 'CargaComboCFDI() - 'LnkPorcentajePrecios.Visible = True + LnkPorcentajeMarcas.Visible = True + LnkPorcentajePrecios.Visible = True If UsuarioActual.TienePermisoProceso(261) Then LnkVerGrafica.Visible = True @@ -3643,14 +3644,14 @@ Partial Class Clientes Dim FechaVencimientoF As String = If(TxtFechaVFCxP.Text = "", "-1", TxtFechaVFCxP.Text).ToString Dim ObjMovtos As New ClsMovimientos() - If ObjMovtos.GetCxCDetalle(FI, FF, CveCliente, -1, -1, -1, -1, -1, "-1", "-1", DdlSucursalCliente.SelectedValue.ToEntero(), "S", -1, "-1", 1, UsuarioActual.CveEmpresa, -1, 1, TipoDocto:=TipoDocto, FechaCorte:=FechaCorte, FechaVI:=FechaVencimientoI, FechaVF:=FechaVencimientoF, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DtCxCFact = ObjMovtos.DtResultados '.FiltraParametros("Tipo = 'Act'").Copy ' If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("CveVentaAmortizacion IS NULL", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVentaAmortizacion IS NULL", "TipoDocto")) + If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then + DtCxCFact = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto")) 'cargo los anticipos NC DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal)) Dim dtt As DataTable = Nothing If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, -1, -1) Then - dtt = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) )") ' que tenga saldo de anticipo y no de cliente + dtt = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )"), ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")) ' que tenga saldo de anticipo y no de cliente If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then For Each drt As DataRow In dtt.Rows Dim drr As DataRow = DtCxCFact.NewRow @@ -3685,7 +3686,7 @@ Partial Class Clientes SaldoIngDolaresPesos = SaldoIngDolaresPesos + (Row("Saldo").ToString.ToDouble * Row("TipoCambio").ToString.ToDouble) End If - ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "Egs" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC + ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "NC" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC ContaAnt = ContaAnt + 1 If Row("CveMoneda").ToString.ToEntero = 1 Then If Row("TipoDocto").ToString = "Dev" Then @@ -8132,14 +8133,13 @@ Partial Class Clientes End Sub #End Region -#Region "PORCENTAJE PRECIO DE PRODUCTOS" - Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click - RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios")) +#Region "PORCENTAJE PRECIO DE MARCAS" + Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas")) CreaDT() - txtPorcentaje.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5")) - CargaPorcentajesProductos() + CargaMarcas() LimpiaModalPorcentaje() End Sub Private Sub CreaDT() @@ -8154,66 +8154,28 @@ Partial Class Clientes End With DTPorcentajeTemp.Columns.Add(column) - DTPorcentajeTemp.Columns.Add("CvePS", GetType(Integer)) - DTPorcentajeTemp.Columns.Add("Producto", GetType(String)) - DTPorcentajeTemp.Columns.Add("PrecioG", GetType(Decimal)) + DTPorcentajeTemp.Columns.Add("CveMarca", GetType(Integer)) + DTPorcentajeTemp.Columns.Add("Marca", GetType(String)) DTPorcentajeTemp.Columns.Add("PorcentajeProducto", GetType(Decimal)) - DTPorcentajeTemp.Columns.Add("PrecioA", GetType(Decimal)) DTPorcentajeTemp.Columns.Add("Estatus", GetType(String)) DTPorcentajePrecios = DTPorcentajeTemp.Clone End Sub - Private Sub CargaPorcentajesProductos() - 'Llenar el dropdownlist de Secciones - If UsuarioActual.CveEmpresa = 66 Then - DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") - Else - Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then - DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados - End If - ObjClasificaciones.Dispose() - End If - DdlClasificacion2.DataBind() + Private Sub CargaMarcas() + Dim ObjMarcas As New ClsProductosServicios + ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) + DdlMarcaPS.DataSource = ObjMarcas.DtResultados + ObjMarcas.Dispose() + DdlMarcaPS.DataBind() + DdlMarcaPS.Items.Insert(0, New ListItem("Seleccione", "-1")) - CargaPS() CargaGridPorcentajes() - UpPorcentaje.Update() End Sub - Private Sub CargaPS() - DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") - - If UsuarioActual.CveEmpresa = 66 Then - DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios") - End If - - If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then - DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2") - - DdlProducto2.DataBind() - - DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - - End Sub - - Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange - DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2) - End Sub - Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost) - Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") - - If drPS IsNot Nothing Then - Dim Precio = drPS("Precio").ToString.ToDouble - LbPrecioG.Text = Precio.FormatoNumero() - LbPrecioA.Text = ((Precio * txtPorcentaje.Text.ToDecimal) / 100).FormatoNumero - End If - End Sub Private Sub CargaGridPorcentajes() Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPorcentajeProductos(CveCliente) Then + If ObjPS.GetPorcentajeMarcas(CveCliente) Then DTPorcentajePrecios = ObjPS.DtResultados GvM.DataSource = DTPorcentajePrecios End If @@ -8232,37 +8194,29 @@ Partial Class Clientes Private Sub LimpiaModalPorcentaje() txtPorcentaje.Text = "" - DdlClasificacion2.SelectedValue = "-1" - DdlProducto2.SelectedText = "" + DdlMarcaPS.SelectedValue = "-1" End Sub - Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click + Protected Sub LbAgregarMarca_Click(sender As Object, e As EventArgs) Handles LbAgregarMarca.Click + If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then - If DdlProducto2.SelectedText <> "" Then - If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then + Dim registro As DataRow = DTPorcentajePrecios.NewRow - Dim registro As DataRow = DTPorcentajePrecios.NewRow - - registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1 - registro.Item("CvePS") = DdlProducto2.SelectedValue.ToEntero - registro.Item("Producto") = DdlProducto2.SelectedText - registro.Item("PrecioG") = 0 - registro.Item("PrecioA") = 0 * txtPorcentaje.Text.ToDecimal / 100 - registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal - registro.Item("Estatus") = "I" - DTPorcentajePrecios.Rows.Add(registro) - CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) - Else - Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia) - End If + registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1 + registro.Item("CveMarca") = DdlMarcaPS.SelectedValue.ToEntero + registro.Item("Marca") = DdlMarcaPS.SelectedItem.Text + registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal + registro.Item("Estatus") = "I" + DTPorcentajePrecios.Rows.Add(registro) + CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) Else - Alert("El campo ''Producto'' es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia) + Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia) End If LimpiaModalPorcentaje() End Sub - Protected Sub DeleteRow(sender As Object, e As EventArgs) + Protected Sub DeleteRowMarca(sender As Object, e As EventArgs) Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton) @@ -8272,7 +8226,7 @@ Partial Class Clientes i = lnkRemove.CommandArgument.ToString.ToEntero Dim Drs As DataRow() = DTPorcentajePrecios.Select(String.Format("No = {0}", i)) If Drs.Count > 0 Then - If CveCliente > 0 AndAlso Drs(0)("CvePS").ToString.ToEntero > 0 Then + If CveCliente > 0 AndAlso Drs(0)("CveMarca").ToString.ToEntero > 0 Then Drs(0)("Estatus") = "D" Else Drs(0).Delete() @@ -8309,7 +8263,6 @@ Partial Class Clientes If Drs.Count > 0 Then Drs(0)("PorcentajeProducto") = PorcentajeProducto - Drs(0)("PrecioA") = Drs(0)("PrecioG").ToString.ToDouble * PorcentajeProducto / 100 Drs(0)("Estatus") = "U" End If @@ -8323,6 +8276,238 @@ Partial Class Clientes End Sub + Protected Sub BtnGuardarPorcentajesMarca_Click(sender As Object, e As EventArgs) Handles BtnGuardarPorcentajesMarca.Click + + Dim TieneError As Boolean = False + + Dim ObjPS As New ClsProductosServicios + ObjPS.IniciaTransacSQL() + + For Each Dr As DataRow In DTPorcentajePrecios.Rows + + If Dr("Estatus").ToString <> "" Then + + If Dr("Estatus").ToString = "I" Then + If Not ObjPS.AddPorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal, UsuarioActual.CveUsuario) Then + TieneError = True + End If + ElseIf Dr("Estatus").ToString = "U" Then + If Not ObjPS.UpdatePorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal) Then + TieneError = True + End If + ElseIf Dr("Estatus").ToString = "D" Then + If Not ObjPS.RemovePorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero) Then + TieneError = True + End If + End If + + End If + Next + + If TieneError Then + ObjPS.RollBack() + Else + ObjPS.Commit() + Alert("Los Porcentajes se guardaron correctamente.", TipoMensaje.MsgInformacion) + RegistraScript("$('#DivPorcentajeMarcas').modal('hide')", "hidemodal") + End If + + ObjPS.Dispose() + + End Sub +#End Region + +#Region "PORCENTAJE PRECIO DE PRODUCTOS" + Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios")) + + CreaDT2() + + TxtPorcentajePS.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5")) + CargaPorcentajesProductos() + LimpiaModalPorcentaje2() + End Sub + Private Sub CreaDT2() + Dim DTPorcentajeTemp As New DataTable + + Dim column As DataColumn = New DataColumn("No") + column.DataType = Type.GetType("System.Int32") + With column + .AutoIncrement = True + .AutoIncrementSeed = 1 + .AutoIncrementStep = 1 + End With + + DTPorcentajeTemp.Columns.Add(column) + DTPorcentajeTemp.Columns.Add("CvePS", GetType(Integer)) + DTPorcentajeTemp.Columns.Add("Producto", GetType(String)) + DTPorcentajeTemp.Columns.Add("PrecioG", GetType(Decimal)) + DTPorcentajeTemp.Columns.Add("PorcentajeProducto", GetType(Decimal)) + DTPorcentajeTemp.Columns.Add("PrecioA", GetType(Decimal)) + DTPorcentajeTemp.Columns.Add("Estatus", GetType(String)) + DTPorcentajePrecios = DTPorcentajeTemp.Clone + End Sub + Private Sub CargaPorcentajesProductos() + 'Llenar el dropdownlist de Secciones + If UsuarioActual.CveEmpresa = 66 Then + DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") + Else + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then + DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados + End If + ObjClasificaciones.Dispose() + End If + DdlClasificacion2.DataBind() + + CargaPS() + CargaGridPorcentajes2() + + UpPorcentajeP.Update() + End Sub + Private Sub CargaPS() + DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + If UsuarioActual.CveEmpresa = 66 Then + DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios") + End If + + If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then + DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2") + + DdlProducto2.DataBind() + + DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + End Sub + + Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange + DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2) + End Sub + Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost) + Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") + + If drPS IsNot Nothing Then + Dim Precio = drPS("Precio").ToString.ToDouble + LbPrecioG.Text = Precio.FormatoNumero() + LbPrecioA.Text = ((Precio * TxtPorcentajePS.Text.ToDecimal) / 100).FormatoNumero + End If + End Sub + + Private Sub CargaGridPorcentajes2() + Dim ObjPS As New ClsProductosServicios + + If ObjPS.GetPorcentajeProductos(CveCliente) Then + DTPorcentajePrecios = ObjPS.DtResultados + GvP.DataSource = DTPorcentajePrecios + End If + ObjPS.Dispose() + + GvP.DataBind() + UpPorcentajePS.Update() + + End Sub + Private Sub CargaDTPorcentajePrecios2(DtTemp As DataTable) + GvP.DataSource = DtTemp + GvP.DataBind() + + UpPorcentajePS.Update() + End Sub + + Private Sub LimpiaModalPorcentaje2() + TxtPorcentajePS.Text = "" + DdlClasificacion2.SelectedValue = "-1" + DdlProducto2.SelectedText = "" + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click + + If DdlProducto2.SelectedText <> "" Then + If TxtPorcentajePS.Text.ToDecimal >= 0 And TxtPorcentajePS.Text.ToDecimal <= 100 Then + + Dim registro As DataRow = DTPorcentajePrecios.NewRow + + registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1 + registro.Item("CvePS") = DdlProducto2.SelectedValue.ToEntero + registro.Item("Producto") = DdlProducto2.SelectedText + registro.Item("PrecioG") = LbPrecioG.Text.ToDecimal + registro.Item("PrecioA") = LbPrecioG.Text.ToDecimal * TxtPorcentajePS.Text.ToDecimal / 100 + registro.Item("PorcentajeProducto") = TxtPorcentajePS.Text.ToDecimal + registro.Item("Estatus") = "I" + DTPorcentajePrecios.Rows.Add(registro) + CargaDTPorcentajePrecios2(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) + Else + Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia) + End If + Else + Alert("El campo ''Producto'' es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia) + End If + + LimpiaModalPorcentaje() + End Sub + + Protected Sub DeleteRow(sender As Object, e As EventArgs) + + Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton) + + + If DTPorcentajePrecios.Rows.Count > 0 And lnkRemove.CommandArgument.ToString.Length > 0 Then + Dim i As Integer + i = lnkRemove.CommandArgument.ToString.ToEntero + Dim Drs As DataRow() = DTPorcentajePrecios.Select(String.Format("No = {0}", i)) + If Drs.Count > 0 Then + If CveCliente > 0 AndAlso Drs(0)("CvePS").ToString.ToEntero > 0 Then + Drs(0)("Estatus") = "D" + Else + Drs(0).Delete() + End If + + End If + DTPorcentajePrecios.AcceptChanges() + End If + + GvP.EditIndex = -1 + + CargaDTPorcentajePrecios2(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) + + End Sub + + Protected Sub GvP_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvP.RowEditing + GvP.EditIndex = e.NewEditIndex + + CargaDTPorcentajePrecios2(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) + End Sub + Protected Sub GvP_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvP.RowCancelingEdit + GvP.EditIndex = -1 + + CargaDTPorcentajePrecios2(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) + End Sub + Protected Sub GvP_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvP.RowUpdating + + Dim PorcentajeProducto As Double = GvP.Rows(e.RowIndex).FCTextBox("TxtPorcentajeP").Text.ToDouble + + If PorcentajeProducto >= 0 And PorcentajeProducto <= 100 Then + Dim No As Integer = GvP.Rows(e.RowIndex).DataKey("No").ToEntero + + Dim Drs As DataRow() = DTPorcentajePrecios.Select(String.Format("No = {0}", No)) + + If Drs.Count > 0 Then + Drs(0)("PorcentajeProducto") = PorcentajeProducto + Drs(0)("PrecioA") = Drs(0)("PrecioG").ToString.ToDouble * PorcentajeProducto / 100 + Drs(0)("Estatus") = "U" + End If + + DTPorcentajePrecios.AcceptChanges() + GvP.EditIndex = -1 + + CargaDTPorcentajePrecios2(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' ")) + Else + Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia) + End If + + End Sub + Protected Sub BtnGuardarPorcentajes_Click(sender As Object, e As EventArgs) Handles BtnGuardarPorcentajes.Click Dim TieneError As Boolean = False @@ -8473,7 +8658,7 @@ Partial Class Clientes End Sub - Function FolioNotaCredito() As Boolean + Function FolioNotaCredito(Tipo As Integer) As Boolean FolioNotaAcumulador = 0 SerieNotaAcumulador = "" @@ -8485,7 +8670,7 @@ Partial Class Clientes If DTSucursales.Rows.Count > 0 Then - If ObjFolios.GetFolios("Egs", UsuarioActual.CveEmpresa) Then + If ObjFolios.GetFolios(If(Tipo = 1, "RNC", "Egs"), UsuarioActual.CveEmpresa) Then Dim DT As DataTable If UsuarioActual.CveSubProyecto > 0 Then @@ -8862,7 +9047,7 @@ Partial Class Clientes Dim Folio As Integer = 0 Dim Serie As String = "" - If FolioNotaCredito() Then + If FolioNotaCredito(Tipo) Then Folio = FolioNotaAcumulador Serie = SerieNotaAcumulador End If @@ -8879,7 +9064,7 @@ Partial Class Clientes ObjFactura.CveMoneda = 1 ObjFactura.Moneda = "Pesos" ObjFactura.MonedaSAT = "MXN" - ObjFactura.TipoDocto = "Egs" + ObjFactura.TipoDocto = If(Tipo = 1, "RNC", "Egs") ObjFactura.Folio = Folio @@ -9013,7 +9198,7 @@ Partial Class Clientes End If - If ObjFactura.TipoDocto = "Egs" Then + If ObjFactura.TipoDocto.Contiene("Egs", "RNC") Then ObjFactura.CveTipoRelacion = -1 End If diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index c8c23ac17..29c2aca5d 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -130,7 +130,7 @@
    -
    +
    diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index efd4939a0..31ec53798 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -212,6 +212,14 @@ Partial Class ProductosyServicios InicializaEcommerce() + If UsuarioActual.CveEmpresa.Contiene(141) Then + 'DivDatos.Attributes("class") = "col-md-12" + + DivDdlTipo.Visible = True + DdlTipoPSDes.Attributes.Add("onChange", "CreaDescripcionPS();") + + End If + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then 'DivDatos.Attributes("class") = "col-md-12" TxtPS.Enabled = False diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index cd394656f..3dbbbcf11 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -89,7 +89,8 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas { var resp = Timbrado.VerificarVigenciaSAT(uuid, UsuarioActual.Empresa.RFC, receptor, total, UsuarioActual.Empresa.FacturaProduccion); if (resp != null) - { + { + if (resp.Estado == null) { sb.Append("No se pudo comprobar el estado de la factura. El servicio del sat no esta disponible"); @@ -100,7 +101,15 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas sb.AppendFormat("Codigo Estado: {0}
    ", resp.CodigoEstatus); sb.AppendFormat("Estado: {0}
    ", resp.Estado); sb.AppendFormat("Es Cancelable: {0}
    ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); - sb.AppendFormat("Estatus de Cancelación: {0}

    ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); + sb.AppendFormat("Estatus de Cancelación: {0}

    ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); + + //var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; + + //sb.AppendFormat("{0}
    ", FueCancelado); + //if (CveEstatus.Contiene(4, 5) && EsRefacturacion) + //{ + // Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta)); + //} if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE")) { @@ -123,7 +132,8 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate(); } - var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC); + var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; + sb.AppendFormat("{0}
    ", FueCancelado); if (CveEstatus.Contiene(4, 5) && EsRefacturacion) { @@ -160,137 +170,11 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas return sb.ToString(); } - private string CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion) + private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion) { - string Mensaje = ""; - ClsVentas ObjVentas = new ClsVentas(); - ClsOIEventos ObjEventos = new ClsOIEventos(ObjVentas.IniciaTransacSQL()); - ClsContabilidad ObjConta = new ClsContabilidad(ObjVentas.IniciaTransacSQL()); - ClsContPAQi ObjContPaq = null; - - try - { - if (UsuarioActual.Empresa.UsaAC || UsuarioActual.Empresa.Funcionalidad(200) == "1") - { - ObjContPaq = new ClsContPAQi(UsuarioActual.Empresa); - ObjContPaq.IniciaTransacSQL(); - } - bool ErrorCancelar = false; - var ErrorList = new List(); - - int IDPoliza = -1; - int CvePrePolizaCancelacion = -1; - - // CANCELA PREPOLIZA - ErrorCancelar = !ObjVentas.ProcesoPrepolizasCancelacion(CveVenta, UsuarioActual.CveUsuario); - - if (ErrorCancelar) - { - Mensaje = "Ocurrió un error al generar la prepoliza de cancelación."; - } - else - { - if (ObjVentas.DtResultados.Rows.Count > 0) - { - CvePrePolizaCancelacion = ObjVentas.DtResultados.FiltroPrimeroValor("CvePrepolizaCancelacion").ToEntero(); - if (CvePrePolizaCancelacion <= 0) - { - ErrorCancelar = true; - Mensaje = "Ocurrió un error al generar la prepoliza de cancelación."; - } - } - else - { - ErrorCancelar = true; - Mensaje = "Ocurrió un error al generar la prepoliza de cancelación."; - } - } - - // POLIZA DE CANCELACION - if (!ErrorCancelar) - { - if (UsuarioActual.Empresa.UsaAC) - { - IDPoliza = GenerarPolizaAC(ObjContPaq, CveVenta, Folio, CveCliente, TipoComprobante, DateTime.Now, true); - if ((IDPoliza <= 0)) - { - ErrorCancelar = true; - Mensaje = "Ocurrió un error al generar la poliza de cancelación."; - } - } - } - - //AUTO CONTABILIDAD - if (!ErrorCancelar) - { - if (UsuarioActual.Empresa.Funcionalidad(200) == "1" & !ErrorCancelar && CvePrePolizaCancelacion > 0) - { - if (!ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta: ObjContPaq)) - { - ErrorCancelar = true; - Mensaje = "Ocurrió un error al contabilizar. Favor de ponerse en contacto con Soporte Técnico"; - } - } - } - - // ACTUALIZA ESTATUS - if (!ErrorCancelar) - { - switch (TipoComprobante) - { - case "Rem": - CveEstatus = 12; - break; - case "Com": - CveEstatus = 9; - break; - } - if (!ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion)) - { - ErrorCancelar = true; - Mensaje = "Ocurrió un error al guardar el estatus de cancelación."; - } - } - - if (!ErrorCancelar) - { - if (ObjContPaq != null) - { - ObjContPaq.Commit(); - } - ObjVentas.Commit(); - Mensaje = "El Documento se canceló correctamente"; - } - else - { - if (ObjContPaq != null) - { - ObjContPaq.RollBack(); - } - ObjVentas.RollBack(); - } - } - catch (Exception ex) - { - ObjVentas.RollBack(); - if (ObjContPaq != null) - { - ObjContPaq.RollBack(); - } - Mensaje = "Ocurrió un error al cancelar la factura"; - this.OnError(Mensaje, ex); - } - finally - { - ObjVentas.Dispose(); - ObjEventos.Dispose(); - ObjConta.Dispose(); - if (ObjContPaq != null) - { - ObjContPaq.Dispose(); - } - } - return Mensaje; + var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa); + var retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse); + return retorno; } private int GenerarPolizaAC(ClsContPAQi ObjAC, int CveVenta, string Folio, int CveCliente, string TipoComprobante, DateTime Fecha, bool CancelacionIngreso = false) diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb index 09571d5be..9ae1ecc1e 100644 --- a/Ventas/RepVentaDetalle.aspx.vb +++ b/Ventas/RepVentaDetalle.aspx.vb @@ -7,9 +7,10 @@ Imports Microsoft.Reporting.WebForms Imports System.IO Imports System.IO.Compression Imports System.Net - +Imports System.Net.Http + Partial Class RepVentaDetalle - Inherits ClsPaginas + Inherits ClsPaginas #Region "P R O P I E D A D E S" Private Property CveProyecto As Integer Get @@ -88,10 +89,10 @@ Partial Class RepVentaDetalle Set(value As DataTable) ViewState("DtColor") = value End Set - End Property - + End Property + #End Region - 'pRivate ReadOnly Property ColumnasVisibles As + 'pRivate ReadOnly Property ColumnasVisibles As Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") @@ -233,8 +234,8 @@ Partial Class RepVentaDetalle DdlVendedor.Enabled = False End If - End Sub - + End Sub + #Region "CARGA COMBOS" Private Sub CargaGrupo() DdlGrupo.Items.Insert(0, New ListItem("Año", "1")) @@ -386,9 +387,9 @@ Partial Class RepVentaDetalle DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) DdlSubProyecto.DataBind() 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub + End Sub #End Region - + #Region "SELECTED INDEX CHANGE" Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs) CargaEstatus() @@ -416,10 +417,10 @@ Partial Class RepVentaDetalle 'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1") 'DdlClientes.DataBind() 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - + End Sub + #End Region - + #Region "CONSULTAR" Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() @@ -470,12 +471,12 @@ Partial Class RepVentaDetalle ObjVentas.Dispose() GvDatos.DataBind() GvVsh.DataBind() - End Sub - + End Sub + #End Region - + #Region "GRIDVIEW" - + Private Function AddRows(ByRef DT As DataTable) As DataTable Dim i As Integer = 0 Dim Ultima As String = String.Empty @@ -589,11 +590,11 @@ Partial Class RepVentaDetalle e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right End If - End Sub + End Sub #End Region - + #Region "PERSONALIZAR COLUMNAS" - + Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click If ChkFolio.Checked Then @@ -777,10 +778,10 @@ Partial Class RepVentaDetalle ImgExcelPersonalizado.Visible = False End If UPDatos.Update() - End Sub - + End Sub + #End Region - + #Region "IMPRESIONES" Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click 'GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString) @@ -872,7 +873,28 @@ Partial Class RepVentaDetalle Response.AddHeader("content-Disposition", "attachment; filename=ReporteVentasPDF.zip") Response.ContentType = "application/zip" Response.End() - End Sub + End Sub + Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte() + Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) + Dim File As Byte() = Nothing + Try + Using httpClient = New HttpClient() + httpClient.Timeout = New TimeSpan(0, 15, 0) + Using request = New HttpRequestMessage(HttpMethod.Get, Url) + request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks))) + Dim response = httpClient.SendAsync(request).Result + If response.StatusCode = Net.HttpStatusCode.OK Then + File = response.Content.ReadAsByteArrayAsync().Result + End If + End Using + End Using + Catch ex As Exception + File = Nothing + OnError("Ocurrió un error al descargar la factura", ex) + End Try + + Return File + End Function Private Sub BtnDescargarXML_Click(sender As Object, e As EventArgs) Handles BtnDescargarXML.Click Dim pathXML As String @@ -972,132 +994,134 @@ Partial Class RepVentaDetalle GenerarPDF() End Sub - Private Sub GenerarFacturaVentaDEV(CveVenta As Integer) - Dim ObjVentas As New ClsVentas - Dim Vta As Modelos.Factura = Nothing - - Dim TmpDTImpuestos = New DataTable - TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) - TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) - TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) - - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - Dim dtVentas As DataTable = ObjVentas.DtResultados - - ' se rellenan los campos de la factura - Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura) - - Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString - 'se rellena la sucursal - Vta.Cliente.Sucursal = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel).ToString - Vta.Cliente = New Modelos.ClienteModel - Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString - Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString - Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString - Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString - Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString - Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString - Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString - Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString - Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString - Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString - Vta.AtencionA = dtVentas(0)("AtencionA").ToString - Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString - Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString - Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString - Vta.Cliente.Mail = dtVentas(0)("Mail").ToString - Vta.RefDocto = dtVentas(0)("Ref").ToString - Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero - - - Vta.ClienteSucursal = New Modelos.SucursalModel - Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString - Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString - Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString - Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString - Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString - Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString - Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString - Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString - Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString - Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString - Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString - Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString - - Vta.EnviarA = New Modelos.EnviarAModel - Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero - Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString - Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString - Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString - Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString - Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString - - Dim DR As DataRow = TmpDTImpuestos.NewRow() - If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR) - - 'solo para eclipse, que muesre un subtotal debajo de IVA - If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - End If - - If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra - Vta.DtDetalle = ObjVentas.DtResultados - End If - - If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then - If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - Dim dtImpuesto As DataTable = ObjVentas.DtResultados - If dtImpuesto.Rows.Count > 0 Then - For Each Row As DataRow In dtImpuesto.Rows - Dim Orden = 80 - If Row("Importe").ToString.ToDouble <> 0 Then - DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString - DR("Importe") = Row("Importe").ToString.ToDouble - DR("Orden") = Orden - TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - Orden = Orden + 1 - End If - Next - End If - Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC") - Else - Vta.DtDeduccion = ObjVentas.DtResultados - End If - End If - - If ObjVentas.GetVentasFirmas(CveVenta) Then - Vta.DtFirmas = ObjVentas.DtResultados - End If - End If - ObjVentas.Dispose() - - If Not IsNothing(Vta) Then - PdfFactura(Vta) - Vta = Nothing - End If - - End Sub - + Private Sub GenerarFacturaVentaDEV(CveVenta As Integer) + + DescargarFactura(CveVenta, UsuarioActual.CveEmpresa) + 'Dim ObjVentas As New ClsVentas + 'Dim Vta As Modelos.Factura = Nothing + + 'Dim TmpDTImpuestos = New DataTable + 'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) + 'TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) + 'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) + + 'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + ' Dim dtVentas As DataTable = ObjVentas.DtResultados + + ' ' se rellenan los campos de la factura + ' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/")) + + ' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString + ' 'se rellena la sucursal + ' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa) + ' Vta.Cliente = New Modelos.ClienteModel + ' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString + ' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString + ' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString + ' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString + ' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString + ' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString + ' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString + ' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString + ' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString + ' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString + ' Vta.AtencionA = dtVentas(0)("AtencionA").ToString + ' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString + ' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString + ' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString + ' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString + ' Vta.RefDocto = dtVentas(0)("Ref").ToString + ' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero + + + ' Vta.ClienteSucursal = New Modelos.SucursalModel + ' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString + ' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString + ' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString + ' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString + ' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString + ' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString + ' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString + ' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString + ' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString + ' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString + ' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString + ' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString + + ' Vta.EnviarA = New Modelos.EnviarAModel + ' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero + ' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString + ' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString + ' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString + ' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString + ' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString + + ' Dim DR As DataRow = TmpDTImpuestos.NewRow() + ' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then + ' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR) + + ' 'solo para eclipse, que muesre un subtotal debajo de IVA + ' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' End If + + ' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra + ' Vta.DtDetalle = ObjVentas.DtResultados + ' End If + + ' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then + ' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then + ' Dim dtImpuesto As DataTable = ObjVentas.DtResultados + ' If dtImpuesto.Rows.Count > 0 Then + ' For Each Row As DataRow In dtImpuesto.Rows + ' Dim Orden = 80 + ' If Row("Importe").ToString.ToDouble <> 0 Then + ' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString + ' DR("Importe") = Row("Importe").ToString.ToDouble + ' DR("Orden") = Orden + ' TmpDTImpuestos.Rows.Add(DR) + ' DR = TmpDTImpuestos.NewRow() + ' Orden = Orden + 1 + ' End If + ' Next + ' End If + ' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC") + ' Else + ' Vta.DtDeduccion = ObjVentas.DtResultados + ' End If + ' End If + + ' If ObjVentas.GetVentasFirmas(CveVenta) Then + ' Vta.DtFirmas = ObjVentas.DtResultados + ' End If + 'End If + 'ObjVentas.Dispose() + + 'If Not IsNothing(Vta) Then + ' PdfFactura(Vta) + ' Vta = Nothing + 'End If + + End Sub + #End Region - + #Region "GRAFICA" - + Private Sub CreaDataTableColor() DtColor = New DataTable DtColor.Columns.Add("Color") @@ -1228,9 +1252,9 @@ Partial Class RepVentaDetalle Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs) CambioGrafica() - End Sub - + End Sub + #End Region - - + + End Class diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index a20b8a60a..e501478f8 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3776,7 +3776,7 @@ Partial Class Ventas End If TxtTipoCambio.Text = DbRowVenta("TipoCambio").ToString - If DbRowVenta("TipoCambio").ToString.ToDecimal <> DbRowVenta("TipoCambioValuacion").ToString.ToDecimal Then + If DbRowVenta("UltimasFluctuaciones").ToString <> "" Then LblTCValuacion.Text = String.Format("Ult. Val:{0}", DbRowVenta("UltimasFluctuaciones").ToString) LblTCValuacion.Visible = True End If @@ -7266,7 +7266,13 @@ Partial Class Ventas Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False) - ObjFactura = New Modelos.Factura + + If Me.CveVenta > 0 Then + ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa) + Else + ObjFactura = New Modelos.Factura + End If + ObjFactura.Version = "3.3" ObjFactura.CveUsuario = UsuarioActual.CveUsuario @@ -10275,6 +10281,13 @@ Partial Class Ventas End If End If + 'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO + If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then + If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then + ErrorPrepoliza = True + End If + End If + Return ErrorPrepoliza Catch ex As Exception GuardaLog(ex.ToString()) @@ -11183,6 +11196,7 @@ Partial Class Ventas Dim ObjConta As New ClsContabilidad Dim ObjVenta As New ClsVentas(ObjConta.IniciaTransacSQL()) + Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL()) Dim ObjContpaq As ClsContPAQi = Nothing Dim CvePrepoliza As Integer @@ -11215,11 +11229,16 @@ Partial Class Ventas ' FechaMaxima = "01/01/2018".ToDate 'End If + + + + CvePrepoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrepoliza > 0 Then Dim tipoCambioPago As Decimal = 1 Dim tipoCambioVenta As Decimal = 1 + Dim tipoCambioVentaValuacion As Decimal = 1 Dim PorcentajePago As Decimal = 100 Dim dtConceptos As DataTable = Nothing Dim CveMonedaVenta = DdlMoneda.SelectedValue.ToEntero @@ -11243,21 +11262,42 @@ Partial Class Ventas For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then + + Dim FechaUltimaFluctuacion As Date = MinFecha + Dim TipoCambioFluctuacion As Decimal = 1 + If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Dim tFecha As Date = gvr.DataKey("Fecha").ToDate + Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) + Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC") + + If drr IsNot Nothing Then + FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate + TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal + End If + + End If + End If + If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos tipoCambioPago = 1 tipoCambioVenta = 1 + tipoCambioVentaValuacion = 1 PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Dolares y se va a pagar en Pesos tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal tipoCambioVenta = TxtTipoCambio.Text.ToDecimal + tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES tipoCambioPago = gvr.DataKey("TipoCambio").ToString.ToDecimal tipoCambioVenta = TxtTipoCambio.Text.ToDecimal + tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal tipoCambioVenta = 1 + tipoCambioVentaValuacion = 1 PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal End If @@ -11284,17 +11324,17 @@ Partial Class Ventas importeMX = importeMovimiento ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta + importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVentaValuacion ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta + importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVentaValuacion ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal importeMX = importeMovimiento End If importeMovimiento = Math.Round(importeMovimiento, 2) importeMX = Math.Round(importeMX, 2) - TipoCambioGeneral = tipoCambioVenta + TipoCambioGeneral = tipoCambioVentaValuacion If CveMonedaVenta = 1 Then IdCtaContable = IdCtaContClientes @@ -11315,7 +11355,7 @@ Partial Class Ventas CveCuentaContabilizacion = 0 End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVentaValuacion) Then ErrorConta = True End If @@ -11543,13 +11583,14 @@ Partial Class Ventas If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria + Dim TipoCambioGanancia As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta) - If tipoCambioPago > tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta) 'Añadimos la diferencia de ganancia en la venta + If tipoCambioPago > TipoCambioGanancia AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * TipoCambioGanancia) 'Añadimos la diferencia de ganancia en la venta importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2)) importeMX = importeMovimiento End If - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVenta, tipoCambioPago) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioGanancia, tipoCambioPago) TipoCambioGeneral = TCImpuestos Else importeMovimiento = 0 @@ -11558,13 +11599,14 @@ Partial Class Ventas If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria + Dim TipoCambioPerdida As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta) - If tipoCambioPago < tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta + If tipoCambioPago < TipoCambioPerdida AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * TipoCambioPerdida) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2)) importeMX = importeMovimiento End If - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVenta, tipoCambioPago) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPerdida, tipoCambioPago) TipoCambioGeneral = TCImpuestos Else importeMovimiento = 0 @@ -11627,6 +11669,8 @@ Partial Class Ventas End If ObjConta.Dispose() + ObjIE.Dispose() + Else 'cuando no se ha registrado la venta @@ -15718,7 +15762,7 @@ Partial Class Ventas If UsuarioActual.CveEmpresa.Contiene(126) Then If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero > 0 Then If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then - ErrorList.Add("Ocurrió un error al actualizar la orden de producción") + OcurrioError = True End If End If End If @@ -15728,7 +15772,7 @@ Partial Class Ventas If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre = 2 Then OcurrioError = True - ErrorList.Add(ObjConta.MensajePolizaDescuadre) + Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError) End If End If End If @@ -17096,6 +17140,8 @@ Partial Class Ventas TxtPrecio.Text = GvRow.FCLiteral("LtlPU").Text RegistraScript("Recalcula();") LbAgregar_Click(Nothing, Nothing) + Else + DdlPS_SelectedIndexChanged(Nothing, Nothing) End If End Sub Protected Sub OrdenarGvPS(ByVal sender As Object, ByVal e As EventArgs) @@ -17382,874 +17428,40 @@ Partial Class Ventas CancelarRefacturada() End If - 'La validacion de saldos cuando es refacturacion se hace antes asi que si es refacturacion ignoramos esta condicion, si es Anticipo verifica que no esté aplicado - If DdlTipoComprobante.SelectedValue = "Ant" AndAlso (HdnPagado.Value.ToDecimal > 0 Or GvAntNC.Rows.Count > 0) Then - Alert("La factura no se puede cancelar debido a que tiene pagos vinculados.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'La validacion de saldos cuando es refacturacion se hace antes asi que si es refacturacion ignoramos esta condicion - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso HdnPagado.Value.ToDecimal > 0 Then - Alert("La factura no se puede cancelar debido a que tiene pagos vinculados.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - - 'Si la remision esta facturada no se puede cancelar - If DdlTipoComprobante.SelectedValue = "Rem" Then - Dim ObjV As New ClsVentas - If ObjV.VerificarRemisionFacturada(CveVenta) Then - If ObjV.DtResultados.Rows.Count > 0 Then - Alert("La remisión no se puede cancelar debido a que ya esta vinculada a una factura.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - End If - ObjV.Dispose() - End If - - 'CARGA REMISIONES DE LA VENTA DEVUELTA - Dim DtDevRem As New DataTable - If Not EsRefacturacion Then - Dim ObjInventarioTemporal As New ClsInventarios() - If ObjInventarioTemporal.GetDevolucionRemisionesCanceladas(CveVenta) Then - DtDevRem = ObjInventarioTemporal.DtResultados - Else - Alert("Ocurrió un error al verificar los movimientos de almacén relacionados al documento.", TipoMensaje.MsgError) - ObjInventarioTemporal.Dispose() - Exit Sub - End If - ObjInventarioTemporal.Dispose() - End If - - '[IPP] FALTA TERMINAR 27/Noviembre/2018 - '' si tiene movimientos en almacen que se hallan surtido en el documento actual, y sigue sin ser marcado como devuelto - 'If (GvInv.Rows.Count > 0 AndAlso DevolucionAlmacen.Contiene(0, 1)) And DtDevRem.COUNT("CantidadSurtida", "ISNULL(CveRem,0) = 0") > 0 Then ' [COMENTADO IPP 3 Agosto 2017] | AndAlso Not (DdlTipoComprobante.SelectedValue.Contiene("Rem", "DPe")) | REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN - ' Alert("La factura no se puede cancelar debido a que tiene movimientos de inventario.", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If - - Dim ReviveRemision As Boolean = False - 'RMF. ANOTACION. cuando se cancela, y tiene relacionada una remisión, y esta no se cancelará. debe de hacer en automático los movimientos al almacen de entrega por adelantado - If Not EsRefacturacion AndAlso ChkCanRem.Visible AndAlso ChkCanRem.Checked = False Then - ReviveRemision = True - End If - If Not EsRefacturacion AndAlso (VentaSaldoAlmacen > 0 AndAlso DevolucionAlmacen.Contiene(0, 1)) AndAlso Not ChkDevAlm.Checked And ReviveRemision = False Then ' [COMENTADO IPP 3 Agosto 2017] | AndAlso Not (DdlTipoComprobante.SelectedValue.Contiene("Rem", "DPe")) | REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN - Alert("La factura no se puede cancelar debido a que tiene movimientos de inventario.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - Dim CancelacionFecha As Date - Dim CancelacionAcuse As String = "" - Dim MensajeError As String = "" - Dim ObjCancelacion As New Timbrado - Dim TotalT As Decimal = TxtTotal.Text.ToDecimal - Dim RFCReceptor As String = LblRFC.Text.Trim - Dim CvePACCancelacion As Integer = CvePAC - Dim CveEstatus As Integer = 4 - Dim IDPoliza As Integer = -1 - Dim CvePrePoliza As Integer - Dim CvePlantillaPoliza As Integer - Dim ErrorCancelar As Boolean = False - - Dim Continuar As Boolean = False - Dim ContinuarCancelacion As Boolean = False - Dim ObtenerAcuse As Boolean = False - Dim RequiereAceptacion As Boolean = False - Dim Mensaje As String = "" - Try - If FolioFiscal <> "" Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then - - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion) - If Vigencia IsNot Nothing Then - If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then - Alert("Esta factura no es cancelable.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then - ContinuarCancelacion = False - ObtenerAcuse = True - Dim solicitud = New WSGF.Service1SoapClient() - Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal) - - If acuse.Estado = 0 Then - Dim xmlAcuse = New System.Xml.XmlDocument() - xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64)) - CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText - CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate() - CveEstatus = 5 - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - CveEstatus = 5 - End If - - ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then - - If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then - CveEstatus = 20 - ContinuarCancelacion = False - If ChkCanRem.Checked Then SeCancelaRemisionProceso = True - ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then - CveEstatus = 20 - ContinuarCancelacion = True - RequiereAceptacion = True - If ChkCanRem.Checked Then SeCancelaRemisionProceso = True - ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then - ContinuarCancelacion = True - CveEstatus = 5 - End If - - Else - If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then - ContinuarCancelacion = True - CveEstatus = 5 - Else - 'Alert("La factura no se puede cancelar debido a que no se encontro su estatus en el SAT.", TipoMensaje.MsgAdvertencia) - 'Exit Sub - CveEstatus = 20 - ContinuarCancelacion = False - CancelacionFecha = Now.Date - CancelacionAcuse = "" - If ChkCanRem.Checked Then SeCancelaRemisionProceso = True - End If - End If - Else - Alert("No se pudo comprobar la vigencia de la factura.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - If Not ObtenerAcuse Then - If ContinuarCancelacion Then - If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then - 'Generamos el acuse y mandamos mail de con el acuse de cancelación - DF 13/01/2017 - If RequiereAceptacion Then - CancelacionFecha = Now.Date - CancelacionAcuse = "" - CveEstatus = 20 - If ChkCanRem.Checked Then SeCancelaRemisionProceso = True - Else - CancelacionFecha = ObjCancelacion.CancelacionFecha - CancelacionAcuse = ObjCancelacion.CancelacionAcuse - CveEstatus = 5 - End If - Else - Alert("La factura no se pudo cancelar ante el SAT", TipoMensaje.MsgError) - Exit Sub - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - Else - CancelacionFecha = Now.Date - CancelacionAcuse = "" - End If - Catch ex As Exception - MensajeError = "Ocurrió un Error al Cancelar la factura con los servicios del SAT." - GuardaLog($"{MensajeError} - Error:{ex.Message}") - Alert(MensajeError, TipoMensaje.MsgError) - Exit Sub - End Try - - Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL() - Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) - Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) - Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL()) - Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL()) - Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL()) - Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Then - ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() - End If CreaObjetosVenta() + Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing - ObjFactura.CveVenta = CveVenta - If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then - CvePlantillaPoliza = 7 - ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then - CvePlantillaPoliza = 4 - Else - CvePlantillaPoliza = 4 - End If + If ObjFactura IsNot Nothing AndAlso ObjFactura.CveVenta > 0 Then - If ((HplSaldoAuxiliar.Text.ToDecimal > 0 OrElse (TxtTotal.Text.ToDecimal = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse CvePlantillaPoliza = 7 Then - 'RMF. 2018.08.08 cuando se cancela, la póliza debe de ser de diario - CvePrePoliza = ObjConta.AddPrePolizas("Ventas/CancelarDocumento", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) - ObjFactura.CvePrePoliza = CvePrePoliza - - 'CANCELAR PAGOS - If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then - If Not ErrorCancelar Then - If Not ObjConta.PrePolizasCancelarPagos(CveDevolucion, CvePrePoliza) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al generar la prepoliza de cancelación de pago." - End If - End If - End If - - 'CANCELA PREPOLIZA - If Not ErrorCancelar Then - ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos) - MensajeError = "Ocurrió un error al generar la prepoliza de cancelación." - End If - - 'CANCELA IMPUESTOS LOCALES - If Not ErrorCancelar Then - ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, -1) - MensajeError = "Ocurrió un error al cancelar los impuestos locales." - End If - End If - - 'CANCELA CONTRATOS - If Not EsRefacturacion Then - If Not ErrorCancelar Then - ErrorList = New List(Of String) - If ObjFactura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then - GuardarContratoAvanceEstimaciones(ObjContrato, ObjFactura, ErrorList, -1, True) - ErrorCancelar = ErrorList.Count > 0 - MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato." - ElseIf ObjFactura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Then - GuardarContratoAvanceEstimaciones(ObjContrato, ObjFactura, ErrorList, 1, True) - ErrorCancelar = ErrorList.Count > 0 - MensajeError = "Ocurrió un error al cancelar los avances del contrato." - End If - End If - End If - - - 'DESVINCULA COTIZACIONES PREDECESORAS - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then - If Not ObjVentas.LiberarCotizacionesFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las cotizaciones." - End If - End If - End If - End If - - 'DESVINCULA PEDIDOS2 PREDECESORES - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then - If Not ObjVentas.LiberarPedidos2Facturados(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular los pedidos." - End If - End If - End If - End If - - - 'DESVINCULA OCs PREDECESORAS - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If DdlTipoComprobante.SelectedValue = "Ing" Then - If Not ObjVentas.LiberarOCFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las Ordenes de Compra." - End If - End If - End If - End If - - 'ELIMINA LAS VENTAS DETALLE DE LA DEVOLUCION - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If DdlTipoComprobante.SelectedValue = "Dev" Then - If Not ObjVentas.RemoveVentaDetalleDevolucion(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al eliminar las ventas detalle devolución." - End If - End If - End If - End If - 'POLIZA DE CANCELACION - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If UsuarioActual.Empresa.UsaAC Then - IDPoliza = GenerarPolizaAC(ObjAC, True) - If IDPoliza <= 0 Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al generar la poliza de cancelación." - End If - End If - End If - End If - - 'DEVOLUCION DE ALMACEN - If ChkDevAlm.Checked Or ReviveRemision Then - Dim TieneSalida As Boolean = False - Dim DtDatos As New DataTable - Dim DtExistencias As New DataTable - - If DevolucionAlmacen = 0 Then - Dim EstatusDevolucion = 1 - If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al solicitar la devolucion de almacen." - End If - End If - - If Not ErrorCancelar AndAlso ObjInventario.EntregaAlmacenGet(CveVenta) Then - If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - DtDatos = ObjInventario.DtResultados - DtDatos.Columns.Add("Consec", GetType(Integer)) - DtDatos.Columns.Add("CantidadGV", GetType(Double)) - DtDatos.Columns.Add("CantidadTraspaso", GetType(Double)) - Dim Index = 1 - For Each Dr As DataRow In DtDatos.Rows - Dr("Consec") = Index - Dr("CantidadGV") = Dr("CantidadF") - Index += 1 - Next - - If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 AndAlso ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString.ToEntero > 0 Then - Dim Filtro As String '= If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString.Contiene({"Ing", "Dev", "Ped"}), "CveConcepto = 3", "CveConcepto = 9") - Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString - Case "Ing", "Ped" - Filtro = "CveConcepto = 3" - Case "Dev" - Filtro = "CveConcepto = 3" - Case Else - Filtro = "CveConcepto = 9" - End Select - If ObjInventario.GetInv_Mov(ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}") - - If DtExistencias.Rows.Count > 0 Then - TieneSalida = True - End If - - Else - ErrorCancelar = True - MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." - End If - End If - End If - End If - - If Not ErrorCancelar AndAlso TieneSalida Then - Dim DtDatosDetalle As New DataTable - DtDatosDetalle.Columns.Add("CveVentaDetalle", GetType(Integer)) - DtDatosDetalle.Columns.Add("Consec", GetType(Integer)) - DtDatosDetalle.Columns.Add("ConsecId", GetType(Integer)) - DtDatosDetalle.Columns.Add("CvePS", GetType(Integer)) - DtDatosDetalle.Columns.Add("PS", GetType(String)) - DtDatosDetalle.Columns.Add("CveUM", GetType(Integer)) - DtDatosDetalle.Columns.Add("SerieLote", GetType(String)) - DtDatosDetalle.Columns.Add("FechaCaducidad", GetType(String)) - DtDatosDetalle.Columns.Add("FueTraspaso", GetType(Integer)) - - Dim DtDatosDetalleLote As New DataTable - DtDatosDetalleLote.Columns.Add("CveVentaDetalle", GetType(Integer)) - DtDatosDetalleLote.Columns.Add("Consec", GetType(Integer)) - DtDatosDetalleLote.Columns.Add("ConsecId", GetType(Integer)) - DtDatosDetalleLote.Columns.Add("Cantidad", GetType(Double)) - DtDatosDetalleLote.Columns.Add("CvePS", GetType(Integer)) - DtDatosDetalleLote.Columns.Add("PS", GetType(String)) - DtDatosDetalleLote.Columns.Add("CveUM", GetType(Integer)) - DtDatosDetalleLote.Columns.Add("Lote", GetType(String)) - DtDatosDetalleLote.Columns.Add("Batch", GetType(String)) - DtDatosDetalleLote.Columns.Add("FechaCaducidad", GetType(String)) - DtDatosDetalleLote.Columns.Add("FueTraspaso", GetType(Integer)) - - Dim DtTraspasos As New DataTable - DtTraspasos.Columns.Add("CveAlmacen", GetType(Integer)) - DtTraspasos.Columns.Add("Almacen", GetType(String)) - DtTraspasos.Columns.Add("CveMovimientoSalida", GetType(Integer)) - DtTraspasos.Columns.Add("FolioSalida", GetType(Integer)) - DtTraspasos.Columns.Add("CveMovimientoEntrada", GetType(Integer)) - DtTraspasos.Columns.Add("FolioEntrada", GetType(Integer)) - - Dim ConceptoMovimiento = 18 - Dim CveMovimiento As Integer = 0 - Dim Folio As Integer = 0 - Dim CantidadPendiente As Decimal = 0 - Dim DtDetalle As New DataTable - Dim DtDetalleLote As New DataTable - - CveMovimiento = ObjInventario.AddMovimiento(CveAlmacenDevolucion, ConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1) - Folio = ObjInventario.Folio - - 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) - 'If Not (CveContrato > 0 And CveAlmacenTraspasoDestino > 0) Then - If CveMovimiento > 0 Then - - 'ES EL MOVIMIENTO PRINCIPAL - CantidadPendiente = 0 - For Each Dr As DataRow In DtDatos.Rows - CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal - If CantidadPendiente > 0 Then - Dim PU As Decimal = 0 - - 'SI FUE POR SERIELOTE - DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec"))) - DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec"))) - If DtDetalle.Rows.Count > 0 Then - For Each Dr1 As DataRow In DtDetalle.Rows - If DtExistencias IsNot Nothing Then - PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar." - Exit For - End If - Next - ElseIf DtDetalleLote.Rows.Count > 0 Then - For Each Dr1 As DataRow In DtDetalleLote.Rows - If DtExistencias IsNot Nothing Then - PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar." - Exit For - End If - Next - Else - If DtExistencias IsNot Nothing Then - PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." - Exit For - End If - End If - - End If - Next - Else - ErrorCancelar = True - End If - - If Not ErrorCancelar Then - Dim DtCostos As DataTable = Nothing - Dim ValorInventario As Decimal = 0 - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtCostos = ObjInventario.DtResultados - - Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) - Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero - Dim IdCtaContable As Integer = 0 - Dim CveCuenta As Integer = 0 - If tmpCostos.Rows.Count > 0 Then - - - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then - Dim Fecha As Date = Now - Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero - Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString - Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString - Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL() - Dim TotalCostoAcumulado As Decimal = 0 - Dim cont As Integer = 1 - - Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - 'Se agrega movimiento separado por la cuenta de ventas (ER) - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() - TotalCostoAcumulado += ValorInventario - - 'cuando es el último movimiento y hay diferencias en los importes - If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then - ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) - End If - - 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString) - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - - If Not ErrorCancelar Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, -1 * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, ImporteMX:=-1 * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then - ErrorCancelar = True - End If - End If - - cont += 1 - Next - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, ImporteMX:=-1 * TotalCosto, CveCuenta:=CveCuentaAlmacen) Then - ErrorCancelar = True - End If - - 'AutoConta - El movimiento 1 es el de Venta - - Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" - - If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue = "Ant" Then - AutoConta = False - End If - - If AutoConta And Not ErrorCancelar Then - Dim ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) - - If IdCtaContable > 0 Then - If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then - Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico") - End If - Else - Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia) - End If - - ObjContPaq.Dispose() - End If - - Else - ErrorCancelar = True - MensajeError = "Ocurrió un Error al ingresar las prepolizas" - End If - - End If - End If - End If - - If Not ErrorCancelar Then - If ObjInventario.VentasAlmacenApartadosGet(CveVenta) Then - - Dim DtTempApartados = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 9", "CveAlmacen") - Dim CveMovimientoSalidaApartado = -1 - Dim CveAlmacenApartado = -1 - Dim CveAlmacenOrigen = CveAlmacenDevolucion - Dim FolioSalida As Integer = 0, FolioEntrada = 0, CveMovimientoSalida = 0, CveMovimientoEntradaApartado = 0 - - For Each Dr As DataRow In DtTempApartados.Rows - - If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then - CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveVendedor:=1, CveCliente:=CveCliente, CveAlmacenDestino:=Dr("CveAlmacen").ToString.ToEntero) - FolioSalida = ObjInventario.Folio - CveAlmacenApartado = Dr("CveAlmacen").ToString.ToEntero - - Dim DrMovto = DtTraspasos.NewRow - DrMovto("Almacen") = Dr("Almacen").ToString.ToEntero - DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString.ToEntero - DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado - DrMovto("FolioSalida") = FolioSalida - DtTraspasos.Rows.Add(DrMovto) - End If - - If Not CveMovimientoSalidaApartado > 0 Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados" - Exit For - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados" - Exit For - End If - Next - - If Not ErrorCancelar Then - For Each Dr1 As DataRow In DtTraspasos.Rows - CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString.ToEntero - - CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", CveAlmacenDestino:=CveAlmacenDevolucion, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:="", CveContrato:=CveContrato, CveVendedor:=-1, CveCliente:=CveCliente) - FolioEntrada = ObjInventario.Folio - - If Not CveMovimientoEntradaApartado > 0 Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado - Dr1("FolioEntrada") = FolioEntrada - - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - Next - End If - - If ErrorCancelar Then Exit For - Next - End If - - End If - End If - - 'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION - If Not ErrorCancelar Then - Dim DtMovtosDev As New DataTable - Dim CveAlmacenTraspasoDestinoDevRem = -1 - - Dim CveVentaDetalleRem = -1 - Dim CantidadDevolver As Decimal = 0 - Dim CantidadRem As Decimal = 0 - Dim CveMovimientoSalidaDevRem As Integer = 0 - Dim FolioMovimientoSalidaDevRem As Integer = 0 - Dim CveMovimientoEntradaDevRem As Integer = 0 - Dim FolioMovimientoEntradaDevRem As Integer = 0 - - 'CARGA REMISIONES DE LA VENTA DEVUELTA - If ObjInventario.GetDevolucionRemisionesFacturadas(CveVenta) Then - DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0") - Else - ErrorCancelar = True - End If - - 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtMovtosDev = ObjInventario.DtResultados - Else - ErrorCancelar = True - End If - - If Not ErrorCancelar Then - If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then - - For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows - - 'CHECO SI NO SE VA A CANCELAR - Dim SeCancela As Boolean = False - If ChkCanRem.Checked Then - For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows - If Gvr.FCCheckBox("ChkCancelarRemision").Checked AndAlso DrMovtos("CveRem").ToString.ToEntero = Gvr.DataKey("CveVenta").ToString.ToEntero Then - SeCancela = True - Exit For - End If - Next - End If - - If Not SeCancela Then - - CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero - If Not CveAlmacenTraspasoDestinoDevRem > 0 Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al obtener el almacén de devolucion de remisión." - Exit For - End If - - 'SALIDA GENERAL - CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) - FolioMovimientoSalidaDevRem = ObjInventario.Folio - - 'ENTRADA ADELANTADO - CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion) - FolioMovimientoEntradaDevRem = ObjInventario.Folio - - If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión." - Exit For - End If - - - 'SALIDA POR TRAPASO DE GENERAL - For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows - CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero - CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal - 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble - 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then - - If Not CveVentaDetalleRem > 0 Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al obtener la relación de la venta con la remisión." - Exit For - End If - - For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión." - Exit For - End If - Next - - If ErrorCancelar Then - Exit For - End If - Next - - If ErrorCancelar Then - Exit For - End If - - 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión." - Exit For - End If - Next - - If ErrorCancelar Then - Exit For - End If - - Else - ErrorCancelar = True - MensajeError = "Ocurrió un error al obtener los detalles de la devolución de almacén" - Exit For - End If - - - If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then - MensajeError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar." - ErrorCancelar = True - Exit For - End If - - End If - - Next - End If - Else - MensajeError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar." - ErrorCancelar = True - End If - - End If - - If Not ErrorCancelar Then - 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) - If Not ErrorCancelar Then - If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then - MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." - ErrorCancelar = True - End If - End If - - 'AGREGA BITACORA A VENTA - If Not ErrorCancelar Then - Dim MensajeBitacora = "Devuelta" - If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then - ErrorCancelar = True - End If - End If - End If - - End If - End If - - 'DESVINCULA REMISIONES PREDECESORAS - If Not EsRefacturacion Then - If Not ErrorCancelar Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then - If Not ChkCanRem.Checked Then - If Not ObjVentas.LiberarRemisionesFacturadas(CveVenta) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las remisiones." - End If - Else - For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows - If Not Gvr.FCCheckBox("ChkCancelarRemision").Checked Then - If Not ObjVentas.LiberarRemisionesFacturadas(CveVenta, Gvr.DataKey("CveVenta").ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al desvincular las remisiones." - End If - End If - Next - End If - End If - End If - End If - - - 'ACTUALIZA ESTATUS - If Not ErrorCancelar Then - Select Case DdlTipoComprobante.SelectedValue - Case "Rem" - CveEstatus = 12 - Case "Com" - CveEstatus = 9 - End Select - '0 Sin Refacturacion, 1 Refacturacion en Proceso, 3. Refacturación en proceso sin aceptación - Me.CveEstatusRefacturacion = 0 If EsRefacturacion Then - If CveEstatus = 5 Then - CveEstatusRefacturacion = 3 ' refacturación en proceso sin autorización de cancelación - Else - CveEstatusRefacturacion = 1 ' refacturación en proceso con autorización de cancelación - End If - End If - - - If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, - CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar el estatus de cancelación." - End If - - If ChkCanRem.Checked Then - For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows - If Gvr.FCCheckBox("ChkCancelarRemision").Checked Then - If Not SeCancelaRemisionProceso Then - If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, Gvr.DataKey("CveVenta").ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar el estatus de cancelación de la remisión." - End If - Else - If Not ObjVentas.AddRemisionesXCancelar(CveVenta, Gvr.DataKey("CveVenta").ToEntero) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar la remisión x cancelar." - End If - End If - End If - Next - End If - If SeCancelaRemisionProceso Then - If Not ObjVentas.UpdateCancelaRemision(CveVenta, SeCancelaRemisionProceso) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al actualizar que la remision sea cancelable." - End If - End If - End If - - If Not ErrorCancelar Then - ObjVentas.Commit() - - If CveEstatus = 5 Then - Dim MensajeAlert As New StringBuilder - MensajeAlert.Append("El Documento se canceló correctamente.") - MensajeAlert.Append($"
    Imprimir Acuse") - MensajeAlert.Append("

    ¿Desea enviar el Acuse de Cancelación al Cliente?") - Alert(MensajeAlert.ToString, TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnEnviarMailCancelacion();", TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") - + resp = ObjFactura.CancelarPorRefacturacion() Else - If Not EsRefacturacion Then - Alert("El documento se canceló exitosamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();") - Else - Response.Redirect($"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={Me.CveVenta}") + Dim ListaRemisionesCancelar As New List(Of Integer) + If ChkCanRem.Checked Then + For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows + If Gvr.FCCheckBox("ChkCancelarRemision").Checked Then + ListaRemisionesCancelar.Add(Gvr.DataKey("CveVenta").ToEntero) + End If + Next End If + + If ChkDevAlm.Checked Then + ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion + End If + + resp = ObjFactura.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar) End If - Me.CveEstatus = CveEstatus - If CveEstatus = 5 Then LbCancelarDocumento.Enabled = False - If ObjAC IsNot Nothing Then ObjAC.Commit() - Else - Alert(MensajeError, TipoMensaje.MsgError) - ObjVentas.RollBack() - If ObjAC IsNot Nothing Then ObjAC.RollBack() - End If + If resp.CveEstatus = 5 Then + Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnEnviarMailCancelacion();", TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") + Else + Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();") + End If - ObjVentas.Dispose() - ObjBancos.Dispose() - ObjInventario.Dispose() - ObjContrato.Dispose() - ObjConta.Dispose() - If ObjAC IsNot Nothing Then ObjAC.Dispose() + ObjFactura.CveAlmacen = -1 + Else + Alert("Ocurrió un error al generar la cancelación", TipoMensaje.MsgError) + End If UpEstatus.Update() @@ -21204,6 +20416,26 @@ Partial Class Ventas TrFolioFiscal.Visible = False TxtFecha.Text = Now.ToShortDateString() TipoCambioFactura = TxtTipoCambio.Text.ToDecimal + + If DdlMoneda.SelectedValue.ToEntero > 1 Then + Dim ObjIE As New ClsBancos + If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Dim tFecha As Date = TxtFecha.Text.ToDate + Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) + Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC") + + If drr IsNot Nothing Then + TipoCambioFactura = drr("TipoCambio").ToString.ToDecimal + End If + + End If + End If + ObjIE.Dispose() + Else + TipoCambioFactura = 1 + End If + TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString DivEstatusFac.Visible = False diff --git a/localhost.sln b/localhost.sln new file mode 100644 index 000000000..888c06549 --- /dev/null +++ b/localhost.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost", "http://localhost", "{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}" + ProjectSection(WebsiteProperties) = preProject + SccProjectName = ""$/localhost", CAAAAAAA" + SccAuxPath = "" + SccLocalPath = "." + SccProvider = "MSSCCI:Microsoft Visual SourceSafe" + UseIISExpress = "false" + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6" + Debug.AspNetCompiler.VirtualPath = "/localhost" + Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\inetpub\SIGIT\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/localhost" + Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\inetpub\SIGIT\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + SlnRelativePath = "..\..\..\..\..\inetpub\SIGIT\" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B4590109-7BF9-411C-A1AE-792C02707CE6} + EndGlobalSection +EndGlobal diff --git a/packages/AjaxControlToolkit.15.1.4.0/.signature.p7s b/packages/AjaxControlToolkit.15.1.4.0/.signature.p7s new file mode 100644 index 000000000..af890cf22 Binary files /dev/null and b/packages/AjaxControlToolkit.15.1.4.0/.signature.p7s differ diff --git a/packages/AjaxControlToolkit.15.1.4.0/AjaxControlToolkit.15.1.4.0.nupkg b/packages/AjaxControlToolkit.15.1.4.0/AjaxControlToolkit.15.1.4.0.nupkg new file mode 100644 index 000000000..ad900c975 Binary files /dev/null and b/packages/AjaxControlToolkit.15.1.4.0/AjaxControlToolkit.15.1.4.0.nupkg differ diff --git a/packages/AjaxControlToolkit.15.1.4.0/Content/Web.config.transform b/packages/AjaxControlToolkit.15.1.4.0/Content/Web.config.transform new file mode 100644 index 000000000..5b1b95d99 --- /dev/null +++ b/packages/AjaxControlToolkit.15.1.4.0/Content/Web.config.transform @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/AjaxControlToolkit.15.1.4.0/lib/net40/AjaxControlToolkit.dll b/packages/AjaxControlToolkit.15.1.4.0/lib/net40/AjaxControlToolkit.dll new file mode 100644 index 000000000..1b01e4d55 Binary files /dev/null and b/packages/AjaxControlToolkit.15.1.4.0/lib/net40/AjaxControlToolkit.dll differ diff --git a/packages/AjaxControlToolkit.15.1.4.0/readme.txt b/packages/AjaxControlToolkit.15.1.4.0/readme.txt new file mode 100644 index 000000000..bcd9d12f6 Binary files /dev/null and b/packages/AjaxControlToolkit.15.1.4.0/readme.txt differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/.signature.p7s b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/.signature.p7s new file mode 100644 index 000000000..be0219a82 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/.signature.p7s differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/AjaxControlToolkit.StaticResources.15.1.4.0.nupkg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/AjaxControlToolkit.StaticResources.15.1.4.0.nupkg new file mode 100644 index 000000000..586697579 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/AjaxControlToolkit.StaticResources.15.1.4.0.nupkg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/AsyncFileUpload.Button.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/AsyncFileUpload.Button.png new file mode 100644 index 000000000..23dbaca44 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/AsyncFileUpload.Button.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.gif new file mode 100644 index 000000000..1863d7837 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.png new file mode 100644 index 000000000..223556170 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.CloudSprite.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.gif new file mode 100644 index 000000000..acf1eee8e Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.png new file mode 100644 index 000000000..402492b1a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/BalloonPopup.RectangleSprite.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Left.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Left.gif new file mode 100644 index 000000000..004a206c1 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Left.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Right.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Right.gif new file mode 100644 index 000000000..5052e7276 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Calendar.Arrow-Right.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ComboBox.Arrow-Down.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ComboBox.Arrow-Down.gif new file mode 100644 index 000000000..ed9281078 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ComboBox.Arrow-Down.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/DropDown.DropArrow.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/DropDown.DropArrow.gif new file mode 100644 index 000000000..25ac96f39 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/DropDown.DropArrow.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.Anonymous.jpg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.Anonymous.jpg new file mode 100644 index 000000000..6770e22fb Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.Anonymous.jpg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.G.jpg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.G.jpg new file mode 100644 index 000000000..27d2c66a2 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.G.jpg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.PG.jpg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.PG.jpg new file mode 100644 index 000000000..0207323d3 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.PG.jpg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.R.jpg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.R.jpg new file mode 100644 index 000000000..3f44cd3b0 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.R.jpg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.X.jpg b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.X.jpg new file mode 100644 index 000000000..2ed4a6dfa Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Gravatar.X.jpg differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.BgiButton.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.BgiButton.gif new file mode 100644 index 000000000..3d3ca3257 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.BgiButton.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-1x1.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-1x1.gif new file mode 100644 index 000000000..35d42e808 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-1x1.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Active.gif new file mode 100644 index 000000000..f206c9858 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Inactive.gif new file mode 100644 index 000000000..d630139c6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignCenter-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Active.gif new file mode 100644 index 000000000..185104be8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Inactive.gif new file mode 100644 index 000000000..5964d8de7 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignJustify-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Active.gif new file mode 100644 index 000000000..abc9c3d9d Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Inactive.gif new file mode 100644 index 000000000..9cdaae369 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignLeft-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Active.gif new file mode 100644 index 000000000..35bd3f81f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Inactive.gif new file mode 100644 index 000000000..b5a6c7fdf Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRemove-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Active.gif new file mode 100644 index 000000000..3218059c6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Inactive.gif new file mode 100644 index 000000000..e1e49b21e Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-AlignRight-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Anchor.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Anchor.gif new file mode 100644 index 000000000..10eab59e8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Anchor.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Active.gif new file mode 100644 index 000000000..1a2a70222 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Inactive.gif new file mode 100644 index 000000000..ea9bf996f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-BackColor-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Active.gif new file mode 100644 index 000000000..09f6452ed Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Inactive.gif new file mode 100644 index 000000000..16d9bb735 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorBgClear-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Active.gif new file mode 100644 index 000000000..a5a73f264 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Inactive.gif new file mode 100644 index 000000000..957a97180 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFg-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Active.gif new file mode 100644 index 000000000..c7d76b415 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Inactive.gif new file mode 100644 index 000000000..aa2b5f248 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ColorFgClear-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Active.gif new file mode 100644 index 000000000..3f77b0317 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Inactive.gif new file mode 100644 index 000000000..3739eb8c8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Copy-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Active.gif new file mode 100644 index 000000000..763494c18 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Inactive.gif new file mode 100644 index 000000000..7a3666efd Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Cut-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Active.gif new file mode 100644 index 000000000..4891ea798 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Inactive.gif new file mode 100644 index 000000000..70cb15524 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Design-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Flash.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Flash.gif new file mode 100644 index 000000000..cc8c61be5 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Flash.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Active.gif new file mode 100644 index 000000000..738d673f6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Inactive.gif new file mode 100644 index 000000000..ed7658e24 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ForeColor-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Active.gif new file mode 100644 index 000000000..c31a24bf0 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Inactive.gif new file mode 100644 index 000000000..e9be56881 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatBold-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Active.gif new file mode 100644 index 000000000..497340108 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Inactive.gif new file mode 100644 index 000000000..b1788d338 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatItalic-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Active.gif new file mode 100644 index 000000000..0a5c920b1 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Inactive.gif new file mode 100644 index 000000000..456162597 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatLtr-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Active.gif new file mode 100644 index 000000000..091649547 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Inactive.gif new file mode 100644 index 000000000..77ab30f81 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatParagraph-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Active.gif new file mode 100644 index 000000000..99446bb69 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Inactive.gif new file mode 100644 index 000000000..d5a85d821 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatRtl-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Active.gif new file mode 100644 index 000000000..e6a098188 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Inactive.gif new file mode 100644 index 000000000..09b87b7cd Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatStrike-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Active.gif new file mode 100644 index 000000000..27c93266b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Inactive.gif new file mode 100644 index 000000000..48ef03d66 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSub-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Active.gif new file mode 100644 index 000000000..58a1d445b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Inactive.gif new file mode 100644 index 000000000..28b1f714a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatSup-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Active.gif new file mode 100644 index 000000000..8cdc17bc9 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Inactive.gif new file mode 100644 index 000000000..38afa80dd Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-FormatUnderline-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Active.gif new file mode 100644 index 000000000..bf7669547 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Inactive.gif new file mode 100644 index 000000000..0ec33f63d Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Html-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Active.gif new file mode 100644 index 000000000..a16b30164 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Inactive.gif new file mode 100644 index 000000000..5e0cc0f7b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentLess-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Active.gif new file mode 100644 index 000000000..fb544bc09 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Inactive.gif new file mode 100644 index 000000000..a1ab8f852 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-IndentMore-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Active.gif new file mode 100644 index 000000000..95d6efccb Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Inactive.gif new file mode 100644 index 000000000..8fe0e8ea8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Link-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Active.gif new file mode 100644 index 000000000..573b6d8b7 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Inactive.gif new file mode 100644 index 000000000..fc6131e70 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListBullet-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Active.gif new file mode 100644 index 000000000..eabb2bb1e Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Inactive.gif new file mode 100644 index 000000000..f86cd091b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-ListNum-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Media.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Media.gif new file mode 100644 index 000000000..d250706df Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Media.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Active.gif new file mode 100644 index 000000000..59aa42a1f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Inactive.gif new file mode 100644 index 000000000..6bc175c23 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Paste-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Active.gif new file mode 100644 index 000000000..7746c7e2a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Inactive.gif new file mode 100644 index 000000000..1aae8d135 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteText-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Active.gif new file mode 100644 index 000000000..e37cd3834 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Inactive.gif new file mode 100644 index 000000000..aa50b01e0 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-PasteWord-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Placeholder.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Placeholder.gif new file mode 100644 index 000000000..904a1750f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Placeholder.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Active.gif new file mode 100644 index 000000000..0c55b5e6a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Inactive.gif new file mode 100644 index 000000000..9dff5d216 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Preview-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Active.gif new file mode 100644 index 000000000..5ceb81000 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Inactive.gif new file mode 100644 index 000000000..2ad8326c8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Redo-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Active.gif new file mode 100644 index 000000000..fbd4e5238 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Inactive.gif new file mode 100644 index 000000000..ce5f02a96 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Rule-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Active.gif new file mode 100644 index 000000000..a202d390a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Inactive.gif new file mode 100644 index 000000000..2d9be81f1 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Selector-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Separator.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Separator.gif new file mode 100644 index 000000000..cf8af58d0 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Separator.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Active.gif new file mode 100644 index 000000000..093dd4626 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Inactive.gif new file mode 100644 index 000000000..a98f12689 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Undo-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Active.gif new file mode 100644 index 000000000..974597b4f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Inactive.gif new file mode 100644 index 000000000..342635fb8 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unformat-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Active.gif new file mode 100644 index 000000000..dd0d524ce Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Inactive.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Inactive.gif new file mode 100644 index 000000000..bd1767635 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditor.Ed-Unlink-Inactive.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditorExtender.Buttons.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditorExtender.Buttons.png new file mode 100644 index 000000000..0dbd6e6bc Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/HtmlEditorExtender.Buttons.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Horizontal.gif new file mode 100644 index 000000000..b3f4aaf09 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Vertical.gif new file mode 100644 index 000000000..cf0d99b9f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Handle-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Horizontal.gif new file mode 100644 index 000000000..aee9d912f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Vertical.gif new file mode 100644 index 000000000..d357a53e0 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleDown-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Horizontal.gif new file mode 100644 index 000000000..be456f04f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Vertical.gif new file mode 100644 index 000000000..f84be9e3b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.HandleHover-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Horizontal.gif new file mode 100644 index 000000000..eb99d1328 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Vertical.gif new file mode 100644 index 000000000..5901bbbe5 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.Rail-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Horizontal.gif new file mode 100644 index 000000000..0cf162bae Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Vertical.gif new file mode 100644 index 000000000..19ef51b69 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/MultiHandleSlider.RailOuter-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Grouphover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Grouphover.png new file mode 100644 index 000000000..3ca4e1e3c Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Grouphover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Hover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Hover.png new file mode 100644 index 000000000..d08eb2d0b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Hover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Pressed.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Pressed.png new file mode 100644 index 000000000..0ee45b5fc Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Pressed.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Rest.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Rest.png new file mode 100644 index 000000000..3172005c6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Fullscreen-Rest.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Grouphover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Grouphover.png new file mode 100644 index 000000000..204e1cc94 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Grouphover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Hover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Hover.png new file mode 100644 index 000000000..ec218a00a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Hover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Pressed.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Pressed.png new file mode 100644 index 000000000..4439508bc Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Pressed.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Rest.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Rest.png new file mode 100644 index 000000000..009d1bbf4 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.Home-Rest.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Grouphover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Grouphover.png new file mode 100644 index 000000000..c985d0f95 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Grouphover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Hover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Hover.png new file mode 100644 index 000000000..3cab721f1 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Hover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Pressed.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Pressed.png new file mode 100644 index 000000000..9c3a75169 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Pressed.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Rest.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Rest.png new file mode 100644 index 000000000..f4219a50a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomIn-Rest.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Grouphover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Grouphover.png new file mode 100644 index 000000000..46d21b3e5 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Grouphover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Hover.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Hover.png new file mode 100644 index 000000000..7b924c26d Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Hover.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Pressed.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Pressed.png new file mode 100644 index 000000000..c028db724 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Pressed.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Rest.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Rest.png new file mode 100644 index 000000000..a13e07de7 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Seadragon.ZoomOut-Rest.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Horizontal.gif new file mode 100644 index 000000000..b3f4aaf09 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Vertical.gif new file mode 100644 index 000000000..cf0d99b9f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Handle-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Horizontal.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Horizontal.gif new file mode 100644 index 000000000..712c16f2f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Horizontal.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Vertical.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Vertical.gif new file mode 100644 index 000000000..b97954f83 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Slider.Rail-Vertical.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalLeft.gif new file mode 100644 index 000000000..ed5138c80 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalRight.gif new file mode 100644 index 000000000..ed5138c80 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active.gif new file mode 100644 index 000000000..7e1d1fd73 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalLeft.gif new file mode 100644 index 000000000..fa77bcc5c Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalRight.gif new file mode 100644 index 000000000..44ea32eea Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft.gif new file mode 100644 index 000000000..99dc54178 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalLeft.gif new file mode 100644 index 000000000..9c5fc7e58 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalRight.gif new file mode 100644 index 000000000..0b62984b2 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight.gif new file mode 100644 index 000000000..589fb7016 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.ActiveRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Background.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Background.gif new file mode 100644 index 000000000..e0f3f1726 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Background.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Active.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Active.gif new file mode 100644 index 000000000..decba73a6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Active.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveLeft.gif new file mode 100644 index 000000000..4aec9e91c Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveRight.gif new file mode 100644 index 000000000..e3485923b Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-ActiveRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Hover.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Hover.gif new file mode 100644 index 000000000..2e3f0d35c Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Hover.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverLeft.gif new file mode 100644 index 000000000..0633e754f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverRight.gif new file mode 100644 index 000000000..9d7c9ae35 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-HoverRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Left.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Left.gif new file mode 100644 index 000000000..168e3cac7 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Left.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Right.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Right.gif new file mode 100644 index 000000000..114d7cf1e Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom-Right.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom.gif new file mode 100644 index 000000000..a44c51976 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Bottom.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalLeft.gif new file mode 100644 index 000000000..a0e28d567 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalRight.gif new file mode 100644 index 000000000..2356067b4 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover.gif new file mode 100644 index 000000000..8210df2c6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Hover.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalLeft.gif new file mode 100644 index 000000000..aef511fc2 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalRight.gif new file mode 100644 index 000000000..b0b9da6a6 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft.gif new file mode 100644 index 000000000..e858d5546 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalLeft.gif new file mode 100644 index 000000000..303efcb72 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalRight.gif new file mode 100644 index 000000000..d7dbd4ef2 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight.gif new file mode 100644 index 000000000..450ac9a68 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.HoverRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalLeft.gif new file mode 100644 index 000000000..4b57f72ee Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalRight.gif new file mode 100644 index 000000000..d3440b7ed Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left.gif new file mode 100644 index 000000000..c586594d9 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Left.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Line.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Line.gif new file mode 100644 index 000000000..941d0bf92 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Line.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalLeft.gif new file mode 100644 index 000000000..bca181cea Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalRight.gif new file mode 100644 index 000000000..6d987426a Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right-VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right.gif new file mode 100644 index 000000000..45393fc9c Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.Right.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalLeft.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalLeft.gif new file mode 100644 index 000000000..47b692470 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalLeft.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalRight.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalRight.gif new file mode 100644 index 000000000..47b692470 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Tabs.VerticalRight.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.24.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.24.png new file mode 100644 index 000000000..191e59183 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.24.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.32.png b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.32.png new file mode 100644 index 000000000..8d7e4ee15 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/Twitter.32.png differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Large.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Large.gif new file mode 100644 index 000000000..bcd846dff Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Large.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Small.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Small.gif new file mode 100644 index 000000000..0a58a92f1 Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Small.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Close.gif b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Close.gif new file mode 100644 index 000000000..aca08241f Binary files /dev/null and b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Images/ValidatorCallout.Close.gif differ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.css new file mode 100644 index 000000000..aec0528fc --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.css @@ -0,0 +1,157 @@ +.ajax__fileupload { + border: #D3D3D3 1px solid; + overflow: auto; + padding: 4px; +} + +.ajax__fileupload_selectFileContainer { + display: inline-block; + height: 24px; + line-height: 24px; + overflow: hidden; + position: relative; + width: 80px; +} + +.ajax__fileupload_selectFileButton { + background-color: #212121; + color: #D0D0D0; + cursor: pointer; + display: block; + font-size: 13px; + height: 24px; + line-height: 24px; + margin-right: 4px; + text-align: center; + width: 80px; +} + +.ajax__fileupload_selectFileButton:hover { + background-color: #000000; + color: #ffffff; +} + +.ajax__fileupload_topFileStatus { + color: rgb(127, 126, 126); +} + +.ajax__fileupload_ProgressBarHolder { + margin-right: 70px; +} + +.ajax__fileupload_uploadbutton { + background-color: #000099; + color: white; + cursor: pointer; + font-weight: bold; + text-align: center; + width: 60px; +} + +.ajax_fileupload_cancelbutton { + background-color: #990033; + color: white; + cursor: pointer; + font-weight: bold; + text-align: center; + width: 60px; +} + +.ajax__fileupload_dropzone { + border-style: dotted; + border-width: 1px; + line-height: 50px; + margin-bottom: 2px; + text-align: center; +} + +.ajax__fileupload_queueContainer { + border: #A9A9A9 1px solid; + border-width: 1px; + clear: both; + margin-top: 2px; + padding: 4px; +} + +.ajax__fileupload_progressBar { + background-color: #CCFFCC; + padding-left: 4px; +} + +.ajax__fileupload_footer { + height: 20px; + line-height: 20px; + margin-top: 2px; +} + +.ajax__fileupload_fileItemInfo { + height: 20px; + line-height: 20px; + margin-bottom: 2px; + overflow: hidden; + position: relative; + z-index: 0; +} + +.ajax__fileupload_fileItemInfo .filename { + font-weight: bold; +} + +.ajax__fileupload_fileItemInfo .uploadstatus { + font-style: italic; +} + +.ajax__fileupload_fileItemInfo .removeButton { + background-color: #900; + color: white; + cursor: pointer; + display: block; + float: left; + height: 20px; + line-height: 20px; + text-align: center; + width: 55px; +} + +.ajax__fileupload_fileItemInfo .uploadedState { + background-color: #fff; + color: #060; +} + +.ajax__fileupload_fileItemInfo .uploadingState { + background-color: #fff; + color: #FF9900; +} + +.ajax__fileupload_fileItemInfo .pendingState { + background-color: #fff; + color: #009; +} + +.ajax__fileupload_fileItemInfo .errorState { + background-color: #ff0000; + color: #ffffff; +} + +.ajax__fileupload_fileItemInfo .cancelledState { + background-color: #fff; + color: #900; +} + +.ajax__fileupload_selectFileContainer input { + border: medium none; + cursor: pointer; + height: 40px; + margin: 0; + opacity: 0; + position: absolute; + right: 0; + top: 0; +} + + +.ajax__fileupload_fileItemInfo div.removeButton { + position: absolute; + right: 0; + top: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.min.css new file mode 100644 index 000000000..7a004f769 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AjaxFileUpload.min.css @@ -0,0 +1 @@ +.ajax__fileupload{border:#d3d3d3 1px solid;overflow:auto;padding:4px}.ajax__fileupload_selectFileContainer{display:inline-block;height:24px;line-height:24px;overflow:hidden;position:relative;width:80px}.ajax__fileupload_selectFileButton{background-color:#212121;color:#d0d0d0;cursor:pointer;display:block;font-size:13px;height:24px;line-height:24px;margin-right:4px;text-align:center;width:80px}.ajax__fileupload_selectFileButton:hover{background-color:#000;color:#fff}.ajax__fileupload_topFileStatus{color:#7f7e7e}.ajax__fileupload_ProgressBarHolder{margin-right:70px}.ajax__fileupload_uploadbutton{background-color:#009;color:#fff;cursor:pointer;font-weight:bold;text-align:center;width:60px}.ajax_fileupload_cancelbutton{background-color:#903;color:#fff;cursor:pointer;font-weight:bold;text-align:center;width:60px}.ajax__fileupload_dropzone{border-style:dotted;border-width:1px;line-height:50px;margin-bottom:2px;text-align:center}.ajax__fileupload_queueContainer{border:#a9a9a9 1px solid;border-width:1px;clear:both;margin-top:2px;padding:4px}.ajax__fileupload_progressBar{background-color:#cfc;padding-left:4px}.ajax__fileupload_footer{height:20px;line-height:20px;margin-top:2px}.ajax__fileupload_fileItemInfo{height:20px;line-height:20px;margin-bottom:2px;overflow:hidden;position:relative;z-index:0}.ajax__fileupload_fileItemInfo .filename{font-weight:bold}.ajax__fileupload_fileItemInfo .uploadstatus{font-style:italic}.ajax__fileupload_fileItemInfo .removeButton{background-color:#900;color:#fff;cursor:pointer;display:block;float:left;height:20px;line-height:20px;text-align:center;width:55px}.ajax__fileupload_fileItemInfo .uploadedState{background-color:#fff;color:#060}.ajax__fileupload_fileItemInfo .uploadingState{background-color:#fff;color:#f90}.ajax__fileupload_fileItemInfo .pendingState{background-color:#fff;color:#009}.ajax__fileupload_fileItemInfo .errorState{background-color:red;color:#fff}.ajax__fileupload_fileItemInfo .cancelledState{background-color:#fff;color:#900}.ajax__fileupload_selectFileContainer input{border:medium none;cursor:pointer;height:40px;margin:0;opacity:0;position:absolute;right:0;top:0}.ajax__fileupload_fileItemInfo div.removeButton{position:absolute;right:0;top:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.css new file mode 100644 index 000000000..864029a03 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.css @@ -0,0 +1,279 @@ +#LinearGradient1 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#LinearGradient2 { + stop-color: #ffffff; + stop-opacity: 0.3; +} + +#LinearGradient3 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#ChartTitle { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 16px; +} + +#VerticalLine { + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#HorizontalLine { + fill: none; + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#BaseLine { + fill: none; + fill-opacity: 1; + stroke: #8e8e8e; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#LegendArea { + fill: none; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#Legend1 { + fill: #6C1E83; + fill-opacity: 0.4; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend2 { + fill: #D08AD9; + fill-opacity: 0.4; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend3 { + fill: #6586A7; + fill-opacity: 0.4; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend4 { + fill: #0E426C; + fill-opacity: 0.4; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend5 { + fill: #A156AB; + fill-opacity: 0.4; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend6 { + fill: #990033; + fill-opacity: 0.4; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend7 { + fill: #669900; + fill-opacity: 0.4; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend8 { + fill: #B85B3E; + fill-opacity: 0.4; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend9 { + fill: #FFC652; + fill-opacity: 0.4; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#Legend10 { + fill: #4508A2; + fill-opacity: 0.4; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; +} + +#AreaPath1 { + fill: #6C1E83; + fill-opacity: 0.4; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath2 { + fill: #D08AD9; + fill-opacity: 0.4; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath3 { + fill: #6586A7; + fill-opacity: 0.4; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath4 { + fill: #0E426C; + fill-opacity: 0.4; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath5 { + fill: #A156AB; + fill-opacity: 0.4; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath6 { + fill: #990033; + fill-opacity: 0.4; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath7 { + fill: #669900; + fill-opacity: 0.4; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath8 { + fill: #B85B3E; + fill-opacity: 0.4; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath9 { + fill: #FFC652; + fill-opacity: 0.4; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#AreaPath10 { + fill: #4508A2; + fill-opacity: 0.4; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.4; + stroke-width: 2; +} + +#SeriesAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ValueAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#LegendText { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ChartBackGround { + fill: #ffffff; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.min.css new file mode 100644 index 000000000..94810100e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/AreaChart.min.css @@ -0,0 +1 @@ +#LinearGradient1{stop-color:#fff;stop-opacity:0}#LinearGradient2{stop-color:#fff;stop-opacity:.3}#LinearGradient3{stop-color:#fff;stop-opacity:0}#ChartTitle{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:16px}#VerticalLine{fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#HorizontalLine{fill:none;fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#BaseLine{fill:none;fill-opacity:1;stroke:#8e8e8e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#LegendArea{fill:none;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#Legend1{fill:#6c1e83;fill-opacity:.4;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend2{fill:#d08ad9;fill-opacity:.4;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend3{fill:#6586a7;fill-opacity:.4;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend4{fill:#0e426c;fill-opacity:.4;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend5{fill:#a156ab;fill-opacity:.4;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend6{fill:#903;fill-opacity:.4;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend7{fill:#690;fill-opacity:.4;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend8{fill:#b85b3e;fill-opacity:.4;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend9{fill:#ffc652;fill-opacity:.4;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#Legend10{fill:#4508a2;fill-opacity:.4;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4}#AreaPath1{fill:#6c1e83;fill-opacity:.4;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath2{fill:#d08ad9;fill-opacity:.4;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath3{fill:#6586a7;fill-opacity:.4;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath4{fill:#0e426c;fill-opacity:.4;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath5{fill:#a156ab;fill-opacity:.4;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath6{fill:#903;fill-opacity:.4;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath7{fill:#690;fill-opacity:.4;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath8{fill:#b85b3e;fill-opacity:.4;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath9{fill:#ffc652;fill-opacity:.4;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#AreaPath10{fill:#4508a2;fill-opacity:.4;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.4;stroke-width:2}#SeriesAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ValueAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#LegendText{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ChartBackGround{fill:#fff;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.css new file mode 100644 index 000000000..da01ad3ab --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.css @@ -0,0 +1,245 @@ +.ajax__slider_h_rail { + background-image: url('../Images/Slider.Rail-Horizontal.gif'); +} + +.ajax__slider_v_rail { + background-image: url('../Images/Slider.Rail-Vertical.gif'); +} + +.ajax__calendar_prev { + background-image: url('../Images/Calendar.Arrow-Left.gif'); +} + +.ajax__calendar_next { + background-image: url('../Images/Calendar.Arrow-Right.gif'); +} + +.ajax__dropdown_arrow_image { + background-image: url('../Images/DropDown.DropArrow.gif'); +} + +.ajax__balloon_popup .rect { + background-image: url('../Images/BalloonPopup.RectangleSprite.gif'); + background-image: url('../Images/BalloonPopup.RectangleSprite.png') !important; +} + +.ajax__balloon_popup .cloud { + background-image: url('../Images/BalloonPopup.CloudSprite.gif'); + background-image: url('../Images/BalloonPopup.CloudSprite.png') !important; +} + +.ajax__tab_xp .ajax__tab_header { + background-image: url('../Images/Tabs.Line.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_outer { + background-image: url('../Images/Tabs.Right.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_inner { + background-image: url('../Images/Tabs.Left.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_tab { + background-image: url('../Images/Tabs.Background.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer { + background-image: url('../Images/Tabs.HoverRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner { + background-image: url('../Images/Tabs.HoverLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab { + background-image: url('../Images/Tabs.Hover.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer { + background-image: url('../Images/Tabs.ActiveRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner { + background-image: url('../Images/Tabs.ActiveLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab { + background-image: url('../Images/Tabs.Active.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft { + background-image: url('../Images/Tabs.Line.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer { + background-image: url('../Images/Tabs.Right-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner { + background-image: url('../Images/Tabs.Left-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab { + background-image: url('../Images/Tabs.VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer { + background-image: url('../Images/Tabs.HoverRight-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner { + background-image: url('../Images/Tabs.HoverLeft-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab { + background-image: url('../Images/Tabs.Hover-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer { + background-image: url('../Images/Tabs.ActiveRight-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner { + background-image: url('../Images/Tabs.ActiveLeft-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab { + background-image: url('../Images/Tabs.Active-VerticalLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright { + background-image: url('../Images/Tabs.Line.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer { + background-image: url('../Images/Tabs.Right-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner { + background-image: url('../Images/Tabs.Left-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab { + background-image: url('../Images/Tabs.VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer { + background-image: url('../Images/Tabs.HoverRight-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner { + background-image: url('../Images/Tabs.HoverLeft-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab { + background-image: url('../Images/Tabs.Hover-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer { + background-image: url('../Images/Tabs.ActiveRight-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner { + background-image: url('../Images/Tabs.ActiveLeft-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab { + background-image: url('../Images/Tabs.Active-VerticalRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom { + background-image: url('../Images/Tabs.Line.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer { + background-image: url('../Images/Tabs.Bottom-Right.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner { + background-image: url('../Images/Tabs.Bottom-Left.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab { + background-image: url('../Images/Tabs.Bottom.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer { + background-image: url('../Images/Tabs.Bottom-HoverRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner { + background-image: url('../Images/Tabs.Bottom-HoverLeft.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab { + background-image: url('../Images/Tabs.Bottom-Hover.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer { + background-image: url('../Images/Tabs.Bottom-ActiveRight.gif'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner { + background-image: url('../Images/Tabs.Bottom-ActiveLeft.gif"'); +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab { + background-image: url('../Images/Tabs.Bottom-Active.gif"'); +} + +.ajax__multi_slider_default .outer_rail_vertical { + background-image: url('../Images/MultiHandleSlider.RailOuter-Vertical.gif'); +} + +.ajax__multi_slider_default .inner_rail_vertical { + background-image: url('../Images/MultiHandleSlider.Rail-Vertical.gif'); +} + +.ajax__multi_slider_default .inner_rail_horizontal { + background-image: url('../Images/MultiHandleSlider.Rail-Horizontal.gif'); +} + +.ajax__multi_slider_default .outer_rail_horizontal { + background-image: url('../Images/MultiHandleSlider.RailOuter-Horizontal.gif'); +} + +.ajax__multi_slider_default .handle_horizontal { + background-image: url('../Images/MultiHandleSlider.Handle-Horizontal.gif'); +} + +.ajax__multi_slider_default .handle_horizontal_hover { + background-image: url('../Images/MultiHandleSlider.HandleHover-Horizontal.gif'); +} + +.ajax__multi_slider_default .handle_horizontal_down { + background-image: url('../Images/MultiHandleSlider.HandleDown-Horizontal.gif'); +} + +.ajax__multi_slider_default .handle_vertical { + background-image: url('../Images/MultiHandleSlider.Handle-Vertical.gif'); +} + +.ajax__multi_slider_default .handle_vertical_hover { + background-image: url('../Images/MultiHandleSlider.HandleHover-Vertical.gif'); +} + +.ajax__multi_slider_default .handle_vertical_down { + background-image: url('../Images/MultiHandleSlider.HandleDown-Vertical.gif'); +} + +.ajax__combobox_buttoncontainer button { + background-image: url('../Images/ComboBox.Arrow-Down.gif'); +} + +.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton { + background-image: url('../Images/HtmlEditor.BgiButton.gif'); +} + +.ajax__html_editor_extender_button { + background-image: url('../Images/HtmlEditorExtender.Buttons.png'); +} + +.ajax__html_editor_extender_separator { + background-image: url('../Images/HtmlEditorExtender.Buttons.png'); +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.min.css new file mode 100644 index 000000000..c53134df0 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Backgrounds.min.css @@ -0,0 +1 @@ +.ajax__slider_h_rail{background-image:url('../Images/Slider.Rail-Horizontal.gif')}.ajax__slider_v_rail{background-image:url('../Images/Slider.Rail-Vertical.gif')}.ajax__calendar_prev{background-image:url('../Images/Calendar.Arrow-Left.gif')}.ajax__calendar_next{background-image:url('../Images/Calendar.Arrow-Right.gif')}.ajax__dropdown_arrow_image{background-image:url('../Images/DropDown.DropArrow.gif')}.ajax__balloon_popup .rect{background-image:url('../Images/BalloonPopup.RectangleSprite.gif');background-image:url('../Images/BalloonPopup.RectangleSprite.png') !important}.ajax__balloon_popup .cloud{background-image:url('../Images/BalloonPopup.CloudSprite.gif');background-image:url('../Images/BalloonPopup.CloudSprite.png') !important}.ajax__tab_xp .ajax__tab_header{background-image:url('../Images/Tabs.Line.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_outer{background-image:url('../Images/Tabs.Right.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_inner{background-image:url('../Images/Tabs.Left.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_tab{background-image:url('../Images/Tabs.Background.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer{background-image:url('../Images/Tabs.HoverRight.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner{background-image:url('../Images/Tabs.HoverLeft.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab{background-image:url('../Images/Tabs.Hover.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer{background-image:url('../Images/Tabs.ActiveRight.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner{background-image:url('../Images/Tabs.ActiveLeft.gif')}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab{background-image:url('../Images/Tabs.Active.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft{background-image:url('../Images/Tabs.Line.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer{background-image:url('../Images/Tabs.Right-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner{background-image:url('../Images/Tabs.Left-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab{background-image:url('../Images/Tabs.VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer{background-image:url('../Images/Tabs.HoverRight-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner{background-image:url('../Images/Tabs.HoverLeft-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab{background-image:url('../Images/Tabs.Hover-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer{background-image:url('../Images/Tabs.ActiveRight-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner{background-image:url('../Images/Tabs.ActiveLeft-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab{background-image:url('../Images/Tabs.Active-VerticalLeft.gif')}.ajax__tab_xp .ajax__tab_header_verticalright{background-image:url('../Images/Tabs.Line.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer{background-image:url('../Images/Tabs.Right-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner{background-image:url('../Images/Tabs.Left-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab{background-image:url('../Images/Tabs.VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer{background-image:url('../Images/Tabs.HoverRight-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner{background-image:url('../Images/Tabs.HoverLeft-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab{background-image:url('../Images/Tabs.Hover-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer{background-image:url('../Images/Tabs.ActiveRight-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner{background-image:url('../Images/Tabs.ActiveLeft-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab{background-image:url('../Images/Tabs.Active-VerticalRight.gif')}.ajax__tab_xp .ajax__tab_header_bottom{background-image:url('../Images/Tabs.Line.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer{background-image:url('../Images/Tabs.Bottom-Right.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner{background-image:url('../Images/Tabs.Bottom-Left.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab{background-image:url('../Images/Tabs.Bottom.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer{background-image:url('../Images/Tabs.Bottom-HoverRight.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner{background-image:url('../Images/Tabs.Bottom-HoverLeft.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab{background-image:url('../Images/Tabs.Bottom-Hover.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer{background-image:url('../Images/Tabs.Bottom-ActiveRight.gif')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner{background-image:url('../Images/Tabs.Bottom-ActiveLeft.gif"')}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab{background-image:url('../Images/Tabs.Bottom-Active.gif"')}.ajax__multi_slider_default .outer_rail_vertical{background-image:url('../Images/MultiHandleSlider.RailOuter-Vertical.gif')}.ajax__multi_slider_default .inner_rail_vertical{background-image:url('../Images/MultiHandleSlider.Rail-Vertical.gif')}.ajax__multi_slider_default .inner_rail_horizontal{background-image:url('../Images/MultiHandleSlider.Rail-Horizontal.gif')}.ajax__multi_slider_default .outer_rail_horizontal{background-image:url('../Images/MultiHandleSlider.RailOuter-Horizontal.gif')}.ajax__multi_slider_default .handle_horizontal{background-image:url('../Images/MultiHandleSlider.Handle-Horizontal.gif')}.ajax__multi_slider_default .handle_horizontal_hover{background-image:url('../Images/MultiHandleSlider.HandleHover-Horizontal.gif')}.ajax__multi_slider_default .handle_horizontal_down{background-image:url('../Images/MultiHandleSlider.HandleDown-Horizontal.gif')}.ajax__multi_slider_default .handle_vertical{background-image:url('../Images/MultiHandleSlider.Handle-Vertical.gif')}.ajax__multi_slider_default .handle_vertical_hover{background-image:url('../Images/MultiHandleSlider.HandleHover-Vertical.gif')}.ajax__multi_slider_default .handle_vertical_down{background-image:url('../Images/MultiHandleSlider.HandleDown-Vertical.gif')}.ajax__combobox_buttoncontainer button{background-image:url('../Images/ComboBox.Arrow-Down.gif')}.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton{background-image:url('../Images/HtmlEditor.BgiButton.gif')}.ajax__html_editor_extender_button{background-image:url('../Images/HtmlEditorExtender.Buttons.png')}.ajax__html_editor_extender_separator{background-image:url('../Images/HtmlEditorExtender.Buttons.png')} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.css new file mode 100644 index 000000000..b3275eee5 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.css @@ -0,0 +1,215 @@ +@charset "utf-8"; +/* CSS Document */ + +/* SMALL SIZE */ +.ajax__balloon_popup .cloud .small { + height: 150px; + width: 200px; +} + +.ajax__balloon_popup .cloud .small .bottom_right { + background-position: 0 0; +} + +.ajax__balloon_popup .cloud .small .bottom_right .ajax__content { + padding: 33px 25px 33px 35px; +} + +*html .ajax__balloon_popup .cloud .small .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .small .bottom_right_shadow { + background-position: -950px 0; +} + +.ajax__balloon_popup .cloud .small .bottom_left { + background-position: 0 -150px; +} + +.ajax__balloon_popup .cloud .small .bottom_left .ajax__content { + padding: 33px 25px 33px 35px; +} + +*html .ajax__balloon_popup .cloud .small .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .small .bottom_left_shadow { + background-position: -950px -150px; +} + +.ajax__balloon_popup .cloud .small .top_right { + background-position: 0 -300px; +} + +.ajax__balloon_popup .cloud .small .top_right .ajax__content { + padding: 33px 25px 33px 35px; +} + +*html .ajax__balloon_popup .cloud .small .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .small .top_right_shadow { + background-position: -950px -300px; +} + +.ajax__balloon_popup .cloud .small .top_left { + background-position: 0 -450px; +} + +.ajax__balloon_popup .cloud .small .top_left .ajax__content { + padding: 33px 25px 33px 35px; +} + +*html .ajax__balloon_popup .cloud .small .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .small .top_left_shadow { + background-position: -950px -450px; +} +/* END OF - SMALL SIZE */ + +/* MEDIUM SIZE */ +.ajax__balloon_popup .cloud .medium { + height: 200px; + width: 250px; +} + +.ajax__balloon_popup .cloud .medium .bottom_right { + background-position: -200px 0; +} + +.ajax__balloon_popup .cloud .medium .bottom_right .ajax__content { + padding: 40px; +} + +*html .ajax__balloon_popup .cloud .medium .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .medium .bottom_right_shadow { + background-position: -1150px 0; +} + +.ajax__balloon_popup .cloud .medium .bottom_left { + background-position: -200px -200px; +} + +.ajax__balloon_popup .cloud .medium .bottom_left .ajax__content { + padding: 40px; +} + +*html .ajax__balloon_popup .cloud .medium .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .medium .bottom_left_shadow { + background-position: -1150px -200px; +} + +.ajax__balloon_popup .cloud .medium .top_right { + background-position: -200px -400px; +} + +.ajax__balloon_popup .cloud .medium .top_right .ajax__content { + padding: 40px; +} + +*html .ajax__balloon_popup .cloud .medium .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .medium .top_right_shadow { + background-position: -1150px -400px; +} + +.ajax__balloon_popup .cloud .medium .top_left { + background-position: -200px -600px; +} + +.ajax__balloon_popup .cloud .medium .top_left .ajax__content { + padding: 40px; +} + +*html .ajax__balloon_popup .cloud .medium .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .medium .top_left_shadow { + background-position: -1150px -600px; +} +/* END OF - MEDIUM SIZE */ + +/* LARGE SIZE */ +.ajax__balloon_popup .cloud .large { + height: 300px; + width: 500px; +} + +.ajax__balloon_popup .cloud .large .bottom_right { + background-position: -450px 0; +} + +.ajax__balloon_popup .cloud .large .bottom_right .ajax__content { + padding: 50px; +} + +*html .ajax__balloon_popup .cloud .large .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .large .bottom_right_shadow { + background-position: -1400px 0; +} + +.ajax__balloon_popup .cloud .large .bottom_left { + background-position: -450px -300px; +} + +.ajax__balloon_popup .cloud .large .bottom_left .ajax__content { + padding: 50px; +} + +*html .ajax__balloon_popup .cloud .large .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .large .bottom_left_shadow { + background-position: -1400px -300px; +} + +.ajax__balloon_popup .cloud .large .top_right { + background-position: -450px -600px; +} + +.ajax__balloon_popup .cloud .large .top_right .ajax__content { + padding: 50px; +} + +*html .ajax__balloon_popup .cloud .large .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .large .top_right_shadow { + background-position: -1400px -600px; +} + +.ajax__balloon_popup .cloud .large .top_left { + background-position: -450px -900px; +} + +.ajax__balloon_popup .cloud .large .top_left .ajax__content { + padding: 50px; +} + +*html .ajax__balloon_popup .cloud .large .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .cloud .large .top_left_shadow { + background-position: -1400px -900px; +} +/* END OF - LARGE SIZE */ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.min.css new file mode 100644 index 000000000..e6a0e984e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Cloud.min.css @@ -0,0 +1 @@ +@charset "utf-8";.ajax__balloon_popup .cloud .small{height:150px;width:200px}.ajax__balloon_popup .cloud .small .bottom_right{background-position:0 0}.ajax__balloon_popup .cloud .small .bottom_right .ajax__content{padding:33px 25px 33px 35px}*html .ajax__balloon_popup .cloud .small .bottom_right_shadow{background:none}.ajax__balloon_popup .cloud .small .bottom_right_shadow{background-position:-950px 0}.ajax__balloon_popup .cloud .small .bottom_left{background-position:0 -150px}.ajax__balloon_popup .cloud .small .bottom_left .ajax__content{padding:33px 25px 33px 35px}*html .ajax__balloon_popup .cloud .small .bottom_left_shadow{background:none}.ajax__balloon_popup .cloud .small .bottom_left_shadow{background-position:-950px -150px}.ajax__balloon_popup .cloud .small .top_right{background-position:0 -300px}.ajax__balloon_popup .cloud .small .top_right .ajax__content{padding:33px 25px 33px 35px}*html .ajax__balloon_popup .cloud .small .top_right_shadow{background:none}.ajax__balloon_popup .cloud .small .top_right_shadow{background-position:-950px -300px}.ajax__balloon_popup .cloud .small .top_left{background-position:0 -450px}.ajax__balloon_popup .cloud .small .top_left .ajax__content{padding:33px 25px 33px 35px}*html .ajax__balloon_popup .cloud .small .top_left_shadow{background:none}.ajax__balloon_popup .cloud .small .top_left_shadow{background-position:-950px -450px}.ajax__balloon_popup .cloud .medium{height:200px;width:250px}.ajax__balloon_popup .cloud .medium .bottom_right{background-position:-200px 0}.ajax__balloon_popup .cloud .medium .bottom_right .ajax__content{padding:40px}*html .ajax__balloon_popup .cloud .medium .bottom_right_shadow{background:none}.ajax__balloon_popup .cloud .medium .bottom_right_shadow{background-position:-1150px 0}.ajax__balloon_popup .cloud .medium .bottom_left{background-position:-200px -200px}.ajax__balloon_popup .cloud .medium .bottom_left .ajax__content{padding:40px}*html .ajax__balloon_popup .cloud .medium .bottom_left_shadow{background:none}.ajax__balloon_popup .cloud .medium .bottom_left_shadow{background-position:-1150px -200px}.ajax__balloon_popup .cloud .medium .top_right{background-position:-200px -400px}.ajax__balloon_popup .cloud .medium .top_right .ajax__content{padding:40px}*html .ajax__balloon_popup .cloud .medium .top_right_shadow{background:none}.ajax__balloon_popup .cloud .medium .top_right_shadow{background-position:-1150px -400px}.ajax__balloon_popup .cloud .medium .top_left{background-position:-200px -600px}.ajax__balloon_popup .cloud .medium .top_left .ajax__content{padding:40px}*html .ajax__balloon_popup .cloud .medium .top_left_shadow{background:none}.ajax__balloon_popup .cloud .medium .top_left_shadow{background-position:-1150px -600px}.ajax__balloon_popup .cloud .large{height:300px;width:500px}.ajax__balloon_popup .cloud .large .bottom_right{background-position:-450px 0}.ajax__balloon_popup .cloud .large .bottom_right .ajax__content{padding:50px}*html .ajax__balloon_popup .cloud .large .bottom_right_shadow{background:none}.ajax__balloon_popup .cloud .large .bottom_right_shadow{background-position:-1400px 0}.ajax__balloon_popup .cloud .large .bottom_left{background-position:-450px -300px}.ajax__balloon_popup .cloud .large .bottom_left .ajax__content{padding:50px}*html .ajax__balloon_popup .cloud .large .bottom_left_shadow{background:none}.ajax__balloon_popup .cloud .large .bottom_left_shadow{background-position:-1400px -300px}.ajax__balloon_popup .cloud .large .top_right{background-position:-450px -600px}.ajax__balloon_popup .cloud .large .top_right .ajax__content{padding:50px}*html .ajax__balloon_popup .cloud .large .top_right_shadow{background:none}.ajax__balloon_popup .cloud .large .top_right_shadow{background-position:-1400px -600px}.ajax__balloon_popup .cloud .large .top_left{background-position:-450px -900px}.ajax__balloon_popup .cloud .large .top_left .ajax__content{padding:50px}*html .ajax__balloon_popup .cloud .large .top_left_shadow{background:none}.ajax__balloon_popup .cloud .large .top_left_shadow{background-position:-1400px -900px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.css new file mode 100644 index 000000000..68ed59095 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.css @@ -0,0 +1,215 @@ +@charset "utf-8"; +/* CSS Document */ + +/* SMALL SIZE */ +.ajax__balloon_popup .rect .small { + height: 150px; + width: 200px; +} + +.ajax__balloon_popup .rect .small .bottom_right { + background-position: 0 0; +} + +.ajax__balloon_popup .rect .small .bottom_right .ajax__content { + padding: 25px 25px 25px 15px; +} + +*html .ajax__balloon_popup .rect .small .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .small .bottom_right_shadow { + background-position: -950px 0; +} + +.ajax__balloon_popup .rect .small .bottom_left { + background-position: 0 -150px; +} + +.ajax__balloon_popup .rect .small .bottom_left .ajax__content { + padding: 25px 15px 25px 25px; +} + +*html .ajax__balloon_popup .rect .small .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .small .bottom_left_shadow { + background-position: -950px -150px; +} + +.ajax__balloon_popup .rect .small .top_right { + background-position: 0 -300px; +} + +.ajax__balloon_popup .rect .small .top_right .ajax__content { + padding: 25px 25px 25px 15px; +} + +*html .ajax__balloon_popup .rect .small .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .small .top_right_shadow { + background-position: -950px -300px; +} + +.ajax__balloon_popup .rect .small .top_left { + background-position: 0 -450px; +} + +.ajax__balloon_popup .rect .small .top_left .ajax__content { + padding: 25px 15px 25px 25px; +} + +*html .ajax__balloon_popup .rect .small .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .small .top_left_shadow { + background-position: -950px -450px; +} +/* END OF - SMALL SIZE */ + +/* MEDIUM SIZE */ +.ajax__balloon_popup .rect .medium { + height: 200px; + width: 250px; +} + +.ajax__balloon_popup .rect .medium .bottom_right { + background-position: -200px 0; +} + +.ajax__balloon_popup .rect .medium .bottom_right .ajax__content { + padding: 30px 25px 25px 15px; +} + +*html .ajax__balloon_popup .rect .medium .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .medium .bottom_right_shadow { + background-position: -1150px 0; +} + +.ajax__balloon_popup .rect .medium .bottom_left { + background-position: -200px -200px; +} + +.ajax__balloon_popup .rect .medium .bottom_left .ajax__content { + padding: 30px 15px 35px 35px; +} + +*html .ajax__balloon_popup .rect .medium .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .medium .bottom_left_shadow { + background-position: -1150px -200px; +} + +.ajax__balloon_popup .rect .medium .top_right { + background-position: -200px -400px; +} + +.ajax__balloon_popup .rect .medium .top_right .ajax__content { + padding: 30px 30px 35px 15px; +} + +*html .ajax__balloon_popup .rect .medium .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .medium .top_right_shadow { + background-position: -1150px -400px; +} + +.ajax__balloon_popup .rect .medium .top_left { + background-position: -200px -600px; +} + +.ajax__balloon_popup .rect .medium .top_left .ajax__content { + padding: 35px 15px 35px 35px; +} + +*html .ajax__balloon_popup .rect .medium .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .medium .top_left_shadow { + background-position: -1150px -600px; +} +/* END OF - MEDIUM SIZE */ + +/* LARGE SIZE */ +.ajax__balloon_popup .rect .large { + height: 300px; + width: 500px; +} + +.ajax__balloon_popup .rect .large .bottom_right { + background-position: -450px 0; +} + +.ajax__balloon_popup .rect .large .bottom_right .ajax__content { + padding: 40px 30px 30px 15px; +} + +*html .ajax__balloon_popup .rect .large .bottom_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .large .bottom_right_shadow { + background-position: -1400px 0; +} + +.ajax__balloon_popup .rect .large .bottom_left { + background-position: -450px -300px; +} + +.ajax__balloon_popup .rect .large .bottom_left .ajax__content { + padding: 40px 15px 30px 30px; +} + +*html .ajax__balloon_popup .rect .large .bottom_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .large .bottom_left_shadow { + background-position: -1400px -300px; +} + +.ajax__balloon_popup .rect .large .top_right { + background-position: -450px -600px; +} + +.ajax__balloon_popup .rect .large .top_right .ajax__content { + padding: 30px 30px 45px 15px; +} + +*html .ajax__balloon_popup .rect .large .top_right_shadow { + background: none; +} + +.ajax__balloon_popup .rect .large .top_right_shadow { + background-position: -1400px -600px; +} + +.ajax__balloon_popup .rect .large .top_left { + background-position: -450px -900px; +} + +.ajax__balloon_popup .rect .large .top_left .ajax__content { + padding: 25px 15px 45px 30px; +} + +*html .ajax__balloon_popup .rect .large .top_left_shadow { + background: none; +} + +.ajax__balloon_popup .rect .large .top_left_shadow { + background-position: -1400px -900px; +} +/* END OF - LARGE SIZE */ diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.min.css new file mode 100644 index 000000000..646c92faa --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BalloonPopup.Rectangle.min.css @@ -0,0 +1 @@ +@charset "utf-8";.ajax__balloon_popup .rect .small{height:150px;width:200px}.ajax__balloon_popup .rect .small .bottom_right{background-position:0 0}.ajax__balloon_popup .rect .small .bottom_right .ajax__content{padding:25px 25px 25px 15px}*html .ajax__balloon_popup .rect .small .bottom_right_shadow{background:none}.ajax__balloon_popup .rect .small .bottom_right_shadow{background-position:-950px 0}.ajax__balloon_popup .rect .small .bottom_left{background-position:0 -150px}.ajax__balloon_popup .rect .small .bottom_left .ajax__content{padding:25px 15px 25px 25px}*html .ajax__balloon_popup .rect .small .bottom_left_shadow{background:none}.ajax__balloon_popup .rect .small .bottom_left_shadow{background-position:-950px -150px}.ajax__balloon_popup .rect .small .top_right{background-position:0 -300px}.ajax__balloon_popup .rect .small .top_right .ajax__content{padding:25px 25px 25px 15px}*html .ajax__balloon_popup .rect .small .top_right_shadow{background:none}.ajax__balloon_popup .rect .small .top_right_shadow{background-position:-950px -300px}.ajax__balloon_popup .rect .small .top_left{background-position:0 -450px}.ajax__balloon_popup .rect .small .top_left .ajax__content{padding:25px 15px 25px 25px}*html .ajax__balloon_popup .rect .small .top_left_shadow{background:none}.ajax__balloon_popup .rect .small .top_left_shadow{background-position:-950px -450px}.ajax__balloon_popup .rect .medium{height:200px;width:250px}.ajax__balloon_popup .rect .medium .bottom_right{background-position:-200px 0}.ajax__balloon_popup .rect .medium .bottom_right .ajax__content{padding:30px 25px 25px 15px}*html .ajax__balloon_popup .rect .medium .bottom_right_shadow{background:none}.ajax__balloon_popup .rect .medium .bottom_right_shadow{background-position:-1150px 0}.ajax__balloon_popup .rect .medium .bottom_left{background-position:-200px -200px}.ajax__balloon_popup .rect .medium .bottom_left .ajax__content{padding:30px 15px 35px 35px}*html .ajax__balloon_popup .rect .medium .bottom_left_shadow{background:none}.ajax__balloon_popup .rect .medium .bottom_left_shadow{background-position:-1150px -200px}.ajax__balloon_popup .rect .medium .top_right{background-position:-200px -400px}.ajax__balloon_popup .rect .medium .top_right .ajax__content{padding:30px 30px 35px 15px}*html .ajax__balloon_popup .rect .medium .top_right_shadow{background:none}.ajax__balloon_popup .rect .medium .top_right_shadow{background-position:-1150px -400px}.ajax__balloon_popup .rect .medium .top_left{background-position:-200px -600px}.ajax__balloon_popup .rect .medium .top_left .ajax__content{padding:35px 15px 35px 35px}*html .ajax__balloon_popup .rect .medium .top_left_shadow{background:none}.ajax__balloon_popup .rect .medium .top_left_shadow{background-position:-1150px -600px}.ajax__balloon_popup .rect .large{height:300px;width:500px}.ajax__balloon_popup .rect .large .bottom_right{background-position:-450px 0}.ajax__balloon_popup .rect .large .bottom_right .ajax__content{padding:40px 30px 30px 15px}*html .ajax__balloon_popup .rect .large .bottom_right_shadow{background:none}.ajax__balloon_popup .rect .large .bottom_right_shadow{background-position:-1400px 0}.ajax__balloon_popup .rect .large .bottom_left{background-position:-450px -300px}.ajax__balloon_popup .rect .large .bottom_left .ajax__content{padding:40px 15px 30px 30px}*html .ajax__balloon_popup .rect .large .bottom_left_shadow{background:none}.ajax__balloon_popup .rect .large .bottom_left_shadow{background-position:-1400px -300px}.ajax__balloon_popup .rect .large .top_right{background-position:-450px -600px}.ajax__balloon_popup .rect .large .top_right .ajax__content{padding:30px 30px 45px 15px}*html .ajax__balloon_popup .rect .large .top_right_shadow{background:none}.ajax__balloon_popup .rect .large .top_right_shadow{background-position:-1400px -600px}.ajax__balloon_popup .rect .large .top_left{background-position:-450px -900px}.ajax__balloon_popup .rect .large .top_left .ajax__content{padding:25px 15px 45px 30px}*html .ajax__balloon_popup .rect .large .top_left_shadow{background:none}.ajax__balloon_popup .rect .large .top_left_shadow{background-position:-1400px -900px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.css new file mode 100644 index 000000000..636d49406 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.css @@ -0,0 +1,279 @@ +#LinearGradient1 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#LinearGradient2 { + stop-color: #ffffff; + stop-opacity: 0.4; +} + +#LinearGradient3 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#ChartTitle { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 16px; +} + +#VerticalLine { + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#HorizontalLine { + fill: none; + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#BaseLine { + fill: none; + fill-opacity: 1; + stroke: #8e8e8e; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#LegendArea { + fill: none; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#Legend1 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend2 { + fill: #D08AD9; + fill-opacity: 1; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend3 { + fill: #6586A7; + fill-opacity: 1; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend4 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend5 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend6 { + fill: #990033; + fill-opacity: 1; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend7 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend8 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend9 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend10 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Bar1 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar2 { + fill: #D08AD9; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar3 { + fill: #6586A7; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar4 { + fill: #0E426C; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar5 { + fill: #A156AB; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar6 { + fill: #990033; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar7 { + fill: #669900; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar8 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar9 { + fill: #FFC652; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#Bar10 { + fill: #4508A2; + fill-opacity: 1; + stroke: #cc5300; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#SeriesAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ValueAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#LegendText { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ChartBackGround { + fill: #ffffff; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.min.css new file mode 100644 index 000000000..febfba31c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BarChart.min.css @@ -0,0 +1 @@ +#LinearGradient1{stop-color:#fff;stop-opacity:0}#LinearGradient2{stop-color:#fff;stop-opacity:.4}#LinearGradient3{stop-color:#fff;stop-opacity:0}#ChartTitle{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:16px}#VerticalLine{fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#HorizontalLine{fill:none;fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#BaseLine{fill:none;fill-opacity:1;stroke:#8e8e8e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#LegendArea{fill:none;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#Legend1{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend2{fill:#d08ad9;fill-opacity:1;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend3{fill:#6586a7;fill-opacity:1;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend4{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend5{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend6{fill:#903;fill-opacity:1;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend7{fill:#690;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend8{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend9{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend10{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Bar1{fill:#6c1e83;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar2{fill:#d08ad9;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar3{fill:#6586a7;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar4{fill:#0e426c;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar5{fill:#a156ab;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar6{fill:#903;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar7{fill:#690;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar8{fill:#b85b3e;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar9{fill:#ffc652;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#Bar10{fill:#4508a2;fill-opacity:1;stroke:#cc5300;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#SeriesAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ValueAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#LegendText{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ChartBackGround{fill:#fff;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.css new file mode 100644 index 000000000..c8607c323 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.css @@ -0,0 +1,278 @@ +#LinearGradient1 { + stop-color: #ffffff; + stop-opacity: 0.10; +} + +#LinearGradient-Stop2 { + stop-color: #ffffff; + stop-opacity: 0.3; +} + +#LinearGradient-Stop3 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#ChartTitle { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 16px; +} + +#VerticalLine { + fill-opacity: 0.5; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 1; +} + +#HorizontalLine { + fill: none; + fill-opacity: 0.5; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 1; +} + +#BaseLine { + fill: none; + fill-opacity: 1; + stroke: #8e8e8e; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#LegendArea { + fill: none; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#Legend1 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend2 { + fill: #D08AD9; + fill-opacity: 1; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend3 { + fill: #6586A7; + fill-opacity: 1; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend4 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend5 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend6 { + fill: #990033; + fill-opacity: 1; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend7 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend8 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend9 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend10 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Dot1 { + fill: #6C1E83; + fill-opacity: 0.7; + stroke: #6C1E83; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot2 { + fill: #D08AD9; + fill-opacity: 0.7; + stroke: #D08AD9; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot3 { + fill: #6586A7; + fill-opacity: 0.7; + stroke: #6586A7; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot4 { + fill: #0E426C; + fill-opacity: 0.7; + stroke: #0E426C; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot5 { + fill: #A156AB; + fill-opacity: 0.7; + stroke: #A156AB; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot6 { + fill: #990033; + fill-opacity: 0.7; + stroke: #990033; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot7 { + fill: #669900; + fill-opacity: 0.7; + stroke: #669900; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot8 { + fill: #B85B3E; + fill-opacity: 0.7; + stroke: #B85B3E; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot9 { + fill: #FFC652; + fill-opacity: 0.7; + stroke: #FFC652; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#Dot10 { + fill: #4508A2; + fill-opacity: 0.7; + stroke: #4508A2; + stroke-opacity: 0.7; + stroke-width: 0; +} + +#SeriesAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ValueAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#LegendText { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ChartBackGround { + fill: #ffffff; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#DotTooltip { + background-color: #ffffff; + border: 2px solid #b85b3e; + color: #0E426C; + left: 0; + padding: 10px; + position: absolute; + top: 0; + visibility: hidden; + z-index: 10000; +} + +#AxisLabels { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.min.css new file mode 100644 index 000000000..27fae3d97 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/BubbleChart.min.css @@ -0,0 +1 @@ +#LinearGradient1{stop-color:#fff;stop-opacity:.1}#LinearGradient-Stop2{stop-color:#fff;stop-opacity:.3}#LinearGradient-Stop3{stop-color:#fff;stop-opacity:0}#ChartTitle{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:16px}#VerticalLine{fill-opacity:.5;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:1}#HorizontalLine{fill:none;fill-opacity:.5;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:1}#BaseLine{fill:none;fill-opacity:1;stroke:#8e8e8e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#LegendArea{fill:none;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#Legend1{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend2{fill:#d08ad9;fill-opacity:1;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend3{fill:#6586a7;fill-opacity:1;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend4{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend5{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend6{fill:#903;fill-opacity:1;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend7{fill:#690;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend8{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend9{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend10{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Dot1{fill:#6c1e83;fill-opacity:.7;stroke:#6c1e83;stroke-opacity:.7;stroke-width:0}#Dot2{fill:#d08ad9;fill-opacity:.7;stroke:#d08ad9;stroke-opacity:.7;stroke-width:0}#Dot3{fill:#6586a7;fill-opacity:.7;stroke:#6586a7;stroke-opacity:.7;stroke-width:0}#Dot4{fill:#0e426c;fill-opacity:.7;stroke:#0e426c;stroke-opacity:.7;stroke-width:0}#Dot5{fill:#a156ab;fill-opacity:.7;stroke:#a156ab;stroke-opacity:.7;stroke-width:0}#Dot6{fill:#903;fill-opacity:.7;stroke:#903;stroke-opacity:.7;stroke-width:0}#Dot7{fill:#690;fill-opacity:.7;stroke:#690;stroke-opacity:.7;stroke-width:0}#Dot8{fill:#b85b3e;fill-opacity:.7;stroke:#b85b3e;stroke-opacity:.7;stroke-width:0}#Dot9{fill:#ffc652;fill-opacity:.7;stroke:#ffc652;stroke-opacity:.7;stroke-width:0}#Dot10{fill:#4508a2;fill-opacity:.7;stroke:#4508a2;stroke-opacity:.7;stroke-width:0}#SeriesAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ValueAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#LegendText{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ChartBackGround{fill:#fff;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#DotTooltip{background-color:#fff;border:2px solid #b85b3e;color:#0e426c;left:0;padding:10px;position:absolute;top:0;visibility:hidden;z-index:10000}#AxisLabels{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.css new file mode 100644 index 000000000..2cc732fe0 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.css @@ -0,0 +1,236 @@ +.ajax__calendar_container { + cursor: default; + font-family: tahoma,verdana,helvetica; + font-size: 11px; + padding: 4px; + text-align: center; + width: 170px; +} + +.ajax__calendar_body { + height: 139px; + margin: auto; + overflow: hidden; + position: relative; + width: 170px; +} + +.ajax__calendar_days, .ajax__calendar_months, .ajax__calendar_years { + height: 139px; + left: 0; + margin: auto; + position: absolute; + text-align: center; + top: 0; + width: 170px; +} + +.ajax__calendar_days table, .ajax__calendar_months table, .ajax__calendar_years table { + border-spacing: 0; +} + +.ajax__calendar_container TABLE { + font-size: 11px; + margin: 0; + padding: 0; +} + +.ajax__calendar_container TD { + font-size: 11px; + margin: 0; + padding: 0; +} + +.ajax__calendar_header { + height: 20px; + width: 100%; +} + +.ajax__calendar_prev { + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: pointer; + float: left; + height: 15px; + width: 15px; +} + +.ajax__calendar_next { + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: pointer; + float: right; + height: 15px; + width: 15px; +} + +.ajax__calendar_title { + cursor: pointer; + font-weight: bold; + margin-left: 15px; + margin-right: 15px; +} + +.ajax__calendar_footer { + height: 15px; +} + +.ajax__calendar_today { + cursor: pointer; + padding-top: 3px; +} + +.ajax__calendar_dayname { + height: 17px; + padding: 0 2px; + text-align: right; + width: 17px; +} + +.ajax__calendar_day { + cursor: pointer; + height: 17px; + padding: 0 2px; + text-align: right; + width: 18px; +} + +.ajax__calendar_month { + cursor: pointer; + height: 44px; + overflow: hidden; + text-align: center; + width: 40px; +} + +.ajax__calendar_year { + cursor: pointer; + height: 44px; + overflow: hidden; + text-align: center; + width: 40px; +} + +.ajax__calendar .ajax__calendar_container { + background-color: #ffffff; + border: 1px solid #646464; + color: #000000; +} + +.ajax__calendar .ajax__calendar_footer { + border-top: 1px solid #f5f5f5; +} + +.ajax__calendar .ajax__calendar_dayname { + border-bottom: 1px solid #f5f5f5; +} + +.ajax__calendar .ajax__calendar_day { + border: 1px solid #ffffff; +} + +.ajax__calendar .ajax__calendar_month { + border: 1px solid #ffffff; +} + +.ajax__calendar .ajax__calendar_year { + border: 1px solid #ffffff; +} + +.ajax__calendar .ajax__calendar_active .ajax__calendar_day { + background-color: #edf9ff; + border-color: #0066cc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_active .ajax__calendar_month { + background-color: #edf9ff; + border-color: #0066cc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_active .ajax__calendar_year { + background-color: #edf9ff; + border-color: #0066cc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_today .ajax__calendar_day { + border-color: #0066cc; +} + +.ajax__calendar .ajax__calendar_today .ajax__calendar_month { + border-color: #0066cc; +} + +.ajax__calendar .ajax__calendar_today .ajax__calendar_year { + border-color: #0066cc; +} + +.ajax__calendar .ajax__calendar_other .ajax__calendar_day { + background-color: #ffffff; + border-color: #ffffff; + color: #646464; +} + +.ajax__calendar .ajax__calendar_other .ajax__calendar_year { + background-color: #ffffff; + border-color: #ffffff; + color: #646464; +} + +.ajax__calendar .ajax__calendar_hover .ajax__calendar_day { + background-color: #edf9ff; + border-color: #daf2fc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_hover .ajax__calendar_month { + background-color: #edf9ff; + border-color: #daf2fc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_hover .ajax__calendar_year { + background-color: #edf9ff; + border-color: #daf2fc; + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_hover .ajax__calendar_title { + color: #0066cc; +} + +.ajax__calendar .ajax__calendar_hover .ajax__calendar_today { + color: #0066cc; +} + +/* styles for invalid dates as defined by startDate and endDate*/ +.ajax__calendar .ajax__calendar_invalid .ajax__calendar_day { + background-color: #ffffff; + border-color: #ffffff; + color: #646464; + cursor: default; + text-decoration: line-through; +} + +.ajax__calendar .ajax__calendar_invalid .ajax__calendar_month { + background-color: #ffffff; + border-color: #ffffff; + color: #646464; + cursor: default; + text-decoration: line-through; +} + +.ajax__calendar .ajax__calendar_invalid .ajax__calendar_year { + background-color: #ffffff; + border-color: #ffffff; + color: #646464; + cursor: default; + text-decoration: line-through; +} + +.ajax__calendar .ajax__calendar_invalid .ajax__calendar_today { + cursor: default; + visibility: hidden; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.min.css new file mode 100644 index 000000000..9624c9326 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Calendar.min.css @@ -0,0 +1 @@ +.ajax__calendar_container{cursor:default;font-family:tahoma,verdana,helvetica;font-size:11px;padding:4px;text-align:center;width:170px}.ajax__calendar_body{height:139px;margin:auto;overflow:hidden;position:relative;width:170px}.ajax__calendar_days,.ajax__calendar_months,.ajax__calendar_years{height:139px;left:0;margin:auto;position:absolute;text-align:center;top:0;width:170px}.ajax__calendar_days table,.ajax__calendar_months table,.ajax__calendar_years table{border-spacing:0}.ajax__calendar_container TABLE{font-size:11px;margin:0;padding:0}.ajax__calendar_container TD{font-size:11px;margin:0;padding:0}.ajax__calendar_header{height:20px;width:100%}.ajax__calendar_prev{background-position:50% 50%;background-repeat:no-repeat;cursor:pointer;float:left;height:15px;width:15px}.ajax__calendar_next{background-position:50% 50%;background-repeat:no-repeat;cursor:pointer;float:right;height:15px;width:15px}.ajax__calendar_title{cursor:pointer;font-weight:bold;margin-left:15px;margin-right:15px}.ajax__calendar_footer{height:15px}.ajax__calendar_today{cursor:pointer;padding-top:3px}.ajax__calendar_dayname{height:17px;padding:0 2px;text-align:right;width:17px}.ajax__calendar_day{cursor:pointer;height:17px;padding:0 2px;text-align:right;width:18px}.ajax__calendar_month{cursor:pointer;height:44px;overflow:hidden;text-align:center;width:40px}.ajax__calendar_year{cursor:pointer;height:44px;overflow:hidden;text-align:center;width:40px}.ajax__calendar .ajax__calendar_container{background-color:#fff;border:1px solid #646464;color:#000}.ajax__calendar .ajax__calendar_footer{border-top:1px solid #f5f5f5}.ajax__calendar .ajax__calendar_dayname{border-bottom:1px solid #f5f5f5}.ajax__calendar .ajax__calendar_day{border:1px solid #fff}.ajax__calendar .ajax__calendar_month{border:1px solid #fff}.ajax__calendar .ajax__calendar_year{border:1px solid #fff}.ajax__calendar .ajax__calendar_active .ajax__calendar_day{background-color:#edf9ff;border-color:#06c;color:#06c}.ajax__calendar .ajax__calendar_active .ajax__calendar_month{background-color:#edf9ff;border-color:#06c;color:#06c}.ajax__calendar .ajax__calendar_active .ajax__calendar_year{background-color:#edf9ff;border-color:#06c;color:#06c}.ajax__calendar .ajax__calendar_today .ajax__calendar_day{border-color:#06c}.ajax__calendar .ajax__calendar_today .ajax__calendar_month{border-color:#06c}.ajax__calendar .ajax__calendar_today .ajax__calendar_year{border-color:#06c}.ajax__calendar .ajax__calendar_other .ajax__calendar_day{background-color:#fff;border-color:#fff;color:#646464}.ajax__calendar .ajax__calendar_other .ajax__calendar_year{background-color:#fff;border-color:#fff;color:#646464}.ajax__calendar .ajax__calendar_hover .ajax__calendar_day{background-color:#edf9ff;border-color:#daf2fc;color:#06c}.ajax__calendar .ajax__calendar_hover .ajax__calendar_month{background-color:#edf9ff;border-color:#daf2fc;color:#06c}.ajax__calendar .ajax__calendar_hover .ajax__calendar_year{background-color:#edf9ff;border-color:#daf2fc;color:#06c}.ajax__calendar .ajax__calendar_hover .ajax__calendar_title{color:#06c}.ajax__calendar .ajax__calendar_hover .ajax__calendar_today{color:#06c}.ajax__calendar .ajax__calendar_invalid .ajax__calendar_day{background-color:#fff;border-color:#fff;color:#646464;cursor:default;text-decoration:line-through}.ajax__calendar .ajax__calendar_invalid .ajax__calendar_month{background-color:#fff;border-color:#fff;color:#646464;cursor:default;text-decoration:line-through}.ajax__calendar .ajax__calendar_invalid .ajax__calendar_year{background-color:#fff;border-color:#fff;color:#646464;cursor:default;text-decoration:line-through}.ajax__calendar .ajax__calendar_invalid .ajax__calendar_today{cursor:default;visibility:hidden} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.css new file mode 100644 index 000000000..ead2780ca --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.css @@ -0,0 +1,21 @@ +.ajax__colorPicker_container { + background-color: #fff; + overflow: hidden; + position: absolute; + width: 201px; +} + +.ajax__colorPicker_container table { + border: 1px solid #646464; + border-spacing: 1px; +} + +.ajax__colorPicker_container table td { + padding: 0; +} + +.ajax__colorPicker_container table td div { + cursor: crosshair; + height: 11px; + width: 10px; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.min.css new file mode 100644 index 000000000..650628f2e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ColorPicker.min.css @@ -0,0 +1 @@ +.ajax__colorPicker_container{background-color:#fff;overflow:hidden;position:absolute;width:201px}.ajax__colorPicker_container table{border:1px solid #646464;border-spacing:1px}.ajax__colorPicker_container table td{padding:0}.ajax__colorPicker_container table td div{cursor:crosshair;height:11px;width:10px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.css new file mode 100644 index 000000000..79a06d0b1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.css @@ -0,0 +1,32 @@ +.ajax__combobox_buttoncontainer button { + background-position: center; + background-repeat: no-repeat; + border-color: ButtonFace; + height: 15px; + width: 15px; +} + +.ajax__combobox_itemlist { + background-color: Window; + border: solid 1px ButtonShadow; + color: WindowText; + cursor: default; + list-style-type: none; + margin: 0; + padding: 0; + text-align: left; +} + +.ajax__combobox_itemlist li { + padding: 0 3px 0 2px; + white-space: nowrap; + width: 100%; +} + +.ajax__combobox_inputcontainer { + border-spacing: 0; +} + +.ajax__combobox_inputcontainer td { + padding: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.min.css new file mode 100644 index 000000000..42623e21c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ComboBox.min.css @@ -0,0 +1 @@ +.ajax__combobox_buttoncontainer button{background-position:center;background-repeat:no-repeat;border-color:ButtonFace;height:15px;width:15px}.ajax__combobox_itemlist{background-color:Window;border:solid 1px ButtonShadow;color:WindowText;cursor:default;list-style-type:none;margin:0;padding:0;text-align:left}.ajax__combobox_itemlist li{padding:0 3px 0 2px;white-space:nowrap;width:100%}.ajax__combobox_inputcontainer{border-spacing:0}.ajax__combobox_inputcontainer td{padding:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.css new file mode 100644 index 000000000..8c70edb20 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.css @@ -0,0 +1,50 @@ +.ajax__dropdown_arrow { + height: 100%; + overflow: hidden; + position: absolute; +} + +.ajax__dropdown_panel { + background: white; + border: 1px solid #868686; +} + +.ajax__dropdown_frame { + border: 1px solid #2353B2; + cursor: pointer; + font-size: 1px; + overflow: hidden; + position: absolute; + text-align: right; +} + +.ajax__dropdown_frame_line { + cursor: pointer; + font-size: 1px; + overflow: hidden; + position: absolute; +} + +.ajax__dropdown_arrow_wrapper { + left: 50%; + position: absolute; + top: 50%; +} + +.ajax__dropdown_arrow_wrapper img { + left: -50%; + margin-top: -50%; + position: relative; + top: -50%; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { + .ajax__dropdown_arrow_wrapper img { + top: 0; + } +} + +.ajax__dropdown_arrow_image { + background-position: 50% 50%; + background-repeat: no-repeat; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.min.css new file mode 100644 index 000000000..8b3265667 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/DropDown.min.css @@ -0,0 +1 @@ +.ajax__dropdown_arrow{height:100%;overflow:hidden;position:absolute}.ajax__dropdown_panel{background:#fff;border:1px solid #868686}.ajax__dropdown_frame{border:1px solid #2353b2;cursor:pointer;font-size:1px;overflow:hidden;position:absolute;text-align:right}.ajax__dropdown_frame_line{cursor:pointer;font-size:1px;overflow:hidden;position:absolute}.ajax__dropdown_arrow_wrapper{left:50%;position:absolute;top:50%}.ajax__dropdown_arrow_wrapper img{left:-50%;margin-top:-50%;position:relative;top:-50%}@media screen and (-webkit-min-device-pixel-ratio:0){.ajax__dropdown_arrow_wrapper img{top:0}}.ajax__dropdown_arrow_image{background-position:50% 50%;background-repeat:no-repeat} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.css new file mode 100644 index 000000000..5b6df605f --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.css @@ -0,0 +1,22 @@ +table { + border: #000 1px dashed; +} + +td { + border: #000 1px dashed; +} + +div { + border: #0000FF 1px dashed; + margin: 0; + padding: 0; +} + +form { + border: #FF0000 1px dashed; +} + +.spell_highlighted { + background-color: blue; + color: yellow; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.min.css new file mode 100644 index 000000000..cc512d0fc --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.DesignPanel.min.css @@ -0,0 +1 @@ +table{border:#000 1px dashed}td{border:#000 1px dashed}div{border:#00f 1px dashed;margin:0;padding:0}form{border:red 1px dashed}.spell_highlighted{background-color:blue;color:#ff0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.css new file mode 100644 index 000000000..2a51fe2af --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.css @@ -0,0 +1,36 @@ +body { + background-color: #fff; + border-width: 0; + color: #404040; + margin: 0; + padding: 2px; +} + +body, table td { + font-family: verdana,sans-serif; + font-size: 10pt; +} + +h1 { + font-size: 24pt; +} + +h2 { + font-size: 18pt; +} + +h3 { + font-size: 14pt; +} + +h4 { + font-size: 12pt; +} + +h5 { + font-size: 10pt; +} + +h6 { + font-size: 8pt; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.min.css new file mode 100644 index 000000000..cb38feb92 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Document.min.css @@ -0,0 +1 @@ +body{background-color:#fff;border-width:0;color:#404040;margin:0;padding:2px}body,table td{font-family:verdana,sans-serif;font-size:10pt}h1{font-size:24pt}h2{font-size:18pt}h3{font-size:14pt}h4{font-size:12pt}h5{font-size:10pt}h6{font-size:8pt} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.css new file mode 100644 index 000000000..6d588e31e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.css @@ -0,0 +1,105 @@ +/* base layout */ +.ajax__htmleditor_editor_base .ajax__htmleditor_editor_container { + border-collapse: separate; + empty-cells: show; + height: 100%; + width: 100%; +} + +.ajax__htmleditor_editor_base .ajax__htmleditor_editor_toptoolbar { + cursor: text; +} + +.ajax__htmleditor_editor_base .ajax__htmleditor_toolbar_button { + border-width: 0; + cursor: pointer; + float: left; + height: 21px; + padding: 0; + white-space: nowrap; +} + +.ajax__htmleditor_editor_base img.ajax__htmleditor_toolbar_button { + width: 23px; +} + +.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button span.ajax__htmleditor_toolbar_selectlable { + cursor: text; + padding: 0 2px; + vertical-align: middle; +} + +.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton { + height: 20px; + margin: 0; + padding: 0; + vertical-align: middle; + width: 120px; +} + +.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton option { + vertical-align: middle; +} + +.ajax__htmleditor_editor_base .ajax__htmleditor_editor_editpanel { + height: 100%; +} + +.ajax__htmleditor_editor_base .ajax__htmleditor_editor_bottomtoolbar { + cursor: text; +} + +/* default theme */ +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_container { + border: 1px solid #C2C2C2; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar { + background-color: #F0F0F0; + padding: 0 2px 2px 2px; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar .ajax__htmleditor_toolbar_button { + background-color: #C2C2C2; + margin: 2px 0 0 0; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar .ajax__htmleditor_toolbar_button_hover { + background-color: #3C8AFF; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button span.ajax__htmleditor_toolbar_selectlable { + font-family: Arial; + font-size: 12px; + font-weight: bold; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton { + cursor: pointer; + font-family: arial; + font-size: 12px; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton option { + font-size: 12px; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_editpanel { + border-bottom: 1px solid #C2C2C2; + border-top: 1px solid #C2C2C2; + border-width: 0; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar { + background-color: #F0F0F0; + padding: 0 0 2px 2px; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar .ajax__htmleditor_toolbar_button { + background-color: #C2C2C2; + margin: 0 4px 0 0; +} + +.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar .ajax__htmleditor_toolbar_button_hover { + background-color: #3C8AFF; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.min.css new file mode 100644 index 000000000..98576c1a7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Editor.min.css @@ -0,0 +1 @@ +.ajax__htmleditor_editor_base .ajax__htmleditor_editor_container{border-collapse:separate;empty-cells:show;height:100%;width:100%}.ajax__htmleditor_editor_base .ajax__htmleditor_editor_toptoolbar{cursor:text}.ajax__htmleditor_editor_base .ajax__htmleditor_toolbar_button{border-width:0;cursor:pointer;float:left;height:21px;padding:0;white-space:nowrap}.ajax__htmleditor_editor_base img.ajax__htmleditor_toolbar_button{width:23px}.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button span.ajax__htmleditor_toolbar_selectlable{cursor:text;padding:0 2px;vertical-align:middle}.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton{height:20px;margin:0;padding:0;vertical-align:middle;width:120px}.ajax__htmleditor_editor_base div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton option{vertical-align:middle}.ajax__htmleditor_editor_base .ajax__htmleditor_editor_editpanel{height:100%}.ajax__htmleditor_editor_base .ajax__htmleditor_editor_bottomtoolbar{cursor:text}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_container{border:1px solid #c2c2c2}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar{background-color:#f0f0f0;padding:0 2px 2px 2px}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar .ajax__htmleditor_toolbar_button{background-color:#c2c2c2;margin:2px 0 0 0}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar .ajax__htmleditor_toolbar_button_hover{background-color:#3c8aff}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button span.ajax__htmleditor_toolbar_selectlable{font-family:Arial;font-size:12px;font-weight:bold}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton{cursor:pointer;font-family:arial;font-size:12px}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_toptoolbar div.ajax__htmleditor_toolbar_button select.ajax__htmleditor_toolbar_selectbutton option{font-size:12px}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_editpanel{border-bottom:1px solid #c2c2c2;border-top:1px solid #c2c2c2;border-width:0}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar{background-color:#f0f0f0;padding:0 0 2px 2px}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar .ajax__htmleditor_toolbar_button{background-color:#c2c2c2;margin:0 4px 0 0}.ajax__htmleditor_editor_default .ajax__htmleditor_editor_bottomtoolbar .ajax__htmleditor_toolbar_button_hover{background-color:#3c8aff} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.css new file mode 100644 index 000000000..18e4cfb4a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.css @@ -0,0 +1,10 @@ +.ajax__htmleditor_htmlpanel_default { + background-color: #fff; + border-width: 0; + color: #000; + font-family: verdana,sans-serif; + font-size: 10pt; + margin: 0; + overflow: auto; + padding: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.min.css new file mode 100644 index 000000000..b637c81d0 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.HtmlPanel.min.css @@ -0,0 +1 @@ +.ajax__htmleditor_htmlpanel_default{background-color:#fff;border-width:0;color:#000;font-family:verdana,sans-serif;font-size:10pt;margin:0;overflow:auto;padding:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.css new file mode 100644 index 000000000..5d8b6ba55 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.css @@ -0,0 +1,76 @@ +body { + background-color: #DFDFDF; + color: #404040; + margin: 0; + padding: 0; +} + +html, body { + border-width: 0; +} + +div.ajax__htmleditor_attachedpopup_default { + border: 1px solid #B0B0B0; + font-family: Arial; + font-size: 11px; + padding: 5px; +} + +.ajax__htmleditor_attachedpopup_default label, button, div, input, select, td, fieldset { + font-family: Tahoma; + font-size: 11px; +} + +.ajax__htmleditor_attachedpopup_default input { + height: 14px; +} + +.ajax__htmleditor_attachedpopup_default img { + border: none; + margin: 0; + padding: 0; +} + +.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton { + background-color: #C2C2C2; + border-width: 0; + margin: 0; + padding: 0; + padding: 1px; +} + +.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton_hover { + background-color: #3C8AFF; + cursor: pointer; +} + +.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton table { + border-width: 0; + width: 100%; +} + +.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton { + background-repeat: repeat-x; + border-width: 0; + font-weight: bold; + height: 19px; + overflow: hidden; + text-align: center; + vertical-align: middle; + width: 100%; +} + +.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton_hover { + cursor: pointer; +} + +.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_confirmbutton { + float: right; + margin-left: 5px; + margin-top: 5px; + width: 60px; +} + +.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton_hover span { + cursor: pointer; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.min.css new file mode 100644 index 000000000..dd2387076 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditor.Popups.AttachedTemplatePopup.min.css @@ -0,0 +1 @@ +body{background-color:#dfdfdf;color:#404040;margin:0;padding:0}html,body{border-width:0}div.ajax__htmleditor_attachedpopup_default{border:1px solid #b0b0b0;font-family:Arial;font-size:11px;padding:5px}.ajax__htmleditor_attachedpopup_default label,button,div,input,select,td,fieldset{font-family:Tahoma;font-size:11px}.ajax__htmleditor_attachedpopup_default input{height:14px}.ajax__htmleditor_attachedpopup_default img{border:none;margin:0;padding:0}.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton{background-color:#c2c2c2;border-width:0;margin:0;padding:0;padding:1px}.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton_hover{background-color:#3c8aff;cursor:pointer}.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_boxbutton table{border-width:0;width:100%}.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton{background-repeat:repeat-x;border-width:0;font-weight:bold;height:19px;overflow:hidden;text-align:center;vertical-align:middle;width:100%}.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton_hover{cursor:pointer}.ajax__htmleditor_attachedpopup_default div.ajax__htmleditor_popup_confirmbutton{float:right;margin-left:5px;margin-top:5px;width:60px}.ajax__htmleditor_attachedpopup_default td.ajax__htmleditor_popup_bgibutton_hover span{cursor:pointer} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.css new file mode 100644 index 000000000..a03471818 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.css @@ -0,0 +1,242 @@ +.ajax__html_editor_extender_button { + background-color: #c2c2c2; + background-repeat: no-repeat; + border: none; + cursor: pointer; + display: block; + float: left; +} + +.ajax__html_editor_extender_button:hover { + background-color: #3c8aff; +} + +.ajax__html_editor_extender_buttoncontainer { + background-color: #F0F0F0; + border: 1px solid #c2c2c2; + border-bottom: none; + overflow: auto; + padding: 2px 2px 2px 2px; +} + +.ajax__html_editor_extender_buttoncontainer2 { + background-color: #F0F0F0; + border-bottom: 1px solid #c2c2c2; + border-left: 1px solid #c2c2c2; + border-right: 1px solid #c2c2c2; + overflow: auto; + padding: 2px 2px 2px 2px; +} + +.ajax__html_editor_extender_texteditor { + border-color: #c2c2c2; + border-style: solid; + border-width: 1px; + padding: 2px 2px 2px 2px; +} + +.ajax__html_editor_extender_footercontainer { + background-color: #F0F0F0; + border: 1px solid #c2c2c2; + height: 10px; + padding: 2px 2px 2px 2px; +} + +.ajax__html_editor_extender_backcolorclass { + float: left; +} + +.ajax__html_editor_extender_forecolorclass { + float: left; +} + +.ajax__html_editor_extender_fontnameclass { + float: left; +} + +.ajax__html_editor_extender_fontsizeclass { + float: left; +} + +.ajax__html_editor_extender_Undo { + background-position: -0px 0; +} + +.ajax__html_editor_extender_Redo { + background-position: -23px 0; +} + +.ajax__html_editor_extender_Bold { + background-position: -46px 0; +} + +.ajax__html_editor_extender_Italic { + background-position: -69px 0; +} + +.ajax__html_editor_extender_Underline { + background-position: -92px 0; +} + +.ajax__html_editor_extender_StrikeThrough { + background-position: -115px 0; +} + +.ajax__html_editor_extender_Subscript { + background-position: -138px 0; +} + +.ajax__html_editor_extender_Superscript { + background-position: -161px 0; +} + +.ajax__html_editor_extender_JustifyLeft { + background-position: -230px 0; +} + +.ajax__html_editor_extender_JustifyRight { + background-position: -276px 0; +} + +.ajax__html_editor_extender_JustifyCenter { + background-position: -253px 0; +} + +.ajax__html_editor_extender_JustifyFull { + background-position: -299px 0; +} + +.ajax__html_editor_extender_insertOrderedList { + background-position: -345px 0; +} + +.ajax__html_editor_extender_insertUnorderedList { + background-position: -368px 0; +} + +.ajax__html_editor_extender_createLink { + background-position: -414px 0; +} + +.ajax__html_editor_extender_UnLink { + background-position: -437px 0; +} + +.ajax__html_editor_extender_FormatBlock { + background-position: -897px 0; +} + +.ajax__html_editor_extender_RemoveFormat { + background-position: -460px 0; +} + +.ajax__html_editor_extender_InsertImage { + background-position: -621px 0; +} + +.ajax__html_editor_extender_SelectAll { + background-position: -644px 0; +} + +.ajax__html_editor_extender_UnSelect { + background-position: -667px 0; +} + +.ajax__html_editor_extender_Delete { + background-position: -690px 0; +} + +.ajax__html_editor_extender_Cut { + background-position: -483px 0; +} + +.ajax__html_editor_extender_Copy { + background-position: -713px 0; +} + +.ajax__html_editor_extender_Paste { + background-position: -736px 0; +} + +.ajax__html_editor_extender_BackColor { + background-position: -760px -1px; + text-indent: -9999px; +} + +.ajax__html_editor_extender_ForeColor { + background-position: -783px -1px; + text-indent: -9999px; +} + +.ajax__html_editor_extender_FontName { + background-position: -0px 48px; +} + +.ajax__html_editor_extender_Indent { + background-position: -575px 0; +} + +.ajax__html_editor_extender_Outdent { + background-position: -552px 0; +} + +.ajax__html_editor_extender_InsertHorizontalRule { + background-position: -391px 0; +} + +.ajax__html_editor_extender_content { + background-position: -920px 0; +} + +.ajax__html_editor_extender_source { + background-position: -943px 0; +} + +.ajax__html_editor_extender_content:active { + background-position: -920px -21px; +} + +.ajax__html_editor_extender_source:active { + background-position: -943px -21px; +} + +.ajax__html_editor_extender_separator { + background-position: -966px 0; + background-repeat:no-repeat; + border: none; + display: block; + float: left; + height: 21px; + width: 13px; +} + +.ajax__html_editor_extender_popupDiv { + background-color: white; + border: 1px solid #555555; + border-color: black; + box-shadow: 0 4px 30px #000000; + height: 290px; + left: 50%; + margin-left: -250px; + margin-top: -145px; + overflow: auto; + padding: 10px; + position: fixed; + top: 50%; + width: 500px; +} + +.ajax__html_editor_extender_popupCancelButton { + border: 1px solid #BBBBBB; + color: #464646; + cursor: pointer; + line-height: 24px; + margin-top: 10px; + text-align: center; + width: 75px; +} + +.ajax__html_editor_extender_popupCancelButton:hover { + border: 1px solid #666666; + color: #000000; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.min.css new file mode 100644 index 000000000..b0a0b76dc --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/HtmlEditorExtender.min.css @@ -0,0 +1 @@ +.ajax__html_editor_extender_button{background-color:#c2c2c2;background-repeat:no-repeat;border:none;cursor:pointer;display:block;float:left}.ajax__html_editor_extender_button:hover{background-color:#3c8aff}.ajax__html_editor_extender_buttoncontainer{background-color:#f0f0f0;border:1px solid #c2c2c2;border-bottom:none;overflow:auto;padding:2px 2px 2px 2px}.ajax__html_editor_extender_buttoncontainer2{background-color:#f0f0f0;border-bottom:1px solid #c2c2c2;border-left:1px solid #c2c2c2;border-right:1px solid #c2c2c2;overflow:auto;padding:2px 2px 2px 2px}.ajax__html_editor_extender_texteditor{border-color:#c2c2c2;border-style:solid;border-width:1px;padding:2px 2px 2px 2px}.ajax__html_editor_extender_footercontainer{background-color:#f0f0f0;border:1px solid #c2c2c2;height:10px;padding:2px 2px 2px 2px}.ajax__html_editor_extender_backcolorclass{float:left}.ajax__html_editor_extender_forecolorclass{float:left}.ajax__html_editor_extender_fontnameclass{float:left}.ajax__html_editor_extender_fontsizeclass{float:left}.ajax__html_editor_extender_Undo{background-position:-0 0}.ajax__html_editor_extender_Redo{background-position:-23px 0}.ajax__html_editor_extender_Bold{background-position:-46px 0}.ajax__html_editor_extender_Italic{background-position:-69px 0}.ajax__html_editor_extender_Underline{background-position:-92px 0}.ajax__html_editor_extender_StrikeThrough{background-position:-115px 0}.ajax__html_editor_extender_Subscript{background-position:-138px 0}.ajax__html_editor_extender_Superscript{background-position:-161px 0}.ajax__html_editor_extender_JustifyLeft{background-position:-230px 0}.ajax__html_editor_extender_JustifyRight{background-position:-276px 0}.ajax__html_editor_extender_JustifyCenter{background-position:-253px 0}.ajax__html_editor_extender_JustifyFull{background-position:-299px 0}.ajax__html_editor_extender_insertOrderedList{background-position:-345px 0}.ajax__html_editor_extender_insertUnorderedList{background-position:-368px 0}.ajax__html_editor_extender_createLink{background-position:-414px 0}.ajax__html_editor_extender_UnLink{background-position:-437px 0}.ajax__html_editor_extender_FormatBlock{background-position:-897px 0}.ajax__html_editor_extender_RemoveFormat{background-position:-460px 0}.ajax__html_editor_extender_InsertImage{background-position:-621px 0}.ajax__html_editor_extender_SelectAll{background-position:-644px 0}.ajax__html_editor_extender_UnSelect{background-position:-667px 0}.ajax__html_editor_extender_Delete{background-position:-690px 0}.ajax__html_editor_extender_Cut{background-position:-483px 0}.ajax__html_editor_extender_Copy{background-position:-713px 0}.ajax__html_editor_extender_Paste{background-position:-736px 0}.ajax__html_editor_extender_BackColor{background-position:-760px -1px;text-indent:-9999px}.ajax__html_editor_extender_ForeColor{background-position:-783px -1px;text-indent:-9999px}.ajax__html_editor_extender_FontName{background-position:-0 48px}.ajax__html_editor_extender_Indent{background-position:-575px 0}.ajax__html_editor_extender_Outdent{background-position:-552px 0}.ajax__html_editor_extender_InsertHorizontalRule{background-position:-391px 0}.ajax__html_editor_extender_content{background-position:-920px 0}.ajax__html_editor_extender_source{background-position:-943px 0}.ajax__html_editor_extender_content:active{background-position:-920px -21px}.ajax__html_editor_extender_source:active{background-position:-943px -21px}.ajax__html_editor_extender_separator{background-position:-966px 0;background-repeat:no-repeat;border:none;display:block;float:left;height:21px;width:13px}.ajax__html_editor_extender_popupDiv{background-color:#fff;border:1px solid #555;border-color:#000;box-shadow:0 4px 30px #000;height:290px;left:50%;margin-left:-250px;margin-top:-145px;overflow:auto;padding:10px;position:fixed;top:50%;width:500px}.ajax__html_editor_extender_popupCancelButton{border:1px solid #bbb;color:#464646;cursor:pointer;line-height:24px;margin-top:10px;text-align:center;width:75px}.ajax__html_editor_extender_popupCancelButton:hover{border:1px solid #666;color:#000} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.css new file mode 100644 index 000000000..52f013925 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.css @@ -0,0 +1,359 @@ +#LinearGradient-Stop1 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#LinearGradient-Stop2 { + stop-color: #ffffff; + stop-opacity: 0.4; +} + +#LinearGradient-Stop3 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#ChartTitle { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 16px; +} + +#VerticalLine { + fill-opacity: 0.5; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 1; +} + +#HorizontalLine { + fill: none; + fill-opacity: 0.5; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 1; +} + +#BaseLine { + fill: none; + fill-opacity: 1; + stroke: #8e8e8e; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#LegendArea { + fill: none; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#Legend1 { + fill: #ff6800; + fill-opacity: 1; + stroke: #ff6800; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend2 { + fill: #a0a700; + fill-opacity: 1; + stroke: #a0a700; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend3 { + fill: #711737; + fill-opacity: 1; + stroke: #711737; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend4 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend5 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend6 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend7 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend8 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend9 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Legend10 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; +} + +#Dot1 { + fill: #ff6800; + fill-opacity: 1; + stroke: #ff6800; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot2 { + fill: #a0a700; + fill-opacity: 1; + stroke: #a0a700; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot3 { + fill: #711737; + fill-opacity: 1; + stroke: #711737; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot4 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot5 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot6 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot7 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot8 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot9 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-opacity: 1; + stroke-width: 2; +} + +#Dot10 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line1 { + fill: none; + fill-opacity: 1; + stroke: #ff6800; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line2 { + fill: none; + fill-opacity: 1; + stroke: #a0a700; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line3 { + fill: none; + fill-opacity: 1; + stroke: #711737; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line4 { + fill: none; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line5 { + fill: none; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line6 { + fill: none; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line7 { + fill: none; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line8 { + fill: none; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line9 { + fill: none; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#Line10 { + fill: none; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 2; +} + +#SeriesAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ValueAxis { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#LegendText { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ChartBackGround { + fill: #fff; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.min.css new file mode 100644 index 000000000..ab79ad6c0 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/LineChart.min.css @@ -0,0 +1 @@ +#LinearGradient-Stop1{stop-color:#fff;stop-opacity:0}#LinearGradient-Stop2{stop-color:#fff;stop-opacity:.4}#LinearGradient-Stop3{stop-color:#fff;stop-opacity:0}#ChartTitle{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:16px}#VerticalLine{fill-opacity:.5;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:1}#HorizontalLine{fill:none;fill-opacity:.5;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:1}#BaseLine{fill:none;fill-opacity:1;stroke:#8e8e8e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#LegendArea{fill:none;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#Legend1{fill:#ff6800;fill-opacity:1;stroke:#ff6800;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend2{fill:#a0a700;fill-opacity:1;stroke:#a0a700;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend3{fill:#711737;fill-opacity:1;stroke:#711737;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend4{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend5{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend6{fill:#690;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend7{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend8{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend9{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Legend10{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1}#Dot1{fill:#ff6800;fill-opacity:1;stroke:#ff6800;stroke-opacity:1;stroke-width:2}#Dot2{fill:#a0a700;fill-opacity:1;stroke:#a0a700;stroke-opacity:1;stroke-width:2}#Dot3{fill:#711737;fill-opacity:1;stroke:#711737;stroke-opacity:1;stroke-width:2}#Dot4{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-opacity:1;stroke-width:2}#Dot5{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-opacity:1;stroke-width:2}#Dot6{fill:#690;fill-opacity:1;stroke:#690;stroke-opacity:1;stroke-width:2}#Dot7{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-opacity:1;stroke-width:2}#Dot8{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-opacity:1;stroke-width:2}#Dot9{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-opacity:1;stroke-width:2}#Dot10{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-opacity:1;stroke-width:2}#Line1{fill:none;fill-opacity:1;stroke:#ff6800;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line2{fill:none;fill-opacity:1;stroke:#a0a700;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line3{fill:none;fill-opacity:1;stroke:#711737;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line4{fill:none;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line5{fill:none;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line6{fill:none;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line7{fill:none;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line8{fill:none;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line9{fill:none;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#Line10{fill:none;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:2}#SeriesAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ValueAxis{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#LegendText{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ChartBackGround{fill:#fff;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.css new file mode 100644 index 000000000..815cbec60 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.css @@ -0,0 +1,75 @@ +.ajax__multi_slider_default .outer_rail_vertical { + background: repeat-y; + height: 150px; + position: absolute; + width: 22px; +} + +.ajax__multi_slider_default .inner_rail_vertical { + background: repeat-y; + position: absolute; + width: 22px; + z-index: 100; +} + +.ajax__multi_slider_default .inner_rail_horizontal { + background: repeat-x; + height: 22px; + position: absolute; + z-index: 100; +} + +.ajax__multi_slider_default .outer_rail_horizontal { + background: repeat-x; + height: 22px; + position: absolute; + width: 150px; +} + +.ajax__multi_slider_default .handle_horizontal { + background: no-repeat; + height: 22px; + position: absolute; + width: 10px; + z-index: 200; +} + +.ajax__multi_slider_default .handle_horizontal_hover { + background: no-repeat; + height: 22px; + position: absolute; + width: 10px; + z-index: 200; +} + +.ajax__multi_slider_default .handle_horizontal_down { + background: no-repeat; + height: 22px; + position: absolute; + width: 10px; + z-index: 200; +} + +.ajax__multi_slider_default .handle_vertical { + background: no-repeat; + height: 10px; + position: absolute; + width: 22px; + z-index: 200; +} + +.ajax__multi_slider_default .handle_vertical_hover { + background: no-repeat; + height: 10px; + position: absolute; + width: 22px; + z-index: 200; +} + +.ajax__multi_slider_default .handle_vertical_down { + background: no-repeat; + height: 10px; + position: absolute; + width: 22px; + z-index: 200; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.min.css new file mode 100644 index 000000000..5cfa4cf31 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/MultiHandleSlider.min.css @@ -0,0 +1 @@ +.ajax__multi_slider_default .outer_rail_vertical{background:repeat-y;height:150px;position:absolute;width:22px}.ajax__multi_slider_default .inner_rail_vertical{background:repeat-y;position:absolute;width:22px;z-index:100}.ajax__multi_slider_default .inner_rail_horizontal{background:repeat-x;height:22px;position:absolute;z-index:100}.ajax__multi_slider_default .outer_rail_horizontal{background:repeat-x;height:22px;position:absolute;width:150px}.ajax__multi_slider_default .handle_horizontal{background:no-repeat;height:22px;position:absolute;width:10px;z-index:200}.ajax__multi_slider_default .handle_horizontal_hover{background:no-repeat;height:22px;position:absolute;width:10px;z-index:200}.ajax__multi_slider_default .handle_horizontal_down{background:no-repeat;height:22px;position:absolute;width:10px;z-index:200}.ajax__multi_slider_default .handle_vertical{background:no-repeat;height:10px;position:absolute;width:22px;z-index:200}.ajax__multi_slider_default .handle_vertical_hover{background:no-repeat;height:10px;position:absolute;width:22px;z-index:200}.ajax__multi_slider_default .handle_vertical_down{background:no-repeat;height:10px;position:absolute;width:22px;z-index:200} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.css new file mode 100644 index 000000000..f7db2a83f --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.css @@ -0,0 +1,3 @@ +.ajax__numericupdown_container { + border-spacing: 0; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.min.css new file mode 100644 index 000000000..00cb917a3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/NumericUpDown.min.css @@ -0,0 +1 @@ +.ajax__numericupdown_container{border-spacing:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.css new file mode 100644 index 000000000..a0d4b7eaf --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.css @@ -0,0 +1,265 @@ +#RadialGradient1 { + stop-color: #ffffff; + stop-opacity: 0.10; +} + +#RadialGradient2 { + stop-color: #ffffff; + stop-opacity: 0.3; +} + +#RadialGradient3 { + stop-color: #ffffff; + stop-opacity: 0; +} + +#ChartTitle { + fill: #711737; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 16px; +} + +#VerticalLine { + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#HorizontalLine { + fill: none; + fill-opacity: 1; + stroke: #dfdfdf; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#BaseLine { + fill: none; + fill-opacity: 1; + stroke: #8e8e8e; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 1; +} + +#LegendArea { + fill: none; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} + +#Legend1 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend2 { + fill: #D08AD9; + fill-opacity: 1; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend3 { + fill: #6586A7; + fill-opacity: 1; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend4 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend5 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend6 { + fill: #990033; + fill-opacity: 1; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend7 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend8 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend9 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Legend10 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; +} + +#Segment1 { + fill: #6C1E83; + fill-opacity: 1; + stroke: #6C1E83; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0; +} + +#Segment2 { + fill: #D08AD9; + fill-opacity: 1; + stroke: #D08AD9; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0; +} + +#Segment3 { + fill: #6586A7; + fill-opacity: 1; + stroke: #6586A7; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0; +} + +#Segment4 { + fill: #0E426C; + fill-opacity: 1; + stroke: #0E426C; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment5 { + fill: #A156AB; + fill-opacity: 1; + stroke: #A156AB; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment6 { + fill: #990033; + fill-opacity: 1; + stroke: #990033; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment7 { + fill: #669900; + fill-opacity: 1; + stroke: #669900; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment8 { + fill: #B85B3E; + fill-opacity: 1; + stroke: #B85B3E; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment9 { + fill: #FFC652; + fill-opacity: 1; + stroke: #FFC652; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#Segment10 { + fill: #4508A2; + fill-opacity: 1; + stroke: #4508A2; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 0.5; + stroke-width: 0.5; +} + +#LegendText { + fill: #232323; + fill-opacity: 1; + font-family: Arial,Helvetica,sans-serif; + font-size: 11px; +} + +#ChartBackGround { + fill: #ffffff; + fill-opacity: 1; + stroke-linecap: square; + stroke-linejoin: round; + stroke-opacity: 1; + stroke-width: 0; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.min.css new file mode 100644 index 000000000..52d2343b9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/PieChart.min.css @@ -0,0 +1 @@ +#RadialGradient1{stop-color:#fff;stop-opacity:.1}#RadialGradient2{stop-color:#fff;stop-opacity:.3}#RadialGradient3{stop-color:#fff;stop-opacity:0}#ChartTitle{fill:#711737;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:16px}#VerticalLine{fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#HorizontalLine{fill:none;fill-opacity:1;stroke:#dfdfdf;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#BaseLine{fill:none;fill-opacity:1;stroke:#8e8e8e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:1}#LegendArea{fill:none;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0}#Legend1{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend2{fill:#d08ad9;fill-opacity:1;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend3{fill:#6586a7;fill-opacity:1;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend4{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend5{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend6{fill:#903;fill-opacity:1;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend7{fill:#690;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend8{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend9{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Legend10{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5}#Segment1{fill:#6c1e83;fill-opacity:1;stroke:#6c1e83;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:0}#Segment2{fill:#d08ad9;fill-opacity:1;stroke:#d08ad9;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:0}#Segment3{fill:#6586a7;fill-opacity:1;stroke:#6586a7;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:0}#Segment4{fill:#0e426c;fill-opacity:1;stroke:#0e426c;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment5{fill:#a156ab;fill-opacity:1;stroke:#a156ab;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment6{fill:#903;fill-opacity:1;stroke:#903;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment7{fill:#690;fill-opacity:1;stroke:#690;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment8{fill:#b85b3e;fill-opacity:1;stroke:#b85b3e;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment9{fill:#ffc652;fill-opacity:1;stroke:#ffc652;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#Segment10{fill:#4508a2;fill-opacity:1;stroke:#4508a2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:.5;stroke-width:.5}#LegendText{fill:#232323;fill-opacity:1;font-family:Arial,Helvetica,sans-serif;font-size:11px}#ChartBackGround{fill:#fff;fill-opacity:1;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:1;stroke-width:0} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.css new file mode 100644 index 000000000..baebaac7b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.css @@ -0,0 +1,102 @@ +.visible { + opacity: 1; +} + +.invisible { + opacity: 0; +} + +.ajax__slide_show_fadeOut { + -webkit-transition: all 1s ease-in-out; + -moz-transition: all 1s ease-in-out; + -o-transition: all 1s ease-in-out; + -ms-transition: all 1s ease-in-out; + opacity: 0; + transition: all 1s ease-in-out; +} + +.ajax__slide_show_fadeIn { + -webkit-transition: all 1s ease-in-out; + -moz-transition: all 1s ease-in-out; + -o-transition: all 1s ease-in-out; + -ms-transition: all 1s ease-in-out; + opacity: 1; + transition: all 1s ease-in-out; +} + +.ajax__slide_show_Animation { + -webkit-transition: all 1s ease-in-out; + -moz-transition: all 1s ease-in-out; + -o-transition: all 1s ease-in-out; + transition: all 1s ease-in-out; +} + +.ajax__slide_show_scaleX { + -webkit-transform: scale(0,1); + -moz-transform: scale(0,1); + -o-transform: scale(0,1); + -ms-transform: scale(0,1); + transform: scale(0,1); +} + +.ajax__slide_show_scaleY { + -webkit-transform: scale(1,0); + -moz-transform: scale(1,0); + -o-transform: scale(1,0); + -ms-transform: scale(1,0); + transform: scale(1,0); +} + +.ajax__slide_show_zoomIn { + opacity: 1; + -webkit-transform: scale(1,1); + -webkit-transform-origin: center right; + -moz-transform: scale(1,1); + -moz-transform-origin: center right; + -o-transform: scale(1,1); + -o-transform-origin: center right; + -ms-transform: scale(1,1); + transform: scale(1,1); + -ms-transform-origin: center right; + transform-origin: center right; +} + +.ajax__slide_show_zoomOut { + -webkit-transform: scale(0,0); + -webkit-transform-origin: center left; + -moz-transform: scale(0,0); + -moz-transform-origin: center left; + -o-transform: scale(0,0); + -o-transform-origin: center left; + -ms-transform: scale(0,0); + transform: scale(0,0); + -ms-transform-origin: center left; + transform-origin: center left; +} + +.ajax__slide_show_rotate { + filter: alpha(opacity=0); + -webkit-transform: rotate(360deg) scale(0,0); + -moz-transform: rotate(360deg) scale(0,0); + -o-transform: rotate(360deg) scale(0,0); + -ms-transform: rotate(360deg) scale(0,0); + transform: rotate(360deg) scale(0,0); +} + +.ajax__slide_show_container { + overflow: hidden; + position: relative; +} + +.ajax__slide_show_slideAnimation { + -webkit-transition: all 1.0s ease-in-out; + -moz-transition: all 1.0s ease-in-out; + -o-transition: all 1.0s ease-in-out; + transition: all 1.0s ease-in-out; +} + +.ajax__slide_show_sliderUL { + margin: 0; + padding: 0; + position: relative; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.min.css new file mode 100644 index 000000000..c03617e3d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/SlideShow.min.css @@ -0,0 +1 @@ +.visible{opacity:1}.invisible{opacity:0}.ajax__slide_show_fadeOut{-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;-ms-transition:all 1s ease-in-out;opacity:0;transition:all 1s ease-in-out}.ajax__slide_show_fadeIn{-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;-ms-transition:all 1s ease-in-out;opacity:1;transition:all 1s ease-in-out}.ajax__slide_show_Animation{-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;transition:all 1s ease-in-out}.ajax__slide_show_scaleX{-webkit-transform:scale(0,1);-moz-transform:scale(0,1);-o-transform:scale(0,1);-ms-transform:scale(0,1);transform:scale(0,1)}.ajax__slide_show_scaleY{-webkit-transform:scale(1,0);-moz-transform:scale(1,0);-o-transform:scale(1,0);-ms-transform:scale(1,0);transform:scale(1,0)}.ajax__slide_show_zoomIn{opacity:1;-webkit-transform:scale(1,1);-webkit-transform-origin:center right;-moz-transform:scale(1,1);-moz-transform-origin:center right;-o-transform:scale(1,1);-o-transform-origin:center right;-ms-transform:scale(1,1);transform:scale(1,1);-ms-transform-origin:center right;transform-origin:center right}.ajax__slide_show_zoomOut{-webkit-transform:scale(0,0);-webkit-transform-origin:center left;-moz-transform:scale(0,0);-moz-transform-origin:center left;-o-transform:scale(0,0);-o-transform-origin:center left;-ms-transform:scale(0,0);transform:scale(0,0);-ms-transform-origin:center left;transform-origin:center left}.ajax__slide_show_rotate{filter:alpha(opacity=0);-webkit-transform:rotate(360deg) scale(0,0);-moz-transform:rotate(360deg) scale(0,0);-o-transform:rotate(360deg) scale(0,0);-ms-transform:rotate(360deg) scale(0,0);transform:rotate(360deg) scale(0,0)}.ajax__slide_show_container{overflow:hidden;position:relative}.ajax__slide_show_slideAnimation{-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;transition:all 1s ease-in-out}.ajax__slide_show_sliderUL{margin:0;padding:0;position:relative} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.css new file mode 100644 index 000000000..4cc987bb6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.css @@ -0,0 +1,29 @@ +.ajax__slider_h_rail { + background-repeat: repeat-x; + height: 22px; + position: relative; + width: 150px; +} + +.ajax__slider_h_handle { + height: 22px; + position: absolute; + width: 10px; +} + +.ajax__slider_v_rail { + background-repeat: repeat-y; + height: 150px; + position: relative; + width: 22px; +} + +.ajax__slider_v_handle { + height: 10px; + position: absolute; + width: 22px; +} + +.ajax__slider_v_handle img { + display: block; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.min.css new file mode 100644 index 000000000..e717666c1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Slider.min.css @@ -0,0 +1 @@ +.ajax__slider_h_rail{background-repeat:repeat-x;height:22px;position:relative;width:150px}.ajax__slider_h_handle{height:22px;position:absolute;width:10px}.ajax__slider_v_rail{background-repeat:repeat-y;height:150px;position:relative;width:22px}.ajax__slider_v_handle{height:10px;position:absolute;width:22px}.ajax__slider_v_handle img{display:block} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.css new file mode 100644 index 000000000..8151906c9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.css @@ -0,0 +1,339 @@ +/* default layout */ +.ajax__tab_default .ajax__tab_header { + white-space: normal !important; +} + +.ajax__tab_default .ajax__tab_outer { + display: inline-block; + display: -moz-inline-box; +} + +.ajax__tab_default .ajax__tab_inner { + display: inline-block; + display: -moz-inline-box; +} + +.ajax__tab_default .ajax__tab_tab { + display: inline-block; + display: -moz-inline-box; + overflow: hidden; + text-align: center; +} + +.ajax__tab_xp .ajax__tab_disabled { + color: #A0A0A0; + cursor: default; +} + +/* xp theme top / default */ +.ajax__tab_xp .ajax__tab_header { + background-position: bottom; + background-repeat: repeat-x; + font-family: verdana,tahoma,helvetica; + font-size: 11px; + height: 21px; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + height: 21px; + padding-right: 4px; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_inner { + background-repeat: no-repeat; + padding-left: 3px; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_tab { + background-repeat: repeat-x; + margin: 0; + padding: 4px; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner { + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab { + background-repeat: repeat-x; + cursor: pointer; +} +/*.ajax__tab_xp .ajax__tab_header .ajax__tab_active { margin-top: 1px; } */ +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner { + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab { + background-repeat: repeat-x; +} + +.ajax__tab_xp .ajax__tab_body { + background-color: #ffffff; + border: 1px solid #999999; + border-top: 0; + font-family: verdana,tahoma,helvetica; + font-size: 10pt; + padding: 8px; +} + +/* xp theme vertical left */ +.ajax__tab_xp .ajax__tab_header_verticalleft { + background-position: right; + background-repeat: repeat-y; + font-family: verdana,tahoma,helvetica; + font-size: 11px; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + height: 21px; + padding-right: 4px; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner { + background-repeat: no-repeat; + padding-left: 3px; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab { + background-repeat: repeat-x; + margin: 0; + padding: 4px; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner { + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab { + background-repeat: repeat-x; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active:not(:first-child) { + margin-top: 1px; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner { + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab { + background-repeat: repeat-x; +} + +.ajax__tab_xp .ajax__tab_body_verticalleft { + background-color: #ffffff; + border: 1px solid #999999; + border-left: 0; + font-family: verdana,tahoma,helvetica; + font-size: 10pt; + padding: 8px; +} + +/* xp theme vertical right */ +.ajax__tab_xp .ajax__tab_header_verticalright { + background-position: left; + background-repeat: repeat-y; + font-family: verdana,tahoma,helvetica; + font-size: 11px; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + height: 21px; + padding-right: 4px; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner { + background-repeat: no-repeat; + padding-left: 3px; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab { + background-repeat: repeat-x; + margin: 0; + padding: 4px; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner { + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab { + background-repeat: repeat-x; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active { + margin-top: 1px; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner { + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab { + background-repeat: repeat-x; +} + +.ajax__tab_xp .ajax__tab_body_verticalright { + background-color: #ffffff; + border: 1px solid #999999; + border-right: 0; + font-family: verdana,tahoma,helvetica; + font-size: 10pt; + padding: 8px; +} + +/* header on bottom */ +.ajax__tab_xp .ajax__tab_header_bottom { + background-position: top; + background-repeat: repeat-x; + font-family: verdana,tahoma,helvetica; + font-size: 11px; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + height: 21px; + padding-right: 4px; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner { + background-repeat: no-repeat; + padding-left: 3px; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab { + background-repeat: repeat-x; + height: 17px; + margin: 0; + padding: 0 4px 4px 4px; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner { + background-repeat: no-repeat; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab { + background-repeat: repeat-x; + cursor: pointer; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer { + background-position: right; + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner { + background-repeat: no-repeat; +} + +.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab { + background-repeat: repeat-x; +} + +.ajax__tab_xp .ajax__tab_body_bottom { + background-color: #ffffff; + border: 1px solid #999999; + border-bottom: 0; + font-family: verdana,tahoma,helvetica; + font-size: 10pt; + padding: 8px; +} + +/* scrolling */ +.ajax__scroll_horiz { + overflow-x: scroll; +} + +.ajax__scroll_vert { + overflow-y: scroll; +} + +.ajax__scroll_both { + overflow: scroll; +} + +.ajax__scroll_auto { + overflow: auto; +} + +.ajax__scroll_none { + overflow: hidden; +} + +/* plain theme */ +.ajax__tab_plain .ajax__tab_outer { + border: 2px solid #999999; + text-align: center; + vertical-align: middle; +} + +.ajax__tab_plain .ajax__tab_inner { + text-align: center; + vertical-align: middle; +} + +.ajax__tab_plain .ajax__tab_body { + text-align: center; + vertical-align: middle; +} + +.ajax__tab_plain .ajax__tab_header { + text-align: center; + vertical-align: middle; +} + +.ajax__tab_plain .ajax__tab_active .ajax__tab_outer { + background: #FFFFE1; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.min.css new file mode 100644 index 000000000..f6666f315 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Tabs.min.css @@ -0,0 +1 @@ +.ajax__tab_default .ajax__tab_header{white-space:normal !important}.ajax__tab_default .ajax__tab_outer{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_inner{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_tab{display:inline-block;display:-moz-inline-box;overflow:hidden;text-align:center}.ajax__tab_xp .ajax__tab_disabled{color:#a0a0a0;cursor:default}.ajax__tab_xp .ajax__tab_header{background-position:bottom;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px;height:21px}.ajax__tab_xp .ajax__tab_header .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body{background-color:#fff;border:1px solid #999;border-top:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalleft{background-position:right;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active:not(:first-child){margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalleft{background-color:#fff;border:1px solid #999;border-left:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalright{background-position:left;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active{margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalright{background-color:#fff;border:1px solid #999;border-right:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_bottom{background-position:top;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab{background-repeat:repeat-x;height:17px;margin:0;padding:0 4px 4px 4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_bottom{background-color:#fff;border:1px solid #999;border-bottom:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__scroll_horiz{overflow-x:scroll}.ajax__scroll_vert{overflow-y:scroll}.ajax__scroll_both{overflow:scroll}.ajax__scroll_auto{overflow:auto}.ajax__scroll_none{overflow:hidden}.ajax__tab_plain .ajax__tab_outer{border:2px solid #999;text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_inner{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_body{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_header{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_active .ajax__tab_outer{background:#ffffe1} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.css new file mode 100644 index 000000000..d561e2d23 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.css @@ -0,0 +1,91 @@ +.ajax__twitter { + background-color: Gray; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + color: White; + font-family: "lucida grande", lucida, tahoma, helvetica, arial, sans-serif; + font-size: 12px; + + width: 300px; +} + +.ajax__twitter_itemlist { + list-style-position: inside; + list-style-type: none; + margin: 0; + padding: 0; + text-indent: 0; + width: 100%; +} + +.ajax__twitter_itemlist li { + background-color: Black; + border-bottom: 1px dotted white; + clear: both; + margin: 0; + padding: 10px; +} + +.ajax__twitter_itemlist li div { + display: block; + margin-left: 35px; +} + +.ajax__twitter_itemlist li div a { + color: #4AED05; + text-decoration: none !important; +} + +.ajax__twitter_itemlist li div a:hover { + text-decoration: underline !important; +} + +.ajax__twitter_itemlist li img { + float: left; + height: 30px; + margin-right: 5px; + width: 30px; +} + +.ajax__twitter_header { + min-height: 34px; + padding: 10px; + position: relative; +} + +.ajax__twitter_header img { + float: left; + height: 34px; + margin-right: 5px; + width: 34px; +} + +.ajax__twitter_header h4 { + font-size: 18px; + font-weight: normal; + margin: 0; + padding: 0; +} + +.ajax__twitter_header h3 { + font-size: 11px; + font-weight: normal; + margin: 0; + padding: 0; +} + +.ajax__twitter_createat { + color: #4AED05; + font-size: 10px; +} + +.ajax__twitter_footer { + height: 36px; +} + +.ajax__twitter_footer img { + float: right; + margin-right: 10px; + margin-top: 6px; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.min.css new file mode 100644 index 000000000..1328bb846 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/Twitter.min.css @@ -0,0 +1 @@ +.ajax__twitter{background-color:gray;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;color:#fff;font-family:"lucida grande",lucida,tahoma,helvetica,arial,sans-serif;font-size:12px;width:300px}.ajax__twitter_itemlist{list-style-position:inside;list-style-type:none;margin:0;padding:0;text-indent:0;width:100%}.ajax__twitter_itemlist li{background-color:#000;border-bottom:1px dotted #fff;clear:both;margin:0;padding:10px}.ajax__twitter_itemlist li div{display:block;margin-left:35px}.ajax__twitter_itemlist li div a{color:#4aed05;text-decoration:none !important}.ajax__twitter_itemlist li div a:hover{text-decoration:underline !important}.ajax__twitter_itemlist li img{float:left;height:30px;margin-right:5px;width:30px}.ajax__twitter_header{min-height:34px;padding:10px;position:relative}.ajax__twitter_header img{float:left;height:34px;margin-right:5px;width:34px}.ajax__twitter_header h4{font-size:18px;font-weight:normal;margin:0;padding:0}.ajax__twitter_header h3{font-size:11px;font-weight:normal;margin:0;padding:0}.ajax__twitter_createat{color:#4aed05;font-size:10px}.ajax__twitter_footer{height:36px}.ajax__twitter_footer img{float:right;margin-right:10px;margin-top:6px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.css new file mode 100644 index 000000000..f74b7f451 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.css @@ -0,0 +1,230 @@ +.ajax__validatorcallout div, .ajax__validatorcallout td { + background-color: LemonChiffon; + border: solid 1px Black; +} + +.ajax__validatorcallout_popup_table { + background-color: transparent; + border: none 0; + margin: 0; + padding: 0; + border-spacing: 0; +} + +.ajax__validatorcallout_popup_table_row { + background-color: transparent; + height: 100%; + margin: 0; + padding: 0; + vertical-align: top; +} + +.ajax__validatorcallout_callout_cell { + background-color: transparent !important; + border: none !important; + height: 100%; + margin: 0; + padding: 0; + text-align: right; + vertical-align: top; + width: 20px; +} + +.ajax__validatorcallout_callout_table { + background-color: transparent; + border: none 0; + height: 100%; + margin: 0; + padding: 0; + border-spacing: 0; +} + +.ajax__validatorcallout_callout_table_row { + background-color: transparent; + margin: 0; + padding: 0; +} + +.ajax__validatorcallout_callout_arrow_cell { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0; + padding: 8px 0 0 0; + text-align: right; + vertical-align: top; +} + +.ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border-bottom: none !important; + border-left: none !important; + border-right: none !important; + font-size: 1px; + left: 1px; + margin: 0; + padding: 0; + position: relative; + width: 15px; +} + +.ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv div { + border-bottom: none !important; + border-right: none !important; + border-top: none !important; + height: 1px; + margin: 0 0 0 auto; + overflow: hidden; + padding: 0; +} + +.ajax__validatorcallout_callout_arrow_cell_leftpos { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0; + padding: 8px 0 0 0; + text-align: left; + vertical-align: top; +} + +.ajax__validatorcallout_callout_arrow_cell_leftpos .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border-bottom: none !important; + border-left: none !important; + border-right: none !important; + font-size: 1px; + left: -1px; + margin: 0; + padding: 0; + position: relative; + width: 15px; +} + +.ajax__validatorcallout_callout_arrow_cell_leftpos .ajax__validatorcallout_innerdiv div { + border-bottom: none !important; + border-left: none !important; + border-top: none !important; + height: 1px; + margin: 0 auto 0 0; + overflow: hidden; + padding: 0; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomleftpos, .ajax__validatorcallout_callout_arrow_cell_topleftpos { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0; + padding: 0 0 0 8px; + text-align: left; + vertical-align: top; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomrightpos, .ajax__validatorcallout_callout_arrow_cell_toprightpos { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0; + padding: 0 8px 0 0; + text-align: right; + vertical-align: top; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border: none !important; + bottom: -1px; + font-size: 1px; + margin: 0; + padding: 0; + position: relative; + width: 30px; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border: none !important; + bottom: -1px; + font-size: 1px; + margin: 0 0 0 auto; + padding: 0; + position: relative; + width: 30px; +} + +.ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0; + padding: 0; + position: relative; + top: -1px; + width: 30px; +} + +.ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv { + background-color: transparent !important; + border: none !important; + font-size: 1px; + margin: 0 0 0 auto; + padding: 0; + position: relative; + top: -1px; + width: 30px; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv div, .ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv div, .ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv div, .ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv div { + border-bottom: none !important; + border-top: none !important; + height: 1px; + margin: 0 auto 0 auto; + overflow: hidden; + padding: 0; +} + +.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv .arrowpixel, .ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv .arrowpixel, .ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv .arrowpixel, .ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv .arrowpixel { + background-color: transparent !important; + border-bottom-style: solid !important; + border-bottom-width: 1px !important; + border-left: none !important; + border-right: none !important; + border-top: none !important; + height: 0; + margin: 0 auto 0 auto; + overflow: hidden; + padding: 0; +} + +.ajax__validatorcallout_error_message_cell { + border-left: none !important; + border-right: none !important; + font-family: Verdana; + font-size: 10px; + padding: 5px; + width: 100%; +} + +.ajax__validatorcallout_icon_cell { + border-right: none !important; + margin: 0; + padding: 5px; + width: 20px; +} + +.ajax__validatorcallout_close_button_cell { + border-left: none !important; + margin: 0; + padding: 0; + text-align: right; + vertical-align: top; +} + +.ajax__validatorcallout_close_button_cell .ajax__validatorcallout_innerdiv { + border: none !important; + cursor: pointer; + padding: 2px; + text-align: center; + width: 10px; +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.min.css b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.min.css new file mode 100644 index 000000000..e40b507dd --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Content/AjaxControlToolkit/Styles/ValidatorCallout.min.css @@ -0,0 +1 @@ +.ajax__validatorcallout div,.ajax__validatorcallout td{background-color:#fffacd;border:solid 1px #000}.ajax__validatorcallout_popup_table{background-color:transparent;border:none 0;margin:0;padding:0;border-spacing:0}.ajax__validatorcallout_popup_table_row{background-color:transparent;height:100%;margin:0;padding:0;vertical-align:top}.ajax__validatorcallout_callout_cell{background-color:transparent !important;border:none !important;height:100%;margin:0;padding:0;text-align:right;vertical-align:top;width:20px}.ajax__validatorcallout_callout_table{background-color:transparent;border:none 0;height:100%;margin:0;padding:0;border-spacing:0}.ajax__validatorcallout_callout_table_row{background-color:transparent;margin:0;padding:0}.ajax__validatorcallout_callout_arrow_cell{background-color:transparent !important;border:none !important;font-size:1px;margin:0;padding:8px 0 0 0;text-align:right;vertical-align:top}.ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv{background-color:transparent !important;border-bottom:none !important;border-left:none !important;border-right:none !important;font-size:1px;left:1px;margin:0;padding:0;position:relative;width:15px}.ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv div{border-bottom:none !important;border-right:none !important;border-top:none !important;height:1px;margin:0 0 0 auto;overflow:hidden;padding:0}.ajax__validatorcallout_callout_arrow_cell_leftpos{background-color:transparent !important;border:none !important;font-size:1px;margin:0;padding:8px 0 0 0;text-align:left;vertical-align:top}.ajax__validatorcallout_callout_arrow_cell_leftpos .ajax__validatorcallout_innerdiv{background-color:transparent !important;border-bottom:none !important;border-left:none !important;border-right:none !important;font-size:1px;left:-1px;margin:0;padding:0;position:relative;width:15px}.ajax__validatorcallout_callout_arrow_cell_leftpos .ajax__validatorcallout_innerdiv div{border-bottom:none !important;border-left:none !important;border-top:none !important;height:1px;margin:0 auto 0 0;overflow:hidden;padding:0}.ajax__validatorcallout_callout_arrow_cell_bottomleftpos,.ajax__validatorcallout_callout_arrow_cell_topleftpos{background-color:transparent !important;border:none !important;font-size:1px;margin:0;padding:0 0 0 8px;text-align:left;vertical-align:top}.ajax__validatorcallout_callout_arrow_cell_bottomrightpos,.ajax__validatorcallout_callout_arrow_cell_toprightpos{background-color:transparent !important;border:none !important;font-size:1px;margin:0;padding:0 8px 0 0;text-align:right;vertical-align:top}.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv{background-color:transparent !important;border:none !important;bottom:-1px;font-size:1px;margin:0;padding:0;position:relative;width:30px}.ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv{background-color:transparent !important;border:none !important;bottom:-1px;font-size:1px;margin:0 0 0 auto;padding:0;position:relative;width:30px}.ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv{background-color:transparent !important;border:none !important;font-size:1px;margin:0;padding:0;position:relative;top:-1px;width:30px}.ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv{background-color:transparent !important;border:none !important;font-size:1px;margin:0 0 0 auto;padding:0;position:relative;top:-1px;width:30px}.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv div,.ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv div,.ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv div,.ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv div{border-bottom:none !important;border-top:none !important;height:1px;margin:0 auto 0 auto;overflow:hidden;padding:0}.ajax__validatorcallout_callout_arrow_cell_bottomleftpos .ajax__validatorcallout_innerdiv .arrowpixel,.ajax__validatorcallout_callout_arrow_cell_bottomrightpos .ajax__validatorcallout_innerdiv .arrowpixel,.ajax__validatorcallout_callout_arrow_cell_topleftpos .ajax__validatorcallout_innerdiv .arrowpixel,.ajax__validatorcallout_callout_arrow_cell_toprightpos .ajax__validatorcallout_innerdiv .arrowpixel{background-color:transparent !important;border-bottom-style:solid !important;border-bottom-width:1px !important;border-left:none !important;border-right:none !important;border-top:none !important;height:0;margin:0 auto 0 auto;overflow:hidden;padding:0}.ajax__validatorcallout_error_message_cell{border-left:none !important;border-right:none !important;font-family:Verdana;font-size:10px;padding:5px;width:100%}.ajax__validatorcallout_icon_cell{border-right:none !important;margin:0;padding:5px;width:20px}.ajax__validatorcallout_close_button_cell{border-left:none !important;margin:0;padding:0;text-align:right;vertical-align:top}.ajax__validatorcallout_close_button_cell .ajax__validatorcallout_innerdiv{border:none !important;cursor:pointer;padding:2px;text-align:center;width:10px} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js new file mode 100644 index 000000000..374a56b0d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js @@ -0,0 +1,1356 @@ +// Some of the techniques used in this.script were adapted with permission from Bertrand +// LeRoy's MIX06 Demo (http://weblogs.asp.net/bleroy/archive/2006/03/28/441343.aspx) +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.AutoSize = function() { + // The AutoSize enumeration is used to specify how the AccordionBehavior limits + // the growth of the accordion when panes are expanded and collapsed. It must + // correspond to the AutoSize CLR enumeration in AutoSize.cs. + // + // "None" - allows the accordion to expand/collapse without restriction. + // "Fill" - keeps the accordion the same size as its specified size. If any + // panes are larger or smaller than the available space, grow or shrink + // them to the available space. + // "Limit" - prevents the accordion from growing any larger than its specified size. + // If the content of a pane is too large to fit, grow it to fill the + // remaining space. + throw Error.invalidOperation(); +} +Sys.Extended.UI.AutoSize.prototype = { + None: 0, + Fill: 1, + Limit: 2 +} +Sys.Extended.UI.AutoSize.registerEnum("Sys.Extended.UI.AutoSize", false); + +Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs = function(oldIndex, selectedIndex) { + // Event arguments used to provide notification when an accordion's selected + // index is changed. The same event argument type is used for both the + // selectedIndexChanging event and the selectedIndexChanged events. If you set + // the cancel property to true during the selectedIndexChanging event, the + // accordion will not change panes. The cancel property has no effect during + // the selectedIndexChanged event. + // + // "oldIndex" - Last selected index + // "selectedIndex" - new selected index + Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.initializeBase(this); + + this._oldIndex = oldIndex; + this._selectedIndex = selectedIndex; +} +Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.prototype = { + get_oldIndex: function() { + return this._oldIndex; + }, + set_oldIndex: function(value) { + this._oldIndex = value; + }, + + get_selectedIndex: function() { + return this._selectedIndex; + }, + set_selectedIndex: function(value) { + this._selectedIndex = value; + } +} +Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.registerClass('Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs', Sys.CancelEventArgs); + + +// The Accordion layout is slightly complex because we support several AutoSize modes +// that are applied to an element collection across multiple events and animations. +// To make the code a little easier to understand, we'll provide a brief description +// of the element format, the control flow for laying out the elements, and an informal +// "correctness proof" of our algorithm. +// +// The Accordion server control will create a collection of panes which it will dump +// out as a sequence of
    s where the (2i)th
    is the ith header and the +// (2i+1)th
    is the ith content section: +// +//
    +// ... +//
    Ith Header
    +//
    Ith Content
    +// ... +//
    +// +// Because the
    s may have padding, borders, or margins (we'll refer to these +// additional pixels as the "gutter"), we cannot collapse them all the way during +// animation (i.e. myDiv.style.height = '0px' will still show myDiv's padding, +// borders, and margins). To work around this, we wrap all of the content section +//
    s in wrappers that have no "gutter" style to end up with a tree of DOM +// elements that looks like: +// +//
    +// ... +//
    Ith Header
    +//
    +//
    Ith Content
    +//
    +// ... +//
    +// +// We automatically wrap the content section when it is passed to the addPane +// function. From here on out, we'll refer to the behavior's target element (the +// root
    ) as the accordion, the dynamically created
    as a wrapper, and +// the content section
    as the original
    . +// +// The primary purpose of the accordion is to expand and collapse its panes so that +// at most only one pane is open at a time. We want to do this using animations for +// a polished effect, but we must also respect the AutoSize modes (where None allows +// the accordion to grow unrestrained, Limit provides a maximum height for the +// accordion, and Fill forces the accordion to always be the specified size). Given +// the structure of an accordion, original
    s, and wrapper
    s, we accomplish +// the layout requirements using the following CSS properties: +// Accordion root
    : +// height +// overflow +// Wrapper
    : +// height +// opacity +// overflow +// display +// Original content section
    : +// height +// maxHeight +// overflow +// +// The large table below precisely defines the expected value of the properties at +// any given point in time. Each of the columns 1 through 8 represents a possible +// state of the accordion. Most of the time the accordion will be in states 1 and 5 +// until the user clicks a header section and triggers a series of changes. The rows +// of the table represent the properties of elements in a particular AutoSize mode. +// For example, a closed wrapper
    with the Limit AutoSize mode should have a value +// of '0px' for its height. Most of the properties in the the table are literal values +// like 'auto', 'hidden', '0px', etc. The value Current for a property is used to +// indicate that a height set to 'auto' should be assigned its explicit value (i.e. +// element.offsetHeight) so that it will not be able to grow/shrink during an animation. +// The value Remaining for a height property refers specifically to the available space +// remaining after all the header sections of the accordion have been taken into +// consideration (this is used specifically for setting the size of the open content +// section when working in Limit or Fill AutoSize modes). It's important to note that +// the Remaining value, retrieved by calling _getRemainingHeight, is slightly different +// for a wrapper
    compared to a an original
    because it must also consider the +// "gutter" offsets for an original
    . Finally, the animations (columns 3 and 7) +// are represented as transformations that take one property value to another when played. +// +// ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +// | +--- Closing an open pane | Opening a closed pane <--+ | +// AutoSize Mode | | 1. 2. 3. 4. | 5. 6. 7. 8. | | +// Element | +--> Opened -> Before Closing -> Closing -> After Closing --+-> Closed -> Before Opening -> Opening -> After Opening ---+ | +// Property | Pane Animation Animation Animation | Pane Animation Animation Animation | +// ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +// None: | | | +// Accordion: | | | +// height: | 'auto' . . . | 'auto' . . . | +// overflow: | 'auto' . . 'auto' | 'auto' . . 'auto' | +// Wrapper: | | | +// height: | 'auto' . Current -> '0px' . | '0px' . '0px' -> Current 'auto' | +// opacity: | 1.0 . 1.0 -> 0.0 . | 0.0 . 0.0 -> 1.0 . | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// display: | 'block' . . 'none' | 'none' 'block' . . | +// Original: | | | +// height: | 'auto' . . . | 'auto' . . . | +// maxHeight: | '' . . . | '' . . . | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +// Limit: | | | +// Accordion: | | | +// height: | Current . . . | Current . . . | +// overflow: | 'hidden' . . . | 'hidden' . . . | +// Wrapper: | | | +// height: | 'auto' Remaining Remaining -> '0px' . | '0px' . '0px' -> Remaining 'auto' | +// opacity: | 1.0 . 1.0 -> 0.0 . | 0.0 . 0.0 -> 1.0 . | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// display: | 'block' . . 'none' | 'none' 'block' . . | +// Original: | | | +// height: | 'auto' . . . | 'auto' . . . | +// maxHeight: | Remaining 'auto' . . | 'auto' . . Remaining | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +// Fill: | | | +// Accordion: | | | +// height: | Current . . . | Current . . . | +// overflow: | 'hidden' . . . | 'hidden' . . . | +// Wrapper: | | | +// height: | 'auto' . . . | 'auto' . . . | +// opacity: | 1.0 . 1.0 -> 0.0 . | 0.0 . 0.0 -> 1.0 . | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// display: | 'block' . . 'none' | 'none' 'block' . . | +// Original: | | | +// height: | Remaining . Remaining -> '0px' . | '0px' . '0px' -> Remaining . | +// maxHeight: | '' . . . | '' . . . | +// overflow: | 'auto' 'hidden' . . | 'hidden' . . 'auto' | +// ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +// +// Although this table is rather large, it's extremely useful because it allows +// us to present an informal argument for the correctness of our layout algorithm. +// It's easy to verify that if an accordion starts in state 1 and proceeds through +// steps 2, 3, and 4 when closing, it will arrive properly in state 5. Similarly +// an accordion starting in state 5 that is opened will progress through steps 6, 7, +// and 8 to arrive back at step 1. Clearly then any accordion starting in a valid +// state of 1 or 5 can be opened or closed repeatedly and return to a proper state. +// It's also worth pointing out that this layout algorithm can operate on one or two +// panes at a time (i.e. if all panes were closed and one were clicked, it would +// open a single pane... but if one pane were already open and another were clicked, +// it would have to close one while opening the other). +// +// States 1 and 5 from the above table are implemented in the _intiailizeLayout and +// _initializePane functions. States 2 and 6 are handled by the _startPaneChange +// function while states 4 and 8 are handled by the _endPaneChange function. Finally, +// states 3 and 7 are intialized and played in the _changePanes function. + +Sys.Extended.UI.AccordionBehavior = function(element) { + // The AccordionBehavior is used to turn properly structured XHTML into an + // Accordion with panes that can expand one at a time. + // + // "element" - the DOM element the behavior is associated with. It should contain an + // even number of child divs (such that ith pane has a header at div 2i and + // has content at div 2i+1). + Sys.Extended.UI.AccordionBehavior.initializeBase(this, [element]); + + /// + /// The _selectedIndex variable is used to track the currently visible content + /// pane. It is persisted via ClientState so that it can be restored on PostBack. + /// If 0 <= _selectedIndex < _panes.Length is not true, then no pane is selected + /// (and they all appear collapsed). While any index outside the bounds of the + /// _panes array indicates that no pane is selected, we don't automatically set + /// the value to a sentinel like -1 (especially on the server) because it's + /// possible for additional panes to be added at any time. We abstract this + /// problem using the getPane() function which returns the selected pane when + /// it's called with no arguments (and returns null when the current selected + /// index is invalid). + /// + ///get_selectedIndex + ///set_selectedIndex + /// + this._selectedIndex = 0; + + /// + /// Panes count. + /// + ///getCount + /// + + // The _panes array represents the collection of Accordion panes. Each element of + // the array is an object of the form {header, content, animation} corresponding + // to that pane's header section, content section, and the animation used to open + // and close its content section. The content element is a new div that has been + // created to wrap the original div (so we can completely collapse it - even if it + // has padding, margins, etc.) which is pointed to by a dynamic _original property. + // The header element has a dynamic _index property indicating its position in the + // Accordion's pane collection (used primarily by the headers' shared click handler). + // Furthermore, the animation will either be an instance of LengthAnimation or + // ParallelAnimation (in the latter case, it will have two children which are a + // LengthAnimation and a FadeAnimation). There will be two dynamic properties + // _length and _fade pointing to each of these children (to easily set the length + // and fadeEffect properties). There is also a dynamic _ended property which is + // an event handler to be fired when the animation is complete, a dynamic _opening + // property to indicate whether the animation was opening or closing the pane, and + // a dynamic _pane property to provide a reference to the pane that was being + // animated. + this._panes = []; + + /// + /// Whether or not to fade the accordion panes when transitioning + /// + ///get_fadeTransitions + ///set_fadeTransitions + /// + this._fadeTransitions = false; + + /// + /// Length of time to transition between Accordion sections in + /// milleseconds. The default value is 250ms. + /// + ///get_transitionDuration + ///set_transitionDuration + /// + this._duration = 0.25; + + /// + /// A number of steps per second in transition animations. + /// The default value is 30 frames per second. + /// + ///get_framesPerSecond + ///set_framesPerSecond + /// + this._framesPerSecond = 30; + + /// + /// Determines how to control resizing of the Accordion. + /// If it is set to None, then the Accordion can grow as large or as small as necessary. + /// If it is set to Limit, then the Accordion will always be less than or equal to its available space. + /// If it is set to Fill, then it will always be equal to its available space. + /// + ///get_autoSize + /// + this._autoSize = Sys.Extended.UI.AutoSize.None; + + /// + /// Whether or not clicking the header will close the currently opened pane (which + /// leaves all the Accordion's panes closed). + /// + ///get_requireOpenedPane + ///set_requireOpenedPane + /// + this._requireOpenedPane = true; + + /// + /// Whether or not we suppress the client-side click handlers of any elements + /// (including server controls like Button or HTML elements like anchor) in the header + /// sections of the Accordion. + /// + ///get_suppressHeaderPostbacks + ///set_suppressHeaderPostbacks + /// + this._suppressHeaderPostbacks = false; + + // Size of all the headers + this._headersSize = 0; + + // The _headerClickHandler is a reference to the event handler that all the header + // elements of our panes will be wired up to + this._headerClickHandler = null; + + /// + /// The _headerSelectedCssClass is the css class applied to the selected header. + /// + ///get_headerCssClass + ///set_headerCssClass + /// + this._headerCssClass = ''; + + /// + /// The _headerSelectedCssClass is the css class applied to the selected header. + /// + ///get_headerSelectedCssClass + ///get_headerSelectedCssClass + /// + this._headerSelectedCssClass = ''; + + // The _resizeHandler is a reference to the global event handler used to patch + // up the accordion when the window is resized + this._resizeHandler = null; + + // Check the browser version and document mode to see if IE8 in standards-compliant mode is used + this._isIE8InStandardMode = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version > 7 && Sys.Browser.documentMode != 0); +} +Sys.Extended.UI.AccordionBehavior.prototype = { + // The initialize function is responsible for getting the selected index from + // the ClientState mechanism and walking the children of the behavior's target + // to find all of the accordion's child panes. It builds up a collection of the + // panes from the headers and content sections. Then we hide all the content + // sections that aren't selected and initialize the layout. + initialize: function() { + // The initialize function is responsible for getting the selected index from + // the ClientState mechanism and walking the children of the behavior's target + // to find all of the accordion's child panes. It builds up a collection of the + // panes from the headers and content sections. Then we hide all the content + // sections that aren't selected and initialize the layout. + Sys.Extended.UI.AccordionBehavior.callBaseMethod(this, 'initialize'); + + // Create the onclick handler used by the accordion's headers + this._headerClickHandler = Function.createDelegate(this, this._onHeaderClick); + + // Get the selected index from ClientState + var state = this.get_ClientState(); + if(state !== null && state !== '') { + this._changeSelectedIndex(parseInt(state), false, true); + } + + // Walk the children of the target control to obtain the accordion's child panes. + // We are expecting a hierarchy of divs that looks like: + //
    this.element + // ... + //
    this.element.childNodes[2i] + //
    this.element.childNodes[2i+1] + // ... + //
    + // We'll turn this hierarchy of divs into objects filling the _panes collection. + // See the comment above the _panes array for more details on the structure of + // these objects. It's also worth pointing out that we effectively "box" the + // index so it can be passed by reference to the _getNextDiv function + var nodes = this.get_element().childNodes; + var index = {}; + for(index.value = 0; index.value < nodes.length; index.value++) { + var header = this._getNextDiv(nodes, index); + if(!header) { + break; + } + var content = this._getNextDiv(nodes, index); + if(content) { + // Add the pane once we've found both a header and a content section + // (but bump the loop index back so we don't skip an element when the + // loop increments) + this.addPane(header, content); + index.value--; + } + } + + // Ensure we have an opened pane if we're required to (and use the first + // pane if we don't have a valid selected index) + if(this._requireOpenedPane && !this.getPane() && this._panes.length > 0) { + this._changeSelectedIndex(0, false, true); + } + + // Setup the layout for the given AutoSize mode + this._initializeLayout(); + }, + + _getNextDiv: function(nodes, index) { + // Get the next div in a sequence of child nodes starting at the + // given index + // + // "nodes" - array of child nodes (i.e. element.childNodes) + // "index" - The index is an object of the form { value } where index.value represents + // the current index in the collection of nodes. We wrap the index in an object + // to perform the .NET equivalent of boxing so it can be passed by reference. + var div = null; + while(index.value < nodes.length && (div = nodes[index.value++])) { + if(div.tagName && (div.tagName.toLowerCase() === 'div')) { + break; + } + } + return div; + }, + + /// + /// Create a new Accordion pane given references to its header and content divs + /// and add it to the _panes collection. We also wrap the content div in a new + /// container div, add a click handler to the header div, etc. + /// + /// header element of the new Accordion pane + /// content element of the new Accordion pane + /// + addPane: function(header, content) { + // New pane object added to the end of the Accordion's pane collection. The pane + // is an object of the form {header, content, animation} corresponding to that + // pane's header section, content section, and the animation used to open and + // close its content section. The content element is a new div that has been + // created to wrap the original div (so we can completely collapse it - even if it + // has padding, margins, etc.) which is pointed to by a dynamic _original property. + // The header element has a dynamic _index property indicating its position in the + // Accordion's pane collection (used primarily by the headers' shared click handler). + // Furthermore, the animation will either be an instance of LengthAnimation or + // ParallelAnimation (in the latter case, it will have two children which are a + // LengthAnimation and a FadeAnimation). There will be two dynamic properties + // _length and _fade pointing to each of these children (to easily set the length + // and fadeEffect properties). There is also a dynamic _ended property which is + // an event handler to be fired when the animation is complete, a dynamic _opening + // property to indicate whether the animation was opening or closing the pane, and + // a dynamic _pane property to provide a reference to the pane that was being + // animated. + + // Create the new pane object + var pane = {}; + pane.animation = null; + + // Initialize the header + pane.header = header; + header._index = this._panes.length; + $addHandler(header, "click", this._headerClickHandler); + + // Wrap the content in a new element + var accordion = this.get_element(); + var wrapper = document.createElement('div'); + accordion.insertBefore(wrapper, content); + wrapper.appendChild(content); + wrapper._original = content; + pane.content = wrapper; + + // Remove any style facets (possibly) automatically applied by + // CSS selectors so they don't interfere with UI/layout + wrapper.style.border = ''; + wrapper.style.margin = ''; + wrapper.style.padding = ''; + + // Add the new pane at the bottom of the accordion + Array.add(this._panes, pane); + + // Setup the layout attributes for the pane so that it will be in a proper opened or + // closed state (we don't bother setting the opacity of the wrapper with + // $common.setElementOpacity(wrapper, selected ? 1 : 0); because it will + // be taken care of by the animation) + this._initializePane(header._index); + + // Since the content section of the accordion panes will be sent down from the server + // with display: none (so the content sections aren't shown before they're wrapped in + // new divs) we'll turn them back on once they've been wrapped in hidden divs + content.style.display = 'block'; + + return pane; + }, + + _getAnimation: function(pane) { + // Get the animation for the specified accordion section or demand create + // the animation if it doesn't already exist. + // + // "pane"- the pane is an object of the form {header, content, animation} corresponding to + // that pane's header section, content section, and the animation used to open and + // close its content section. The content element is a new div that has been created + // to wrap the original div (so we can completely collapse it - even if it has + // padding, margins, etc.) which is pointed to by a dynamic _original property. The + // header element has a dynamic _index property indicating its position in the + // Accordion's pane collection (used primarily by the headers' shared click + // handler). Furthermore, the animation will either be an instance of + // LengthAnimation or ParallelAnimation (in the latter case, it will have two + // children which are a LengthAnimation and a FadeAnimation). There will be two + // dynamic properties _length and _fade pointing to each of these children (to + // easily set the length and fadeEffect properties). There is also a dynamic _ended + // property which is an event handler to be fired when the animation is complete, + // a dynamic _opening property to indicate whether the animation was opening or + // closing the pane, and a dynamic _pane property to provide a reference to the pane + // that was being animated. + + var animation = pane.animation; + if(!animation) { + // Determine whether or not to just use the length animation or build a + // composite effect with fading transitions (note that only the parent + // animation has the duration/fps specfied) + var length = null; + var fade = null; + if(!this._fadeTransitions) { + animation = length = new Sys.Extended.UI.Animation.LengthAnimation(pane.content, this._duration, this._framesPerSecond, "style", "height", 0, 0, "px"); + } else { + length = new Sys.Extended.UI.Animation.LengthAnimation(null, null, null, "style", "height", 0, 0, "px"); + fade = new Sys.Extended.UI.Animation.FadeAnimation(null, null, null, Sys.Extended.UI.Animation.FadeEffect.FadeOut, 0, 1, false); + animation = new Sys.Extended.UI.Animation.ParallelAnimation(pane.content, this._duration, this._framesPerSecond, [fade, length]); + } + + // Create references to the length and fade animations so we can easily + // set the length and fadeEffect properties when animating without having + // to reach into the composite animation. + pane.animation = animation; + animation._length = length; + animation._fade = fade; + animation._pane = pane; + animation._opening = true; + animation._behavior = this; + animation._ended = Function.createDelegate(pane.animation, this._onAnimationFinished); + animation.add_ended(pane.animation._ended); + + animation.initialize(); + } + return animation; + }, + + _onAnimationFinished: function() { + // _onAnimationFinished is an event handler played after an animation (to open/ + // close an accordion pane) has completed. The delegate for this function should + // have associated it with an animation (so the this references below are expecting + // to reach expando fields declared on the animation). It invokes _endPaneChange + // for the current pane. + this._behavior._endPaneChange(this._pane, this._opening); + }, + + _initializeLayout: function() { + // Setup the layout of the accordion (either when the behavior is created or when the + // AutoSize mode is changed). + + // Stop any animations that are still playing (i.e. that haven't finished opening + // or closing from changing previous panes) in case the user changed the AutoSize + // mode while an animation was playing. + for(var i = 0; i < this._panes.length; i++) { + var animation = this._panes[i].animation; + if(animation && animation.get_isPlaying()) { + animation.stop(); + } + } + + // Cache the initial size of the accordion + var accordion = this.get_element(); + this._initialHeight = accordion.offsetHeight; + var style = accordion.style; + + + // Initialize the accordion itself + if(this._autoSize === Sys.Extended.UI.AutoSize.None) { + // Remove the window resizing handler + this._disposeResizeHandler(); + + // IE7 appears to have a rendering quirk where it will hide the + // accordion if we change height or overflow from the empty string + // to auto when it's contained in a fixed size div. We'll just not + // change the value if that's the case. + var isIE7 = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version >= 7) + if(!isIE7 || (isIE7 && style.height && style.height.length > 0)) { + style.height = 'auto'; + } + if(!isIE7 || (isIE7 && style.overflow && style.overflow.length > 0)) { + style.overflow = 'auto'; + } + } else { + // Add the window's resizing handler + this._addResizeHandler(); + + style.height = accordion.offsetHeight + 'px'; + style.overflow = 'hidden'; + } + + // Setup the layout attributes for the pane so that it will be in a proper opened + // or closed state + for(var i = 0; i < this._panes.length; i++) { + this._initializePane(i); + } + + // Resize the selected pane so (depending on the AutoSize mode) it will fill the + // available remaining space after the headers have been laid out. + this._resizeSelectedPane(); + }, + + _initializePane: function(index) { + // Setup the layout attributes for the pane so that it will be in a proper opened or + // closed. This will be called when adding a new pane for the first time or when + // changing the AutoSize mode. + // + // "index" - index of the pane to initialize + + var pane = this.getPane(index); + if(!pane) { + return; + } + var wrapper = pane.content; + var original = wrapper._original; + + var opened = (index === this._selectedIndex); + wrapper.style.height = (opened || (this._autoSize === Sys.Extended.UI.AutoSize.Fill)) ? 'auto' : '0px'; + wrapper.style.overflow = opened ? 'auto' : 'hidden'; + wrapper.style.display = opened ? 'block' : 'none'; + original.style.height = 'auto'; + original.style.maxHeight = ''; + original.style.overflow = opened ? 'auto' : 'hidden'; + + var opacity = (opened || !this._fadeTransitions) ? 1 : 0; + if(this._autoSize === Sys.Extended.UI.AutoSize.Fill) { + if($common.getElementOpacity(original) != opacity) { + $common.setElementOpacity(original, opacity); + } + if($common.getElementOpacity(wrapper) != 1) { + $common.setElementOpacity(wrapper, 1); + } + } else { + if($common.getElementOpacity(wrapper) != opacity) { + $common.setElementOpacity(wrapper, opacity); + } + if($common.getElementOpacity(original) != 1) { + $common.setElementOpacity(original, 1); + } + } + + pane.header.className = this._selectedIndex === index ? (this._headerSelectedCssClass || this._headerCssClass) : this._headerCssClass; + }, + + _addResizeHandler: function() { + // Attach the resize handler + // This has been pulled out into its own method since we need to selectively wire + // up the resize handler depending on the AutoSize mode. + + if(!this._resizeHandler) { + this._resizeHandler = Function.createDelegate(this, this._resizeSelectedPane); + $addHandler(window, "resize", this._resizeHandler); + } + }, + + dispose: function() { + // Remove the window resizing handler + this._disposeResizeHandler(); + + // Wipe all the animations + this._disposeAnimations(); + + // Wipe the _panes collection. We're careful to wipe any expando properties + // which could cause memory leaks in IE6. + for(var i = this._panes.length - 1; i >= 0; i--) { + var pane = this._panes[i]; + if(pane) { + if(pane.header) { + pane.header._index = null; + $removeHandler(pane.header, "click", this._headerClickHandler); + pane.header = null; + } + if(pane.content) { + pane.content._original = null; + pane.content = null; + } + this._panes[i] = null; + delete this._panes[i]; + } + } + this._panes = null; + this._headerClickHandler = null; + + Sys.Extended.UI.AccordionBehavior.callBaseMethod(this, 'dispose'); + }, + + _disposeResizeHandler: function() { + // Remove the resize handler + // This has been pulled out into its own method since we need to selectively wire + // up the resize handler depending on the AutoSize mode. + + if(this._resizeHandler) { + $removeHandler(window, "resize", this._resizeHandler); + this._resizeHandler = null; + } + }, + + _disposeAnimations: function() { + // Dispose all the animations. This method was pulled out of dispose so we could + // allow the user to change the FadeTransitions property after the behavior was + // already initialized. We can merge it back into dispose once we support generic + // animations on the Accordion. + + for(var i = 0; i < this._panes.length; i++) { + var animation = this._panes[i].animation; + if(animation) { + // Stop the animation if it was still playing + if(animation.get_isPlaying()) { + animation.stop(); + } + + // Remove the event handler that runs after the animation completes + if(animation._ended) { + animation.remove_ended(animation._ended); + animation._ended = null; + } + + // Dispose the animation's resources (timer, etc.) + animation.dispose(); + + // Wipe expando properties to prevent leaks in IE6 + animation._length = null; + animation._fade = null; + animation._pane = null; + animation._opening = null; + animation._behavior = null; + this._panes[i].animation = null; + } + } + }, + + _resizeSelectedPane: function() { + var pane = this.getPane(); + if(!pane) { + return; + } + + // Cache the header size so it only gets looked up when the window resizes + this._headersSize = this._getHeadersSize().height; + + var original = pane.content._original; + switch(this._autoSize) { + case Sys.Extended.UI.AutoSize.None: + original.style.height = 'auto'; + original.style.maxHeight = ''; + break; + case Sys.Extended.UI.AutoSize.Limit: + var remaining = this._getRemainingHeight(false); + original.style.height = 'auto'; + original.style.maxHeight = remaining + 'px'; + break; + case Sys.Extended.UI.AutoSize.Fill: + var remaining = this._getRemainingHeight(true); + original.style.height = remaining + 'px'; + original.style.maxHeight = ''; + break; + } + }, + + _onHeaderClick: function(evt) { + // Get the header that raised the event (by walking up the event target's + // control hierarchy until we find an element just below the root of the accordion) + var header = evt.target; + var accordion = this.get_element(); + while(header && (header.parentNode !== accordion)) { + header = header.parentNode; + } + + // Stop the event from bubbling out of the header pane and prevent any + // action from happening unless we clicked a control inside the header + evt.stopPropagation(); + if(this._suppressHeaderPostbacks) { + evt.preventDefault(); + } + + // Select this pane (which saves it to ClientState and initiates an animation + // to show the content pane). If the user clicked the currently open pane and + // we're not required to keep one pane open, then we'll set the selected index + // to -1 which will close it (which means all panes will be collapsed). + var index = header._index; + if((index === this._selectedIndex) && !this._requireOpenedPane) { + index = -1; + } + this._changeSelectedIndex(index, true); + }, + + _changeSelectedIndex: function(index, animate, force) { + // Change the accordion's selected pane to a new index (and optionally show the change). + // + // "index" - index of the new selected pane + // "animate" - whether or not to show the pane change (this is primarily intended to support + // restoring _selectedIndex in initialize before any panes have been added) + // "force" - we perform no action (i.e. raising events, animating, etc.) if the two indices represent + // the same pane (including the case when we have two different "no pane selected values" + // like -1 and -500). The force flag is used during initialization to skip this check since + // we aren't able to determine invalid values yet. + + // Don't bother doing anything if the index didn't change (we actually check the + // panes so any invalid indices will match because getPane() will return null for + // both of them) + var lastIndex = this._selectedIndex; + var currentPane = this.getPane(index); + var lastPane = this.getPane(lastIndex); + if(!force && (currentPane == lastPane)) { + return; + } + + // Raise the selectedIndexChanging event but don't change the selected index + // if the handler set the cancel property to true + var eventArgs = new Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs(lastIndex, index); + this.raise_selectedIndexChanging(eventArgs); + if(eventArgs.get_cancel()) { + return; + } + + //This sets the header CSS class to the non-selected case. + if(lastPane) { + lastPane.header.className = this._headerCssClass; + } + + //This sets the selected header CSS class if available. + if(currentPane) { + currentPane.header.className = (this._headerSelectedCssClass == '') ? + this._headerCssClass : this._headerSelectedCssClass; + } + + this._selectedIndex = index; + + // Save the selected pane to preserve on postbacks + this.set_ClientState(this._selectedIndex); + + // Animate the pane changes if required + if(animate) { + this._changePanes(lastIndex); + } + + // Raise the selectedIndexChanged event and the propertyChanged event. We include + // both events because many users have expressed that the propertyChanged event is + // not discoverable. + this.raise_selectedIndexChanged(new Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs(lastIndex, index)); + this.raisePropertyChanged('SelectedIndex'); + + this._resizeSelectedPane(); + }, + + _changePanes: function(lastIndex) { + // The _changePanes function is used to animate the change between two panes when + // the selected index changes. We will loop through each pane and get its + // animation (or demand create it if it doesn't have one yet), stop playing it if + // it's currently playing, change its parameters to either open or close, and then + // animate it. Because we have an animation for each pane and we stop them if they + // were already playing, the Accordion has the ability to nicely change panes + // again before the animation is finished. + // + // "lastIndex" - index of the last selected Accordion pane + + if(!this.get_isInitialized()) { + return; + } + + var open = null; + var close = null; + for(var i = 0; i < this._panes.length; i++) { + // Get the animation for each pane (creating it on demand if it doesn't + // already exist) + var pane = this._panes[i]; + var animation = this._getAnimation(pane); + + // Stop any animations that are still playing (i.e. that haven't finished + // opening or closing from changing previous panes) + if(animation.get_isPlaying()) { + animation.stop(); + } + + // If we're not opening or closing the current pane, then restart the loop. + // We set the _opening flag so we don't have to keep checking if we're opening + // or closing. If opening, we also set the display style of the pane's content + // so it will be visible for the animation + if(i == this._selectedIndex) { + animation._opening = true; + open = animation; + } else if(i == lastIndex) { + animation._opening = false; + close = animation; + } else { + continue; + } + + // Get the pane ready to be animated by setting + this._startPaneChange(pane, animation._opening); + + + // Setup the fade effect if we are using it + if(this._fadeTransitions) { + animation._fade.set_effect(animation._opening ? Sys.Extended.UI.Animation.FadeEffect.FadeIn : Sys.Extended.UI.Animation.FadeEffect.FadeOut); + } + + // Set the length animation to either open or close depending on whether or + // not this is the selected pane. We also change the target to be the wrapper + // or the original pane depending on whether the AutoSize mode is set to Fill + // (because we need the background color, etc., to grow with the animation + // which means changing the size of the original, not the wrapper, should grow). + // We would prefer to animate the wrapper because it can collapse all the way to + // 0px while the original can only collapse it's content size to 0px (leaving any + // padding, margins, borders, etc.) which is why we need to factor in the size of + // the original div's gutter pixels. Animating the original content will also + // cause the animation to jump slightly at the end when it collapses smoothly down + // to the gutter pixels but then sets display: none and disappears. + if(this._autoSize === Sys.Extended.UI.AutoSize.Fill) { + animation.set_target(pane.content._original); + animation._length.set_startValue($common.getContentSize(pane.content._original).height); + animation._length.set_endValue(animation._opening ? this._getRemainingHeight(true) : 0); + } else { + animation.set_target(pane.content); + animation._length.set_startValue(pane.content.offsetHeight); + animation._length.set_endValue(animation._opening ? this._getRemainingHeight(false) : 0); + } + } + + // Play the animations to open the selected pane/close any other panes. Note that we + // pulled playing the animations out of the loop so that we could always play the + // closing animation first. If you play the opening animation first, in some cases the + // accordion will always grow slightly larger (shifting the rest of the page down) and + // then shrink again because the animations are running on different timers (and + // unifying them into a single animation would be a lot messier than the current + // implementation since they won't both play when we're closing the currently open pane). + if(close) { + close.play(); + } + if(open) { + open.play(); + } + + // TODO: Someday get both animations to run on the same timer because it makes an obvious + // difference in IE6 and Safari + }, + + _startPaneChange: function(pane, opening) { + // Setup the pane before it is animated. + + var wrapper = pane.content; + var original = wrapper._original; + + if(opening) { + // Make the hidden panes visible so we can see them animate + wrapper.style.display = 'block'; + + // Workaround for IE8 to preserve the margins of the accordion headers + if(this._autoSize === Sys.Extended.UI.AutoSize.Fill && this._isIE8InStandardMode) { + original.style.display = 'block'; + } + } else { + // Hide any overflow because we'll be shrinking the wrapper div down to 0px and + // we don't want content leaking out the bottom + wrapper.style.overflow = 'hidden'; + + // Turn off overflow on the original div because it's content doesn't grow during + // the animation and leaving it on slows the animation down + original.style.overflow = 'hidden'; + + // Remove any explicit height off the original content section but manually set + // the wrapper to the initial height (since it will be shrunk from this height + // to zero) + if(this._autoSize === Sys.Extended.UI.AutoSize.Limit) { + wrapper.style.height = this._getTotalSize(original).height + 'px'; + original.style.maxHeight = ''; + } + } + }, + + _endPaneChange: function(pane, opening) { + // Clean the pane up after it's been animated. + + var wrapper = pane.content; + var original = wrapper._original; + + if(opening) { + // Depending on the mode, move the explicit height value from the original + // content div to the wrapper div. This is necessary because we moved the + // explicit height value to the wrapper before the animation started since + // it was the target. + if(this._autoSize === Sys.Extended.UI.AutoSize.Limit) { + var remaining = this._getRemainingHeight(true); + original.style.maxHeight = remaining + 'px'; + } + + // Turn overflow back on so the original div's content can grow accordingly + original.style.overflow = 'auto'; + + // Remove an explicit height from the wrapper div so that it will + // automatically grow and shrink with the original content div + wrapper.style.height = 'auto'; + wrapper.style.overflow = 'auto'; + } else { + // If we finished a close animation, completely hide the pane so that + // it's content cannot be tabbed into + + if(!this._isIE8InStandardMode) { + wrapper.style.display = 'none'; + } else { + // Workaround for IE8 to preserve the margins of the accordion headers + if(this._autoSize === Sys.Extended.UI.AutoSize.Fill) { + original.style.display = 'none'; + } else { + wrapper.style.height = '0px'; + } + } + } + }, + + _getHeadersSize: function() { + // Compute the amount of space used by all the headers + var total = { width: 0, height: 0 }; + for(var i = 0; i < this._panes.length; i++) { + var size = this._getTotalSize(this._panes[i].header); + total.width = Math.max(total.width, size.width); + total.height += size.height; + } + return total; + }, + + _getRemainingHeight: function(includeGutter) { + // Determine how much remaining height we have to fill with the currently selected + // pane's content section after taking into account all the headers. This is primarily + // used for the Limit and Fill AutoSize modes. + // Returns remaining height after all the headers have been accounted for. + // + // "includeGutter" - whether or not we should include the gutter (padding, borders, margins) of the + // selected pane's original content section. This should be true whenever we're + // getting the remaining height for the original content section and false whenever + // we're getting the remaining height for its wrapper. + + var height = 0; + var pane = this.getPane(); + + if(this._autoSize === Sys.Extended.UI.AutoSize.None) { + // If the AutoSize mode is "None", then we use the size of the pane + if(pane) { + height = this._getTotalSize(pane.content._original).height; + } + } else { + // Compute the amount of space used + height = this._headersSize; + if(includeGutter && pane) { + height += this._getGutterSize(pane.content._original).height; + } + + // Determine how much of the remaining space to use + // (if AutoSize is "Fill", use the rest of the available space) + var accordion = this.get_element(); + height = Math.max(accordion.offsetHeight - height, 0); + + // If AutoSize is "Limit", then the size of the pane should be either its + // actual size, or the rest of the available space. + if(pane && (this._autoSize === Sys.Extended.UI.AutoSize.Limit)) { + var required = this._getTotalSize(pane.content._original).height; + // Ensure we return a number greater than or equal to zero + if(required > 0) { + height = Math.min(height, required); + } + } + } + + return height; + }, + + _getTotalSize: function(element) { + // Get the total size of an element, including its margins, in the form {width, height} + + var size = $common.getSize(element); + var box = $common.getMarginBox(element); + size.width += box.horizontal; + size.height += box.vertical; + return size; + }, + + _getGutterSize: function(element) { + // Get the extra "gutter" size around an element made up of its padding, + // borders, and margins. + // Returns size of the extra space (in the form of {height, width}) + + var gutter = { width: 0, height: 0 }; + + try { + var box = $common.getPaddingBox(element); + gutter.width += box.horizontal; + gutter.height += box.vertical; + } catch(ex) { } + + try { + var box = $common.getBorderBox(element); + gutter.width += box.horizontal; + gutter.height += box.vertical; + } catch(ex) { } + + var box = $common.getMarginBox(element); + gutter.width += box.horizontal; + gutter.height += box.vertical; + + return gutter; + }, + + /// + /// Fires when an Accordion pane is clicked, but before Accordion changes the pane. + /// + /// + /// + add_selectedIndexChanging: function(handler) { + this.get_events().addHandler('selectedIndexChanging', handler); + }, + remove_selectedIndexChanging: function(handler) { + this.get_events().removeHandler('selectedIndexChanging', handler); + }, + raiseSelectedIndexChanging: function(eventArgs) { + Sys.Extended.Deprecated("raiseSelectedIndexChanging(eventArgs)", "raise_selectedIndexChanging(eventArgs)"); + this.raise_selectedIndexChanging(eventArgs); + }, + raise_selectedIndexChanging: function(eventArgs) { + var handler = this.get_events().getHandler('selectedIndexChanging'); + if(handler) { + handler(this, eventArgs); + } + }, + + /// + /// Fires when an Accordion pane is clicked, but after Accordion changes the pane. + /// + /// + /// + add_selectedIndexChanged: function(handler) { + this.get_events().addHandler('selectedIndexChanged', handler); + }, + remove_selectedIndexChanged: function(handler) { + this.get_events().removeHandler('selectedIndexChanged', handler); + }, + raiseSelectedIndexChanged: function(eventArgs) { + Sys.Extended.Deprecated("raiseSelectedIndexChanged(eventArgs)", "raise_selectedIndexChanged(eventArgs)"); + this.raise_selectedIndexChanged(eventArgs); + }, + raise_selectedIndexChanged: function(eventArgs) { + var handler = this.get_events().getHandler('selectedIndexChanged'); + if(handler) { + handler(this, eventArgs); + } + }, + + /// + /// Get a specific Accordion pane given its index. If no index is provided, get the currently selected pane. + /// + /// index of the desired Accordion pane. If the index is not provided, we use + /// the currently selected index. In the event the provided index (or the currently + /// selected index) is outside the bounds of the panes collection, we return null. + /// + getPane: function(index) { + if(index === undefined || index === null) { + index = this._selectedIndex; + } + return (this._panes && index >= 0 && index < this._panes.length) ? this._panes[index] : null; + }, + get_Pane: function(index) { + Sys.Extended.Deprecated("get_Pane(index)", "getPane(index)"); + return this.getPane(index); + }, + + /// + /// Panes count. + /// + /// + getCount: function() { + return this._panes ? this._panes.length : 0; + }, + get_Count: function() { + Sys.Extended.Deprecated("get_Count()", "getCount()"); + return this.getCount(); + }, + + get_TransitionDuration: function() { + Sys.Extended.Deprecated("get_TransitionDuration()", "get_transitionDuration()"); + return this.get_transitionDuration(); + }, + get_transitionDuration: function() { + return this._duration * 1000; + }, + set_TransitionDuration: function(value) { + Sys.Extended.Deprecated("set_TransitionDuration(value)", "set_transitionDuration(value)"); + this.set_transitionDuration(value); + }, + set_transitionDuration: function(value) { + if(this._duration != (value / 1000)) { + this._duration = value / 1000; + for(var i = 0; i < this._panes.length; i++) { + var animation = this._panes[i].animation; + if(animation) { + animation.set_duration(this._duration); + } + } + this.raisePropertyChanged('TransitionDuration'); + } + }, + + get_FramesPerSecond: function() { + Sys.Extended.Deprecated("get_FramesPerSecond()", "get_framesPerSecond()"); + return this.get_framesPerSecond(); + }, + get_framesPerSecond: function() { + return this._framesPerSecond; + }, + set_FramesPerSecond: function(value) { + Sys.Extended.Deprecated("set_FramesPerSecond(value)", "set_framesPerSecond(value)"); + this.set_framesPerSecond(value); + }, + set_framesPerSecond: function(value) { + if(this._framesPerSecond != value) { + this._framesPerSecond = value; + for(var i = 0; i < this._panes.length; i++) { + var animation = this._panes[i].animation; + if(animation) { + animation.set_fps(this._framesPerSecond); + } + } + this.raisePropertyChanged('FramesPerSecond'); + } + }, + + get_FadeTransitions: function() { + Sys.Extended.Deprecated("get_FadeTransitions()", "get_fadeTransitions()"); + return this.get_fadeTransitions(); + }, + get_fadeTransitions: function() { + return this._fadeTransitions; + }, + set_FadeTransitions: function(value) { + Sys.Extended.Deprecated("set_FadeTransitions(value)", "set_fadeTransitions(value)"); + return this.set_fadeTransitions(value); + }, + set_fadeTransitions: function(value) { + if(this._fadeTransitions != value) { + this._fadeTransitions = value; + + // Whenever we toggle FadeTransitions we dispose the entire list of + // animations because it's not easy to selectively play just one of a + // ParallelAnimation's children... This is of course just a temporary + // workaround until we enable generic animations and remove the + // FadeTransitions property. + this._disposeAnimations(); + + // Set all the content sections to 100% opacity in case they had been + // faded out when a pane was changed but not faded back in yet + if(!this._fadeTransitions) { + for(var i = 0; i < this._panes.length; i++) { + if($common.getElementOpacity(this._panes[i].content) != 1) { + $common.setElementOpacity(this._panes[i].content, 1); + } + if($common.getElementOpacity(this._panes[i].content._original) != 1) { + $common.setElementOpacity(this._panes[i].content._original, 1); + } + } + } + this.raisePropertyChanged('FadeTransitions'); + } + }, + + get_HeaderCssClass: function() { + Sys.Extended.Deprecated("get_HeaderCssClass()", "get_headerCssClass()"); + return this.get_headerCssClass(); + }, + get_headerCssClass: function() { + return this._headerCssClass; + }, + set_HeaderCssClass: function(value) { + Sys.Extended.Deprecated("set_HeaderCssClass(value)", "set_headerCssClass(value)"); + this.set_headerCssClass(); + }, + set_headerCssClass: function(value) { + this._headerCssClass = value; + this.raisePropertyChanged('HeaderCssClass'); + }, + + get_HeaderSelectedCssClass: function() { + Sys.Extended.Deprecated("get_headerSelectedCssClass()", "get_headerSelectedCssClass()"); + return this.get_selectedIndex(); + }, + get_headerSelectedCssClass: function(){ + return this._headerSelectedCssClass; + }, + set_HeaderSelectedCssClass: function(value) { + Sys.Extended.Deprecated("set_HeaderSelectedCssClass(value)", "set_headerSelectedCssClass(value)"); + this.set_headerSelectedCssClass(value); + }, + set_headerSelectedCssClass: function(value) { + this._headerSelectedCssClass = value; + this.raisePropertyChanged('HeaderSelectedCssClass'); + }, + + get_AutoSize: function() { + Sys.Extended.Deprecated("get_AutoSize()", "get_autoSize()"); + return get_autoSize(); + }, + get_autoSize: function() { + return this._autoSize; + }, + set_AutoSize: function(value){ + Sys.Extended.Deprecated("set_AutoSize(value)", "set_autoSize(value)"); + this.set_autoSize(value); + }, + set_autoSize: function(value) { + // In IE, treat AutoSize.Limit exactly the same as AutoSize.Fill. Since IE does not + // support the max-height CSS property, we can't achieve the Limit auto-size behavior + // without fixing the exact size of the pane (which means it can't grow/shrink in response + // to dynamic content changes). Since Fill has most of the same UI characteristics, it's + // a safer and cleaner workaround for this one browser. + if(Sys.Browser.agent === Sys.Browser.InternetExplorer && value === Sys.Extended.UI.AutoSize.Limit) { + value = Sys.Extended.UI.AutoSize.Fill; + } + + if(this._autoSize != value) { + this._autoSize = value; + this._initializeLayout(); + this.raisePropertyChanged('AutoSize'); + } + }, + + get_SelectedIndex: function() { + Sys.Extended.Deprecated("get_SelectedIndex()", "get_selectedIndex()"); + return this.get_selectedIndex(); + }, + get_selectedIndex: function() { + return this._selectedIndex; + }, + set_SelectedIndex: function(value) { + Sys.Extended.Deprecated("set_SelectedIndex(value)", "set_selectedIndex(value)"); + this.set_selectedIndex(value); + }, + set_selectedIndex: function(value) { + this._changeSelectedIndex(value, true); + }, + + get_requireOpenedPane: function() { + return this._requireOpenedPane; + }, + set_requireOpenedPane: function(value) { + if(this._requireOpenedPane != value) { + this._requireOpenedPane = value; + this.raisePropertyChanged('requireOpenedPane'); + } + }, + + get_suppressHeaderPostbacks: function() { + return this._suppressHeaderPostbacks; + }, + set_suppressHeaderPostbacks: function(value) { + if(this._suppressHeaderPostbacks != value) { + this._suppressHeaderPostbacks = value; + this.raisePropertyChanged('suppressHeaderPostbacks'); + } + } +} +Sys.Extended.UI.AccordionBehavior.registerClass('Sys.Extended.UI.AccordionBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js new file mode 100644 index 000000000..4e06d9cb7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js @@ -0,0 +1,1621 @@ +Type.registerNamespace("Sys.Extended.UI.AjaxFileUpload"); + +// Utils +Sys.Extended.UI.AjaxFileUpload.Utils = function() { + + this.generateGuid = function() { + var result, i, j; + result = ''; + for(j = 0; j < 32; j++) { + if(j == 8 || j == 12 || j == 16 || j == 20) + result = result + '-'; + i = Math.floor(Math.random() * 16).toString(16).toUpperCase(); + result = result + i; + } + return result; + }; + + this.getFileName = function(fullPath) { + + var result = ""; + if(!fullPath) + return ''; + + if(!fullPath.value && fullPath.name) + result = fullPath.name; + else { + if(!fullPath.value && typeof (fullPath) !== "string") + throw "Invalid parameter. fullPath parameter must be a string of full path or file element."; + + if(fullPath.value) + fullPath = fullPath.value; + + if(fullPath) { + var startIndex = (fullPath.indexOf('\\') >= 0 ? fullPath.lastIndexOf('\\') : fullPath.lastIndexOf('/')); + var filename = fullPath.substring(startIndex); + if(filename.indexOf('\\') === 0 || filename.indexOf('/') === 0) { + filename = filename.substring(1); + } + + result = filename; + } + } + + return encodeURIComponent(result); + }; + + this.getFileType = function(file) { + if(!file) + throw 'file must defined or not null'; + + if(!file.value && file.name) + return file.name.substring(file.name.lastIndexOf('.') + 1); + + if(file.value) + file = file.value; + + if(typeof (file) !== "string") + throw "can't resolve file type."; + + return file.substring(file.lastIndexOf('.') + 1); + }; + + this.sizeToString = function(bytes) { + if(!bytes || bytes <= 0) + return '0 Kb'; + + var s = ['bytes', 'kb', 'MB', 'GB', 'TB', 'PB']; + var e = Math.floor(Math.log(bytes) / Math.log(1024)); + return (bytes / Math.pow(1024, Math.floor(e))).toFixed(2) + " " + s[e]; + }; + + this.checkHtml5BrowserSupport = function() { + return window.File + && window.FileReader && window.FileList + && window.Blob && (new XMLHttpRequest()).upload; + }; + +}; + +// Item +Sys.Extended.UI.AjaxFileUpload.Item = function(parentId, fileItem, onRemoveItem) { + this._deleteButton = null; + this._parentId = parentId; + this._inputElementValue = fileItem.value; + this._id = fileItem.id; + this._slices = fileItem.slices; + this._sliceIndex = 0; + + this._fileInfoContainer = null; + this._fileStatusText = null; + this._isUploaded = false; + this._isUploading = false; + this._fileSize = 0; + this._fileName = ""; + this._fileType = ""; + this._bytesUploaded = 0; + + this._ui = this.initUI(onRemoveItem); +}; + +Sys.Extended.UI.AjaxFileUpload.Item.prototype = { + initUI: function(onRemoveItem) { + + var self = this, file = this._inputElementValue, utils = new Sys.Extended.UI.AjaxFileUpload.Utils(), + isHtml5Support = utils.checkHtml5BrowserSupport(), + + // generate unique id for each item + id = this._id, + + // create line item container + container = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: this._parentId + '_FileItemContainer_' + id + }, + cssClasses: ['ajax__fileupload_fileItemInfo'] + }), + + // create file info/status container + fileInfoContainer = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: this._parentId + '_FileInfoContainer_' + id, + style: { + display: 'inline-block' + } + } + }), + + // create file info placeholder + fileInfoText = $common.createElementFromTemplate({ + nodeName: "span", + properties: { + id: this._parentId + '_FileItemInfo_' + id + }, + cssClasses: ['ajax__fileupload_fileItemInfo'] + }), + + // create file status placeholder + fileStatusText = $common.createElementFromTemplate({ + nodeName: "span", + properties: { + id: this._parentId + '_FileItemStatus_' + id + }, + cssClasses: ['uploadstatus'] + }), + + // init remove button + deleteButton = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: this._parentId + '_FileItemDeleteButton_' + id + }, + cssClasses: ['removeButton'] + }); + + this._fileName = utils.getFileName(file); + var fileNameToDisplay = decodeURIComponent(this._fileName); + + if(isHtml5Support) { + this._fileSize = file.size; + var fType = file.type ? '(' + file.type + ')' : ''; + fileInfoText.innerHTML = '' + fileNameToDisplay + ' ' + + fType + + ' - ' + utils.sizeToString(file.size) + ' '; + this._fileType = file.type; + } else { + + fileInfoText.innerHTML = '' + fileNameToDisplay + ''; + this._fileType = utils.getFileType(file); + } + + fileInfoContainer.appendChild(fileInfoText); + fileInfoContainer.appendChild(fileStatusText); + + $common.setText(deleteButton, Sys.Extended.UI.Resources.AjaxFileUpload_Remove); + $addHandlers(deleteButton, { + 'click': Function.createDelegate(this, function() { + onRemoveItem(self); + }) + }); + + // build the line item + if(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version <= 8) { + container.appendChild(deleteButton); + container.appendChild(fileInfoContainer); + } + else { + container.appendChild(fileInfoContainer); + container.appendChild(deleteButton); + } + + + this._fileInfoContainer = fileInfoContainer; + this._deleteButton = deleteButton; + this._fileStatusText = fileStatusText; + + return container; + }, + + setStatus: function(fileStatusText, text) { + $common.setText(this._fileStatusText, ' (' + text + ')'); + this._fileInfoContainer.setAttribute('class', fileStatusText + 'State'); + }, + + disabled: function(on) { + if(on) + this._deleteButton.disabled = 'disabled'; + else + this._deleteButton.disabled = ''; + }, + + hide: function() { + this._deleteButton.style.visibility = 'hidden'; + }, + + destroy: function() { + $common.removeElement(this._inputElementValue); + $common.removeElement(this._deleteButton); + $common.removeElement(this._ui); + }, + + get_inputElementValue: function() { + return this._inputElementValue; + }, + + appendNodeTo: function(parent) { + parent.appendChild(this._ui); + }, + + removeNodeFrom: function(parent) { + parent.removeChild(this._ui); + } +}; + +// Processor +Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) { + + var utils = new Sys.Extended.UI.AjaxFileUpload.Utils(), + xhrPoll = new XMLHttpRequest(); + + this._iframe = null; + this._iframeName = control.get_id() + '_uploadIframe'; + this._form = null; + + this.initialize = function() { + this.attachEvents(); + this.createIFrame(); + this.createForm(); + }; + + this.attachEvents = function() { + this.onFileSelected$delegate = Function.createDelegate(this, this.onFileSelectedHandler); + this.attachFileInputEvents(elements.inputFile, true); + + var self = this; + + // Capture uploading percentage report from server + xhrPoll.onreadystatechange = function(e) { + if(xhrPoll.readyState == 4) { + + if(xhrPoll.status == 200) { + + // Update percentage + var percent = xhrPoll.responseText; + if(percent) { + percent = parseFloat(percent).toFixed(2); + control.setPercent(percent); + } + + // Keep polling as long as upload is not completed + if(percent < 100) + setTimeout(function() { + self.pollingServerProgress(true); + }, 500); + + } else { + + // We won't do any error handler for polling, since upload error handled by upload request it self. + + } + } + }; + }; + + this.attachFileInputEvents = function(fileInput, attach) { + if(attach) + $addHandlers(fileInput, { 'change': this.onFileSelected$delegate }); + else + $common.removeHandlers(fileInput, { 'change': this.onFileSelected$delegate }); + }, + + this.onFileSelectedHandler = function(e) { + // User selects file through browser open file dialog. + // We generate file item and add it into file list, and recreate new element for next file. + + // generate file item to be uploaded + var fileItem = { + id: utils.generateGuid(), + value: elements.inputFile, + type: utils.getFileType(elements.inputFile.value) + }; + + + if(control.fileTypeIsValid(fileItem.type)) { + control.addFileToQueue(fileItem); + this.createInputFileElement(); + } else { + control.confirmFileIsInvalid(fileItem); + } + + }; + + this.createInputFileElement = function() { + var currentInputFile = elements.inputFile; + + // disfunction current input file element + currentInputFile.style.zIndex = -999; + $common.setLocation(currentInputFile, { x: -99999, y: -99999 }); + this.attachFileInputEvents(currentInputFile, false); + + // create new input file element in same location + var id = control.get_id() + '_file_' + utils.generateGuid(), + newInputFile = $common.createElementFromTemplate({ + nodeName: 'input', + properties: { + id: id, + name: "act-file-data", + type: 'file', + style: { + zIndex: 0, + cursor: 'pointer', + position: 'absolute' + } + } + }, currentInputFile.parentNode); + + $common.setElementOpacity(newInputFile, 0); + this.attachFileInputEvents(newInputFile, true); + + // set current input file with the new one + elements.inputFile = newInputFile; + }; + + this.startUpload = function() { + // Get un-uploaded file on the top from queue and start upload it. + + var form = this._form, + fileItem = control.getNextFile(); + + if(!fileItem) { + control._currentFileId = null; + this.setThrobber(false); + control.done(); + return; + } + + // set file item status + control.setAsUploading(fileItem); + + var inputElement = fileItem.get_inputElementValue(); + + // set current file id + control._currentFileId = fileItem._id; + + this.setThrobber(true); + + // clear all form children + while(form.firstChild) { + form.removeChild(form.firstChild); + } + + inputElement.name = 'act-file-data'; + + // only add 1 file input element to be uploaded + form.appendChild(inputElement); + form.setAttribute("action", control._uploadUrl + '?contextKey=' + control.get_id() + '&fileId=' + control._currentFileId + '&fileName=' + fileItem._fileName + '&usePoll=' + (control.get_serverPollingSupport() ? "true" : "false")); + + // upload it now + form.submit(); + }; + + this.cancelUpload = function() { + // send message to server to cancel this upload + var xhr = new XMLHttpRequest(), + self = this; + + // aborting server polling request + if(xhrPoll) + xhrPoll.abort(); + + xhr.open("POST", '?contextKey=' + control.get_id() + "&cancel=1&guid=" + control._currentFileId, true); + xhr.onreadystatechange = function() { + self.setThrobber(false); + if(xhr.readyState == 4) { + if(xhr.status == 200) { + control.cancelUpload(); + } else { + // cancelation is error. + self.raiseUploadError(xhr); + throw "Failed to cancel upload."; + } + } + }; + xhr.send(null); + }, + + this.createIFrame = function() { + + var name = this._iframeName, + iframe = document.createElement("IFRAME"); + + iframe.width = "0"; + iframe.height = "0"; + iframe.style.display = "none"; + iframe.src = "about:blank"; + iframe.id = name; + iframe.name = name; + iframe.security = "restricted"; + document.body.appendChild(iframe); + iframe.contentWindow.name = name; + $addHandlers(iframe, { + load: Function.createDelegate(this, this.onIFrameLoadedHandler) + }); + + this._iframe = iframe; + }; + + this.onIFrameLoadedHandler = function(e) { + // Event handler to capture when iframe receive response from server. + + if(!control._currentFileId) + return; + + try { + + var iframe = this._iframe, doc = null; + + // Only test the iframe data, exception should thrown if something went wrong. + if(iframe.contentDocument) + // Firefox, Opera + doc = iframe.contentDocument; + else if(iframe.contentWindow) + // Internet Explorer + doc = iframe.contentWindow.document; + else if(iframe.document) + // Others? + doc = iframe.document; + + if(doc == null) + throw "Document not initialized"; + + // finalizing and upload next file + control.doneAndUploadNextFile(control.getCurrentFileItem()); + + } catch(e) { + + // Cancelation / aborting upload can causing 'Access is denied' or 'Permission denied' on IE 9 bellow, + // let's consider this exception is not trully error exception from server. + if(!control._canceled || !(e.message && (e.message.indexOf("Access is denied") > -1 || e.message.indexOf("Permission denied") > -1))) { + this.raiseUploadError(e); + throw e; + } + } + }; + + this.setThrobber = function(value) { + // Show or hide throbber when processing upload. + + if(control.get_serverPollingSupport()) { + control.setPercent(0); + $common.setVisible(elements.progressBar, value ? true : false); + $common.setVisible(elements.progressBarContainer, value ? true : false); + this.pollingServerProgress(value); + return; + } + + if(control.get_throbber() != null) { + control.get_throbber().style.display = value ? "" : "none"; + } + }; + + this.pollingServerProgress = function(value) { + // Get percentage of uploading progress from server. + + if(!value || !control._currentFileId) + return; + + xhrPoll.open("GET", '?contextKey=' + control.get_id() + "&poll=1&guid=" + control._currentFileId, true); + xhrPoll.send(null); + }; + + this.createForm = function() { + // Create form that we use to upload file one by one taken from queue. + + var form, + formId = "___postForm" + control.get_id(); + + try { + form = document.createElement('
    '); + } catch(ex) { + form = document.createElement('form'); + form.setAttribute("id", formId); + form.setAttribute("method", "post"); + form.setAttribute("target", this._iframe.id); + form.setAttribute("enctype", "multipart/form-data"); + } + + form.style.visibility = 'hidden'; + form.style.display = 'none'; + document.body.appendChild(form); + + this._form = form; + }; + + this.raiseUploadError = function(xhr) { + + control.raise_uploadError(xhr); + control.setFileStatus(control._currentFileId, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error); + + if(xhrPoll) + xhrPoll.abort(); + control._currentFileId = null; + }; + +}; + +// ProcessorHtml5 +Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) { + + var utils = new Sys.Extended.UI.AjaxFileUpload.Utils(), + chunkSize = control.get_chunkSize() * 1000, + tmpXhrLoaded = 0, + xhrReq = null; + + this.initialize = function() { + $common.setVisible(elements.dropZone, true); + elements.dropZone.innerHTML = Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles; + + this.attachEvents(); + }; + + this.attachEvents = function() { + + this.onFileDropped$delegate = Function.createDelegate(this, this.onFileDroppedHandler); + this.onFileDragOver$delegate = Function.createDelegate(this, this.onFileDragOverHandler); + this.onFileSelected$delegate = Function.createDelegate(this, this.onFileSelectedHandler); + + elements.inputFile.addEventListener("change", this.onFileSelected$delegate, false); + elements.dropZone.addEventListener("drop", this.onFileDropped$delegate, false); + elements.dropZone.addEventListener("dragover", this.onFileDragOver$delegate, false); + + }; + + // #region event handlers + + this.onFileDroppedHandler = function(e) { + e.stopPropagation(); + e.preventDefault(); + this.addFilesToQueue(e.dataTransfer.files); + }; + + this.onFileDragOverHandler = function(e) { + e.stopPropagation(); + e.preventDefault(); + }; + + this.onFileSelectedHandler = function(e) { + this.addFilesToQueue(e.target.files); + this.createInputFileElement(); + }; + + this.createInputFileElement = function() { + var currentInputFile = elements.inputFile; + + delete currentInputFile; + + // create new input file element in same location + var id = control.get_id() + '_file_' + utils.generateGuid(), + newInputFile = $common.createElementFromTemplate({ + nodeName: 'input', + properties: { + id: id, + name: "act-file-data", + type: 'file', + style: { + zIndex: 0, + cursor: 'pointer', + position: 'absolute' + } + } + }, currentInputFile.parentNode); + + $common.setElementOpacity(newInputFile, 0); + this.attachFileInputEvents(newInputFile, true); + + // set current input file with the new one + elements.inputFile = newInputFile; + }; + + this.attachFileInputEvents = function(fileInput, attach) { + if(attach) + $addHandlers(fileInput, { 'change': this.onFileSelected$delegate }); + else + $common.removeHandlers(fileInput, { 'change': this.onFileSelected$delegate }); + }, + + // #endregion + + this.addFilesToQueue = function(files) { + // Validate and generate file item from HTML5 files. + + for(var i = 0; i < files.length; i++) { + + var blob = files[i], + slices = 0; + + // slice file into several chunks when it's too big + if(blob.size > chunkSize) { + slices = Math.ceil(blob.size / chunkSize); + } + + // create file item to be added on queue + var fileItem = { + id: utils.generateGuid(), + value: files[i], + type: utils.getFileType(files[i]), + uploaded: false, + slices: slices + }; + + // validate it, add it if it's OK + if(control.fileTypeIsValid(fileItem.type)) { + if(!control.addFileToQueue(fileItem)) + break; + } else { + control.confirmFileIsInvalid(fileItem); + } + } + + // reset input file value so 'change' event can be fired again with same file name. + elements.inputFile.value = null; + }; + + this.cancelUpload = function() { + + // abort ajax upload request + if(xhrReq) xhrReq.abort(); + + control.cancelUpload(); + }, + + this.startUpload = function() { + // Get un-uploaded file on the top from queue and start upload it. + + var fileItem = control.getNextFile(); + + if(fileItem) { + if(fileItem._sliceIndex === 0) + control.setPercent(0); + $common.setVisible(elements.progressBarContainer, true); + this.upload(fileItem); + } else { + control._currentFileId = null; + control.setPercent(0); + $common.setVisible(elements.progressBarContainer, false); + control.done(); + } + }; + + this.upload = function(fileItem) { + if(!control._isUploading) + return; + + // ensure progress bar is visible + $common.setVisible(elements.progressBar, true); + + // set file item status + control.setAsUploading(fileItem); + + // preparing upload data + var blob = fileItem.get_inputElementValue(), + fileName = fileItem._fileName, + chunked = fileItem._slices && (fileItem._slices > 0), + firstChunk = fileItem._sliceIndex == 0; + + if(chunked) { + var start = fileItem._sliceIndex * chunkSize, + stop = start + chunkSize; + blob = blob.slice(start, stop > blob.size ? blob.size : stop); + } + + // preparing xhr request + var form = new FormData(), + id = control._currentFileId = fileItem._id, + xhrReq = new XMLHttpRequest(), + self = this, + xhrDelegate = function(method) { return function(e) { method.call(self, id, e); }; }; + + xhrReq.upload.addEventListener("progress", xhrDelegate(this.onProgressHandler), false); + xhrReq.addEventListener("load", xhrDelegate(this.onUploadCompleteHandler), false); + xhrReq.addEventListener("error", xhrDelegate(this.onUploadFailedHandler), false); + xhrReq.addEventListener("abort", xhrDelegate(this.onUploadCanceledHandler), false); + xhrReq.open("POST", control._uploadUrl + '?contextKey=' + control.get_id() + '&fileId=' + id + '&fileName=' + fileName + '&chunked=' + (chunked ? "true" : "false") + '&firstChunk=' + firstChunk, true); + form.append("act-file-data", blob); + xhrReq.send(form); + }; + + this.onProgressHandler = function(id, xhr) { + // if lengthComputable is available, then let's provide progress bar animation. + + if(!control._isUploading) + return; + + + if(xhr.lengthComputable) { + + tmpXhrLoaded = xhr.loaded; + + var fileItem = control.getFileItem(id), + slices = fileItem._slices, + + // calculate all uploaded bytes + allBytesUploaded = fileItem._bytesUploaded + tmpXhrLoaded, + + // estimation of total file size + calculatedFileSize = + slices - fileItem._sliceIndex == 1 + ? allBytesUploaded + : xhr.total * slices, + + // calculate all uploaded bytes in percent + percentComplete = + slices == 0 + ? (xhr.loaded * 100 / xhr.total).toFixed(2) + : ((allBytesUploaded / calculatedFileSize) * 100).toFixed(2); + + control.setPercent(percentComplete); + } + }; + + this.onUploadCompleteHandler = function(id, xhr) { + var self = this, + fileItem = control.getFileItem(id), + file = fileItem.get_inputElementValue(); + + + if(fileItem._slices && fileItem._slices > 0 && fileItem._sliceIndex + 1 < fileItem._slices) { + + // uploaded data is chunk of file that is not the last chunk, so we move to next chunk and upload it + fileItem._sliceIndex++; + fileItem._bytesUploaded += tmpXhrLoaded; + tmpXhrLoaded = 0; + self.startUpload(); + + } else { + + // hide remove button + fileItem.hide(); + + // set statuses as uploaded + fileItem.setStatus('uploaded', Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded); + control.setStatusMessage(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadingHtml5File, + file.name, utils.sizeToString(file.size))); + + // finalizing and upload next file + control.doneAndUploadNextFile(fileItem); + } + }; + + this.onUploadFailedHandler = function(id, xhr) { + var fileItem = control.getFileItem(id); + fileItem._isUploading = false; + control.setFileStatus(id, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error); + control.raise_uploadError(xhr); + }; + + this.onUploadCanceledHandler = function(id, xhr) { + var fileItem = control.getFileItem(id); + fileItem._isUploading = false; + control.setFileStatus(fileItem, 'canceled', Sys.Extended.UI.Resources.AjaxFileUpload_Canceled); + }; +}; + +// StartEventArgs +Sys.Extended.UI.AjaxFileUploadStartEventArgs = function(filesInQueue, serverArguments) { + if(arguments.length != 2) throw Error.parameterCount(); + + Sys.Extended.UI.AjaxFileUploadStartEventArgs.initializeBase(this); + this._filesInQueue = filesInQueue; + this._serverArguments = serverArguments; +}; + +Sys.Extended.UI.AjaxFileUploadStartEventArgs.prototype = { + get_filesInQueue: function() { + return this._filesInQueue; + }, + get_serverArguments: function() { + return this._serverArguments; + } +}; + +Sys.Extended.UI.AjaxFileUploadStartEventArgs.registerClass('Sys.Extended.UI.AjaxFileUploadStartEventArgs', Sys.EventArgs); + +// EventArgs +Sys.Extended.UI.AjaxFileUploadEventArgs = function(fileId, statusMessage, fileName, fileSize, contentType, postedUrl, fileIndex, fileQueueLength) { + if(arguments.length != 8) throw Error.parameterCount(); + + //Calling the base class constructor + Sys.Extended.UI.AjaxFileUploadEventArgs.initializeBase(this); + this._fileId = fileId; + this._statusMessage = statusMessage; + this._fileName = fileName; + this._fileSize = fileSize; + this._contentType = contentType; + this._postedUrl = postedUrl; + this._fileIndex = fileIndex; + this._fileQueueLength = fileQueueLength; +}; + +Sys.Extended.UI.AjaxFileUploadEventArgs.prototype = +{ + get_fileId: function() { + return this._fileId; + }, + get_fileName: function() { + return this._fileName; + }, + get_statusMessage: function() { + return this._statusMessage; + }, + get_fileSize: function() { + return this._fileSize; + }, + get_contentType: function() { + return this._contentType; + }, + get_postedUrl: function() { + return this._postedUrl; + }, + set_postedUrl: function() { + return this._postedUrl = value; + }, + get_fileIndex: function() { + return this._fileIndex; + }, + get_fileQueueLength: function() { + return this._fileQueueLength; + } +}; + +Sys.Extended.UI.AjaxFileUploadEventArgs.registerClass('Sys.Extended.UI.AjaxFileUploadEventArgs', Sys.EventArgs); + +// CompleteAllEventArgs +Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs = function(filesInQueue, filesUploaded, reason, serverArguments) { + if(arguments.length != 4) throw Error.parameterCount(); + + Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs.initializeBase(this); + this._filesInQueue = filesInQueue; + this._filesUploaded = filesUploaded; + this._reason = reason; + this._serverArguments = serverArguments; +}; + +Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs.prototype = { + get_filesInQueue: function() { + return this._filesInQueue; + }, + get_reason: function() { + return this._reason; + }, + get_filesUploaded: function() { + return this._filesUploaded; + }, + get_serverArguments: function() { + return this._serverArguments; + } +}; + +Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs.registerClass('Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs', Sys.EventArgs); + +// Control +Sys.Extended.UI.AjaxFileUpload.Control = function(element) { + + Sys.Extended.UI.AjaxFileUpload.Control.initializeBase(this, [element]); + + // properties + this._contextKey = null; + + /// + /// A url of the page where the control is located. + /// + /// get_postBackUrl + /// set_postBackUrl + /// + this._postBackUrl = null; + + /// + /// How AjaxFileUpload displays a progress bar. + /// + /// get_mode + /// set_mode + /// + this._mode = 0; + + /// + /// Whether or not AjaxFileUpload supports server polling. + /// + /// get_serverPollingSupport + /// set_serverPollingSupport + /// + this._serverPollingSupport = false; + + /// + /// A control that is shown while a file is uploading. + /// The throbber image is displayed for browsers that do not support the HTML5 File API or server-side polling. + /// + /// get_throbber + /// set_throbber + /// + this._throbber = null; + + /// + /// A maximum number of files in an upload queue. + /// Default value is 10. + /// + /// get_maximumNumberOfFiles + /// set_maximumNumberOfFiles + /// + this._maximumNumberOfFiles = 10; + + /// + /// A comma-separated list of allowed file extensions. + /// + /// get_allowedFileTypes + /// set_allowedFileTypes + /// + this._allowedFileTypes = ''; + + /// + /// The size of a chunk used by HTML5 to upload a large file in bytes. + /// + /// get_chunkSize + /// set_chunkSize + /// + this._chunkSize = 4096; + + this._clearFileListAfterUpload = false; + + // fields + this._uploadUrl = 'AjaxFileUploadHandler.axd'; + this._useHtml5Support = false; + this._elements = null; + this._processor = null; + this._filesInQueue = []; + this._isUploading = false; + this._currentFileId = null; + this._currentQueueIndex = 0; + this._canceled = false; +}; + +Sys.Extended.UI.AjaxFileUpload.Control.prototype = { + + initialize: function() { + + var utils = new Sys.Extended.UI.AjaxFileUpload.Utils(), + + // element id + id = this.get_id(), + + getElement = function(name) { + return document.getElementById(id + name); + }, + + // control elements + elements = { + queueContainer: getElement('_QueueContainer'), + selectFileButton: getElement('_SelectFileButton'), + uploadOrCancelButton: getElement('_UploadOrCancelButton'), + fileStatusContainer: getElement('_FileStatusContainer'), + footer: getElement('_Footer') + }; + + // determine browser supports for HTML5, only if browser supported and mode is not Server. + this._useHtml5Support = utils.checkHtml5BrowserSupport() && this._mode != 2; + + // define progress bar element + elements.progressBar = getElement('_ProgressBar'); + elements.progressBarContainer = getElement('_ProgressBarContainer'); + + if(this._useHtml5Support) { + + // define spesific elements for HTML5 + elements.inputFile = getElement('_Html5InputFile'); + elements.dropZone = getElement('_Html5DropZone'); + } else { + + // define spesific elements for non HTML5 + elements.inputFile = getElement('_InputFileElement'); + } + this._elements = elements; + + // define processor + var processor = this._useHtml5Support + ? new Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5(this, elements) + : new Sys.Extended.UI.AjaxFileUpload.Processor(this, elements); + + // set layout + this.setDefaultElementsLayout(elements); + + // attach elements events + this.attachEvents(elements); + + // initialize processor + processor.initialize(); + + this._processor = processor; + Sys.Extended.UI.AjaxFileUpload.Control.callBaseMethod(this, "initialize"); + }, + + dispose: function() { + Sys.Extended.UI.AjaxFileUpload.Control.callBaseMethod(this, "dispose"); + }, + + /// + /// Sets default elements layout during initializing. + /// + /// + /// Elements to set up + setDefaultElementsLayout: function(elements) { + $common.setVisible(elements.inputFile, true); + elements.uploadOrCancelButton.style.visibility = "hidden"; + $common.setVisible(elements.fileStatusContainer, true); + + elements.selectFileButton.innerHTML = Sys.Extended.UI.Resources.AjaxFileUpload_SelectFile; + elements.uploadOrCancelButton.innerHTML = Sys.Extended.UI.Resources.AjaxFileUpload_Upload; + + this.setStatusMessage(Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload); + }, + + /// + /// Attaches the click event hanlder to an upload button. + /// + /// + /// Collection of AjaxFileUpload visual elements + attachEvents: function(elements) { + this.onUploadOrCancelButtonClicked$delegate = Function.createDelegate(this, this._onUploadOrCancelButtonClickedHandler); + $addHandlers(elements.uploadOrCancelButton, { 'click': this.onUploadOrCancelButtonClicked$delegate }); + }, + + // Event handler for click event on upload button. Upload button will act as a toggle driven by _isUploading field, for Upload and Cancel action. + // if _isUploading set to true, it indicates that this button will act as Cancel, otherwise is Upload. + onUploadOrCancelButtonClickedHandler: function(e) { + Sys.Extended.Deprecated("onUploadOrCancelButtonClickedHandler(e)"); + }, + _onUploadOrCancelButtonClickedHandler: function(e) { + var files = this._filesInQueue; + if(!files.length) { + alert(Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload); + return; + } + + var uploaded = 0; + for(var i = 0; i < files.length; i++) { + if(files[i]._isUploaded) + uploaded++; + } + + if(uploaded == files.length) { + alert(Sys.Extended.UI.Resources.AjaxFileUpload_AllFilesUploaded); + return; + } + + // Enabling control based on now state + this.enableControls(this._isUploading); + + // Toggling state + this._isUploading = !this._isUploading; + if(this._isUploading) { + this._canceled = false; + + // Tell server upload is started + var xhr = new XMLHttpRequest(), + self = this; + + xhr.open("POST", '?contextKey=' + this.get_id() + + "&start=1&queue=" + this._filesInQueue.length); + xhr.onreadystatechange = function() { + if(xhr.readyState == 4) { + if(xhr.status == 200) { + self._processor.startUpload(); + self.raise_uploadStart(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText)); + } else { + self.raise_uploadError(xhr); + throw "Failed to starting upload."; + } + } + }; + xhr.send(null); + + } else { + this._canceled = true; + this._processor.cancelUpload(); + + // reset all file items state + for(var i = 0; i < files.length; i++) { + if(!files[i]._isUploaded) { + files[i]._isUploading = false; + } + } + } + }, + + /// + /// If set to true, it will set the control state to enabled (ready to upload), + /// otherwise the control will be disabled and the button state turns to the Cancel button. + /// + /// + /// true to enable controls, otherwise false + enableControls: function(enable) { + var btn = this._elements.uploadOrCancelButton; + $common.setText(btn, enable ? Sys.Extended.UI.Resources.AjaxFileUpload_Upload : Sys.Extended.UI.Resources.AjaxFileUpload_Cancel); + btn.setAttribute('class', enable ? 'ajax__fileupload_uploadbutton' : 'ajax_fileupload_cancelbutton'); + + // Lock/unlock input element, so user won't add new file while uploading. + $common.setVisible(this._elements.inputFile, enable); + + if(this._useHtml5Support) { + this._elements.dropZone.disable = !enable; + this._elements.inputFile.disable = !enable; + } + }, + + /// + /// Call this method when all files has been uploaded. + /// This method will reset states of the control. + /// + /// + done: function() { + this._isUploading = false; + this.enableControls(true); + this.setStatusMessage(Sys.Extended.UI.Resources.AjaxFileUpload_AllFilesUploaded + " " + Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload); + $common.setVisible(this._elements.uploadOrCancelButton, false); + + // Tell to server that all files has been uploaded. + var xhr = new XMLHttpRequest(), + self = this, + currentFile = this._filesInQueue[this._currentQueueIndex - 1]; + + xhr.open("POST", '?contextKey=' + this.get_id() + + "&complete=1&queue=" + this._filesInQueue.length + + "&uploaded=" + (this._currentQueueIndex - (currentFile._isUploaded ? 0 : 1)) + + "&reason=" + (this._canceled ? "cancel" : "done")); + + xhr.onreadystatechange = function() { + if(xhr.readyState == 4) { + if(xhr.status == 200) { + self.raise_uploadCompleteAll(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText)); + } else { + self.raise_uploadError(xhr); + throw "Failed to completing upload."; + } + } + }; + xhr.send(null); + + if(this.get_clearFileListAfterUpload()) { + for(var i = 0; i < this._filesInQueue.length; i += 1) { + var item = this._filesInQueue[i]; + + item.removeNodeFrom(this._elements.queueContainer); + } + + $common.setVisible(this._elements.queueContainer, false); + $common.setVisible(this._elements.uploadOrCancelButton, false); + } + + // Reset queue + this._filesInQueue = []; + this._currentQueueIndex = 0; + }, + + /// + /// Removes a file from the queue and updates user interface. + /// + /// + /// An item to remove + removeFileFromQueueHandler: function(e) { + // never remove file being uploaded. + if(!e || e._isUploading) + return; + + // remove from queue. + Array.remove(this._filesInQueue, e); + + // remove element. + e.removeNodeFrom(this._elements.queueContainer); + + // hide container if queue is empty. + if(!this._elements.queueContainer.hasChildNodes()) { + $common.setVisible(this._elements.queueContainer, false); + $common.setVisible(this._elements.uploadOrCancelButton, false); + } + + // update files count information. + this._showFilesCount(); + }, + + /// + /// The processor will call this method to add a selected file to the queue. + /// It will return true if a file item is successfully added, otherwise, it returnes false. + /// + /// + /// File to add to the queue + addFileToQueue: function(item) { + var max = this.get_maximumNumberOfFiles(); + if(max > 0 && this._filesInQueue.length >= max) { + alert(Sys.Extended.UI.Resources.AjaxFileUpload_MaxNumberOfFilesExceeded); + return false; + } + + // assign event handler for remove button. + var fileItem = new Sys.Extended.UI.AjaxFileUpload.Item(this.get_id(), item, + Function.createDelegate(this, this.removeFileFromQueueHandler)); + + // add element to queue container. + fileItem.appendNodeTo(this._elements.queueContainer); + + // set default state of file item as pending. + fileItem.setStatus('pending', Sys.Extended.UI.Resources.AjaxFileUpload_Pending); + + // Ensure the queue container is visible + $common.setVisible(this._elements.queueContainer, true); + $common.setVisible(this._elements.uploadOrCancelButton, true); + + // add into queue. + this._filesInQueue.push(fileItem); + + // update files count information. + this._showFilesCount(); + + return true; + }, + + _showFilesCount: function() { + // This will show number of files in queue or message to select file(s) when there is no file in queue. + + var empty = (this._filesInQueue.length == 0); + + this.setStatusMessage(empty + ? Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload + : String.format(Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue, this._filesInQueue.length.toString())); + }, + + /// + /// Checks whether the file type is allowed to be uploaded by checking it against the AlowedFileTypes property. + /// + /// + /// File extension + fileTypeIsValid: function(fileType) { + if(!this._allowedFileTypes) + return true; + + var allowedFileTypes = this._allowedFileTypes.split(','); + + for(var i = 0; i < allowedFileTypes.length; i++) { + var ftype = allowedFileTypes[i]; + if(fileType.toLocaleLowerCase() == ftype.toLocaleLowerCase()) + return true; + } + + return false; + }, + + /// + /// Sends alert to a user that the file type is not acceptable. The processor uses this method after validation. + /// + /// + /// File trying to be added to queue + confirmFileIsInvalid: function(fileItem) { + var utils = new Sys.Extended.UI.AjaxFileUpload.Utils(); + alert(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_WrongFileType, utils.getFileName(fileItem.value), fileItem.type)); + }, + + /// + /// Marks fileItem as uploaded, and uploads the next file in a queue. + /// + /// + /// Uploaded file + doneAndUploadNextFile: function(fileItem) { + // send message to server to finalize this upload + var xhr = new XMLHttpRequest(), + self = this; + + xhr.open("POST", "?contextKey=" + this.get_id() + "&done=1&guid=" + fileItem._id, true); + xhr.onreadystatechange = function(e) { + if(xhr.readyState == 4) { + if(xhr.status == 200) { + + // Mark as done and invoke event handler + self.raise_uploadComplete(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText)); + + // Upload next file + self._processor.startUpload(); + + } else { + // finalizing is error. next file will not be uploaded. + self.setFileStatus(fileItem, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error); + self.raise_uploadError(xhr); + throw "error raising upload complete event and start new upload"; + } + } + }; + xhr.send(null); + }, + + /// + /// Cancels upload process. + /// + /// + cancelUpload: function() { + var fileItem = this.getCurrentFileItem(); + + // Reset file item state + fileItem._isUploaded = false; + fileItem._isUploading = false; + + // Update status + this.setStatusMessage(Sys.Extended.UI.Resources.AjaxFileUpload_UploadCanceled); + + // Mark all rest un-uploaded files to be canceled + for(var i = 0; i < this._filesInQueue.length; i++) { + var file = this._filesInQueue[i]; + if(!file._isUploaded) { + this.setFileStatus(file, 'cancelled', Sys.Extended.UI.Resources.AjaxFileUpload_Canceled); + } + } + }, + + /// + /// Sets the file item status to uploading. + /// + /// + /// Uploading file + setAsUploading: function(fileItem) { + fileItem._isUploading = true; + fileItem._isUploaded = false; + + this._currentQueueIndex = Array.indexOf(this._filesInQueue, fileItem) + 1; + + this.setFileStatus(fileItem, 'uploading', Sys.Extended.UI.Resources.AjaxFileUpload_Uploading); + this.setStatusMessage('Uploading ' + this._currentQueueIndex + ' of ' + this._filesInQueue.length + ' file(s)'); + }, + + /// + /// Sets file item status text. + /// + /// + /// Uploading file + /// Text displayed in file info container + /// Text displayed in status bar + setFileStatus: function(fileItem, fileStatusText, text) { + if(typeof (fileItem) === "string") + fileItem = this.getFileItem(fileItem); + if(fileItem) + fileItem.setStatus(fileStatusText, text); + }, + + /// + /// Sets a message in a status bar. + /// + /// + /// Text to set + setStatusMessage: function(msg) { + this._elements.fileStatusContainer.innerHTML = msg; + }, + + /// + /// Sets upload percentage. + /// + /// + /// Upload percent + setPercent: function(percent) { + var progressBar = this._elements.progressBar; + if(percent <= 0) + percent = "0"; + else if(percent >= 100) + percent = "100"; + + progressBar.style.width = percent + '%'; + $common.setText(progressBar, String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage, percent)); + }, + + get_allowedFileTypes: function() { + return this._allowedFileTypes; + }, + set_allowedFileTypes: function(value) { + this._allowedFileTypes = value; + }, + + get_contextKey: function() { + return this._contextKey; + }, + set_contextKey: function(value) { + this._contextKey = value; + }, + + get_postBackUrl: function() { + return this._postBackUrl; + }, + set_postBackUrl: function(value) { + this._postBackUrl = value; + }, + + get_mode: function() { + return this._mode; + }, + set_mode: function(value) { + this._mode = value; + }, + + get_serverPollingSupport: function() { + return this._serverPollingSupport; + }, + set_serverPollingSupport: function(value) { + this._serverPollingSupport = value; + }, + + get_throbber: function() { + return this._throbber; + }, + set_throbber: function(value) { + this._throbber = value; + }, + + get_maximumNumberOfFiles: function() { + return this._maximumNumberOfFiles; + }, + set_maximumNumberOfFiles: function(value) { + this._maximumNumberOfFiles = value; + }, + + get_chunkSize: function() { + return this._chunkSize; + }, + set_chunkSize: function(value) { + this._chunkSize = value; + }, + + /// + /// Whether or not to hide the file upload list container after uploading finished + /// get_clearQueueContainerAfterUpload + /// set_clearQueueContainerAfterUpload + /// + get_clearFileListAfterUpload: function() { + return this._clearFileListAfterUpload; + }, + set_clearFileListAfterUpload: function(value) { + this._clearFileListAfterUpload = value; + }, + + /// + /// Occurs when the file upload starts + /// + /// + /// + add_uploadStart: function(handler) { + this.get_events().addHandler("uploadStart", handler); + }, + remove_uploadStart: function(handler) { + this.get_events().removeHandler("uploadStart", handler); + }, + raiseUploadStart: function(e) { + Sys.Extended.Deprecated("raiseUploadStart(e)", "raise_uploadStart(e)"); + this.raise_uploadStart(e); + }, + raise_uploadStart: function(e) { + // Invoke uploadStart event + var eh = this.get_events().getHandler("uploadStart"); + if(eh) { + var eventArgs = new Sys.Extended.UI.AjaxFileUploadStartEventArgs(e.FilesInQueue, e.ServerArguments); + eh(this, eventArgs); + } + }, + + /// + /// Occurs when the file upload completes. + /// + /// + /// + add_uploadComplete: function(handler) { + this.get_events().addHandler("uploadComplete", handler); + }, + remove_uploadComplete: function(handler) { + this.get_events().removeHandler("uploadComplete", handler); + }, + raiseUploadComplete: function(e) { + Sys.Extended.Deprecated("raiseUploadComplete(e)", "raise_uploadComplete(e)"); + this.raise_uploadComplete(e); + }, + raise_uploadComplete: function(e) { + var fileItem = this.getCurrentFileItem(); + + if(!fileItem || !e || e.FileId !== fileItem._id) + throw "Invalid finalizing upload server response."; + + // Mark and reset state that current file is uploaded + this.setFileStatus(fileItem, 'uploaded', Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded); + this.setStatusMessage('Uploaded ' + this._currentQueueIndex + ' of ' + this._filesInQueue.length + ' file(s)'); + + fileItem._isUploaded = true; + fileItem._isUploading = false; + fileItem.hide(); + + // Invoke uploadComplete event + var eh = this.get_events().getHandler("uploadComplete"); + if(eh) { + var fileIndex = Array.indexOf(this._filesInQueue, fileItem), + eventArgs = new Sys.Extended.UI.AjaxFileUploadEventArgs(e.FileId, e.StatusMessage, e.FileName, + e.FileSize, e.ContentType, + e.PostedUrl, fileIndex, + this._filesInQueue.length); + eh(this, eventArgs); + } + }, + + /// + /// An event handler that will be raised when the UploadComplete event is raised + /// in all files in an upload queue, or when a user presses the Cancel button to stop uploading. + /// + /// + /// + add_uploadCompleteAll: function(handler) { + this.get_events().addHandler("uploadCompleteAll", handler); + }, + remove_uploadCompleteAll: function(handler) { + this.get_events().removeHandler("uploadCompleteAll", handler); + }, + raiseUploadCompleteAll: function(e) { + Sys.Extended.Deprecated("raiseUploadCompleteAll(e)", "raise_uploadCompleteAll(e)"); + this.raise_uploadCompleteAll("raiseUploadCompleteAll(e)", "raise_uploadCompleteAll(e)"); + }, + raise_uploadCompleteAll: function(e) { + var eh = this.get_events().getHandler("uploadCompleteAll"); + if(eh) { + var eventArgs = new Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs(e.FilesInQueue, e.FilesUploaded, e.Reason, e.ServerArguments); + eh(this, eventArgs); + } + }, + + /// + /// An event handler raised when an upload error occurs. + /// + /// + /// + add_uploadError: function(handler) { + this.get_events().addHandler("uploadError", handler); + }, + remove_uploadError: function(handler) { + this.get_events().removeHandler("uploadError", handler); + }, + raiseUploadError: function(e) { + Sys.Extended.Deprecated("raiseUploadError(e)", "raise_uploadError(e)"); + this.raise_uploadError(e); + }, + raise_uploadError: function(e) { + var eh = this.get_events().getHandler("uploadError"); + if(eh) { + eh(this, e); + } + + this._canceled = false; + this._isUploading = false; + this.enableControls(true); + }, + + /// + /// Gets a file item based on the current file id. + /// + /// + getCurrentFileItem: function() { + return this.getFileItem(this._currentFileId); + }, + + /// + /// Gets a file in an upload queue by id. + /// + /// + getNextFile: function() { + if(!this._isUploading) + return null; + + for(var i = 0; i < this._filesInQueue.length; i++) { + var file = this._filesInQueue[i]; + if(!file._isUploaded) { + return file; + } + } + + return null; + }, + + /// + /// Get file in upload queue by ID + /// + /// + /// File ID + getFileItem: function(id) { + for(var i = 0; i < this._filesInQueue.length; i++) { + var file = this._filesInQueue[i]; + if(file._id === id) { + return file; + } + } + + return null; + } +}; + +Sys.Extended.UI.AjaxFileUpload.Control.registerClass("Sys.Extended.UI.AjaxFileUpload.Control", Sys.Extended.UI.ControlBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AlwaysVisibleControl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AlwaysVisibleControl.debug.js new file mode 100644 index 000000000..8eaf86865 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AlwaysVisibleControl.debug.js @@ -0,0 +1,376 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.HorizontalSide = function() { + // The HorizontalSide enumeration describes the horizontal side + // of the window used to anchor the element + throw Error.invalidOperation(); +} +Sys.Extended.UI.HorizontalSide.prototype = { + Left: 0, + Center: 1, + Right: 2 +} +Sys.Extended.UI.HorizontalSide.registerEnum("Sys.Extended.UI.HorizontalSide", false); + + +Sys.Extended.UI.VerticalSide = function() { + // The VerticalSide enumeration describes the vertical side + // of the window used to anchor the element + throw Error.invalidOperation(); +} +Sys.Extended.UI.VerticalSide.prototype = { + Top: 0, + Middle: 1, + Bottom: 2 +} +Sys.Extended.UI.VerticalSide.registerEnum("Sys.Extended.UI.VerticalSide", false); + + +Sys.Extended.UI.AlwaysVisibleControlBehavior = function(element) { + // The AlwaysVisibleControl behavior is used to fix a particular control a specified distance + // from the top/left corner at all times regardless of how the users scrolls or sizes the window. + Sys.Extended.UI.AlwaysVisibleControlBehavior.initializeBase(this, [element]); + + /// + /// A distance to the horizontal edge of the browser in pixels from the same side of the target control. + /// The default is 0 pixels. + /// + /// get_horizontalOffset + /// set_horizontalOffset + /// + this._horizontalOffset = 0; + + /// + /// A horizontal side of the browser to anchor the control against. + /// The default is the Left side. + /// + /// get_horizontalSide + /// set_horizontalSide + /// + this._horizontalSide = Sys.Extended.UI.HorizontalSide.Left; + + /// + /// A distance to the vertical edge of the browser in pixels from the same side of the target control. + /// The default is 0 pixels. + /// + /// get_verticalOffset + /// set_verticalOffset + /// + this._verticalOffset = 0; + + /// + /// A vertical side of the browser to anchor the control against. + /// The default is the Top side. + /// + /// get_verticalSide + /// set_verticalSide + /// + this._verticalSide = Sys.Extended.UI.VerticalSide.Top; + + /// + /// Length of the scrolling effectn seconds when the target control is repositioned. + /// The default is 1 + /// + /// get_scrollEffectDuration + /// set_scrollEffectDuration + /// + this._scrollEffectDuration = .1; + + // Member variable used to handle the window's scroll and resize events + this._repositionHandler = null; + + + /// + /// Whether or not to animate the element's transposition. (note: this value should always be true in IE6). + /// + /// get_useAnimation + /// set_useAnimation + /// + this._animate = false; + + // Animation to handle moving the element + this._animation = null; +} +Sys.Extended.UI.AlwaysVisibleControlBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.AlwaysVisibleControlBehavior.callBaseMethod(this, 'initialize'); + + var element = this.get_element(); + if(!element) throw Error.invalidOperation(Sys.Extended.UI.Resources.AlwaysVisible_ElementRequired); + + // Create the resposition handler used to place the element + this._repositionHandler = Function.createDelegate(this, this._reposition); + + // Determine whether or not to use animations (i.e. whether or not the browser + // supports CSS position: fixed). All major browsers except IE 6 or earlier support it. + // Otherwise we'll only animate if desired. + if(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) { + this._animate = true; + } + if(this._animate) { + // Initialize the animations to use the actual properties + this._animation = new Sys.Extended.UI.Animation.MoveAnimation( + element, this._scrollEffectDuration, 25, 0, 0, false, 'px'); + + // Make the control use absolute positioning to hover + // appropriately and move it to its new home + element.style.position = 'absolute'; + } else { + // Make the control use fixed positioning to keep it from moving + // while the content behind it slides around + element.style.position = 'fixed'; + } + + // Attach the onResize handler + $addHandler(window, 'resize', this._repositionHandler); + + // Attach the onscroll event handler for the animations + if(this._animate) { + $addHandler(window, 'scroll', this._repositionHandler); + } + + // Move to the initial position + this._reposition(); + }, + + dispose: function() { + // Detach the event and wipe the delegate + if(this._repositionHandler) { + if(this._animate) { + $removeHandler(window, 'scroll', this._repositionHandler); + } + $removeHandler(window, 'resize', this._repositionHandler); + this._repositionHandler = null; + } + + // Dispose the animation + if(this._animation) { + this._animation.dispose(); + this._animation = null; + } + + Sys.Extended.UI.AlwaysVisibleControlBehavior.callBaseMethod(this, 'dispose'); + }, + + _reposition: function(eventObject) { + // Handler to reposition the element and place it where it actually belongs + // whenever the browser is scrolled or resized + var element = this.get_element(); + if(!element) return; + + this.raise_repositioning(Sys.EventArgs.Empty); + + var x = 0; + var y = 0; + + // Compute the initial offset if we're animating + if(this._animate) { + if(document.documentElement && document.documentElement.scrollTop) { + x = document.documentElement.scrollLeft; + y = document.documentElement.scrollTop; + } else { + x = document.body.scrollLeft; + y = document.body.scrollTop; + } + } + + // Compute the width and height of the client + var clientBounds = $common.getClientBounds(); + var width = clientBounds.width; + var height = clientBounds.height; + + // Compute the horizontal coordinate + switch(this._horizontalSide) { + case Sys.Extended.UI.HorizontalSide.Center: + x = Math.max(0, Math.floor(x + width / 2.0 - element.offsetWidth / 2.0 - this._horizontalOffset)); + break; + case Sys.Extended.UI.HorizontalSide.Right: + x = Math.max(0, x + width - element.offsetWidth - this._horizontalOffset); + break; + case Sys.Extended.UI.HorizontalSide.Left: + default: + x += this._horizontalOffset; + break; + } + + // Compute the vertical coordinate + switch(this._verticalSide) { + case Sys.Extended.UI.VerticalSide.Middle: + y = Math.max(0, Math.floor(y + height / 2.0 - element.offsetHeight / 2.0 - this._verticalOffset)); + break; + case Sys.Extended.UI.VerticalSide.Bottom: + y = Math.max(0, y + height - element.offsetHeight - this._verticalOffset); + break; + case Sys.Extended.UI.VerticalSide.Top: + default: + y += this._verticalOffset; + break; + } + + // Move the element to its new position + if(this._animate && this._animation) { + this._animation.stop(); + this._animation.set_horizontal(x); + this._animation.set_vertical(y); + this._animation.play(); + } else { + element.style.left = x + 'px'; + element.style.top = y + 'px'; + } + + this.raise_repositioned(Sys.EventArgs.Empty); + }, + + get_horizontalOffset: function() { + return this._horizontalOffset; + }, + get_HorizontalOffset: function() { + Sys.Extended.Deprecated("get_HorizontalOffset()", "get_horizontalOffset()"); + return this.get_horizontalOffset(); + }, + set_horizontalOffset: function(value) { + if(this._horizontalOffset != value) { + this._horizontalOffset = value; + this._reposition(); + this.raisePropertyChanged('HorizontalOffset'); + } + }, + set_HorizontalOffset: function(value) { + Sys.Extended.Deprecated("set_HorizontalOffset(value)", "set_horizontalOffset(value)"); + this.set_horizontalOffset(value); + }, + + get_horizontalSide: function() { + return this._horizontalSide; + }, + get_HorizontalSide: function() { + Sys.Extended.Deprecated("get_HorizontalSide()", "get_horizontalSide()"); + return this.get_horizontalSide(); + }, + set_horizontalSide: function(value) { + if(this._horizontalSide != value) { + this._horizontalSide = value; + this._reposition(); + this.raisePropertyChanged('HorizontalSide'); + } + }, + set_HorizontalSide: function(value) { + Sys.Extended.Deprecated("set_HorizontalSide(value)", "set_horizontalSide(value)"); + this.set_horizontalSide(value); + }, + + get_verticalOffset: function() { + return this._verticalOffset; + }, + get_VerticalOffset: function() { + Sys.Extended.Deprecated("get_VerticalOffset()", "get_verticalOffset()"); + return this.get_verticalOffset(); + }, + set_verticalOffset: function(value) { + if(this._verticalOffset != value) { + this._verticalOffset = value; + this._reposition(); + this.raisePropertyChanged('VerticalOffset'); + } + }, + set_VerticalOffset: function(value) { + Sys.Extended.Deprecated("set_VerticalOffset(value)", "set_verticalOffset(value)"); + this.set_verticalOffset(value); + }, + + get_verticalSide: function() { + return this._verticalSide; + }, + get_VerticalSide: function() { + Sys.Extended.Deprecated("get_VerticalSide()", "get_verticalSide()"); + return this.get_verticalSide(); + }, + set_verticalSide: function(value) { + if(this._verticalSide != value) { + this._verticalSide = value; + this._reposition(); + this.raisePropertyChanged('VerticalSide'); + } + }, + set_VerticalSide: function(value) { + Sys.Extended.Deprecated("set_VerticalSide(value)", "set_verticalSide(value)"); + this.set_verticalSide(value); + }, + + get_scrollEffectDuration: function() { + return this._scrollEffectDuration; + }, + get_ScrollEffectDuration: function() { + Sys.Extended.Deprecated("get_ScrollEffectDuration()", "get_scrollEffectDuration"); + return this.get_scrollEffectDuration(); + }, + set_scrollEffectDuration: function(value) { + if(this._scrollEffectDuration != value) { + this._scrollEffectDuration = value; + if(this._animation) { + this._animation.set_duration(value); + } + this.raisePropertyChanged('ScrollEffectDuration'); + } + }, + set_ScrollEffectDuration: function(value) { + Sys.Extended.Deprecated("set_ScrollEffectDuration(value)", "set_scrollEffectDuration(value)"); + this.set_scrollEffectDuration(value); + }, + + get_useAnimation: function() { + return this._animate; + }, + set_useAnimation: function(value) { + value |= (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7); + if(this._animate != value) { + this._animate = value; + this.raisePropertyChanged('useAnimation'); + } + }, + + /// + /// Fires before control reposition + /// + /// + /// + add_repositioning: function(handler) { + this.get_events().addHandler('repositioning', handler); + }, + remove_repositioning: function(handler) { + this.get_events().removeHandler('repositioning', handler); + }, + raise_repositioning: function(eventArgs) { + var handler = this.get_events().getHandler('repositioning'); + if(handler) { + handler(this, eventArgs); + } + }, + raiseRepositioning: function(eventArgs) { + Sys.Extended.Deprecated("raiseRepositioning(eventArgs)", "raise_repositioning(eventArgs)"); + this.raise_repositioning(eventArgs); + }, + + /// + /// Fires after control reposition + /// + /// + /// + add_repositioned: function(handler) { + this.get_events().addHandler('repositioned', handler); + }, + remove_repositioned: function(handler) { + this.get_events().removeHandler('repositioned', handler); + }, + raise_repositioned: function(eventArgs) { + var handler = this.get_events().getHandler('repositioned'); + if(handler) { + handler(this, eventArgs); + } + }, + raiseRepositioned: function(eventArgs) { + Sys.Extended.Deprecated("raiseRepositioned(eventArgs)", "raise_repositioned(eventArgs)"); + this.raise_repositioned(eventArgs); + } +} +Sys.Extended.UI.AlwaysVisibleControlBehavior.registerClass('Sys.Extended.UI.AlwaysVisibleControlBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Animation.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Animation.debug.js new file mode 100644 index 000000000..60ad603d9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Animation.debug.js @@ -0,0 +1,477 @@ +Type.registerNamespace('Sys.Extended.UI.Animation'); + +Sys.Extended.UI.Animation.AnimationBehavior = function(element) { + // The AnimationBehavior allows us to associate animations (described by JSON) with events and + // have them play when the events are fired. It relies heavily on the AJAX Control Toolkit + // animation framework provided in Animation.js, and the GenericAnimationBehavior defined below. + Sys.Extended.UI.Animation.AnimationBehavior.initializeBase(this, [element]); + + // Generic animation behaviors that automatically build animations from JSON descriptions + + /// + /// Generic OnLoad Animation's JSON definition. + /// Setting the OnLoad property will cause it to be played immediately + /// + /// get_onLoad + /// set_onLoad + /// + this._onLoad = null; + + /// + /// Generic OnClick Animation's JSON definition + /// + /// get_onClick + /// set_onClick + /// + this._onClick = null; + + /// + /// Generic OnMouseOver Animation's JSON definition + /// + /// get_onMouseOver + /// set_onMouseOver + /// + this._onMouseOver = null; + + /// + /// Generic OnMouseOut Animation's JSON definition + /// + /// get_onMouseOut + /// set_onMouseOut + /// + this._onMouseOut = null; + + /// + /// Generic OnHoverOver Animation's JSON definition + /// + /// get_onHoverOver + /// set_onHoverOver + /// + this._onHoverOver = null; + + /// + /// Generic OnHoverOut Animation's JSON definition + /// + /// get_onHoverOut + /// set_onHoverOut + /// + this._onHoverOut = null; + + // Handlers for the events + this._onClickHandler = null; + this._onMouseOverHandler = null; + this._onMouseOutHandler = null; +} +Sys.Extended.UI.Animation.AnimationBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.Animation.AnimationBehavior.callBaseMethod(this, 'initialize'); + + // Wireup the event handlers + var element = this.get_element(); + if(element) { + this._onClickHandler = Function.createDelegate(this, this.playOnClick); + $addHandler(element, 'click', this._onClickHandler); + this._onMouseOverHandler = Function.createDelegate(this, this.playOnMouseOver); + $addHandler(element, 'mouseover', this._onMouseOverHandler); + this._onMouseOutHandler = Function.createDelegate(this, this.playOnMouseOut); + $addHandler(element, 'mouseout', this._onMouseOutHandler); + } + }, + + dispose: function() { + // Remove the event handlers + var element = this.get_element(); + if(element) { + if(this._onClickHandler) { + $removeHandler(element, 'click', this._onClickHandler); + this._onClickHandler = null; + } + if(this._onMouseOverHandler) { + $removeHandler(element, 'mouseover', this._onMouseOverHandler); + this._onMouseOverHandler = null; + } + if(this._onMouseOutHandler) { + $removeHandler(element, 'mouseout', this._onMouseOutHandler); + this._onMouseOutHandler = null; + } + } + + // Wipe the behaviors (we don't need to dispose them because + // that will happen automatically in our base dispose) + this._onLoad = null; + this._onClick = null; + this._onMouseOver = null; + this._onMouseOut = null; + this._onHoverOver = null; + this._onHoverOut = null; + + Sys.Extended.UI.Animation.AnimationBehavior.callBaseMethod(this, 'dispose'); + }, + + get_onLoad: function() { + return this._onLoad ? this._onLoad.get_json() : null; + }, + get_OnLoad: function() { + Sys.Extended.Deprecated("get_OnLoad()", "get_onLoad()"); + return this.get_onLoad(); + }, + set_onLoad: function(value) { + if(!this._onLoad) { + this._onLoad = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onLoad.initialize(); + } + this._onLoad.set_json(value); + this.raisePropertyChanged('OnLoad'); + this._onLoad.play(); + }, + set_OnLoad: function(value) { + Sys.Extended.Deprecated("set_OnLoad(value)", "set_onLoad(value)"); + this.set_onLoad(value); + }, + + /// + /// Generic OnLoad Animation's behavior + /// + /// get_onLoadBehavior + /// + get_onLoadBehavior: function() { + return this._onLoad; + }, + get_OnLoadBehavior: function() { + Sys.Extended.Deprecated("get_OnLoadBehavior()", "get_OnLoadBehavior()"); + return this.get_onLoadBehavior(); + }, + + get_onClick: function() { + return this._onClick ? this._onClick.get_json() : null; + }, + get_OnClick: function() { + Sys.Extended.Deprecated("get_OnClick()", "get_onClick()"); + return this.get_onClick(); + }, + set_OnClick: function(value) { + Sys.Extended.Deprecated("set_OnClick(value)", "set_onClick(value)"); + this.set_onClick(value); + }, + set_onClick: function(value) { + if(!this._onClick) { + this._onClick = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onClick.initialize(); + } + this._onClick.set_json(value); + this.raisePropertyChanged('OnClick'); + }, + + /// + /// Generic OnClick Animation's behavior + /// + /// get_onClickBehavior + /// + get_onClickBehavior: function() { + return this._onClick; + }, + get_OnClickBehavior: function() { + Sys.Extended.Deprecated("get_OnClickBehavior()", "get_onClickBehavior()"); + return this.get_onClickBehavior(); + }, + + /// + /// Plays animation. + /// + /// + OnClick: function() { + Sys.Extended.Deprecated("OnClick()"); + this.playOnClick(); + }, + playOnClick: function() { + if(this._onClick) { + this._onClick.play(); + } + }, + + get_onMouseOver: function() { + return this._onMouseOver ? this._onMouseOver.get_json() : null; + }, + get_OnMouseOver: function() { + Sys.Extended.Deprecated("get_OnMouseOver()", "get_onMouseOver()"); + return this.get_onMouseOver(); + }, + set_onMouseOver: function(value) { + if(!this._onMouseOver) { + this._onMouseOver = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onMouseOver.initialize(); + } + this._onMouseOver.set_json(value); + this.raisePropertyChanged('OnMouseOver'); + }, + set_OnMouseOver: function(value) { + Sys.Extended.Deprecated("set_OnMouseOver(value)", "set_onMouseOver(value)"); + this.set_onMouseOver(value); + }, + + /// + /// Generic OnMouseOver Animation's behavior + /// + /// get_onLoadBehavior + /// + get_onMouseOverBehavior: function() { + return this._onMouseOver; + }, + get_OnMouseOverBehavior: function() { + Sys.Extended.Deprecated("get_OnMouseOverBehavior()", "get_onMouseOverBehavior()"); + }, + + /// + /// Plays OnMouseOver/OnHoverOver animations + /// + /// + OnMouseOver: function() { + Sys.Extended.Deprecated("OnMouseOver()"); + this.playOnMouseOver(); + }, + playOnMouseOver: function() { + // Private property to track whether a mouseOver event has already occured, and thus eliminate dups + if(this._mouseHasEntered) { + // This is an additional onMouseOver triggered by child content + return; + } + if(this._onMouseOver) { + this._onMouseOver.play(); + } + if(this._onHoverOver) { + if(this._onHoverOut) { + this._onHoverOut.quit(); + } + this._onHoverOver.play(); + } + this._mouseHasEntered = true; + }, + + + get_onMouseOut: function() { + return this._onMouseOut ? this._onMouseOut.get_json() : null; + }, + get_OnMouseOut: function() { + Sys.Extended.Deprecated("get_OnMouseOut()", "get_onMouseOut()"); + return this.get_onMouseOut(); + }, + set_onMouseOut: function(value) { + if(!this._onMouseOut) { + this._onMouseOut = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onMouseOut.initialize(); + } + this._onMouseOut.set_json(value); + this.raisePropertyChanged('OnMouseOut'); + }, + set_OnMouseOut: function(value) { + Sys.Extended.Deprecated("set_OnMouseOut(value)", "set_OnMouseOut(value)"); + this.set_onMouseOut(value); + }, + + /// + /// Generic OnMouseOut Animation's behavior + /// + /// get_onMouseOutBehavior + /// + get_onMouseOutBehavior: function() { + return this._onMouseOut; + }, + get_OnMouseOutBehavior: function() { + Sys.Extended.Deprecated("get_OnMouseOutBehavior()", "get_onMouseOutBehavior"); + return this.get_onMouseOutBehavior(); + }, + + /// + /// Plays OnMouseOver/OnHoverOver animations + /// + /// + OnMouseOut: function(e) { + Sys.Extended.Deprecated("OnMouseOut()"); + this.playOnMouseOut(); + }, + playOnMouseOut: function(e) { + var ev = e.rawEvent; + var pt = this.get_element(); + var tg = e.target; + if(tg.nodeName !== pt.nodeName) return; + + var rel = ev.relatedTarget || ev.toElement; + if(pt != rel && !this._isChild(pt, rel)) { + this._mouseHasEntered = false; + if(this._onMouseOut) { + this._onMouseOut.play(); + } + if(this._onHoverOut) { + if(this._onHoverOver) { + this._onHoverOver.quit(); + } + this._onHoverOut.play(); + } + } + }, + + _isChild: function(elmtA, elmtB) { + var body = document.body; + while(elmtB && elmtA != elmtB && body != elmtB) { + try { + elmtB = elmtB.parentNode; + } catch(e) { + // Firefox sometimes fires events for XUL elements, which throws + // a "permission denied" error. so this is not a child. + return false; + } + } + return elmtA == elmtB; + }, + get_onHoverOver: function() { + return this._onHoverOver ? this._onHoverOver.get_json() : null; + }, + get_OnHoverOver: function() { + Sys.Extended.Deprecated("get_OnHoverOver()", "get_onHoverOver"); + return this.get_onHoverOver(); + }, + set_onHoverOver: function(value) { + if(!this._onHoverOver) { + this._onHoverOver = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onHoverOver.initialize(); + } + this._onHoverOver.set_json(value); + this.raisePropertyChanged('OnHoverOver'); + }, + set_OnHoverOver: function(value) { + Sys.Extended.Deprecated("set_OnHoverOver(value)", "set_OnHoverOver(value)"); + this.set_onHoverOver(value); + }, + + /// + /// Generic OnHoverOver Animation's behavior + /// + /// get_onHoverOverBehavior + /// + get_onHoverOverBehavior: function() { + return this._onHoverOver; + }, + get_OnHoverOverBehavior: function() { + Sys.Extended.Deprecated("get_OnHoverOverBehavior()", "get_onHoverOverBehavior()"); + return this.get_onHoverOverBehavior(); + }, + + get_onHoverOut: function() { + return this._onHoverOut ? this._onHoverOut.get_json() : null; + }, + get_OnHoverOut: function() { + Sys.Extended.Deprecated("get_OnHoverOut()", "get_onHoverOut()"); + return this.get_onHoverOut(); + }, + set_onHoverOut: function(value) { + if(!this._onHoverOut) { + this._onHoverOut = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onHoverOut.initialize(); + } + this._onHoverOut.set_json(value); + this.raisePropertyChanged('OnHoverOut'); + }, + set_OnHoverOut: function(value) { + Sys.Extended.Deprecated("set_OnHoverOut(value)", "set_onHoverOut(value)"); + this.set_onHoverOut(value); + }, + + /// + /// Generic OnHoverOut Animation's behavior + /// + /// get_onHoverOverBehavior + /// + get_onHoverOutBehavior: function() { + return this._onHoverOut; + }, + get_OnHoverOutBehavior: function() { + Sys.Extended.Deprecated("get_OnHoverOutBehavior()", "get_onHoverOutBehavior()"); + return this.get_onHoverOutBehavior(); + } +} +Sys.Extended.UI.Animation.AnimationBehavior.registerClass('Sys.Extended.UI.Animation.AnimationBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.Animation.GenericAnimationBehavior = function(element) { + // The GenericAnimationBehavior handles the creation, playing, and disposing of animations + // created from a JSON description. As we intend to expose a lot of generic animations + // across the Toolkit, this behavior serves to simplify the amount of work required. + Sys.Extended.UI.Animation.GenericAnimationBehavior.initializeBase(this, [element]); + + // JSON description of the animation that will be used to create it + this._json = null; + + // Animation created from the JSON description that will be played + this._animation = null; +} +Sys.Extended.UI.Animation.GenericAnimationBehavior.prototype = { + dispose: function() { + // Dispose the behavior and its animation + this.disposeAnimation(); + Sys.Extended.UI.Animation.GenericAnimationBehavior.callBaseMethod(this, 'dispose'); + }, + + disposeAnimation: function() { + if(this._animation) { + this._animation.dispose(); + } + this._animation = null; + }, + + play: function() { + // Play the animation if it isn't already playing. If it's already playing, this does nothing. + if(this._animation && !this._animation.get_isPlaying()) { + this.stop(); + this._animation.play(); + } + }, + + stop: function() { + if(this._animation) { + if(this._animation.get_isPlaying()) { + this._animation.stop(true); + } + } + }, + + quit: function() { + // Quit playing the animation without updating the final state (i.e. if + // the animation was moving, this would leave it in the middle of its path). + // This differs from the stop function which will update the final state. The + // quit function is most useful for scenarios where you're toggling back and forth + // between two animations (like those used in OnHoverOver/OnHoverOut) and you don't + // want to completely finish one animation if its counterpart is triggered. + if(this._animation) { + if(this._animation.get_isPlaying()) { + this._animation.stop(false); + } + } + }, + + get_json: function() { + return this._json; + }, + set_json: function(value) { + // Only wipe and rebuild if they're changing the value + if(this._json != value) { + this._json = value; + this.raisePropertyChanged('json'); + + // Build the new animation + this.disposeAnimation(); + var element = this.get_element(); + if(element) { + this._animation = Sys.Extended.UI.Animation.buildAnimation(this._json, element); + if(this._animation) { + this._animation.initialize(); + } + this.raisePropertyChanged('animation'); + } + } + }, + + get_animation: function() { + // Animation created from the JSON description + return this._animation; + } +} +Sys.Extended.UI.Animation.GenericAnimationBehavior.registerClass('Sys.Extended.UI.Animation.GenericAnimationBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js new file mode 100644 index 000000000..de48097d4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js @@ -0,0 +1,2418 @@ +Type.registerNamespace('Sys.Extended.UI.Animation'); + +// Create an alias for the namespace to save 25 chars each time it's used since +// this is a very long script and will take awhile to download +$AA = Sys.Extended.UI.Animation; + +$AA.registerAnimation = function(name, type) { + // Register an animation with the AJAX Control Toolkit animation framework. This serves a dual purpose: + // 1) to add standard utility methods to the animation type (such as a play method that creates + // an animation, plays it, and disposes it when the animation is over), and 2) to associate a name with the + // type that will be used when creating animations from a JSON description. This method can also be called + // by other animation libraries to seamlessly interoperate with the AJAX Control Toolkit's animation + // framework. + // + // "name" - name of the animation that will be used as the XML tag name in the XML animation description. It + // should be a valid XML tag (i.e. an alpha-numeric sequence with no spaces, special characters, etc.). + // Make sure the type inherits from Sys.Extended.UI.Animation.Animation + if(type && ((type === $AA.Animation) || (type.inheritsFrom && type.inheritsFrom($AA.Animation)))) { + // We'll store the animation name/type mapping in a "static" object off of + // Sys.Extended.UI.Animation. If this __animations object hasn't been + // created yet, demand create it on the first registration. + if(!$AA.__animations) { + $AA.__animations = {}; + } + + // Add the current type to the collection of animations + $AA.__animations[name.toLowerCase()] = type; + + // Add a play function that will make it very easy to create, play, and + // dispose of an animation. This is effectively a "static" function on + // each animation and will take the same parameters as that animation's + // constructor. + type.play = function() { + // Create an animation, play it immediately, and dispose it when finished. + // The play function takes the same parameters as the type's constructor + + // Create and initialize a new animation of the right type and pass in + // any arguments given to the play function + var animation = new type(); + type.apply(animation, arguments); + animation.initialize(); + + // Add an event handler to dispose the animation when it's finished + var handler = Function.createDelegate(animation, + function() { + // Dispose the animation after playing + animation.remove_ended(handler); + handler = null; + animation.dispose(); + }); + animation.add_ended(handler); + + // Once the animation has been created and initialized, play it and + // dispose it as soon as it's finished + animation.play(); + } + } else { + // Raise an error if someone registers an animation that doesn't inherit + // from our base Animation class + throw Error.argumentType('type', type, $AA.Animation, Sys.Extended.UI.Resources.Animation_InvalidBaseType); + } +} + +$AA.buildAnimation = function(json, defaultTarget) { + // The buildAnimation function is used to turn a JSON animation description + // into an actual animation object that can be played. + // + // "json" - JSON description of the animation in the format expected by createAnimation + // "defaultTarget" - target of the animation if none is specified in the JSON description. The semantics of + // target assignment are provided in more detail in createAnimation. + + // Ensure we have a description to create an animation with + if(!json || json === '') { + return null; + } + + // "Parse" the JSON so we can easily manipulate it + // (we don't wrap it in a try/catch when debugging to raise any errors) + var obj; + json = '(' + json + ')'; + if(!Sys.Debug.isDebug) { + try { obj = Sys.Serialization.JavaScriptSerializer.deserialize(json); } catch(ex) { } + } else { + obj = Sys.Serialization.JavaScriptSerializer.deserialize(json); + } + + // Create a new instance of the animation + return $AA.createAnimation(obj, defaultTarget); +} + +$AA.createAnimation = function(obj, defaultTarget) { + // The createAnimation function builds a new Sys.Extended.UI.Animation.Animation instance from an object + // that describes it. + // Exceptions are thrown when the AnimationName cannot be found. Also, + // any exceptions raised by setting properties or providing properties with invalid + // names will only be raised when debugging. + // + // "obj" - the object provides a description of the animation to be be generated in + // a very specific format. It has two special properties: AnimationName + // and AnimationChildren. The AnimationName is required + // and used to find the type of animation to create (this name should map to + // one of the animation names supplied to registerAnimation). The + // AnimationChildren property supplies an optional array for + // animations that use child animations (such as + // Sys.Extended.UI.Animation.ParallelAnimation and + // Sys.Extended.UI.Animation.SequenceAnimation). The elements of + // the AnimationChildren array are valid + // Sys.Extended.UI.Animation.Animation objects that meet these same + // requirements. In order for an animation to support child animations, it must + // derive from the Sys.Extended.UI.Animation.ParentAnimation class + // which provides common methods like add, clear, etc. The + // remaining properties of the object are used to set parameters specific to the type + // of animation being created (e.g. duration, minimumOpacity, + // startValue, etc.) and should have a corresponding property on the + // animation. You can also assign an arbitrary JavaScript expression to any property + // by adding 'Script' to the end of its name (i.e., Height="70" can be replaced by + // HeightScript="$get('myElement').offsetHeight") and have the property set to the + // result of evaluating the expression before the animation is played each time. + // "defaultTarget" - the function also takes a defaultTarget parameter that is used as the + // target of the animation if the object does not specify one. This parameter should be + // an instance of Sys.UI.DomElement and not just the name of an element. + + // Create a default instance of the animation by looking up the AnimationName + // in the global __animations object. + if(!obj || !obj.AnimationName) { + throw Error.argument('obj', Sys.Extended.UI.Resources.Animation_MissingAnimationName); + } + var type = $AA.__animations[obj.AnimationName.toLowerCase()]; + if(!type) { + throw Error.argument('type', String.format(Sys.Extended.UI.Resources.Animation_UknownAnimationName, obj.AnimationName)); + } + var animation = new type(); + + // Set the animation's target if provided via defaultTarget (note that setting + // it via AnimationTarget will happen during the regular property setting phase) + if(defaultTarget) { + animation.set_target(defaultTarget); + } + + // If there is an AnimationChildren array and the animation inherits from + // ParentAnimation, then we will recusively build the child animations. It is + // important that we create the child animations before setting the animation's + // properties or initializing (because some properties and initialization may be + // propogated down from parent to child). + if(obj.AnimationChildren && obj.AnimationChildren.length) { + if($AA.ParentAnimation.isInstanceOfType(animation)) { + for(var i = 0; i < obj.AnimationChildren.length; i++) { + var child = $AA.createAnimation(obj.AnimationChildren[i]); + if(child) { + animation.add(child); + } + } + } else { + throw Error.argument('obj', String.format(Sys.Extended.UI.Resources.Animation_ChildrenNotAllowed, type.getName())); + } + } + + // Get the list of all properties available to set on the current animation's + // type. We create a mapping from the property's lowercase friendly name + // (i.e., "duration") to the name of its setter (i.e., "set_duration"). This is + // essentialy in setting properties so we only copy over valid values. + var properties = type.__animationProperties; + if(!properties) { + // Get the properties for this type by walking its prototype - by doing + // this we'll effectively ignore anything not defined in the prototype + type.__animationProperties = {}; + type.resolveInheritance(); + for(var name in type.prototype) { + if(name.startsWith('set_')) { + type.__animationProperties[name.substr(4).toLowerCase()] = name; + } + } + + // Remove the 'id' property as it shouldn't be set by the animation + // (NOTE: the 'target' proeprty shouldn't be set to a string value, but it + // isn't removed because it can be used as a valid dynamic property - i.e. + // Target="myElement" *DOES NOT WORK*, but it's OKAY to use + // TargetScript="$get('myElement')". Validation for this scenario will be + // handled automatically by _validateParams when debugging as Target is required + // to be a dom element.) + delete type.__animationProperties['id']; + properties = type.__animationProperties; + } + + // Loop through each of the properties in the object and check if it's in the list + // of valid property names. We will check the type of the propertyName to make sure + // it's a String (as other types can be added by the ASP.NET AJAX compatability + // layers to all objects and cause errors if you don't exclude them). We will first + // try to set a property with the same name if it exists. If we can't find one but + // the name of the property ends in 'script', then we will try to set a corresponding + // dynamic property. If no matches can be found at all, we'll raise an error when + // debugging. + for(var property in obj) { + // Ignore the special properties in the object that don't correspond + // to any actual properties on the animation + var prop = property.toLowerCase(); + if(prop == 'animationname' || prop == 'animationchildren') { + continue; + } + + var value = obj[property]; + + // Try to directly set the value of this property + var setter = properties[prop]; + if(setter && String.isInstanceOfType(setter) && animation[setter]) { + // Ignore any exceptions raised by setting the property + // unless we're debugging + if(!Sys.Debug.isDebug) { + try { animation[setter](value); } catch(ex) { } + } else { + animation[setter](value); + } + } else { + // Try to set the value of a dynamic property + if(prop.endsWith('script')) { + setter = properties[prop.substr(0, property.length - 6)]; + if(setter && String.isInstanceOfType(setter) && animation[setter]) { + animation.DynamicProperties[setter] = value; + } else if(Sys.Debug.isDebug) { + // Raise an error when debugging if we could not find a matching property + throw Error.argument('obj', String.format(Sys.Extended.UI.Resources.Animation_NoDynamicPropertyFound, property, property.substr(0, property.length - 5))); + } + } else if(Sys.Debug.isDebug) { + // Raise an error when debugging if we could not find a matching property + throw Error.argument('obj', String.format(Sys.Extended.UI.Resources.Animation_NoPropertyFound, property)); + } + } + } + + return animation; +} + +// In the Xml comments for each of the animations below, there is a special tag +// that describes how the animation is referenced from a generic XML animation description + +$AA.Animation = function(target, duration, fps) { + // Animation is an abstract base class used as a starting point for all the other animations. + // It provides the basic mechanics for the animation (playing, pausing, stopping, timing, etc.) + // and leaves the actual animation to be done in the abstract methods getAnimatedValue + // and setValue. + // Animations need to be as fast as possible - even in debug mode. Don't add validation code to + // methods involved in every step of the animation. + // + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // + // The DynamicProperties collection is used to associate JavaScript expressions with + // properties. The expressions are evaluated just before the animation is played + // everytime (in the base onStart method). The object itself maps strings with the + // names of property setters (like "set_verticalOffset") to JavaScript expressions + // (like "$find('MyBehavior').get_element().offsetHeight"). Note specifically that + // the dynamic properties are JavaScript expressions and not abitrary statements (i.e. + // you can't include things like "return foo;"), although you can include anything + // inside an anonymous function definition that you immediately invoke (i.e., + // "(function() { return foo; })()"). A dynamic property can be set in the generic + // XML animation description by appending Script onto any legitimate property name + // (for example, instead of Height="70" we could use + // HeightScript="$find('MyBehavior').get_element().offsetHeight"). Any exceptions + // raised when setting dynamic properties (including both JavaScript evaluation errors + // and other exceptions raised by property setters) will only be propogated when + // debugging. + + $AA.Animation.initializeBase(this); + + // Length of the animation in seconds + this._duration = 1; + + // Number of steps per second + this._fps = 25; + + // Target Sys.UI.DomElement of the animation + this._target = null; + + // Tick event handler + this._tickHandler = null; + + // Animation timer + this._timer = null; + + // Percentage of the animation already played + this._percentComplete = 0; + + // Percentage of the animation to play on each step + this._percentDelta = null; + + // Reference to the animation that owns this animation (currently only set in + // ParallelAnimation.add). This concept of ownership allows an entire animation + // subtree to be driven off a single timer so all the operations are properly + // synchronized. + this._owner = null; + + // Reference to the animation that contains this as a child (this is set + // in ParentAnimation.add). The primary use of the parent animation is in + // resolving the animation target when one isn't specified. + this._parentAnimation = null; + + // The DynamicProperties collection is used to associate JavaScript expressions with + // properties. The expressions are evaluated just before the animation is played + // everytime (in the base onStart method). See the additional information in the + // XML comment above. + this.DynamicProperties = {}; + + // Set the target, duration, and fps if they were provided in the constructor + if(target) { + this.set_target(target); + } + if(duration) { + this.set_duration(duration); + } + if(fps) { + this.set_fps(fps); + } +} + +$AA.Animation.prototype = { + dispose: function() { + if(this._timer) { + this._timer.dispose(); + this._timer = null; + } + + this._tickHandler = null; + this._target = null; + + $AA.Animation.callBaseMethod(this, 'dispose'); + }, + + play: function() { + // Play the animation from the beginning or where it was left off when paused. + // If this animation is the child of another, you must call play on its parent instead. + + // If ownership of this animation has been claimed, then we'll require the parent to + // handle playing the animation (this is very important because then the entire animation + // tree runs on the same timer and updates consistently) + if(!this._owner) { + var resume = true; + if(!this._timer) { + resume = false; + + if(!this._tickHandler) { + this._tickHandler = Function.createDelegate(this, this._onTimerTick); + } + + this._timer = new Sys.Timer(); + this._timer.add_tick(this._tickHandler); + + this.onStart(); + + this._timer.set_interval(1000 / this._fps); + this._percentDelta = 100 / (this._duration * this._fps); + this._updatePercentComplete(0, true); + } + + this._timer.set_enabled(true); + + this.raisePropertyChanged('isPlaying'); + if(!resume) { + this.raisePropertyChanged('isActive'); + } + } + }, + + pause: function() { + // Pause the animation if it is playing. Calling play will resume where + // the animation left off. + // If this animation is the child of another, you must call pause on its parent instead. + + if(!this._owner) { + if(this._timer) { + this._timer.set_enabled(false); + + this.raisePropertyChanged('isPlaying'); + } + } + }, + + stop: function(finish) { + // Stop playing the animation. + // If this animation is the child of another, you must call stop on + // its parent instead. + // + // "finish" - Whether or not stopping the animation should leave the target element in a state + // consistent with the animation playing completely by performing the last step. + // The default value is true. + + if(!this._owner) { + var t = this._timer; + this._timer = null; + if(t) { + t.dispose(); + + if(this._percentComplete !== 100) { + this._percentComplete = 100; + this.raisePropertyChanged('percentComplete'); + if(finish || finish === undefined) { + this.onStep(100); + } + } + this.onEnd(); + + this.raisePropertyChanged('isPlaying'); + this.raisePropertyChanged('isActive'); + } + } + }, + + onStart: function() { + // The onStart method is called just before the animation is played each time. + this.raiseStarted(); + + // Initialize any dynamic properties + for(var property in this.DynamicProperties) { + try { + // Invoke the property's setter on the evaluated expression + this[property](eval(this.DynamicProperties[property])); + } catch(ex) { + // Propogate any exceptions if we're debugging, otherwise eat them + if(Sys.Debug.isDebug) { + throw ex; + } + } + } + }, + + onStep: function(percentage) { + // The onStep method is called repeatedly to progress the animation through each frame + // + // "percentage" - percentage of the animation already complete + this.setValue(this.getAnimatedValue(percentage)); + this.raiseStep(); + }, + + onEnd: function() { + this.raiseEnded(); + }, + + getAnimatedValue: function(percentage) { + // Determine the state of the animation after the given percentage of its duration has elapsed + // Returns state of the animation after the given percentage of its duration has elapsed that will + // be passed to setValue + // + // "percentage" - percentage of the animation already complete + + throw Error.notImplemented(); + }, + + setValue: function(value) { + // Set the current state of the animation + // Returns current state of the animation (as retreived from getAnimatedValue) + throw Error.notImplemented(); + }, + + interpolate: function(start, end, percentage) { + // The interpolate function is used to find the appropriate value between starting and + // ending values given the current percentage. + // In the future, we hope to make several implementations of this available so we can dynamically + // change the apparent speed of the animations, although it may make more sense to modify the + // _updatePercentComplete function instead. + // Returns the desired percentage between the start and end values + // + // "start"- start of the range to interpolate + // "end" - end of the range to interpolate + // "percentage" - percentage completed in the range to interpolate + + return start + (end - start) * (percentage / 100); + }, + + _onTimerTick: function() { + // Handler for the tick event to move the animation along through its duration + this._updatePercentComplete(this._percentComplete + this._percentDelta, true); + }, + + _updatePercentComplete: function(percentComplete, animate) { + // Update the animation and its target given the current percentage of its duration that + // has already elapsed + // + // "percentComplete" - percentage of the animation duration that has already elapsed + // "animate" - whether or not updating the animation should visually modify the animation's target + + if(percentComplete > 100) { + percentComplete = 100; + } + + this._percentComplete = percentComplete; + this.raisePropertyChanged('percentComplete'); + + if(animate) { + this.onStep(percentComplete); + } + + if(percentComplete === 100) { + this.stop(false); + } + }, + + setOwner: function(owner) { + // Make this animation the child of another animation + // + // "owner" - parent animation + this._owner = owner; + }, + + raiseStarted: function() { + var handlers = this.get_events().getHandler('started'); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + + add_started: function(handler) { + this.get_events().addHandler("started", handler); + }, + + remove_started: function(handler) { + this.get_events().removeHandler("started", handler); + }, + + raiseEnded: function() { + var handlers = this.get_events().getHandler('ended'); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + + add_ended: function(handler) { + this.get_events().addHandler("ended", handler); + }, + + remove_ended: function(handler) { + this.get_events().removeHandler("ended", handler); + }, + + raiseStep: function() { + var handlers = this.get_events().getHandler('step'); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + + add_step: function(handler) { + this.get_events().addHandler("step", handler); + }, + + remove_step: function(handler) { + this.get_events().removeHandler("step", handler); + }, + + get_target: function() { + // Target of the animation. If the target of this animation is null and + // the animation has a parent, then it will recursively use the target of + // the parent animation instead. + // Do not set this property in a generic Xml animation description. It should be set + // using either the extender's TargetControlID or the AnimationTarget property (the latter + // maps to Sys.Extended.UI.Animation.set_animationTarget). The only valid way to + // set this property in the generic Xml animation description is to use the dynamic + // property TargetScript="$get('myElement')". + if(!this._target && this._parentAnimation) { + return this._parentAnimation.get_target(); + } + return this._target; + }, + set_target: function(value) { + if(this._target != value) { + this._target = value; + this.raisePropertyChanged('target'); + } + }, + + set_animationTarget: function(id) { + // ID of a Sys.UI.DomElement or Sys.UI.Control to use as the target of the animation + // If no Sys.UI.DomElement or Sys.UI.Control can be found for the given ID, an + // argument exception will be thrown. + + // Try to find a Sys.UI.DomElement + var target = null; + var element = $get(id); + if(element) { + target = element; + } else { + // Try to find the control in the AJAX controls collection + var ctrl = $find(id); + if(ctrl) { + element = ctrl.get_element(); + if(element) { + target = element; + } + } + } + + // Use the new target if we have one, or raise an error if not + if(target) { + this.set_target(target); + } else { + throw Error.argument('id', String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound, id)); + } + }, + + get_duration: function() { + // Length of the animation in seconds. The default is 1. + return this._duration; + }, + set_duration: function(value) { + value = this._getFloat(value); + if(this._duration != value) { + this._duration = value; + this.raisePropertyChanged('duration'); + } + }, + + get_fps: function() { + // Number of steps per second. The default is 25. + return this._fps; + }, + set_fps: function(value) { + value = this._getInteger(value); + if(this.fps != value) { + this._fps = value; + this.raisePropertyChanged('fps'); + } + }, + + get_isActive: function() { + return (this._timer !== null); + }, + + get_isPlaying: function() { + return (this._timer !== null) && this._timer.get_enabled(); + }, + + get_percentComplete: function() { + return this._percentComplete; + }, + + _getBoolean: function(value) { + if(String.isInstanceOfType(value)) { + return Boolean.parse(value); + } + return value; + }, + + _getInteger: function(value) { + if(String.isInstanceOfType(value)) { + return parseInt(value); + } + return value; + }, + + _getFloat: function(value) { + if(String.isInstanceOfType(value)) { + return parseFloat(value); + } + return value; + }, + + _getEnum: function(value, type) { + // Helper to convert strings to enum values for property setters + // Returns value that has been converted if it was a string + // + // "value" - value to convert if it's a string + // "type" - type of the enum to convert to + + if(String.isInstanceOfType(value) && type && type.parse) { + return type.parse(value); + } + return value; + } +} +$AA.Animation.registerClass('Sys.Extended.UI.Animation.Animation', Sys.Component); +$AA.registerAnimation('animation', $AA.Animation); + + +$AA.ParentAnimation = function(target, duration, fps, animations) { + // The ParentAnimation serves as a base class for all animations that contain children (such as + // Sys.Extended.UI.Animation.ParallelAnimation, Sys.Extended.UI.SequenceAnimation, + // etc.). It does not actually play the animations, so any classes that inherit from it must do so. Any animation + // that requires nested child animations must inherit from this class, although it will likely want to inherit off of + // Sys.Extended.UI.Animation.ParallelAnimation or Sys.Extended.UI.SequenceAnimation + // which will actually play their child animations. + // + // "target"- target of the animation + // "duration"- length of the animation in seconds. he default is 1. + // "fps" - number of steps per second. The default is 25. + // "animations" - array of child animations to be played + $AA.ParentAnimation.initializeBase(this, [target, duration, fps]); + + // Array of child animations (there are no assumptions placed on order because + // it will matter for some derived animations like SequenceAnimation, but not + // for others like ParallelAnimation) that is demand created in add + this._animations = []; + + // Add any child animations passed into the constructor + if(animations && animations.length) { + for(var i = 0; i < animations.length; i++) { + this.add(animations[i]); + } + } +} +$AA.ParentAnimation.prototype = { + initialize: function() { + // Initialize the parent along with any child animations that have not yet been initialized themselves + $AA.ParentAnimation.callBaseMethod(this, 'initialize'); + + // Initialize all the uninitialized child animations + if(this._animations) { + for(var i = 0; i < this._animations.length; i++) { + var animation = this._animations[i]; + if(animation && !animation.get_isInitialized) { + animation.initialize(); + } + } + } + }, + + dispose: function() { + this.clear(); + this._animations = null; + $AA.ParentAnimation.callBaseMethod(this, 'dispose'); + }, + + get_animations: function() { + // Array of child animations to be played (there are no assumptions placed on order because it will matter for some + // derived animations like Sys.Extended.UI.Animation.SequenceAnimation, but not for + // others like Sys.Extended.UI.Animation.ParallelAnimation). To manipulate the child + // animations, use the functions add, clear, remove, and removeAt. + return this._animations; + }, + + add: function(animation) { + // Add an animation as a child of this animation. + // + // "animation" - child animation to add + if(this._animations) { + if(animation) { + animation._parentAnimation = this; + } + Array.add(this._animations, animation); + this.raisePropertyChanged('animations'); + } + }, + + remove: function(animation) { + // Remove the animation from the array of child animations. + // This will dispose the removed animation. + // + // "animation" - child animation to remove + + if(this._animations) { + if(animation) { + animation.dispose(); + } + Array.remove(this._animations, animation); + this.raisePropertyChanged('animations'); + } + }, + + removeAt: function(index) { + // Remove the animation at a given index from the array of child animations. + // + // "index" - Index of the child animation to remove + if(this._animations) { + var animation = this._animations[index]; + if(animation) { + animation.dispose(); + } + Array.removeAt(this._animations, index); + this.raisePropertyChanged('animations'); + } + }, + + clear: function() { + // Clear the array of child animations. + // This will dispose the cleared child animations. + if(this._animations) { + for(var i = this._animations.length - 1; i >= 0; i--) { + this._animations[i].dispose(); + this._animations[i] = null; + } + Array.clear(this._animations); + this._animations = []; + this.raisePropertyChanged('animations'); + } + } +} +$AA.ParentAnimation.registerClass('Sys.Extended.UI.Animation.ParentAnimation', $AA.Animation); +$AA.registerAnimation('parent', $AA.ParentAnimation); + + +$AA.ParallelAnimation = function(target, duration, fps, animations) { + // The ParallelAnimation plays several animations simultaneously. It inherits from + // Sys.Extended.UI.Animation.ParentAnimation, but makes itself the owner of all + // its child animations to allow the use a single timer and syncrhonization mechanisms shared with + // all the children (in other words, the duration properties of any child animations + // are ignored in favor of the parent's duration). It is very useful in creating + // sophisticated effects through combination of simpler animations. + // + // "target"- target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "animations" - array of child animations + $AA.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]); +} +$AA.ParallelAnimation.prototype = { + add: function(animation) { + // Add an animation as a child of this animation and make ourselves its owner. + // + // "animation" - child animation to add + + $AA.ParallelAnimation.callBaseMethod(this, 'add', [animation]); + animation.setOwner(this); + }, + + onStart: function() { + // Get the child animations ready to play + $AA.ParallelAnimation.callBaseMethod(this, 'onStart'); + var animations = this.get_animations(); + for(var i = 0; i < animations.length; i++) { + animations[i].onStart(); + } + }, + + onStep: function(percentage) { + // Progress the child animations through each frame + // + // "percentage" - percentage of the animation already complete + var animations = this.get_animations(); + for(var i = 0; i < animations.length; i++) { + animations[i].onStep(percentage); + } + }, + + onEnd: function() { + // Finish playing all of the child animations + var animations = this.get_animations(); + for(var i = 0; i < animations.length; i++) { + animations[i].onEnd(); + } + $AA.ParallelAnimation.callBaseMethod(this, 'onEnd'); + } +} +$AA.ParallelAnimation.registerClass('Sys.Extended.UI.Animation.ParallelAnimation', $AA.ParentAnimation); +$AA.registerAnimation('parallel', $AA.ParallelAnimation); + + +$AA.SequenceAnimation = function(target, duration, fps, animations, iterations) { + // The SequenceAnimation runs several animations one after the other. It can also + // repeat the sequence of animations for a specified number of iterations (which defaults to a + // single iteration, but will repeat forever if you specify zero or less iterations). Also, the + // SequenceAnimation cannot be a child of a Sys.Extended.UI.Animation.ParallelAnimation + // (or any animation inheriting from it). + // The SequenceAnimation ignores the duration and fps + // properties, and will let each of its child animations use any settings they please. + // + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps"- number of steps per second. The default is 25. + // "animations" - array of child animations + // "iterations" - number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence + // will repeat forever. The default value is 1 iteration. + + $AA.SequenceAnimation.initializeBase(this, [target, duration, fps, animations]); + + // Handler used to determine when an animation has finished + this._handler = null; + + // Flags to note whether we're playing, paused, or stopped + this._paused = false; + this._playing = false; + + // Index of the currently executing animation in the sequence + this._index = 0; + + // Counter used when playing the animation to determine the remaining number of times to play the entire sequence + this._remainingIterations = 0; + + // Number of iterations + this._iterations = (iterations !== undefined) ? iterations : 1; +} +$AA.SequenceAnimation.prototype = { + dispose: function() { + this._handler = null; + $AA.SequenceAnimation.callBaseMethod(this, 'dispose'); + }, + + stop: function() { + // Stop playing the entire sequence of animations + // Stopping this animation will perform the last step of each child animation, thereby leaving their + // target elements in a state consistent with the animation playing completely. If this animation is + // the child of another, you must call stop on its parent instead. + + if(this._playing) { + var animations = this.get_animations(); + if(this._index < animations.length) { + // Remove the handler from the currently running animation + animations[this._index].remove_ended(this._handler); + // Call stop on all remaining animations to ensure their + // effects will be seen + for(var i = this._index; i < animations.length; i++) { + animations[i].stop(); + } + } + this._playing = false; + this._paused = false; + this.raisePropertyChanged('isPlaying'); + this.onEnd(); + } + }, + + pause: function() { + // Pause the animation if it is playing. Calling play will resume where + // the animation left off. + // If this animation is the child of another, you must call pause on its parent instead. + if(this.get_isPlaying()) { + var current = this.get_animations()[this._index]; + if(current != null) { + current.pause(); + } + this._paused = true; + this.raisePropertyChanged('isPlaying'); + } + }, + + play: function() { + // Play the sequence of animations from the beginning or where it was left off when paused + // If this animation is the child of another, you must call play on its parent instead + + var animations = this.get_animations(); + if(!this._playing) { + this._playing = true; + if(this._paused) { + this._paused = false; + var current = animations[this._index]; + if(current != null) { + current.play(); + this.raisePropertyChanged('isPlaying'); + } + } else { + this.onStart(); + // Reset the index and attach the handler to the first + this._index = 0; + var first = animations[this._index]; + if(first) { + first.add_ended(this._handler); + first.play(); + this.raisePropertyChanged('isPlaying'); + } else { + this.stop(); + } + } + } + }, + + onStart: function() { + // The onStart method is called just before the animation is played each time + $AA.SequenceAnimation.callBaseMethod(this, 'onStart'); + this._remainingIterations = this._iterations - 1; + + // Create the handler we attach to each animation as it plays to determine when we've finished with it + if(!this._handler) { + this._handler = Function.createDelegate(this, this._onEndAnimation); + } + }, + + _onEndAnimation: function() { + // Wait for the end of each animation, and then continue by playing the other animations remaining + // in the sequence. Stop when it reaches the last animation and there are no remaining iterations. + + // Remove the handler from the current animation + var animations = this.get_animations(); + var current = animations[this._index++]; + if(current) { + current.remove_ended(this._handler); + } + + // Keep running animations and stop when we're out + if(this._index < animations.length) { + var next = animations[this._index]; + next.add_ended(this._handler); + next.play(); + } else if(this._remainingIterations >= 1 || this._iterations <= 0) { + this._remainingIterations--; + this._index = 0; + var first = animations[0]; + first.add_ended(this._handler); + first.play(); + } else { + this.stop(); + } + }, + + onStep: function(percentage) { + // Raises an invalid operation exception because this will only be called if a SequenceAnimation + // has been nested inside an (or a derived type). + // "percentage" - percentage of the animation already complete + throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence); + }, + + onEnd: function() { + // The onEnd method is called just after the animation is played each time. + this._remainingIterations = 0; + $AA.SequenceAnimation.callBaseMethod(this, 'onEnd'); + }, + + get_isActive: function() { + return true; + }, + + get_isPlaying: function() { + return this._playing && !this._paused; + }, + + get_iterations: function() { + // Number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence + // will repeat forever. The default value is 1 iteration. + return this._iterations; + }, + set_iterations: function(value) { + value = this._getInteger(value); + if(this._iterations != value) { + this._iterations = value; + this.raisePropertyChanged('iterations'); + } + }, + + get_isInfinite: function() { + return this._iterations <= 0; + } +} +$AA.SequenceAnimation.registerClass('Sys.Extended.UI.Animation.SequenceAnimation', $AA.ParentAnimation); +$AA.registerAnimation('sequence', $AA.SequenceAnimation); + + +$AA.SelectionAnimation = function(target, duration, fps, animations) { + // The SelectionAnimation will run a single animation chosen from of its child animations. It is + // important to note that the SelectionAnimation ignores the duration and fps + // properties, and will let each of its child animations use any settings they please. This is a base class with no + // functional implementation, so consider using ConditionAnimation or CaseAnimation instead. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "animations" - array of child animations + $AA.SelectionAnimation.initializeBase(this, [target, duration, fps, animations]); + + // Index of the animation selected to play + this._selectedIndex = -1; + + // Reference to the animation selected to play + this._selected = null; +} +$AA.SelectionAnimation.prototype = { + getSelectedIndex: function() { + // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of + // the child animations array, then nothing is played. + // returns index of the selected child animation to play + throw Error.notImplemented(); + }, + + onStart: function() { + // The onStart method is called just before the animation is played each time. + $AA.SelectionAnimation.callBaseMethod(this, 'onStart'); + + var animations = this.get_animations(); + this._selectedIndex = this.getSelectedIndex(); + if(this._selectedIndex >= 0 && this._selectedIndex < animations.length) { + this._selected = animations[this._selectedIndex]; + if(this._selected) { + this._selected.setOwner(this); + this._selected.onStart(); + } + } + }, + + onStep: function(percentage) { + // The onStep method is called repeatedly to progress the animation through each frame + // "percentage" - percentage of the animation already complete + if(this._selected) { + this._selected.onStep(percentage); + } + }, + + onEnd: function() { + // The onEnd method is called just after the animation is played each time. + if(this._selected) { + this._selected.onEnd(); + this._selected.setOwner(null); + } + this._selected = null; + this._selectedIndex = null; + $AA.SelectionAnimation.callBaseMethod(this, 'onEnd'); + } +} +$AA.SelectionAnimation.registerClass('Sys.Extended.UI.Animation.SelectionAnimation', $AA.ParentAnimation); +$AA.registerAnimation('selection', $AA.SelectionAnimation); + + +$AA.ConditionAnimation = function(target, duration, fps, animations, conditionScript) { + // The ConditionAnimation is used as a control structure to play a specific child animation + // depending on the result of executing the conditionScript. If the conditionScript + // evaluates to true, the first child animation is played. If it evaluates to false, + // the second child animation is played (although nothing is played if a second animation is not present). + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "animations" - array of child animations + // "conditionScript" - javaScript that should evaluate to true or false to determine which child + // animation to play. + $AA.ConditionAnimation.initializeBase(this, [target, duration, fps, animations]); + + // Condition to determine which index we will play + this._conditionScript = conditionScript; +} +$AA.ConditionAnimation.prototype = { + getSelectedIndex: function() { + // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of + // the child animations array, then nothing is played. + // returns index of the selected child animation to play + var selected = -1; + if(this._conditionScript && this._conditionScript.length > 0) { + try { + selected = eval(this._conditionScript) ? 0 : 1; + } catch(ex) { + } + } + return selected; + }, + + get_conditionScript: function() { + // JavaScript that should evaluate to true or false to determine which + // child animation to play. + return this._conditionScript; + }, + set_conditionScript: function(value) { + if(this._conditionScript != value) { + this._conditionScript = value; + this.raisePropertyChanged('conditionScript'); + } + } +} +$AA.ConditionAnimation.registerClass('Sys.Extended.UI.Animation.ConditionAnimation', $AA.SelectionAnimation); +$AA.registerAnimation('condition', $AA.ConditionAnimation); + + +$AA.CaseAnimation = function(target, duration, fps, animations, selectScript) { + // The CaseAnimation is used as a control structure to play a specific child animation depending on + // the result of executing the selectScript, which should return the index of the child animation to + // play (this is similar to the case or select statements in C#/VB, etc.). If the provided + // index is outside the bounds of the child animations array (or if nothing was returned) then we will not play anything. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "animations" - array of child animations + // "selectScript" - JavaScript that should evaluate to the index of the appropriate child animation to play. + // If this returns an index outside the bounds of the child animations array, then nothing is played. + $AA.CaseAnimation.initializeBase(this, [target, duration, fps, animations]); + + // Condition to determine which index we will play + this._selectScript = selectScript; +} +$AA.CaseAnimation.prototype = { + getSelectedIndex: function() { + // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of + // the child animations array, then nothing is played. + // returns index of the selected child animation to play + var selected = -1; + if(this._selectScript && this._selectScript.length > 0) { + try { + var result = eval(this._selectScript) + if(result !== undefined) + selected = result; + } catch(ex) { + } + } + return selected; + }, + + get_selectScript: function() { + // JavaScript that should evaluate to the index of the appropriate child animation to play. + // If this returns an index outside the bounds of the child animations array, then nothing is played. + return this._selectScript; + }, + set_selectScript: function(value) { + if(this._selectScript != value) { + this._selectScript = value; + this.raisePropertyChanged('selectScript'); + } + } +} +$AA.CaseAnimation.registerClass('Sys.Extended.UI.Animation.CaseAnimation', $AA.SelectionAnimation); +$AA.registerAnimation('case', $AA.CaseAnimation); + + +$AA.FadeEffect = function() { + // The FadeEffect enumeration determines whether a fade animation is used to fade in or fade out. + throw Error.invalidOperation(); +} +$AA.FadeEffect.prototype = { + FadeIn: 0, + FadeOut: 1 +} +$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect", false); + + +$AA.FadeAnimation = function(target, duration, fps, effect, minimumOpacity, maximumOpacity, forceLayoutInIE) { + // The FadeAnimation is used to fade an element in or out of view, depending on the + // provided , by settings its opacity. + // The minimum and maximum opacity values can be specified to precisely control the fade. + // You may also consider using FadeInAnimation or FadeOutAnimation if you know the only direction you + // are fading. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "effect" - determine whether to fade the element in or fade the element out. The possible values are FadeIn + // and FadeOut. The default value is FadeOut. + // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0. + // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1. + // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + $AA.FadeAnimation.initializeBase(this, [target, duration, fps]); + + // The effect determines whether or not we fade in or out + this._effect = (effect !== undefined) ? effect : $AA.FadeEffect.FadeIn; + + // Maximum and minimum opacities default to 100% and 0% + this._max = (maximumOpacity !== undefined) ? maximumOpacity : 1; + this._min = (minimumOpacity !== undefined) ? minimumOpacity : 0; + + // Starting and ending opacities + this._start = this._min; + this._end = this._max; + + // Whether the a layout has already been created (to work around IE + // problems). + this._layoutCreated = false; + + // Whether or not we should force a layout to be created for IE by giving it a width + // and setting its background color (the latter is required in case the user has ClearType enabled). + // http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/alpha.asp + this._forceLayoutInIE = (forceLayoutInIE === undefined || forceLayoutInIE === null) ? true : forceLayoutInIE; + + // Current target of the animation that is cached before the animation plays (since looking up + // the target could mean walking all the way up to the root of the animation's tree, which we don't + // want to do for every step of the animation) + this._currentTarget = null; + + // Properly set up the min/max values provided by the constructor + this._resetOpacities(); +} +$AA.FadeAnimation.prototype = { + _resetOpacities: function() { + // Set the starting and ending opacity values based on the effect (i.e. when we're fading + // in we go from _min to _max, but we go _max to + // _min when fading out) + + if(this._effect == $AA.FadeEffect.FadeIn) { + this._start = this._min; + this._end = this._max; + } else { + this._start = this._max; + this._end = this._min; + } + }, + + _createLayout: function() { + // Create a layout when using Internet Explorer (which entails setting a width and also + // a background color if it currently has neither) + + var element = this._currentTarget; + if(element) { + // Get the original width/height/back color + this._originalWidth = $common.getCurrentStyle(element, 'width'); + var originalHeight = $common.getCurrentStyle(element, 'height'); + this._originalBackColor = $common.getCurrentStyle(element, 'backgroundColor'); + + // Set the width which will force the creation of a layout + if((!this._originalWidth || this._originalWidth == '' || this._originalWidth == 'auto') && + (!originalHeight || originalHeight == '' || originalHeight == 'auto')) { + element.style.width = element.offsetWidth + 'px'; + } + + // Set the back color to avoid ClearType problems + if(!this._originalBackColor || this._originalBackColor == '' || this._originalBackColor == 'transparent' || this._originalBackColor == 'rgba(0, 0, 0, 0)') { + element.style.backgroundColor = $common.getInheritedBackgroundColor(element); + } + + // Mark that we've created the layout so we only do it once + this._layoutCreated = true; + } + }, + + onStart: function() { + // The onStart method is called just before the animation is played each time. + $AA.FadeAnimation.callBaseMethod(this, 'onStart'); + + this._currentTarget = this.get_target(); + this.setValue(this._start); + + // Force the creation of a layout in IE if we're supposed to and the current browser is Internet Explorer + if(this._forceLayoutInIE && !this._layoutCreated && Sys.Browser.agent == Sys.Browser.InternetExplorer) { + this._createLayout(); + } + }, + + getAnimatedValue: function(percentage) { + // Determine the current opacity after the given percentage of its duration has elapsed + // "percentage" - percentage of the animation already complete + // returns - current opacity after the given percentage of its duration has elapsed that will be passed to setValue + return this.interpolate(this._start, this._end, percentage); + }, + + setValue: function(value) { + // Set the current opacity of the element. + // "value" - current opacity (as retreived from getAnimatedValue) + // This method will be replaced by a dynamically generated function that requires no logic + // to determine whether it should use filters or the style's opacity. + if(this._currentTarget) { + $common.setElementOpacity(this._currentTarget, value); + } + }, + + get_effect: function() { + // Determine whether to fade the element in or fade the element out. The possible values are + // FadeIn and FadeOut. The default value is FadeOut. + return this._effect; + }, + set_effect: function(value) { + value = this._getEnum(value, $AA.FadeEffect); + if(this._effect != value) { + this._effect = value; + this._resetOpacities(); + this.raisePropertyChanged('effect'); + } + }, + + get_minimumOpacity: function() { + // Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. + // The default value is 0. + return this._min; + }, + set_minimumOpacity: function(value) { + value = this._getFloat(value); + if(this._min != value) { + this._min = value; + this._resetOpacities(); + this.raisePropertyChanged('minimumOpacity'); + } + }, + + get_maximumOpacity: function() { + // Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. + // The default value is 1. + return this._max; + }, + set_maximumOpacity: function(value) { + value = this._getFloat(value); + if(this._max != value) { + this._max = value; + this._resetOpacities(); + this.raisePropertyChanged('maximumOpacity'); + } + }, + + get_forceLayoutInIE: function() { + // Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + return this._forceLayoutInIE; + }, + set_forceLayoutInIE: function(value) { + value = this._getBoolean(value); + if(this._forceLayoutInIE != value) { + this._forceLayoutInIE = value; + this.raisePropertyChanged('forceLayoutInIE'); + } + }, + + set_startValue: function(value) { + // Set the start value (so that child animations can set the current opacity as the start value when fading in or out) + value = this._getFloat(value); + this._start = value; + } +} +$AA.FadeAnimation.registerClass('Sys.Extended.UI.Animation.FadeAnimation', $AA.Animation); +$AA.registerAnimation('fade', $AA.FadeAnimation); + + +$AA.FadeInAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) { + // The FadeInAnimation will fade the target in by moving from hidden to visible. + // It starts the animation the target's current opacity. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0. + // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1. + // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + $AA.FadeInAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeIn, minimumOpacity, maximumOpacity, forceLayoutInIE]); +} +$AA.FadeInAnimation.prototype = { + onStart: function() { + // The onStart method is called just before the animation is played each time. + $AA.FadeInAnimation.callBaseMethod(this, 'onStart'); + + if(this._currentTarget) { + this.set_startValue($common.getElementOpacity(this._currentTarget)); + } + } +} +$AA.FadeInAnimation.registerClass('Sys.Extended.UI.Animation.FadeInAnimation', $AA.FadeAnimation); +$AA.registerAnimation('fadeIn', $AA.FadeInAnimation); + + +$AA.FadeOutAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) { + // The FadeInAnimation will fade the element out by moving from visible to hidden. It starts the animation + // at the element's current opacity. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0. + // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1. + // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + $AA.FadeOutAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeOut, minimumOpacity, maximumOpacity, forceLayoutInIE]); +} +$AA.FadeOutAnimation.prototype = { + onStart: function() { + // The onStart method is called just before the animation is played each time. + $AA.FadeOutAnimation.callBaseMethod(this, 'onStart'); + + if(this._currentTarget) { + this.set_startValue($common.getElementOpacity(this._currentTarget)); + } + } +} +$AA.FadeOutAnimation.registerClass('Sys.Extended.UI.Animation.FadeOutAnimation', $AA.FadeAnimation); +$AA.registerAnimation('fadeOut', $AA.FadeOutAnimation); + + +$AA.PulseAnimation = function(target, duration, fps, iterations, minimumOpacity, maximumOpacity, forceLayoutInIE) { + // The PulseAnimation fades an element in and our repeatedly to create a pulsating + // effect. The iterations determines how many pulses there will be (which defaults + // to three, but it will repeat infinitely if given zero or less). The duration + // property defines the duration of each fade in or fade out, not the duration of + // the animation as a whole. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "iterations" - number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence + // will repeat forever. The default value is 1 iteration. + // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0. + // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1. + // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + $AA.PulseAnimation.initializeBase(this, [target, duration, fps, null, ((iterations !== undefined) ? iterations : 3)]); + + // Create the FadeOutAnimation + this._out = new $AA.FadeOutAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE); + this.add(this._out); + + // Create the FadeInAnimation + this._in = new $AA.FadeInAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE); + this.add(this._in); +} +$AA.PulseAnimation.prototype = { + + get_minimumOpacity: function() { + // Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0. + return this._out.get_minimumOpacity(); + }, + set_minimumOpacity: function(value) { + value = this._getFloat(value); + this._out.set_minimumOpacity(value); + this._in.set_minimumOpacity(value); + this.raisePropertyChanged('minimumOpacity'); + }, + + get_maximumOpacity: function() { + // Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1. + return this._out.get_maximumOpacity(); + }, + set_maximumOpacity: function(value) { + value = this._getFloat(value); + this._out.set_maximumOpacity(value); + this._in.set_maximumOpacity(value); + this.raisePropertyChanged('maximumOpacity'); + }, + + get_forceLayoutInIE: function() { + // Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its + // background color (the latter is required in case the user has ClearType enabled). The default value is true. + // This is obviously ignored when working in other browsers. + return this._out.get_forceLayoutInIE(); + }, + set_forceLayoutInIE: function(value) { + value = this._getBoolean(value); + this._out.set_forceLayoutInIE(value); + this._in.set_forceLayoutInIE(value); + this.raisePropertyChanged('forceLayoutInIE'); + }, + + set_duration: function(value) { + // Override the duration property + value = this._getFloat(value); + $AA.PulseAnimation.callBaseMethod(this, 'set_duration', [value]); + this._in.set_duration(value); + this._out.set_duration(value); + }, + + set_fps: function(value) { + // Override the fps property + value = this._getInteger(value); + $AA.PulseAnimation.callBaseMethod(this, 'set_fps', [value]); + this._in.set_fps(value); + this._out.set_fps(value); + } + +} +$AA.PulseAnimation.registerClass('Sys.Extended.UI.Animation.PulseAnimation', $AA.SequenceAnimation); +$AA.registerAnimation('pulse', $AA.PulseAnimation); + + +$AA.PropertyAnimation = function(target, duration, fps, property, propertyKey) { + // The PropertyAnimation is a useful base animation that will assign the value from + // getAnimatedValue to a specified property. You can provide the name of + // a property alongside an optional propertyKey (which indicates the value + // property[propertyKey], like style['backgroundColor']). + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "property" - property of the target element to set when animating + // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey], + // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly + // format (i.e. backgroundColor instead of background-color). + $AA.PropertyAnimation.initializeBase(this, [target, duration, fps]); + + // Name of the property to set + this._property = property; + + // Optional Key of the property to set (i.e., if the property were "style" then + // this might be "backgroundColor") + this._propertyKey = propertyKey; + + // Current target of the animation that is cached before the animation plays (since looking up + // the target could mean walking all the way up to the root of the animation's tree, which we don't + // want to do for every step of the animation) + this._currentTarget = null; +} +$AA.PropertyAnimation.prototype = { + onStart: function() { + // The onStart method is called just before the animation is played each time. + $AA.PropertyAnimation.callBaseMethod(this, 'onStart'); + + this._currentTarget = this.get_target(); + }, + + setValue: function(value) { + var element = this._currentTarget; + if(element && this._property && this._property.length > 0) { + if(this._propertyKey && this._propertyKey.length > 0 && element[this._property]) { + element[this._property][this._propertyKey] = value; + } else { + element[this._property] = value; + } + } + }, + + getValue: function() { + var element = this.get_target(); + if(element && this._property && this._property.length > 0) { + var property = element[this._property]; + if(property) { + if(this._propertyKey && this._propertyKey.length > 0) { + return property[this._propertyKey]; + } + return property; + } + } + return null; + }, + + get_property: function() { + return this._property; + }, + set_property: function(value) { + if(this._property != value) { + this._property = value; + this.raisePropertyChanged('property'); + } + }, + + get_propertyKey: function() { + // Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). + // Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color). + return this._propertyKey; + }, + set_propertyKey: function(value) { + if(this._propertyKey != value) { + this._propertyKey = value; + this.raisePropertyChanged('propertyKey'); + } + } +} +$AA.PropertyAnimation.registerClass('Sys.Extended.UI.Animation.PropertyAnimation', $AA.Animation); +$AA.registerAnimation('property', $AA.PropertyAnimation); + + +$AA.DiscreteAnimation = function(target, duration, fps, property, propertyKey, values) { + // The DiscreteAnimation inherits from + // and sets the value of the property to the elements in a provided array of values. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "property" - property of the target element to set when animating + // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey], + // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly + // format (i.e. backgroundColor instead of background-color). + // "values" - array of possible values of the property that will be iterated over as the animation is played + $AA.DiscreteAnimation.initializeBase(this, [target, duration, fps, property, propertyKey]); + + // Values to assign to the property + this._values = (values && values.length) ? values : []; +} +$AA.DiscreteAnimation.prototype = { + getAnimatedValue: function(percentage) { + // Assign the value whose index corresponds to the current percentage + // "percentage" - percentage of the animation already complete + // returns - state of the animation after the given percentage of its duration has elapsed that will + // be passed to setValue + var index = Math.floor(this.interpolate(0, this._values.length - 1, percentage)); + return this._values[index]; + }, + + get_values: function() { + // Array of possible values of the property that will be iterated over as the animation is played + return this._values; + }, + set_values: function(value) { + if(this._values != value) { + this._values = value; + this.raisePropertyChanged('values'); + } + } +} +$AA.DiscreteAnimation.registerClass('Sys.Extended.UI.Animation.DiscreteAnimation', $AA.PropertyAnimation); +$AA.registerAnimation('discrete', $AA.DiscreteAnimation); + + +$AA.InterpolatedAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) { + // The InterpolatedAnimation assigns a range of values between startValue + // and endValue to the designated property. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "property" - property of the target element to set when animating. The default value is 'style'. + // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey], + // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly + // format (i.e. backgroundColor instead of background-color). + // "startValue" - start of the range of values + // "endValue" - end of the range of values + $AA.InterpolatedAnimation.initializeBase(this, [target, duration, fps, ((property !== undefined) ? property : 'style'), propertyKey]); + + // Start and end values + this._startValue = startValue; + this._endValue = endValue; +} +$AA.InterpolatedAnimation.prototype = { + get_startValue: function() { + return this._startValue; + }, + set_startValue: function(value) { + value = this._getFloat(value); + if(this._startValue != value) { + this._startValue = value; + this.raisePropertyChanged('startValue'); + } + }, + + get_endValue: function() { + return this._endValue; + }, + set_endValue: function(value) { + value = this._getFloat(value); + if(this._endValue != value) { + this._endValue = value; + this.raisePropertyChanged('endValue'); + } + } +} +$AA.InterpolatedAnimation.registerClass('Sys.Extended.UI.Animation.InterpolatedAnimation', $AA.PropertyAnimation); +$AA.registerAnimation('interpolated', $AA.InterpolatedAnimation); + + +$AA.ColorAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) { + // The ColorAnimation transitions the value of the property between + // two colors (although it does ignore the alpha channel). The colors must be 7-character hex strings + // (like #246ACF). + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "property" - property of the target element to set when animating. The default value is 'style'. + // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey], + // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color). + // "startValue" - start of the range of colors + // "endValue" - end of the range of colors + $AA.ColorAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]); + + // Cached start/end RBG triplets + this._start = null; + this._end = null; + + // Flags indicating whether each dimension of color will be interpolated + this._interpolateRed = false; + this._interpolateGreen = false; + this._interpolateBlue = false; +} +$AA.ColorAnimation.prototype = { + onStart: function() { + // Determine which dimensions of color will be animated + $AA.ColorAnimation.callBaseMethod(this, 'onStart'); + + this._start = $AA.ColorAnimation.getRGB(this.get_startValue()); + this._end = $AA.ColorAnimation.getRGB(this.get_endValue()); + + this._interpolateRed = (this._start.Red != this._end.Red); + this._interpolateGreen = (this._start.Green != this._end.Green); + this._interpolateBlue = (this._start.Blue != this._end.Blue); + }, + + getAnimatedValue: function(percentage) { + // Get the interpolated color values + // "percentage" - percentage of the animation already complete + // returns current color formatted as a 7-character hex string (like #246ACF). + var r = this._start.Red; + var g = this._start.Green; + var b = this._start.Blue; + + if(this._interpolateRed) + r = Math.round(this.interpolate(r, this._end.Red, percentage)); + + if(this._interpolateGreen) + g = Math.round(this.interpolate(g, this._end.Green, percentage)); + + if(this._interpolateBlue) + b = Math.round(this.interpolate(b, this._end.Blue, percentage)); + + return $AA.ColorAnimation.toColor(r, g, b); + }, + + set_startValue: function(value) { + // Starting color of the transition formatted as a 7-character hex string (like #246ACF). + if(this._startValue != value) { + this._startValue = value; + this.raisePropertyChanged('startValue'); + } + }, + + set_endValue: function(value) { + // Ending color of the transition formatted as a 7-character hex string (like #246ACF). + if(this._endValue != value) { + this._endValue = value; + this.raisePropertyChanged('endValue'); + } + } +} +$AA.ColorAnimation.getRGB = function(color) { + // Convert the color to an RGB triplet + // "color" - color formatted as a 7-character hex string (like #246ACF) + // returns object representing the color with Red, Green, and Blue properties. + if(!color || color.length != 7) { + throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor, color); + } + return { + 'Red': parseInt(color.substr(1, 2), 16), + 'Green': parseInt(color.substr(3, 2), 16), + 'Blue': parseInt(color.substr(5, 2), 16) + }; +} +$AA.ColorAnimation.toColor = function(red, green, blue) { + // Convert an RBG triplet into a 7-character hex string (like #246ACF) + // "red" - value of the color's red dimension + // "green" - value of the color's green dimension + // "blue" - value of the color's blue dimension + // returns color as a 7-character hex string (like #246ACF) + var r = red.toString(16); + var g = green.toString(16); + var b = blue.toString(16); + if(r.length == 1) r = '0' + r; + if(g.length == 1) g = '0' + g; + if(b.length == 1) b = '0' + b; + return '#' + r + g + b; +} +$AA.ColorAnimation.registerClass('Sys.Extended.UI.Animation.ColorAnimation', $AA.InterpolatedAnimation); +$AA.registerAnimation('color', $AA.ColorAnimation); + + +$AA.LengthAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue, unit) { + // The LengthAnimation is identical to + // except it adds a unit to the value before assigning it to the property. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "property" - property of the target element to set when animating. The default value is 'style'. + // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey], + // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly + // format (i.e. backgroundColor instead of background-color). + // "startValue" - start of the range of values + // "endValue" - end of the range of values + // "unit" - unit of the interpolated values. The default value is 'px'. + $AA.LengthAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]); + + // Unit of length (which defaults to px) + this._unit = (unit != null) ? unit : 'px'; +} +$AA.LengthAnimation.prototype = { + + getAnimatedValue: function(percentage) { + // Get the interpolated length value + // "percentage" - percentage of the animation already complete + // returns interpolated length + var value = this.interpolate(this.get_startValue(), this.get_endValue(), percentage); + return Math.round(value) + this._unit; + }, + + get_unit: function() { + // Unit of the interpolated values. The default value is 'px'. + return this._unit; + }, + set_unit: function(value) { + if(this._unit != value) { + this._unit = value; + this.raisePropertyChanged('unit'); + } + } +} +$AA.LengthAnimation.registerClass('Sys.Extended.UI.Animation.LengthAnimation', $AA.InterpolatedAnimation); +$AA.registerAnimation('length', $AA.LengthAnimation); + + +$AA.MoveAnimation = function(target, duration, fps, horizontal, vertical, relative, unit) { + // The MoveAnimation is used to move the target element. If the + // relative flag is set to true, then it treats the horizontal + // and vertical properties as offsets to move the element. If the relative + // flag is false, then it will treat the horizontal and vertical + // properties as coordinates on the page where the target element should be moved. It is + // important to note that the target must be positioned (i.e. absolutely) so + // that settings its top/left style attributes will change its location. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "horizontal" - if relative is true, this is the offset to move horizontally. Otherwise this is the x + // coordinate on the page where the target should be moved. + // "vertical" - if relative is true, this is the offset to move vertically. Otherwise this is the y + // coordinate on the page where the target should be moved. + // "relative" - true if we are moving relative to the current position, false if we are moving absolutely + // "unit" - length unit for the size of the target. The default value is 'px'. + $AA.MoveAnimation.initializeBase(this, [target, duration, fps, null]); + + // Distance to move horizontally and vertically + this._horizontal = horizontal ? horizontal : 0; + this._vertical = vertical ? vertical : 0; + this._relative = (relative === undefined) ? true : relative; + + // Length animations representing the movememnts + this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'left', null, null, unit); + this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'top', null, null, unit); + this.add(this._verticalAnimation); + this.add(this._horizontalAnimation); +} +$AA.MoveAnimation.prototype = { + + onStart: function() { + // Use the target's current position as the starting point for the animation + $AA.MoveAnimation.callBaseMethod(this, 'onStart'); + + // Set the start and end values of the animations by getting + // the element's current position and applying the offsets + var element = this.get_target(); + this._horizontalAnimation.set_startValue(element.offsetLeft); + this._horizontalAnimation.set_endValue(this._relative ? element.offsetLeft + this._horizontal : this._horizontal); + this._verticalAnimation.set_startValue(element.offsetTop); + this._verticalAnimation.set_endValue(this._relative ? element.offsetTop + this._vertical : this._vertical); + }, + + get_horizontal: function() { + // If relative is true, this is the offset to move horizontally. Otherwise this is the x + // coordinate on the page where the target should be moved. + return this._horizontal; + }, + set_horizontal: function(value) { + value = this._getFloat(value); + if(this._horizontal != value) { + this._horizontal = value; + this.raisePropertyChanged('horizontal'); + } + }, + + get_vertical: function() { + // If relative is true, this is the offset to move vertically. Otherwise this is the y + // coordinate on the page where the target should be moved. + return this._vertical; + }, + set_vertical: function(value) { + value = this._getFloat(value); + if(this._vertical != value) { + this._vertical = value; + this.raisePropertyChanged('vertical'); + } + }, + + get_relative: function() { + // true if we are moving relative to the current position, false if we are moving absolutely + return this._relative; + }, + set_relative: function(value) { + value = this._getBoolean(value); + if(this._relative != value) { + this._relative = value; + this.raisePropertyChanged('relative'); + } + }, + + get_unit: function() { + // Length unit for the size of the target. The default value is 'px'. + this._horizontalAnimation.get_unit(); + }, + set_unit: function(value) { + var unit = this._horizontalAnimation.get_unit(); + if(unit != value) { + this._horizontalAnimation.set_unit(value); + this._verticalAnimation.set_unit(value); + this.raisePropertyChanged('unit'); + } + } +} +$AA.MoveAnimation.registerClass('Sys.Extended.UI.Animation.MoveAnimation', $AA.ParallelAnimation); +$AA.registerAnimation('move', $AA.MoveAnimation); + + +$AA.ResizeAnimation = function(target, duration, fps, width, height, unit) { + // The ResizeAnimation changes the size of the target from its + // current value to the specified width and height. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "width" - new width of the target + // "height" - new height of the target + // "unit" - length unit for the size of the target. The default value is 'px'. + $AA.ResizeAnimation.initializeBase(this, [target, duration, fps, null]); + + // New size of the element + this._width = width; + this._height = height; + + // Animations to set the size across both dimensions + this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'width', null, null, unit); + this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'height', null, null, unit); + this.add(this._horizontalAnimation); + this.add(this._verticalAnimation); +} +$AA.ResizeAnimation.prototype = { + + onStart: function() { + // Use the target's current size as the starting point for the animation + $AA.ResizeAnimation.callBaseMethod(this, 'onStart'); + + // Set the start and end values of the animations by getting + // the element's current width and height + var element = this.get_target(); + this._horizontalAnimation.set_startValue(element.offsetWidth); + this._verticalAnimation.set_startValue(element.offsetHeight); + this._horizontalAnimation.set_endValue((this._width !== null && this._width !== undefined) ? + this._width : element.offsetWidth); + this._verticalAnimation.set_endValue((this._height !== null && this._height !== undefined) ? + this._height : element.offsetHeight); + }, + + get_width: function() { + return this._width; + }, + set_width: function(value) { + value = this._getFloat(value); + if(this._width != value) { + this._width = value; + this.raisePropertyChanged('width'); + } + }, + + get_height: function() { + return this._height; + }, + set_height: function(value) { + value = this._getFloat(value); + if(this._height != value) { + this._height = value; + this.raisePropertyChanged('height'); + } + }, + + get_unit: function() { + // Length unit for the size of the target. The default value is 'px'. + this._horizontalAnimation.get_unit(); + }, + set_unit: function(value) { + var unit = this._horizontalAnimation.get_unit(); + if(unit != value) { + this._horizontalAnimation.set_unit(value); + this._verticalAnimation.set_unit(value); + this.raisePropertyChanged('unit'); + } + } +} +$AA.ResizeAnimation.registerClass('Sys.Extended.UI.Animation.ResizeAnimation', $AA.ParallelAnimation); +$AA.registerAnimation('resize', $AA.ResizeAnimation); + +$AA.ScaleAnimation = function(target, duration, fps, scaleFactor, unit, center, scaleFont, fontUnit) { + // The ScaleAnimation scales the size of the target element by the given scaleFactor + // (i.e. a scaleFactor of .5 will shrink it in half and a scaleFactor of 2.0 + // will double it). If scaleFont is true, the size of the font will also scale with the element. If + // center is true, then the element's center will not move as it is scaled. It is important to note that + // the target must be positioned (i.e. absolutely) so that setting its top/left properties will change + // its location in order for center to have an effect. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 1. + // "fps" - number of steps per second. The default is 25. + // "scaleFactor" - the amount to scale the target (a scaleFactor of .5 will + // shrink it in half and a scaleFactor of 2.0 will double it). The default value is + // 1, which does no scaling. + // "unit" - length unit for the size of the target. The default value is 'px'. + // "center" - whether the target should stay centered while scaling + // "scaleFont" - whether the font should be scaled along with the size + // "fontUnit" - unit of the font, which is only used if scaleFont is true. + // The default value is 'pt'. + $AA.ScaleAnimation.initializeBase(this, [target, duration, fps]); + + // Percentage to scale + this._scaleFactor = (scaleFactor !== undefined) ? scaleFactor : 1; + this._unit = (unit !== undefined) ? unit : 'px'; + + // Center the content while scaling + this._center = center; + + // Scale the font size as well + this._scaleFont = scaleFont; + this._fontUnit = (fontUnit !== undefined) ? fontUnit : 'pt'; + + // Initial values + this._element = null; + this._initialHeight = null; + this._initialWidth = null; + this._initialTop = null; + this._initialLeft = null; + this._initialFontSize = null; +} +$AA.ScaleAnimation.prototype = { + getAnimatedValue: function(percentage) { + // Get the amount to scale the target + // "percentage" - percentage of the animation already complete + // returns percentage to scale the target + return this.interpolate(1.0, this._scaleFactor, percentage); + }, + + onStart: function() { + // Cache the initial size because it will be used to determine how much to scale the element at each step of the animation + $AA.ScaleAnimation.callBaseMethod(this, 'onStart'); + + this._element = this.get_target(); + if(this._element) { + this._initialHeight = this._element.offsetHeight; + this._initialWidth = this._element.offsetWidth; + if(this._center) { + this._initialTop = this._element.offsetTop; + this._initialLeft = this._element.offsetLeft; + } + if(this._scaleFont) { + // Note: we're assuming this is in the same units as fontUnit + this._initialFontSize = parseFloat( + $common.getCurrentStyle(this._element, 'fontSize')); + } + } + }, + + setValue: function(scale) { + // Scale the target by the given percentage + // "scale" - percentage to scale the target + if(this._element) { + var width = Math.round(this._initialWidth * scale); + var height = Math.round(this._initialHeight * scale); + this._element.style.width = width + this._unit; + this._element.style.height = height + this._unit; + + if(this._center) { + this._element.style.top = (this._initialTop + + Math.round((this._initialHeight - height) / 2)) + this._unit; + this._element.style.left = (this._initialLeft + + Math.round((this._initialWidth - width) / 2)) + this._unit; + } + + if(this._scaleFont) { + var size = this._initialFontSize * scale; + if(this._fontUnit == 'px' || this._fontUnit == 'pt') { + size = Math.round(size); + } + this._element.style.fontSize = size + this._fontUnit; + } + } + }, + + onEnd: function() { + // Wipe the cached values after the animation completes + this._element = null; + this._initialHeight = null; + this._initialWidth = null; + this._initialTop = null; + this._initialLeft = null; + this._initialFontSize = null; + $AA.ScaleAnimation.callBaseMethod(this, 'onEnd'); + }, + + get_scaleFactor: function() { + // The amount to scale the target (a scaleFactor of .5 will + // shrink it in half and a scaleFactor of 2.0 will double it). The default value is + // 1, which does no scaling. + return this._scaleFactor; + }, + set_scaleFactor: function(value) { + value = this._getFloat(value); + if(this._scaleFactor != value) { + this._scaleFactor = value; + this.raisePropertyChanged('scaleFactor'); + } + }, + + get_unit: function() { + // Length unit for the size of the target. The default value is 'px'. + return this._unit; + }, + set_unit: function(value) { + if(this._unit != value) { + this._unit = value; + this.raisePropertyChanged('unit'); + } + }, + + get_center: function() { + // Whether the target should stay centered while scaling + return this._center; + }, + set_center: function(value) { + value = this._getBoolean(value); + if(this._center != value) { + this._center = value; + this.raisePropertyChanged('center'); + } + }, + + get_scaleFont: function() { + // Whether the font should be scaled along with the size + return this._scaleFont; + }, + set_scaleFont: function(value) { + value = this._getBoolean(value); + if(this._scaleFont != value) { + this._scaleFont = value; + this.raisePropertyChanged('scaleFont'); + } + }, + + get_fontUnit: function() { + // Unit of the font, which is only used if scaleFont is true. + // The default value is 'pt'. + return this._fontUnit; + }, + set_fontUnit: function(value) { + if(this._fontUnit != value) { + this._fontUnit = value; + this.raisePropertyChanged('fontUnit'); + } + } +} +$AA.ScaleAnimation.registerClass('Sys.Extended.UI.Animation.ScaleAnimation', $AA.Animation); +$AA.registerAnimation('scale', $AA.ScaleAnimation); + + +$AA.Action = function(target, duration, fps) { + // Action is a base class for all "non-animating" animations that provides empty implementations + // for abstract methods and adds a doAction method that will be called to perform the action's + // operation. While regular animations perform an operation in a sequence of small steps spread over an interval, + // the actions perform a single operation instantaneously. By default, all actions have a duration + // of zero. The actions are very useful for defining complex animations. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + $AA.Action.initializeBase(this, [target, duration, fps]); + + // Set the duration to 0 if it wasn't specified + if(duration === undefined) { + this.set_duration(0); + } +} +$AA.Action.prototype = { + + onEnd: function() { + // Call the doAction method when the animation completes + this.doAction(); + $AA.Action.callBaseMethod(this, 'onEnd'); + }, + + doAction: function() { + // The doAction method must be implemented by all actions + throw Error.notImplemented(); + }, + + getAnimatedValue: function() { + // Empty implementation of required abstract method + }, + setValue: function() { + // Empty implementation of required abstract method + } +} +$AA.Action.registerClass('Sys.Extended.UI.Animation.Action', $AA.Animation); +$AA.registerAnimation('action', $AA.Action); + + +$AA.EnableAction = function(target, duration, fps, enabled) { + // The EnableAction changes whether or not the target is disabled. + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + // "enabled" - whether or not the target is disabled. The default value is true. + $AA.EnableAction.initializeBase(this, [target, duration, fps]); + + // Whether to enable or disable + this._enabled = (enabled !== undefined) ? enabled : true; +} +$AA.EnableAction.prototype = { + doAction: function() { + // Set the enabled property of the target + var element = this.get_target(); + if(element) { + element.disabled = !this._enabled; + } + }, + + get_enabled: function() { + // Whether or not the target is disabled. The default value is true. + return this._enabled; + }, + set_enabled: function(value) { + value = this._getBoolean(value); + if(this._enabled != value) { + this._enabled = value; + this.raisePropertyChanged('enabled'); + } + } +} +$AA.EnableAction.registerClass('Sys.Extended.UI.Animation.EnableAction', $AA.Action); +$AA.registerAnimation('enableAction', $AA.EnableAction); + + +$AA.HideAction = function(target, duration, fps, visible) { + // The HideAction simply hides the target from view + // (by setting its style's display attribute to 'none') + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + // "visible" - true to show the target, false to hide it. The default value is false. + $AA.HideAction.initializeBase(this, [target, duration, fps]); + + this._visible = visible; +} +$AA.HideAction.prototype = { + doAction: function() { + // Hide the target + var element = this.get_target(); + if(element) { + $common.setVisible(element, this._visible); + } + }, + + get_visible: function() { + // True to show the target, false to hide it. The default value is false. + return this._visible; + }, + set_visible: function(value) { + if(this._visible != value) { + this._visible = value; + this.raisePropertyChanged('visible'); + } + } +} +$AA.HideAction.registerClass('Sys.Extended.UI.Animation.HideAction', $AA.Action); +$AA.registerAnimation('hideAction', $AA.HideAction); + + +$AA.StyleAction = function(target, duration, fps, attribute, value) { + // The StyleAction is used to set a particular attribute of the target's style + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + // "attribute" - style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor + // instead of background-color) + // "value" - value to set the attribute + $AA.StyleAction.initializeBase(this, [target, duration, fps]); + + // Style attribute (like "backgroundColor" or "borderWidth" + this._attribute = attribute; + + // Value to assign to the style attribute + this._value = value; + +} +$AA.StyleAction.prototype = { + doAction: function() { + // Assign the value to the style's attribute + var element = this.get_target(); + if(element) { + element.style[this._attribute] = this._value; + } + }, + + get_attribute: function() { + // Style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor + // instead of background-color) + return this._attribute; + }, + set_attribute: function(value) { + if(this._attribute != value) { + this._attribute = value; + this.raisePropertyChanged('attribute'); + } + }, + + get_value: function() { + return this._value; + }, + set_value: function(value) { + if(this._value != value) { + this._value = value; + this.raisePropertyChanged('value'); + } + } +} +$AA.StyleAction.registerClass('Sys.Extended.UI.Animation.StyleAction', $AA.Action); +$AA.registerAnimation('styleAction', $AA.StyleAction); + + +$AA.OpacityAction = function(target, duration, fps, opacity) { + // OpacityAction allows you to set the opacity of the target + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + // "opacity" - opacity to set the target + $AA.OpacityAction.initializeBase(this, [target, duration, fps]); + + // Opacity + this._opacity = opacity; +} +$AA.OpacityAction.prototype = { + doAction: function() { + // Set the opacity + var element = this.get_target(); + if(element) { + $common.setElementOpacity(element, this._opacity); + } + }, + + get_opacity: function() { + return this._opacity; + }, + set_opacity: function(value) { + value = this._getFloat(value); + if(this._opacity != value) { + this._opacity = value; + this.raisePropertyChanged('opacity'); + } + } +} +$AA.OpacityAction.registerClass('Sys.Extended.UI.Animation.OpacityAction', $AA.Action); +$AA.registerAnimation('opacityAction', $AA.OpacityAction); + + +$AA.ScriptAction = function(target, duration, fps, script) { + // The ScriptAction is used to execute arbitrary JavaScript + // "target" - target of the animation + // "duration" - length of the animation in seconds. The default is 0. + // "fps" - number of steps per second. The default is 25. + // "script" - javaScript to execute + $AA.ScriptAction.initializeBase(this, [target, duration, fps]); + + // Script to execute + this._script = script; +} +$AA.ScriptAction.prototype = { + doAction: function() { + try { + eval(this._script); + } catch(ex) { + } + }, + + get_script: function() { + return this._script; + }, + set_script: function(value) { + if(this._script != value) { + this._script = value; + this.raisePropertyChanged('script'); + } + } +} +$AA.ScriptAction.registerClass('Sys.Extended.UI.Animation.ScriptAction', $AA.Action); +$AA.registerAnimation('scriptAction', $AA.ScriptAction); + +// globals +var $AA; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AreaChart.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AreaChart.debug.js new file mode 100644 index 000000000..e34138a7e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AreaChart.debug.js @@ -0,0 +1,588 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.AreaChart = function(element) { + Sys.Extended.UI.AreaChart.initializeBase(this, [element]); + var id = this.get_id(); + id = id.replace("_ctl00", ""); + this._parentDiv = document.getElementById(id + "__ParentDiv"); + + /// + /// Whether or not show series values. + /// + /// get_displayValues + /// set_displayValues + /// + this._displayValues = true; + + /// + /// Chart width in pixels. Default value is 300 + /// + /// get_chartWidth + /// set_chartWidth + /// + this._chartWidth = '300'; + + /// + /// Chart height in pixels. Default value is 300 + /// + /// get_chartHeight + /// set_chartHeight + /// + this._chartHeight = '300'; + + /// + /// A chart title. + /// + /// get_chartTitle + /// set_chartTitle + /// + this._chartTitle = ''; + + /// + /// Comma-separated text for each category rendered below X axis + /// + /// get_categoriesAxis + /// set_categoriesAxis + /// + this._categoriesAxis = ''; + + /// + /// A list of series. + /// + /// get_clientSeries + /// set_clientSeries + /// + this._series = null; + + /// + /// A type of chart. The default value is Basic. + /// + /// get_chartType + /// set_chartType + /// + this._chartType = Sys.Extended.UI.AreaChartType.Basic; + + /// + /// A CSS file name for AreaChart. The default value is 'AreaChart'. + /// + /// get_theme + /// set_theme + /// + this._theme = 'AreaChart'; + + /// + /// Value axis lines count. The default value is 9. + /// + /// get_valueAxisLines + /// set_valueAxisLines + /// + this._valueAxisLines = 9; + + /// + /// Color of a chart title. + /// + /// get_chartTitleColor + /// set_chartTitleColor + /// + this._chartTitleColor = ''; + + /// + /// Color of a value axis line. + /// + /// get_valueAxisLineColor + /// set_valueAxisLineColor + /// + this._valueAxisLineColor = ''; + + /// + /// Color of a category axis line. + /// + /// get_categoryAxisLineColor + /// set_categoryAxisLineColor + /// + this._categoryAxisLineColor = ''; + + /// + /// Color of a base line. + /// + /// get_baseLineColor + /// set_baseLineColor + /// + this._baseLineColor = ''; + + // variables + this.yMax = 0; + this.yMin = 0; + this.roundedTickRange = 0; + this.startX = 0; + this.startY = 0; + this.endX = 0; + this.endY = 0; + this.xInterval = 0; + this.yInterval = 0; + this.arrXAxis; + this.arrXAxisLength = 0; + this.charLength = 3.5; + this.arrCombinedData = null; +} + +Sys.Extended.UI.AreaChart.prototype = { + initialize: function() { + Sys.Extended.UI.AreaChart.callBaseMethod(this, "initialize"); + + if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) { + throw 'Current version of browser does not support SVG.' + } + + if(this._valueAxisLines == 0) { + this._valueAxisLines = 9; + } + + this.generateAreaChart(); + }, + + dispose: function() { + Sys.Extended.UI.AreaChart.callBaseMethod(this, "dispose"); + }, + + /// + /// Generates the AreaChart with the specified values + /// + /// + generateAreaChart: function() { + this.arrXAxis = this._categoriesAxis.split(','); + this.arrXAxisLength = this.arrXAxis.length; + + this.calculateMinMaxValues(); + this.calculateInterval(); + this.calculateValueAxis(); + + var svgContents = this.initializeSVG(); + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + + svgContents = svgContents + this.drawBackgroundHorizontalLines(); + svgContents = svgContents + this.drawBackgroundVerticalLines(); + svgContents = svgContents + this.drawBaseLines(); + svgContents = svgContents + this.drawLegendArea(); + svgContents = svgContents + this.drawAxisValues(); + this._parentDiv.innerHTML = svgContents; + this.drawAreas(); + }, + + // Calculates distance interval for the value axis. + calculateInterval: function() { + this.startX = (this._chartWidth * 10 / 100) + 0.5; + this.endX = parseInt(this._chartWidth) - 4.5; + + if(this.yMin >= 0) + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 24 / 100)) + 0.5; + else + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 12 / 100)) / 2 + 0.5; + + this.yInterval = this.startY / (this._valueAxisLines + 1); + }, + + calculateMinMaxValues: function() { + var seriesMax; + var seriesMin; + var arrData; + if(this._chartType == Sys.Extended.UI.AreaChartType.Basic) { + for(var i = 0; i < this._series.length; i++) { + arrData = this._series[i].Data; + seriesMax = Math.max.apply(null, arrData); + seriesMin = Math.min.apply(null, arrData); + if(i == 0) { + this.yMax = seriesMax; + this.yMin = seriesMin; + } + else { + if(seriesMax > this.yMax) + this.yMax = seriesMax; + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + } + else { + for(var i = 0; i < this._series.length; i++) { + arrData = new Array(); + for(var j = 0; j < this._series[i].Data.length; j++) { + arrData[j] = this._series[i].Data[j]; + } + if(this.arrCombinedData == null) + this.arrCombinedData = arrData; + else { + for(j = 0; j < arrData.length; j++) { + this.arrCombinedData[j] = parseFloat(this.arrCombinedData[j]) + parseFloat(arrData[j]); + } + } + } + + for(var i = 0; i < this._series.length; i++) { + seriesMin = Math.min.apply(null, this._series[i].Data); + if(i == 0) { + this.yMin = seriesMin; + } + else { + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + + this.yMax = Math.max.apply(null, this.arrCombinedData); + } + + if(this.yMin < 0) { + this._valueAxisLines = Math.round(this._valueAxisLines / 2); + } + }, + + // Calculates label values for Value axis to display on the chart. + calculateValueAxis: function() { + var range; + var unroundedTickSize; + var x; + var pow10x; + + if(this.yMin >= 0) { + range = this.yMax; + } + else { + range = this.yMax > Math.abs(this.yMin) ? this.yMax : Math.abs(this.yMin); + } + + unroundedTickSize = range / (this._valueAxisLines - 1); + if(unroundedTickSize < 1) { + this.roundedTickRange = unroundedTickSize.toFixed(1); + } + else { + x = Math.ceil((Math.log(unroundedTickSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.roundedTickRange = Math.ceil(unroundedTickSize / pow10x) * pow10x; + } + this.startX = this.startX + (this.roundedTickRange * 10 * this._valueAxisLines / 10).toString().length * this.charLength; + }, + + drawBackgroundHorizontalLines: function() { + var horizontalLineContents = ''; + // background grid's horizontal lines + for(var i = 1; i <= this._valueAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY - (this.yInterval * i), this._categoryAxisLineColor); + } + + if(this.yMin < 0) { + // background grid's horizontal lines for negative values + for(var i = 1; i <= this._valueAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY + (this.yInterval * i), this._categoryAxisLineColor); + } + } + return horizontalLineContents; + }, + + drawBackgroundVerticalLines: function() { + // background grid's vertical lines + var verticalLineContents = ''; + this.xInterval = Math.round((parseInt(this._chartWidth) - this.startX) / this.arrXAxisLength); + + for(var i = 0; i < this.arrXAxisLength; i++) { + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + } + + if(this.yMin < 0) { + for(var i = 0; i < this.arrXAxisLength; i++) { + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + } + } + return verticalLineContents; + }, + + drawBaseLines: function() { + var baseLineContents = ''; + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endX, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startY + 4, this._baseLineColor); + + for(var i = 0; i < this.arrXAxisLength; i++) { + baseLineContents = baseLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), this.startY, this.startY + 4, this._baseLineColor); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY - (this.yInterval * i), this._baseLineColor); + } + + if(this.yMin < 0) { + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + for(var i = 1; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY + (this.yInterval * i), this._baseLineColor); + } + } + return baseLineContents; + }, + + drawLegendArea: function() { + var legendContents = ''; + // Legend Area + var legendAreaStartHeight = (parseInt(this._chartHeight) * 82 / 100) + 5; + var legendBoxWidth = 7.5; + var legendBoxHeight = 7.5; + var spaceInLegendContents = 5; + + // Get length of text to display in legend + var legendCharLength = 0; + for(var i = 0; i < this._series.length; i++) { + legendCharLength = legendCharLength + this._series[i].Name.length; + } + var legendAreaWidth = Math.round((legendCharLength * 5) / 2) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._series.length); + var isLegendNextLine = false; + if(legendAreaWidth > parseInt(this._chartWidth) / 2) { + legendAreaWidth = legendAreaWidth / 2; + isLegendNextLine = true; + } + + legendContents = legendContents + ''; + legendContents = legendContents + String.format('', parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2), legendAreaStartHeight, Math.round(parseInt(this._chartWidth) * 50 / 100 + (legendCharLength * 5)) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._series.length), Math.round(parseInt(this._chartHeight) * 97.5 / 100)); + + var startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + legendBoxWidth + spaceInLegendContents; + var nextStartText = startText; + var startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2); + var nextStartLegend = startLegend; + + for(var i = 0; i < this._series.length; i++) { + if(isLegendNextLine && i == Math.round(this._series.length / 2)) { + startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + legendBoxWidth + spaceInLegendContents; + nextStartText = startText; + startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2); + nextStartLegend = startLegend; + legendAreaStartHeight = (parseInt(this._chartHeight) * 89 / 100) + 5; + isLegendNextLine = false; + } + startLegend = nextStartLegend; + startText = nextStartText; + legendContents = legendContents + String.format('', startLegend, legendAreaStartHeight + legendBoxHeight, startLegend + legendBoxWidth, legendAreaStartHeight + 15, i + 1, this._series[i].AreaColor); + legendContents = legendContents + String.format('{2}', startText, legendAreaStartHeight + 15, this._series[i].Name); + if(this._series[i].Name.length > 10) { + nextStartLegend = startLegend + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = startText + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + } + else { + nextStartLegend = nextStartLegend + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = nextStartText + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + } + } + legendContents = legendContents + ''; + return legendContents; + }, + + drawAxisValues: function() { + var axisContents = ''; + var textLength = 0; + for(var i = 0; i < this.arrXAxisLength; i++) { + textLength = (this.arrXAxis[i].toString().length * 10 * i / 10).toString().length * 5.5; + axisContents = axisContents + String.format('{2}', Math.round(this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 50 / 100) - textLength), this.startY + Math.round(this.yInterval * 65 / 100), this.arrXAxis[i]); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + textLength = (this.roundedTickRange * 10 * i / 10).toString().length * 5.5; + axisContents = axisContents + String.format('{2}', this.startX - textLength - 15, this.startY - (this.yInterval * 10 * i / 10) + 3.5, this.roundedTickRange * 10 * i / 10); + } + + if(this.yMin < 0) { + for(var i = 1; i <= this._valueAxisLines; i++) { + textLength = (this.roundedTickRange * 10 * i / 10).toString().length * 5.5; + axisContents = axisContents + String.format('-{2}', this.startX - textLength - 19, this.startY + (this.yInterval * 10 * i / 10), this.roundedTickRange * 10 * i / 10); + } + } + + return axisContents; + }, + + initializeSVG: function() { + var svgContents = String.format('', this._theme); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + + return svgContents; + }, + + drawAreas: function () { + var displayValues = this.get_displayValues(); + var areaContents = ''; + // Area section + var yVal = new Array(); + var lastStartX = new Array(); + var lastStartY = new Array(); + + var areaPath = new Array(); + + for(var i = 0; i < this.arrXAxisLength; i++) { + for(var j = 0; j < this._series.length; j++) { + yVal[j] = 0; + if(this._chartType == Sys.Extended.UI.AreaChartType.Stacked) { + for(var k = 0; k <= j; k++) { + yVal[j] = parseFloat(yVal[j]) + parseFloat(this._series[k].Data[i]); + } + } else { + yVal[j] = parseFloat(this._series[j].Data[i]); + } + + if(i == 0) { + areaPath[j] = String.format('{0} {1} {0} {2} ', this.startX + (this.xInterval / 2), this.startY, this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange))); + } + else if(i == this.arrXAxisLength - 1) { + areaPath[j] = areaPath[j] + String.format('{0} {1} {2} {3} {2} {4} ', lastStartX[j], lastStartY[j], this.startX + (this.xInterval * i) + (this.xInterval / 2), this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange)), this.startY); + } + else { + areaPath[j] = areaPath[j] + String.format('{0} {1} ', this.startX + (this.xInterval * i) + (this.xInterval / 2), this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange))); + } + + if(yVal[j] > 0) + areaContents = areaContents + String.format('{2}', this.startX + (this.xInterval * i) + (this.xInterval * 50 / 100) - yVal[j].toString().length * this.charLength, this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange)) - 7.5, displayValues ? yVal[j] : ""); + else + areaContents = areaContents + String.format('{2}', this.startX + (this.xInterval * i) + (this.xInterval * 50 / 100) - yVal[j].toString().length * this.charLength, this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange)) + 7.5, displayValues ? yVal[j] : ""); + + lastStartX[j] = this.startX + (this.xInterval * i) + (this.xInterval / 2); + lastStartY[j] = this.startY - Math.round(yVal[j] * (this.yInterval / this.roundedTickRange)); + } + } + this._parentDiv.innerHTML = this._parentDiv.innerHTML + areaContents; + var svgContentsBeforeAnimation = this._parentDiv.innerHTML; + this._drawArea(areaPath, 0); + }, + + _drawArea: function(areaPath, seriesIndex) { + var self = this; + self._parentDiv.innerHTML = self._parentDiv.innerHTML.replace('', '') + String.format('', areaPath[seriesIndex], seriesIndex + 1, self._series[seriesIndex].AreaColor); + + seriesIndex++; + if(seriesIndex < self._series.length) { + setTimeout(function() { + self._drawArea(areaPath, seriesIndex); + }, 400); + } + }, + drawArea: function(me, areaPath, seriesIndex) { + Sys.Extended.Deprecated("drawArea(me, areaPath, seriesIndex)"); + this._drawArea(areaPath, seriesIndex); + }, + + get_displayValues: function () { + return this._displayValues; + }, + set_displayValues: function (value) { + this._displayValues = value; + }, + + get_chartWidth: function() { + return this._chartWidth; + }, + set_chartWidth: function(value) { + this._chartWidth = value; + }, + + get_chartHeight: function() { + return this._chartHeight; + }, + set_chartHeight: function(value) { + this._chartHeight = value; + }, + + get_chartTitle: function() { + return this._chartTitle; + }, + set_chartTitle: function(value) { + this._chartTitle = value; + }, + + get_categoriesAxis: function() { + return this._categoriesAxis; + }, + set_categoriesAxis: function(value) { + this._categoriesAxis = value; + }, + + get_clientSeries: function() { + return this._series; + }, + get_ClientSeries: function() { + Sys.Extended.Deprecated("get_ClientSeries()", "get_clientSeries()"); + return this.get_clientSeries(); + }, + set_clientSeries: function(value) { + this._series = value; + }, + set_ClientSeries: function(value) { + Sys.Extended.Deprecated("set_ClientSeries(value)", "set_clientSeries(value)"); + this.set_clientSeries(value); + }, + + get_chartType: function() { + return this._chartType; + }, + set_chartType: function(value) { + this._chartType = value; + }, + + get_theme: function() { + return this._theme; + }, + set_theme: function(value) { + this._theme = value; + }, + + get_valueAxisLines: function() { + return this._valueAxisLines; + }, + set_valueAxisLines: function(value) { + this._valueAxisLines = value; + }, + + get_chartTitleColor: function() { + return this._chartTitleColor; + }, + set_chartTitleColor: function(value) { + this._chartTitleColor = value; + }, + + get_valueAxisLineColor: function() { + return this._valueAxisLineColor; + }, + set_valueAxisLineColor: function(value) { + this._valueAxisLineColor = value; + }, + + get_categoryAxisLineColor: function() { + return this._categoryAxisLineColor; + }, + set_categoryAxisLineColor: function(value) { + this._categoryAxisLineColor = value; + }, + + get_baseLineColor: function() { + return this._baseLineColor; + }, + set_baseLineColor: function(value) { + this._baseLineColor = value; + } +}; + +Sys.Extended.UI.AreaChart.registerClass("Sys.Extended.UI.AreaChart", Sys.Extended.UI.ControlBase); + +Sys.Extended.UI.AreaChartType = function() { + throw Error.invalidOperation(); +} +Sys.Extended.UI.AreaChartType.prototype = { + Basic: 0, + Stacked: 1 +} + +Sys.Extended.UI.AreaChartType.registerEnum("Sys.Extended.UI.AreaChartType", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js new file mode 100644 index 000000000..375e77736 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js @@ -0,0 +1,574 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.AsyncFileUpload = function(element) { + Sys.Extended.UI.AsyncFileUpload.initializeBase(this, [element]); + + /// + /// Stores the file path. + /// + /// get_hiddenField + /// set_hiddenField + /// + this._hiddenField = null; + + /// + /// Inputs an element with type='file'. + /// + /// get_inputFile + /// set_inputFile + /// + this._inputFile = null; + + /// + /// An inner throbber. + /// + /// get_innerTB + /// set_innerTB + /// + this._innerTB = null; + + /// + /// Url that receives posted data relative to the form. + /// + /// get_postBackUrl + /// set_postBackUrl + /// + this._postBackUrl = ""; + + /// + /// A name of the form. + /// + /// get_postBackUrl + /// set_postBackUrl + /// + this._formName = ""; + this._iframe = null; + this._waitTimer = null; + + /// + /// The control's background color on upload complete. The default value - 'Lime'. + /// + /// get_completeBackColor + /// set_completeBackColor + /// + this._completeBackColor = ""; + + /// + /// The control's background color when uploading is in progress. The default value - 'White'. + /// + /// get_uploadingBackColor + /// set_uploadingBackColor + /// + this._uploadingBackColor = ""; + + /// + /// The control's background color on upload error. The default value - 'Red'. + /// + /// get_errorBackColor + /// set_errorBackColor + /// + this._errorBackColor = ""; + + /// + /// The control that is shown while the file is being uploaded. + /// + /// get_throbber + /// set_throbber + /// + this._throbber = null; + + this._onchange$delegate = null; + this._onload$delegate = null; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); + this._onmouseup$delegate = null; +} + +Sys.Extended.UI.AsyncFileUpload.prototype = { + get_throbber: function() { + return this._throbber; + }, + set_throbber: function(value) { + this._throbber = value; + }, + + get_completeBackColor: function() { + return this._completeBackColor; + }, + set_completeBackColor: function(value) { + this._completeBackColor = value; + }, + + get_errorBackColor: function() { + return this._errorBackColor; + }, + set_errorBackColor: function(value) { + this._errorBackColor = value; + }, + + get_uploadingBackColor: function() { + return this._uploadingBackColor; + }, + set_uploadingBackColor: function(value) { + this._uploadingBackColor = value; + }, + + get_inputFile: function() { + return this._inputFile; + }, + set_inputFile: function(value) { + this._inputFile = value; + }, + + get_hiddenField: function() { + return this._hiddenField; + }, + set_hiddenField: function(value) { + this._hiddenField = value; + }, + + get_innerTB: function() { + return this._innerTB; + }, + set_innerTB: function(value) { + this._innerTB = value; + }, + + get_postBackUrl: function() { + return this._postBackUrl; + }, + set_postBackUrl: function(value) { + this._postBackUrl = value; + }, + + /// + /// Name of the form + /// + /// get_formName + /// set_formName + /// + get_formName: function() { + return this._formName; + }, + set_formName: function(value) { + this._formName = value; + }, + + /// + /// Occurs when file uploading starts. + /// + /// + /// + add_uploadStarted: function(handler) { + this.get_events().addHandler("uploadStarted", handler); + }, + remove_uploadStarted: function(handler) { + this.get_events().removeHandler("uploadStarted", handler); + }, + raise_uploadStarted: function (e) { + var eh = this.get_events().getHandler("uploadStarted"); + if (eh) { + return eh(this, e); + } + return true; + }, + raiseUploadStarted: function(e) { + Sys.Extended.Deprecated("raiseUploadStarted(e)", "raise_uploadStarted(e)"); + return this.raise_uploadStarted(e); + }, + + /// + /// Occurs when file uploading is completed. + /// + /// + /// + add_uploadComplete: function(handler) { + this.get_events().addHandler("uploadComplete", handler); + }, + remove_uploadComplete: function(handler) { + this.get_events().removeHandler("uploadComplete", handler); + }, + raise_uploadComplete: function(e) { + var eh = this.get_events().getHandler("uploadComplete"); + if(eh) { + eh(this, e); + } + }, + raiseUploadComplete: function (e) { + Sys.Extended.Deprecated("raiseUploadComplete(e)", "raise_uploadComplete(e)"); + return this.raise_uploadComplete(e); + }, + + /// + /// Fires when file uploading encounters an error + /// + /// + /// + add_uploadError: function(handler) { + this.get_events().addHandler("uploadError", handler); + }, + remove_uploadError: function(handler) { + this.get_events().removeHandler("uploadError", handler); + }, + raise_uploadError: function(e) { + var eh = this.get_events().getHandler("uploadError"); + if(eh) { + eh(this, e); + return true; + } + return false; + }, + raiseUploadError: function (e) { + Sys.Extended.Deprecated("raiseUploadError(e)", "raise_uploadError(e)"); + return this.raise_uploadError(e); + }, + + /// + /// Set throbber visual style + /// + /// Visual style value + /// + setThrobber: function(value) { + if(this.get_throbber() != null) { + this.get_throbber().style.display = value ? "" : "none"; + } + }, + + _onStart: function(fileName) { + var valid = this.raise_uploadStarted(new Sys.Extended.UI.AsyncFileUploadEventArgs(fileName, null, null, null)); + if(typeof valid == 'undefined') { + valid = true; + } + + return valid; + }, + + // Initialize of AsyncFileUpload. + initialize: function() { + Sys.Extended.UI.AsyncFileUpload.callBaseMethod(this, "initialize"); + Sys.Application.add_load(this._app_onload$delegate); + this._iframeName = this.get_element().id + "_iframe"; + this.setThrobber(false); + }, + + // Dispose of AsyncFileUpload. + dispose: function() { + Sys.Application.remove_load(this._app_onload$delegate); + if(this._onchange$delegate != null) { + $common.removeHandlers(this._inputFile, { + change: this._onchange$delegate + }); + this._onchange$delegate = null; + } + if(this._onmouseup$delegate != null) { + $common.removeHandlers(this._inputFile, { + mouseup: this._onmouseup$delegate + }); + this._onmouseup$delegate = null; + } + this._removeIframe(); + Sys.Extended.UI.AsyncFileUpload.callBaseMethod(this, "dispose"); + }, + + _onmouseup: function() { + var inputFile = this._inputFile; + setTimeout(function() { inputFile.blur(); }, 0); + return true; + }, + + _app_onload: function(sender, e) { + this.setThrobber(false); + if(this._inputFile != null) { + if(this._onchange$delegate == null) { + this._onchange$delegate = Function.createDelegate(this, this._onchange); + $addHandlers(this._inputFile, { + change: this._onchange$delegate + }); + } + if(this._innerTB != null) { + this._inputFile.blur(); + var inputFile = this._inputFile; + setTimeout(function() { inputFile.blur(); }, 0); + this._innerTB.style.width = (this._inputFile.offsetWidth - 107) + "px"; + this._inputFile.parentNode.style.width = this._inputFile.offsetWidth + "px"; + if(Sys.Browser.agent == Sys.Browser.InternetExplorer) { + this._onmouseup$delegate = Function.createDelegate(this, this._onmouseup); + $addHandlers(this._inputFile, { + mouseup: this._onmouseup$delegate + }); + } + } + } + }, + + _removeIframe: function() { + this._removeTimer(); + if(this._iframe != null) { + if(this._onload$delegate != null) { + $common.removeHandlers(this._iframe, { + load: this._onload$delegate + }); + this._onload$delegate = null; + } + document.body.removeChild(this._iframe); + this._iframe = null; + } + }, + + _removeTimer: function() { + if(this._waitTimer != null) { + window.clearTimeout(this._waitTimer); + this._waitTimer = null; + } + }, + + _onError: function(error) { + var unhandledException = Sys.Extended.UI.Resources.AsyncFileUpload_UnhandledException; + this.setThrobber(false); + + if(this.get_errorBackColor() != "") { + if(this._innerTB != null) { + this._innerTB.style.backgroundColor = this.get_errorBackColor(); + } else { + this._inputFile.style.backgroundColor = this.get_errorBackColor(); + } + } + if(!this.raise_uploadError(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value, null, null, error))) { + alert(unhandledException + ": " + error); + } + }, + + _onchange: function(e) { + var value = this._inputFile.value; + if(value == "") { + return; + } + if(this._innerTB != null) { + this._innerTB.value = value; + } + if(this._hiddenField != null) { + this._hiddenField.value = value; + } + + try { + if(this._iframe == null) { + this._onload$delegate = Function.createDelegate(this, this._onload); + var iframe = document.createElement("IFRAME"); + iframe.width = "0"; + iframe.height = "0"; + iframe.style.display = "none"; + iframe.src = "about:blank"; + iframe.id = this._iframeName; + iframe.name = this._iframeName; + $addHandlers(iframe, { + load: this._onload$delegate + }); + this._iframe = iframe; + document.body.appendChild(this._iframe); + iframe.contentWindow.name = this._iframeName; + } else { + this._removeIframe(); + var internalErrorMessage = Sys.Extended.UI.Resources.AsyncFileUpload_InternalErrorMessage; + this._onError(internalErrorMessage); + } + } catch(ex) { + this._onError(ex.message); + } + }, + + _stopLoad: function(result) { + var mainForm = document.getElementById(this._formName); + this._removeTimer(); + this.setThrobber(false); + mainForm.target = "_top"; + mainForm.action = this._postBackUrl; + var length; + var contentType = ""; + var temp = result.split("------"); + if(temp.length > 0) { + if(temp[0] == "error") { + this._onError(temp[1]); + return; + } + length = parseInt(temp[0]); + } + if(temp.length > 1) { + contentType = temp[1]; + } + if(this.get_completeBackColor() != "") { + if(this._innerTB != null) { + this._innerTB.style.backgroundColor = this.get_completeBackColor(); + } else { + this._inputFile.style.backgroundColor = this.get_completeBackColor(); + } + } + this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value, length, contentType, null)); + }, + + _onload: function(e) { + var cleanup = true; + var uploader = this; + var mainForm = document.getElementById(this._formName); + try { + var frameDocument = this._iframe.contentWindow.document; + if(frameDocument == null || frameDocument.location == null) { + var e = { "message": Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem }; + throw (e); + } else if(frameDocument.location.href == 'about:blank') { + this._removeTimer(); + if(this.get_uploadingBackColor() != "") { + if(this._innerTB != null) { + this._innerTB.style.backgroundColor = this.get_uploadingBackColor(); + } else { + this._inputFile.style.backgroundColor = this.get_uploadingBackColor(); + } + } + + var valid = this._onStart(this._inputFile.value); + if(valid) { + var url = this._postBackUrl; + url += url.indexOf("?") === -1 ? "?" : "&"; + mainForm.action = url + 'AsyncFileUploadID=' + this.get_element().id + '&rnd=' + Math.random().toString().replace(/\./g, ""); + mainForm.target = this._iframeName; + cleanup = false; + this.setThrobber(true); + setTimeout(function() { + mainForm.submit(); + uploader._waitTimer = setTimeout(function() { uploader._wait() }, 100); + }, 0); + return true; + } + } else { + //---------------------------------------- + if(frameDocument.body.innerHTML == "") { + return true; + } + // if (this._waitTimer == null) { + // setTimeout(function() { uploader._removeIframe(); }, 100); + // return true; + // } + //---------------------------------------- + var result = frameDocument.getElementById(this.get_element().id); + var length; + var contentType = ""; + if(result != null) { + var temp = result.innerHTML.split("------"); + if(temp.length > 0) { + if(temp[0] == "error") { + var e = { "message": temp[1] }; + throw (e); + } + length = parseInt(temp[0]); + } + if(temp.length > 1) { + contentType = temp[1]; + } + } else { + var serverError = Sys.Extended.UI.Resources.AsyncFileUpload_UnknownServerError; + function replace_func(p0, p1) { + serverError = p1; + return ""; + } + frameDocument.body.innerHTML.replace(/Exception\]:([^\n\r]+)[\n\r]/, replace_func); + var exMessage = Sys.Extended.UI.Resources.AsyncFileUpload_ServerResponseError + ": '" + serverError + "'"; + var ret = confirm(exMessage + "\n\n" + Sys.Extended.UI.Resources.AsyncFileUpload_ConfirmToSeeErrorPage); + if(ret) { + var handle = window.open("", "NotFoundInAnswer", "toolbar=0,status=1,scrollbars=1,resizable=1,width=600,height=400"); + function onOpen() { + try { + if(!handle.document) + setTimeout(onOpen, 100); + } + catch(e) { return; } + var _doc = handle.document; + _doc.open(); + _doc.write("" + frameDocument.body.innerHTML + ""); + _doc.close(); + } + setTimeout(onOpen, 0); + } + var e = { "message": exMessage }; + throw (e); + } + + this._removeTimer(); + mainForm.target = "_top"; + mainForm.action = this._postBackUrl; + if(this.get_completeBackColor() != "") { + if(this._innerTB != null) { + this._innerTB.style.backgroundColor = this.get_completeBackColor(); + } else { + this._inputFile.style.backgroundColor = this.get_completeBackColor(); + } + } + this.setThrobber(false); + this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value, length, contentType, null)); + } + } + catch(ex) { + this._removeTimer(); + mainForm.target = "_top"; + mainForm.action = this._postBackUrl; + this._onError(ex.message); + } + finally { + if(cleanup) { + setTimeout(function() { uploader._removeIframe(); }, 100); + } + } + }, + + _wait: function() { + if(this._waitTimer == null) { + return; + } + var uploader = this; + try { + var frameDocument = this._iframe.contentWindow.document; + var location = frameDocument.location; + var href = location.href; + this._waitTimer = setTimeout(function() { uploader._wait() }, 100); + } catch(ex) { + setTimeout(function() { uploader._removeIframe(); }, 100); + setTimeout(function() { uploader._onError(Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem); }, 0); + this._waitTimer = null; + } + } +} + +Sys.Extended.UI.AsyncFileUpload.registerClass("Sys.Extended.UI.AsyncFileUpload", Sys.Extended.UI.ControlBase); + +Sys.Extended.UI.AsyncFileUploadEventArgs = function(fileName, length, contentType, errorMessage) { + if(arguments.length != 4) throw Error.parameterCount(); + + //Calling the base class constructor + Sys.Extended.UI.AsyncFileUploadEventArgs.initializeBase(this); + this._fileName = fileName; + this._length = length; + this._contentType = contentType; + this._errorMessage = errorMessage; +} + +Sys.Extended.UI.AsyncFileUploadEventArgs.prototype = +{ + get_fileName: function() { + var slashPos = this._fileName.lastIndexOf("/"); + var backSlashPos = this._fileName.lastIndexOf("\\"); + + var fileName = this._fileName.substr(((slashPos > backSlashPos) ? slashPos : backSlashPos) + 1); + return fileName; + }, + get_path: function() { + return this._fileName; + }, + get_length: function() { + return this._length; + }, + get_contentType: function() { + return this._contentType; + }, + get_errorMessage: function() { + return this._errorMessage; + } +} + +Sys.Extended.UI.AsyncFileUploadEventArgs.registerClass('Sys.Extended.UI.AsyncFileUploadEventArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js new file mode 100644 index 000000000..3900ad450 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js @@ -0,0 +1,1284 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.AutoCompleteBehavior = function(element) { + // This behavior can be attached to a textbox to enable auto-complete/auto-suggest scenarios. + // "element" - DOM Element the behavior is associated with + Sys.Extended.UI.AutoCompleteBehavior.initializeBase(this, [element]); + + /// + /// Web service url + /// + /// get_servicePath + /// set_servicePath + /// + this._servicePath = null; + + /// + /// Web service method + /// + /// get_serviceMethod + /// set_serviceMethod + /// + this._serviceMethod = null; + + /// + /// User/page specific context provided to an optional overload + /// of the web method described by ServiceMethod/ServicePath. + /// If the context key is used, it should have the same signature + /// with an additional parameter named contextKey of a string type. + /// + /// get_contextKey + /// set_contextKey + /// + this._contextKey = null; + + /// + /// Whether or not the ContextKey property should be used. + /// This will be automatically enabled if the ContextKey property + /// is ever set (on either the client or the server). If the context key is used, + /// it should have the same signature with an additional parameter named contextKey of a string type. + /// The default is false + /// + /// get_useContextKey + /// set_useContextKey + /// + this._useContextKey = false; + + /// + /// Minimum text prefix length required to call the webservice. + /// The default is 3 + /// + /// get_minimumPrefixLength + /// set_minimumPrefixLength + /// + this._minimumPrefixLength = 3; + + /// + /// Maximum completion set size. + /// The default is 10 + /// + /// get_completionSetCount + /// set_completionSetCount + /// + this._completionSetCount = 10; + + /// + /// Auto completion timer interval in milliseconds. + /// The default is 1000 + /// + /// get_completionInterval + /// set_completionInterval + /// + this._completionInterval = 1000; + + /// + /// ID of the completion div element + /// + /// get_completionListElementID + /// set_completionListElementID + /// + this._completionListElementID = null; + + /// + /// List dom element + /// + /// get_completionList + /// set_completionList + /// + this._completionListElement = null; + this._textColor = 'windowtext'; + this._textBackground = 'window'; + this._popupBehavior = null; + this._popupBehaviorHiddenHandler = null; + this._onShowJson = null; + this._onHideJson = null; + this._timer = null; + this._cache = null; + this._currentPrefix = null; + this._selectIndex = -1; + this._focusHandler = null; + this._blurHandler = null; + this._bodyClickHandler = null; + this._completionListBlurHandler = null; + this._keyDownHandler = null; + this._mouseDownHandler = null; + this._mouseUpHandler = null; + this._mouseOverHandler = null; + this._tickHandler = null; + + /// + /// Whether suggestions retrieved from the webservice should be cached + /// + /// get_enableCaching + /// set_enableCaching + /// + this._enableCaching = true; + this._flyoutHasFocus = false; + this._textBoxHasFocus = false; + + /// + /// A CSS class name that will be used to style the completion list element. + /// + /// get_completionListCssClass + /// set_completionListCssClass + /// + this._completionListCssClass = null; + + /// + /// A CSS class name that will be used to style an item in the completion list. + /// + /// get_completionListItemCssClass + /// set_completionListItemCssClass + /// + this._completionListItemCssClass = null; + + /// + /// A CSS class name that will be used to style a highlighted item in the list. + /// + /// get_highlightedItemCssClass + /// set_highlightedItemCssClass + /// + this._highlightedItemCssClass = null; + + /// + /// The character(s) used to seperate words for autocomplete + /// + /// get_delimiterCharacters + /// set_delimiterCharacters + /// + this._delimiterCharacters = null; + + /// + /// A flag to determine if the first option in the flyout is selected or not. + /// The default is false + /// + /// get_firstRowSelected + /// set_firstRowSelected + /// + this._firstRowSelected = false; + + /// + /// If Delimiter characters are specified and showOnlyCurrentWordInCompletionListItem is + /// set to true, then the completion list displays suggestions just for the current word, + /// otherwise, it displays the whole string that will show up in the TextBox if that + /// item is selected, which is the current default. + /// The default is false + /// + /// get_showOnlyCurrentWordInCompletionListItem + /// set_showOnlyCurrentWordInCompletionListItem + /// + this._showOnlyCurrentWordInCompletionListItem = false; + + // WebRequest object returned from WebServiceProxy.invoke + this._webRequest = null; + +} +Sys.Extended.UI.AutoCompleteBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this, 'initialize'); + $common.prepareHiddenElementForATDeviceUpdate(); + + this._popupBehaviorHiddenHandler = Function.createDelegate(this, this._popupHidden); + this._tickHandler = Function.createDelegate(this, this._onTimerTick); + this._focusHandler = Function.createDelegate(this, this._onGotFocus); + this._blurHandler = Function.createDelegate(this, this._onLostFocus); + this._keyDownHandler = Function.createDelegate(this, this._onKeyDown); + this._mouseDownHandler = Function.createDelegate(this, this._onListMouseDown); + this._mouseUpHandler = Function.createDelegate(this, this._onListMouseUp); + this._mouseOverHandler = Function.createDelegate(this, this._onListMouseOver); + this._completionListBlurHandler = Function.createDelegate(this, this._onCompletionListBlur); + this._bodyClickHandler = Function.createDelegate(this, this._onCompletionListBlur); + + + this._timer = new Sys.Timer(); + this.initializeTimer(this._timer); + + var element = this.get_element(); + this.initializeTextBox(element); + + if (this._completionListElementID !== null) + this._completionListElement = $get(this._completionListElementID); + if (this._completionListElement == null) { + this._completionListElement = document.createElement('ul'); + this._completionListElement.id = this.get_id() + '_completionListElem'; + + // Safari styles the element incorrectly if it's added to the desired location + if (Sys.Browser.agent === Sys.Browser.Safari) { + document.body.appendChild(this._completionListElement); + } else { + element.parentNode.insertBefore(this._completionListElement, element.nextSibling); + } + } + this.initializeCompletionList(this._completionListElement); + + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, + { 'id': this.get_id() + 'PopupBehavior', 'parentElement': element, "positioningMode": Sys.Extended.UI.PositioningMode.BottomLeft }, null, null, this._completionListElement); + this._popupBehavior.add_hidden(this._popupBehaviorHiddenHandler); + + // Create the animations (if they were set before initialize was called) + if (this._onShowJson) { + this._popupBehavior.set_onShow(this._onShowJson); + } + if (this._onHideJson) { + this._popupBehavior.set_onHide(this._onHideJson); + } + }, + + dispose: function() { + this._onShowJson = null; + this._onHideJson = null; + if (this._popupBehavior) { + if (this._popupBehaviorHiddenHandler) { + this._popupBehavior.remove_hidden(this._popupBehaviorHiddenHandler); + } + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + if (this._timer) { + this._timer.dispose(); + this._timer = null; + } + + var element = this.get_element(); + if (element) { + $removeHandler(element, "focus", this._focusHandler); + $removeHandler(element, "blur", this._blurHandler); + $removeHandler(element, "keydown", this._keyDownHandler); + $removeHandler(this._completionListElement, 'blur', this._completionListBlurHandler); + $removeHandler(this._completionListElement, 'mousedown', this._mouseDownHandler); + $removeHandler(this._completionListElement, 'mouseup', this._mouseUpHandler); + $removeHandler(this._completionListElement, 'mouseover', this._mouseOverHandler); + } + if (this._bodyClickHandler) { + $removeHandler(document.body, 'click', this._bodyClickHandler); + this._bodyClickHandler = null; + } + + this._popupBehaviorHiddenHandler = null; + this._tickHandler = null; + this._focusHandler = null; + this._blurHandler = null; + this._keyDownHandler = null; + this._completionListBlurHandler = null; + this._mouseDownHandler = null; + this._mouseUpHandler = null; + this._mouseOverHandler = null; + + Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this, 'dispose'); + }, + + initializeTimer: function(timer) { + timer.set_interval(this._completionInterval); + timer.add_tick(this._tickHandler); + }, + + initializeTextBox: function(element) { + element.autocomplete = "off"; + $addHandler(element, "focus", this._focusHandler); + $addHandler(element, "blur", this._blurHandler); + $addHandler(element, "keydown", this._keyDownHandler); + }, + + initializeCompletionList: function(element) { + if (this._completionListCssClass) { + Sys.UI.DomElement.addCssClass(element, this._completionListCssClass); + } else { + var completionListStyle = element.style; + completionListStyle.textAlign = 'left'; + completionListStyle.visibility = 'hidden'; + completionListStyle.cursor = 'default'; + completionListStyle.listStyle = 'none'; + completionListStyle.padding = '0px'; + completionListStyle.margin = '0px! important'; + if (Sys.Browser.agent === Sys.Browser.Safari) { + completionListStyle.border = 'solid 1px gray'; + completionListStyle.backgroundColor = 'white'; + completionListStyle.color = 'black'; + } else { + completionListStyle.border = 'solid 1px buttonshadow'; + completionListStyle.backgroundColor = this._textBackground; + completionListStyle.color = this._textColor; + } + } + $addHandler(element, "mousedown", this._mouseDownHandler); + $addHandler(element, "mouseup", this._mouseUpHandler); + $addHandler(element, "mouseover", this._mouseOverHandler); + $addHandler(element, "blur", this._completionListBlurHandler); + $addHandler(document.body, 'click', this._bodyClickHandler); + }, + + _currentCompletionWord: function() { + var element = this.get_element(); + var elementValue = element.value; + var word = elementValue; + + if (this.get_isMultiWord()) { + var startIndex = this._getCurrentWordStartIndex(); + var endIndex = this._getCurrentWordEndIndex(startIndex); + + if (endIndex <= startIndex) { + word = elementValue.substring(startIndex); + } else { + word = elementValue.substring(startIndex, endIndex); + } + } + + return word; + }, + + _getCursorIndex: function() { + return this.get_element().selectionStart; + }, + + _getCurrentWordStartIndex: function() { + var element = this.get_element(); + var elementText = element.value.substring(0, this._getCursorIndex()); + + var index = 0; + var lastIndex = -1; + + for (var i = 0; i < this._delimiterCharacters.length; ++i) { + var curIndex = elementText.lastIndexOf(this._delimiterCharacters.charAt(i)); + if (curIndex > lastIndex) { + lastIndex = curIndex; + } + } + + index = lastIndex; + if (index >= this._getCursorIndex()) { + index = 0; + } + + return index < 0 ? 0 : index + 1; + }, + + _getCurrentWordEndIndex: function(wordStartIndex) { + var element = this.get_element(); + var elementText = element.value.substring(wordStartIndex); + var index = 0; + + for (var i = 0; i < this._delimiterCharacters.length; ++i) { + var curIndex = elementText.indexOf(this._delimiterCharacters.charAt(i)); + if (curIndex > 0 && (curIndex < index || index == 0)) { + index = curIndex; + } + } + + return index <= 0 ? element.value.length : index + wordStartIndex; + }, + + /// + /// Whether the behavior is currently in multi-word mode + /// + /// get_isMultiword + /// + get_isMultiWord: function() { + return (this._delimiterCharacters != null) && (this._delimiterCharacters != ''); + }, + + _getTextWithInsertedWord: function(wordToInsert) { + var text = wordToInsert; + var replaceIndex = 0; + var element = this.get_element(); + var originalText = element.value; + + if (this.get_isMultiWord()) { + var startIndex = this._getCurrentWordStartIndex(); + var endIndex = this._getCurrentWordEndIndex(startIndex); + var prefix = ''; + var suffix = ''; + + if (startIndex > 0) { + prefix = originalText.substring(0, startIndex); + } + if (endIndex > startIndex) { + suffix = originalText.substring(endIndex); + } + + text = prefix + wordToInsert + suffix; + } + + return text; + }, + + _hideCompletionList: function() { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + // Actually hide the popup + this.hidePopup(); + }, + + /// + /// Shows the completion list popup + /// + /// + showPopup: function() { + // If you cancel the showing event, you should still call + // showPopup to ensure consistency of the internal state + this._popupBehavior.show(); + this.raise_shown(Sys.EventArgs.Empty); + }, + + /// + /// Hides the completion list popup + /// + /// + hidePopup: function() { + // If you cancel the hiding event, you should still + // call hidePopup to ensure consistency of the internal + // state + + if (this._popupBehavior) { + this._popupBehavior.hide(); + } else { + this._popupHidden(); + } + }, + + _popupHidden: function() { + // Clean up the completion list popup after it has been hidden + this._completionListElement.innerHTML = ''; + this._selectIndex = -1; + this._flyoutHasFocus = false; + + this.raise_hidden(Sys.EventArgs.Empty); + }, + + _highlightItem: function(item) { + var children = this._completionListElement.childNodes; + + // Unselect any previously highlighted item + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (child._highlighted) { + if (this._completionListItemCssClass) { + Sys.UI.DomElement.removeCssClass(child, this._highlightedItemCssClass); + Sys.UI.DomElement.addCssClass(child, this._completionListItemCssClass); + } else { + if (Sys.Browser.agent === Sys.Browser.Safari) { + child.style.backgroundColor = 'white'; + child.style.color = 'black'; + } else { + child.style.backgroundColor = this._textBackground; + child.style.color = this._textColor; + } + } + this.raise_itemOut(new Sys.Extended.UI.AutoCompleteItemEventArgs(child, child.firstChild.nodeValue, child._value)); + } + } + + // Highlight the new item + if (this._highlightedItemCssClass) { + Sys.UI.DomElement.removeCssClass(item, this._completionListItemCssClass); + Sys.UI.DomElement.addCssClass(item, this._highlightedItemCssClass); + } else { + if (Sys.Browser.agent === Sys.Browser.Safari) { + item.style.backgroundColor = 'lemonchiffon'; + } else { + item.style.backgroundColor = 'highlight'; + item.style.color = 'highlighttext'; + } + + } + item._highlighted = true; + this.raise_itemOver(new Sys.Extended.UI.AutoCompleteItemEventArgs(item, item.firstChild.nodeValue, item._value)); + }, + + _onCompletionListBlur: function(ev) { + this._hideCompletionList(); + }, + + _onListMouseDown: function(ev) { + if (ev.target !== this._completionListElement) { + this._setText(ev.target); + this._flyoutHasFocus = false; + } else { // focus is still on the flyout and we do not want to hide it + this._flyoutHasFocus = true; + } + }, + + _onListMouseUp: function(ev) { + if(this._flyoutHasFocus) + return; + + try { this.get_element().focus(); } catch (e) { } + }, + + _onListMouseOver: function(ev) { + var item = ev.target; + if (item !== this._completionListElement) { + var children = this._completionListElement.childNodes; + // make sure the selected index is updated + for (var i = 0; i < children.length; ++i) { + if (item === children[i]) { + this._highlightItem(item); + this._selectIndex = i; + break; + } + } + } + }, + + _onGotFocus: function(ev) { + this._textBoxHasFocus = true; + if (this._flyoutHasFocus) { + // hide the flyout now that the focus is back on the textbox + this._hideCompletionList(); + } + if ((this._minimumPrefixLength == 0) && (!this.get_element().value)) { + this._timer.set_enabled(true); + // only start the timer if the minimumprefixlength is 0 + // since we would like to retrieve results even if + // the user has not entered any text and the textbox is empty. + } + }, + + _onKeyDown: function(ev) { + // If textbox had focus on page load, _onGotFocus() would not have been called. + // So if a user started typing, then focus is obviously on the textbox. + this._textBoxHasFocus = true; + + this._timer.set_enabled(false); + // the last key press occured so we need to "reset" the timer. + var k = ev.keyCode ? ev.keyCode : ev.rawEvent.keyCode; + if (k === Sys.UI.Key.esc) { + this._hideCompletionList(); + ev.preventDefault(); + } + else if (k === Sys.UI.Key.up) { + if (this._selectIndex > 0) { + this._selectIndex--; + this._handleScroll(this._completionListElement.childNodes[this._selectIndex], this._selectIndex); + this._highlightItem(this._completionListElement.childNodes[this._selectIndex]); + ev.stopPropagation(); + ev.preventDefault(); + } + } + else if (k === Sys.UI.Key.down) { + if (this._selectIndex < (this._completionListElement.childNodes.length - 1)) { + this._selectIndex++; + this._handleScroll(this._completionListElement.childNodes[this._selectIndex], this._selectIndex); + this._highlightItem(this._completionListElement.childNodes[this._selectIndex]); + ev.stopPropagation(); + ev.preventDefault(); + } + } + else if (k === Sys.UI.Key.enter) { + if (this._selectIndex !== -1) { + this._setText(this._completionListElement.childNodes[this._selectIndex]); + ev.preventDefault(); + } else { + // close the popup + this.hidePopup(); + } + } + else if (k === Sys.UI.Key.tab) { + if (this._selectIndex !== -1) { + this._setText(this._completionListElement.childNodes[this._selectIndex]); + } + } + else { + this._timer.set_enabled(true); + // start the timer to retrieve results since now it is an actual key + } + }, + + _handleScroll: function(element, index) { + // Method to determine if an item is in view or not + var flyout = this._completionListElement; + var elemBounds = $common.getBounds(element); + var numItems = this._completionListElement.childNodes.length; + if (((elemBounds.height * index) - (flyout.clientHeight + flyout.scrollTop)) >= 0) { + // you need to scroll down + flyout.scrollTop += (((elemBounds.height * index) - (flyout.clientHeight + flyout.scrollTop)) + elemBounds.height); + } + if (((elemBounds.height * (numItems - (index + 1))) - (flyout.scrollHeight - flyout.scrollTop)) >= 0) { + // you need to scroll up + flyout.scrollTop -= (((elemBounds.height * (numItems - (index + 1))) - (flyout.scrollHeight - flyout.scrollTop)) + elemBounds.height); + } + + if (flyout.scrollTop % elemBounds.height !== 0) { + if (((elemBounds.height * (index + 1)) - (flyout.clientHeight + flyout.scrollTop)) >= 0) { + // an element is partially displayed at the bottom + flyout.scrollTop -= (flyout.scrollTop % elemBounds.height); + } else { // an element is partially displayed on the top + flyout.scrollTop += (elemBounds.height - (flyout.scrollTop % elemBounds.height)); + } + } + + }, + + _handleFlyoutFocus: function() { + // Method to handle flyout focus if textbox loses focus. + if (!this._textBoxHasFocus) { + if (!this._flyoutHasFocus) { + if (this._webRequest) { + // abort the web service call if we are losing focus. no sense having it delay future web requests. + this._webRequest.get_executor().abort(); + this._webRequest = null; + } + // the textbox lost focus and the flyout does not have it + this._hideCompletionList(); + } else { + // keep the flyout around otherwise + } + } + }, + + _onLostFocus: function() { + this._textBoxHasFocus = false; + this._timer.set_enabled(false); + /* the rest of the onblur handling will be done in + this method after a minor delay to ensure we do not close the flyout + if a user clicks on its scroll bars for example */ + window.setTimeout(Function.createDelegate(this, this._handleFlyoutFocus), 500); + }, + + _onMethodComplete: function(result, context) { + this._webRequest = null; // clear out our saved WebRequest object + this._update(context, result, /* cacheResults */true); + }, + + _onMethodFailed: function(err, response, context) { + this._webRequest = null; + }, + + _onTimerTick: function(sender, eventArgs) { + // turn off the timer until another key is pressed. + this._timer.set_enabled(false); + if (this._servicePath && this._serviceMethod) { + var text = this._currentCompletionWord(); + + if (text.trim().length < this._minimumPrefixLength) { + this._currentPrefix = null; + this._update('', null, /* cacheResults */false); + return; + } + // there is new content in the textbox or the textbox is empty but the min prefix length is 0 + if ((this._currentPrefix !== text) || ((text == "") && (this._minimumPrefixLength == 0))) { + this._currentPrefix = text; + if ((text != "") && this._cache && this._cache[text]) { + this._update(text, this._cache[text], /* cacheResults */false); + return; + } + // Raise the populating event and optionally cancel the web service invocation + var eventArgs = new Sys.CancelEventArgs(); + this.raise_populating(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + // Create the service parameters and optionally add the context parameter + // (thereby determining which method signature we're expecting...) + var params = { prefixText: this._currentPrefix, count: this._completionSetCount }; + if (this._useContextKey) { + params.contextKey = this._contextKey; + } + + if (this._webRequest) { + // abort the previous web service call if we + // are issuing a new one and the previous one is + // active. + this._webRequest.get_executor().abort(); + this._webRequest = null; + } + // Invoke the web service + this._webRequest = Sys.Net.WebServiceProxy.invoke(this.get_servicePath(), this.get_serviceMethod(), false, params, + Function.createDelegate(this, this._onMethodComplete), + Function.createDelegate(this, this._onMethodFailed), + text); + $common.updateFormToRefreshATDeviceBuffer(); + } + } + }, + + _setText: function(item) { + var text = (item && item.firstChild) ? item.firstChild.nodeValue : null; + this._timer.set_enabled(false); + + var element = this.get_element(); + var control = element.control; + var newText = this._showOnlyCurrentWordInCompletionListItem ? this._getTextWithInsertedWord(text) : text; + if (control && control.set_text) { + control.set_text(newText); + } else { + element.value = newText; + } + $common.tryFireEvent(element, "change"); + + this.raise_itemSelected(new Sys.Extended.UI.AutoCompleteItemEventArgs(item, text, item ? item._value : null)); + + this._currentPrefix = this._currentCompletionWord(); + this._hideCompletionList(); + }, + + _update: function(prefixText, completionItems, cacheResults) { + if (cacheResults && this.get_enableCaching()) { + if (!this._cache) { + this._cache = {}; + } + this._cache[prefixText] = completionItems; + } + + // If the target control loses focus or + // if the value in textbox has changed before the webservice returned + // completion items we don't need to show popup + if ((!this._textBoxHasFocus) || (prefixText != this._currentCompletionWord())) { + this._hideCompletionList(); + return; + } + + if (completionItems && completionItems.length) { + this._completionListElement.innerHTML = ''; + this._selectIndex = -1; + var _firstChild = null; + var text = null; + var value = null; + + for (var i = 0; i < completionItems.length; i++) { + // Create the item + var itemElement = null; + if (this._completionListElementID) { + // the completion element has been created by the user and li won't necessarily work + itemElement = document.createElement('div'); + } else { + itemElement = document.createElement('li'); + } + + // set the first child if it is null + if (_firstChild == null) { + _firstChild = itemElement; + } + + // Get the text/value for the item + try { + var pair = Sys.Serialization.JavaScriptSerializer.deserialize('(' + completionItems[i] + ')'); + if (pair && pair.First) { + // Use the text and value pair returned from the web service + text = pair.First; + value = pair.Second; + } + else { + // If the web service only returned a regular string, use it for + // both the text and the value + text = completionItems[i]; + value = text; + } + } catch (ex) { + text = completionItems[i]; + value = completionItems[i]; + } + + + // Set the text/value for the item + // ShowOnlyCurrentWordInCompletionListItem support + var optionText = this._showOnlyCurrentWordInCompletionListItem ? text : this._getTextWithInsertedWord(text); + itemElement.appendChild(document.createTextNode(optionText)); + itemElement._value = value; + itemElement.__item = ''; + + if (this._completionListItemCssClass) { + Sys.UI.DomElement.addCssClass(itemElement, this._completionListItemCssClass); + } else { + var itemElementStyle = itemElement.style; + itemElementStyle.padding = '0px'; + itemElementStyle.textAlign = 'left'; + itemElementStyle.textOverflow = 'ellipsis'; + // workaround for safari since normal colors do not + // show well there. + if (Sys.Browser.agent === Sys.Browser.Safari) { + itemElementStyle.backgroundColor = 'white'; + itemElementStyle.color = 'black'; + } else { + itemElementStyle.backgroundColor = this._textBackground; + itemElementStyle.color = this._textColor; + } + } + this._completionListElement.appendChild(itemElement); + } + var elementBounds = $common.getBounds(this.get_element()); + this._completionListElement.style.width = Math.max(1, elementBounds.width - 2) + 'px'; + this._completionListElement.scrollTop = 0; + + this.raise_populated(Sys.EventArgs.Empty); + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + if (!eventArgs.get_cancel()) { + this.showPopup(); + // Check if the first Row is to be selected by default and if yes highlight it and updated selectIndex. + if (this._firstRowSelected && (_firstChild != null)) { + this._highlightItem(_firstChild); + this._selectIndex = 0; + } + } + } else { + this._hideCompletionList(); + } + }, + + /// + /// Generic OnShow Animation's JSON definition + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if (this._popupBehavior) { + this._popupBehavior.set_onShow(value) + } else { + this._onShowJson = value; + } + this.raisePropertyChanged('onShow'); + }, + + /// + /// Generic OnShow Animation's behavior + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Play the OnShow animation + /// + /// + onShow: function() { + if (this._popupBehavior) { + this._popupBehavior.onShow(); + } + }, + + /// + /// Generic OnHide Animation's JSON definition + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if (this._popupBehavior) { + this._popupBehavior.set_onHide(value) + } else { + this._onHideJson = value; + } + this.raisePropertyChanged('onHide'); + }, + + /// + /// Generic OnHide Animation's behavior + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Play the OnHide animation + /// + /// + onHide: function() { + if (this._popupBehavior) { + this._popupBehavior.onHide(); + } + }, + + get_completionInterval: function() { + return this._completionInterval; + }, + set_completionInterval: function(value) { + if (this._completionInterval != value) { + this._completionInterval = value; + this.raisePropertyChanged('completionInterval'); + } + }, + + get_completionList: function() { + return this._completionListElement; + }, + set_completionList: function(value) { + if (this._completionListElement != value) { + this._completionListElement = value; + this.raisePropertyChanged('completionList'); + } + }, + + get_completionSetCount: function() { + return this._completionSetCount; + }, + set_completionSetCount: function(value) { + if (this._completionSetCount != value) { + this._completionSetCount = value; + this.raisePropertyChanged('completionSetCount'); + } + }, + + get_minimumPrefixLength: function() { + return this._minimumPrefixLength; + }, + set_minimumPrefixLength: function(value) { + if (this._minimumPrefixLength != value) { + this._minimumPrefixLength = value; + this.raisePropertyChanged('minimumPrefixLength'); + } + }, + + get_serviceMethod: function() { + return this._serviceMethod; + }, + set_serviceMethod: function(value) { + if (this._serviceMethod != value) { + this._serviceMethod = value; + this.raisePropertyChanged('serviceMethod'); + } + }, + + get_servicePath: function() { + return this._servicePath; + }, + set_servicePath: function(value) { + if (this._servicePath != value) { + this._servicePath = value; + this.raisePropertyChanged('servicePath'); + } + }, + + get_contextKey: function() { + return this._contextKey; + }, + set_contextKey: function(value) { + if (this._contextKey != value) { + this._contextKey = value; + this.set_useContextKey(true); + this.raisePropertyChanged('contextKey'); + } + }, + + get_useContextKey: function() { + return this._useContextKey; + }, + set_useContextKey: function(value) { + if (this._useContextKey != value) { + this._useContextKey = value; + this.raisePropertyChanged('useContextKey'); + } + }, + + get_enableCaching: function() { + return this._enableCaching; + }, + set_enableCaching: function(value) { + if (this._enableCaching != value) { + this._enableCaching = value; + this.raisePropertyChanged('enableCaching'); + } + }, + + get_completionListElementID: function() { + return this._completionListElementID; + }, + set_completionListElementID: function(value) { + if (this._completionListElementID != value) { + this._completionListElementID = value; + this.raisePropertyChanged('completionListElementID'); + } + }, + + get_completionListCssClass: function() { + return this._completionListCssClass; + }, + set_completionListCssClass: function(value) { + if (this._completionListCssClass != value) { + this._completionListCssClass = value; + this.raisePropertyChanged('completionListCssClass'); + } + }, + + get_completionListItemCssClass: function() { + return this._completionListItemCssClass; + }, + set_completionListItemCssClass: function(value) { + if (this._completionListItemCssClass != value) { + this._completionListItemCssClass = value; + this.raisePropertyChanged('completionListItemCssClass'); + } + }, + + get_highlightedItemCssClass: function() { + return this._highlightedItemCssClass; + }, + set_highlightedItemCssClass: function(value) { + if (this._highlightedItemCssClass != value) { + this._highlightedItemCssClass = value; + this.raisePropertyChanged('highlightedItemCssClass'); + } + }, + + get_delimiterCharacters: function() { + return this._delimiterCharacters; + }, + set_delimiterCharacters: function(value) { + if (this._delimiterCharacters != value) { + this._delimiterCharacters = value; + this.raisePropertyChanged('delimiterCharacters'); + } + }, + + get_firstRowSelected: function() { + return this._firstRowSelected; + }, + set_firstRowSelected: function(value) { + if (this._firstRowSelected != value) { + this._firstRowSelected = value; + this.raisePropertyChanged('firstRowSelected'); + } + }, + + get_showOnlyCurrentWordInCompletionListItem: function() { + return this._showOnlyCurrentWordInCompletionListItem; + }, + set_showOnlyCurrentWordInCompletionListItem: function(value) { + if (this._showOnlyCurrentWordInCompletionListItem != value) { + this._showOnlyCurrentWordInCompletionListItem = value; + this.raisePropertyChanged('showOnlyCurrentWordInCompletionListItem'); + } + }, + + /// + /// Occurs when a control is populating. + /// + /// + /// + add_populating: function(handler) { + this.get_events().addHandler('populating', handler); + }, + remove_populating: function(handler) { + this.get_events().removeHandler('populating', handler); + }, + raise_populating: function(eventArgs) { + // The populating event can be used to provide custom data to AutoComplete + // instead of using a web service. Just cancel the event (using the + // CancelEventArgs) and pass your own data to the _update method. + var handler = this.get_events().getHandler('populating'); + if (handler) + handler(this, eventArgs); + }, + raisePopulating: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulating(eventArgs)", "raise_populating(eventArgs)"); + this.raise_populating(eventArgs); + }, + + /// + /// Occurs when a control is populated. + /// + /// + /// + add_populated: function(handler) { + this.get_events().addHandler('populated', handler); + }, + remove_populated: function(handler) { + this.get_events().removeHandler('populated', handler); + }, + raise_populated: function(eventArgs) { + var handler = this.get_events().getHandler('populated'); + if (handler) + handler(this, eventArgs); + }, + raisePopulated: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulated(eventArgs)", "raise_populated(eventArgs)"); + this.raise_populated(eventArgs); + }, + + /// + /// Occurs when a control is showing. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if (handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Occurs when a control is shown. + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler('shown', handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler('shown', handler); + }, + raise_shown: function(eventArgs) { + var handler = this.get_events().getHandler('shown'); + if (handler) + handler(this, eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Occurs when a control is hiding. + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler('hiding', handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler('hiding', handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if (handler) + handler(this, eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Occurs when a control is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + if (handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + }, + + /// + /// Occurs when an item is selected. + /// + /// + /// + add_itemSelected: function(handler) { + this.get_events().addHandler('itemSelected', handler); + }, + remove_itemSelected: function(handler) { + this.get_events().removeHandler('itemSelected', handler); + }, + raise_itemSelected: function(eventArgs) { + var handler = this.get_events().getHandler('itemSelected'); + if (handler) + handler(this, eventArgs); + }, + raiseItemSelected: function(eventArgs) { + Sys.Extended.Deprecated("raiseItemSelected(eventArgs)", "raise_itemSelected(eventArgs)"); + this.raise_itemSelected(eventArgs); + }, + + /// + /// Occurs when the mouse cursor is over item. + /// + /// + /// + add_itemOver: function(handler) { + this.get_events().addHandler('itemOver', handler); + }, + remove_itemOver: function(handler) { + this.get_events().removeHandler('itemOver', handler); + }, + raise_itemOver: function(eventArgs) { + var handler = this.get_events().getHandler('itemOver'); + if (handler) + handler(this, eventArgs); + }, + raiseItemOver: function(eventArgs) { + Sys.Extended.Deprecated("raiseItemOver(eventArgs)", "raise_itemOver(eventArgs)"); + this.raise_itemOver(eventArgs); + }, + + /// + /// Occurs when the mouse cursor is out of the item. + /// + /// + /// + add_itemOut: function(handler) { + this.get_events().addHandler('itemOut', handler); + }, + remove_itemOut: function(handler) { + this.get_events().removeHandler('itemOut', handler); + }, + raise_itemOut: function(eventArgs) { + var handler = this.get_events().getHandler('itemOut'); + if (handler) + handler(this, eventArgs); + }, + raiseItemOut: function(eventArgs) { + Sys.Extended.Deprecated("raiseItemOut(eventArgs)", "raise_itemOut(eventArgs)"); + this.raise_itemOut(eventArgs); + } +} +Sys.Extended.UI.AutoCompleteBehavior.registerClass('Sys.Extended.UI.AutoCompleteBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.AutoCompleteItemEventArgs = function(item, text, value) { + Sys.Extended.UI.AutoCompleteItemEventArgs.initializeBase(this); + + this._item = item; + this._text = text; + this._value = (value !== undefined) ? value : null; +} +Sys.Extended.UI.AutoCompleteItemEventArgs.prototype = { + get_item : function() { + return this._item; + }, + set_item : function(value) { + this._item = value; + }, + + get_text : function() { + return this._text; + }, + set_text : function(value) { + this._text = value; + }, + + get_value : function() { + // Value of the item different from text if specifically returned by the webservice + // as autocomplete json text/value item(using AutoComplete.CreateAutoCompleteItem); otherwise same as text. + return this._value; + }, + set_value : function(value) { + this._value = value; + } +} +Sys.Extended.UI.AutoCompleteItemEventArgs.registerClass('Sys.Extended.UI.AutoCompleteItemEventArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js new file mode 100644 index 000000000..e157ebc43 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js @@ -0,0 +1,1035 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.BalloonPopupControlBehavior = function(element) { + // The BalloonPopupControlBehavior opens a popup window next to the target element + Sys.Extended.UI.BalloonPopupControlBehavior.initializeBase(this, [element]); + + /// + /// The ID of the control to display + /// + /// get_balloonPopupControlID + /// set_balloonPopupControlID + /// + this._balloonPopupControlID = null; + + /// + /// Optional setting specifying where the popup should be positioned relative to the target control. + /// Default value is Auto + /// + /// get_balloonPopupPosition + /// set_balloonPopupPosition + /// + this._position = Sys.Extended.UI.BalloonPopupPosition.Auto; + + /// + /// Optional setting specifying the theme of balloon popup. + /// Default value is Rectangle + /// + /// get_balloonPopupStyle + /// set_balloonPopupStyle + /// + this._balloonStyle = Sys.Extended.UI.BalloonPopupStyle.Rectangle; + + /// + /// Optional X (horizontal) offset for the popup window (relative to the target control) + /// + /// get_offsetX + /// set_offsetX + /// + this._offsetX = 0; + + /// + /// Optional Y (horizontal) offset for the popup window (relative to the target control) + /// + /// get_offsetY + /// set_offsetY + /// + this._offsetY = 0; + + /// + /// Extender control ID + /// + /// get_extenderControlID + /// set_extenderControlID + /// + this._extenderControlID = null; + + /// + /// Optional setting specifying whether to display balloon popup on the client onMouseOver event. Default value is false + /// + /// get_displayOnMouseOver + /// set_displayOnMouseOver + /// + this._displayOnMouseOver = false; + + /// + /// Optional setting specifying whether to display balloon popup on the client onFocus event. Default value is false + /// + /// get_displayOnFocus + /// set_displayOnFocus + /// + this._displayOnFocus = false; + + /// + /// Optional setting specifying whether to display balloon popup on the client onClick event. Default value is true + /// + /// get_displayOnClick + /// set_displayOnClick + /// + this._displayOnClick = true; + + /// + /// Optional setting specifying the size of balloon popup. Default value is Small + /// + /// get_balloonSize + /// set_balloonSize + /// + this._balloonSize = "small"; + + /// + /// Optional setting specifying whether to display shadow of balloon popup or not. + /// Default value is true + /// + /// get_useShadow + /// set_useShadow + /// + this._shadow = true; + + /// + /// Optional setting specifying whether to display scrollbar if contents are overflowing. + /// Default value is Auto + /// + /// get_scrollBars + /// set_scrollBars + /// + this._scrollBars = Sys.Extended.UI.ScrollBars.Auto; + + // Variables + this._popupElement = null; + this._styleElement = null; + this._sizeElement = null; + this._shadowElement = null; + this._directionElement = null; + this._contentElement = null; + this._popupBehavior = null; + + /// + /// Whether popup is visible. + /// Default value is false + /// + /// get_popupVisible + /// + this._popupVisible = false; + this._focusHandler = null; + this._mouseOverHandler = null; + this._clickHandler = null; + this._popupClickHandler = null; + this._bodyClickHandler = null; + this._onShowJson = null; + this._onHideJson = null; + this._popupWidth = 0; + this._popupHeight = 0; + this._AutoPosition = null; // to hold correct position when Position mode is auto + this._directionClassName = null; // temporary store class names for direction and shadow elements +} +Sys.Extended.UI.BalloonPopupControlBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this, "initialize"); + + // Identify popup element from control id + var e = this.get_element(); + + this.createPopupElement(); + // Hook up a PopupBehavior + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, { "id": this.get_id() + "BalloonPopupBehavior", "parentElement": e }, null, null, this._popupElement); + + // Create the animations (if they were set before initialize was called) + if(this._onShowJson) { + this._popupBehavior.set_onShow(this._onShowJson); + } + if(this._onHideJson) { + this._popupBehavior.set_onHide(this._onHideJson); + } + + // Create delegates + if(this._displayOnFocus) { + this._focusHandler = Function.createDelegate(this, this._onFocus); + } + if(this._displayOnMouseOver) { + this._mouseOverHandler = Function.createDelegate(this, this._onMouseOver); + } + if(this._displayOnClick) { + this._clickHandler = Function.createDelegate(this, this._onFocus); + } + + this._popupClickHandler = Function.createDelegate(this, this._onPopupClick); + this._bodyClickHandler = Function.createDelegate(this, this._onBodyClick); + + // Attach events + if(this._displayOnFocus) { + $addHandler(e, "focus", this._focusHandler); + } + if(this._displayOnMouseOver) { + $addHandler(e, "mouseover", this._mouseOverHandler); + } + if(this._displayOnClick) { + $addHandler(e, "click", this._clickHandler); + } + $addHandler(document, "click", this._bodyClickHandler); + $addHandler(this._popupElement, "click", this._popupClickHandler); + }, + + dispose: function() { + var e = this.get_element(); + + this._onShowJson = null; + this._onHideJson = null; + + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + if(this._focusHandler) { + $removeHandler(e, "focus", this._focusHandler); + this._focusHandler = null; + } + if(this._mouseOverHandler) { + $removeHandler(e, "mouseover", this._mouseOverHandler); + this._mouseOverHandler = null; + } + if(this._clickHandler) { + $removeHandler(e, "click", this._clickHandler); + this._clickHandler = null; + } + + if(this._bodyClickHandler) { + $removeHandler(document, "click", this._bodyClickHandler); + this._bodyClickHandler = null; + } + if(this._popupClickHandler) { + $removeHandler(this._popupElement, "click", this._popupClickHandler); + this._popupClickHandler = null; + } + + Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this, "dispose"); + }, + + createPopupElement: function() { + var e = this.get_element(); + + // create main container for balloon popup + this._popupElement = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: this.get_id() + "_balloonPopup", + style: { + display: "block", + position: "absolute" + } + }, + cssClasses: ["ajax__balloon_popup"] + }, e.parentNode); + + // create element for theme/style + this._styleElement = $common.createElementFromTemplate({ + nodeName: "span", + Properties: { + id: "ajax__style_wrapper" + } + }, this._popupElement); + + // create element for balloonpopup size + this._sizeElement = $common.createElementFromTemplate({ + nodeName: "span", + Properties: { + id: "ajax__size_wrapper" + } + }, this._styleElement); + + // create element for shadow + this._shadowElement = $common.createElementFromTemplate({ + nodeName: "div", + Properties: { + id: "ajax__shadow_wrapper" + } + }, this._sizeElement); + + // create element for direction of arrow + this._directionElement = $common.createElementFromTemplate({ + nodeName: "div", + Properties: { + id: "ajax__direction_wrapper" + } + }, this._shadowElement); + + // create element to hold contents + this._contentElement = $common.createElementFromTemplate({ + nodeName: "div", + Properties: { + id: "ajax__content" + }, + cssClasses: ["ajax__content"] + }, this._directionElement); + + if($get(this._balloonPopupControlID) == null) + throw "Referred BalloonPopupControlId did not find."; + $get(this._balloonPopupControlID).style.display = 'none'; + + // set theme/style as per user's setting + this.setStyle(); + // set size of balloon popup + this.setSize(); + // set class name to directionElement to set height and width of balloon popup + this._directionElement.className = this._directionClassName; + + this._popupWidth = this._directionElement.offsetWidth; + this._popupHeight = this._directionElement.offsetHeight; + + if(this.get_balloonPopupPosition() != Sys.Extended.UI.BalloonPopupPosition.Auto) { + // set position of arrow and drop shadow + this.setPosition(); + this.setContentPadding(); + this.setScrollBar(); + } + }, + + setStyle: function() { + switch(this.get_balloonPopupStyle()) { + case Sys.Extended.UI.BalloonPopupStyle.Rectangle: + this._styleElement.className = "rect"; + this._directionClassName = "rect"; + break; + case Sys.Extended.UI.BalloonPopupStyle.Cloud: + this._styleElement.className = "cloud"; + this._directionClassName = "cloud"; + break; + case Sys.Extended.UI.BalloonPopupStyle.Custom: + this._styleElement.className = this.get_customClassName(); + this._directionClassName = this.get_customClassName(); + break; + default: + this._styleElement.className = "rect"; + this._directionClassName = "rect"; + break; + } + }, + + setSize: function() { + switch(this.get_balloonSize()) { + case Sys.Extended.UI.BalloonPopupSize.Small: + this._sizeElement.className += " small"; + this._directionClassName += " small"; + break; + case Sys.Extended.UI.BalloonPopupSize.Medium: + this._sizeElement.className += " medium"; + this._directionClassName += " medium"; + break; + case Sys.Extended.UI.BalloonPopupSize.Large: + this._sizeElement.className += " large"; + this._directionClassName += " large"; + break; + default: + this._sizeElement.className += " small"; + this._directionClassName += " small"; + break; + } + }, + + setPosition: function() { + var currentPosition = null; + if(this.get_balloonPopupPosition() == Sys.Extended.UI.BalloonPopupPosition.Auto) { + currentPosition = this._autoPosition; + } + else { + currentPosition = this.get_balloonPopupPosition(); + } + + switch(currentPosition) { + case Sys.Extended.UI.BalloonPopupPosition.TopLeft: + this._directionElement.className = this._directionClassName + " top_left"; + this._shadowElement.className = this._directionClassName + " top_left_shadow"; + break; + case Sys.Extended.UI.BalloonPopupPosition.TopRight: + this._directionElement.className = this._directionClassName + " top_right"; + this._shadowElement.className = this._directionClassName + " top_right_shadow"; + break; + case Sys.Extended.UI.BalloonPopupPosition.BottomLeft: + this._directionElement.className = this._directionClassName + " bottom_left"; + this._shadowElement.className = this._directionClassName + " bottom_left_shadow"; + break; + case Sys.Extended.UI.BalloonPopupPosition.BottomRight: + this._directionElement.className = this._directionClassName + " bottom_right"; + this._shadowElement.className = this._directionClassName + " bottom_right_shadow"; + break; + default: + this._directionElement.className = this._directionClassName + " top_right"; + this._shadowElement.className = this._directionClassName + " top_right_shadow"; + break; + } + }, + + setContentPadding: function() { + var contentPadding = $common.getPaddingBox(this._contentElement); + var content = $get(this._balloonPopupControlID); + $common.setBounds(content, + { + x: this._offsetX + contentPadding.left, + y: this._offsetY + contentPadding.top, + width: this._popupWidth - contentPadding.left - contentPadding.right, + height: this._popupHeight - contentPadding.top - contentPadding.bottom + }); + }, + + setScrollBar: function() { + // Set overflow style for balloon popup contents + var content = $get(this._balloonPopupControlID); + switch(this.get_scrollBars()) { + case Sys.Extended.UI.ScrollBars.Horizontal: + $common.setStyle(content, { overflowX: "scroll", overflowY: "hidden" }); + break; + case Sys.Extended.UI.ScrollBars.Vertical: + $common.setStyle(content, { overflowY: "scroll", overflowX: "hidden" }); + break; + case Sys.Extended.UI.ScrollBars.Both: + $common.setStyle(content, { overflow: "scroll" }); + break; + case Sys.Extended.UI.ScrollBars.None: + $common.setStyle(content, { overflow: "hidden" }); + break; + default: + $common.setStyle(content, { overflow: "auto" }); + break; + } + }, + + /// + /// Shows the popup + /// + /// + showPopup: function() { + this._contentElement.appendChild($get(this._balloonPopupControlID)); + $get(this._balloonPopupControlID).style.display = 'block'; + + if(Sys.Extended.UI.BalloonPopupPosition.Auto == this._position) { + this._setAutoPosition(); + this.setPosition(); + this.setContentPadding(); + this.setScrollBar(); + } + + // don't display shadow if user set useShadow property to false + if(!this._shadow) { + this._shadowElement.className = ""; + } + + var old = Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup; + if(old && old._popupBehavior) { + old.hidePopup(); + } + + Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this, "populate"); + + this._popupBehavior.set_x(this._getLeftOffset()); + this._popupBehavior.set_y(this._getTopOffset()); + this._popupBehavior.show(); + + this._popupVisible = true; + Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup = this; + + // fix main background position demanded by IE7 + var bgPosX = $common.getCurrentStyle(this._directionElement, "backgroundPositionX"); + var bgPosY = $common.getCurrentStyle(this._directionElement, "backgroundPositionY"); + $common.setStyle(this._styleElement, { backgroundPositionX: bgPosX, backgroundPositionY: bgPosY }); + }, + + /// + /// Hides the popup + /// + /// + hidePopup: function() { + this._popupBehavior.hide(); + this._popupVisible = false; + Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup = null; + }, + + _onFocus: function(e) { + // Show the balloon popup when its control is focused + + // Set the popup position and display it + if(!this._popupVisible) { + this.showPopup(); + } + if(e) { + e.stopPropagation(); + } + }, + + _onMouseOver: function(e) { + // Show the balloon popup when its control is mouse over + + // Set the popup position and display it + if(!this._popupVisible) { + this.showPopup(); + } + if(e) { + e.stopPropagation(); + } + }, + + _onPopupClick: function(e) { + e.stopPropagation(); + }, + + _onBodyClick: function() { + // Hide the popup if something other than our target or popup + // was clicked (since each of these stop the event from bubbling + // up to the body) + if(this._popupVisible) { + this.hidePopup(); + } + }, + + _onPopulated: function(sender, eventArgs) { + Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this, "_onPopulated", [sender, eventArgs]); + + // Dynamic populate may have added content; re-layout to accomodate it + if(this._popupVisible) { + this._popupBehavior.show(); + } + }, + + _getLeftOffset: function() { + // Get the left offset for the balloon popup + var xoffSet = 0; + var currentPosition = Sys.Extended.UI.BalloonPopupPosition.Auto == this._position ? this._autoPosition : this._position; + if(Sys.Extended.UI.BalloonPopupPosition.BottomLeft == currentPosition || Sys.Extended.UI.BalloonPopupPosition.TopLeft == currentPosition) { + xoffSet = (-1 * (this._popupWidth)) + this._offsetX; + } else if(Sys.Extended.UI.BalloonPopupPosition.BottomRight == currentPosition || Sys.Extended.UI.BalloonPopupPosition.TopRight == currentPosition) { + xoffSet = this.get_element().offsetWidth + this._offsetX; + } else { + xoffSet = this._offsetX; + } + return xoffSet; + }, + + _getTopOffset: function() { + var yoffSet = 0; + var currentPosition = Sys.Extended.UI.BalloonPopupPosition.Auto == this._position ? this._autoPosition : this._position; + if(Sys.Extended.UI.BalloonPopupPosition.TopLeft == currentPosition || Sys.Extended.UI.BalloonPopupPosition.TopRight == currentPosition) { + yoffSet = (-1 * (this._popupHeight)) + this._offsetY; + } else if(Sys.Extended.UI.BalloonPopupPosition.BottomLeft == currentPosition || Sys.Extended.UI.BalloonPopupPosition.BottomRight == currentPosition) { + yoffSet = (this.get_element().offsetHeight) + this._offsetY; + } else { + yoffSet = this._offsetY; + } + return yoffSet; + }, + + _setAutoPosition: function() { + // get elements absolute left and top position + var _elementTopPosition = 0; + var _elementLeftPosition = 0; + var e = this.get_element(); + if(e.offsetParent) { + do { + _elementLeftPosition += e.offsetLeft; + _elementTopPosition += e.offsetTop; + } while(e = e.offsetParent); + } + + var _pageTopPosition = this.posTop(); + var _pageLeftPosition = this.posLeft(); + var _pagewidth = this.pageWidth(); + var _pageHeight = this.pageHeight(); + var _pageBottom = _pageTopPosition + _pageHeight; + var _pageRight = _pageLeftPosition + _pagewidth; + + var _popTopPosition = _elementTopPosition - this._popupHeight; + var _popLeftPosition = _elementLeftPosition - this._popupWidth; + var _popBottomPosition = _elementTopPosition + this.get_element().offsetHeight + this._popupHeight; + var _popRightPosition = _elementLeftPosition + this.get_element().offsetWidth + this._popupWidth; + + if((_popTopPosition - _pageTopPosition) > 0 && ((_popTopPosition - _pageTopPosition) > (_pageBottom - _popBottomPosition))) { + if(_pageRight < _popRightPosition) { + this._autoPosition = Sys.Extended.UI.BalloonPopupPosition.TopLeft; + } + else { + this._autoPosition = Sys.Extended.UI.BalloonPopupPosition.TopRight; + } + } + else { + if(_pageRight < _popRightPosition) { + this._autoPosition = Sys.Extended.UI.BalloonPopupPosition.BottomLeft; + } + else { + this._autoPosition = Sys.Extended.UI.BalloonPopupPosition.BottomRight; + } + } + }, + + /// + /// Generic OnShow Animation's JSON definition + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._popupBehavior) { + this._popupBehavior.set_onShow(value) + } else { + this._onShowJson = value; + } + this.raisePropertyChanged("onShow"); + }, + + /// + /// Generic OnShow Animation's behavior + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Play the OnShow animation + /// + /// + onShow: function() { + if(this._popupBehavior) { + this._popupBehavior.onShow(); + } + }, + + /// + /// Generic OnHide Animation's JSON definition + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._popupBehavior) { + this._popupBehavior.set_onHide(value) + } else { + this._onHideJson = value; + } + this.raisePropertyChanged("onHide"); + }, + + /// + /// Generic OnHide Animation's behavior + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Play the OnHide animation + /// + /// + onHide: function() { + if(this._popupBehavior) { + this._popupBehavior.onHide(); + } + }, + + get_balloonPopupControlID: function() { + return this._balloonPopupControlID; + }, + set_balloonPopupControlID: function(value) { + if(this._balloonPopupControlID != value) { + this._balloonPopupControlID = value; + this.raisePropertyChanged("balloonPopupControlID"); + } + }, + + get_BalloonPopupControlID: function() { + Sys.Extended.Deprecated("get_BalloonPopupControlID", "get_balloonPopupControlID"); + return this.get_balloonPopupControlID(); + }, + set_BalloonPopupControlID: function(value) { + Sys.Extended.Deprecated("set_BalloonPopupControlID", "set_balloonPopupControlID"); + this.set_balloonPopupControlID(value); + }, + + get_balloonPopupPosition: function() { + // Where the balloon popup should be positioned relative to the target control. (Left, Right, Top, Bottom) + return this._position; + }, + set_balloonPopupPosition: function(value) { + if(this._position != value) { + this._position = value; + this.raisePropertyChanged("Position"); + } + }, + + get_balloonPopupStyle: function() { + return this._balloonStyle; + }, + set_balloonPopupStyle: function(value) { + if(this._balloonStyle != value) { + this._balloonStyle = value; + this.raisePropertyChanged("balloonStyle"); + } + }, + + get_extenderControlID: function() { + return this._extenderControlID; + }, + set_extenderControlID: function(value) { + if(this._extenderControlID != value) { + this._extenderControlID = value; + this.raisePropertyChanged("extenderControlID"); + } + }, + + get_ExtenderControlID: function() { + Sys.Extended.Deprecated("get_ExtenderControlID", "get_extenderControlID"); + return this.get_extenderControlID(); + }, + set_ExtenderControlID: function(value) { + Sys.Extended.Deprecated("set_ExtenderControlID", "set_extenderControlID"); + this.set_extenderControlID(value); + }, + + get_offsetX: function() { + return this._offsetX; + }, + set_offsetX: function(value) { + if(this._offsetX != value) { + this._offsetX = value; + this.raisePropertyChanged("offsetX"); + } + }, + + get_OffsetX: function() { + Sys.Extended.Deprecated("get_OffsetX", "get_offsetX"); + return this.get_offsetX(); + }, + set_OffsetX: function(value) { + Sys.Extended.Deprecated("set_OffsetX", "set_offsetX"); + this.set_offsetX(value); + }, + + get_offsetY: function() { + return this._offsetY; + }, + set_offsetY: function(value) { + if(this._offsetY != value) { + this._offsetY = value; + this.raisePropertyChanged("offsetY"); + } + }, + + get_OffsetY: function() { + Sys.Extended.Deprecated("get_OffsetY", "get_offsetY"); + return this.get_offsetY(); + }, + set_OffsetY: function(value) { + Sys.Extended.Deprecated("set_OffsetY", "set_offsetY"); + this.set_offsetY(value); + }, + + get_displayOnMouseOver: function() { + return this._displayOnMouseOver; + }, + set_displayOnMouseOver: function(value) { + if(this._displayOnMouseOver != value) { + this._displayOnMouseOver = value; + this.raisePropertyChanged("displayOnMouseOver"); + } + }, + + get_displayOnFocus: function() { + return this._displayOnFocus; + }, + set_displayOnFocus: function(value) { + if(this._displayOnFocus != value) { + this._displayOnFocus = value; + this.raisePropertyChanged("displayOnFocus"); + } + }, + + get_displayOnClick: function() { + return this._displayOnClick; + }, + set_displayOnClick: function(value) { + if(this._displayOnClick != value) { + this._displayOnClick = value; + this.raisePropertyChanged("displayOnClick"); + } + }, + + get_balloonSize: function() { + // small, medium or large + return this._balloonSize; + }, + set_balloonSize: function(value) { + if(this._balloonSize != value) { + this._balloonSize = value; + this.raisePropertyChanged("balloonSize"); + } + }, + + get_useShadow: function() { + return this._shadow; + }, + set_useShadow: function(value) { + if(this._shadow != value) { + this._shadow = value; + this.raisePropertyChanged("useShadow"); + } + }, + + get_scrollBars: function() { + return this._scrollBars; + }, + set_scrollBars: function(value) { + if(this._scrollBars != value) { + this._scrollBars = value; + this.raisePropertyChanged('scrollBars'); + } + }, + + get_popupVisible: function() { + return this._popupVisible; + }, + get_PopupVisible: function() { + Sys.Extended.Deprecated("get_PopupVisible", "get_popupVisible"); + return this.get_popupVisible(); + }, + + /// + /// This is required if user choose BalloonStyle to Custom. This specifies the name of + /// the css class for the custom theme + /// + /// get_customClassName + /// set_customClassName + /// + get_customClassName: function() { + return this._customClassName; + }, + set_customClassName: function(value) { + if(this._customClassName != value) { + this._customClassName = value; + this.raisePropertyChanged("customClassName"); + } + }, + + /// + /// Fires when popup is showing + /// + /// + /// + add_showing: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_showing(handler); + }, + remove_showing: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_showing(handler); + }, + raise_showing: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_showing(eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires when popup is shown + /// + /// + /// + add_shown: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_shown(handler); + }, + remove_shown: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_shown(handler); + }, + raise_shown: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_shown(eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Fires when popup is hiding + /// + /// + /// + add_hiding: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_hiding(handler); + }, + remove_hiding: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_hiding(handler); + }, + raise_hiding: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_hiding(eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires when popup is hidden + /// + /// + /// + add_hidden: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_hidden(handler); + }, + remove_hidden: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_hidden(handler); + }, + raise_hidden: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_hidden(eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + }, + + /// + /// Calculates popup top offset + /// + /// + posTop: function() { + var winTopPosition = 0; + + if(typeof window.pageYOffset != "undefined") { + winTopPosition = window.pageYOffset; + } + else if(document.documentElement && document.documentElement.scrollTop) { + winTopPosition = document.documentElement.scrollTop; + } + else if(document.body.scrollTop) { + winTopPosition = document.body.scrollTop; + } + return winTopPosition; + }, + + /// + /// Calculates popup left offset + /// + /// + posLeft: function() { + var winLeftPosition = 0; + + if(typeof window.pageXOffset != "undefined") { + winLeftPosition = window.pageXOffset; + } + else if(document.documentElement && document.documentElement.scrollLeft) { + winLeftPosition = document.documentElement.scrollLeft; + } + else if(document.body.scrollLeft) { + winLeftPosition = document.body.scrollLeft; + } + return winLeftPosition; + }, + + /// + /// Calculates container height + /// + /// + pageHeight: function() { + var _height = null; + + if(window.innerHeight != null) { + _height = window.innerHeight; + } + else if(document.documentElement && document.documentElement.clientHeight) { + _height = document.documentElement.clientHeight; + } + else if(document.body != null) { + _height = document.body.clientHeight; + } + return _height; + }, + + /// + /// Calculates container width + /// + /// + pageWidth: function() { + var _width = null; + + if(window.innerWidth != null) { + _width = window.innerWidth; + } + else if(document.documentElement && document.documentElement.clientWidth) { + _width = document.documentElement.clientWidth; + } + else if(document.body != null) { + _width = document.body.clientWidth; + } + return _width; + } +} +Sys.Extended.UI.BalloonPopupControlBehavior.registerClass("Sys.Extended.UI.BalloonPopupControlBehavior", Sys.Extended.UI.DynamicPopulateBehaviorBase); + +// This global variable tracks the currently visible popup. Automatically +// hiding the popup when focus is lost does not work with our mechanism to +// hide the popup when something else is clicked... So we will instead go for +// the weaker strategy of letting at most one popup be visible at a time. +Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup = null; + + +Sys.Extended.UI.BalloonPopupPosition = function() { + // Position of the popup relative to the target control + throw Error.invalidOperation(); +} +Sys.Extended.UI.BalloonPopupPosition.prototype = { + Auto: 0, + TopRight: 1, + TopLeft: 2, + BottomRight: 3, + BottomLeft: 4 +} + +Sys.Extended.UI.BalloonPopupPosition.registerEnum("Sys.Extended.UI.BalloonPopupPosition", false); + +Sys.Extended.UI.BalloonPopupStyle = function() { + // Style of the popup relative to the target control + throw Error.invalidOperation(); +} +Sys.Extended.UI.BalloonPopupStyle.prototype = { + Rectangle: 0, + Cloud: 1, + Custom: 2 +} + +Sys.Extended.UI.BalloonPopupStyle.registerEnum("Sys.Extended.UI.BalloonPopupStyle", false); + +Sys.Extended.UI.BalloonPopupSize = function() { + throw Error.invalidOperation(); +} +Sys.Extended.UI.BalloonPopupSize.prototype = { + Small: 0, + Medium: 1, + Large: 2 +} + +Sys.Extended.UI.BalloonPopupSize.registerEnum("Sys.Extended.UI.BalloonPopupSize", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js new file mode 100644 index 000000000..8bd19de5c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js @@ -0,0 +1,858 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.BarChart = function(element) { + Sys.Extended.UI.BarChart.initializeBase(this, [element]); + var id = this.get_id(); + id = id.replace("_ctl00", ""); + this._parentDiv = document.getElementById(id + "__ParentDiv"); + + this._chartWidth = '300'; + this._chartHeight = '200'; + this._chartTitle = ''; + this._categoriesAxis = ''; + this._series = null; + this._chartType = Sys.Extended.UI.BarChartType.Column; + this._theme = 'BarChart'; + this._valueAxisLines = 9; + this._chartTitleColor = ''; + this._valueAxisLineColor = ''; + this._categoryAxisLineColor = ''; + this._baseLineColor = ''; + + // variables + this.yMax = 0; + this.yMin = 0; + this.xMax = 0; + this.xMin = 0; + this.roundedTickRange = 0; + this.startX = 0; + this.startY = 0; + this.endX = 0; + this.endY = 0; + this.xInterval = 0; + this.yInterval = 0; + this.arrXAxis; + this.arrXAxisLength = 0; + this.arrYAxis; + this.arrYAxisLength = 0; + this.charLength = 3.5; + this.arrCombinedData = null; +} + +Sys.Extended.UI.BarChart.prototype = { + + initialize: function() { + Sys.Extended.UI.BarChart.callBaseMethod(this, "initialize"); + + if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) { + throw 'Browser does not support SVG.'; + } + + if(this._valueAxisLines == 0) { + this._valueAxisLines = 9; + } + + if(this._chartType == Sys.Extended.UI.BarChartType.Column || this._chartType == Sys.Extended.UI.BarChartType.StackedColumn) + this.generateColumnChart(); + else if(this._chartType == Sys.Extended.UI.BarChartType.Bar || this._chartType == Sys.Extended.UI.BarChartType.StackedBar) + this.generateBarChart(); + }, + + dispose: function() { + Sys.Extended.UI.BarChart.callBaseMethod(this, "dispose"); + }, + + generateColumnChart: function() { + this.arrXAxis = this._categoriesAxis.split(','); + this.arrXAxisLength = this.arrXAxis.length; + + this.calculateMinMaxValuesForColumnType(); + this.calculateIntervalForColumnType(); + this.calculateValueAxisForColumnType(); + + var svgContents = this.initializeSVG(); + + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + + svgContents = svgContents + this.drawBackgroundHorizontalLinesForColumnType(); + svgContents = svgContents + this.drawBackgroundVerticalLinesForColumnType(); + svgContents = svgContents + this.drawBaseLinesForColumnType(); + svgContents = svgContents + this.drawLegendArea(); + svgContents = svgContents + this.drawAxisValuesForColumnType(); + svgContents = svgContents + this.drawBarsForColumnType(); + + svgContents = svgContents + ''; + this._parentDiv.innerHTML = svgContents; + }, + + // This calculates distance interval for the value axis. + calculateIntervalForColumnType: function() { + this.startX = (this._chartWidth * 10 / 100) + 0.5; + this.endX = parseInt(this._chartWidth) - 4.5; + + if(this.yMin >= 0) + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 24 / 100)) + 0.5; + else + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 12 / 100)) / 2 + 0.5; + + this.yInterval = this.startY / (this._valueAxisLines + 1); + + }, + + // This calculates minimum and maximum values of the specified data. + calculateMinMaxValuesForColumnType: function(chartType) { + // calculate minimum and maximum value + var seriesMax; + var seriesMin; + var arrData; + + if(this._chartType == Sys.Extended.UI.BarChartType.Column) { + for(var i = 0; i < this._series.length; i++) { + arrData = this._series[i].Data; + seriesMax = Math.max.apply(null, arrData); + seriesMin = Math.min.apply(null, arrData); + + if(i == 0) { + this.yMax = seriesMax; + this.yMin = seriesMin; + } + else { + if(seriesMax > this.yMax) + this.yMax = seriesMax; + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + } + else { + this.arrCombinedData = null; + for(var i = 0; i < this._series.length; i++) { + arrData = new Array(); + for(var j = 0; j < this._series[i].Data.length; j++) { + arrData[j] = this._series[i].Data[j]; + } + if(this.arrCombinedData == null) + this.arrCombinedData = arrData; + else { + for(var j = 0; j < arrData.length; j++) { + this.arrCombinedData[j] = parseFloat(this.arrCombinedData[j]) + parseFloat(arrData[j]); + } + } + } + + for(var i = 0; i < this._series.length; i++) { + seriesMin = Math.min.apply(null, this._series[i].Data); + if(i == 0) { + this.yMin = seriesMin; + } + else { + + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + + this.yMax = Math.max.apply(null, this.arrCombinedData); + } + + if(this.yMin < 0) { + this._valueAxisLines = Math.round(this._valueAxisLines / 2); + } + }, + + // this calculates label values for Value axis to display on the chart. + calculateValueAxisForColumnType: function() { + // calculate value axis labels + var range; + var unroundedTickSize; + var x; + var pow10x; + + if(this.yMin >= 0) { + range = this.yMax; + } + else { + range = this.yMax > Math.abs(this.yMin) ? this.yMax : Math.abs(this.yMin); + } + + unroundedTickSize = range / (this._valueAxisLines - 1); + if(unroundedTickSize < 1) { + this.roundedTickRange = unroundedTickSize.toFixed(1); + } + else { + x = Math.ceil((Math.log(unroundedTickSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.roundedTickRange = Math.ceil(unroundedTickSize / pow10x) * pow10x; + } + + this.startX = this.startX + (this.roundedTickRange * 10 * this._valueAxisLines / 10).toString().length * this.charLength; + }, + + // This draws background horizontal lines of the chart. + drawBackgroundHorizontalLinesForColumnType: function() { + var horizontalLineContents = ''; + // background grid's horizontal lines + for(var i = 1; i <= this._valueAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY - (this.yInterval * i), this._categoryAxisLineColor); + } + + if(this.yMin < 0) { + // background grid's horizontal lines for negative values + for(var i = 1; i <= this._valueAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY + (this.yInterval * i), this._categoryAxisLineColor); + } + } + return horizontalLineContents; + }, + + // This draws background vertical lines of the chart. + drawBackgroundVerticalLinesForColumnType: function() { + // background grid's vertical lines + var verticalLineContents = ''; + this.xInterval = Math.round((parseInt(this._chartWidth) - this.startX) / this.arrXAxisLength); + + for(var i = 0; i < this.arrXAxisLength; i++) { + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + } + + if(this.yMin < 0) { + for(var i = 0; i < this.arrXAxisLength; i++) { + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + } + } + return verticalLineContents; + }, + + // This draws base lines of the chart. + drawBaseLinesForColumnType: function() { + var baseLineContents = ''; + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endX, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startY + 4, this._baseLineColor); + + for(var i = 0; i < this.arrXAxisLength; i++) { + baseLineContents = baseLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), this.startY, this.startY + 4, this._baseLineColor); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY - (this.yInterval * i), this._baseLineColor); + } + + if(this.yMin < 0) { + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + for(var i = 1; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY + (this.yInterval * i), this._baseLineColor); + } + } + return baseLineContents; + }, + + // This writes horizontal and vertical axis values of the chart. + drawAxisValuesForColumnType: function() { + var axisContents = ''; + var textLength = 0; + for(var i = 0; i < this.arrXAxisLength; i++) { + textLength = this.arrXAxis[i].toString().length * 5.5; + axisContents = axisContents + String.format('{2}', Math.round(this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 50 / 100) - (textLength)), this.startY + Math.round(this.yInterval * 65 / 100), this.arrXAxis[i]); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + textLength = (this.roundedTickRange * 10 * i / 10).toString().length * 5.5; + axisContents = axisContents + String.format('{2}', this.startX - textLength - 15, this.startY - (this.yInterval * 10 * i / 10) + 3.5, this.roundedTickRange * 10 * i / 10); + } + + if(this.yMin < 0) { + for(var i = 1; i <= this._valueAxisLines; i++) { + textLength = (this.roundedTickRange * 10 * i / 10).toString().length * 5.5; + axisContents = axisContents + String.format('-{2}', this.startX - textLength - 19, this.startY + (this.yInterval * 10 * i / 10), this.roundedTickRange * 10 * i / 10); + } + } + + return axisContents; + }, + + drawBarsForColumnType: function() { + // Bars section + var barContents = ''; + + var numberOfBars = this._series.length; + var widthBetweenBars = this.xInterval * 10 / 100; + var barWidth; + if(this._chartType == Sys.Extended.UI.BarChartType.Column) { + barWidth = Math.round(((this.xInterval * 80 / 100) - (widthBetweenBars * numberOfBars)) / numberOfBars); + } + else { + barWidth = Math.round(this.xInterval * 80 / 100); + } + + var barColor = ''; + for(var i = 0; i < this.arrXAxisLength; i++) { + barContents = barContents + ''; + if(this._chartType == Sys.Extended.UI.BarChartType.Column) { + for(var j = 0; j < this._series.length; j++) { + this.yVal = parseFloat(this._series[j].Data[i]); + if(i == 0) { + barContents = barContents + String.format('', this.startX + (this.xInterval * i) + (this.xInterval * 15 / 100) + ((widthBetweenBars + barWidth) * j), this.startX + (this.xInterval * i) + (this.xInterval * 15 / 100) + ((widthBetweenBars + barWidth) * j) + barWidth, this.startY, this.startY - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + } + else { + barContents = barContents + String.format('', this.startX + (this.xInterval * i) + (this.xInterval * 12.5 / 100) + ((widthBetweenBars + barWidth) * j), this.startX + (this.xInterval * i) + (this.xInterval * 12.5 / 100) + ((widthBetweenBars + barWidth) * j) + barWidth, this.startY, this.startY - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + } + if(this.yVal > 0) + barContents = barContents + String.format('{2}', this.startX + (this.xInterval * i) + (this.xInterval * 20 / 100) + ((widthBetweenBars + barWidth) * j) + (barWidth * 10 / 100) - Math.round((this.yVal.toString().length * this.charLength) / 2), this.startY - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)) - 7.5, this.yVal); + else + barContents = barContents + String.format('{2}', this.startX + (this.xInterval * i) + (this.xInterval * 20 / 100) + ((widthBetweenBars + barWidth) * j) + (barWidth * 10 / 100) - Math.round((this.yVal.toString().length * this.charLength) / 2), this.startY - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)) + 7.5, this.yVal); + } + } + else { + var lastStartYPositive = this.startY; + var lastStartYNegative = this.startY; + for(var j = 0; j < this._series.length; j++) { + this.yVal = parseFloat(this._series[j].Data[i]); + if(i == 0) { + if(this.yVal > 0) + barContents = barContents + String.format('', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 7.5 / 100), this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 7.5 / 100) + barWidth, lastStartYPositive, lastStartYPositive - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + else + barContents = barContents + String.format('', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 7.5 / 100), this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 7.5 / 100) + barWidth, lastStartYNegative, lastStartYNegative - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + } + else { + if(this.yVal > 0) + barContents = barContents + String.format('', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 5 / 100), this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 5 / 100) + barWidth, lastStartYPositive, lastStartYPositive - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + else + barContents = barContents + String.format('', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 5 / 100), this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 5 / 100) + barWidth, lastStartYNegative, lastStartYNegative - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)), j + 1, this._series[j].BarColor); + } + + if(this.yVal > 0) { + barContents = barContents + String.format('{2}', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 30 / 100) + (barWidth * 10 / 100), lastStartYPositive - Math.round((this.yVal * (this.yInterval / this.roundedTickRange)) / 2), this.yVal); + lastStartYPositive = lastStartYPositive - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)); + } + else { + barContents = barContents + String.format('{2}', this.startX + (this.xInterval * 10 * i / 10) + (this.xInterval * 30 / 100) + (barWidth * 10 / 100), lastStartYNegative + Math.round((Math.abs(this.yVal) * (this.yInterval / this.roundedTickRange)) / 2), this.yVal); + lastStartYNegative = lastStartYNegative - Math.round(this.yVal * (this.yInterval / this.roundedTickRange)); + } + } + } + barContents = barContents + ''; + } + + return barContents; + }, + + // This creates svg and its initial contents. + initializeSVG: function() { + var svgContents = String.format('', this._theme); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + + return svgContents; + }, + + // This draws legends of the chart. + drawLegendArea: function() { + var legendContents = ''; + // Legend Area + var legendAreaStartHeight = (parseInt(this._chartHeight) * 84 / 100) + 5; + var legendBoxWidth = 7.5; + var legendBoxHeight = 7.5; + var spaceInLegendContents = 5; + + // Get length of text to display in legend + var legendCharLength = 0; + for(var i = 0; i < this._series.length; i++) { + legendCharLength = legendCharLength + this._series[i].Name.length; + } + + var legendAreaWidth = Math.round((legendCharLength * 5) / 2) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._series.length); + var isLegendNextLine = false; + if(legendAreaWidth > parseInt(this._chartWidth) / 2) { + legendAreaWidth = legendAreaWidth / 2; + isLegendNextLine = true; + } + + legendContents = legendContents + ''; + legendContents = legendContents + String.format('', Math.round(parseInt(this._chartWidth) / 2 - legendAreaWidth / 2), legendAreaStartHeight, Math.round(parseInt(this._chartWidth) / 2 + legendAreaWidth / 2), Math.round(parseInt(this._chartHeight) * 97.5 / 100)); + + var startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + legendBoxWidth + spaceInLegendContents; + var nextStartText = startText; + var startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2); + var nextStartLegend = startLegend; + + for(var i = 0; i < this._series.length; i++) { + if(isLegendNextLine && i == Math.round(this._series.length / 2)) { + startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + legendBoxWidth + spaceInLegendContents; + nextStartText = startText; + startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2); + nextStartLegend = startLegend; + legendAreaStartHeight = (parseInt(this._chartHeight) * 91 / 100) + 5; + isLegendNextLine = false; + } + startLegend = nextStartLegend; + startText = nextStartText; + legendContents = legendContents + String.format('', startLegend, legendAreaStartHeight + legendBoxHeight, startLegend + legendBoxWidth, legendAreaStartHeight + 15, i + 1, this._series[i].BarColor); + legendContents = legendContents + String.format('{2}', startText, legendAreaStartHeight + 15, this._series[i].Name); + if(this._series[i].Name.length > 10) { + nextStartLegend = startLegend + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = startText + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + } + else { + nextStartLegend = nextStartLegend + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = nextStartText + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + } + } + legendContents = legendContents + ''; + return legendContents; + }, + + // This generates charts of Bar type. + generateBarChart: function() { + this.arrYAxis = this._categoriesAxis.split(','); + this.arrYAxisLength = this.arrYAxis.length; + + this.calculateMinMaxValuesForBarType(); + this.calculateIntervalForBarType(); + this.calculateValueAxisForBarType(); + + var svgContents = this.initializeSVG(); + + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + svgContents = svgContents + this.drawBackgroundHorizontalLinesForBarType(); + svgContents = svgContents + this.drawBackgroundVerticalLinesForBarType(); + svgContents = svgContents + this.drawBaseLinesForBarType(); + svgContents = svgContents + this.drawLegendArea(); + svgContents = svgContents + this.drawAxisValuesForBarType(); + svgContents = svgContents + this.drawBarsForBarType(); + + svgContents = svgContents + ''; + this._parentDiv.innerHTML = svgContents; + }, + + // This calculates distance interval for the value axis. + calculateIntervalForBarType: function() { + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 20 / 100)) + 0.5; + this.endY = (parseInt(this._chartHeight) * 8 / 100) + 5; + this.endX = parseInt(this._chartWidth) - 10 + 0.5; + + if(this.xMin >= 0) { + this.startX = (this._chartWidth * 15 / 100) + 0.5; + } + else { + this.startX = Math.round(parseInt(this._chartWidth) / 2) + 0.5; + } + + this.xInterval = Math.round((this.endX - this.startX) / (this._valueAxisLines)); + }, + + // This calculates minimum and maximum values of the specified data. + calculateMinMaxValuesForBarType: function(chartType) { + // calculate minimum and maximum value + var seriesMax; + var seriesMin; + var arrData; + if(this._chartType == Sys.Extended.UI.BarChartType.Bar) { + for(var i = 0; i < this._series.length; i++) { + arrData = this._series[i].Data; + seriesMax = Math.max.apply(null, arrData); + seriesMin = Math.min.apply(null, arrData); + if(i == 0) { + this.xMax = seriesMax; + this.xMin = seriesMin; + } + else { + if(seriesMax > this.xMax) + this.xMax = seriesMax; + if(seriesMin < this.yMin) + this.xMin = seriesMin; + } + } + } + else { + this.arrCombinedData = null; + for(var i = 0; i < this._series.length; i++) { + arrData = new Array(); + for(var j = 0; j < this._series[i].Data.length; j++) { + arrData[j] = this._series[i].Data[j]; + } + if(this.arrCombinedData == null) + this.arrCombinedData = arrData; + else { + for(j = 0; j < arrData.length; j++) { + this.arrCombinedData[j] = parseFloat(this.arrCombinedData[j]) + parseFloat(arrData[j]); + } + } + } + + for(var i = 0; i < this._series.length; i++) { + seriesMin = Math.min.apply(null, this._series[i].Data); + if(i == 0) { + this.xMin = seriesMin; + } + else { + if(seriesMin < this.xMin) + this.xMin = seriesMin; + } + } + + this.xMax = Math.max.apply(null, this.arrCombinedData); + } + + if(this.xMin < 0) { + this._valueAxisLines = Math.round(this._valueAxisLines / 2); + } + }, + + // this calculates label values for Value axis to display on the chart. + calculateValueAxisForBarType: function() { + // calculate value axis labels + var range; + var unroundedTickSize; + var x; + var pow10x; + + if(this.xMin >= 0) { + range = this.xMax; + } + else { + range = this.xMax > Math.abs(this.xMin) ? this.xMax : Math.abs(this.xMin); + } + + unroundedTickSize = range / (this._valueAxisLines - 1); + if(unroundedTickSize < 1) { + this.roundedTickRange = unroundedTickSize.toFixed(1); + } + else { + x = Math.ceil((Math.log(unroundedTickSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.roundedTickRange = Math.ceil(unroundedTickSize / pow10x) * pow10x; + } + }, + + // This draws background Vertical lines of the chart. + drawBackgroundVerticalLinesForBarType: function() { + // background grid's vertical lines + var verticalLineContents = ''; + for(var i = 1; i <= this._valueAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX + (this.xInterval * i), this.startY, this.startY - (this.yInterval * this.arrYAxisLength), this._categoryAxisLineColor); + } + + if(this.xMin < 0) { + // background grid's vertical lines for negative values + for(var i = 1; i <= this._valueAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX - (this.xInterval * i), this.startY, this.startY - (this.yInterval * this.arrYAxisLength), this._categoryAxisLineColor); + } + } + return verticalLineContents; + }, + + // This draws background Horizontal lines of the chart. + drawBackgroundHorizontalLinesForBarType: function() { + // background grid's horizontal lines + var horizontalLineContents = ''; + this.yInterval = Math.round((this.startY - this.endY) / this.arrYAxisLength); + for(var i = 0; i <= this.arrYAxisLength; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.startX + (this.xInterval * this._valueAxisLines), (this.startY - (this.yInterval * i)), this._valueAxisLineColor); + } + + if(this.xMin < 0) { + for(var i = 0; i <= this.arrYAxisLength; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.startX - (this.xInterval * this._valueAxisLines), (this.startY - (this.yInterval * i)), this._valueAxisLineColor); + } + } + + return horizontalLineContents; + }, + + // This draws base lines of the chart. + drawBaseLinesForBarType: function() { + var baseLineContents = ''; + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startX - 4, this.startY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.endX, this.startY, this._baseLineColor); + + for(var i = 0; i < this.arrYAxisLength; i++) { + baseLineContents = baseLineContents + String.format('', this.startX, this.startX - 4, this.startY - (this.yInterval * i), this._baseLineColor); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX + (this.xInterval * i), this.startY, this.startY + 4, this._baseLineColor); + } + + if(this.xMin < 0) { + baseLineContents = baseLineContents + String.format('', this.startX, (this.startX - (this.xInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + for(var i = 1; i <= this._valueAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - (this.xInterval * i), this.startY, this.startY + 4, this._baseLineColor); + } + } + + return baseLineContents; + }, + + // This writes horizontal and vertical axis values of the chart. + drawAxisValuesForBarType: function() { + var axisContents = ''; + var textLength = 0; + + for(var i = 0; i < this.arrYAxisLength; i++) { + textLength = this.arrYAxis[i].toString().length * 6.5; + axisContents = axisContents + String.format('{2}', this.startX - (this.xInterval * 15 / 100) - textLength, Math.round(this.startY - (this.yInterval * (i + 1)) + (this.yInterval * 60 / 100)), this.arrYAxis[i]); + } + + for(var i = 0; i <= this._valueAxisLines; i++) { + axisContents = axisContents + String.format('{2}', this.startX + (this.xInterval * i) - ((this.roundedTickRange * i).toString().length * this.charLength), this.startY + (this.yInterval * 35 / 100), this.roundedTickRange * i); + } + + if(this.xMin < 0) { + for(var i = 1; i <= this._valueAxisLines; i++) { + axisContents = axisContents + String.format('-{2}', this.startX - (this.xInterval * i) - ((this.roundedTickRange * i).toString().length * this.charLength), this.startY + (this.yInterval * 35 / 100), this.roundedTickRange * i); + } + } + + return axisContents; + }, + + drawBarsForBarType: function() { + // Bars section + var barContents = ''; + var numberOfBars = this._series.length; + var widthBetweenBars = this.yInterval * 10 / 100; + var barWidth = this._chartType == Sys.Extended.UI.BarChartType.Bar ? Math.round(((this.yInterval * 80 / 100) - (widthBetweenBars * numberOfBars)) / numberOfBars) : Math.round(this.yInterval * 80 / 100); + for(var i = 0; i < this.arrYAxisLength; i++) { + barContents = barContents + ''; + if(this._chartType == Sys.Extended.UI.BarChartType.Bar) { + for(var j = 0; j < this._series.length; j++) { + this.xVal = this._series[j].Data[i]; + if(i == 0) { + barContents = barContents + String.format('', this.startX, this.startX + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 15 / 100) - ((widthBetweenBars + barWidth) * j), this.startY - (this.yInterval * i) - (this.yInterval * 15 / 100) - ((widthBetweenBars + barWidth) * j) - barWidth, j + 1, this._series[j].BarColor); + } + else { + barContents = barContents + String.format('', this.startX, this.startX + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 12.5 / 100) - ((widthBetweenBars + barWidth) * j), this.startY - (this.yInterval * i) - (this.yInterval * 12.5 / 100) - ((widthBetweenBars + barWidth) * j) - barWidth, j + 1, this._series[j].BarColor); + } + + if(this.xVal > 0) + barContents = barContents + String.format('{2}', this.startX + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)) + (this.xVal.toString().length * this.charLength), this.startY - (this.yInterval * i) - (this.yInterval * 20 / 100) - ((widthBetweenBars + barWidth) * j) - (barWidth * 10 / 100), this.xVal); + else + barContents = barContents + String.format('{2}', this.startX + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)) - ((this.xVal.toString().length + 1) * this.charLength) - 5, this.startY - (this.yInterval * i) - (this.yInterval * 20 / 100) - ((widthBetweenBars + barWidth) * j) - (barWidth * 10 / 100), this.xVal); + } + } + else { + var lastStartXPositive = this.startX; + var lastStartXNegative = this.startX; + for(var j = 0; j < this._series.length; j++) { + this.xVal = this._series[j].Data[i]; + if(i == 0) { + if(this.xVal > 0) + barContents = barContents + String.format('', lastStartXPositive, lastStartXPositive + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 10 / 100), this.startY - (this.yInterval * i) - (this.xInterval * 10 / 100) - barWidth, j + 1, this._series[j].BarColor); + else + barContents = barContents + String.format('', lastStartXNegative, lastStartXNegative + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 10 / 100), this.startY - (this.yInterval * i) - (this.xInterval * 10 / 100) - barWidth, j + 1, this._series[j].BarColor); + } + else { + if(this.xVal > 0) + barContents = barContents + String.format('', lastStartXPositive, lastStartXPositive + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 7.55 / 100), this.startY - (this.yInterval * i) - (this.xInterval * 7.5 / 100) - barWidth, j + 1, this._series[j].BarColor); + else + barContents = barContents + String.format('', lastStartXNegative, lastStartXNegative + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)), this.startY - (this.yInterval * i) - (this.yInterval * 7.55 / 100), this.startY - (this.yInterval * i) - (this.xInterval * 7.5 / 100) - barWidth, j + 1, this._series[j].BarColor); + } + + if(this.xVal > 0) { + barContents = barContents + String.format('{2}', lastStartXPositive + Math.round((this.xVal * (this.xInterval / this.roundedTickRange)) / 2), this.startY - (this.yInterval * i) - (this.yInterval * 30 / 100) - (barWidth * 10 / 100), this.xVal); + lastStartXPositive = lastStartXPositive + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)); + } + else { + barContents = barContents + String.format('{2}', lastStartXNegative + Math.round((this.xVal * (this.xInterval / this.roundedTickRange)) / 2), this.startY - (this.yInterval * i) - (this.yInterval * 30 / 100) - (barWidth * 10 / 100), this.xVal); + lastStartXNegative = lastStartXNegative + Math.round(this.xVal * (this.xInterval / this.roundedTickRange)); + } + } + } + barContents = barContents + ''; + } + + return barContents; + }, + + /// + /// Enables you to customize chart width. + /// + /// get_chartWidth + /// set_chartWidth + /// + get_chartWidth: function() { + return this._chartWidth; + }, + set_chartWidth: function(value) { + this._chartWidth = value; + }, + + /// + /// Enables you to customize chart height. + /// + /// get_chartHeight + /// set_chartHeight + /// + get_chartHeight: function() { + return this._chartHeight; + }, + set_chartHeight: function(value) { + this._chartHeight = value; + }, + + /// + /// Enables you to set the chart's title. + /// + /// get_chartTitle + /// set_chartTitle + /// + get_chartTitle: function() { + return this._chartTitle; + }, + set_chartTitle: function(value) { + this._chartTitle = value; + }, + + /// + /// This is a required property. You need to provide a set of values for the category axis to create a bar chart + /// + /// get_categoriesAxis + /// set_categoriesAxis + /// + get_categoriesAxis: function() { + return this._categoriesAxis; + }, + set_categoriesAxis: function(value) { + this._categoriesAxis = value; + }, + + /// + /// A list of series. + /// + /// get_clientSeries + /// set_clientSeries + /// + get_clientSeries: function() { + return this._series; + }, + set_clientSeries: function(value) { + this._series = value; + }, + + get_ClientSeries: function() { + Sys.Extended.Deprecated("get_ClientSeries", "get_clientSeries"); + return this.get_clientSeries(); + }, + set_ClientSeries: function(value) { + Sys.Extended.Deprecated("set_ClientSeries", "set_clientSeries"); + this.set_clientSeries(value); + }, + + /// + /// Enables you to render different types of bar charts including Column, StackedColumn, Bar, and StackedBar + /// + /// get_chartType + /// set_chartType + /// + get_chartType: function() { + return this._chartType; + }, + set_chartType: function(value) { + this._chartType = value; + }, + + /// + /// Enables you to control the appearance of the bar chart with a Cascading Style Sheet file + /// + /// get_theme + /// set_theme + /// + get_theme: function() { + return this._theme; + }, + set_theme: function(value) { + this._theme = value; + }, + + /// + /// Enables you to set interval size for a value axis line. + /// + /// get_valueAxisLines + /// set_valueAxisLines + /// + get_valueAxisLines: function() { + return this._valueAxisLines; + }, + set_valueAxisLines: function(value) { + this._valueAxisLines = value; + }, + + /// + /// Enables you to set a font color of the chart title. + /// + /// get_chartTitleColor + /// set_chartTitleColor + /// + get_chartTitleColor: function() { + return this._chartTitleColor; + }, + set_chartTitleColor: function(value) { + this._chartTitleColor = value; + }, + + /// + /// Enables you to set a color of the value axis lines. + /// + /// get_valueAxisLineColor + /// set_valueAxisLineColor + /// + get_valueAxisLineColor: function() { + return this._valueAxisLineColor; + }, + set_valueAxisLineColor: function(value) { + this._valueAxisLineColor = value; + }, + + /// + /// Enables you to set a color of the category axis lines. + /// + /// get_categoryAxisLineColor + /// set_categoryAxisLineColor + /// + get_categoryAxisLineColor: function() { + return this._categoryAxisLineColor; + }, + set_categoryAxisLineColor: function(value) { + this._categoryAxisLineColor = value; + }, + + /// + /// Enables you to set a color of the base lines of the chart. + /// + /// get_baseLineColor + /// set_baseLineColor + /// + get_baseLineColor: function() { + return this._baseLineColor; + }, + set_baseLineColor: function(value) { + this._baseLineColor = value; + } +}; + +Sys.Extended.UI.BarChart.registerClass("Sys.Extended.UI.BarChart", Sys.Extended.UI.ControlBase); + +Sys.Extended.UI.BarChartType = function() { + throw Error.invalidOperation(); +} +Sys.Extended.UI.BarChartType.prototype = { + Column: 0, + Bar: 1, + StackedColumn: 2, + StackedBar: 3 +} + +Sys.Extended.UI.BarChartType.registerEnum("Sys.Extended.UI.BarChartType", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js new file mode 100644 index 000000000..1f6ca2ba1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js @@ -0,0 +1,403 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.BehaviorBase = function(element) { + // Base behavior for all extender behaviors + // "element" - element the behavior is associated with + Sys.Extended.UI.BehaviorBase.initializeBase(this,[element]); + + this._clientStateFieldID = null; + this._pageRequestManager = null; + this._partialUpdateBeginRequestHandler = null; + this._partialUpdateEndRequestHandler = null; +} +Sys.Extended.UI.BehaviorBase.prototype = { + initialize : function() { + Sys.Extended.UI.BehaviorBase.callBaseMethod(this, 'initialize'); + }, + + dispose : function() { + Sys.Extended.UI.BehaviorBase.callBaseMethod(this, 'dispose'); + + if (this._pageRequestManager) { + if (this._partialUpdateBeginRequestHandler) { + this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler); + this._partialUpdateBeginRequestHandler = null; + } + if (this._partialUpdateEndRequestHandler) { + this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler); + this._partialUpdateEndRequestHandler = null; + } + this._pageRequestManager = null; + } + }, + + get_ClientStateFieldID : function() { + // ID of the hidden field used to store client state + return this._clientStateFieldID; + }, + set_ClientStateFieldID : function(value) { + if (this._clientStateFieldID != value) { + this._clientStateFieldID = value; + this.raisePropertyChanged('ClientStateFieldID'); + } + }, + + get_ClientState : function() { + if (this._clientStateFieldID) { + var input = document.getElementById(this._clientStateFieldID); + if (input) { + return input.value; + } + } + return null; + }, + set_ClientState : function(value) { + if (this._clientStateFieldID) { + var input = document.getElementById(this._clientStateFieldID); + if (input) { + input.value = value; + } + } + }, + + registerPartialUpdateEvents : function() { + // Register for beginRequest and endRequest events on the PageRequestManager, + // (which cause _partialUpdateBeginRequest and _partialUpdateEndRequest to be + // called when an UpdatePanel refreshes) + + if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager){ + this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); + if (this._pageRequestManager) { + this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest); + this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler); + this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest); + this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler); + } + } + }, + + _partialUpdateBeginRequest : function(sender, beginRequestEventArgs) { + // Method that will be called when a partial update (via an UpdatePanel) begins, + // if registerPartialUpdateEvents() has been called. + // "sender" - sender + // "beginRequestEventArgs" - event arguments + }, + + _partialUpdateEndRequest : function(sender, endRequestEventArgs) { + // Method that will be called when a partial update (via an UpdatePanel) finishes, + // if registerPartialUpdateEvents() has been called. + // "sender" - sender + // "endRequestEventArgs" - event arguments + } +} +Sys.Extended.UI.BehaviorBase.registerClass('Sys.Extended.UI.BehaviorBase', Sys.UI.Behavior); + + +Sys.Extended.UI.DynamicPopulateBehaviorBase = function(element) { + /// DynamicPopulateBehaviorBase is used to add DynamicPopulateBehavior funcitonality + /// to other extenders. It will dynamically populate the contents of the target element + /// when its populate method is called. + /// "element" - DOM Element the behavior is associated with + Sys.Extended.UI.DynamicPopulateBehaviorBase.initializeBase(this, [element]); + + this._DynamicControlID = null; + this._DynamicContextKey = null; + this._DynamicServicePath = null; + this._DynamicServiceMethod = null; + this._cacheDynamicResults = false; + this._dynamicPopulateBehavior = null; + this._populatingHandler = null; + this._populatedHandler = null; +} +Sys.Extended.UI.DynamicPopulateBehaviorBase.prototype = { + initialize : function() { + Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize'); + + this._populatingHandler = Function.createDelegate(this, this._onPopulating); + this._populatedHandler = Function.createDelegate(this, this._onPopulated); + }, + + dispose : function() { + if (this._populatedHandler) { + if (this._dynamicPopulateBehavior) { + this._dynamicPopulateBehavior.remove_populated(this._populatedHandler); + } + this._populatedHandler = null; + } + if (this._populatingHandler) { + if (this._dynamicPopulateBehavior) { + this._dynamicPopulateBehavior.remove_populating(this._populatingHandler); + } + this._populatingHandler = null; + } + + if (this._dynamicPopulateBehavior) { + this._dynamicPopulateBehavior.dispose(); + this._dynamicPopulateBehavior = null; + } + Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose'); + }, + + populate : function(contextKeyOverride) { + // Demand-create the DynamicPopulateBehavior and use it to populate the target element + // "contextKeyOverride" - an arbitrary string value to be passed to the web method. + // For example, if the element to be populated is within a data-bound repeater, this could be the ID of the current row. + + if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) { + this._dynamicPopulateBehavior.dispose(); + this._dynamicPopulateBehavior = null; + } + + if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) { + this._dynamicPopulateBehavior = $create(Sys.Extended.UI.DynamicPopulateBehavior, + { + "id" : this.get_id() + "_DynamicPopulateBehavior", + "ContextKey" : this._DynamicContextKey, + "ServicePath" : this._DynamicServicePath, + "ServiceMethod" : this._DynamicServiceMethod, + "cacheDynamicResults" : this._cacheDynamicResults + }, null, null, $get(this._DynamicControlID)); + + this._dynamicPopulateBehavior.add_populating(this._populatingHandler); + this._dynamicPopulateBehavior.add_populated(this._populatedHandler); + } + + if (this._dynamicPopulateBehavior) { + this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey); + } + }, + + _onPopulating : function(sender, eventArgs) { + // Handler for DynamicPopulate behavior's Populating event + // "sender" - DynamicPopulate behavior + // "eventArgs" - event args + this.raisePopulating(eventArgs); + }, + + _onPopulated : function(sender, eventArgs) { + // Handler for DynamicPopulate behavior's Populated event + // "sender" - DynamicPopulate behavior + // "eventArgs" - event args + this.raisePopulated(eventArgs); + }, + + get_dynamicControlID : function() { + // ID of the element to populate with dynamic content + return this._DynamicControlID; + }, + get_DynamicControlID : this.get_dynamicControlID, + set_dynamicControlID : function(value) { + if (this._DynamicControlID != value) { + this._DynamicControlID = value; + this.raisePropertyChanged('dynamicControlID'); + this.raisePropertyChanged('DynamicControlID'); + } + }, + set_DynamicControlID : this.set_dynamicControlID, + + get_dynamicContextKey : function() { + // An arbitrary string value to be passed to the web method. + // For example, if the element to be populated is within a + // data-bound repeater, this could be the ID of the current row. + return this._DynamicContextKey; + }, + get_DynamicContextKey : this.get_dynamicContextKey, + set_dynamicContextKey : function(value) { + if (this._DynamicContextKey != value) { + this._DynamicContextKey = value; + this.raisePropertyChanged('dynamicContextKey'); + this.raisePropertyChanged('DynamicContextKey'); + } + }, + set_DynamicContextKey : this.set_dynamicContextKey, + + get_dynamicServicePath : function() { + // The URL of the web service to call. If the ServicePath is not defined, then we will invoke a PageMethod instead of a web service. + return this._DynamicServicePath; + }, + get_DynamicServicePath : this.get_dynamicServicePath, + set_dynamicServicePath : function(value) { + if (this._DynamicServicePath != value) { + this._DynamicServicePath = value; + this.raisePropertyChanged('dynamicServicePath'); + this.raisePropertyChanged('DynamicServicePath'); + } + }, + set_DynamicServicePath : this.set_dynamicServicePath, + + get_dynamicServiceMethod : function() { + // The name of the method to call on the page or web service + // The signature of the method must exactly match the following: + // [WebMethod] + // string DynamicPopulateMethod(string contextKey) + // { + // ... + // } + return this._DynamicServiceMethod; + }, + get_DynamicServiceMethod : this.get_dynamicServiceMethod, + set_dynamicServiceMethod : function(value) { + if (this._DynamicServiceMethod != value) { + this._DynamicServiceMethod = value; + this.raisePropertyChanged('dynamicServiceMethod'); + this.raisePropertyChanged('DynamicServiceMethod'); + } + }, + set_DynamicServiceMethod : this.set_dynamicServiceMethod, + + get_cacheDynamicResults : function() { + // Whether the results of the dynamic population should be cached and + // not fetched again after the first load + return this._cacheDynamicResults; + }, + set_cacheDynamicResults : function(value) { + if (this._cacheDynamicResults != value) { + this._cacheDynamicResults = value; + this.raisePropertyChanged('cacheDynamicResults'); + } + }, + + add_populated : function(handler) { + // Add a handler on the populated event + // "handler" - handler + this.get_events().addHandler("populated", handler); + }, + remove_populated : function(handler) { + // Remove a handler from the populated event + // "handler" - handler + this.get_events().removeHandler("populated", handler); + }, + raisePopulated : function(arg) { + // Raise the populated event + // "arg" - event arguments + var handler = this.get_events().getHandler("populated"); + if (handler) handler(this, arg); + }, + + add_populating : function(handler) { + // Add an event handler for the populating event + // "handler" - event handler + this.get_events().addHandler('populating', handler); + }, + remove_populating : function(handler) { + // Remove an event handler from the populating event + // "handler" - event handler + this.get_events().removeHandler('populating', handler); + }, + raisePopulating : function(eventArgs) { + // Raise the populating event + // "eventArgs" - event arguments for the populating event + + var handler = this.get_events().getHandler('populating'); + if (handler) { + handler(this, eventArgs); + } + } +} +Sys.Extended.UI.DynamicPopulateBehaviorBase.registerClass('Sys.Extended.UI.DynamicPopulateBehaviorBase', Sys.Extended.UI.BehaviorBase); + + +Sys.Extended.UI.ControlBase = function(element) { + Sys.Extended.UI.ControlBase.initializeBase(this, [element]); + this._clientStateField = null; + this._callbackTarget = null; + this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit); + this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete); + this._onerror$delegate = Function.createDelegate(this, this._onerror); +} + +Sys.Extended.UI.ControlBase.__doPostBack = function(eventTarget, eventArgument) { + if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) { + for (var i = 0; i < Sys.Extended.UI.ControlBase.onsubmitCollection.length; i++) { + Sys.Extended.UI.ControlBase.onsubmitCollection[i](); + } + } + Function.createDelegate(window, Sys.Extended.UI.ControlBase.__doPostBackSaved)(eventTarget, eventArgument); +} + +Sys.Extended.UI.ControlBase.prototype = { + initialize: function() { + Sys.Extended.UI.ControlBase.callBaseMethod(this, "initialize"); + if (this._clientStateField) { + this.loadClientState(this._clientStateField.value); + } + if (typeof (Sys.WebForms) !== "undefined" && typeof (Sys.WebForms.PageRequestManager) !== "undefined") { + Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate); + if (Sys.Extended.UI.ControlBase.__doPostBackSaved == null || typeof Sys.Extended.UI.ControlBase.__doPostBackSaved == "undefined") { + Sys.Extended.UI.ControlBase.__doPostBackSaved = window.__doPostBack; + window.__doPostBack = Sys.Extended.UI.ControlBase.__doPostBack; + Sys.Extended.UI.ControlBase.onsubmitCollection = new Array(); + } + Array.add(Sys.Extended.UI.ControlBase.onsubmitCollection, this._onsubmit$delegate); + } else { + $addHandler(document.forms[0], "submit", this._onsubmit$delegate); + } + }, + dispose: function() { + if (typeof (Sys.WebForms) !== "undefined" && typeof (Sys.WebForms.PageRequestManager) !== "undefined") { + Array.remove(Sys.Extended.UI.ControlBase.onsubmitCollection, this._onsubmit$delegate); + Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate); + } else { + $removeHandler(document.forms[0], "submit", this._onsubmit$delegate); + } + Sys.Extended.UI.ControlBase.callBaseMethod(this, "dispose"); + }, + + findElement: function(id) { + return $get(this.get_id() + '_' + id.split(':').join('_')); + }, + get_clientStateField: function() { + return this._clientStateField; + }, + set_clientStateField: function(value) { + if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_CannotSetClientStateField); + if (this._clientStateField != value) { + this._clientStateField = value; + this.raisePropertyChanged('clientStateField'); + } + }, + loadClientState: function(value) { + // override this method to intercept client state loading after a callback + }, + saveClientState: function() { + // override this method to intercept client state acquisition before a callback + return null; + }, + _invoke: function(name, args, cb) { + // invokes a callback method on the server control + if (!this._callbackTarget) { + throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_ControlNotRegisteredForCallbacks); + } + if (typeof (WebForm_DoCallback) === "undefined") { + throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_PageNotRegisteredForCallbacks); + } + var ar = []; + for (var i = 0; i < args.length; i++) + ar[i] = args[i]; + var clientState = this.saveClientState(); + if (clientState != null && !String.isInstanceOfType(clientState)) { + throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_InvalidClientStateType); + } + var payload = Sys.Serialization.JavaScriptSerializer.serialize({ name: name, args: ar, state: this.saveClientState() }); + WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true); + }, + _oncomplete: function(result, context) { + result = Sys.Serialization.JavaScriptSerializer.deserialize(result); + if (result.error) { + throw Error.create(result.error); + } + this.loadClientState(result.state); + context(result.result); + }, + _onerror: function(message, context) { + throw Error.create(message); + }, + _onsubmit: function() { + if (this._clientStateField) { + this._clientStateField.value = this.saveClientState(); + } + return true; + } + +} +Sys.Extended.UI.ControlBase.registerClass("Sys.Extended.UI.ControlBase", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BubbleChart.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BubbleChart.debug.js new file mode 100644 index 000000000..209043cb1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/BubbleChart.debug.js @@ -0,0 +1,699 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.BubbleChart = function(element) { + Sys.Extended.UI.BubbleChart.initializeBase(this, [element]); + var id = this.get_id(); + id = id.replace("_ctl00", ""); + this._parentDiv = document.getElementById(id + "__ParentDiv"); + + /// + /// Enables you to customize the chart width. + /// The default is 300 + /// + /// get_chartWidth + /// set_chartWidth + /// + this._chartWidth = '300'; + + /// + /// Enables you to customize the chart height. + /// The default is 200 + /// + /// get_chartHeight + /// set_chartHeight + /// + this._chartHeight = '200'; + + /// + /// Enables you to set the chart's title. + /// + /// get_chartTitle + /// set_chartTitle + /// + this._chartTitle = ''; + + /// + /// A list of values. + /// + /// get_bubbleChartClientValues + /// set_bubbleChartClientValues + /// + this._bubbleChartClientValues = null; + + /// + /// Enables you to control the appearance of the bar chart with a CSS file. + /// The default is 'BubbleChart' + /// + /// get_theme + /// set_theme + /// + this._theme = 'BubbleChart'; + + /// + /// Enables you to set interval size for the Y axis line of the chart. + /// The default is 6 + /// + /// get_yAxisLines + /// set_yAxisLines + /// + this._yAxisLines = 6; + + /// + /// Enables you to set interval size for the X axis line of the chart. + /// The default is 6 + /// + /// get_xAxisLines + /// set_xAxisLines + /// + this._xAxisLines = 6; + + /// + /// Enables you to set the number of different sizes of the bubbles + /// + /// get_bubbleSizes + /// set_bubbleSizes + /// + this._bubbleSizes = 5; + + /// + /// A font color of the chart title. + /// + /// get_chartTitleColor + /// set_chartTitleColor + /// + this._chartTitleColor = ''; + + /// + /// Enables you to set the color of the Y axis lines of the chart + /// + /// get_yAxisLineColor + /// set_yAxisLineColor + /// + this._yAxisLineColor = ''; + + /// + /// Enables you to set the color of the X axis lines of the chart + /// + /// get_xAxisLineColor + /// set_xAxisLineColor + /// + this._xAxisLineColor = ''; + + /// + /// Enables you to set the color of the base lines of the chart + /// + /// get_baseLineColor + /// set_baseLineColor + /// + this._baseLineColor = ''; + + /// + /// Enables you to set a background color of the tooltip box. + /// The default is #FFFFFF + /// + /// get_tooltipBackgroundColor + /// set_tooltipBackgroundColor + /// + this._tooltipBackgroundColor = '#FFFFFF'; + + /// + /// Enables you to set a font color of the tooltip box. + /// The default is #0E426C + /// + /// get_tooltipFontColor + /// set_tooptipFontColor + /// + this._tooltipFontColor = '#0E426C'; + + /// + /// Enables you to set a border color of the tooltip box. + /// The default is #B85B3E + /// + /// get_tooltipBorderColor + /// set_tooltipBorderColor + /// + this._tooltipBorderColor = '#B85B3E'; + + /// + /// Enables you to set the text/label to describe what data is in XAxis. + /// + /// get_xAxisLabel + /// set_xAxisLabel + /// + this._xAxisLabel = ''; + + /// + /// Enables you to set the text/label to describe what data is in YAxis. + /// + /// get_yAxisLabel + /// set_yAxisLabel + /// + this._yAxisLabel = ''; + + /// + /// Enables you to set the text/label that will be shown in the tooltip and describe a bubble value. + /// + /// get_bubbleLabel + /// set_bubbleLabel + /// + this._bubbleLabel = ''; + + /// + /// Enables you to set the axis label font color. + /// The default is #000000 + /// + /// get_axislabelFontColor + /// set_axislabelFontColor + /// + this._axislabelFontColor = '#000000'; + + // variables + this.yMax = 0; + this.yMin = 0; + this.xMax = 0; + this.xMin = 0; + this.dataMax = 0; + this.dataMin = 0; + this.yRoundedIntervalLabelSize = 0; + this.xRoundedIntervalLabelSize = 0; + this.roundedBubbleSize = 0; + this.startX = 0; + this.startY = 0; + this.endX = 0; + this.endY = 0; + this.xInterval = 0; + this.yInterval = 0; + this.charLength = 3.5; + this._divTooltip = null; +} + +Sys.Extended.UI.BubbleChart.prototype = { + + initialize: function() { + Sys.Extended.UI.BubbleChart.callBaseMethod(this, "initialize"); + + if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) { + throw 'Current version of browser does not support SVG.'; + } + + if(this._yAxisLines == 0) { + this._yAxisLines = 6; + } + + if(this._xAxisLines == 0) { + this._xAxisLines = 6; + } + + if(this._bubbleSizes == 0) { + this._bubbleSizes = 5; + } + + this.generateTooltipDiv(); + this.generateBubbleChart(); + }, + + dispose: function() { + Sys.Extended.UI.BubbleChart.callBaseMethod(this, "dispose"); + }, + + generateTooltipDiv: function() { + this._divTooltip = $common.createElementFromTemplate({ + nodeName: 'div', + properties: { + id: this.get_id() + '_tooltipDiv', + style: { + position: 'absolute', + backgroundColor: this._tooltipBackgroundColor, + borderStyle: 'solid', + borderWidth: '5px', + borderColor: this._tooltipBorderColor, + left: '0px', + top: '0px', + color: this._tooltipFontColor, + visibility: 'hidden', + zIndex: Sys.Extended.UI.zIndex.BubbleChartTooltip, + padding: '10px' + } + } + }, this._parentDiv); + }, + + generateBubbleChart: function() { + this.calculateMinMaxValues(); + this.calculateBubbleSize(); + this.calculateAxisValues(); + + var svgContents = this.intializeSVG(); + + // Title Text + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + + this.calculateIntervals(); + // Draw backgound horizontal lines + svgContents = svgContents + this.drawBackgroundHorizontalLines(); + //draw background vertical lines + svgContents = svgContents + this.drawBackgroundVerticalLines(); + // draw background base lines + svgContents = svgContents + this.drawBaseLines(); + // draw X and Y axis values + svgContents = svgContents + this.drawAxisValues(); + + this._parentDiv.innerHTML = this._parentDiv.innerHTML + svgContents; + + // Bubble section + this.drawBubbles(this, 0); + }, + + intializeSVG: function() { + var svgContents = String.format('', this._theme); + svgContents = String.format('', this._chartWidth, this._chartHeight, parseFloat(this._chartWidth) * 0.99, parseFloat(this._chartHeight) * 0.99); + //svgContents = svgContents + ""; + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + svgContents = svgContents + String.format('', this._chartWidth, parseInt(this._chartHeight) - 5); + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + return svgContents; + }, + + drawBubbles: function(me, index) { + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + Math.round((parseFloat(me._bubbleChartClientValues[index].X) / me.xRoundedIntervalLabelSize) * me.xInterval), me.startY + Math.round(((-1 * parseFloat(me._bubbleChartClientValues[index].Y)) / me.yRoundedIntervalLabelSize) * me.yInterval), Math.round((parseFloat(me._bubbleChartClientValues[index].Data) / me.roundedBubbleSize) * me._bubbleSizes), me._bubbleChartClientValues[index].BubbleColor, index + 1, me._bubbleChartClientValues[index].Category, me._bubbleChartClientValues[index].Data, me._bubbleLabel); + index++; + if(index < me._bubbleChartClientValues.length) { // if the counter < series length, call the loop function + setTimeout(function() { + me.drawBubbles(me, index); + }, 400); + } + }, + + // This calculates minimum and maximum values of the specified data. + calculateMinMaxValues: function() { + // calculate minimum and maximum value + for(var i = 0; i < this._bubbleChartClientValues.length; i++) { + if(i == 0) { + this.dataMax = parseFloat(this._bubbleChartClientValues[i].Data); + this.dataMin = parseFloat(this._bubbleChartClientValues[i].Data); + + this.yMax = parseFloat(this._bubbleChartClientValues[i].Y); + this.yMin = parseFloat(this._bubbleChartClientValues[i].Y); + + this.xMax = parseFloat(this._bubbleChartClientValues[i].X); + this.xMin = parseFloat(this._bubbleChartClientValues[i].X); + } + else { + // Data values + if(parseFloat(this._bubbleChartClientValues[i].Data) > this.dataMax) + this.dataMax = parseFloat(this._bubbleChartClientValues[i].Data); + + if(parseFloat(this._bubbleChartClientValues[i].Data) < this.dataMin) + this.dataMin = parseFloat(this._bubbleChartClientValues[i].Data); + + // X values + if(parseFloat(this._bubbleChartClientValues[i].X) > this.xMax) + this.xMax = parseFloat(this._bubbleChartClientValues[i].X); + + if(parseFloat(this._bubbleChartClientValues[i].Data) < this.xMin) + this.xMin = parseFloat(this._bubbleChartClientValues[i].X); + + // Y values + if(parseFloat(this._bubbleChartClientValues[i].Y) > this.yMax) + this.yMax = parseFloat(this._bubbleChartClientValues[i].Y); + + if(parseFloat(this._bubbleChartClientValues[i].Y) < this.yMin) + this.yMin = parseFloat(this._bubbleChartClientValues[i].Y); + } + } + + if(this.xMin < 0) + this._xAxisLines = Math.round(this._xAxisLines / 2); + + if(this.yMin < 0) + this._yAxisLines = Math.round(this._yAxisLines / 2); + + }, + + calculateBubbleSize: function() { + var pow10x; + var x; + // calculate size of bubble + var bubbleRange; + var unroundedBubbleSize; + + bubbleRange = this.dataMax; + + unroundedBubbleSize = bubbleRange / (this._bubbleSizes - 1); + x = Math.ceil((Math.log(unroundedBubbleSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.roundedBubbleSize = Math.ceil(unroundedBubbleSize / pow10x) * pow10x; + }, + + // this calculates label values for X and Y Value axis to display on the chart. + calculateAxisValues: function() { + // calculate value axis labels + var valueRange; + var unroundedValueSize; + + if(this.yMin < 0) { + valueRange = this.yMax > Math.abs(this.yMin) ? this.yMax : Math.abs(this.yMin); + } + else { + valueRange = this.yMax; + } + + unroundedValueSize = valueRange / (this._yAxisLines - 1); + if(unroundedValueSize < 1) { + this.yRoundedIntervalLabelSize = unroundedValueSize.toFixed(1); + } + else { + x = Math.ceil((Math.log(unroundedValueSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.yRoundedIntervalLabelSize = Math.ceil(unroundedValueSize / pow10x) * pow10x; + } + + // calculate X axis labels + var xRange; + var unroundedXSize; + + if(this.xMin < 0) { + xRange = this.xMax > Math.abs(this.xMin) ? this.xMax : Math.abs(this.xMin); + } + else { + xRange = this.xMax; + } + + unroundedXSize = xRange / (this._xAxisLines - 1); + if(unroundedValueSize < 1) { + this.xRoundedIntervalLabelSize = unroundedXSize.toFixed(1); + } + else { + x = Math.ceil((Math.log(unroundedXSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.xRoundedIntervalLabelSize = Math.ceil(unroundedXSize / pow10x) * pow10x; + } + }, + + // This calculates distance interval for the value axis. + calculateIntervals: function() { + this.endX = parseFloat(this._chartWidth) - (parseFloat(this._chartWidth) * 5 / 100); + if(this.xMin < 0) { + this.startX = Math.round(parseFloat(this._chartWidth) + (parseFloat(this._chartWidth) * 10 / 100)) / 2 + 0.5; + } + else { + this.startX = (parseFloat(this._chartWidth) * 20 / 100) + 0.5; + } + + if(this.xMin < 0) + this.xInterval = (this.endX - this.startX) / (this._xAxisLines); + else + this.xInterval = Math.round((this.endX - this.startX) / (this._xAxisLines)); + + if(this.yMin < 0) + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 5 / 100)) / 2 + 0.5; + else + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 20 / 100)) + 0.5; + + this.yInterval = this.startY / (this._yAxisLines + 1); + this.endY = this.startY - (this.yInterval * this._yAxisLines); + }, + + // This draws background horizontal lines of the chart. + drawBackgroundHorizontalLines: function() { + var horizontalLineContents = ''; + // For positive values. + for(var i = 1; i <= this._yAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY - (this.yInterval * i), this._xAxisLineColor); + } + + if(this.yMin < 0) { + // background grid's horizontal lines for negative y values. + for(var i = 1; i <= this._yAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY + (this.yInterval * i), this._xAxisLineColor); + } + } + + if(this.xMin < 0) { + // background grid's horizontal lines for negative x values. + for(var i = 1; i <= this._yAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, (this.startX - (this.xInterval * this._xAxisLines)), (this.startY - (this.yInterval * i)), this._xAxisLineColor); + } + } + + if(this.xMin < 0 && this.yMin < 0) { + // background grid's horizontal lines for negative values + for(var i = 1; i <= this._yAxisLines; i++) { + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.startX - (this.xInterval * this._xAxisLines), (this.startY + (this.yInterval * i)), this._xAxisLineColor); + } + } + return horizontalLineContents; + }, + + // This draws background vertical lines of the chart. + drawBackgroundVerticalLines: function() { + var verticalLineContents = ''; + // background grid's vertical lines + for(var i = 1; i <= this._xAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX + (this.xInterval * i), this.startY, this.endY, this._yAxisLineColor); + } + + if(this.xMin < 0) { + // background grid's vertical lines for negative values + for(var i = 1; i <= this._xAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX - (this.xInterval * i), this.startY, this.endY, this._yAxisLineColor); + } + } + + if(this.yMin < 0) { + // background grid's vertical lines for negative values + for(var i = 1; i <= this._xAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX + (this.xInterval * i), this.startY, this.startY + (this.yInterval * this._yAxisLines), this._yAxisLineColor); + } + } + + if(this.xMin < 0 && this.yMin < 0) { + // background grid's vertical lines for negative values + for(var i = 1; i <= this._xAxisLines; i++) { + verticalLineContents = verticalLineContents + String.format('', this.startX - (this.xInterval * i), this.startY, this.startY + (this.yInterval * this._yAxisLines), this._yAxisLineColor); + } + } + + return verticalLineContents; + }, + + // This draws base lines of the chart. + drawBaseLines: function() { + var baseLineContents = ''; + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endX, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startY + 4, this._baseLineColor); + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startX + 4, this._baseLineColor); + + for(var i = 0; i <= this._yAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY - (this.yInterval * i), this._baseLineColor); + } + + if(this.yMin < 0) { + for(var i = 1; i <= this._yAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY + (this.yInterval * i), this._baseLineColor); + } + baseLineContents = baseLineContents + String.format('', (this.startX - (this.xInterval * this._xAxisLines)), this.startY, this.startY + 4, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startY + (this.yInterval * this._yAxisLines), this._baseLineColor); + } + + for(var i = 0; i <= this._xAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX + (this.xInterval * i), this.startY, this.startY + 4, this._baseLineColor); + } + + if(this.xMin < 0) { + for(var i = 1; i <= this._xAxisLines; i++) { + baseLineContents = baseLineContents + String.format('', this.startX - (this.xInterval * i), this.startY, this.startY + 4, this._baseLineColor); + } + baseLineContents = baseLineContents + String.format('', this.startX, (this.startX - (this.xInterval * this._xAxisLines)), this.startY, this._baseLineColor); + } + return baseLineContents; + }, + + drawAxisValues: function() { + var axisValueContents = ''; + var textLength = 0; + for(var i = 1; i <= this._yAxisLines; i++) { + textLength = (this.yRoundedIntervalLabelSize * 10 * i / 10).toString().length * 5.5; + axisValueContents = axisValueContents + String.format('{2}', this.startX - textLength - 10, this.startY - (this.yInterval * i) + 4, this.yRoundedIntervalLabelSize * 10 * i / 10); + } + + if(this.yMin < 0) { + for(var i = 1; i <= this._yAxisLines; i++) { + textLength = (this.yRoundedIntervalLabelSize * 10 * i / 10).toString().length * 5.5 + 5.5; // add length for -ve character + axisValueContents = axisValueContents + String.format('-{2}', this.startX - textLength - 10, this.startY + (this.yInterval * i) + 4, this.yRoundedIntervalLabelSize * 10 * i / 10); + } + } + + for(var i = 1; i <= this._xAxisLines; i++) { + textLength = (this.xRoundedIntervalLabelSize * 10 * i / 10).toString().length * 5.5; + axisValueContents = axisValueContents + String.format('{2}', Math.round(this.startX + (this.xInterval * i) - (textLength / 2)), this.startY + Math.round(this.yInterval * 25 / 100) + 5, this.xRoundedIntervalLabelSize * 10 * i / 10); + } + + if(this.xMin < 0) { + for(var i = 1; i <= this._xAxisLines; i++) { + textLength = (this.xRoundedIntervalLabelSize * 10 * i / 10).toString().length * 5.5 + 5.5; // add length for -ve character + axisValueContents = axisValueContents + String.format('-{2}', Math.round(this.startX - (this.xInterval * i) - (textLength / 2)), this.startY + Math.round(this.yInterval * 25 / 100) + 5, this.xRoundedIntervalLabelSize * 10 * i / 10); + } + } + + var yLabelStart; + if(this.yMin < 0) + yLabelStart = Math.round((this.startY + (this.yInterval * this._yAxisLines)) - (this.startY - (this.yInterval * this._yAxisLines))) / 2; + else + yLabelStart = Math.round((this.startY - this.endY) / 2); + + axisValueContents = axisValueContents + String.format('{2}', Math.round(parseFloat(this._chartWidth) * 5 / 100), yLabelStart + (this._yAxisLabel.toString().length * this.charLength), this._yAxisLabel, this._axislabelFontColor); + axisValueContents = axisValueContents + String.format('{2}', Math.round(parseInt(this._chartWidth) / 2 - (this._xAxisLabel.toString().length * this.charLength) / 2), Math.round(parseInt(this._chartHeight) * 90 / 100 + 5), this._xAxisLabel, this._axislabelFontColor); + return axisValueContents; + }, + + get_chartWidth: function() { + return this._chartWidth; + }, + set_chartWidth: function(value) { + this._chartWidth = value; + }, + + get_chartHeight: function() { + return this._chartHeight; + }, + set_chartHeight: function(value) { + this._chartHeight = value; + }, + + get_chartTitle: function() { + return this._chartTitle; + }, + set_chartTitle: function(value) { + this._chartTitle = value; + }, + + get_bubbleChartClientValues: function() { + return this._bubbleChartClientValues; + }, + set_bubbleChartClientValues: function(value) { + this._bubbleChartClientValues = value; + }, + + get_BubbleChartClientValues: function() { + Sys.Extended.Deprecated("get_BubbleChartClientValues", "get_bubbleChartClientValues"); + return this.get_bubbleChartClientValues(); + }, + set_BubbleChartClientValues: function(value) { + Sys.Extended.Deprecated("set_BubbleChartClientValues", "set_bubbleChartClientValues"); + this.set_bubbleChartClientValues(value); + }, + + get_theme: function() { + return this._theme; + }, + set_theme: function(value) { + this._theme = value; + }, + + get_yAxisLines: function() { + return this._yAxisLines; + }, + set_yAxisLines: function(value) { + this._yAxisLines = value; + }, + + get_xAxisLines: function() { + return this._xAxisLines; + }, + set_xAxisLines: function(value) { + this._xAxisLines = value; + }, + + get_chartTitleColor: function() { + return this._chartTitleColor; + }, + set_chartTitleColor: function(value) { + this._chartTitleColor = value; + }, + + get_yAxisLineColor: function() { + return this._yAxisLineColor; + }, + set_yAxisLineColor: function(value) { + this._yAxisLineColor = value; + }, + + + get_xAxisLineColor: function() { + return this._xAxisLineColor; + }, + set_xAxisLineColor: function(value) { + this._xAxisLineColor = value; + }, + + + get_bubbleSizes: function() { + return this._bubbleSizes; + }, + set_bubbleSizes: function(value) { + this._bubbleSizes = value; + }, + + get_baseLineColor: function() { + return this._baseLineColor; + }, + set_baseLineColor: function(value) { + this._baseLineColor = value; + }, + + get_tooltipBackgroundColor: function() { + return this.tooltipBackgroundColor; + }, + set_tooltipBackgroundColor: function(value) { + this.tooltipBackgroundColor = value; + }, + + get_tooltipFontColor: function() { + return this._tooltipFontColor; + }, + set_tooltipFontColor: function(value) { + this._tooltipFontColor = value; + }, + + get_tooltipBorderColor: function() { + return this._tooltipBorderColor; + }, + set_tooltipBorderColor: function(value) { + this._tooltipBorderColor = value; + }, + + + get_xAxisLabel: function() { + return this._xAxisLabel; + }, + set_xAxisLabel: function(value) { + this._xAxisLabel = value; + }, + + get_yAxisLabel: function() { + return this._yAxisLabel; + }, + set_yAxisLabel: function(value) { + this._yAxisLabel = value; + }, + + get_bubbleLabel: function() { + return this._bubbleLabel; + }, + set_bubbleLabel: function(value) { + this._bubbleLabel = value; + }, + + get_axislabelFontColor: function() { + return this._axislabelFontColor; + }, + set_axislabelFontColor: function(value) { + this._axislabelFontColor = value; + } +}; + +Sys.Extended.UI.BubbleChart.registerClass("Sys.Extended.UI.BubbleChart", Sys.Extended.UI.ControlBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js new file mode 100644 index 000000000..16fbe4515 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js @@ -0,0 +1,1931 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.CalendarBehavior = function(element) { + // A behavior that attaches a calendar date selector to a textbox + // param "element" is the element to attach to + + Sys.Extended.UI.CalendarBehavior.initializeBase(this, [element]); + + this._textbox = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(element); + /// + /// A format string used to display the selected date. The default value is d + /// + /// get_format + /// set_format + /// + this._format = "d"; + /// + /// A format string used to display today's date. The default value is MMMM d, yyyy. + /// + /// get_todaysDateFormat + /// set_todaysDateFormat + /// + this._todaysDateFormat = "MMMM d, yyyy"; + /// + /// A format string used to display Days Mode Title. The default value is MMMM, yyyy. + /// + /// get_daysModeTitleFormat + /// set_daysModeTitleFormat + /// + this._daysModeTitleFormat = "MMMM, yyyy"; + /// + /// The name of a CSS class used to style the calendar. + /// The default value is ajax__calendar + /// + /// get_cssClass + /// set_cssClass + /// + this._cssClass = "ajax__calendar"; + /// + /// Determines whether or not this behavior is available for the current element. + /// + /// get_enabled + /// set_enabled + /// + this._enabled = true; + /// + /// Sets whether or not changing modes is animated. + /// The default is true + /// + /// get_animated + /// set_animated + /// + this._animated = true; + this._buttonID = null; + this._layoutRequested = 0; + this._layoutSuspended = false; + /// + /// The button to use to show the calendar (optional). + /// + /// get_button + /// set_button + /// + this._button = null; + this._popupMouseDown = false; + /// + /// A date that the calendar is initialized with. + /// + /// get_selectedDate + /// set_selectedDate + /// + this._selectedDate = null; + /// + /// The start date for the range. + /// + /// get_startDate + /// set_startDate + /// + this._startDate = null; + /// + /// The end date for a range. + /// + /// get_endDate + /// set_endDate + /// + this._endDate = null; + /// + /// The date currently visible in the calendar. + /// + /// get_visibleDate + /// set_visibleDate + /// + this._visibleDate = null; + /// + /// The date to use for "Today". + /// + /// get_todaysDate + /// set_todaysDate + /// + this._todaysDate = null; + /// + /// The first day of the week. + /// The default value is Default + /// + /// get_firstDayOfWeek + /// set_firstDayOfWeek + /// + this._firstDayOfWeek = Sys.Extended.UI.FirstDayOfWeek.Default; + this._firstPopUp = true; + + this._container = null; + this._popupDiv = null; + this._header = null; + this._prevArrow = null; + this._nextArrow = null; + this._title = null; + this._body = null; + /// + /// The button used to select today's date. + /// + /// get_todayButton + /// + this._today = null; + this._days = null; + this._daysTable = null; + this._daysTableHeader = null; + this._daysTableHeaderRow = null; + this._daysBody = null; + this._months = null; + this._monthsTable = null; + this._monthsBody = null; + this._years = null; + this._yearsTable = null; + this._yearsBody = null; + /// + /// The popup position of the calendar. + /// The default is BottomLeft + /// + /// get_popupPosition + /// set_popupPosition + /// + this._popupPosition = Sys.Extended.UI.CalendarPosition.BottomLeft; + /// + /// The default view of the calender. The default value is Days. + /// + /// get_defaultView + /// set_defaultView + /// + this._defaultView = Sys.Extended.UI.CalendarDefaultView.Days; + + this._popupBehavior = null; + this._modeChangeAnimation = null; + this._modeChangeMoveTopOrLeftAnimation = null; + this._modeChangeMoveBottomOrRightAnimation = null; + this._mode = "days"; + this._selectedDateChanging = false; + /// + /// Determines whether or not the calendar is open. + /// The default value is false + /// + /// get_isOpen + /// + this._isOpen = false; + this._isAnimating = false; + /// + /// Determines whether or not time should be cleared in the edited date/time. + /// The default is false + /// + /// get_clearTime + /// set_clearTime + /// + this._clearTime = false; + this._width = 170; + this._height = 139; + this._modes = { "days": null, "months": null, "years": null }; + this._modeOrder = { "days": 0, "months": 1, "years": 2 }; + + this._blur = new Sys.Extended.UI.DeferredOperation(1, this, this.blur); + + this._button$delegates = { + click: Function.createDelegate(this, this._button_onclick), + keypress: Function.createDelegate(this, this._button_onkeypress), + blur: Function.createDelegate(this, this._button_onblur) + } + this._element$delegates = { + change: Function.createDelegate(this, this._element_onchange), + keypress: Function.createDelegate(this, this._element_onkeypress), + click: Function.createDelegate(this, this._element_onclick), + focus: Function.createDelegate(this, this._element_onfocus), + blur: Function.createDelegate(this, this._element_onblur) + } + this._popup$delegates = { + mousedown: Function.createDelegate(this, this._popup_onmousedown), + mouseup: Function.createDelegate(this, this._popup_onmouseup), + drag: Function.createDelegate(this, this._popup_onevent), + dragstart: Function.createDelegate(this, this._popup_onevent) + } + this._cell$delegates = { + mouseover: Function.createDelegate(this, this._cell_onmouseover), + mouseout: Function.createDelegate(this, this._cell_onmouseout), + click: Function.createDelegate(this, this._cell_onclick) + } +} +Sys.Extended.UI.CalendarBehavior.prototype = { + + get_clearTime: function() { + return this._clearTime; + }, + set_clearTime: function(value) { + if(this._clearTime != value) { + this._clearTime = value; + this.raisePropertyChanged("clearTime"); + } + }, + + get_animated: function() { + return this._animated; + }, + set_animated: function(value) { + if(this._animated != value) { + this._animated = value; + this.raisePropertyChanged("animated"); + } + }, + + get_enabled: function() { + return this._enabled; + }, + set_enabled: function(value) { + if(this._enabled != value) { + this._enabled = value; + this.raisePropertyChanged("enabled"); + } + }, + + get_button: function() { + return this._button; + }, + set_button: function(value) { + if(this._button != value) { + if(this._button && this.get_isInitialized()) { + $common.removeHandlers(this._button, this._button$delegates); + } + this._button = value; + if(this._button && this.get_isInitialized()) { + $addHandlers(this._button, this._button$delegates); + } + this.raisePropertyChanged("button"); + } + }, + + get_popupPosition: function() { + return this._popupPosition; + }, + set_popupPosition: function(value) { + if(this._popupPosition != value) { + this._popupPosition = value; + this.raisePropertyChanged('popupPosition'); + } + }, + + get_startDate: function() { + return this._startDate; + }, + set_startDate: function(value) { + // The property of the start date for range + if(this._startDate != value) { + this._startDate = new Date(value); + this.raisePropertyChanged('startDate'); + } + }, + + get_endDate: function() { + return this._endDate; + }, + set_endDate: function(value) { + if(this._endDate != value) { + this._endDate = new Date(value); + this.raisePropertyChanged('endDate'); + } + }, + + get_format: function() { + return this._format; + }, + set_format: function(value) { + if(this._format != value) { + this._format = value; + this.raisePropertyChanged("format"); + } + }, + + get_todaysDateFormat: function() { + return this._todaysDateFormat; + }, + set_todaysDateFormat: function(value) { + if(this._todaysDateFormat != value) { + this._todaysDateFormat = value; + this.raisePropertyChanged("todaysDateFormat"); + } + }, + + get_daysModeTitleFormat: function() { + return this._daysModeTitleFormat; + }, + set_daysModeTitleFormat: function(value) { + if(this._daysModeTitleFormat != value) { + this._daysModeTitleFormat = value; + this.raisePropertyChanged("daysModeTitleFormat"); + } + }, + + get_selectedDate: function() { + // The date value represented by the text box + if(this._selectedDate == null) { + var value = this._textbox.get_Value(); + if(value) { + value = this._parseTextValue(value); + if(value) { + this._selectedDate = value; + } + } + } + return this._selectedDate; + }, + set_selectedDate: function(value) { + if(value && (String.isInstanceOfType(value)) && (value.length != 0)) { + value = Date.fromISO(value); + } + + if(this._selectedDate != value) { + this._selectedDate = value; + this._selectedDateChanging = true; + var text = ""; + if(value) { + text = this._convertToLocal(value).localeFormat(this._format); + + // If we don't clear the time then we transfer the time from the + // textbox to the selected value + if(!this._clearTime) { + var tbvalue = this._textbox.get_Value(); + if(tbvalue) { + tbvalue = this._parseTextValue(tbvalue); + } + if(tbvalue) { + if(value != tbvalue.getDateOnly()) { + // Transfer time from textbox to selected value + value.setUTCHours(tbvalue.getUTCHours()); + value.setUTCMinutes(tbvalue.getUTCMinutes()); + value.setUTCSeconds(tbvalue.getUTCSeconds()); + value.setUTCMilliseconds(tbvalue.getUTCMilliseconds()); + + text = this._convertToLocal(value).localeFormat(this._format); + } + } + } + + } + if(text != this._textbox.get_Value()) { + this._textbox.set_Value(text); + this._fireChanged(); + } + this._selectedDateChanging = false; + this.invalidate(); + this.raisePropertyChanged("selectedDate"); + } + }, + + get_defaultView: function() { + // The default view of the calendar when it first pops up. + return this._defaultView; + }, + set_defaultView: function(value) { + if(this._defaultView != value) { + this._defaultView = value; + this.raisePropertyChanged("defaultView"); + } + }, + + get_visibleDate: function() { + return this._visibleDate; + }, + set_visibleDate: function(value) { + if(value && (String.isInstanceOfType(value)) && (value.length != 0)) { + value = new Date(value); + } + + if(this._visibleDate != value) { + this._switchMonth(value, !this._isOpen); + this.raisePropertyChanged("visibleDate"); + } + }, + + get_isOpen: function() { + return this._isOpen; + }, + + get_todaysDate: function() { + if(this._todaysDate != null) { + return this._todaysDate; + } + return new Date(); + }, + set_todaysDate: function(value) { + if(this._todaysDate != value) { + this._todaysDate = value; + + this.invalidate(); + this.raisePropertyChanged("todaysDate"); + } + }, + + get_firstDayOfWeek: function() { + // The day of the week to appear as the first day in the calendar + return this._firstDayOfWeek; + }, + set_firstDayOfWeek: function(value) { + if(this._firstDayOfWeek != value) { + this._firstDayOfWeek = value; + this.invalidate(); + this.raisePropertyChanged("firstDayOfWeek"); + } + }, + + get_cssClass: function() { + return this._cssClass; + }, + set_cssClass: function(value) { + if(this._cssClass != value) { + if(this._cssClass && this.get_isInitialized()) { + Sys.UI.DomElement.removeCssClass(this._container, this._cssClass); + } + this._cssClass = value; + if(this._cssClass && this.get_isInitialized()) { + Sys.UI.DomElement.addCssClass(this._container, this._cssClass); + } + this.raisePropertyChanged("cssClass"); + } + }, + + get_todayButton: function() { + return this._today; + }, + + /// + /// Gets a day cell at the specified row or column + /// + /// get_dayCell + /// + get_dayCell: function(row, col) { + if(this._daysBody) { + return this._daysBody.rows[row].cells[col].firstChild; + } + return null; + }, + + /// + /// Fires when the calendar is being shown. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler("showing", handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler("showing", handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if(handler) { + handler(this, eventArgs); + } + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires after the calendar is shown. + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler("shown", handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler("shown", handler); + }, + raise_shown: function() { + var handlers = this.get_events().getHandler("shown"); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseShown: function() { + Sys.Extended.Deprecated("raiseShown", "raise_shown"); + this.raise_shown(); + }, + + /// + /// Fires when the calendar is being hidden. + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler("hiding", handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler("hiding", handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if(handler) { + handler(this, eventArgs); + } + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires after the calendar is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler("hidden", handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler("hidden", handler); + }, + raise_hidden: function() { + var handlers = this.get_events().getHandler("hidden"); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseHidden: function() { + Sys.Extended.Deprecated("raiseHidden", "raise_hidden"); + this.raise_hidden(); + }, + + /// + /// Fires when calendar date selection is changed. + /// + /// + /// + add_dateSelectionChanged: function(handler) { + this.get_events().addHandler("dateSelectionChanged", handler); + }, + remove_dateSelectionChanged: function(handler) { + this.get_events().removeHandler("dateSelectionChanged", handler); + }, + raise_dateSelectionChanged: function() { + var handlers = this.get_events().getHandler("dateSelectionChanged"); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseDateSelectionChanged: function() { + Sys.Extended.Deprecated("raiseDateSelectionChanged", "raise_dateSelectionChanged"); + this.raise_dateSelectionChanged(); + }, + + initialize: function() { + Sys.Extended.UI.CalendarBehavior.callBaseMethod(this, "initialize"); + + var elt = this.get_element(); + $addHandlers(elt, this._element$delegates); + + if(this._button) { + $addHandlers(this._button, this._button$delegates); + } + + this._modeChangeMoveTopOrLeftAnimation = new Sys.Extended.UI.Animation.LengthAnimation(null, null, null, "style", null, 0, 0, "px"); + this._modeChangeMoveBottomOrRightAnimation = new Sys.Extended.UI.Animation.LengthAnimation(null, null, null, "style", null, 0, 0, "px"); + this._modeChangeAnimation = new Sys.Extended.UI.Animation.ParallelAnimation(null, .25, null, [this._modeChangeMoveTopOrLeftAnimation, this._modeChangeMoveBottomOrRightAnimation]); + + var value = this.get_selectedDate(); + if(value) { + this.set_selectedDate(value); + } + }, + dispose: function() { + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + this._modes = null; + this._modeOrder = null; + if(this._modeChangeMoveTopOrLeftAnimation) { + this._modeChangeMoveTopOrLeftAnimation.dispose(); + this._modeChangeMoveTopOrLeftAnimation = null; + } + if(this._modeChangeMoveBottomOrRightAnimation) { + this._modeChangeMoveBottomOrRightAnimation.dispose(); + this._modeChangeMoveBottomOrRightAnimation = null; + } + if(this._modeChangeAnimation) { + this._modeChangeAnimation.dispose(); + this._modeChangeAnimation = null; + } + if(this._container) { + if(this._container.parentNode) { // added this check before calling removeChild WI: 8486 + this._container.parentNode.removeChild(this._container); + } + this._container = null; + } + if(this._popupDiv) { + $common.removeHandlers(this._popupDiv, this._popup$delegates); + this._popupDiv = null; + } + if(this._prevArrow) { + $common.removeHandlers(this._prevArrow, this._cell$delegates); + this._prevArrow = null; + } + if(this._nextArrow) { + $common.removeHandlers(this._nextArrow, this._cell$delegates); + this._nextArrow = null; + } + if(this._title) { + $common.removeHandlers(this._title, this._cell$delegates); + this._title = null; + } + if(this._today) { + $common.removeHandlers(this._today, this._cell$delegates); + this._today = null; + } + if(this._button) { + $common.removeHandlers(this._button, this._button$delegates); + this._button = null; + } + if(this._daysBody) { + for(var i = 0; i < this._daysBody.rows.length; i++) { + var row = this._daysBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + $common.removeHandlers(row.cells[j].firstChild, this._cell$delegates); + } + } + this._daysBody = null; + } + if(this._monthsBody) { + for(var i = 0; i < this._monthsBody.rows.length; i++) { + var row = this._monthsBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + $common.removeHandlers(row.cells[j].firstChild, this._cell$delegates); + } + } + this._monthsBody = null; + } + if(this._yearsBody) { + for(var i = 0; i < this._yearsBody.rows.length; i++) { + var row = this._yearsBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + $common.removeHandlers(row.cells[j].firstChild, this._cell$delegates); + } + } + this._yearsBody = null; + } + var elt = this.get_element(); + $common.removeHandlers(elt, this._element$delegates); + Sys.Extended.UI.CalendarBehavior.callBaseMethod(this, "dispose"); + }, + + /// + /// Shows the calendar. + /// + /// + show: function() { + this._ensureCalendar(); + + if(!this._isOpen) { + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + if(eventArgs.get_cancel()) { + return; + } + + this._isOpen = true; + + this._popupBehavior.show(); + + if(this._firstPopUp) { + this._switchMonth(null, true); + switch(this._defaultView) { + case Sys.Extended.UI.CalendarDefaultView.Months: + this._switchMode("months", true); + break; + case Sys.Extended.UI.CalendarDefaultView.Years: + this._switchMode("years", true); + break; + } + this._firstPopUp = false; + } + + this.raise_shown(); + } + }, + + /// + /// Hides the calendar. + /// + /// + hide: function() { + if(this._isOpen) { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + if(eventArgs.get_cancel()) { + return; + } + + if(this._container) { + this._popupBehavior.hide(); + } + this._isOpen = false; + this.raise_hidden(); + + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + + /// + /// Focuses the calendar. + /// + /// + focus: function() { + if(this._button) { + this._button.focus(); + } else { + this.get_element().focus(); + } + }, + + /// + /// Blurs the calendar. + /// + /// + blur: function(force) { + if(!force && Sys.Browser.agent === Sys.Browser.Opera) { + this._blur.post(true); + } else { + if(!this._popupMouseDown) { + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + + suspendLayout: function() { + // Suspends layout of the behavior while setting properties + this._layoutSuspended++; + }, + + resumeLayout: function() { + // Resumes layout of the behavior and performs any pending layout requests + + this._layoutSuspended--; + if(this._layoutSuspended <= 0) { + this._layoutSuspended = 0; + if(this._layoutRequested) { + this._performLayout(); + } + } + }, + + invalidate: function() { + // Performs layout of the behavior unless layout is suspended + + if(this._layoutSuspended > 0) { + this._layoutRequested = true; + } else { + this._performLayout(); + } + }, + + _buildCalendar: function() { + // Builds the calendar's layout + + var elt = this.get_element(); + var id = this.get_id(); + + this._container = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_container" }, + cssClasses: [this._cssClass], + visible: false + }, elt.parentNode); + + this._popupDiv = $common.createElementFromTemplate({ + nodeName: "div", + events: this._popup$delegates, + properties: { + id: id + "_popupDiv" + }, + cssClasses: ["ajax__calendar_container"] + }, this._container); + }, + _buildHeader: function() { + var id = this.get_id(); + + this._header = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_header" }, + cssClasses: ["ajax__calendar_header"] + }, this._popupDiv); + + var prevArrowWrapper = $common.createElementFromTemplate({ nodeName: "div" }, this._header); + this._prevArrow = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_prevArrow", + mode: "prev" + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_prev"] + }, prevArrowWrapper); + + var nextArrowWrapper = $common.createElementFromTemplate({ nodeName: "div" }, this._header); + this._nextArrow = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_nextArrow", + mode: "next" + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_next"] + }, nextArrowWrapper); + + var titleWrapper = $common.createElementFromTemplate({ nodeName: "div" }, this._header); + + this._title = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_title", + mode: "title" + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_title"] + }, titleWrapper); + }, + _buildBody: function() { + this._body = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: this.get_id() + "_body" }, + cssClasses: ["ajax__calendar_body"] + }, this._popupDiv); + + this._buildDays(); + this._buildMonths(); + this._buildYears(); + }, + _buildFooter: function() { + var todayWrapper = $common.createElementFromTemplate({ nodeName: "div" }, this._popupDiv); + this._today = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: this.get_id() + "_today", + mode: "today" + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_footer", "ajax__calendar_today"] + }, todayWrapper); + }, + _buildDays: function() { + // Builds a "days of the month" view for the calendar + + var dtf = Sys.CultureInfo.CurrentCulture.dateTimeFormat; + var id = this.get_id(); + + this._days = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_days" }, + cssClasses: ["ajax__calendar_days"] + }, this._body); + this._modes["days"] = this._days; + + this._daysTable = $common.createElementFromTemplate({ + nodeName: "table", + properties: { + id: id + "_daysTable", + style: { margin: "auto" } + } + }, this._days); + + this._daysTableHeader = $common.createElementFromTemplate({ nodeName: "thead", properties: { id: id + "_daysTableHeader" } }, this._daysTable); + this._daysTableHeaderRow = $common.createElementFromTemplate({ nodeName: "tr", properties: { id: id + "_daysTableHeaderRow" } }, this._daysTableHeader); + for(var i = 0; i < 7; i++) { + var dayCell = $common.createElementFromTemplate({ nodeName: "td" }, this._daysTableHeaderRow); + var dayDiv = $common.createElementFromTemplate({ + nodeName: "div", + cssClasses: ["ajax__calendar_dayname"] + }, dayCell); + } + + this._daysBody = $common.createElementFromTemplate({ nodeName: "tbody", properties: { id: id + "_daysBody" } }, this._daysTable); + for(var i = 0; i < 6; i++) { + var daysRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._daysBody); + for(var j = 0; j < 7; j++) { + var dayCell = $common.createElementFromTemplate({ nodeName: "td" }, daysRow); + var dayDiv = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + mode: "day", + id: id + "_day_" + i + "_" + j, + innerHTML: " " + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_day"] + }, dayCell); + } + } + }, + _buildMonths: function() { + // Builds a "months of the year" view for the calendar + + var dtf = Sys.CultureInfo.CurrentCulture.dateTimeFormat; + var id = this.get_id(); + + this._months = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_months" }, + cssClasses: ["ajax__calendar_months"], + visible: false + }, this._body); + this._modes["months"] = this._months; + + this._monthsTable = $common.createElementFromTemplate({ + nodeName: "table", + properties: { + id: id + "_monthsTable", + style: { margin: "auto" } + } + }, this._months); + + this._monthsBody = $common.createElementFromTemplate({ nodeName: "tbody", properties: { id: id + "_monthsBody" } }, this._monthsTable); + for(var i = 0; i < 3; i++) { + var monthsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._monthsBody); + for(var j = 0; j < 4; j++) { + var monthCell = $common.createElementFromTemplate({ nodeName: "td" }, monthsRow); + var monthDiv = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_month_" + i + "_" + j, + mode: "month", + month: (i * 4) + j, + innerHTML: "
    " + dtf.AbbreviatedMonthNames[(i * 4) + j] + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_month"] + }, monthCell); + } + } + }, + _buildYears: function() { + // Builds a "years in this decade" view for the calendar + + var id = this.get_id(); + + this._years = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_years" }, + cssClasses: ["ajax__calendar_years"], + visible: false + }, this._body); + this._modes["years"] = this._years; + + this._yearsTable = $common.createElementFromTemplate({ + nodeName: "table", + properties: { + id: id + "_yearsTable", + style: { margin: "auto" } + } + }, this._years); + + this._yearsBody = $common.createElementFromTemplate({ nodeName: "tbody", properties: { id: id + "_yearsBody" } }, this._yearsTable); + for(var i = 0; i < 3; i++) { + var yearsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._yearsBody); + for(var j = 0; j < 4; j++) { + var yearCell = $common.createElementFromTemplate({ nodeName: "td" }, yearsRow); + var yearDiv = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_year_" + i + "_" + j, + mode: "year", + year: ((i * 4) + j) - 1 + }, + events: this._cell$delegates, + cssClasses: ["ajax__calendar_year"] + }, yearCell); + } + } + }, + + _isInDateRange: function(date, part) { + switch(part) { + case "d": + if((this._startDate) && (this._getDateOnly(date) < this._getDateOnly(this._startDate))) { return false; } + if((this._endDate) && (this._getDateOnly(date) > this._getDateOnly(this._endDate))) { return false; } + break; + case "M": + if((this._startDate) && (this._getMonthOnly(date) < this._getMonthOnly(this._startDate))) { return false; } + if((this._endDate) && (this._getMonthOnly(date) > this._getMonthOnly(this._endDate))) { return false; } + break; + case "y": + if((this._startDate) && (date.getUTCFullYear() < this._startDate.getUTCFullYear())) { return false; } + if((this._endDate) && (date.getUTCFullYear() > this._endDate.getUTCFullYear())) { return false; } + break; + case "yy": + var startYear = date.getUTCFullYear(); + var endYear = date.getUTCFullYear() + 9; + + if (this._startDate && this._endDate) { + if (startYear < this._startDate.getUTCFullYear() + && + endYear > this._endDate.getUTCFullYear()) + return true; + + return false; + } + else { + if(!this._startDate && !this._endDate) + return true; + + if (this._startDate && endYear > this._startDate.getUTCFullYear()) + return true; + + if (this._endDate && startYear < this._endDate.getUTCFullYear()) + return true; + + return false; + } + + break; + } + return true; + }, + _isInNextDateRange: function (date, part) { + switch (part) { + case "d": + if ((this._startDate) && (this._getDateOnly(date) > this._getDateOnly(this._startDate))) { return false; } + break; + case "M": + if ((this._startDate) && (this._getMonthOnly(date) > this._getMonthOnly(this._startDate))) { return false; } + break; + case "y": + if ((this._startDate) && (date.getUTCFullYear() > this._startDate.getUTCFullYear())) { return false; } + break; + case "yy": + var startYear = date.getUTCFullYear(); + var endYear = date.getUTCFullYear(); + if ((this._startDate) && (date.getUTCFullYear() > this._startDate.getUTCFullYear())) { return false; } + break; + } + return true; + }, + _isInPrevDateRange: function (date, part) { + switch (part) { + case "d": + if ((this._endDate) && (this._getDateOnly(date) < this._getDateOnly(this._endDate))) { return false; } + break; + case "M": + if ((this._endDate) && (this._getMonthOnly(date) < this._getMonthOnly(this._endDate))) { return false; } + break; + case "y": + if ((this._endDate) && (date.getUTCFullYear() < this._endDate.getUTCFullYear())) { return false; } + break; + case "yy": + var startYear = date.getUTCFullYear(); + var endYear = date.getUTCFullYear() + 9; + + if (this._startDate || this._endDate) + { + if (startYear < this._startDate.getUTCFullYear() + && + endYear > this._endDate.getUTCFullYear()) + return true; + } + + break; + } + return true; + }, + + _getDateOnly: function(date) { + return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())); + }, + + _getMonthOnly: function(date) { + return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); + }, + + _convertToUTC: function(value) { + // Converts a local date such as 1/1/2007 into 1/1/2007 GMT without adjusting for time zone + if(value) { + value = new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds())); + } + return value; + }, + + _convertToLocal: function(value) { + // Converts a UTC date such as 1/1/2007 GMT into 1/1/2007 without adjusting for time zone + + var result = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds()); + + // Handle daylight savings time offset (The first hour of September 25 becomes the last hour of September 24 when DST starts) + if(result.getDate() != value.getUTCDate()) { + result = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours() + 1, value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds()); + } + return result; + }, + + _performLayout: function() { + // Updates the various views of the calendar to match the current selected and visible dates + + var elt = this.get_element(); + if(!elt) return; + if(!this.get_isInitialized()) return; + if(!this._isOpen) return; + + var dtf = Sys.CultureInfo.CurrentCulture.dateTimeFormat; + var selectedDate = this.get_selectedDate(); + var visibleDate = this._getEffectiveVisibleDate(); + var todaysDate = this.get_todaysDate(); + switch(this._mode) { + case "days": + + var firstDayOfWeek = this._getFirstDayOfWeek(); + var daysToBacktrack = visibleDate.getUTCDay() - firstDayOfWeek; + if(daysToBacktrack <= 0) + daysToBacktrack += 7; + + var startDate = new Date(visibleDate); + startDate.setUTCDate(startDate.getUTCDate() - daysToBacktrack); + var currentDate = new Date(startDate); + + for(var i = 0; i < 7; i++) { + var dayCell = this._daysTableHeaderRow.cells[i].firstChild; + if(dayCell.firstChild) { + dayCell.removeChild(dayCell.firstChild); + } + dayCell.appendChild(document.createTextNode(dtf.ShortestDayNames[(i + firstDayOfWeek) % 7])); + } + for(var week = 0; week < 6; week++) { + var weekRow = this._daysBody.rows[week]; + for(var dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) { + var dayCell = weekRow.cells[dayOfWeek].firstChild; + if(dayCell.firstChild) { + dayCell.removeChild(dayCell.firstChild); + } + dayCell.appendChild(document.createTextNode(currentDate.getUTCDate())); + dayCell.title = this._convertToLocal(currentDate).localeFormat("D"); + dayCell.date = currentDate; + $common.removeCssClasses(dayCell.parentNode, ["ajax__calendar_other", "ajax__calendar_active", "ajax__calendar_today"]); + + if(!this._isInDateRange(currentDate, "d")) { + $common.removeCssClasses(dayCell.parentNode, ["ajax__calendar_other", "ajax__calendar_active"]); + Sys.UI.DomElement.addCssClass(dayCell.parentNode, "ajax__calendar_invalid"); + } else { + $common.removeCssClasses(dayCell.parentNode, ["ajax__calendar_invalid", "ajax__calendar_other", "ajax__calendar_active", ""]); + Sys.UI.DomElement.addCssClass(dayCell.parentNode, this._getCssClass(dayCell.date, 'd')); + } + + currentDate = new Date(currentDate); + currentDate.setUTCDate(currentDate.getUTCDate() + 1); + } + } + + this._prevArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), visibleDate.getUTCMonth() - 1, 1)); + this._nextArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), visibleDate.getUTCMonth() + 1, 1)); + if(this._title.firstChild) { + this._title.removeChild(this._title.firstChild); + } + + this._title.appendChild(document.createTextNode(this._convertToLocal(visibleDate).localeFormat(this.get_daysModeTitleFormat()))); + this._title.date = visibleDate; + + break; + case "months": + for(var i = 0; i < this._monthsBody.rows.length; i++) { + var row = this._monthsBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + var cell = row.cells[j].firstChild; + cell.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), cell.month, 1)); + cell.title = this._convertToLocal(cell.date).localeFormat("Y"); + + if(!this._isInDateRange(cell.date, "M")) { + $common.removeCssClasses(cell.parentNode, ["ajax__calendar_other", "ajax__calendar_active"]); + Sys.UI.DomElement.addCssClass(cell.parentNode, "ajax__calendar_invalid"); + } + else { + + $common.removeCssClasses(cell.parentNode, ["ajax__calendar_invalid", "ajax__calendar_other", "ajax__calendar_active"]); + Sys.UI.DomElement.addCssClass(cell.parentNode, this._getCssClass(cell.date, 'M')); + } + } + } + + if(this._title.firstChild) { + this._title.removeChild(this._title.firstChild); + } + + this._title.appendChild(document.createTextNode(this._convertToLocal(visibleDate).localeFormat("yyyy"))); + this._title.date = visibleDate; + this._prevArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear() - 1, 0, 1)); + this._nextArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear() + 1, 0, 1)); + + break; + case "years": + + var minYear = (Math.floor(visibleDate.getUTCFullYear() / 10) * 10); + for(var i = 0; i < this._yearsBody.rows.length; i++) { + var row = this._yearsBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + var cell = row.cells[j].firstChild; + cell.date = new Date(Date.UTC(minYear + cell.year, 0, 1)); + if(cell.firstChild) { + cell.removeChild(cell.lastChild); + } else { + cell.appendChild(document.createElement("br")); + } + cell.appendChild(document.createTextNode(minYear + cell.year)); + + if(!this._isInDateRange(cell.date, "y")) { + $common.removeCssClasses(cell.parentNode, ["ajax__calendar_other", "ajax__calendar_active"]); + Sys.UI.DomElement.addCssClass(cell.parentNode, "ajax__calendar_invalid"); + } + else { + $common.removeCssClasses(cell.parentNode, ["ajax__calendar_invalid", "ajax__calendar_other", "ajax__calendar_active"]); + Sys.UI.DomElement.addCssClass(cell.parentNode, this._getCssClass(cell.date, 'y')); + } + } + } + + if(this._title.firstChild) { + this._title.removeChild(this._title.firstChild); + } + + this._title.appendChild(document.createTextNode(minYear.toString() + "-" + (minYear + 9).toString())); + this._title.date = visibleDate; + this._prevArrow.date = new Date(Date.UTC(minYear - 10, 0, 1)); + this._nextArrow.date = new Date(Date.UTC(minYear + 10, 0, 1)); + + break; + } + if(this._today.firstChild) { + this._today.removeChild(this._today.firstChild); + } + + $common.removeCssClasses(this._today.parentNode, ["ajax__calendar_invalid"]); + this._today.appendChild(document.createTextNode(String.format(Sys.Extended.UI.Resources.Calendar_Today, todaysDate.localeFormat(this.get_todaysDateFormat())))); + if(!this._isInDateRange(todaysDate, "d")) { + Sys.UI.DomElement.addCssClass(this._today.parentNode, "ajax__calendar_invalid"); + } + + this._today.date = this._convertToUTC(todaysDate); + }, + + _ensureCalendar: function() { + + if(!this._container) { + + var elt = this.get_element(); + + this._buildCalendar(); + this._buildHeader(); + this._buildBody(); + this._buildFooter(); + + this._popupBehavior = new $create(Sys.Extended.UI.PopupBehavior, { parentElement: elt }, {}, {}, this._container); + if(this._popupPosition == Sys.Extended.UI.CalendarPosition.TopLeft) { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopLeft); + } else if(this._popupPosition == Sys.Extended.UI.CalendarPosition.TopRight) { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopRight); + } else if(this._popupPosition == Sys.Extended.UI.CalendarPosition.BottomRight) { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomRight); + } else if(this._popupPosition == Sys.Extended.UI.CalendarPosition.Right) { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Right); + } else if(this._popupPosition == Sys.Extended.UI.CalendarPosition.Left) { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Left); + } else { + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomLeft); + } + } + }, + + _fireChanged: function() { + // Attempts to fire the change event on the attached textbox + + var elt = this.get_element(); + if(document.createEventObject) { + elt.fireEvent("onchange"); + } else if(document.createEvent) { + var e = document.createEvent("HTMLEvents"); + e.initEvent("change", true, true); + elt.dispatchEvent(e); + } + }, + _switchMonth: function(date, dontAnimate) { + // Switches the visible month in the days view + // param name "date" of type "Date" is the visible date to switch to + // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated + + // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time + if(this._isAnimating) { + return; + } + + // Check if can switch month depending on the startDate and endDAte + if(date && !this._canSwitchMonth(date)) { + return; + } + + var visibleDate = this._getEffectiveVisibleDate(); + if((date && date.getFullYear() == visibleDate.getFullYear() && date.getMonth() == visibleDate.getMonth())) { + dontAnimate = true; + } + + if(this._animated && !dontAnimate) { + this._isAnimating = true; + + var newElement = this._modes[this._mode]; + var oldElement = newElement.cloneNode(true); + this._body.appendChild(oldElement); + if(visibleDate > date) { + + // animating down + // the newIndex element is the top + // the oldIndex element is the bottom (visible) + + // move in, fade in + $common.setLocation(newElement, { x: -162, y: 0 }); + $common.setVisible(newElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"); + this._modeChangeMoveTopOrLeftAnimation.set_target(newElement); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(0); + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"); + this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width); + + } else { + // animating up + // the oldIndex element is the top (visible) + // the newIndex element is the bottom + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"); + this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(0); + + // move in, fade in + $common.setLocation(newElement, { x: 162, y: 0 }); + $common.setVisible(newElement, true); + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"); + this._modeChangeMoveBottomOrRightAnimation.set_target(newElement); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width); + } + this._visibleDate = date; + this.invalidate(); + + var endHandler = Function.createDelegate(this, function() { + this._body.removeChild(oldElement); + oldElement = null; + this._isAnimating = false; + this._modeChangeAnimation.remove_ended(endHandler); + }); + this._modeChangeAnimation.add_ended(endHandler); + this._modeChangeAnimation.play(); + } else { + this._visibleDate = date; + this.invalidate(); + } + }, + _switchNextRange: function(date, dontAnimate) { + // Switches the visible month in the days view + // param name "date" of type "Date" is the visible date to switch to + // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated + + // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time + if(this._isAnimating) { + return; + } + + // Check if can switch month depending on the startDate and endDAte + if(date && !this._canSwitchNextRange(date)) { + return; + } + + this._switchRange(date, dontAnimate); + }, + _switchPrevRange: function (date, dontAnimate) { + // Switches the visible month in the days view + // param name "date" of type "Date" is the visible date to switch to + // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated + + // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time + if (this._isAnimating) { + return; + } + + // Check if can switch month depending on the startDate and endDAte + if (date && !this._canSwitchPrevRange(date)) { + return; + } + + this._switchRange(date, dontAnimate); + }, + _switchRange: function (date, dontAnimate) + { + var visibleDate = this._getEffectiveVisibleDate(); + if((date && date.getFullYear() == visibleDate.getFullYear() && date.getMonth() == visibleDate.getMonth())) { + dontAnimate = true; + } + + if(this._animated && !dontAnimate) { + this._isAnimating = true; + + var newElement = this._modes[this._mode]; + var oldElement = newElement.cloneNode(true); + this._body.appendChild(oldElement); + if(visibleDate > date) { + + // animating down + // the newIndex element is the top + // the oldIndex element is the bottom (visible) + + // move in, fade in + $common.setLocation(newElement, { x: -162, y: 0 }); + $common.setVisible(newElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"); + this._modeChangeMoveTopOrLeftAnimation.set_target(newElement); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(0); + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"); + this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width); + + } else { + // animating up + // the oldIndex element is the top (visible) + // the newIndex element is the bottom + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"); + this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(0); + + // move in, fade in + $common.setLocation(newElement, { x: 162, y: 0 }); + $common.setVisible(newElement, true); + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"); + this._modeChangeMoveBottomOrRightAnimation.set_target(newElement); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width); + } + this._visibleDate = date; + this.invalidate(); + + var endHandler = Function.createDelegate(this, function() { + this._body.removeChild(oldElement); + oldElement = null; + this._isAnimating = false; + this._modeChangeAnimation.remove_ended(endHandler); + }); + this._modeChangeAnimation.add_ended(endHandler); + this._modeChangeAnimation.play(); + } else { + this._visibleDate = date; + this.invalidate(); + } + }, + + + _canSwitchMonth: function(date) { + switch(this._mode) { + case "days": + if(!this._isInDateRange(date, "M")) { + return false; + } + break; + case "months": + if(!this._isInDateRange(date, "y")) { + return false; + } + break; + case "years": + if(!this._isInDateRange(date, "yy")) { + return false; + } + break; + } + return true; + }, + _canSwitchNextRange: function (date) { + switch (this._mode) { + case "days": + return this._isInNextDateRange(date, "M"); + case "months": + return this._isInNextDateRange(date, "y"); + case "years": + return this._isInNextDateRange(date, "yy"); + } + }, + _canSwitchPrevRange: function (date) { + switch (this._mode) { + case "days": + return this._isInPrevDateRange(date, "M"); + case "months": + return this._isInPrevDateRange(date, "y"); + case "years": + return this._isInPrevDateRange(date, "yy"); + } + }, + + _switchMode: function(mode, dontAnimate) { + // Switches the visible view from "days" to "months" to "years" + // param name "mode" of type "String" is the view mode to switch to + // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated + + // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time + if(this._isAnimating || (this._mode == mode)) { + return; + } + + var moveDown = this._modeOrder[this._mode] < this._modeOrder[mode]; + var oldElement = this._modes[this._mode]; + var newElement = this._modes[mode]; + this._mode = mode; + + if(this._animated && !dontAnimate) { + this._isAnimating = true; + + this.invalidate(); + + if(moveDown) { + // animating down + // the newIndex element is the top + // the oldIndex element is the bottom (visible) + + // move in, fade in + $common.setLocation(newElement, { x: 0, y: -this._height }); + $common.setVisible(newElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("top"); + this._modeChangeMoveTopOrLeftAnimation.set_target(newElement); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._height); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(0); + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("top"); + this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._height); + + } else { + // animating up + // the oldIndex element is the top (visible) + // the newIndex element is the bottom + + // move out, fade out + $common.setLocation(oldElement, { x: 0, y: 0 }); + $common.setVisible(oldElement, true); + this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("top"); + this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement); + this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._height); + this._modeChangeMoveTopOrLeftAnimation.set_startValue(0); + + // move in, fade in + $common.setLocation(newElement, { x: 0, y: 139 }); + $common.setVisible(newElement, true); + this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("top"); + this._modeChangeMoveBottomOrRightAnimation.set_target(newElement); + this._modeChangeMoveBottomOrRightAnimation.set_endValue(0); + this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._height); + } + var endHandler = Function.createDelegate(this, function() { + this._isAnimating = false; + this._modeChangeAnimation.remove_ended(endHandler); + }); + this._modeChangeAnimation.add_ended(endHandler); + this._modeChangeAnimation.play(); + } else { + this._mode = mode; + $common.setVisible(oldElement, false); + this.invalidate(); + $common.setVisible(newElement, true); + $common.setLocation(newElement, { x: 0, y: 0 }); + } + }, + _isSelected: function(date, part) { + // Gets whether the supplied date is the currently selected date + // "date" - the date to match + // "part" - the most significant part of the date to test + + var value = this.get_selectedDate(); + if(!value) return false; + switch(part) { + case 'd': + if(date.getUTCDate() != value.getUTCDate()) return false; + // goto case 'M'; + case 'M': + if(date.getUTCMonth() != value.getUTCMonth()) return false; + // goto case 'y'; + case 'y': + if(date.getUTCFullYear() != value.getUTCFullYear()) return false; + break; + } + return true; + }, + + _isOther: function(date, part) { + // Gets whether the supplied date is in a different view from the current visible month + // "date" - the date to match + // "part" - the most significant part of the date to test + + var value = this._getEffectiveVisibleDate(); + switch(part) { + case 'd': + return (date.getUTCFullYear() != value.getUTCFullYear() || date.getUTCMonth() != value.getUTCMonth()); + case 'M': + return false; + case 'y': + var minYear = (Math.floor(value.getUTCFullYear() / 10) * 10); + return date.getUTCFullYear() < minYear || (minYear + 10) <= date.getUTCFullYear(); + } + return false; + }, + + _isTodaysDate: function(date) { + return this._getDateOnly(this._convertToUTC(this.get_todaysDate())).valueOf() === this._getDateOnly(date).valueOf(); + }, + + _getCssClass: function(date, part) { + // Gets the cssClass to apply to a cell based on a supplied date + // "date" - is the date to match + // "part" - the most significant part of the date to test + + if(this._isSelected(date, part)) { + return "ajax__calendar_active"; + } else if(this._isOther(date, part)) { + return "ajax__calendar_other"; + // Highlight today's date + } else if(this._isTodaysDate(date)) { + return "ajax__calendar_today"; + } else { + return ""; + } + }, + _getEffectiveVisibleDate: function() { + var value = this.get_visibleDate(); + if(value == null) + value = this.get_selectedDate(); + if(value == null) + value = this.get_todaysDate(); + + value = new Date(value); + value.setUTCDate(1); + + return this._getDateOnly(value); + }, + + + _getFirstDayOfWeek: function() { + // Gets the first day of the week + + if(this.get_firstDayOfWeek() != Sys.Extended.UI.FirstDayOfWeek.Default) { + return this.get_firstDayOfWeek(); + } + return Sys.CultureInfo.CurrentCulture.dateTimeFormat.FirstDayOfWeek; + }, + _parseTextValue: function(text) { + // Converts a text value from the textbox into a date + + var value = null; + if(text) { + value = this._convertToUTC(Date.parseLocale(text, this.get_format())); + } + if(isNaN(value)) { + value = null; + } + return value; + }, + + _element_onfocus: function(e) { + // Handles the focus event of the element + if(!this._enabled) return; + if(!this._button) { + this.show(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + _element_onblur: function(e) { + // Handles the blur event of the element + if(!this._enabled) return; + if(!this._button) { + this.blur(); + } + }, + _element_onchange: function(e) { + // Handles the change event of the element + if(!this._selectedDateChanging) { + var value = this._parseTextValue(this._textbox.get_Value()); + this._selectedDate = value; + if(this._isOpen) { + this._switchMonth(this._selectedDate, this._selectedDate == null); + } + } + }, + _element_onkeypress: function(e) { + // Handles the keypress event of the element + if(!this._enabled) return; + if(!this._button && e.charCode == Sys.UI.Key.esc) { + e.stopPropagation(); + e.preventDefault(); + this.hide(); + } + }, + _element_onclick: function(e) { + // Handles the click event of the element + if(!this._enabled) return; + if(!this._button) { + this.show(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + + _popup_onevent: function(e) { + // Handles the drag-start event of the popup calendar + e.stopPropagation(); + e.preventDefault(); + }, + _popup_onmousedown: function(e) { + // Handles the mousedown event of the popup + + // signal that the popup has received a mousedown event, this handles + // onblur issues on browsers like FF, OP, and SF + this._popupMouseDown = true; + }, + _popup_onmouseup: function(e) { + // Handles the mouseup event of the popup + + // signal that the popup has received a mouseup event, this handles + // onblur issues on browsers like FF, OP, and SF + if(Sys.Browser.agent === Sys.Browser.Opera && this._blur.get_isPending()) { + this._blur.cancel(); + } + this._popupMouseDown = false; + this.focus(); + }, + + _cell_onmouseover: function(e) { + // Handles the mouseover event of a cell + + e.stopPropagation(); + + if(Sys.Browser.agent === Sys.Browser.Safari) { + // Safari doesn't reliably call _cell_onmouseout, so clear other cells here to keep the UI correct + for(var i = 0; i < this._daysBody.rows.length; i++) { + var row = this._daysBody.rows[i]; + for(var j = 0; j < row.cells.length; j++) { + Sys.UI.DomElement.removeCssClass(row.cells[j].firstChild.parentNode, "ajax__calendar_hover"); + } + } + } + + var target = e.target; + + Sys.UI.DomElement.addCssClass(target.parentNode, "ajax__calendar_hover"); + }, + _cell_onmouseout: function(e) { + // Handles the mouseout event of a cell + + e.stopPropagation(); + + var target = e.target; + + Sys.UI.DomElement.removeCssClass(target.parentNode, "ajax__calendar_hover"); + }, + _cell_onclick: function(e) { + // Handles the click event of a cell + + e.stopPropagation(); + e.preventDefault(); + + if(!this._enabled) return; + + var target = e.target; + if(target.parentNode.className.indexOf("ajax__calendar_invalid") != -1) { + return; + } + var visibleDate = this._getEffectiveVisibleDate(); + Sys.UI.DomElement.removeCssClass(target.parentNode, "ajax__calendar_hover"); + switch(target.mode) { + case "prev": + this._switchMonth(target.date); + break; + case "next": + this._switchMonth(target.date); + break; + case "title": + switch(this._mode) { + case "days": this._switchMode("months"); break; + case "months": this._switchMode("years"); break; + } + break; + case "month": + if(target.month == visibleDate.getUTCMonth()) { + this._switchMode("days"); + } else { + this._visibleDate = target.date; + this._switchMode("days"); + } + break; + case "year": + if(target.date.getFullYear() == visibleDate.getFullYear()) { + this._switchMode("months"); + } else { + this._visibleDate = target.date; + this._switchMode("months"); + } + break; + case "day": + this.set_selectedDate(target.date); + this._switchMonth(target.date); + this._blur.post(true); + this.raise_dateSelectionChanged(); + break; + case "today": + this.set_selectedDate(target.date); + this._switchMonth(target.date); + this._blur.post(true); + this.raise_dateSelectionChanged(); + break; + } + }, + + _button_onclick: function(e) { + // Handles the click event of the asociated button + e.preventDefault(); + e.stopPropagation(); + + if(!this._enabled) return; + // if event was rised not by mouse click + if(e.clientX == 0) return; + + if(!this._isOpen) { + this.show(); + } else { + this.hide(); + } + this.focus(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + // set to the date currently in the text box + if(this._visibleDate != this._selectedDate) { + this._visibleDate = this._selectedDate + this.invalidate(); + } + }, + _button_onblur: function(e) { + // Handles the blur event of the button + if(!this._enabled) return; + if(!this._popupMouseDown) { + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + }, + _button_onkeypress: function(e) { + // Handles the keypress event of the element + if(!this._enabled) return; + if(e.charCode == Sys.UI.Key.esc) { + e.stopPropagation(); + e.preventDefault(); + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } +} +Sys.Extended.UI.CalendarBehavior.registerClass("Sys.Extended.UI.CalendarBehavior", Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.CalendarPosition = function() { + // Position of the popup relative to the target control + throw Error.invalidOperation(); +} +Sys.Extended.UI.CalendarPosition.prototype = { + BottomLeft: 0, + BottomRight: 1, + TopLeft: 2, + TopRight: 3, + Right: 4, + Left: 5 +} +Sys.Extended.UI.CalendarPosition.registerEnum('Sys.Extended.UI.CalendarPosition'); + +Sys.Extended.UI.CalendarDefaultView = function() { + // Choices for default view of the calendar when it first pops up. + throw Error.invalidOperation(); +} +Sys.Extended.UI.CalendarDefaultView.prototype = { + Days: 0, + Months: 1, + Years: 2 +} +Sys.Extended.UI.CalendarDefaultView.registerEnum('Sys.Extended.UI.CalendarDefaultView'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js new file mode 100644 index 000000000..535794e94 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js @@ -0,0 +1,788 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs = function(oldValue, newValue) { + Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs.initializeBase(this); + + this._oldValue = oldValue; + this._newValue = newValue; +} +Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs.prototype = { + get_oldValue: function() { + return this._oldValue; + }, + + get_newValue: function() { + return this._newValue; + } +} +Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs.registerClass('Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs', Sys.EventArgs); + +Sys.Extended.UI.CascadingDropDownBehavior = function(e) { + // The CascadingDropDownBehavior is used to populate drop downs with values from a web service + // "e" - the DOM element the behavior is associated with + Sys.Extended.UI.CascadingDropDownBehavior.initializeBase(this, [e]); + + /// + /// A string containing an ID of a parent dropdown in a hierarchy of dropdowns. + /// + /// get_parentControlID + /// set_parentControlID + /// + this._parentControlID = null; + /// + /// A string containing a category of this dropdown. + /// + /// get_category + /// set_category + /// + this._category = null; + /// + /// A string containing prompt text that is displayed as the first entry in the dropdown. + /// + /// get_promptText + /// set_promptText + /// + this._promptText = null; + /// + /// A string containing loading text to to be displayed when getting the dropdown's values from the Web service. + /// + /// get_loadingText + /// set_loadingText + /// + this._loadingText = null; + /// + /// A string containing a value for an option displayed by DropDownList showing PromptText. + /// + /// get_promptValue + /// set_promptValue + /// + this._promptValue = null; + /// + /// A string containing a value for an option displayed when the list is empty. + /// + /// get_emptyValue + /// set_emptyValue + /// + this._emptyValue = null; + /// + /// A string containing text for an option displayed when the list is empty. + /// + /// get_emptyText + /// set_emptyText + /// + this._emptyText = null; + + /// + /// A string containing a path of the Web service. + /// The default is page path + /// + /// get_servicePath + /// set_servicePath + /// + this._servicePath = location.pathname; + + /// + /// A string containing the name of the method to invoke on the Web service. + /// + /// get_serviceMethod + /// set_serviceMethod + /// + this._serviceMethod = null; + + /// + /// A string containing user or page-specific context provided to an optional overload of the Web method described by ServiceMethod or ServicePath. + /// + /// + /// If the context key is used, it should have the same signature with an additional parameter named contextKey of the string type. + /// + /// get_contextKey + /// set_contextKey + /// + this._contextKey = null; + + /// + /// A boolean value that determines whether or not the ContextKey property should be used. + /// + /// + /// The useContextKey property will be automatically enabled if the ContextKey property is ever set either on the client or server side. + /// If the context key is used, it should have the same signature with an additional parameter named contextKey of the string type. + /// + /// get_useContextKey + /// set_useContextKey + /// + this._useContextKey = false; + + /// + /// Determines whether or not to use the HTTP GET method for requesting data. + /// + /// get_useHttpGet + /// set_useHttpGet + /// + this._useHttpGet = false; + + /// + /// Determines whether or not to disable the DropDownList control when it is waiting for + /// data from the service, so on loading a user can use the keyboard to navigate to the drop-down control. + /// + /// get_enableAtLoading + /// set_enableAtLoading + /// + this._enableAtLoading = false; + + // Variables + this._parentElement = null; + this._changeHandler = null; + this._parentChangeHandler = null; + this._lastParentValues = null; + /// + /// A string containing the selected value of the dropdown. + /// + /// get_selectedValue + /// set_selectedValue + /// + this._selectedValue = null; + this._actualDisabledStatus = false; +} + +Sys.Extended.UI.CascadingDropDownBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.CascadingDropDownBehavior.callBaseMethod(this, 'initialize'); + $common.prepareHiddenElementForATDeviceUpdate(); + + var e = this.get_element(); + this._actualDisabledStatus = e.disabled; + // Clear any items that may have been put there for server side convenience + this._clearItems(); + + e.CascadingDropDownCategory = this._category; + + // Attach change handler to self + this._changeHandler = Function.createDelegate(this, this._onChange); + $addHandler(e, "change", this._changeHandler); + + if(this._parentControlID) { + // Set properties on element so that children controls (if any) can have easy access + this._parentElement = $get(this._parentControlID); + + // Attach change handler to parent + if(!this._parentElement) { + Sys.Debug.fail(String.format(Sys.Extended.UI.Resources.CascadingDropDown_NoParentElement, this._parentControlID)); + } + + if(this._parentElement) { + e.CascadingDropDownParentControlID = this._parentControlID; + this._parentChangeHandler = Function.createDelegate(this, this._onParentChange); + + $addHandler(this._parentElement, "change", this._parentChangeHandler); + if(!this._parentElement.childDropDown) { + this._parentElement.childDropDown = new Array(); + } + this._parentElement.childDropDown.push(this); + } + } + + // Simulate parent change to populate self, even if no parent exists. + this._onParentChange(null, true); + + // Revert disable status to the actual. + var me = this; + setTimeout(function() { + if(me._actualDisabledStatus) + e.disabled = me._actualDisabledStatus; + }, 50); + }, + + dispose: function() { + var e = this.get_element(); + + // Detach change handler for self + if(this._changeHandler) { + $removeHandler(e, "change", this._changeHandler); + this._changeHandler = null; + } + + // Detach change handler for parent + if(this._parentChangeHandler) { + if(this._parentElement) { + $removeHandler(this._parentElement, "change", this._parentChangeHandler); + } + this._parentChangeHandler = null; + } + + Sys.Extended.UI.CascadingDropDownBehavior.callBaseMethod(this, 'dispose'); + }, + + _clearItems: function() { + var e = this.get_element(); + if(e != null && e.options != null) { + while(0 < e.options.length) { + e.remove(0); + } + } + }, + + _isPopulated: function() { + var items = this.get_element().options.length; + + if(this._promptText) { + return items > 1; + } else { + return items > 0; + } + }, + + _setOptions: function(list, inInit, gettingList) { + // Set the contents of the DropDownList to the specified list + // "list" - array of options (where each option has name and value properties) + // "inInit" - whether this is being called from the initialize method + // "gettingList" - whether we are fetching the list of options from the web service + if(!this.get_isInitialized()) { + return; + } + + var e = this.get_element(); + // Remove existing contents + this._clearItems(); + + // Populate prompt text (if available) + var headerText; + var headerValue = ""; + if(gettingList && this._loadingText) { + headerText = this._loadingText; + if(this._selectedValue) { + headerValue = this._selectedValue; + } + } else if(!gettingList && list && (0 == list.length) && (null != this._emptyText)) { + headerText = this._emptyText; + if(this._emptyValue) { + headerValue = this._emptyValue; + } + } else if(this._promptText) { + headerText = this._promptText; + if(this._promptValue) { + headerValue = this._promptValue; + } + } + var optionElement; + if(headerText) { + optionElement = new Option(headerText, headerValue); + e.options[e.options.length] = optionElement; + } + + // Add each item to the DropDownList, selecting the previously selected item + var selectedValueOption = null, + defaultIndex = -1; + + if(list) { + for(var i = 0; i < list.length; i++) { + var item = list[i], + listItemName = item.name, + listItemValue = item.value, + listItemOptionTitle = item.optionTitle; + + if(item.isDefaultValue) { + this.set_selectedValue(listItemValue, listItemName, listItemOptionTitle); + defaultIndex = i; + if(this._promptText) { + // bump the index if there's a prompt item in the list. + // + defaultIndex++; + } + } + + optionElement = new Option(listItemName, listItemValue); + if(listItemValue == this._selectedValue) { + selectedValueOption = optionElement; + } + // Populate the title attribute with the optionTitle value provided by the service (shows tooltip over item on some + // modern browsers) + if(listItemOptionTitle) { + optionElement.setAttribute('title', listItemOptionTitle); + } + + e.options[e.options.length] = optionElement; + } + if(selectedValueOption) { + selectedValueOption.selected = true; + } + } + + // if we didn't match the selected value, and we found a default + // item, select that one. + // + if(selectedValueOption) { + // Call set_selectedValue to store the text as well + this.set_selectedValue(e.options[e.selectedIndex].value, e.options[e.selectedIndex].text); + } else if(!selectedValueOption && defaultIndex != -1) { + e.options[defaultIndex].selected = true; + this.set_selectedValue(e.options[defaultIndex].value, e.options[defaultIndex].text); + } else if(!inInit && !selectedValueOption && !gettingList && !this._promptText && (e.options.length > 0)) { + // If no prompt text or default item, select the first item + this.set_selectedValue(e.options[0].value, e.options[0].text); + } else if(!inInit && !selectedValueOption && !gettingList) { + this.set_selectedValue('', ''); + } + + if(e.childDropDown && !gettingList) { + for(var i = 0; i < e.childDropDown.length; i++) { + e.childDropDown[i]._onParentChange(); + } + } + else { + if(list && (Sys.Browser.agent !== Sys.Browser.Safari) && (Sys.Browser.agent !== Sys.Browser.Opera)) { + // Fire the onchange event for the control to notify any listeners of the change + if(document.createEvent) { + var onchangeEvent = document.createEvent('HTMLEvents'); + onchangeEvent.initEvent('change', true, false); + this.get_element().dispatchEvent(onchangeEvent); + } else if(document.createEventObject) { + this.get_element().fireEvent('onchange'); + } + } + } + + // check whether to disable or not at loading. + if(!this._enableAtLoading) { + // Disable the control if loading/prompt text is present and an empty list was populated + if(this._loadingText || this._promptText || this._emptyText) { + e.disabled = !list || (0 == list.length); + } + if(this._actualDisabledStatus) + e.disabled = this._actualDisabledStatus; + } + }, + + _onChange: function() { + if(!this._isPopulated()) { + return; + } + + var e = this.get_element(); + + // Record the selected value in the client state + if((-1 != e.selectedIndex) && !(this._promptText && (0 == e.selectedIndex))) { + this.set_selectedValue(e.options[e.selectedIndex].value, e.options[e.selectedIndex].text, e.options[e.selectedIndex].title); + } else { + this.set_selectedValue('', ''); + } + }, + + _onParentChange: function(evt, inInit) { + // Handler for the parent drop down's change event + // "evt" - set by the browser when called as an event handler (unused here) + // "inInit" - whether this is being called from the initialize method + + var e = this.get_element(); + + // Create the known category/value pairs string for sending to the helper web service + // Follow parent pointers so that the complete state can be sent + // Format: 'name1:value1;name2:value2;...' + var knownCategoryValues = ''; + var parentControlID = this._parentControlID; + while(parentControlID) { + var parentElement = $get(parentControlID); + if(parentElement && (-1 != parentElement.selectedIndex)) { + var selectedValue = parentElement.options[parentElement.selectedIndex].value; + + if(selectedValue && selectedValue != "") { + knownCategoryValues = parentElement.CascadingDropDownCategory + ':' + selectedValue + ';' + knownCategoryValues; + parentControlID = parentElement.CascadingDropDownParentControlID; + continue; + } + } + break; + } + + if(knownCategoryValues != '' && this._lastParentValues == knownCategoryValues) { + return; + } + + this._lastParentValues = knownCategoryValues; + + // we have a parent but it doesn't have a valid value + // + if(knownCategoryValues == '' && this._parentControlID) { + this._setOptions(null, inInit); + return; + } + + // Show the loading text (if any) + this._setOptions(null, inInit, true); + + if(this._servicePath && this._serviceMethod) { + // Raise the populating event and optionally cancel the web service invocation + var eventArgs = new Sys.CancelEventArgs(); + this.raise_populating(eventArgs); + if(eventArgs.get_cancel()) { + return; + } + + // Create the service parameters and optionally add the context parameter + // (thereby determining which method signature we're expecting...) + var params = { knownCategoryValues: knownCategoryValues, category: this._category }; + if(this._useContextKey) { + params.contextKey = this._contextKey; + } + + // Call the helper web service + Sys.Net.WebServiceProxy.invoke(this._servicePath, this._serviceMethod, this._useHttpGet, params, + Function.createDelegate(this, this._onMethodComplete), Function.createDelegate(this, this._onMethodError)); + $common.updateFormToRefreshATDeviceBuffer(); + } + }, + + _onMethodComplete: function(result, userContext, methodName) { + // Success, update the DropDownList + this._setOptions(result); + this.raise_populated(Sys.EventArgs.Empty); + }, + + _onMethodError: function(webServiceError, userContext, methodName) { + // Indicate failure + if(webServiceError.get_timedOut()) { + this._setOptions([this._makeNameValueObject(Sys.Extended.UI.Resources.CascadingDropDown_MethodTimeout)]); + } else { + this._setOptions([this._makeNameValueObject(String.format(Sys.Extended.UI.Resources.CascadingDropDown_MethodError, webServiceError.get_statusCode()))]); + } + }, + + _makeNameValueObject: function(message) { + // Create an object with name and value properties set to the provided message + // "message" - message + // "Object" - object with name and value properties set to the message + + return { 'name': message, 'value': message }; + }, + + get_parentControlID: function() { + return this._parentControlID; + }, + set_parentControlID: function(value) { + if(this._parentControlID != value) { + this._parentControlID = value; + this.raisePropertyChanged('parentControlID'); + } + }, + + get_ParentControlID: function() { + Sys.Extended.Deprecated("get_ParentControlID", "get_parentControlID"); + return this.get_parentControlID(); + }, + set_ParentControlID: function(value) { + Sys.Extended.Deprecated("set_ParentControlID", "set_parentControlID"); + this.set_parentControlID(value); + }, + + get_category: function() { + return this._category; + }, + set_category: function(value) { + if(this._category != value) { + this._category = value; + this.raisePropertyChanged('category'); + } + }, + + get_Category: function() { + Sys.Extended.Deprecated("get_Category", "get_category"); + return this.get_category(); + }, + set_Category: function(value) { + Sys.Extended.Deprecated("set_Category", "set_category"); + this.set_category(value); + }, + + get_promptText: function() { + return this._promptText; + }, + set_promptText: function(value) { + if(this._promptText != value) { + this._promptText = value; + this.raisePropertyChanged('promptText'); + } + }, + + get_PromptText: function() { + Sys.Extended.Deprecated("get_PromptText", "get_promptText"); + return this.get_promptText(); + }, + set_PromptText: function(value) { + Sys.Extended.Deprecated("set_PromptText", "set_promptText"); + this.set_promptText(value); + }, + + get_promptValue: function() { + // Value for the option displayed by a DropDownList showing the PromptText + return this._promptValue; + }, + set_promptValue: function(value) { + if(this._promptValue != value) { + this._promptValue = value; + this.raisePropertyChanged('promptValue'); + } + }, + + get_PromptValue: function() { + Sys.Extended.Deprecated("get_PromptValue", "get_promptValue"); + return this.get_promptValue(); + }, + set_PromptValue: function(value) { + Sys.Extended.Deprecated("set_PromptValue", "set_promptValue"); + this.set_promptValue(value); + }, + + get_emptyText: function() { + return this._emptyText; + }, + set_emptyText: function(value) { + if(this._emptyText != value) { + this._emptyText = value; + this.raisePropertyChanged('emptyText'); + } + }, + + get_EmptyText: function() { + Sys.Extended.Deprecated("get_EmptyText", "get_emptyText"); + return this.get_emptyText(); + }, + set_EmptyText: function(value) { + Sys.Extended.Deprecated("set_EmptyText", "set_emptyText"); + this.set_emptyText(value); + }, + + get_emptyValue: function() { + // Value for the option displayed when the list is empty + return this._emptyValue; + }, + set_emptyValue: function(value) { + if(this._emptyValue != value) { + this._emptyValue = value; + this.raisePropertyChanged('emptyValue'); + } + }, + + get_EmptyValue: function() { + Sys.Extended.Deprecated("get_EmptyValue", "get_emptyValue"); + return this.get_emptyValue(); + }, + set_EmptyValue: function(value) { + Sys.Extended.Deprecated("set_EmptyValue", "set_emptyValue"); + this.set_emptyValue(value); + }, + + get_loadingText: function() { + return this._loadingText; + }, + set_loadingText: function(value) { + if(this._loadingText != value) { + this._loadingText = value; + this.raisePropertyChanged('loadingText'); + } + }, + + get_LoadingText: function() { + Sys.Extended.Deprecated("get_LoadingText", "get_loadingText"); + return this.get_loadingText(); + }, + set_LoadingText: function(value) { + Sys.Extended.Deprecated("set_LoadingText", "set_loadingText"); + this.set_loadingText(value); + }, + + + get_selectedValue: function() { + return this._selectedValue; + }, + set_selectedValue: function (value, text, title) { + if(this._selectedValue != value) { + if(!text) { + // Initial population by server; look for "value:::text" pair + var i = value.indexOf(':::'); + if(-1 != i) { + text = value.slice(i + 3); + value = value.slice(0, i); + + i = text.indexOf(':::'); + if(-1 != i) { + title = text.slice(i + 3); + text = text.slice(0, i); + } + } + } + var oldValue = this._selectedValue; + this._selectedValue = value; + this.raisePropertyChanged('selectedValue'); + this.raise_selectionChanged(new Sys.Extended.UI.CascadingDropDownSelectionChangedEventArgs(oldValue, value)); + } + Sys.Extended.UI.CascadingDropDownBehavior.callBaseMethod(this, 'set_ClientState', [this._selectedValue + ':::' + text + ':::' + (title ? (':::' + title) : '')]); + }, + + get_SelectedValue: function() { + Sys.Extended.Deprecated("get_SelectedValue", "get_selectedValue"); + return this.get_selectedValue(); + }, + set_SelectedValue: function(value, text, title) { + Sys.Extended.Deprecated("set_SelectedValue(value, text, title)", "set_selectedValue(value, text, title)"); + this.set_selectedValue(value, text, title); + }, + + get_servicePath: function() { + return this._servicePath; + }, + set_servicePath: function(value) { + if(this._servicePath != value) { + this._servicePath = value; + this.raisePropertyChanged('servicePath'); + } + }, + + get_ServicePath: function() { + Sys.Extended.Deprecated("get_ServicePath", "get_servicePath"); + return this.get_servicePath(); + }, + set_ServicePath: function(value) { + Sys.Extended.Deprecated("set_ServicePath", "set_servicePath"); + this.set_servicePath(value); + }, + + get_serviceMethod: function() { + return this._serviceMethod; + }, + set_serviceMethod: function(value) { + if(this._serviceMethod != value) { + this._serviceMethod = value; + this.raisePropertyChanged('serviceMethod'); + } + }, + + get_ServiceMethod: function() { + Sys.Extended.Deprecated("get_ServiceMethod", "get_serviceMethod"); + return this.get_serviceMethod(); + }, + set_ServiceMethod: function(value) { + Sys.Extended.Deprecated("set_ServiceMethod", "set_serviceMethod"); + this.set_serviceMethod(value); + }, + + get_contextKey: function() { + // User/page specific context provided to an optional overload of the + // web method described by ServiceMethod/ServicePath. If the context + // key is used, it should have the same signature with an additional + // parameter named contextKey of type string. + return this._contextKey; + }, + set_contextKey: function(value) { + if(this._contextKey != value) { + this._contextKey = value; + this.set_useContextKey(true); + this.raisePropertyChanged('contextKey'); + } + }, + + + get_useContextKey: function() { + // Whether or not the ContextKey property should be used. This will be + // automatically enabled if the ContextKey property is ever set + // (on either the client or the server). If the context key is used, + // it should have the same signature with an additional parameter + // named contextKey of type string. + return this._useContextKey; + }, + set_useContextKey: function(value) { + if(this._useContextKey != value) { + this._useContextKey = value; + this.raisePropertyChanged('useContextKey'); + } + }, + + get_useHttpGet: function() { + return this._useHttpGet; + }, + set_useHttpGet: function(value) { + if(this._useHttpGet != value) { + this._useHttpGet = value; + this.raisePropertyChanged('useHttpGet'); + } + }, + + get_enableAtLoading: function() { + return this._enableAtLoading; + }, + set_enableAtLoading: function(value) { + if(this._enableAtLoading != value) { + this._enableAtLoading = value; + this.raisePropertyChanged('enableAtLoading'); + } + }, + + /// + /// Fires when selection is changed. + /// + /// + /// + add_selectionChanged: function(handler) { + this.get_events().addHandler('selectionChanged', handler); + }, + remove_selectionChanged: function(handler) { + this.get_events().removeHandler('selectionChanged', handler); + }, + raise_selectionChanged: function(eventArgs) { + var handler = this.get_events().getHandler('selectionChanged'); + if(handler) { + handler(this, eventArgs); + } + }, + raiseSelectionChanged: function(eventArgs) { + Sys.Extended.Deprecated("raiseSelectionChanged(eventArgs)", "raise_selectionChanged(eventArgs)"); + this.raise_selectionChanged(eventArgs); + }, + + /// + /// Fires when the control is being populated. + /// + /// + /// + add_populating: function(handler) { + this.get_events().addHandler('populating', handler); + }, + remove_populating: function(handler) { + this.get_events().removeHandler('populating', handler); + }, + raise_populating: function(eventArgs) { + // The populating event can be used to provide custom data to + // CascadingDropDown instead of using a web service. Just cancel the + // event (using the CancelEventArgs) and pass your own data to the + // _setOptions method. + var handler = this.get_events().getHandler('populating'); + if(handler) { + handler(this, eventArgs); + } + }, + raisePopulating: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulating(eventArgs)", "raise_populating(eventArgs)"); + this.raise_populating(eventArgs); + }, + + /// + /// Fires after the control is populated. + /// + /// + /// + add_populated: function(handler) { + this.get_events().addHandler('populated', handler); + }, + remove_populated: function(handler) { + this.get_events().removeHandler('populated', handler); + }, + raise_populated: function(eventArgs) { + var handler = this.get_events().getHandler('populated'); + if(handler) { + handler(this, eventArgs); + } + }, + raisePopulated: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulated(eventArgs)", "raise_populated(eventArgs)"); + this.raise_populated(eventArgs); + } +} +Sys.Extended.UI.CascadingDropDownBehavior.registerClass('Sys.Extended.UI.CascadingDropDownBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js new file mode 100644 index 000000000..dc31f1871 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js @@ -0,0 +1,1214 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.CollapsiblePanelExpandDirection = function() { + // The CollapsiblePanelExpandDirection enumeration describes whether the panel is opened vertically or horizontally + throw Error.invalidOperation(); +} +Sys.Extended.UI.CollapsiblePanelExpandDirection.prototype = { + Horizontal : 0, + Vertical: 1 +} +Sys.Extended.UI.CollapsiblePanelExpandDirection.registerEnum("Sys.Extended.UI.CollapsiblePanelExpandDirection", false); + + +Sys.Extended.UI.CollapsiblePanelBehavior = function(element) { + // The CollapsiblePanelBehavior allows you to add collapsible sections to your page + // "element" - element to associate the behavior with + Sys.Extended.UI.CollapsiblePanelBehavior.initializeBase(this, [element]); + + // property values + this._collapsedSize = 0; + this._expandedSize = 0; + this._scrollContents = null; + this._collapsed = false; + this._expandControlID = null; + this._collapseControlID = null; + this._textLabelID = null; + this._collapsedText = null; + this._expandedText = null; + this._imageControlID = null; + this._expandedImage = null; + this._collapsedImage = null; + this._suppressPostBack = null; + this._autoExpand = null; + this._autoCollapse = null; + this._expandDirection = Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical; + + // handler delegates + this._collapseClickHandler = null; + this._expandClickHandler = null; + this._panelMouseEnterHandler = null; + this._panelMouseLeaveHandler = null; + + // the div we wrap around the panel contents + this._childDiv = null; + + // Animation used to open/close the panel + this._animation = null; +} + +Sys.Extended.UI.CollapsiblePanelBehavior.prototype = { + initialize : function() { + Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(this, 'initialize'); + + var element = this.get_element(); + this._animation = new Sys.Extended.UI.Animation.LengthAnimation(element, .25, 10, 'style', null, 0, 0, 'px'); + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + this._animation.set_propertyKey('height'); + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + this._animation.set_propertyKey('width'); + } + this._animation.add_ended(Function.createDelegate(this, this._onAnimateComplete)); + + // for checkboxes, we don't want to suppress the posback (e.g. return false) + // because that stops them from toggling their state. + if (this._suppressPostBack == null) { + if (element.tagName == "INPUT" && element.type == "checkbox") { + this._suppressPostBack = false; + this.raisePropertyChanged('SuppressPostBack'); + } + else if (element.tagName == "A") { + this._suppressPostBack = true; + this.raisePropertyChanged('SuppressPostBack'); + } + } + + // Check our client state. If it's present, + // that means this is a postback, so we restore the state. + var lastState = Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(this, 'get_ClientState'); + if (lastState && lastState != "") { + var wasCollapsed = Boolean.parse(lastState); + if (this._collapsed != wasCollapsed) { + this._collapsed = wasCollapsed; + this.raisePropertyChanged('Collapsed'); + } + } + + this._setupChildDiv(); + + // setup the initial size and state + if (this._collapsed) { + this._setTargetSize(this._getCollapsedSize()); + } else { + this._setTargetSize(this._getExpandedSize()); + } + + this._setupState(this._collapsed); + + // setup all of our handlers. + if (this._collapseControlID == this._expandControlID) { + this._collapseClickHandler = Function.createDelegate(this, this.togglePanel); + this._expandClickHandler = null; // we don't need both if we're toggling. + } else { + this._collapseClickHandler = Function.createDelegate(this, this.collapsePanel); + this._expandClickHandler = Function.createDelegate(this, this.expandPanel); + } + + if (this._autoExpand) { + this._panelMouseEnterHandler = Function.createDelegate(this, this._onMouseEnter); + $addHandler(element, 'mouseover', this._panelMouseEnterHandler); + } + if (this._autoCollapse) { + this._panelMouseLeaveHandler = Function.createDelegate(this, this._onMouseLeave); + $addHandler(element, 'mouseout', this._panelMouseLeaveHandler); + } + + // attach the click handlers + if (this._collapseControlID) { + var collapseElement = $get(this._collapseControlID); + if (!collapseElement) { + throw Error.argument('CollapseControlID', String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID, this._collapseControlID)); + } else { + $addHandler(collapseElement, 'click', this._collapseClickHandler); + } + } + + if (this._expandControlID) { + if (this._expandClickHandler) { // if it's a toggle don't set up again + var expandElement = $get(this._expandControlID); + if (!expandElement) { + throw Error.argument('ExpandControlID', String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID, this._expandControlID)); + } else { + $addHandler(expandElement, 'click', this._expandClickHandler); + } + } + } + }, + + dispose : function() { + var element = this.get_element(); + + if (this._collapseClickHandler) { + var collapseElement = (this._collapseControlID ? $get(this._collapseControlID) : null); + if (collapseElement) { + $removeHandler(collapseElement, 'click', this._collapseClickHandler); + } + this._collapseClickHandler = null; + } + + if (this._expandClickHandler) { + var expandElement = (this._expandControlID ? $get(this._expandControlID) : null); + if (expandElement) { + $removeHandler(expandElement, 'click', this._expandClickHandler); + } + this._expandClickHandler = null; + } + + if (this._panelMouseEnterHandler) { + $removeHandler(element, 'mouseover', this._panelMouseEnterHandler); + } + + if (this._panelMouseLeaveHandler) { + $removeHandler(element, 'mouseout', this._panelMouseLeaveHandler); + } + + if (this._animation) { + this._animation.dispose(); + this._animation = null; + } + + Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Event handler to epxand or collapse the panel (based on its current state) + /// This is the public function that should be called instead of _toggle if + /// you wish to programmatically open and close the collapsible panel + /// + /// Event info + /// + togglePanel : function(eventObj) { + this._toggle(eventObj); + }, + + /// + /// Open the panel. Public function that users should call if they + /// wish to operate the collapsible panel programmatically + /// + /// Event info + /// + expandPanel : function(eventObj) { + this._doOpen(eventObj); + }, + + /// + /// Collapse the panel. Public function that users should call if they + /// wish to operate the collapsible panel programmatically + /// + /// Event info + /// + collapsePanel : function(eventObj) { + this._doClose(eventObj); + }, + + _checkCollapseHide : function() { + // Check if a control is collapsed and hidden + // (and set its display to none if it is supposed to be hidden) + // returns whether the control is collapsed and hidden + if (this._collapsed && this._getTargetSize() == 0) { + var e = this.get_element(); + var display = $common.getCurrentStyle(e, 'display'); + if (!e.oldDisplay && display != "none") { + e.oldDisplay = display; + e.style.display = "none"; + } + return true; + } + return false; + }, + + _doClose : function(eventObj) { + // Collapse the panel. Internal function, to close call "collapsePanel". + // "eventObj" - event Info + var eventArgs = new Sys.CancelEventArgs(); + this.raise_collapsing(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + if (this._animation) { + this._animation.stop(); + + // setup the animation state + this._animation.set_startValue(this._getTargetSize()); + this._animation.set_endValue(this._getCollapsedSize()); + + this._animation.play(); + } + + this._setupState(true); + + // stop postback if necessary. + if (this._suppressPostBack) { + if (eventObj && eventObj.preventDefault) { + eventObj.preventDefault(); + } else { + if (eventObj) { + eventObj.returnValue = false; + } + return false; + } + } + }, + + _doOpen : function(eventObj) { + // Expand the Panel. Internal function, to close call "expandPanel". + // "eventObj" - event Info + var eventArgs = new Sys.CancelEventArgs(); + this.raise_expanding(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + // stop any existing animation + if (this._animation) { + this._animation.stop(); + var e = this.get_element(); + + if (this._checkCollapseHide() && $common.getCurrentStyle(e, 'display', e.style.display)) { + if (e.oldDisplay) { + e.style.display = e.oldDisplay; + } else { + // IE isn't compliant on this one + if (e.style.removeAttribute) { + e.style.removeAttribute("display"); + } else { + e.style.removeProperty("display"); + } + } + e.oldDisplay = null; + } + + // setup the animation state + this._animation.set_startValue(this._getTargetSize()); + this._animation.set_endValue(this._getExpandedSize()); + + this._animation.play(); + } + + // relect our state changes + this._setupState(false); + + // stop the postback if necessary. + if (this._suppressPostBack) { + if (eventObj && eventObj.preventDefault) { + eventObj.preventDefault(); + } else { + if (eventObj) { + eventObj.returnValue = false; + } + return false; + } + } + }, + + _onAnimateComplete : function() { + // Handler to listen for the end of the expand/collapse animation + var e = this.get_element(); + + // if we're fully expanded and the inner pannel is still smaller + // than the size we've expanded to, fall back to auto + if (!this._collapsed && !this._expandedSize) + { + if(this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + if(this._childDiv.offsetHeight <= e.offsetHeight) { + e.style.height = "auto"; + this.raisePropertyChanged('TargetHeight'); + } + else { + this._checkCollapseHide(); + } + } + else // horizontal + { + if( this._childDiv.offsetWidth <= e.offsetWidth) { + e.style.width = "auto"; + this.raisePropertyChanged('TargetWidth'); + } + else { + this._checkCollapseHide(); + } + } + } + else { + this._checkCollapseHide(); + } + + if (this._collapsed) { + this.raise_collapseComplete(); + this.raise_collapsed(Sys.EventArgs.Empty); + } else { + this.raise_expandComplete() + this.raise_expanded(new Sys.EventArgs()); + } + }, + + _onMouseEnter : function(eventObj) { + if (this._autoExpand) { + this.expandPanel(eventObj); + } + }, + + _onMouseLeave : function(eventObj) { + if (this._autoCollapse) { + this.collapsePanel(eventObj); + } + }, + + _getExpandedSize : function() { + // Get the size of the panel when fully expanded + if (this._expandedSize) { + return this._expandedSize; + } + + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + return this._childDiv.offsetHeight; + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + return this._childDiv.offsetWidth; + } + }, + + _getCollapsedSize : function() { + // Get the size of the panel when fully collapsed + if (this._collapsedSize) { + return this._collapsedSize; + } + + return 0; + }, + + _getTargetSize : function() { + // Get the target size of the Panel + var value; + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + value = this.get_targetHeight(); + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + value = this.get_targetWidth(); + } + + // Safari returns undefined if display is 'none' + if (value === undefined) { + value = 0; + } + return value; + }, + + _setTargetSize : function(value) { + // Set the target size of the panel + + // we don't always want to set the target size here. + // if we don't have an expanded size, and we're not collapsed, + // and we're at (or past) our "maximum" size + var useSize = this._collapsed || this._expandedSize; + var e = this.get_element(); + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + if (useSize || value < e.offsetHeight) { + this.set_targetHeight(value); + } else { + // if we're at our maximum size, flip to auto + // so that nested collapsible panels will + // work properly. + e.style.height = "auto"; + this.raisePropertyChanged('TargetHeight'); + } + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + if (useSize || value < e.offsetWidth) { + this.set_targetWidth(value); + } + else { + e.style.width = "auto"; + this.raisePropertyChanged('TargetWidth'); + } + } + this._checkCollapseHide(); + }, + + _setupChildDiv : function() { + // Set up a child div to host our panel contents + // and then push the panel's children into it. + + var startSize = this._getTargetSize(); + + var e = this.get_element(); + + this._childDiv = e.cloneNode(false); + e.id = ''; + + // Make the child div visible (in case the panel was made invisible, + // to avoid the flickering issue that appears in IE6). + this._childDiv.style.visibility = 'visible'; + this._childDiv.style.display = ''; + + // move all children into the div. + while (e.hasChildNodes()) { + var child = e.childNodes[0]; + child = e.removeChild(child); + this._childDiv.appendChild(child); + } + + //On Parent + e.setAttribute('style', ''); + e.className = ''; + e.style.border = '0px'; + e.style.margin = '0px'; + e.style.padding = '0px'; + + // Setup scrolling on the child div and parent by only altering the scrolling + // for the expand direction letting the other fall into place naturally. + if (this._scrollContents) { + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + e.style.overflowY = "scroll"; + this._childDiv.style.overflowY = ""; + } else { + e.style.overflowX = "scroll"; + this._childDiv.style.overflowX = ""; + } + // safari and opera do not recognize overflowX and overflowY + if (Sys.Browser.agent == Sys.Browser.Safari || Sys.Browser.agent == Sys.Browser.Opera) { + e.style.overflow = "scroll"; + this._childDiv.style.overflow = ""; + } + + } + else { + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + e.style.overflowY = "hidden"; + this._childDiv.style.overflowY = ""; + } else { + e.style.overflowX = "hidden"; + this._childDiv.style.overflowX = ""; + } + // safari and opera do not recognize overflowX and overflowY + if (Sys.Browser.Agent == Sys.Browser.Safari || Sys.Browser.Agent == Sys.Browser.Opera) { + e.style.overflow = "hidden"; + this._childDiv.style.overflow = ""; + } + } + + //Delete some style after cloneNode + //On Clone + this._childDiv.style.position = ""; + + // we optimize for the case where the original size is the collapsed size. + // if that's the case, we go ahead and set the inner panel to auto so you + // can still expand it but not see it expanded by default when the page loads. + if (startSize == this._collapsedSize) { + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + this._childDiv.style.height = "auto"; + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + this._childDiv.style.width = "auto"; + } + } + + e.appendChild(this._childDiv); + + // Make the panel visible (in case the panel was made invisible, + // to avoid the flickering issue that appears in IE6). + e.style.visibility = 'visible'; + e.style.display = ''; + + if (this._collapsed) { + startSize = this._getCollapsedSize(); + } + else { + startSize = this._getExpandedSize(); + } + + // set up our initial size + if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical) { + e.style.height = startSize + "px"; + + if (!this._expandedSize) { + e.style.height = "auto"; + } + else { + e.style.height = this._expandedSize + "px"; + } + this._childDiv.style.height = "auto"; + + } else if (this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal) { + e.style.width = startSize + "px"; + + if (!this._expandedSize) { + e.style.width = "auto"; + } + else { + e.style.width = this._expandedSize + "px"; + } + this._childDiv.style.width = "auto"; + } + }, + + _setupState : function(isCollapsed) { + // Get all the state set consistently when we change modes + // "isCollapsed" - true to setup the state as if we're collapsed, false to setup the state as if we're expanded + + if (isCollapsed) { + + // change the text label ID if we have one. + if (this._textLabelID && this._collapsedText) { + var e = $get(this._textLabelID); + + if (e) { + e.innerHTML = this._collapsedText; + } + } + + // Change the image if we have one + if (this._imageControlID && this._collapsedImage) { + var i = $get(this._imageControlID); + if (i && i.src) { + i.src = this._collapsedImage; + if (this._expandedText || this._collapsedText) { + i.title = this._collapsedText; + } + } + } + } + else { + if (this._textLabelID && this._expandedText) { + var e = $get(this._textLabelID); + + if (e) { + e.innerHTML = this._expandedText; + } + } + + // Change the image if we have one + if (this._imageControlID && this._expandedImage) { + var i = $get(this._imageControlID); + if (i && i.src) { + i.src = this._expandedImage; + if (this._expandedText || this._collapsedText) { + i.title = this._expandedText; + } + } + } + } + + // set our member variable and set the client state to reflect it + if (this._collapsed != isCollapsed) { + this._collapsed = isCollapsed; + this.raisePropertyChanged('Collapsed'); + } + Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(this, 'set_ClientState', [this._collapsed.toString()]); + }, + + _toggle : function(eventObj) { + // Event handler to epxand or collapse the panel (based on its current state) + // Internal function. Please use "togglePanel(eventObj)" to get same functionality. + if(this.get_collapsed()) { + return this.expandPanel(eventObj); + } else { + return this.collapsePanel(eventObj); + } + }, + + /// + /// Fires when control is collapsing + /// + /// + /// + add_collapsing: function(handler) { + // Add an event handler for the collapsing event + this.get_events().addHandler('collapsing', handler); + }, + remove_collapsing: function(handler) { + // Remove an event handler from the collapsing event + this.get_events().removeHandler('collapsing', handler); + }, + raise_collapsing: function(eventArgs) { + // Raise the collapsing event + var handler = this.get_events().getHandler('collapsing'); + + if(handler) + handler(this, eventArgs); + }, + raiseCollapsing: function(eventArgs) { + Sys.Extended.Deprecated("raiseCollapsing", "raise_collapsing"); + this.raise_collapsing(eventArgs); + }, + + /// + /// Fires when control is collapsed + /// + /// + /// + add_collapsed: function(handler) { + // Add an event handler for the collapsed event + this.get_events().addHandler('collapsed', handler); + }, + remove_collapsed: function(handler) { + // Remove an event handler from the collapsed event + this.get_events().removeHandler('collapsed', handler); + }, + raise_collapsed: function(eventArgs) { + // Raise the collapsed event + var handler = this.get_events().getHandler('collapsed'); + + if(handler) + handler(this, eventArgs); + }, + raiseCollapsed: function(eventArgs) { + Sys.Extended.Deprecated("raiseCollapsed", "raise_collapsed"); + this.raise_collapsed(eventArgs); + }, + + /// + /// Fires when collapse completes + /// + /// + /// + add_collapseComplete: function(handler) { + // Add a handler to the collapseComplete event + // Obsolete: Use the collapsed event instead + this.get_events().addHandler('collapseComplete', handler); + }, + remove_collapseComplete: function(handler) { + // Remove a handler from the collapseComplete event + // Obsolete: Use the collapsed event instead + this.get_events().removeHandler('collapseComplete', handler); + }, + raise_collapseComplete: function() { + // Obsolete: Use the collapsed event instead + var handlers = this.get_events().getHandler('collapseComplete'); + + if(handlers) + handlers(this, Sys.EventArgs.Empty); + }, + raiseCollapseComplete: function() { + Sys.Extended.Deprecated("raiseCollapseComplete", "raise_collapseComplete"); + this.raise_collapseComplete(); + }, + + /// + /// Fires when control is expanding + /// + /// + /// + add_expanding: function(handler) { + // Add an event handler for the expanding event + this.get_events().addHandler('expanding', handler); + }, + remove_expanding: function(handler) { + // Remove an event handler from the expanding event + this.get_events().removeHandler('expanding', handler); + }, + raise_expanding: function(eventArgs) { + // Raise the expanding event + var handler = this.get_events().getHandler('expanding'); + + if(handler) + handler(this, eventArgs); + }, + raiseExpanding : function(eventArgs) { + Sys.Extended.Deprecated("raiseExpanding", "raise_expanding"); + this.raise_expanding(eventArgs); + }, + + /// + /// Fires when control is expanded + /// + /// + /// + add_expanded: function(handler) { + // Add an event handler for the expanded event + this.get_events().addHandler('expanded', handler); + }, + remove_expanded: function(handler) { + // Remove an event handler from the expanded event + this.get_events().removeHandler('expanded', handler); + }, + raise_expanded: function(eventArgs) { + // Raise the expanded event + var handler = this.get_events().getHandler('expanded'); + + if(handler) + handler(this, eventArgs); + }, + raiseExpanded: function(eventArgs) { + Sys.Extended.Deprecated("raiseExpanded", "raise_expanded"); + this.raise_expanded(eventArgs); + }, + + /// + /// Fires when expand completes + /// + /// + /// + add_expandComplete: function(handler) { + // Add a handler to the expandComplete event + // Obsolete: Use the expanded event instead + this.get_events().addHandler('expandComplete', handler); + }, + remove_expandComplete: function(handler) { + // Remove a handler from the expandComplete event + // Obsolete: Use the expanded event instead + this.get_events().removeHandler('expandComplete', handler); + }, + raise_expandComplete: function() { + // Obsolete: Use the expanded event instead + var handlers = this.get_events().getHandler('expandComplete'); + if(handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseExpandComplete: function() { + Sys.Extended.Deprecated("raiseExpandComplete", "raise_expandComplete"); + this.raise_expandComplete(); + }, + + /// + /// Wrap the height of the panel + /// + /// get_targetHeight + /// set_targetHeight + /// + get_targetHeight: function() { + return this.get_element().offsetHeight; + }, + set_targetHeight: function(value) { + this.get_element().style.height = value + "px"; + this.raisePropertyChanged('targetHeight'); + }, + + get_TargetHeight: function() { + Sys.Extended.Deprecated("get_TargetHeight", "get_targetHeight"); + return this.get_targetHeight(); + }, + set_TargetHeight: function(value) { + Sys.Extended.Deprecated("set_TargetHeight", "set_targetHeight"); + this.set_targetHeight(value); + }, + + /// + /// Wrap the width of the panel + /// + /// get_targetWidth + /// set_targetWidth + /// + get_targetWidth: function() { + return this.get_element().offsetWidth; + }, + set_targetWidth: function(value) { + this.get_element().style.width = value + "px"; + this.raisePropertyChanged('targetWidth'); + }, + + get_TargetWidth: function() { + Sys.Extended.Deprecated("get_TargetWidth", "get_targetWidth"); + return this.get_targetWidth(); + }, + set_TargetWidth: function(value) { + Sys.Extended.Deprecated("set_TargetWidth", "set_targetWidth"); + this.set_targetWidth(value); + }, + + /// + /// Whether or not the panel is collapsed + /// + /// get_collapsed + /// set_collapsed + /// + get_collapsed: function() { + return this._collapsed; + }, + set_collapsed: function(value) { + // if we're changing values, and we're live, togglePanel. + if(this.get_isInitialized() && this.get_element() && value != this.get_collapsed()) { + this.togglePanel(); + } else { + this._collapsed = value; + this.raisePropertyChanged('collapsed'); + } + }, + + get_Collapsed: function() { + Sys.Extended.Deprecated("get_Collapsed", "get_collapsed"); + return this.get_collapsed(); + }, + set_Collapsed: function(value) { + Sys.Extended.Deprecated("set_Collapsed", "set_collapsed"); + this.set_collapsed(value); + }, + + /// + /// The size of the target, in pixels, when it is in the collapsed state + /// + /// get_collapsedSize + /// set_collapsedSize + /// + get_collapsedSize: function() { + return this._collapsedSize; + }, + set_collapsedSize: function(value) { + if(this._collapsedSize != value) { + this._collapsedSize = value; + this.raisePropertyChanged('collapsedSize'); + } + }, + + get_CollapsedSize: function() { + Sys.Extended.Deprecated("get_CollapsedSize", "get_collapsedSize"); + return this.get_collapsedSize(); + }, + set_CollapsedSize: function(value) { + Sys.Extended.Deprecated("set_CollapsedSize", "set_collapsedSize"); + this.set_collapsedSize(value); + }, + + /// + /// The size of the target, in pixels, when it is in the expanded state + /// + /// get_expandedSize + /// set_expandedSize + /// + get_expandedSize: function() { + return this._expandedSize; + }, + set_expandedSize: function(value) { + if(this._expandedSize != value) { + this._expandedSize = value; + this.raisePropertyChanged('expandedSize'); + } + }, + + get_ExpandedSize: function() { + Sys.Extended.Deprecated("get_ExpandedSize", "get_expandedSize"); + return this.get_expandedSize(); + }, + set_ExpandedSize: function(value) { + Sys.Extended.Deprecated("set_ExpandedSize", "set_expandedSize"); + this.set_expandedSize(value); + }, + + /// + /// ID of the control used to collapse the target when clicked + /// + /// get_collapseControlID + /// set_collapseControlID + /// + get_collapseControlID: function() { + return this._collapseControlID; + }, + set_collapseControlID: function(value) { + if(this._collapseControlID != value) { + this._collapseControlID = value; + this.raisePropertyChanged('collapseControlID'); + } + }, + + get_CollapseControlID: function() { + Sys.Extended.Deprecated("get_CollapseControlID", "get_collapseControlID"); + return this.get_collapseControlID(); + }, + set_CollapseControlID: function(value) { + Sys.Extended.Deprecated("set_CollapseControlID", "set_collapseControlID"); + this.set_collapseControlID(value); + }, + + /// + /// ID of the control used to expand the target when clicked + /// + /// get_expandControlID + /// set_expandControlID + /// + get_expandControlID: function() { + return this._expandControlID; + }, + set_expandControlID: function(value) { + if (this._expandControlID != value) { + this._expandControlID = value; + this.raisePropertyChanged('expandControlID'); + } + }, + + get_ExpandControlID: function() { + Sys.Extended.Deprecated("get_ExpandControlID", "get_expandControlID"); + return this.get_expandControlID(); + }, + set_ExpandControlID: function(value) { + Sys.Extended.Deprecated("set_ExpandControlID", "set_expandControlID"); + this.set_expandControlID(value); + }, + + /// + /// Whether to add a scrollbar when the contents are larger than the target + /// (the contents will be clipped if false) + /// + /// get_scrollContents + /// set_scrollContents + /// + get_scrollContents: function() { + return this._scrollContents; + }, + set_scrollContents: function(value) { + if (this._scrollContents != value) { + this._scrollContents = value; + this.raisePropertyChanged('scrollContents'); + } + }, + + get_ScrollContents: function() { + Sys.Extended.Deprecated("get_ScrollContents", "get_scrollContents"); + return this.get_scrollContents(); + }, + set_ScrollContents: function(value) { + Sys.Extended.Deprecated("set_ScrollContents", "set_scrollContents"); + this.set_scrollContents(value); + }, + + /// + /// Whether or not to suppress postbacks generated when the CollapseControlID or + /// ExpandControlID elements are clicked + /// + /// get_suppressPostBack + /// set_suppressPostBack + /// + get_suppressPostBack: function() { + return this._suppressPostBack; + }, + set_suppressPostBack: function(value) { + if (this._suppressPostBack != value) { + this._suppressPostBack = value; + this.raisePropertyChanged('suppressPostBack'); + } + }, + + get_SuppressPostBack: function() { + Sys.Extended.Deprecated("get_SuppressPostBack", "get_suppressPostBack"); + return this.get_suppressPostBack(); + }, + set_SuppressPostBack: function(value) { + Sys.Extended.Deprecated("set_SuppressPostBack", "set_suppressPostBack"); + this.set_suppressPostBack(value); + }, + + /// + /// ID of the element where the "status text" for the target will be placed + /// + /// get_textLabelID + /// set_textLabelID + /// + get_textLabelID: function() { + return this._textLabelID; + }, + set_textLabelID: function(value) { + if (this._textLabelID != value) { + this._textLabelID = value; + this.raisePropertyChanged('textLabelID'); + } + }, + + get_TextLabelID: function() { + Sys.Extended.Deprecated("get_TextLabelID", "get_textLabelID"); + return this.get_textLabelID(); + }, + set_TextLabelID: function(value) { + Sys.Extended.Deprecated("set_TextLabelID", "set_textLabelID"); + this.set_textLabelID(value); + }, + + /// + /// Text to show in the element specified by TextLabelID when the target is expanded. + /// This text is also used as the alternate text of the image if ImageControlID has been provided + /// + /// get_expandedText + /// set_expandedText + /// + get_expandedText: function() { + return this._expandedText; + }, + set_expandedText: function(value) { + if (this._expandedText != value) { + this._expandedText = value; + this.raisePropertyChanged('expandedText'); + } + }, + + get_ExpandedText: function() { + Sys.Extended.Deprecated("get_ExpandedText", "get_expandedText"); + return this.get_expandedText(); + }, + set_ExpandedText: function(value) { + Sys.Extended.Deprecated("set_ExpandedText", "set_expandedText"); + this.set_expandedText(value); + }, + + /// + /// Text to show in the element specified by TextLabelID when the target is collapsed. + /// This text is also used as the alternate text of the image if ImageControlID has been provided + /// + /// get_collapsedText + /// set_collapsedText + /// + get_collapsedText: function() { + return this._collapsedText; + }, + set_collapsedText: function(value) { + if (this._collapsedText != value) { + this._collapsedText = value; + this.raisePropertyChanged('collapsedText'); + } + }, + + get_CollapsedText: function() { + Sys.Extended.Deprecated("get_CollapsedText", "get_collapsedText"); + return this.get_collapsedText(); + }, + set_CollapsedText: function(value) { + Sys.Extended.Deprecated("set_CollapsedText", "set_collapsedText"); + this.set_collapsedText(value); + }, + + /// + /// ID of the element where an icon indicating the collapsed status of the target will be placed + /// + /// get_imageControlID + /// set_imageControlID + /// + get_imageControlID: function() { + return this._imageControlID; + }, + set_imageControlID: function(value) { + if (this._imageControlID != value) { + this._imageControlID = value; + this.raisePropertyChanged('imageControlID'); + } + }, + + get_ImageControlID: function() { + Sys.Extended.Deprecated("get_ImageControlID", "get_imageControlID"); + return this.get_imageControlID(); + }, + set_ImageControlID: function(value) { + Sys.Extended.Deprecated("set_ImageControlID", "set_imageControlID"); + this.set_imageControlID(); + }, + + /// + /// Path to an image to show in the element specified by ImageControlID when the target is expanded + /// + /// get_expandedImage + /// set_expandedImage + /// + get_expandedImage: function() { + return this._expandedImage; + }, + set_expandedImage: function(value) { + if (this._expandedImage != value) { + this._expandedImage = value; + this.raisePropertyChanged('expandedImage'); + } + }, + + get_ExpandedImage: function() { + Sys.Extended.Deprecated("get_ExpandedImage", "get_expandedImage"); + return this.get_expandedImage(); + }, + set_ExpandedImage: function(value) { + Sys.Extended.Deprecated("set_ExpandedImage", "set_expandedImage"); + this.set_expandedImage(value); + }, + + /// + /// Path to an image to show in the element specified by ImageControlID when the target is collapsed + /// + /// get_collapsedImage + /// set_collapsedImage + /// + get_collapsedImage: function() { + return this._collapsedImage; + }, + set_collapsedImage: function(value) { + if (this._collapsedImage != value) { + this._collapsedImage = value; + this.raisePropertyChanged('collapsedImage'); + } + }, + + get_CollapsedImage : function() { + Sys.Extended.Deprecated("get_CollapsedImage", "get_collapsedImage"); + return this.get_collapsedImage(); + }, + set_CollapsedImage : function(value) { + Sys.Extended.Deprecated("set_CollapsedImage", "set_collapsedImage"); + this.set_collapsedImage(); + }, + + /// + /// Whether to automatically expand the target when the mouse is moved over it + /// + /// get_autoExpand + /// set_autoExpand + /// + get_autoExpand: function() { + return this._autoExpand; + }, + set_autoExpand: function(value) { + if (this._autoExpand != value) { + this._autoExpand = value; + this.raisePropertyChanged('autoExpand'); + } + }, + + get_AutoExpand: function() { + Sys.Extended.Deprecated("get_AutoExpand", "get_autoExpand"); + return this.get_autoExpand(); + }, + set_AutoExpand: function(value) { + Sys.Extended.Deprecated("set_AutoExpand", "set_autoExpand"); + this.set_autoExpand(value); + }, + + /// + /// Whether to automatically collapse the target when the mouse is moved off of it + /// + /// get_autoCollapse + /// set_autoCollapse + /// + get_autoCollapse: function() { + return this._autoCollapse; + }, + set_autoCollapse: function(value) { + if (this._autoCollapse != value) { + this._autoCollapse = value; + this.raisePropertyChanged('autoCollapse'); + } + }, + + get_AutoCollapse: function() { + Sys.Extended.Deprecated("get_AutoCollapse", "get_autoCollapse"); + return this.get_autoCollapse(); + }, + set_AutoCollapse: function(value) { + Sys.Extended.Deprecated("set_AutoCollapse", "set_autoCollapse"); + this.set_autoCollapse(value); + }, + + /// + /// Direction the panel will expand and collapse (can be either "Vertical" or "Horizontal") + /// + /// get_expandDirection + /// set_expandDirection + /// + get_expandDirection: function() { + return this._expandDirection == Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical; + }, + set_expandDirection: function(value) { + if (this._expandDirection != value) { + this._expandDirection = value; + this.raisePropertyChanged('expandDirection'); + } + }, + + get_ExpandDirection: function() { + Sys.Extended.Deprecated("get_ExpandDirection", "get_expandDirection"); + return this.get_expandDirection(); + }, + set_ExpandDirection: function(value) { + Sys.Extended.Deprecated("set_ExpandDirection", "set_expandDirection"); + this.set_expandDirection(value); + } +} +Sys.Extended.UI.CollapsiblePanelBehavior.registerClass('Sys.Extended.UI.CollapsiblePanelBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js new file mode 100644 index 000000000..988191261 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js @@ -0,0 +1,617 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ColorPickerBehavior = function(element) { + // A behavior that attaches a color picker to a textbox + Sys.Extended.UI.ColorPickerBehavior.initializeBase(this, [element]); + + this._textbox = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(element); + this._button = null; + this._sample = null; + this._cssClass = "ajax__colorPicker"; + this._popupPosition = Sys.Extended.UI.PositioningMode.BottomLeft; + this._selectedColor = null; + + this._enabled = true; + this._selectedColorChanging = false; + this._popupMouseDown = false; + this._isOpen = false; + this._blur = new Sys.Extended.UI.DeferredOperation(1, this, this._doBlur); + + this._popupBehavior = null; + this._container = null; + this._popupDiv = null; + this._colorsTable = null; + this._colorsBody = null; + + this._button$delegates = { + click: Function.createDelegate(this, this._button_onclick), + keypress: Function.createDelegate(this, this._button_onkeypress), + blur: Function.createDelegate(this, this._button_onblur) + }; + this._element$delegates = { + change: Function.createDelegate(this, this._element_onchange), + keypress: Function.createDelegate(this, this._element_onkeypress), + click: Function.createDelegate(this, this._element_onclick), + focus: Function.createDelegate(this, this._element_onfocus), + blur: Function.createDelegate(this, this._element_onblur) + }; + this._popup$delegates = { + mousedown: Function.createDelegate(this, this._popup_onmousedown), + mouseup: Function.createDelegate(this, this._popup_onmouseup), + drag: Function.createDelegate(this, this._popup_onevent), + dragstart: Function.createDelegate(this, this._popup_onevent), + select: Function.createDelegate(this, this._popup_onevent) + }; + this._cell$delegates = { + mouseover: Function.createDelegate(this, this._cell_onmouseover), + mouseout: Function.createDelegate(this, this._cell_onmouseout), + click: Function.createDelegate(this, this._cell_onclick) + }; +} + +Sys.Extended.UI.ColorPickerBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.ColorPickerBehavior.callBaseMethod(this, 'initialize'); + + // Store the color validation Regex in a "static" object off of + // Sys.Extended.UI.ColorPickerBehavior. If this _colorRegex object hasn't been + // created yet, initialize it for the first time. + if (!Sys.Extended.UI.ColorPickerBehavior._colorRegex) { + Sys.Extended.UI.ColorPickerBehavior._colorRegex = new RegExp('^[A-Fa-f0-9]{6}$'); + } + + var elt = this.get_element(); + $addHandlers(elt, this._element$delegates); + + if (this._button) { + $addHandlers(this._button, this._button$delegates); + } + + var value = this.get_selectedColor(); + if (value) { + this.set_selectedColor(value); + } + this._restoreSample(); + }, + + dispose: function() { + this._sample = null; + if (this._button) { + $clearHandlers(this._button); + this._button = null; + } + + if (this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + if (this._container) { + if (this._container.parentNode) { + this._container.parentNode.removeChild(this._container); + } + this._container = null; + } + if (this._popupDiv) { + $clearHandlers(this._popupDiv); + this._popupDiv = null; + } + if (this._colorsBody) { + for (var i = 0; i < this._colorsBody.rows.length; i++) { + var row = this._colorsBody.rows[i]; + for (var j = 0; j < row.cells.length; j++) { + $clearHandlers(row.cells[j].firstChild); + } + } + this._colorsBody = null; + } + this._colorsTable = null; + + var elt = this.get_element(); + if (elt) { + $clearHandlers(elt); + } + + Sys.Extended.UI.ColorPickerBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// The Sys.UI.DomElement object that represents a button to use to show the color picker. + /// + /// + /// This property is optional. + /// + /// get_button + /// set_button + /// + get_button: function() { + // The button to use to show the color picker (optional) + return this._button; + }, + set_button: function(value) { + if (this._button !== value) { + if (this._button && this.get_isInitialized()) { + $common.removeHandlers(this._button, this._button$delegates); + } + this._button = value; + if (this._button && this.get_isInitialized()) { + $addHandlers(this._button, this._button$delegates); + } + this.raisePropertyChanged("button"); + } + }, + + /// + /// The Sys.UI.DomElement object that represents an element to use to preview the color that is currently selected or over which a user is holding the mouse pointer. + /// + /// + /// This property is optional. + /// + /// get_sample + /// set_sample + /// + get_sample: function() { + // The element is to sample the color currently being hovered or selected (optional) + return this._sample; + }, + set_sample: function(value) { + if (this._sample !== value) { + this._sample = value; + this.raisePropertyChanged("sample"); + } + }, + + /// + /// A string that contains a color value that is represented by the text box. + /// + /// get_selectedColor + /// set_selectedColor + /// + get_selectedColor: function() { + if (this._selectedColor === null) { + var value = this._textbox.get_Value(); + if (this._validate(value)) { + this._selectedColor = value; + } + } + return this._selectedColor; + }, + set_selectedColor: function(value) { + if (this._selectedColor !== value && this._validate(value)) { + this._selectedColor = value; + this._selectedColorChanging = true; + if (value !== this._textbox.get_Value()) { + this._textbox.set_Value(value); + } + this._showSample(value); + this._selectedColorChanging = false; + this.raisePropertyChanged("selectedColor"); + } + }, + + /// + /// A Boolean value that specifies whether or not ColorPicker behavior is available for the current element. + /// + /// get_enabled + /// set_enabled + /// + get_enabled: function() { + // Whether this behavior is available for the current element + return this._enabled; + }, + set_enabled: function(value) { + if (this._enabled !== value) { + this._enabled = value; + this.raisePropertyChanged("enabled"); + } + }, + + /// + /// The Sys.Extended.UI.PositionMode object that represents where the popup should be positioned relative to the target control. + /// The default is BottomLeft. + /// + /// get_popupPosition + /// set_popupPosition + /// + get_popupPosition: function() { + // Where the popup should be positioned relative to the target control. + return this._popupPosition; + }, + set_popupPosition: function(value) { + if (this._popupPosition !== value) { + this._popupPosition = value; + this.raisePropertyChanged('popupPosition'); + } + }, + + /// + /// Fires when color selection is changed. + /// + /// + /// + add_colorSelectionChanged: function(handler) { + this.get_events().addHandler("colorSelectionChanged", handler); + }, + remove_colorSelectionChanged: function(handler) { + this.get_events().removeHandler("colorSelectionChanged", handler); + }, + raise_colorSelectionChanged: function() { + var handlers = this.get_events().getHandler("colorSelectionChanged"); + if (handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseColorSelectionChanged: function() { + Sys.Extended.Deprecated("raiseColorSelectionChanged", "raise_colorSelectionChanged"); + this.raise_colorSelectionChanged(); + }, + + /// + /// Fires when the control is being shown. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler("showing", handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler("showing", handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if (handler) { + handler(this, eventArgs); + } + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing", "raise_showing"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires after the control is shown. + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler("shown", handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler("shown", handler); + }, + raise_shown: function() { + var handlers = this.get_events().getHandler("shown"); + if (handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseShown: function() { + Sys.Extended.Deprecated("raiseShown", "raise_shown"); + this.raise_shown(); + }, + + /// + /// Fires when the control is being hidden. + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler("hiding", handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler("hiding", handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if (handler) { + handler(this, eventArgs); + } + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding", "raise_hiding"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires after the control is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler("hidden", handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler("hidden", handler); + }, + raise_hidden: function() { + var handlers = this.get_events().getHandler("hidden"); + if (handlers) { + handlers(this, Sys.EventArgs.Empty); + } + }, + raiseHidden: function() { + Sys.Extended.Deprecated("raiseHidden", "raise_hidden"); + this.raise_hidden(); + }, + + /// + /// Shows the color picker. + /// + /// + show: function() { + this._ensureColorPicker(); + + if (!this._isOpen) { + + var eventArgs = new Sys.CancelEventArgs(); + this.raiseShowing(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + this._isOpen = true; + this._popupBehavior.show(); + this.raiseShown(); + } + }, + + /// + /// Hides the color picker. + /// + /// + hide: function() { + if (this._isOpen) { + var eventArgs = new Sys.CancelEventArgs(); + this.raiseHiding(eventArgs); + if (eventArgs.get_cancel()) { + return; + } + + if (this._container) { + this._popupBehavior.hide(); + } + this._isOpen = false; + this.raiseHidden(); + + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + _focus: function() { + if (this._button) { + this._button.focus(); + } else { + this.get_element().focus(); + } + }, + _doBlur: function(force) { + if (!force && Sys.Browser.agent === Sys.Browser.Opera) { + this._blur.post(true); + } else { + if (!this._popupMouseDown) { + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + _buildColorPicker: function() { + // Builds the color picker's layout + + var elt = this.get_element(); + var id = this.get_id(); + + this._container = $common.createElementFromTemplate({ + nodeName: "div", + properties: { id: id + "_container" }, + cssClasses: [this._cssClass] + }, elt.parentNode); + + this._popupDiv = $common.createElementFromTemplate({ + nodeName: "div", + events: this._popup$delegates, + properties: { + id: id + "_popupDiv" + }, + cssClasses: ["ajax__colorPicker_container"], + visible: false + }, this._container); + }, + _buildColors: function() { + // Builds a table of colors for the popup + + var id = this.get_id(); + + this._colorsTable = $common.createElementFromTemplate({ + nodeName: "table", + properties: { + id: id + "_colorsTable", + style: { margin: "auto" } + } + }, this._popupDiv); + + this._colorsBody = $common.createElementFromTemplate({ + nodeName: "tbody", + properties: { id: id + "_colorsBody" } + }, this._colorsTable); + + var rgb = ['00', '99', '33', '66', 'FF', 'CC'], color, cssColor; + var l = rgb.length; + + for (var r = 0; r < l; r++) { + var colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody); + for (var g = 0; g < l; g++) { + if (g === 3) { + colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody); + } + for (var b = 0; b < l; b++) { + color = rgb[r] + rgb[g] + rgb[b]; + cssColor = '#' + color; + var colorCell = $common.createElementFromTemplate({ nodeName: "td" }, colorsRow); + var colorDiv = $common.createElementFromTemplate({ + nodeName: "div", + properties: { + id: id + "_color_" + color, + color: color, + title: cssColor, + style: { backgroundColor: cssColor }, + innerHTML: " " + }, + events: this._cell$delegates + }, colorCell); + } + } + } + }, + _ensureColorPicker: function() { + + if (!this._container) { + + var elt = this.get_element(); + + this._buildColorPicker(); + this._buildColors(); + + this._popupBehavior = new $create(Sys.Extended.UI.PopupBehavior, { parentElement: elt }, {}, {}, this._popupDiv); + this._popupBehavior.set_positioningMode(this._popupPosition); + } + }, + _showSample: function(value) { + if (this._sample) { + var color = ""; + if (value) { + color = "#" + value; + } + this._sample.style.backgroundColor = color; + } + }, + _restoreSample: function() { + this._showSample(this._selectedColor); + }, + _validate: function(value) { + return value && Sys.Extended.UI.ColorPickerBehavior._colorRegex.test(value); + }, + + _element_onfocus: function(e) { + if (!this._enabled) { return; } + if (!this._button) { + this.show(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + _element_onblur: function(e) { + if (!this._enabled) { return; } + if (!this._button) { + this._doBlur(); + } + }, + _element_onchange: function(e) { + if (!this._selectedColorChanging) { + var value = this._textbox.get_Value(); + if (this._validate(value) || value === "") { + this._selectedColor = value; + this._restoreSample(); + } + } + }, + _element_onkeypress: function(e) { + if (!this._enabled) { return; } + if (!this._button && e.charCode === Sys.UI.Key.esc) { + e.stopPropagation(); + e.preventDefault(); + this.hide(); + } + }, + _element_onclick: function(e) { + if (!this._enabled) { return; } + if (!this._button) { + this.show(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } + }, + + _popup_onevent: function(e) { + e.stopPropagation(); + e.preventDefault(); + }, + _popup_onmousedown: function(e) { + // signal that the popup has received a mousedown event, this handles + // onblur issues on browsers like FF, OP, and SF + this._popupMouseDown = true; + }, + _popup_onmouseup: function(e) { + // signal that the popup has received a mouseup event, this handles + // onblur issues on browsers like FF, OP, and SF + if (Sys.Browser.agent === Sys.Browser.Opera && this._blur.get_isPending()) { + this._blur.cancel(); + } + this._popupMouseDown = false; + this._focus(); + }, + + _cell_onmouseover: function(e) { + e.stopPropagation(); + var target = e.target; + this._showSample(target.color); + }, + _cell_onmouseout: function(e) { + e.stopPropagation(); + this._restoreSample(); + }, + _cell_onclick: function(e) { + e.stopPropagation(); + e.preventDefault(); + + if (!this._enabled) { + return; + } + + var target = e.target; + + this.set_selectedColor(target.color); + this._blur.post(true); + this.raise_colorSelectionChanged(); + }, + + _button_onclick: function(e) { + e.preventDefault(); + e.stopPropagation(); + + if (!this._enabled) { + return; + } + + if (!this._isOpen) { + this.show(); + } else { + this.hide(); + } + this._focus(); + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + }, + _button_onblur: function(e) { + if (!this._enabled) { + return; + } + if (!this._popupMouseDown) { + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + }, + _button_onkeypress: function(e) { + if (!this._enabled) { + return; + } + if (e.charCode === Sys.UI.Key.esc) { + e.stopPropagation(); + e.preventDefault(); + this.hide(); + } + // make sure we clean up the flag due to issues with alert/alt-tab/etc + this._popupMouseDown = false; + } +} +Sys.Extended.UI.ColorPickerBehavior.registerClass('Sys.Extended.UI.ColorPickerBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js new file mode 100644 index 000000000..244f42e1d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js @@ -0,0 +1,1861 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ComboBoxAutoCompleteMode = function () { }; +Sys.Extended.UI.ComboBoxAutoCompleteMode.prototype = +{ + None: 0, + Append: 1, + Suggest: 2, + SuggestAppend: 3 +}; +Sys.Extended.UI.ComboBoxAutoCompleteMode.registerEnum( + 'Sys.Extended.UI.ComboBoxAutoCompleteMode', false); + +Sys.Extended.UI.ComboBoxStyle = function () { }; +Sys.Extended.UI.ComboBoxStyle.prototype = +{ + DropDownList: 0, + DropDown: 1, + Simple: 2 +}; +Sys.Extended.UI.ComboBoxStyle.registerEnum( + 'Sys.Extended.UI.ComboBoxStyle', false); + +Sys.Extended.UI.ComboBoxTextSelectionStrategy = function () { }; +Sys.Extended.UI.ComboBoxTextSelectionStrategy.prototype = +{ + Unknown: 0, + Microsoft: 1, + W3C: 2 +}; +Sys.Extended.UI.ComboBoxTextSelectionStrategy.registerEnum( + "Sys.Extended.UI.ComboBoxTextSelectionStrategy", false); + + +Sys.Extended.UI.ComboBox = function (element) { + + Sys.Extended.UI.ComboBox.initializeBase(this, [element]); + + this._comboTableControl = null; + this._textBoxControl = null; + this._optionListControl = null; + this._buttonControl = null; + this._hiddenFieldControl = null; + this._autoPostBack = false; + this._autoCompleteMode = null; + this._dropDownStyle = null; + this._caseSensitive = false; + this._originalSelectedIndex = null; + this._listItemHoverCssClass = null; + + this._popupBehavior = null; + this._supressFocusHide = true; + this._doingPostBack = false; + this._textSelectionStrategy = null; + this._highlightSuggestedItem = false; + this._highlightedIndex = null; + + this._optionListItems = null; + this._optionListItemHeight = null; + this._optionListHeight = null; + this._optionListWidth = null; + + this.clearDelegates(); + +}; +Sys.Extended.UI.ComboBox.prototype = { + + initialize: function () { + + Sys.Extended.UI.ComboBox.callBaseMethod(this, 'initialize'); + ComboBox_Elements[ComboBox_Elements.length] = this; + var hiddenParent = this._findHiddenParent(this.get_comboTableControl()); + var hiddenParentDisplay; + var hiddenParentVisibility; + if (hiddenParent != null) { + hiddenParentDisplay = hiddenParent.style.display; + hiddenParentVisibility = hiddenParent.style.visibility; + hiddenParent.style.visibility = "visible"; + hiddenParent.style.display = "block"; + } + this.createDelegates(); + this.initializeTextBox(); + this.initializeButton(); + this.initializeOptionList(); + this.addHandlers(); + if (hiddenParent != null) { + hiddenParent.style.visibility = hiddenParentVisibility; + hiddenParent.style.display = hiddenParentDisplay; + } + }, + dispose: function () { + + // dispose of popup extender + if (this._popupBehavior) { + this._popupBehavior.remove_showing(this._popupShowingHandler); + this._popupBehavior.remove_shown(this._popupShownHandler); + this._popupBehavior.remove_hiding(this._popupHidingHandler); + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + + this.clearHandlers(); + this.clearDelegates(); + + Sys.Extended.UI.ComboBox.callBaseMethod(this, 'dispose'); + + }, + + _findHiddenParent: function (element) { + var parent = element.parentElement; + if (parent == null || parent.style.visibility == "hidden" || parent.style.display == 'none') { + return parent; + } + + return this._findHiddenParent(parent); + }, + + createDelegates: function () { + + this._listMouseOverHandler = Function.createDelegate(this, this._onListMouseOver); + this._listMouseOutHandler = Function.createDelegate(this, this._onListMouseOut); + this._listMouseDownHandler = Function.createDelegate(this, this._onListMouseDown); + this._listClickHandler = Function.createDelegate(this, this._onListClick); + this._listDragHandler = Function.createDelegate(this, this._onListDrag); + this._listSelectStartHandler = Function.createDelegate(this, this._onListSelectStart); + this._listMouseWheelHandler = Function.createDelegate(this, this._onListMouseWheel); + this._textBoxClickHandler = Function.createDelegate(this, this._onTextBoxClick); + this._textBoxFocusHandler = Function.createDelegate(this, this._onTextBoxFocus); + this._textBoxBlurHandler = Function.createDelegate(this, this._onTextBoxBlur); + this._textBoxKeyPressHandler = Function.createDelegate(this, this._onTextBoxKeyPress); + this._textBoxKeyDownHandler = Function.createDelegate(this, this._onTextBoxKeyDown); + this._buttonClickHandler = Function.createDelegate(this, this._onButtonClick); + this._buttonBlurHandler = Function.createDelegate(this, this._onButtonBlur); + this._buttonKeyDownHandler = Function.createDelegate(this, this._onButtonKeyDown); + this._buttonKeyPressHandler = Function.createDelegate(this, this._onButtonKeyPress); + this._documentClickHandler = Function.createDelegate(this, this._onDocumentClick); + this._documentMouseWheelHandler = Function.createDelegate(this, this._onDocumentMouseWheel); + this._popupShowingHandler = Function.createDelegate(this, this._popupShowing); + this._popupShownHandler = Function.createDelegate(this, this._popupShown); + this._popupHidingHandler = Function.createDelegate(this, this._popupHiding); + + }, + clearDelegates: function () { + + this._listMouseOverHandler = null; + this._listMouseOutHandler = null; + this._listMouseDownHandler = null; + this._listClickHandler = null; + this._listDragHandler = null; + this._listSelectStartHandler = null; + this._listMouseWheelHandler = null; + this._textBoxClickHandler = null; + this._textBoxFocusHandler = null; + this._textBoxBlurHandler = null; + this._textBoxKeyPressHandler = null; + this._textBoxKeyDownHandler = null; + this._buttonClickHandler = null; + this._buttonBlurHandler = null; + this._buttonKeyDownHandler = null; + this._buttonKeyPressHandler = null; + this._documentClickHandler = null; + this._documentMouseWheelHandler = null; + this._popupShowingHandler = null; + this._popupShownHandler = null; + this._popupHidingHandler = null; + + }, + addHandlers: function () { + + var optionListControl = this.get_optionListControl(); + + $addHandlers(optionListControl, + { + 'mouseover': this._listMouseOverHandler, + 'mouseout': this._listMouseOutHandler, + 'mousedown': this._listMouseDownHandler, + 'click': this._listClickHandler, + 'drag': this._listDragHandler, + 'selectstart': this._listSelectStartHandler + }, this); + + $addHandlers(this.get_textBoxControl(), + { + "click": this._textBoxClickHandler, + "focus": this._textBoxFocusHandler, + "blur": this._textBoxBlurHandler, + "keypress": this._textBoxKeyPressHandler + }, this); + + if (Sys.Browser.agent == Sys.Browser.InternetExplorer || Sys.Browser.agent === Sys.Browser.Safari + || Sys.Browser.agent === Sys.Browser.WebKit) { + $addHandler(this.get_textBoxControl(), "keydown", this._textBoxKeyDownHandler); + } + + $addHandlers(this.get_buttonControl(), + { + 'click': this._buttonClickHandler, + 'blur': this._buttonBlurHandler, + 'keydown': this._buttonKeyDownHandler, + 'keypress': this._buttonKeyPressHandler + }, this); + + $addHandler(document, 'click', this._documentClickHandler); + + // FF doesn't have an onmousewheel event + if (typeof (optionListControl.onmousewheel) === 'undefined') { + $addHandler(optionListControl, 'DOMMouseScroll', this._listMouseWheelHandler); + $addHandler(document, 'DOMMouseScroll', this._documentMouseWheelHandler); + } + else { + $addHandler(optionListControl, 'mousewheel', this._listMouseWheelHandler); + $addHandler(document, 'mousewheel', this._documentMouseWheelHandler); + } + }, + clearHandlers: function () { + + $clearHandlers(this.get_optionListControl()); + $clearHandlers(this.get_textBoxControl()); + $clearHandlers(this.get_buttonControl()); + $clearHandlers(document); + }, + initializeTextBox: function () { + + // initialize style + var style = this.get_textBoxControl().style; + + // default browser margins interfere with button alignment + if (style.margin == '') + style.margin = '0px'; + + }, + initializeButton: function () { + + // initialize style + var style = this.get_buttonControl().style; + + // container height is based on the textbox's offsetHeight + if (style.height == '' && this.get_textBoxControl().offsetHeight >= 0) + style.height = this.get_textBoxControl().offsetHeight + 'px'; + if (style.width == '') + style.width = style.height; + + // zero margins & padding (helps particularly in firefox) + if (style.padding == '') + style.padding = '0px'; + + // button is originally hidden to reduce screen flicker + this._buttonControl.style.visibility = 'visible'; + + }, + initializeOptionList: function () { + + // when there are no option items, server does not render a UL element. + if (this.get_optionListControl() == null) { + var optionList = document.createElement('ul'); + this.get_element().appendChild(optionList); + this.set_optionListControl(optionList); + } + var optionListControl = this.get_optionListControl(); + + // force inline display on Safari by moving the list to the bottom of the form. + if (Sys.Browser.agent === Sys.Browser.Safari || Sys.Browser.agent === Sys.Browser.WebKit) { + //this.get_element().removeChild(optionListControl); + var parentOfOptionList = optionListControl.parentNode; + if (parentOfOptionList != null) + parentOfOptionList.removeChild(optionListControl); + + var parent = this.get_element().parentNode; + while (typeof (parent) != typeof (document.forms[0])) { + parent = parent.parentNode; + } + var safariListContainer = document.createElement('div'); + safariListContainer.className = this.get_element().className; + safariListContainer.appendChild(optionListControl); + parent.appendChild(safariListContainer); + } + + // initialize style + var style = optionListControl.style; + + // option list is originally display-none to force inline rendering + style.display = 'block'; + style.zIndex = Sys.Extended.UI.zIndex.ComboBoxList; + + // build an array of list items + this._optionListItems = new Array(); + var children = optionListControl.childNodes; + for (var i = 0; i < children.length; i++) { + + // evaluate the current node to see if it should be added to the list items array + var child = children[i]; + + // there may be more childNodes than items in the list -- remove non-li elements + if (child.tagName == undefined || child.tagName.toUpperCase() != 'LI') { + // remove the child, then re-evaluate this index + optionListControl.removeChild(child); + i--; + continue; + } + + // add the item to the internal collection + var item = new Object(); + var text = child.innerHTML.trim(); + + // remove carriage returns + var indexOfCarriageReturn = text.indexOf('\r'); + while (indexOfCarriageReturn >= 0) { + text = text.substring(0, indexOfCarriageReturn).trim() + + ' ' + text.substring(indexOfCarriageReturn + 1, text.length).trim(); + indexOfCarriageReturn = text.indexOf('\r'); + } + + // remove newlines + var indexOfNewline = text.indexOf('\n'); + while (indexOfNewline >= 0) { + text = text.substring(0, indexOfNewline).trim() + + ' ' + text.substring(indexOfNewline + 1, text.length).trim(); + indexOfNewline = text.indexOf('\n'); + } + + // replace HTML entities with character equivalents + text = text.replace(/\&/g, '&') + .replace(/\"/g, '"') + .replace(/\>/g, '>') + .replace(/\</g, '<'); + + item.text = text.trim(); + Array.add(this._optionListItems, item); + + // style the ListItem with default skin + this.initializeOptionListItem(child); + } + + // initialize list width + style.width = this._getOptionListBounds().width + 'px'; + style.width = '0px'; + + // add the popup behavior to the master container, targeting the option list + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, + { + 'id': this.get_id() + '_PopupBehavior' + , 'parentElement': this.get_textBoxControl() + , "positioningMode": Sys.Extended.UI.PositioningMode.BottomLeft + }, null, null, optionListControl); + this._popupBehavior.add_showing(this._popupShowingHandler); + this._popupBehavior.add_shown(this._popupShownHandler); + this._popupBehavior.add_hiding(this._popupHidingHandler); + + // highlight the default item and set the default text + if (this.get_selectedIndex() >= 0) { + this._highlightListItem(this.get_selectedIndex()); + this.get_textBoxControl().value = this._optionListItems[this.get_selectedIndex()].text; + } + else { + //this.get_textBoxControl().text = ''; + this.get_textBoxControl().value = ''; + } + + // show and hide the popup behavior to initialize dimensions and overflow + this._popupShowing(); + optionListControl.style.display = "none"; + + }, + initializeOptionListItem: function (liElement) { + + // ensure empty text appears in the list + liElement._textIsEmpty = false; + if (liElement.innerHTML.length < 1) { + liElement.innerHTML = ' '; + liElement._textIsEmpty = true; + } + + }, + _popupShowing: function () { + + // find out what dimensions and positioning we are working with + var windowBounds = this._getWindowBounds(); + var tableBounds = Sys.UI.DomElement.getBounds(this.get_comboTableControl()); + var optionListBounds = this._getOptionListBounds(); + var safetyDimension = 30; + + // determine placement + var yThreshold = windowBounds.y + (windowBounds.height / 2); + var yFlopPoint = tableBounds.y + tableBounds.height; + var xThreshold = windowBounds.x + (windowBounds.width / 2); + var xFlopPoint = tableBounds.x + (tableBounds.width / 2); + + // vertical alignment & height + var maxHeight = tableBounds.y - windowBounds.y; + var yAlign = 'Top'; + if (yFlopPoint <= yThreshold) { + yAlign = 'Bottom'; + maxHeight = windowBounds.height - tableBounds.height - maxHeight; + } + + // when the list contains few enough items, maxHeight may be too large + var itemHeight = this._getOptionListItemHeight(); + if (maxHeight >= optionListBounds.height) { + maxHeight = optionListBounds.height; + } + else { + // adjust maxHeight to be a multiple of listItemHeight + maxHeight = itemHeight * ((Math.floor(maxHeight / itemHeight)) - 2); + } + var visibleItems = maxHeight / itemHeight; + var yScrollbar = (visibleItems < this._optionListItems.length); + var scrollbarWidth = 20; + + // when the list will fit safely, give it default alignment + if (yAlign == "Top" && maxHeight < (windowBounds.height - tableBounds.y)) { + yAlign = "Bottom"; + } + + // horizontal alignment & width + var maxWidth = tableBounds.x - windowBounds.x; + var xAlign = 'Left'; + if (xFlopPoint <= xThreshold) { + maxWidth = windowBounds.width - maxWidth; + } + else { + xAlign = 'Right'; + maxWidth = tableBounds.width + maxWidth; + } + + // subtract safety dimension + maxWidth -= safetyDimension; + + // when the list contains short items, maxWidth may be too large. + var bestWidth = optionListBounds.width; + if (yScrollbar) { + bestWidth += scrollbarWidth; + if (maxWidth >= bestWidth) { + maxWidth = bestWidth; + } + } + else if (maxWidth >= bestWidth) { + maxWidth = bestWidth; + } + + // when the list will fit safely, give it default alignment + if (xAlign == "Right" && maxWidth < (windowBounds.width - tableBounds.x)) { + xAlign = "Left"; + } + + // when list is empty, maxheight is -Infinity + if (maxHeight < 0) { + maxHeight = 0; + } + if (maxWidth < 0) { + maxWidth = 0; + } + + // set width & height + var style = this.get_optionListControl().style; + style.height = maxHeight + 'px'; + style.width = maxWidth + 'px'; + + // account for scrollbars + if (yScrollbar) { + style.overflow = 'auto'; + style.overflowX = 'hidden'; + } + else { + style.overflow = 'hidden'; + } + + // set positioning mode + var compositeAlign = yAlign + xAlign; + if (compositeAlign == 'BottomLeft') + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomLeft); + else if (compositeAlign == 'BottomRight') + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomRight); + else if (compositeAlign == 'TopLeft') + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopLeft); + else if (compositeAlign == 'TopRight') + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopRight); + + style.visibility = 'hidden'; + + }, + _popupShown: function () { + + var optionListControl = this.get_optionListControl(); + optionListControl.style.display = 'block'; + + // check and enforce correct positioning. + var tableBounds = Sys.UI.DomElement.getBounds(this.get_comboTableControl()); + var listBounds = Sys.UI.DomElement.getBounds(optionListControl); + var textBoxBounds = Sys.UI.DomElement.getBounds(this.get_textBoxControl()); + var y = listBounds.y; + var x; + + if (this._popupBehavior.get_positioningMode() === Sys.Extended.UI.PositioningMode.BottomLeft + || this._popupBehavior.get_positioningMode() === Sys.Extended.UI.PositioningMode.TopLeft) { + x = textBoxBounds.x; + } + else if (this._popupBehavior.get_positioningMode() === Sys.Extended.UI.PositioningMode.BottomRight + || this._popupBehavior.get_positioningMode() === Sys.Extended.UI.PositioningMode.TopRight) { + x = textBoxBounds.x - (listBounds.width - textBoxBounds.width); + } + + Sys.UI.DomElement.setLocation(optionListControl, x, y); + + // enforce default scroll + this._ensureHighlightedIndex(); + this._ensureScrollTop(); + + // show the option list + optionListControl.style.visibility = 'visible'; + + }, + _popupHiding: function () { + + // hide the option list + this._highlightSuggestedItem = false; + + var style = this.get_optionListControl().style; + style.display = 'none'; + style.visibility = 'hidden'; + + }, + _onButtonClick: function (e) { + Sys.Extended.UI.ComboBox.IsOpen(this); + // in Simple mode, always display the list + if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple) { + this._popupBehavior.show(); + } + + // show / hide the option list + else if (this._popupBehavior._visible) { + this._popupBehavior.hide(); + } + else { + this._popupBehavior.show(); + } + + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onButtonBlur: function (e) { + + // optionally trigger postback + if (this.get_autoPostBack() == true && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) { + this._doingPostBack = true; + __doPostBack(this.get_element().id, ''); + } + + }, + _onButtonKeyDown: function (e) { + + // sometimes user can type while the button has focus + if (e.keyCode == Sys.UI.Key.tab || e.keyCode == 16) { // 16==SHIFT key + return true; + } + + if (!this._popupBehavior._visible && (e.keyCode == Sys.UI.Key.enter || e.keyCode == Sys.UI.Key.down)) { + this._popupBehavior.show(); + } + else if (this._popupBehavior._visible && (e.keyCode == Sys.UI.Key.enter || e.keyCode == Sys.UI.Key.up)) { + this._popupBehavior.hide(); + } + + e.stopPropagation(); + e.preventDefault(); + + // give focus to the text box + var textBoxID = this.get_textBoxControl().id; + setTimeout(function () { document.getElementById(textBoxID).focus(); }, 0); + return false; + + }, + _onButtonKeyPress: function (e) { + + // sometimes user can type while the button has focus + if (e.charCode == Sys.UI.Key.tab || e.charCode == 16) { // 16==SHIFT key + return true; + } + e.stopPropagation(); + e.preventDefault(); + return false; + + }, + _onListMouseWheel: function (e) { + + var direction; + + // enforce mousewheel scrolling + if (typeof (e.rawEvent.wheelDelta) === 'undefined') { + // firefox + direction = (e.rawEvent.detail >= 1) ? 1 : -1; + } + else { + // not firefox + direction = (e.rawEvent.wheelDelta > 1) ? -1 : 1; + } + + // each event scrolls approximately 1 list item up or down + this.get_optionListControl().scrollTop += this._getOptionListItemHeight() * direction; + + // tell parents we have handled this event + e.stopPropagation(); + e.preventDefault(); + return false; + + }, + _onListMouseOver: function (e) { + var optionListControl = this.get_optionListControl(); + // do not highlight unless an LI is being hovered + if (e.target !== optionListControl) { + var target = e.target; + var children = optionListControl.childNodes; + + // loop through children to find a match with the target + for (var i = 0; i < children.length; ++i) { + // match found, highlight item and break loop + if (target === children[i]) { + this._highlightListItem(i, true); + break; + } + } + } + + }, + _onListMouseOut: function (e) { + + // unhighlight the highlighted item if the list is open in suggestappend mode + // prevents overriding user-typed text when determining the selectedindex + if (this._popupBehavior._visible + && this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend) { + this._highlightListItem(this._highlightedIndex, false); + } + + }, + _onListMouseDown: function (e) { + var optionListControl = this.get_optionListControl(); + + if (e.target == optionListControl || e.target.tagName == 'scrollbar') { + return true; + } + + // set the TextBox to the highlighted ListItem's text and update selectedIndex + if (e.target !== optionListControl) { + var highlightedItem = optionListControl.childNodes[this._highlightedIndex], + text = this._optionListItems[this._highlightedIndex].text; + this.get_textBoxControl().value = text; + this.set_selectedIndex(this._highlightedIndex); + + // return focus to the TextBox + this._supressFocusHide = false; + //this.get_textBoxControl().focus(); // danludwig, see http://Sys.Extended.UI.codeplex.com/WorkItem/View.aspx?WorkItemId=22392 + this._handleTextBoxFocus(null); + + } + else { + return true; + } + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onListClick: function (e) { + + if (e.target == this.get_optionListControl()) { + return true; + } + + // prevent ItemList clicks from triggering document clicks + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onListDrag: function (e) { + + // prevent selection of ListItem text + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onListSelectStart: function (e) { + + // prevent selection of ListItem text + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onTextBoxClick: function (e) { + + // in Simple mode, always display the list + if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple) { + this._popupBehavior.show(); + } + + // prevent TextBox clicks from triggering document clicks + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onTextBoxFocus: function (e) { + Sys.Extended.UI.ComboBox.IsOpen(this); + this._handleTextBoxFocus(e); + + }, + _onTextBoxBlur: function (e) { + + // select the correct index based on text box value + var textBoxValue = this.get_textBoxControl().value.trim(); + var matchedIndex = -3; + + // search items + for (var i = 0; i < this._optionListItems.length; i++) { + var item = this._optionListItems[i]; + if (this._isExactMatch(item.text, textBoxValue)) { + matchedIndex = i; + break; + } + } + + // when in suggest mode, a suggested index may already be set + if (this._highlightSuggestedItem == true && this._highlightedIndex != null && this._highlightedIndex >= 0) { + this.set_selectedIndex(this._highlightedIndex); + this.get_textBoxControl().value = this._optionListItems[this.get_selectedIndex()].text; + } + + // selected index is -2 when custom text is entered in dropdownlist mode + else if (matchedIndex == -3 && textBoxValue.length > 0 + && this.get_dropDownStyle() != Sys.Extended.UI.ComboBoxStyle.DropDownList) { + this.set_selectedIndex(-2); + } + + // selected index is -1 when there are no items in the list and there is no custom text + else if (this._optionListItems.length < 1 && (textBoxValue == '' + || this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDownList)) { + this.set_selectedIndex(-1); + this.get_textBoxControl().value = ''; + } + + // when list contains items but none matched, select the first item by default + else if (this._optionListItems.length >= 0 && matchedIndex == -3 + && this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDownList) { + this.set_selectedIndex(0); + this.get_textBoxControl().value = this._optionListItems[0].text; + } + + // when list contains a matchable item, set the selected index + else if (matchedIndex >= 0) { + this.set_selectedIndex(matchedIndex); + this.get_textBoxControl().value = this._optionListItems[matchedIndex].text; + } + + // hide the option list and optionally trigger postback + this._popupBehavior.hide(); + if (this.get_autoPostBack() == true && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) { + this._doingPostBack = true; + __doPostBack(this.get_element().id, ''); + } + + }, + _onTextBoxKeyDown: function (e) { + + // keydown is not fired in ff or opera. keypress is fired instead. + // in ie and safari, keydown is fired before keypress for character keys and the ENTER key. + // in ie and safari, keydown is fired instead of keypress for ARROWS, BACKSPACE, and DELETE keys. + // only keyCodes are sent to this event: charCodes are always undefined here. + + // user presses ENTER while text box has focus + var enterResult = this._handleEnterKey(e); + if (enterResult != null) { + return enterResult; + } + + this._handleArrowKey(e); + + // handle backspace and delete keystrokes + var erasureKeyResult = this._handleErasureKeys(e); + if (erasureKeyResult != null) { + return erasureKeyResult; + } + + return true; + + }, + _onTextBoxKeyPress: function (e) { + + // user presses ENTER while text box has focus + var enterResult = this._handleEnterKey(e); + if (enterResult != null) { + return enterResult; + } + + // some browsers, like ff and Opera, send arrow strokes here instead of keydown + var arrowResult = this._handleArrowKey(e); + if (arrowResult != null) { + return arrowResult; + } + + // do not prevent all keypresses, only character keypresses. + var nonCharacterKeyResult = this._handleNonCharacterKey(e); + if (nonCharacterKeyResult != null) { + return nonCharacterKeyResult; + } + + // always show list in simple mode + if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple && !this._popupBehavior._visible) { + this._popupBehavior.show(); + } + + // prevent typing when there are no items in the list + if (this.get_selectedIndex() == -1 + && this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDownList + && this._optionListItems.length == 0) { + this.get_textBoxControl().value = ''; + e.preventDefault(); + e.stopPropagation(); + return false; + } + + // get info about the text and selection + var info = this._getTextSelectionInfo(this.get_textBoxControl(), e); + var newSelectionStart = info.selectionStart; + var newSelectionEnd = info.selectionEnd; + var allText = info.selectionPrefix + info.typedCharacter + + info.selectionText.substring(1) + info.selectionSuffix; + var userText = info.selectionPrefix + info.typedCharacter; + var textBoxMaxLength =this.get_textBoxControl().maxLength; + if(textBoxMaxLength < 0) + textBoxMaxLength = Number.MAX_VALUE; + + if (userText.length > textBoxMaxLength) { + userText = userText.substring(0, this.get_textBoxControl().maxLength); + } + var suggestedIndex = this._suggestIndex(allText, userText); + + // setup suggest behavior + if (this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.Suggest + || this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend) { + this._highlightSuggestedItem = true; + if (!this._popupBehavior._visible) { + this._popupBehavior.show(); + } + } + + // suggestedIndex can be a valid index or -1. + if (suggestedIndex >= 0) { + + // handle append behavior + if (this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.Append + || this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend) { + this.get_textBoxControl().value = this._optionListItems[suggestedIndex].text; + newSelectionStart = info.selectionStart + 1; + newSelectionEnd = this.get_textBoxControl().value.length; + } + // do not append suggestion + else { + this.get_textBoxControl().value = this._optionListItems[suggestedIndex].text.substring(0, userText.length); + newSelectionStart = this.get_textBoxControl().value.length; + newSelectionEnd = this.get_textBoxControl().value.length; + } + } + // when suggestedIndex is -1, there is no match. + else if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple + || this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDown) { + this.get_textBoxControl().value = userText; + newSelectionStart = userText.length; + newSelectionEnd = userText.length; + } + + // handle backspace and delete keystrokes + var erasureKeyResult = this._handleErasureKeys(e); + if (erasureKeyResult != null) { + return erasureKeyResult; + } + + // automatically highlight and scroll based on typing + this._ensureHighlightedIndex(); + this._ensureScrollTop(); + this._setTextSelectionRange(this.get_textBoxControl(), newSelectionStart, newSelectionEnd); + + e.preventDefault(); + e.stopPropagation(); + return false; + + }, + _onDocumentClick: function (e) { + + // hide the option list when users click document + if (this._popupBehavior._visible) { + this._popupBehavior.hide(); + } + + }, + _onDocumentMouseWheel: function (e) { + + // hide the option list when user mousewheel scrolls outside of it + if (this._popupBehavior) { + this._popupBehavior.hide(); + } + return true; + + }, + _handleTextBoxFocus: function (e) { + + // hide the option list and optionally trigger postback + if (!this._supressFocusHide && this._popupBehavior._visible) { + this._popupBehavior.hide(); + this._supressFocusHide = true; + if (this.get_autoPostBack() && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) { + this._doingPostBack = true; + __doPostBack(this.get_element().id, ''); + } + } + + // in Simple mode, always display the list + if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple) { + this._popupBehavior.show(); + } + + // select the entire string in the text box + this._setTextSelectionRange( + this.get_textBoxControl(), + 0, + this.get_textBoxControl().value.length); + + if (e != null) { + e.preventDefault(); + e.stopPropagation(); + } + + }, + _highlightListItem: function (index, isHighlighted) { + + // only highlight valid indices + if (index == undefined || index < 0) { + if (this._highlightedIndex != undefined && this._highlightedIndex >= 0) { + this._highlightListItem(this._highlightedIndex, false); + } + return; + } + + var children = this.get_optionListControl().childNodes; + var liElement = children[index]; + + // item is being hovered + if (isHighlighted == true) { + + // skip if already highlighted + if (this._highlightedIndex == index) + return; + + // apply hover css class + if (index >= 0) { + // to avoid scrollbar flickering during scrolls in IE, do not set className unless it is provided + if (this.get_listItemHoverCssClass() == undefined || this.get_listItemHoverCssClass() == '') { + liElement.style.backgroundColor = 'Highlight'; + liElement.style.color = 'HighlightText'; + } + else { + liElement.className = this.get_listItemHoverCssClass; + } + } + + // unselect previously highlighted item + if (this._highlightedIndex != null && this._highlightedIndex != index && this._highlightedIndex >= 0) { + this._highlightListItem(this._highlightedIndex, false); + } + + // update control state + this._highlightedIndex = index; + } + + // item is not being hovered + else { + if (this.get_listItemHoverCssClass() == undefined || this.get_listItemHoverCssClass() == '') { + liElement.style.backgroundColor = ''; + liElement.style.color = ''; + } + else { + liElement.className = ''; + } + + if (index == this._highlightedIndex) { + this._highlightedIndex = -1; + } + } + + }, + _suggestIndex: function (allText, userText) { + + // suggest closest option list match based on user's typing + var suggestedIndex = -1; + var firstMatch = false; + var exactMatch = false; + + // loop through all options in the list + for (var i = 0; i < this._optionListItems.length; i++) { + itemText = this._optionListItems[i].text; + + // skip empty elements + if (itemText.length < 1) + continue; + + // skip elements that don't match on first character + if (itemText.substring(0, 1).toLowerCase() != userText.substring(0, 1).toLowerCase()) + continue; + + // first, check if strings are exact match + var allCandidate = itemText.substring(0, allText.length); + exactMatch = (allCandidate == allText); + if (!exactMatch && !this.get_caseSensitive()) { + exactMatch = (allCandidate.toLowerCase() == allText.toLowerCase()); + } + + // always return exact matches before first matches + if (exactMatch) { + suggestedIndex = i; + break; + } + + // otherwise, look for a partial match and keep going + else if (!firstMatch) { + var userCandidate = itemText.substring(0, userText.length); + firstMatch = (userCandidate == userText); + if (!firstMatch && !this.get_caseSensitive()) + firstMatch = (userCandidate.toLowerCase() == userText.toLowerCase()); + if (firstMatch) + suggestedIndex = i; + } + } + return suggestedIndex; + + }, + _getKeyboardCode: function (e) { + + if (e.type == 'keypress') { + return e.charCode; + } else if (e.type == 'keydown') { + return e.keyCode; + } + return undefined; + + }, + _handleArrowKey: function (e) { + + // when shift key is pressed, ignore arrow codes + if (e.shiftKey == true) { + return null; + } + + var code = this._getKeyboardCode(e); + + // cycle through items when up & down arrow keys are used + if (code == Sys.UI.Key.up || code == Sys.UI.Key.down) { + if (!this._popupBehavior._visible) { + this._popupBehavior.show(); + this._highlightedIndex = this._highlightedIndex || -1; + } + + var vector = code - 39; + if ((vector == -1 && this._highlightedIndex > 0) || (vector == 1 && this._highlightedIndex < this._optionListItems.length - 1)) { + var newIndex = (this._highlightedIndex + vector); + this.get_textBoxControl().value = this._optionListItems[newIndex].text; + this._highlightListItem(newIndex, true); + this.set_selectedIndex(newIndex); + this._ensureScrollTop(); + } + + if (e.type == 'keypress') { + e.preventDefault(); + e.stopPropagation(); + return false; + } + return true; + } + return null; + + }, + _handleEnterKey: function (e) { + + var code = this._getKeyboardCode(e); + + if (code == Sys.UI.Key.enter) { + // if the dropdown is open, close it. + if (this._popupBehavior._visible) { + if (this._highlightedIndex >= 0) { + this.get_textBoxControl().value = this._optionListItems[this._highlightedIndex].text; + this.set_selectedIndex(this._highlightedIndex); + __doPostBack(this.get_element().id, ''); + } + this._popupBehavior.hide(); + e.preventDefault(); + e.stopPropagation(); + return false; + } + + // allow form submits for free text + else if (this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple + || this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDown) { + return true; + } + + // allow form submits for valid selected indices + else if (this._highlightedIndex == this.get_selectedIndex()) { + return true; + } + + e.preventDefault(); + e.stopPropagation(); + return false; + } + return null; + + }, + _handleErasureKeys: function (e) { + + var code = this._getKeyboardCode(e); + + var isBackspaceKey = (code == Sys.UI.Key.backspace); + var isDeleteKey = (code == Sys.UI.Key.del); + if (typeof (window.event) === 'undefined' && e.type == 'keypress') { + isDeleteKey = (e.rawEvent.keyCode == 46); + } + + if (isBackspaceKey || isDeleteKey) { + + var info = this._getTextSelectionInfo(this.get_textBoxControl(), e); + var newSelectionStart, newSelectionEnd; + + // always delete selected characters + if (info.selectionStart < info.selectionEnd) { + this.get_textBoxControl().value = info.selectionPrefix + info.selectionSuffix; + newSelectionStart = info.selectionStart; + newSelectionEnd = info.selectionStart; + } + + // otherwise, there is no selection -- only a carat + else if (info.selectionStart == info.selectionEnd) { + var newValue; + if (isBackspaceKey && info.selectionStart > 0) { + var trimSize = 1; + if (info.selectionPrefix.charCodeAt(info.selectionPrefix.length - 1) == 8) { + trimSize = 2; + } + newValue = info.selectionPrefix.substr(0, info.selectionPrefix.length - trimSize); + newValue += info.selectionSuffix; + this.get_textBoxControl().value = newValue; + newSelectionStart = info.selectionStart - 1; + newSelectionEnd = info.selectionStart - 1; + } + else if (isDeleteKey && info.selectionStart < info.textBoxValue.length) { + newValue = info.selectionSuffix; + newValue = info.selectionPrefix + newValue.substr(1, info.selectionSuffix.length - 1); + this.get_textBoxControl().value = newValue; + newSelectionStart = info.selectionStart; + newSelectionEnd = info.selectionStart; + this._setTextSelectionRange(this.get_textBoxControl(), info.selectionStart, info.selectionStart); + } + } + + this._ensureHighlightedIndex(); + this._ensureScrollTop(); + this._setTextSelectionRange(this.get_textBoxControl(), newSelectionStart, newSelectionEnd); + + // in custom text modes with suggestion, need to re-check the highlighted item + if ((this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.Simple + || this.get_dropDownStyle() == Sys.Extended.UI.ComboBoxStyle.DropDown) + && (this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.Suggest + || this.get_autoCompleteMode() == Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend) + && (this._highlightedIndex != null && this._highlightedIndex >= 0)) { + var _isExactMatch = this._isExactMatch(this._optionListItems[this._highlightedIndex].text, this.get_textBoxControl().value); + if (!_isExactMatch) { + this._highlightListItem(this._highlightedIndex, false); + } + } + + e.preventDefault(); + e.stopPropagation(); + return false; + } + return null; + + }, + _handleNonCharacterKey: function (e) { + + var code = this._getKeyboardCode(e); + + var isBackspaceKey = (code == Sys.UI.Key.backspace); + var isDeleteKey = (code == Sys.UI.Key.del); + if (e.type == 'keypress') { + isDeleteKey = (e.rawEvent.code == 46); + } + + if (isBackspaceKey || isDeleteKey) { + return null; + } + + if (this._isNonCharacterKey(e)) { + // prevent event validation errors when ESC is hit twice + if (code == Sys.UI.Key.esc) { + this._popupBehavior.hide(); + this.get_textBoxControl().blur(); + e.preventDefault(); + e.stopPropagation(); + return false; + } + return true; + } + return null; + }, + _isNonCharacterKey: function (e) { + + // MS Ajax uses following codes for Key enumeration + // backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127 + var code = this._getKeyboardCode(e); + + // return true if keypress actions should be allowed + if (code == Sys.UI.Key.enter || code == Sys.UI.Key.esc) { // allow RETURN/ENTER and ESC keys for all browsers + return true; + } + else if (Sys.Browser.agent == Sys.Browser.Safari && Sys.Browser.version < 500) { + + // allow special funky apple keypresses + if (code == 8 // BACKSPACE in Safari 2 + || code == 9 // TAB in Safari 2 + || code == 63272 // DELETE in Safari 2 + || code == 63276 // PAGEUP in Safari 2 + || code == 63277 // PAGEDOWN in Safari 2 + || code == 63275 // END in Safari 2 + || code == 63273 // HOME in Safari 2 + || code == 63234 // ARROWLEFT in Safari 2 + || code == 63235 // ARROWRIGHT in Safari 2 + || (code >= 63236 && code <= 63243) // FUNCTION keys in Safari 2 + || code == 63248 // F13 key in Safari 2 + ) { + return true; + } + } + else if (Sys.Browser.agent == Sys.Browser.WebKit) { + + // allow special funky apple webkit keypresses + if (code == 8 // BACKSPACE in Safari 3 + || code == 9 // TAB in Safari 3 + || code == 19 // PAUSE BREAK Safari 3 + || code == 33 // PAGEUP in Safari 3 + || code == 34 // PAGEDOWN in Safari 3 + || code == 35 // END in Safari 3 + || code == 36 // HOME in Safari 3 + || code == 37 // ARROWLEFT in Safari 3 + || code == 39 // ARROWRIGHT in Safari 3 + || code == 45 // INSERT in Safari 3 + || code == 46 // DELETE in Safari 3 + || code == 91 // WINDOWS LEFT Safari 3 + || code == 92 // WINDOWS RIGHT Safari 3 + || code == 93 // MENU Safari 3 + || code == 113 // F2 Safari 3 + || code == 115 // F4 Safari 3 + || code == 118 // F7 Safari 3 + || code == 119 // F8 Safari 3 + || code == 120 // F9 Safari 3 + || code == 122 // F11 Safari 3 + || code == 145 // SCROLL LOCK Safari 3 + ) + return true; + } + else if (Sys.Browser.agent != Sys.Browser.InternetExplorer) { + + // allow kepress events triggered by FF & Opera + if (code == 8 // BACKSPACE in non-microsoft browsers + || code == 9 // TAB in non-microsoft browsers + || code == 33 // PAGEUP in non-microsoft browsers + || code == 34 // PAGEDOWN in non-microsoft browsers + || code == 35 // END in non-microsoft browsers + || code == 36 // HOME in non-microsoft browsers + || code == 37 // ARROWLEFT in non-microsoft browsers + || code == 39 // ARROWRIGHT in non-microsoft browsers + || code == 45 // INSERT in non-microsoft browsers + || code == 46 // DELETE in non-microsoft browsers + //|| (code >= 112 && code <= 123) // FUNCTION keys in non-microsoft browsers + ) { + if (!e.shiftKey) + return true; + } + else if (code == 145) { + + // allow SCROLL LOCK events triggered by weird combos + return true; + + } + else if (code == 19) { + + // allow PAUSE BREAK events triggered by weird combos + return true; + } + else if (Sys.Browser.agent == Sys.Browser.Opera) { + + // allow kepress events triggered only by Opera + if (code == 0 // MENU key in Opera + || code == 16 // SHIFT key in Opera + || code == 17 // CONTROL key in Opera + ) { + return true; + } + } + else if (Sys.Browser.agent == Sys.Browser.Firefox) { + + // allow kepress events triggered only by Firefox + if (code == 91 // WINDOWS LEFT key in Firefox + || code == 92 // WINDOWS RIGHT key in Firefox + || code == 93 // MENU key in Firefox + ) { + return true; + } + } + } + else if (Sys.Browser.agent == Sys.Browser.InternetExplorer) { + // period character for IE + if (code == 46) + return true; + } + return false; + + }, + _ensureScrollTop: function () { + + var optionListControl = this.get_optionListControl(); + + // automatically scroll if the highlighted index is not visible. + if (this._highlightedIndex >= 0) { + var itemHeight = this._getOptionListItemHeight(), + itemTop = itemHeight * this._highlightedIndex, + scrollBottom = optionListControl.scrollTop + optionListControl.clientHeight; + + if (itemTop <= optionListControl.scrollTop || itemTop >= scrollBottom) + optionListControl.scrollTop = this._highlightedIndex * itemHeight; + } + + }, + _ensureSelectedIndex: function () { + + // server may not always invoke set_selectedIndex(), need to make sure this is always an integer + var selectedIndex = this.get_hiddenFieldControl().value; + if (selectedIndex == '') { + selectedIndex = (this._optionListItems.length > 0) ? 0 : -1; + this.get_hiddenFieldControl().value = selectedIndex.toString(); + } + if (this._originalSelectedIndex == null) { + this._originalSelectedIndex = parseInt(selectedIndex); + } + + + }, + _ensureHighlightedIndex: function () { + + // highlight an index according to textbox value + var textBoxValue = this.get_textBoxControl().value; + + // first, check the current highlighted index + if (this._highlightedIndex != null && this._highlightedIndex >= 0 + && this._isExactMatch(this._optionListItems[this._highlightedIndex].text, textBoxValue)) { + return; + } + + // need to find the correct index + var firstMatch = -1; + var ensured = false; + for (var i = 0; i < this._optionListItems.length; i++) { + var itemText = this._optionListItems[i].text; + if (this._isExactMatch(itemText, textBoxValue)) { + this._highlightListItem(i, true); + ensured = true; + break; + } + + // if in DropDownList mode, save first match. + else if (firstMatch < 0 && this._highlightSuggestedItem) { + if (this._isPrefixMatch(itemText, textBoxValue)) { + firstMatch = i; + } + } + } + + if (!ensured) { + this._highlightListItem(firstMatch, true); + } + + }, + _isExactMatch: function (itemText, userText) { + + // whether strings match exactly, depending on case sensitivity + var exactMatch = (itemText == userText); + if (!exactMatch && !this.get_caseSensitive()) + exactMatch = (itemText.toLowerCase() == userText.toLowerCase()); + return exactMatch; + + }, + _isPrefixMatch: function (itemText, userText) { + + // whether the user-typed text matches as the prefix of an option in the list + return this._isExactMatch(itemText.substring(0, userText.length), userText); + + }, + _setTextSelectionRange: function (textBox, selectionStart, selectionEnd) { + + // set the selection range on the text box + var strategy = this._getTextSelectionStrategy(); + if (strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) { + var range = textBox.createTextRange(); + range.collapse(true); + range.moveEnd('character', selectionEnd); + range.moveStart('character', selectionStart); + range.select(); + + // opera wants to also invoke the W3C setSelectionRange method + if (Sys.Browser.agent == Sys.Browser.Opera) { + textBox.setSelectionRange(selectionStart, selectionEnd); + } + } + else if (strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C) { + textBox.setSelectionRange(selectionStart, selectionEnd); + } + + }, + _getTextSelectionStrategy: function () { + + // different browsers have different API's for selecting text + if (this._textSelectionStrategy == null) { + if(Sys.Browser.agent === Sys.Browser.InternetExplorer && Sys.Browser.version <= 8) { + this._textSelectionStrategy = + Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft; + } + else if (this.get_textBoxControl().setSelectionRange) { + this._textSelectionStrategy = + Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C; + } + else { + this._textSelectionStrategy = + Sys.Extended.UI.ComboBoxTextSelectionStrategy.Unknown; + } + } + + return this._textSelectionStrategy; + + }, + _getTextSelectionInfo: function (textBox, e) { + + // returns a helper object with information about textbox selection + var info = new Object(); + + // strategy + info.strategy = this._getTextSelectionStrategy(); + + // selectionStart & selectionEnd + if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.Microsoft) { + var userRange = document.selection.createRange(); + info.selectionStart = 0; + info.selectionEnd = textBox.value.length; + while (userRange.moveStart('character', -1) != 0) { + info.selectionStart++; + } + while (userRange.moveEnd('character', 1) != 0) { + info.selectionEnd--; + } + } + else if (info.strategy == Sys.Extended.UI.ComboBoxTextSelectionStrategy.W3C) { + info.selectionStart = textBox.selectionStart; + info.selectionEnd = textBox.selectionEnd; + } + + // typedCharacter, textBoxValue, selectionPrefix, selectionSuffix, selectionTextFirst + info.typedCharacter = String.fromCharCode(e.charCode); + info.textBoxValue = textBox.value; + info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart) + ? info.textBoxValue.substring(0, info.selectionStart) + : ''; + info.selectionText = (info.textBoxValue.length >= info.selectionEnd) + ? info.textBoxValue.substring(info.selectionStart, info.selectionEnd) + : ''; + info.selectionSuffix = (info.textBoxValue.length >= info.selectionEnd) + ? info.textBoxValue.substring(info.selectionEnd, info.textBoxValue.length) + : ''; + info.selectionTextFirst = info.selectionText.substring(0, 1); + + return info; + + }, + _getOptionListItemHeight: function () { + + var optionListControl = this.get_optionListControl(); + + // gets the height of an individual option list item + if (this._optionListItemHeight == null && optionListControl.scrollHeight > 0) { + this._optionListItemHeight = Math.round(optionListControl.scrollHeight / this._optionListItems.length); + } + else if (Sys.Browser.agent === Sys.Browser.InternetExplorer && Sys.Browser.version < 7 + && Math.round(optionListControl.scrollHeight / this._optionListItems.length) < this._optionListItemHeight) { + this._optionListItemHeight = Math.round(optionListControl.scrollHeight / this._optionListItems.length); + } + return this._optionListItemHeight; + + }, + _getOptionListBounds: function () { + + var bounds = { + width: this._getOptionListWidth(), + height: this._getOptionListHeight() + }; + return bounds; + + }, + _getOptionListHeight: function () { + + // gets the total height of the option list + if (this._optionListHeight == null || (this._getOptionListItemHeight() * this._optionListItems.length) < this._optionListHeight) { + // multiply the height of one item by the total number of items + this._optionListHeight = this._getOptionListItemHeight() * this._optionListItems.length; + } + + // protect against negative dimensions + if (this._optionListHeight < 0) { + this._optionListHeight = 0; + } + + return this._optionListHeight; + + }, + _getOptionListWidth: function () { + + var optionListControl = this.get_optionListControl(); + + // gets the width of the option list + if (this._optionListWidth == null) { + var leftBorder = 1; + var rightBorder = 1; + var leftPadding = 0; + var rightPadding = 0; + var style = optionListControl.style; + + + // before doing anything, make sure overflow is auto + style.overflow = 'auto'; + + // first, default to the clientWidth of the container + var bestWidth = this.get_comboTableControl().offsetWidth; + + // subtract borders from the offsetWidth + bestWidth -= (leftBorder + rightBorder); + if (bestWidth < 0) { + bestWidth = 0; + } + + // in order for ths list's scrollWidth to be correct, must set its width + var originalWidth = style.width; + style.width = bestWidth + 'px'; + + // now compare the list's scrollWidth to the box width + if (this.get_comboTableControl().offsetWidth < optionListControl.scrollWidth) { + // allow the list to extend as wide as necessary according to its contents + bestWidth = optionListControl.scrollWidth + rightPadding + leftPadding; + } + + // hide the overflow, as there shouldn't be any scrollbars needed now + style.overflow = 'hidden'; + + // reset the list's width style to its original setting + style.width = originalWidth; + + this._optionListWidth = bestWidth; + } + + // protect against negative dimensions + if (this._optionListWidth < 0) { + this._optionListWidth = 0; + } + + return this._optionListWidth; + + }, + _getWindowBounds: function () { + + var bounds = { + x: this._getScrollLeft(), + y: this._getScrollTop(), + width: this._getWindowWidth(), + height: this._getWindowHeight() + }; + return bounds; + + }, + _getWindowHeight: function () { + + var windowHeight = 0; + if (typeof (window.innerHeight) == 'number') { + windowHeight = window.innerHeight; + } + else if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } + else if (document.body && document.body.clientHeight) { + windowHeight = document.body.clientHeight; + } + return windowHeight; + + }, + _getWindowWidth: function () { + + var windowWidth = 0; + if (typeof (window.innerWidth) == 'number') { + windowWidth = window.innerWidth; + } + else if (document.documentElement && document.documentElement.clientWidth) { + windowWidth = document.documentElement.clientWidth; + } + else if (document.body && document.body.clientWidth) { + windowWidth = document.body.clientWidth; + } + return windowWidth; + + }, + _getScrollTop: function () { + + var scrollTop = 0; + if (typeof (window.pageYOffset) == 'number') { + scrollTop = window.pageYOffset; + } + if (document.body && document.body.scrollTop) { + scrollTop = document.body.scrollTop; + } + else if (document.documentElement && document.documentElement.scrollTop) { + scrollTop = document.documentElement.scrollTop; + } + return scrollTop; + + }, + _getScrollLeft: function () { + + var scrollLeft = 0; + if (typeof (window.pageXOffset) == 'number') { + scrollLeft = window.pageXOffset; + } + else if (document.body && document.body.scrollLeft) { + scrollLeft = document.body.scrollLeft; + } + else if (document.documentElement && document.documentElement.scrollLeft) { + scrollLeft = document.documentElement.scrollLeft; + } + return scrollLeft; + + }, + + /// + /// A ComboBox table control. + /// + /// get_comboTableControl + /// set_comboTableControl + /// + get_comboTableControl: function () { + return this._comboTableControl; + }, + set_comboTableControl: function (value) { + if (this._comboTableControl !== value) { + this._comboTableControl = value; + this.raisePropertyChanged('comboTableControl'); + } + }, + + /// + /// A TextBox control. + /// + /// get_textBoxControl + /// set_textBoxControl + /// + get_textBoxControl: function () { + return this._textBoxControl; + }, + set_textBoxControl: function (value) { + if (this._textBoxControl !== value) { + this._textBoxControl = value; + this.raisePropertyChanged('textBoxControl'); + } + }, + + /// + /// A Button control. + /// + /// get_buttonControl + /// set_buttonControl + /// + get_buttonControl: function () { + return this._buttonControl; + }, + set_buttonControl: function (value) { + if (this._buttonControl !== value) { + this._buttonControl = value; + this.raisePropertyChanged('buttonControl'); + } + }, + + /// + /// An OptionList control. + /// + /// get_optionListControl + /// set_optionListControl + /// + get_optionListControl: function () { + return this._optionListControl; + }, + set_optionListControl: function (value) { + if (this._optionListControl !== value) { + this._optionListControl = value; + this.raisePropertyChanged('optionListControl'); + } + }, + + /// + /// A hidden field control. + /// + /// get_hiddenFieldControl + /// set_hiddenFieldControl + /// + get_hiddenFieldControl: function () { + return this._hiddenFieldControl; + }, + set_hiddenFieldControl: function (value) { + if (this._hiddenFieldControl !== value) { + this._hiddenFieldControl = value; + this.raisePropertyChanged('hiddenFieldControl'); + } + }, + + /// + /// The ComboBox selected item index. + /// + /// get_selectedIndex + /// set_selectedIndex + /// + get_selectedIndex: function () { + this._ensureSelectedIndex(); + var selectedIndex = this.get_hiddenFieldControl().value; + return parseInt(selectedIndex); + }, + set_selectedIndex: function (value) { + if (this.get_hiddenFieldControl().value !== value.toString()) { + this.get_hiddenFieldControl().value = value.toString(); + this._ensureSelectedIndex(); + this.raisePropertyChanged('selectedIndex'); + } + }, + + /// + /// Determined whether or not to use AutoPostBack. + /// + /// get_autoPostBack + /// set_autoPostBack + /// + get_autoPostBack: function () { + return this._autoPostBack; + }, + set_autoPostBack: function (value) { + if (this._autoPostBack !== value) { + this._autoPostBack = value; + this.raisePropertyChanged('autoPostBack'); + } + }, + + /// + /// Determines how the ComboBox automatically completes typed text. + /// + /// + /// When "Suggest" is specified, the ComboBox will show the list, highlight the first matched item, + /// and if necessary, scroll the list to show the highlighted item. If "Append" is specified, + /// the ComboBox will append the remainder of the first matched item to the user-typed text and + /// highlight the appended text. When "SuggestAppend" is specified, both of the above behaviors are + /// applied. If "None" (the default value) is specified, the ComboBox's auto-complete behaviors are disabled. + /// + /// get_autoCompleteMode + /// set_autoCompleteMode + /// + get_autoCompleteMode: function () { + return this._autoCompleteMode; + }, + set_autoCompleteMode: function (value) { + if (this._autoCompleteMode !== value) { + this._autoCompleteMode = value; + this.raisePropertyChanged('autoCompleteMode'); + } + }, + + /// + /// Determines whether or not a user is allowed to enter text that does not match an item in the list and if the list is always displayed. + /// + /// + /// If "DropDownList" is specified, users are not allowed to enter text that does not match an item in the list. When "DropDown" + /// (the default value) is specified, any text is allowed. If "Simple" is specified, any text is allowed and the list is + /// always displayed regardless of the AutoCompleteMode property value. + /// + /// get_dropDownStyle + /// set_dropDownStyle + /// + get_dropDownStyle: function () { + return this._dropDownStyle; + }, + set_dropDownStyle: function (value) { + if (this._dropDownStyle !== value) { + this._dropDownStyle = value; + this.raisePropertyChanged('dropDownStyle'); + } + }, + + /// + /// Specifies whether user-typed text matches items in the list in a case-sensitive manner. The default is false. + /// + /// get_caseSensitive + /// set_caseSensitive + /// + get_caseSensitive: function () { + return this._caseSensitive; + }, + set_caseSensitive: function (value) { + if (this._caseSensitive !== value) { + this._caseSensitive = value; + this.raisePropertyChanged('caseSensitive'); + } + }, + + /// + /// When specified, replaces the default styles applied to highlighted items in the list with a custom css class. + /// + /// get_listItemHoverCssClass + /// set_listItemHoverCssClass + /// + get_listItemHoverCssClass: function () { + return this._listItemHoverCssClass; + }, + set_listItemHoverCssClass: function (value) { + if (this._listItemHoverCssClass !== value) { + this._listItemHoverCssClass = value; + this.raisePropertyChanged('listItemHoverCssClass'); + } + }, +}; +Sys.Extended.UI.ComboBox.registerClass('Sys.Extended.UI.ComboBox', Sys.UI.Control); + +var ComboBox_Elements = new Array(); + +Sys.Extended.UI.ComboBox.IsOpen = function (currentInstance) { + var components = Sys.Application.getComponents(); + for (var i = 0; i < components.length; i++) { + var component = components[i]; + if (Sys.Extended.UI.ComboBox.isInstanceOfType(component)) { + if (component != currentInstance && component._popupBehavior._visible) { + // hide popup of other instance of combobox + component._popupBehavior.hide(); + } + } + } +}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js new file mode 100644 index 000000000..37e9f2250 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js @@ -0,0 +1,335 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.TimeSpan = function() { + // Represents a period of time + if (arguments.length == 0) this._ctor$0.apply(this, arguments); + else if (arguments.length == 1) this._ctor$1.apply(this, arguments); + else if (arguments.length == 3) this._ctor$2.apply(this, arguments); + else if (arguments.length == 4) this._ctor$3.apply(this, arguments); + else if (arguments.length == 5) this._ctor$4.apply(this, arguments); + else throw Error.parameterCount(); +} +Sys.Extended.UI.TimeSpan.prototype = { + + _ctor$0 : function() { + this._ticks = 0; + }, + _ctor$1 : function(ticks) { + this._ctor$0(); + this._ticks = ticks; + }, + _ctor$2 : function(hours, minutes, seconds) { + this._ctor$0(); + this._ticks = + (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) + + (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) + + (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond); + }, + _ctor$3 : function(days, hours, minutes, seconds) { + this._ctor$0(); + this._ticks = + (days * Sys.Extended.UI.TimeSpan.TicksPerDay) + + (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) + + (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) + + (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond); + }, + _ctor$4 : function(days, hours, minutes, seconds, milliseconds) { + this._ctor$0(); + this._ticks = + (days * Sys.Extended.UI.TimeSpan.TicksPerDay) + + (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) + + (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) + + (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond) + + (milliseconds * Sys.Extended.UI.TimeSpan.TicksPerMillisecond); + }, + + getDays : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerDay); + }, + getHours : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerHour) % 24; + }, + getMinutes : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute) % 60; + }, + getSeconds : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond) % 60; + }, + getMilliseconds : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond) % 1000; + }, + getDuration : function() { + return new Sys.Extended.UI.TimeSpan(Math.abs(this._ticks)); + }, + getTicks : function() { + return this._ticks; + }, + getTotalDays : function() { + Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerDay); + }, + getTotalHours : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerHour); + }, + getTotalMinutes : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute); + }, + getTotalSeconds : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond); + }, + getTotalMilliseconds : function() { + return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond); + }, + add : function(value) { + // Adds the supplied TimeSpan to this TimeSpan + return new Sys.Extended.UI.TimeSpan(this._ticks + value.getTicks()); + }, + subtract : function(value) { + // Subtracts the supplied TimeSpan to this TimeSpan + return new Sys.Extended.UI.TimeSpan(this._ticks - value.getTicks()); + }, + negate : function() { + // Negates the TimeSpan + return new Sys.Extended.UI.TimeSpan(-this._ticks); + }, + equals : function(value) { + // Whether this TimeSpan equals another TimeSpan + return this._ticks == value.getTicks(); + }, + compareTo : function(value) { + // Whether this TimeSpan greater or less than another TimeSpan + if(this._ticks > value.getTicks()) + return 1; + else if(this._ticks < value.getTicks()) + return -1; + else + return 0; + }, + toString : function() { + return this.format("F"); + }, + format : function(format) { + if (!format) { + format = "F"; + } + if (format.length == 1) { + switch (format) { + case "t": format = Sys.Extended.UI.TimeSpan.ShortTimeSpanPattern; break; + case "T": format = Sys.Extended.UI.TimeSpan.LongTimeSpanPattern; break; + case "F": format = Sys.Extended.UI.TimeSpan.FullTimeSpanPattern; break; + default: throw Error.createError(String.format(Sys.Extended.UI.Resources.Common_DateTime_InvalidTimeSpan, format)); + } + } + var regex = /dd|d|hh|h|mm|m|ss|s|nnnn|nnn|nn|n/g; + var builder = new Sys.StringBuilder(); + var ticks = this._ticks; + if (ticks < 0) { + builder.append("-"); + ticks = -ticks; + } + for (;;) { + var index = regex.lastIndex; + var ar = regex.exec(format); + builder.append(format.slice(index, ar ? ar.index : format.length)); + if (!ar) break; + switch (ar[0]) { + case "dd": + case "d": + builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerDay, ar[0].length, '0'))); + break; + case "hh": + case "h": + builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerHour) % 24, ar[0].length, '0')); + break; + case "mm": + case "m": + builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute) % 60, ar[0].length, '0')); + break; + case "ss": + case "s": + builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond) % 60, ar[0].length, '0')); + break; + case "nnnn": + case "nnn": + case "nn": + case "n": + builder.append($common.padRight(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond) % 1000, ar[0].length, '0', true)); + break; + default: + Sys.Debug.assert(false); + } + } + return builder.toString(); + } +} +Sys.Extended.UI.TimeSpan.parse = function(text) { + // Parses a text value into a TimeSpan + var parts = text.split(":"); + var d = 0; + var h = 0; + var m = 0; + var s = 0; + var n = 0; + var ticks = 0; + switch(parts.length) { + case 1: + if (parts[0].indexOf(".") != -1) { + var parts2 = parts[0].split("."); + s = parseInt(parts2[0]); + n = parseInt(parts2[1]); + } else { + ticks = parseInt(parts[0]); + } + break; + case 2: + h = parseInt(parts[0]); + m = parseInt(parts[1]); + break; + case 3: + h = parseInt(parts[0]); + m = parseInt(parts[1]); + if (parts[2].indexOf(".") != -1) { + var parts2 = parts[2].split("."); + s = parseInt(parts2[0]); + n = parseInt(parts2[1]); + } else { + s = parseInt(parts[2]); + } + break; + case 4: + d = parseInt(parts[0]); + h = parseInt(parts[1]); + m = parseInt(parts[2]); + if (parts[3].indexOf(".") != -1) { + var parts2 = parts[3].split("."); + s = parseInt(parts2[0]); + n = parseInt(parts2[1]); + } else { + s = parseInt(parts[3]); + } + break; + } + ticks += (d * Sys.Extended.UI.TimeSpan.TicksPerDay) + + (h * Sys.Extended.UI.TimeSpan.TicksPerHour) + + (m * Sys.Extended.UI.TimeSpan.TicksPerMinute) + + (s * Sys.Extended.UI.TimeSpan.TicksPerSecond) + + (n * Sys.Extended.UI.TimeSpan.TicksPerMillisecond); + if(!isNaN(ticks)) { + return new Sys.Extended.UI.TimeSpan(ticks); + } + throw Error.create(Sys.Extended.UI.Resources.Common_DateTime_InvalidFormat); +} +Sys.Extended.UI.TimeSpan.fromTicks = function(ticks) { + // Creates a TimeSpan for the specified number of ticks + return new Sys.Extended.UI.TimeSpan(ticks); +} +Sys.Extended.UI.TimeSpan.fromDays = function(days) { + // Creates a TimeSpan for the specified number of days + return new Sys.Extended.UI.TimeSpan(days * Sys.Extended.UI.TimeSpan.TicksPerDay); +} +Sys.Extended.UI.TimeSpan.fromHours = function(hours) { + // Creates a TimeSpan for the specified number of hours + return new Sys.Extended.UI.TimeSpan(hours * Sys.Extended.UI.TimeSpan.TicksPerHour); +} +Sys.Extended.UI.TimeSpan.fromMinutes = function(minutes) { + // Creates a TimeSpan for the specified number of minutes + return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute); +} +Sys.Extended.UI.TimeSpan.fromSeconds = function(seconds) { + // Creates a TimeSpan for the specified number of seconds + return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerSecond); +} +Sys.Extended.UI.TimeSpan.fromMilliseconds = function(milliseconds) { + // Creates a TimeSpan for the specified number of milliseconds + return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerMillisecond); +} +Sys.Extended.UI.TimeSpan.TicksPerDay = 864000000000; +Sys.Extended.UI.TimeSpan.TicksPerHour = 36000000000; +Sys.Extended.UI.TimeSpan.TicksPerMinute = 600000000; +Sys.Extended.UI.TimeSpan.TicksPerSecond = 10000000; +Sys.Extended.UI.TimeSpan.TicksPerMillisecond = 10000; +Sys.Extended.UI.TimeSpan.FullTimeSpanPattern = "dd:hh:mm:ss.nnnn"; +Sys.Extended.UI.TimeSpan.ShortTimeSpanPattern = "hh:mm"; +Sys.Extended.UI.TimeSpan.LongTimeSpanPattern = "hh:mm:ss"; + +Date.prototype.getTimeOfDay = function Date$getTimeOfDay() { + // Gets a TimeSpan representing the current time of the Date + return new Sys.Extended.UI.TimeSpan( + 0, + this.getHours(), + this.getMinutes(), + this.getSeconds(), + this.getMilliseconds()); +} +Date.prototype.getDateOnly = function Date$getDateOnly() { + // Gets a Date representing the Date only part of the Date and Adjusts for DST switch at midnight. + var tempDate = new Date(this.getFullYear(), this.getMonth(), this.getDate()); + + if (!((this.getMonth() === tempDate.getMonth()) && (this.getDate() === tempDate.getDate()))) { + + tempDate.setMinutes(120); + + } + + return tempDate; +} +Date.prototype.add = function Date$add(span) { + // Adds a TimeSpan to the current Date + // param "span"is the amount of time to add to the date + + return new Date(this.getTime() + span.getTotalMilliseconds()); +} +Date.prototype.subtract = function Date$subtract(span) { + // Subtracts a TimeSpan to the current Date + // param "span" is the amount of time to subtract from the date + return this.add(span.negate()); +} +Date.prototype.getTicks = function Date$getTicks() { + return this.getTime() * Sys.Extended.UI.TimeSpan.TicksPerMillisecond; +} + +Sys.Extended.UI.FirstDayOfWeek = function() { +} +Sys.Extended.UI.FirstDayOfWeek.prototype = { + Sunday : 0, + Monday : 1, + Tuesday : 2, + Wednesday : 3, + Thursday : 4, + Friday : 5, + Saturday : 6, + Default : 7 +} +Sys.Extended.UI.FirstDayOfWeek.registerEnum("Sys.Extended.UI.FirstDayOfWeek"); + +(function(){ + var D= new Date('2011-06-02T09:34:29+02:00'); + if(!D || +D!== 1307000069000){ + Date.fromISO= function(s){ + var day, tz, + rx=/^(\d{4}\-\d\d\-\d\d([tT ][\d:\.]*)?)([zZ]|([+\-])(\d\d):(\d\d))?$/, + p= rx.exec(s) || []; + if(p[1]){ + day= p[1].split(/\D/); + for(var i= 0, L= day.length; i + + if (!element) { + throw Error.argumentNull('element'); + } + if (!size) { + throw Error.argumentNull('size'); + } + var borderBox = this.getBorderBox(element); + var paddingBox = this.getPaddingBox(element); + var contentSize = { + width: size.width - borderBox.horizontal - paddingBox.horizontal, + height: size.height - borderBox.vertical - paddingBox.vertical + }; + this.setContentSize(element, contentSize); + }, + + getBounds: function(element) { + // Gets the coordinates, width and height of an element. + // Returns a Bounds object with four fields, x, y, width and height, which contain the pixel coordinates, + // width and height of the element. + return Sys.UI.DomElement.getBounds(element); + }, + + setBounds: function(element, bounds) { + // Sets the "border-box" bounds of an element + // The "border-box" is the size of the content area *outside* of the borders and + // padding of an element. The "border-box" size does not include the margins around + // the element. + // "element" - DOM element + // "bounds" - bounds of the element (of the form {x,y,width,height}) + + if (!element) { + throw Error.argumentNull('element'); + } + if (!bounds) { + throw Error.argumentNull('bounds'); + } + this.setSize(element, bounds); + $common.setLocation(element, bounds); + }, + + getClientBounds: function() { + // Gets the width and height of the browser client window (excluding scrollbars) + // Returns browser's client width and height + + var clientWidth; + var clientHeight; + + // getClientBounds must return dimensions excluding scrollbars, so cannot use window.innerWidth and window.innerHeight. + if (document.compatMode == "CSS1Compat") { + // Standards-compliant mode + clientWidth = document.documentElement.clientWidth; + clientHeight = document.documentElement.clientHeight; + } + else { + // Quirks mode + clientWidth = document.body.clientWidth; + clientHeight = document.body.clientHeight; + } + return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight); + }, + + getMarginBox: function(element) { + // Gets the entire margin box sizes. + // "element" - DOM element + // Returns - element's margin box sizes (of the form {top,left,bottom,right,horizontal,vertical}) + + if (!element) { + throw Error.argumentNull('element'); + } + var box = { + top: this.getMargin(element, Sys.Extended.UI.BoxSide.Top), + right: this.getMargin(element, Sys.Extended.UI.BoxSide.Right), + bottom: this.getMargin(element, Sys.Extended.UI.BoxSide.Bottom), + left: this.getMargin(element, Sys.Extended.UI.BoxSide.Left) + }; + box.horizontal = box.left + box.right; + box.vertical = box.top + box.bottom; + return box; + }, + + getBorderBox: function(element) { + // Gets the entire border box sizes. + // Returns element's border box sizes (of the form {top,left,bottom,right,horizontal,vertical}) + // "element" - DOM element + + if (!element) { + throw Error.argumentNull('element'); + } + var box = { + top: this.getBorderWidth(element, Sys.Extended.UI.BoxSide.Top), + right: this.getBorderWidth(element, Sys.Extended.UI.BoxSide.Right), + bottom: this.getBorderWidth(element, Sys.Extended.UI.BoxSide.Bottom), + left: this.getBorderWidth(element, Sys.Extended.UI.BoxSide.Left) + }; + box.horizontal = box.left + box.right; + box.vertical = box.top + box.bottom; + return box; + }, + + getPaddingBox: function(element) { + // Gets the entire padding box sizes. + // Returns element's padding box sizes (of the form {top,left,bottom,right,horizontal,vertical}) + // "element" - DOM element + + if (!element) { + throw Error.argumentNull('element'); + } + var box = { + top: this.getPadding(element, Sys.Extended.UI.BoxSide.Top), + right: this.getPadding(element, Sys.Extended.UI.BoxSide.Right), + bottom: this.getPadding(element, Sys.Extended.UI.BoxSide.Bottom), + left: this.getPadding(element, Sys.Extended.UI.BoxSide.Left) + }; + box.horizontal = box.left + box.right; + box.vertical = box.top + box.bottom; + return box; + }, + + isBorderVisible: function(element, boxSide) { + // Gets whether the current border style for an element on a specific boxSide is not 'none'. + // "element" - DOM element + // "boxSide" - side of the element + + if (!element) { + throw Error.argumentNull('element'); + } + if (boxSide < Sys.Extended.UI.BoxSide.Top || boxSide > Sys.Extended.UI.BoxSide.Left) { + throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'Sys.Extended.UI.BoxSide')); + } + var styleName = this._borderStyleNames[boxSide]; + var styleValue = this.getCurrentStyle(element, styleName); + return styleValue != "none"; + }, + + getMargin: function(element, boxSide) { + // Gets the margin thickness of an element on a specific boxSide. + // "element" - DOM element + // "boxSide" - side of the element + // Returns margin thickness on the element's specified side + + if (!element) { + throw Error.argumentNull('element'); + } + if (boxSide < Sys.Extended.UI.BoxSide.Top || boxSide > Sys.Extended.UI.BoxSide.Left) { + throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'Sys.Extended.UI.BoxSide')); + } + var styleName = this._marginWidthNames[boxSide]; + var styleValue = this.getCurrentStyle(element, styleName); + try { return this.parsePadding(styleValue); } catch (ex) { return 0; } + }, + + getBorderWidth: function(element, boxSide) { + // Gets the border thickness of an element on a specific boxSide. + // "element" - DOM element + // "boxSide" - side of the element + + if (!element) { + throw Error.argumentNull('element'); + } + if (boxSide < Sys.Extended.UI.BoxSide.Top || boxSide > Sys.Extended.UI.BoxSide.Left) { + throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'Sys.Extended.UI.BoxSide')); + } + if (!this.isBorderVisible(element, boxSide)) { + return 0; + } + var styleName = this._borderWidthNames[boxSide]; + var styleValue = this.getCurrentStyle(element, styleName); + return this.parseBorderWidth(styleValue); + }, + + getPadding: function(element, boxSide) { + // Gets the padding thickness of an element on a specific boxSide. + // "element" - DOM element + // "boxSide" - side of the element + + if (!element) { + throw Error.argumentNull('element'); + } + if (boxSide < Sys.Extended.UI.BoxSide.Top || boxSide > Sys.Extended.UI.BoxSide.Left) { + throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'Sys.Extended.UI.BoxSide')); + } + var styleName = this._paddingWidthNames[boxSide]; + var styleValue = this.getCurrentStyle(element, styleName); + return this.parsePadding(styleValue); + }, + + parseBorderWidth: function(borderWidth) { + // Parses a border-width string into a pixel size + // Returns number of pixels in the border-width + // "borderWidth" - type of border ('thin','medium','thick','inherit',px unit,null,'') + + if (!this._borderThicknesses) { + + // Populate the borderThicknesses lookup table + var borderThicknesses = {}; + var div0 = document.createElement('div'); + div0.style.visibility = 'hidden'; + div0.style.position = 'absolute'; + div0.style.fontSize = '1px'; + document.body.appendChild(div0) + var div1 = document.createElement('div'); + div1.style.height = '0px'; + div1.style.overflow = 'hidden'; + div0.appendChild(div1); + var base = div0.offsetHeight; + div1.style.borderTop = 'solid black'; + div1.style.borderTopWidth = 'thin'; + borderThicknesses['thin'] = div0.offsetHeight - base; + div1.style.borderTopWidth = 'medium'; + borderThicknesses['medium'] = div0.offsetHeight - base; + div1.style.borderTopWidth = 'thick'; + borderThicknesses['thick'] = div0.offsetHeight - base; + div0.removeChild(div1); + document.body.removeChild(div0); + this._borderThicknesses = borderThicknesses; + } + + if (borderWidth) { + switch (borderWidth) { + case 'thin': + case 'medium': + case 'thick': + return this._borderThicknesses[borderWidth]; + case 'inherit': + return 0; + } + var unit = this.parseUnit(borderWidth); + Sys.Debug.assert(unit.type == 'px', String.format(Sys.Extended.UI.Resources.Common_InvalidBorderWidthUnit, unit.type)); + return unit.size; + } + return 0; + }, + + parsePadding: function(padding) { + // Parses a padding string into a pixel size + // "padding" - padding to parse ('inherit',px unit,null,'') + // Returns number of pixels in the padding + + if (padding) { + if (padding == 'inherit') { + return 0; + } + var unit = this.parseUnit(padding); + if (unit.type !== 'px') { + Sys.Debug.fail(String.format(Sys.Extended.UI.Resources.Common_InvalidPaddingUnit, unit.type)); + } + return unit.size; + } + return 0; + }, + + parseUnit: function(value) { + // Parses a unit string into a unit object + // Returns parsed unit (of the form {size,type}) + // "value" - value to parse (of the form px unit,% unit,em unit,...) + + if (!value) { + throw Error.argumentNull('value'); + } + + value = value.trim().toLowerCase(); + var l = value.length; + var s = -1; + for (var i = 0; i < l; i++) { + var ch = value.substr(i, 1); + if ((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') { + break; + } + s = i; + } + if (s == -1) { + throw Error.create(Sys.Extended.UI.Resources.Common_UnitHasNoDigits); + } + var type; + var size; + if (s < (l - 1)) { + type = value.substring(s + 1).trim(); + } else { + type = 'px'; + } + size = parseFloat(value.substr(0, s + 1)); + if (type == 'px') { + size = Math.floor(size); + } + return { + size: size, + type: type + }; + }, + + getElementOpacity: function(element) { + // Get the element's opacity + // "element" - element + + if (!element) { + throw Error.argumentNull('element'); + } + + var hasOpacity = false; + var opacity; + + if (element.filters) { + var filters = element.filters; + if (filters.length !== 0) { + var alphaFilter = filters['DXImageTransform.Microsoft.Alpha']; + if (alphaFilter) { + opacity = alphaFilter.opacity / 100.0; + hasOpacity = true; + } + } + } + else { + opacity = this.getCurrentStyle(element, 'opacity', 1); + hasOpacity = true; + } + + if (hasOpacity === false) { + return 1.0; + } + return parseFloat(opacity); + }, + + setElementOpacity: function(element, value) { + // Set the element's opacity + // "element" - element + // "value" - opacity of the element + + if (!element) { + throw Error.argumentNull('element'); + } + + if (element.filters) { + var filters = element.filters; + var createFilter = true; + if (filters.length !== 0) { + var alphaFilter = filters['DXImageTransform.Microsoft.Alpha']; + if (alphaFilter) { + createFilter = false; + alphaFilter.opacity = value * 100; + } + } + if (createFilter) { + element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')'; + } + } + else { + element.style.opacity = value; + } + }, + + getVisible: function(element) { + // Check if an element is visible + // Returns true if the element is visible, false otherwise + // element"- element + // Note: reference to CommonToolkitScripts must be left intact (i.e. don't + // replace with 'this') because this function will be aliased + + return (element && + ("none" != $common.getCurrentStyle(element, "display")) && + ("hidden" != $common.getCurrentStyle(element, "visibility"))); + }, + + setVisible: function(element, value) { + // Check if an element is visible + // "element" - element + // "value" - true to make the element visible, false to hide it + // Note: reference to CommonToolkitScripts must be left intact (i.e. don't + // replace with 'this') because this function will be aliased + + if (element) { + if (value) { + if (element.style.removeAttribute) { + element.style.removeAttribute("display"); + } else { + element.style.removeProperty("display"); + } + } else { + element.style.display = 'none'; + } + element.style.visibility = value ? 'visible' : 'hidden'; + } + }, + + resolveFunction: function(value) { + // Returns a function reference that corresponds to the provided value + // Returns reference to the function, or null if not found + // "value" - the value can either be a Function, the name of a function (that can be found using window['name']), + // or an expression that evaluates to a function. + + if (value) { + if (value instanceof Function) { + return value; + } else if (String.isInstanceOfType(value) && value.length > 0) { + var func; + if ((func = window[value]) instanceof Function) { + return func; + } else if ((func = eval(value)) instanceof Function) { + return func; + } + } + } + return null; + }, + + addCssClasses: function(element, classNames) { + // Adds multiple css classes to a DomElement + // "element"- the element to modify + // "classNames" - the class names to add + + for (var i = 0; i < classNames.length; i++) { + Sys.UI.DomElement.addCssClass(element, classNames[i]); + } + }, + removeCssClasses: function(element, classNames) { + // Removes multiple css classes to a DomElement + // "element" - the element to modify + // "classNames" - the class names to remove + + for (var i = 0; i < classNames.length; i++) { + Sys.UI.DomElement.removeCssClass(element, classNames[i]); + } + }, + setStyle: function(element, style) { + // Sets the style of the element using the supplied style template object + // "element" - the element to modify + // "style" - the template + + $common.applyProperties(element.style, style); + }, + removeHandlers: function(element, events) { + // Removes a set of event handlers from an element + // This is NOT the same as $clearHandlers which removes all delegates from a DomElement. This rather removes select delegates + // from a specified element and has a matching signature as $addHandlers + // "element" - the element to modify + // "events" - the template object that contains event names and delegates + + for (var name in events) { + $removeHandler(element, name, events[name]); + } + }, + + overlaps: function(r1, r2) { + // Determine if two rectangles overlap + // "r1" - rectangle + // "r2" - rectangle + // Returns true if the rectangles overlap, false otherwise + + return r1.x < (r2.x + r2.width) + && r2.x < (r1.x + r1.width) + && r1.y < (r2.y + r2.height) + && r2.y < (r1.y + r1.height); + }, + + containsPoint: function(rect, x, y) { + // Tests whether a point (x,y) is contained within a rectangle + // "rect" - the rectangle + // "x" - the x coordinate of the point + // "y" - the y coordinate of the point + + return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height); + }, + + isKeyDigit: function(keyCode) { + // Gets whether the supplied key-code is a digit + // "keyCode" - the key code of the event (from Sys.UI.DomEvent) + + return (0x30 <= keyCode && keyCode <= 0x39); + }, + + isKeyNavigation: function(keyCode) { + // Gets whether the supplied key-code is a navigation key + // "keyCode" - the key code of the event (from Sys.UI.DomEvent) + + return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down); + }, + + padLeft: function(text, size, ch, truncate) { + // Pads the left hand side of the supplied text with the specified pad character up to the requested size + // "text" - the text to pad + // "size" - the size to pad the text (default is 2) + // "ch" - the single character to use as the pad character (default is ' ') + // "truncate" - whether to truncate the text to size (default is false) + + return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false); + }, + + padRight: function(text, size, ch, truncate) { + // Pads the right hand side of the supplied text with the specified pad character up to the requested size + // "text" - the text to pad + // "size" - the size to pad the text (default is 2) + // "ch" - the single character to use as the pad character (default is ' ') + // "truncate" - whether to truncate the text to size (default is false) + + return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false); + }, + + _pad: function(text, size, ch, side, truncate) { + // Pads supplied text with the specified pad character up to the requested size + // "text" - the text to pad< + // "size" - the size to pad the text + // "ch" - the single character to use as the pad character + // "side" - either 'l' or 'r' to siginfy whether to pad the Left or Right side respectively + // "truncate" - whether to truncate the text to size + + text = text.toString(); + var length = text.length; + var builder = new Sys.StringBuilder(); + if (side == 'r') { + builder.append(text); + } + while (length < size) { + builder.append(ch); + length++; + } + if (side == 'l') { + builder.append(text); + } + var result = builder.toString(); + if (truncate && result.length > size) { + if (side == 'l') { + result = result.substr(result.length - size, size); + } else { + result = result.substr(0, size); + } + } + return result; + }, + + __DOMEvents: { + focusin: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focusin", true, false, window, 1); } }, + focusout: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focusout", true, false, window, 1); } }, + activate: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("activate", true, true, window, 1); } }, + focus: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focus", false, false, window, 1); } }, + blur: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("blur", false, false, window, 1); } }, + click: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + dblclick: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + mousedown: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + mouseup: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + mouseover: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + mousemove: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + mouseout: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } }, + load: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("load", false, false); } }, + unload: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("unload", false, false); } }, + select: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("select", true, false); } }, + change: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("change", true, false); } }, + submit: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("submit", true, true); } }, + reset: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("reset", true, false); } }, + resize: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("resize", true, false); } }, + scroll: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("scroll", true, false); } } + }, + + tryFireRawEvent: function(element, rawEvent) { + // Attempts to fire a raw DOM event on an element + // Returns true if the event was successfully fired, otherwise false + // "element" - the element to fire the event + // "rawEvent" - the raw DOM event object to fire. Must not be Sys.UI.DomEvent + + try { + if (element.fireEvent) { + element.fireEvent("on" + rawEvent.type, rawEvent); + return true; + } else if (element.dispatchEvent) { + element.dispatchEvent(rawEvent); + return true; + } + } catch (e) { + } + return false; + }, + + tryFireEvent: function(element, eventName, properties) { + // Attempts to fire a DOM event on an element + // Returns true if the event was successfully fired, otherwise false< + // "element" - the element to fire the event + // "eventName" - the name of the event to fire (without an 'on' prefix) + // "properties"- properties to add to the event + + try { + if (document.createEventObject) { + var e = document.createEventObject(); + $common.applyProperties(e, properties || {}); + element.fireEvent("on" + eventName, e); + return true; + } else if (document.createEvent) { + var def = $common.__DOMEvents[eventName]; + if (def) { + var e = document.createEvent(def.eventGroup); + def.init(e, properties || {}); + element.dispatchEvent(e); + return true; + } + } + } catch (e) { + } + return false; + }, + + wrapElement: function(innerElement, newOuterElement, newInnerParentElement) { + // Wraps an inner element with a new outer element at the same DOM location as the inner element + // "innerElement" - the element to be wrapped + // "newOuterElement" - the new parent for the element + + var parent = innerElement.parentNode; + parent.replaceChild(newOuterElement, innerElement); + (newInnerParentElement || newOuterElement).appendChild(innerElement); + }, + + unwrapElement: function(innerElement, oldOuterElement) { + // Unwraps an inner element from an outer element at the same DOM location as the outer element + // "innerElement" - the element to be wrapped + // "newOuterElement" - the new parent for the element + + var parent = oldOuterElement.parentNode; + if (parent != null) { + $common.removeElement(innerElement); + parent.replaceChild(innerElement, oldOuterElement); + } + }, + + removeElement: function(element) { + // Removes an element from the DOM tree + // "element" - the element to be removed + + var parent = element.parentNode; + if (parent != null) { + parent.removeChild(element); + } + }, + + applyProperties: function(target, properties) { + // Quick utility method to copy properties from a template object to a target object + // "target" - the object to apply to + // "properties" - the template to copy values from< + + for (var p in properties) { + var pv = properties[p]; + if (pv != null && Object.getType(pv) === Object) { + var tv = target[p]; + $common.applyProperties(tv, pv); + } else { + target[p] = pv; + } + } + }, + + createElementFromTemplate: function(template, appendToParent, nameTable) { + // Creates an element for the current document based on a template object + // "template" - the template from which to create the element + // "appendToParent" - a DomElement under which to append this element + // "nameTable" - an object to use as the storage for the element using template.name as the key + // This method is useful if you find yourself using the same or similar DomElement constructions throughout a class. You can even set the templates + // as static properties for a type to cut down on overhead. This method is often called with a JSON style template: + // + // var elt = $common.createElementFromTemplate({ + // nodeName : "div", + // properties : { + // style : { + // height : "100px", + // width : "100px", + // backgroundColor : "white" + // }, + // expandoAttribute : "foo" + // }, + // events : { + // click : function() { alert("foo"); }, + // mouseover : function() { elt.backgroundColor = "silver"; }, + // mouseout : function() { elt.backgroundColor = "white"; } + // }, + // cssClasses : [ "class0", "class1" ], + // visible : true, + // opacity : .5 + // }, someParent); + // + + // if we wish to override the name table we do so here + if (typeof (template.nameTable) != 'undefined') { + var newNameTable = template.nameTable; + if (String.isInstanceOfType(newNameTable)) { + newNameTable = nameTable[newNameTable]; + } + if (newNameTable != null) { + nameTable = newNameTable; + } + } + + // get a name for the element in the nameTable + var elementName = null; + if (typeof (template.name) !== 'undefined') { + elementName = template.name; + } + + // create or acquire the element + var elt = document.createElement(template.nodeName); + + // if our element is named, add it to the name table + if (typeof (template.name) !== 'undefined' && nameTable) { + nameTable[template.name] = elt; + } + + // if we wish to supply a default parent we do so here + if (typeof (template.parent) !== 'undefined' && appendToParent == null) { + var newParent = template.parent; + if (String.isInstanceOfType(newParent)) { + newParent = nameTable[newParent]; + } + if (newParent != null) { + appendToParent = newParent; + } + } + + // properties are applied as expando values to the element + if (typeof (template.properties) !== 'undefined' && template.properties != null) { + $common.applyProperties(elt, template.properties); + } + + // css classes are added to the element's className property + if (typeof (template.cssClasses) !== 'undefined' && template.cssClasses != null) { + $common.addCssClasses(elt, template.cssClasses); + } + + // events are added to the dom element using $addHandlers + if (typeof (template.events) !== 'undefined' && template.events != null) { + $addHandlers(elt, template.events); + } + + // if the element is visible or not its visibility is set + if (typeof (template.visible) !== 'undefined' && template.visible != null) { + this.setVisible(elt, template.visible); + } + + // if we have an appendToParent we will now append to it + if (appendToParent) { + appendToParent.appendChild(elt); + } + + // if we have opacity, apply it + if (typeof (template.opacity) !== 'undefined' && template.opacity != null) { + $common.setElementOpacity(elt, template.opacity); + } + + // if we have child templates, process them + if (typeof (template.children) !== 'undefined' && template.children != null) { + for (var i = 0; i < template.children.length; i++) { + var subtemplate = template.children[i]; + $common.createElementFromTemplate(subtemplate, elt, nameTable); + } + } + + // if we have a content presenter for the element get it (the element itself is the default presenter for content) + var contentPresenter = elt; + if (typeof (template.contentPresenter) !== 'undefined' && template.contentPresenter != null) { + contentPresenter = nameTable[contentPresenter]; + } + + // if we have content, add it + if (typeof (template.content) !== 'undefined' && template.content != null) { + var content = template.content; + if (String.isInstanceOfType(content)) { + content = nameTable[content]; + } + if (content.parentNode) { + $common.wrapElement(content, elt, contentPresenter); + } else { + contentPresenter.appendChild(content); + } + } + + // return the created element + return elt; + }, + + prepareHiddenElementForATDeviceUpdate: function() { + // JAWS, an Assistive Technology device responds to updates to form elements + // and refreshes its document buffer to what is showing live + // in the browser. To ensure that Toolkit controls that make XmlHttpRequests to + // retrieve content are useful to users with visual disabilities, we update a + // hidden form element to ensure that JAWS conveys what is in + // the browser. See this article for more details: + // http://juicystudio.com/article/improving-ajax-applications-for-jaws-users.php + // This method creates a hidden input on the screen for any page that uses a Toolkit + // control that will perform an XmlHttpRequest. + var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts'); + if (!objHidden) { + var objHidden = document.createElement('input'); + objHidden.setAttribute('type', 'hidden'); + objHidden.setAttribute('value', '1'); + objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts'); + objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts'); + if (document.forms[0]) { + document.forms[0].appendChild(objHidden); + } + } + }, + + updateFormToRefreshATDeviceBuffer: function() { + // Updates the hidden buffer to ensure that the latest document stream is picked up + // by the screen reader. + var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts'); + + if (objHidden) { + if (objHidden.getAttribute('value') == '1') { + objHidden.setAttribute('value', '0'); + } else { + objHidden.setAttribute('value', '1'); + } + } + }, + + appendElementToFormOrBody: function(element) { + // Tries to append an element to the current form. If no form exists, the element will be appended to the body element. + // "element" - the element to append. + if (document.forms && document.forms[0]) { + document.forms[0].appendChild(element); + } else { + document.body.appendChild(element); + } + }, + + setText: function (element, text) { + if (document.all) + element.innerText = text; + else + element.textContent = text; + } +} + +// Create the singleton instance of the CommonToolkitScripts +CommonToolkitScripts = Sys.Extended.UI.CommonToolkitScripts = new Sys.Extended.UI._CommonToolkitScripts(); +$common = CommonToolkitScripts; + +// Alias functions that were moved from BlockingScripts into Common +Sys.UI.DomElement.getVisible = $common.getVisible; +Sys.UI.DomElement.setVisible = $common.setVisible; +Sys.UI.Control.overlaps = $common.overlaps; + +Sys.Extended.UI._DomUtility = function() { + // Utility functions for manipulating the DOM +} +Sys.Extended.UI._DomUtility.prototype = { + isDescendant : function(ancestor, descendant) { + // Whether the specified element is a descendant of the ancestor + // "ancestor" - ancestor node + // "descendant" - possible descendant node + + for (var n = descendant.parentNode; n != null; n = n.parentNode) { + if (n == ancestor) return true; + } + return false; + }, + isDescendantOrSelf : function(ancestor, descendant) { + // Whether the specified element is a descendant of the ancestor or the same as the ancestor + // "ancestor" - ancestor node + // "descendant" - possible descendant node + + if (ancestor === descendant) + return true; + return Sys.Extended.UI.DomUtility.isDescendant(ancestor, descendant); + }, + isAncestor : function(descendant, ancestor) { + // Whether the specified element is an ancestor of the descendant + // "descendant" - descendant node + // "ancestor" - possible ancestor node + + return Sys.Extended.UI.DomUtility.isDescendant(ancestor, descendant); + }, + isAncestorOrSelf : function(descendant, ancestor) { + // Whether the specified element is an ancestor of the descendant or the same as the descendant + // "descendant" - descendant node + // "ancestor" - possible ancestor node + + if (descendant === ancestor) + return true; + + return Sys.Extended.UI.DomUtility.isDescendant(ancestor, descendant); + }, + isSibling : function(self, sibling) { + // Whether the specified element is a sibling of the self element + // "self" - self node + // "sibling" - possible sibling node + + var parent = self.parentNode; + for (var i = 0; i < parent.childNodes.length; i++) { + if (parent.childNodes[i] == sibling) return true; + } + return false; + } +} +Sys.Extended.UI._DomUtility.registerClass("Sys.Extended.UI._DomUtility"); +Sys.Extended.UI.DomUtility = new Sys.Extended.UI._DomUtility(); + + +Sys.Extended.UI.TextBoxWrapper = function(element) { + // Class that wraps a TextBox (INPUT type="text") to abstract-out the + // presence of a watermark (which may be visible to the user but which + // should never be read by script. + // "element" - the DOM element the behavior is associated with + Sys.Extended.UI.TextBoxWrapper.initializeBase(this, [element]); + this._current = element.value; + this._watermark = null; + this._isWatermarked = false; +} + +Sys.Extended.UI.TextBoxWrapper.prototype = { + + dispose : function() { + this.get_element().TextBoxWrapper = null; + Sys.Extended.UI.TextBoxWrapper.callBaseMethod(this, 'dispose'); + }, + + get_Current : function() { + // Current value actually in the TextBox (i.e., TextBox.value) + this._current = this.get_element().value; + return this._current; + }, + set_Current : function(value) { + this._current = value; + this._updateElement(); + }, + + get_Value : function() { + // Conceptual "value" of the TextBox - its contents if no watermark is present + // or "" if one is + if (this.get_IsWatermarked()) { + return ""; + } else { + return this.get_Current(); + } + }, + set_Value : function(text) { + this.set_Current(text); + if (!text || (0 == text.length)) { + if (null != this._watermark) { + this.set_IsWatermarked(true); + } + } else { + this.set_IsWatermarked(false); + } + }, + + get_Watermark : function() { + // Text of the watermark for the TextBox + return this._watermark; + }, + set_Watermark : function(value) { + this._watermark = value; + this._updateElement(); + }, + + get_IsWatermarked : function() { + // true iff the TextBox is watermarked + return this._isWatermarked; + }, + set_IsWatermarked : function(isWatermarked) { + if (this._isWatermarked != isWatermarked) { + this._isWatermarked = isWatermarked; + this._updateElement(); + this._raiseWatermarkChanged(); + } + }, + + _updateElement : function() { + // Updates the actual contents of the TextBox according to what should be there + var element = this.get_element(); + if (this._isWatermarked) { + if (element.value != this._watermark) { + element.value = this._watermark; + } + } else { + if (element.value != this._current) { + element.value = this._current; + } + } + }, + + add_WatermarkChanged : function(handler) { + // Adds a handler for the WatermarkChanged event + // "handler" - handler + this.get_events().addHandler("WatermarkChanged", handler); + }, + remove_WatermarkChanged : function(handler) { + // Removes a handler for the WatermarkChanged event + // "handler" - handler + this.get_events().removeHandler("WatermarkChanged", handler); + }, + _raiseWatermarkChanged : function() { + // Raises the WatermarkChanged event + var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged"); + if (onWatermarkChangedHandler) { + onWatermarkChangedHandler(this, Sys.EventArgs.Empty); + } + } +} +Sys.Extended.UI.TextBoxWrapper.get_Wrapper = function(element) { + // Gets (creating one if necessary) the TextBoxWrapper for the specified TextBox + // Returns - TextBoxWrapper instance + // "element" - textBox for which to get the wrapper + + if (null == element.TextBoxWrapper) { + element.TextBoxWrapper = new Sys.Extended.UI.TextBoxWrapper(element); + } + return element.TextBoxWrapper; +} +Sys.Extended.UI.TextBoxWrapper.registerClass('Sys.Extended.UI.TextBoxWrapper', Sys.UI.Behavior); + +Sys.Extended.UI.TextBoxWrapper.validatorGetValue = function(id) { + // Wrapper for ASP.NET's validatorGetValue to return the value from the wrapper if present + // Returns value from the wrapper or result of original ValidatorGetValue + // "id" - id of the element + + var control = $get(id); + if (control && control.TextBoxWrapper) { + return control.TextBoxWrapper.get_Value(); + } + return Sys.Extended.UI.TextBoxWrapper._originalValidatorGetValue(id); +} + +// Wrap ASP.NET's ValidatorGetValue with Sys.Extended.UI.TextBoxWrapper.validatorGetValue +// to make validators work properly with watermarked TextBoxes +if (typeof(ValidatorGetValue) == 'function') { + Sys.Extended.UI.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue; + ValidatorGetValue = Sys.Extended.UI.TextBoxWrapper.validatorGetValue; +} + + +// Temporary fix null reference bug in Sys.CultureInfo._getAbbrMonthIndex +if (Sys.CultureInfo && Sys.CultureInfo.prototype._getAbbrMonthIndex) { + Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { + if (!this._upperAbbrMonths) { + this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); + } + return Array.indexOf(this._upperAbbrMonths, this._toUpper(value)); + } + Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex; + Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex; +} + +Sys.Extended.UI.ScrollBars = function () { throw Error.invalidOperation(); } +Sys.Extended.UI.ScrollBars.prototype = { + None: 0x00, + Horizontal: 0x01, + Vertical: 0x02, + Both: 0x03, + Auto: 0x04 +} +Sys.Extended.UI.ScrollBars.registerEnum("Sys.Extended.UI.ScrollBars", false); + +var isUnminified = /param/.test(function(param) {}); + +Sys.Extended.Deprecated = function (oldMethodName, properMethodName) { + if (isUnminified && console && console.warn) + if(arguments.length == 1) + console.warn(oldMethodName + " is deprecated."); + else + console.warn(oldMethodName + " is deprecated. Use " + properMethodName + " instead."); + } + +Sys.Extended.UI.zIndex = function() {}; +Sys.Extended.UI.zIndex.BubbleChartTooltip = 10000; +Sys.Extended.UI.zIndex.ComboBoxList = 10000; +Sys.Extended.UI.zIndex.DropWatcherDragVisual= 99999; +Sys.Extended.UI.zIndex.LineChartTooltip= 10000; +Sys.Extended.UI.zIndex.MaskedEditDivTip = 99999; +Sys.Extended.UI.zIndex.ModalPopupBackground = 10000; +Sys.Extended.UI.zIndex.PasswordStrengthTextDisplay = 10001; +Sys.Extended.UI.zIndex.Popup = 1000; +Sys.Extended.UI.zIndex.SeadragonContainer = 99999999; +Sys.Extended.UI.zIndex.SliderDragHandle = 999; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.DragDrop.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.DragDrop.debug.js new file mode 100644 index 000000000..f016ab7ad --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.DragDrop.debug.js @@ -0,0 +1,833 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.IDragSource = function() { +} + +Sys.Extended.UI.IDragSource.prototype = { + // Type get_dragDataType() + get_dragDataType: function() { throw Error.notImplemented(); }, + + // Object getDragData(Context) + getDragData: function() { throw Error.notImplemented(); }, + + // DragMode get_dragMode() + get_dragMode: function() { throw Error.notImplemented(); }, + + // void onDragStart() + onDragStart: function() { throw Error.notImplemented(); }, + + // void onDrag() + onDrag: function() { throw Error.notImplemented(); }, + + // void onDragEnd(Cancelled) + onDragEnd: function() { throw Error.notImplemented(); } +} + +Sys.Extended.UI.IDragSource.registerInterface('Sys.Extended.UI.IDragSource'); + +Sys.Extended.UI.IDropTarget = function() { +} + +Sys.Extended.UI.IDropTarget.prototype = { + get_dropTargetElement: function() { throw Error.notImplemented(); }, + // bool canDrop(DragMode, DataType, Data) + canDrop: function() { throw Error.notImplemented(); }, + + // void drop(DragMode, DataType, Data) + drop: function() { throw Error.notImplemented(); }, + + // void onDragEnterTarget(DragMode, DataType, Data) + onDragEnterTarget: function() { throw Error.notImplemented(); }, + + // void onDragLeaveTarget(DragMode, DataType, Data) + onDragLeaveTarget: function() { throw Error.notImplemented(); }, + + // void onDragInTarget(DragMode, DataType, Data) + onDragInTarget: function() { throw Error.notImplemented(); } +} + +Sys.Extended.UI.IDropTarget.registerInterface('Sys.Extended.UI.IDropTarget'); + +Sys.Extended.UI.DragMode = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.DragMode.prototype = { + Copy: 0, + Move: 1 +} + +Sys.Extended.UI.DragMode.registerEnum('Sys.Extended.UI.DragMode'); + +Sys.Extended.UI.DragDropEventArgs = function(dragMode, dragDataType, dragData) { + this._dragMode = dragMode; + this._dataType = dragDataType; + this._data = dragData; +} + +Sys.Extended.UI.DragDropEventArgs.prototype = { + get_dragMode: function() { + return this._dragMode || null; + }, + + get_dragDataType: function() { + return this._dataType || null; + }, + + get_dragData: function() { + return this._data || null; + } +} + +Sys.Extended.UI.DragDropEventArgs.registerClass('Sys.Extended.UI.DragDropEventArgs'); + +Sys.Extended.UI._DragDropManager = function() { + this._instance = null; + this._events = null; +} + +Sys.Extended.UI._DragDropManager.prototype = { + add_dragStart: function(handler) { + this.get_events().addHandler('dragStart', handler); + }, + + remove_dragStart: function(handler) { + this.get_events().removeHandler('dragStart', handler); + }, + + get_events: function() { + if(!this._events) + this._events = new Sys.EventHandlerList(); + + return this._events; + }, + + add_dragStop: function(handler) { + this.get_events().addHandler('dragStop', handler); + }, + + remove_dragStop: function(handler) { + this.get_events().removeHandler('dragStop', handler); + }, + + _getInstance: function() { + if(!this._instance) { + if(Sys.Browser.agent === Sys.Browser.InternetExplorer) + this._instance = new Sys.Extended.UI.IEDragDropManager(); + else + this._instance = new Sys.Extended.UI.GenericDragDropManager(); + + this._instance.initialize(); + this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart)); + this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop)); + } + + return this._instance; + }, + + startDragDrop: function(dragSource, dragVisual, context, useBuiltInDragAndDropFunctions) { + this._getInstance().startDragDrop(dragSource, dragVisual, context, useBuiltInDragAndDropFunctions); + }, + + registerDropTarget: function(target) { + this._getInstance().registerDropTarget(target); + }, + + unregisterDropTarget: function(target) { + this._getInstance().unregisterDropTarget(target); + }, + + dispose: function() { + delete this._events; + + Sys.Application.unregisterDisposableObject(this); + Sys.Application.removeComponent(this); + }, + + _raiseDragStart: function(sender, eventArgs) { + var handler = this.get_events().getHandler('dragStart'); + if(handler) + handler(this, eventArgs); + }, + + _raiseDragStop: function(sender, eventArgs) { + var handler = this.get_events().getHandler('dragStop'); + if(handler) + handler(this, eventArgs); + } +} + +Sys.Extended.UI._DragDropManager.registerClass('Sys.Extended.UI._DragDropManager'); +Sys.Extended.UI.DragDropManager = new Sys.Extended.UI._DragDropManager(); + +Sys.Extended.UI.IEDragDropManager = function() { + Sys.Extended.UI.IEDragDropManager.initializeBase(this); + + this._dropTargets = null; + // Radius of the cursor used to determine what drop target we + // are hovering. Anything below the cursor's zone may be a + // potential drop target. + this._radius = 10; + this._useBuiltInDragAndDropFunctions = true; + this._activeDragVisual = null; + this._activeContext = null; + this._activeDragSource = null; + this._underlyingTarget = null; + this._oldOffset = null; + this._potentialTarget = null; + this._isDragging = false; + this._mouseUpHandler = null; + this._documentMouseMoveHandler = null; + this._documentDragOverHandler = null; + this._dragStartHandler = null; + this._mouseMoveHandler = null; + this._dragEnterHandler = null; + this._dragLeaveHandler = null; + this._dragOverHandler = null; + this._dropHandler = null; +} + +Sys.Extended.UI.IEDragDropManager.prototype = { + + add_dragStart: function(handler) { + this.get_events().addHandler("dragStart", handler); + }, + + remove_dragStart: function(handler) { + this.get_events().removeHandler("dragStart", handler); + }, + + add_dragStop: function(handler) { + this.get_events().addHandler("dragStop", handler); + }, + + remove_dragStop: function(handler) { + this.get_events().removeHandler("dragStop", handler); + }, + + initialize: function() { + Sys.Extended.UI.IEDragDropManager.callBaseMethod(this, 'initialize'); + + this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp); + this._documentMouseMoveHandler = Function.createDelegate(this, this._onDocumentMouseMove); + this._documentDragOverHandler = Function.createDelegate(this, this._onDocumentDragOver); + this._dragStartHandler = Function.createDelegate(this, this._onDragStart); + this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove); + this._dragEnterHandler = Function.createDelegate(this, this._onDragEnter); + this._dragLeaveHandler = Function.createDelegate(this, this._onDragLeave); + this._dragOverHandler = Function.createDelegate(this, this._onDragOver); + this._dropHandler = Function.createDelegate(this, this._onDrop); + }, + + dispose: function() { + if(this._dropTargets) { + for(var i = 0; i < this._dropTargets; i++) + this.unregisterDropTarget(this._dropTargets[i]); + + this._dropTargets = null; + } + + Sys.Extended.UI.IEDragDropManager.callBaseMethod(this, 'dispose'); + }, + + + startDragDrop: function(dragSource, dragVisual, context, useBuiltInDragAndDropFunctions) { + var ev = window._event; + + // Don't allow drag and drop if there is another active drag operation going on. + if(this._isDragging) + return; + + this._underlyingTarget = null; + this._activeDragSource = dragSource; + this._activeDragVisual = dragVisual; + this._activeContext = context; + this._useBuiltInDragAndDropFunctions = typeof (useBuiltInDragAndDropFunctions) != 'undefined' ? useBuiltInDragAndDropFunctions : true; + + var mousePosition = { x: ev.clientX, y: ev.clientY }; + + // By default we use absolute positioning, unless a different type + // of positioning is set explicitly. + dragVisual.originalPosition = dragVisual.style.position; + dragVisual.style.position = "absolute"; + + document._lastPosition = mousePosition; + dragVisual.startingPoint = mousePosition; + var scrollOffset = this.getScrollOffset(dragVisual, /* recursive */true); + + dragVisual.startingPoint = this.addPoints(dragVisual.startingPoint, scrollOffset); + + var left = parseInt(dragVisual.style.left), + top = parseInt(dragVisual.style.top); + + if(isNaN(left)) + left = "0"; + if(isNaN(top)) + top = "0"; + + dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, { x: left, y: top }); + + // Monitor DOM changes. + this._prepareForDomChanges(); + dragSource.onDragStart(); + + var eventArgs = new Sys.Extended.UI.DragDropEventArgs( + dragSource.get_dragMode(), + dragSource.get_dragDataType(), + dragSource.getDragData(context)); + + var handler = this.get_events().getHandler('dragStart'); + if(handler) + handler(this, eventArgs); + + this._recoverFromDomChanges(); + this._wireEvents(); + this._drag(/* isInitialDrag */true); + }, + + _stopDragDrop: function(cancelled) { + var ev = window._event; + if(this._activeDragSource != null) { + this._unwireEvents(); + + if(!cancelled) + // The drag operation is cancelled if there + // is no drop target. + cancelled = (this._underlyingTarget == null); + + if(!cancelled && this._underlyingTarget != null) + this._underlyingTarget.drop(this._activeDragSource.get_dragMode(), this._activeDragSource.get_dragDataType(), this._activeDragSource.getDragData(this._activeContext)); + + this._activeDragSource.onDragEnd(cancelled); + var handler = this.get_events().getHandler('dragStop'); + if(handler) + handler(this, Sys.EventArgs.Empty); + + this._activeDragVisual.style.position = this._activeDragVisual.originalPosition; + this._activeDragSource = null; + this._activeContext = null; + this._activeDragVisual = null; + this._isDragging = false; + this._potentialTarget = null; + + ev.preventDefault(); + } + }, + + _drag: function(isInitialDrag) { + var ev = window._event, + mousePosition = { x: ev.clientX, y: ev.clientY }; + + // NOTE: We store the event object to be able to determine the current + // mouse position in Mozilla in other event handlers such as keydown. + document._lastPosition = mousePosition; + + var scrollOffset = this.getScrollOffset(this._activeDragVisual, /* recursive */true), + position = this.addPoints(this.subtractPoints(mousePosition, this._activeDragVisual.startingPoint), scrollOffset); + + // Check if the visual moved at all. + if(!isInitialDrag && parseInt(this._activeDragVisual.style.left) == position.x && parseInt(this._activeDragVisual.style.top) == position.y) + return; + + $common.setLocation(this._activeDragVisual, position); + + // Monitor DOM changes. + this._prepareForDomChanges(); + this._activeDragSource.onDrag(); + this._recoverFromDomChanges(); + + // Find a potential target. + this._potentialTarget = this._findPotentialTarget(this._activeDragSource, this._activeDragVisual); + + var movedToOtherTarget = (this._potentialTarget != this._underlyingTarget || this._potentialTarget == null); + + // Check if we are leaving an underlying target. + if(movedToOtherTarget && this._underlyingTarget != null) + this._leaveTarget(this._activeDragSource, this._underlyingTarget); + + if(this._potentialTarget != null) { + // Check if we are entering a new target. + if(movedToOtherTarget) { + this._underlyingTarget = this._potentialTarget; + + // Enter the new target. + this._enterTarget(this._activeDragSource, this._underlyingTarget); + } else { + this._moveInTarget(this._activeDragSource, this._underlyingTarget); + } + } else { + this._underlyingTarget = null; + } + }, + + _wireEvents: function() { + if(this._useBuiltInDragAndDropFunctions) { + $addHandler(document, "mouseup", this._mouseUpHandler); + $addHandler(document, "mousemove", this._documentMouseMoveHandler); + $addHandler(document.body, "dragover", this._documentDragOverHandler); + + $addHandler(this._activeDragVisual, "dragstart", this._dragStartHandler); + $addHandler(this._activeDragVisual, "dragend", this._mouseUpHandler); + $addHandler(this._activeDragVisual, "drag", this._mouseMoveHandler); + } else { + $addHandler(document, "mouseup", this._mouseUpHandler); + $addHandler(document, "mousemove", this._mouseMoveHandler); + } + }, + + _unwireEvents: function() { + if(this._useBuiltInDragAndDropFunctions) { + $removeHandler(this._activeDragVisual, "drag", this._mouseMoveHandler); + $removeHandler(this._activeDragVisual, "dragend", this._mouseUpHandler); + $removeHandler(this._activeDragVisual, "dragstart", this._dragStartHandler); + + $removeHandler(document.body, "dragover", this._documentDragOverHandler); + $removeHandler(document, "mousemove", this._documentMouseMoveHandler); + $removeHandler(document, "mouseup", this._mouseUpHandler); + } else { + $removeHandler(document, "mousemove", this._mouseMoveHandler); + $removeHandler(document, "mouseup", this._mouseUpHandler); + } + }, + + registerDropTarget: function(dropTarget) { + if(this._dropTargets == null) + this._dropTargets = []; + + Array.add(this._dropTargets, dropTarget); + + this._wireDropTargetEvents(dropTarget); + }, + + unregisterDropTarget: function(dropTarget) { + this._unwireDropTargetEvents(dropTarget); + if(this._dropTargets) + Array.remove(this._dropTargets, dropTarget); + }, + + _wireDropTargetEvents: function(dropTarget) { + var associatedElement = dropTarget.get_dropTargetElement(); + + associatedElement._dropTarget = dropTarget; + $addHandler(associatedElement, "dragenter", this._dragEnterHandler); + $addHandler(associatedElement, "dragleave", this._dragLeaveHandler); + $addHandler(associatedElement, "dragover", this._dragOverHandler); + $addHandler(associatedElement, "drop", this._dropHandler); + }, + + _unwireDropTargetEvents: function(dropTarget) { + var associatedElement = dropTarget.get_dropTargetElement(); + + // make sure that the handlers are not removed twice + if(associatedElement._dropTarget) { + associatedElement._dropTarget = null; + $removeHandler(associatedElement, "dragenter", this._dragEnterHandler); + $removeHandler(associatedElement, "dragleave", this._dragLeaveHandler); + $removeHandler(associatedElement, "dragover", this._dragOverHandler); + $removeHandler(associatedElement, "drop", this._dropHandler); + } + }, + + + _onDragStart: function(ev) { + window._event = ev; + document.selection.empty(); + + var dt = ev.dataTransfer; + if(!dt && ev.rawEvent) + dt = ev.rawEvent.dataTransfer; + + var dataType = this._activeDragSource.get_dragDataType().toLowerCase(), + data = this._activeDragSource.getDragData(this._activeContext); + + if(data) { + // TODO: How do we want to deal with 'non-compatible types'? + if(dataType != "text" && dataType != "url") { + dataType = "text"; + + if(data.innerHTML != null) + data = data.innerHTML; + } + + dt.effectAllowed = "move"; + dt.setData(dataType, data.toString()); + } + }, + + _onMouseUp: function(ev) { + window._event = ev; + this._stopDragDrop(false); + }, + + _onDocumentMouseMove: function(ev) { + window._event = ev; + this._dragDrop(); + }, + + _onDocumentDragOver: function(ev) { + window._event = ev; + if(this._potentialTarget) + ev.preventDefault(); + }, + + _onMouseMove: function(ev) { + window._event = ev; + this._drag(); + }, + + _onDragEnter: function(ev) { + window._event = ev; + if(this._isDragging) { + ev.preventDefault(); + //ev.returnValue = false; + } else { + // An external object is dragged to the drop target. + var dataObjects = Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target)); + + for(var i = 0; i < dataObjects.length; i++) + this._dropTarget.onDragEnterTarget(Sys.Extended.UI.DragMode.Copy, dataObjects[i].type, dataObjects[i].value); + } + }, + + _onDragLeave: function(ev) { + window._event = ev; + if(this._isDragging) { + ev.preventDefault(); + //ev.returnValue = false; + } else { + // An external object is dragged to the drop target. + var dataObjects = Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target)); + + for(var i = 0; i < dataObjects.length; i++) + this._dropTarget.onDragLeaveTarget(Sys.Extended.UI.DragMode.Copy, dataObjects[i].type, dataObjects[i].value); + } + }, + + _onDragOver: function(ev) { + window._event = ev; + if(this._isDragging) { + ev.preventDefault(); + } else { + // An external object is dragged over the drop target. + var dataObjects = Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target)); + + for(var i = 0; i < dataObjects.length; i++) + this._dropTarget.onDragInTarget(Sys.Extended.UI.DragMode.Copy, dataObjects[i].type, dataObjects[i].value); + } + }, + + _onDrop: function(ev) { + window._event = ev; + + if(!this._isDragging) { + // An external object is dropped on the drop target. + var dataObjects = Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target)); + + for(var i = 0; i < dataObjects.length; i++) + this._dropTarget.drop(Sys.Extended.UI.DragMode.Copy, dataObjects[i].type, dataObjects[i].value); + } + ev.preventDefault(); + }, + + _getDropTarget: function(element) { + while(element) { + if(element._dropTarget != null) + return element._dropTarget; + + element = element.parentNode; + } + + return null; + }, + + _dragDrop: function() { + if(this._isDragging) + return; + + this._isDragging = true; + this._activeDragVisual.dragDrop(); + + document.selection.empty(); + }, + + _moveInTarget: function(dragSource, dropTarget) { + // Monitor DOM changes. + this._prepareForDomChanges(); + dropTarget.onDragInTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext)); + this._recoverFromDomChanges(); + }, + + _enterTarget: function(dragSource, dropTarget) { + // Monitor DOM changes. + this._prepareForDomChanges(); + dropTarget.onDragEnterTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext)); + this._recoverFromDomChanges(); + }, + + _leaveTarget: function(dragSource, dropTarget) { + // Monitor DOM changes. + this._prepareForDomChanges(); + dropTarget.onDragLeaveTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext)); + this._recoverFromDomChanges(); + }, + + _findPotentialTarget: function(dragSource, dragVisual) { + var ev = window._event; + + if(this._dropTargets == null) + return null; + + var type = dragSource.get_dragDataType(), + mode = dragSource.get_dragMode(), + data = dragSource.getDragData(this._activeContext); + + // Get the current cursor location. + var scrollOffset = this.getScrollOffset(document.body, /* recursive */true), + x = ev.clientX + scrollOffset.x, + y = ev.clientY + scrollOffset.y, + cursorRect = { x: x - this._radius, y: y - this._radius, width: this._radius * 2, height: this._radius * 2 }; + + // Find any targets near the current cursor location. + var targetRect; + for(var i = 0; i < this._dropTargets.length; i++) { + targetRect = $common.getBounds(this._dropTargets[i].get_dropTargetElement()); + + if($common.overlaps(cursorRect, targetRect) && this._dropTargets[i].canDrop(mode, type, data)) + return this._dropTargets[i]; + } + + return null; + }, + + _prepareForDomChanges: function() { + this._oldOffset = $common.getLocation(this._activeDragVisual); + }, + + _recoverFromDomChanges: function() { + var newOffset = $common.getLocation(this._activeDragVisual); + + if(this._oldOffset.x != newOffset.x || this._oldOffset.y != newOffset.y) { + this._activeDragVisual.startingPoint = this.subtractPoints(this._activeDragVisual.startingPoint, this.subtractPoints(this._oldOffset, newOffset)); + scrollOffset = this.getScrollOffset(this._activeDragVisual, /* recursive */true); + + var position = this.addPoints(this.subtractPoints(document._lastPosition, this._activeDragVisual.startingPoint), scrollOffset); + $common.setLocation(this._activeDragVisual, position); + } + }, + + addPoints: function(p1, p2) { + return { x: p1.x + p2.x, y: p1.y + p2.y }; + }, + + subtractPoints: function(p1, p2) { + return { x: p1.x - p2.x, y: p1.y - p2.y }; + }, + + // -- Drag and drop helper methods. + getScrollOffset: function(element, recursive) { + var left = element.scrollLeft, + top = element.scrollTop; + + if(recursive) { + var parent = element.parentNode; + + while(parent != null && parent.scrollLeft != null) { + left += parent.scrollLeft; + top += parent.scrollTop; + + // Don't include anything below the body. + if(parent == document.body && (left != 0 && top != 0)) + break; + + parent = parent.parentNode; + } + } + + return { x: left, y: top }; + }, + + getBrowserRectangle: function() { + var width = window.innerWidth, + height = window.innerHeight; + + if(width == null) + width = document.documentElement.clientWidth; + + if(height == null) + height = document.documentElement.clientHeight; + + return { x: 0, y: 0, width: width, height: height }; + }, + + getNextSibling: function(item) { + for(item = item.nextSibling; item != null; item = item.nextSibling) + if(item.innerHTML != null) + return item; + + return null; + }, + + hasParent: function(element) { + return (element.parentNode != null && element.parentNode.tagName != null); + } +} + +Sys.Extended.UI.IEDragDropManager.registerClass('Sys.Extended.UI.IEDragDropManager', Sys.Component); + +Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget = function(dropTarget) { + if(dropTarget == null) + return []; + + var ev = window._event, + dataObjects = [], + dataTypes = ["URL", "Text"], + data; + + for(var i = 0; i < dataTypes.length; i++) { + var dt = ev.dataTransfer; + + if(!dt && ev.rawEvent) + dt = ev.rawEvent.dataTransfer; + + data = dt.getData(dataTypes[i]); + if(dropTarget.canDrop(Sys.Extended.UI.DragMode.Copy, dataTypes[i], data)) + if(data) + Array.add(dataObjects, { type: dataTypes[i], value: data }); + } + + return dataObjects; +} + +Sys.Extended.UI.GenericDragDropManager = function() { + Sys.Extended.UI.GenericDragDropManager.initializeBase(this); + + this._dropTargets = null; + // Radius of the cursor used to determine what drop target we + // are hovering. Anything below the cursor's zone may be a + // potential drop target. + this._scrollEdgeConst = 40; + this._scrollByConst = 10; + this._scroller = null; + this._scrollDeltaX = 0; + this._scrollDeltaY = 0; + this._activeDragVisual = null; + this._activeContext = null; + this._activeDragSource = null; + this._oldOffset = null; + this._potentialTarget = null; + this._mouseUpHandler = null; + this._mouseMoveHandler = null; + this._keyPressHandler = null; + this._scrollerTickHandler = null; +} + +Sys.Extended.UI.GenericDragDropManager.prototype = { + + initialize: function() { + Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this, "initialize"); + + this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp); + this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove); + this._keyPressHandler = Function.createDelegate(this, this._onKeyPress); + this._scrollerTickHandler = Function.createDelegate(this, this._onScrollerTick); + this._scroller = new Sys.Timer(); + this._scroller.set_interval(10); + this._scroller.add_tick(this._scrollerTickHandler); + }, + + startDragDrop: function(dragSource, dragVisual, context) { + this._activeDragSource = dragSource; + this._activeDragVisual = dragVisual; + this._activeContext = context; + + Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this, "startDragDrop", [dragSource, dragVisual, context]); + }, + + _stopDragDrop: function(cancelled) { + this._scroller.set_enabled(false); + + Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this, "_stopDragDrop", [cancelled]); + }, + + _drag: function(isInitialDrag) { + Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this, "_drag", [isInitialDrag]); + + this._autoScroll(); + }, + + _wireEvents: function() { + $addHandler(document, "mouseup", this._mouseUpHandler); + $addHandler(document, "mousemove", this._mouseMoveHandler); + $addHandler(document, "keypress", this._keyPressHandler); + }, + + _unwireEvents: function() { + $removeHandler(document, "keypress", this._keyPressHandler); + $removeHandler(document, "mousemove", this._mouseMoveHandler); + $removeHandler(document, "mouseup", this._mouseUpHandler); + }, + + _wireDropTargetEvents: function(dropTarget) { + }, + + _unwireDropTargetEvents: function(dropTarget) { + }, + + _onMouseUp: function(e) { + window._event = e; + this._stopDragDrop(false); + }, + + _onMouseMove: function(e) { + window._event = e; + this._drag(); + }, + + _onKeyPress: function(e) { + window._event = e; + // Escape. + var k = e.keyCode ? e.keyCode : e.rawEvent.keyCode; + if(k == 27) + this._stopDragDrop(/* cancel */ true); + }, + + _autoScroll: function() { + var ev = window._event, + browserRect = this.getBrowserRectangle(); + + if(browserRect.width > 0) { + this._scrollDeltaX = this._scrollDeltaY = 0; + + if(ev.clientX < browserRect.x + this._scrollEdgeConst) + this._scrollDeltaX = -this._scrollByConst; + else if(ev.clientX > browserRect.width - this._scrollEdgeConst) + this._scrollDeltaX = this._scrollByConst; + + if(ev.clientY < browserRect.y + this._scrollEdgeConst) + this._scrollDeltaY = -this._scrollByConst; + else if(ev.clientY > browserRect.height - this._scrollEdgeConst) + this._scrollDeltaY = this._scrollByConst; + + if(this._scrollDeltaX != 0 || this._scrollDeltaY != 0) + this._scroller.set_enabled(true); + else + this._scroller.set_enabled(false); + } + }, + + _onScrollerTick: function() { + var oldLeft = document.body.scrollLeft, + oldTop = document.body.scrollTop; + + window.scrollBy(this._scrollDeltaX, this._scrollDeltaY); + var newLeft = document.body.scrollLeft, + newTop = document.body.scrollTop; + + var dragVisual = this._activeDragVisual, + position = { x: parseInt(dragVisual.style.left) + (newLeft - oldLeft), y: parseInt(dragVisual.style.top) + (newTop - oldTop) }; + + $common.setLocation(dragVisual, position); + } +} + +Sys.Extended.UI.GenericDragDropManager.registerClass('Sys.Extended.UI.GenericDragDropManager', Sys.Extended.UI.IEDragDropManager); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.Timer.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.Timer.debug.js new file mode 100644 index 000000000..c6dbc2a14 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Compat.Timer.debug.js @@ -0,0 +1,91 @@ +Sys.Timer = function() { + Sys.Timer.initializeBase(this); + + this._interval = 1000; + this._enabled = false; + this._timer = null; +} + +Sys.Timer.prototype = { + + get_interval: function() { + + return this._interval; + }, + + set_interval: function(value) { + if(this._interval !== value) { + this._interval = value; + this.raisePropertyChanged('interval'); + + if(!this.get_isUpdating() && (this._timer !== null)) { + this._stopTimer(); + this._startTimer(); + } + } + }, + + get_enabled: function() { + return this._enabled; + }, + + set_enabled: function(value) { + if(value !== this.get_enabled()) { + this._enabled = value; + this.raisePropertyChanged('enabled'); + + if(!this.get_isUpdating()) + if(value) + this._startTimer(); + else + this._stopTimer(); + } + }, + + add_tick: function(handler) { + this.get_events().addHandler("tick", handler); + }, + + remove_tick: function(handler) { + this.get_events().removeHandler("tick", handler); + }, + + dispose: function() { + this.set_enabled(false); + this._stopTimer(); + + Sys.Timer.callBaseMethod(this, 'dispose'); + }, + + updated: function() { + Sys.Timer.callBaseMethod(this, 'updated'); + + if(this._enabled) { + this._stopTimer(); + this._startTimer(); + } + }, + + _timerCallback: function() { + var handler = this.get_events().getHandler("tick"); + if(handler) + handler(this, Sys.EventArgs.Empty); + }, + + _startTimer: function() { + this._timer = window.setInterval(Function.createDelegate(this, this._timerCallback), this._interval); + }, + + _stopTimer: function() { + window.clearInterval(this._timer); + this._timer = null; + } +} + +Sys.Timer.descriptor = { + properties: [{ name: 'interval', type: Number }, + { name: 'enabled', type: Boolean }], + events: [{ name: 'tick' }] +} + +Sys.Timer.registerClass('Sys.Timer', Sys.Component); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComponentSet.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComponentSet.debug.js new file mode 100644 index 000000000..2f34f5fe4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ComponentSet.debug.js @@ -0,0 +1,75 @@ +Sys.ComponentSet = function ComponentSet(elementSet, query, index) { + this._elementSet = elementSet || (elementSet = new Sys.ElementSet()); + this._components = this._execute(elementSet, query, index); +} + +Sys.ComponentSet.prototype = { + __class: true, + setProperties: function ComponentSet$setProperties(properties) { + // Sets properties on the matched components. + // "properties" - object with the names and values of the properties to set. + return this.each(function() { + Sys._set(this, properties); + }); + }, + + get: function ComponentSet$get(index) { + // Returns the component at the specified index, or an array of all matches if not specified. + var components = this._components; + + return (typeof (index) === "undefined") ? (Array.apply(null, components)) : (components[index || 0] || null); + }, + + each: function ComponentSet$each(callback) { + // Enumerate all the found components. The index of the component are passed as parameters to a callback. You may return 'false' to cancel the enumeration. + // "callback" - function called for each component. + foreach(this._components, function(c, i) { + if(callback.call(c, i) === false) + return true; + }); + + return this; + }, + + elements: function ComponentSet$elements() { + // Returns the underlying set of elements this component collection came from. + return this._elementSet; + }, + + _execute: function ComponentSet$_execute(elementSet, query, index) { + var components = []; + function match(c) { + var ctor; + return (c instanceof query) || + ((ctor = c.constructor) && ( + (ctor === query) || + (ctor.inheritsFrom && ctor.inheritsFrom(query)) || + (ctor.implementsInterface && ctor.implementsInterface(query)))); + } + + if(query instanceof Array) + components.push.apply(components, query); + else + // query is a type or not set + elementSet.each(function() { + var c = this.control; + + if(c && (!query || match(c))) + components.push(c); + + foreach(this._behaviors, function(b) { + if(!query || match(b)) + components.push(b); + }); + }); + + if((typeof (index) !== "undefined")) { + if(components[index]) + components = [components[index]]; + else + components = []; + } + + return components; + } +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js new file mode 100644 index 000000000..0542e2e59 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js @@ -0,0 +1,326 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ConfirmButtonHiddenEventArgs = function(confirmed) { + Sys.Extended.UI.ConfirmButtonHiddenEventArgs.initializeBase(this); + + this._confirmed = confirmed; +} + +Sys.Extended.UI.ConfirmButtonHiddenEventArgs.prototype = { + get_confirmed: function() { + return this._confirmed; + } +} + +Sys.Extended.UI.ConfirmButtonHiddenEventArgs.registerClass('Sys.Extended.UI.ConfirmButtonHiddenEventArgs', Sys.EventArgs); + + +Sys.Extended.UI.ConfirmButtonBehavior = function(element) { + Sys.Extended.UI.ConfirmButtonBehavior.initializeBase(this, [element]); + + // Confirm text + this._ConfirmTextValue = null; + + // Cancel value + this._OnClientCancelValue = null; + + // Confirm on form submit + this._ConfirmOnFormSubmit = false; + + // ModalPopup to use instead of window.confirm + this._displayModalPopupID = null; + + // Script to call to initiate a postback + this._postBackScript = null; + + // Click handler for the target control + this._clickHandler = null; + + this._oldScript = null; +} + +Sys.Extended.UI.ConfirmButtonBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.ConfirmButtonBehavior.callBaseMethod(this, 'initialize'); + var element = this.get_element(); + + // Attach the handler + this._clickHandler = Function.createDelegate(this, this._onClick); + $addHandler(element, "click", this._clickHandler); + + // hoist out any existing script + // + this._oldScript = element.getAttribute("onclick"); + if(this._oldScript) + element.setAttribute("onclick", null); + + // Hook into the ASP.NET WebForm_OnSubmit function to display the confirm dialog prior to submission + if(this._ConfirmOnFormSubmit && (typeof (WebForm_OnSubmit) == 'function') && !Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit) { + if(Sys.Extended.UI.TextBoxWatermarkBehavior && Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit) { + // If TextBoxWatermark has already hooked the WebForm_OnSubmit, we want to run before it so the watermark removal is always last to run + Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit = Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit; + Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit = Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit; + } else { + // Hook WebForm_OnSubmit normally + Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit = WebForm_OnSubmit; + WebForm_OnSubmit = Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit; + } + } + }, + + dispose: function() { + // Detach event handlers + if(this._clickHandler) { + $removeHandler(this.get_element(), "click", this._clickHandler); + this._clickHandler = null; + } + + if(this._oldScript) { + this.get_element().setAttribute("onclick", this._oldScript); + this._oldScript = null; + } + + Sys.Extended.UI.ConfirmButtonBehavior.callBaseMethod(this, 'dispose'); + }, + + _onClick: function(e) { + if(this.get_element() && !this.get_element().disabled) { + if(this._ConfirmOnFormSubmit) { + // Note that this behavior was triggered (for later) + Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior = this; + } else { + // Display the dialog and cancel the click if necessary + if(!this._displayConfirmDialog()) { + e.preventDefault(); + return false; + } else if(this._oldScript) { + if(String.isInstanceOfType(this._oldScript)) + eval(this._oldScript); + else if(typeof (this._oldScript) == 'function') + this._oldScript(); + } + } + } + }, + + _displayConfirmDialog: function() { + // Raise the showing event and potentially cancel + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + + if(eventArgs.get_cancel()) + return; + + if(this._displayModalPopupID) { + // Using a ModalPopupBehavior instead of window.confirm + var mpe = $find(this._displayModalPopupID); + if(!mpe) + throw Error.argument('displayModalPopupID', String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID, this._displayModalPopupID)); + + // Hook into ModalPopupBehavior for the confirm result + mpe.set_OnOkScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(true);"); + mpe.set_OnCancelScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(false);"); + + // Show the ModalPopupBehavior + mpe.show(); + + // Cancel postback since ModalPopupBehavior.show is asynchronous - _handleConfirmDialogCompletion will handle the result + return false; + } else { + // Display window.confirm dialog + var result = window.confirm(this._ConfirmTextValue); + this._handleConfirmDialogCompletion(result); + + return result; + } + }, + + _handleConfirmDialogCompletion: function(result) { + // Handle the completion of a confirm dialog (whether by window.confirm or ModalPopupBehavior) + this.raise_hidden(new Sys.Extended.UI.ConfirmButtonHiddenEventArgs(result)); + + if(result) { + // Confirmed - Initiate the postback if specified + if(this._postBackScript) + eval(this._postBackScript); + } else { + // Rejected - Execute the associated script if present + if(this._OnClientCancelValue) + window[this._OnClientCancelValue](); + } + }, + + /// + /// A string that contains a client script that executes when the Cancel button is clicked in the confirm dialog box. + /// + /// get_onClientCancel + /// set_onClientCancel + /// + get_onClientCancel: function() { + // The client-side script that executes when the cancel button is clicked on the confirm dialog. + return this._OnClientCancelValue; + }, + set_onClientCancel: function(value) { + if(this._OnClientCancelValue != value) { + this._OnClientCancelValue = value; + this.raisePropertyChanged('onClientCancel'); + } + }, + + get_OnClientCancel: function() { + Sys.Extended.Deprecated("get_OnClientCancel()", "get_onClientCancel()"); + return this.get_onClientCancel(); + }, + set_OnClientCancel: function(value) { + Sys.Extended.Deprecated("set_OnClientCancel(value)", "set_onClientCancel(value)"); + this.set_onClientCancel(value); + }, + + /// + /// Confirmation text to display. + /// + /// + /// HTML entities can be used for a newline character. + /// + /// get_confirmText + /// set_confirmText + /// + get_confirmText: function() { + // The text to show when you want to confirm the click. (Note: HTML entities can be used here (ex: " " for new-line)) + return this._ConfirmTextValue; + }, + set_confirmText: function(value) { + if(this._ConfirmTextValue != value) { + this._ConfirmTextValue = value; + this.raisePropertyChanged('confirmText'); + } + }, + + get_ConfirmText: function() { + Sys.Extended.Deprecated("get_ConfirmText()", "get_confirmText()"); + return this.get_confirmText(); + }, + set_ConfirmText: function(value) { + Sys.Extended.Deprecated("set_ConfirmText(value)", "set_confirmText(value)"); + this.set_confirmText(value); + }, + + /// + /// A Boolean value that specifies that the confirm dialog box should not be displayed until the form is submitted. + /// + /// + /// This is useful if a page contains ASP.NET validator controls and the confirm dialog box should be displayed only after all validation checks pass. + /// + /// get_confirmOnFormSubmit + /// set_confirmOnFormSubmit + /// + get_confirmOnFormSubmit: function() { + // True iff the confirm dialog should run for form submission (i.e., after validators are all satisfied) + return this._ConfirmOnFormSubmit; + }, + set_confirmOnFormSubmit: function(value) { + if(this._ConfirmOnFormSubmit != value) { + this._ConfirmOnFormSubmit = value; + this.raisePropertyChanged('confirmOnFormSubmit'); + } + }, + + get_ConfirmOnFormSubmit: function() { + Sys.Extended.Deprecated("get_ConfirmOnFormSubmit()", "get_confirmOnFormSubmit()"); + return this.get_confirmOnFormSubmit(); + }, + set_ConfirmOnFormSubmit: function(value) { + Sys.Extended.Deprecated("set_ConfirmOnFormSubmit(value)", "set_confirmOnFormSubmit(value)"); + this.set_confirmOnFormSubmit(value); + }, + + /// + /// A string that contains the ID of the ModalPopupBehavior control for use instead of the default window.confirm dialog box. + /// + /// get_displayModalPopupID + /// set_displayModalPopupID + /// + get_displayModalPopupID: function() { + // ID of a ModalPopupBehavior to be used instead of the default window.confirm dialog + return this._displayModalPopupID; + }, + set_displayModalPopupID: function(value) { + if(this._displayModalPopupID != value) { + this._displayModalPopupID = value; + this.raisePropertyChanged('displayModalPopupID'); + } + }, + + /// + /// A string that contains script to run in order to initiate a postback. + /// + /// get_postBackScript + /// set_postBackScript + /// + get_postBackScript: function() { + return this._postBackScript; + }, + set_postBackScript: function(value) { + if(this._postBackScript != value) { + this._postBackScript = value; + this.raisePropertyChanged('postBackScript'); + } + }, + + /// + /// Fires when the control is being shown. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if(handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing", "raise_showing"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires when the control is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + if(handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden", "raise_hidden"); + this.raise_hidden(eventArgs); + } +} + +Sys.Extended.UI.ConfirmButtonBehavior.registerClass('Sys.Extended.UI.ConfirmButtonBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit = function() { + // Wraps ASP.NET's WebForm_OnSubmit in order to display the confirm dialog prior to submission + var result = Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit(); + + if(result && Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior) + result = Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior._displayConfirmDialog(); + + Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior = null; + + return result; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DraggableListItem.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DraggableListItem.debug.js new file mode 100644 index 000000000..76edfb32a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DraggableListItem.debug.js @@ -0,0 +1,132 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.DraggableListItem = function(e) { + Sys.Extended.UI.DraggableListItem.initializeBase(this, [e]); + + this._data = null; + + this._handle = null; + this._dragVisualTemplate = null; + this._dragVisualTemplateInstance = null; + this._mouseDownHandler = null; +} + +Sys.Extended.UI.DraggableListItem.prototype = { + + dispose: function() { + var e = this.get_element(); + this.set_handle(null); + Sys.Extended.UI.DraggableListItem.callBaseMethod(this, 'dispose'); + }, + + get_data: function() { + if(this._data == null) { + var dragSource = this._findDragSource(); + + if(dragSource != null && Sys.Extended.UI.DragDropList.IsValidDataType(dragSource.get_dragDataType())) + return this.get_element(); + } + + return this._data; + }, + + set_data: function(value) { + if(this._data != value) { + this._data = value; + this.raisePropertyChanged('data'); + } + }, + + get_handle: function() { + return this._handle; + }, + + set_handle: function(value) { + if(this._handle != null) { + $removeHandler(this._handle, "mousedown", this.get_mouseDownHandler()); + this._handle.__draggableBehavior = null; + } + + if(value) { + if(value.element) + value = value.element; + + this._handle = value; + this.raisePropertyChanged('handle'); + this._handle.__draggableBehavior = this; + + $addHandler(this._handle, "mousedown", this.get_mouseDownHandler()); + this._handle.__draggableBehavior = this; + } + else + this._handle = null; + }, + + get_mouseDownHandler: function() { + if(this._mouseDownHandler == null) + this._mouseDownHandler = Function.createDelegate(this, this._onMouseDown); + + return this._mouseDownHandler; + }, + + get_dragVisualTemplate: function() { + return this._dragVisualTemplate; + }, + + set_dragVisualTemplate: function(value) { + if(this._dragVisualTemplate != value) { + this._dragVisualTemplate = value; + this.raisePropertyChanged('dragVisualTemplate'); + } + }, + + _onMouseDown: function(ev) { + window._event = ev.rawEvent; + this._handle.__draggableBehavior._mouseDownHandlerInternal(ev); + }, + + _mouseDownHandlerInternal: function(ev) { + var ev = window.testEvent ? window.testEvent : ev; + if(ev.button <= 1) { + var dragSource = this._findDragSource(); + + if(dragSource != null) { + var dragVisual = this._createDragVisual(); + + dragSource.startDragDrop(this.get_element(), this.get_data(), dragVisual); + ev.returnValue = false; + } + } + }, + + _createDragVisual: function() { + var ev = window.testEvent ? window.testEvent : window.event; + + if(this._dragVisualTemplate != null) { + if(this._dragVisualTemplateInstance == null) + this._dragVisualTemplateInstance = this._dragVisualTemplate.cloneElement(); + else if(!Sys.UI.DragDropManager._getInstance().hasParent(this._dragVisualTemplateInstance)) + this.get_element().appendChild(this._dragVisualTemplateInstance); + + var location = { x: ev.clientX, y: ev.clientY }; + location = Sys.UI.DragDropManager._getInstance().addPoints(location, Sys.UI.DragDropManager._getInstance().getScrollOffset(document.body, true)); + $common.setLocation(this._dragVisualTemplateInstance, location); + } + + return this._dragVisualTemplateInstance; + }, + + _findDragSource: function() { + var element = this.get_element(); + while(element != null) { + if(element.__dragDropList != null) + return element.__dragDropList; + + element = element.parentNode; + } + + return null; + } +} + +Sys.Extended.UI.DraggableListItem.registerClass('Sys.Extended.UI.DraggableListItem', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropDown.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropDown.debug.js new file mode 100644 index 000000000..b1d9fd904 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropDown.debug.js @@ -0,0 +1,793 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.DropDownBehavior = function(element) { + Sys.Extended.UI.DropDownBehavior.initializeBase(this, [element]); + this._dropDownControl = null; + this._highlightBorderColor = "#2353B2"; + this._highlightBackgroundColor = "#FFF3DB"; + this._dropArrowBackgroundColor = "#C6E1FF"; + this._dropArrowImageUrl = null; + this._dropArrowWidth = "16px"; + this._oldBackgroundColor = null; + this._dropFrame = null; + this._dropArrow = null; + this._dropArrowImage = null; + this._dropWrapper = null; + this._isOpen = false; + this._isOver = false; + this._wasClicked = null; + this._dropWrapperHoverBehavior = null; + this._dropPopupPopupBehavior = null; + this._onShowJson = null; + this._onHideJson = null; + + this._dropDownControl$delegates = { + click: Function.createDelegate(this, this._dropDownControl_onclick), + contextmenu: Function.createDelegate(this, this._dropDownControl_oncontextmenu) + } + + this._dropFrame$delegates = { + click: Function.createDelegate(this, this._dropFrame_onclick), + contextmenu: Function.createDelegate(this, this._dropFrame_oncontextmenu) + } + + this._dropWrapper$delegates = { + click: Function.createDelegate(this, this._dropWrapper_onclick), + contextmenu: Function.createDelegate(this, this._dropWrapper_oncontextmenu) + } + + this._document$delegates = { + click: Function.createDelegate(this, this._document_onclick), + contextmenu: Function.createDelegate(this, this._document_oncontextmenu) + } + + this._dropWrapperHoverBehavior$delegates = { + hover: Function.createDelegate(this, this._dropWrapperHoverBehavior_onhover), + unhover: Function.createDelegate(this, this._dropWrapperHoverBehavior_onunhover) + } +} + +Sys.Extended.UI.DropDownBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.DropDownBehavior.callBaseMethod(this, 'initialize'); + + var elt = this.get_element(), + parent = elt.parentNode; + + // _dropDownControl + if(this._dropDownControl == null) { + $common.createElementFromTemplate({ + parent: parent, + nameTable: this, + name: "_dropDownControl", + nodeName: "div", + visible: false, + cssClasses: this._dropDownControl ? null : ["ajax__dropdown_panel"], + properties: { + __GENERATED: true + } + }); + } + $addHandlers(this._dropDownControl, this._dropDownControl$delegates); + + // _dropFrame + // _dropArrow + // _dropArrowWrapper + // _dropArrowImage + var dropArrowImageProperties = {}; + if(this._dropArrowImageUrl) + // Only set src if it has a value - otherwise IE gets a HTTP 404 response + dropArrowImageProperties["src"] = this._dropArrowImageUrl; + + $common.createElementFromTemplate({ + parent: parent, + nameTable: this, + name: "_dropFrame", + nodeName: "span", + visible: false, + children: [{ + name: "_dropFrameTop", + nodeName: "div", + cssClasses: ["ajax__dropdown_frame_line"] + }, { + name: "_dropFrameRight", + nodeName: "div", + cssClasses: ["ajax__dropdown_frame_line"] + }, { + name: "_dropFrameBottom", + nodeName: "div", + cssClasses: ["ajax__dropdown_frame_line"] + }, { + name: "_dropFrameLeft", + nodeName: "div", + cssClasses: ["ajax__dropdown_frame_line"] + }, { + name: "_dropArrow", + nodeName: "div", + cssClasses: (!this._dropArrowImageUrl) ? ["ajax__dropdown_arrow", "ajax__dropdown_arrow_image"] : ["ajax__dropdown_arrow"], + properties: { + style: { + width: this._dropArrowWidth, + backgroundColor: this._dropArrowBackgroundColor + } + }, + events: this._dropFrame$delegates, + children: [{ + name: "_dropArrowWrapper", + nodeName: "div", + visible: !!this._dropArrowImageUrl, + cssClasses: ["ajax__dropdown_arrow_wrapper"], + children: [{ + name: "_dropArrowImage", + nodeName: "img", + properties: dropArrowImageProperties + }] + }] + }] + }); + + // _dropWrapper + $common.createElementFromTemplate({ + parent: null, + nameTable: this, + name: "_dropWrapper", + nodeName: "span", + properties: { + id: elt.id + "_dropWrapper", + style: { + cursor: "default" + } + }, + events: this._dropWrapper$delegates, + content: elt + }); + + // _dropPopupPopupBehavior + this._dropPopupPopupBehavior = $create(Sys.Extended.UI.PopupBehavior, { + positioningMode: Sys.Extended.UI.PositioningMode.BottomRight, + parentElement: elt, + y: -1 + }, null, null, this._dropDownControl); + + // Create the animations (if they were set before initialize was called) + if(this._onShowJson) + this._dropPopupPopupBehavior.set_onShow(this._onShowJson); + + if(this._onHideJson) + this._dropPopupPopupBehavior.set_onHide(this._onHideJson); + + // _dropWrapperHoverBehavior + this._dropWrapperHoverBehavior = $create(Sys.Extended.UI.HoverBehavior, { + hoverElement: this._dropFrame + }, this._dropWrapperHoverBehavior$delegates, null, this._dropWrapper); + + // wire events + $addHandlers(document, this._document$delegates); + }, + + dispose: function() { + var elt = this.get_element(); + if(this._isOpen) { + this.hide(); + this.unhover(); + this._isOpen = false; + } + + $common.removeHandlers(document, this._document$delegates); + this._onShowJson = null; + this._onHideJson = null; + + if(this._dropPopupPopupBehavior) { + this._dropPopupPopupBehavior.dispose(); + this._dropPopupPopupBehavior = null; + } + + if(this._dropWrapperHoverBehavior) { + this._dropWrapperHoverBehavior.dispose(); + this._dropWrapperHoverBehavior = null; + } + + if(this._dropFrame) { + $common.removeElement(this._dropFrame); + this._dropFrame = null; + this._dropFrameTop = null; + this._dropFrameRight = null; + this._dropFrameBottom = null; + this._dropFrameLeft = null; + this._dropArrow = null; + this._dropArrowWrapper = null; + this._dropArrowImage = null; + } + + if(this._dropWrapper) { + $common.removeHandlers(this._dropWrapper, this._dropWrapper$delegates); + $common.unwrapElement(elt, this._dropWrapper); + + this._dropWrapper = null; + } + + if(this._dropDownControl) { + $common.removeHandlers(this._dropDownControl, this._dropDownControl$delegates); + + if(this._dropDownControl.__GENERATED) + $common.removeElement(this._dropDownControl); + + this._dropDownControl = null; + } + + Sys.Extended.UI.DropDownBehavior.callBaseMethod(this, 'dispose'); + }, + + hover: function() { + var elt = this.get_element(); + if(!this._isOver) { + this._isOver = true; + this.raiseHoverOver(Sys.EventArgs.Empty); + + var bounds = $common.getBounds(elt); + + // measure the offset caused by absolute/relative positioning: + // - set position to (0,0) + $common.setLocation(this._dropFrame, { x: 0, y: 0 }); + + // - show element + $common.setVisible(this._dropFrame, true); + + // - get the actual position + var offset = $common.getLocation(this._dropFrame); + + // - hide element + $common.setVisible(this._dropFrame, false); + + // apply the measured offset + bounds.x -= offset.x; + bounds.y -= offset.y; + + $common.setBounds(this._dropFrameTop, { + x: bounds.x, + y: bounds.y, + width: bounds.width, + height: 1 + }); + $common.setBounds(this._dropFrameRight, { + x: bounds.x + bounds.width - 1, + y: bounds.y, + width: 1, + height: bounds.height + }); + $common.setBounds(this._dropFrameBottom, { + x: bounds.x, + y: bounds.y + bounds.height - 1, + width: bounds.width, + height: 1 + }); + $common.setBounds(this._dropFrameLeft, { + x: bounds.x, + y: bounds.y, + width: 1, + height: bounds.height + }); + $common.setBounds(this._dropArrow, { + x: bounds.x + bounds.width - 17, + y: bounds.y + 1, + width: 16, + height: bounds.height - 2 + }); + + this._dropFrameTop.style.backgroundColor = this._highlightBorderColor; + this._dropFrameRight.style.backgroundColor = this._highlightBorderColor; + this._dropFrameBottom.style.backgroundColor = this._highlightBorderColor; + this._dropFrameLeft.style.backgroundColor = this._highlightBorderColor; + + $common.setVisible(this._dropFrame, true); + if(!this._oldBackgroundColor) + this._oldBackgroundColor = $common.getCurrentStyle(elt, 'backgroundColor'); + + var rgbColorRegEx = /\d{0,3},\s*\d{0,3},\s*\d{0,3}/; + if(rgbColorRegEx.test(this._highlightBackgroundColor)) + elt.style.backgroundColor = "rgb(" + this._highlightBackgroundColor + ")"; + else + elt.style.backgroundColor = this._highlightBackgroundColor; + } + }, + + unhover: function() { + var elt = this.get_element(); + if(this._isOver || !this._isOpen) { + this._isOver = false; + + if(!this._isOpen) { + $common.setVisible(this._dropFrame, false); + + if(this._oldBackgroundColor) { + elt.style.backgroundColor = this._oldBackgroundColor; + this._oldBackgroundColor = null; + } else { + elt.style.backgroundColor = "transparent"; + } + } + + this.raise_hoverOut(Sys.EventArgs.Empty); + } + }, + + /// + /// Shows a drop-down list. + /// + /// + show: function() { + if(!this._isOpen) { + this.hover(); + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + this.raise_popup(eventArgs); + if(eventArgs.get_cancel()) + return; + + this._isOpen = true; + this.populate(); + + if(!this._dynamicPopulateBehavior || (this._dynamicPopulateBehavior._populated && this._cacheDynamicResults)) + this._showPopup(); + } + }, + + _showPopup: function() { + this._dropPopupPopupBehavior.show(); + this.raise_shown(Sys.EventArgs.Empty); + }, + + /// + /// Hides a drop-down list. + /// + /// + hide: function() { + if(this._isOpen) { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + + if(eventArgs.get_cancel()) + return; + + this._isOpen = false; + this._dropPopupPopupBehavior.hide(); + this.raise_hidden(Sys.EventArgs.Empty); + } + }, + + _dropWrapperHoverBehavior_onhover: function(sender, e) { + this.hover(); + }, + + _dropWrapperHoverBehavior_onunhover: function(sender, e) { + this.unhover(); + }, + + _dropWrapper_onclick: function(e) { + if(e.target.tagName != "A") { + if(!this._isOpen) + this.show(); + else + this.hide(); + + this._wasClicked = true; + } + }, + + _dropWrapper_oncontextmenu: function(e) { + if(e.target.tagName != "A") { + this._wasClicked = true; + e.preventDefault(); + this.show(); + } + }, + + _dropFrame_onclick: function(e) { + if(!this._isOpen) + this.show(); + else + this.hide(); + + this._wasClicked = true; + }, + + _dropFrame_oncontextmenu: function(e) { + this._wasClicked = true; + e.preventDefault(); + this.show(); + }, + + _dropDownControl_onclick: function(e) { + //this._wasClicked = true; + }, + + _dropDownControl_oncontextmenu: function(e) { + this._wasClicked = true; + e.preventDefault(); + }, + + _document_onclick: function(e) { + if(this._wasClicked) { + this._wasClicked = false; + } else if(this._isOpen) { + this.hide(); + this.unhover(); + } + }, + + _document_oncontextmenu: function(e) { + if(this._wasClicked) { + this._wasClicked = false; + } else if(this._isOpen) { + this.hide(); + this.unhover(); + } + }, + + _onPopulated: function(sender, eventArgs) { + Sys.Extended.UI.DropDownBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]); + + if(this._isOpen) + this._showPopup(); + }, + + /// + /// A JSON definition of a generic OnShow animation. + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + return this._dropPopupPopupBehavior ? this._dropPopupPopupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._dropPopupPopupBehavior) + this._dropPopupPopupBehavior.set_onShow(value) + else + this._onShowJson = value; + + this.raisePropertyChanged('onShow'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing the generic OnShow animation behavior. + /// + /// get_onShowBehaior + /// + get_onShowBehavior: function() { + return this._dropPopupPopupBehavior ? this._dropPopupPopupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Plays OnShow animation. + /// + /// + onShow: function() { + if(this._dropPopupPopupBehavior) + this._dropPopupPopupBehavior.onShow(); + }, + + /// + /// A JSON definition of a generic OnHide animation. + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + // Generic OnHide Animation's JSON definition + return this._dropPopupPopupBehavior ? this._dropPopupPopupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._dropPopupPopupBehavior) + this._dropPopupPopupBehavior.set_onHide(value) + else + this._onHideJson = value; + + this.raisePropertyChanged('onHide'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing the generic OnHide animation behavior. + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._dropPopupPopupBehavior ? this._dropPopupPopupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Play OnHide animation. + /// + /// + onHide: function() { + if(this._dropPopupPopupBehavior) + this._dropPopupPopupBehavior.onHide(); + }, + + /// + /// A drop-down control. + /// + /// get_dropDownControl + /// set_dropDownControl + /// + get_dropDownControl: function() { + return this._dropDownControl; + }, + set_dropDownControl: function(value) { + if(this._dropDownControl != value) { + this._dropDownControl = value; + this.raisePropertyChanged("dropDownControl"); + } + }, + + /// + /// TThe highlighted border color of the DropDown control. + /// + /// get_highlightBorderColor + /// set_highlightBorderColor + /// + get_highlightBorderColor: function() { + return this._highlightBorderColor; + }, + set_highlightBorderColor: function(value) { + if(this._highlightBorderColor != value) { + this._highlightBorderColor = value; + this.raisePropertyChanged("highlightBorderColor"); + } + }, + + /// + /// The highlighted background color of the DropDown control. + /// + /// get_highlightBackgroundColor + /// set_highlightBackgroundColor + /// + get_highlightBackgroundColor: function() { + return this._highlightBackgroundColor; + }, + set_highlightBackgroundColor: function(value) { + if(this._highlightBackgroundColor != value) { + this._highlightBackgroundColor = value; + + if(this.get_isInitialized() && this._isOpen) + this._dropWrapper.style.backgroundColor = value; + + this.raisePropertyChanged("highlightBackgroundColor"); + } + }, + + /// + /// The arrow's background color of the DropDown control. + /// + /// get_dropArrowBackgroundColor + /// set_dropArrowBackgroundColor + /// + get_dropArrowBackgroundColor: function() { + return this._dropArrowBackgroundColor; + }, + set_dropArrowBackgroundColor: function(value) { + if(this._dropArrowBackgroundColor != value) { + this._dropArrowBackgroundColor = value; + + if(this.get_isInitialized()) + this._dropArrow.style.backgroundColor = value; + + this.raisePropertyChanged("dropArrowBackgroundColor"); + } + }, + + /// + /// The arrow image URL of the DropDown control. + /// + /// get_dropArrowImageUrl + /// set_dropArrowImageUrl + /// + get_dropArrowImageUrl: function() { + return this._dropArrowImageUrl; + }, + set_dropArrowImageUrl: function(value) { + if(this._dropArrowImageUrl != value) { + this._dropArrowImageUrl = value; + + if(this.get_isInitialized()) { + if(this._dropArrow.className) { + this._dropArrow.className = ""; + this._dropArrowWrapper.style.display = 'block'; + } + + this._dropArrowImage.src = value; + } + + this.raisePropertyChanged("dropArrowImageUrl"); + } + }, + + /// + /// The arrow width of the DropDown control. + /// + /// get_dropArrowWidth + /// set_dropArrowWidth + /// + get_dropArrowWidth: function() { + return this._dropArrowWidth; + }, + set_dropArrowWidth: function(value) { + if(this._dropArrowWidth != value) { + this._dropArrowWidth = value; + + if(this.get_isInitialized()) + this._dropArrow.style.width = value; + + this.raisePropertyChanged("dropArrowWidth"); + } + }, + + /// + /// A Boolean value that specifies whether or not the cursor is over the DropDown control. + /// + /// get_isOver + /// + get_isOver: function() { + return this._isOver; + }, + + /// + /// A Boolean value that specifies whether the DropDown control is open. + /// + /// get_isOpen + /// + get_isOpen: function() { + return this._isOpen; + }, + + /// + /// Fires when the control is being shown. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if(handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires after the control is shown. + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler('shown', handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler('shown', handler); + }, + raise_shown: function(eventArgs) { + var handler = this.get_events().getHandler('shown'); + if(handler) + handler(this, eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Fires when the popup is shown. + /// + /// + /// + add_popup: function(handler) { + this.get_events().addHandler('popup', handler); + }, + remove_popup: function(handler) { + this.get_events().removeHandler('popup', handler); + }, + raise_popup: function(eventArgs) { + var handler = this.get_events().getHandler('popup'); + if(handler) + handler(this, eventArgs); + }, + raisePopup: function(eventArgs) { + Sys.Extended.Deprecated("raisePopup(eventArgs)", "raise_popup(eventArgs)"); + this.raise_popup(eventArgs); + }, + + /// + /// Fires when the control is being hidden. + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler('hiding', handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler('hiding', handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if(handler) + handler(this, eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires after the control is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + if(handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + }, + + /// + /// Fires on hovering over the control. + /// + /// + /// + add_hoverOver: function(handler) { + this.get_events().addHandler('hoverOver', handler); + }, + remove_hoverOver: function(handler) { + this.get_events().removeHandler('hoverOver', handler); + }, + raise_hoverOver: function(eventArgs) { + var handler = this.get_events().getHandler('hoverOver'); + if(handler) + handler(this, eventArgs); + }, + raiseHoverOver: function(eventArgs) { + Sys.Extended.Deprecated("raiseHoverOver(eventArgs)", "raise_hoverOver(eventArgs)"); + this.raise_hoverOver(eventArgs); + }, + + /// + /// Fires on hovering out of the control. + /// + /// + /// + add_hoverOut: function(handler) { + this.get_events().addHandler('hoverOut', handler); + }, + remove_hoverOut: function(handler) { + this.get_events().removeHandler('hoverOut', handler); + }, + raise_hoverOut: function(eventArgs) { + var handler = this.get_events().getHandler('hoverOut'); + if(handler) + handler(this, eventArgs); + }, + raiseHoverOut: function(eventArgs) { + Sys.Extended.Deprecated("raiseHoverOut(eventArgs)", "raise_hoverOut(eventArgs)"); + this.raise_hoverOut(eventArgs); + } +} + +Sys.Extended.UI.DropDownBehavior.registerClass('Sys.Extended.UI.DropDownBehavior', Sys.Extended.UI.DynamicPopulateBehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropShadow.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropShadow.debug.js new file mode 100644 index 000000000..e07cea2c3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropShadow.debug.js @@ -0,0 +1,483 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.DropShadowBehavior = function(element) { + // The DropShadowBehavior is used to attach a drop shadow to the element + // "element" - DOM Element the behavior is associated with + Sys.Extended.UI.DropShadowBehavior.initializeBase(this, [element]); + + // our property values + this._opacity = 1.0; + this._width = 5; + + // the div we create for the shadow. + this._shadowDiv = null; + + // our timer for tracking position + this._trackPosition = null; + this._trackPositionDelay = 50; + this._timer = null; + this._tickHandler = null; + this._roundedBehavior = null; + this._shadowRoundedBehavior = null; + + this._rounded = false; + this._radius = 5; + + // our cache of our last size and position for tracking + this._lastX = null; + this._lastY = null; + this._lastW = null; + this._lastH = null; +} + +Sys.Extended.UI.DropShadowBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this, 'initialize'); + + e = this.get_element(); + + // flip the styles position to relative so that we z-order properly. + if($common.getCurrentStyle(e, 'position', e.style.position) != "absolute") + e.style.position = "relative"; + + // set up our initial state + if(this._rounded) + this.setupRounded(); + + if(this._trackPosition) + this.startTimer(); + + this.setShadow(); + }, + + dispose: function() { + this.stopTimer(); + this.disposeShadowDiv(); + + Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this, 'dispose'); + }, + + buildShadowDiv: function() { + // Create the div that we'll use as the shadow + e = this.get_element(); + + if(!this.get_isInitialized() || !e || !this._width) + return; + + // check if browser does not support css3 + if(e.style.boxShadow == undefined && e.style.MozBoxShadow == undefined && e.style.WebkitBoxShadow == undefined) { + var div = document.createElement("DIV"); + + div.style.backgroundColor = "black"; + div.style.position = "absolute"; + + if(e.id) + div.id = e.id + "_DropShadow"; + + // initialize a control around it, and + // set up the opacity behavior and rounding + this._shadowDiv = div; + + e.parentNode.appendChild(div); + + if(this._rounded) { + this._shadowDiv.style.height = Math.max(0, e.offsetHeight - (2 * this._radius)) + "px"; + + if(!this._shadowRoundedBehavior) + this._shadowRoundedBehavior = $create(Sys.Extended.UI.RoundedCornersBehavior, { "Radius": this._radius }, null, null, this._shadowDiv); + else + this._shadowRoundedBehavior.set_radius(this._radius); + } else if(this._shadowRoundedBehavior) { + this._shadowRoundedBehavior.set_radius(0); + } + + if(this._opacity != 1.0) + this.setupOpacity(); + + this.setShadow(false, true); + this.updateZIndex(); + } + }, + + disposeShadowDiv: function() { + // Dispose of the div we use as the shadow + if(this._shadowDiv) { + // on page teardown (or in an update panel, this may already + // be gone) + if(this._shadowDiv.parentNode) + this._shadowDiv.parentNode.removeChild(this._shadowDiv); + + this._shadowDiv = null; + } + + if(this._shadowRoundedBehavior) { + this._shadowRoundedBehavior.dispose(); + this._shadowRoundedBehavior = null; + } + }, + + onTimerTick: function() { + // Timer's tick handler that is used to position the shadow when its target moves + this.setShadow(); + }, + + startTimer: function() { + // Start the timer (and hence start tracking the bounds of the target element) + if(!this._timer) { + if(!this._tickHandler) + this._tickHandler = Function.createDelegate(this, this.onTimerTick); + + this._timer = new Sys.Timer(); + this._timer.set_interval(this._trackPositionDelay); + this._timer.add_tick(this._tickHandler); + this._timer.set_enabled(true); + } + }, + + stopTimer: function() { + // Stop the timer (and hence stop tracking the bounds of the target element) + + // on stop, just clean the thing up completely + if(this._timer) { + this._timer.remove_tick(this._tickHandler); + this._timer.set_enabled(false); + this._timer.dispose(); + this._timer = null; + } + }, + + /// + /// Draws shadow around the control. + /// + /// + /// This function does most part of work when positioning and sizing the shadow. + /// It caches values to avoid extra work. + /// It's called on a timer so we need to keep its weight light. + /// + /// Whether to force the bounds change. + /// Whether to recurse if we need to recreate the shadow div + /// + setShadow: function(force, norecurse) { + // This function does the heavy lifting of positioning and sizing the shadow. + // It caches values to avoid extra work - it's called on a timer so we need to + // keep it light weight. + // "force" - whether to force the bounds change + // "norecurse" - whether to recurse if we need to recreate the shadow div + + e = this.get_element(); + + if(!this.get_isInitialized() || !e || (!this._width && !force)) + return; + + // execute if browser does not support css3 + if(e.style.boxShadow == undefined && e.style.MozBoxShadow == undefined && e.style.WebkitBoxShadow == undefined) { + var existingShadow = this._shadowDiv; + if(!existingShadow) + this.buildShadowDiv(); + + var location = { x: e.offsetLeft, y: e.offsetTop }; + + if(force || this._lastX != location.x || this._lastY != location.y || !existingShadow) { + this._lastX = location.x; + this._lastY = location.y; + + var w = this.get_width(); + + location.x += w; + location.y += w; + + $common.setLocation(this._shadowDiv, location); + } + + var h = e.offsetHeight, + w = e.offsetWidth; + + if(force || h != this._lastH || w != this._lastW || !existingShadow) { + this._lastW = w; + this._lastH = h; + + if(!this._rounded || !existingShadow || norecurse) { + this._shadowDiv.style.width = w + "px"; + this._shadowDiv.style.height = h + "px"; + } else { + // recurse if we need to redo the div + this.disposeShadowDiv(); + this.setShadow(); + } + } + + if(this._shadowDiv) + this._shadowDiv.style.visibility = $common.getCurrentStyle(e, 'visibility'); + } else { // create dropshadow effect on div if browser supports css3 + + var boxShadowVals; + + //To display effect of opacity set different color + // on the basis of selected % of opacity + if(this._opacity == ".25") + boxShadowVals = this._width + "px " + this._width + "px " + this._width + "px " + "#D3D3D3"; + else if(this._opacity == ".5") + boxShadowVals = this._width + "px " + this._width + "px " + this._width + "px " + "#778899"; + else if(this._opacity == ".75") + boxShadowVals = this._width + "px " + this._width + "px " + this._width + "px " + "#808080"; + else + boxShadowVals = this._width + "px " + this._width + "px " + this._width + "px " + "#000"; + + // this works in IE9 and Chrome latest versions + if(e.style.boxShadow != undefined) + e.style.boxShadow = boxShadowVals; + else if(e.style.MozBoxShadow != undefined) // this works for Mozila Firefox + e.style.MozBoxShadow = boxShadowVals; // this works for Chrome older version, Safari + else if(e.style.WebkitBoxShadow != undefined) + e.style.WebkitBoxShadow = boxShadowVals; + } + }, + + setupOpacity: function() { + // Set the opacity of the shadow div + if(this.get_isInitialized() && this._shadowDiv) + $common.setElementOpacity(this._shadowDiv, this._opacity); + + }, + + setupRounded: function() { + // Demand create and initialize the RoundedCornersBehavior + if(!this._roundedBehavior && this._rounded) + this._roundedBehavior = $create(Sys.Extended.UI.RoundedCornersBehavior, null, null, null, this.get_element()); + + if(this._roundedBehavior) + this._roundedBehavior.set_radius(this._rounded ? this._radius : 0); + }, + + updateZIndex: function() { + // Update the z-Index so the shadow div remains behind the target element + if(!this._shadowDiv) + return; + + var e = this.get_element(), + targetZIndex = e.style.zIndex, + shadowZIndex = this._shadowDiv.style.zIndex; + + if(shadowZIndex && targetZIndex && targetZIndex > shadowZIndex) { + return; + } else { + targetZIndex = Math.max(2, targetZIndex); + shadowZIndex = targetZIndex - 1; + } + + e.style.zIndex = targetZIndex; + this._shadowDiv.style.zIndex = shadowZIndex; + }, + + updateRoundedCorners: function() { + // Update the RoundedCorndersBehavior and recreate the shadow div so its corners are rounded as well + if(this.get_isInitialized()) { + this.setupRounded(); + this.disposeShadowDiv(); + this.setShadow(); + } + }, + + /// + /// A number that represents the opacity of the drop shadow from 0 (fully transparent) to 1.0 (fully opaque). + /// + /// + /// The default is .5. + /// + /// get_opacity + /// set_opacity + /// + get_opacity: function() { + return this._opacity; + }, + set_opacity: function(value) { + if(this._opacity != value) { + this._opacity = value; + + this.setShadow(); + this.setupOpacity(); + + this.raisePropertyChanged('opacity'); + } + }, + + get_Opacity: function() { + Sys.Extended.Deprecated("get_Opacity", "get_opacity"); + return this.get_opacity(); + }, + set_Opacity: function(value) { + Sys.Extended.Deprecated("set_Opacity", "set_opacity"); + this.set_opacity(value); + }, + + /// + /// A Boolean value that specifies whether or not corners of the target and drop shadow should be rounded. + /// + /// get_rounded + /// set_rounded + /// + get_rounded: function() { + return this._rounded; + }, + set_rounded: function(value) { + if(value != this._rounded) { + this._rounded = value; + + this.updateRoundedCorners(); + this.raisePropertyChanged('rounded'); + } + }, + + get_Rounded: function() { + Sys.Extended.Deprecated("get_Rounded", "get_rounded"); + return this.get_rounded(); + }, + set_Rounded: function(value) { + Sys.Extended.Deprecated("set_Rounded", "set_rounded"); + this.set_rounded(value); + }, + + /// + /// An integer that specifies the radius of rounded corners in pixels. + /// + /// get_radius + /// set_radius + /// + get_radius: function() { + return this._radius; + }, + set_radius: function(value) { + if(value != this._radius) { + this._radius = value; + + this.updateRoundedCorners(); + this.raisePropertyChanged('radius'); + } + }, + + get_Radius: function() { + Sys.Extended.Deprecated("get_Radius", "get_radius"); + return this.get_radius(); + }, + set_Radius: function(value) { + Sys.Extended.Deprecated("set_Radius", "set_radius"); + this.set_radius(value); + }, + + /// + /// An integer that specifies the drop shadow width in pixels. + /// + /// + /// The default is 5. + /// + /// get_width + /// set_width + /// + get_width: function() { + return this._width; + }, + set_width: function(value) { + if(value != this._width) { + this._width = value; + + if(this._shadowDiv) + $common.setVisible(this._shadowDiv, value > 0); + + this.setShadow(true); + this.raisePropertyChanged('width'); + } + }, + + get_Width: function() { + Sys.Extended.Deprecated("get_Width", "get_width"); + return this.get_width(); + }, + set_Width: function(value) { + Sys.Extended.Deprecated("set_Width", "set_width"); + this.set_width(value); + }, + + /// + /// A number that specifies the length of the timer interval that is used when tracking the targer position. + /// + /// get_trackPositionDelay + /// set_trackPositionDelay + /// + get_trackPositionDelay: function() { + return this._trackPositionDelay; + }, + set_trackPositionDelay: function(value) { + if(value != this._trackPositionDelay) { + this._trackPositionDelay = value; + + if(!e) + e = this.get_element(); + + // execute if browser does not support css3 + if(e.style.boxShadow == undefined && e.style.MozBoxShadow == undefined && e.style.WebkitBoxShadow == undefined) { + if(this._trackPosition) { + this.stopTimer(); + this.startTimer(); + } + + this.raisePropertyChanged('trackPositionDelay'); + } + } + }, + + get_TrackPositionDelay: function() { + Sys.Extended.Deprecated("get_TrackPositionDelay", "get_trackPositionDelay"); + return this.get_trackPositionDelay(); + }, + set_TrackPositionDelay: function(value) { + Sys.Extended.Deprecated("set_TrackPositionDelay", "set_trackPositionDelay"); + this.set_trackPositionDelay(value); + }, + + /// + /// A Boolean value that specifies whether the drop shadow should track the position of the panel to which it is attached. + /// + /// + /// Set this property to true if the panel is absolutely positioned or if it might move at runtime. The default is false. + /// + /// get_trackPosition + /// set_trackPosition + /// + get_trackPosition: function() { + // Whether the drop shadow should track the position of the panel it is attached to. + // Use this if the panel is absolutely positioned or will otherwise move. + return this._trackPosition; + }, + set_trackPosition: function(value) { + if(value != this._trackPosition) { + this._trackPosition = value; + + if(!e) + e = this.get_element(); + + // execute if browser does not support css3 + if(e.style.boxShadow == undefined && e.style.MozBoxShadow == undefined && e.style.WebkitBoxShadow == undefined) { + if(this.get_element()) { + if(value) + this.startTimer(); + else + this.stopTimer(); + } + + this.raisePropertyChanged('trackPosition'); + } + } + }, + + get_TrackPosition: function() { + Sys.Extended.Deprecated("get_TrackPosition", "get_trackPosition"); + return this.get_trackPosition(); + }, + set_TrackPosition: function(value) { + Sys.Extended.Deprecated("set_TrackPosition", "set_trackPosition"); + this.set_trackPosition(value); + } +} + +Sys.Extended.UI.DropShadowBehavior.registerClass('Sys.Extended.UI.DropShadowBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js new file mode 100644 index 000000000..69d3255c0 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js @@ -0,0 +1,757 @@ +// This behavior exists to trap a drop on the list. When an item is dropped, +// this behavior owns firing the postback so the server-side ReorderList control knows it happened. +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.RepeatDirection = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.RepeatDirection.prototype = { + Vertical: 0, + Horizontal: 1 +} + +Sys.Extended.UI.RepeatDirection.registerEnum('Sys.Extended.UI.RepeatDirection'); + +Sys.Extended.UI.DragDropList = function(associatedElement) { + Sys.Extended.UI.DragDropList.initializeBase(this, [associatedElement]); + + this._acceptedDataTypes = []; + + this._isDragging = null; + + this._dataType = null; + this._dragMode = Sys.Extended.UI.DragMode.Move; + this._dragVisual = null; + this._direction = Sys.Extended.UI.RepeatDirection.Vertical; + + this._emptyTemplate = null; + this._emptyTemplateInstance = null; + this._dropCueTemplate = null; + this._dropCueTemplateInstance = null; + this._floatContainerInstance = null; + + this._originalParent = null; + this._originalNextSibling = null; + this._originalZIndex = null; + + this._currentContext = null; + this._data = null; +} + +Sys.Extended.UI.DragDropList.IsValidDataType = function(dataType) { + if(dataType && typeof (dataType) == 'string' && dataType.length >= 4) + return dataType.substring(0, 4) === "HTML"; + + return false; +} + +Sys.Extended.UI.DragDropList.prototype = { + + get_data: function() { + return this._data; + }, + + set_data: function(value) { + this._data = value; + }, + + initialize: function() { + Sys.Extended.UI.DragDropList.callBaseMethod(this, 'initialize'); + this.get_element().__dragDropList = this; + Sys.Extended.UI.DragDropManager.registerDropTarget(this); + }, + + // -- IDragSource (related) members -- + + startDragDrop: function(dragObject, context, dragVisual) { + if(!this._isDragging) { + this._isDragging = true; + this._currentContext = context; + + if(!dragVisual) + dragVisual = this.createDragVisual(dragObject); + else + this._dragVisual = dragVisual; + + Sys.Extended.UI.DragDropManager.startDragDrop(this, dragVisual, context, !(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version > 7 && Sys.Browser.documentMode != 0)); + } + + }, + + createDragVisual: function(dragObject) { + if(this._dragMode === Sys.Extended.UI.DragMode.Copy) + this._dragVisual = dragObject.cloneNode(true); + else + this._dragVisual = dragObject; + + var oldOffset = Sys.Extended.UI.DragDropManager._getInstance().getScrollOffset(dragObject, true); + + this._dragVisual.preDragWidth = this._dragVisual.style.width; + this._dragVisual.preDragHeight = this._dragVisual.style.height; + + this._dragVisual.style.width = dragObject.offsetWidth + "px"; + this._dragVisual.style.height = dragObject.offsetHeight + "px"; + + this._dragVisual.style.opacity = "0.4"; + this._dragVisual.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity=0.4);"; + this._originalZIndex = this._dragVisual.style.zIndex; + this._dragVisual.style.zIndex = Sys.Extended.UI.zIndex.DropWatcherDragVisual; + + this._originalParent = this._dragVisual.parentNode; + this._originalNextSibling = Sys.Extended.UI.DragDropManager._getInstance().getNextSibling(this._dragVisual); + + var currentLocation = $common.getLocation(dragObject); + + // Store the drag object in a temporary container to make it self-contained. + var dragVisualContainer = this._getFloatContainer(); + $common.setLocation(dragVisualContainer, currentLocation); + + if(Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._dragVisual)) + this._dragVisual.parentNode.removeChild(this._dragVisual); + + dragVisualContainer.appendChild(this._dragVisual); + + var newOffset = Sys.Extended.UI.DragDropManager._getInstance().getScrollOffset(dragObject, true); + if(oldOffset.x !== newOffset.x || oldOffset.y !== newOffset.y) { + var diff = Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(oldOffset, newOffset); + var location = Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(currentLocation, diff); + + $common.setLocation(dragVisualContainer, location); + } + + return dragVisualContainer; + }, + + get_emptyTemplate: function() { + return this._emptyTemplate; + }, + + set_emptyTemplate: function(value) { + this._emptyTemplate = value; + }, + + get_dragDataType: function() { + return this._dataType; + }, + + set_dragDataType: function(value) { + this._dataType = value; + }, + + getDragData: function(context) { + return context; + }, + + get_dragMode: function() { + return this._dragMode; + }, + + set_dragMode: function(value) { + this._dragMode = value; + }, + + dispose: function() { + Sys.Extended.UI.DragDropManager.unregisterDropTarget(this); + this.get_element().__dragDropList = null; + Sys.Extended.UI.DragDropList.callBaseMethod(this, 'dispose'); + }, + + onDragStart: function() { + this._validate(); + }, + + onDrag: function() { + }, + + onDragEnd: function(cancelled) { + if(this._floatContainerInstance) { + if(this._dragMode === Sys.Extended.UI.DragMode.Copy) { + this._floatContainerInstance.removeChild(this._dragVisual); + } else { + // NOTE: There seems to be a cursor issue in Mozilla when setting the opacity to 1. We + // can work around this by setting the opacity to anything lower than 1 instead. + this._dragVisual.style.opacity = "0.999"; + //_dragVisual.style.opacity = "1"; + this._dragVisual.style.filter = ""; + + this._dragVisual.style.zIndex = this._originalZIndex ? this._originalZIndex : 0; + + // restore the height/width of the drag visual. + // + if(this._dragVisual.preDragWidth != null) { + this._dragVisual.style.width = this._dragVisual.preDragWidth; + this._dragVisual.preDragWidth = null; + } + + if(this._dragVisual.preDragHeight != null) { + this._dragVisual.style.height = this._dragVisual.preDragHeight; + this._dragVisual.preDragHeight = null; + } + + if(cancelled) { + // Re-parent the drag visual to its original position. + this._dragVisual.parentNode.removeChild(this._dragVisual); + + if(this._originalNextSibling != null) + this._originalParent.insertBefore(this._dragVisual, this._originalNextSibling); + else + this._originalParent.appendChild(this._dragVisual); + } else { + if(this._dragVisual.parentNode === this._floatContainerInstance) + this._dragVisual.parentNode.removeChild(this._dragVisual); + } + } + + // Remove the container. + document.body.removeChild(this._floatContainerInstance); + } + else { + this._dragVisual.parentNode.removeChild(this._dragVisual); + } + + if(!cancelled && this._data && this._dragMode === Sys.Extended.UI.DragMode.Move) { + var data = this.getDragData(this._currentContext); + if(this._data && data) + Array.remove(this._data, data); + } + + this._isDragging = false; + this._validate(); + }, + + // -- IDropTarget (related) members -- + + get_direction: function() { + return this._direction; + }, + + set_direction: function(value) { + this._direction = value; + }, + + get_acceptedDataTypes: function() { + return this._acceptedDataTypes; + }, + + set_acceptedDataTypes: function(value) { + if(typeof (value) == "string") + this._acceptedDataTypes = value.split(","); + else + this._acceptedDataTypes = value; + }, + + get_dropCueTemplate: function() { + return this._dropCueTemplate; + }, + + set_dropCueTemplate: function(value) { + this._dropCueTemplate = value; + }, + + get_dropTargetElement: function() { + return this.get_element(); + }, + + canDrop: function(dragMode, dataType, data) { + for(var i = 0; i < this._acceptedDataTypes.length; i++) + if(this._acceptedDataTypes[i] === dataType) + return true; + + return false; + }, + + drop: function(dragMode, dataType, data) { + if(Sys.Extended.UI.DragDropList.IsValidDataType(dataType) && dragMode === Sys.Extended.UI.DragMode.Move) { + // Re-parent the drag visual. + dragVisual = data; + + var potentialNextSibling = this._findPotentialNextSibling(dragVisual); + this._setDropCueVisible(false, dragVisual); + dragVisual.parentNode.removeChild(dragVisual); + + if(potentialNextSibling) + this.get_element().insertBefore(dragVisual, potentialNextSibling); + else + this.get_element().appendChild(dragVisual); + } else { + this._setDropCueVisible(false); + } + }, + + onDragEnterTarget: function(dragMode, dataType, data) { + if(Sys.Extended.UI.DragDropList.IsValidDataType(dataType)) { + this._setDropCueVisible(true, data); + this._validate(); + } + }, + + onDragLeaveTarget: function(dragMode, dataType, data) { + if(Sys.Extended.UI.DragDropList.IsValidDataType(dataType)) { + this._setDropCueVisible(false); + this._validate(); + } + }, + + onDragInTarget: function(dragMode, dataType, data) { + if(Sys.Extended.UI.DragDropList.IsValidDataType(dataType)) + this._setDropCueVisible(true, data); + }, + + _setDropCueVisible: function(visible, dragVisual) { + if(this._dropCueTemplate) { + if(visible) { + if(!this._dropCueTemplateInstance) { + var documentContext = document.createDocumentFragment(); + this._dropCueTemplateInstance = this._dropCueTemplate.cloneNode(true); + } + + var potentialNextSibling = this._findPotentialNextSibling(dragVisual); + + if(!Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._dropCueTemplateInstance)) { + // Add drop cue. + if(potentialNextSibling) + this.get_element().insertBefore(this._dropCueTemplateInstance, potentialNextSibling); + else + this.get_element().appendChild(this._dropCueTemplateInstance); + + this._dropCueTemplateInstance.style.width = dragVisual.offsetWidth + "px"; + this._dropCueTemplateInstance.style.height = dragVisual.offsetHeight + "px"; + } else { + // Move drop cue. + if(Sys.Extended.UI.DragDropManager._getInstance().getNextSibling(this._dropCueTemplateInstance) !== potentialNextSibling) { + this.get_element().removeChild(this._dropCueTemplateInstance); + + if(potentialNextSibling) + this.get_element().insertBefore(this._dropCueTemplateInstance, potentialNextSibling); + else + this.get_element().appendChild(this._dropCueTemplateInstance); + } + } + } else { + if(this._dropCueTemplateInstance && Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._dropCueTemplateInstance)) + this.get_element().removeChild(this._dropCueTemplateInstance); + } + } + }, + + _findPotentialNextSibling: function(dragVisual) { + var dragVisualRect = $common.getBounds(dragVisual), + isVertical = (this._direction === 0 /*Sys.Extended.UI.RepeatDirection.Vertical*/), + nodeRect; + + for(var node = this.get_element().firstChild; node !== null; node = node.nextSibling) { + if(node.innerHTML && node !== this._dropCueTemplateInstance && node !== this._emptyTemplateInstance) { + nodeRect = $common.getBounds(node); + + if((!isVertical && dragVisualRect.x <= nodeRect.x) || (isVertical && dragVisualRect.y <= nodeRect.y)) + return node; + } + } + + return null; + }, + + _validate: function() { + var visible = (this._dropCueTemplateInstance == null || !Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._dropCueTemplateInstance)); + + // Check if there are draggables left in this host. If not, display a placeholder. + var count = 0; + for(var node = this.get_element().firstChild; node !== null; node = node.nextSibling) + if(node.innerHTML && node !== this._emptyTemplateInstance && node !== this._dropCueTemplateInstance) + count++; + + if(count > 0) + visible = false; + + this._setEmptyTemplateVisible(visible); + }, + + _setEmptyTemplateVisible: function(visible) { + if(this._emptyTemplate) + if(visible) { + if(!this._emptyTemplateInstance) + this._emptyTemplateInstance = this._emptyTemplate.createInstance(this.get_element()).instanceElement; + else if(!Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._emptyTemplateInstance)) + this.get_element().appendChild(this._emptyTemplateInstance); + } else { + if(this._emptyTemplateInstance && Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._emptyTemplateInstance)) + this.get_element().removeChild(this._emptyTemplateInstance); + } + }, + + _getFloatContainer: function() { + if(!this._floatContainerInstance) { + this._floatContainerInstance = document.createElement(this.get_element().tagName); + var none = "0px 0px 0px 0px"; + + this._floatContainerInstance.style.position = "absolute"; + this._floatContainerInstance.style.padding = none; + this._floatContainerInstance.style.margin = none; + this._floatContainerInstance.className = 'dragVisualContainer'; + + document.body.appendChild(this._floatContainerInstance); + } else if(!Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._floatContainerInstance)) { + document.body.appendChild(this._floatContainerInstance); + } + + return this._floatContainerInstance; + } +} + +Sys.Extended.UI.DragDropList.registerClass('Sys.Extended.UI.DragDropList', Sys.Extended.UI.BehaviorBase, Sys.Extended.UI.IDragSource, Sys.Extended.UI.IDropTarget, Sys.IDisposable); + +function callbackSuccessStub(response, context) { + var contextSplit = context.split(":"), + id = contextSplit[0], + obj = $find(id); + + if(obj) + obj._onCallbackSuccess(response, contextSplit[1]); +} + +function callbackErrorStub(response, context) { + var contextSplit = context.split(":"), + id = contextSplit[0], + obj = $find(id); + + alert('error'); + if(obj) + obj._onCallbackError(response, contextSplit[1]); +} + +Sys.Extended.UI.DragDropWatcher = function(e) { + Sys.Extended.UI.DragDropWatcher.initializeBase(this, [e]); + + this._childList = new Array(); + this._inProgressDrops = new Object(); + + this._postbackCode = null; + this._callbackCssStyle = null; + + this._argReplaceString = null; + this._argContextString = null; + this._argErrorString = null; + this._argSuccessString = null; +} + +Sys.Extended.UI.DragDropWatcher.prototype = { + + dispose: function() { + Sys.Extended.UI.DragDropWatcher.callBaseMethod(this, 'dispose'); + + }, + + initialize: function() { + Sys.Extended.UI.DragDropWatcher.callBaseMethod(this, 'initialize'); + + this._saveChildOrder(); + }, + + add_reorderComplete: function(handler) { + this.get_events().addHandler("reorderComplete", handler); + }, + + remove_reorderComplete: function(handler) { + this.get_events().removeHandler("reorderComplete", handler); + }, + + raiseReorderComplete: function() { + var handler = this.get_events().getHandler("reorderComplete"); + if(handler) + handler(this, Sys.EventArgs.Empty); + }, + + findChild: function(parent, childId) { + // just walk through the list of children looking for the child + var childIndex = 0, + nodes = parent.childNodes; + + for(var i = 0; i < nodes.length; i++) { + var item = nodes[i]; + + // nodeName check is for Safari which enumerates LI contents as well + if((item != null) && (item.nodeName == "LI")) { + if(item.id == childId) + return childIndex; + + childIndex++; + } + } + + return -1; + }, + + canDrop: function(dragMode, dataType, data) { + if(this._inProgressDrops && this._inProgressDrops.length > 0) + return false; + + var dropOk = Sys.Extended.UI.DragDropWatcher.callBaseMethod(this, 'canDrop', [dragMode, dataType, data]); + + if(dropOk) { + // data is the thing being dragged + var dragVisualRect = $common.getBounds(data), + nodeRect, + hitInsertNode = false, + e = this.get_element(); + + for(var node = e.firstChild; node != null && !hitInsertNode; node = node.nextSibling) { + if(!node.id) + continue; + + nodeRect = $common.getBounds(node); + if(dragVisualRect.y <= nodeRect.y) + break; + + hitInsertNode = (node.id.lastIndexOf("Insert", node.id.length - 6) != -1); + } + dropOk = !hitInsertNode; + } + + return dropOk; + }, + + drop: function(dragMode, dataType, data) { + Sys.Extended.UI.DragDropWatcher.callBaseMethod(this, 'drop', [dragMode, dataType, data]); + + var childId = data.id; + if(!this._postbackCode || !childId) + return; + + // figure out which child index we're moving to + var newIndex = this.findChild(this.get_element(), childId); + Sys.Debug.assert(newIndex != -1, String.format(Sys.Extended.UI.Resources.ReorderList_DropWatcherBehavior_NoChild, childId)); + + var oldIndex = this._getSavedChildIndex(childId); + if(newIndex != -1 && newIndex != oldIndex) { + this._saveChildOrder(); + this.doPostBack(childId, newIndex, oldIndex); + } + }, + + _setupDropState: function(childId, newIndex, oldIndex) { + if(childId) { + var child = $get(childId); + this._inProgressDrops[childId] = { "oldCss": child.className, "newIndex": newIndex, "oldIndex": oldIndex }; + + if(this._callbackCssStyle) + child.className = this._callbackCssStyle; + } + }, + + _onDropCallback: function(childId) { + if(childId) { + + this.set_ClientState("true"); + + var item = this._inProgressDrops[childId]; + + if(item) { + var child = $get(childId); + + if(this._callbackCssStyle) + child.className = item.oldCss; + + delete this._inProgressDrops[childId]; + } + + return item; + } + }, + + + doPostBack: function(childId, newIndex, oldIndex) { + var item = this._inProgressDrops[childId]; + + if(item) + // don't allow recursive drops. + return; + + // setup the postback string + var postbackArg = "reorder:" + childId + ":" + oldIndex.toString() + ":" + newIndex.toString(); + + // replace the specified replace string with the arg and build the full postback string + var postbackCode = this._postbackCode.replace(this._argReplaceString, postbackArg); + + if(this._argSuccessString) + postbackCode = postbackCode.replace(this._argSuccessString, "callbackSuccessStub"); + + if(this._argErrorString) + postbackCode = postbackCode.replace(this._argErrorString, "callbackErrorStub"); + + if(this._argContextString) + postbackCode = postbackCode.replace(this._argContextString, this.get_id() + ":" + childId); + + this._setupDropState(childId, newIndex, oldIndex); + + window.setTimeout(postbackCode, 0); + }, + + _onCallbackSuccess: function(response, context) { + if(response && response.length > 0) { + this._onCallbackError(response, context); + } else { + this._onDropCallback(context); + this.raiseReorderComplete(); + } + + }, + + _onCallbackError: function(response, context) { + var item = this._onDropCallback(context); + + // undo the move + if(item.oldIndex || item.newIndex) { + this._saveChildOrder(); + this.doReorder(item.newIndex, item.oldIndex, true); + } + + alert(String.format(Sys.Extended.UI.Resources.ReorderList_DropWatcherBehavior_CallbackError, response)); + }, + + doReorder: function(oldIndex, newIndex, skipPostback) { + var e = this.get_element(), + children = this._childList; + + if(oldIndex >= 0 && children.length > oldIndex && oldIndex != newIndex) { + var child = $get(children[oldIndex]), + item = this._inProgressDrops[child.id]; + + if(item) + // don't allow recursive drops. + return; + + if(child) { + if(newIndex > oldIndex) + // if the destination element is after the source element + // we can't insert after, we need to insert after. + // so we increment the newIndex. + newIndex++; + + var append = newIndex >= children.length; + + try { + e.removeChild(child); + } catch(e) { + // Safari likes to throw NOT_FOUND_ERR (DOMException 8) + // but it seems to work fine anyway. + // + } + + if(append) { + e.appendChild(child); + } else { + var childAtNewIndex = $get(children[newIndex]); + e.insertBefore(child, childAtNewIndex); + } + + if(!skipPostback) { + this.doPostBack(child.id, newIndex, oldIndex); + } else { + this._saveChildOrder(); + this.raiseReorderComplete(); + } + } + } + }, + + getItem: function(index) { + if(!this._childList) + this._saveChildOrder(); + + return this._childList[index]; + }, + + _getSavedChildIndex: function(childId) { + if(this._childList && childId) + for(var i = 0; i < this._childList.length; i++) + if(childId == this._childList[i]) + return i; + + return -1; + }, + + _saveChildOrder: function() { + var e = this.get_element(); + if(!e) + return; + + var children = e.childNodes; + this._childList = []; + var childCount = 0; + + for(var i = 0; i < children.length; i++) + // note Safari is returning all children, not just direct ones + if(children[i] && children[i].parentNode === e && children[i].tagName && children[i].tagName.toLowerCase() == "li") + this._childList[childCount++] = children[i].id; + }, + + + get_argReplaceString: function() { + return this._argReplaceString; + }, + + set_argReplaceString: function(value) { + if(this._argReplaceString != value) { + this._argReplaceString = value; + this.raisePropertyChanged('argReplaceString'); + } + }, + + get_argContextString: function() { + return this._argContextString; + }, + + set_argContextString: function(value) { + if(this._argContextString != value) { + this._argContextString = value; + this.raisePropertyChanged('argContextString'); + } + }, + + get_argErrorString: function() { + return this._argErrorString; + }, + + set_argErrorString: function(value) { + if(this._argErrorString != value) { + this._argErrorString = value; + this.raisePropertyChanged('argErrorString'); + } + }, + + get_argSuccessString: function() { + return this._argSuccessString; + }, + + set_argSuccessString: function(value) { + if(this._argSuccessString != value) { + this._argSuccessString = value; + this.raisePropertyChanged('argSuccessString'); + } + }, + + get_postbackCode: function() { + return this._postbackCode; + }, + + set_postbackCode: function(value) { + if(this._postbackCode != value) { + this._postbackCode = value; + this.raisePropertyChanged('postbackCode'); + } + }, + + get_callbackCssStyle: function() { + return this._callbackCssStyle; + }, + + set_callbackCssStyle: function(value) { + if(this._callbackCssStyle != value) { + this._callbackCssStyle = value; + this.raisePropertyChanged('callbackCssStyle'); + } + } +} + +Sys.Extended.UI.DragDropWatcher.registerClass('Sys.Extended.UI.DragDropWatcher', Sys.Extended.UI.DragDropList); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DynamicPopulate.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DynamicPopulate.debug.js new file mode 100644 index 000000000..b6b78567d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/DynamicPopulate.debug.js @@ -0,0 +1,421 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.DynamicPopulateBehavior = function(element) { + // The DynamicPopulateBehavior replaces the contents of an element with the result of a web service or page method call. + // The method call returns a string of HTML that is inserted as the children of the target element. + // [element] is DOM Element the behavior is associated with. + Sys.Extended.UI.DynamicPopulateBehavior.initializeBase(this, [element]); + + this._servicePath = location.pathname; + this._serviceMethod = null; + this._contextKey = null; + this._cacheDynamicResults = false; + this._populateTriggerID = null; + this._setUpdatingCssClass = null; + this._clearDuringUpdate = true; + this._customScript = null; + + this._clickHandler = null; + + this._callID = 0; + this._currentCallID = -1; + + this._populated = false; +} + +Sys.Extended.UI.DynamicPopulateBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.DynamicPopulateBehavior.callBaseMethod(this, 'initialize'); + $common.prepareHiddenElementForATDeviceUpdate(); + + if(this._populateTriggerID) { + var populateTrigger = $get(this._populateTriggerID); + + if(populateTrigger) { + this._clickHandler = Function.createDelegate(this, this._onPopulateTriggerClick); + $addHandler(populateTrigger, "click", this._clickHandler); + } + } + }, + + dispose: function() { + if(this._populateTriggerID && this._clickHandler) { + var populateTrigger = $get(this._populateTriggerID); + + if(populateTrigger) + $removeHandler(populateTrigger, "click", this._clickHandler); + + this._populateTriggerID = null; + this._clickHandler = null; + } + + Sys.Extended.UI.DynamicPopulateBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Uses dymanic content to populate the target element. + /// + /// + /// If an element to populate is in a data-bound repeating control, the contextKey parameter can be an ID of the current row. + /// + /// A string to pass to the Web service method or page method. + /// + populate: function(contextKey) { + // An arbitrary string value to be passed to the web method. For example, if the element to be populated is within a data-bound repeater, this could be the ID of the current row. + + if(contextKey) + this._contextKey = contextKey; + + if(this._populated && this._cacheDynamicResults) + return; + + if(this._currentCallID == -1) { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_populating(eventArgs); + + if(eventArgs.get_cancel()) + return; + + this._setUpdating(true); + } + + if(this._customScript) { + var scriptResult = eval(this._customScript); + + this._setTargetHtml(scriptResult); + this._setUpdating(false); + } else { + this._currentCallID = ++this._callID; + + if(!this._servicePath || !this._serviceMethod) + return; + + Sys.Net.WebServiceProxy.invoke(this._servicePath, this._serviceMethod, false, + { contextKey: (contextKey ? contextKey : this._contextKey) }, + Function.createDelegate(this, this._onMethodComplete), Function.createDelegate(this, this._onMethodError), + this._currentCallID); + $common.updateFormToRefreshATDeviceBuffer(); + } + }, + + _onMethodComplete: function(result, userContext, methodName) { + // Callback used when the populating service returns successfully + if(userContext != this._currentCallID) + return; + + this._setTargetHtml(result); + this._setUpdating(false); + }, + + _onMethodError: function(webServiceError, userContext, methodName) { + // Callback used when the populating service fails + if(userContext != this._currentCallID) + return; + + if(webServiceError.get_timedOut()) + this._setTargetHtml(Sys.Extended.UI.Resources.DynamicPopulate_WebServiceTimeout); + else + this._setTargetHtml(String.format(Sys.Extended.UI.Resources.DynamicPopulate_WebServiceError, webServiceError.get_statusCode())); + + this._setUpdating(false); + }, + + _onPopulateTriggerClick: function() { + this.populate(this._contextKey); + }, + + _setUpdating: function(updating) { + // Toggle the display elements to indicate if they are being updated or not + // updating - Whether or not the display should indicated it is being updated + this.setStyle(updating); + + if(!updating) { + this._currentCallID = -1; + this._populated = true; + this.raise_populated(this, Sys.EventArgs.Empty); + } + }, + + _setTargetHtml: function(value) { + var e = this.get_element() + if(e) { + if(e.tagName == "INPUT") + e.value = value; + else + e.innerHTML = value; + } + }, + + /// + /// Sets the dislpayed style. + /// + /// A Boolean value that specifies whether the display is being updated. + /// + setStyle: function(updating) { + // Set the style of the display + // updating - Whether or not the display is being updated + var e = this.get_element(); + if(this._setUpdatingCssClass) { + if(!updating) { + e.className = this._oldCss; + this._oldCss = null; + } else { + this._oldCss = e.className; + e.className = this._setUpdatingCssClass; + } + } + + if(updating && this._clearDuringUpdate) + this._setTargetHtml(""); + }, + + /// + /// A Boolean value that specifies whether or the target content should be cleared when the update begins. + /// + /// get_clearContentsDuringUpdate + /// set_clearContentsDuringUpdate + /// + get_clearContentsDuringUpdate: function() { + return this._clearDuringUpdate; + }, + set_clearContentsDuringUpdate: function(value) { + if(this._clearDuringUpdate != value) { + this._clearDuringUpdate = value; + this.raisePropertyChanged('clearContentsDuringUpdate'); + } + }, + + get_ClearContentsDuringUpdate: function() { + Sys.Extended.Deprecated("get_ClearContentsDuringUpdate", "get_clearContentsDuringUpdate"); + return this.get_clearContentsDuringUpdate(); + }, + set_ClearContentsDuringUpdate: function(value) { + Sys.Extended.Deprecated("set_ClearContentsDuringUpdate", "set_clearContentsDuringUpdate"); + this.set_clearContentsDuringUpdate(value); + }, + + /// + /// A string to pass to the Web method. + /// + /// get_contextKey + /// set_contextKey + /// + get_contextKey: function() { + // An arbitrary string value to be passed to the web method. + // For example, if the element to be populated is within a + // data-bound repeater, this could be the ID of the current row. + return this._contextKey; + }, + set_contextKey: function(value) { + if(this._contextKey != value) { + this._contextKey = value; + this.raisePropertyChanged('contextKey'); + } + }, + + get_ContextKey: function() { + Sys.Extended.Deprecated("get_ContextKey", "get_contextKey"); + return this.get_contextKey(); + }, + set_ContextKey: function(value) { + Sys.Extended.Deprecated("set_ContextKey", "set_contextKey"); + this.set_contextKey(value); + }, + + /// + /// TA name of an element that can be clicked to trigger the target element population. + /// + /// get_populateTriggerID + /// set_populateTriggerID + /// + get_populateTriggerID: function() { + // Name of an element that triggers the population of the target when clicked + return this._populateTriggerID; + }, + set_populateTriggerID: function(value) { + if(this._populateTriggerID != value) { + this._populateTriggerID = value; + this.raisePropertyChanged('populateTriggerID'); + } + }, + + get_PopulateTriggerID: function() { + Sys.Extended.Deprecated("get_PopulateTriggerID", "get_populateTriggerID"); + return this.get_populateTriggerID(); + }, + set_PopulateTriggerID: function(value) { + Sys.Extended.Deprecated("set_PopulateTriggerID", "set_populateTriggerID"); + this.set_populateTriggerID(value); + }, + + /// + /// The Web service URL to call. + /// + /// + /// This property is optional. If the ServicePath property is not set, a page method is invoked instead of a Web service. + /// + /// get_servicePath + /// set_servicePath + /// + get_servicePath: function() { + return this._servicePath; + }, + set_servicePath: function(value) { + if(this._servicePath != value) { + this._servicePath = value; + this.raisePropertyChanged('servicePath'); + } + }, + + get_ServicePath: function() { + Sys.Extended.Deprecated("get_ServicePath", "get_servicePath"); + return this.get_servicePath(); + }, + set_ServicePath: function(value) { + Sys.Extended.Deprecated("set_ServicePath", "set_servicePath"); + this.set_servicePath(value); + }, + + /// + /// The method name to call on the Web service or a page. + /// + /// get_serviceMethod + /// set_serviceMethod + /// + get_serviceMethod: function() { + // The signature of the method must exactly match the following: + // [WebMethod] + // string DynamicPopulateMethod(string contextKey) { + // .... + // } + return this._serviceMethod; + }, + set_serviceMethod: function (value) { + if(this._serviceMethod != value) { + this._serviceMethod = value; + this.raisePropertyChanged('serviceMethod'); + } + }, + + get_ServiceMethod: function() { + Sys.Extended.Deprecated("get_ServiceMethod", "get_serviceMethod"); + return this.get_serviceMethod(); + }, + set_ServiceMethod: function(value) { + Sys.Extended.Deprecated("set_ServiceMethod", "set_serviceMethod"); + this.set_serviceMethod(value); + }, + + /// + /// A Boolean value that specifies whether or not the results of the target + /// element population should be cached and not fetched again after the first load. + /// + /// get_cacheDynamicResults + /// set_cacheDynamicResults + /// + get_cacheDynamicResults: function() { + return this._cacheDynamicResults; + }, + set_cacheDynamicResults: function(value) { + if(this._cacheDynamicResults != value) { + this._cacheDynamicResults = value; + this.raisePropertyChanged('cacheDynamicResults'); + } + }, + + /// + /// The name of the CSS class to apply to the target during asynchronous calls. + /// + /// get_updatingCssClass + /// set_updatingCssClass + /// + get_updatingCssClass: function() { + return this._setUpdatingCssClass; + }, + set_updatingCssClass: function(value) { + if(this._setUpdatingCssClass != value) { + this._setUpdatingCssClass = value; + this.raisePropertyChanged('updatingCssClass'); + } + }, + + get_UpdatingCssClass: function() { + Sys.Extended.Deprecated("get_UpdatingCssClass", "get_updatingCssClass"); + return this.get_updatingCssClass(); + }, + set_UpdatingCssClass: function(value) { + Sys.Extended.Deprecated("set_UpdatingCssClass", "set_updatingCssClass"); + this.set_updatingCssClass(value); + }, + + /// + /// The script to invoke instead of calling a Web service or page method. + /// + /// get_customScript + /// set_customScript + /// + get_customScript: function() { + // The script to invoke instead of calling a Web or Page method. This script must evaluate to a string value. + return this._customScript; + }, + set_customScript: function(value) { + if(this._customScript != value) { + this._customScript = value; + this.raisePropertyChanged('customScript'); + } + }, + + get_CustomScript: function() { + Sys.Extended.Deprecated("get_CustomScript", "get_customScript"); + return this.get_customScript(); + }, + set_CustomScript: function(value) { + Sys.Extended.Deprecated("set_CustomScript", "set_customScript"); + this.set_customScript(value); + }, + + /// + /// Fires when populating starts. + /// + /// + /// + add_populating: function(handler) { + this.get_events().addHandler('populating', handler); + }, + remove_populating: function(handler) { + this.get_events().removeHandler('populating', handler); + }, + raise_populating: function(eventArgs) { + var handler = this.get_events().getHandler('populating'); + if(handler) + handler(this, eventArgs); + }, + raisePopulating: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulating(eventArgs)", "raise_populating(eventArgs)"); + this.raise_populating(eventArgs); + }, + + /// + /// Fires when populating ends. + /// + /// + /// + add_populated: function(handler) { + this.get_events().addHandler('populated', handler); + }, + remove_populated: function(handler) { + this.get_events().removeHandler('populated', handler); + }, + raise_populated: function(eventArgs) { + var handler = this.get_events().getHandler('populated'); + if(handler) + handler(this, eventArgs); + }, + raisePopulated: function(eventArgs) { + Sys.Extended.Deprecated("raisePopulated(eventArgs)", "raise_populated(eventArgs)"); + this.raise_populated(eventArgs); + } +} + +Sys.Extended.UI.DynamicPopulateBehavior.registerClass('Sys.Extended.UI.DynamicPopulateBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js new file mode 100644 index 000000000..bcd0529cf --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js @@ -0,0 +1,497 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.FilteredTextBoxBehavior = function(element) { + // The FilteredTextBoxBehavior is used to prevent invalid characters from being entered into a textbox + // "element" - the textbox element this behavior is associated with + Sys.Extended.UI.FilteredTextBoxBehavior.initializeBase(this, [element]); + + this._keypressHandler = null; + this._changeHandler = null; + + this._intervalID = null; + + this._filterType = Sys.Extended.UI.FilterTypes.Custom; + this._filterMode = Sys.Extended.UI.FilterModes.ValidChars; + this._validChars = null; + this._invalidChars = null; + this._filterInterval = 250; + + this.charTypes = {}; + this.charTypes.LowercaseLetters = "abcdefghijklmnopqrstuvwxyz"; + this.charTypes.UppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + this.charTypes.Numbers = "0123456789"; +} + +Sys.Extended.UI.FilteredTextBoxBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(this, 'initialize'); + + var element = this.get_element(); + + this._keypressHandler = Function.createDelegate(this, this._onkeypress); + $addHandler(element, 'keypress', this._keypressHandler); + + this._changeHandler = Function.createDelegate(this, this._onchange); + $addHandler(element, 'change', this._changeHandler); + + var callback = Function.createDelegate(this, this._intervalCallback); + this._intervalID = window.setInterval(callback, this._filterInterval); + }, + + dispose: function() { + var element = this.get_element(); + + $removeHandler(element, 'keypress', this._keypressHandler); + this._keypressHandler = null; + + $removeHandler(element, 'change', this._changeHandler); + this._changeHandler = null; + + window.clearInterval(this._intervalID); + + Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(this, 'dispose'); + }, + + _getValidChars: function() { + if(this._validChars) + return this._validChars; + + this._validChars = ""; + + for(type in this.charTypes) { + var filterType = Sys.Extended.UI.FilterTypes.toString(this._filterType); + + if(filterType.indexOf(type) != -1) + this._validChars += this.charTypes[type]; + } + + return this._validChars; + }, + + _getInvalidChars: function() { + // Get all the invalid characters (in case of custom filtering and InvalidChars mode) + // returns all invalid characters + if(!this._invalidChars) + this._invalidChars = this.charTypes.Custom; + + return this._invalidChars; + }, + + _onkeypress: function(evt) { + // Handler for the target textbox's key press event + // "evt" - event info + + // This handler will only get called for valid characters in IE, we use keyCode + + // In FireFox, this will be called for all key presses, with charCode/which + // being set for keys we should filter (e.g. the chars) and keyCode being + // set for all other keys. + + // scanCode = event.charCode + + // In Safari, charCode, which, and keyCode will all be filled with the same value, + // as well as keyIdentifier, which has the string representation either as "end" or "U+00000008" + + // 1) Check for ctrl/alt/meta -> bail if true + // 2) Check for keyIdentifier.startsWith("U+") -> bail if false + // 3) Check keyCode < 0x20 -> bail + // 4) Special case Delete (63272) -> bail + + var scanCode; + + // Note (Supergibbs): Changed to handle all majors browsers + // IE and Safari only fires for valid characters + // Firefox sets charCode to 0 and uses keyCode for special keys + // Opera always fires but you cannot distinguish which are valid or special keys + if((((/* ff */ evt.rawEvent.charCode == 0) || + (/* opera */ evt.rawEvent.keyCode == evt.rawEvent.which && evt.rawEvent.charCode == undefined)) && + ((evt.rawEvent.keyCode == Sys.UI.Key.pageUp) || + (evt.rawEvent.keyCode == Sys.UI.Key.pageDown) || + (evt.rawEvent.keyCode == Sys.UI.Key.up) || + (evt.rawEvent.keyCode == Sys.UI.Key.down) || + (evt.rawEvent.keyCode == Sys.UI.Key.left) || + (evt.rawEvent.keyCode == Sys.UI.Key.right) || + (evt.rawEvent.keyCode == Sys.UI.Key.home) || + (evt.rawEvent.keyCode == Sys.UI.Key.end) || + (evt.rawEvent.keyCode == 46 /* Delete */))) || + (evt.ctrlKey /* Control keys */)) + return; + + if(evt.rawEvent.keyIdentifier) { + // Safari + // Note (Garbin): used the underlying rawEvent insted of the DomEvent instance. + if(evt.rawEvent.ctrlKey || evt.rawEvent.altKey || evt.rawEvent.metaKey) + return; + + if(evt.rawEvent.keyIdentifier.substring(0, 2) != "U+") + return; + + scanCode = evt.rawEvent.charCode; + if(scanCode == 63272 /* Delete */) + return; + } else { + scanCode = evt.charCode; + } + + if(scanCode && scanCode >= 0x20 /* space */) { + var c = String.fromCharCode(scanCode); + + if(!this._processKey(c)) + evt.preventDefault(); + } + }, + + _processKey: function(key) { + // Determine whether the key is valid or whether it should be filtered out + // "key" - character to be validated + // returns true if the character should be accepted, false if it should be filtered + + // Allow anything that's not a printable character, + // e.g. backspace, arrows, etc. Everything above 32 + // should be considered allowed, as it may be Unicode, etc. + var filter = "", + shouldFilter = false; + + if(this._filterMode == Sys.Extended.UI.FilterModes.ValidChars) { + filter = this._getValidChars(); + + // Determine if we should accept the character + shouldFilter = filter && (filter.length > 0) && (filter.indexOf(key) == -1); + } else { + filter = this._getInvalidChars(); + + // Determine if we should accept the character + shouldFilter = filter && (filter.length > 0) && (filter.indexOf(key) > -1); + } + + // Raise the processKey event and allow handlers to intercept + // and decide whether the key should be allowed + var eventArgs = new Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs(key, Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value(), shouldFilter); + this.raise_processKey(eventArgs); + + // If a processKey handler decided the key should be allowed, just + // return true and pass it through (note that the default value of + // allowKey is the opposite of shouldFilter so it will work as normal + // if no one is handling the event) + if(eventArgs.get_allowKey()) + return true; + + // Else if it was decided that it shouldn't be allowed, + // raise the Filtered event and return false to filter the key + this.raiseFiltered(new Sys.Extended.UI.FilteredTextBoxEventArgs(key)); + + return false; + }, + + _onchange: function() { + // Handler for the target textbox's key change event which will filter + // the text again (to make sure no text was inserted without keypresses, etc.) + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + text = wrapper.get_Value() || '', + result = new Sys.StringBuilder(); + + for(var i = 0; i < text.length; i++) { + var ch = text.substring(i, i + 1); + + if(this._processKey(ch)) + result.append(ch); + } + + // change the value only if it is different + if(wrapper.get_Value() != result.toString()) + wrapper.set_Value(result.toString()); + }, + + _intervalCallback: function() { + // Method that is repeatedly called to purge invalid characters from the textbox + + this._changeHandler(); + }, + + /// + /// A string that consists of all characters that are considered + /// valid for the text box when the field type is Custom. + /// + /// + /// If the field type is not Custom, this property value is ignored. + /// + /// get_validChars + /// set_validChars + /// + get_validChars: function() { + // A string consisting of all characters considered valid for the textbox, if + // "Custom" is specified as the field type. Otherwise this parameter is ignored. + return this.charTypes.Custom; + }, + set_validChars: function(value) { + if(this._validChars != null || this.charTypes.Custom != value) { + this.charTypes.Custom = value; + this._validChars = null; + this.raisePropertyChanged('validChars'); + } + }, + + get_ValidChars: function() { + Sys.Extended.Deprecated("get_ValidChars", "get_validChars"); + return this.get_validChars(); + }, + set_ValidChars: function(value) { + Sys.Extended.Deprecated("set_ValidChars", "set_validChars"); + this.set_validChars(value); + }, + + /// + /// A string that consists of all characters that are considered + /// invalid for the text box when the field type is Custom. + /// + /// + /// If the field type is not Custom, this property value is ignored. + /// + /// get_invalidChars + /// set_invalidChars + /// + get_invalidChars: function() { + return this.charTypes.Custom; + }, + set_invalidChars: function(value) { + if(this._invalidChars != null || this.charTypes.Custom != value) { + this.charTypes.Custom = value; + this._invalidChars = null; + this.raisePropertyChanged('invalidChars'); + } + }, + + get_InvalidChars: function() { + Sys.Extended.Deprecated("get_InvalidChars", "get_invalidChars"); + return this.get_invalidChars(); + }, + set_InvalidChars: function(value) { + Sys.Extended.Deprecated("set_InvalidChars", "set_invalidChars"); + this.set_invalidChars(value); + }, + + /// + /// The Sys.Extended.UI.FilterTypes object to apply to a FilterTextBox instance. + /// + /// + /// The filter type to apply can be a comma-separated combination of the following values: + /// Numbers, LowercaseLetters, UppercaseLetters, and Custom. + /// If Custom is specified, the ValidChars property will be used in addition to other settings, such as Numbers. + /// + /// get_filterType + /// set_filterType + /// + get_filterType: function() { + return this._filterType; + }, + set_filterType: function(value) { + if(this._validChars != null || this._filterType != value) { + this._filterType = value; + this._validChars = null; + this.raisePropertyChanged('filterType'); + } + }, + + get_FilterType: function() { + Sys.Extended.Deprecated("get_FilterType", "get_filterType"); + return this.get_filterType(); + }, + set_FilterType: function(value) { + Sys.Extended.Deprecated("set_FilterType", "set_filterType"); + this.set_filterType(value); + }, + + /// + /// The Sys.Extended.UI.FilterModes object that specifies the mode to apply to a FilterTextBox instance. + /// + /// + /// Supported values are ValidChars and InvalidChars. + /// + /// get_filterMode + /// set_filterMode + /// + get_filterMode: function() { + return this._filterMode; + }, + set_filterMode: function(value) { + if(this._validChars != null || this._invalidChars != null || this._filterMode != value) { + this._filterMode = value; + this._validChars = null; + this._invalidChars = null; + this.raisePropertyChanged('filterMode'); + } + }, + + get_FilterMode: function() { + Sys.Extended.Deprecated("get_FilterMode", "get_filterMode"); + return this.get_filterMode(); + }, + set_FilterMode: function(value) { + Sys.Extended.Deprecated("set_FilterMode", "set_filterMode"); + this.set_filterMode(value); + }, + + /// + /// An interval in milliseconds, in which the field's content is filtered. + /// + /// get_filterInterval + /// set_filterInterval + /// + get_filterInterval: function() { + return this._filterInterval; + }, + set_filterInterval: function(value) { + if(this._filterInterval != value) { + this._filterInterval = value; + this.raisePropertyChanged('filterInterval'); + } + }, + + get_FilterInterval: function() { + Sys.Extended.Deprecated("get_FilterInterval", "get_filterInterval"); + return this.get_filterInterval(); + }, + set_FilterInterval: function(value) { + Sys.Extended.Deprecated("set_FilterInterval", "set_filterInterval"); + this.set_filterInterval(value); + }, + + /// + /// Fires when a key is processed. + /// + /// + /// + add_processKey: function(handler) { + this.get_events().addHandler('processKey', handler); + }, + remove_processKey: function(handler) { + this.get_events().removeHandler('processKey', handler); + }, + raise_processKey: function(eventArgs) { + var handler = this.get_events().getHandler('processKey'); + if(handler) + handler(this, eventArgs); + }, + raiseProcessKey: function(eventArgs) { + Sys.Extended.Deprecated("raiseProcessKey(eventArgs)", "raise_processKey(eventArgs)"); + this.raise_processKey(eventArgs); + }, + + /// + /// Fires when the TextBox is filtered. + /// + /// + /// + add_filtered: function(handler) { + this.get_events().addHandler('filtered', handler); + }, + remove_filtered: function(handler) { + this.get_events().removeHandler('filtered', handler); + }, + raise_filtered: function(eventArgs) { + var handler = this.get_events().getHandler('filtered'); + if(handler) + handler(this, eventArgs); + }, + raiseFiltered: function(eventArgs) { + Sys.Extended.Deprecated("raiseFiltered(eventArgs)", "raise_filtered(eventArgs)"); + this.raise_filtered(eventArgs); + } +} + +Sys.Extended.UI.FilteredTextBoxBehavior.registerClass('Sys.Extended.UI.FilteredTextBoxBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.FilterTypes = function() { + // Character filter to be applied to a textbox + // "Custom" - custom Characters + // "Numbers" - numbers (0123456789) + // "UppercaseLetters" - uppercase Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ) + // "LowercaseLetters" - lowercase Letters (abcdefghijklmnopqrstuvwxyz) + throw Error.invalidOperation(); +} + +Sys.Extended.UI.FilterTypes.prototype = { + Custom: 0x1, + Numbers: 0x2, + UppercaseLetters: 0x4, + LowercaseLetters: 0x8 +} + +Sys.Extended.UI.FilterTypes.registerEnum('Sys.Extended.UI.FilterTypes', true); + +Sys.Extended.UI.FilterModes = function() { + // Filter mode to be applied to a textbox + // "ValidChars" - provide a list of valid characters + // "InvalidChars" - provide a list of invalid characters + throw Error.invalidOperation(); +} + +Sys.Extended.UI.FilterModes.prototype = { + ValidChars: 0x1, + InvalidChars: 0x2 +} + +Sys.Extended.UI.FilterModes.registerEnum('Sys.Extended.UI.FilterModes', true); + +Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs = function(key, text, shouldFilter) { + // Event arguments used when the processKey event is raised + // "key" - key to be processed + // "text" - current text in the textbox + // "shouldFilter" - whether the character should be filtered given the current filteredTextBox settings + Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.initializeBase(this); + + this._key = key; + this._text = text; + this._shouldFilter = shouldFilter; + this._allowKey = !shouldFilter; +} + +Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.prototype = { + + get_key: function() { + // Key to be processed + return this._key; + }, + + get_text: function() { + // Current text in the textbox + return this._text; + }, + + get_shouldFilter: function() { + // Whether the character should be filtered given the current + // FilteredTextBox settings + return this._shouldFilter; + }, + + get_allowKey: function() { + // Whether or not the key will be filtered. It defaults to the opposite of + // shouldFilter and should be set by handlers of the processKey event. + return this._allowKey; + }, + + set_allowKey: function(value) { + this._allowKey = value; + } +} + +Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.registerClass('Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs', Sys.EventArgs); + +Sys.Extended.UI.FilteredTextBoxEventArgs = function(key) { + // Event arguments used when the filtered event is raised + // "key" - key that was filtered + Sys.Extended.UI.FilteredTextBoxEventArgs.initializeBase(this); + + this._key = key; +} + +Sys.Extended.UI.FilteredTextBoxEventArgs.prototype = { + + get_key: function() { + // Key that was filtered + return this._key; + } +} + +Sys.Extended.UI.FilteredTextBoxEventArgs.registerClass('Sys.Extended.UI.FilteredTextBoxEventArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FloatingBehavior.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FloatingBehavior.debug.js new file mode 100644 index 000000000..6e293c2b3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/FloatingBehavior.debug.js @@ -0,0 +1,192 @@ +Sys.Extended.UI.FloatingBehavior = function(element) { + Sys.Extended.UI.FloatingBehavior.initializeBase(this, [element]); + + var _handle, + _location, + _dragStartLocation, + _profileProperty, + _profileComponent; + + var _mouseDownHandler = Function.createDelegate(this, mouseDownHandler); + + /// + /// Move event handler. + /// + /// + /// + this.add_move = function(handler) { + this.get_events().addHandler('move', handler); + } + this.remove_move = function(handler) { + this.get_events().removeHandler('move', handler); + } + + /// + /// Handles to drag the panel around. + /// + ///get_handle + ///set_handle + /// + this.get_handle = function() { + return _handle; + } + this.set_handle = function(value) { + if(_handle != null) + $removeHandler(_handle, "mousedown", _mouseDownHandler); + + _handle = value; + $addHandler(_handle, "mousedown", _mouseDownHandler); + } + + this.get_profileProperty = function() { + return _profileProperty; + } + this.set_profileProperty = function(value) { + _profileProperty = value; + } + + this.get_profileComponent = function() { + return _profileComponent; + } + this.set_profileComponent = function(value) { + _profileComponent = value; + } + + /// + /// Defines the location of an element being dragged. + /// + ///get_location + ///set_location + /// + this.get_location = function() { + return _location; + } + this.set_location = function(value) { + if(_location != value) { + _location = value; + + if(this.get_isInitialized()) + $common.setLocation(this.get_element(), _location); + + this.raisePropertyChanged('location'); + } + } + + this.initialize = function() { + Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'initialize'); + Sys.Extended.UI.DragDropManager.registerDropTarget(this); + + var el = this.get_element(); + + if(!_location) + _location = $common.getLocation(el); + + el.style.position = "fixed"; + $common.setLocation(el, _location); + } + + this.dispose = function() { + Sys.Extended.UI.DragDropManager.unregisterDropTarget(this); + if(_handle && _mouseDownHandler) + $removeHandler(_handle, "mousedown", _mouseDownHandler); + + _mouseDownHandler = null; + Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'dispose'); + } + + this.checkCanDrag = function(element) { + var undraggableTagNames = ["input", "button", "select", "textarea", "label"], + tagName = element.tagName; + + if((tagName.toLowerCase() == "a") && (element.href != null) && (element.href.length > 0)) + return false; + + if(Array.indexOf(undraggableTagNames, tagName.toLowerCase()) > -1) + return false; + + return true; + } + + function mouseDownHandler(ev) { + window._event = ev; + var el = this.get_element(); + + if(this.checkCanDrag(ev.target)) { + _dragStartLocation = $common.getLocation(el); + + ev.preventDefault(); + + this.startDragDrop(el); + } + } + + // Type get_dataType() + this.get_dragDataType = function() { + return "_floatingObject"; + } + + // Object get_data(Context) + this.getDragData = function(context) { + return null; + } + + // DragMode get_dragMode() + this.get_dragMode = function() { + return Sys.Extended.UI.DragMode.Move; + } + + // void onDragStart() + this.onDragStart = function() { } + + // void onDrag() + this.onDrag = function() { } + + this.onDragEnd = function(canceled) { + if(!canceled) { + var handler = this.get_events().getHandler('move'); + + if(handler) { + var cancelArgs = new Sys.CancelEventArgs(); + + handler(this, cancelArgs); + canceled = cancelArgs.get_cancel(); + } + } + + var el = this.get_element(); + if(canceled) { + // Restore the position of the control. + $common.setLocation(el, _dragStartLocation); + } else { + _location = $common.getLocation(el); + this.raisePropertyChanged('location'); + } + } + + this.startDragDrop = function(dragVisual) { + Sys.Extended.UI.DragDropManager.startDragDrop(this, dragVisual, null); + } + + this.get_dropTargetElement = function() { + return document.body; + } + + // bool canDrop(DragMode, DataType, Data) + this.canDrop = function(dragMode, dataType, data) { + return (dataType == "_floatingObject"); + } + + // void drop(DragMode, DataType, Data) + this.drop = function(dragMode, dataType, data) { } + + // void onDragEnterTarget(DragMode, DataType, Data) + this.onDragEnterTarget = function(dragMode, dataType, data) { } + + // void onDragLeaveTarget(DragMode, DataType, Data) + this.onDragLeaveTarget = function(dragMode, dataType, data) { } + + // void onDragInTarget(DragMode, DataType, Data) + this.onDragInTarget = function(dragMode, dataType, data) { } +} + +Sys.Extended.UI.FloatingBehavior.registerClass('Sys.Extended.UI.FloatingBehavior', Sys.Extended.UI.BehaviorBase, Sys.Extended.UI.IDragSource, Sys.Extended.UI.IDropTarget, Sys.IDisposable); diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Hover.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Hover.debug.js new file mode 100644 index 000000000..0a84d163d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Hover.debug.js @@ -0,0 +1,224 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.HoverBehavior = function(element) { + Sys.Extended.UI.HoverBehavior.initializeBase(this, [element]); + + // NOTE: DomEvent handler is specific to the dom element; so these are now 2-element arrays + // where index 0 is the handler for element and index 1 is the handler for hoverElement. + this._elementHandlers = null; + this._hoverElementHandlers = null; + + this._hoverElement = null; + this._hoverCount = 0; + this._unhoverDelay = 0; + this._hoverDelay = 0; + this._hoverScript = null; + this._unhoverScript = null; + this._hoverFired = false; +} + +Sys.Extended.UI.HoverBehavior.prototype = { + _setupHandlersArray: function() { + var target = []; + + target[0] = Function.createDelegate(this, this._onHover); + target[1] = Function.createDelegate(this, this._onUnhover); + + return target; + }, + + get_elementHandlers: function() { + if(!this._elementHandlers) + this._elementHandlers = this._setupHandlersArray(); + + return this._elementHandlers; + }, + + get_hoverElementHandlers: function() { + if(!this._hoverElementHandlers) + this._hoverElementHandlers = this._setupHandlersArray(); + + return this._hoverElementHandlers; + }, + + get_hoverElement: function() { + // DOM element associated with this behavior. + return this._hoverElement; + }, + + set_hoverElement: function(element) { + // DOM element associated with this behavior. + if(element != this._hoverElement) { + if(this._hoverElement) + this._setupHandlers(this._hoverElement, this.get_hoverElementHandlers(), false); + + this._hoverElement = element; + + if(this._hoverElement) + this._setupHandlers(this._hoverElement, this.get_hoverElementHandlers(), true); + } + }, + + get_hoverDelay: function() { + // Delay in milliseconds before unhover event is raised. + return this._hoverDelay; + }, + + set_hoverDelay: function(value) { + // Delay in milliseconds before unhover event is raised. + this._hoverDelay = value; + this.raisePropertyChanged('hoverDelay'); + }, + + get_hoverScript: function() { + return this._hoverScript; + }, + + set_hoverScript: function(script) { + this._hoverScript = script; + }, + + get_unhoverDelay: function() { + // Delay in milliseconds before unhover event is raised. + return this._unhoverDelay; + }, + + set_unhoverDelay: function(value) { + // Delay in milliseconds before unhover event is raised. + this._unhoverDelay = value; + this.raisePropertyChanged('unhoverDelay'); + }, + + get_unhoverScript: function() { + return this._unhoverScript; + }, + + set_unhoverScript: function(script) { + this._unhoverScript = script; + }, + + dispose: function() { + var element = this.get_element(); + + if(this._elementHandlers) { + var handlers = this.get_elementHandlers(); + + this._setupHandlers(element, handlers, false); + this._elementHandlers = null; + } + + if(this._hoverElement) { + var handlers = this.get_hoverElementHandlers(); + this._setupHandlers(this._hoverElement, handlers, false); + this._hoverElement = null; + } + + Sys.Extended.UI.HoverBehavior.callBaseMethod(this, 'dispose'); + }, + + initialize: function() { + Sys.Extended.UI.HoverBehavior.callBaseMethod(this, 'initialize'); + + var handlers = this.get_elementHandlers(); + + this._setupHandlers(this.get_element(), handlers, true); + + if(this._hoverElement) { + handlers = this.get_hoverElementHandlers(); + this._setupHandlers(this._hoverElement, handlers, true); + } + }, + + add_hover: function(handler) { + this.get_events().addHandler("hover", handler); + }, + + remove_hover: function(handler) { + this.get_events().removeHandler("hover", handler); + }, + + _fireHover: function() { + if(!this._hoverCount || this._hoverFired) + return; + + var handler = this.get_events().getHandler("hover"); + if(handler) + handler(this, Sys.EventArgs.Empty); + + if(this._hoverScript) + eval(this._hoverScript); + + this._hoverFired = true; + }, + + _onHover: function() { + this._hoverCount++; + + if(!this._hoverDelay) + this._fireHover(); + else + window.setTimeout(Function.createDelegate(this, this._fireHover), this._hoverDelay); + }, + + add_unhover: function(handler) { + this.get_events().addHandler("unhover", handler); + }, + + remove_unhover: function(handler) { + this.get_events().removeHandler("unhover", handler); + }, + + _fireUnhover: function() { + if(this._hoverFired && !this._hoverCount) { + this._hoverFired = false; + var handler = this.get_events().getHandler("unhover"); + + if(handler) + handler(this, Sys.EventArgs.Empty); + if(this._unhoverScript) + eval(this._unhoverScript); + } + }, + + _onUnhover: function() { + this._hoverCount--; + + if(this._hoverCount <= 0) { + // Because Safari fires events differently, it's possible in some scenarios to + // have mouseout fire before mouseover, so make sure we never get a negative _hoverCount + this._hoverCount = 0; + + if(!this._unhoverDelay) + this._fireUnhover(); + else + window.setTimeout(Function.createDelegate(this, this._fireUnhover), this._unhoverDelay); + + } + }, + + _setupHandlers: function(element, handlers, hookup) { + if(!this.get_isInitialized() || !element) + return; + + if(hookup) { + $addHandler(element, "mouseover", handlers[0]); + $addHandler(element, "focus", handlers[0]); + $addHandler(element, "mouseout", handlers[1]); + $addHandler(element, "blur", handlers[1]); + } else { + $removeHandler(element, "mouseover", handlers[0]); + $removeHandler(element, "focus", handlers[0]); + $removeHandler(element, "mouseout", handlers[1]); + $removeHandler(element, "blur", handlers[1]); + } + } +} + +Sys.Extended.UI.HoverBehavior.descriptor = { + properties: [{ name: 'hoverElement', isDomElement: true }, + { name: 'unhoverDelay', type: Number }], + events: [{ name: 'hover' }, + { name: 'unhover' }] +} + +Sys.Extended.UI.HoverBehavior.registerClass('Sys.Extended.UI.HoverBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HoverMenu.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HoverMenu.debug.js new file mode 100644 index 000000000..e9bfc5e26 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HoverMenu.debug.js @@ -0,0 +1,564 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.HoverMenuBehavior = function(element) { + // The HoverMenuBehavior is used to display a popup whenever the target is hovered over + Sys.Extended.UI.HoverMenuBehavior.initializeBase(this, [element]); + + // Encapsulated behaviors + this._hoverBehavior = null; + this._popupBehavior = null; + + // Handler delegates + this._mouseEnterHandler = null; + this._mouseLeaveHandler = null; + this._unhoverHandler = null; + this._hoverHandler = null; + + // State variables + this._inHover = null; + this._oldClass = null; + this._popupElement = null; + this._onShowJson = null; + this._onHideJson = null; + + // Property values + this._popupElement = null; + this._hoverCssClass = null; + this._offsetX = 0; + this._offsetY = 0; + this._popDelay = 100; + this._hoverDelay = 0; + this._popupPosition = null; +} + +Sys.Extended.UI.HoverMenuBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.HoverMenuBehavior.callBaseMethod(this, 'initialize'); + + // set up our delegates and handlers + this._hoverHandler = Function.createDelegate(this, this._onHover); + this._unhoverHandler = Function.createDelegate(this, this._onUnhover); + this._mouseEnterHandler = Function.createDelegate(this, this._onmouseover); + this._mouseLeaveHandler = Function.createDelegate(this, this._onmouseout); + + var e = this.get_element(); + $addHandler(e, "mouseover", this._mouseEnterHandler); + $addHandler(e, "mouseout", this._mouseLeaveHandler); + + if(this._popupElement) { + // setup the popup behavior + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, { "id": this.get_id() + "_PopupBehavior" }, null, null, this._popupElement); + if(this._popupPosition) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.HoverMenuPopupPosition.Absolute); + else + this._popupBehavior.set_positioningMode(Sys.Extended.UI.HoverMenuPopupPosition.Center); + + // Create the animations (if they were set before initialize was called) + if(this._onShowJson) + this._popupBehavior.set_onShow(this._onShowJson); + + if(this._onHideJson) + this._popupBehavior.set_onHide(this._onHideJson); + + // set up the hover behavior + this._hoverBehavior = $create(Sys.Extended.UI.HoverBehavior, { "id": this.get_id() + "_HoverBehavior", "hoverDelay": this._hoverDelay, "unhoverDelay": this._popDelay, "hoverElement": this._popupElement }, null, null, e); + this._hoverBehavior.add_hover(this._hoverHandler); + this._hoverBehavior.add_unhover(this._unhoverHandler); + } + }, + + dispose: function() { + // do cleanup + this._onShowJson = null; + this._onHideJson = null; + + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + + if(this._popupElement) + this._popupElement = null; + + if(this._mouseEnterHandler) + $removeHandler(this.get_element(), "mouseover", this._mouseEnterHandler); + + if(this._mouseLeaveHandler) + $removeHandler(this.get_element(), "mouseout", this._mouseLeaveHandler); + + if(this._hoverBehavior) { + if(this._hoverHandler) { + this._hoverBehavior.remove_hover(this._hoverHandler); + this._hoverHandler = null; + } + + if(this._unhoverHandler) { + this._hoverBehavior.remove_hover(this._unhoverHandler); + this._unhoverHandler = null; + } + + this._hoverBehavior.dispose(); + this._hoverBehavior = null; + } + + Sys.Extended.UI.HoverMenuBehavior.callBaseMethod(this, 'dispose'); + }, + + _getLeftOffset: function() { + var defaultLeft = $common.getLocation(this.get_element()).x, + offsetLeft = $common.getLocation(this.get_popupElement().offsetParent).x, + delta = 0; + + // this offset is always relative to the left edge of the hover element. + switch(this._popupPosition) { + case Sys.Extended.UI.HoverMenuPopupPosition.Left: + // if it's positioned left, it's the width of the popup plus the offset + delta = (-1 * this._popupElement.offsetWidth); + break; + case Sys.Extended.UI.HoverMenuPopupPosition.Right: + // if it's to the right, it's the width of the hover element plus the offset. + delta = this.get_element().offsetWidth; + break; + } + + return delta + defaultLeft - offsetLeft + this._offsetX; + }, + + _getTopOffset: function() { + var defaultTop = $common.getLocation(this.get_element()).y, + offsetTop = $common.getLocation(this.get_popupElement().offsetParent).y, + delta = 0; + + // this offset is always relative to the top edge of the hover element. + switch(this._popupPosition) { + case Sys.Extended.UI.HoverMenuPopupPosition.Top: + // if it's Top positioned, it's the height of the popup plus the offset. + delta = (-1 * this._popupElement.offsetHeight); + break; + case Sys.Extended.UI.HoverMenuPopupPosition.Bottom: + // if it's bottom positioned it's the height of the hover element plus the offset + delta = this.get_element().offsetHeight; + break; + } + + return defaultTop - offsetTop + delta + this._offsetY; + }, + + _onHover: function() { + if(this._inHover) + return; + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + + if(eventArgs.get_cancel()) + return; + + this._inHover = true; + this.populate(); + + this._popupBehavior.show(); + if($common.getCurrentStyle(this._popupElement, 'display') == 'none') + this._popupElement.style.display = 'block'; + + this._popupBehavior.set_x(this._getLeftOffset()); + this._popupBehavior.set_y(this._getTopOffset()); + this.raise_shown(Sys.EventArgs.Empty); + }, + + _onUnhover: function() { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + + if(eventArgs.get_cancel()) + return; + + this._inHover = false; + this._resetCssClass(); + this._popupBehavior.hide(); + this.raise_hidden(Sys.EventArgs.Empty); + }, + + _onmouseover: function() { + // Handler to change the CSS class when hovered over + + // set up the CSS class + var e = this.get_element(); + if(this._hoverCssClass && e.className != this._hoverCssClass) { + this._oldClass = e.className; + e.className = this._hoverCssClass; + } + }, + + _onmouseout: function() { + this._resetCssClass(); + }, + + _resetCssClass: function() { + // Reset the CSS class if we changed it while hovering + + // make sure we're not still in hover mode, and that the class is + // currently the hover class. + var e = this.get_element(); + if(!this._inHover && this._hoverCssClass && e.className == this._hoverCssClass) + e.className = this._oldClass; + }, + + /// + /// A JSON definition of a generic OnShow animation. + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + // Generic OnShow Animation's JSON definition + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onShow(value) + else + this._onShowJson = value; + + this.raisePropertyChanged('onShow'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing the generic OnShow animation behavior. + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + // Generic OnShow Animation's behavior + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Plays OnHide animation. + /// + /// + onShow: function() { + if(this._popupBehavior) + this._popupBehavior.onShow(); + }, + + /// + /// A JSON definition of a genericOnHide animation. + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + // Generic OnHide Animation's JSON definition + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onHide(value) + else + this._onHideJson = value; + + this.raisePropertyChanged('onHide'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing the generic OnHide animation behavior. + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + // Generic OnHide Animation's behavior + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Plays OnHide animation. + /// + /// + onHide: function() { + if(this._popupBehavior) + this._popupBehavior.onHide(); + }, + + /// + /// Sys.UI.DomElement that acts as a popup and is displayed on hovering. + /// + /// get_popupElement + /// set_popupElement + /// + get_popupElement: function() { + // Popup that is displayed when hovering + return this._popupElement; + }, + set_popupElement: function(value) { + if(this._popupElement != value) { + this._popupElement = value; + + if(this.get_isInitialized() && this._hoverBehavior) + this._hoverBehavior.set_hoverElement(this._popupElement); + + this.raisePropertyChanged('popupElement'); + } + }, + + /// + /// A CSS class used on hovering. + /// + /// get_hoverCssClass + /// set_hoverCssClass + /// + get_hoverCssClass: function() { + return this._hoverCssClass; + }, + set_hoverCssClass: function(value) { + if(this._hoverCssClass != value) { + this._hoverCssClass = value; + this.raisePropertyChanged('hoverCssClass'); + } + }, + + get_HoverCssClass: function() { + Sys.Extended.Deprecated("get_HoverCssClass", "get_hoverCssClass"); + return this.get_hoverCssClass(); + }, + set_HoverCssClass: function(value) { + Sys.Extended.Deprecated("set_HoverCssClass", "set_hoverCssClass"); + this.set_hoverCssClass(value); + }, + + /// + /// The number of pixels to offset the popup from its default horizontal position. + /// + /// get_offsetX + /// set_offsetX + /// + get_offsetX: function() { + return this._offsetX; + }, + set_offsetX: function(value) { + if(this._offsetX != value) { + this._offsetX = value; + this.raisePropertyChanged('offsetX'); + } + }, + + get_OffsetX: function() { + Sys.Extended.Deprecated("get_OffsetX()", "get_offsetX()"); + return this.get_offsetX(); + }, + set_OffsetX: function(value) { + Sys.Extended.Deprecated("set_OffsetX(value)", "set_offsetX(value)"); + this.set_offsetX(value); + }, + + /// + /// The number of pixels to offset the popup from its default vertical position. + /// + /// get_offsetY + /// set_offsetY + /// + get_offsetY: function() { + return this._offsetY; + }, + set_offsetY: function(value) { + if(this._offsetY != value) { + this._offsetY = value; + this.raisePropertyChanged('offsetY'); + } + }, + + get_OffsetY: function() { + Sys.Extended.Deprecated("get_OffsetY()", "get_offsetY()"); + return this.get_offsetY(); + }, + set_OffsetY: function(value) { + Sys.Extended.Deprecated("set_OffsetY(value)", "set_offsetY(value)"); + this.set_offsetY(value); + }, + + /// + /// The Sys.Extended.UI.HoverMenuPopupPosition object that contains the location where the popup should be positioned relative to the target control. + /// + /// + /// Can be Left, Right, Top, Bottom, Center. Center is default + /// + /// get_popupPosition + /// set_popupPosition + /// + get_popupPosition: function() { + return this._popupPosition; + }, + set_popupPosition: function(value) { + if(this._popupPosition != value) { + this._popupPosition = value; + this.raisePropertyChanged('popupPosition'); + } + }, + + get_PopupPosition: function() { + Sys.Extended.Deprecated("get_PopupPosition()", "get_popupPosition()"); + return this.get_popupPosition(); + }, + set_PopupPosition: function(value) { + Sys.Extended.Deprecated("set_PopupPosition(value)", "set_popupPosition(value)"); + this.set_popupPosition(value); + }, + + /// + /// A number representing a time delay from the moment the mouse enters the target to the time when the popup is shown (displayed in milliseconds). + /// + /// + /// Default is 100. + /// + /// get_popDelay + /// set_popDelay + /// + get_popDelay: function() { + return this._popDelay; + }, + set_popDelay: function(value) { + if(this._popDelay != value) { + this._popDelay = value; + this.raisePropertyChanged('popDelay'); + } + }, + + get_PopDelay: function() { + Sys.Extended.Deprecated("get_PopDelay", "get_popDelay"); + return this.get_popDelay(); + }, + set_PopDelay: function(value) { + Sys.Extended.Deprecated("set_PopDelay", "set_popDelay"); + this.set_popDelay(value); + }, + + /// + /// A number representing a time delay after the mouse enters the target and before the popup is shown (in milliseconds). + /// + /// + /// Default is 0. + /// + /// get_hoverDelay + /// set_hoverDelay + /// + get_hoverDelay: function() { + return this._hoverDelay; + }, + set_hoverDelay: function(value) { + if(this._hoverDelay != value) { + this._hoverDelay = value; + this.raisePropertyChanged('hoverDelay'); + } + }, + + get_HoverDelay: function() { + Sys.Extended.Deprecated("get_HoverDelay", "get_hoverDelay"); + return this.get_hoverDelay(); + }, + set_HoverDelay: function(value) { + Sys.Extended.Deprecated("set_HoverDelay", "set_hoverDelay"); + this.set_hoverDelay(value); + }, + + /// + /// Fires when the hover menu is being shown. + /// + /// + /// + add_showing: function(handler) { + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if(handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires after the hover menu is shown. + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler('shown', handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler('shown', handler); + }, + raise_shown: function(eventArgs) { + var handler = this.get_events().getHandler('shown'); + if(handler) + handler(this, eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Fires when the hover menu is being hidden. + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler('hiding', handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler('hiding', handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if(handler) + handler(this, eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires after the hover menu is hidden. + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + if(handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + } +} + +Sys.Extended.UI.HoverMenuBehavior.registerClass('Sys.Extended.UI.HoverMenuBehavior', Sys.Extended.UI.DynamicPopulateBehaviorBase); + +Sys.Extended.UI.HoverMenuPopupPosition = function() { + // Where the popup should be positioned relative to the target control + throw Error.invalidOperation(); +} + +Sys.Extended.UI.HoverMenuPopupPosition.prototype = { + Center: 0, + Top: 1, + Left: 2, + Bottom: 3, + Right: 4 +} + +Sys.Extended.UI.HoverMenuPopupPosition.registerEnum('Sys.Extended.UI.HoverMenuPopupPosition'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js new file mode 100644 index 000000000..b038c4811 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js @@ -0,0 +1,3253 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.DesignPanel = function(element) { + Sys.Extended.UI.HtmlEditor.DesignPanel.initializeBase(this, [element]); + + this._doc = null; + this._updated_now = false; + this._updateTimer = null; + this._popup = null; + this._contextElement = null; + this._a_prize = false; + this.__stack = null; + this._StyleForTyping = null; + this.isWord = false; + this.isPlainText = false; + this.dfltBlockElement = "P"; + this._FontNotSet = true; + this._design_timer1 = null; + + this._events$delegate = Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler); + this._blur$delegate = Function.createDelegate(this, this._blur); + this._focus$delegate = Function.createDelegate(this, this._focus_event); +} + +Sys.Extended.UI.HtmlEditor.DesignPanel.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this, "initialize"); + }, + + dispose: function() { + Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this, "dispose"); + }, + + _activate: function(value) { + Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this, "_activate"); + + this._wasFocused = false; + this._initIframe(value); + this._onDocumentLoaded(); + }, + + _deactivate: function() { + this._deactivateCommon(); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._doc.open(); + this._doc.write(""); + this._doc.close(); + this.get_element().src = "javascript:false;"; + } + + this._doc = null; + Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this, "_deactivate"); + }, + + _deactivateCommon: function() { + this._editPanel.__blured = false; + var aList = this._doc.body.getElementsByTagName("IMG"); + + for(var i = 0; i < aList.length; i++) { + if(aList[i].getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute) && aList[i].getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute).length > 0) { + try { + if(Sys.Extended.UI.HtmlEditor.isIE) + $removeHandler(aList[i], "dragstart", Sys.Extended.UI.HtmlEditor.stopDrag); + else + $removeHandler(aList[i], "draggesture", Sys.Extended.UI.HtmlEditor.stopDrag); + } catch(e) { } + } + } + + Sys.Extended.UI.HtmlEditor._removeEvents(this._doc, ["keydown", "keypress", "mousedown", "mouseup", "dblclick"], this._events$delegate); + Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow, ["blur"], this._blur$delegate); + Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow, ["focus"], this._focus$delegate); + }, + + _initIframe: function(value) { + if(!Sys.Extended.UI.HtmlEditor.isIE) { + this._savedValue = value; + this._absAndFixedParents = this._getAbsAndFixedParents(); + } + + var str = Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(value)); + this._doc = this.get_element().contentWindow.document; + + if(!Sys.Extended.UI.HtmlEditor.isIE) + this._doc.designMode = "on"; + + this._doc.open(); + this._doc.write("" + str + ""); + this._doc.close(); + this._doc.id = "EditorDocument"; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._doc.body.contentEditable = true; + this._tryForward = true; + } + }, + + _blur: function(event) { + this._editPanel.__blured = true; + + if(!Sys.Extended.UI.HtmlEditor.isIE && this._design_timer1 != null) { + clearTimeout(this._design_timer1); + this._design_timer1 = null; + } + + if(!this.isPopup) + this._editPanel._validate(event, null); + + return true; + }, + + _focus_event: function() { + this._editPanel.__blured = false; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._really_focused(); + } else { + var panel = this; + Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel = this._editPanel; + + if(this._design_timer1 == null) + this._design_timer1 = setTimeout(function() { panel._really_focused(); panel._design_timer1 = null; }, 0); + } + + return true; + }, + + _getAbsAndFixedParents: function() { + var el = this.get_element(), + str = ""; + + while(el != null && el.tagName && el.tagName.toLowerCase() != "body") { + str += el.tagName; + + if(el.style.position == "absolute" || el.style.position == "fixed") + str += ": " + el.style.position; + + str += "\n"; + el = el.parentNode; + } + + return str; + }, + + _onDocumentLoaded: function() { + var editor = this; + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var absAndFixedParents = this._getAbsAndFixedParents(); + + if(absAndFixedParents != this._absAndFixedParents) { + this._initIframe(this._savedValue); + setTimeout(function() { + editor._onDocumentLoaded() + }, 10); + + return; + } + } + + try { + if(!Sys.Extended.UI.HtmlEditor.isIE) { + this._doc.queryCommandValue("forecolor"); + + if(Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) + if(!Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element())) { + setTimeout(function() { + editor._onDocumentLoaded() + }, 10); + + return; + } + } + var temp = editor._doc.body.innerHTML; + } catch(e) { + setTimeout(function() { + editor._onDocumentLoaded() + }, 10); // waiting for loading + + return; + } + + this._afterBodyIsFormed(); + + setTimeout(function() { + editor._activateFinished(); + if(Sys.Extended.UI.HtmlEditor.isIE && !editor._editPanel.get_autofocus()) + editor._getSelection().empty(); + }, 0); + }, + + _afterBodyIsFormed: function() { + var editor = this; + + Sys.Extended.UI.HtmlEditor._addEvents(this._doc, ["keydown", "keypress", "mousedown", "mouseup", "dblclick"], this._events$delegate); + Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow, ["blur"], this._blur$delegate); + Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow, ["focus"], this._focus$delegate); + + Sys.Extended.UI.HtmlEditor.inspectForShadows(editor._doc.body); + + var body = this._doc.body; + + if(body.childNodes.length == 1 && body.firstChild.tagName && body.firstChild.tagName.toUpperCase() == "DIV" && + body.firstChild.style.cssText.length > 0 && body.firstChild.style.direction.length > 0 && + Sys.Extended.UI.HtmlEditor.getStyle(body.firstChild, "position") != "absolute") { + + body.style.cssText = body.firstChild.style.cssText; + var temp = body.firstChild; + + while(temp.firstChild) + body.insertBefore(temp.firstChild, temp); + + body.removeChild(temp); + } + + editor._clearP(); + }, + + _getContent: function() { + if(this._popup != null) + if(typeof this._popup._forceImClose == "function") { + var func = this._popup._forceImClose; + func(this._popup._iframe.contentWindow); + } + + this._clearP(); + var temp; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + Sys.Extended.UI.HtmlEditor.spanJoiner(this._doc.body, this._doc); + temp = Sys.Extended.UI.HtmlEditor.getHTML(this._doc.body, false, true); + + temp = temp.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig, "$1 $3") + .replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/ig, "$1
    $3") + .replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/ig, "$1
    $3"); + temp = ((this._doc.body.style.cssText.length > 0) ? "
    " : "") + temp + ((this._doc.body.style.cssText.length > 0) ? "
    " : ""); + + if(this._editPanel.get_noScript()) + temp = temp.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi, ""); + + if(/)/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1$3") + .replace(/()/ig, "$1wmode=$3$4") + .replace(/()/ig, "$1$3"); + } + + var nnreg = new RegExp("(<[/]?)(teo" + Sys.Extended.UI.HtmlEditor.smartClassName + ":)", "ig"); + temp = temp.replace(nnreg, "$1"); + } else { + var trg = this._doc.createElement("DIV"), + scriptRecover = new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover(); + + trg.style.cssText = this._doc.body.style.cssText; + if(!this._editPanel.get_noScript()) + this._doc.body.innerHTML.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi, function(p0, p1) { return scriptRecover.regReplScript1(p0, p1); }); + + trg.innerHTML = Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML); + + var tempCollection = trg.getElementsByTagName("IMG"), + imgCollection = []; + + for(var i = 0; i < tempCollection.length; i++) + imgCollection.push(tempCollection[i]); + + for(var j = 0; j < imgCollection.length; j++) { + var img = imgCollection[j], + attr; + + attr = img.getAttribute("dummytag"); + if(attr && attr.length > 0 && attr.toLowerCase() == "embed") { + var src = img.getAttribute("dummysrc"), + bgcolor = img.getAttribute("dummybgcolor"), + wmode = img.getAttribute("pseudomode"), + attrs = img.attributes, + embed = this._doc.createElement("EMBED"); + + embed.src = src; + embed.width = img.width; + embed.height = img.height; + + if(bgcolor && bgcolor.length > 0) { + bgcolor = Sys.Extended.UI.HtmlEditor.tryReplaceRgb(bgcolor); + embed.setAttribute("bgcolor", bgcolor); + } + + if(wmode && wmode.length > 0) + embed.setAttribute("wmode", wmode); + + for(var i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + + if(!a.specified) + continue; + + var name = a.name.toLowerCase(), + value = a.value; + + if(name == "dummytag" || name == "dummysrc" || + name == "dummybgcolor" || name == "style" || + name == "wmode" || name == "pseudomode" || + name == "src") + continue; + + if(name == "loop" && value == "true") continue; + if(name == "play" && value == "true") continue; + if(name == "hspace" && value == "0") continue; + if(name == "vspace" && value == "0") continue; + if(name == "scale" && value.length == 0) continue; + if(name == "align" && value.length == 0) continue; + + embed.setAttribute(name, value); + } + + if(img.style.width && img.style.width.length > 0) + embed.style.width = img.style.width; + if(img.style.height && img.style.height.length > 0) + embed.style.height = img.style.height; + + img.parentNode.insertBefore(embed, img); + img.parentNode.removeChild(img); + } + } + + Sys.Extended.UI.HtmlEditor.spanJoiner(trg, this._doc); + + temp = Sys.Extended.UI.HtmlEditor.getHTML(trg, (trg.style.cssText.length > 0) ? true : false, true); + if(!this._editPanel.get_noScript()) + temp = temp.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi, function(p0, p1, p2, p3) { return scriptRecover.regReplFromScript1(p0, p1, p2, p3); }); + else + temp = temp.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi, ""); + + delete trg; + } + + temp = Sys.Extended.UI.HtmlEditor.brXHTML(temp.replace(/^([\n|\r]+)/, "")); + if(this._editPanel.get_noUnicode()) + temp = temp.replace(/([\u0080-\uFFFF])/g, function(p0, p1) { return "&#" + p1.charCodeAt(0).toString(10) + ";"; }); + + if(Sys.Extended.UI.HtmlEditor.Trim(temp) == "
    ") + temp = ""; + + return temp; + }, + + _setContent: function(value) { + this._deactivateCommon(); + var str = Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(value)); + + this._doc.open(); + this._doc.write("" + str + ""); + this._doc.close(); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._doc.body.contentEditable = true; + this._tryForward = true; + } + + this._afterBodyIsFormed(); + if(this._editPanel.get_autofocus()) + this._focus(); + + if(Sys.Extended.UI.HtmlEditor.isIE && !this._editPanel.get_autofocus()) + this._getSelection().empty(); + }, + + _focus: function(prize) { + this.focusEditor(); + this._focused(prize); + }, + + focusEditor: function() { + try { + this.get_element().contentWindow.focus(); + } catch(e) { } + + if(!this._wasFocused) { + this._wasFocused = true; + + if(!this._editPanel.get_startEnd()) + this._setToEnd(); + } + }, + + _prepareContent: function(value) { + var temptext = value; + + temptext = temptext.replace(/]*?)>(?:[^\u0000]*?)(]*?)>)(?:[^\u0000]*?)<\/object(?:[^>]*?)>/gi, "$1"); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + temptext = Sys.Extended.UI.HtmlEditor.Trim(temptext.replace(/([\n\r]+<)/g, "<").replace(/([^>])([\n\r]+)([^<])/g, "$1 $3")) + .replace(/(&)/g, "&amp;") + .replace(/\s*<\/td>/ig, "") + .replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig, "$1 $3") + .replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/ig, "$1 $3"); + + if(/)/ig, "$1pseudomode=$3$4") + .replace(/(]*?>)/ig, "$1 wmode=\"transparent\"$2"); + + temptext = temptext.replace(/&/ig, "&"); + + return temptext; + } else { + var scriptRecover = new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover(), + src = document.createElement("DIV"); + + if(!this._editPanel.get_noScript()) + temptext.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi, function(p0, p1) { return scriptRecover.regReplScript1(p0, p1); }); + + src.innerHTML = Sys.Extended.UI.HtmlEditor.Trim(temptext.replace(/([^>])([\n\r]+)([^<])/g, "$1 $3")); + + var tempCollection = src.getElementsByTagName("EMBED"), + embedCollection = []; + + for(var i = 0; i < tempCollection.length; i++) + embedCollection.push(tempCollection[i]); + + for(var j = 0; j < embedCollection.length; j++) { + var embed = embedCollection[j], + img = document.createElement("IMG"), + attrs = embed.attributes; + + img.src = this._editPanel.get_imagePath_1x1(); + img.setAttribute("dummytag", "embed"); + + for(var i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + if(!a.specified) + continue; + + var name = a.name.toLowerCase(), + value = a.value; + + if(name == "src") + name = "dummysrc"; + else + if(name == "bgcolor") + name = "dummybgcolor"; + else + if(name == "wmode") + name = "pseudomode"; + + img.setAttribute(name, value); + } + + img.style.cssText = "border: 1px dotted #000000; background-image: url('" + (img.getAttribute("type").toLowerCase() == "application/x-mplayer2" ? this._editPanel.get_imagePath_media() : tthis._editPanel.get_imagePath_flash()) + "'); background-position: center; background-repeat: no-repeat; background-color: #c0c0c0;"; + + if(embed.style.width && embed.style.width.length > 0) + img.style.width = embed.style.width; + if(embed.style.height && embed.style.height.length > 0) + img.style.height = embed.style.height; + + embed.parentNode.insertBefore(img, embed); + embed.parentNode.removeChild(embed); + } + + Sys.Extended.UI.HtmlEditor.spanJoiner(src, document); + + temptext = Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(src, false, true)); + if(!this._editPanel.get_noScript()) + temptext = temptext.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi, function(p0, p1, p2, p3) { return scriptRecover.regReplFromScript1(p0, p1, p2, p3); }); + + delete src; + delete scriptRecover; + temptext = Sys.Extended.UI.HtmlEditor.brXHTML(temptext); + + if(temptext.length == 0) + temptext = "
    "; + + return temptext; + } + }, + + _clearP: function() { + try { + var el = this._doc.body; + + if(el.firstChild) + if(el.firstChild.nodeType == 3) { + var str = Sys.Extended.UI.HtmlEditor.Trim("" + el.firstChild.data + ""); + + if(str.length == 0) + el.removeChild(el.firstChild); + else + if(str != ("" + el.firstChild.data + "")) + el.firstChild.data = str; + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(el.childNodes.length == 1) { + el = el.firstChild; + + if(el.nodeType == 1) { + var elTagName = el.tagName.toLowerCase(); + + if(elTagName == "p" || elTagName == "ul" || elTagName == "ol") { + var needDel = false, + list = (elTagName == "ul" || elTagName == "ol"); + + function checkInner(elem) { + var ret = false; + + if(elem.nodeType == 1) { + var tagName = elem.tagName.toUpperCase(); + + if(!(list && tagName == "LI")) + if(Sys.Extended.UI.HtmlEditor.isRestricted(elem) || tagName == "IMG" || tagName == "IFRAME" || tagName == "EMBED" || tagName == "SCRIPT") + return true; + + if(elem.childNodes.length > 1) + return true; + if(elem.childNodes.length == 0) + return false; + + ret |= checkInner(elem.firstChild); + } else { + if(elem.nodeType == 3) + ret |= true; + } + + return ret; + } + + if(el.childNodes.length == 1) + if(!checkInner(el.firstChild)) + el.removeChild(el.firstChild); needDel = true; + + if(needDel || el.parentNode.innerHTML.toLowerCase() == "

     

    ") + this._doc.body.removeChild(el); + } + } + } + } + } catch(e) { } + }, + + isControl: function() { + try { + var sel = this._getSelection(); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(sel.type.toLowerCase() == "control") + return true; + else + return false; + } else { + var range = this._createRange(sel), + parent = this._getParent(range); + + if(parent.nodeType != 3 && range.startContainer == range.endContainer) { + if(!parent.tagName) + return false; + + if(range.startContainer.childNodes.item(range.startOffset) == null) + return false; + + if(range.startOffset == range.endOffset && + range.startContainer.childNodes.item(range.startOffset).tagName && + (range.startContainer.childNodes.item(range.startOffset).tagName.toUpperCase() == "BR" || + Sys.Extended.UI.HtmlEditor.isStyleTag(range.startContainer.childNodes.item(range.startOffset).tagName))) + return false; + + if(parent.tagName.toUpperCase() == "BODY" && range.startOffset == 0 && + range.endOffset > 0 && range.endOffset == parent.childNodes.length) + return false; + + if(range.startOffset == range.endOffset && range.startContainer.childNodes.item(range.startOffset).nodeType == 3) + return false; + + return true; + } + else { + return false; + } + } + } catch(e) { + return true; + } + }, + + isPopup: function() { + return (this._popup != null); + }, + + _getSelection: function() { + if(Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._doc.selection; + + return sel; + } else { + this.focusEditor(); + + var sel, + range, + el, + contentWindow = this.get_element().contentWindow; + + sel = contentWindow.getSelection(); + range = this._createRange(sel); + el = range.startContainer; + + try { + while(el && el.nodeType) + el = el.parentNode; + } catch(e) { + this._removeAllRanges(sel); + range = this._createRange(sel); + range.setStart(this._saved_startContainer, this._saved_startOffset); + range.setEnd(this._saved_startContainer, this._saved_startOffset); + + this._selectRange(sel, range); + sel = contentWindow.getSelection(); + } + + return sel; + } + }, + + _createRange: function(sel) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(typeof sel == "undefined") + return this._doc.body.createTextRange(); + else + return sel.createRange(); + } else { + this.focusEditor(); + + if(typeof sel == "undefined") { + return this._doc.createRange(); + } else { + try { + var r = sel.getRangeAt(0); + return r; + } catch(e) { + return this._doc.createRange(); + } + } + } + }, + + toEndOfProtected: function() { + var editor = this, + sss = this._getSelection(), + range; + + try { + range = this._createRange(sss); + } catch(ex) { + return false; + } + + var el; + if(!Sys.Extended.UI.HtmlEditor.isIE) { + el = Sys.Extended.UI.HtmlEditor.contentEditable(range.startContainer); + + if(el == null) + el = Sys.Extended.UI.HtmlEditor.contentEditable(range.endContainer); + } else { + el = Sys.Extended.UI.HtmlEditor.contentEditable(Sys.Extended.UI.HtmlEditor.getSelParent(editor)); + } + + if(Sys.Extended.UI.HtmlEditor.isIE && el != null) { + try { + range.remove(el); + } catch(e) { } + + range = editor._doc.body.createControlRange(); + range.add(el); + range.select(); + } else { + if(!Sys.Extended.UI.HtmlEditor.isIE && el != null) { + var sel = editor._getSelection(), + tempText; + + if(el.nextSibling != null && el.nextSibling.nodeType == 3) { + tempText = el.nextSibling; + } else { + tempText = editor._doc.createTextNode(""); + + if(el.nextSibling != null) + el.parentNode.insertBefore(tempText, el.nextSibling); + else + el.parentNode.appendChild(tempText); + } + + editor._removeAllRanges(sel); + var range = editor._createRange(sel); + + range.setStart(tempText, 0); + range.setEnd(tempText, 0); + editor._selectRange(sel, range); + } + } + + return true; + }, + + _commonPaste: function(ev) { + var editor = this; + + this._saveContent(); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + this.openWait(); + + setTimeout(function() { + editor._paste(!editor._editPanel.get_noPaste()); editor.closeWait(); + }, 0) + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + } + else { + if(!this.isPlainText && !this.isWord && !this._editPanel.get_noPaste()) { + setTimeout(function() { + Sys.Extended.UI.HtmlEditor.operateAnchors(editor, editor._doc, !editor._editPanel.get_showAnchors()); + Sys.Extended.UI.HtmlEditor.operatePlaceHolders(editor, editor._doc, !editor._editPanel.get_showPlaceHolders()); + Sys.Extended.UI.HtmlEditor.inspectForShadows(editor._doc.body); + + editor._checkImages(editor._doc.body); + editor.onContentChanged(); + }, 0); + } else { + var place = editor._getSafePlace(); + + if(place != null) { + var div = editor._doc.createElement("div"); + + div.style.display = "inline"; + div.style.borderStyle = "none"; + place.parentNode.insertBefore(div, place); + div.appendChild(place); + div.removeChild(place); + div.innerHTML = "xx"; + + var sel = editor._getSelection(), + rng = editor._createRange(); + + editor._removeAllRanges(sel); + rng.setStart(div.firstChild, 0); + rng.setEnd(div.firstChild, 1); + editor._selectRange(sel, rng); + editor.openWait(); + + setTimeout(function() { + var parent = div.parentNode; + div.lastChild.deleteData(div.lastChild.length - 1, 1); + + if(editor.isWord) { + div.innerHTML = Sys.Extended.UI.HtmlEditor.cleanUp(div.innerHTML); + Sys.Extended.UI.HtmlEditor.replaceOldTags(div, editor); + Sys.Extended.UI.HtmlEditor.spanJoiner(div, editor._doc); + } else { + var div1 = document.createElement("div"); + div1.innerHTML = Sys.Extended.UI.HtmlEditor.cleanUp(div.innerHTML); + + var html = new Sys.Extended.UI.HtmlEditor.jsDocument(true); + Sys.Extended.UI.HtmlEditor.__MozillaGetInnerText(div1, html); + + div.innerHTML = html.toString().replace(//g, ">").replace(/\r/g, "").replace(/\n/g, "
    ").replace(/\t/g, " "); + delete div1; + } + + while(div.firstChild) + parent.insertBefore(div.firstChild, div); + + var ns = null, + ps = null; + + if(div.nextSibling && div.nextSibling.nodeType == 3 && div.previousSibling && div.previousSibling.nodeType == 3) { + ns = div.nextSibling; + ps = div.previousSibling; + } + + parent.removeChild(div); + var pslength = null; + + if(ns != null && ps != null) { + pslength = ps.data.length; + ps.data = "" + ps.data + "" + ns.data + ""; + ns.parentNode.removeChild(ns); + } + + editor.isWord = false; + editor.isPlainText = false; + editor.closeWait(); + + if(pslength != null) { + var sel = editor._getSelection(); + var rng = editor._createRange(); + + editor._removeAllRanges(sel); + rng.setStart(ps, pslength); + rng.setEnd(ps, pslength); + editor._selectRange(sel, rng); + } + + editor.onContentChanged(); + }, 0); + } else { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + } + } + } + }, + + _selectRange: function(sel, range) { + sel.addRange(range); + this.focusEditor(); + }, + + _selectRng: function(rng) { + var sel = this._getSelection(); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var range = this._doc.createRange(); + + range.setStart(rng[0], 0); + range.setEnd(rng[rng.length - 1], ("" + rng[rng.length - 1].data + "").length); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + } else { + var range1 = this._createRange(sel), + range2 = this._createRange(sel); + + var span1 = this._doc.createElement("span"), + span2 = this._doc.createElement("span"); + + rng[0].parentNode.insertBefore(span1, rng[0]); + + if(rng[rng.length - 1].nextSibling) + rng[rng.length - 1].parentNode.insertBefore(span2, rng[rng.length - 1].nextSibling); + else + rng[rng.length - 1].parentNode.appendChild(span2); + + try { + range1.moveToElementText(span1); + var ii = range1.moveStart('character', 1); + range1.moveStart('character', -ii); + + range2.moveToElementText(span2); + ii = range2.moveEnd('character', -1); + range2.moveEnd('character', -ii); + + range1.setEndPoint("EndToEnd", range2); + range1.select(); + } catch(e) { } + + rng[0].parentNode.removeChild(span1); + rng[rng.length - 1].parentNode.removeChild(span2); + } + }, + + _removeAllRanges: function(sel) { + sel.removeAllRanges(); + }, + + _setToEnd: function() { + var editor = this; + + setTimeout(function() { + editor._setToEnd_(); + editor._editPanel.updateToolbar(); + }, 0); + }, + + _setToEnd_: function() { + var editor = this; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(sel.type.toLowerCase() != "control") { + range.moveEnd("textedit", 1); + range.collapse(false); + } + + range.select(); + editor.focusEditor(); + + return; + } + + var index = 0, + container = editor._doc.body, + anchor = null; + + if(container.lastChild && container.lastChild.nodeType == 3) { + container = container.lastChild; + index = ("" + container.data + "").length; + } else { + var tempText = editor._doc.createTextNode(""); + + if(container.lastChild && container.lastChild.nodeType == 1 && container.lastChild.tagName.toUpperCase() == "BR") + container.insertBefore(tempText, container.lastChild); + else + container.appendChild(tempText); + + container = tempText; + index = 0; + } + + var sel = editor._getSelection(); + editor._removeAllRanges(sel); + var range = editor._createRange(); + + range.setStart(container, index); + range.setEnd(container, index); + + editor._selectRange(sel, range); + + if(anchor != null) + editor._doc.body.removeChild(anchor); + + editor.focusEditor(); + + if(!Sys.Extended.UI.HtmlEditor.isSafari && !Sys.Extended.UI.HtmlEditor.isOpera) { + try { + var anchor = editor._doc.createElement("button"); + anchor.style.width = "0px"; + anchor.style.height = "20px"; + editor._doc.body.appendChild(anchor); + + anchor.focus(); + + anchor.blur(); + editor.focusEditor(); + editor._doc.body.removeChild(anchor); + } catch(e) { } + } + }, + + isShadowed: function() { + if(!this.isControl()) + return false; + + var sel = this._getSelection(), + range = this._createRange(sel), + element; + + if(Sys.Extended.UI.HtmlEditor.isIE) + element = range.item(0); + else + element = range.startContainer.childNodes.item(range.startOffset); + + if(element.tagName && + element.tagName.toUpperCase() == "IMG" && + element.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute) && + element.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute).length > 0 + ) { + var shadowNode = this.getAttachedElement(element); + + if(shadowNode != null) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + range = this._doc.body.createControlRange(); + range.add(shadowNode); + range.select(); + } else { + try { + var index = Sys.Extended.UI.HtmlEditor.__getIndex(shadowNode); + sel.collapseToEnd(); + + this._removeAllRanges(sel); + range = this._createRange(sel); + range.setStart(shadowNode.parentNode, index); + range.setEnd(shadowNode.parentNode, index + 1); + + this._selectRange(sel, range); + } catch(e) { + return true; + } + } + return false; + } + + return true; + } + + return false; + }, + + _ifShadow: function() { + if(Sys.Extended.UI.HtmlEditor.isIE) { + try { + var selka = this._doc.selection; + } catch(e) { + return false; + } + } + + var editor = this, + prot = null, + el = Sys.Extended.UI.HtmlEditor.getSelParent(editor); + + while(el && (el.nodeType == 3 || (el.tagName && el.tagName.toUpperCase() != "BODY"))) { + if(el.nodeType == 3 || !el.tagName) { + el = el.parentNode; + + continue; + } + + var tagName = el.tagName.toUpperCase() + if(tagName == "TABLE" && el.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute) && + el.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute) == "yes") { + prot = el.rows.item(0).cells.item(0).firstChild; + + if(Sys.Extended.UI.HtmlEditor.isIE && tagName == "P") + prot = prot.firstChild; + + break; + } + + el = el.parentNode; + } + + if(prot != null) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + range = editor._doc.body.createControlRange(); + range.add(prot); + range.select(); + } else { + try { + sel.collapseToEnd(); + editor._removeAllRanges(sel); + range = editor._createRange(sel); + range.setStart(prot.parentNode, 0); + range.setEnd(prot.parentNode, 1); + editor._selectRange(sel, range); + } catch(e) { } + } + } + }, + + _saveContent: function() { + var sel, + range, + marker; + + try { + try { + sel = this._getSelection(); + range = this._createRange(sel); + } catch(e) { } + + marker = new Sys.Extended.UI.HtmlEditor._Marker(this, range, sel); + } catch(e) { + return; + } + + if(!this.__stack) { + this.__stack = []; + this.__stackPos = 0; + } + + while(this.__stackPos < this.__stack.length) + this.__stack.pop(); + + if(this.__stack.length == Sys.Extended.UI.HtmlEditor.__stackMaxSize) { + this.__stack.reverse(); + this.__stack.pop(); + this.__stack.reverse(); + } + + this.__stack.push(marker); + this.__stackPos = this.__stack.length; + }, + + _restoreContent: function() { + if(this.__stack && this.__stackPos >= 0 && this.__stackPos < this.__stack.length) { + var obj = this.__stack[this.__stackPos], + sel, + range; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + function rep(p0, p1, p2, p3, p4) { + return p1.replace(/\salign=[^\s>]*/ig, "") + ((p3 == '"X"') ? "" : ("align=" + p3)) + p4.replace(/\salign=[^\s>]*/ig, ""); + } + + var tempCollection = this._doc.body.getElementsByTagName("EMBED"); + + var els = []; + for(var i = 0; i < tempCollection.length; i++) + els.push(tempCollection[i]); + + for(var jk = 0; jk < els.length; jk++) + els[jk].parentNode.removeChild(els[jk]); + + var tuk = obj._save.replace(/&/ig, "&"); + tuk = tuk.replace(/()/ig, rep); + this._doc.body.innerHTML = "!!!" + Sys.Extended.UI.HtmlEditor.Trim(tuk); + + if(this._doc.body.firstChild) + this._doc.body.removeChild(this._doc.body.firstChild); + if(this._doc.body.firstChild) + this._doc.body.removeChild(this._doc.body.firstChild); + + var mArr = Sys.Extended.UI.HtmlEditor.getHrefsText(tuk); + Sys.Extended.UI.HtmlEditor.setHrefsText(this._doc.body, mArr); + + if(this._editPanel.get_relativeImages()) { + mArr = Sys.Extended.UI.HtmlEditor.getImagesText(tuk); + Sys.Extended.UI.HtmlEditor.setImagesText(this._doc.body, mArr); + } + + Sys.Extended.UI.HtmlEditor.setNames(this._doc.body, obj._nArr); + Sys.Extended.UI.HtmlEditor.operateAnchors(this, this._doc, !this._editPanel.get_showAnchors()); + Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this, this._doc, !this._editPanel.get_showPlaceHolders()); + + if(obj._tree != null) { + var el = this._doc.body, i; + + try { + for(i = obj._tree.length - 1; i >= 0; i--) + el = el.childNodes.item(obj._tree[i]); + } catch(e) { + if(this.__stackPos > 0) { + this.__stackPos--; + this._restoreContent(); + this.__stackPos++; + } + + return; + } + + try { + var rng = this._doc.body.createControlRange(); + + rng.add(el); + rng.select(); + } catch(e) { } + } else { + var editor = this; + + setTimeout(function() { + try { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + sel = editor._getSelection(); + range = editor._createRange(sel); + + if(sel.type.toLowerCase() != "control") + try { range.moveToPoint(obj._offsetLeft, obj._offsetTop); } catch(e) { } + + range.select(); + } + } catch(e) { } + }, 0); + } + } else { + if(Sys.Extended.UI.HtmlEditor.isOpera) { + this._doc.body.innerHTML = Sys.Extended.UI.HtmlEditor.Trim(obj._save); + } else { + this._doc.body.innerHTML = ""; + + for(var i = 0; i < obj._save.childNodes.length; i++) + this._doc.body.appendChild(obj._save.childNodes.item(i).cloneNode(true)); + } + + Sys.Extended.UI.HtmlEditor.operateAnchors(this, this._doc, !this._editPanel.get_showAnchors()); + Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this, this._doc, !this._editPanel.get_showPlaceHolders()); + + try { + sel = this._getSelection(); + range = this._createRange(); + this._removeAllRanges(sel); + } catch(e) { } + + var str = "", + el = this._doc.body; + + for(var i = obj._tree.length - 1; i >= 0; i--) { + str += " " + obj._tree[i]; + el = el.childNodes.item(obj._tree[i]); + } + + var n_offset = obj._offset; + try { + range.setStart(el, n_offset); + range.setEnd(el, n_offset); + } catch(e) { + Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body); + + return; + } + + try { + this._selectRange(sel, range); + } catch(e) { } + } + + try { + Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body); + } catch(e) { } + } + }, + + SaveContent: function() { + this._saveContent(); + }, + + RestoreContent: function() { + this._undo(false); + }, + + _undo: function(pr) { + if(this.__stack) { + if(this.__stackPos > 0) { + if(this.__stackPos == this.__stack.length && pr) + this._saveContent(); + + do { + var tmp = Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML); + + this.__stackPos--; + this._restoreContent(); + } + while(Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML) == tmp && this.__stackPos > 0 && pr) + + var editor = this; + setTimeout(function() { + try { + editor._ifShadow(); + } catch(e) { }; + + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) + try { + editor._editPanel.updateToolbar(); + } catch(e) { } + + if(!pr) + editor.onContentChanged(); + }, 0); + } + } + }, + + _redo: function() { + if(this.__stack) { + if(this.__stackPos < this.__stack.length - 1) { + this.__stackPos++; + var editor = this, + tempCollectionLength; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + tempCollectionLength = editor._doc.body.getElementsByTagName("EMBED").length; + + if(tempCollectionLength > 0) { + var popup = editor._body.ownerDocument.createElement("div"); + editor._body.appendChild(popup); + + setTimeout(function() { + editor._body.removeChild(popup); + }, 0); + } + } + + this._restoreContent(); + var editor = this; + + setTimeout(function() { + editor._ifShadow(); editor._editPanel.updateToolbar(); + }, 0); + } + } + }, + + undo: function() { + this._undo(true); + this.onContentChanged(); + }, + + redo: function() { + this._redo(); + this.onContentChanged(); + }, + + _contextMenuCallP: function() { + }, + + onContentChanged: function() { + }, + + _copyCut: function(key, prize) { + var editor = this; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._getSelection(), + range = this._createRange(sel), + was = false, + html = ""; + + if(key == 'x') + this._saveContent(); + + if(sel.type.toLowerCase() == "control") { + was = true; + html = Sys.Extended.UI.HtmlEditor.getHTML(range.item(0), true) + } else { + if(range.text != "") { + was = true; + html = range.htmlText; + + var sr = range.duplicate(); + + var rng = this._getTextNodeCollection(); + + if(rng.length < 1) + return; + + var fnd = Sys.Extended.UI.HtmlEditor._commonParent(rng[0], rng[rng.length - 1]); + + if(fnd != null && rng[0].previousSibling && rng[0].previousSibling.nodeType == 3) { + var par = fnd.parent; + + while(par && par.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + var ttt = par.cloneNode(false); + ttt.innerHTML = html; + html = ttt.outerHTML; + par = par.parentNode; + } + } + + sel = this._getSelection(); + sel.empty(); + + range = this._createRange(sel); + range.setEndPoint("EndToEnd", sr); + range.setEndPoint("StartToStart", sr); + range.select(); + } else { + if(range.htmlText != "") { + was = true; + html = range.htmlText; + } + } + } + + if(was) { + var src = this._doc.createElement("DIV"); + + src.innerHTML = "!!!" + html; + src.removeChild(src.firstChild); + src.removeChild(src.firstChild); + + var temp = Sys.Extended.UI.HtmlEditor.getHTML(src, false, true); + + var nnreg = new RegExp("(<[/]?)(teo" + Sys.Extended.UI.HtmlEditor.smartClassName + ":)", "ig"); + temp = temp.replace(nnreg, "$1"); + + delete src; + this._contentCopy(temp, true); + range.select(); + + if(key == 'x') { + sel.clear(); + this._clearP(); + } + } else { + if(key == 'x') { + sel.clear(); + this._clearP(); + } + } + + if(prize) + setTimeout(function() { editor._editPanel.updateToolbar(); }, 0); + } else { + if(key == "x") { + this._saveContent(); + + var sel = this._getSelection(), + range = this._createRange(sel); + + this._removeAllRanges(sel); + range.deleteContents(); + + if(this._doc.body.innerHTML == "") { + this._doc.body.innerHTML = "
    "; + range.setStart(this._doc.body, 0); + range.setEnd(this._doc.body, 0); + } + + editor.onContentChanged(); + this._selectRange(sel, range); + } else { + var sel = this._getSelection(), + range = this._createRange(sel); + + this._removeAllRanges(sel); + + alert(String.format(Sys.Extended.UI.Resources.HTMLEditor_toolbar_button_Use_verb, (Sys.Extended.UI.HtmlEditor.isSafari && navigator.userAgent.indexOf("mac") != -1) ? "Apple-C" : "Ctrl-C")); + this._selectRange(sel, range); + } + } + }, + + _paste: function(prize, word) { + var editor = this, + sel = this._getSelection(), + range = this._createRange(sel), + _left, + _top; + + if(!prize) { + _left = range.offsetLeft; + _top = range.offsetTop; + + this.insertHTML(this._getPlain()); + editor.onContentChanged(); + + return; + } + + if(this._editPanel.get_noPaste()) + return; + + _left = range.offsetLeft; + _top = range.offsetTop; + + var temp = this._doc.createElement("span"), + place, + tText = this._contentCopy("", false, word); + + if((/<[\/]*p[\s>]+/i.test(tText)) || (/<[\/]*h/i.test(tText))) { + place = this._getSafePlace(); + } else { + place = this._doc.createElement("SPAN"); + place.id = Sys.Extended.UI.HtmlEditor.smartClassName; + + if(!this.insertHTML(Sys.Extended.UI.HtmlEditor.getHTML(place, true))) + return; + + place = this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName); + + if(place) { + place.id = null; + place.removeAttribute("id"); + place.setAttribute("para", "no"); + } + } + + temp.innerHTML = tText; + if(!place) + return; + + this._checkImages(temp); + + var par = place.parentNode, + pos = place.getAttribute("para"); + + if(pos != "no") { + if(pos.indexOf("left") >= 0 && temp.firstChild) { + if(temp.firstChild.tagName && temp.firstChild.tagName.toUpperCase() == "P") { + while(temp.firstChild.firstChild) + place.previousSibling.appendChild(temp.firstChild.firstChild); + + temp.removeChild(temp.firstChild); + } + } + + if(pos.indexOf("right") >= 0 && temp.lastChild) { + if(temp.lastChild.tagName && temp.lastChild.tagName.toUpperCase() == "P") { + while(temp.lastChild.lastChild) + place.nextSibling.insertBefore(temp.lastChild.lastChild, place.nextSibling.firstChild); + + temp.removeChild(temp.lastChild); + } + } + } + + var saveEl = place, + temp1 = null; + + if(temp.childNodes.length == 0 && pos.indexOf("left") >= 0 && pos.indexOf("right") >= 0) { + if(place.nextSibling.firstChild) { + temp1 = this._doc.createElement("span"); + saveEl = temp1; + temp1.innerHTML = "111"; + place.previousSibling.appendChild(temp1); + } + + while(place.nextSibling.firstChild) + place.previousSibling.appendChild(place.nextSibling.firstChild); + + par.removeChild(place.nextSibling); + } else { + while(temp.firstChild) + par.insertBefore(temp.firstChild, place); + } + + setTimeout(function() { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(sel.type.toLowerCase() == "control") { + while(range.length > 0) + range.remove(0); + } + + try { + range.collapse(false); + } catch(e) { } + + editor.focusEditor(); + Sys.Extended.UI.HtmlEditor._setCursor(saveEl, editor); + + if(temp1) + temp1.parentNode.removeChild(temp1); + + par.removeChild(place); + Sys.Extended.UI.HtmlEditor.inspectForShadows(editor._doc.body); + editor.onContentChanged(); + range.select(); + }, 0); + }, + + _contentCopy: function(text, prize, word) { + if(text != "") { + text = text.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig, "$1 $3") + .replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/ig, "$1
    $3") + .replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/ig, "$1
    $3"); + } + + var iframe = this._doc.createElement("iframe"); + + iframe.width = "0"; + iframe.height = "0"; + + if(Sys.Extended.UI.HtmlEditor.isIE) + iframe.src = "javascript:false;"; + + this._doc.appendChild(iframe); + var doc = iframe.contentWindow.document; + + doc.write("" + text + ""); + doc.close(); + doc.body.contentEditable = true; + + var r = doc.body.createTextRange(), + wasNbsp = false; + + if(text == "") { + r.execCommand("paste"); + var trg = doc.createElement("DIV"); + + for(var i = 0; i < doc.body.childNodes.length; i++) { + var child = doc.body.childNodes.item(i); + + if(child.nodeType == 8) { + var str = "" + child.data + ""; + + if(str.search(/StartFragment/i) >= 0) { + if(child.nextSibling && child.nextSibling.nodeType == 3) { + var str = "" + child.nextSibling.data + ""; + + if(str.length) { + if(str.charCodeAt(0) == 160) { + str = str.substr(1); + child.nextSibling.data = str; + wasNbsp = true; + + break; + } + } + } + } + } + } + + if(typeof word != "undefined" && word) + doc.body.innerHTML = Sys.Extended.UI.HtmlEditor.cleanUp(doc.body.innerHTML); + + var str = Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(doc.body, false, true)); + str = str.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi, ""); + doc.body.innerHTML = str; + + if(!prize) { + Sys.Extended.UI.HtmlEditor.operateAnchors(this, doc, !this.showAnchors); + Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this, doc, !this.showPlaceHolders); + + var tempCollection = doc.body.getElementsByTagName("EMBED"); + + var els = []; + for(var i = 0; i < tempCollection.length; i++) + els.push(tempCollection[i]); + + for(var jk = 0; jk < els.length; jk++) + els[jk].parentNode.removeChild(els[jk]); + } + + delete r; + delete trg; + + if(prize && Sys.Extended.UI.HtmlEditor.isIE) + r = doc.body.createTextRange(); + } + + if(prize && Sys.Extended.UI.HtmlEditor.isIE) { + if(text != "") { + Sys.Extended.UI.HtmlEditor.operateAnchors(this, doc, true); + Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this, doc, true); + } + + r.select(); + r.execCommand("copy"); + } + + var ret = Sys.Extended.UI.HtmlEditor.Trim(doc.body.innerHTML) + .replace(/\s*<\/td>/ig, "") + .replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig, "$1 $3") + .replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/ig, "$1 $3") + .replace(/()/ig, "$1pseudomode=$3$4") + .replace(/(]*?>)/ig, "$1 wmode=\"transparent\"$2"); + + var tempCollection = doc.body.getElementsByTagName("EMBED"), + els = []; + + for(var i = 0; i < tempCollection.length; i++) + els.push(tempCollection[i]); + + for(var jk = 0; jk < els.length; jk++) + els[jk].parentNode.removeChild(els[jk]); + + iframe.src = ""; + var editor = this; + editor._doc.removeChild(iframe); + + delete iframe; + + return ret; + }, + + insertHTML: function(html, range) { + this.focusEditor(); + var sel = this._getSelection(); + + if(typeof range == "undefined") + range = this._createRange(sel); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + function regReplScript(p0, p1) { + return ""; + } + + function regReplFromScript(p0, p1, p2, p3) { + return p1.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&"); + } + + var new_html = "111" + html + ""; + var mArr = Sys.Extended.UI.HtmlEditor.getHrefsText(new_html); + var mArr1 = Sys.Extended.UI.HtmlEditor.getImagesText(new_html); + + if(!this._editPanel.get_noScript()) + new_html = new_html.replace(/(]*?)>.*?<\/script(?:[^>]*?)>)/gi, regReplScript); + else + new_html = new_html.replace(/(]*?)>.*?<\/script(?:[^>]*?)>)/gi, ""); + + var editor = this; + try { + if(range.pasteHTML) { + range.pasteHTML(new_html); + } else { + var div = this._doc.createElement("DIV"); + div.innerHTML = new_html; + + while(div.firstChild) + range(0).parentNode.insertBefore(div.firstChild, range(0)); + + range(0).parentNode.removeChild(range(0)); + range.remove(0); + + delete div; + } + } catch(e) { + return false; + } + + var trg = this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName); + + trg.innerHTML = "qqq" + Sys.Extended.UI.HtmlEditor.getHTML(trg, false, true).replace(new RegExp("]*?)class=" + Sys.Extended.UI.HtmlEditor.smartClassName + "_script(?:[^>]*?)>(.*?)<\/span(?:[^>]*?)>", "gi"), regReplFromScript) + "qqq"; + trg.removeChild(trg.firstChild); + trg.removeChild(trg.lastChild); + + Sys.Extended.UI.HtmlEditor.setHrefsText(trg, mArr); + Sys.Extended.UI.HtmlEditor.setImagesText(trg, mArr1); + + if(trg.firstChild) + trg.removeChild(trg.firstChild); + + if(trg.firstChild) + trg.removeChild(trg.firstChild); + + while(trg.firstChild) + trg.parentNode.insertBefore(trg.firstChild, trg); + + trg.parentNode.removeChild(trg); + delete trg; + + return true; + } else { + var div = this._doc.createElement("div"); + div.innerHTML = html; + + var tempCollection = div.getElementsByTagName("EMBED"); + + var embedCollection = []; + for(var i = 0; i < tempCollection.length; i++) + embedCollection.push(tempCollection[i]); + + for(var j = 0; j < embedCollection.length; j++) { + var embed = embedCollection[j], + img = document.createElement("IMG"), + attrs = embed.attributes; + + img.src = this._images_list[1]; + img.setAttribute("dummytag", "embed"); + + for(var i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + if(!a.specified) + continue; + + var name = a.name.toLowerCase(), + value = a.value; + + if(name == "src") + name = "dummysrc"; + else if(name == "bgcolor") + name = "dummybgcolor"; + else if(name == "wmode") + name = "pseudomode"; + + img.setAttribute(name, value); + } + + img.getAttribute("type") + img.style.cssText = "border: 1px dotted #000000; background-image: url('" + (img.getAttribute("type").toLowerCase() == "application/x-mplayer2" ? this._images_list[3] : this._images_list[2]) + "'); background-position: center; background-repeat: no-repeat; background-color: #c0c0c0;"; + + embed.parentNode.insertBefore(img, embed); + embed.parentNode.removeChild(embed); + } + var ret = this.insertNodeAtSelection(div, range); + + return ret; + } + }, + + insertNodeAtSelection: function(toBeInserted, range) { + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._getSelection(); + + if(typeof range == "undefined") { + try { + range = this._createRange(sel); + } catch(ex) { + this._removeAllRanges(sel); + + return false; + } + } + + var node = range.startContainer, + pos = range.startOffset; + + if(node.ownerDocument.id != "EditorDocument") + return false; + + if((range.startContainer.nodeType == 1 && range.startContainer.tagName.toUpperCase() == "TR") || + (range.endContainer.nodeType == 1 && range.endContainer.tagName.toUpperCase() == "TR")) + return false; + + this._removeAllRanges(sel); + range.deleteContents(); + + try { + range = this._createRange(); + } catch(ex) { + this._removeAllRanges(sel); + + return false; + } + + switch(node.nodeType) { + case 3: + if(pos > 0) + node = node.splitText(pos); + + while(toBeInserted.firstChild) + node.parentNode.insertBefore(toBeInserted.firstChild, node); + + range.setStart(node, 0); + range.setEnd(node, 0); + + break; + case 1: + case 11: + try { + this._removeAllRanges(sel); + if(node.childNodes.length >= pos + 1) { + node = node.childNodes.item(pos); + + while(toBeInserted.firstChild) + node.parentNode.insertBefore(toBeInserted.firstChild, node); + + var tempText = this._doc.createTextNode(""); + node.parentNode.insertBefore(tempText, node); + node = tempText; + } else { + var tempText = this._doc.createTextNode(""); + + if(Sys.Extended.UI.HtmlEditor.canHaveChildren(node)) { + while(toBeInserted.firstChild) + node.appendChild(toBeInserted.firstChild); + + node.appendChild(tempText); + } else { + while(toBeInserted.firstChild) + node.parentNode.insertBefore(toBeInserted.firstChild, node); + + node.parentNode.insertBefore(tempText, node); + } + node = tempText; + } + + if(node.nodeType == 1) { + var par = node.parentNode, + container = par, + j = 0; + + for(; j < par.childNodes.length; j++) + if(node == par.childNodes.item(j)) + break; + + range.setStart(par, j); + range.setEnd(par, j); + } else { + range.setStart(node, 0); + range.setEnd(node, 0); + } + } catch(ex) { + this._removeAllRanges(sel); + + return false; + } + break; + } + + this._selectRange(sel, range); + return true; + } else { + return false; + } + }, + + trickWithStyles: function(tid) { + var editor = this, + el = editor._doc.getElementById(tid); + + if(el != null) { + if(el.nextSibling && el.nextSibling.nodeType == 3) { + var text = el.nextSibling; + el.parentNode.removeChild(el); + + var spaceIndex = ("" + text.data + "").indexOf(" "); + if(spaceIndex > 0) { + text.splitText(spaceIndex); + } else { + if(spaceIndex == 0) + text.splitText(1); + } + + if(editor.n_arr != null) + for(var im = 0; im < editor.n_arr.length; im++) + editor.MSIE_applyCssStyle(editor.n_arr[im], [text], false); + + editor.n_arr = null; + + var sel = editor._getSelection(); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var range = editor._doc.createRange(); + + range.setStart(text, text.length); + range.setEnd(text, text.length); + + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + } else { + var range1 = editor._createRange(sel), + span1 = editor._doc.createElement("span"); + + if(text.nextSibling) + text.parentNode.insertBefore(span1, text.nextSibling); + else + text.parentNode.appendChild(span1); + + try { + range1.moveToElementText(span1); + range1.select(); + } catch(e) { } + + span1.parentNode.removeChild(span1); + } + } + else { + el.parentNode.removeChild(el); + } + } + }, + + _getParent: function(range) { + if(Sys.Extended.UI.HtmlEditor.isIE) + return range.parentElement(); + else + return range.startContainer; + }, + + _checkImages: function(element) { + if(this._editPanel.get_relativeImages()) { + var images = element.getElementsByTagName("IMG"); + + for(var i = 0; i < images.length; i++) { + var image = images[i]; + + if(image.src.indexOf("http://") >= 0) { + var tmp = image.src; + + image.src = "qwerty.gif"; + var n = image.src.indexOf("qwerty.gif"); + + if(tmp.substr(0, n) == image.src.substr(0, n)) + tmp = tmp.substr(n, tmp.length - n); + + image.src = tmp; + } + } + } + }, + + _getSafePlace: function(uel) { + var el = this._doc.createElement("SPAN"), + editor = this; + + el.id = Sys.Extended.UI.HtmlEditor.smartClassName; + + if(typeof uel == "undefined") { + if(!this.insertHTML(Sys.Extended.UI.HtmlEditor.getHTML(el, true))) + return null; + } else { + if(uel.nextSibling == null) + uel.parentNode.appendChild(el); + else + uel.parentNode.insertBefore(el, uel.nextSibling); + + uel.parentNode.removeChild(uel); + } + + el = this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName); + el.id = null; + el.removeAttribute("id"); + el.setAttribute("para", "no"); + + var parent = el.parentNode, + tagName = parent.tagName.toUpperCase(); + + while(tagName != "BODY" && tagName != "TD" && tagName != "P" && tagName != "DIV") { + if(Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName)) { + parent = parent.parentNode; + tagName = parent.tagName.toUpperCase(); + } else { + break; + } + } + + if(tagName == "P") { + el.setAttribute("para", ""); + + function diver(add, el, rpr, before) { + var neighbour, + par = Sys.Extended.UI.HtmlEditor.myClone(rpr, editor._doc, false); + + if(add) + par.appendChild(add); + + while(el) { + if(el.nodeType == 1 || (el.nodeType == 3 && Sys.Extended.UI.HtmlEditor.Trim("" + el.data + "").length > 0)) { + var text = null; + + if(el.tagName && el.tagName.toUpperCase() == "SCRIPT") + text = el.text; + + var ela = Sys.Extended.UI.HtmlEditor.myClone(el, editor._doc, true); + + if(par.childNodes.length == 0 || !before) + par.appendChild(ela); + else + par.insertBefore(ela, par.firstChild); + + if(text != null) + ela.text = text; + } + el = before ? el.previousSibling : el.nextSibling + } + + if(par.childNodes.length == 0) { + delete par; + par = null; + } + + if(rpr == parent) + return par; + else + return diver(par, before ? rpr.previousSibling : rpr.nextSibling, rpr.parentNode, before); + }; + + var p1 = diver(null, el.previousSibling, el.parentNode, true), + p2 = diver(null, el.nextSibling, el.parentNode, false); + + var par = parent.parentNode; + + if(p1) { + par.insertBefore(p1, parent); + el.setAttribute("para", el.getAttribute("para") + " left"); + } + par.insertBefore(el, parent); + + if(p2) { + par.insertBefore(p2, parent); + el.setAttribute("para", el.getAttribute("para") + " right"); + } + par.removeChild(parent); + } + + return el; + }, + + noContextMenuAttributeName: function() { + return Sys.Extended.UI.HtmlEditor.noContextMenuAttribute; + }, + + _getTextNodeCollection: function(total) { + var _result = []; + if(this.isControl()) + return _result; + + var sel = this._getSelection(), + range = this._createRange(sel); + + var rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right", + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left", + r_left = null, + r_right = null, + svs; + + if(typeof total == "undefined") { + if(Sys.Extended.UI.HtmlEditor.isIE) { + r_left = range.duplicate(); + r_right = range.duplicate(); + r_left.setEndPoint("EndToStart", range); + r_right.setEndPoint("StartToEnd", range); + } else { + r_left = range.cloneRange(); + r_right = range.cloneRange(); + r_left.setEnd(r_left.startContainer, r_left.startOffset); + r_right.setStart(r_right.endContainer, r_right.endOffset); + svs = r_left.endOffset; + } + + if(!this.insertHTML("", r_right)) { + return _result; + } else { + if(Sys.Extended.UI.HtmlEditor.isOpera) { + r_left.setEnd(r_left.startContainer, svs); + r_left.setStart(r_left.startContainer, svs); + } + + if(!this.insertHTML("", r_left)) { + var rP = this._doc.getElementById(rn); + + if(rP != null) { + temp = rP.parentNode; + temp.removeChild(rP); + } + + var rL = this._doc.getElementById(rl); + if(rL != null) { + temp = rL.parentNode; + temp.removeChild(rL); + } + + return _result; + } + } + } else { + var span; + + span = this._doc.createElement("SPAN"); + span.id = rn; + this._doc.body.appendChild(span); + + span = this._doc.createElement("SPAN"); + span.id = ln; + this._doc.body.insertBefore(span, this._doc.body.firstChild); + } + + var lPoint = this._doc.getElementById(ln), + rPoint = this._doc.getElementById(rn); + + if(lPoint == null || rPoint == null) { + var temp; + + if(lPoint != null) { + temp = lPoint.parentNode; + temp.removeChild(lPoint); + } + + if(rPoint != null) { + temp = rPoint.parentNode; + temp.removeChild(rPoint); + } + + return []; + } + + while(lPoint.firstChild) + lPoint.removeChild(lPoint.firstChild); + + while(rPoint.firstChild) + rPoint.removeChild(rPoint.firstChild); + + while(lPoint.previousSibling && lPoint.previousSibling.nodeType == 3 && + Sys.Extended.UI.HtmlEditor.Trim("" + lPoint.previousSibling.data + "").length == 0) + lPoint.parentNode.removeChild(lPoint.previousSibling); + + while(lPoint.nextSibling && lPoint.nextSibling.nodeType == 3 && + Sys.Extended.UI.HtmlEditor.Trim("" + lPoint.nextSibling.data + "").length == 0) + lPoint.parentNode.removeChild(lPoint.nextSibling); + + while(rPoint.previousSibling && rPoint.previousSibling.nodeType == 3 && + Sys.Extended.UI.HtmlEditor.Trim("" + rPoint.previousSibling.data + "").length == 0) + rPoint.parentNode.removeChild(rPoint.previousSibling); + + while(rPoint.nextSibling && rPoint.nextSibling.nodeType == 3 && + Sys.Extended.UI.HtmlEditor.Trim("" + rPoint.nextSibling.data + "").length == 0) + rPoint.parentNode.removeChild(rPoint.nextSibling); + + var _found = false, + editor = this; + + function _diver(_point, prize) { + while(_point) { + if(_point.id && _point.id == rn) { + _found = true; + + return; + } + + if(_point.nodeType == 3) { + while(_point.nextSibling && (_point.nextSibling.nodeType == 3 || (!Sys.Extended.UI.HtmlEditor.isIE && typeof editor.__saveBM__ != "undefined" && editor.__saveBM__ != null && editor.__saveBM__[0] == _point.nextSibling))) { + if(_point.nextSibling.nodeType == 3) { + _point.data = "" + _point.data + "" + _point.nextSibling.data + ""; + } else { + editor.__saveBM__[0] = _point; + editor.__saveBM__[1] = ("" + _point.data + "").length; + } + + _point.parentNode.removeChild(_point.nextSibling); + } + + if(Sys.Extended.UI.HtmlEditor.Trim("" + _point.data + "").length > 0) + _result.push(_point); + } else { + var tagName = _point.tagName; + + if(_point.tagName) { + tagName = tagName.toUpperCase(); + + if(!(tagName == "MAP" || tagName == "AREA" || tagName == "SCRIPT" || tagName == "NOSCRIPT")) + if(!(_point.style && (Sys.Extended.UI.HtmlEditor.getStyle(_point, "display") == "none" || Sys.Extended.UI.HtmlEditor.getStyle(_point, "visibility") == "hidden"))) + _diver(_point.firstChild, false); + } + } + + if(_found) + return; + + var _save = _point.parentNode; + + if(prize) + while(_point.nextSibling == null) + _point = _point.parentNode; + + _point = _point.nextSibling; + } + }; + + _diver(lPoint, true); + var temp; + + temp = lPoint.parentNode; + temp.removeChild(lPoint); + temp = rPoint.parentNode; + temp.removeChild(rPoint); + + if(typeof total == "undefined") { + if(Sys.Extended.UI.HtmlEditor.isIE) { + sel.empty(); + r_right.select(); + } else { + if(_result.length > 0) { + this._removeAllRanges(sel); + var rrr = this._createRange(); + + rrr.setEnd(_result[_result.length - 1], _result[_result.length - 1].length); + rrr.setStart(_result[_result.length - 1], _result[_result.length - 1].length); + this._selectRange(sel, rrr); + } + } + } + + return _result; + }, + + _getPlain: function() { + var area = this._doc.createElement("textarea"); + area.width = "0"; + area.height = "0"; + + this._doc.appendChild(area); + var r = area.createTextRange(); + r.execCommand("paste"); + var res = area.value; + res = res.replace(//g, ">").replace(/\r/g, "").replace(/\n/g, "
    "); + this._doc.removeChild(area); + + return res; + }, + + _execCommand: function(cmdID, UI, param) { + var editor = this, + sel, + range; + + if(Sys.Extended.UI.HtmlEditor.isIE && !this.isControl()) { + sel = this._getSelection(); + range = this._createRange(sel); + + var prnt = range.parentElement(); + if(prnt.tagName.toUpperCase() == "TEXTAREA") + return; + } + + if(cmdID.toLowerCase() != "createlink") + this._saveContent(); + + switch(cmdID.toLowerCase()) { + case "createlink": + if(Sys.Extended.UI.HtmlEditor.isIE || !UI) { + this._doc.execCommand(cmdID, UI, param); + } else { + var param; + + if((param = prompt("Enter URL"))) + this._doc.execCommand(cmdID, false, param); + } + break; + case "backcolor": + case "forecolor": + case "fontname": + case "fontsize": + this.MSIE_applyCommand(cmdID.toLowerCase(), param); + break; + case "indent": + this.MSIE_indent(true); + break; + case "outdent": + this.MSIE_indent(false); + break; + case "justifyleft": + this.MSIE_justify("left"); + break; + case "justifyfull": + this.MSIE_justify("justify"); + break; + case "justifycenter": + this.MSIE_justify("center"); + break; + case "justifyright": + this.MSIE_justify("right"); + break; + case "paragraph": + this.MSIE_justify("remain", false, "P"); + break; + case "formatblock": + if(param != null && typeof param == "string" && param.length == 2) + if(param.substr(0, 1).toUpperCase() == "H" && parseInt(param.substr(1, 1)) > 0) { + this.MSIE_justify("remain", false, param); + break; + } + + this._doc.execCommand(cmdID, UI, param); + break; + case "insertunorderedlist": + this.MSIE_list("UL"); + break; + case "insertorderedlist": + this.MSIE_list("OL"); + break; + case "bold": + case "italic": + case "underline": + case "strikethrough": + case "superscript": + case "subscript": + this.MSIE_applyCommand(cmdID.toLowerCase()); + break; + default: + this._doc.execCommand(cmdID, UI, param); + break; + } + + this.onContentChanged(); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + sel = this._getSelection(); + range = this._createRange(sel); + + this._removeAllRanges(sel); + + this._selectRange(sel, range); + this.focusEditor(); + } + + var editor = this; + setTimeout(function() { + editor._editPanel.updateToolbar(); + }, 0); + }, + + MSIE_indent: function(increase) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.MSIE_indent))(increase); + }, + + MSIE_justify: function(textAlign, addParameter, addParameter1) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.MSIE_justify))(textAlign, addParameter, addParameter1); + }, + + MSIE_list: function(listTg) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.MSIE_list))(listTg); + }, + + getSelectionAfterOperation: function(paragraphs) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.getSelectionAfterOperation))(paragraphs); + }, + + setSelectionAfterOperation: function(pars, needJoiner) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.setSelectionAfterOperation))(pars, needJoiner); + }, + + get_paragraphs: function() { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.get_paragraphs))(); + }, + + getPseudoP: function() { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.getPseudoP))(); + }, + + getPseudoP_Recur: function(lPoint, rPoint, r_level) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.getPseudoP_Recur))(lPoint, rPoint, r_level); + }, + + unWrap: function(element, pars) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.unWrap))(element, pars); + }, + + tryUnWrap: function(element, pars, force) { + return (Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.tryUnWrap))(element, pars, force); + }, + + MSIE_applyCommand: function(cmd, par) { + var selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(this.getSelectedHTML()) : ""; + + if(this.isControl()) + return; + + var sel = this._getSelection(), + range = this._createRange(sel), + savedRange = (Sys.Extended.UI.HtmlEditor.isIE) ? [range.boundingLeft, range.boundingTop] : [range.startContainer, range.startOffset], + notEmpty = (Sys.Extended.UI.HtmlEditor.isIE && range.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0); + + var cssStyle = { name: "none", value: "none" }; + switch(cmd.toLowerCase()) { + case "bold": + cssStyle = { name: "font-weight", value: "bold", repl: false }; + break; + case "italic": + cssStyle = { name: "font-style", value: "italic", repl: false }; + break; + case "underline": + cssStyle = { name: "text-decoration", value: "underline", repl: false }; + break; + case "strikethrough": + cssStyle = { name: "text-decoration", value: "line-through", repl: false }; + break; + case "superscript": + cssStyle = { name: "vertical-align", value: "super", repl: false }; + break; + case "subscript": + cssStyle = { name: "vertical-align", value: "sub", repl: false }; + break; + case "forecolor": + cssStyle = { name: "color", value: par, repl: false }; + break; + case "backcolor": + cssStyle = { name: "background-color", value: par, repl: false }; + break; + case "fontname": + cssStyle = { name: "font-family", value: par, repl: false }; + break; + case "fontsize": + cssStyle = { name: "font-size", value: par, repl: false }; + break; + } + + if(notEmpty) { + var rng = this._getTextNodeCollection(); + this.MSIE_applyCssStyle(cssStyle, rng, true); + } else { + if(this.isControl()) + return; + + var rng = this._tryExpand(); + + if(rng.length > 0) { + this.MSIE_applyCssStyle(cssStyle, rng, false); + + if(Sys.Extended.UI.HtmlEditor.isIE && this.__saveBM__ != null) { + sel = this._getSelection(); + range = this._createRange(sel); + range.moveToBookmark(this.__saveBM__); + range.select(); + this.__saveBM__ = null; + } else { + if(this.__saveBM__ != null) { + if(this.__saveBM__[0].nodeType == 3) { + sel = this._getSelection(); + range = this._doc.createRange(); + range.setStart(this.__saveBM__[0], this.__saveBM__[1]); + range.setEnd(this.__saveBM__[0], this.__saveBM__[1]); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + } else { + this._trySelect(this.__saveBM__[0], this.__saveBM__[0]); + this.__saveBM__[0].parentNode.removeChild(this.__saveBM__[0]); + } + + this.__saveBM__ = null; + } + } + } else { + this._setStyleForTyping(cssStyle); + } + } + }, + + MSIE_applyCssStyle: function(cssStyle, rng, selectPrize) { + var name = cssStyle.name.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase(); }), + value = cssStyle.value, + repl = cssStyle.repl, + _detected = false, + _remove = false; + + this._saveContent(); + + var rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right", + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left"; + + var lPoint = this._doc.createElement("SPAN"); + lPoint.id = ln; + + var rPoint = this._doc.createElement("SPAN"); + rPoint.id = rn; + + rng[0].parentNode.insertBefore(lPoint, rng[0]); + + if(rng[rng.length - 1].nextSibling != null) + rng[rng.length - 1].parentNode.insertBefore(rPoint, rng[rng.length - 1].nextSibling); + else + rng[rng.length - 1].parentNode.appendChild(rPoint); + + Sys.Extended.UI.HtmlEditor.unStyle(lPoint); + Sys.Extended.UI.HtmlEditor.unStyle(rPoint); + + var parentNodes = []; + for(var i = 0; i < rng.length; i++) { + var textNode = rng[i], + par = textNode.parentNode; + + var j; + for(j = 0; j < parentNodes.length; j++) { + var parent = parentNodes[j]; + + if(parent.parent == par) { + parent.textNodes.push(textNode); + break; + } + } + + if(j == parentNodes.length) + parentNodes.push({ parent: par, textNodes: [textNode] }); + } + + for(var i = 0; i < parentNodes.length; i++) { + var parent = parentNodes[i]; + + if(parent.textNodes.length > 1) { + var textNodes = parent.textNodes; + + var lPointT = this._doc.createElement("SPAN"), + rPointT = this._doc.createElement("SPAN"); + + textNodes[0].parentNode.insertBefore(lPointT, textNodes[0]); + + if(textNodes[textNodes.length - 1].nextSibling != null) + textNodes[textNodes.length - 1].parentNode.insertBefore(rPointT, textNodes[textNodes.length - 1].nextSibling); + else + textNodes[textNodes.length - 1].parentNode.appendChild(rPointT); + + Sys.Extended.UI.HtmlEditor._moveTagsUp(lPointT, rPointT); + + lPointT.parentNode.removeChild(lPointT); + rPointT.parentNode.removeChild(rPointT); + } + } + + for(var i = 0; i < rng.length; i++) { + var textNode = rng[i], + par = textNode.parentNode, + _found = false; + + while(par && par.tagName && par.childNodes.length == 1 && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + var parTag = par.tagName.toUpperCase(); + + if( + ((parTag == "I" || parTag == "EM") && cssStyle.name == "font-style") || + ((parTag == "B" || parTag == "STRONG") && cssStyle.name == "font-weight") || + ((parTag == "S" || parTag == "STRIKE") && cssStyle.name == "text-decoration") || + ((parTag == "U") && cssStyle.name == "text-decoration") || + ((parTag == "SUB" || parTag == "SUP") && cssStyle.name == "vertical-align") + ) { + var parSaved = par; + par = par.parentNode; + + while(parSaved.firstChild) + par.insertBefore(parSaved.firstChild, parSaved); + + par.removeChild(parSaved); + + _found = true; + + continue; + } else if(par.style && par.style[name] && par.style[name].length > 0) { + var foundCss = par.style[name]; + + if(name.toLowerCase().indexOf("color") >= 0 || name == "fontFamily" || name == "fontSize") { + par.style[name] = value; + } else { + if(repl) { + try { + par.style[name] = par.style[name] + " " + value; + + if(foundCss == par.style[name]) + par.style[name] = value; + } catch(e) { + par.style[name] = value; + } + } else { + if(!_detected) { + var sv = foundCss.replace(value, ""); + + if(name == "fontWeight" && foundCss.toString() == "700") + sv = ""; + + if(sv == foundCss) { + try { + par.style[name] = par.style[name] + " " + value; + + if(foundCss == par.style[name]) + par.style[name] = value; + } catch(e) { + par.style[name] = value; + } + } else { + par.style[name] = sv.replace(/,/, ""); + _remove = true; + } + + _detected = true; + } else { + if(_remove) { + par.style[name] = foundCss.replace(value, "").replace(/,/, ""); + } else { + try { + par.style[name] = par.style[name] + " " + value; + + if(foundCss == par.style[name]) + par.style[name] = value; + } catch(e) { + par.style[name] = value; + } + } + } + } + } + + _found = true; + } + + par = par.parentNode; + } + + if(!_found && !_remove) { + var span; + + span = this._doc.createElement("SPAN"); + span.style[name] = value; + + var parN = textNode.parentNode; + parN.insertBefore(span, textNode); + + span.appendChild(textNode); + _detected = true; + } + } + + var commonParent = Sys.Extended.UI.HtmlEditor._commonTotalParent(lPoint, rPoint), + pSibling = commonParent.parent.childNodes.item(commonParent.indexFirst).previousSibling, + nSibling = commonParent.parent.childNodes.item(commonParent.indexLast).nextSibling; + + lPoint.parentNode.removeChild(lPoint); + rPoint.parentNode.removeChild(rPoint); + + var indexFirst = 0, + indexLast = commonParent.parent.childNodes.length; + + if(pSibling != null) + indexFirst = Sys.Extended.UI.HtmlEditor.__getIndex(pSibling); + + if(nSibling != null) { + indexLast = Sys.Extended.UI.HtmlEditor.__getIndex(nSibling) + 1; + + if(indexLast < commonParent.parent.childNodes.length) { + if(nSibling.nodeType == 3) { + indexLast++; + } else if(nSibling.nodeType == 1) { + var tag = nSibling.tagName.toUpperCase(); + + if(tag != "TR" && tag != "TD" && tag != "LI") + indexLast++; + } + } + } + + Sys.Extended.UI.HtmlEditor.spanJoiner(commonParent.parent, this._doc, indexFirst, indexLast); + + var editor = this; + if(selectPrize) + editor._selectRng(rng); + + setTimeout(function() { + if(!Sys.Extended.UI.HtmlEditor.isIE) + editor.focusEditor(); + + editor._editPanel.updateToolbar(); + }, 0); + }, + + _tryExpand: function(prize) { + var result = [], + selectedHTML, + notEmpty; + + var sel = this._getSelection(), + range = this._createRange(sel), + sel1, + range1; + + var rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right_add", + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left_add", + mn = Sys.Extended.UI.HtmlEditor.smartClassName + "_middle_add"; + + if(Sys.Extended.UI.HtmlEditor.isIE && typeof prize == "undefined") { + range.execCommand('bold'); + this.__saveBM__ = range.getBookmark(); + range.execCommand('bold'); + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + var mn_element = null, + mn_span_text = "", + save_range = range.duplicate(); + + try { + range.pasteHTML(mn_span_text); + } catch(ex) { } + + mn_element = this._doc.getElementById(mn); + if(mn_element == null) + return []; + + if(typeof prize != "undefined") + this.__saveBM__ = mn_element; + + if(mn_element.nextSibling != null && !Sys.Extended.UI.HtmlEditor.isInlineElement(mn_element.nextSibling)) { + mn_element.parentNode.removeChild(mn_element); + + return []; + } + + range.expand('word'); + range.select(); + + if(range.text.length == 0) { + mn_element.parentNode.removeChild(mn_element); + save_range.select(); + + return []; + } + + var re = new RegExp(mn_span_text, "ig"); + if(!re.test(range.htmlText.replace(/[\n\r]/g, ""))) { + mn_element.parentNode.removeChild(mn_element); + save_range.select(); + + return []; + } + + re = new RegExp(mn_span_text + "(
    | |[\\s])*$", "ig"); + if(re.test(range.htmlText.replace(/[\n\r]/g, ""))) { + mn_element.parentNode.removeChild(mn_element); + save_range.select(); + + return []; + } + + while(range.text.length > 0 && range.text.substr(range.text.length - 1, 1) == " ") { + range.moveEnd('character', -1); + range.select(); + + if(range.text.length == 0) { + mn_element.parentNode.removeChild(mn_element); + save_range.select(); + + return []; + } + } + + + if(typeof prize == "undefined") + mn_element.parentNode.removeChild(mn_element); + + return this._getTextNodeCollection(); + } + + + function wordBound(c) { + var re = /[\d\w]/; + + if(re.test(c)) + return false; + + re = /[\u0080-\u024F]/; + if(re.test(c)) + return false; + + re = /[\u0370-\u2000]/; + if(re.test(c)) + return false; + + return true; + } + + if(!this.insertHTML("")) + return []; + + var lPoint = this._doc.getElementById(ln), + rPoint = this._doc.getElementById(rn), + mPoint = this._doc.getElementById(mn); + + Sys.Extended.UI.HtmlEditor.positionInParagraph(lPoint, lPoint.previousSibling, true, lPoint.parentNode, wordBound); + try { + this._trySelect(lPoint, rPoint); + } catch(ex) { } + + sel1 = this._getSelection(); + range1 = this._createRange(sel1); + selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(this.getSelectedHTML()) : ""; + notEmpty = (Sys.Extended.UI.HtmlEditor.isIE && range1.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0); + + if(!notEmpty || this._getTextNodeCollection().length == 0) { + var text1 = this._doc.createTextNode(""); + + lPoint.parentNode.insertBefore(text1, lPoint); + lPoint.parentNode.removeChild(lPoint); + rPoint.parentNode.removeChild(rPoint); + mPoint.parentNode.removeChild(mPoint); + + var range = this._doc.createRange(); + range.setStart(text1, 0); + range.setEnd(text1, 0); + range.setStart(text1, 0); + range.setEnd(text1, 0); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + + return []; + } + + rPoint.parentNode.insertBefore(lPoint, mPoint); + + Sys.Extended.UI.HtmlEditor.positionInParagraph(rPoint, rPoint.nextSibling, false, rPoint.parentNode, wordBound); + this._trySelect(lPoint, rPoint); + + sel1 = this._getSelection(); + range1 = this._createRange(sel1); + selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(this.getSelectedHTML()) : ""; + notEmpty = (Sys.Extended.UI.HtmlEditor.isIE && range1.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0); + + if(!notEmpty || this._getTextNodeCollection().length == 0) { + var text1 = this._doc.createTextNode(""); + + lPoint.parentNode.insertBefore(text1, lPoint); + lPoint.parentNode.removeChild(lPoint); + rPoint.parentNode.removeChild(rPoint); + mPoint.parentNode.removeChild(mPoint); + + var range = this._doc.createRange(); + range.setStart(text1, 0); + range.setEnd(text1, 0); + range.setStart(text1, 0); + range.setEnd(text1, 0); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + + return []; + } + + Sys.Extended.UI.HtmlEditor.positionInParagraph(lPoint, lPoint.previousSibling, true, lPoint.parentNode, wordBound); + this._trySelect(lPoint, rPoint); + sel1 = this._getSelection(); + range1 = this._createRange(sel1); + selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(this.getSelectedHTML()) : ""; + notEmpty = (Sys.Extended.UI.HtmlEditor.isIE && range1.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(typeof prize != "undefined") + this.__saveBM__ = mPoint; + else + mPoint.parentNode.removeChild(mPoint); + } else { + this.__saveBM__ = [mPoint, 0]; + } + + if(notEmpty) + result = this._getTextNodeCollection(); + + lPoint.parentNode.removeChild(lPoint); + rPoint.parentNode.removeChild(rPoint); + + return result; + }, + + _setStyleForTyping: function(cssStyle) { + var name = cssStyle.name.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase(); }), + value = cssStyle.value, + repl = cssStyle.repl; + + if(this._StyleForTyping == null) + this._StyleForTyping = []; + + var n_arr = [], + needApply = true; + + for(var i = 0; i < this._StyleForTyping.length; i++) { + var i_name = this._StyleForTyping[i].name.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase(); }), + i_value = this._StyleForTyping[i].value; + + if(!(i_name == name && (i_value == value || repl))) + n_arr.push(this._StyleForTyping[i]); + else + needApply = false; + } + + this._StyleForTyping = n_arr; + if(needApply) + this._StyleForTyping.push(cssStyle); + }, + + _trySelect: function(lPoint, rPoint) { + var sel = this._getSelection(), + text1 = null, + text2 = null; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + sel.empty(); + sel = this._getSelection(); + + var range1 = this._createRange(sel), + range2 = this._createRange(sel); + + try { + if(lPoint != null) + range1.moveToElementText(lPoint); + if(rPoint != null) + range2.moveToElementText(rPoint); + + if(lPoint != null && rPoint != null) { + range1.setEndPoint("EndToEnd", range2); + range1.select(); + } else if(lPoint != null) + range1.select(); + else if(rPoint != null) + range2.select(); + + } catch(e) { } + } else { + try { + text1 = this._doc.createTextNode(""); + text2 = this._doc.createTextNode(""); + + lPoint.parentNode.insertBefore(text1, lPoint); + rPoint.parentNode.insertBefore(text2, rPoint); + + var range = this._doc.createRange(); + range.setStart(text1, 0); + range.setEnd(text2, 0); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + } catch(e) { } + } + }, + + getSelectedHTML: function() { + var sel = this._getSelection(), + range = this._createRange(sel), + existing = null; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + existing = range.htmlText; + } else { + if(Sys.Extended.UI.HtmlEditor.isSafari && (sel.type == "Caret" || sel.type == "None")) { + existing = ""; + } else { + if(Sys.Extended.UI.HtmlEditor.isSafari) + if(range.cloneContents() == null) + return ""; + + existing = Sys.Extended.UI.HtmlEditor.getHTML(range.cloneContents(), false); + } + } + + return existing; + }, + + _queryCommandState: function(cmdID) { + var obj = this._rangeStartEnd(); + if(obj == null) + return false; + + try { + var cssStyle = { name: "none", value: "none" }; + + switch(cmdID.toLowerCase()) { + case "bold": + cssStyle = { name: "font-weight", value: "bold" }; + break; + case "italic": + cssStyle = { name: "font-style", value: "italic" }; + break; + case "underline": + cssStyle = { name: "text-decoration", value: "underline" }; + break; + case "strikethrough": + cssStyle = { name: "text-decoration", value: "line-through" }; + break; + case "superscript": + cssStyle = { name: "vertical-align", value: "super" }; + break; + case "subscript": + cssStyle = { name: "vertical-align", value: "sub" }; + break; + } + + var el1 = obj.start, + el2 = obj.end, + cs1 = Sys.Extended.UI.HtmlEditor.getStyle(el1, cssStyle.name).toString().toLowerCase(), + cs2 = Sys.Extended.UI.HtmlEditor.getStyle(el2, cssStyle.name).toString().toLowerCase(); + + if(cssStyle.name == "font-weight" && cs1 == "700") + cs1 = "bold"; + if(cssStyle.name == "font-weight" && cs2 == "700") + cs2 = "bold"; + + if(/MSIE (5|6)/.test(navigator.userAgent) && cmdID.toLowerCase() == "strikethrough" && (cs1 == "underline" || cs2 == "underline")) { + while(el1 && Sys.Extended.UI.HtmlEditor.isStyleTag(el1.tagName)) { + if(el1.style.textDecoration.indexOf("line-through") >= 0) { + cs1 = el1.style.textDecoration; + + break; + } + + el1 = el1.parentNode; + } + + while(el2 && Sys.Extended.UI.HtmlEditor.isStyleTag(el2.tagName)) { + if(el2.style.textDecoration.indexOf("line-through") >= 0) { + cs2 = el2.style.textDecoration; + + break; + } + + el2 = el2.parentNode; + } + } + + if(Sys.Extended.UI.HtmlEditor.isSafari && (cmdID.toLowerCase() == "strikethrough" || cmdID.toLowerCase() == "underline")) { + var cmdl = cmdID.toLowerCase(); + if(cmdl == "strikethrough") + cmdl = "line-through"; + + while(el1 && Sys.Extended.UI.HtmlEditor.isStyleTag(el1.tagName)) { + if(el1.style.textDecoration.indexOf(cmdl) >= 0) { + cs1 = el1.style.textDecoration; + + break; + } + + el1 = el1.parentNode; + } + + while(el2 && Sys.Extended.UI.HtmlEditor.isStyleTag(el2.tagName)) { + if(el2.style.textDecoration.indexOf(cmdl) >= 0) { + cs2 = el2.style.textDecoration; + + break; + } + + el2 = el2.parentNode; + } + } + + var ret = (cs1.indexOf(cssStyle.value) >= 0) && (cs2.indexOf(cssStyle.value) >= 0); + + if(this._StyleForTyping != null && this._StyleForTyping.length > 0) { + for(var i = 0; i < this._StyleForTyping.length; i++) { + var curCss = this._StyleForTyping[i]; + + if(curCss.name == cssStyle.name && curCss.value == cssStyle.value) { + ret = !ret; + + break; + } + } + } + + return ret; + } catch(ex) { + return false; + } + }, + + _textAlignState: function(value) { + var obj = this._rangeStartEnd(); + if(obj == null) + return false; + + try { + var cs1 = this._textAlignStateSingle(obj.start), + cs2 = this._textAlignStateSingle(obj.end); + + return (cs1 == value && cs2 == value); + } catch(ex) { + return false; + } + }, + + _textAlignStateSingle: function(el) { + while(el && Sys.Extended.UI.HtmlEditor.isStyleTag(el.tagName)) + el = el.parentNode; + + if(el != null) { + var tagName = el.tagName.toUpperCase(); + if(tagName == "P" || tagName == "DIV") + return el.style.textAlign.toLowerCase(); + } + + return null; + }, + + _rangeStartEnd: function() { + if(this.isControl()) + return null; + + try { + var sel = this._getSelection(), + range = this._createRange(sel), + el1 = null, + el2 = null; + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + function __getText__(par, first) { + var ret = null; + + while(ret == null) { + if(par.nodeType == 3) { + if(first && range.startContainer != range.endContainer && range.startOffset == par.length && par.nextSibling) + ret = __getText__(par.nextSibling, first); + else if(!first && range.startContainer != range.endContainer && range.endOffset == 0 && par.previousSibling) + ret = __getText__(par.previousSibling, first); + else + ret = par; + } else { + if((first ? par.firstChild : par.lastChild) == null) + ret = null; + else + ret = __getText__(first ? par.firstChild : par.lastChild, first); + } + + if(ret == null) { + par = first ? par.nextSibling : par.previousSibling; + if(par == null) + return null; + } else { + return ret; + } + } + } + + var parent = this._getParent(range); + + if(parent.nodeType != 3 && range.startContainer == range.endContainer && + range.startOffset == range.endOffset && + range.startContainer.childNodes.item(range.startOffset).tagName && + Sys.Extended.UI.HtmlEditor.isStyleTag(range.startContainer.childNodes.item(range.startOffset).tagName) + ) { + return { start: range.startContainer.childNodes.item(range.startOffset), end: range.startContainer.childNodes.item(range.startOffset) }; + } + + el1 = __getText__(range.startContainer, true); + if(el1 != null && el1.parentNode != null) + el1 = el1.parentNode; + if(el1 == null) + el1 = range.startContainer; + + el2 = __getText__(range.endContainer, false); + if(el2 != null && el2.parentNode != null) + el2 = el2.parentNode; + if(el2 == null) + el2 = range.endContainer; + } else { + if(range.text.length == 0) { + el1 = el2 = this._getParent(range); + } else { + var rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right_marker", + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left_marker"; + + // get bound ranges + var r_left = range.duplicate(), + r_right = range.duplicate(); + + r_left.setEndPoint("EndToStart", range); + r_right.setEndPoint("StartToEnd", range); + + // insert markers + r_right.pasteHTML(""); + r_left.pasteHTML(""); + + // get markers + var lPoint = this._doc.getElementById(ln), + rPoint = this._doc.getElementById(rn); + + el1 = lPoint.parentNode; + el2 = rPoint.parentNode; + + lPoint.parentNode.removeChild(lPoint); + rPoint.parentNode.removeChild(rPoint); + } + } + + return { start: el1, end: el2 }; + } catch(ex) { + return null; + } + }, + + rtlState: function() { + if(this._doc.body.style.direction && this._doc.body.style.direction == "rtl") + return true; + + return false; + }, + + openWait: function() { + this._editPanel.openWait(); + }, + + closeWait: function() { + this._editPanel.closeWait(); + } +} + +Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover = function() { + this.scriptsArray = []; + this.scriptsArray_index = -1; + + this.regReplScript1 = function(p0, p1) { + this.scriptsArray.push(p1); + + return ""; + } + + this.regReplFromScript = function(p0, p1, p2, p3) { + return p1.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&"); + } + + this.regReplFromScript1 = function(p0, p1, p2, p3) { + this.scriptsArray_index++; + var mmm; + + if(!Sys.Extended.UI.HtmlEditor.isIE) + mmm = this.scriptsArray[this.scriptsArray_index].replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\""); + else + mmm = this.scriptsArray[this.scriptsArray_index]; + + return p1 + mmm + p3; + } +} + +Sys.Extended.UI.HtmlEditor.DesignPanel.registerClass("Sys.Extended.UI.HtmlEditor.DesignPanel", Sys.Extended.UI.HtmlEditor.ModePanel); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js new file mode 100644 index 000000000..b727bfe68 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js @@ -0,0 +1,1199 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler = function(ev) { + try { + var editor = this; + + if(editor._editPanel != Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) + return true; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + try { + var selka = this._doc.selection, + rrr = this._createRange(selka); + } catch(e) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } + + if(ev.type == "mousedown" || ev.type == "dblclick") + this._focus(true); + + if(!Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keydown" && ev.keyCode == Sys.UI.Key.tab && this._editPanel.get_suppressTabInDesignMode()) { + Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel = null; + + return true; + } + + if(this.isPopup()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + // if there is opened Context menu + var contextMenuRemoved = false; + if(editor._contextElement && editor._contextElement != null) { + Function.createDelegate(this, Sys.Extended.UI.HtmlEditor.RemoveContextMenu)(); + + if(ev.type == "keydown" || ev.type == "keypress") { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return; + } + contextMenuRemoved = true; + } + + if(typeof editor.captureInDesign == "function") + if(editor.captureInDesign(ev) === false) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return; + } + + // try to emulate "Ctrl + mouse click" in IE + if(Sys.Extended.UI.HtmlEditor.isIE && ev.type == "mousedown" && ev.ctrlKey) { + var sel = editor._getSelection(), + savedX = ev.clientX, + savedY = ev.clientY; + + setTimeout(function() { + var sel = editor._getSelection(); + + if(sel.type.toLowerCase() != "control") { + var range = editor._doc.body.createTextRange(); + + range.moveToPoint(savedX, savedY); + range.select(); + } + + sel = editor._getSelection(); + var range = editor._createRange(sel), + parent = Sys.Extended.UI.HtmlEditor.getSelParent(editor); + + while(parent != null && parent.tagName.toUpperCase() != "BODY") { + if(parent.tagName.toUpperCase() == "A" && parent.href != null && typeof parent.href != "undefined" && parent.href.length > 0) { + window.open(parent.href, "LinkViewWindow"); + break; + } + parent = parent.parentNode; + } + }, 0); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + var el = (!Sys.Extended.UI.HtmlEditor.isIE) ? ev.target : ev.srcElement; + if(el.tagName != null && typeof el.tagName != "undefined" && (el.tagName.toUpperCase() == "HTML" || el.tagName.toUpperCase() == "BODY")) { + if(editor.__kkoka != true) { + editor.__kkoka = true; + + setTimeout(function() { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + if(!editor.toEndOfProtected()) + try { + editor.focusEditor(); + } catch(ex) { } + } + + editor.__kkoka = false; + }, 0); + } + } else { + if(Sys.Extended.UI.HtmlEditor.contentEditable(el) != null) { + setTimeout(function() { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) + editor.toEndOfProtected(); + }, 0); + } + } + + if(contextMenuRemoved && (Sys.Extended.UI.HtmlEditor.isIE)) { + var sss = this._getSelection(), + rrr; + + try { + rrr = this._createRange(sss); + + if(sss.type.toLowerCase() == "control") { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } catch(ex) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } + + var keyEvent = (Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keydown") || (ev.type == "keypress"), + rere = ev.type + "--" + keyEvent; + + if(keyEvent && !this._editPanel.get_keyboardEnabled()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + var key = String.fromCharCode(Sys.Extended.UI.HtmlEditor.isIE ? ev.keyCode : ev.charCode).toLowerCase();; + if(keyEvent && editor._editPanel.get_hotkeys() != null) { + if(editor._editPanel.get_hotkeys().length > 0) { + var keysn = editor._editPanel.get_hotkeys().length, + cake = key; + + if(ev.keyCode == 18 || ev.keyCode == 17 || ev.keyCode == 16) + cake = null; + + for(var i = 0; i < keysn; i++) { + var item = editor._editPanel.get_hotkeys()[i]; + + if(item[1] == cake && item[2] == ev.altKey && item[3] == ev.shiftKey && item[4] == ev.ctrlKey) { + if(typeof item[0] == "function") { + setTimeout(function() { + (item[0])(editor); + editor.onContentChanged(); + editor.focusEditor(); + }, 0); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } + } + } + + if(keyEvent && ev.shiftKey && ev.keyCode == 45) { + this._commonPaste(ev); + } else { + if(keyEvent && ev.ctrlKey && ev.altKey && ev.keyCode == Sys.UI.Key.home) { + var prot = null, + el = Sys.Extended.UI.HtmlEditor.getSelParent(editor); + + while(el && (el.nodeType == 3 || (el.tagName && el.tagName.toUpperCase() != "BODY"))) { + if(el.nodeType == 3 || !el.tagName) { + el = el.parentNode; + continue; + } + + var tagName = el.tagName.toUpperCase(); + if(!Sys.Extended.UI.HtmlEditor.canBeInsideP(el) && tagName != "P") { + if(tagName == "TD") { + while(tagName != "TABLE") { + el = el.parentNode; + tagName = el.tagName.toUpperCase(); + } + } else { + if(tagName == "LI") { + while(tagName != "OL" && tagName != "UL") { + el = el.parentNode; + tagName = el.tagName.toUpperCase(); + } + } + } + + prot = el; + break; + } + + el = el.parentNode; + } + + if(prot != null) { + var sel = editor._getSelection(), + range = editor._createRange(sel), + tempText = editor._doc.createTextNode(""); + + prot.parentNode.insertBefore(tempText, prot); + if(Sys.Extended.UI.HtmlEditor.isIE) { + var range1 = editor._createRange(sel), + range2 = editor._createRange(sel), + span1 = editor._doc.createElement("span"), + span2 = editor._doc.createElement("span"); + + tempText.parentNode.insertBefore(span1, tempText); + if(tempText.nextSibling) + tempText.parentNode.insertBefore(span2, tempText.nextSibling); + else + tempText.parentNode.appendChild(span2); + + try { + range1.moveToElementText(span1); + range2.moveToElementText(span2); + range1.setEndPoint("EndToEnd", range2); + range1.select(); + } catch(e) { } + + tempText.parentNode.removeChild(span1); + tempText.parentNode.removeChild(span2); + } else { + editor._removeAllRanges(sel); + range.setStart(tempText, 0); + range.setEnd(tempText, 0); + editor._selectRange(sel, range); + } + } + } else + if(Sys.Extended.UI.HtmlEditor.isIE && ev.keyCode >= 33 && ev.keyCode <= 40 && !ev.shiftKey) { + var after_pos = (ev.keyCode == Sys.UI.Key.pageDown || ev.keyCode == Sys.UI.Key.end || ev.keyCode == Sys.UI.Key.right || ev.keyCode == Sys.UI.Key.down); + + setTimeout(function() { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(sel.type.toLowerCase() == "control") { + var el = range.item(0); + + if(!el.contentEditable || el.contentEditable == "false") { + range.remove(0); + sel.empty(); + range = editor._createRange(sel); + var span = editor._doc.createElement("SPAN"); + span.appendChild(editor._doc.createTextNode("")); + + if(after_pos) { + if(el.nextSibling == null) + el.parentNode.appendChild(span); + else + el.parentNode.insertBefore(span, el.nextSibling); + } else { + el.parentNode.insertBefore(span, el); + } + + range.moveToElementText(span); + range.select(); + + setTimeout(function() { + editor.focusEditor(); + span.parentNode.removeChild(span); + }, 0); + } + } + }, 0); + } else + if(((keyEvent && !Sys.Extended.UI.HtmlEditor.isSafari) || (Sys.Extended.UI.HtmlEditor.isSafari && ev.type == "keydown")) && ev.ctrlKey && !ev.altKey) { + editor._a_prize = false; + + var sel = null, + range = null, + key = String.fromCharCode((Sys.Extended.UI.HtmlEditor.isIE || Sys.Extended.UI.HtmlEditor.isOpera || Sys.Extended.UI.HtmlEditor.isSafari) ? ev.keyCode : ev.charCode).toLowerCase(), + cmd = null, + value = null; + + if((Sys.Extended.UI.HtmlEditor.isIE || Sys.Extended.UI.HtmlEditor.isSafari) && ev.keyCode == 17) { // Ctrl + return false; + } else + if(!Sys.Extended.UI.HtmlEditor.isIE && ev.keyCode == Sys.UI.Key.end && !ev.shiftKey) { + editor._setToEnd(); + } else + if(ev.keyCode == 46 && this.isShadowed()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } else + if(ev.keyCode == 46 || ev.keyCode == Sys.UI.Key.backspace) { + if((Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keydown") || (!Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keypress")) + this._saveContent(); + } else { + switch(key) { + case "a": + if(!Sys.Extended.UI.HtmlEditor.isIE) { + // KEY select all + sel = this._getSelection(); + this._removeAllRanges(sel); + range = this._createRange(); + range.selectNodeContents(this._doc.body); + this._selectRange(sel, range); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } else { + editor._a_prize = true; + } + + break; + case "z": + this.undo(); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + case "p": + if(!Sys.Extended.UI.HtmlEditor.isIE) { + setTimeout(function() { + editor._contextMenuCallP(); + }, 0); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + + break; + case "y": + this.redo(); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + break; + case "x": + if(this.isShadowed()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + this._saveContent(); + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(ev.type == "keydown") { + editor.openWait(); + + setTimeout(function() { + editor._copyCut(key, false); + editor.closeWait(); + }, 0); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + } + break; + case "c": + if(this.isShadowed()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(ev.type == "keydown") { + editor.openWait(); + + setTimeout(function() { + editor._copyCut(key, false); + editor.closeWait(); + setTimeout(function() { + editor._ifShadow(); + }, 0); + }, 0); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + } + break; + case "v": + if(this.isShadowed()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + + // This was added on 5 Feb 2009 : "Let's paste it as it is" in IE + // Not a good idea, but in this case some Word's markup will not be lost + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._saveContent(); + + return true; + } + + this._commonPaste(ev); + break; + // simple key commands follow + case "b": // KEY bold + this._execCommand("bold", false, value); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + case "i": // KEY italic + this._execCommand("italic", false, value); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + case "u": // KEY underline + this._execCommand("underline", false, value); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + case "s": // KEY strike through + this._execCommand("strikethrough", false, value); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + case "l": // KEY justify left + cmd = "justifyleft"; + break; + case "e": // KEY justify center + cmd = "justifycenter"; + break; + case "r": // KEY justify right + cmd = "justifyright"; + break; + case "j": // KEY justify full + cmd = "justifyfull"; + break; + case "q": // test KEY + alert(this._doc.body.innerHTML); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + break; + case "0": // test KEY + var str1 = "Your browser:\n\n" + navigator.userAgent; + alert(str1); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + break; + case "9": + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = editor._getSelection(), + range = editor._createRange(sel), + p1 = range.startContainer, + p2 = range.endContainer, + Str = ""; + + Str += "startContainer: " + (p1.nodeType == 1 ? p1.tagName : "text") + "\n"; + Str += "endContainer : " + (p2.nodeType == 1 ? p2.tagName : "text") + "\n"; + + if(p1 == p2) { + Str += "startOffset: " + range.startOffset + "\n"; + Str += "endOffset : " + range.endOffset + "\n"; + + if(p1.nodeType == 1) { + p1 = p1.childNodes.item(range.startOffset); + + if(p1 && p1.nodeType) { + Str += "startOffset node: " + (p1.nodeType == 1 ? p1.tagName : "text") + "\n"; + + if(range.startOffset != range.endOffset) { + p1 = p2.childNodes.item(range.endOffset); + + if(p1 && p1.nodeType) + Str += "endOffset node: " + (p1.nodeType == 1 ? p1.tagName : "text") + "\n"; + } + } else { + Str += p1; + } + } + } + alert(Str); + } else { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + alert("boundingLeft: " + range.boundingLeft + " boundingTop: " + range.boundingTop + "\n" + "boundingWidth: " + range.boundingWidth + " boundingHeight: " + range.boundingHeight); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + break; + } + } + if(cmd) { + // execute simple command + this._execCommand(cmd, false, value); + if(cmd == "formatblock" && !Sys.Extended.UI.HtmlEditor.isIE) { + this._saveContent(); + this._undo(false); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + if(cmd == "delete" || cmd == "paste") + this._clearP(); + } + } else + if(keyEvent || ((Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) && ev.type == "keydown")) { + // other keys here + if(Sys.Extended.UI.HtmlEditor.isIE && this._tryForward) { + var range = this._createRange(this._getSelection()); + range.select(); + this._tryForward = false; + } + + var key = String.fromCharCode(Sys.Extended.UI.HtmlEditor.isIE ? ev.keyCode : ev.charCode).toLowerCase(); + if(editor._a_prize) { + editor._a_prize = false; + + function test_a() { + var r = editor._createRange(editor._getSelection()), + parent = r.parentElement(); + + if(parent && parent.nodeType == 1 && parent.tagName.toUpperCase() == "P") { + while(parent.firstChild) + parent.parentNode.insertBefore(parent.firstChild, parent); + + parent.parentNode.removeChild(parent); + } + } + // wait for the IE stops operating this event + setTimeout(test_a, 0); + } + + if(this.isShadowed()) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + + switch(ev.keyCode) { + case Sys.UI.Key.tab: + if((Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) && ev.type != "keydown") + break; + + if(!this._editPanel.get_suppressTabInDesignMode()) { + if(!this.isControl()) + this.insertHTML("        "); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + } else { + if(Sys.Extended.UI.HtmlEditor.isSafari) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + } + + Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel = null; + return true; + } + break; + case 46: case Sys.UI.Key.backspace: + if((Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) && ev.type != "keydown") + break; + + if(((Sys.Extended.UI.HtmlEditor.isIE || Sys.Extended.UI.HtmlEditor.isSafari) && ev.type == "keydown") || (!Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keypress")) + this._saveContent(); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var range = this._createRange(this._getSelection()), + p1 = range.startContainer, + p2 = range.endContainer; + + if(ev.type == "keypress") + if(Sys.Extended.UI.HtmlEditor.contentEditable(p1) != null || Sys.Extended.UI.HtmlEditor.contentEditable(p2) != null) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + + // inside TD + if(p1 == p2 && p1.nodeType == 1 && p1.tagName.toUpperCase() == "TD" && range.startOffset == range.startOffset && p1.childNodes.item(range.startOffset) && p1.childNodes.item(range.startOffset).tagName && p1.childNodes.item(range.startOffset).tagName.toUpperCase() == "BR") { + var span = p1.childNodes.item(range.startOffset), + left = 0, right = 0, + nb; + + nb = span.previousSibling; + while(nb) { + left++; + nb = nb.previousSibling; + } + + nb = span.nextSibling; + while(nb) { + right++; + nb = nb.nextSibling; + } + + if((ev.keyCode == 46 && right == 0) || (ev.keyCode == Sys.UI.Key.backspace && left == 0)) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } else { + if(ev.keyCode == 46 && p1.firstChild == p1.lastChild && p1.firstChild.nodeType == 1) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + } + } + + // inside TEXTNODE + if(p1 == p2 && p1.nodeType == 3 && range.startOffset == range.endOffset && !Sys.Extended.UI.HtmlEditor.isOpera) { + var data = p1.data + ""; + + if(ev.keyCode == 46) { + if(range.startOffset == data.length && !(p1.nextSibling && p1.nextSibling.nodeType == 3)) { + if(p1.nextSibling) { + p1.parentNode.removeChild(p1.nextSibling); + editor.onContentChanged(); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + } + + if(ev.keyCode == Sys.UI.Key.backspace) + if(range.startOffset == 0 && !(p1.previousSibling && p1.previousSibling.nodeType == 3)) { + if(p1.previousSibling) { + p1.parentNode.removeChild(p1.previousSibling); + editor.onContentChanged(); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } + } + + if(ev.keyCode == Sys.UI.Key.backspace && p1.nodeType == 1 && p1 == p2 && range.startOffset == range.endOffset) { + var mel = p1.childNodes.item(range.startOffset); + + if(mel != null && mel.nodeType == 1 && mel.tagName.toUpperCase() == "BR") { + mel = mel.previousSibling; + + if(mel != null && mel.nodeType != 3) { + mel.parentNode.removeChild(mel); + editor.onContentChanged(); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } + } + + setTimeout(function() { + var sel = editor._getSelection(), + range = editor._createRange(sel), + p1 = range.startContainer, + p2 = range.endContainer; + + if(Sys.Extended.UI.HtmlEditor.contentEditable(p1) != null || Sys.Extended.UI.HtmlEditor.contentEditable(p2) != null) { + editor._undo(false); + return; + } + + if(Sys.Extended.UI.HtmlEditor.isOpera && p1 == p2 && p1.nodeType == 3 && (p1.data).length == 0) { + p1.parentNode.removeChild(p1); + } else + if(p1 == p2 && p1.nodeType == 1 && Sys.Extended.UI.HtmlEditor.isStyleTag(p1.tagName) && range.startOffset == range.endOffset && p1.childNodes.length == 0) { + while(p1.parentNode.nodeType == 1 && Sys.Extended.UI.HtmlEditor.isStyleTag(p1.parentNode.tagName) && p1.parentNode.childNodes.length == 1) + p1 = p1.parentNode; + + var next = p1.nextSibling, + prev = p1.previousSibling, + parent = p1.parentNode; + + parent.removeChild(p1); + editor.onContentChanged(); + + if(next == null && prev == null) { + range.setStart(parent, 0); + range.setEnd(parent, 0); + } else + if(next != null && prev != null) { + if(next.nodeType == 3 && prev.nodeType == 3) { + var l = ("" + prev.data + "").length; + + prev.appendData(next.data); + parent.removeChild(next); + range.setStart(prev, l); + range.setEnd(prev, l); + } else { + if(prev.nodeType == 3) { + var l = ("" + prev.data + "").length; + range.setStart(prev, l); + range.setEnd(prev, l); + } else { + if(next.nodeType == 3) { + range.setStart(next, 0); + range.setEnd(next, 0); + } else { + if(next.childNodes.length > 0) { + range.setStart(next, 0); + range.setEnd(next, 0); + } else { + var l = Sys.Extended.UI.HtmlEditor.__getIndex(next); + range.setStart(parent, l); + range.setEnd(parent, l); + } + } + } + } + } else { + if(prev != null) { + if(prev.nodeType == 3) { + var l = ("" + prev.data + "").length; + + range.setStart(prev, l); + range.setEnd(prev, l); + } else { + var l = prev.childNodes.length; + + if(l > 0) { + range.setStart(prev, l); + range.setEnd(prev, l); + } else { + l = Sys.Extended.UI.HtmlEditor.__getIndex(prev); + range.setStart(parent, l); + range.setEnd(parent, l); + } + } + } else { + if(next != null) { + if(next.nodeType == 3) { + range.setStart(next, 0); + range.setEnd(next, 0); + } else { + var l = next.childNodes.length; + + if(l > 0) { + range.setStart(next, l); + range.setEnd(next, l); + } else { + l = Sys.Extended.UI.HtmlEditor.__getIndex(next); + range.setStart(parent, l); + range.setEnd(parent, l); + } + } + } + } + } + + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + } + }, 0); + } else { // IE + var sel = editor._getSelection(); + + if(sel.type.toLowerCase() == "control") { + if(ev.keyCode == 8) { + setTimeout(function() { + editor._ifShadow(); + editor.onContentChanged(); + }, 0); + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return; + } + + var r = editor._createRange(sel), + eln = r.item(0); + + if(eln.tagName.toUpperCase() == "EMBED") { + eln.src = ""; + eln.parentNode.removeChild(eln); + + while(r.length > 0) + r.remove(0); + + try { + r.collapse(false); + } catch(e) { } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + editor._saveContent(); + + setTimeout(function() { + editor._undo(false); + editor.onContentChanged(); + }, 0); + + return; + } + } + + var tempCollectionLength = editor._doc.body.getElementsByTagName("EMBED").length; + if(tempCollectionLength > 0) { + var popup = editor._body.ownerDocument.createElement("div"); + editor._body.appendChild(popup); + var evKeyCode = ev.keyCode; + + setTimeout(function() { + editor._body.removeChild(popup); + var tempCollectionNew = editor._doc.body.getElementsByTagName("EMBED"); + + if(tempCollectionLength != tempCollectionNew.length) { + editor._saveContent(); + + setTimeout(function() { + editor._undo(false); + editor.onContentChanged(); + }, 0); + } + }, 0); + } + + setTimeout(function() { + editor._clearP(); + }, 0); + } + break; + case Sys.UI.Key.enter: + if((Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) && ev.type == "keydown") + break; + + if((!Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keypress") || (Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keydown")) + this._saveContent(); + + if(Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keydown") { + var sel = editor._getSelection(); + + if(sel.type.toLowerCase() == "control") + break; + + var r = editor._createRange(sel); + if(!ev.shiftKey) { + var prnt = r.parentElement(); + + if(prnt.tagName.toUpperCase() == "TEXTAREA") + break; + + while(prnt && prnt.tagName && prnt.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(prnt.tagName)) + prnt = prnt.parentNode; + + if(prnt && prnt.tagName) { + var tagName = prnt.tagName.toUpperCase(); + + if(tagName == "P" || tagName == "LI") { + if(tagName == "LI") { + function test() { + r = editor._createRange(editor._getSelection()); + var parent = r.parentElement(); + + while(parent && parent.tagName && parent.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName)) + parent = parent.parentNode; + + if(parent && parent.nodeType == 1 && parent.tagName.toUpperCase() == "P") { + var span1 = editor._doc.createElement("span"), + tempText = editor._doc.createTextNode(" "), + inner = parent; + + while(inner.firstChild != null && inner.firstChild.nodeType == 1) + inner = inner.firstChild; + + if(inner.nodeType == 1) { + inner.appendChild(tempText); + inner.appendChild(span1); + + while(parent.firstChild) + parent.parentNode.insertBefore(parent.firstChild, parent); + } else { + parent.parentNode.insertBefore(tempText, parent); + parent.parentNode.insertBefore(span1, parent); + } + + parent.parentNode.removeChild(parent); + r.moveToElementText(span1); + r.select(); + span1.parentNode.removeChild(span1); + editor.onContentChanged(); + } + } + setTimeout(test, 0); + } + break; + } + } + + try { + var mn = Sys.Extended.UI.HtmlEditor.smartClassName + "_middle_add", + mn_element = null, + mn_span_text = ""; + + function testNextBlockElement() { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(mn_element != null) { + mn_element.innerHTML = " "; + range.moveToElementText(mn_element); + range.select(); + mn_element.parentNode.insertBefore(mn_element.firstChild, mn_element); + mn_element.parentNode.removeChild(mn_element); + editor.onContentChanged(); + } + } + + r.pasteHTML(mn_span_text); + var needTest = false; + mn_element = editor._doc.getElementById(mn); + + if(mn_element != null) { + var nextSibling = mn_element.nextSibling, + curPar = mn_element.parentNode; + + while(nextSibling == null && curPar != null && Sys.Extended.UI.HtmlEditor.isStyleTag(curPar.tagName)) { + nextSibling = curPar.nextSibling; + curPar = curPar.parentNode; + } + + if(nextSibling != null && !Sys.Extended.UI.HtmlEditor.isInlineElement(nextSibling) && nextSibling.tagName != null && typeof nextSibling.tagName != "undefined") { + var tag = nextSibling.tagName.toUpperCase(); + + if(tag != "BR" && tag != "UL" && tag != "OL" && tag != "P") + needTest = true; + } + + mn_element.parentNode.removeChild(mn_element); + } + r.pasteHTML("
    " + (needTest ? mn_span_text : "")); + + if(needTest) + mn_element = editor._doc.getElementById(mn); + + r.select(); + if(needTest) { + setTimeout(testNextBlockElement, 0); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + return false; + } + } catch(ex) { } + } else { + break; + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + } else { + if(!ev.shiftKey && (Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera)) { + var prnt = Sys.Extended.UI.HtmlEditor.getSelParent(this); + + if(prnt.nodeType == 3) + prnt = prnt.parentNode; + + while(prnt && prnt.tagName && prnt.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(prnt.tagName)) + prnt = prnt.parentNode; + + if(prnt && prnt.tagName && (prnt.tagName.toUpperCase() == "P" || prnt.tagName.toUpperCase() == "LI")) + break; + + var mn_span_text = "
    "; + if(Sys.Extended.UI.HtmlEditor.isOpera) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(range.startContainer == range.endContainer) + if(range.startContainer.nodeType == 1) { + var firstCh = range.startContainer.childNodes.item(range.startOffset); + + if(firstCh.nodeType == 1 && firstCh.tagName.toUpperCase() == "BR") + mn_span_text += "
    "; + } else if(range.startContainer.nodeType == 3 && range.startOffset == range.endOffset && (range.startContainer.data).length == range.endOffset && !(range.startContainer.nextSibling && range.startContainer.nextSibling.nodeType == 3)) { + mn_span_text += " "; + } + } + + this.insertHTML(mn_span_text); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + + if(Sys.Extended.UI.HtmlEditor.isOpera) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(range.startContainer == range.endContainer && range.startContainer.nodeType == 3 && range.startOffset == range.endOffset && (range.startContainer.data).length == 0) { + var nbsp = range.startContainer.previousSibling; + + range.startContainer.parentNode.removeChild(range.startContainer); + editor._removeAllRanges(sel); + range = editor._createRange(); + range.setStart(nbsp, 0); + range.setEnd(nbsp, 1); + editor._selectRange(sel, range); + } + } + + editor.onContentChanged(); + } else if(Sys.Extended.UI.HtmlEditor.isSafari) { + this.insertHTML("
    "); + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + editor.onContentChanged(); + } + } + break; + } + } else { + editor._a_prize = false; + } + } + + // Struggle with bad behavior of IE when text is typing inside SPAN and when some text is selected + if(Sys.Extended.UI.HtmlEditor.isIE && ev.type == "keypress" && !ev.ctrlKey) { + var key = ev.keyCode, + selT = editor._getSelection(), + rangeT = editor._createRange(selT); + + if(rangeT.text.length > 0) { + var chr = String.fromCharCode(key), + caps = Sys.Extended.UI.HtmlEditor.capLock(ev), + upper = (ev.shiftKey && !caps) || caps; + + if(!upper) + chr = chr.toLowerCase(); + + var tid = Sys.Extended.UI.HtmlEditor.smartClassName + "StyleForTyping", + elT = editor._doc.getElementById(tid); + + if(elT != null) { + chr = "" + chr + ""; + elT.parentNode.removeChild(elT); + } + + rangeT.pasteHTML(chr); + if(elT != null) { + editor.trickWithStyles(tid); + elT = editor._doc.getElementById(tid + tid); + elT.parentNode.removeChild(elT); + } + + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + editor.onContentChanged(); + + return false; + } + } + + if(ev.type == "mouseup" || ev.type == "mousedown" || ev.type == "keydown") { + var need_update = true; + + if(ev.type == "keydown" && !ev.ctrlKey) { + var key = ev.keyCode; + + if((key >= 0x30 && key <= 0x5a) || (key == 0x20) || (key == 0x0d) || (key >= 0xba && key <= 0xde) || (key >= 0x60 && key <= 0x6f)) { + if(editor._StyleForTyping != null) { + editor.n_arr = []; + + for(var im = 0; im < editor._StyleForTyping.length; im++) + editor.n_arr.push(editor._StyleForTyping[im]); + + var tid = Sys.Extended.UI.HtmlEditor.smartClassName + "StyleForTyping", + needItNow = true; + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + editor.insertHTML(""); + } else { + editor.insertHTML(" "); + var elT = editor._doc.getElementById(tid); + + if(elT && elT.nextSibling && elT.nextSibling.nodeType == 3) { + needItNow = false; + + var selT = editor._getSelection(), + rangeT = editor._createRange(selT); + + rangeT.moveToElementText(editor._doc.getElementById(tid)); + rangeT.select(); + } else { + if(elT) + elT.removeChild(elT.firstChild); + } + } + + if(needItNow) { + setTimeout(function() { + editor.trickWithStyles(tid); + editor.onContentChanged(); + }, 0); + } + } + } + } + + if(need_update || !Sys.Extended.UI.HtmlEditor.isIE) { + if(!editor._updated_now) { + if(editor._updateTimer) { + clearTimeout(editor._updateTimer); + editor._updateTimer = null; + } + editor._updateTimerLimit = 3; + + function xyz() { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + try { + if(Sys.Extended.UI.HtmlEditor.isIE) { + try { + var selka = editor._doc.selection; + } catch(e) { + return false; + } + + if(editor._getSelection().type == "None" && editor._doc.queryCommandValue("backcolor") == 0 && editor._doc.queryCommandValue("forecolor") == 0) { + editor._updateTimerLimit--; + + if(editor._updateTimerLimit > 0) { + editor._updateTimer = setTimeout(xyz, 100); // delay for toolbars updating + return; + } + } + } + + editor._updated_now = true; + editor._editPanel.updateToolbar(); + editor._updated_now = false; + editor._updateTimer = null; + + if(!Sys.Extended.UI.HtmlEditor.isIE) + editor.focusEditor(); + } catch(e) { } + } + } + + editor._updateTimer = setTimeout(xyz, 300); // delay for toolbars updating + } + } + } + + if(!((!Sys.Extended.UI.HtmlEditor.isIE && (ev.type == "keydown" || ev.type == "keyup")) || (Sys.Extended.UI.HtmlEditor.isIE && (ev.type == "keydown" || ev.type == "keyup") && (ev.keyCode == 16 || ev.keyCode == 20)))) + editor._StyleForTyping = null; + + if(Sys.Extended.UI.HtmlEditor.isSafari) + setTimeout(function() { + editor._createRange(editor._getSelection()); + }, 0); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + setTimeout(function() { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(range.startContainer.nodeType != 3 && range.startContainer == range.endContainer) + if(range.startOffset == range.endOffset) + if(range.startContainer.childNodes.item(range.startOffset)) + if(range.startContainer.childNodes.item(range.startOffset).nodeType == 3) { + var container = range.startContainer.childNodes.item(range.startOffset); + + sel.collapseToEnd(); + editor._removeAllRanges(sel); + sel = editor._getSelection(); + range = editor._createRange(sel); + range.setStart(container, 0); + range.setEnd(container, 0); + editor._selectRange(sel, range); + } + } + }, 0); + } + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + editor._saved_startContainer = range.startContainer; + editor._saved_startOffset = range.startOffset; + } + + setTimeout(function() { + try { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) + editor._ifShadow(); + } catch(e) { } + }, 0); + + if(ev.type == "keydown") { + if(editor._AfterOnContentChanged == null || typeof editor._AfterOnContentChanged == "undefined" || !editor._AfterOnContentChanged) { + editor._AfterOnContentChanged = true; + + setTimeout(function() { + if(editor._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + editor.onContentChanged(); + editor._AfterOnContentChanged = false; + } + }, 0); + } + } + + return true; + } catch(ex) { + Sys.Extended.UI.HtmlEditor._stopEvent(ev); + return false; + } +}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.EditPanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.EditPanel.debug.js new file mode 100644 index 000000000..e9610a707 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.EditPanel.debug.js @@ -0,0 +1,739 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); +Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel = null; + +Sys.Extended.UI.HtmlEditor.EditPanel = function(element) { + Sys.Extended.UI.HtmlEditor.EditPanel.initializeBase(this, [element]); + + this._loaded = false; + this._eAfter = null; + this._toolbars = null; + this._modePanels = null; + this._contentChangedElement = null; + this._contentElement = null; + this._contentForceElement = null; + this._activeModeElement = null; + this._suppressTabInDesignMode = false; + this._keyboardEnabled = true; + this._noPaste = false; + this._hotkeys = null; + this._showAnchors = false; + this._showPlaceHolders = false; + this._startEnd = true; + this._relativeImages = true; + + this._documentCssPath = null; + this._designPanelCssPath = null; + this._imagePath_1x1 = null; + this._imagePath_flash = null; + this._imagePath_media = null; + this._imagePath_anchor = null; + this._imagePath_placeHolder = null; + this._autofocus = true; + this._initialCleanUp = false; + this._noScript = false; + this._noUnicode = false; + this._cachedToolbarIds = null; + this._contentPrepared = false; + this._activeMode = null; + this._pageRequestManager = null; + this._formOnSubmitSaved = null; + this._validators = null; + + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); + this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit); + this._disposed = true; +} + +Sys.Extended.UI.HtmlEditor.EditPanel.prototype = { + + get_relativeImages: function() { + return this._relativeImages; + }, + + set_relativeImages: function(value) { + this._relativeImages = value; + + if(this._loaded) + this.raisePropertyChanged("relativeImages"); + }, + + get_startEnd: function() { + return this._startEnd; + }, + + set_startEnd: function(value) { + this._startEnd = value; + + if(this._loaded) + this.raisePropertyChanged("startEnd"); + }, + + get_showPlaceHolders: function() { + return this._showPlaceHolders; + }, + + set_showPlaceHolders: function(value) { + this._showPlaceHolders = value; + + if(this._loaded) + this.raisePropertyChanged("showPlaceHolders"); + }, + + get_showAnchors: function() { + return this._showAnchors; + }, + + set_showAnchors: function(value) { + this._showAnchors = value; + + if(this._loaded) + this.raisePropertyChanged("showAnchors"); + }, + + get_hotkeys: function() { + return this._hotkeys; + }, + + set_hotkeys: function(value) { + this._hotkeys = value; + + if(this._loaded) + this.raisePropertyChanged("noPaste"); + }, + + get_noPaste: function() { + return this._noPaste; + }, + + set_noPaste: function(value) { + this._noPaste = value; + + if(this._loaded) + this.raisePropertyChanged("noPaste"); + }, + + get_suppressTabInDesignMode: function() { + return this._suppressTabInDesignMode; + }, + + set_suppressTabInDesignMode: function(value) { + this._suppressTabInDesignMode = value; + + if(this._loaded) + this.raisePropertyChanged("suppressTabInDesignMode"); + }, + + get_keyboardEnabled: function() { + return this._keyboardEnabled; + }, + + set_keyboardEnabled: function(value) { + this._keyboardEnabled = value; + + if(this._loaded) + this.raisePropertyChanged("keyboardEnabled"); + }, + + get_noUnicode: function() { + return this._noUnicode; + }, + + set_noUnicode: function(value) { + this._noUnicode = value; + + if(this._loaded) + this.raisePropertyChanged("noUnicode"); + }, + + get_noScript: function() { + return this._noScript; + }, + + set_noScript: function(value) { + this._noScript = value; + + if(this._loaded) + this.raisePropertyChanged("noScript"); + }, + + get_initialCleanUp: function() { + return this._initialCleanUp; + }, + + set_initialCleanUp: function(value) { + this._initialCleanUp = value; + + if(this._loaded) + this.raisePropertyChanged("initialCleanUp"); + }, + + get_imagePath_1x1: function() { + return this._imagePath_1x1; + }, + + set_imagePath_1x1: function(value) { + this._imagePath_1x1 = value; + }, + + get_imagePath_flash: function() { + return this._imagePath_flash; + }, + + set_imagePath_flash: function(value) { + this._imagePath_flash = value; + }, + + get_imagePath_media: function() { + return this._imagePath_media; + }, + + set_imagePath_media: function(value) { + this._imagePath_media = value; + }, + + get_imagePath_anchor: function() { + return this._imagePath_anchor; + }, + + set_imagePath_anchor: function(value) { + this._imagePath_anchor = value; + }, + + get_imagePath_placeHolder: function() { + return this._imagePath_placeHolder; + }, + + set_imagePath_placeHolder: function(value) { + this._imagePath_placeHolder = value; + }, + + get_documentCssPath: function() { + return this._documentCssPath; + }, + + set_documentCssPath: function(value) { + this._documentCssPath = value; + + if(this._loaded) + this.raisePropertyChanged("documentCssPath"); + }, + + get_designPanelCssPath: function() { + return this._designPanelCssPath; + }, + + set_designPanelCssPath: function(value) { + this._designPanelCssPath = value; + + if(this._loaded) + this.raisePropertyChanged("designPanelCssPath"); + }, + + get_autofocus: function() { + return this._autofocus; + }, + + set_autofocus: function(value) { + this._autofocus = value; + + if(this._loaded) + this.raisePropertyChanged("autofocus"); + }, + + get_content: function() { + if(this._activeMode == null) { + if(this.get_contentElement() != null) + return this._getContentForPostback(); + + return ""; + } + + return this.getContent(); + }, + + set_content: function(value) { + if(!this.get_isInitialized() || !this._loaded) { + if(this.get_contentElement() != null) + this.get_contentElement().value = value.replace(/\"/g, """); + + return; + } + + this.setContent(value); + this._contentPrepared = false; + + if(this._loaded) + this.raisePropertyChanged("content"); + }, + + get_activeMode: function() { + if(this._activeMode == null) + return Sys.Extended.UI.HtmlEditor.ActiveModeType.Design; + + return this._activeMode; + }, + + set_activeMode: function(value) { + if(!Sys.Extended.UI.HtmlEditor.ActiveModeType_checkValue(value)) + throw Error.argumentOutOfRange("value, function: Sys.Extended.UI.HtmlEditor.EditPanel.set_activeMode"); + + var oldMode = this._activeMode, + retval = true; + + if(this._loaded && oldMode != null && oldMode != value) { + var eBefore = new Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs(oldMode, value, this); + this.raiseBeforeActiveModeChanged(eBefore); + + this._eAfter = new Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs(oldMode, value, this); + retval = this._setMode(value); + } else { + this._activeMode = value; + } + + this.get_activeModeElement().value = value; + + return retval; + }, + + get_contentChangedElement: function() { + return this._contentChangedElement; + }, + + set_contentChangedElement: function(value) { + this._contentChangedElement = value; + }, + + get_contentElement: function() { + return this._contentElement; + }, + + set_contentElement: function(value) { + this._contentElement = value; + }, + + get_contentForceElement: function() { + return this._contentForceElement; + }, + + set_contentForceElement: function(value) { + this._contentForceElement = value; + }, + + get_activeModeElement: function() { + return this._activeModeElement; + }, + + set_activeModeElement: function(value) { + this._activeModeElement = value; + }, + + setCancelOnPostback: function() { + if(this._loaded) + this.get_contentForceElement().value = ""; + }, + + setAcceptOnPostback: function() { + if(this._loaded) + this.get_contentForceElement().value = "1"; + }, + + get_toolbars: function() { + if(this._toolbars == null) + this._toolbars = []; + + return this._toolbars; + }, + + set_toolbars: function(value) { + this.get_toolbars().push(value); + }, + + get_toolbarIds: function() { + }, + + set_toolbarIds: function(value) { + if(!this.get_isInitialized()) { + this._cachedToolbarIds = value; + + return; + } + + var arr = value.split(";"); + for(var i = 0; i < arr.length; i++) + if(arr[i].length > 0) + this.set_toolbars($find(arr[i])); + }, + + get_modePanels: function() { + if(this._modePanels == null) + this._modePanels = []; + + return this._modePanels; + }, + + set_modePanel: function(value) { + this.get_modePanels().push(value); + }, + + get_modePanelIds: function() { + }, + + set_modePanelIds: function(value) { + var arr = value.split(";"); + + for(var i = 0; i < arr.length; i++) + this.set_modePanel($find(arr[i])); + }, + + add_focused: function(handler) { + this.get_events().addHandler("focused", handler); + }, + + remove_focused: function(handler) { + this.get_events().removeHandler("focused", handler); + }, + + raiseFocused: function(e) { + var eh = this.get_events().getHandler("focused"); + + if(eh) + eh(this, e); + }, + + add_activeModeChanged: function(handler) { + this.get_events().addHandler("activeModeChanged", handler); + }, + + remove_activeModeChanged: function(handler) { + this.get_events().removeHandler("activeModeChanged", handler); + }, + + raiseActiveModeChanged: function(e) { + var eh = this.get_events().getHandler("activeModeChanged"); + + if(eh) + eh(this, e); + }, + + add_beforeActiveModeChanged: function(handler) { + this.get_events().addHandler("beforeActiveModeChanged", handler); + }, + + remove_beforeActiveModeChanged: function(handler) { + this.get_events().removeHandler("beforeActiveModeChanged", handler); + }, + + raiseBeforeActiveModeChanged: function(e) { + var eh = this.get_events().getHandler("beforeActiveModeChanged"); + + if(eh) + eh(this, e); + }, + + get_activePanel: function() { + var modePanel = this.get_modePanels()[this.get_activeMode()]; + + if(modePanel == null || typeof modePanel == "undefined") + throw Error.argumentOutOfRange("activeMode, function: Sys.Extended.UI.HtmlEditor.EditPanel.get_activePanel"); + + return modePanel; + }, + + initialize: function() { + this.__appLoaded__ = false; + Sys.Extended.UI.HtmlEditor.EditPanel.callBaseMethod(this, "initialize"); + this._disposed = false; + Sys.Application.add_load(this._app_onload$delegate); + + if(Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) { + this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); + + if(this._pageRequestManager) { + this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest); + this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler); + + this._invokingRequestHandler = Function.createDelegate(this, this._invokingRequest); + Sys.Net.WebRequestManager.add_invokingRequest(this._invokingRequestHandler); + + this._completedRequestHandler = Function.createDelegate(this, this._completedRequest); + Sys.Net.WebRequestManager.add_completedRequest(this._completedRequestHandler); + } + } + + Sys.Extended.UI.HtmlEditor.addFormOnSubmit(this._onsubmit$delegate, this); + }, + + dispose: function() { + this._loaded = false; + this._disposed = true; + + if(this._pageRequestManager) { + if(this._invokingRequestHandler) { + this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler); + this._partialUpdateEndRequestHandler = null; + + Sys.Net.WebRequestManager.remove_invokingRequest(this._invokingRequestHandler); + this._invokingRequestHandler = null; + + Sys.Net.WebRequestManager.remove_completedRequest(this._completedRequestHandler); + this._completedRequestHandler = null; + } + + this._pageRequestManager = null; + } + + Sys.Extended.UI.HtmlEditor.removeFormOnSubmit(this._onsubmit$delegate); + + Sys.Application.remove_load(this._app_onload$delegate); + this.disableToolbars(); + Sys.Extended.UI.HtmlEditor.EditPanel.callBaseMethod(this, "dispose"); + }, + + _onsubmit: function(e) { + if(!this._contentPrepared) { + this._prepareContentForPostback(this.get_content()); + this._contentPrepared = true; + } + + return true; + }, + + _invokingRequest: function(sender, args) { + if(this._contentPrepared) + return; + + var webRequest = args.get_webRequest(), + body = webRequest.get_body(); + + // change body here... + var reg = new RegExp("([\\?&])(" + this.get_contentElement().name + "=)([^&$]*)([&$])", "g"); + this._prepareContentForPostback(this.get_content()); + body = body.replace(reg, "$1$2" + escape(this.get_contentElement().value) + "$4"); + + this._contentPrepared = true; + webRequest.set_body(body); + }, + + _completedRequest: function(sender, args) { + this._contentPrepared = false; + }, + + _partialUpdateEndRequest: function(sender, args) { + this._contentPrepared = false; + + if(Sys.Extended.UI.HtmlEditor.isIE && this.__blured) { + this.__blured = false; + this.get_activePanel()._focus(); + } + }, + + _app_onload: function(sender, e) { + if(this.__appLoaded__) + return; + + this.__appLoaded__ = true; + if(this._disposed) + return; + + var editPanel = this; + this._loaded = true; + + this.set_activeMode(parseInt(this.get_activeModeElement().value)); + + if(this._cachedToolbarIds != null) { + this.set_toolbarIds(this._cachedToolbarIds); + this._cachedToolbarIds = null; + } + + this._validators = this.get_modePanels()[Sys.Extended.UI.HtmlEditor.ActiveModeType.Html].get_element().Validators; + this._shouldResize = false; + + if(Sys.Extended.UI.HtmlEditor.isIE && document.compatMode != "BackCompat") + this._shouldResize = true; + + if(this._shouldResize) { + var modePanels = this.get_modePanels(), + iframePanel = modePanels[Sys.Extended.UI.HtmlEditor.ActiveModeType.Design]; + + if(iframePanel == null) + iframePanel = modePanels[Sys.Extended.UI.HtmlEditor.ActiveModeType.Preview]; + + var htmlPanel = modePanels[Sys.Extended.UI.HtmlEditor.ActiveModeType.Html]; + if(iframePanel != null && htmlPanel != null) { + var iframePanelElement = iframePanel.get_element(); + iframePanelElement.style.display = ""; + + var height = iframePanelElement.offsetHeight, + invisible = false, + save; + + if(height == 0) { + invisible = true; + save = Sys.Extended.UI.HtmlEditor.setElementVisibility(iframePanelElement.parentNode); + height = iframePanelElement.offsetHeight; + } + + htmlPanel.get_element().style.height = height + "px"; + if(invisible) { + Sys.Extended.UI.HtmlEditor.restoreElementVisibility(save); + delete save; + } + + iframePanelElement.style.display = "none"; + } + } + + var content = this.get_contentElement().value.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/&/g, "&"); + this.setContent(this._initialCleanUp ? Sys.Extended.UI.HtmlEditor.cleanUp(content.replace(/[\n\r]+/g, " ")) : content); + + this.setAcceptOnPostback(); + }, + + _setActive: function() { + for(var i = 0; i < this.get_toolbars().length; i++) + this.get_toolbars()[i].set_activeEditPanel(this, true); + + if(this._eAfter != null) { + this.raisePropertyChanged("activeMode"); + this.raiseActiveModeChanged(this._eAfter); + this._eAfter = null; + } + }, + + _focused: function(prize) { + if(!(typeof prize != "undefined" && prize)) + for(var i = 0; i < this.get_toolbars().length; i++) + this.get_toolbars()[i].set_activeEditPanel(this); + + //this.raiseFocused(new Sys.EventArgs()); + Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel = this; + }, + + _really_focused: function() { + this._focused(); + this.raiseFocused(new Sys.EventArgs()); + }, + + updateToolbar: function() { + this._focused(); + }, + + getContent: function() { + var ret = this.get_activePanel().get_content() + .replace(/<\/?html(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/<\/?head(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/<\/?body(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/^([\n\r]+)/, "").replace(/([\n\r]+)$/, ""); + + if(!Sys.Extended.UI.HtmlEditor.isIE) + ret = ret.replace(/^$/, ""); + + return ret; + }, + + setContent: function(content) { + var temptext = content; + if(this.get_noScript()) + temptext = temptext.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/ig, ""); + + temptext = temptext.replace(/<\/?html(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/<\/?head(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/<\/?body(?=\s|>)(?:[^>]*?)>/gi, "") + .replace(/^([\n\r]+)/, "").replace(/([\n\r]+)$/, ""); + + this._prepareContentForPostback(temptext); + + this.get_activePanel().set_content(temptext); + this._validate(null, temptext); + }, + + _validate: function(event, content) { + var validators = this._validators; + if(validators != null && typeof validators != "undefined") { + this._contentForValidation = content; + + try { + for(var i = 0; i < validators.length; i++) + window.ValidatorValidate(validators[i], null, event); + + window.ValidatorUpdateIsValid(); + } catch(ex) { } + + this._contentForValidation = null; + } + }, + + _prepareContentForPostback: function(value) { + this.get_contentElement().value = value.replace(/&/g, "&").replace(//g, ">").replace(/\"/g, """); + }, + + _getContentForPostback: function() { + return this.get_contentElement().value.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/&/g, "&"); + }, + + _setMode: function(mode) { + var activePanel = this.get_activePanel(); + if(!activePanel._activated) { + var editPanel = this; + setTimeout(function() { + editPanel._setMode(mode); + }, 10); + + return false; + } + + var content = this.get_content(); + if(Sys.Extended.UI.HtmlEditor.isOpera) + content = content.replace(/\r/ig, ""); + + if(this._shouldResize && mode == Sys.Extended.UI.HtmlEditor.ActiveModeType.Html) { + var iframePanel = this.get_activePanel(), + htmlPanel = this.get_modePanels()[Sys.Extended.UI.HtmlEditor.ActiveModeType.Html]; + + if(iframePanel != null && htmlPanel != null) { + var iframePanelElement = iframePanel.get_element(), + height = iframePanelElement.offsetHeight, + invisible = false, + save; + + if(height == 0) { + invisible = true; + save = Sys.Extended.UI.HtmlEditor.setElementVisibility(iframePanelElement.parentNode); + height = iframePanelElement.offsetHeight; + } + + htmlPanel.get_element().style.height = height + "px"; + if(invisible) { + Sys.Extended.UI.HtmlEditor.restoreElementVisibility(save); + delete save; + } + } + } + + this.disableToolbars(mode); + + activePanel._deactivate(); + + this._activeMode = mode; + this.setContent(content); + + return true; + }, + + disableToolbars: function(mode) { + for(var i = 0; i < this.get_toolbars().length; i++) { + var toolbar = this.get_toolbars()[i]; + + if(toolbar._loaded) + toolbar.disable(mode); + } + }, + + openWait: function() { + }, + + closeWait: function() { + } +} + +Sys.Extended.UI.HtmlEditor.EditPanel.registerClass("Sys.Extended.UI.HtmlEditor.EditPanel", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Editor.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Editor.debug.js new file mode 100644 index 000000000..f357a2196 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Editor.debug.js @@ -0,0 +1,185 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.Editor = function(element) { + Sys.Extended.UI.HtmlEditor.Editor.initializeBase(this, [element]); + + this._editPanel = null; + this._changingToolbar = null; + + if(Sys.Extended.UI.HtmlEditor.isIE && Sys.Browser.version == 8 && document.compatMode != "BackCompat" || Sys.Extended.UI.HtmlEditor.isOpera) + this._onresize$delegate = Function.createDelegate(this, this._onresize); +} + +Sys.Extended.UI.HtmlEditor.Editor.prototype = { + + get_autofocus: function() { + return this._editPanel.get_autofocus(); + }, + + set_autofocus: function(value) { + this._editPanel.set_autofocus(value); + }, + + get_content: function() { + return this._editPanel.get_content(); + }, + + set_content: function(value) { + this._editPanel.set_content(value); + }, + + get_activeMode: function() { + return this._editPanel.get_activeMode(); + }, + + set_activeMode: function(value) { + this._editPanel.set_activeMode(value); + }, + + get_editPanel: function() { + return this._editPanel; + }, + + set_editPanel: function(value) { + this._editPanel = value; + }, + + get_changingToolbar: function() { + return this._changingToolbar; + }, + + set_changingToolbar: function(value) { + this._changingToolbar = value; + }, + + add_propertyChanged: function(handler) { + this._editPanel.add_propertyChanged(handler); + }, + + remove_propertyChanged: function(handler) { + this._editPanel.remove_propertyChanged(handler); + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.Editor.callBaseMethod(this, "initialize"); + + var element = this.get_element(), + oldStyle = element.className; + + Sys.UI.DomElement.removeCssClass(element, oldStyle); + Sys.UI.DomElement.addCssClass(element, "ajax__htmleditor_editor_base"); + Sys.UI.DomElement.addCssClass(element, oldStyle); + + if(!Sys.Extended.UI.HtmlEditor.isIE && document.compatMode != "BackCompat") + this.get_element().style.height = "100%"; + + if(Sys.Extended.UI.HtmlEditor.isIE && Sys.Browser.version == 8 && document.compatMode != "BackCompat" || Sys.Extended.UI.HtmlEditor.isOpera) { + $addHandlers(element, { + resize: this._onresize$delegate + }); + + var editPanel = this.get_editPanel(); + this._saved_setActive = editPanel._setActive; + editPanel._setActive = Function.createDelegate(this, this._setActive); + var editor = this; + + if(Sys.Extended.UI.HtmlEditor.isOpera) { + setTimeout(function() { + editor._ensureVisibleResize(); + }, 0); + } else { + editor._ensureVisibleResize(); + } + } + }, + + _setActive: function(par) { + var editor = this; + (Function.createDelegate(this.get_editPanel(), this._saved_setActive))(par); + + if(!Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element())) { + setTimeout(function() { + editor._ensureVisibleResize(); + }, 0); + } else { + editor._ensureVisibleResize(); + } + }, + + _ensureVisibleResize: function() { + var invisible = false, + save; + + if(!Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element())) { + invisible = true; + save = Sys.Extended.UI.HtmlEditor.setElementVisibility(this.get_element()); + } + + this._onresize(); + if(invisible) { + Sys.Extended.UI.HtmlEditor.restoreElementVisibility(save); + delete save; + } + }, + + dispose: function() { + if(Sys.Extended.UI.HtmlEditor.isIE && Sys.Browser.version == 8 && document.compatMode != "BackCompat" || Sys.Extended.UI.HtmlEditor.isOpera) { + $common.removeHandlers(this.get_element(), { + resize: this._onresize$delegate + }); + + this.get_editPanel()._setActive = this._saved_setActive; + } + + Sys.Extended.UI.HtmlEditor.Editor.callBaseMethod(this, "dispose"); + }, + + _onresize: function(e) { + try { + var editPanelTD = this.get_editPanel().get_element().parentNode; + if(typeof e == "undefined" || e == null) + editPanelTD.style.height = ""; + + var height = Sys.Extended.UI.HtmlEditor.Editor.MidleCellHeightForIE(editPanelTD.parentNode.parentNode.parentNode, editPanelTD.parentNode); + editPanelTD.style.height = height; + + if(typeof this.get_editPanel().get_activePanel()._onresize != "undefined") + this.get_editPanel().get_activePanel()._onresize(); + } catch(ex) { } + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.Editor.registerClass("Sys.Extended.UI.HtmlEditor.Editor", Sys.UI.Control); + +Sys.Extended.UI.HtmlEditor.Editor.MidleCellHeightForIE = function(table, row) { + var height = "100%"; + + if(Sys.Extended.UI.HtmlEditor.isIE && document.compatMode != "BackCompat" || Sys.Extended.UI.HtmlEditor.isOpera) { + try { + var decrease = 2; + + for(var i = 0; i < table.rows.length; i++) + if(table.rows[i] != row) + decrease += (table.rows[i].offsetHeight + 1); + + var clientHeight = table.clientHeight; + if(Sys.Browser.version == 8 || Sys.Extended.UI.HtmlEditor.isOpera) { + var styleHeight = table.style.height, + parentStyleHeight = table.parentNode.style.height; + + if(styleHeight.indexOf("px") > 0) + clientHeight = parseInt(styleHeight); + else if(styleHeight == "100%" && parentStyleHeight.indexOf("px") > 0) + clientHeight = parseInt(parentStyleHeight); + } + + height = ((clientHeight - decrease) * 100.00 / (clientHeight * 1.00)) + '%'; + } catch(e) { + height = ""; + } + } + + return height; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Enums.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Enums.debug.js new file mode 100644 index 000000000..56fd2bba2 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Enums.debug.js @@ -0,0 +1,18 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.ActiveModeType = function() { } + +Sys.Extended.UI.HtmlEditor.ActiveModeType.prototype = { + Design: 0x00, + Html: 0x01, + Preview: 0x02 +} + +Sys.Extended.UI.HtmlEditor.ActiveModeType_checkValue = function(value) { + if(value >= 0 && value <= 2) + return true; + + return false; +} + +Sys.Extended.UI.HtmlEditor.ActiveModeType.registerEnum("Sys.Extended.UI.HtmlEditor.ActiveModeType", true); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Events.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Events.debug.js new file mode 100644 index 000000000..713d4d1af --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Events.debug.js @@ -0,0 +1,30 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs = function(oldMode, newMode, editPanel) { + if(arguments.length != 3) + throw Error.parameterCount(); + + //Calling the base class constructor + Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.initializeBase(this); + + this._oldMode = oldMode; + this._newMode = newMode; + this._editPanel = editPanel; +} + +Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.prototype = { + + get_oldMode: function() { + return this._oldMode; + }, + + get_newMode: function() { + return this._newMode; + }, + + get_editPanel: function() { + return this._editPanel; + } +} + +Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.registerClass('Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ExecCommandEmulation.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ExecCommandEmulation.debug.js new file mode 100644 index 000000000..1e99aa8a8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ExecCommandEmulation.debug.js @@ -0,0 +1,1979 @@ +Sys.Extended.UI.HtmlEditor.MSIE_list = function(listTg) { + var paragraphs = this.get_paragraphs(), + pars = this.getSelectionAfterOperation(paragraphs), + currentParent = null, + collectedParagraphs = [], + editor = this, + commonList = null, + commonListItems = [], + listTag = listTg.toUpperCase(), + needJoiner = false; + + function operateList() { + if(commonList != null) { + var newList; + + newList = commonList.cloneNode(false); + commonList.parentNode.insertBefore(newList, commonList); + + while(commonList.firstChild != commonListItems[0]) + newList.appendChild(commonList.firstChild); + + if(newList.firstChild == null) + newList.parentNode.removeChild(newList); + + if(commonList.tagName.toUpperCase() == listTag) { + for(var i = 0; i < commonListItems.length; i++) { + var element = commonListItems[i]; + + if(element.nodeType == 1 && element.tagName && element.tagName.toUpperCase() == "LI") { + var good = false; + commonList.parentNode.insertBefore(element, commonList); + + if(element.style.textAlign == "") + element.style.textAlign = commonList.style.textAlign; + + if(commonList.childNodes.length == 0 && i == commonListItems.length - 1) { + commonList.parentNode.removeChild(commonList); + commonList = null; + } + + if(element.style.textAlign == "" || (element.style.textAlign.toLowerCase() == "left" && !editor.rtlState()) || + (element.style.textAlign.toLowerCase() == "right" && editor.rtlState())) { + + good = editor.tryUnWrap(element, pars); + if(good) + needJoiner = true; + } + + if(!good) { + var newP = editor._doc.createElement(editor.dfltBlockElement), + attrs = element.attributes; + + for(var ik = 0; ik < attrs.length; ++ik) { + var a = attrs.item(ik); + + if(!a.specified) + continue; + if(a.name.toLowerCase() == "style") + continue; + + newP.setAttribute(a.name, a.value); + } + + newP.style.cssText = element.style.cssText; + if(newP.tagName.toUpperCase() == "P") + newP.style.margin = "0px"; + + while(element.firstChild) + newP.appendChild(element.firstChild); + + element.parentNode.insertBefore(newP, element); + element.parentNode.removeChild(element); + } + } else + commonList.parentNode.insertBefore(element, commonList); + } + } else { + var newList = editor._doc.createElement(listTag), + attrs = commonList.attributes; + + for(var ik = 0; ik < attrs.length; ++ik) { + var a = attrs.item(ik); + + if(!a.specified) + continue; + if(a.name.toLowerCase() == "style") + continue; + + newList.setAttribute(a.name, a.value); + } + + newList.style.cssText = commonList.style.cssText; + commonList.parentNode.insertBefore(newList, commonList); + + for(var i = 0; i < commonListItems.length; i++) { + var element = commonListItems[i]; + newList.appendChild(element); + } + } + + if(commonList != null) { + newList = commonList.cloneNode(false); + commonList.parentNode.insertBefore(newList, commonList); + + while(commonList.firstChild) + newList.appendChild(commonList.firstChild); + + if(newList.firstChild == null) + newList.parentNode.removeChild(newList); + + commonList.parentNode.removeChild(commonList); + } + } + + commonList = null; + commonListItems = []; + } + + function operateCollectedParagraphs() { + var firstChild = currentParent.firstChild, + lastChild = currentParent.lastChild, + parTagName = currentParent.tagName.toUpperCase(); + + if( // if all paragraps(only) are in one parent already + !Sys.Extended.UI.HtmlEditor.isInlineElement(currentParent) && + collectedParagraphs[0][0] == firstChild && + collectedParagraphs[collectedParagraphs.length - 1][collectedParagraphs[collectedParagraphs.length - 1].length - 1] == lastChild && + (parTagName == "OL" || parTagName == "UL" || parTagName == "DL" || parTagName == "LI" || + ((parTagName == "P" || parTagName == "DIV" || Sys.Extended.UI.HtmlEditor.isHeader(currentParent)) && parTagName == "LI") + ) + ) { + operateList(); + commonListItems = []; + + if(parTagName == "LI") { + commonList = currentParent.parentNode; + commonListItems.push(currentParent); + } else if(parTagName == "P" || parTagName == "DIV" || Sys.Extended.UI.HtmlEditor.isHeader(currentParent)) { + commonList = currentParent.parentNode.parentNode; + commonListItems.push(currentParent.parentNode); + } else { + commonList = currentParent; + + for(var i = 0; i < collectedParagraphs.length; i++) { + var paragraph = collectedParagraphs[i]; + + for(var j = 0; j < paragraph.length; j++) + commonListItems.push(paragraph[j]); + } + } + operateList(); + } else { + if(parTagName == "LI" && (collectedParagraphs.length < paragraphs.length)) { + if(commonList != currentParent.parentNode) { + operateList(); + commonList = currentParent.parentNode; + commonListItems = []; + } + commonListItems.push(currentParent); + } else if(parTagName == "OL" || parTagName == "UL" || parTagName == "DL") { + operateList(); + commonList = currentParent; + commonListItems = []; + + for(var i = 0; i < collectedParagraphs.length; i++) { + var paragraph = collectedParagraphs[i]; + + for(var j = 0; j < paragraph.length; j++) + commonListItems.push(paragraph[j]); + } + operateList(); + } else { + var li = null, + list = null; + + function completeLi() { + if(li != null) + if(li.childNodes == 1 && (li.firstChild == pars[0] || li.firstChild == pars[1])) { + li.parentNode.insertBefore(li.firstChild, li); + li.parentNode.removeChild(li); + } + li = null; + } + + if(commonList != null) + operateList(); + + var colTagName = ""; + if(collectedParagraphs.length == 1 && collectedParagraphs[0].length == 1 && collectedParagraphs[0][0].nodeType == 1 && collectedParagraphs[0][0].tagName) + colTagName = collectedParagraphs[0][0].tagName.toUpperCase(); + + if(colTagName == "OL" || colTagName == "UL" || colTagName == "DL") { + var element = collectedParagraphs[0][0]; + + commonList = element; + commonListItems = []; + + for(var i = 0; i < element.childNodes.length; i++) { + var el = element.childNodes.item(i); + commonListItems.push(el); + } + operateList(); + } else { + for(var i = 0; i < collectedParagraphs.length; i++) { + var paragraph = collectedParagraphs[i]; + + for(var j = 0; j < paragraph.length; j++) { + var element = paragraph[j], + elTagName = (element.tagName) ? element.tagName.toUpperCase() : ""; + + if(list == null) { + list = editor._doc.createElement(listTag); + element.parentNode.insertBefore(list, element); + } + + if(!Sys.Extended.UI.HtmlEditor.isInlineElement(element) && elTagName != "BR") { + if(li && li.firstChild) + completeLi(); + + if(li == null) { + li = editor._doc.createElement("LI"); + list.appendChild(li); + } + + li.appendChild(element); + completeLi(); + } else { + if(li == null) { + li = editor._doc.createElement("LI"); + list.appendChild(li); + } + + var actualLength = (paragraph[paragraph.length - 1] == pars[1]) ? paragraph.length - 1 : paragraph.length, + actualStart = (paragraph[0] == pars[0]) ? 1 : 0; + + if(elTagName == "BR" && j == actualLength - 1 && j == actualStart) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + li.appendChild(editor._doc.createTextNode(String.fromCharCode(160))); + element.parentNode.removeChild(element); + } else + li.appendChild(element); + } else + if(elTagName == "BR" && j == actualLength - 1 && j > actualStart) + element.parentNode.removeChild(element); + else + li.appendChild(element); + + if(elTagName == "BR" && j == paragraph.length - 1) { + completeLi(); + li = null; + } + + if(element == pars[1] && j == paragraph.length - 1) { + completeLi(); + li = null; + } + } + } + + if(li && li.firstChild) + completeLi(); + } + } + + if(list != null) { + var aligns = []; + for(var j = 0; j < list.childNodes.length; j++) + aligns.push(list.childNodes.item(j).style.textAlign); + + var jj = 1; + for(; jj < aligns.length; jj++) + if(aligns[jj - 1] != aligns[jj]) + break; + + if(jj == aligns.length) { + var align = ((aligns[0] == "left" && !editor.rtlState()) || (aligns[0] == "right" && editor.rtlState())) ? "" : aligns[0]; + + for(var j = 0; j < list.childNodes.length; j++) + list.childNodes.item(j).style.textAlign = ""; + + list.style.textAlign = align; + } + } + + if(list != null) + if(list.parentNode.tagName.toUpperCase() == "P" && list.parentNode.childNodes.length == 1) { + var pp = list.parentNode, + clone = pp.cloneNode(false); + + pp.parentNode.insertBefore(list, pp); + pp.parentNode.removeChild(pp); + + if(list.childNodes.length == 1) { + var item = list.firstChild; + + while(item.firstChild) + clone.appendChild(item.firstChild); + + item.appendChild(clone); + } else + delete clone; + } + } + } + } + + for(var i = 0; i < paragraphs.length; i++) { + var paragraph = paragraphs[i]; + + if(paragraph.length > 0) { + if(paragraph[0].parentNode != currentParent) { // start new collection of paragraps + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + collectedParagraphs = []; + currentParent = paragraph[0].parentNode; + } + + collectedParagraphs.push(paragraph); + } + } + + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + if(commonList != null) + operateList(); + + this.setSelectionAfterOperation(pars, needJoiner); +}; + +Sys.Extended.UI.HtmlEditor.MSIE_justify = function(textAlign, addParameter, addParameter1) { + var paragraphs = this.get_paragraphs(), + pars = this.getSelectionAfterOperation(paragraphs), + currentParent = null, + collectedParagraphs = [], + editor = this, + force = (typeof addParameter != "undefined" && addParameter) ? true : false, + remainP = (typeof addParameter1 == "string") ? true : false, + pTag = (typeof addParameter1 == "string") ? addParameter1 : "", + needJoiner = false; + + function completeDiv(div) { + if(div != null) + if(div.childNodes == 1 && (div.firstChild == pars[0] || div.firstChild == pars[1])) { + div.parentNode.insertBefore(div.firstChild, div); + div.parentNode.removeChild(div); + } + } + + function operateCollectedParagraphs() { + var firstChild = currentParent.firstChild, + lastChild = currentParent.lastChild, + single = false, + curTagName; + + if(currentParent.tagName && !Sys.Extended.UI.HtmlEditor.isInlineElement(currentParent) && + collectedParagraphs[0][0] == firstChild && + collectedParagraphs[collectedParagraphs.length - 1][collectedParagraphs[collectedParagraphs.length - 1].length - 1] == lastChild + ) { + curTagName = currentParent.tagName.toUpperCase(); + + if(curTagName != "TD" && curTagName != "TH" && curTagName != "FIELDSET" && curTagName != "LEGEND") + single = true; + } + + if(single) { // if all paragraps(them only) are in one parent already + var align = ""; + + if(currentParent.getAttribute("align") && currentParent.getAttribute("align").length > 0) + align = currentParent.getAttribute("align"); + + if(currentParent.align && currentParent.align.length > 0) + align = currentParent.align; + + if(currentParent.style.textAlign && currentParent.style.textAlign.length > 0) + align = currentParent.style.textAlign; + + currentParent.align = ""; + currentParent.setAttribute("align", ""); + currentParent.removeAttribute("align"); + + // can we remove parent element? + if((curTagName == "DIV" || curTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(currentParent)) && textAlign == "left" && force) { + if(editor.tryUnWrap(currentParent, pars, force)) + needJoiner = true; + } else { + if(textAlign != "remain") { + if(!(textAlign == "left" && force) || (curTagName == "LI" && currentParent.parentNode.style.textAlign.length > 0)) + currentParent.style.textAlign = textAlign; + else + currentParent.style.textAlign = ""; + } + + if(force) + currentParent.style.margin = (curTagName == "P") ? "0px" : ""; + + if(curTagName == "LI") { + var list = currentParent.parentNode, + aligns = []; + + for(var jn = 0; jn < list.childNodes.length; jn++) + if(list.childNodes.item(jn).nodeType == 1) + aligns.push(list.childNodes.item(jn).style.textAlign); + + var jj = 1; + for(; jj < aligns.length; jj++) + if(aligns[jj - 1] != aligns[jj]) + break; + + if(jj == aligns.length) { + var align = (aligns[0] == "left" && force) ? "" : aligns[0]; + + for(var j = 0; j < list.childNodes.length; j++) + if(list.childNodes.item(j).nodeType == 1) { + list.childNodes.item(j).style.textAlign = ""; + + if(force) + list.childNodes.item(j).style.margin = (list.childNodes.item(j).tagName.toUpperCase() == "P") ? "0px" : ""; + } + + list.style.textAlign = align; + } + } + + if((curTagName == "DIV" || curTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(currentParent)) + && remainP && pTag.toUpperCase() != curTagName) { + var nEl = editor._doc.createElement(pTag), + attrs = currentParent.attributes; + + for(var k = 0; k < attrs.length; ++k) { + var a = attrs.item(k); + + if(!a.specified) + continue; + if(a.name.toLowerCase() == "style") + continue; + + nEl.setAttribute(a.name, a.value); + } + + nEl.style.cssText = currentParent.style.cssText; + + while(currentParent.firstChild) + nEl.appendChild(currentParent.firstChild); + + currentParent.parentNode.insertBefore(nEl, currentParent); + currentParent.parentNode.removeChild(currentParent); + } + } + } else { + var div = null; + for(var i = 0; i < collectedParagraphs.length ; i++) { + if(!remainP) + div = null; + + var paragraph = collectedParagraphs[i]; + for(var j = 0; j < paragraph.length; j++) { + var element = paragraph[j], + elementTagName = (element.nodeType == 1 && element.tagName) ? element.tagName.toUpperCase() : null; + + if(elementTagName != null && + (elementTagName == "UL" || elementTagName == "OL" || + elementTagName == "DL" || elementTagName == "DIV" || Sys.Extended.UI.HtmlEditor.isHeader(element) || + elementTagName == "P" || elementTagName == "LI" || elementTagName == "TABLE" + ) + ) { + completeDiv(div); + div = null; + if(textAlign != "remain") + if(elementTagName != "TABLE" && !force) + element.style.textAlign = textAlign; + + if(force) + element.style.margin = (elementTagName == "P") ? "0px" : ""; + + if(elementTagName == "UL" || elementTagName == "OL" || elementTagName == "DL") { + for(var jk = 0; jk < element.childNodes.length; jk++) { + var li = element.childNodes.item(jk); + + if(li.nodeType == 1) { + li.style.textAlign = ""; + if(force) + li.style.margin = (li.tagName.toUpperCase() == "P") ? "0px" : ""; + + for(var kk = 0; kk < li.childNodes.length; kk++) { + var child = li.childNodes.item(kk); + + if(child.nodeType == 1 && child.tagName) { + var childTagName = child.tagName.toUpperCase(); + + if(force) + child.style.margin = (childTagName == "P") ? "0px" : ""; + + if(childTagName == "DIV" || childTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(child)) + if(editor.tryUnWrap(child, pars, force)) + needJoiner = true; + } + } + } + } + + if(textAlign == "left" && force) + element.style.textAlign = ""; + + continue; + } else if(elementTagName == "LI") { + if(textAlign != "remain") + if(!(textAlign == "left" && force) || element.parentNode.style.textAlign.length > 0) + element.style.textAlign = textAlign; + else + element.style.textAlign = ""; + + if(force) + element.style.margin = (elementTagName == "P") ? "0px" : ""; + + var list = element.parentNode, + aligns = []; + + for(var jn = 0; jn < list.childNodes.length; jn++) + if(list.childNodes.item(jn).nodeType == 1) + aligns.push(list.childNodes.item(jn).style.textAlign); + + var jj = 1; + for(; jj < aligns.length; jj++) + if(aligns[jj - 1] != aligns[jj]) + break; + + if(jj == aligns.length) { + var align = (aligns[0] == "left" && force) ? "" : aligns[0]; + + for(var j = 0; j < list.childNodes.length; j++) + if(list.childNodes.item(j).nodeType == 1) { + list.childNodes.item(j).style.textAlign = ""; + + if(force) + list.childNodes.item(j).style.margin = (list.childNodes.item(j).tagName.toUpperCase() == "P") ? "0px" : ""; + } + + list.style.textAlign = align; + } + + continue; + } else if(elementTagName == "TABLE") { + if(textAlign != "remain") { + if(!(textAlign == "left" && force)) + element.align = textAlign; + else { + element.align = ""; + element.removeAttribute("align"); + } + } + } + + // can we remove DIV or P ? + if((elementTagName == "DIV" || elementTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(element)) && textAlign == "left" && force) + if(editor.tryUnWrap(element, pars, force)) + needJoiner = true; + + if((elementTagName == "DIV" || elementTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(element)) + && remainP && pTag.toUpperCase() != elementTagName) { + var nEl = editor._doc.createElement(pTag); + + var attrs = element.attributes; + + for(var k = 0; k < attrs.length; ++k) { + var a = attrs.item(k); + + if(!a.specified) + continue; + if(a.name.toLowerCase() == "style") + continue; + + nEl.setAttribute(a.name, a.value); + } + + nEl.style.cssText = element.style.cssText; + + while(element.firstChild) + nEl.appendChild(element.firstChild); + + element.parentNode.insertBefore(nEl, element); + element.parentNode.removeChild(element); + } + } else { + if(!(textAlign == "left" && force) || remainP) { + if(div == null) { + div = editor._doc.createElement(remainP ? pTag : editor.dfltBlockElement); + + if(editor.dfltBlockElement.toUpperCase() == "P" && !remainP) + div.style.margin = "0px"; + if(!remainP) + div.style.textAlign = textAlign; + + element.parentNode.insertBefore(div, element); + } + + var actualLength = (paragraph[paragraph.length - 1] == pars[1]) ? paragraph.length - 1 : paragraph.length, + actualStart = (paragraph[0] == pars[0]) ? 1 : 0; + + if(elementTagName == "BR" && j == actualLength - 1 && j == actualStart) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + div.appendChild(editor._doc.createTextNode(String.fromCharCode(160))); + element.parentNode.removeChild(element); + } else + div.appendChild(element); + } else + if(elementTagName == "BR" && j == actualLength - 1 && j > actualStart && (!remainP || (element.nextSibling != null && element.nextSibling == pars[1]))) + element.parentNode.removeChild(element); + else + div.appendChild(element); + + if(elementTagName == "BR" && j == paragraph.length - 1 && !remainP) { + completeDiv(div); + div = null; + } + + if(element == pars[1] && j == paragraph.length - 1) { + completeDiv(div); + div = null; + } + } + } + } + } + } + } + + for(var i = 0; i < paragraphs.length; i++) { + var paragraph = paragraphs[i]; + + if(paragraph.length > 0) { + if(paragraph[0].parentNode != currentParent) { // start new collection of paragraps + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + collectedParagraphs = []; + currentParent = paragraph[0].parentNode; + } + + collectedParagraphs.push(paragraph); + } + } + + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + this.setSelectionAfterOperation(pars, needJoiner); +} + +Sys.Extended.UI.HtmlEditor.MSIE_indent = function(increase) { + var paragraphs = this.get_paragraphs(), + pars = this.getSelectionAfterOperation(paragraphs), + currentParent = null, + collectedParagraphs = [], + editor = this, + needJoiner = false; + + function getMargin(el) { + if(el.nodeType == 1) { + var cssEl = (!editor.rtlState()) ? el.style.marginLeft : el.style.marginRight; + + if(cssEl.length > 0) + return parseInt(cssEl); + } + + return 0; + } + + function setMargin(el, value) { + if(el.nodeType == 1) { + if(el.tagName.toUpperCase() == "P" && value == "") + value = "0px"; + + if(!editor.rtlState()) + el.style.marginLeft = value; + else + el.style.marginRight = value; + } + } + + function changeMargin(el) { + if(increase) + setMargin(el, (getMargin(el) + 40) + "px"); + else { + if(el.tagName.toUpperCase() == "P") { + if(getMargin(el) >= 40) + setMargin(el, (getMargin(el) - 40) + "px"); + else + setMargin(el, "0px"); + } else { + if(getMargin(el) > 40) + setMargin(el, (getMargin(el) - 40) + "px"); + else + setMargin(el, ""); + } + } + } + + function completeDiv(div) { + if(div != null) + if(div.childNodes == 1 && (div.firstChild == pars[0] || div.firstChild == pars[1])) { + div.parentNode.insertBefore(div.firstChild, div); + div.parentNode.removeChild(div); + } + } + + function operateCollectedParagraphs() { + var firstChild = currentParent.firstChild, + lastChild = currentParent.lastChild; + + if( // if all paragraps(them only) are in one parent already + currentParent.tagName && !Sys.Extended.UI.HtmlEditor.isInlineElement(currentParent) && + collectedParagraphs[0][0] == firstChild && + collectedParagraphs[collectedParagraphs.length - 1][collectedParagraphs[collectedParagraphs.length - 1].length - 1] == lastChild + ) { + var textAlign = ""; + + if(currentParent.getAttribute("align") && currentParent.getAttribute("align").length > 0) + textAlign = currentParent.getAttribute("align"); + + if(currentParent.align && currentParent.align.length > 0) + textAlign = currentParent.align; + + if(currentParent.style.textAlign && currentParent.style.textAlign.length > 0) + textAlign = currentParent.style.textAlign; + + if((textAlign.toLowerCase() == "left" && !editor.rtlState()) || (textAlign.toLowerCase() == "right" && editor.rtlState())) + textAlign = ""; + + currentParent.align = ""; + currentParent.setAttribute("align", ""); + currentParent.removeAttribute("align"); + + changeMargin(currentParent); + + var curTagName = currentParent.tagName.toUpperCase(); + + // can we remove parent element? + if((curTagName == "DIV" || curTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(currentParent)) && textAlign == "") { + if(editor.tryUnWrap(currentParent, pars)) + needJoiner = true; + } else { + if(textAlign != "" || (curTagName == "LI" && currentParent.parentNode.style.textAlign.length > 0)) + currentParent.style.textAlign = textAlign; + else + currentParent.style.textAlign = ""; + + if(curTagName == "LI") { + var list = currentParent.parentNode, + margins = []; + + for(var jn = 0; jn < list.childNodes.length; jn++) + margins.push(getMargin(list.childNodes.item(jn))); + + var jj = 1; + for(; jj < margins.length; jj++) + if(margins[jj - 1] != margins[jj]) + break; + + if(jj == margins.length) { + var margin = (margins[0] == 0) ? "" : (margins[0] + "px"); + + for(var j = 0; j < list.childNodes.length; j++) + setMargin(list.childNodes.item(j), ""); + + setMargin(list, margin); + } + } + } + } else { + for(var i = 0; i < collectedParagraphs.length ; i++) { + var div = null, + paragraph = collectedParagraphs[i]; + + for(var j = 0; j < paragraph.length; j++) { + var element = paragraph[j], + elementTagName = (element.nodeType == 1 && element.tagName) ? element.tagName.toUpperCase() : null; + + if(elementTagName != null && + (elementTagName == "UL" || elementTagName == "OL" || + elementTagName == "DL" || elementTagName == "DIV" || Sys.Extended.UI.HtmlEditor.isHeader(element) || + elementTagName == "P" || elementTagName == "LI" + ) + ) { + completeDiv(div); + div = null; + + changeMargin(element) + + if(elementTagName == "UL" || elementTagName == "OL" || elementTagName == "DL") { + for(var jk = 0; jk < element.childNodes.length; jk++) { + var li = element.childNodes.item(jk); + + if(li.nodeType == 1) { + setMargin(li, ""); + + for(var kk = 0; kk < li.childNodes.length; kk++) { + var child = li.childNodes.item(kk); + + var textAlign = (child.nodeType == 1) ? element.style.textAlign : ""; + if((textAlign.toLowerCase() == "left" && !editor.rtlState()) || (textAlign.toLowerCase() == "right" && editor.rtlState())) + textAlign = ""; + + if(child.nodeType == 1) { + setMargin(child, ""); + + if(textAlign == "" && child.tagName) { + var childTagName = child.tagName.toUpperCase(); + + if(childTagName == "DIV" || childTagName == "P") + if(editor.tryUnWrap(child, pars)) + needJoiner = true; + } + } + } + } + } + + continue; + } else if(elementTagName == "LI") { + var list = element.parentNode, + margins = []; + + for(var jn = 0; jn < list.childNodes.length; jn++) + margins.push(getMargin(list.childNodes.item(jn))); + + var jj = 1; + for(; jj < margins.length; jj++) + if(margins[jj - 1] != margins[jj]) + break; + + if(jj == margins.length) { + var margin = (margins[0] == 0) ? "" : (margins[0] + "px"); + + for(var j = 0; j < list.childNodes.length; j++) + setMargin(list.childNodes.item(j), ""); + + setMargin(list, margin); + } + + continue; + } + + var textAlign = element.style.textAlign; + if((textAlign.toLowerCase() == "left" && !editor.rtlState()) || (textAlign.toLowerCase() == "right" && editor.rtlState())) + textAlign = ""; + + // can we remove DIV or P ? + if((elementTagName == "DIV" || elementTagName == "P" || Sys.Extended.UI.HtmlEditor.isHeader(element)) && textAlign == "") { + if(editor.tryUnWrap(element, pars)) + needJoiner = true; + } + } else { + if(increase) { + if(div == null) { + div = editor._doc.createElement(editor.dfltBlockElement); + + if(editor.dfltBlockElement.toUpperCase() == "P") + div.style.margin = "0px"; + + changeMargin(div); + element.parentNode.insertBefore(div, element); + } + + var actualLength = (paragraph[paragraph.length - 1] == pars[1]) ? paragraph.length - 1 : paragraph.length, + actualStart = (paragraph[0] == pars[0]) ? 1 : 0; + + if(elementTagName == "BR" && j == actualLength - 1 && j == actualStart) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + div.appendChild(editor._doc.createTextNode(String.fromCharCode(160))); + element.parentNode.removeChild(element); + } else + div.appendChild(element); + } else if(elementTagName == "BR" && j == actualLength - 1 && j > actualStart) + element.parentNode.removeChild(element); + else + div.appendChild(element); + + if(elementTagName == "BR" && j == paragraph.length - 1) { + completeDiv(div); + div = null; + } + + if(element == pars[1] && j == paragraph.length - 1) { + completeDiv(div); + div = null; + } + } + } + } + } + } + } + + for(var i = 0; i < paragraphs.length; i++) { + var paragraph = paragraphs[i]; + + if(paragraph.length > 0) { + if(paragraph[0].parentNode != currentParent) { + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + collectedParagraphs = []; + currentParent = paragraph[0].parentNode; + } + + collectedParagraphs.push(paragraph); + } + } + + if(collectedParagraphs.length > 0) + operateCollectedParagraphs(); + + this.setSelectionAfterOperation(pars, needJoiner); +}; + +Sys.Extended.UI.HtmlEditor.getSelectionAfterOperation = function(paragraphs) { + if(paragraphs.length == 0) + return []; + + var lPoint = this._doc.createElement("SPAN"), + rPoint = this._doc.createElement("SPAN"), + initFirst = paragraphs[0][0], + initLast = paragraphs[paragraphs.length - 1][paragraphs[paragraphs.length - 1].length - 1]; + + if(initFirst == initLast && initLast.nodeType == 1 && initLast.childNodes.length == 0 && Sys.Extended.UI.HtmlEditor.canHaveChildren(initLast)) { + initLast.appendChild(lPoint); + initLast.appendChild(rPoint); + } else { + var firstest = Sys.Extended.UI.HtmlEditor._getReallyFirst(initFirst); + + firstest.parentNode.insertBefore(lPoint, firstest); + + if(firstest == initFirst) { + var sv = []; + sv.push(lPoint); + + for(var i = 0; i < paragraphs[0].length; i++) + sv.push(paragraphs[0][i]); + + paragraphs[0] = sv; + } + + var lastest = Sys.Extended.UI.HtmlEditor._getReallyLast(initLast); + + if(lastest.nextSibling) + lastest.parentNode.insertBefore(rPoint, lastest.nextSibling); + else + lastest.parentNode.appendChild(rPoint); + + if(lastest == initLast) + paragraphs[paragraphs.length - 1].push(rPoint) + } + + return [lPoint, rPoint]; +}; + +Sys.Extended.UI.HtmlEditor.setSelectionAfterOperation = function(pars, needJoiner) { + if(pars.length == 0) + return; + + var lPoint = pars[0], + rPoint = pars[1]; + + var sel = this._getSelection(), + text1 = null, + text2 = null; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + sel.empty(); + sel = this._getSelection(); + + var range1 = this._createRange(sel), + range2 = this._createRange(sel); + + try { + if(lPoint != null && rPoint != null && lPoint.nextSibling == rPoint) { + text1 = this._doc.createTextNode(" "); + rPoint.parentNode.insertBefore(text1, rPoint); + } + + this._TcurrentFormat = null; + + if(lPoint != null) + range1.moveToElementText(lPoint); + + if(rPoint != null) + range2.moveToElementText(rPoint); + + if(lPoint != null && rPoint != null) { + range1.setEndPoint("EndToStart", range2); + range1.select(); + + if(text1 != null) { + range1.collapse(false); + range1.select(); + text1.parentNode.removeChild(text1); + } + } else + if(lPoint != null) + range1.select(); + else + if(rPoint != null) + range2.select(); + } catch(ex) { } + } else { + try { + var range, + next = lPoint.nextSibling, + prev = rPoint.previousSibling + + this._TcurrentFormat = null; + + if(next == prev && next.nodeType == 1 && next.tagName.toUpperCase() == "BR") { + var ind = Sys.Extended.UI.HtmlEditor.__getIndex(next); + + range = this._doc.createRange(); + range.setStart(next.parentNode, ind); + range.setEnd(next.parentNode, ind); + } else { + text1 = this._doc.createTextNode(""); + text2 = this._doc.createTextNode(""); + + lPoint.parentNode.insertBefore(text1, lPoint); + rPoint.parentNode.insertBefore(text2, rPoint); + + range = this._doc.createRange(); + range.setStart(text1, 0); + range.setEnd(text2, 0); + } + + this._removeAllRanges(sel); + this._selectRange(sel, range); + } catch(ex) { } + } + + var fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent((lPoint == null) ? rPoint : lPoint, (rPoint == null) ? lPoint : rPoint), + parent = null; + + if(fnd != null) + parent = fnd.parent; + + if(lPoint != null) + lPoint.parentNode.removeChild(lPoint); + if(rPoint != null) + rPoint.parentNode.removeChild(rPoint); + + if(needJoiner && parent != null) { + Sys.Extended.UI.HtmlEditor.spanJoiner(parent, this._doc); + + if(!Sys.Extended.UI.HtmlEditor.isIE && text1 != null && text2 != null) { + var range = this._doc.createRange(); + + range.setStart(text1, 0); + range.setEnd(text2, 0); + + this._removeAllRanges(sel); + this._selectRange(sel, range); + } + } +}; + +Sys.Extended.UI.HtmlEditor.get_paragraphs = function() { + this._TcurrentFormat = null; + var paragraphs = this.getPseudoP(); + + if(paragraphs.length == 0) { + try { + var str = "
    "; + this.insertHTML(str); + + var lPoint = this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName + "_ll"), + rPoint = this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName + "_rr"); + + var sv = this._TcurrentFormat; + + this._TcurrentFormat = null; + this.setSelectionAfterOperation([lPoint, rPoint], false); + this._TcurrentFormat = sv; + + paragraphs = this.getPseudoP(); + } catch(ex) { } + } + + return paragraphs; +}; + +Sys.Extended.UI.HtmlEditor.getPseudoP = function() { + var result = []; + + try { + var sel = this._getSelection(), + range = this._createRange(sel); + + // ids for bound markers + var rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right", + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left"; + + // bound ranges + var r_left = null, + r_right = null; + + // get bound ranges + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(sel.type.toLowerCase() != "control") { + r_left = range.duplicate(); + r_right = range.duplicate(); + r_left.setEndPoint("EndToStart", range); + r_right.setEndPoint("StartToEnd", range); + } + } else { + r_left = range.cloneRange(); + r_right = range.cloneRange(); + r_left.setEnd(r_left.startContainer, r_left.startOffset); + r_right.setStart(r_right.endContainer, r_right.endOffset); + } + + var lPoint = null, + rPoint = null; + + // insert markers + if(Sys.Extended.UI.HtmlEditor.isIE && sel.type.toLowerCase() == "control") { + var control = range.item(0), + cspan; + + cspan = this._doc.createElement("SPAN"); + cspan.id = ln; + control.parentNode.insertBefore(cspan, control); + + cspan = this._doc.createElement("SPAN"); + cspan.id = rn; + + if(control.nextSibling == null) + control.parentNode.appendChild(cspan); + else + control.parentNode.insertBefore(cspan, control.nextSibling); + } else { + if(!this.insertHTML("", r_right)) + return []; + + if(!this.insertHTML("", r_left)) { + var rP = this._doc.getElementById(rn); + + if(rP != null) { + temp = rP.parentNode; + temp.removeChild(rP); + } + + return []; + } + } + + // get markers + lPoint = this._doc.getElementById(ln); + rPoint = this._doc.getElementById(rn); + + if(lPoint != null && rPoint != null) + while(lPoint.nextSibling == null) + if(lPoint.parentNode.nextSibling) + lPoint.parentNode.parentNode.insertBefore(lPoint, lPoint.parentNode.nextSibling); + else + lPoint.parentNode.parentNode.appendChild(lPoint); + + if(lPoint != null && rPoint != null) { + while(rPoint.previousSibling == null) + rPoint.parentNode.parentNode.insertBefore(rPoint, rPoint.parentNode); + + if(rPoint.previousSibling.nodeType == 1) { + var tagName = rPoint.previousSibling.tagName.toUpperCase(); + + if(tagName != "BR" && tagName != "IMG") { + var last = Sys.Extended.UI.HtmlEditor._getReallyLast(rPoint.previousSibling); + + if(last.nodeType == 1 && Sys.Extended.UI.HtmlEditor.canHaveChildren(last)) + last.appendChild(rPoint); + else + last.parentNode.appendChild(rPoint); + } + } + + if(rPoint.previousSibling && rPoint.previousSibling.nodeType == 1 && rPoint.previousSibling.tagName.toUpperCase() == "BR") + rPoint.parentNode.insertBefore(rPoint, rPoint.previousSibling); + } + + if(lPoint == null) { + var span = this._doc.createElement("SPAN"); + span.id = ln; + rPoint.parentNode.insertBefore(span, rPoint); + lPoint = span; + } + + if(rPoint == null) { + var span = this._doc.createElement("SPAN"); + span.id = rn; + + if(lPoint.nextSibling) + lPoint.parentNode.insertBefore(span, lPoint.nextSibling); + else + lPoint.parentNode.appendChild(span); + + rPoint = span; + } + + if(lPoint != null && rPoint != null) + if(lPoint.parentNode == rPoint) { + rPoint.parentNode.insertBefore(lPoint, rPoint); + } else if(rPoint.parentNode == lPoint) { + if(lPoint.nextSibling != null) + lPoint.parentNode.insertBefore(rPoint, lPoint.nextSibling); + else + lPoint.parentNode.appendChild(rPoint); + } + + while(lPoint.nextSibling != null && lPoint.nextSibling.nodeType == 3 && ("" + lPoint.nextSibling.data + "").length == 0) + lPoint.parentNode.removeChild(lPoint.nextSibling); + + + if(this._TcurrentFormat == null && lPoint != null && rPoint != null && lPoint.nextSibling == rPoint) { + var par = rPoint.parentNode; + + this._TcurrentFormat = null; + + while(par && par.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + if(par.tagName.toUpperCase() != "A") { + var temp = par.cloneNode(false); + + if(this._TcurrentFormat == null) { + this._TcurrentFormat = temp; + } else { + temp.appendChild(this._TcurrentFormat); + this._TcurrentFormat = temp; + } + } + + par = par.parentNode; + } + + if(this._TcurrentFormat) { + var sspan = this._doc.createElement("span"); + sspan.appendChild(this._TcurrentFormat); + this._TcurrentFormat = sspan.innerHTML; + } + } + + // try to move markers to pseudo paragraphs bounds + + var telem = lPoint; + while(telem && telem.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(telem.tagName) && (telem.tagName.toUpperCase() != "A")) + telem = telem.parentNode; + + if(telem != null && telem.tagName.toUpperCase() == "P") { + if(telem.firstChild != null) + telem.insertBefore(lPoint, telem.firstChild); + else + telem.appendChild(lPoint); + } else + Sys.Extended.UI.HtmlEditor.positionInParagraph(lPoint, lPoint.previousSibling, true, lPoint.parentNode); + + telem = rPoint; + while(telem && telem.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(telem.tagName) && (telem.tagName.toUpperCase() != "A")) + telem = telem.parentNode; + + if(telem != null && telem.tagName.toUpperCase() == "P") { + telem.appendChild(rPoint); + } else + Sys.Extended.UI.HtmlEditor.positionInParagraph(rPoint, rPoint.nextSibling, false, rPoint.parentNode); + + result = this.getPseudoP_Recur(lPoint, rPoint, 0); + + var lpTagName = lPoint.parentNode.tagName.toUpperCase(); + if(result.length == 0 && lPoint.previousSibling == null && rPoint.nextSibling == null && + lPoint.nextSibling == rPoint && (lpTagName == "P" || llpTagName == "DIV" || lpTagName == "LI") + ) + result = [[lPoint.parentNode]]; + + // set selection + if(Sys.Extended.UI.HtmlEditor.isIE) { + sel.empty(); + + sel = this._getSelection(); + var range1 = this._createRange(sel), + range2 = this._createRange(sel); + + try { + if(lPoint != null) + range1.moveToElementText(lPoint); + if(rPoint != null) + range2.moveToElementText(rPoint); + + if(lPoint != null && rPoint != null) { + range1.setEndPoint("EndToEnd", range2); + range1.select(); + } else if(lPoint != null) + range1.select(); + else + if(rPoint != null) + range2.select(); + } catch(e) { } + } + + // remobe bound markers + if(lPoint != null) + lPoint.parentNode.removeChild(lPoint); + if(rPoint != null) + rPoint.parentNode.removeChild(rPoint); + } catch(e) { + var spans = this._doc.getElementsByTagName("SPAN"), + del = []; + + for(var i = 0; i < spans.length; i++) { + var span = spans[i]; + + if(span.id && span.id.length > 0) { + var reg = new RegExp(Sys.Extended.UI.HtmlEditor.smartClassName, "ig"); + if(reg.test(span.id)) + del.push(span); + } + } + + for(var i = 0; i < del.length; i++) + del[i].parentNode.removeChild(del[i]); + } + + return result; +}; + +Sys.Extended.UI.HtmlEditor.getPseudoP_Recur = function(lPoint, rPoint, r_level) { + var result = []; + + // bound elements + var lBound = lPoint, + rBound = (rPoint.nextSibling != null && rPoint.nextSibling.tagName && rPoint.nextSibling.tagName.toUpperCase() == "BR") ? rPoint.nextSibling : rPoint; + + // find coomon parent of the bound elements + var fnd = null; + + if(lBound == null || rBound == null) { + if(lBound != null) + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(lBound, lBound); + + if(rBound != null) + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(rBound, rBound); + } else + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(lBound, rBound); + + if(fnd != null) { // common parent found + //where are the bound elements? + lBound = Sys.Extended.UI.HtmlEditor.getContainer(fnd.parent.childNodes.item(fnd.indexFirst), lBound); + rBound = Sys.Extended.UI.HtmlEditor.getContainer(fnd.parent.childNodes.item(fnd.indexLast), rBound); + + // move them up + Sys.Extended.UI.HtmlEditor.unStyle(lBound); + Sys.Extended.UI.HtmlEditor.unStyle(rBound); + + while(lBound.parentNode != fnd.parent) + lBound = lBound.parentNode; + while(rBound.parentNode != fnd.parent) + rBound = rBound.parentNode; + + // move up all non inline elements (
    ,
    , ...) + Sys.Extended.UI.HtmlEditor._moveTagsUp(lBound.nextSibling, rBound); + + fnd = null; + + // optimize spans + if(lPoint == null || rPoint == null) { + if(lPoint != null) + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(lPoint, lPoint); + if(rPoint != null) + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(rPoint, rPoint); + } else + fnd = Sys.Extended.UI.HtmlEditor._commonTotalParent(lPoint, rPoint); + + if(fnd != null) + Sys.Extended.UI.HtmlEditor.spanJoiner(fnd.parent, this._doc, fnd.indexFirst, fnd.indexLast + 1, true); + + // prepare output array + function _dive1(next) { + if(!Sys.Extended.UI.HtmlEditor.isInlineElement(next)) { + return true; + } else if(next.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(next.tagName) && (next.tagName.toUpperCase() != "A") && !Sys.Extended.UI.HtmlEditor.isTempElement(next)) { + var nnn = next.firstChild; + + while(nnn != null) { + nnnNext = nnn.nextSibling; + var temp = _dive1(nnn); + + if(temp) + return true; + + nnn = nnnNext; + } + } + + return false; + } + + var arrIndex = 0, + subArr = [], + subIndex = 0; + + if(lBound.tagName && rBound.tagName) { + var lBoundTagName = lBound.tagName.toUpperCase(), + rBoundTagName = rBound.tagName.toUpperCase(); + + if((lBoundTagName == "TD" || lBoundTagName == "TR") && + (rBoundTagName == "TD" || rBoundTagName == "TR") + ) { + while(lBound.tagName.toUpperCase() != "TABLE") + lBound = lBound.parentNode; + + rBound = lBound; + } else { + if((lBoundTagName == "DD" || lBoundTagName == "DT") && + (rBoundTagName == "DD" || rBoundTagName == "DT") + ) { + while(lBound.tagName && lBound.tagName.toUpperCase() != "DL") + lBound = lBound.parentNode; + + rBound = lBound; + } else { + if((lBoundTagName == "LI") && (rBoundTagName == "LI")) { + while(lBoundTagName != "UL" && lBoundTagName != "OL") { + lBound = lBound.parentNode; + lBoundTagName = (lBound.tagName) ? lBound.tagName.toUpperCase() : null; + } + rBound = lBound; + } + } + } + } + + var fromPoint = lPoint ? lPoint : rPoint, + toPoint = rPoint ? rPoint : lPoint, + next = lBound; + + while(true) { + if(!Sys.Extended.UI.HtmlEditor.isTempElement(next)) { + var isBlock = _dive1(next); + + if(!isBlock) { + if(next.nodeType && next.nodeType == 3) { + var str = "" + next.data + ""; + + if(str.length == 0 || /^[\n\r]+$/.test(str)) { + var tempNext = next.nextSibling; + + next.parentNode.removeChild(next); + if(next == rBound) + break; + + next = tempNext; + + continue; + } + } + + subArr[subIndex] = next; + subIndex++; + } else { + if(next.tagName && next.tagName.toUpperCase() == "BR") { + subArr[subIndex] = next; + result[arrIndex] = subArr; + arrIndex++; + + subArr = []; + subIndex = 0; + } else + if((next == rBound || next == lBound) && + !((next == rBound && next == lBound) ? (Sys.Extended.UI.HtmlEditor._reallyFirst(next, fromPoint) && Sys.Extended.UI.HtmlEditor._reallyLast(next, toPoint)) + : (Sys.Extended.UI.HtmlEditor._reallyFirst(next, fromPoint) || Sys.Extended.UI.HtmlEditor._reallyLast(next, toPoint)) + ) + ) { + var nextTagName = (next.tagName) ? (next.tagName.toUpperCase()) : null; + + if(nextTagName == "TABLE" || nextTagName == "TBODY") { + var table = next; + + while(table.tagName.toUpperCase() != "TABLE") + table = table.parentNode; + + var fromCellIndex = 0, + fromRowIndex = 0, + toCellIndex = table.rows.item(table.rows.length - 1).cells.length - 1, + toRowIndex = table.rows.length - 1; + + // find cells with start/end of selection in the Table + for(var i = 0; i < table.rows.length; i++) { + var row = table.rows.item(i), + j = 0; + + for(; j < row.cells.length; j++) { + var cell = row.cells.item(j); + + if(Sys.Extended.UI.HtmlEditor._lookChild(cell, fromPoint) >= 0) { + fromCellIndex = j; + fromRowIndex = i; + } + + if(Sys.Extended.UI.HtmlEditor._lookChild(cell, toPoint) >= 0) { + toCellIndex = j; + toRowIndex = i; + } + } + } + + // collect pseudo paragraps + for(var i = fromRowIndex; i <= toRowIndex; i++) + for(var j = ((i == fromRowIndex) ? fromCellIndex : 0) ; j <= ((i == toRowIndex) ? toCellIndex : (table.rows.item(i).cells.length - 1)) ; j++) { + var cell = table.rows.item(i).cells.item(j); + + if(subIndex > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + + var is_lPoint = (Sys.Extended.UI.HtmlEditor._lookChild(cell, fromPoint) >= 0), + is_rPoint = (Sys.Extended.UI.HtmlEditor._lookChild(cell, toPoint) >= 0); + + if(is_lPoint || is_rPoint) { // need recursion + var r_lPoint = fromPoint, + r_rPoint = toPoint, + rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right_" + r_level, + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left_" + r_level; + + if(is_lPoint) { + r_rPoint = this._doc.createElement("span"); + r_rPoint.id = rn; + cell.appendChild(r_rPoint); + } + + if(is_rPoint) { + r_lPoint = this._doc.createElement("span"); + r_lPoint.id = ln; + + if(cell.firstChild) + cell.insertBefore(r_lPoint, cell.firstChild); + else + cell.appendChild(r_lPoint); + } + + var r_result = this.getPseudoP_Recur(r_lPoint, r_rPoint, r_level + 1); + for(var cnt = 0; cnt < r_result.length; cnt++) { + result[arrIndex] = r_result[cnt]; + arrIndex++; + } + + if(r_lPoint != fromPoint) + r_lPoint.parentNode.removeChild(r_lPoint); + if(r_rPoint != toPoint) + r_rPoint.parentNode.removeChild(r_rPoint); + } else { + var fromEl = 0, + toEl = cell.childNodes.length; + + for(var k = fromEl; k < toEl; k++) { + var el = cell.childNodes.item(k); + + if(!Sys.Extended.UI.HtmlEditor.isTempElement(el)) { + subArr[subIndex] = el; + subIndex++; + } + } + + if(subArr.length > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + } + } + } else if(nextTagName == "UL" || nextTagName == "OL" || nextTagName == "DL") { + var list = next, + fromIndex = 0, + toIndex = list.childNodes.length - 1; + + // find itemss with start/end of selection in the list + for(var i = 0; i < list.childNodes.length; i++) { + var point = list.childNodes.item(i); + + if(point.nodeType == 1) { + if(point == fromPoint || Sys.Extended.UI.HtmlEditor._lookChild(point, fromPoint) >= 0) + fromIndex = i; + + if(point == toPoint || Sys.Extended.UI.HtmlEditor._lookChild(point, toPoint) >= 0) + toIndex = i; + } + } + + // collect pseudo paragraps + for(var i = fromIndex; i <= toIndex; i++) { + var point = list.childNodes.item(i); + + if(subIndex > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + + var is_lPoint = (Sys.Extended.UI.HtmlEditor._lookChild(point, fromPoint) >= 0), + is_rPoint = (Sys.Extended.UI.HtmlEditor._lookChild(point, toPoint) >= 0); + + if(is_lPoint || is_rPoint) { // need recursion + var r_lPoint = fromPoint, + r_rPoint = toPoint, + rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right_" + r_level, + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left_" + r_level; + + if(is_lPoint) { + r_rPoint = this._doc.createElement("span"); + r_rPoint.id = rn; + point.appendChild(r_rPoint); + } + + if(is_rPoint) { + r_lPoint = this._doc.createElement("span"); + r_lPoint.id = ln; + + if(point.firstChild) + point.insertBefore(r_lPoint, point.firstChild); + else + point.appendChild(r_lPoint); + } + + var r_result = this.getPseudoP_Recur(r_lPoint, r_rPoint, r_level + 1); + + for(var cnt = 0; cnt < r_result.length; cnt++) { + result[arrIndex] = r_result[cnt]; + arrIndex++; + } + + if(r_lPoint != fromPoint) + r_lPoint.parentNode.removeChild(r_lPoint); + if(r_rPoint != toPoint) + r_rPoint.parentNode.removeChild(r_rPoint); + } else { + var fromEl = 0, + toEl = point.childNodes.length; + + for(var k = fromEl; k < toEl; k++) { + var el = point.childNodes.item(k); + + if(!Sys.Extended.UI.HtmlEditor.isTempElement(el)) { + subArr[subIndex] = el; + subIndex++; + } + } + + if(subArr.length > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + } + } + } else { + var is_lPoint = (Sys.Extended.UI.HtmlEditor._lookChild(next, fromPoint) >= 0), + is_rPoint = (Sys.Extended.UI.HtmlEditor._lookChild(next, toPoint) >= 0); + + if(subIndex > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + + if(is_lPoint || is_rPoint) { // need recursion + var r_lPoint = fromPoint, + r_rPoint = toPoint, + rn = Sys.Extended.UI.HtmlEditor.smartClassName + "_right_" + r_level, + ln = Sys.Extended.UI.HtmlEditor.smartClassName + "_left_" + r_level; + + if(is_lPoint) { + r_rPoint = this._doc.createElement("span"); + r_rPoint.id = rn; + next.appendChild(r_rPoint); + } + + if(is_rPoint) { + r_lPoint = this._doc.createElement("span"); + r_lPoint.id = ln; + + if(next.firstChild) + next.insertBefore(r_lPoint, next.firstChild); + else + next.appendChild(r_lPoint); + } + + var r_result = this.getPseudoP_Recur(r_lPoint, r_rPoint, r_level + 1); + + for(var cnt = 0; cnt < r_result.length; cnt++) { + result[arrIndex] = r_result[cnt]; + arrIndex++; + } + + if(r_lPoint != fromPoint) + r_lPoint.parentNode.removeChild(r_lPoint); + if(r_rPoint != toPoint) + r_rPoint.parentNode.removeChild(r_rPoint); + } else { + var fromEl = 0, + toEl = next.childNodes.length; + + for(var k = fromEl; k < toEl; k++) { + var el = next.childNodes.item(k); + + if(!Sys.Extended.UI.HtmlEditor.isTempElement(el)) { + subArr[subIndex] = el; + subIndex++; + } + } + + if(subArr.length > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + } + } + } else { + if(subIndex > 0) { + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + + subArr[subIndex] = next; + result[arrIndex] = subArr; + arrIndex++; + subArr = []; + subIndex = 0; + } + } + } + + if(next == rBound) + break; + next = next.nextSibling; + } + + if(subIndex > 0) + result[arrIndex] = subArr; + } + + return result; +}; + +Sys.Extended.UI.HtmlEditor.unWrap = function(element, pars) { + var editor = this; + + if(element.firstChild) { + while(element.firstChild && element.firstChild.nodeType == 3 && ("" + element.firstChild.data + "") == "") + element.removeChild(element.firstChild); + + var inner = []; + while(element.firstChild) { + if(element.firstChild != pars[0] && element.firstChild != pars[1]) + inner.push(element.firstChild); + element.parentNode.insertBefore(element.firstChild, element); + } + + if(inner.length == 0) { + var br = editor._doc.createElement("BR"); + element.parentNode.insertBefore(br, element); + } + + if(Sys.Extended.UI.HtmlEditor.isIE && inner.length == 1 && inner[0].nodeType == 3) { + var str = "" + inner[0].data + ""; + + if(str.length == 1 && str.charCodeAt(0) == 160) { + var br = editor._doc.createElement("BR"); + + inner[0].parentNode.insertBefore(br, inner[0]); + inner[0].parentNode.removeChild(inner[0]); + } + } + + while(element.nextSibling && element.nextSibling.nodeType == 3 && ("" + element.nextSibling.data + "") == "") + element.parentNode.removeChild(element.nextSibling); + + var previousSibling = (element.previousSibling && pars[1] == element.previousSibling) ? pars[1].previousSibling : element.previousSibling; + + if(previousSibling && Sys.Extended.UI.HtmlEditor.isInlineElement(previousSibling)) + if(previousSibling.nodeType == 1 && previousSibling.childNodes.length > 0) + previousSibling = Sys.Extended.UI.HtmlEditor._getReallyLast(previousSibling); + + if(Sys.Extended.UI.HtmlEditor.isInlineElement(previousSibling) && element.nextSibling != null) { + var br = editor._doc.createElement("BR"); + element.parentNode.insertBefore(br, element); + } + } else { + var br = editor._doc.createElement("BR"); + element.parentNode.insertBefore(br, element); + } + + element.parentNode.removeChild(element); +}; + +Sys.Extended.UI.HtmlEditor.tryUnWrap = function(element, pars, force) { + var editor = this; + + element.style.textAlign = ""; + + var attrsNumber = 0, + attrs = element.attributes; + + for(var k = 0; k < attrs.length; ++k) { + var a = attrs.item(k); + + if(!a.specified) + continue; + if(a.name.toLowerCase() == "style") + continue; + + attrsNumber++; + } + + var save_css = element.style.cssText, + margin = 0, + mar, + elementTagName = element.tagName.toUpperCase(); + + if(!(typeof force != "undefined" && force)) + if(elementTagName != "LI") + try { + mar = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "margin-top")); + if(isNaN(mar)) + mar = elementTagName == "P" ? 1 : 0; + margin += mar; + + mar = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "margin-bottom")); + if(isNaN(mar)) + mar = elementTagName == "P" ? 1 : 0; + margin += mar; + + mar = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "margin-right")); + if(isNaN(mar)) + mar = elementTagName == "P" ? 1 : 0; + margin += mar; + + mar = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "margin-left")); + if(isNaN(mar)) + mar = elementTagName == "P" ? 1 : 0; + margin += mar; + } catch(e) { margin = 1; } + + element.style.margin = ""; + + if((attrsNumber == 0 && element.style.cssText.length == 0 && margin == 0) || (typeof force != "undefined" && force && elementTagName != "LI")) { + editor.unWrap(element, pars); + + return true; + } else { + element.style.cssText = save_css; + + return false; + } +}; + +Sys.Extended.UI.HtmlEditor._queryCommandValue = function(cmdID, _id) { + var obj = this._rangeStartEnd(); + if(obj == null) + return ""; + + try { + if(cmdID.toLowerCase() == "backcolor") { + var el = obj.start; + + while(el) { + var bckg = Sys.Extended.UI.HtmlEditor.getStyle(el, "background-color").toLowerCase(); + if(bckg.length > 0 && bckg != "transparent") + return bckg; + + el = el.parentNode; + } + + return "#FFFFFF"; + } + + var cssStyle = "none"; + switch(cmdID.toLowerCase()) { + case "forecolor": + cssStyle = "color"; + break; + case "fontname": + cssStyle = "font-family"; + break; + case "fontsize": + cssStyle = "font-size"; + break; + } + + var ret; + + if((cssStyle == "font-size" || cssStyle == "font-family") && this._FontNotSet) { + ret = ""; + var par = obj.start; + while(par != null) { + if(cssStyle == "font-size") { + if(par.style && par.style.fontSize && par.style.fontSize.length > 0) { + ret = par.style.fontSize; + break; + } else if(par.tagName && par.tagName.toUpperCase() == "FONT" && par.size && par.size.length > 0) { + ret = Sys.Extended.UI.HtmlEditor.fontSizeSeek(par.size); + break; + } + } else { + if(par.style && par.style.fontFamily && par.style.fontFamily.length > 0) { + ret = par.style.fontFamily; + break; + } else if(par.tagName && par.tagName.toUpperCase() == "FONT" && par.face && par.face.length > 0) { + ret = par.face; + break; + } + } + + if(par.className && par.className.length > 0) { + ret = Sys.Extended.UI.HtmlEditor.getStyle(par, cssStyle).toLowerCase(); + if(cssStyle == "font-size") + if(!Sys.Extended.UI.HtmlEditor.isIE) + ret = Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt(ret, this, _id); + + break; + } + + var parTagName = par.tagName.toUpperCase(); + if(parTagName == "BODY" || parTagName == "TD") + break; + + par = par.parentNode; + } + } else { + ret = Sys.Extended.UI.HtmlEditor.getStyle(obj.start, cssStyle).toLowerCase(); + + if(cssStyle == "font-size") { + if(!Sys.Extended.UI.HtmlEditor.isIE) { + ret = Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt(ret, this, _id); + + var par = obj.start; + while(par != null) { + if(par.style && par.style.fontSize && par.style.fontSize.length > 0) { + ret = par.style.fontSize; + break; + } + + if(par.className && par.className.length > 0) + break; + + var parTagName = par.tagName.toUpperCase(); + if(parTagName == "BODY" || parTagName == "TD") + break; + + par = par.parentNode; + } + } + } + } + + if(this._StyleForTyping != null && this._StyleForTyping.length > 0) + for(var i = 0; i < this._StyleForTyping.length; i++) { + var curCss = this._StyleForTyping[i]; + + if(curCss.name == cssStyle) { + ret = curCss.value; + break; + } + } + + return ret; + } catch(ex) { return ""; } +}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js new file mode 100644 index 000000000..abf9147d8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js @@ -0,0 +1,2482 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.Trim = function(value) { + return value.replace(/[\x00-\x1F]+/g, ""); +}; + +Sys.Extended.UI.HtmlEditor.TrimAll = function(value) { + return value.replace(/[\x00-\x1F]/g, "").replace(/^[\x20]+/g, "").replace(/[\x20]+$/g, ""); +}; + +Sys.Extended.UI.HtmlEditor.isIE = (Sys.Browser.agent == Sys.Browser.InternetExplorer); +Sys.Extended.UI.HtmlEditor.isSafari = (Sys.Browser.agent == Sys.Browser.Safari); +Sys.Extended.UI.HtmlEditor.isOpera = (Sys.Browser.agent == Sys.Browser.Opera); + +Sys.Extended.UI.HtmlEditor.tryReplaceRgb = function(value) { + var result = value; + var re = /(rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\))/ig; + + function hex(d) { + return (d < 16) ? ("0" + d.toString(16)) : d.toString(16); + }; + + function repl($0, $1, $2, $3, $4) { + var r = parseInt($2); + var g = parseInt($3); + var b = parseInt($4); + + return "#" + hex(r) + hex(g) + hex(b); + } + + try { // some versions of Safari don't support such replace + result = result.replace(re, repl); + } catch(e) { } + + return result; +} + +Sys.Extended.UI.HtmlEditor._getScrollTop = function(win) { + var doc = win.document; + var scrollTop = 0; + + if(typeof (win.pageYOffset) == 'number') + scrollTop = win.pageYOffset; + + if(doc.body && doc.body.scrollTop) + scrollTop = doc.body.scrollTop; + else if(doc.documentElement && doc.documentElement.scrollTop) + scrollTop = doc.documentElement.scrollTop; + + return scrollTop; +} + +Sys.Extended.UI.HtmlEditor._getScrollLeft = function(win) { + var doc = win.document; + var scrollLeft = 0; + + if(typeof (win.pageXOffset) == 'number') + scrollLeft = win.pageXOffset; + else if(doc.body && doc.body.scrollLeft) + scrollLeft = doc.body.scrollLeft; + else if(doc.documentElement && doc.documentElement.scrollLeft) + scrollLeft = doc.documentElement.scrollLeft; + + return scrollLeft; +} + +Sys.Extended.UI.HtmlEditor.addFormOnSubmit = function(handler, editPanel) { + var form = window.theForm; + + if(window.theForm != null && typeof window.theForm != "undefined") { + if(form.HtmlEditor_editPanels == null || typeof form.HtmlEditor_editPanels == "undefined") { + form.originalOnSubmit_HtmlEditor = window.theForm.onsubmit; + form.HtmlEditor_editPanels = []; + window.theForm.onsubmit = Sys.Extended.UI.HtmlEditor.EditPanelsOnSubmit; + + if(window.__doPostBack != null && typeof window.__doPostBack != "undefined") + if(window.__doPostBack_HtmlEditor_original == null || typeof window.__doPostBack_HtmlEditor_original == "undefined") { + window.__doPostBack_HtmlEditor_original = window.__doPostBack; + window.__doPostBack = Sys.Extended.UI.HtmlEditor.EditPanelsOnPostBack; + } + + if(window.ValidatorGetValue != null && typeof window.ValidatorGetValue != "undefined") + if(window.ValidatorGetValue_HtmlEditor_original == null || typeof window.ValidatorGetValue_HtmlEditor_original == "undefined") { + window.ValidatorGetValue_HtmlEditor_original = window.ValidatorGetValue; + window.ValidatorGetValue = Sys.Extended.UI.HtmlEditor.ValidatorGetValue; + } + } + + form.HtmlEditor_editPanels.push({ handler: handler, editPanel: editPanel }); + } +} + +Sys.Extended.UI.HtmlEditor.removeFormOnSubmit = function(handler) { + var form = window.theForm; + + if(window.theForm != null && typeof window.theForm != "undefined") { + var original = form.originalOnSubmit_HtmlEditor; + + if(form.HtmlEditor_editPanels != null && typeof form.HtmlEditor_editPanels != "undefined") { + var newArr = []; + + for(var i = 0; i < form.HtmlEditor_editPanels.length; i++) { + var cur = form.HtmlEditor_editPanels[i]; + + if(cur.handler != handler) + newArr.push(cur); + } + + form.HtmlEditor_editPanels = newArr; + if(form.HtmlEditor_editPanels.length == 0) { + window.theForm.onsubmit = original; + form.originalOnSubmit_HtmlEditor = null; + form.HtmlEditor_editPanels = null; + + if(window.__doPostBack_HtmlEditor_original != null && typeof window.__doPostBack_HtmlEditor_original != "undefined") { + window.__doPostBack = window.__doPostBack_HtmlEditor_original; + window.__doPostBack_HtmlEditor_original = null; + } + + if(window.ValidatorGetValue_HtmlEditor_original != null && typeof window.ValidatorGetValue_HtmlEditor_original != "undefined") { + window.ValidatorGetValue = window.ValidatorGetValue_HtmlEditor_original; + window.ValidatorGetValue_HtmlEditor_original = null; + } + } + } + } +} + +Sys.Extended.UI.HtmlEditor.EditPanelsOnSubmit = function(e) { + var form = window.theForm, + ret = true; + + for(var i = 0; i < form.HtmlEditor_editPanels.length; i++) { + var ret = form.HtmlEditor_editPanels[i].handler(e); + if(!ret) + break; + } + + if(ret && form.originalOnSubmit_HtmlEditor != null && typeof form.originalOnSubmit_HtmlEditor != "undefined") + ret = form.originalOnSubmit_HtmlEditor(e); + + if(!ret || !window.Page_IsValid) + for(var i = 0; i < form.HtmlEditor_editPanels.length; i++) + form.HtmlEditor_editPanels[i].editPanel._contentPrepared = false; + + return ret; +} + +Sys.Extended.UI.HtmlEditor.ValidatorGetValue = function(id) { + var component = $find(id); + + if(component != null) { + var editPanel = null; + + if(Sys.Extended.UI.HtmlEditor.Editor.isInstanceOfType(component)) + editPanel = component.get_editPanel(); + else if(Sys.Extended.UI.HtmlEditor.EditPanel.isInstanceOfType(component)) + editPanel = component; + + if(editPanel != null) { + var content = editPanel._contentForValidation; + + if(content == null || typeof content == "undefined") + content = editPanel.get_content(); + + return content; + } + } + + return window.ValidatorGetValue_HtmlEditor_original(id); +} + +Sys.Extended.UI.HtmlEditor.EditPanelsOnPostBack = function(eventTarget, eventArgument) { + var form = window.theForm; + + for(var i = 0; i < form.HtmlEditor_editPanels.length; i++) { + var ret = form.HtmlEditor_editPanels[i].handler(null); + if(!ret) + return false; + } + + if(window.__doPostBack_HtmlEditor_original != null && typeof window.__doPostBack_HtmlEditor_original != "undefined") + return window.__doPostBack_HtmlEditor_original(eventTarget, eventArgument); + + return true; +} + +Sys.Extended.UI.HtmlEditor.getRealAttributeIE = function(element, name, source) { + var value = source, + n_value = ""; + + function tempFunc(p0, p1) { + n_value = p1; + } + + element.outerHTML.replace(new RegExp("^(?:<[^>]*?" + name + "=\")([^\"]*?)\"", "ig"), tempFunc); + if(n_value == "") + element.outerHTML.replace(new RegExp("^(?:<[^>]*?" + name + "=')([^']*?)'", "ig"), tempFunc); + + if(n_value == "") + element.outerHTML.replace(new RegExp("^(?:<[^>]*?" + name + "=)([^\s>]*?)", "ig"), tempFunc); + + if(value != n_value && n_value != "") { + value = n_value; + value = value.replace(/&/g, "&"); + } + + return value; +} + +Sys.Extended.UI.HtmlEditor.getRealAttribute = function(element, name) { + var searchName = name.toLowerCase(), + attrs = element.attributes, + value = ""; + + for(i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + + if(!a.specified) + continue; + + var name = a.name.toLowerCase(); + if(name == searchName) { + value = a.value; + + if(Sys.Extended.UI.HtmlEditor.isIE) + value = Sys.Extended.UI.HtmlEditor.getRealAttributeIE(element, name, value); + + if(name == "src" || name == "href") + value = value.replace(/(\(S\([A-Za-z0-9_]+\)\)\/)/, ""); + + break; + } + } + + return value; +} + +Sys.Extended.UI.HtmlEditor.enabledWordTags = [ + "img", + "strong", + "p", + "b", + "i", + "u", + "a", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "table", + "tbody", + "tr", + "td", + "ul", + "ol", + "li", + "span", + "div", + "font", + "xml", + "del", + "ins", + "em", + "sub", + "sup", + "hr", + "br" +]; + +Sys.Extended.UI.HtmlEditor.cleanUp = function(html) { + var old_ret; + + var ret = Sys.Extended.UI.HtmlEditor.Trim(html.replace(/[\x00-\x1F]+/g, " ")) + .replace(/^[^\u0000]+?]*?)>/gi, "").replace(/<\/html(?:[^>]*?)>[^\u0000]*$/gi, "") + .replace(/]*?)>[^\u0000]*?<\/head(?:[^>]*?)>/gi, "") + .replace(/]*?>([^\u0000]*?)<\/body(?:[^>]*?)>/gi, "$1") + .replace(/<\/?html(?:[^>]*?)>/gi, "") + .replace(/<\/?head(?:[^>]*?)>/gi, "") + .replace(/<\/?body(?:[^>]*?)>/gi, "") + .replace(//ig, "") // remove comments + .replace(/(<[\/]?)(?:o|v|x|p|w|\?xml):(\w+)([^>]*?>)/ig, "$1$2$3") // remove prefixes + .replace(/<(IMAGEDATA)([^>]*?)>/ig, "") // replace ImageData + .replace(/]*>

     <\/p><\/p>/ig, "
    ") // remove empty P + .replace(/]*?\/>/ig, "").replace(/<(p|div)[^>]*?> <\/(\1)[^>]*?>/ig, "").replace(/<(p|div)[^>]*?><\/(\1)[^>]*?>/ig, ""); + + // remove some attributes + do { + old_ret = ret; + ret = ret.replace(/<([^>]*)(?:class|size|lang|face|start|type|border|[ovwxp]:\w+)=(?:\'[^\']*\'|\"[^\"]*\"|[^> ]+)([^>]*)>/ig, "<$1$2>"); + } while(ret != old_ret) + + // remain enabled tags only + + var div = document.createElement("div"); + + div.innerHTML = ret; + + function diver(elem) { + var n = elem.childNodes.length; + + for(var i = 0; i < elem.childNodes.length; i++) { + var child = elem.childNodes.item(i); + + if(child.nodeType == 1) { + if(child.tagName.indexOf("/") >= 0) { + i--; + child.parentNode.removeChild(child); + } else { + var search = child.tagName.toLowerCase(), + found = false, + nn = Sys.Extended.UI.HtmlEditor.enabledWordTags.length; + + for(var j = 0; j < nn; j++) + if(Sys.Extended.UI.HtmlEditor.enabledWordTags[j] == search) { + found = true; + break; + } + + diver(child); + if(!found) { + i += child.childNodes.length; + while(child.firstChild) + child.parentNode.insertBefore(child.firstChild, child); + + child.parentNode.removeChild(child); + i--; + } else { + var s_background_color = child.style.backgroundColor, + s_color = child.style.color; + + child.style.cssText = ""; + child.removeAttribute("style"); + + if(child.getAttribute("width") && child.getAttribute("width").length > 0) + child.style.width = child.getAttribute("width"); + if(child.width && child.width.length > 0) + child.style.width = child.width; + + child.width = ""; + try { + child.removeAttribute("width"); + } catch(e) { } + + if(child.getAttribute("height") && child.getAttribute("height").length > 0) + child.style.height = child.getAttribute("height"); + if(child.height && child.height.length > 0) + child.style.height = child.height; + + child.height = ""; + try { + child.removeAttribute("height"); + } catch(e) { } + + if(search == "table") { + child.style.borderLeftWidth = "1px"; + child.style.borderLeftColor = "black"; + child.style.borderLeftStyle = "solid"; + child.style.borderTopWidth = "1px"; + child.style.borderTopColor = "black"; + child.style.borderTopStyle = "solid"; + + child.style.backgroundColor = s_background_color; + child.style.color = s_color; + } + + if(search == "td") { + child.style.borderRightWidth = "1px"; + child.style.borderRightColor = "black"; + child.style.borderRightStyle = "solid"; + child.style.borderBottomWidth = "1px"; + child.style.borderBottomColor = "black"; + child.style.borderBottomStyle = "solid"; + + child.style.backgroundColor = s_background_color; + child.style.color = s_color; + } + + if(search == "font" || search == "span") { + child.style.backgroundColor = s_background_color; + child.style.color = s_color; + + var attrs = child.attributes, + n = 0; + + for(var m = 0; m < attrs.length; ++m) { + var a = attrs.item(m); + if(!a.specified) + continue; + n++; + } + + if(n == 0 && child.style.cssText == "") { + i += child.childNodes.length; + while(child.firstChild) + child.parentNode.insertBefore(child.firstChild, child); + + child.parentNode.removeChild(child); + i--; + } + } + } + } + } + } + } + + diver(div); + ret = Sys.Extended.UI.HtmlEditor.Trim(div.innerHTML); + delete div; + + ret = ret.replace(/<[\/]?(xml|del|ins)[^>]*?>/ig, "") // remove some tags (content should be remained) + .replace(/<(p|div)[^>]*?>/ig, "") // remove P, DIV tags (content should be remained)
    is added + .replace(/<\/(p|div)[^>]*?>/ig, "
    "); + + // remove empty style tags + do { + old_ret = ret; + ret = ret.replace(/<\/b>/ig, "").replace(/<\/i>/ig, "").replace(/<\/u>/ig, "").replace(/<\/strong>/ig, "").replace(/<\/em>/ig, "").replace(/<\/sub>/ig, "").replace(/<\/sup>/ig, ""); + ret = ret.replace(/]*?><\/span>/ig, "").replace(/([^<]+?)<\/span>/ig, "$1"); + ret = ret.replace(/]*?><\/font>/ig, "").replace(/([^<]+?)<\/font>/ig, "$1"); + } while(ret != old_ret) + + // replace all Microsoft special characters + ret = ret.replace(/’/g, "'") + .replace(/‘/g, "'") + .replace(/–/g, "-") + .replace(/—/g, "-") + .replace(/…/g, "...") + .replace(/"/g, "\"") + .replace(/“/g, "\"") + .replace(/”/g, "\"") + .replace(//g, "") + .replace(/•/g, "") + .replace(/[ \s]+/g, " ").replace(/(( )+)/g, " "); // remove extra spaces + + if(document.all) + ret = ret.replace(/^[\x00-\x1F]* /, ""); + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.spanJoiner = function(element, doc, sFrom, sTo, nobr) { + var sIndex = 0, + sLength = element.childNodes.length; + + if(typeof sFrom != "undefined" && sFrom != null) + sIndex = sFrom; + if(typeof sTo != "undefined" && sTo != null) + sLength = sTo; + + for(var i = sIndex; i < sLength && i < element.childNodes.length; i++) { + var child = element.childNodes.item(i) + if(child.parentNode != element) + continue; + + switch(child.nodeType) { + case 1: // Node.ELEMENT_NODE + if(child.childNodes.length == 0 && Sys.Extended.UI.HtmlEditor.isStyleTag(child.tagName) && child.tagName.toUpperCase() != "A" && !(child.className.length > 0 || (child.getAttribute("class") && child.getAttribute("class").length > 0)) && !Sys.Extended.UI.HtmlEditor.isTempElement(child)) { + element.removeChild(child); + i--; + sLength--; + continue; + } + + if(child.tagName.toUpperCase() == "SPAN") { + while(child.childNodes.length == 1 && child.firstChild.nodeType == 1) { + if(child.firstChild.tagName.toUpperCase() == "SPAN" && !Sys.Extended.UI.HtmlEditor.isTempElement(child.firstChild)) { + var attrs = Sys.Extended.UI.HtmlEditor.differAttr(child.firstChild, []), + styles = Sys.Extended.UI.HtmlEditor.differStyle(child.firstChild), + oldSpan = child.firstChild, + chieldren = oldSpan.childNodes; + + while(oldSpan.firstChild != null) + child.insertBefore(oldSpan.firstChild, oldSpan); + + for(var j = 0; j < styles.length; j++) { + if(styles[j][1]) { + try { + if(child.style[styles[j][0]]) { + if(styles[j][0].toLowerCase().indexOf("color") >= 0) { + child.style[styles[j][0]] = styles[j][1]; + } else { + try { + var sv = child.style[styles[j][0]]; + + child.style[styles[j][0]] = child.style[styles[j][0]] + " " + styles[j][1]; + + if(sv == child.style[styles[j][0]]) + child.style[styles[j][0]] = styles[j][1]; + } catch(e) { + child.style[styles[j][0]] = styles[j][1]; + } + } + } else { + child.style[styles[j][0]] = styles[j][1]; + } + } catch(ee) { } + } + } + + for(var j = 0; j < attrs.length; j++) + if(attrs[j][1]) + child.setAttribute(attrs[j][0], attrs[j][1]); + + child.removeChild(oldSpan); + continue; + } else { + if(child.firstChild.tagName.toUpperCase() == "SPAN" && Sys.Extended.UI.HtmlEditor.isTempElement(child.firstChild)) { + var svv = child.firstChild; + + child.parentNode.insertBefore(child.firstChild, child); + child.parentNode.removeChild(child); + child = svv; + } + } + + break; + } + + var tempArr = [], + nextChild = child.nextSibling; + + while(!Sys.Extended.UI.HtmlEditor.isTempElement(child) && nextChild && i + 1 < sLength && (nextChild.nodeType == 3 || (nextChild.nodeType == 1 && + (nextChild.tagName.toUpperCase() == "SPAN" || (nextChild.tagName.toUpperCase() == "BR") && typeof nobr == "undefined") && + !Sys.Extended.UI.HtmlEditor.isTempElement(nextChild)))) { + if(nextChild.nodeType == 3) { + if(("" + nextChild.data + "").length == 0) { + nextChild.parentNode.removeChild(nextChild); + nextChild = child.nextSibling; + sLength--; + } else { + break; + } + } else { + if(nextChild.tagName.toUpperCase() == "BR") { + tempArr.push(nextChild); + nextChild = nextChild.nextSibling; + } else { + var attrs = Sys.Extended.UI.HtmlEditor.differAttr(child, [], nextChild), + styles = Sys.Extended.UI.HtmlEditor.differStyle(child, nextChild); + + if(attrs.length == 0 && styles.length == 0 && child.className == nextChild.className) { + var n = tempArr.length; + + for(var j = 0; j < n; j++) { + child.appendChild(tempArr[j]); + sLength--; + } + tempArr = []; + + while(nextChild.firstChild) + child.appendChild(nextChild.firstChild); + + nextChild.parentNode.removeChild(nextChild); + nextChild = child.nextSibling; + sLength--; + } else { + break; + } + } + } + } + + if(!Sys.Extended.UI.HtmlEditor.isTempElement(child) && child.className.length == 0) { + var attrs = Sys.Extended.UI.HtmlEditor.differAttr(child, []), + styles = Sys.Extended.UI.HtmlEditor.differStyle(child); + + if(attrs.length == 0 && styles.length == 0) { + i--; + sLength--; + + while(child.firstChild) { + child.parentNode.insertBefore(child.firstChild, child); + sLength++; + } + child.parentNode.removeChild(child); + + continue; + } + } + } + + if(child.parentNode != null) { + if(child.childNodes.length == 0 && Sys.Extended.UI.HtmlEditor.isStyleTag(child.tagName) && child.tagName.toUpperCase() != "A" && !(child.className.length > 0 || (child.getAttribute("class") && child.getAttribute("class").length > 0)) && !Sys.Extended.UI.HtmlEditor.isTempElement(child)) { + element.removeChild(child); + i--; + sLength--; + + continue; + } else { + Sys.Extended.UI.HtmlEditor.spanJoiner(child, doc); + } + } + break; + } + } +}; + +Sys.Extended.UI.HtmlEditor._styleTags = [ + "strong", + "em", + "u", + "strike", + "s", + "span", + "font", + "b", + "sub", + "sup", + "a", + "i" +]; + +Sys.Extended.UI.HtmlEditor.isStyleTag = function(tag) { + if(!tag) + return false; + + for(var i = 0; i < Sys.Extended.UI.HtmlEditor._styleTags.length; i++) + if(Sys.Extended.UI.HtmlEditor._styleTags[i].toLowerCase() == tag.toLowerCase()) + return true; + + return false; +}; + +Sys.Extended.UI.HtmlEditor.smartClassName = "MSIEparagraph"; +Sys.Extended.UI.HtmlEditor.noContextMenuAttribute = "obout-no-contextmenu"; + +Sys.Extended.UI.HtmlEditor.isTempElement = function(el) { + if(el.id && el.id.length > 0 && el.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName) >= 0) + return true; + + return false; +}; + +Sys.Extended.UI.HtmlEditor.differAttr = function(element, pr, comp) { + var result = [], + parent = element.parentNode; + + if(typeof comp != "undefined") + parent = comp; + + if(!parent || !parent.tagName || !Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName)) + parent = null; + + if(element.attributes) + for(var i = 0; i < element.attributes.length; i++) { + var attr = element.attributes[i], + brk = false; + + for(var j = 0; j < pr.length; j++) + if(attr.name.toUpperCase() == pr[j].toUpperCase()) { + brk = true; + break; + } + + if(brk) + continue; + + if(attr.name.toUpperCase() == "STYLE") + continue; + if(attr.name.toUpperCase().substr(0, 4) == "_MOZ") + continue; + + if(attr.specified) + if(parent && parent.attributes && parent.attributes[attr.name]) { + var pattr = parent.attributes[attr.name]; + + if(pattr) + if(attr.name != pattr.name || attr.value != pattr.value) + result.push([attr.name, attr.value]); + } else { + if(attr.name.toUpperCase() == "CLASS" && attr.value == "") + continue; + + result.push([attr.name, attr.value]); + } + } + + return result; +}; + +Sys.Extended.UI.HtmlEditor.differStyle = function(element, comp) { + var result = [], + parent = element.parentNode; + + if(typeof comp != "undefined") + parent = comp; + + if(!parent || !parent.tagName || !Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName)) + parent = null; + + function _putStyle(i, _style) { + _style = "" + _style; + + if(i.toLowerCase() == "textdecoration") { + var _arr = _style.split(" "); + + for(var j = 0; j < _arr.length; j++) + result.push([i, Sys.Extended.UI.HtmlEditor.Trim(_arr[j])]); + } else { + result.push([i, _style]); + } + } + + for(var i in element.style) { + if(i && typeof i == "string" && i != "accelerator") { + var ii = i; + + if(!isNaN(parseInt(i))) { + if(!Sys.Extended.UI.HtmlEditor.isSafari) + continue; + + ii = element.style[i]; + } + + var style = element.style[ii]; + + if(style && typeof style == "string" && style != "accelerator") { + if(parent && parent.style) { + var pstyle = parent.style[ii]; + + if(ii.toLowerCase() != "csstext" && ii.toLowerCase() != "length") + if(style != pstyle) + _putStyle(ii, style); + } else { + if(ii.toLowerCase() != "csstext" && ii.toLowerCase() != "length") + _putStyle(ii, style); + } + } + } + } + + if(typeof comp != "undefined") + for(var i in parent.style) { + if(i && typeof i == "string" && i != "accelerator") { + var ii = i; + + if(!isNaN(parseInt(i))) { + if(!Sys.Extended.UI.HtmlEditor.isSafari) + continue; + + ii = element.style[i]; + } + + var style = parent.style[ii]; + if(style && typeof style == "string" && style != "accelerator") { + var pstyle = element.style[ii]; + + if(i.toLowerCase() != "csstext" && ii.toLowerCase() != "length") + if(style != pstyle) + _putStyle(ii, style); + } + } + } + + return result; +}; + +Sys.Extended.UI.HtmlEditor.brXHTML = function(str) { + return str.replace(/
    /ig, "
    "); +}; + +Sys.Extended.UI.HtmlEditor._needsClosingTag = function(el) { + var closingTags = " script style div span a del strong em u strike font b sub sup p iframe li ul ol placeholder textarea td tr "; + + return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); +}; + +Sys.Extended.UI.HtmlEditor._encodeText_ = function(str) { + return str.replace(/&/ig, "&").replace(//ig, ">").replace(/\"/ig, """).replace(/\xA0/ig, " "); +}; + +Sys.Extended.UI.HtmlEditor._noNeedsClosingTag = function(el) { + var closingTags = " hr br "; + + return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); +}; + +Sys.Extended.UI.HtmlEditor.canBeInsideP = function(el, prize) { + if(el && el.style && el.style.display && el.style.display.toLowerCase() == "inline") + return true; + + var name = el.tagName.toUpperCase(); + + if(name.length == 2) + if(name.substr(0, 1) == "H" && parseInt(name.substr(1, 1)) > 0) + return false; + + switch(name) { + case "TBODY": + case "TR": + case "TD": + if(typeof prize != "undefined") { + var par = el.parentNode; + while(par && par.tagName && par.tagName.toUpperCase() != "TABLE") + par = par.parentNode; + + if(par.tagName.toUpperCase() == "TABLE" && par.style && par.style.display && par.style.display.toLowerCase() == "inline") + return true; + } + case "P": + case "PRE": + case "TABLE": + case "OL": + case "UL": + case "LI": + case "HR": + case "DIV": + case "BLOCKQUOTE": + case "FORM": + case "FIELDSET": + case "LEGEND": + return false; + default: + return true; + } +}; + +Sys.Extended.UI.HtmlEditor.convertAlign = function(aval) { + var value, n; + + try { + n = parseInt(aval) - 1; + } catch(e) { + return aval; + } + + switch(n) { + case 1: + value = "left"; + break; + case 2: + value = "right"; + break; + case 3: + value = "texttop"; + break; + case 4: + value = "absmiddle"; + break; + case 5: + value = "baseline"; + break; + case 6: + value = "absbottom"; + break; + case 7: + value = "bottom"; + break; + case 8: + value = "middle"; + break; + case 9: + value = "top"; + break; + default: + value = aval.replace(/\"/g, """); + } + + return value; +}; + +Sys.Extended.UI.HtmlEditor.getHTML = function(root, outputRoot, must) { + try { + if(typeof must == "undefined") + if(!outputRoot && root.nodeType == 1) { + return root.innerHTML; + } else { + if(outputRoot && root.nodeType == 1 && Sys.Extended.UI.HtmlEditor.isIE) + return root.outerHTML; + } + } catch(e) { } + + var html = new Sys.Extended.UI.HtmlEditor.jsDocument(true); + Sys.Extended.UI.HtmlEditor._getHTML_(html, root, outputRoot); + + return html.toString(); +}; + +Sys.Extended.UI.HtmlEditor._getHTML_ = function(html, root, outputRoot, must) { + switch(root.nodeType) { + case 1: // Node.ELEMENT_NODE + case 11: // Node.DOCUMENT_FRAGMENT_NODE + if(root.tagName && root.tagName.indexOf("/") >= 0) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + var tag = root.tagName.toLowerCase().substr(root.tagName.indexOf("/") + 1), + prev = root.previousSibling; + + if(tag == "embed") + return; + + while(prev != null) { + if(prev.nodeType == root.nodeType && prev.tagName && prev.tagName.toLowerCase() == tag) { + html.append(""); + + return; + } + + prev = prev.previousSibling; + } + } + + return; + } + + var closed, noSlash, i; + if(outputRoot && root.tagName.length > 0) { + var tag = root.tagName.toLowerCase(); + + closed = (!(root.hasChildNodes() || Sys.Extended.UI.HtmlEditor._needsClosingTag(root))); + noSlash = true; + + var scope = ""; + if(Sys.Extended.UI.HtmlEditor.isIE && root.scopeName && typeof root.scopeName != "undefined") + scope = (root.scopeName.toUpperCase() == "HTML") ? "" : (root.scopeName + ":"); + + if(Sys.Extended.UI.HtmlEditor.isIE && (closed || tag == "placeholder") && !Sys.Extended.UI.HtmlEditor._noNeedsClosingTag(root) && tag != "embed") { + var next = root.nextSibling; + + while(next != null) { + if(next.nodeType == root.nodeType && next.tagName) { + var nextTagName = next.tagName; + + if(nextTagName.indexOf("/") >= 0) + if(nextTagName.toLowerCase().substr(nextTagName.indexOf("/") + 1) == tag) { + closed = false; + noSlash = false; + + break; + } + } + + next = next.nextSibling; + } + } + + if(!Sys.Extended.UI.HtmlEditor.canBeInsideP(root)) + html.append("\n"); + + html.append("<" + ((!closed && !noSlash) ? "teo" + Sys.Extended.UI.HtmlEditor.smartClassName + ":" : scope) + tag); + + if(Sys.Extended.UI.HtmlEditor.isIE && root.name && root.name.length > 0) + html.append(" name=\"" + root.name.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.value && root.value.length > 0 && tag != "textarea") + html.append(" value=\"" + root.value.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.className && root.className.length > 0) + html.append(" class=\"" + root.className.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.align && root.align.length > 0) + html.append(" align=\"" + root.align.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.color && root.color.length > 0) + html.append(" color=\"" + root.color.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.size && root.size.length > 0 && root.size != "+0") + html.append(" size=\"" + root.size.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.shape && root.shape.length > 0) + html.write(" shape" + '="' + root.shape.replace(/\"/g, """) + '"'); + if(Sys.Extended.UI.HtmlEditor.isIE && root.coords && root.coords.length > 0) + html.write(" coords" + '="' + root.coords.replace(/\"/g, """) + '"'); + + var attrs = root.attributes, + cssForSafari = null; + + for(i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + if(!a.specified) + continue; + + var name = a.name.toLowerCase(); + if(name.substr(0, 4) == "_moz") + // Mozilla reports some special attributes + // here we don't need them. + continue; + + if(name == "teoalign") + continue; + + var value; + if(name != 'style') { + if(name == 'width') { + value = root.width; + if(Sys.Extended.UI.HtmlEditor.isIE && value == 0) { + var n_value = 0; + + root.outerHTML.replace(new RegExp("^(?:<[^>]*?width=)([\\d]+)", "ig"), function(p0, p1) { n_value = p1; }); + + if(value != n_value) + value = n_value; + } + } else + if(name == 'height') { + value = root.height; + + if(Sys.Extended.UI.HtmlEditor.isIE && value == 0) { + var n_value = 0; + + root.outerHTML.replace(new RegExp("^(?:<[^>]*?height=)([\\d]+)", "ig"), function(p0, p1) { n_value = p1; }); + + if(value != n_value) + value = n_value; + } + } else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'name' && root.name && root.name.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'value' && root.value && root.value.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'align' && root.align && root.align.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'class' && root.className && root.className.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'color' && root.color && root.color.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'size' && root.size && root.size.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'shape' && root.shape && root.shape.length > 0) + continue; + else + if(Sys.Extended.UI.HtmlEditor.isIE && name == 'coords' && root.coords && root.coords.length > 0) + continue; + else { + if(tag == "embed" && name == "align" && (Sys.Extended.UI.HtmlEditor.isIE)) { + value = Sys.Extended.UI.HtmlEditor.convertAlign(a.value); + } else { + value = a.value; + + if(Sys.Extended.UI.HtmlEditor.isSafari && name == "class") + if(/apple-style/ig.test(value)) + continue; + + if(name == "src" || name == "href") { + if(Sys.Extended.UI.HtmlEditor.isIE) + value = Sys.Extended.UI.HtmlEditor.getRealAttributeIE(root, name, value); + + value = value.replace(/(\(S\([A-Za-z0-9_]+\)\)\/)/, ""); + } + value = value.replace(/\"/g, """); + } + } + } else { + if(Sys.Extended.UI.HtmlEditor.isSafari) + cssForSafari = a.value; + + continue; + } + + var qchar = "\""; + if(("" + value + "").indexOf("\"") >= 0) + qchar = "'"; + + if(name != null) + html.append(" " + name + '=' + qchar + value + qchar); + } + + if(root.style.cssText.length > 0 || cssForSafari != null) { + var name = "style", + re1 = /(url\((?:[^\)]*)\))/ig, + urls = []; + + function f2($0, $1) { + urls.push($1); + } + + var value = ((cssForSafari != null) ? cssForSafari : root.style.cssText).toLowerCase(); + value.replace(re1, f2); + var times = 0; + + function f3() { + var temp = urls[times]; + times++; + + return temp; + } + + value = Sys.Extended.UI.HtmlEditor.tryReplaceRgb(value.replace(re1, f3)).replace(/(font-weight\s*:\s*)(700)/ig, "$1bold") + .replace(/([\s]*-moz-[^;]*[;][\s]*)/ig, "").replace(/(-moz-.*)$/i, "") + .replace(/(background-position: 0% 0%[;]*[\s]*)/ig, ""); + + if(Sys.Extended.UI.HtmlEditor.isSafari) { + function repSaf($0, $1, $2, $3) { + return $1 + $2.replace(/(,)/g, "") + $3; + } + + value = value.replace(/(text-decoration:)([^;$]+)([;$])/ig, repSaf); + } + + if(Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera) { + function repSafOp($0, $1, $2, $3) { + return $1 + $2.replace(/(['"])/g, "") + $3; + } + value = value.replace(/(font-family:)([^;]+)([;]*)/ig, repSafOp); + } + + if(value.length > 0) { + var qchar = "\""; + if(("" + value + "").indexOf("\"") >= 0) + qchar = "'"; + + html.append(" " + name + '=' + qchar + value + qchar); + } + } + + html.append(closed ? " />" : ">"); + + if(tag == "br") + html.append("\n"); + } + + if(root.tagName && root.tagName.toUpperCase() == "SCRIPT") + html.append(root.text); + + if(root.tagName && root.tagName.toUpperCase() == "STYLE") { + html.append(root.innerHTML); + } else { + for(i = root.firstChild; i; i = i.nextSibling) + Sys.Extended.UI.HtmlEditor._getHTML_(html, i, true) + } + + if(outputRoot && root.tagName.length > 0 && !closed && noSlash) + html.append(""); + + break; + case 3: // Node.TEXT_NODE + html.append(Sys.Extended.UI.HtmlEditor._encodeText_("" + root.data + "")); + break; + case 8: // Node.COMMENT_NODE + if(root.length > 0) + html.append(""); + else // IE bug tricking (negative lengths happen there) + html.append(""); + + break; + } +}; + +Sys.Extended.UI.HtmlEditor.RemoveContextMenu = function() { + var editor = this; + var hhh = editor._contextElement.parentNode.removeChild(editor._contextElement); + + if(hhh) + delete hhh; + + editor._contextElement = null; + editor._contextTable = null; + + if(editor.__saved_range__) { + editor.__saved_range__.select(); + editor.__saved_range__ = null; + } +}; + +Sys.Extended.UI.HtmlEditor.contentEditable = function(el, prize) { + while(el != null) { + try { + var mean = null; + + if(el.contentEditable != null && typeof el.contentEditable != "undefined" && !(Sys.Extended.UI.HtmlEditor.isSafari || Sys.Extended.UI.HtmlEditor.isOpera)) { + if(!el.contentEditable || el.contentEditable == "false") + mean = false; + else + mean = true; + } else { + var value = el.getAttribute("contenteditable"); + + if(typeof value == "boolean") { + mean = value; + } else { + if(typeof value == "string" && value.toLowerCase() == "false") + mean = false; + } + } + + if(mean != null && typeof mean == "boolean") + if(!mean) + return el; + } catch(ex) { } + + if(typeof prize != "undefined" && prize) + return null; + + if(el.tagName != null && typeof el.tagName != "undefined" && (el.tagName.toUpperCase() == "BODY" || el.tagName.toUpperCase() == "HTML")) + break; + + el = el.parentNode; + } + + return null; +}; + +Sys.Extended.UI.HtmlEditor.getSelParent = function(editor) { + var sel = editor._getSelection(), + range = editor._createRange(sel), + parent = null; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + if(sel.type.toLowerCase() == "control") + parent = range.item(0); + else + parent = editor._getParent(range); + } else { + parent = editor._getParent(range); + + if(parent.nodeType != 3 && range.startContainer == range.endContainer) { + var p = parent; + parent = parent.childNodes.item(range.startOffset); + if(parent == null) + parent = p; + } + } + + return parent; +}; + +Sys.Extended.UI.HtmlEditor.__getIndex = function(el) { + var ind = 0; + + if(el.parentNode) + for(; ind < el.parentNode.childNodes.length; ind++) + if(el.parentNode.childNodes.item(ind) == el) + break; + + return ind; +}; + +Sys.Extended.UI.HtmlEditor.isInlineElement = function(el) { + if(el.nodeType == 3) + return true; + if(el.nodeType != 1) + return false; + if(!el.tagName || el.tagName.length == 0) + return false; + if(el && el.style && el.style.display && el.style.display.toLowerCase() == "inline") + return true; + + var name = el.tagName.toUpperCase(); + + if(name.length == 2) + if(name.substr(0, 1) == "H" && parseInt(name.substr(1, 1)) > 0) + return false; + + switch(name) { + case "BR": + case "TBODY": + case "TR": + case "TD": + case "P": + case "PRE": + case "TABLE": + case "OL": + case "UL": + case "LI": + case "HR": + case "DIV": + case "BLOCKQUOTE": + case "FORM": + case "FIELDSET": + case "LEGEND": + return false; + default: + return true; + } +}; + +Sys.Extended.UI.HtmlEditor.capLock = function(e) { + var kc = e.charCode, + sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false); + + if(((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)) + return true; + else + return false; +}; + +Sys.Extended.UI.HtmlEditor.operateAnchors = function(editor, _doc, _prize) { + var aList = _doc.getElementsByTagName("A"), + ret = false; + + for(var i = 0; i < aList.length; i++) { + var a = aList[i]; + + if(a.name && a.name.length > 0) { + var imgToDelete = []; + + for(var j = 0; j < a.childNodes.length; j++) { + var node = a.childNodes.item(j); + + if(node.nodeType == 1 && node.tagName && node.tagName.toUpperCase() == "IMG" && node.src == editor._editPanel.get_imagePath_anchor()) { + imgToDelete.push(node); + ret = true; + } + } + + while(imgToDelete.length > 0) + a.removeChild(imgToDelete.pop()); + + if(!_prize) { + var img = _doc.createElement("IMG"); + + img.title = a.name; + img.src = editor._editPanel.get_imagePath_anchor(); + img.setAttribute(editor.noContextMenuAttributeName(), "yes"); + + a.appendChild(img); + } + } + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.operatePlaceHolders = function(editor, _doc, _prize) { + var ret = false; + if(_prize) { + var tempCollection = _doc.getElementsByTagName("IMG"); + + var aList = []; + for(var i = 0; i < tempCollection.length; i++) + aList.push(tempCollection[i]); + + for(var i = 0; i < aList.length; i++) { + var a = aList[i], + dum = a.getAttribute("dummytag"); + + if(dum && dum.length > 0 && dum.toLowerCase() == "placeholder") { + var ph = _doc.createElement("PLACEHOLDER"), + title = a.title; + + if(title == null || typeof title == "undefined") + title = a.getAttribute("title"); + + ph.name = title; + ph.setAttribute("name", title); + + a.parentNode.insertBefore(ph, a); + a.parentNode.removeChild(a); + + ret = true; + } + } + } else { + var tempCollection = _doc.getElementsByTagName("PLACEHOLDER"); + + var aList = []; + for(var i = 0; i < tempCollection.length; i++) + aList.push(tempCollection[i]); + + for(var i = 0; i < aList.length; i++) { + var a = aList[i], + nd = true; + + try { + if(a.childNodes.length > 0) + nd = false; + } catch(ex) { } + + if(nd) { + var name = a.name; + + if(name == null || typeof name == "undefined") + name = a.getAttribute("name"); + + var img = _doc.createElement("IMG"); + img.title = name; + img.src = editor._editPanel.get_imagePath_placeHolder(); + + img.setAttribute("dummytag", "placeholder"); + img.setAttribute("title", name); + + a.parentNode.insertBefore(img, a); + a.parentNode.removeChild(a); + } + } + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.inspectForShadows = function(el) { + var aList = el.getElementsByTagName("IMG"); + + for(var i = 0; i < aList.length; i++) { + if(aList[i].getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute) && aList[i].getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute).length > 0) { + try { + if(Sys.Extended.UI.HtmlEditor.isIE) + $removeHandler(aList[i], "dragstart", Sys.Extended.UI.HtmlEditor.stopDrag); + else + $removeHandler(aList[i], "draggesture", Sys.Extended.UI.HtmlEditor.stopDrag); + } catch(e) { } + + if(Sys.Extended.UI.HtmlEditor.isIE) + $addHandler(aList[i], "dragstart", Sys.Extended.UI.HtmlEditor.stopDrag); + else + $addHandler(aList[i], "draggesture", Sys.Extended.UI.HtmlEditor.stopDrag); + } + } +}; + +Sys.Extended.UI.HtmlEditor.attachedIdAttribute = "obout-attached-id"; + +Sys.Extended.UI.HtmlEditor.stopDrag = function(ev) { + if(ev) + ev.stopPropagation(); + ev.preventDefault(); + + return false; +}; + +Sys.Extended.UI.HtmlEditor.replacingRules = + [ + ["strong", "font-weight", "bold"], + ["b", "font-weight", "bold"], + ["strong", "font-weight", "700"], + ["em", "font-style", "italic"], + ["i", "font-style", "italic"], + ["u", "text-decoration", "underline"], + ["strike", "text-decoration", "line-through"] + ]; + +Sys.Extended.UI.HtmlEditor.replaceOldTags = function(root, editor) { + var innerHTML = root.innerHTML, + need = false; + + for(var j = 0; j < Sys.Extended.UI.HtmlEditor.replacingRules.length; j++) { + var reg = new RegExp("<" + Sys.Extended.UI.HtmlEditor.replacingRules[j][0] + "[\s>]", "ig"); + + if(reg.test(innerHTML)) { + need = true; + break; + } + } + + if(!need) + if(!(/]/ig.test(innerHTML))) + return; + + for(var i = 0; i < root.childNodes.length; i++) { + var child = root.childNodes.item(i); + + if(child.nodeType == 1) { + var found = null, + childTagName = child.tagName.toLowerCase(); + + for(var j = 0; j < Sys.Extended.UI.HtmlEditor.replacingRules.length; j++) + if(Sys.Extended.UI.HtmlEditor.replacingRules[j][0].toLowerCase() == childTagName) { + found = Sys.Extended.UI.HtmlEditor.replacingRules[j]; + break; + } + + if(found) { + var span = editor._doc.createElement("SPAN"); + + span.style["cssText"] = child.style["cssText"]; + + if(Sys.Extended.UI.HtmlEditor.isIE) + span.style[found[1]] = found[2]; + else + span.style[found[1].replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase(); })] = found[2]; + + while(child.firstChild) + span.appendChild(child.firstChild); + + root.insertBefore(span, child); + root.removeChild(child); + child = span; + } else { + if(childTagName == "font") { + var span = editor._doc.createElement("SPAN"), + save = child.size; + + span.style["cssText"] = child.style["cssText"]; + + if(child.color) + span.style.color = child.color; + + if(child.face) + span.style.fontFamily = child.face; + + while(child.firstChild) + span.appendChild(child.firstChild); + + root.insertBefore(span, child); + root.removeChild(child); + + if(save) { + var font = editor._doc.createElement("FONT"); + font.size = save; + root.insertBefore(font, span); + + if(span.style["cssText"].length > 0) { + font.appendChild(span); + child = span; + } else { + while(span.firstChild) + font.appendChild(span.firstChild); + + root.removeChild(span); + child = font; + } + } else { + child = span; + } + } + } + Sys.Extended.UI.HtmlEditor.replaceOldTags(child, editor); + } + } +}; + +Sys.Extended.UI.HtmlEditor.getStyle = function(oElm, strCssRule) { + var strValue = ""; + + if(oElm.nodeType == 1) { + if(oElm.ownerDocument && oElm.ownerDocument.defaultView && oElm.ownerDocument.defaultView.getComputedStyle) { + strValue = oElm.ownerDocument.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } else if(oElm.currentStyle) { + try { + strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) { return p1.toUpperCase(); }); + strValue = oElm.currentStyle[strCssRule]; + } catch(ex) { + strValue = oElm.style[strCssRule]; + } + } else { + strValue = oElm.style[strCssRule]; + } + } + + return strValue; +}; + +Sys.Extended.UI.HtmlEditor._Marker = function(editor, rng, sel) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + this._nArr = Sys.Extended.UI.HtmlEditor.getNames(editor._doc.body); + this._save = editor._doc.body.innerHTML; + this._tree = null; + + if(sel.type.toLowerCase() == "control") { + try { + var el = rng.item(0); + this._tree = []; + + while(el && (el.nodeType == 3 || !el.tagName || el.tagName.toUpperCase() != "BODY")) { + var n = 0; + + while(el.previousSibling) { + n++; + el = el.previousSibling; + } + + this._tree.push(n); + el = el.parentNode; + } + } catch(e) { } + } else { + this._offsetLeft = rng.offsetLeft; + this._offsetTop = rng.offsetTop; + } + } else { + if(Sys.Extended.UI.HtmlEditor.isOpera) + this._save = Sys.Extended.UI.HtmlEditor.Trim(editor._doc.body.innerHTML); + else + this._save = editor._doc.body.cloneNode(true); + + this._tree = []; + this._offset = 0; + + try { + var el = rng.startContainer; + this._offset = rng.startOffset; + + if(el && el.nodeType == 1 && el.tagName.toUpperCase() == "HTML") { + el = editor._doc.body; + + setTimeout(function() { + try { + sel = editor._getSelection(); + rng = editor._createRange(); + editor._removeAllRanges(sel); + + rng.setStart(el, 0); + rng.setEnd(el, 0); + editor._selectRange(sel, rng); + } catch(e) { } + }, 0); + } + + while(el && el.nodeType && (el.nodeType == 3 || !el.tagName || el.tagName.toUpperCase() != "BODY")) { + var n = 0; + + while(el.previousSibling) { + n++; + + if(Sys.Extended.UI.HtmlEditor.isOpera) + if(el.nodeType == 3 && el.previousSibling != null && el.previousSibling.nodeType == 3) + n--; + + el = el.previousSibling; + } + + this._tree.push(n); + el = el.parentNode; + } + } catch(e) { } + } +}; + +Sys.Extended.UI.HtmlEditor.__stackMaxSize = 30; + +Sys.Extended.UI.HtmlEditor.getNames = function(el) { + var aList = el.all, + mArr = [], + nArr = [] + + for(var i = 0; i < aList.length; i++) { + var a = aList[i]; + + if(a.name && a.name.length > 0) { + var tag = a.tagName, + coll = el.getElementsByTagName(tag), + n = 0; + + for(var j = 0; j < coll.length; j++) + if(coll[j] == a) { + n = j; + + break; + } + + nArr[tag] = n; + mArr.push([tag, nArr[tag], a.name]); + } + } + + return mArr; +}; + +Sys.Extended.UI.HtmlEditor.setNames = function(el, mArr) { + for(var i = 0; i < mArr.length; i++) + if(el.getElementsByTagName(mArr[i][0]).length > mArr[i][1]) + el.getElementsByTagName(mArr[i][0])[mArr[i][1]].name = mArr[i][2]; +}; + +Sys.Extended.UI.HtmlEditor._lookChild = function(root, seek) { + for(var i = 0; i < root.childNodes.length; i++) { + var child = root.childNodes.item(i); + + if(child == seek) + return i; + + if(child.nodeType == 1) + if(Sys.Extended.UI.HtmlEditor._lookChild(child, seek) >= 0) + return i; + } + + return -1; +}; + +Sys.Extended.UI.HtmlEditor.getHrefsText = function(txt) { + var result = [] + + function regRepl(p0, p1, p2, p3, p4, p5, p6, p7) { + var tag = p1.replace(/^<([^\s>]+)/, "$1"), + insert = true, + i = 0; + + for(; i < result.length; i++) + if(result[i][0] == tag) { + insert = false; + break; + } + + if(insert) + result[i] = [tag]; + + result[i].push(p5); + }; + + var reg = new RegExp("(<[^\\s><]+)([^><]*?)(href=)(\"|')([^\\4]*?)(\\4)((?:[^><]*?)>)", "ig"); + txt.replace(reg, regRepl); + + return result; +}; + +Sys.Extended.UI.HtmlEditor.setHrefsText = function(el, mArr) { + for(var j = 0; j < mArr.length; j++) { + var aList = el.getElementsByTagName(mArr[j][0]), + k = 1; + + for(var i = 0; i < aList.length; i++) { + if(!aList[i].href) + continue; + + if(mArr[j][k] && mArr[j][k].length > 0) { + var trickIE; + + if(Sys.Extended.UI.HtmlEditor.isIE) + trickIE = aList[i].innerHTML; + + aList[i].href = mArr[j][k].replace(/&/ig, "&"); + if(Sys.Extended.UI.HtmlEditor.isIE) + aList[i].innerHTML = trickIE; + } + k++; + } + } +}; + +Sys.Extended.UI.HtmlEditor.getImagesText = function(txt) { + var mArr = []; + + function regRepl(p0, p1, p2, p3, p4, p5) { + mArr.push(p3); + + return p0; + } + + txt.replace(/()/ig, regRepl); + + return mArr; +}; + +Sys.Extended.UI.HtmlEditor.setImagesText = function(el, mArr) { + var aList = el.getElementsByTagName("IMG"), + k = 0; + + for(var i = 0; i < aList.length; i++) { + if(!aList[i].src) + continue; + + if(mArr[k] && mArr[k].length > 0) + aList[i].src = mArr[k].replace(/&/ig, "&"); + + k++; + } +}; + +Sys.Extended.UI.HtmlEditor.canHaveChildren = function(elem) { + if(Sys.Extended.UI.HtmlEditor.isIE) + return elem.canHaveChildren; + else + return !/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(elem.tagName.toLowerCase()); +}; + +Sys.Extended.UI.HtmlEditor._setCursor = function(el1, editor) { + var el = el1; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + if(sel.type.toLowerCase() == "control") { + range.remove(0); + sel.empty(); + range = editor._createRange(); + } + + var isText = (el.nodeType == 3), + span; + + if(isText) { + span = editor._doc.createElement("SPAN"); + span.innerHTML = " "; + + el.parentNode.insertBefore(span, el); + el = span; + } + + var location = $common.getLocation(el), + _left = location.x, _top = location.y; + + if(isText) + span.parentNode.removeChild(span); + + try { + range.moveToPoint(_left, _top); + } catch(e) { } + + range.select(); + } else { + var sel = editor._getSelection(), + range = editor._createRange(); + + range.setStart(el, 0); + range.setEnd(el, 0); + + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + editor.focusEditor(); + } +}; + +Sys.Extended.UI.HtmlEditor.myClone = function(el, doc, prize) { + var ela; + + if(Sys.Extended.UI.HtmlEditor.isIE && el.tagName && (el.tagName.toUpperCase() == "EMBED" || el.tagName.toUpperCase() == "OBJECT")) { + var div = doc.createElement("DIV"); + + try { + div.innerHTML = el.outerHTML; + ela = div.firstChild; + } catch(e) { + ela = el; + } + + delete div; + } else { + ela = el.cloneNode(prize); + } + + return ela; +}; + +Sys.Extended.UI.HtmlEditor.unStyle = function(el) { + var _prn = (el.parentNode != null && typeof el.parentNode != "undefined") ? el.parentNode : null; + + if(_prn) { + var _fnd = null; + + while(_prn && _prn.tagName && _prn.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(_prn.tagName) && + (_prn.tagName.toUpperCase() != "A")) { + _fnd = _prn; + _prn = _prn.parentNode; + } + + if(_fnd) { + function diver(add, el, rpr, before, prize) { + var par = rpr.cloneNode(false); + + if(add) + if(add.push && typeof add.push == "function") + for(var iii = 0; iii < add.length; iii++) + par.appendChild(add[iii]); + else + par.appendChild(add); + + if(prize) { + par.appendChild(el); + } else { + while(el) { + var elSibling = before ? el.previousSibling : el.nextSibling; + + if(el.nodeType == 1 || (el.nodeType == 3 && Sys.Extended.UI.HtmlEditor.Trim("" + el.data + "").length > 0)) { + if(el.nodeType == 1) + if(el.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(el.tagName) && el.childNodes.length == 0 && !Sys.Extended.UI.HtmlEditor.isTempElement(el)) + el = null; + + if(el) { + if(par.childNodes.length == 0 || !before) + par.appendChild(el); + else + par.insertBefore(el, par.firstChild); + } + } + + el = elSibling; + } + } + + if(par.childNodes.length == 0) { + delete par; + par = null; + } else if(par.childNodes.length == 1 && par.firstChild.nodeType == 3 && ("" + par.firstChild.data + "").length == 0) { + delete par; + par = null; + } else { + if(!prize && par.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName) && (par.tagName.toUpperCase() != "A") && !Sys.Extended.UI.HtmlEditor.isTempElement(par)) { + var elNumber = par.childNodes.length; + + for(var cnt = 0; cnt < par.childNodes.length; cnt++) { + var inn = par.childNodes.item(cnt); + + if(inn.nodeType == 1 && inn.tagName && !Sys.Extended.UI.HtmlEditor.isStyleTag(inn.tagName) && + (inn.tagName.toUpperCase() == "BR" || inn.tagName.toUpperCase() == "TABLE" || + Sys.Extended.UI.HtmlEditor.isTempElement(inn))) + elNumber--; + } + + if(elNumber == 0) { + var parr = []; + + while(par.firstChild) { + var inn = par.removeChild(par.firstChild); + parr.push(inn); + } + par = parr; + } + } + } + + if(rpr == _fnd) { + return par; + } else { + if(!prize) + return diver(par, before ? rpr.previousSibling : rpr.nextSibling, rpr.parentNode, before, prize); + else + return diver(null, par, rpr.parentNode, before, prize); + } + }; + + _prn = el.parentNode; + + if(el.previousSibling == null && el.nextSibling == null && + _prn && _prn.tagName && _prn.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(_prn.tagName) && + Sys.Extended.UI.HtmlEditor.differAttr(_prn, ["class", "color", "face", "size"]).length > 0) + el = _prn; + + var p1 = diver(null, el.previousSibling, el.parentNode, true, false), + p2 = diver(null, el.nextSibling, el.parentNode, false, false); + + var par = _fnd.parentNode; + if(p1) { + if(p1.push && typeof p1.push == "function") { + for(var iii = 0; iii < p1.length; iii++) + par.insertBefore(p1[iii], _fnd); + } else { + par.insertBefore(p1, _fnd); + } + } + + if(el.nodeType == 1 && el.tagName && + (el.tagName.toUpperCase() == "BR" || el.tagName.toUpperCase() == "TABLE" || + Sys.Extended.UI.HtmlEditor.isTempElement(el))) { + par.insertBefore(el, _fnd); + } else { + var p3 = diver(null, el, el.parentNode, false, true); + + par.insertBefore(p3, _fnd); + } + + if(p2) { + if(p2.push && typeof p2.push == "function") { + for(var iii = 0; iii < p2.length; iii++) + par.insertBefore(p2[iii], _fnd); + } else { + par.insertBefore(p2, _fnd); + } + } + par.removeChild(_fnd); + } + } +}; + +Sys.Extended.UI.HtmlEditor.isTempElement = function(el) { + if(el.id && el.id.length > 0 && el.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName) >= 0) + return true; + + return false; +}; + +Sys.Extended.UI.HtmlEditor._moveTagsUp = function(lBound, rBound) { + function _dive(next) { + if(!Sys.Extended.UI.HtmlEditor.isInlineElement(next) || next.nodeType == 3) { + Sys.Extended.UI.HtmlEditor.unStyle(next); + } else if(next.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(next.tagName) && (next.tagName.toUpperCase() != "A") && !Sys.Extended.UI.HtmlEditor.isTempElement(next)) { + var nnn = next.firstChild; + + while(nnn != null) { + var nnnNext = nnn.nextSibling; + + _dive(nnn); + nnn = nnnNext; + } + } + } + + var next = lBound; + while(next != null && next != rBound) { + var nextSibling = next.nextSibling; + _dive(next); + next = nextSibling; + } +}; + +Sys.Extended.UI.HtmlEditor._commonTotalParent = function(first, last) { + var ret = null, + par = first.parentNode, + fst = first; + + while(par) { + if(par.tagName && !Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + var indexLast = Sys.Extended.UI.HtmlEditor._lookChild(par, last); + + if(indexLast >= 0) { + var indexFirst = 0; + + for(var i = 0; i < par.childNodes.length; i++) + if(par.childNodes.item(i) == fst) { + indexFirst = i; + break; + } + + return { parent: par, indexFirst: indexFirst, indexLast: indexLast }; + } + } + + fst = par; + par = par.parentNode; + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor._commonParent = function(first, last) { + var ret = null, + par = first.parentNode, + fst = first; + + while(par && par.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + var indexLast = Sys.Extended.UI.HtmlEditor._lookChild(par, last); + + if(indexLast >= 0) { + var indexFirst = 0; + + for(var i = 0; i < par.childNodes.length; i++) { + if(par.childNodes.item(i) == fst) { + indexFirst = i; + break; + } + } + + return { parent: par, indexFirst: indexFirst, indexLast: indexLast }; + } + + fst = par; + par = par.parentNode; + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.positionInParagraph = function(marker, el, left, par, wordBound) { + while(true) { + var result = Sys.Extended.UI.HtmlEditor.positionInParagraphLevel(marker, el, left, wordBound); + + if(result != null) + return result; + + if(par.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName) && (par.tagName.toUpperCase() != "A") && !Sys.Extended.UI.HtmlEditor.isTempElement(par)) { + el = left ? par.previousSibling : par.nextSibling; + par = par.parentNode; + } else { + if(!left || par.firstChild == null) + par.appendChild(marker); + else + par.insertBefore(marker, par.firstChild); + + return marker; + } + } +}; + +Sys.Extended.UI.HtmlEditor.positionInParagraphLevel = function(marker, el, left, wordBound) { + while(el) { + var elSibling = left ? el.previousSibling : el.nextSibling; + + if(!Sys.Extended.UI.HtmlEditor.isInlineElement(el)) { + var par = el.parentNode; + + if(!left) { + par.insertBefore(marker, el); + } else { + if(el.nextSibling) + par.insertBefore(marker, el.nextSibling); + else + par.appendChild(marker); + } + + return marker; + } else if(typeof wordBound == "function" && el.nodeType == 3) { + var j, str = "" + el.data + ""; + + if(left) { + for(j = str.length - 1; j >= 0; j--) + if(wordBound(str.substr(j, 1))) + break; + } else { + for(j = 0; j < str.length; j++) + if(wordBound(str.substr(j, 1))) + break; + } + + if(j >= 0 && j < str.length) { + var par = el.parentNode, + newNode; + + if((j > 0 || (left && j == 0)) && (j < str.length - 1 || (!left && j == str.length - 1))) { + if(left) + newNode = el.splitText(j + 1); + else + newNode = el.splitText(j); + + par.insertBefore(marker, newNode); + } else { + if(!left) { + par.insertBefore(marker, el); + } else { + if(el.nextSibling) + par.insertBefore(marker, el.nextSibling); + else + par.appendChild(marker); + } + } + + return marker; + } + } + + el = left ? el.lastChild : el.firstChild; + + if(el) { + var result = Sys.Extended.UI.HtmlEditor.positionInParagraphLevel(marker, el, left, wordBound); + + if(result != null) + return result; + } + el = elSibling; + } + + return null; +}; + +Sys.Extended.UI.HtmlEditor._addEvent = function(el, evname, func) { + if(el.attachEvent) + el.attachEvent("on" + evname, func); + else if(el.addEventListener) + el.addEventListener(evname, func, true); +}; + +Sys.Extended.UI.HtmlEditor._addEvents = function(el, evs, func) { + for(var i = 0; i < evs.length; i++) + Sys.Extended.UI.HtmlEditor._addEvent(el, evs[i], func); +}; + +Sys.Extended.UI.HtmlEditor._removeEvent = function(el, evname, func) { + if(el.detachEvent) + el.detachEvent("on" + evname, func); + else if(el.removeEventListener) + el.removeEventListener(evname, func, true); +}; + +Sys.Extended.UI.HtmlEditor._removeEvents = function(el, evs, func) { + for(var i = 0; i < evs.length; i++) + Sys.Extended.UI.HtmlEditor._removeEvent(el, evs[i], func); +}; + +Sys.Extended.UI.HtmlEditor._stopEvent = function(ev) { + if(ev) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + ev.cancelBubble = true; + ev.returnValue = false; + } else { + ev.preventDefault(); + ev.stopPropagation(); + } + } +}; + +Sys.Extended.UI.HtmlEditor.restrictedTags = ["DIV", "P", "TD", "TR", "TABLE", "TBODY", "LI", "OL", "UL", "FORM", "INPUT"]; // this list can be increased + +Sys.Extended.UI.HtmlEditor.isRestricted = function(element) { + var elementTagName = element.tagName.toUpperCase(); + for(var i = 0; i < Sys.Extended.UI.HtmlEditor.restrictedTags.length; i++) + if(Sys.Extended.UI.HtmlEditor.restrictedTags[i].toUpperCase() == elementTagName) + return true; + + if(Sys.Extended.UI.HtmlEditor.isIE && element.scopeName.toUpperCase() != "HTML") + return true; + + return false; +}; + +Sys.Extended.UI.HtmlEditor.jsDocument = function(noExtraLf) { + this.noExtraLf = (typeof noExtraLf != "undefined" && noExtraLf); + this.text = []; //array to store the string + + this.write = function(str) { + if(!this.noExtraLf || (this.text.length == 0 && str != "\n") || (this.text.length > 0 && (this.text[this.text.length - 1] != "\n" || str != "\n"))) + this.text[this.text.length] = str; + }; + + this.append = this.write; + + this.writeln = function(str) { + this.text[this.text.length] = str + "\n"; + } + + this.toString = function() { + return this.text.join(""); + } + + this.clear = function() { + delete this.text; + this.text = null; + this.text = new Array; + } +}; + +Sys.Extended.UI.HtmlEditor.isHeader = function(el) { + var name = el.tagName.toUpperCase(); + + if(name.length == 2) + if(name.substr(0, 1) == "H" && parseInt(name.substr(1, 1)) > 0) + return true; + + return false; +}; + +Sys.Extended.UI.HtmlEditor._getReallyFirst = function(root) { + if(typeof root.firstChild != "undefined" && root.firstChild != null) + if(typeof root.firstChild.childNodes != "undefined" && root.firstChild.childNodes != null) + return Sys.Extended.UI.HtmlEditor._getReallyFirst(root.firstChild) + + return root; +}; + +Sys.Extended.UI.HtmlEditor._getReallyLast = function(root) { + if(typeof root.lastChild != "undefined" && root.lastChild != null) + if(typeof root.lastChild.childNodes != "undefined" && root.lastChild.childNodes != null) + return Sys.Extended.UI.HtmlEditor._getReallyLast(root.lastChild) + + return root; +}; + +Sys.Extended.UI.HtmlEditor._reallyFirst = function(root, seek) { + if(root.firstChild) { + if(root.firstChild == seek) + return true; + + if(root.firstChild.childNodes) + if(Sys.Extended.UI.HtmlEditor._lookChild(root.firstChild, seek) == 0) + return Sys.Extended.UI.HtmlEditor._reallyFirst(root.firstChild, seek) + } + + return false; +}; + +Sys.Extended.UI.HtmlEditor._reallyLast = function(root, seek) { + if(root.lastChild) { + if(root.lastChild == seek) + return true; + + if(root.lastChild.childNodes) + if(Sys.Extended.UI.HtmlEditor._lookChild(root.lastChild, seek) == root.lastChild.childNodes.length - 1) + return Sys.Extended.UI.HtmlEditor._reallyLast(root.lastChild, seek) + } + + return false; +}; + +Sys.Extended.UI.HtmlEditor.getContainer = function(container, el) { + if(el == container) + return container; + + if(container.nodeType == 1) { + for(var i = 0; i < container.childNodes.length; i++) { + var child = container.childNodes.item(i); + + if(el == child) + return child; + + if(child.nodeType == 1) { + var ind = Sys.Extended.UI.HtmlEditor._lookChild(child, el); + + if(ind >= 0) { + if(child.tagName && Sys.Extended.UI.HtmlEditor.isStyleTag(child.tagName) && (child.tagName.toUpperCase() != "A") && !Sys.Extended.UI.HtmlEditor.isTempElement(child)) + return Sys.Extended.UI.HtmlEditor.getContainer(child, el); + else + return child; + } + } + } + } + + return null; +}; + +Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt = function(fontSize, editor, _id) { + var ret = fontSize.replace(/^(\d+)\.(\d+)px/i, "$1px"); + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + if(ret && ret.length > 0) { + var seek = ret.toLowerCase().split(",")[0]; + + if(typeof _id != "undefined") { + var el = document.getElementById(_id); + + if(el != null) { + var i; + + for(i = 0; i < el.options.length; i++) { + var cur = Sys.Extended.UI.HtmlEditor.fontSizeSeek(el.options.item(i).value.toLowerCase().split(",")[0]); + + if(cur == seek) + break; + } + + if(i == el.options.length) { + var span = editor._doc.createElement("SPAN"); + editor._doc.body.appendChild(span); + + for(i = 1; i < 100; i++) { + span.style.fontSize = i + "pt"; + + if(Sys.Extended.UI.HtmlEditor.getStyle(span, "font-size").replace(/^(\d+)\.(\d+)px/i, "$1px") == seek) { + seek = i + "pt"; + break; + } + } + span.parentNode.removeChild(span); + } + } + } + ret = seek; + } + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.fontSizeSeek = function(val) { + var seek = val.toString(); + + switch(seek) { + case "1": + seek = "8pt"; + break; + case "2": + seek = "10pt"; + break; + case "3": + seek = "12pt"; + break; + case "4": + seek = "14pt"; + break; + case "5": + seek = "18pt"; + break; + case "6": + seek = "24pt"; + break; + case "7": + seek = "36pt"; + break; + } + + return seek; +}; + +Sys.Extended.UI.HtmlEditor.getOwnerDocument = function(node) { + return node.nodeType == 9 ? node : node.ownerDocument || node.document; +}; + +Sys.Extended.UI.HtmlEditor.getClientViewportElement = function(opt_node) { + var doc; + + if(opt_node.nodeType == 9) + doc = opt_node; + else + doc = Sys.Extended.UI.HtmlEditor.getOwnerDocument(opt_node); + + if(Sys.Extended.UI.HtmlEditor.isIE && doc.compatMode != 'CSS1Compat') + return doc.body; + + return doc.documentElement; +}; + +Sys.Extended.UI.HtmlEditor.isReallyVisible = function(el) { + var elem = el, + real_visible = true; + + while(elem) { + if(elem.style && Sys.Extended.UI.HtmlEditor.getStyle(elem, "display") == "none") { + real_visible = false; + break; + } + elem = elem.parentNode; + } + + return real_visible; +} + + +Sys.Extended.UI.HtmlEditor.setSelectionRange = function(input, selectionStart, selectionEnd) { + input.focus(); + + if(input.setSelectionRange) { + input.setSelectionRange(selectionStart, selectionEnd); + } else if(input.createTextRange) { + var range = input.createTextRange(); + + range.collapse(true); + range.moveEnd('character', selectionEnd); + range.moveStart('character', selectionStart); + range.select(); + } +}; + +Sys.Extended.UI.HtmlEditor.setElementVisibility = function(element) { + var ret = new Array(), + elem = element; + + while(elem && elem.nodeType == 1 && elem.tagName.toUpperCase() != "BODY") { + var display = elem.style.display, + visibility = elem.style.visibility; + + if(elem.style && (display == "none" || visibility == "hidden")) { + ret.push({ element: elem, display: display, visibility: visibility }); + elem.style.display = ""; + elem.style.visibility = "visible"; + } + elem = elem.parentNode; + } + + return ret; +}; + +Sys.Extended.UI.HtmlEditor.restoreElementVisibility = function(arr) { + for(var i = 0; i < arr.length; i++) { + var item = arr[i], + style = item.element.style; + + style.display = item.display; + style.visibility = item.visibility; + } +}; + +if(!Sys.Extended.UI.HtmlEditor.isIE) { + try { //not all such browsers support getter/setter + Sys.Extended.UI.HtmlEditor.__MozillaGetInnerText = function(node, html) { + var els = node.childNodes; + + for(var i = 0; i < els.length; i++) { + var elem = els[i]; + + if(elem.nodeType == 3) + html.write(elem.nodeValue.replace("\n", "")); + + if(elem.nodeType == 1) { + var display = Sys.Extended.UI.HtmlEditor.getStyle(elem, "display"), + visibility = Sys.Extended.UI.HtmlEditor.getStyle(elem, "visibility"); + + if(Sys.Extended.UI.HtmlEditor.__needLineBreakBefore(elem)) + html.write("\n"); + + if(Sys.Extended.UI.HtmlEditor.__needTabBefore(elem)) + html.write("\t"); + + if(display != "none" && visibility != "hidden") + Sys.Extended.UI.HtmlEditor.__MozillaGetInnerText(elem, html); + + if(Sys.Extended.UI.HtmlEditor.__needLineBreakAfter(elem)) + html.write("\n"); + } + } + }; + + Sys.Extended.UI.HtmlEditor.__needLineBreakBefore = function(el) { + var _Tags = " div table p pre ol ul blockquote form fieldset "; + + return (_Tags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); + }; + + Sys.Extended.UI.HtmlEditor.__needLineBreakAfter = function(el) { + var _Tags = " br div table tr p pre ol ul li hr blockquote form fieldset legend "; + + return (_Tags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); + }; + + Sys.Extended.UI.HtmlEditor.__needTabBefore = function(el) { + var _Tags = " td li "; + + return (_Tags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1); + }; + + } catch(ex) { } +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlPanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlPanel.debug.js new file mode 100644 index 000000000..cf44314c5 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlPanel.debug.js @@ -0,0 +1,123 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.HtmlPanel = function(element) { + Sys.Extended.UI.HtmlEditor.HtmlPanel.initializeBase(this, [element]); + this._onfocus$delegate = Function.createDelegate(this, this._onfocus); + + if(Sys.Extended.UI.HtmlEditor.isIE && document.compatMode != "BackCompat") + this._onresize$delegate = Function.createDelegate(this, this._onresize); +} + +Sys.Extended.UI.HtmlEditor.HtmlPanel.prototype = { + + _activate: function(value) { + this._shouldResize = false; + var element = this.get_element(); + + if(Sys.Extended.UI.HtmlEditor.isIE && Sys.Browser.version > 6 && document.compatMode != "BackCompat" && element.parentNode.clientHeight > 0) + this._shouldResize = true; + + Sys.Extended.UI.HtmlEditor.HtmlPanel.callBaseMethod(this, "_activate"); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + element.value = ""; + var panel = this; + + setTimeout(function() { + element.value = value; + }, 0); + } else { + element.value = value; + } + + $addHandlers(element, { + focus: this._onfocus$delegate + }); + + if(this._shouldResize) + $addHandlers(element, { + resize: this._onresize$delegate + }); + + this._activateFinished(); + }, + + _deactivate: function() { + var element = this.get_element(); + + if(this._shouldResize) + $common.removeHandlers(element, { + resize: this._onresize$delegate + }); + + this._shouldResize = false; + + $common.removeHandlers(element, { + focus: this._onfocus$delegate + }); + + element.value = ""; + Sys.Extended.UI.HtmlEditor.HtmlPanel.callBaseMethod(this, "_deactivate"); + }, + + _getContent: function() { + return this.get_element().value; + }, + + _setContent: function(value) { + this.get_element().value = value; + + if(Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element().parentNode)) { + try { // some browsers fail when invisible + var textarea = this.get_element(); + textarea.focus(); + setTimeout(function() { + try { + Sys.Extended.UI.HtmlEditor.setSelectionRange(textarea, 0, 0); + } catch(e) { } + }, 0); + } catch(e) { } + } + }, + + _focus: function() { + if(Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element().parentNode)) { + try { // some browsers fail when invisible + var textarea = this.get_element(); + textarea.focus(); + + setTimeout(function() { + try { + Sys.Extended.UI.HtmlEditor.setSelectionRange(textarea, 0, 0); + } catch(e) { } + }, 0); + } catch(e) { } + } + var panel = this; + + setTimeout(function() { + panel._focused(); + }, 0); + }, + + _onfocus: function(e) { + this._really_focused(); + var textarea = this.get_element(); + + setTimeout(function() { + textarea.focus(); + }, 0); + + return true; + }, + + _onresize: function(e) { + var element = this.get_element(); + var clientHeight = element.parentNode.clientHeight; + + if(clientHeight > 0) + element.style.height = clientHeight + "px"; + } +} + +Sys.Extended.UI.HtmlEditor.HtmlPanel.registerClass("Sys.Extended.UI.HtmlEditor.HtmlPanel", Sys.Extended.UI.HtmlEditor.ModePanel); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ModePanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ModePanel.debug.js new file mode 100644 index 000000000..85928bf5a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ModePanel.debug.js @@ -0,0 +1,123 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.ModePanel = function(element) { + Sys.Extended.UI.HtmlEditor.ModePanel.initializeBase(this, [element]); + + this._activated = false; + this._isActivating = false; + this._editPanel = null; + this._cachedContent = null; + this._onbeforeunload$delegate = Function.createDelegate(this, this._onbeforeunload); +} + +Sys.Extended.UI.HtmlEditor.ModePanel.prototype = { + + set_editPanel: function(value) { + this._editPanel = value; + }, + + get_content: function() { + if(this._activated) { + return this._getContent(); + } else { + if(this._cachedContent != null) + return this._cachedContent; + else + return ""; + } + }, + + set_content: function(value) { + this._cachedContent = value; + + if(!this._activated && !this._isActivating) { + this._activate(value); + } else { + if(!this._isActivating) { + this._setContent(value); + } else { + var panel = this; + setTimeout(function() { + panel.set_content(value); + }, 10); + + return false; + } + } + return true; + }, + + _activate: function() { + this.get_element().style.display = ""; + this._isActivating = true; + }, + + _activateFinished: function() { + this._activated = true; + this._isActivating = false; + this._editPanel._setActive(); + + if(this._editPanel.get_autofocus()) + this._focus(); + }, + + _deactivate: function() { + this.get_element().style.display = "none"; + this._activated = false; + this._isActivating = false; + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this, "initialize"); + if(Sys.Extended.UI.HtmlEditor.isIE) + $addHandlers(window, { beforeunload: this._onbeforeunload$delegate }); + }, + + dispose: function() { + if(Sys.Extended.UI.HtmlEditor.isIE) + $common.removeHandlers(window, { beforeunload: this._onbeforeunload$delegate }); + + if(this._activated) { + if(Sys.Extended.UI.HtmlEditor.isIE) + this._onbeforeunload(); + + this._deactivate(); + } + + Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this, "dispose"); + }, + + _onbeforeunload: function() { + if(this._activated) + if(!this._editPanel._contentPrepared) { + this._editPanel._prepareContentForPostback(this.get_content()); + this._editPanel._contentPrepared = true; + } + }, + + _getContent: function() { + if(this._cachedContent != null) + return this._cachedContent; + else + return ""; + }, + + _setContent: function(value) { + }, + + _focus: function() { + this._focused(); + }, + + _focused: function(prize) { + this._editPanel._focused(prize); + this._editPanel.set_autofocus(true); + }, + + _really_focused: function() { + this._editPanel._really_focused(); + this._editPanel.set_autofocus(true); + } +} + +Sys.Extended.UI.HtmlEditor.ModePanel.registerClass("Sys.Extended.UI.HtmlEditor.ModePanel", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedPopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedPopup.debug.js new file mode 100644 index 000000000..fcff6cac3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedPopup.debug.js @@ -0,0 +1,83 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.initializeBase(this, [element]); + + this._relatedElement = null; +} + +Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.prototype = { + + get_relatedElement: function() { + return this._relatedElement; + }, + + set_relatedElement: function(value) { + this._relatedElement = value; + }, + + open: function(callback) { + if(this._relatedElement != null) { + var popup = this; + + if(!this.checkCorrectLoaded(function() { popup.open(callback); })) + return; + + var location = $common.getLocation(this._relatedElement), + x = location.x, + y = location.y + this._relatedElement.offsetHeight; + + var element = this.get_element().parentNode; + while(element && element.tagName && element.tagName.toUpperCase() != "BODY") { + var position = Sys.Extended.UI.HtmlEditor.getStyle(element, "position"); + + if(position == "absolute" || position == "fixed") { + var top = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "top")), + left = parseInt(Sys.Extended.UI.HtmlEditor.getStyle(element, "left")); + + if(!isNaN(top) && !isNaN(left)) { + x -= left; + y -= top; + } + break; + } else if(position == "relative") { + var relativeLocation = $common.getLocation(element); + + x -= relativeLocation.x; + y -= relativeLocation.y; + } + element = element.parentNode; + } + + var viewportElement = Sys.Extended.UI.HtmlEditor.getClientViewportElement(this._iframe), + theVisibleWidth = viewportElement.clientWidth + viewportElement.scrollLeft, + theVisibleHeight = viewportElement.clientHeight + viewportElement.scrollTop; + + if(y < viewportElement.scrollTop) + y = viewportElement.scrollTop; + if(x < viewportElement.scrollLeft) + x = viewportElement.scrollLeft; + + if(y + this._iframe.offsetHeight > theVisibleHeight) + y -= y + this._iframe.offsetHeight - theVisibleHeight; + if(x + this._iframe.offsetWidth > theVisibleWidth) + x -= x + this._iframe.offsetWidth - theVisibleWidth; + + Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this, "open", [callback, y, x]); + } + }, + + close: function(callback) { + Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this, "close", [callback]); + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this, "initialize"); + }, + + dispose: function() { + Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this, "dispose"); + } +} + +Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup", Sys.Extended.UI.HtmlEditor.Popups.Popup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedTemplatePopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedTemplatePopup.debug.js new file mode 100644 index 000000000..7133e7c1a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.AttachedTemplatePopup.debug.js @@ -0,0 +1,29 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.initializeBase(this, [element]); + + this._contentDiv = null; +} + +Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.prototype = { + + get_contentDiv: function() { + return this._contentDiv; + }, + + set_contentDiv: function(value) { + this._contentDiv = value; + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.callBaseMethod(this, "initialize"); + this.set_initialContent(this._contentDiv.innerHTML); + }, + + dispose: function() { + Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.callBaseMethod(this, "dispose"); + } +} + +Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup", Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.BaseColorsPopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.BaseColorsPopup.debug.js new file mode 100644 index 000000000..261bc6e0b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.BaseColorsPopup.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.prototype = { +} + +Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup", Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.LinkProperties.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.LinkProperties.debug.js new file mode 100644 index 000000000..d06d25e1a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.LinkProperties.debug.js @@ -0,0 +1,22 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.LinkProperties = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.initializeBase(this, [element]); + + this._defaultTarget = "_self"; + this._targetTextHolder = null; + this._urlTextHolder = null; +} + +Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.prototype = { + + get_defaultTarget: function() { + return this._defaultTarget; + }, + + set_defaultTarget: function(value) { + this._defaultTarget = value; + } +} + +Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.registerClass("Sys.Extended.UI.HtmlEditor.Popups.LinkProperties", Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.debug.js new file mode 100644 index 000000000..61ff6ce3e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.debug.js @@ -0,0 +1,18 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.callBaseMethod(this, "initialize"); + }, + + dispose: function() { + Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.callBaseMethod(this, "dispose"); + } +} + +Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup", Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.Popup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.Popup.debug.js new file mode 100644 index 000000000..8c3d740bc --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.Popup.debug.js @@ -0,0 +1,323 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.Popup = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.Popup.initializeBase(this, [element]); + + this._iframe = null; + this._top = 0; + this._left = 0; + this._doc = null; + this._initialContent = ""; + this._cssPath = ""; + this._autoDimensions = true; + this._registeredFields = []; + this._registeredHandlers = []; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); + this.isOpened = false; + this.isLoaded = false; + this.isLoading = false; +} + +Sys.Extended.UI.HtmlEditor.Popups.Popup.prototype = { + + getDocument: function() { + return this._doc; + }, + + getPopupMediator: function() { + if(this._iframe.contentWindow && this._iframe.contentWindow.popupMediator) + return this._iframe.contentWindow.popupMediator; + else + return null; + }, + + get_registeredFields: function() { + return this._registeredFields; + }, + + set_registeredFields: function(value) { + this._registeredFields = eval(value); + }, + + get_registeredHandlers: function() { + return this._registeredHandlers; + }, + + set_registeredHandlers: function(value) { + this._registeredHandlers = eval(value); + }, + + get_initialContent: function() { + return this._initialContent; + }, + + set_initialContent: function(value) { + this._initialContent = value; + }, + + get_cssPath: function() { + return this._cssPath; + }, + + set_cssPath: function(value) { + this._cssPath = value; + }, + + get_autoDimensions: function() { + return this._autoDimensions; + }, + + set_autoDimensions: function(value) { + this._autoDimensions = value; + }, + + get_iframe: function() { + return this._iframe; + }, + + set_iframe: function(value) { + this._iframe = value; + }, + + checkCorrectLoaded: function(func) { + var popup = this; + if(popup.isLoaded && (popup._iframe.style.height == "0px" || popup._iframe.style.width == "0px")) + this.isLoaded = false; + + if(!this.isLoaded) { + if(!this.isLoading) + this.reload(); + + if(typeof func != "undefined") + setTimeout(func, 10); + + return false; + } + + return true; + }, + + _baseOpen: function(callback, top, left) { + var popup = this; + + if(!this.checkCorrectLoaded(function() { popup._baseOpen(callback, top, left); })) + return; + + var element = this.get_element(); + + if(typeof left != "undefined") + this._left = parseInt(left); + if(typeof top != "undefined") + this._top = parseInt(top); + + element.style.top = this._top + "px"; + element.style.left = this._left + "px"; + + setTimeout(function() { + if(typeof callback == "function") + popup._onDocumentLoaded(callback); + + popup.isOpened = true; + }, 0); + }, + + open: function(callback, top, left) { + this._baseOpen(callback, top, left); + }, + + close: function(callback) { + var element = this.get_element(); + this.isOpened = false; + + element.style.top = "-2000px"; + element.style.left = "-2000px"; + + if(typeof callback == "function") + callback(); + }, + + reload: function() { + this.isLoading = true; + var element = this.get_element(); + var _parentNode_ = element.parentNode; + + document.body.appendChild(element); + _parentNode_.appendChild(this.get_element()); + + this._doc = this._iframe.contentWindow.document; + this._doc.open(); + var html = new Sys.StringBuilder(); + + html.append(""); + if(this._cssPath.length > 0) + html.append(""); + + html.append(""); + if(this._autoDimensions) + html.append("

    "); + + html.append(this._initialContent); + if(this._autoDimensions) + html.append("
    "); + + html.append(""); + + this._doc.write(html.toString()); + this._doc.close(); + + this.isLoaded = false; + this._afterReload(); + }, + + _afterReload: function() { + var contentWindow = this._iframe.contentWindow, + popup = this; + + this.isLoaded = contentWindow.__loaded__; + + if(!(popup._doc.body && popup._doc.body.innerHTML)) + this.isLoaded = false; + + if(!this.isLoaded) { + setTimeout(function() { + popup._afterReload() + }, 10); // waiting for loading + return; + } + + this.isLoaded = false; + contentWindow.popupMediator = {}; + contentWindow.popupMediator.registeredFields = this._registeredFields; + contentWindow.popupMediator.registeredHandlers = this._registeredHandlers; + + contentWindow.popupMediator.get_callMethodByName = function(name) { + var handlers = contentWindow.popupMediator.registeredHandlers; + + for(var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + + if(handler.name == name) + return handler.callMethod; + } + + return null; + }; + + contentWindow.popupMediator.set_callMethodByName = function(name, value) { + var handlers = contentWindow.popupMediator.registeredHandlers; + + for(var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + + if(handler.name == name) + handler.callMethod = value; + } + }; + + contentWindow.popupMediator.getField = function(name) { + var registeredFields = contentWindow.popupMediator.registeredFields; + + for(var i = 0; i < registeredFields.length; i++) { + var registeredField = registeredFields[i]; + + if(registeredField.name == name) + return contentWindow.document.getElementById(registeredField.clientID); + } + + return null; + }; + + contentWindow.Sys = Sys; + + for(var i = 0; i < this._registeredHandlers.length; i++) + $find(this._registeredHandlers[i].clientID).activate(contentWindow.document.getElementById(this._registeredHandlers[i].clientID)); + + + if(Sys.Extended.UI.HtmlEditor.isIE) { + popup._doc.onselectstart = function() { + var event = popup._iframe.contentWindow.event; + var tagName = event.srcElement.tagName.toUpperCase(); + + if(tagName == "INPUT" || tagName == "TEXTAREA") + return true; + + return false; + }; + } else { + popup._doc.onmousedown = function disableselect(e) { + var tagName = e.target.tagName.toUpperCase(); + + if(tagName == "INPUT" || tagName == "TEXTAREA" || tagName == "SELECT") + return true; + if(Sys.Extended.UI.HtmlEditor.isSafari) + if(tagName == "TABLE" || tagName == "TR" || tagName == "TD" || tagName == "DIV") + return true; + + return false; + }; + + var aInp = popup._doc.getElementsByTagName('input'); + for(var i = 0; i < aInp.length; i++) + aInp[i].setAttribute('autocomplete', 'off') + } + + if(this._autoDimensions) { + popup._iframe.style.height = "1000px"; + popup._iframe.style.width = "1000px"; + + setTimeout(function() { + popup._iframe.style.height = popup._doc.body.firstChild.offsetHeight + "px"; + popup._iframe.style.width = popup._doc.body.firstChild.offsetWidth + "px"; + popup.isLoaded = true; + popup.isLoading = false; + }, 0); + } else { + popup.isLoaded = true; + popup.isLoading = false; + } + }, + + _onDocumentLoaded: function(callback) { + var popup = this; + if(!this.isLoaded) { + setTimeout(function() { + popup._onDocumentLoaded(callback) + }, 10); // waiting for loading + return; + } + + this.isLoaded = true; + callback(this._iframe.contentWindow); + }, + + initialize: function() { + this.__appLoaded__ = false; + + Sys.Extended.UI.HtmlEditor.Popups.Popup.callBaseMethod(this, "initialize"); + Sys.Application.add_load(this._app_onload$delegate); + }, + + dispose: function() { + Sys.Application.remove_load(this._app_onload$delegate); + + if(this.isOpened) + this.close(); + + Sys.Extended.UI.HtmlEditor.Popups.Popup.callBaseMethod(this, "dispose"); + }, + + _app_onload: function(sender, e) { + if(this.__appLoaded__) + return; + + this.__appLoaded__ = true; + var element = this.get_element(); + + if(Sys.Extended.UI.HtmlEditor.isReallyVisible(element)) { + this._parentNode_ = element.parentNode; + this.reload(); + } + } +} + +Sys.Extended.UI.HtmlEditor.Popups.Popup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.Popup", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBGIButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBGIButton.debug.js new file mode 100644 index 000000000..9731f4c73 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBGIButton.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.PopupBGIButton = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.PopupBGIButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupBGIButton.prototype = { +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupBGIButton.registerClass("Sys.Extended.UI.HtmlEditor.Popups.PopupBGIButton", Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBoxButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBoxButton.debug.js new file mode 100644 index 000000000..fde9708a9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupBoxButton.debug.js @@ -0,0 +1,12 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton.initializeBase(this, [element]); + + this._designPanel = null; +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton.prototype = { +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton.registerClass("Sys.Extended.UI.HtmlEditor.Popups.PopupBoxButton", Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupCommonButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupCommonButton.debug.js new file mode 100644 index 000000000..a394cac5d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Popups.PopupCommonButton.debug.js @@ -0,0 +1,195 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups"); + +Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton = function(element) { + Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton.initializeBase(this, [element]); + + this._loaded = false; + this._activated = null; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); + this._cssClass = ""; + this._name = ""; + + this._onmouseover$delegate = Function.createDelegate(this, this._onmouseover); + this._onmouseout$delegate = Function.createDelegate(this, this._onmouseout); + this._onmousedown$delegate = Function.createDelegate(this, this._onmousedown); + this._onmouseup$delegate = Function.createDelegate(this, this._onmouseup); + this._onclick$delegate = Function.createDelegate(this, this._onclick); +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton.prototype = { + + isImage: function() { + return true; + }, + + set_toolTip: function(value) { + this.get_element().title = value; + }, + + get_toolTip: function() { + return this.get_element().title; + }, + + set_name: function(value) { + this._name = value; + }, + + get_name: function() { + return this._name; + }, + + initialize: function() { + var element = this.get_element(); + + Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton.callBaseMethod(this, "initialize"); + Sys.Application.add_load(this._app_onload$delegate); + this._cssClass = element.className.split(" ")[0]; + + if(this.isImage()) { + $addHandlers(element, { + mouseover: this._onmouseover$delegate, + mouseout: this._onmouseout$delegate, + mousedown: this._onmousedown$delegate, + mouseup: this._onmouseup$delegate, + click: this._onclick$delegate + }); + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + function diveSelectable(el) { + if(el.nodeType == 1 && el.tagName) { + var tag = el.tagName.toUpperCase(); + + if(tag != "INPUT" && tag != "TEXTAREA" && tag != "IFRAME") + el.unselectable = "on"; + + for(var k = 0; k < el.childNodes.length; k++) + diveSelectable(el.childNodes.item(k)); + } + } + + diveSelectable(element); + } else { + try { + element.style.MozUserSelect = "none"; + element.parentNode.style.MozUserSelect = "none"; + } catch(ex) { } + } + }, + + activate: function(element) { + this._activated = element; + + if(this.isImage()) { + Sys.Extended.UI.HtmlEditor._addEvent(this._activated, "mouseover", this._onmouseover$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(this._activated, "mouseout", this._onmouseout$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(this._activated, "mousedown", this._onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(this._activated, "mouseup", this._onmouseup$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(this._activated, "click", this._onclick$delegate); + } + }, + + dispose: function() { + if(this.isImage() && this._activated != null) { + Sys.Extended.UI.HtmlEditor._removeEvent(this._activated, "mouseover", this._onmouseover$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(this._activated, "mouseout", this._onmouseout$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(this._activated, "mousedown", this._onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(this._activated, "mouseup", this._onmouseup$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(this._activated, "click", this._onclick$delegate); + } + this._activated = null; + this._loaded = false; + + Sys.Application.remove_load(this._app_onload$delegate); + Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton.callBaseMethod(this, "dispose"); + }, + + _app_onload: function(sender, e) { + if(this._loaded) + return; + + this.onButtonLoaded(); + this._loaded = true; + }, + + onButtonLoaded: function() { + }, + + _onmouseover: function(e) { + if(!this.isEnable()) + return false; + + Sys.UI.DomElement.addCssClass(this._activated, this._cssClass + "_hover"); + + return true; + }, + + _onmouseout: function(e) { + if(!this.isEnable()) + return false; + + var _target1 = e.toElement || e.relatedTarget; + + try { + while(_target1 && typeof _target1 != "undefined") + if(_target1 == this._activated) + break; + else + _target1 = _target1.parentNode; + } catch(e) { + _target1 = null; + } + + if(_target1 != null) + return true; + + Sys.UI.DomElement.removeCssClass(this._activated, this._cssClass + "_hover"); + Sys.UI.DomElement.removeCssClass(this._activated, this._cssClass + "_mousedown"); + + return true; + }, + + _onmousedown: function(e) { + if(!this.isEnable()) + return null; + + Sys.UI.DomElement.addCssClass(this._activated, this._cssClass + "_mousedown"); + + return false; + }, + + _onmouseup: function(e) { + if(!this.isEnable()) + return false; + + Sys.UI.DomElement.removeCssClass(this._activated, this._cssClass + "_mousedown"); + + return true; + }, + + _onclick: function(e) { + if(!this.isEnable()) + return false; + + this.callMethod(e); + + return true; + }, + + callMethod: function(e) { + var doc = this._activated.ownerDocument || this._activated.document || target, + contWin = doc.defaultView || doc.parentWindow, + method = contWin.popupMediator.get_callMethodByName(this._name); + + Function.createDelegate(this, method)(contWin); + }, + + isEnable: function() { + if(!this._loaded) + return false; + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton.registerClass("Sys.Extended.UI.HtmlEditor.Popups.PopupCommonButton", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.PreviewPanel.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.PreviewPanel.debug.js new file mode 100644 index 000000000..564e84edb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.PreviewPanel.debug.js @@ -0,0 +1,98 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.PreviewPanel = function(element) { + Sys.Extended.UI.HtmlEditor.PreviewPanel.initializeBase(this, [element]); + + this._focus$delegate = Function.createDelegate(this, this._focus_event); + this._blur$delegate = Function.createDelegate(this, this._blur_event); + this._doc = null; + this._content = ""; + this._panel_timer = null; +} + +Sys.Extended.UI.HtmlEditor.PreviewPanel.prototype = { + + _focus: function() { + try { // some browsers fail when invisible + this.get_element().contentWindow.focus(); + } catch(e) { } + + this._focused(); + }, + + _focus_event: function() { + if(this._panel_timer == null) { + var contentWindow = this.get_element().contentWindow; + var panel = this; + + this._really_focused(); + this._panel_timer = setTimeout(function() { contentWindow.focus(); panel._really_focused(); panel._panel_timer = null; }, 0); + } + + return true; + }, + + _blur_event: function() { + if(this._panel_timer != null) { + clearTimeout(this._panel_timer); + this._panel_timer = null; + } + + return true; + }, + + _activate: function(value) { + Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this, "_activate"); + + this._content = value; + this._wasFocused = false; + this._initIframe(value); + + Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow, ["focus"], this._focus$delegate); + Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow, ["blur"], this._blur$delegate); + + this._activateFinished(); + }, + + _deactivate: function() { + Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow, ["blur"], this._blur$delegate); + Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow, ["focus"], this._focus$delegate); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + try { // if src changed (with link in document) - security exception can occur in IE + this._doc.open(); + this._doc.write(""); + this._doc.close(); + this.get_element().src = "javascript:false;"; + } catch(ex) { } + } + + this._doc = null; + this._content = ""; + + Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this, "_deactivate"); + }, + + _initIframe: function(value) { + var str = Sys.Extended.UI.HtmlEditor.Trim(value); + this._doc = this.get_element().contentWindow.document; + + if(Sys.Extended.UI.HtmlEditor.isIE) + str = str.replace(/&/ig, "&"); + + this._doc.open(); + this._doc.write("" + str + ""); + this._doc.close(); + }, + + _getContent: function() { + return this._content; + }, + + _setContent: function(value) { + this._content = value; + this._initIframe(value); + } +} + +Sys.Extended.UI.HtmlEditor.PreviewPanel.registerClass("Sys.Extended.UI.HtmlEditor.PreviewPanel", Sys.Extended.UI.HtmlEditor.ModePanel); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Toolbar.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Toolbar.debug.js new file mode 100644 index 000000000..5a506425e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.Toolbar.debug.js @@ -0,0 +1,98 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); + +Sys.Extended.UI.HtmlEditor.Toolbar = function(element) { + Sys.Extended.UI.HtmlEditor.Toolbar.initializeBase(this, [element]); + + this._loaded = false; + this._cachedButtonIds = null; + this._cachedEditPanel = null; + this._buttons = null; + this._alwaysVisible = false; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); +} + +Sys.Extended.UI.HtmlEditor.Toolbar.prototype = { + + get_alwaysVisible: function() { + return this._alwaysVisible; + }, + + set_alwaysVisible: function(value) { + this._alwaysVisible = value; + if(this.get_isInitialized()) + this.raisePropertyChanged("alwaysVisible"); + }, + + set_activeEditPanel: function(value) { + if(!this._loaded) { + this._cachedEditPanel = value; + return; + } + + for(var i = 0; i < this.get_buttons().length; i++) + this.get_buttons()[i].set_activeEditPanel(value); + }, + + disable: function() { + if(this.get_isInitialized()) { + if(this._alwaysVisible) + return; + + for(var i = 0; i < this.get_buttons().length; i++) + this.get_buttons()[i].set_activeEditPanel(null); + } + }, + + get_buttons: function() { + if(this._buttons == null) + this._buttons = []; + + return this._buttons; + }, + + set_buttons: function(value) { + this.get_buttons().push(value); + }, + + get_buttonIds: function() { + }, + + set_buttonIds: function(value) { + if(!this.get_isInitialized()) { + this._cachedButtonIds = value; + return; + } + + var arr = value.split(";"); + for(var i = 0; i < arr.length; i++) + if(arr[i].length > 0) + this.set_buttons($find(arr[i])); + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.Toolbar.callBaseMethod(this, "initialize"); + Sys.Application.add_load(this._app_onload$delegate); + }, + + dispose: function() { + this._loaded = false; + + Sys.Application.remove_load(this._app_onload$delegate); + Sys.Extended.UI.HtmlEditor.Toolbar.callBaseMethod(this, "dispose"); + }, + + _app_onload: function(sender, e) { + if(this._cachedButtonIds != null) { + this.set_buttonIds(this._cachedButtonIds); + this._cachedButtonIds = null; + } + + this._loaded = true; + if(this._cachedEditPanel != null) { + this.set_activeEditPanel(this._cachedEditPanel); + this._cachedEditPanel = null; + } + } +} + +Sys.Extended.UI.HtmlEditor.Toolbar.registerClass("Sys.Extended.UI.HtmlEditor.Toolbar", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorClear.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorClear.debug.js new file mode 100644 index 000000000..ffc1f11a5 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorClear.debug.js @@ -0,0 +1,17 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("backcolor", false, ""); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorClear", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorSelector.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorSelector.debug.js new file mode 100644 index 000000000..ac2e607cb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BackColorSelector.debug.js @@ -0,0 +1,20 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector.callBaseMethod(this, "callMethod")) + return false; + }, + + setColor: function(color) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector.callBaseMethod(this, "setColor", [color]); + this._designPanel._execCommand("backcolor", false, color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.BackColorSelector", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Bold.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Bold.debug.js new file mode 100644 index 000000000..7586f8227 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Bold.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("bold", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._queryCommandState("bold"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Bold", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BoxButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BoxButton.debug.js new file mode 100644 index 000000000..317a0f1c4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BoxButton.debug.js @@ -0,0 +1,14 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton.callBaseMethod(this, "initialize"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BulletedList.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BulletedList.debug.js new file mode 100644 index 000000000..138c1b7d9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.BulletedList.debug.js @@ -0,0 +1,17 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("InsertUnorderedList"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.BulletedList", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorButton.debug.js new file mode 100644 index 000000000..d4f116ead --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorButton.debug.js @@ -0,0 +1,27 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton.callBaseMethod(this, "callMethod")) + return false; + + this.openPopup(Function.createDelegate(this, this._onopened)); + + return true; + }, + + _onopened: function(contentWindow) { + contentWindow.setColor = Function.createDelegate(this, this.setColor); + }, + + setColor: function(color) { + this.closePopup(); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorSelector.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorSelector.debug.js new file mode 100644 index 000000000..13467fcdb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ColorSelector.debug.js @@ -0,0 +1,39 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector.initializeBase(this, [element]); + + this._fixedColorButton = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector.prototype = { + + get_fixedColorButton: function() { + return this._fixedColorButton; + }, + + set_fixedColorButton: function(value) { + this._fixedColorButton = value; + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector.callBaseMethod(this, "callMethod")) + return false; + + this.openPopup(Function.createDelegate(this, this._onopened)); + + return true; + }, + + _onopened: function(contentWindow) { + contentWindow.setColor = Function.createDelegate(this, this.setColor); + }, + + setColor: function(color) { + this.closePopup(); + if(this._fixedColorButton != null) + this._fixedColorButton.set_defaultColor(color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector", Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.CommonButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.CommonButton.debug.js new file mode 100644 index 000000000..9466e82c9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.CommonButton.debug.js @@ -0,0 +1,285 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton.initializeBase(this, [element]); + + this._loaded = false; + this._preservePlace = false; + this._editPanel = null; + this._activeModes = null; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); + this._cssClass = ""; + + this._onmouseover$delegate = Function.createDelegate(this, this._onmouseover); + this._onmouseout$delegate = Function.createDelegate(this, this._onmouseout); + this._onmousedown$delegate = Function.createDelegate(this, this._onmousedown); + this._onmouseup$delegate = Function.createDelegate(this, this._onmouseup); + this._onclick$delegate = Function.createDelegate(this, this._onclick); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton.prototype = { + + get_preservePlace: function() { + return this._preservePlace; + }, + + set_preservePlace: function(value) { + this._preservePlace = value; + }, + + set_activeEditPanel: function(value) { + this._editPanel = value; + + if(this._editPanel == null) { + this.hideButton(); + } else { + if(this.isAllowedActiveMode(this._editPanel.get_activeMode()) && this.canBeShown()) { + this.showButton(); + this.onEditPanelActivity(); + } else { + this.hideButton(); + } + } + }, + + isImage: function() { + return true; + }, + + checkRangeInDesign: function() { + if(typeof this._designPanel == "undefined") + return false; + + if(this._designPanel == null) + return false; + if(this._designPanel.isPopup()) + return false; + + var parent = Sys.Extended.UI.HtmlEditor.getSelParent(this._designPanel); + if(parent.nodeType == 3) + parent = parent.parentNode; + + return (parent.ownerDocument == this._designPanel._doc); + }, + + get_buttonName: function() { + var name = Object.getType(this).getName(); + name = name.substring(name.lastIndexOf(".") + 1); + + return name; + }, + + get_message: function(messageName) { + var expression = "Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_" + this.get_buttonName() + "_message_" + messageName; + + return eval(expression); + }, + + isDisplayed: function() { + var element = this.get_element(); + + if(element) { + var style = element.style; + + return (style.display != "none" && style.visibility != "hidden"); + } else { + return false; + } + }, + + hideButton: function() { + var element = this.get_element(); + + if(element) { + if(!this._preservePlace) + element.style.display = "none"; + else + element.style.visibility = "hidden"; + } + }, + + showButton: function() { + var element = this.get_element(); + + if(element) { + if(element.style.display == "none") + element.style.display = ""; + + if(this._preservePlace) + element.style.visibility = "visible"; + } + }, + + canBeShown: function() { + return true; + }, + + onEditPanelActivity: function() { + }, + + get_activeModes: function() { + if(this._activeModes == null) + this._activeModes = []; + + return this._activeModes; + }, + + set_activeModes: function(value) { + this.get_activeModes().push(value); + }, + + get_activeModesIds: function() { + }, + + set_activeModesIds: function(value) { + var arr = value.split(";"); + + for(var i = 0; i < arr.length; i++) + this.set_activeModes(parseInt(arr[i])); + }, + + set_toolTip: function(value) { + this.get_element().title = value; + }, + + get_toolTip: function() { + return this.get_element().title; + }, + + isAllowedActiveMode: function(value) { + for(var i = 0; i < this.get_activeModes().length; i++) + if(this.get_activeModes()[i] == value) + return true; + + return false; + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton.callBaseMethod(this, "initialize"); + + Sys.Application.add_load(this._app_onload$delegate); + var element = this.get_element(); + + if(this._preservePlace && !this.canBeShown()) + element.style.display = "none"; + + this._cssClass = element.className; + + if(this.isImage()) + $addHandlers(element, { + mouseover: this._onmouseover$delegate, + mouseout: this._onmouseout$delegate, + mousedown: this._onmousedown$delegate, + mouseup: this._onmouseup$delegate, + click: this._onclick$delegate + }); + + if(Sys.Extended.UI.HtmlEditor.isIE) { + function diveSelectable(el) { + if(el.nodeType == 1 && el.tagName) { + var tag = el.tagName.toUpperCase(); + + if(tag != "INPUT" && tag != "TEXTAREA" && tag != "IFRAME") + el.unselectable = "on"; + + for(var k = 0; k < el.childNodes.length; k++) + diveSelectable(el.childNodes.item(k)); + } + } + + diveSelectable(element); + } else { + try { + element.style.MozUserSelect = "none"; + element.parentNode.style.MozUserSelect = "none"; + } catch(ex) { } + } + }, + + dispose: function() { + if(this.isImage()) { + $common.removeHandlers(this.get_element(), { + mouseover: this._onmouseover$delegate, + mouseout: this._onmouseout$delegate, + mousedown: this._onmousedown$delegate, + mouseup: this._onmouseup$delegate, + click: this._onclick$delegate + }); + } + + this._loaded = false; + Sys.Application.remove_load(this._app_onload$delegate); + Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton.callBaseMethod(this, "dispose"); + }, + + _app_onload: function(sender, e) { + this.onButtonLoaded(); + this._loaded = true; + }, + + onButtonLoaded: function() { + }, + + _onmouseover: function(e) { + if(!this.isEnable()) + return false; + + Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_hover"); + + return true; + }, + + _onmouseout: function(e) { + if(!this.isEnable()) + return false; + + Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_hover"); + Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_mousedown"); + + return true; + }, + + _onmousedown: function(e) { + if(!this.isEnable()) + return null; + + Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_mousedown"); + + return false; + }, + + _onmouseup: function(e) { + if(!this.isEnable()) + return false; + + Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_mousedown"); + + return true; + }, + + _onclick: function(e) { + if(!this.isEnable()) + return false; + + return true; + }, + + isEnable: function() { + if(!this._loaded) + return false; + + if(this._editPanel == null) + return false; + + return true; + }, + + setActivity: function(value) { + if(value) + Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_active"); + else + Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_active"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Copy.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Copy.debug.js new file mode 100644 index 000000000..a5ba4449f --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Copy.debug.js @@ -0,0 +1,30 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy.prototype = { + + canBeShown: function() { + return Sys.Extended.UI.HtmlEditor.isIE; + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + editor.openWait(); + setTimeout(function() { + editor.isShadowed(); editor._copyCut('c', true); editor.closeWait(); editor._ifShadow(); + }, 0) + } else { + editor._copyCut('c', true); + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Copy", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Cut.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Cut.debug.js new file mode 100644 index 000000000..b05b8d0d7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Cut.debug.js @@ -0,0 +1,26 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + editor.openWait(); + setTimeout(function() { + editor.isShadowed(); editor._copyCut('x', true); editor.closeWait(); + }, 0) + } else { + editor._copyCut('x', true); + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Cut", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DecreaseIndent.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DecreaseIndent.debug.js new file mode 100644 index 000000000..18f6218c7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DecreaseIndent.debug.js @@ -0,0 +1,18 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("Outdent"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DecreaseIndent", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); + diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignMode.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignMode.debug.js new file mode 100644 index 000000000..9ee569e90 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignMode.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignMode = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignMode.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignMode.prototype = { +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignMode.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignMode", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeBoxButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeBoxButton.debug.js new file mode 100644 index 000000000..88c802ede --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeBoxButton.debug.js @@ -0,0 +1,42 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton.initializeBase(this, [element]); + + this._designPanel = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton.prototype = { + + _onmousedown: function(e) { + if(this._designPanel == null) + return false; + + if(this._designPanel.isPopup()) + return false; + + if(Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton.callBaseMethod(this, "_onmousedown", [e]) === null) + return false; + + this.callMethod(); + + return false; + }, + + onEditPanelActivity: function() { + this._designPanel = this._editPanel.get_activePanel(); + }, + + callMethod: function() { + if(this._designPanel == null) + return false; + + if(this._designPanel.isPopup()) + return false; + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.BoxButton); + diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeImageButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeImageButton.debug.js new file mode 100644 index 000000000..981a830d1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeImageButton.debug.js @@ -0,0 +1,40 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton.initializeBase(this, [element]); + this._designPanel = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton.prototype = { + + _onmousedown: function(e) { + if(this._designPanel == null) + return false; + + if(this._designPanel.isPopup()) + return false; + + if(Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton.callBaseMethod(this, "_onmousedown", [e]) === null) + return false; + + this.callMethod(); + + return false; + }, + + onEditPanelActivity: function() { + this._designPanel = this._editPanel.get_activePanel(); + }, + + callMethod: function() { + if(this._designPanel == null) + return false; + + if(this._designPanel.isPopup()) + return false; + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModePopupImageButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModePopupImageButton.debug.js new file mode 100644 index 000000000..3714984c8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModePopupImageButton.debug.js @@ -0,0 +1,179 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.initializeBase(this, [element]); + + this._relatedPopup = null; + this._autoClose = true; + this._forclose_onmousedown$delegate = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.prototype = { + + set_activeEditPanel: function(value) { + if(this._editPanel != value && this._editPanel != null) + this.closePopup(); + + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.callBaseMethod(this, "set_activeEditPanel", [value]); + }, + + get_autoClose: function() { + return this._autoClose; + }, + + set_autoClose: function(value) { + this._autoClose = value; + }, + + get_relatedPopup: function() { + return this._relatedPopup; + }, + + set_relatedPopup: function(value) { + this._relatedPopup = value; + }, + + openPopup: function(callback, top, left) { + if(this._autoClose && this._forclose_onmousedown$delegate != null) + return; + + if(this._relatedPopup != null) { + this._bookmark = null; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._designPanel._getSelection(); + this._selType = sel.type.toLowerCase(); + var range = this._designPanel._createRange(sel); + + if(this._selType == "text" || this._selType == "none") { + try { + this._bookmark = range.duplicate(); + } catch(ex) { } + } else if(this._selType == "control") { + this._bookmark = range.item(0); + range.remove(0); + sel.empty(); + } + } + + if(typeof this._relatedPopup.set_relatedElement == "function") { + this._relatedPopup.set_relatedElement(this.get_element()); + + this._forclose_onmousedown$delegate = Function.createDelegate(this, this._forclose_onmousedown); + if(this._autoClose) { + var designWindow = this._designPanel.get_element().contentWindow, + designBody = designWindow.document.body, + button = this; + + setTimeout(function() { + if(button._forclose_onmousedown$delegate != null) { + Sys.Extended.UI.HtmlEditor._addEvent(designBody, "mousedown", button._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(designBody, "keydown", button._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(document.body, "keydown", button._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(window, "keydown", button._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(designWindow, "mousedown", button._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._addEvent(document.body, "mousedown", button._forclose_onmousedown$delegate); + + if(document.documentElement) + Sys.Extended.UI.HtmlEditor._addEvent(document.documentElement, "mousedown", button._forclose_onmousedown$delegate); + } + }, 0); + } + + this._relatedPopup.open(callback); + } else { + this._relatedPopup.open(callback, top, left); + } + } + }, + + _forclose_onmousedown: function(e) { + if(this._forclose_onmousedown$delegate == null) + return true; + + if(this._relatedPopup.isOpened) + this._relatedPopup.close(); + else + return true; + + if(this._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) { + try { // for the case if currently the Design panel is invisible + if(this._bookmark) { + if(Sys.Extended.UI.HtmlEditor.isIE) { + var range; + + if(this._selType == "control") { + range = this._designPanel._doc.body.createControlRange(); + range.add(this._bookmark); + } else { + range = this._bookmark; + } + + range.select(); + } + + this._bookmark = null; + } + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._designPanel._getSelection(), + range = this._designPanel._createRange(sel); + + this._designPanel._removeAllRanges(sel); + this._designPanel._selectRange(sel, range); + this._designPanel.focusEditor(); + } + } catch(ex) { } + } + + var button = this; + setTimeout(function() { + if(button._editPanel == Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel) + try { + button._editPanel.updateToolbar(); + } catch(ex) { } + }, 0); + + if(this._autoClose) { + try { + var designWindow = this._designPanel.get_element().contentWindow, + designBody = designWindow.document.body; + + if(document.documentElement) + Sys.Extended.UI.HtmlEditor._removeEvent(document.documentElement, "mousedown", this._forclose_onmousedown$delegate); + + Sys.Extended.UI.HtmlEditor._removeEvent(designBody, "keydown", this._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(document.body, "keydown", this._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(window, "keydown", this._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(designBody, "mousedown", this._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(designWindow, "mousedown", this._forclose_onmousedown$delegate); + Sys.Extended.UI.HtmlEditor._removeEvent(document.body, "mousedown", this._forclose_onmousedown$delegate); + } catch(ex) { } + } + + this._forclose_onmousedown$delegate = null; + if(e && e.type) { + if(e.type == "keydown") { + Sys.Extended.UI.HtmlEditor._stopEvent(e); + + return false; + } + } + + return true; + }, + + closePopup: function() { + if(this._forclose_onmousedown$delegate != null) + this._forclose_onmousedown$delegate(null); + }, + + dispose: function() { + if(this._forclose_onmousedown$delegate != null) + this._forclose_onmousedown$delegate(null); + + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.callBaseMethod(this, "dispose"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeSelectButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeSelectButton.debug.js new file mode 100644 index 000000000..bd2c2be19 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.DesignModeSelectButton.debug.js @@ -0,0 +1,36 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton.initializeBase(this, [element]); + this._designPanel = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton.prototype = { + + onEditPanelActivity: function() { + this._designPanel = this._editPanel.get_activePanel(); + this.checkState() + }, + + + checkState: function() { + if(!this.checkRangeInDesign()) + return false; + + return true; + }, + + callMethod: function(select, e) { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton.callBaseMethod(this, "callMethod")) + return false; + + if(this._designPanel == null) + return false; + if(this._designPanel.isPopup()) + return false; + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.EditorToggleButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.EditorToggleButton.debug.js new file mode 100644 index 000000000..151e293d2 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.EditorToggleButton.debug.js @@ -0,0 +1,22 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton.prototype = { + + onEditPanelActivity: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton.callBaseMethod(this, "onEditPanelActivity"); + this.setActivity(this.checkState()); + }, + + checkState: function() { + if(!this.checkRangeInDesign()) + return false; + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedBackColor.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedBackColor.debug.js new file mode 100644 index 000000000..f92d14e46 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedBackColor.debug.js @@ -0,0 +1,14 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedBackColor = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedBackColor.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedBackColor.prototype = { + + setColor: function(color) { + this._designPanel._execCommand("backcolor", false, color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedBackColor.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedBackColor", Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedColorButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedColorButton.debug.js new file mode 100644 index 000000000..33e763c4c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedColorButton.debug.js @@ -0,0 +1,61 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton.initializeBase(this, [element]); + + this._defaultColor = "#000000"; + this._colorDiv = null; + this._methodButton = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton.prototype = { + + get_defaultColor: function() { + return this._defaultColor; + }, + + set_defaultColor: function(value) { + this._defaultColor = value; + + if(this._colorDiv != null) + this._colorDiv.get_element().style.backgroundColor = value; + }, + + get_colorDiv: function() { + return this._colorDiv; + }, + + set_colorDiv: function(value) { + this._colorDiv = value; + }, + + get_methodButton: function() { + return this._methodButton; + }, + + set_methodButton: function(value) { + this._methodButton = value; + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton.callBaseMethod(this, "callMethod")) + return false; + + this.setColor(this.get_defaultColor()); + }, + + setColor: function(color) { + }, + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton.callBaseMethod(this, "initialize"); + + if(this._methodButton != null) + this._methodButton.callMethod = Function.createDelegate(this, this.callMethod); + + if(this._colorDiv != null) + this._colorDiv.callMethod = Function.createDelegate(this, this.callMethod); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeBoxButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedForeColor.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedForeColor.debug.js new file mode 100644 index 000000000..6bcdb9490 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FixedForeColor.debug.js @@ -0,0 +1,14 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedForeColor = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedForeColor.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedForeColor.prototype = { + + setColor: function(color) { + this._designPanel._execCommand("forecolor", false, color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedForeColor.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedForeColor", Sys.Extended.UI.HtmlEditor.ToolbarButtons.FixedColorButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontName.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontName.debug.js new file mode 100644 index 000000000..cebbe217c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontName.debug.js @@ -0,0 +1,68 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this, "initialize"); + }, + + callMethod: function(select, event) { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this, "callMethod")) + return false; + + try { + var editor = this._designPanel; + editor._execCommand("fontname", false, select.options.item(select.selectedIndex).value); + } catch(e) { } + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this, "checkState")) + return false; + + var editor = this._designPanel, + param = null; + + try { + param = (Function.createDelegate(editor, Sys.Extended.UI.HtmlEditor._queryCommandValue))("fontname"); + } catch(e) { } + + if(!editor._FontNotSet) + if(!param || param.length == 0) + param = Sys.Extended.UI.HtmlEditor.getStyle(editor._doc.body, "font-family"); + + var el = this._select, + i = 0; + + if(param && param.length > 0) { + var seek = param.toLowerCase().split(",")[0].replace(/^(['"])/, "").replace(/(['"])$/, ""); + + for(i = 0; i < el.options.length; i++) { + var cur = el.options.item(i).value.toLowerCase().split(",")[0]; + if(cur == seek) + break + } + + if(i == el.options.length) { + try { + var newopt = document.createElement("OPTION"); + + newopt.value = param.replace(/^(['"])/, "").replace(/(['"])$/, ""); + newopt.text = param.split(",")[0].replace(/^(['"])/, "").replace(/(['"])$/, ""); + el.add(newopt, (Sys.Extended.UI.HtmlEditor.isIE) ? i : null); + $addHandler(newopt, "click", this._onclick_option$delegate); + } catch(e) { + i = 0; + } + } + } + + el.selectedIndex = i; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontSize.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontSize.debug.js new file mode 100644 index 000000000..351bd24e6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.FontSize.debug.js @@ -0,0 +1,78 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.callBaseMethod(this, "initialize"); + }, + + callMethod: function(select, event) { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.callBaseMethod(this, "callMethod")) + return false; + + try { + var editor = this._designPanel; + editor._execCommand("FontSize", false, Sys.Extended.UI.HtmlEditor.fontSizeSeek(select.options.item(select.selectedIndex).value)); + } catch(e) { } + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.callBaseMethod(this, "checkState")) + return false; + + var editor = this._designPanel; + + var param = null, + _id = this._select.id; + + try { + param = (Function.createDelegate(editor, Sys.Extended.UI.HtmlEditor._queryCommandValue))("fontsize", _id); + } catch(e) { } + + if(param) + param = param.toString(); + + if(!editor._FontNotSet) + if(!param || param.length == 0) { + param = Sys.Extended.UI.HtmlEditor.getStyle(editor._doc.body, "font-size"); + param = Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt(param, this, _id); + } + + try { + var el = this._select, + i = 0; + + if(param && param.length > 0) { + var seek = param.toLowerCase().split(",")[0]; + + for(i = 0; i < el.options.length; i++) { + var cur = Sys.Extended.UI.HtmlEditor.fontSizeSeek(el.options.item(i).value.toLowerCase().split(",")[0]); + + if(cur == seek) + break; + } + + if(i == el.options.length) { + try { + var newopt = document.createElement("OPTION"); + + newopt.value = param; + newopt.text = param; + el.add(newopt, (Sys.Extended.UI.HtmlEditor.isIE) ? i : null); + $addHandler(newopt, "click", this._onclick_option$delegate); + } catch(e) { + i = 0; + } + } + } + + el.selectedIndex = i; + } catch(e) { } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontSize", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColor.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColor.debug.js new file mode 100644 index 000000000..341e4be05 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColor.debug.js @@ -0,0 +1,20 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor.callBaseMethod(this, "callMethod")) + return false; + }, + + setColor: function(color) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor.callBaseMethod(this, "setColor", [color]); + this._designPanel._execCommand("forecolor", false, color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColor", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorClear.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorClear.debug.js new file mode 100644 index 000000000..397a491e2 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorClear.debug.js @@ -0,0 +1,17 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("forecolor", false, ""); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorClear", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorSelector.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorSelector.debug.js new file mode 100644 index 000000000..127d82b3c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ForeColorSelector.debug.js @@ -0,0 +1,20 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector.callBaseMethod(this, "callMethod")) + return false; + }, + + setColor: function(color) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector.callBaseMethod(this, "setColor", [color]); + this._designPanel._execCommand("forecolor", false, color); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ForeColorSelector", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ColorSelector); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HorizontalSeparator.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HorizontalSeparator.debug.js new file mode 100644 index 000000000..b5ada8c41 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HorizontalSeparator.debug.js @@ -0,0 +1,14 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HorizontalSeparator = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.HorizontalSeparator.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HorizontalSeparator.prototype = { + + isImage: function() { + return false; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HorizontalSeparator.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.HorizontalSeparator", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HtmlMode.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HtmlMode.debug.js new file mode 100644 index 000000000..1113cd134 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.HtmlMode.debug.js @@ -0,0 +1,11 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HtmlMode = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.HtmlMode.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HtmlMode.prototype = { +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.HtmlMode.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.HtmlMode", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton); + diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ImageButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ImageButton.debug.js new file mode 100644 index 000000000..025dffbcb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ImageButton.debug.js @@ -0,0 +1,147 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.initializeBase(this, [element]); + + this._normalSrc = ""; + this._hoverSrc = ""; + this._downSrc = ""; + this._activeSrc = ""; + this._downTimer = null; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.prototype = { + + get_normalSrc: function() { + return this._normalSrc; + }, + + set_normalSrc: function(value) { + this._normalSrc = value; + var element = this.get_element(); + + if(/none$/.test(element.src)) + element.src = value; + }, + + get_hoverSrc: function() { + return this._hoverSrc; + }, + + set_hoverSrc: function(value) { + this._hoverSrc = value; + }, + + get_downSrc: function() { + return this._downSrc; + }, + + set_downSrc: function(value) { + this._downSrc = value; + }, + + get_activeSrc: function() { + return this._activeSrc; + }, + + set_activeSrc: function(value) { + this._activeSrc = value; + }, + + isImage: function() { + return true; + }, + + _onmouseover: function(e) { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.callBaseMethod(this, "_onmouseover")) + return false; + + if(this._hoverSrc.length > 0) + this.get_element().src = this._hoverSrc; + + return true; + }, + + _onmouseout: function(e) { + var node = this.get_element(); + + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.callBaseMethod(this, "_onmouseout")) + return false; + + if(this._hoverSrc.length > 0) { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_mousedown") && this._downSrc.length > 0) { + node.src = this._downSrc; + } else { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_active") && this._activeSrc.length > 0) + node.src = this._activeSrc; + else + node.src = this._normalSrc; + } + } + + return true; + }, + + _onmousedown: function(e) { + if(Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.callBaseMethod(this, "_onmousedown") === null) + return null; + + if(this._downSrc.length > 0) { + this.get_element().src = this._downSrc; + this._downTimer = setTimeout(Function.createDelegate(this, this._onmouseup), 1000); // one second delay + } + + return true; + }, + + _onmouseup: function(e) { + var node = this.get_element(); + + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.callBaseMethod(this, "_onmouseup")) + return false; + + if(this._downSrc.length > 0) { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_hover") && this._hoverSrc.length > 0) { + node.src = this._hoverSrc; + } else { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_active") && this._activeSrc.length > 0) + node.src = this._activeSrc; + else + node.src = this._normalSrc; + } + + if(this._downTimer != null) { + clearTimeout(this._downTimer); + this._downTimer = null; + } + } + + return true; + }, + + setActivity: function(value) { + var node = this.get_element(); + + if(this._activeSrc.length > 0) { + if(value) { + if(!Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_active")) + node.src = this._activeSrc; + } else { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_active")) { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_mousedown") && this._downSrc.length > 0) { + node.src = this._downSrc; + } else { + if(Sys.UI.DomElement.containsCssClass(node, this._cssClass + "_hover") && this._hoverSrc.length > 0) + node.src = this._hoverSrc; + else + node.src = this._normalSrc; + } + } + } + } + + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.callBaseMethod(this, "setActivity", [value]); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.IncreaseIndent.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.IncreaseIndent.debug.js new file mode 100644 index 000000000..2f66008eb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.IncreaseIndent.debug.js @@ -0,0 +1,16 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent.callBaseMethod(this, "callMethod")) + return false; + this._designPanel._execCommand("Indent"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.IncreaseIndent", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertHR.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertHR.debug.js new file mode 100644 index 000000000..598f47741 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertHR.debug.js @@ -0,0 +1,46 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + try { + editor._saveContent(); + + var _div = editor._doc.createElement("div"); + _div.innerHTML = "
    "; + + var el = _div.firstChild, + place = editor._getSafePlace(); + + if(!place) + return; + + var parent = place.parentNode; + + parent.insertBefore(el, place); + parent.removeChild(place); + + el = (el.nextSibling) ? el.nextSibling : el; + Sys.Extended.UI.HtmlEditor._setCursor(el, editor); + + setTimeout(function() { + editor.onContentChanged(); editor._editPanel.updateToolbar(); + }, 0); + + editor.focusEditor(); + + return true; + } catch(e) { } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertHR", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertLink.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertLink.debug.js new file mode 100644 index 000000000..e12977aab --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.InsertLink.debug.js @@ -0,0 +1,308 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink.initializeBase(this, [element]); + this._emptySrc = window.location.href.replace(/(http[s]*\:\/\/)[^\u0000]*/i, "$1"); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink.prototype = { + + callMethod: function() { + var editor = this._designPanel, + sel = editor._getSelection(), + range = editor._createRange(sel), + parent = Sys.Extended.UI.HtmlEditor.getSelParent(editor); + + if(parent.nodeType == 3) + parent = parent.parentNode; + + while(parent && Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName) && parent.tagName.toUpperCase() != "A") + parent = parent.parentNode; + + if(parent && parent.tagName.toUpperCase() == "A") { + this._edit = true; + this._editLink(parent); + } else { + this._edit = false; + if(!this._createLink()) + return false; + } + + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink.callBaseMethod(this, "callMethod")) + return false; + + return true; + }, + + opened: function(contentWindow) { + this._preparePopup(contentWindow); + }, + + ok: function(contentWindow) { + var targetField = contentWindow.popupMediator.getField("target"); + if(targetField != null) + this._obj.target = targetField.value; + + var urlField = contentWindow.popupMediator.getField("url"); + if(urlField != null) + this._obj.href = urlField.value; + + if(/^javascript:/.test(this._obj.href)) { + this._obj.target = null; + try { + this._obj.removeAttribute("target"); + } catch(e) { } + } else { + var targetField = contentWindow.popupMediator.getField("target"); + + if(targetField != null) + this._obj.target = targetField.value; + } + + if(this._edit) { + this._edit_callback(true); + } else { + this._create_callback(true); + } + }, + + cancel: function(contentWindow) { + if(this._edit) + this._edit_callback(false); + else + this._create_callback(false); + }, + + _createLink: function() { + var editor = this._designPanel, + selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(editor.getSelectedHTML()) : "", + sel = editor._getSelection(), + range = editor._createRange(sel); + + this._txt = null; + + if(!(editor.isControl() && Sys.Extended.UI.HtmlEditor.getSelParent(editor).tagName && (Sys.Extended.UI.HtmlEditor.getSelParent(editor).tagName.toUpperCase() == "EMBED" || Sys.Extended.UI.HtmlEditor.getSelParent(editor).tagName.toUpperCase() == "IMG")) && + !(!editor.isControl() && ((Sys.Extended.UI.HtmlEditor.isIE && range.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0)))) { + + editor._saveContent(); + var _span = editor._doc.createElement("span"); + _span.innerHTML = "new link"; + + _span.id = Sys.Extended.UI.HtmlEditor.smartClassName; + + var needSelect = true; + if(Sys.Extended.UI.HtmlEditor.isIE && editor.isControl()) { + var control = range.item(0); + var _span1 = editor._doc.createElement("span"); + + control.parentNode.insertBefore(_span1, control); + this._txt = _span.firstChild; + control.parentNode.insertBefore(this._txt, control); + var _span2 = editor._doc.createElement("span"); + + control.parentNode.insertBefore(_span2, control); + control.parentNode.removeChild(control); + + editor.setSelectionAfterOperation([_span1, _span2], false); + needSelect = false; + } else { + editor.insertHTML(Sys.Extended.UI.HtmlEditor.getHTML(_span, true)); + + var el = editor._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName); + + this._txt = el.firstChild; + + el.parentNode.insertBefore(el.firstChild, el); + el.parentNode.removeChild(el); + } + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + range = editor._createRange(); + range.setStart(this._txt, 0); + range.setEnd(this._txt, ("" + this._txt.data + "").length); + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + } else { + if(needSelect) + range.select(); + } + + selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(editor.getSelectedHTML()) : ""; + sel = editor._getSelection(); + range = editor._createRange(sel); + } + + if((editor.isControl() && Sys.Extended.UI.HtmlEditor.getSelParent(editor).tagName.toUpperCase() == "IMG") || + (!editor.isControl() && ((Sys.Extended.UI.HtmlEditor.isIE && range.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0)))) { + editor._saveContent(); + + this._obj = { target: "default", href: this._emptySrc, title: "" }; + + var temp = editor._doc.getElementsByTagName("A"); + var aList = []; + + for(var i = 0; i < temp.length; i++) + aList.push([temp[i], "" + temp[i].href + ""]); + + editor._execCommand("createLink", false, this._emptySrc); + this._oldList = []; + + for(var i = 0; i < aList.length; i++) { + var a = aList[i][0]; + var href = aList[i][1]; + + if(a.href == href) + this._oldList.push(a); + } + } else { + if(this._txt) { + editor._undo(false); + editor.__stack.pop(); + } + return false; + } + + return true; + }, + + _editLink: function(link) { + var editor = this._designPanel; + + this._obj = link; + editor._saveContent(); + }, + + _preparePopup: function(contentWindow) { + if(this._obj.target && this._obj.target.length > 0 && this._obj.target == "default") + this._obj.target = this.get_relatedPopup().get_defaultTarget(); + + var targetField = contentWindow.popupMediator.getField("target"); + if(targetField != null) + targetField.value = (this._obj.target && this._obj.target.length > 0 && this._obj.target.substr(0, 1) == "_") ? this._obj.target.toLowerCase() : "_self"; + + var urlField = contentWindow.popupMediator.getField("url"); + if(urlField != null) { + if(this._edit) + urlField.value = Sys.Extended.UI.HtmlEditor.getRealAttribute(this._obj, "href"); + else + urlField.value = this._obj.href; + + if(urlField.value.length == 0) + urlField.value = this._emptySrc; + + urlField.value = urlField.value.replace(/\"/g, "\""); + + setTimeout(function() { + Sys.Extended.UI.HtmlEditor.setSelectionRange(urlField, 0, urlField.value.length); + }, 0); + } + }, + + _edit_callback: function(ok) { + var editor = this._designPanel; + try { + if(!ok) { + editor._undo(false); + } else { + if(this._obj.title.length == 0) { + this._obj.title = null; + this._obj.removeAttribute("title"); + } + editor.onContentChanged(); + } + } catch(ex) { } + + return true; + }, + + okCheck: function(contentWindow) { + var urlField = contentWindow.popupMediator.getField("url"); + + if(urlField != null) { + var url = urlField.value; + + if(url == "" || (url.length >= 3 && url.substr(url.length - 3, 3) == "://")) { + contentWindow.alert(this.get_message("EmptyURL")); + contentWindow.setTimeout(function() { try { urlField.focus(); } catch(e) { } }, 0); + + return false; + } + + return true; + } + + return false; + }, + + _create_callback: function(ok) { + var editor = this._designPanel; + + try { + if(ok) { + var aList = editor._doc.getElementsByTagName("A"), + aNumber = 0; + + for(var i = 0; i < aList.length; i++) { + var good = true, + a = aList[i]; + + for(var j = 0; j < this._oldList.length; j++) + if(a == this._oldList[j]) { + good = false; + break; + } + + if(!good) + continue; + + aNumber = i; + if(this._obj.target) + a.target = this._obj.target; + + a.href = this._obj.href; + if(this._obj.title.length > 0) + a.title = this._obj.title; + } + + if(this._txt) + this._txt.data = this._obj.href; + + if(aList.length > 0) { + var elka = aList[aNumber], + _span = editor._doc.createElement("span"); + + _span.innerHTML = " "; + + if(elka.nextSibling != null) + elka.parentNode.insertBefore(_span, elka.nextSibling); + else + elka.parentNode.appendChild(_span); + + setTimeout(function() { + Sys.Extended.UI.HtmlEditor._setCursor(_span, editor); + + setTimeout(function() { + elka.parentNode.removeChild(_span); + }, 0); + }, 0); + } + + setTimeout(function() { editor._editPanel.updateToolbar(); editor.onContentChanged(); }, 0); + } else { + editor._undo(false); + editor.__stack.pop(); + + if(this._txt) { + editor._undo(false); + editor.__stack.pop(); + } + } + + editor.focusEditor(); + } catch(e) { } + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.InsertLink", Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Italic.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Italic.debug.js new file mode 100644 index 000000000..b379b1c0c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Italic.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("italic", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._queryCommandState("italic"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Italic", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyCenter.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyCenter.debug.js new file mode 100644 index 000000000..ae96d23df --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyCenter.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter.prototype = { + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState("center"); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("JustifyCenter"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyCenter", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyFull.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyFull.debug.js new file mode 100644 index 000000000..c8e3481c6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyFull.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull.prototype = { + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState("justify"); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("JustifyFull"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyFull", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyLeft.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyLeft.debug.js new file mode 100644 index 000000000..a50fd70b8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyLeft.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft.prototype = { + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState("left"); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("JustifyLeft"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyLeft", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyRight.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyRight.debug.js new file mode 100644 index 000000000..c3f1f8f7c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.JustifyRight.debug.js @@ -0,0 +1,24 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight.prototype = { + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState("right"); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("JustifyRight"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.JustifyRight", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Ltr.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Ltr.debug.js new file mode 100644 index 000000000..cf775a31b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Ltr.debug.js @@ -0,0 +1,39 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr.callBaseMethod(this, "callMethod")) + return false; + this._designPanel._doc.body.style.direction = (!this.checkState()) ? "" : "rtl"; + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._designPanel._getSelection(), + range = this._designPanel._createRange(sel); + + this._designPanel._removeAllRanges(sel); + this._designPanel._selectRange(sel, range); + this._designPanel.focusEditor(); + } + + var button = this; + setTimeout(function() { + button._editPanel.updateToolbar(); + }, 0); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr.callBaseMethod(this, "checkState")) + return false; + if(!(this._designPanel._doc.body.style.direction && this._designPanel._doc.body.style.direction == "rtl")) + return true; + + return false; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Ltr", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.MethodButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.MethodButton.debug.js new file mode 100644 index 000000000..bf9b87b22 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.MethodButton.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton.prototype = { +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ModeButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ModeButton.debug.js new file mode 100644 index 000000000..f4dfe4cba --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.ModeButton.debug.js @@ -0,0 +1,36 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor"); +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton.initializeBase(this, [element]); + + this._activeMode = Sys.Extended.UI.HtmlEditor.ActiveModeType.Design; +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton.prototype = { + get_activeMode: function() { + return this._activeMode; + }, + + set_activeMode: function(value) { + this._activeMode = value; + }, + + _onclick: function(e) { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton.callBaseMethod(this, "_onclick")) + return false; + + var modeButton = this; + setTimeout(function() { + modeButton._editPanel.set_activeMode(modeButton._activeMode); + }, 0); + + return true; + }, + + onEditPanelActivity: function() { + this.setActivity(this._editPanel.get_activeMode() == this._activeMode); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OkCancelPopupButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OkCancelPopupButton.debug.js new file mode 100644 index 000000000..e2a07ddc7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OkCancelPopupButton.debug.js @@ -0,0 +1,79 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton.prototype = { + + set_activeEditPanel: function(value) { + if(this._editPanel != value && this._editPanel != null) { + var relatedPopup = this.get_relatedPopup(); + + if(typeof relatedPopup._forceImClose == "function") { + var func = relatedPopup._forceImClose; + func(relatedPopup._iframe.contentWindow); + } + } + Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton.callBaseMethod(this, "set_activeEditPanel", [value]); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton.callBaseMethod(this, "callMethod")) + return false; + + this.openPopup(Function.createDelegate(this, this._onopened)); + + return true; + }, + + _onopened: function(contentWindow) { + contentWindow.popupMediator.set_callMethodByName("OK", Function.createDelegate(this, this._onOK)); + contentWindow.popupMediator.set_callMethodByName("Cancel", Function.createDelegate(this, this._onCancel)); + + var relatedPopup = this.get_relatedPopup(); + relatedPopup._popup = this._designPanel._popup; + relatedPopup._forceImClose = Function.createDelegate(this, this._onCancel); + + this._designPanel._popup = this.get_relatedPopup(); + this.opened(contentWindow); + }, + + opened: function(contentWindow) { + }, + + _onOK: function(contentWindow) { + if(this.okCheck(contentWindow)) + this._exit(Function.createDelegate(this, this.ok), contentWindow); + }, + + _onCancel: function(contentWindow) { + if(this.cancelCheck(contentWindow)) + this._exit(Function.createDelegate(this, this.cancel), contentWindow); + }, + + _exit: function(callback, contentWindow) { + this.closePopup(); + this._designPanel._popup = this.get_relatedPopup()._popup; + this.get_relatedPopup()._popup = null; + this.get_relatedPopup()._forceImClose = null; + + callback(contentWindow); + }, + + ok: function(contentWindow) { + }, + + cancel: function(contentWindow) { + }, + + okCheck: function(contentWindow) { + return true; + }, + + cancelCheck: function(contentWindow) { + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.OkCancelPopupButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OrderedList.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OrderedList.debug.js new file mode 100644 index 000000000..ec4f9e891 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.OrderedList.debug.js @@ -0,0 +1,16 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("InsertOrderedList"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.OrderedList", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paragraph.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paragraph.debug.js new file mode 100644 index 000000000..3a4f0fbfd --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paragraph.debug.js @@ -0,0 +1,23 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph.prototype = { + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState(""); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._execCommand("Paragraph"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paragraph", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paste.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paste.debug.js new file mode 100644 index 000000000..d2d4fd041 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Paste.debug.js @@ -0,0 +1,39 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste.prototype = { + canBeShown: function() { + return Sys.Extended.UI.HtmlEditor.isIE; + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + editor._saveContent(); + editor.openWait(); + setTimeout(function() { + editor._paste(true); editor.closeWait(); + }, 0) + } else { + var sel = editor._getSelection(), + range = editor._createRange(sel); + + editor._removeAllRanges(sel); + + alert(String.format(Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_Use_verb, (Sys.Extended.UI.HtmlEditor.isSafari && navigator.userAgent.indexOf("mac") != -1) ? "Apple-V" : "Ctrl-V")); + + editor._selectRange(sel, range); + editor.isWord = false; + editor.isPlainText = false; + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Paste", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteText.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteText.debug.js new file mode 100644 index 000000000..45dc6ec9b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteText.debug.js @@ -0,0 +1,39 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + editor._saveContent(); + editor.openWait(); + setTimeout(function() { + editor._paste(false); editor.closeWait(); + }, 0) + } else { + var sel = editor._getSelection(), + range = editor._createRange(sel), + useVerb = String.format(Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_Use_verb, (Sys.Extended.UI.HtmlEditor.isSafari && navigator.userAgent.indexOf("mac") != -1) ? "Apple-V" : "Ctrl-V"), + mess = String.format(Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_OnPastePlainText, useVerb); + + alert(mess); + + setTimeout(function() { + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + }, 0); + + editor.isPlainText = true; + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteText", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteWord.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteWord.debug.js new file mode 100644 index 000000000..895572e7d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PasteWord.debug.js @@ -0,0 +1,39 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + if(Sys.Extended.UI.HtmlEditor.isIE) { + editor._saveContent(); + editor.openWait(); + setTimeout(function() { + editor._paste(true, true); editor.closeWait(); + }, 0) + } else { + var sel = editor._getSelection(), + range = editor._createRange(sel), + useVerb = String.format(Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_Use_verb, (Sys.Extended.UI.HtmlEditor.isSafari && navigator.userAgent.indexOf("mac") != -1) ? "Apple-V" : "Ctrl-V"), + mess = String.format(Sys.Extended.UI.Resources.HtmlEditor_toolbar_button_OnPasteFromMSWord, useVerb); + + alert(mess); + + setTimeout(function() { + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + }, 0); + + editor.isWord = true; + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.PasteWord", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PreviewMode.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PreviewMode.debug.js new file mode 100644 index 000000000..44431ded6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.PreviewMode.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PreviewMode = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.PreviewMode.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PreviewMode.prototype = { +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.PreviewMode.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.PreviewMode", Sys.Extended.UI.HtmlEditor.ToolbarButtons.ModeButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Redo.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Redo.debug.js new file mode 100644 index 000000000..fd6afd33b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Redo.debug.js @@ -0,0 +1,16 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel.redo(); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Redo", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveAlignment.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveAlignment.debug.js new file mode 100644 index 000000000..df81dd4f8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveAlignment.debug.js @@ -0,0 +1,32 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment.prototype = { + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment.callBaseMethod(this, "checkState")) + return false; + + return this._designPanel._textAlignState(null); + }, + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel, + editPanel = this._editPanel; + + editor._saveContent(); + editor.MSIE_justify("left", true); + editor.onContentChanged(); + + setTimeout(function() { + editPanel.updateToolbar(); + }, 0); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveAlignment", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveLink.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveLink.debug.js new file mode 100644 index 000000000..1ffb13811 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveLink.debug.js @@ -0,0 +1,44 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel, + sel = editor._getSelection(), + range = editor._createRange(sel), + parent = Sys.Extended.UI.HtmlEditor.getSelParent(editor); + + if(parent.nodeType == 3) + parent = parent.parentNode; + + while(parent && Sys.Extended.UI.HtmlEditor.isStyleTag(parent.tagName) && parent.tagName.toUpperCase() != "A") + parent = parent.parentNode; + + if(parent && parent.tagName.toUpperCase() == "A") { + editor._saveContent(); + var el = parent.firstChild; + + while(parent.firstChild) + parent.parentNode.insertBefore(parent.firstChild, parent); + + parent.parentNode.removeChild(parent); + if(el) + Sys.Extended.UI.HtmlEditor._setCursor(el, editor); + + setTimeout(function() { + editor._editPanel.updateToolbar(); + }, 0); + + editor.onContentChanged(); + } + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveLink", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveStyles.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveStyles.debug.js new file mode 100644 index 000000000..17f8a4123 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.RemoveStyles.debug.js @@ -0,0 +1,393 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.callBaseMethod(this, "callMethod")) + return false; + + var editor = this._designPanel; + + setTimeout(function() { + var selectedHTML = (!Sys.Extended.UI.HtmlEditor.isIE) ? Sys.Extended.UI.HtmlEditor.Trim(editor.getSelectedHTML()) : "", + sel = editor._getSelection(), + range = editor._createRange(sel), + rng = null, + expanded = false; + + if(!editor.isControl() && ((Sys.Extended.UI.HtmlEditor.isIE && range.text.length > 0) || (!Sys.Extended.UI.HtmlEditor.isIE && selectedHTML.length > 0))) { + rng = editor._getTextNodeCollection(); + } else { + rng = editor._tryExpand(); + expanded = true; + } + + if(rng != null && rng.length > 0) { + var changed = false, // document tree changing indicator + _found = true, // style tag deleting indicator + _text = null; + + editor._saveContent(); // for undo + + var span1 = editor._doc.createElement("span"); + span1.id = "_left_"; + + var span2 = editor._doc.createElement("span"); + span2.id = "_right_"; + + var par1 = rng[0].parentNode, + par2 = rng[rng.length - 1].parentNode; + + par1.insertBefore(span1, rng[0]); + + if(rng[rng.length - 1].nextSibling) + par2.insertBefore(span2, rng[rng.length - 1].nextSibling); + else + par2.appendChild(span2); + + while(_found) { // while there were tags' deletings + _found = false; // reset the indicator + + for(var i = 0; i < rng.length; i++) { // inspect all TextNodes + var par = rng[i].parentNode; + + // if the TextNode still have a parent + if(par) { + // it's the first node in his parent + if(rng[i].previousSibling == null && rng[i].nextSibling == null) { + var tag = par.tagName.toUpperCase(); + + // parent can be a style tag only + if(Sys.Extended.UI.HtmlEditor.isStyleTag(tag) && (tag != "A") && (par.className != Sys.Extended.UI.HtmlEditor.smartClassName || tag.substr(0, 1) == "H")) { + // it is what we need ! + + // have the parent attributes? + var _attrs = Sys.Extended.UI.HtmlEditor.differAttr(par, ["class", "color", "face", "size"]); + + // changes will be now + changed = true; + + // if there aren't attributes - we can delete the tag + // and move his chieldren to parent + if(_attrs.length == 0) { + var parent = par.parentNode, + el = (par.firstChild) ? par.firstChild : null, + P = null; + + if(tag.toUpperCase().substr(0, 1) == "H" && (Sys.Extended.UI.HtmlEditor.isIE)) { + P = editor._doc.createElement("p"); + P.className = Sys.Extended.UI.HtmlEditor.smartClassName; + + parent.insertBefore(P, par); + + while(par.firstChild) // chieldren moving + P.appendChild(par.firstChild); + } else { + while(par.firstChild) // chieldren moving + parent.insertBefore(par.firstChild, par); + + if(tag.toUpperCase().substr(0, 1) == "H") { + var br = editor._doc.createElement("br"); + parent.insertBefore(br, par); + } + } + + parent.removeChild(par); + _found = true; // set indicator + } else { // we can't remove the tag - cleaning only + var parent = par.parentNode; + + // create the new same tag + var nel = editor._doc.createElement(tag); + + // set it's attributes + for(var j = 0; j < _attrs.length; j++) + nel.setAttribute(_attrs[j][0], _attrs[j][1]); + + // insert the clone instead the old tag + // (no ClassName, no Styles) + + parent.insertBefore(nel, par); + while(par.firstChild) + nel.appendChild(par.firstChild); + + parent.removeChild(par); + } + } + } + } + } + } + + for(var i = 0; i < rng.length; i++) { // inspect all TextNodes + var el = rng[i], + _prn = (rng[i].parentNode != null && typeof rng[i].parentNode != "undefined") ? rng[i].parentNode : null; + + // if the TextNode still have a parent + if(_prn) { + // now try to cut this Text node from arround style tags + var _fnd = null; + + // look for the upper style parent + while(_prn && _prn.tagName && _prn.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(_prn.tagName) && (_prn.tagName.toUpperCase() != "A") + && Sys.Extended.UI.HtmlEditor.differAttr(_prn, ["class", "color", "face", "size"]).length == 0) { + _fnd = _prn; + _prn = _prn.parentNode; + } + + // if such parent is found + if(_fnd) { + // changes will be now + changed = true; + + function diver(add, el, rpr, before) { + var par = rpr.cloneNode(false); + + if(add) { + if(add.push && typeof add.push == "function") + for(var iii = 0; iii < add.length; iii++) + par.appendChild(add[iii]); + else + par.appendChild(add); + } + + while(el) { + var elSibling = before ? el.previousSibling : el.nextSibling; + + if(el.nodeType == 1 || (el.nodeType == 3 && Sys.Extended.UI.HtmlEditor.Trim("" + el.data + "").length > 0)) { + if(el.nodeType == 1) { + if(Sys.Extended.UI.HtmlEditor.isStyleTag(el.tagName) && (el.tagName.toUpperCase() != "A") && (!el.id || (el.id != "_left_" && el.id != "_right_"))) + Sys.Extended.UI.HtmlEditor.spanJoiner(el); + + if(Sys.Extended.UI.HtmlEditor.isStyleTag(el.tagName) && el.childNodes.length == 0 && (!el.id || (el.id != "_left_" && el.id != "_right_"))) + el = null; + } + + if(el) + if(par.childNodes.length == 0 || !before) + par.appendChild(el); + else + par.insertBefore(el, par.firstChild); + } + el = elSibling; + } + + if(par.childNodes.length == 0) { + delete par; + par = null; + } else if(par.childNodes.length == 1 && par.firstChild.nodeType == 3 && ("" + par.firstChild.data + "").length == 0) { + delete par; + par = null; + } else { + if(Sys.Extended.UI.HtmlEditor.isStyleTag(par.tagName)) { + var elNumber = par.childNodes.length; + for(var cnt = 0; cnt < par.childNodes.length; cnt++) { + var inn = par.childNodes.item(cnt); + + if(inn.nodeType == 1 && !Sys.Extended.UI.HtmlEditor.isStyleTag(inn.tagName)) + elNumber--; + } + + if(elNumber == 0) { + var parr = []; + while(par.firstChild) { + var inn = par.removeChild(par.firstChild); + parr.push(inn); + } + par = parr; + } + } + } + + if(rpr == _fnd) + return par; + else + return diver(par, before ? rpr.previousSibling : rpr.nextSibling, rpr.parentNode, before); + }; + + _prn = el.parentNode; + + if(el.previousSibling == null && el.nextSibling == null && + _prn && _prn.tagName && _prn.tagName.toUpperCase() != "BODY" && Sys.Extended.UI.HtmlEditor.isStyleTag(_prn.tagName) && + Sys.Extended.UI.HtmlEditor.differAttr(_prn, ["class", "color", "face", "size"]).length > 0) + el = _prn; + + + // create neibouring style tags for this Text node + var p1 = diver(null, el.previousSibling, el.parentNode, true), + p2 = diver(null, el.nextSibling, el.parentNode, false); + + var par = _fnd.parentNode; + if(p1) { + if(p1.push && typeof p1.push == "function") { + for(var iii = 0; iii < p1.length; iii++) + par.insertBefore(p1[iii], _fnd); + } else { + par.insertBefore(p1, _fnd); + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + span1 = editor._doc.getElementById("_left_"); + span2 = editor._doc.getElementById("_right_"); + } + } + + par.insertBefore(el, _fnd); + if(p2) { + if(p2.push && typeof p2.push == "function") { + for(var iii = 0; iii < p2.length; iii++) + par.insertBefore(p2[iii], _fnd); + } else { + par.insertBefore(p2, _fnd); + } + + if(Sys.Extended.UI.HtmlEditor.isIE) { + span1 = editor._doc.getElementById("_left_"); + span2 = editor._doc.getElementById("_right_"); + } + } + + par.removeChild(_fnd); + } + } + } + + if(expanded) { + if(Sys.Extended.UI.HtmlEditor.isIE && editor.__saveBM__ != null) { + try { + var ppp = span1.parentNode; + ppp.removeChild(span1); + + while(ppp && ppp.childNodes.length == 0) { + ppp.parentNode.removeChild(ppp); + ppp = ppp.parentNode; + } + + ppp = span2.parentNode; + ppp.removeChild(span2); + + while(ppp && ppp.childNodes.length == 0) { + ppp.parentNode.removeChild(ppp); + ppp = ppp.parentNode; + } + + span1 = null; + span2 = null; + } catch(e) { } + + var sel = editor._getSelection(); + var range = editor._createRange(sel); + + range.moveToBookmark(editor.__saveBM__); + range.select(); + + editor.__saveBM__ = null; + } else if(editor.__saveBM__ != null) { + if(editor.__saveBM__[0].nodeType == 3) { + var sel = editor._getSelection(); + var range = editor._doc.createRange(); + + range.setStart(editor.__saveBM__[0], editor.__saveBM__[1]); + range.setEnd(editor.__saveBM__[0], editor.__saveBM__[1]); + + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + } else { + editor._trySelect(editor.__saveBM__[0], editor.__saveBM__[0]); + editor.__saveBM__[0].parentNode.removeChild(editor.__saveBM__[0]); + } + + editor.__saveBM__ = null; + } + } else if(!Sys.Extended.UI.HtmlEditor.isIE) { + rng = []; + var _found = false; + + function _diver(_point, prize) { + while(_point) { + if(_point == span2) { + _found = true; + return; + } + + if(_point.nodeType == 3) { + while(_point.nextSibling && _point.nextSibling.nodeType == 3) { + _point.data = "" + _point.data + "" + _point.nextSibling.data + ""; + _point.parentNode.removeChild(_point.nextSibling); + } + + if(Sys.Extended.UI.HtmlEditor.Trim("" + _point.data + "").length > 0) + rng.push(_point); + } else + _diver(_point.firstChild, false); + + if(_found) + return; + + var _save = _point.parentNode; + + if(prize) + while(_point && _point.nextSibling == null) + _point = _point.parentNode; + + _point = _point.nextSibling; + } + } + + _diver(span1, true); + + range = editor._doc.createRange(); + range.setStart(rng[0], 0); + range.setEnd(rng[rng.length - 1], ("" + rng[rng.length - 1].data + "").length); + + editor._removeAllRanges(sel); + editor._selectRange(sel, range); + } else { + try { + sel = editor._getSelection(); + var range1 = editor._createRange(sel); + var range2 = editor._createRange(sel); + + range1.moveToElementText(span1); + range2.moveToElementText(span2); + + range1.setEndPoint("EndToEnd", range2); + range1.select(); + } catch(e) { } + } + + try { + var ppp; + if(span1 != null) { + ppp = span1.parentNode; + ppp.removeChild(span1); + + while(ppp && ppp.childNodes.length == 0) { + ppp.parentNode.removeChild(ppp); + ppp = ppp.parentNode; + } + } + + if(span2 != null) { + ppp = span2.parentNode; + ppp.removeChild(span2); + + while(ppp && ppp.childNodes.length == 0) { + ppp.parentNode.removeChild(ppp); + ppp = ppp.parentNode; + } + } + } catch(e) { } + + editor.onContentChanged(); + editor._editPanel.updateToolbar(); + } + }, 0); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Rtl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Rtl.debug.js new file mode 100644 index 000000000..0b1e390f8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Rtl.debug.js @@ -0,0 +1,41 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl.prototype = { + + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl.callBaseMethod(this, "callMethod")) + return false; + + this._designPanel._doc.body.style.direction = (!this.checkState()) ? "rtl" : ""; + + if(!Sys.Extended.UI.HtmlEditor.isIE) { + var sel = this._designPanel._getSelection(), + range = this._designPanel._createRange(sel); + + this._designPanel._removeAllRanges(sel); + this._designPanel._selectRange(sel, range); + this._designPanel.focusEditor(); + } + + var button = this; + setTimeout(function() { + button._editPanel.updateToolbar(); + }, 0); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl.callBaseMethod(this, "checkState")) + return false; + + if(this._designPanel._doc.body.style.direction && this._designPanel._doc.body.style.direction == "rtl") + return true; + + return false; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Rtl", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SelectButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SelectButton.debug.js new file mode 100644 index 000000000..b6dc60bef --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SelectButton.debug.js @@ -0,0 +1,70 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.initializeBase(this, [element]); + + this._onclick_option$delegate = Function.createDelegate(this, this._onclick_option); + this._onchange$delegate = Function.createDelegate(this, this._onchange); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.prototype = { + + initialize: function() { + var nodeId = this.get_element().id; + Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.callBaseMethod(this, "initialize"); + this._select = $get(nodeId + "_select"); + + $addHandler(this._select, "change", this._onchange$delegate); + for(var i = 0; i < this._select.options.length; i++) { + var option = this._select.options[i]; + $addHandler(option, "click", this._onclick_option$delegate); + } + }, + + dispose: function() { + for(var i = 0; i < this._select.options.length; i++) { + var option = this._select.options[i]; + $removeHandler(option, "click", this._onclick_option$delegate); + } + + $removeHandler(this._select, "change", this._onchange$delegate); + Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.callBaseMethod(this, "dispose"); + }, + + isImage: function() { + return false; + }, + + callMethod: function(select, e) { + return true; + }, + + _onclick_option: function(e) { + if(!this.isEnable()) + return false; + + var option = e.target; + option.parentNode.value = option.value; + Sys.Extended.UI.HtmlEditor._stopEvent(e); + + if(!Sys.Extended.UI.HtmlEditor.isSafari) + return false; + + this.callMethod(option.parentNode, e); + + return true; + }, + + _onchange: function(e) { + if(!this.isEnable()) + return false; + + var select = e.target; + Sys.Extended.UI.HtmlEditor._stopEvent(e); + this.callMethod(select, e); + + return true; + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton", Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Selector.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Selector.debug.js new file mode 100644 index 000000000..e233235a8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Selector.debug.js @@ -0,0 +1,10 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector.prototype = { +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Selector", Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModePopupImageButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.StrikeThrough.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.StrikeThrough.debug.js new file mode 100644 index 000000000..847b1db03 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.StrikeThrough.debug.js @@ -0,0 +1,19 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough.callBaseMethod(this, "callMethod")) return false; + this._designPanel._execCommand("strikeThrough", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough.callBaseMethod(this, "checkState")) return false; + return this._designPanel._queryCommandState("strikeThrough"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.StrikeThrough", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SubScript.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SubScript.debug.js new file mode 100644 index 000000000..c62086df1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SubScript.debug.js @@ -0,0 +1,19 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript.callBaseMethod(this, "callMethod")) return false; + this._designPanel._execCommand("subScript", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript.callBaseMethod(this, "checkState")) return false; + return this._designPanel._queryCommandState("subScript"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.SubScript", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SuperScript.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SuperScript.debug.js new file mode 100644 index 000000000..ada70d4b1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.SuperScript.debug.js @@ -0,0 +1,19 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript.callBaseMethod(this, "callMethod")) return false; + this._designPanel._execCommand("superScript", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript.callBaseMethod(this, "checkState")) return false; + return this._designPanel._queryCommandState("superScript"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.SuperScript", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Underline.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Underline.debug.js new file mode 100644 index 000000000..89bab6d52 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Underline.debug.js @@ -0,0 +1,19 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline.callBaseMethod(this, "callMethod")) return false; + this._designPanel._execCommand("underline", false, null); + }, + + checkState: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline.callBaseMethod(this, "checkState")) return false; + return this._designPanel._queryCommandState("underline"); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Underline", Sys.Extended.UI.HtmlEditor.ToolbarButtons.EditorToggleButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Undo.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Undo.debug.js new file mode 100644 index 000000000..5a214646e --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditor.ToolbarButtons.Undo.debug.js @@ -0,0 +1,14 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"); + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo = function(element) { + Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo.initializeBase(this, [element]); +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo.prototype = { + callMethod: function() { + if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo.callBaseMethod(this, "callMethod")) return false; + this._designPanel.undo(); + } +} + +Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.Undo", Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js new file mode 100644 index 000000000..517aeb71b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js @@ -0,0 +1,1191 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) { + Sys.Extended.UI.HtmlEditorExtenderBehavior.initializeBase(this, [element]); + this._textbox = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(element); + + var id = this.get_id(); + + this._backColor = null; + this._foreColor = null; + this._commandName = null; + this._savedRange = null; + this._isInFocus = null; + this._oldContents = null; + this._newContents = null; + + /// + /// Flag indicating that HtmlEditorExtender content is changed + /// + /// get_isDirty + /// + this._isDirty = false; + this._viewMode = 'content'; + + /// + /// Determines whether or not to display a source view tab/button to see the source view of HtmlEditorExtender + /// + /// get_displaySourceTab + /// set_displaySourceTab + /// + this._displaySourceTab = false; + + /// + /// Button width in pixels + /// + /// get_buttonWidth + /// set_buttonWidth + /// + this._ButtonWidth = 23; + + /// + /// Button height in pixels + /// + /// get_buttonHeight + /// set_buttonHeight + /// + this._ButtonHeight = 21; + + //Templates + this._containerTemplate = { + nodeName: 'div', + properties: { + id: id + '_ExtenderContainer' + }, + cssClasses: ['unselectable', 'ajax__html_editor_extender_container'] + }; + + this._editableTemplate = { + nodeName: 'div', + properties: { + id: id + '_ExtenderContentEditable', + style: { + //height: '60%', + overflow: 'auto', + clear: 'both' + }, + contentEditable: true + }, + cssClasses: ['ajax__html_editor_extender_texteditor'] + }; + + this._sourceViewTemplate = { + nodeName: 'div', + properties: { + id: id + '_ExtenderSourceView', + style: { + height: '90%', + overflow: 'auto', + clear: 'both' + }, + contentEditable: true + }, + cssClasses: ['ajax__html_editor_extender_texteditor'] + }; + + this._buttonTemplate = { + nodeName: 'input', + properties: { + type: 'button', + style: { + width: this._ButtonWidth + 'px', + height: this._ButtonHeight + 'px' + } + }, + cssClasses: ['ajax__html_editor_extender_button'] + }; + + this._buttonContentTemplate = { + nodeName: 'input', + properties: { + type: 'button', + style: { + width: this._ButtonWidth + 'px', + height: this._ButtonHeight + 'px' + } + }, + cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_content'] + }; + + this._buttonSourceTemplate = { + nodeName: 'input', + properties: { + type: 'button', + style: { + width: this._ButtonWidth + 'px', + height: this._ButtonHeight + 'px' + } + }, + cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_source'] + }; + + this._textboxTemplate = { + nodeName: 'input', + properties: { + type: 'text' + } + }; + + this._dropDownTemplate = { + nodeName: 'select', + properties: { + style: { + width: this._ButtonWidth + 'px', + height: this._ButtonHeight + 'px' + } + }, + cssClasses: ['ajax__html_editor_extender_button'] + }; + + this._topButtonContainerTemplate = { + nodeName: 'div', + properties: { + id: id + '_ExtenderButtonContainer' + }, + cssClasses: ['ajax__html_editor_extender_buttoncontainer'] + }; + + this._topButtonContainerTemplate2 = { + nodeName: 'div', + properties: { + id: id + '_ExtenderButtonContainer2', + style: { + clear: 'both' + } + }, + cssClasses: ['ajax__html_editor_extender_buttoncontainer2'] + }; + + // variables + this._container = null; + + /// + /// A collection of toolbar buttons + /// + /// get_toolbarButtons + /// set_toolbarButtons + /// + this._toolbarButtons = null; + this._editableDiv = null; + this._sourceViewDiv = null; + this._topButtonContainer = null; + this._topButtonContainer2 = null; + this._buttons = []; + this._requested_buttons = new Array(); + this._colorPicker = null; + this._txtBoxForColor = null; + this._contentViewButton = null; + this._sourceViewButton = null; + this._popupDiv = null; + this._btnDone = null; + this._btnCancel = null; + this._isFocusInEditableDiv = false; + this._textBoxOnBlurDelegate = null; + this._editableDivOnBlurDelegate = null; + this._editableDivOnFocusDelegate = null; + this._btnClickDelegate = null; + this._contentViewClickDelegate = null; + this._sourceViewClickDelegate = null; + this._sourceViewDivOnBlurDelegate = null; + this._imageCancelClickDelegate = null; + + // Hook into the ASP.NET WebForm_OnSubmit function to encode html tags prior to submission + if((typeof (WebForm_OnSubmit) == 'function') && !Sys.Extended.UI.HtmlEditorExtenderBehavior._originalWebForm_OnSubmit) { + Sys.Extended.UI.HtmlEditorExtenderBehavior._originalWebForm_OnSubmit = WebForm_OnSubmit; + WebForm_OnSubmit = Sys.Extended.UI.HtmlEditorExtenderBehavior.WebForm_OnSubmit; + } +}; + +Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.HtmlEditorExtenderBehavior.callBaseMethod(this, 'initialize'); + HtmlEditorExtender_editableDivs[HtmlEditorExtender_editableDivs.length] = this; + + this._button_list = new Array(); + this._createContainer(); + this._createTopButtonContainer(); + this._createButton(); + this._createEditableDiv(); + + if(this.get_displaySourceTab()) { + this._createSourceViewDiv(); + this._createTopButtonContainer2(); + } + + // get form that contains textbox + var formElement = this._textbox._element.parentNode; + while(formElement != null && formElement.nodeName != 'FORM') + formElement = formElement.parentNode; + + if(formElement == null) + throw 'Missing Form tag'; + + var id = this.get_id(); + this._popupDiv = $get(id + '_popupDiv'); + if(this._popupDiv == null) { + if(id.indexOf('_') != -1) + id = id.substring(id.lastIndexOf('_') + 1); + else + id = ''; + + this._popupDiv = $get(id + '_popupDiv'); + } + + if(this._popupDiv != null) { + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, { 'id': id + '_ImagePopupBehavior', 'parentElement': this.get_element(), 'unselectable': 'on' }, null, null, this._popupDiv); + this._btnCancel = $get(id + '_btnCancel'); + this._imageCancelClickDelegate = Function.createDelegate(this, this._btnCancel_click); + + $addHandler(this._btnCancel, 'click', this._imageCancelClickDelegate, true); + this._elementVisible(this._popupDiv, false); + } + + // delegates + this._textBoxOnBlurDelegate = Function.createDelegate(this, this._textBox_onblur); + this._editableDivOnBlurDelegate = Function.createDelegate(this, this._editableDiv_onblur); + this._editableDivOnFocusDelegate = Function.createDelegate(this, this._editableDiv_onfocus); + this._btnClickDelegate = Function.createDelegate(this, this._executeCommand); + + if(this.get_displaySourceTab()) { + this._contentViewClickDelegate = Function.createDelegate(this, this._contentView_click); + this._sourceViewClickDelegate = Function.createDelegate(this, this._sourceView_click); + this._sourceViewDivOnBlurDelegate = Function.createDelegate(this, this._sourceViewDiv_onblur); + } + + // handlers + $addHandler(this._textbox._element, 'blur', this._textBoxOnBlurDelegate, true); + $addHandler(this._editableDiv, 'blur', this._editableDivOnBlurDelegate, true); + $addHandler(this._editableDiv, 'focus', this._editableDivOnFocusDelegate, true); + $addHandler(this._topButtonContainer, 'click', this._btnClickDelegate, true); + + if(this.get_displaySourceTab()) { + $addHandler(this._contentViewButton, 'click', this._contentViewClickDelegate, true); + $addHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate, true); + $addHandler(this._sourceViewDiv, 'blur', this._sourceViewDivOnBlurDelegate, true); + } + }, + + _dispose: function() { + $removeHandler(this._textbox._element, 'blur', this._textBoxOnBlurDelegate); + $removeHandler(this._editableDiv, 'blur', this._editableDivOnBlurDelegate); + $removeHandler(this._editableDiv, 'focus', this._editableDivOnFocusDelegate); + $removeHandler(this._topButtonContainer, 'click', this._btnClickDelegate); + + if(this.get_displaySourceTab()) { + $removeHandler(this._contentViewButton, 'click', this._contentViewClickDelegate); + $removeHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate); + $removeHandler(this._sourceViewDiv, 'blur', this._sourceViewDivOnBlurDelegate); + } + + if(this._popupDiv != null) + $removeHandler(this._btnCancel, 'click', this._imageCancelClickDelegate); + + Sys.Extended.UI.HtmlEditorExtenderBehavior.callBaseMethod(this, 'dispose'); + }, + + _createContainer: function() { + var e = this.get_element(); + this._container = $common.createElementFromTemplate(this._containerTemplate, e.parentNode); + + this._elementVisible(this._textbox._element, true); + + var bounds = $common.getBounds(this._textbox._element); + $common.setSize(this._container, { + width: bounds.width, + height: bounds.height + }); + + this._elementVisible(this._textbox._element, false); + + $common.wrapElement(this._textbox._element, this._container, this._container); + }, + + _createTopButtonContainer: function() { + this._topButtonContainer = $common.createElementFromTemplate(this._topButtonContainerTemplate, this._container); + }, + + _createButton: function() { + var isIE = Sys.Browser.agent == Sys.Browser.InternetExplorer; + for(i = 0; i < this._toolbarButtons.length; i++) { + var _btn; + + if(this._toolbarButtons[i].CommandName == 'HorizontalSeparator') { + _btn = $common.createElementFromTemplate({ + nodeName: "span", + cssClasses: ['ajax__html_editor_extender_separator'] + }, this._topButtonContainer); + } else if(this._toolbarButtons[i].CommandName == 'FontName') { + _btn = $common.createElementFromTemplate({ + nodeName: "nobr", + properties: { + style: { + float: 'left', + cssFloat: 'left', + fontSize: '11px' + } + }, + cssClasses: ['ajax__html_editor_extender_fontnameclass'], + children: [{ + nodeName: "span", + properties: { + textContent: "Font ", + innerText: "Font ", + style: { + paddingLeft: '5px', + fontWeight: 'bold' + } + } + }] + }, this._topButtonContainer); + + _select = $common.createElementFromTemplate({ + nodeName: "select", + properties: { + style: { + fontSize: '9px', + fontFamily: 'Arial', + height: "20px", + width: '90px' + } + }, + events: { + change: function(e) { + var value = this.options[this.selectedIndex].value; + setTimeout(function() { + document.execCommand("fontname", false, value); + }, 200); + } + } + }, _btn); + + var option = [ + { Text: "Arial", Value: "arial,helvetica,sans-serif" }, + { Text: "Courier New", Value: "courier new,courier,monospace" }, + { Text: "Georgia", Value: "georgia,times new roman,times,serif" }, + { Text: "Tahoma", Value: "tahoma,arial,helvetica,sans-serif" }, + { Text: "Times New Roman", Value: "times new roman,times,serif" }, + { Text: "Verdana", Value: "verdana,arial,helvetica,sans-serif" }, + { Text: "Impact", Value: "impact" }, + { Text: "WingDings", Value: "wingdings" } + ]; + + for(x in option) { + var elOptNew = document.createElement('option'); + + elOptNew.text = option[x].Text; + elOptNew.value = option[x].Value; + + try { + _select.add(elOptNew, null); // standards compliant; doesn't work in IE + } catch(ex) { + _select.add(elOptNew); // IE only + } + } + + _select.setAttribute('id', this._id + this._toolbarButtons[i].CommandName); + _select.setAttribute('name', this._toolbarButtons[i].CommandName); + _select.setAttribute('title', this._toolbarButtons[i].Tooltip); + _select.setAttribute('unselectable', 'on'); + } else if(this._toolbarButtons[i].CommandName == 'FontSize') { + _btn = $common.createElementFromTemplate({ + nodeName: "nobr", + properties: { + style: { + float: 'left', + cssFloat: 'left', + fontSize: '11px' + } + }, + cssClasses: ['ajax__html_editor_extender_fontsizeclass'], + children: [{ + nodeName: "span", + properties: { + textContent: "Size ", + innerText: "Size ", + style: { + paddingLeft: '5px', + fontWeight: 'bold' + } + } + }] + }, this._topButtonContainer); + + _select = $common.createElementFromTemplate({ + nodeName: "select", + properties: { + style: { + fontSize: '11px', + fontFamily: 'Arial', + height: "20px", + width: isIE ? '30px' : '50px' + } + }, + events: { + change: function(e) { + var value = this.options[this.selectedIndex].value; + setTimeout(function() { + document.execCommand("fontsize", false, value); + }, 200); + } + } + }, _btn); + + var option = [ + { Text: "1", Value: "1" }, + { Text: "2", Value: "2" }, + { Text: "3", Value: "3" }, + { Text: "4", Value: "4" }, + { Text: "5", Value: "5" }, + { Text: "6", Value: "6" }, + { Text: "7", Value: "7" } + ]; + + for(x in option) { + var elOptNew = document.createElement('option'); + + elOptNew.text = option[x].Text; + elOptNew.value = option[x].Value; + + try { + _select.add(elOptNew, null); // standards compliant; doesn't work in IE + } catch(ex) { + _select.add(elOptNew); // IE only + } + } + + _select.setAttribute('id', this._id + this._toolbarButtons[i].CommandName); + _select.setAttribute('name', this._toolbarButtons[i].CommandName); + _select.setAttribute('title', this._toolbarButtons[i].Tooltip); + _select.setAttribute('unselectable', 'on'); + } else if(this._toolbarButtons[i].CommandName == 'ForeColor') { + _btn = $common.createElementFromTemplate({ + nodeName: "span", + properties: { + style: { + backgroundColor: '#ff0000', + border: 'solid 1px #c2c2c2', + display: 'block', + float: 'left', + cssFloat: 'left' + } + }, + cssClasses: ['ajax__html_editor_extender_forecolorclass'] + }, this._topButtonContainer); + _btn.setAttribute('unselectable', 'on'); + + this._foreColor = $common.createElementFromTemplate({ + nodeName: 'input', + properties: { + type: 'button', + id: this._id + this._toolbarButtons[i].CommandName, + name: this._toolbarButtons[i].CommandName, + title: this._toolbarButtons[i].Tooltip, + style: { + backgroundColor: 'transparent', + width: '21px', + height: '19px', + color: 'transparent' + } + }, + cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_' + this._toolbarButtons[i].CommandName] + }, _btn); + + this._foreColor.setAttribute('unselectable', 'on'); + } else if(this._toolbarButtons[i].CommandName == 'BackColor') { + _btn = $common.createElementFromTemplate({ + nodeName: "span", + properties: { + style: { + backgroundColor: '#ff0000', + border: 'solid 1px #c2c2c2', + display: 'block', + float: 'left', + cssFloat: 'left' + } + }, + cssClasses: ['ajax__html_editor_extender_backcolorclass'] + }, this._topButtonContainer); + _btn.setAttribute('unselectable', 'on'); + + this._backColor = $common.createElementFromTemplate({ + nodeName: 'input', + properties: { + type: 'button', + id: this._id + this._toolbarButtons[i].CommandName, + name: this._toolbarButtons[i].CommandName, + title: this._toolbarButtons[i].Tooltip, + style: { + backgroundColor: 'transparent', + width: '21px', + height: '19px', + color: 'transparent' + } + }, + cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_' + this._toolbarButtons[i].CommandName] + }, _btn); + + this._backColor.setAttribute('unselectable', 'on'); + } else { + var map = { + Copy: 1, + Cut: 1, + Paste: 1 + }; + + if(Sys.Browser.agent != Sys.Browser.InternetExplorer && map[this._toolbarButtons[i].CommandName]) { + // don't render button + } else { + _btn = $common.createElementFromTemplate({ + nodeName: 'input', + properties: { + type: 'button', + id: this._id + this._toolbarButtons[i].CommandName, + name: this._toolbarButtons[i].CommandName, + title: this._toolbarButtons[i].Tooltip, + style: { + width: '23px', + height: '21px' + } + }, + cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_' + this._toolbarButtons[i].CommandName] + }, this._topButtonContainer); + _btn.setAttribute('unselectable', 'on'); + } + Array.add(this._buttons, _btn); + } + } + }, + + _createEditableDiv: function() { + var id = this.get_id(), + height; + + // need to make visible to get height if this is hidden under parent element + this._elementVisible(this._container, true); + if(this.get_displaySourceTab()) + height = this._container.clientHeight - (this._topButtonContainer.clientHeight + 25); + else + height = this._container.clientHeight - this._topButtonContainer.clientHeight; + + // make it visible false for its early stage + this._elementVisible(this._container, false); + + this._editableDiv = $common.createElementFromTemplate({ + nodeName: 'div', + properties: { + id: id + '_ExtenderContentEditable', + style: { + height: height + 'px', + overflow: 'auto', + clear: 'both' + }, + contentEditable: true + }, + cssClasses: ['ajax__html_editor_extender_texteditor'] + }, this._container); + + this._textbox._element.value = this._textbox._element.value.replace('&amp;', '&'); + this._editableDiv.innerHTML = this._textbox._element.value; + this._oldContents = this._editableDiv.innerHTML; + + $common.setVisible(this._textbox._element, false); + }, + + _createTopButtonContainer2: function() { + this._topButtonContainer2 = $common.createElementFromTemplate(this._topButtonContainerTemplate2, this._container); + this._contentViewButton = $common.createElementFromTemplate(this._buttonContentTemplate, this._topButtonContainer2); + this._sourceViewButton = $common.createElementFromTemplate(this._buttonSourceTemplate, this._topButtonContainer2); + }, + + _createSourceViewDiv: function() { + var id = this.get_id(), + height = this._container.clientHeight - 25; + + this._sourceViewDiv = $common.createElementFromTemplate({ + nodeName: 'div', + properties: { + id: id + '_ExtenderSourceView', + style: { + height: height + 'px', + overflow: 'auto', + clear: 'both' + }, + contentEditable: true + }, + cssClasses: ['ajax__html_editor_extender_texteditor'] + }, this._container); + + $common.setVisible(this._sourceViewDiv, false); + }, + + _editableDiv_onblur: function() { + this._textbox._element.value = this._encodeHtml(); + this._isFocusInEditableDiv = false; + + if(this._oldContents != this._editableDiv.innerHTML) { + this._isDirty = true; + this._oldContents = this._editableDiv.innerHTML; + this._raiseEvent('change'); + } + }, + + _editableDiv_onfocus: function() { + this._isFocusInEditableDiv = false; + }, + + _sourceViewDiv_onblur: function() { + if(this._oldContents != (this._sourceViewDiv.innerText || this._sourceViewDiv.textContent)) { + this._isDirty = true; + + if(this._sourceViewDiv.textContent != undefined) + this._editableDiv.innerHTML = this._sourceViewDiv.textContent; + else + this._editableDiv.innerHTML = this._sourceViewDiv.innerText; + + this._oldContents = this._editableDiv.innerHTML; + this._raiseEvent('change'); + } + }, + + _textBox_onblur: function() { + this._editableDiv.innerHTML = this._textbox._element.value; + }, + + _contentView_click: function() { + if(this._viewMode != 'content') { + $common.setVisible(this._topButtonContainer, true); + $common.setVisible(this._editableDiv, true); + + if(this._sourceViewDiv.textContent != undefined) + this._editableDiv.innerHTML = this._sourceViewDiv.textContent; + else + this._editableDiv.innerHTML = this._sourceViewDiv.innerText; + + this._oldContents = this._editableDiv.innerHTML; + $common.setVisible(this._sourceViewDiv, false); + this._viewMode = 'content'; + } + }, + + _sourceView_click: function() { + if(this._viewMode != 'source') { + $common.setVisible(this._sourceViewDiv, true); + + if(this._sourceViewDiv.textContent != undefined) + this._sourceViewDiv.textContent = this._editableDiv.innerHTML; + else + this._sourceViewDiv.innerText = this._editableDiv.innerHTML; + + this._oldContents = this._editableDiv.innerHTML; + $common.setVisible(this._editableDiv, false); + $common.setVisible(this._topButtonContainer, false); + this._viewMode = 'source'; + } + }, + + _btnCancel_click: function() { + this._popupBehavior.hide(); + }, + + _attributes: { + style: 'st_yle_', + size: 'si_ze_', + color: 'co_lor_', + face: 'fa_ce_', + align: 'al_ign_' + }, + + _rgbToHex: function(s) { + var a = /rgb\s?\(\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?\)/.exec(s); + + return '#' + (parseInt(a[3], 10) | (parseInt(a[2], 10) << 8) | (parseInt(a[1], 10) << 16)).toString(16); + }, + + _encodeHtml: function() { + //Encode html tags + var isIE = Sys.Browser.agent == Sys.Browser.InternetExplorer, + elements = this._editableDiv.getElementsByTagName('*'), + element; + + for(var i = 0; element = elements[i]; i++) { + try { + element.className = ''; + element.removeAttribute('class'); + } catch(ex) { } + + try { + element.id = ''; + element.removeAttribute('id'); + } catch(ex) { } + + try { + element.removeAttribute('width'); + } catch(ex) { } + } + + var html = this._editableDiv.innerHTML; + if(isIE) { + //force attributes to be double quoted + var allTags = /\<[^\>]+\>/g; + + html = html.replace(allTags, function(tag) { + var sQA = '', + nQA = ''; + + if(tag.toLowerCase().substring(0, 2) != ']*)/g; //non double quoted attributes + + return tag.replace(sQA, '="$1"').replace(nQA, '=$1'); + } else { + return tag; + } + }); + } + + //convert rgb colors to hex + var fixRGB = this._rgbToHex; + var replaceRGB = function() { + html = html.replace(/(\<[^\>]+)(rgb\s?\(\d{1,3}\s?\,\s?\d{1,3}\s?\,\s?\d{1,3}\s?\))([^\>]*\>)/gi, function(text, p1, p2, p3) { + return (p1 || '') + ((p2 && fixRGB(p2)) || '') + (p3 || ''); + }); + }; + + //twice in case a tag has more than one rgb color in it; + replaceRGB(); + replaceRGB(); + + // remove empty class and id attributes + html = html.replace(/\sclass\=\"\"/gi, '').replace(/\sid\=\"\"/gi, ''); + + //converter to convert different tags into Html5 standard tags + html = html.replace(/\<(\/?)strong\>/gi, '<$1b>').replace(/\<(\/?)em\>/gi, '<$1i>'); + + //encode for safe transport + html = html.replace(/&(?!g|lt;)/ig, '&').replace(/\xA0/ig, ' '); + html = html.replace(//ig, '>').replace(/\'/ig, ''').replace(/\"/ig, '"'); + + return html; + }, + + _editableDiv_submit: function() { + var char = 0, + selection = null; + + setTimeout(function() { + if(this._editableDiv != null) + this._editableDiv.focus(); + }, 0); + + if(Sys.Browser.agent != Sys.Browser.Firefox) { + if(document.selection) { + selection = document.selection.createRange(); + selection.moveStart('character', char); + selection.select(); + } else { + selection = window.getSelection(); + + if(this._editableDiv.firstChild !== null) + selection.collapse(this._editableDiv.firstChild, char); + } + } + + this._textbox._element.value = this._encodeHtml(); + }, + + _isHtmlElement: function (obj) { + if(obj instanceof HTMLElement) + return true; + + return false; + }, + + isValidTarget: function(target) + { + if (target.name == undefined + || + target.name == "" + || + target.tagName.toLowerCase() == "select") + return false; + + return true; + }, + + _executeCommand: function(command) { + if(!this.isValidTarget(command.target)) + return; + + var isFireFox = Sys.Browser.agent == Sys.Browser.Firefox, + delcolorPicker_onchange = Function.createDelegate(this, this._colorPicker_onchange); + + if(isFireFox) + document.execCommand('styleWithCSS', false, false); + + var map = { + JustifyRight: 1, + JustifyLeft: 1, + JustifyCenter: 1, + JustifyFull: 1, + Indent: 1, + Outdent: 1 + }; + + if(map[command.target.name]) { + try { + document.execCommand(command.target.name, false, null); + } catch(e) { + //special case for Mozilla Bug #442186 + if(e && e.result == 2147500037) { + //probably firefox bug 442186 - workaround + var range = window.getSelection().getRangeAt(0), + dummy = document.createElement('div'); + + //To restore the range after collapsing for triple click bug... + var restoreSelection = false; + dummy.style.height = '1px;'; + + //Triple Click selection Problem in mozilla, the selection contains the content editable div, which creates a problem for some reason, so we collapse the selection to the end, and then re-select everything... + if(range.startContainer.contentEditable == 'true') { + window.getSelection().collapseToEnd(); + restoreSelection = true; + } + + var ceNode = window.getSelection().getRangeAt(0).startContainer; + + while(ceNode && ceNode.contentEditable != 'true') + ceNode = ceNode.parentNode; + + if(!ceNode) + throw 'Selected node is not editable!'; + + ceNode.insertBefore(dummy, ceNode.childNodes[0]); + document.execCommand(command.target.name, false, null); + dummy.parentNode.removeChild(dummy); + + //RestoreSelection if we changed it... + if(restoreSelection) + window.getSelection().addRange(range); + } else if(window.console && window.console.log) { + window.console.log(e); + } + } + } else if(command.target.name == "createLink") { + var url = prompt('Please insert URL', ''); + if(url) + document.execCommand('createLink', false, url); + } else if(command.target.name == 'ForeColor') { + this._commandName = command.target.name; + this.saveSelection(); + + if(!this._foreColorPicker) { + this._foreColorPicker = $create(Sys.Extended.UI.ColorPickerBehavior, {}, {}, {}, this._foreColor); + this._foreColorPicker.set_sample(this._foreColor.parentNode); + this._foreColorPicker.add_colorSelectionChanged(delcolorPicker_onchange); + } + this._foreColorPicker.show(); + } else if(command.target.name == 'BackColor') { + this._commandName = command.target.name; + this.saveSelection(); + + if(!this._backColorPicker) { + this._backColorPicker = $create(Sys.Extended.UI.ColorPickerBehavior, {}, {}, {}, this._backColor); + this._backColorPicker.set_sample(this._backColor.parentNode); + this._backColorPicker.add_colorSelectionChanged(delcolorPicker_onchange); + } + this._backColorPicker.show(); + } else if(command.target.name == 'UnSelect') { + if(isFireFox) { + this._editableDiv.focus(); + var sel = window.getSelection(); + sel.collapse(this._editableDiv.firstChild, 0); + } else { + document.execCommand(command.target.name, false, null); + } + } else if(command.target.name == 'InsertImage') { + // if focus in not at editable div then dom error occurs + if(!this._isFocusInEditableDiv) + this._editableDiv.focus(); + + this.saveSelection(); + + var components = Sys.Application.getComponents(); + + for(var i = 0; i < components.length; i++) { + var component = components[i]; + + if(Sys.Extended.UI.HtmlEditorExtenderBehavior.isInstanceOfType(component)) + if(component._popupBehavior._visible) + return; + } + + this._elementVisible(this._popupDiv, true); + this._popupBehavior.show(); + + $common.setStyle(this._popupDiv, { + position: 'fixed', + top: '', + left: '', + opacity: '1' + }); + } else { + document.execCommand(command.target.name, false, null); + } + }, + + // BackColor & ForeColor colorpicker onchange, fill color to selected text + _colorPicker_onchange: function(e) { + this.restoreSelection(); + + if(/backcolor/i.test(this._commandName)) { + var isFireFox = Sys.Browser.agent == Sys.Browser.Firefox; + if(isFireFox) { + document.execCommand('stylewithcss', false, true); + document.execCommand("hilitecolor", false, "#" + e._selectedColor); + document.execCommand('stylewithcss', false, false); + } else { + document.execCommand("backcolor", false, "#" + e._selectedColor); + } + } else + document.execCommand(this._commandName, false, "#" + e._selectedColor); + }, + + /// + /// Saves selected text + /// + /// + saveSelection: function () { + if(window.getSelection) //non IE Browsers + this._savedRange = window.getSelection().rangeCount && window.getSelection().getRangeAt(0); + else if(document.selection) //IE + this._savedRange = document.selection.createRange(); + }, + + /// + /// Restores selected text + /// + /// + restoreSelection: function() { + this._isInFocus = true; + + //document.getElementById("area").focus(); + if(this._savedRange != null) { + if(window.getSelection) { //non IE and there is already a selection + var s = window.getSelection(); + + if(s.rangeCount > 0) + s.removeAllRanges(); + + s.addRange(this._savedRange); + } else { + if(document.createRange) { //non IE and no selection + window.getSelection().addRange(this._savedRange); + } else { + if(document.selection) { //IE + this._savedRange.select(); + } + } + } + } + }, + + _elementVisible: function(obj, flag) { + if(obj.tagName == 'FORM') + return; + + if(flag) { + if(obj.style.display == 'none') { + obj.style.display = 'block'; + obj.setAttribute('displayChanged', true); + } + + if(obj.style.visibility == 'hidden') { + obj.style.visibility = 'visible'; + obj.setAttribute('visibleChanged', true); + } + + this._elementVisible(obj.parentNode, true); + } else { + if(obj.getAttribute('displayChanged')) { + obj.style.display = 'none'; + obj.removeAttribute('displayChanged'); + } + + if(obj.getAttribute('visibleChanged')) { + // creating problem in IE8 + //obj.style.visibility = 'hidden'; + obj.removeAttribute('visibleChanged'); + } + + this._elementVisible(obj.parentNode, false); + } + }, + + _raiseEvent: function(eventName, eventArgs) { + // Get handler for event. + var handler = this.get_events().getHandler(eventName); + + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + + // Fire event. + handler(this, eventArgs); + } + }, + + get_buttonWidth: function () { + return this._ButtonWidth; + }, + get_ButtonWidth: function() { + Sys.Extended.Deprecated("get_ButtonWidth()", "get_buttonWidth()"); + return this.get_buttonWidth(); + }, + + set_buttonWidth: function (value) { + if (this._ButtonWidth != value) { + this._ButtonWidth = value; + this.raisePropertyChanged('ButtonWidth'); + } + }, + set_ButtonWidth: function(value) { + Sys.Extended.Deprecated("set_ButtonWidth(value)", "set_buttonWidth(value)"); + this.set_buttonWidth(value); + }, + + get_buttonHeight: function() { + return this._ButtonHeight; + }, + get_ButtonHeight: function () { + Sys.Extended.Deprecated("get_ButtonHeight()", "get_buttonHeight()"); + return this.get_buttonHeight(); + }, + + set_buttonHeight: function(value) { + if(this._ButtonHeight != value) { + this._ButtonHeight = value; + this.raisePropertyChanged('ButtonHeight'); + } + }, + set_ButtonHeight: function (value) { + Sys.Extended.Deprecated("set_ButtonHeight(value)", "set_buttonHeight(value)"); + this.set_buttonHeight(); + }, + + get_toolbarButtons: function () { + return this._toolbarButtons; + }, + get_ToolbarButtons: function() { + Sys.Extended.Deprecated("get_ToolbarButtons()", "get_toolbarButtons()"); + return this.get_toolbarButtons(); + }, + + set_toolbarButtons: function(value) { + if(this._toolbarButtons != value) { + this._toolbarButtons = value; + this.raisePropertyChanged('ToolbarButtons'); + } + }, + set_ToolbarButtons: function (value) { + Sys.Extended.Deprecated("set_ToolbarButtons(value)", "set_ToolbarButtons(value)"); + this.set_toolbarButtons(value); + }, + + get_displaySourceTab: function() { + return this._displaySourceTab; + }, + + set_displaySourceTab: function(value) { + if(this._displaySourceTab != value) { + this._displaySourceTab = value; + this.raisePropertyChanged('DisplaySourceTab'); + } + }, + + /// + /// Fires when text change occurs + /// + /// + /// + add_change: function(handler) { + this.get_events().addHandler("change", handler); + }, + remove_change: function(handler) { + this.get_events().removeHandler("change", handler); + }, + + get_isDirty: function() { + return this._isDirty; + } +}; + +Sys.Extended.UI.HtmlEditorExtenderBehavior.registerClass('Sys.Extended.UI.HtmlEditorExtenderBehavior', Sys.Extended.UI.BehaviorBase); + +var HtmlEditorExtender_editableDivs = new Array(); + +Sys.Extended.UI.HtmlEditorExtenderBehavior.WebForm_OnSubmit = function() { + var result = Sys.Extended.UI.HtmlEditorExtenderBehavior._originalWebForm_OnSubmit(); + + if(result) { + var components = Sys.Application.getComponents(); + + for(var i = 0; i < components.length; i++) { + var component = components[i]; + + if(Sys.Extended.UI.HtmlEditorExtenderBehavior.isInstanceOfType(component)) + component._editableDiv_submit(); + } + } + + return result; +}, + +Sys.Extended.UI.HtmlEditorExtenderBehavior.IsDirty = function() { + var components = Sys.Application.getComponents(); + + for(var i = 0; i < components.length; i++) { + var component = components[i]; + + if(Sys.Extended.UI.HtmlEditorExtenderBehavior.isInstanceOfType(component)) + if(component._isDirty) + return true; + } + + return false; +}, + +ajaxClientUploadComplete = function(sender, e) { + var htmlEditorExtender = null, + components = Sys.Application.getComponents(); + + for(var i = 0; i < components.length; i++) { + var component = components[i]; + + if(Sys.Extended.UI.HtmlEditorExtenderBehavior.isInstanceOfType(component)) + if(component._popupBehavior._visible) { + htmlEditorExtender = component; + i = component.length; + } + } + + var postedUrl = e.get_postedUrl().replace('&', '&'); + if(htmlEditorExtender != null) { + htmlEditorExtender.restoreSelection(); + + if(document.selection && document.selection.createRange) { + try { + htmlEditorExtender._savedRange.pasteHTML(''); + } catch(Error) { + var node = document.createElement("img"); + node.src = postedUrl; + htmlEditorExtender._savedRange.insertNode(node); + } + } else { + var node = document.createElement("img"); + + node.src = postedUrl; + htmlEditorExtender._savedRange.insertNode(node); + } + } +}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/LineChart.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/LineChart.debug.js new file mode 100644 index 000000000..0e45d2b8d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/LineChart.debug.js @@ -0,0 +1,699 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.LineChart = function(element) { + Sys.Extended.UI.LineChart.initializeBase(this, [element]); + var id = this.get_id(); + id = id.replace("_ctl00", ""); + this._parentDiv = document.getElementById(id).children[0]; + + /// + /// Whether or not show series values. + /// + /// get_displayValues + /// set_displayValues + /// + this._displayValues = true; + this._chartWidth = '300'; + this._chartHeight = '300'; + this._chartTitle = ''; + this._categoriesAxis = ''; + this._series = null; + this._chartType = Sys.Extended.UI.LineChartType.Basic; + this._theme = 'LineChart'; + this._valueAxisLines = 9; + this._chartTitleColor = ''; + this._valueAxisLineColor = ''; + this._categoryAxisLineColor = ''; + this._baseLineColor = ''; + this._tooltipBackgroundColor = '#ffffff'; + this._tooltipFontColor = '#0E426C'; + this._tooltipBorderColor = '#B85B3E'; + this._areaDataLabel = ''; + + // variables + this.yMax = 0; + this.yMin = 0; + this.roundedTickRange = 0; + this.startX = 0; + this.startY = 0; + this.endX = 0; + this.endY = 0; + this.xInterval = 0; + this.yInterval = 0; + this.arrXAxis; + this.arrXAxisLength = 0; + this.charLength = 3.5; + this.arrCombinedData = null; + this._toolTipDiv; +} + +Sys.Extended.UI.LineChart.prototype = { + + initialize: function() { + Sys.Extended.UI.LineChart.callBaseMethod(this, "initialize"); + + if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) + throw 'Browser does not support SVG.'; + + if(this._valueAxisLines == 0) + this._valueAxisLines = 9; + + this.generateTooltipDiv(); + this.generateLineChart(); + }, + + dispose: function() { + Sys.Extended.UI.LineChart.callBaseMethod(this, "dispose"); + }, + + generateTooltipDiv: function() { + this._divTooltip = $common.createElementFromTemplate({ + nodeName: 'div', + properties: { + id: this.get_id() + '_tooltipDiv', + style: { + position: 'absolute', + backgroundColor: this._tooltipBackgroundColor, + borderStyle: 'solid', + borderWidth: '5px', + borderColor: this._tooltipBorderColor, + left: '0px', + top: '0px', + color: this._tooltipFontColor, + visibility: 'hidden', + zIndex: Sys.Extended.UI.zIndex.LineChartTooltip, + padding: '10px' + } + } + }, this._parentDiv); + }, + + generateLineChart: function() { + this.arrXAxis = this._categoriesAxis.split(','); + this.arrXAxisLength = this.arrXAxis.length; + + this.calculateMinMaxValues(); + this.calculateInterval(); + this.calculateValueAxis(); + var svgContents = this.initializeSVG(); + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + + svgContents = svgContents + this.drawBackgroundHorizontalLines(); + svgContents = svgContents + this.drawBackgroundVerticalLines(); + svgContents = svgContents + this.drawBaseLines(); + svgContents = svgContents + this.drawLegendArea(); + svgContents = svgContents + this.drawAxisValues(); + + this._parentDiv.innerHTML = this._parentDiv.innerHTML + svgContents; + this.drawLines(); + }, + + /// + /// Calculates a distance interval for the value axis + /// + /// + calculateInterval: function() { + this.startX = (this._chartWidth * 10 / 100) + 0.5; + this.endX = parseInt(this._chartWidth) - 4.5; + + if(this.yMin >= 0) + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 24 / 100)) + 0.5; + else + this.startY = Math.round(parseInt(this._chartHeight) - (parseInt(this._chartHeight) * 12 / 100)) / 2 + 0.5; + + this.yInterval = this.startY / (this._valueAxisLines + 1); + }, + + /// + /// Calculates minimum and maximum values of specified data + /// + /// Chart type + /// + calculateMinMaxValues: function(chartType) { + var seriesMax, + seriesMin, + arrData; + + if(this._chartType == Sys.Extended.UI.LineChartType.Basic) { + for(var i = 0; i < this._series.length; i++) { + arrData = new Array(); + for(var j = 0; j < this._series[i].Data.length; j++) + arrData[j] = this._series[i].Data[j]; + + seriesMax = Math.max.apply(null, arrData); + seriesMin = Math.min.apply(null, arrData); + + if(i == 0) { + this.yMax = seriesMax; + this.yMin = seriesMin; + } else { + if(seriesMax > this.yMax) + this.yMax = seriesMax; + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + } else { + this.arrCombinedData = null; + for(var i = 0; i < this._series.length; i++) { + arrData = new Array(); + for(var j = 0; j < this._series[i].Data.length; j++) + arrData[j] = this._series[i].Data[j]; + + if(this.arrCombinedData == null) + this.arrCombinedData = arrData; + else { + for(j = 0; j < this._series[i].Data.length; j++) + this.arrCombinedData[j] = parseFloat(this.arrCombinedData[j]) + parseFloat(arrData[j]); + } + } + + for(var i = 0; i < this._series.length; i++) { + seriesMin = Math.min.apply(null, this._series[i].Data); + + if(i == 0) { + this.yMin = seriesMin; + } else { + if(seriesMin < this.yMin) + this.yMin = seriesMin; + } + } + + this.yMax = Math.max.apply(null, this.arrCombinedData); + } + + if(this.yMin < 0) + this._valueAxisLines = Math.round(this._valueAxisLines / 2); + }, + + /// + /// Calculates label values for the value axis to display on the chart + /// + /// + calculateValueAxis: function() { + // calculate value axis labels + var range, + unroundedTickSize, + x, + pow10x; + + if(this.yMin >= 0) + range = this.yMax; + else + range = this.yMax > Math.abs(this.yMin) ? this.yMax : Math.abs(this.yMin); + + unroundedTickSize = range / (this._valueAxisLines - 1); + if(unroundedTickSize < 1) { + this.roundedTickRange = unroundedTickSize.toFixed(1); + } else { + x = Math.ceil((Math.log(unroundedTickSize) / Math.log(10)) - 1); + pow10x = Math.pow(10, x); + this.roundedTickRange = Math.ceil(unroundedTickSize / pow10x) * pow10x; + } + + this.startX = this.startX + (this.roundedTickRange * 10 * this._valueAxisLines / 10).toString().length * this.charLength; + }, + + /// + /// Draws background horizontal lines of the chart + /// + /// + drawBackgroundHorizontalLines: function() { + var horizontalLineContents = ''; + + // background grid's horizontal lines + for(var i = 1; i <= this._valueAxisLines; i++) + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY - (this.yInterval * i), this._categoryAxisLineColor); + + if(this.yMin < 0) { + // background grid's horizontal lines for negative values + for(var i = 1; i <= this._valueAxisLines; i++) + horizontalLineContents = horizontalLineContents + String.format('', this.startX, this.endX, this.startY + (this.yInterval * i), this._categoryAxisLineColor); + } + return horizontalLineContents; + }, + + /// + /// Draws background vertical lines of the chart + /// + /// + drawBackgroundVerticalLines: function() { + // background grid's vertical lines + var verticalLineContents = ''; + this.xInterval = Math.round((parseInt(this._chartWidth) - this.startX) / this.arrXAxisLength); + + for(var i = 0; i < this.arrXAxisLength; i++) + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + + if(this.yMin < 0) + for(var i = 0; i < this.arrXAxisLength; i++) + verticalLineContents = verticalLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._valueAxisLineColor); + + return verticalLineContents; + }, + + /// + /// Draws base lines of the chart + /// + /// + drawBaseLines: function() { + var baseLineContents = ''; + + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.endX, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY - (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + baseLineContents = baseLineContents + String.format('', this.startX, this.startY, this.startY + 4, this._baseLineColor); + + for(var i = 0; i < this.arrXAxisLength; i++) + baseLineContents = baseLineContents + String.format('', ((parseInt(this._chartWidth) - 5) - (this.xInterval * i)), this.startY, this.startY + 4, this._baseLineColor); + + for(var i = 0; i <= this._valueAxisLines; i++) + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY - (this.yInterval * i), this._baseLineColor); + + if(this.yMin < 0) { + baseLineContents = baseLineContents + String.format('', this.startX, (this.startY + (this.yInterval * this._valueAxisLines)), this.startY, this._baseLineColor); + + for(var i = 1; i <= this._valueAxisLines; i++) + baseLineContents = baseLineContents + String.format('', this.startX - 4, this.startX, this.startY + (this.yInterval * i), this._baseLineColor); + } + + return baseLineContents; + }, + + /// + /// Draws legends of the chart + /// + /// + drawLegendArea: function() { + var legendContents = ''; + // Legend Area + var legendAreaStartHeight = (parseInt(this._chartHeight) * 82 / 100) + 5, + legendBoxWidth = 7.5, + legendBoxHeight = 7.5, + spaceInLegendContents = 5; + + // Get length of text to display in legend + var legendCharLength = 0; + for(var i = 0; i < this._series.length; i++) + legendCharLength = legendCharLength + this._series[i].Name.length; + + var legendAreaWidth = Math.round((legendCharLength * 5) / 2) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._series.length), + isLegendNextLine = false; + + if(legendAreaWidth > parseInt(this._chartWidth) / 2) { + legendAreaWidth = legendAreaWidth / 2; + isLegendNextLine = true; + } + + legendContents = legendContents + ''; + legendContents = legendContents + String.format('', parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2), legendAreaStartHeight, Math.round(parseInt(this._chartWidth) * 50 / 100 + (legendCharLength * 5)) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._series.length), Math.round(parseInt(this._chartHeight) * 97.5 / 100)); + + var startText = parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2) + 5 + legendBoxWidth + spaceInLegendContents, + nextStartText = startText, + startLegend = parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2) + 5, + nextStartLegend = startLegend; + + for(var i = 0; i < this._series.length; i++) { + if(isLegendNextLine && i == Math.round(this._series.length / 2)) { + startText = parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2) + 5 + legendBoxWidth + spaceInLegendContents; + nextStartText = startText; + startLegend = parseInt(this._chartWidth) * 50 / 100 - (legendAreaWidth / 2) + 5; + nextStartLegend = startLegend; + legendAreaStartHeight = (parseInt(this._chartHeight) * 89 / 100) + 5; + isLegendNextLine = false; + } + + startLegend = nextStartLegend; + startText = nextStartText; + + legendContents = legendContents + String.format('', startLegend, legendAreaStartHeight + legendBoxHeight, startLegend + legendBoxWidth, legendAreaStartHeight + 15, i + 1, this._series[i].LineColor); + legendContents = legendContents + String.format('{2}', startText, legendAreaStartHeight + 15, this._series[i].Name); + + if(this._series[i].Name.length > 10) { + nextStartLegend = startLegend + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = startText + (this._series[i].Name.length * 5) + legendBoxWidth + (spaceInLegendContents * 2); + } else { + nextStartLegend = nextStartLegend + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = nextStartText + (this._series[i].Name.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + } + } + legendContents = legendContents + ''; + + return legendContents; + }, + + /// + /// Writes horizontal and vertical axis values of the chart + /// + /// + drawAxisValues: function() { + var axisContents = '', + textLength = 0; + + for(var i = 0; i < this.arrXAxisLength; i++) { + textLength = this.arrXAxis[i].toString().length * this.charLength; + axisContents = axisContents + String.format('{2}', Math.round(this.startX + (this.xInterval * i) + (this.xInterval * 50 / 100) - (textLength)), this.startY + Math.round(this.yInterval * 65 / 100), this.arrXAxis[i]); + } + + for(var i = 0; i <= this._valueAxisLines; i++) + axisContents = axisContents + String.format('{2}', this.startX - ((this.roundedTickRange * 10 * i / 10).toString().length * 5.5) - 10, this.startY - (this.yInterval * i) + 3.5, this.roundedTickRange * 10 * i / 10); + + if(this.yMin < 0) + for(var i = 1; i <= this._valueAxisLines; i++) + axisContents = axisContents + String.format('-{2}', this.startX - ((this.roundedTickRange * 10 * i / 10).toString().length * 5.5) - 15, this.startY + (this.yInterval * i), this.roundedTickRange * 10 * i / 10); + + return axisContents; + }, + + /// + /// Creates SVG and its initial content + /// + /// + initializeSVG: function() { + var svgContents = String.format('', this._theme); + + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + + return svgContents; + }, + + /// + /// Draws lines on the chart + /// + /// + drawLines: function() { + // Lines section + var lineContents = '', + yVal = 0, + lastStartX, + lastStartY; + + lastStartX = new Array(); + lastStartY = new Array(); + + for(var j = 0; j < this._series.length; j++) { + lastStartX[j] = this.startX; + lastStartY[j] = this.startY; + } + + this.animateLines(this, lastStartX, lastStartY, 0, 0); + }, + + animateLines: function (me, lastStartX, lastStartY, yVal, index) { + var displayValues = this.get_displayValues(); + + for(var j = 0; j < me._series.length; j++) { + yVal = 0; + + if(me._chartType == Sys.Extended.UI.LineChartType.Stacked) { + for(k = 0; k <= j; k++) + yVal = parseFloat(yVal) + parseFloat(me._series[k].Data[index]); + } else { + yVal = me._series[j].Data[index]; + } + + if(me._chartType == Sys.Extended.UI.LineChartType.Stacked) { + if(me.arrCombinedData[index] > 0) { + if(index > 0) + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('', lastStartX[j], lastStartY[j], me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) - 7.5, displayValues ? yVal : ""); + else + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) - 7.5, displayValues ? yVal : ""); + } else { + if(index > 0) + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('', lastStartX[j], lastStartY[j], me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) + 7.5, displayValues ? yVal : ""); + else + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) + 7.5, displayValues ? yVal : ""); + } + } else { + if(yVal > 0) { + if(index > 0) + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('', lastStartX[j], lastStartY[j], me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) - 7.5, displayValues ? yVal : ""); + else + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) - 7.5, displayValues ? yVal : ""); + } else { + if(index > 0) + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('', lastStartX[j], lastStartY[j], me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) + 7.5, displayValues ? yVal : ""); + else + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', me.startX + (me.xInterval * index) + (me.xInterval / 2), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)), j + 1, me._series[j].LineColor, yVal, me._areaDataLabel) + String.format('{2}', me.startX + (me.xInterval * index) + (me.xInterval * 20 / 100), me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)) + 7.5, displayValues ? yVal : ""); + } + } + + lastStartX[j] = me.startX + (me.xInterval * index) + (me.xInterval / 2) + 3; + lastStartY[j] = me.startY - Math.round(yVal * (me.yInterval / me.roundedTickRange)); + } + + index++; + + if(index < me.arrXAxisLength) + setTimeout(function() { + me.animateLines(me, lastStartX, lastStartY, 0, index); + }, 400); + }, + + get_displayValues: function () { + return this._displayValues; + }, + set_displayValues: function (value) { + this._displayValues = value; + }, + + /// + /// Enables you to customize chart width + /// + /// get_chartWidth + /// set_chartWidth + /// + get_chartWidth: function() { + return this._chartWidth; + }, + set_chartWidth: function(value) { + this._chartWidth = value; + }, + + /// + /// Enables you to customize chart height + /// + /// get_chartHeight + /// set_chartHeight + /// + get_chartHeight: function() { + return this._chartHeight; + }, + set_chartHeight: function(value) { + this._chartHeight = value; + }, + + /// + /// Enables you to set the chart's title + /// + /// get_chartTitle + /// set_chartTitle + /// + get_chartTitle: function() { + return this._chartTitle; + }, + set_chartTitle: function(value) { + this._chartTitle = value; + }, + + /// + /// Provides a set of values for the category axis to create a line chart + /// + /// get_categoriesAxis + /// set_categoriesAxis + /// + get_categoriesAxis: function() { + return this._categoriesAxis; + }, + set_categoriesAxis: function(value) { + this._categoriesAxis = value; + }, + + /// + /// Provides a list of series + /// + /// get_clientSeries + /// set_clientSeries + /// + get_clientSeries: function() { + return this._series; + }, + set_clientSeries: function(value) { + this._series = value; + }, + + get_ClientSeries: function() { + Sys.Extended.Deprecated("get_ClientSeries()", "get_clientSeries()"); + return this.get_clientSeries(); + }, + set_ClientSeries: function(value) { + Sys.Extended.Deprecated("set_ClientSeries(value)", "set_clientSeries(value)"); + this.set_clientSeries(value); + }, + + /// + /// Enables you to render two types of line charts: Basic or Stacked + /// + /// get_chartType + /// set_chartType + /// + get_chartType: function() { + return this._chartType; + }, + set_chartType: function(value) { + this._chartType = value; + }, + + /// + /// Enables you to control the appearance of a line chart with a CSS file + /// + /// get_theme + /// set_theme + /// + get_theme: function() { + return this._theme; + }, + set_theme: function(value) { + this._theme = value; + }, + + /// + /// Enables you to set interval size for a value axis line + /// + /// get_valueAxisLines + /// set_valueAxisLines + /// + get_valueAxisLines: function() { + return this._valueAxisLines; + }, + set_valueAxisLines: function(value) { + this._valueAxisLines = value; + }, + + /// + /// Enables you to set a font color of the chart's title + /// + /// get_chartTitleColor + /// set_chartTitleColor + /// + get_chartTitleColor: function() { + return this._chartTitleColor; + }, + set_chartTitleColor: function(value) { + this._chartTitleColor = value; + }, + + /// + /// Enables you to set a color of a value axis line + /// + /// get_valueAxisLineColor + /// set_valueAxisLineColor + /// + get_valueAxisLineColor: function() { + return this._valueAxisLineColor; + }, + set_valueAxisLineColor: function(value) { + this._valueAxisLineColor = value; + }, + + /// + /// Enables you to set a color of category axis lines + /// + /// get_categoryAxisLineColor + /// set_categoryAxisLineColor + /// + get_categoryAxisLineColor: function() { + return this._categoryAxisLineColor; + }, + set_categoryAxisLineColor: function(value) { + this._categoryAxisLineColor = value; + }, + + /// + /// Enables you to set a color of the chart's base lines + /// + /// get_baseLineColor + /// set_baseLineColor + /// + get_baseLineColor: function() { + return this._baseLineColor; + }, + set_baseLineColor: function(value) { + this._baseLineColor = value; + }, + + /// + /// Enables you to set a background color of the tooltip box + /// + /// get_tooltipBackgroundColor + /// set_tooltipBackgroundColor + /// + get_tooltipBackgroundColor: function() { + return this.tooltipBackgroundColor; + }, + set_tooltipBackgroundColor: function(value) { + this.tooltipBackgroundColor = value; + }, + + /// + /// Enables you to set a font color of the tooltip box + /// + /// get_tooltipFontColor + /// set_tooltipFontColor + /// + get_tooltipFontColor: function() { + return this._tooltipFontColor; + }, + set_tooltipFontColor: function(value) { + this._tooltipFontColor = value; + }, + + /// + /// Enables you to set a border color of the tooltip box + /// + /// get_tooltipBorderColor + /// set_tooltipBorderColor + /// + get_tooltipBorderColor: function() { + return this._tooltipBorderColor; + }, + set_tooltipBorderColor: function(value) { + this._tooltipBorderColor = value; + }, + + /// + /// Enables you to set text/label that will be shown in the tooltip and describe a area data value + /// + /// get_areaDataLabel + /// set_areaDataLabel + /// + get_areaDataLabel: function() { + return this._areaDataLabel; + }, + set_areaDataLabel: function(value) { + this._areaDataLabel = value; + } +}; + +Sys.Extended.UI.LineChart.registerClass("Sys.Extended.UI.LineChart", Sys.Extended.UI.ControlBase); + +Sys.Extended.UI.LineChartType = function() { + // Type of Line Chart + throw Error.invalidOperation(); +} + +Sys.Extended.UI.LineChartType.prototype = { + Basic: 0, + Stacked: 1 +} + +Sys.Extended.UI.LineChartType.registerEnum("Sys.Extended.UI.LineChartType", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ListSearch.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ListSearch.debug.js new file mode 100644 index 000000000..46115818a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ListSearch.debug.js @@ -0,0 +1,684 @@ +// ListSearchExtender originally created by Damian Mehers http://damianblog.com +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ListSearchBehavior = function(element) { + // The ListSearchBehavior allows users to search incrementally within a Select + Sys.Extended.UI.ListSearchBehavior.initializeBase(this, [element]); + + // Properties + this._promptCssClass = null; + this._promptText = (Sys.Extended.UI.Resources && Sys.Extended.UI.Resources.ListSearch_DefaultPrompt) || "Type to search"; + this._offsetX = 0; + this._offsetY = 0; + this._promptPosition = Sys.Extended.UI.ListSearchPromptPosition.Top; + this._raiseImmediateOnChange = false; + this._queryPattern = Sys.Extended.UI.ListSearchQueryPattern.StartsWith; + this._isSorted = false; + + // Variables + this._popupBehavior = null; + this._onShowJson = null; + this._onHideJson = null; + this._originalIndex = 0; // Index of the selected option when a key is first hit (before it is changed by the browser) + this._newIndex = -1; // New index to which we want to move. We need this because Firefox shifts the selected option even though we preventDefault and preventPropagation in _onKeyPress. + this._showingPromptText = false; + this._searchText = ''; // Actual search text (text displayed in the PromptDiv may be clipped) + this._ellipsis = String.fromCharCode(0x2026); + this._binarySearch = false; + this._applicationLoadDelegate = null; + this._focusIndex = 0; // Selected Index when the list is initially given focus + this._queryTimeout = 0; // Timeout in milliseconds after which search text will be cleared + this._timer = null; // Holds the opaque ID returned by setTimeout function. Needed to correctly clear the timeout reference. + this._matchFound = false; // Set to true means an item was selected after searching. False means no item match search criteria + + this._focusHandler = null; + this._blurHandler = null; + this._keyDownHandler = null; + this._keyUpHandler = null; + this._keyPressHandler = null; +} + +Sys.Extended.UI.ListSearchBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.ListSearchBehavior.callBaseMethod(this, 'initialize'); + + var element = this.get_element(); + + // Check for a SELECT since a ControlAdapter could have rendered the ListBox or DropDown as something else + if(element && element.tagName === 'SELECT') { + this._focusHandler = Function.createDelegate(this, this._onFocus); + this._blurHandler = Function.createDelegate(this, this._onBlur); + this._keyDownHandler = Function.createDelegate(this, this._onKeyDown); + this._keyUpHandler = Function.createDelegate(this, this._onKeyUp); + this._keyPressHandler = Function.createDelegate(this, this._onKeyPress); + + $addHandler(element, "focus", this._focusHandler); + $addHandler(element, "blur", this._blurHandler); + $addHandler(element, "keydown", this._keyDownHandler); + $addHandler(element, "keyup", this._keyUpHandler); + $addHandler(element, "keypress", this._keyPressHandler); + + // We use the load event to determine whether the control has focus and display prompt text. We can't do it here. + this._applicationLoadDelegate = Function.createDelegate(this, this._onApplicationLoad); + Sys.Application.add_load(this._applicationLoadDelegate); + } + }, + + dispose: function() { + var element = this.get_element(); + + $removeHandler(element, "keypress", this._keyPressHandler); + $removeHandler(element, "keyup", this._keyUpHandler); + $removeHandler(element, "keydown", this._keyDownHandler); + $removeHandler(element, "blur", this._blurHandler); + $removeHandler(element, "focus", this._focusHandler); + + this._onShowJson = null; + this._onHideJson = null; + this._disposePopupBehavior(); + + if(this._applicationLoadDelegate) { + Sys.Application.remove_load(this._applicationLoadDelegate); + this._applicationLoadDelegate = null; + } + + if(this._timer) + this._stopTimer(); + + Sys.Extended.UI.ListSearchBehavior.callBaseMethod(this, 'dispose'); + }, + + _onApplicationLoad: function(sender, applicationLoadEventArgs) { + // Handler called automatically when a all scripts are loaded and controls are initialized + // Called after all scripts have been loaded and controls initialized. If the current Select is the one that has + // focus then it shows the prompt text. We cannot do this in the initialize method because the second pass initialization + // of the popup behavior hides it. + // "sender" - sender + // "applicationLoadEventArgs" - event arguments + + // Determine if this SELECT is focused initially + var hasInitialFocus = false; + + var clientState = Sys.Extended.UI.ListSearchBehavior.callBaseMethod(this, 'get_ClientState'); + if(clientState != null && clientState != "") { + hasInitialFocus = (clientState === "Focused"); + Sys.Extended.UI.ListSearchBehavior.callBaseMethod(this, 'set_ClientState', null); + } + + if(hasInitialFocus) + this._handleFocus(); + }, + + _checkIfSorted: function(options) { + // Checks to see if the list is sorted to see if we can do the fast binary search or the slower linear search + if(this._isSorted) { + // we assume this is sorted + return true; + } else { + // it is not known if elements list is sorted, so check it by itself + var previousOptionValue = null, + optionsLength = options.length; + + for(var index = 0; index < optionsLength; index++) { + var optionValue = options[index].text.toLowerCase(); + + if(previousOptionValue && this._compareStrings(optionValue, previousOptionValue) < 0) + return false; + + previousOptionValue = optionValue; + } + return true; + } + }, + + _onFocus: function(e) { + this._handleFocus(); + }, + + _handleFocus: function() { + // Utility method called when the form is loaded if the Select has the default focus, or when it is explicitly focused + var element = this.get_element(); + this._focusIndex = element.selectedIndex; + + if(!this._promptDiv) { + this._promptDiv = document.createElement('div'); + this._promptDiv.id = element.id + '_promptDiv'; + + // Need to initialize _promptDiv here even though it is set below by _updatePromptDiv because otherwise both + // FireFox and IE bomb -- I guess there needs to be some content in the Div. We need a value, which will be overwritten + // below anyway. + this._promptDiv.innerHTML = this._promptText && this._promptText.length > 0 ? this._promptText : Sys.Extended.UI.Resources.ListSearch_DefaultPrompt; + this._showingPromptText = true; + + if(this._promptCssClass) + this._promptDiv.className = this._promptCssClass; + + element.parentNode.insertBefore(this._promptDiv, element.nextSibling); + this._promptDiv.style.overflow = 'hidden'; + this._promptDiv.style.height = this._promptDiv.offsetHeight + 'px'; + this._promptDiv.style.width = element.offsetWidth + 'px'; + } + + // Hook up a PopupBehavior to the promptDiv + if(!this._popupBehavior) + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, { parentElement: element }, {}, {}, this._promptDiv); + + if(this._promptPosition && this._promptPosition == Sys.Extended.UI.ListSearchPromptPosition.Bottom) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomLeft); + else + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopLeft); + + // Create the animations (if they were set before the behavior was created) + if(this._onShowJson) + this._popupBehavior.set_onShow(this._onShowJson); + + if(this._onHideJson) + this._popupBehavior.set_onHide(this._onHideJson); + + this._popupBehavior.show(); + this._updatePromptDiv(this._promptText); + }, + + _onBlur: function() { + this._disposePopupBehavior(); + + // Remove the DIV showing the text typed so far + var promptDiv = this._promptDiv, + element = this.get_element(); + + if(promptDiv) { + this._promptDiv = null; + promptDiv.parentNode.removeChild(promptDiv); + } + + if(!this._raiseImmediateOnChange && this._focusIndex != element.selectedIndex) + this._raiseOnChange(element); + }, + + _disposePopupBehavior: function() { + // Utilty function to dispose of the popup behavior, called when the Select loses focus or when the extender is being disposed + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + }, + + _onKeyDown: function(e) { + var element = this.get_element(), + promptDiv = this._promptDiv; + + if(!element || !promptDiv) + return; + + this._originalIndex = element.selectedIndex; + + if(this._showingPromptText) { + promptDiv.innerHTML = ''; + + this._searchText = ''; + this._showingPromptText = false; + this._binarySearch = this._checkIfSorted(element.options); // Delayed until required + } + + // Backspace not passed to keyPressed event in IE, so handle it here + if(e.keyCode == Sys.UI.Key.backspace) { + e.preventDefault(); + e.stopPropagation(); + + this._removeCharacterFromPromptDiv(); + this._searchForTypedText(element); + + if(!this._searchText || this._searchText.length == 0) + this._stopTimer(); + } else if(e.keyCode == Sys.UI.Key.esc) { + e.preventDefault(); + e.stopPropagation(); + + promptDiv.innerHTML = ''; + this._searchText = ''; + this._searchForTypedText(element); + + this._stopTimer(); + } else if(e.keyCode == Sys.UI.Key.enter && !this._raiseImmediateOnChange && this._focusIndex != element.selectedIndex) { + this._focusIndex = element.selectedIndex; // So that OnChange is not fired again when the list loses focus + this._raiseOnChange(element); + } + }, + + _onKeyUp: function(e) { + // Handler for the Select's KeyUp event. We need this because Firefox shifts the selected option even though + // we preventDefault and preventPropagation in _onKeyPress + + var element = this.get_element(), + promptDiv = this._promptDiv; + + if(!element || !promptDiv) + return; + + if(this._newIndex == -1 || !element || !promptDiv || promptDiv.innerHTML == '') { + this._newIndex = -1; + return; + } + + element.selectedIndex = this._newIndex; + this._newIndex = -1; + }, + + _onKeyPress: function(e) { + var element = this.get_element(), + promptDiv = this._promptDiv; + + if(!element || !promptDiv) + return; + + if(!this._isNormalChar(e)) { + if(e.charCode == Sys.UI.Key.backspace) { + e.preventDefault(); + e.stopPropagation(); + + if(this._searchText && this._searchText.length == 0) + this._stopTimer(); + } + + return; + } + + e.preventDefault(); + e.stopPropagation(); + + // Add key pressed to the displayed DIV and search for it + this._addCharacterToPromptDiv(e.charCode); + this._searchForTypedText(element); + + this._stopTimer(); + // start auto reset timer only if search text is not empty + if(this._searchText && this._searchText.length != 0) + this._startTimer(); + }, + + _isNormalChar: function(e) { + // Returns true if the specified charCode is a key rather than a normal (displayable) character + + // Walking through Sys.UI.Keys won't work -- Ampersand is code 38 which matches + if(Sys.Browser.agent == Sys.Browser.Firefox && e.rawEvent.keyCode) + return false; + + if(Sys.Browser.agent == Sys.Browser.Opera && e.rawEvent.which == 0) + return false; + + if(e.charCode && (e.charCode < Sys.UI.Key.space || e.charCode > 6000)) + return false; + + return true; + }, + + _updatePromptDiv: function(newText) { + var promptDiv = this._promptDiv; + if(!promptDiv || !this.get_element()) + return; + + var text = typeof (newText) === 'undefined' ? this._searchText : newText; + var textNode = promptDiv.firstChild; + + if(!textNode) { + textNode = document.createTextNode(text); + promptDiv.appendChild(textNode); + } else { + textNode.nodeValue = text; + } + + if(promptDiv.scrollWidth <= promptDiv.offsetWidth && promptDiv.scrollHeight <= promptDiv.offsetHeight) + return; // Already fit + + // Remove characters until they fit + for(var maxFit = text.length - 1; maxFit > 0 && (promptDiv.scrollWidth > promptDiv.offsetWidth || promptDiv.scrollHeight > promptDiv.offsetHeight) ; maxFit--) + textNode.nodeValue = this._ellipsis + text.substring(text.length - maxFit, text.length); + }, + + _addCharacterToPromptDiv: function(charCode) { + this._searchText += String.fromCharCode(charCode); + this._updatePromptDiv(); + }, + + _removeCharacterFromPromptDiv: function() { + if(this._searchText && this._searchText != '') { + this._searchText = this._searchText.substring(0, this._searchText.length - 1); + this._updatePromptDiv(); + } + }, + + _searchForTypedText: function(element) { + // Searches for the text typed so far in the Select + var searchText = this._searchText, + options = element.options, + text = searchText ? searchText.toLowerCase() : ""; + + this._matchFound = false; + + if(text.length == 0) { // Probably hit delete -- select the first option + if(options.length > 0) { + element.selectedIndex = 0; + this._newIndex = 0; + } + } else { + var selectedIndex = -1; + + if(this._binarySearch && (this._queryPattern == Sys.Extended.UI.ListSearchQueryPattern.StartsWith)) + selectedIndex = this._doBinarySearch(options, text, 0, options.length - 1); + else + selectedIndex = this._doLinearSearch(options, text, 0, options.length - 1); + + // If nothing is found then stick with the current option + if(selectedIndex == -1) { + // Need this because firefox has aleady changed the current option based on the character typed + this._newIndex = this._originalIndex; + } else { // Otherwise move to the new option + element.selectedIndex = selectedIndex; + this._newIndex = selectedIndex; + this._matchFound = true; + } + } + + if(this._raiseImmediateOnChange && this._originalIndex != element.selectedIndex) + // Fire an OnChange + this._raiseOnChange(element); + }, + + _raiseOnChange: function(element) { + if(document.createEvent) { + var onchangeEvent = document.createEvent('HTMLEvents'); + onchangeEvent.initEvent('change', true, false); + element.dispatchEvent(onchangeEvent); + } else if(document.createEventObject) { + element.fireEvent('onchange'); + } + }, + + _compareStrings: function(strA, strB) { + return ((strA == strB) ? 0 : ((strA < strB) ? -1 : 1)) + }, + + _doBinarySearch: function(options, value, left, right) { + // Does a binary search for a value in the Select's options + while(left <= right) { + var mid = Math.floor((left + right) / 2), + option = options[mid].text.toLowerCase().substring(0, value.length), + compareResult = this._compareStrings(value, option); + + if(compareResult > 0) { + left = mid + 1 + } else if(compareResult < 0) { + right = mid - 1; + } else { + // We've found a match, but it might not be the first -- do a linear search backwards + while(mid > 0 && options[mid - 1].text.toLowerCase().startsWith(value)) + mid--; + + return mid; + } + } + + return -1; + }, + + _doLinearSearch: function(options, value, left, right) { + // Does a linear search for a value in the Select's options + if(this._queryPattern == Sys.Extended.UI.ListSearchQueryPattern.Contains) { + for(var i = left; i <= right; i++) + if(options[i].text.toLowerCase().indexOf(value) >= 0) + return i; + } else if(this._queryPattern == Sys.Extended.UI.ListSearchQueryPattern.StartsWith) { + for(var i = left; i <= right; i++) + if(options[i].text.toLowerCase().startsWith(value)) + return i; + } + + return -1; + }, + + _onTimerTick: function() { + // On timer tick since user is not responsive, so reset search text if no match is found. + this._stopTimer(); + + // reset search text only if no match was found + if(!this._matchFound) { + this._searchText = ''; + this._updatePromptDiv(); + } + }, + + _startTimer: function() { + // Starts timer to monitor user interaction only if greater than zero. + if(this._queryTimeout > 0) + this._timer = window.setTimeout(Function.createDelegate(this, this._onTimerTick), this._queryTimeout); + }, + + _stopTimer: function() { + // Stops and clears previously created timer. + if(this._timer != null) + window.clearTimeout(this._timer); + + this._timer = null; + }, + + /// + /// A JSON definition of generic OnShow animation + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onShow(value) + else + this._onShowJson = value; + + this.raisePropertyChanged('onShow'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing generic OnShow animation behavior + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Plays OnShow animation + /// + /// + onShow: function() { + if(this._popupBehavior) + this._popupBehavior.onShow(); + }, + + /// + /// A JSON definition of generic OnHide animation + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onHide(value) + else + this._onHideJson = value; + + this.raisePropertyChanged('onHide'); + }, + + /// + /// The Sys.Extended.UI.Animation.GenericAnimationBehavior object containing generic OnHide animation behavior + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Plays OnHide animation + /// + /// + onHide: function() { + if(this._popupBehavior) + this._popupBehavior.onHide(); + }, + + /// + /// Prompt text displayed when a user clicks the list + /// + /// get_promptText + /// set_promptText + /// + get_promptText: function() { + return this._promptText; + }, + set_promptText: function(value) { + if(this._promptText != value) { + this._promptText = value; + this.raisePropertyChanged('promptText'); + } + }, + + /// + /// A CSS class applied to prompt when a user clicks the list + /// + /// get_promptCssClass + /// set_promptCssClass + /// + get_promptCssClass: function() { + return this._promptCssClass; + }, + set_promptCssClass: function(value) { + if(this._promptCssClass != value) { + this._promptCssClass = value; + this.raisePropertyChanged('promptCssClass'); + } + }, + + /// + /// A Sys.Extended.UI.ListSearchPromptPosition value used to determine where the prompt + /// should be positioned relative to the target control (Top (default) or Bottom) + /// Can be Top (default) or Bottom + /// + /// get_promptPosition + /// set_promptPosition + /// + get_promptPosition: function() { + return this._promptPosition; + }, + set_promptPosition: function(value) { + if(this._promptPosition != value) { + this._promptPosition = value; + this.raisePropertyChanged('promptPosition'); + } + }, + + /// + /// A Boolean value indicating whether or not the OnChange event should be raised as soon as + /// the selected element is changed when the list loses focus or when a user hits Enter + /// + /// get_raiseImmediateOnChange + /// set_raiseImmediateOnChange + /// + get_raiseImmediateOnChange: function() { + return this._raiseImmediateOnChange; + }, + set_raiseImmediateOnChange: function(value) { + if(this._raiseImmediateOnChange != value) { + this._raiseImmediateOnChange = value; + this.raisePropertyChanged('raiseImmediateOnChange'); + } + }, + + /// + /// The number indicating timeout in milliseconds upon which the search query will be cleared. + /// Zero means no auto reset + /// + /// get_queryTimeout + /// set_queryTimeout + /// + get_queryTimeout: function() { + return this._queryTimeout; + }, + set_queryTimeout: function(value) { + if(this._queryTimeout != value) { + this._queryTimeout = value; + this.raisePropertyChanged('queryTimeout'); + } + }, + + /// + /// A Boolean value used to determine whether or not the list has been sorted upon population + /// + /// + /// True indicates that all values in the List are already sorted upon population + /// + /// get_isSorted + /// set_isSorted + /// + get_isSorted: function() { + // When setting this to true, we instruct search routines that + // all values in List are already sorted on population, + // so binary search can be used if on StartsWith criteria is set. + return this._isSorted; + }, + + set_isSorted: function(value) { + if(this._isSorted != value) { + this._isSorted = value; + this.raisePropertyChanged('isSorted'); + } + }, + + /// + /// A Sys.Extended.UI.ListSearchQueryPattern value used to determine the search query pattern + /// to be used to find items (StartsWith (default) or Contains) + /// + /// get_queryPattern + /// set_queryPattern + /// + get_queryPattern: function() { + return this._queryPattern; + }, + set_queryPattern: function(value) { + if(this._queryPattern != value) { + this._queryPattern = value; + this.raisePropertyChanged('queryPattern'); + } + } +} + +Sys.Extended.UI.ListSearchBehavior.registerClass('Sys.Extended.UI.ListSearchBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.ListSearchPromptPosition = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.ListSearchPromptPosition.prototype = { + Top: 0, + Bottom: 1 +} + +Sys.Extended.UI.ListSearchPromptPosition.registerEnum('Sys.Extended.UI.ListSearchPromptPosition'); + +Sys.Extended.UI.ListSearchQueryPattern = function() { + // Choose what query pattern to use to search for matching words. + throw Error.invalidOperation(); +} + +Sys.Extended.UI.ListSearchQueryPattern.prototype = { + StartsWith: 0, + Contains: 1 +} +Sys.Extended.UI.ListSearchQueryPattern.registerEnum('Sys.Extended.UI.ListSearchQueryPattern'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ar.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ar.debug.js new file mode 100644 index 000000000..f8bd3a791 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ar.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["ar"] = { + "Calendar_Today": "اليوم: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.cs.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.cs.debug.js new file mode 100644 index 000000000..c12d1da87 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.cs.debug.js @@ -0,0 +1,13 @@ +Sys.Extended.UI.Localization["cs"] = { + "Calendar_Today": "Dnes: {0}", + "Common_DateTime_InvalidFormat": "Nesprávný formát data", + "Common_DateTime_InvalidTimeSpan": "\"{0}\" není správný formát časového úseku", + "PasswordStrength_DefaultStrengthDescriptions": "Neexistuje;Velmi chatrné;Chatrné;Slabé;Téměř použitelné;Téměř akceptovatelné;Průměrné;Dobré;Silné;Vynikající;Nezlomitlné!", + "PasswordStrength_GetHelpRequirements": "Získat nápovědu k požadavkům na heslo", + "PasswordStrength_RemainingCharacters": "{0} dalších znaků", + "PasswordStrength_RemainingMixedCase": "více malých a velkých písmen", + "PasswordStrength_RemainingNumbers": "{0} dalších čísel", + "PasswordStrength_RemainingSymbols": "{0} dalších symbolů", + "PasswordStrength_Satisfied": "Nic víc nevyžadováno", + "PasswordStrength_StrengthPrompt": "Síla: " +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.de.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.de.debug.js new file mode 100644 index 000000000..788bd8c55 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.de.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["de"] = { + "Calendar_Today": "Heute: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.debug.js new file mode 100644 index 000000000..ecf9f27ea --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.debug.js @@ -0,0 +1,202 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.Resources = { + "AlwaysVisible_ElementRequired": "Sys.Extended.UI.AlwaysVisibleControlBehavior must have an element", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.SequenceAnimation cannot be nested inside Sys.Extended.UI.Animation.ParallelAnimation", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from Sys.Extended.UI.Animation.ParentAnimation", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation can only register types that inherit from Sys.Extended.UI.Animation.Animation", + "Animation_InvalidColor": "Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation requires an object with an AnimationName property", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation found no property corresponding to \"{0}\"", + "Animation_TargetNotFound": "Sys.Extended.UI.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control. No element or control could be found corresponding to \"{0}\"", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"", + "Calendar_Today": "Today: {0}", + "CascadingDropDown_MethodError": "[Method error {0}]", + "CascadingDropDown_MethodTimeout": "[Method timeout]", + "CascadingDropDown_NoParentElement": "Failed to find parent element \"{0}\"", + "CollapsiblePanel_NoControlID": "Failed to find element \"{0}\"", + "Common_DateTime_InvalidFormat": "Invalid format", + "Common_DateTime_InvalidTimeSpan": "\"{0}\" is not a valid TimeSpan format", + "Common_InvalidBorderWidthUnit": "A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth", + "Common_InvalidPaddingUnit": "A unit type of \"{0}\" is invalid for parsePadding", + "Common_UnitHasNoDigits": "No digits", + "DynamicPopulate_WebServiceError": "Web Service call failed: {0}", + "DynamicPopulate_WebServiceTimeout": "Web service call timed out", + "ExtenderBase_CannotSetClientStateField": "clientStateField can only be set before initialization", + "ExtenderBase_ControlNotRegisteredForCallbacks": "This Control has not been registered for callbacks", + "ExtenderBase_InvalidClientStateType": "saveClientState must return a value of type String", + "ExtenderBase_PageNotRegisteredForCallbacks": "This Page has not been registered for callbacks", + "HTMLEditor_toolbar_button_FixedBackColor_title": "Background color", + "HTMLEditor_toolbar_button_BackColorClear_title": "Clear background color", + "HTMLEditor_toolbar_button_Bold_title": "Bold", + "HTMLEditor_toolbar_button_BulletedList_title": "Bulleted List", + "HTMLEditor_toolbar_button_Copy_title": "Copy", + "HTMLEditor_toolbar_button_Cut_title": "Cut", + "HTMLEditor_toolbar_button_DecreaseIndent_title": "Decrease Indent", + "HTMLEditor_toolbar_button_FontName_defaultValue": "default", + "HTMLEditor_toolbar_button_FontSize_defaultValue": "default", + "HTMLEditor_toolbar_button_DesignMode_title": "Design mode", + "HTMLEditor_toolbar_button_FontName_label": "Font", + "HTMLEditor_toolbar_button_FixedForeColor_title": "Foreground color", + "HTMLEditor_toolbar_button_ForeColorClear_title": "Clear foreground color", + "HTMLEditor_toolbar_button_HtmlMode_title": "HTML text", + "HTMLEditor_toolbar_button_IncreaseIndent_title": "Increase Indent", + "HTMLEditor_toolbar_button_InsertHR_title": "Insert horizontal rule", + "HTMLEditor_toolbar_button_InsertLink_title": "Insert/Edit URL link", + "HTMLEditor_toolbar_button_InsertLink_message_EmptyURL": "URL can not be empty", + "HTMLEditor_toolbar_button_Italic_title": "Italic", + "HTMLEditor_toolbar_button_JustifyCenter_title": "Justify Center", + "HTMLEditor_toolbar_button_JustifyFull_title": "Justify", + "HTMLEditor_toolbar_button_JustifyLeft_title": "Justify Left", + "HTMLEditor_toolbar_button_JustifyRight_title": "Justify Right", + "HTMLEditor_toolbar_button_Ltr_title": "Left to right direction", + "HTMLEditor_toolbar_button_OnPasteFromMSWord": "Pasting from MS Word is switched on. Just now: {0}", + "HTMLEditor_toolbar_button_OnPastePlainText": "Plain text pasting is switched on. Just now: {0}", + "HTMLEditor_toolbar_button_OrderedList_title": "Ordered List", + "HTMLEditor_toolbar_button_Paragraph_title": "Make Paragraph", + "HTMLEditor_toolbar_button_Paste_title": "Paste", + "HTMLEditor_toolbar_button_PasteText_title": "Paste Plain Text", + "HTMLEditor_toolbar_button_PasteWord_title": "Paste from MS Word (with cleanup)", + "HTMLEditor_toolbar_popup_LinkProperties_button_Cancel": "Cancel", + "HTMLEditor_toolbar_popup_LinkProperties_button_OK": "OK", + "HTMLEditor_toolbar_popup_LinkProperties_field_URL": "URL", + "HTMLEditor_toolbar_popup_LinkProperties_field_Target": "Target", + "HTMLEditor_toolbar_popup_LinkProperties_field_Target_New": "New window", + "HTMLEditor_toolbar_popup_LinkProperties_field_Target_Current": "Current window", + "HTMLEditor_toolbar_popup_LinkProperties_field_Target_Parent": "Parent window", + "HTMLEditor_toolbar_popup_LinkProperties_field_Target_Top": "Top window", + "HTMLEditor_toolbar_button_PreviewMode_title": "Preview", + "HTMLEditor_toolbar_button_Redo_title": "Redo", + "HTMLEditor_toolbar_button_RemoveAlignment_title": "Remove Alignment", + "HTMLEditor_toolbar_button_RemoveLink_title": "Remove Link", + "HTMLEditor_toolbar_button_RemoveStyles_title": "Remove styles", + "HTMLEditor_toolbar_button_Rtl_title": "Right to left direction", + "HTMLEditor_toolbar_button_FontSize_label": "Size", + "HTMLEditor_toolbar_button_StrikeThrough_title": "Strike through", + "HTMLEditor_toolbar_button_SubScript_title": "Sub script", + "HTMLEditor_toolbar_button_SuperScript_title": "Super script", + "HTMLEditor_toolbar_button_Underline_title": "Underline", + "HTMLEditor_toolbar_button_Undo_title": "Undo", + "HTMLEditor_toolbar_button_Use_verb": "Use {0}", + "ListSearch_DefaultPrompt": "Type to search", + "PasswordStrength_DefaultStrengthDescriptions": "NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!", + "PasswordStrength_GetHelpRequirements": "Get help on password requirements", + "PasswordStrength_InvalidStrengthDescriptions": "Invalid number of text strength descriptions specified", + "PasswordStrength_InvalidStrengthDescriptionStyles": "Text Strength description style classes must match the number of text descriptions.", + "PasswordStrength_InvalidWeightingRatios": "Strength Weighting ratios must have 4 elements", + "PasswordStrength_RemainingCharacters": "{0} more characters", + "PasswordStrength_RemainingLowerCase": "{0} more lower case characters", + "PasswordStrength_RemainingMixedCase": "Mixed case characters", + "PasswordStrength_RemainingNumbers": "{0} more numbers", + "PasswordStrength_RemainingSymbols": "{0} symbol characters", + "PasswordStrength_RemainingUpperCase": "{0} more upper case characters", + "PasswordStrength_Satisfied": "Nothing more required", + "PasswordStrength_StrengthPrompt": "Strength: ", + "PopupControl_NoDefaultProperty": "No default property supported for control \"{0}\" of type \"{1}\"", + "PopupExtender_NoParentElement": "Couldn\u0027t find parent element \"{0}\"", + "Rating_CallbackError": "An unhandled exception has occurred:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "Reorder failed, see details below.\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "Could not find child of list with id \"{0}\"", + "ResizableControlBehavior_CannotChangeProperty": "Changes to {0} not supported", + "ResizableControlBehavior_InvalidHandler": "{0} handler not a function, function name, or function text", + "RTE_BackgroundColor": "Background Color", + "RTE_BarColor": "Bar Color", + "RTE_Bold": "Bold", + "RTE_Border": "Border", + "RTE_BorderColor": "Border Color", + "RTE_Cancel": "Cancel", + "RTE_CellColor": "Cell Color", + "RTE_CellPadding": "Cell Padding", + "RTE_CellSpacing": "Cell Spacing", + "RTE_ClearFormatting": "Clear Formatting", + "RTE_Columns": "Columns", + "RTE_Copy": "Copy", + "RTE_Create": "Create", + "RTE_Cut": "Cut", + "RTE_Font": "Font", + "RTE_FontColor": "Font Color", + "RTE_Heading": "Heading", + "RTE_Hyperlink": "Hyperlink", + "RTE_Indent": "Indent", + "RTE_InsertHorizontalRule": "Insert Horizontal Rule", + "RTE_InsertImage": "Insert Image", + "RTE_InsertTable": "Insert Table", + "RTE_Inserttexthere": "Insert text here", + "RTE_Italic": "Italic", + "RTE_JustifyCenter": "Justify Center", + "RTE_JustifyFull": "Justify Full", + "RTE_JustifyLeft": "Justify Left", + "RTE_JustifyRight": "Justify Right", + "RTE_LabelColor": "Label Color", + "RTE_Labels": "Labels", + "RTE_Legend": "Legend", + "RTE_Normal": "Normal", + "RTE_OK": "OK", + "RTE_OrderedList": "Ordered List", + "RTE_Outdent": "Outdent", + "RTE_Paragraph": "Paragraph", + "RTE_Paste": "Paste", + "RTE_PreviewHTML": "Preview HTML", + "RTE_Redo": "Redo", + "RTE_Rows": "Rows", + "RTE_Size": "Size", + "RTE_Underline": "Underline", + "RTE_Undo": "Undo", + "RTE_UnorderedList": "Unordered List", + "RTE_Values": "Values", + "RTE_ViewEditor": "View Editor", + "RTE_ViewSource": "View Source", + "RTE_ViewValues": "View Values", + "Shared_BrowserSecurityPreventsPaste": "Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead.", + "Slider_NoSizeProvided": "Please set valid values for the height and width attributes in the slider\u0027s CSS classes", + "Tabs_ActiveTabArgumentOutOfRange": "Argument is not a member of the tabs collection", + "Tabs_OwnerExpected": "owner must be set before initialize", + "Tabs_PropertySetAfterInitialization": "{0} cannot be changed after initialization", + "Tabs_PropertySetBeforeInitialization": "{0} cannot be changed before initialization", + "ValidatorCallout_DefaultErrorMessage": "This control is invalid", + "MultiHandleSlider_CssHeightWidthRequired": "You must specify a CSS width and height for all handle styles as well as the rail.", + "AsyncFileUpload_InternalErrorMessage": "The AsyncFileUpload control has encountered an error with the uploader in this page. Please refresh the page and try again.", + "AsyncFileUpload_UnhandledException": "Unhandled Exception", + "AsyncFileUpload_ConfirmToSeeErrorPage": "Do you want to see the response page?", + "AsyncFileUpload_ServerResponseError": "Server Response Error", + "AsyncFileUpload_UnknownServerError": "Unknown Server error", + "AsyncFileUpload_UploadingProblem": "The requested file uploading problem.", + "AjaxFileUpload_DropFiles": "Drop files here", + "AjaxFileUpload_AllFilesUploaded": "All Files Uploaded.", + "AjaxFileUpload_SelectFile": "Select File", + "AjaxFileUpload_Remove": "Remove", + "AjaxFileUpload_Upload": "Upload", + "AjaxFileUpload_Cancel": "Cancel", + "AjaxFileUpload_FileList": "List of Uploaded files:", + "AjaxFileUpload_SelectFileToUpload": "Please select file(s) to upload.", + "AjaxFileUpload_Pending": "pending", + "AjaxFileUpload_FileInQueue": "{0} file(s) in queue.", + "AjaxFileUpload_UploadingHtml5File": "Uploading file: {0} of size {1} bytes.", + "AjaxFileUpload_UploadingInputFile": "Uploading file: {0}.", + "AjaxFileUpload_UploadError": "An Error occured during file upload.", + "AjaxFileUpload_DefaultError": "File upload error.", + "AjaxFileUpload_UploadedPercentage": "uploaded {0} %", + "AjaxFileUpload_Uploading": "Uploading", + "AjaxFileUpload_Uploaded": "Uploaded", + "AjaxFileUpload_Cancelling": "Cancelling...", + "AjaxFileUpload_CancellingUpload": "Cancelling upload...", + "AjaxFileUpload_UploadCanceled": "File upload cancelled.", + "AjaxFileUpload_Canceled": "cancelled", + "AjaxFileUpload_error": "error", + "AjaxFileUpload_MaxNumberOfFilesExceeded": "Maximum number of files exceeded", + "AjaxFileUpload_WrongFileType": "Can\u0027t add file \u0027{0}\u0027 to upload list. File with type \u0027{1}\u0027 is not allowed" +}; + +Type.registerNamespace('Sys.Extended.UI.Localization'); + +Sys.Extended.UI.Localization.SetLocale = function(locale) { + var localeData = Sys.Extended.UI.Localization[locale]; + if(!localeData) + return; + + for(var key in localeData) { + if(localeData.hasOwnProperty(key)) + Sys.Extended.UI.Resources[key] = localeData[key]; + } +} diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.es.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.es.debug.js new file mode 100644 index 000000000..01bab6f35 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.es.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["es"] = { + "Calendar_Today": "Hoy: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.fr.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.fr.debug.js new file mode 100644 index 000000000..f4eb25edb --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.fr.debug.js @@ -0,0 +1,27 @@ +Sys.Extended.UI.Localization["fr"] = { + "Calendar_Today": "Aujourd\u0027hui : {0}", + "AjaxFileUpload_DropFiles": "Glisser les fichiers ici", + "AjaxFileUpload_AllFilesUploaded": "Tous les files ont été envoyés.", + "AjaxFileUpload_SelectFile": "Sélectionner un fichier", + "AjaxFileUpload_Remove": "Supprimer", + "AjaxFileUpload_Upload": "Envoi", + "AjaxFileUpload_Cancel": "Annuler", + "AjaxFileUpload_FileList": "Liste des fichiers envoyés :", + "AjaxFileUpload_SelectFileToUpload": "Veuiller sélectionner le(s) fichier(s) à envoyer.", + "AjaxFileUpload_Pending": "en attente", + "AjaxFileUpload_FileInQueue": "{0} fichier(s) dans la file d\u0027attente.", + "AjaxFileUpload_UploadingHtml5File": "Envoi de fichier : {0} sur un total de {1} octets.", + "AjaxFileUpload_UploadingInputFile": "Envoi du fichier : {0}.", + "AjaxFileUpload_UploadError": "Une erreur est survenu lors l\u0027envoi de fichier.", + "AjaxFileUpload_DefaultError": "Error lors de l\u0027envoi du fichier.", + "AjaxFileUpload_UploadedPercentage": "{0} % envoyé", + "AjaxFileUpload_Uploading": "Envoi", + "AjaxFileUpload_Uploaded": "Envoyé", + "AjaxFileUpload_Cancelling": "Annulation en cours", + "AjaxFileUpload_CancellingUpload": "Annulation de l\u0027envoi...", + "AjaxFileUpload_UploadCanceled": "Envoi de fichier annulé.", + "AjaxFileUpload_Canceled": "annulé", + "AjaxFileUpload_error": "erreur", + "AjaxFileUpload_MaxNumberOfFilesExceeded": "Maximum number of files exceeded", + "AjaxFileUpload_WrongFileType": "Can\u0027t add file \u0027{0}\u0027 to upload list. File with type \u0027{1}\u0027 is not allowed" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.he.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.he.debug.js new file mode 100644 index 000000000..6ea690056 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.he.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["he"] = { + "Calendar_Today": "היום: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.hi.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.hi.debug.js new file mode 100644 index 000000000..81b1e5211 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.hi.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["hi"] = { + "Calendar_Today": "आज: {0}" +}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.it.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.it.debug.js new file mode 100644 index 000000000..de21771b9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.it.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["it"] = { + "Calendar_Today": "Oggi: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ja.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ja.debug.js new file mode 100644 index 000000000..b975cf963 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ja.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["ja"] = { + "Calendar_Today": "今日: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ko.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ko.debug.js new file mode 100644 index 000000000..e27f2afa9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ko.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["ko"] = { + "Calendar_Today": "오늘: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.nl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.nl.debug.js new file mode 100644 index 000000000..308592296 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.nl.debug.js @@ -0,0 +1,54 @@ +Sys.Extended.UI.Localization["nl"] = { + "AlwaysVisible_ElementRequired": "Sys.Extended.UI.AlwaysVisibleControlBehavior moet een element hebben", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.SequenceAnimation kan niet genest worden binnen Sys.Extended.UI.Animation.ParallelAnimation", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation kan geen deelanimaties toevoegen aantype \"{0}\" omdat deze niet afgeleid is van Sys.Extended.UI.Animation.ParentAnimation", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation kan alleen types registreren die afgeleid zijn van Sys.Extended.UI.Animation.Animation", + "Animation_InvalidColor": "Color moet een hexadecimale notatie van 7 tekens zijn (bijv. #246ACF), niet \"{0}\"", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation vereist een object met een AnimationName-eigenschap", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation vond geen eigenschap corresponderend met \"{0}\" of \"{1}\"", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation vond geen eigenschap corresponderend met \"{0}\"", + "Animation_TargetNotFound": "Sys.Extended.UI.Animation.Animation.set_animationTarget vereist dat de ID van een Sys.UI.DomElement of Sys.UI.Control. Er kon geen element of control gevonden worden corresponderend met \"{0}\"", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation kon geen Animation vinden corresponderend met de naam \"{0}\"", + "Calendar_Today": "Vandaag: {0}", + "CascadingDropDown_MethodError": "[Methodefout {0}]", + "CascadingDropDown_MethodTimeout": "[Methodetimeout]", + "CascadingDropDown_NoParentElement": "Kon geen bovenliggend element \"{0}\" vinden", + "CollapsiblePanel_NoControlID": "Kon element \"{0}\"niet vinden", + "Common_DateTime_InvalidFormat": "Ongeldige notatie", + "Common_DateTime_InvalidTimeSpan": "De eenheid \"{0}\"\u0027 is niet geldig voor parseBorderWidth", + "Common_InvalidBorderWidthUnit": "A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth", + "Common_InvalidPaddingUnit": "De eenheid \"{0}\" is niet geldig voor parsePadding", + "Common_UnitHasNoDigits": "Geen cijfers", + "DynamicPopulate_WebServiceError": "Web Service-aanroep mislukt: {0}", + "DynamicPopulate_WebServiceTimeout": "Web Service heeft niet tijdig gereageerd", + "ExtenderBase_CannotSetClientStateField": "clientStateField kan alleen vóór initialisatie worden ingesteld", + "ExtenderBase_ControlNotRegisteredForCallbacks": "Deze control is niet geregistreerd voor callbacks", + "ExtenderBase_InvalidClientStateType": "saveClientState moet een waarde van het type string retourneren", + "ExtenderBase_PageNotRegisteredForCallbacks": "Deze pagina is niet geregistreerd voor callbacks", + "ListSearch_DefaultPrompt": "Typ om te zoeken", + "PasswordStrength_DefaultStrengthDescriptions": "Geen enkel;Zeer zwak;Zwak;Matig;Bijna in orde;Net voldoende;Gemiddeld;Goed;Sterk;Uitstekend;Onbreekbaar!", + "PasswordStrength_GetHelpRequirements": "Hulp voor wachtwoord-vereisten", + "PasswordStrength_InvalidStrengthDescriptions": "Ongeldig aantal tekststerkte-beschrijvingen opgegeven", + "PasswordStrength_InvalidStrengthDescriptionStyles": "Text Strength beschrijvingsstijl-klassen moeten met het aantal tekstbeschrijvingen overeenkomen.", + "PasswordStrength_InvalidWeightingRatios": "Strength Weighting ratio\u0027s moeten 4 elementen hebben", + "PasswordStrength_RemainingCharacters": "nog {0} tekens", + "PasswordStrength_RemainingMixedCase": "Hoofd- en kleine letters", + "PasswordStrength_RemainingNumbers": "nog {0} cijfers", + "PasswordStrength_RemainingSymbols": "nog {0} symbooltekens", + "PasswordStrength_Satisfied": "Niets meer benodigd", + "PasswordStrength_StrengthPrompt": "Sterkte:", + "PopupControl_NoDefaultProperty": "Geen standaard-eigenschap ondersteund voor control \"{0}\" van type \"{1}\"", + "PopupExtender_NoParentElement": "Kon geen bovenliggend element \"{0}\" vinden", + "Rating_CallbackError": "Een niet-afgehandelde uitzondering is opgetreden:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "Herschikken mislukt; zie details hieronder.\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "Kon geen onderliggend element van lijst met id \"{0}\" vinden", + "ResizableControlBehavior_CannotChangeProperty": "Veranderingen voor {0} niet ondersteund", + "ResizableControlBehavior_InvalidHandler": "{0} handler is geen functie, functienaam of functietekst", + "Shared_BrowserSecurityPreventsPaste": "De beveiligingsinstellingen van uw browser staan het automatisch uitvoeren van de plak-bewerking niet toe. Gebruik in plaats hiervan de toetsencombinatie Ctrl+V.", + "Slider_NoSizeProvided": "Stel geldige waarden in voor de height en width-CSS-attributen van de sliders CSS-klassen", + "Tabs_ActiveTabArgumentOutOfRange": "Het opgegeven argument maakt geen deel uit van de tabverzameling", + "Tabs_OwnerExpected": "owner moet ingesteld worden vóór initialisatie", + "Tabs_PropertySetAfterInitialization": "{0} kan na initialisatie niet meer worden gewijzigd", + "Tabs_PropertySetBeforeInitialization": "{0} kan vóór initialisatie niet worden gewijzigd", + "ValidatorCallout_DefaultErrorMessage": "Deze control is niet geldig" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pl.debug.js new file mode 100644 index 000000000..29310c5e3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pl.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["pl"] = { + "Calendar_Today": "Dzisiaj: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pt.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pt.debug.js new file mode 100644 index 000000000..235d30c10 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.pt.debug.js @@ -0,0 +1,3 @@ +Sys.Extended.UI.Localization["pt"] = { + "Calendar_Today": "Hoje: {0}" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ru.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ru.debug.js new file mode 100644 index 000000000..75ebf538c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.ru.debug.js @@ -0,0 +1,53 @@ +Sys.Extended.UI.Localization["ru"] = { + "AlwaysVisible_ElementRequired": "Sys.Extended.UI.AlwaysVisibleControlBehavior: элемент должен быть указан", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.SequenceAnimation не может быть вложен в Sys.Extended.UI.Animation.ParallelAnimation", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation не может добавить дочернюю анимацию к типу \"{0}\", который не является производным от Sys.Extended.UI.Animation.ParentAnimation", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation может регистрировать только типы, которые наследуются от Sys.Extended.UI.Animation.Animation", + "Animation_InvalidColor": "Цвето должен быть в 7-ми символьном шестнадцатеричном представлении (т.е. #246ACF), но не \"{0}\"", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation требует объект со свойством AnimationName", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation не нашел свойство, относящееся к \"{0}\" или \"{1}\"", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation не нашел свойство, относящееся к \"{0}\"", + "Animation_TargetNotFound": "Sys.Extended.UI.Animation.Animation.set_animationTarget требует ID типа Sys.UI.DomElement or Sys.UI.Control. Невозможно найти элемент или контрол, соответствующий \"{0}\"", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation невозможно найти Animation, относящуюся к имени \"{0}\"", + "Calendar_Today": "Сегодня: {0}", + "CascadingDropDown_MethodError": "[Ошибка метода {0}]", + "CascadingDropDown_MethodTimeout": "[Превышено время ожидания в методе]", + "CascadingDropDown_NoParentElement": "Невозможно найти родителя элемента \"{0}\"", + "CollapsiblePanel_NoControlID": "Невозможно найти элемент \"{0}\"", + "Common_DateTime_InvalidFormat": "Неверный формат", + "Common_DateTime_InvalidTimeSpan": "\"{0}\" не является правильным TimeSpan форматом", + "Common_InvalidBorderWidthUnit": "Единица типа \"{0}\"\u0027 не является правильной для parseBorderWidth", + "Common_InvalidPaddingUnit": "Единица типа \"{0}\" не является правильной для parsePadding", + "Common_UnitHasNoDigits": "Нет цифр", + "DynamicPopulate_WebServiceError": "Неудачный вызов вебсервиса: {0}", + "DynamicPopulate_WebServiceTimeout": "Превышено время ожидания вебсервиса", + "ExtenderBase_CannotSetClientStateField": "clientStateField может быть установлено только перед инициализацией", + "ExtenderBase_ControlNotRegisteredForCallbacks": "Этот Control не был зарегистрирован для обратных вызовов", + "ExtenderBase_InvalidClientStateType": "saveClientState должен возвращать значение типа String", + "ExtenderBase_PageNotRegisteredForCallbacks": "Этот Page не был зарегистрирован для обратных вызовов", + "ListSearch_DefaultPrompt": "Тип для поиска", + "PasswordStrength_DefaultStrengthDescriptions": "Отсутствует;Очень слабый;Слабый;Неподходящий;Почти хороший;Примерно нормальный;Нормальный;Хороший;Сильный;Замечательный;Первокласный!", + "PasswordStrength_GetHelpRequirements": "Получить помощь по требованиям к паролю", + "PasswordStrength_InvalidStrengthDescriptions": "Указано неверное кол-во описаний для уровней защищенности пароля", + "PasswordStrength_InvalidWeightingRatios": "Кол-во весовых коэффициентов защищенности пароля должно быть равно 4.", + "PasswordStrength_RemainingCharacters": "Еще {0} букв(ы)", + "PasswordStrength_RemainingMixedCase": "Требуются символ(ы) в разных регистрах", + "PasswordStrength_RemainingNumbers": "Еще {0} цифр(ы)", + "PasswordStrength_RemainingSymbols": "Еще {0} символ(а|ов)", + "PasswordStrength_Satisfied": "Все ок.", + "PasswordStrength_StrengthPrompt": "Пароль: ", + "PopupControl_NoDefaultProperty": "Свойство по умолчанию типа \"{1}\" для control \"{0}\" не поддерживается.", + "PopupExtender_NoParentElement": "Невозможно найти родителя элемента \"{0}\"", + "Rating_CallbackError": "Возникло необработанное исключение:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "Ошибка пересортировки, дополнительная информация ниже.\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "Невозможно найти ребенка листа с id \"{0}\"", + "ResizableControlBehavior_CannotChangeProperty": "Изменения для {0} не поддерживаются", + "ResizableControlBehavior_InvalidHandler": "{0} обработчик не является функцией, именем функции или текстом функции", + "Shared_BrowserSecurityPreventsPaste": "Настройки безопасности Вашего браузера не позволяют автоматическое выполнение операции вставки. Пожалуйста, воспользуйтесь комбинацией Ctrl+V.", + "Slider_NoSizeProvided": "Пожалуйста, установите правильные значения высоты и ширины для CSS класса ползунка", + "Tabs_ActiveTabArgumentOutOfRange": "Аргумент не является цленом коллекции закладок", + "Tabs_OwnerExpected": "Владелец должен быть установлен перед инициализацией", + "Tabs_PropertySetAfterInitialization": "{0} не может быть изменен после инициализации", + "Tabs_PropertySetBeforeInitialization": "{0} не может быть изменен перед инициализацией", + "ValidatorCallout_DefaultErrorMessage": "Данный элемент не является валидным" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.tr.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.tr.debug.js new file mode 100644 index 000000000..6d4548e13 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.tr.debug.js @@ -0,0 +1,54 @@ +Sys.Extended.UI.Localization["tr"] = { + "AlwaysVisible_ElementRequired": "Sys.Extended.UI.AlwaysVisibleControlBehavior element içermek zorundadır", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.SequenceAnimation Sys.Extended.UI.Animation.ParallelAnimation içinde yer alamaz", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation Sys.Extended.UI.Animation.ParentAnimation dan türetilmeyen alt animasyonları \"{0}\" tipine ekleyemez", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation sadece Sys.Extended.UI.Animation.Animation dan türetilmiş tipleri kayıt edebilir", + "Animation_InvalidColor": "Renk tanımı \"{0}\" şeklinde değil 7-karakter 16\u0027lık sayı düzeninde belirtilmelidir (örneğin #246ACF)", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation AnimationName özelliği olan bir objeye ihtiyaç duyar", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation \"{0}\" veya \"{1}\" ile uygun bir özellik bulamadı", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation \"{0}\" ile uygun bir özellik bulamadı", + "Animation_TargetNotFound": "\"{0}\" ile uygun element veya kontrol bulunamadı. Sys.Extended.UI.Animation.Animation.set_animationTarget Sys.UI.DomElement veya Sys.UI.Control ID ye ihtiyaç duyar.", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation \"{0}\" isminde bir Animasyon bulamadı", + "Calendar_Today": "Bugün: {0}", + "CascadingDropDown_MethodError": "[Metot hatası {0}]", + "CascadingDropDown_MethodTimeout": "[Metot zaman aşımı]", + "CascadingDropDown_NoParentElement": "\"{0}\" kök elementi bulunamadı", + "CollapsiblePanel_NoControlID": "\"{0}\" elementi bulunamadı", + "Common_DateTime_InvalidFormat": "Yanlış format", + "Common_DateTime_InvalidTimeSpan": "\"{0}\" geçerli bir TimeSpan formatı değil", + "Common_InvalidBorderWidthUnit": "\"{0}\" birim tipi parseBorderWidth için geçersiz", + "Common_InvalidPaddingUnit": "\"{0}\" birim tipi parsePadding için geçersiz", + "Common_UnitHasNoDigits": "Rakam yok", + "DynamicPopulate_WebServiceError": "Web Servis çağrısı başarısız oldu: {0}", + "DynamicPopulate_WebServiceTimeout": "Web Servis çağrısı zaman aşımına uğradı", + "ExtenderBase_CannotSetClientStateField": "clientStateField sadece başlangıç noktasından önce ayarlanabilir", + "ExtenderBase_ControlNotRegisteredForCallbacks": "Bu kontrol geri arama işlemleri için kaydedilmedi", + "ExtenderBase_InvalidClientStateType": "saveClientState String tipinde bir değer döndürmelidir", + "ExtenderBase_PageNotRegisteredForCallbacks": "Bu sayfa geri arama işlemleri için kaydedilmedi", + "ListSearch_DefaultPrompt": "Arama için yazın", + "PasswordStrength_DefaultStrengthDescriptions": "Kabul Edilemez;Çok Zayıf;Zayıf;Biraz Zayıf;Vasat;Kabul Edilebilir;Ortalama;İyi;Güçlü;Mükemmel;Kırılamaz!", + "PasswordStrength_GetHelpRequirements": "Şifre gereksinimleri hakkında yardım al", + "PasswordStrength_InvalidStrengthDescriptions": "Yanlış sayıda şifre yetkinliği tanımı belirlendi", + "PasswordStrength_InvalidStrengthDescriptionStyles": "Şifre yetkinliği tanımlama stil sınıfları yazım tariflerinin sayısına eşit olmalıdır", + "PasswordStrength_InvalidWeightingRatios": "Şifre yetkinliği oranı 4 elemente sahip olmalıdır", + "PasswordStrength_RemainingCharacters": "{0} harf daha", + "PasswordStrength_RemainingMixedCase": "Karmaşık tipte harf", + "PasswordStrength_RemainingNumbers": "{0} sayı daha", + "PasswordStrength_RemainingSymbols": "{0} sembol daha", + "PasswordStrength_Satisfied": "Şifre yetkinliği sağlandı", + "PasswordStrength_StrengthPrompt": "Şifre yetkinliği:", + "PopupControl_NoDefaultProperty": "\"{1}\" tipindeki \"{0}\" kontrolü için varsayılan bir özellik belirlenmedi", + "PopupExtender_NoParentElement": "\"{0}\" kök elementi bulunamadı", + "Rating_CallbackError": "İşlenemez bir hata oluştu:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "Yeniden düzenleme başarısız oldu, detayı aşağıda.\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "Listede id \"{0}\" olan bir alt birim bulunamadı", + "ResizableControlBehavior_CannotChangeProperty": "{0} üstündeki değişiklikleri desteklenmemektedir", + "ResizableControlBehavior_InvalidHandler": "{0} işleyicisi fonksiyon, fonksiyon ismi veya fonksiyon metni değil", + "Shared_BrowserSecurityPreventsPaste": "Tarayıcınızın güvenlik ayarları otomatik yapıştırma işlemine izin vermemektedir. Lütfen Ctrl+V klavye kısayolunu kullanın.", + "Slider_NoSizeProvided": "Lütfen kaydırıcının (slider) CSS sınıflarında genişlik ve yükseklik için geçerli değerler kullanın", + "Tabs_ActiveTabArgumentOutOfRange": "Argüman sekme koleksiyonunun bir üyesi değil", + "Tabs_OwnerExpected": "Başlangıç noktasına gelmeden önce sahip belirlenmelidir", + "Tabs_PropertySetAfterInitialization": "Başlangıç noktası geçildikten sonra {0} değiştirilemez", + "Tabs_PropertySetBeforeInitialization": "Başlangıç noktasına varılmadan önce {0} değiştirilemez", + "ValidatorCallout_DefaultErrorMessage": "Bu kontrol geçersiz" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHS.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHS.debug.js new file mode 100644 index 000000000..4ff4cad1a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHS.debug.js @@ -0,0 +1,54 @@ +Sys.Extended.UI.Localization["zh-CHS"] = { + "AlwaysVisible_ElementRequired": "必须为 Sys.Extended.UI.AlwaysVisibleControlBehavior 指定一个元素", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.ParallelAnimation 不能内含 Sys.Extended.UI.Animation.SequenceAnimation", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation 无法加入一个不是派生自 Sys.Extended.UI.Animation.ParentAnimation 且类型为 {0} 的子动画", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation 只能注册那些继承自 Sys.Extended.UI.Animation.Animation 的类型", + "Animation_InvalidColor": "标记名称 Color 必须是 7 个字符的 16 进位字符串(例如:#246ACF),不能是 {0}", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation 必须持有一个 AnimationName 属性的对象", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation 找不到相对应的 {0} 或 {1} 属性", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation 找不到相对应的 {0} 属性", + "Animation_TargetNotFound": "Sys.Extended.UI.Animation.Animation.set_animationTarget 需要一个 Sys.UI.DomElement 或 Sys.UI.Control 类的控件 ID。找不到相对应的 {0} 之元素或控件", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation 找不到名称为 {0} 的动画", + "Calendar_Today": "今天: {0}", + "CascadingDropDown_MethodError": "[方法错误 {0}]", + "CascadingDropDown_MethodTimeout": "[方法逾时]", + "CascadingDropDown_NoParentElement": "无法找到父元素 {0}", + "CollapsiblePanel_NoControlID": "无法找到元素 {0}", + "Common_DateTime_InvalidFormat": "格式无效", + "Common_DateTime_InvalidTimeSpan": "{0} 的 TimeSpan 格式无效", + "Common_InvalidBorderWidthUnit": "单位类型 {0} 对 parseBorderWidth 而言无效", + "Common_InvalidPaddingUnit": "单位类型 {0} 对 parsePadding 而言无效", + "Common_UnitHasNoDigits": "没有数字", + "DynamicPopulate_WebServiceError": "无法调用 Web 服务:{0}", + "DynamicPopulate_WebServiceTimeout": "调用 Web 服务超时", + "ExtenderBase_CannotSetClientStateField": "只能在初始化之前设定 clientStateField", + "ExtenderBase_ControlNotRegisteredForCallbacks": "这个控件尚未注册,无法提供回调", + "ExtenderBase_InvalidClientStateType": "saveClientState 必须返回 String 类型的值", + "ExtenderBase_PageNotRegisteredForCallbacks": "这个页面尚未注册,无法提供回调", + "ListSearch_DefaultPrompt": "请键入以便搜寻", + "PasswordStrength_DefaultStrengthDescriptions": "没有;很弱;弱;差;差强人意;尚可;普通;好;很好;非常好;臻于完美!", + "PasswordStrength_GetHelpRequirements": "取得密码强度的要求说明", + "PasswordStrength_InvalidStrengthDescriptions": "所指定的密码强度文字内容个数无效", + "PasswordStrength_InvalidStrengthDescriptionStyles": "密码强度文字说明的样式表,必须符合文字内容之个数", + "PasswordStrength_InvalidWeightingRatios": "密码强度的权重比例必须有 4 种", + "PasswordStrength_RemainingCharacters": "还需要 {0} 个字符", + "PasswordStrength_RemainingMixedCase": "大小写混合", + "PasswordStrength_RemainingNumbers": "还需要 {0} 个数字", + "PasswordStrength_RemainingSymbols": "还需要 {0} 个符号", + "PasswordStrength_Satisfied": "密码强度已经足够", + "PasswordStrength_StrengthPrompt": "强度:", + "PopupControl_NoDefaultProperty": "类型 {1} 的 控件 {0} 不支持预设属性", + "PopupExtender_NoParentElement": "无法找到父元素 {0}", + "Rating_CallbackError": "发生未处理的异常状况:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "无法重新排列,请参考下面的说明:\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "无法找到 ID 为 {0} 的子清单", + "ResizableControlBehavior_CannotChangeProperty": "不支持对 {0} 的变更", + "ResizableControlBehavior_InvalidHandler": "{0} 处理例程不是函数、函数名称、或是函数文字", + "Shared_BrowserSecurityPreventsPaste": "您的浏览器安全性设定,不允许执行自动粘贴的操作。请改用键盘快捷键 Ctrl + V。", + "Slider_NoSizeProvided": "请在 Slider 的 CSS Class 中,设定高度与宽度属性的有效值", + "Tabs_ActiveTabArgumentOutOfRange": "参数不是索引标签 (Tab) 集合的成员", + "Tabs_OwnerExpected": "于初始化之前,必须设定拥有者", + "Tabs_PropertySetAfterInitialization": "于初始化之后,无法变更 {0}", + "Tabs_PropertySetBeforeInitialization": "于初始化之前,无法变更 {0}", + "ValidatorCallout_DefaultErrorMessage": "这个控件无效" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHT.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHT.debug.js new file mode 100644 index 000000000..1fda12e2a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Localization.Resources.zh-CHT.debug.js @@ -0,0 +1,54 @@ +Sys.Extended.UI.Localization["zh-CHT"] = { + "AlwaysVisible_ElementRequired": "必須替 Sys.Extended.UI.AlwaysVisibleControlBehavior 指定一個項目", + "Animation_CannotNestSequence": "Sys.Extended.UI.Animation.ParallelAnimation 不能內含 Sys.Extended.UI.Animation.SequenceAnimation", + "Animation_ChildrenNotAllowed": "Sys.Extended.UI.Animation.createAnimation 無法加入一個不是衍生自 Sys.Extended.UI.Animation.ParentAnimation 且類型為 {0} 的子動畫", + "Animation_InvalidBaseType": "Sys.Extended.UI.Animation.registerAnimation 只能註冊那些繼承自 Sys.Extended.UI.Animation.Animation 的類型", + "Animation_InvalidColor": "標記名稱 Color 必須是 7 個字元的 16 進位字串(例如:#246ACF),不能是 {0}", + "Animation_MissingAnimationName": "Sys.Extended.UI.Animation.createAnimation 必須持有一個 AnimationName 屬性的物件", + "Animation_NoDynamicPropertyFound": "Sys.Extended.UI.Animation.createAnimation 找不到相對應的 {0} 或 {1} 屬性", + "Animation_NoPropertyFound": "Sys.Extended.UI.Animation.createAnimation 找不到相對應的 {0} 屬性", + "Animation_TargetNotFound": "Sys.Extended.UI.Animation.Animation.set_animationTarget 需要一個 Sys.UI.DomElement 或 Sys.UI.Control 類別的控制項 ID。找不到相對應的 {0} 之項目或控制項", + "Animation_UknownAnimationName": "Sys.Extended.UI.Animation.createAnimation 找不到名稱為 {0} 的動畫", + "Calendar_Today": "今天: {0}", + "CascadingDropDown_MethodError": "[方法錯誤 {0}]", + "CascadingDropDown_MethodTimeout": "[方法逾時]", + "CascadingDropDown_NoParentElement": "無法找到父項目 {0}", + "CollapsiblePanel_NoControlID": "無法找到項目 {0}", + "Common_DateTime_InvalidFormat": "格式無效", + "Common_DateTime_InvalidTimeSpan": "{0} 的 TimeSpan 格式無效", + "Common_InvalidBorderWidthUnit": "單位類型 {0} 對 parseBorderWidth 而言無效", + "Common_InvalidPaddingUnit": "單位類型 {0} 對 parsePadding 而言無效", + "Common_UnitHasNoDigits": "沒有數字", + "DynamicPopulate_WebServiceError": "無法呼叫 Web 服務:{0}", + "DynamicPopulate_WebServiceTimeout": "呼叫 Web 服務逾時", + "ExtenderBase_CannotSetClientStateField": "只能在初始化之前設定 clientStateField", + "ExtenderBase_ControlNotRegisteredForCallbacks": "這個控制項尚未註冊,無法提供回呼", + "ExtenderBase_InvalidClientStateType": "saveClientState 必須傳回 String 型別的值", + "ExtenderBase_PageNotRegisteredForCallbacks": "這個頁面尚未註冊,無法提供回呼", + "ListSearch_DefaultPrompt": "請鍵入以便搜尋", + "PasswordStrength_DefaultStrengthDescriptions": "沒有;很弱;弱;差;差強人意;尚可;普通;好;很好;非常好;臻於完美!", + "PasswordStrength_GetHelpRequirements": "取得密碼複雜性的要求說明", + "PasswordStrength_InvalidStrengthDescriptions": "所指定的密碼複雜性文字內容個數無效", + "PasswordStrength_InvalidStrengthDescriptionStyles": "密碼複雜性文字說明的樣式表,必須符合文字內容之個數", + "PasswordStrength_InvalidWeightingRatios": "密碼複雜性的權重比例必須有 4 種", + "PasswordStrength_RemainingCharacters": "還需要 {0} 個字元", + "PasswordStrength_RemainingMixedCase": "大小寫混合", + "PasswordStrength_RemainingNumbers": "還需要 {0} 個數字", + "PasswordStrength_RemainingSymbols": "還需要 {0} 個符號", + "PasswordStrength_Satisfied": "密碼複雜性已經足夠", + "PasswordStrength_StrengthPrompt": "複雜性:", + "PopupControl_NoDefaultProperty": "類型 {1} 的 控制項 {0} 不支援預設屬性", + "PopupExtender_NoParentElement": "無法找到父項目 {0}", + "Rating_CallbackError": "發生未處理的例外狀況:\\r\\n{0}", + "ReorderList_DropWatcherBehavior_CallbackError": "無法重新排列,請參考下面的說明:\\r\\n\\r\\n{0}", + "ReorderList_DropWatcherBehavior_NoChild": "無法找到 ID 為 {0} 的子清單", + "ResizableControlBehavior_CannotChangeProperty": "不支援對 {0} 的變更", + "ResizableControlBehavior_InvalidHandler": "{0} 處理常式不是函式、函式名稱、或是函式文字", + "Shared_BrowserSecurityPreventsPaste": "您的瀏覽器安全性設定,不允許執行自動貼上的操作。請改用鍵盤快速鍵 Ctrl + V。", + "Slider_NoSizeProvided": "請在 Slider 的 CSS Class 中,設定高度與寬度屬性的有效值", + "Tabs_ActiveTabArgumentOutOfRange": "參數不是索引標籤 (Tab) 集合的成員", + "Tabs_OwnerExpected": "於初始化之前,必須設定擁有者", + "Tabs_PropertySetAfterInitialization": "於初始化之後,無法變更 {0}", + "Tabs_PropertySetBeforeInitialization": "於初始化之前,無法變更 {0}", + "ValidatorCallout_DefaultErrorMessage": "這個控制項無效" +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEdit.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEdit.debug.js new file mode 100644 index 000000000..501cc1b9a --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEdit.debug.js @@ -0,0 +1,4240 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.MaskedEditBehavior = function(element) { + Sys.Extended.UI.MaskedEditBehavior.initializeBase(this, [element]); + + // mask + this._mask = ""; + this._maskType = Sys.Extended.UI.MaskedEditType.None; + this._filtered = ""; + this._promptCharacter = "_"; + this._inputDirection = Sys.Extended.UI.MaskedEditInputDirections.LeftToRight; + + // Message + this._messageValidatorTip = true; + this._showMessageErrorFloat = false; + this._cssMessageErrorFloat = ""; + + // AutoComplete + this._autoComplete = true; + this._autoCompleteValue = ""; + + // behavior + this._clearTextOnInvalid = false; + this._clearMaskOnLostfocus = true; + this._acceptAmPm = Sys.Extended.UI.MaskedEditShowSymbol.None; + this._acceptNegative = Sys.Extended.UI.MaskedEditShowSymbol.None; + this._displayMoney = Sys.Extended.UI.MaskedEditShowSymbol.None; + + // CSS + this._onFocusCssClass = "MaskedEditFocus"; + this._onInvalidCssClass = "MaskedEditError"; + this._onFocusCssNegative = "MaskedEditFocusNegative"; + this._onBlurCssNegative = "MaskedEditBlurNegative"; + + // globalization + this._cultureName = Sys.CultureInfo.CurrentCulture.name; // "en-US" + this._userDateFormat = Sys.Extended.UI.MaskedEditUserDateFormat.None; + this._userTimeFormat = Sys.Extended.UI.MaskedEditUserTimeFormat.None; + + // globalization Hidden + this._cultureDatePlaceholder = Sys.CultureInfo.CurrentCulture.dateTimeFormat.DateSeparator; // "/" + this._cultureTimePlaceholder = Sys.CultureInfo.CurrentCulture.dateTimeFormat.TimeSeparator; // ":" + this._cultureDecimalPlaceholder = Sys.CultureInfo.CurrentCulture.numberFormat.NumberDecimalSeparator; // "." + this._cultureThousandsPlaceholder = Sys.CultureInfo.CurrentCulture.numberFormat.NumberGroupSeparator; // "," + + this._cultureDateFormat = "MDY"; + var parts = Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern.split(this._cultureDatePlaceholder); + + if(parts.length >= 3) + this._cultureDateFormat = parts[0].substr(0, 1).toUpperCase() + parts[1].substr(0, 1).toUpperCase() + parts[2].substr(0, 1).toUpperCase(); // "MDY" + + this._cultureCurrencySymbolPlaceholder = Sys.CultureInfo.CurrentCulture.numberFormat.CurrencySymbol; // "$" + this._cultureAMPMPlaceholder = Sys.CultureInfo.CurrentCulture.dateTimeFormat.PMDesignator + ";" + Sys.CultureInfo.CurrentCulture.dateTimeFormat.PMDesignator; // "AM;PM" + this._AMPMPlaceholderSeparator = ";"; + this._century = 1900; + + // clipboard + this._allowCopyPaste = true; + this._clipboardText = (Sys.Extended.UI.Resources && Sys.Extended.UI.Resources.Shared_BrowserSecurityPreventsPaste) || + "Your browser security settings don't permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."; + + // local var mask valid + // 9 = only numeric + // L = only letter + // $ = only letter and spaces + // C = only custom - read from this._filtered + // A = only letter and custom + // N = only numeric and custom + // ? = any digit + this._CharsEditMask = "9L$CAN?"; + + // local var special mask + // At runtime replace with culture property + // / = Date placeholder + // : = Time placeholder + // . = Decimal placeholder + // , = Thousands placeholder + this._CharsSpecialMask = "/:.,"; + + // local converted mask + // i.e.: 9{2} => 99 , 9{2}/9{2}/9{2} = 99/99/99 + this._maskConv = ""; + + this._EmptyMask = ""; + this._maskvalid = "" + this._DirectSelText = ""; // save the Direction selected Text (only for ie) + this._initialvalue = ""; // save the initial value for verify changed + this._LogicSymbol = ""; // save the symbol - or AM/PM + this._LogicTextMask = ""; // save logic mask with text input + this._LogicMask = ""; // save logic mask without text + this._LogicMaskConv = ""; // save logic mask without text and without escape + this._LogicPrompt = String.fromCharCode(1); // logic prompt char + this._LogicEscape = String.fromCharCode(2); // logic escape char + this._LogicFirstPos = -1; // first valid position + this._LogicLastPos = -1; // Last valid position + this._LogicLastInt = -1; // Last valid position RTL Integer with decimal + this._LogicDateTimeSepPos = -1; // valid position seperating date & time + this._QtdValidInput = 0; // Qtd Valid input Position + this._InLostfocus = false; // Flag to validate in lost focus not duplicate clearMask execute + this._ExternalMessageError = ""; // Save local MessageError from Controls Validator + this._CurrentMessageError = ""; // Save local Current MessageError + this._FiringOnChange = false; // true when OnChange is being fired + this._ErroOnEnter = false; // Flag Erro validate with Enter + + // local chars ANSI + this._charLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + this._charNumbers = "0123456789"; + this._charEscape = "\\"; + + // local placeholder delimit for info repeat mask + this._DelimitStartDup = "{"; + this._DelimitEndDup = "}"; + + // Handler + this._focusHandler = null; + this._keypressdown = null; + this._keypressHandler = null; + this._blurHandler = null; + this._mouseOutHandler = null; + this._mouseOutHandler = null; + this._mouseMoveHandler = null; + this._mouseEnterHandler = null; + this._changeHandler = null; + + // Only for Opera + this._timer = null; //Timer + this._timerHandler = null; //Timer Handler + this._SaveSymb = ""; // Symb Saved immediate perform Action + this._SaveText = ""; // Text Saved immediate perform Action + this._SavePosi = -1; // Cursor pos Saved immediate perform Action + this._SaveMask = ""; // Mask with text Saved + this._SaveKeyDown = 0; // save scancode at keydown +} + +Sys.Extended.UI.MaskedEditBehavior.prototype = { + + initialize: function() { + var e = this.get_element(); + + this._InLostfocus = true; + Sys.Extended.UI.MaskedEditBehavior.callBaseMethod(this, 'initialize'); + + this._createMask(); + + // if this textbox is focused initially + var hasInitialFocus = false, + clientState = this.get_ClientState(); + + if(clientState != null && clientState != "") { + hasInitialFocus = (clientState == "Focused"); + this.set_ClientState(null); + } + + //only for ie , for firefox see keydown + try { + if(e === document.activeElement) + hasInitialFocus = true; + } catch(ex) { } + + // Create delegates Attach events + if(this._showMessageErrorFloat) { + this._mouseOutHandler = Function.createDelegate(this, this._onMouseOut); + $addHandler(e, "mouseout", this._mouseOutHandler); + + this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove); + $addHandler(e, "mousemove", this._mouseMoveHandler); + + this._mouseEnterHandler = Function.createDelegate(this, this._onMouseover); + $addHandler(e, "mouseover", this._mouseEnterHandler); + } + + if(!e.readOnly) { + this._keypressdown = Function.createDelegate(this, this._onKeyPressdown); + $addHandler(e, "keydown", this._keypressdown); + + this._keypressHandler = Function.createDelegate(this, this._onKeyPress); + $addHandler(e, "keypress", this._keypressHandler); + } + + this._focusHandler = Function.createDelegate(this, this._onFocus); + $addHandler(e, "focus", this._focusHandler); + + this._blurHandler = Function.createDelegate(this, this._onBlur); + $addHandler(e, "blur", this._blurHandler); + + this._changeHandler = Function.createDelegate(this, this._onChange); + $addHandler(e, "change", this._changeHandler); + + if(Sys.Browser.agent == Sys.Browser.Opera) { + this._timerHandler = Function.createDelegate(this, this._OnTimerTicket); + this._timer = new Sys.Timer(); + this._timer.set_enabled(false); + this._timer.set_interval(100); + this._timer.add_tick(this._timerHandler); + this._SaveText = ""; + this._SavePosi = -1; + this._timer.set_enabled(true); + } + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e); + this._InitValue(wrapper.get_Value(), true); + + if(hasInitialFocus) { + this._onFocus(); + } else { + if(this._clearMaskOnLostfocus) + wrapper.set_Value(this._getClearMask(wrapper.get_Value())); + + var IsValid = this._CaptureServerValidators(); + if(!IsValid) + if(this._onInvalidCssClass != "") + this.addCssClassMaskedEdit(this._onInvalidCssClass); + } + }, + + dispose: function() { + var e = this.get_element(); + + if(this._mouseOutHandler) { + $removeHandler(e, "mouseout", this._mouseOutHandler); + this._mouseOutHandler = null; + } + + if(this._mouseMoveHandler) { + $removeHandler(e, "mousemove", this._mouseMoveHandler); + this._mouseMoveHandler = null; + } + + if(this._mouseEnterHandler) { + $removeHandler(e, "mouseover", this._mouseEnterHandler); + this._mouseEnterHandler = null; + } + + if(this._focusHandler) { + $removeHandler(e, "focus", this._focusHandler); + this._focusHandler = null; + } + + if(this._focusHandler) { + $removeHandler(e, "focus", this._focusHandler); + this._focusHandler = null; + } + + if(this._blurHandler) { + $removeHandler(e, "blur", this._blurHandler); + this._blurHandler = null; + } + + if(this._changeHandler) { + $removeHandler(e, "change", this._changeHandler); + this._changeHandler = null; + } + + if(this._keypressdown) { + $removeHandler(e, "keydown", this._keypressdown); + this._keypressdown = null; + } + + if(this._keypressHandler) { + $removeHandler(e, "keypress", this._keypressHandler); + this._keypressHandler = null; + } + + if(this._timerHandler) { + this._timer.set_enabled(false); + this._timerHandler = null; + this._timer.dispose(); + this._timer = null; + } + + Sys.Extended.UI.MaskedEditBehavior.callBaseMethod(this, 'dispose'); + }, + // EVENT TARGET + _OnTimerTicket: function() { + this._SaveSymb = ""; + + if(this._InLostfocus) + return; + + this._timer.set_enabled(false); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + if(this._SaveText != "") { + wrapper.set_Value(this._SaveText); + + this.setSelectionRange(this._SavePosi, this._SavePosi); + this._SaveText = ""; + this._SavePosi = -1; + this._SaveMask = wrapper.get_Value(); + } else { + if(wrapper.get_Value().length != this._EmptyMask.length) + wrapper.set_Value(this._SaveMask); + + if(this._timer.get_interval() != 100) + this._timer.set_interval(100); + } + + this._timer.set_enabled(true); + }, + + _onChange: function() { + if(!this._FiringOnChange) + //capture and initialize external input Ex : calendar Extender + this._onFocus(); + }, + + _onFocus: function() { + var e = this.get_element(); + if(e.readOnly || e.disabled) + return; + + if(!this._keypressdown) { + this._keypressdown = Function.createDelegate(this, this._onKeyPressdown); + $addHandler(e, "keydown", this._keypressdown); + } + + if(!this._keypressHandler) { + this._keypressHandler = Function.createDelegate(this, this._onKeyPress); + $addHandler(e, "keypress", this._keypressHandler); + } + + this._InLostfocus = false; + this._RemoveDivToolTip(); + + if(this._onFocusCssClass != "") + this.addCssClassMaskedEdit(this._onFocusCssClass); + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e); + this._initialvalue = wrapper.get_Value(); + this._InitValue(wrapper.get_Value(), false); + + var ClearText = this._getClearMask(), + hastip = false; + + if(this._messageValidatorTip && ClearText == "") + hastip = true; + + if((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.get_cultureAMPMPlaceholder() != "" && ClearText == "") { + if(this._acceptAmPm) + this.insertAMPM(this.get_cultureAMPMPlaceholder().substring(0, 1)); + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && ClearText != "") { + if(this._LogicSymbol == "-" && this._onFocusCssNegative != "") + this.addCssClassMaskedEdit(this._onFocusCssNegative); + } + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(this._LogicLastInt != -1) + this.setSelectionRange(this._LogicLastInt, this._LogicLastInt); + else + this.setSelectionRange(this._LogicLastPos + 1, this._LogicLastPos + 1); + } else { + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && ClearText != "") { + var pos = this._getLastEmptyPosition() + 1; + this.setSelectionRange(pos, pos); + } else { + this.setSelectionRange(this._LogicFirstPos, this._LogicFirstPos); + } + } + + this.showTooltipMessage(false); + if(hastip) + this.showTooltipMessage(true); + }, + + _PeforformValidLostFocus: function(isblur) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + var ClearText = this._getClearMask(wrapper.get_Value()); + + if(ClearText == "" && this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._LogicSymbol == "-") + this.insertSignal("+"); + + // auto format + if(ClearText != "" && this._autoComplete && this._maskType == Sys.Extended.UI.MaskedEditType.Date) + this.AutoFormatDate(); + else if(ClearText != "" && this._autoComplete && this._maskType == Sys.Extended.UI.MaskedEditType.Time) + this.AutoFormatTime(); + else if(ClearText != "" && this._autoComplete && this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + this.AutoFormatDateTime(); + else if(ClearText != "" && this._autoComplete && this._maskType == Sys.Extended.UI.MaskedEditType.Number) + this.AutoFormatNumber(); + + // clear mask and set CSS + if((this._clearMaskOnLostfocus && ClearText != "") || (isblur && this._clearMaskOnLostfocus)) + wrapper.set_Value(this._getClearMask(wrapper.get_Value())); + + this.addCssClassMaskedEdit(""); + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._LogicSymbol == "-" && this._onBlurCssNegative != "") + this.addCssClassMaskedEdit(this._onBlurCssNegative); + + // perform validation + this.showTooltipMessage(false); + this._RemoveDivToolTip(); + + var IsValid = this._CaptureClientsValidators(); + if(!IsValid) { + if(this._onInvalidCssClass != "") + this.addCssClassMaskedEdit(this._onInvalidCssClass); + + if(this._clearTextOnInvalid) { + this._createMask(); + wrapper.set_Value(this._EmptyMask); + } + } + + return IsValid; + }, + + _onBlur: function(evt) { + this._InLostfocus = true; + var IsValid = this._PeforformValidLostFocus(true); + + if(IsValid) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + // trigger TextChanged with postback + if(!this.get_element().readOnly && (this._initialvalue != wrapper.get_Value()) && evt) + this._fireChanged(); + } + }, + + _fireChanged: function() { + // Attempts to fire the change event on the attached textbox + this._FiringOnChange = true; + var elt = this.get_element(); + + if(document.createEventObject) { + elt.fireEvent("onchange"); + } else if(document.createEvent) { + var e = document.createEvent("HTMLEvents"); + e.initEvent("change", true, true); + elt.dispatchEvent(e); + } + + this._FiringOnChange = false; + }, + + _onKeyPress: function(evt) { + var scancode = this._KeyCode(evt); + if(scancode == 9) // tab default action + return true; + + if(scancode == 13) { + var IsValid = this._PeforformValidLostFocus(false); + this._ErroOnEnter = false; + + if(!IsValid) + this._ErroOnEnter = true; + + // Opera not perform cancel event. Re-perform at Timer + if(Sys.Browser.agent == Sys.Browser.Opera) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + this._SaveText = wrapper.get_Value(); + this._SavePosi = this._getCurrentPosition(); + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + + return IsValid; + } + + if(this._onFocusCssClass != "" && this._ErroOnEnter) + this.addCssClassMaskedEdit(this._onFocusCssClass); + + this._ErroOnEnter = false; + if(!this._isNormalChar(evt, scancode)) { + this._ExecuteNav(evt, scancode); + return false; + } + + // process and validate normal char + var curpos = this._deleteTextSelection(); + if(curpos == -1) + curpos = this._getCurrentPosition() + + var c = String.fromCharCode(scancode); + if(this._maskType == Sys.Extended.UI.MaskedEditType.Date && c == this.get_cultureDatePlaceholder()) + this._AdjustElementDate(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Time && c == this.get_cultureTimePlaceholder()) + this._AdjustElementTime(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime && (c == this.get_cultureTimePlaceholder() || c == this.get_cultureDatePlaceholder())) + this._AdjustElementDateTime(c); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight && c == this.get_cultureDecimalPlaceholder() && curpos == this._LogicLastInt) + this._AdjustElementDecimalLTR(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && c == this.get_cultureDecimalPlaceholder() && curpos == this._LogicLastInt) + this._AdjustElementDecimalRTL(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && c == this.get_cultureDecimalPlaceholder() && curpos != this._LogicLastInt) + this._MoveDecimalPos(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight && c == this.get_cultureThousandsPlaceholder()) + this._MoveThousandLTR(); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && c == this.get_cultureThousandsPlaceholder()) + this._MoveThousandRTL(); + else if((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.getCultureFirstLettersAMPM().toUpperCase().indexOf(c.toUpperCase()) != -1) { + if(this._acceptAmPm) { + this.insertAMPM(c); + this.setSelectionRange(curpos, curpos); + } + } + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) + if(Sys.Browser.agent != Sys.Browser.Opera) { + this.insertSignal(c); + this.setSelectionRange(curpos, curpos); + } else { + // Opera perform double event! when press "-" at numpad key + if(this._SaveSymb == "") { + this.insertSignal(c); + this.setSelectionRange(curpos, curpos); + this._SaveSymb = c; + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } else { + this._SaveSymb = ""; + } + } + else { + var OriPos = curpos; + curpos = this._getNextPosition(curpos); + var logiccur = curpos; + + if(this._LogicLastInt != -1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(OriPos == this._LogicLastInt) + logiccur = this._getLastEmptyPosition(); + } else { + if(curpos >= this._LogicLastPos + 1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + logiccur = this._getLastEmptyPosition(); + } + + if(this._processKey(logiccur, c)) { + if(this._messageValidatorTip) + this.showTooltipMessage(false); + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(this._LogicLastInt == -1) { + if(curpos < this._LogicLastPos + 1) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else { + this._insertContentRight(c); + curpos = this._LogicLastPos + 1; + } + } else { + if(OriPos != this._LogicLastInt) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + ClearText = this._getClearMask(wrapper.get_Value()); + + if(ClearText != "") { + var pospt = ClearText.indexOf(this.get_cultureDecimalPlaceholder()); + + if(pospt != -1) { + var intnum = ClearText.substring(0, pospt); + if(intnum == "0" || intnum == "-0") { + this.setSelectionRange(this._LogicLastInt - 1, this._LogicLastInt); + this._deleteTextSelection(); + curpos = this._LogicLastInt; + this.setSelectionRange(curpos, curpos); + } + } + } + + if(ClearText == "" && c == "0") { + curpos = this._LogicLastInt; + } else { + this._insertContentRight(c); + curpos = this._LogicLastInt; + } + } + } + } + + this.setSelectionRange(curpos, curpos); + } + } + + this._SetCancelEvent(evt); + + return false; + }, + + _onKeyPressdown: function(evt) { + // for other browsers not IE (NOT IMPLEMENT document.activeElement) + if(this._InLostfocus) + this._onFocus(evt); + + var scancode = this._KeyCode(evt); + if(scancode == 9) //tab default action + return true; + + if(scancode == 13) //enter + return true; + + if(!this._isNormalChar(evt, scancode)) { + this._ExecuteNav(evt, scancode); + } else { + // Opera not perform cancel event. Re-perform at Timer + if(Sys.Browser.agent == Sys.Browser.Opera) { + // cancel shift Ins , assume Ins = "-" + if(evt.rawEvent.shiftKey && !evt.rawEvent.ctrlKey && !evt.rawEvent.altKey && evt.rawEvent.keyCode == 45) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + this._SaveText = wrapper.get_Value(); + this._SavePosi = this._getCurrentPosition(); + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + } + } + }, + + _onMouseOut: function(evt) { + this._RemoveDivToolTip(); + }, + + _onMouseMove: function(evt) { + if((this._InLostfocus || this._ErroOnEnter) && this._ExternalMessageError != "") + this._ShowDivToolTip(evt); + }, + + _onMouseover: function(evt) { + // check if validation execute at asyc.post back + if(!$get("DivMaskedEditTip_" + this.get_element().id)) + this._CaptureServerValidators(); + + if((this._InLostfocus || this._ErroOnEnter) && this._ExternalMessageError != "") + this._createDivToolTip(evt, this._ExternalMessageError); + }, + + // CREATE TOOLTIP + _ShowDivToolTip: function(evt) { + var et = $get("DivMaskedEditTip_" + this.get_element().id); + if(!et) { + this._createDivToolTip(evt, this._ExternalMessageError); + et = $get("DivMaskedEditTip_" + this.get_element().id); + } + + var mousepos = this._GetMousePos(evt); + et.style.left = mousepos.x + 1 /* offset To prevent flick in FF */ + "px"; + et.style.top = mousepos.y + 1 /* offset To prevent flick in FF */ + "px"; + }, + + _GetMousePos: function(evt) { + var scrOfX = 0, scrOfY = 0; + if(typeof (window.pageYOffset) == 'number') { + //Netscape compliant + scrOfY = window.pageYOffset; + scrOfX = window.pageXOffset; + } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) { + //DOM compliant + scrOfY = document.body.scrollTop; + scrOfX = document.body.scrollLeft; + } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { + //IE6 standards compliant mode + scrOfY = document.documentElement.scrollTop; + scrOfX = document.documentElement.scrollLeft; + } + + var posX = 0, posY = 0; + if(typeof (evt.pageX) == 'number') { + posX = evt.pageX; + posY = evt.pageY; + } else if(typeof (evt.clientX) == 'number') { + posX = evt.clientX; + posY = evt.clientY; + } + + return { x: posX + scrOfX, y: posY + scrOfY } + }, + + _RemoveDivToolTip: function() { + var e = $get("DivMaskedEditTip_" + this.get_element().id); + if(e) + document.body.removeChild(e); + }, + + _createDivToolTip: function(evt, Msg) { + var e = $get("DivMaskedEditTip_" + this.get_element().id); + if(!e) { + var DivTp, + mousepos = this._GetMousePos(evt); + + DivTp = document.createElement("div"); + DivTp.id = "DivMaskedEditTip_" + this.get_element().id; + DivTp.style.position = "absolute"; + DivTp.style.left = mousepos.x + 2 /* offset */ + "px"; + DivTp.style.top = mousepos.y + 2 /* offset */ + "px"; + DivTp.style.zIndex = Sys.Extended.UI.zIndex.MaskedEditDivTip; + + if(this._cssMessageErrorFloat == "") { + DivTp.style.padding = "3px 3px 3px 3px"; + DivTp.style.border = "Solid 1px #000000"; + DivTp.style.backgroundColor = "#FFFFEA"; + DivTp.style.fontWeight = "normal"; + DivTp.style.fontSize = "12px"; + DivTp.style.fontFamily = "Arial"; + } else { + DivTp.className = this._cssMessageErrorFloat; + } + + DivTp.innerHTML = Msg; + DivTp = document.body.insertBefore(DivTp, document.body.firstChild); + } + }, + + // Execute Navigator on Mask + _ExecuteNav: function(evt, scanCode) { + if(evt.type == "keydown") { + if(this._isInternetExplorer()) { + // ctrl v + if((scanCode == 86 || scanCode == 118) && !evt.shiftKey && evt.ctrlKey && !evt.altKey) { + this._SetCancelEvent(evt); + this._PasteFromClipBoard(); + + return; + } + + // Shift Ins + if(evt.shiftKey && !evt.ctrlKey && !evt.altKey && evt.keyCode == 45) { + this._SetCancelEvent(evt); + this._PasteFromClipBoard(); + + return; + } + } + } + + if(!this._isInternetExplorer() || evt.type == "keypress") { + // Shift Ins + if(evt.rawEvent.shiftKey && !evt.rawEvent.ctrlKey && !evt.rawEvent.altKey && evt.rawEvent.keyCode == 45) { + // at opera assume Ins = "-" not execute Shift-Ins + this._SetCancelEvent(evt); + this._PasteFromClipBoard(); + + return; + } + // ctrl v + if(evt.type == "keydown" && (scanCode == 86 || scanCode == 118) && !evt.shiftKey && evt.ctrlKey && !evt.altKey) { + this._SetCancelEvent(evt); + this._PasteFromClipBoard(); + + return; + } + } + + var curpos; + if(Sys.Browser.agent == Sys.Browser.InternetExplorer || evt.type == "keypress" || evt.type == "keydown") { + if(scanCode == 8) { // BackSpace + this._SetCancelEvent(evt); + curpos = this._deleteTextSelection(); + + if(curpos != -1) { + this.setSelectionRange(curpos, curpos); + } else { + curpos = this._getCurrentPosition(); + this._backspace(curpos); + + curpos = this._getPreviousPosition(curpos - 1); + this.setSelectionRange(curpos, curpos); + } + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + if(this._messageValidatorTip && wrapper.get_Value() == this._EmptyMask) + this.showTooltipMessage(true); + + // Opera not perform cancel event. Re-perform at Timer + if(Sys.Browser.agent == Sys.Browser.Opera) { + this._SaveText = wrapper.get_Value(); + this._SavePosi = curpos; + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + } else if(scanCode == 46 || scanCode == 127) { // delete + this._SetCancelEvent(evt); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + curpos = this._deleteTextSelection(); + + if(curpos == -1) { + curpos = this._getCurrentPosition(); + + if(!this._isValidMaskedEditPosition(curpos)) + if(curpos != this._LogicLastInt && this._inputDirection != Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + curpos = this._getNextPosition(curpos); + + this._deleteAtPosition(curpos, false); + } else { + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + var ClearText = this._getClearMask(wrapper.get_Value()); + + if(ClearText != "") { + ClearText = ClearText.replace(new RegExp("(\\" + this.get_cultureThousandsPlaceholder() + ")", "g"), "") + ''; + + if(ClearText.substring(ClearText.length - 1, ClearText.length) == this.get_cultureDecimalPlaceholder()) { + ClearText = ClearText.substring(0, ClearText.length - 1); + this.loadValue(ClearText, this._LogicLastInt); + } else { + this.loadValue(ClearText, this._LogicLastPos); + } + } + } + } + + this.setSelectionRange(curpos, curpos); + if(this._messageValidatorTip && wrapper.get_Value() == this._EmptyMask) + this.showTooltipMessage(true); + + if(Sys.Browser.agent == Sys.Browser.Opera) { + this._SaveText = wrapper.get_Value(); + this._SavePosi = curpos; + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + } else if(evt.ctrlKey) { + if(scanCode == 39 || scanCode == 35 || scanCode == 34) { //Right or END or pgdown + this._DirectSelText = "R"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + curpos = this._getCurrentPosition(); + this.setSelectionRange(curpos, this._LogicLastPos + 1); + } else if(scanCode == 37 || scanCode == 36 || scanCode == 33) { //Left or Home or pgup + this._DirectSelText = "L"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + curpos = this._getCurrentPosition(); + this.setSelectionRange(this._LogicFirstPos, curpos); + } + } else if(scanCode == 35 || scanCode == 34) { //END or pgdown + this._DirectSelText = "R"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + if(evt.shiftKey) { + curpos = this._getCurrentPosition(); + this.setSelectionRange(curpos, this._LogicLastPos + 1); + } else { + this.setSelectionRange(this._LogicLastPos + 1, this._LogicLastPos + 1); + } + } else if(scanCode == 36 || scanCode == 33) { //Home or pgup + this._DirectSelText = "L"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + if(evt.shiftKey) { + curpos = this._getCurrentPosition(); + this.setSelectionRange(this._LogicFirstPos, curpos); + } else { + this.setSelectionRange(this._LogicFirstPos, this._LogicFirstPos); + } + } else if(scanCode == 37) { //left + this._DirectSelText = "L"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + if(evt.shiftKey) { + var BoundSel = this._GetBoundSelection(); + + if(BoundSel) { + if(BoundSel.left > this._LogicFirstPos) + BoundSel.left--; + + this.setSelectionRange(BoundSel.left, BoundSel.right); + } else { + var pos = this._getCurrentPosition(); + if(pos > this._LogicFirstPos) + this.setSelectionRange(pos - 1, pos); + } + } else { + curpos = this._getCurrentPosition() - 1; + if(curpos < this._LogicFirstPos) + curpos = this._LogicFirstPos; + + this.setSelectionRange(curpos, curpos); + } + + if(Sys.Browser.agent == Sys.Browser.Opera) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + this._SaveText = wrapper.get_Value(); + this._SavePosi = curpos; + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + } else if(scanCode == 39) { // right + this._DirectSelText = "R"; + if(Sys.Browser.agent == Sys.Browser.Opera) + return; + + this._SetCancelEvent(evt); + if(evt.shiftKey) { + var BoundSel = this._GetBoundSelection(); + if(BoundSel) { + if(BoundSel.right < this._LogicLastPos + 1) + BoundSel.right++; + + this.setSelectionRange(BoundSel.left, BoundSel.right); + } else { + pos = this._getCurrentPosition(); + if(pos < this._LogicLastPos + 1) + this.setSelectionRange(pos, pos + 1); + } + } else { + curpos = this._getCurrentPosition() + 1; + if(curpos > this._LogicLastPos + 1) + curpos = this._LogicLastPos + 1; + + this.setSelectionRange(curpos, curpos); + } + + if(Sys.Browser.agent == Sys.Browser.Opera) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + this._SaveText = wrapper.get_Value(); + this._SavePosi = curpos; + this._timer.set_enabled(false); + this._timer.set_interval(1); + this._timer.set_enabled(true); + } + } else if(scanCode == 27) { // esc + this._SetCancelEvent(evt); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + if(this._EmptyMask == this._initialvalue) + wrapper.set_Value(""); + else + wrapper.set_Value(this._initialvalue); + + this._onFocus(); + } + } + + // any other nav key + this._SetCancelEvent(evt); + }, + + _backspace: function(curpos) { + var exec = false; + if(curpos > this._LogicFirstPos) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + var masktext = wrapper.get_Value(); + + curpos = this._getPreviousPosition(curpos - 1); + this._deleteAtPosition(curpos, true); + exec = true; + } + + return exec; + }, + + _deleteAtPosition: function(curpos, isBS) { + var exec = false, + lastpos = this._LogicLastPos + 1; + + if(this._LogicLastInt != -1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + lastpos = this._LogicLastInt; + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + if(isBS == false && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && curpos == lastpos) { + var ClearText = this._getClearMask(wrapper.get_Value()); + if(ClearText != "") { + exec = true; + ClearText = ClearText.replace(new RegExp("(\\" + this.get_cultureThousandsPlaceholder() + ")", "g"), "") + ''; + + if(ClearText.substring(ClearText.length - 1, ClearText.length) == this.get_cultureDecimalPlaceholder()) + ClearText = ClearText.substring(0, ClearText.length - 1); + + var arr_num = ClearText.split(this.get_cultureDecimalPlaceholder()); + if(this._LogicLastInt != -1 && arr_num[0] != "") { + arr_num[0] = arr_num[0].substring(0, arr_num[0].length - 1); + ClearText = arr_num[0]; + + if(arr_num.length = 2) + ClearText += this.get_cultureDecimalPlaceholder() + arr_num[1]; + } else { + ClearText = ClearText.substring(0, ClearText.length - 1); + } + + ClearText += this._LogicSymbol; + this.loadValue(ClearText, lastpos); + } + } else { + var masktext = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1), + logiTxt = this._LogicTextMask.substring(this._LogicFirstPos, this._LogicLastPos + 1), + qtdDt = 0, + curvld = curpos - this._LogicFirstPos; + + if(this._isValidMaskedEditPosition(curpos)) { + exec = true; + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + var arr_mask = this._SplitDateTime(masktext), + posmask = curpos - this._LogicFirstPos; + + if(posmask > arr_mask[0].length) { + // at position time + masktext = arr_mask[1]; + qtdDt = arr_mask[0].length + 1; + logiTxt = logiTxt.substring(qtdDt); + curvld -= qtdDt; + } else { + // at position date + masktext = arr_mask[0]; + logiTxt = logiTxt.substring(0, arr_mask[0].length); + } + } + + var resttext = masktext.substring(curvld + 1), + restlogi = logiTxt.substring(curvld + 1); + + masktext = masktext.substring(0, curvld) + this._promptCharacter; + logiTxt = logiTxt.substring(0, curvld) + this._LogicPrompt; + var i; + + // clear rest of mask + for(i = 0 ; i < parseInt(resttext.length, 10) ; i++) + if(this._isValidMaskedEditPosition(curpos + 1 + i)) { + masktext += this._promptCharacter; + logiTxt += this._LogicPrompt; + } else { + masktext += resttext.substring(i, i + 1); + logiTxt += restlogi.substring(i, i + 1); + } + + // insert only valid text + var posaux = this._getNextPosition(curpos); + for(i = 0 ; i < parseInt(resttext.length, 10) ; i++) + if(this._isValidMaskedEditPosition(curpos + 1 + i) && restlogi.substring(i, i + 1) != this._LogicPrompt) { + masktext = masktext.substring(0, posaux - this._LogicFirstPos - qtdDt) + resttext.substring(i, i + 1) + masktext.substring(posaux + 1 - this._LogicFirstPos - qtdDt); + logiTxt = logiTxt.substring(0, posaux - this._LogicFirstPos - qtdDt) + restlogi.substring(i, i + 1) + logiTxt.substring(posaux + 1 - this._LogicFirstPos - qtdDt); + posaux = this._getNextPosition(posaux + 1); + } + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + var oritext = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1), + orilogi = this._LogicTextMask.substring(this._LogicFirstPos, this._LogicLastPos + 1), + arr_mask = this._SplitDateTime(oritext), + posmask = curpos - this._LogicFirstPos; + + if(posmask > arr_mask[0].length) { + // at position time + masktext = arr_mask[0] + " " + masktext; + logiTxt = orilogi.substring(0, qtdDt) + logiTxt; + } else { + // at position date + masktext = masktext + " " + arr_mask[1]; + logiTxt = logiTxt + orilogi.substring(arr_mask[0].length); + } + } + + var currValue = wrapper.get_Value(); + masktext = currValue.substring(0, this._LogicFirstPos) + masktext + currValue.substring(this._LogicLastPos + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, this._LogicFirstPos) + logiTxt + this._LogicTextMask.substring(this._LogicLastPos + 1); + wrapper.set_Value(masktext); + } + } + + return exec; + }, + + _SplitDateTime: function(inputText) { + var arr = []; + if(inputText.charAt(this._LogicDateTimeSepPos) == " ") { + arr[0] = inputText.substring(this._LogicFirstPos, this._LogicDateTimeSepPos); + arr[1] = inputText.substring(this._LogicDateTimeSepPos + 1); + } else { + arr[0] = inputText; + } + + return arr; + }, + + _isInternetExplorer: function () + { + if (Sys.Browser.agent == Sys.Browser.InternetExplorer //pre IE 11 + || + (Sys.Browser.agent == null && Sys.Browser.name == "Netscape" && Sys.Browser.version == 5)) // IE 11 + return true; + + return false; + }, + + // Paste clip board + _ShowModalClipBoardInput: function() { + var clip = prompt(this._clipboardText, ""); + + return clip; + }, + + _PasteFromClipBoard: function() { + var value = null, + curpos, + iniSel = -1, + fimSel = -1; + + if(this._isInternetExplorer()) { + value = window.clipboardData.getData("Text"); + } else { + // save current values because lost focus + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + oldvalue = wrapper.get_Value(), + BoundSel = this._GetBoundSelection(), + curpos = this._getCurrentPosition(), + OldAuto = this._autoComplete, + OldInv = this._clearTextOnInvalid, + OldCls = this._clearMaskOnLostfocus, + OldDir = this._DirectSelText; + + this._autoComplete = false; + this._clearTextOnInvalid = false; + this._clearMaskOnLostfocus = false; + value = this._ShowModalClipBoardInput(); + this._autoComplete = OldAuto; + this._clearTextOnInvalid = OldInv; + this._clearMaskOnLostfocus = OldCls; + wrapper.set_Value(oldvalue); + + if(BoundSel) + this.setSelectionRange(BoundSel.left, BoundSel.right); + else + this.setSelectionRange(curpos, curpos); + } + + if(value == null || value == "") + return; + + if(value.length > this._maskvalid.length) + value = value.substring(0, this._maskvalid.length); + + curpos = this._deleteTextSelection(); + if(curpos == -1) { + curpos = this._getCurrentPosition(); + if(BoundSel) + curpos = BoundSel.left; + } + + this.setSelectionRange(curpos, curpos); + var ReturnPosDec = false; + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && this._LogicLastInt != -1) + ReturnPosDec = true; + + var i = 0; + for(i = 0; i < value.length; i++) { + var c = value.substring(i, i + 1), + logiccur = curpos; + + if(ReturnPosDec) + logiccur = this._getLastEmptyPosition(); + + if((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.getCultureFirstLettersAMPM().toUpperCase().indexOf(c.toUpperCase()) != -1) { + if(this._acceptAmPm) { + this.insertAMPM(c); + this.setSelectionRange(curpos, curpos); + } + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) { + this.insertSignal(c); + this.setSelectionRange(curpos, curpos); + } else { + var OriPos = curpos; + curpos = this._getNextPosition(curpos); + var logiccur = curpos; + + if(this._LogicLastInt != -1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(OriPos == this._LogicLastInt) + logiccur = this._getLastEmptyPosition(); + } else { + if(curpos >= this._LogicLastPos + 1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + logiccur = this._getLastEmptyPosition(); + } + + if(this._processKey(logiccur, c)) { + if(this._messageValidatorTip) + this.showTooltipMessage(false); + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(this._LogicLastInt == -1) { + if(curpos < this._LogicLastPos + 1) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else { + this._insertContentRight(c); + curpos = this._LogicLastPos + 1; + } + } else { + if(OriPos != this._LogicLastInt) { + this._insertContent(c, logiccur); + curpos = this._getNextPosition(logiccur + 1); + } else { + this._insertContentRight(c); + curpos = this._LogicLastInt; + } + } + } + this.setSelectionRange(curpos, curpos); + } + } + } + + if(ReturnPosDec) + this.setSelectionRange(this._LogicLastInt, this._LogicLastInt); + }, + + // Move cursor to decimal position (LeftToRight and RightToLeft Mode) + _MoveDecimalPos: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + curpos = this._LogicFirstPos, + max = this._LogicLastPos, + posDc = -1; + + while(curpos < max) { + if(wrapper.get_Value().substring(curpos, curpos + 1) == this.get_cultureDecimalPlaceholder()) { + posDc = curpos; + break; + } + curpos++; + } + + if(posDc == -1) + return; + + this.setSelectionRange(posDc, posDc); + }, + + // Move cursor to next Thousand position (LeftToRight Mode) + _MoveThousandLTR: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + curpos = this._getCurrentPosition(), + max = this._LogicLastPos, + cur = curpos + 1, + posTh = -1; + + while(cur < max) { + if(wrapper.get_Value().substring(cur, cur + 1) == this.get_cultureThousandsPlaceholder()) { + posTh = cur; + break; + } + cur++; + } + + if(posTh == -1) { + var cur = 0; + max = curpos; + + while(cur < max) { + if(wrapper.get_Value().substring(cur, cur + 1) == this.get_cultureThousandsPlaceholder()) { + posTh = cur; + break; + } + cur++; + } + + if(posTh == -1) + return; + } + this.setSelectionRange(posTh, posTh); + }, + + // Move cursor to next Thousand position (RightToLeft Mode) + _MoveThousandRTL: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + curpos = this._getCurrentPosition(), + min = this._LogicFirstPos, + cur = curpos - 1, + posTh = -1; + + while(cur > min) { + if(wrapper.get_Value().substring(cur, cur + 1) == this.get_cultureThousandsPlaceholder()) { + posTh = cur; + break; + } + cur--; + } + + if(posTh == -1) { + cur = this._LogicLastPos; + min = curpos; + + while(cur > min) { + if(wrapper.get_Value().substring(cur, cur + 1) == this.get_cultureThousandsPlaceholder()) { + posTh = cur; + break; + } + cur--; + } + + if(posTh == -1) + return; + } + this.setSelectionRange(posTh, posTh); + }, + + // adjust element Number to Decimal position (LeftToRight Mode) + _AdjustElementDecimalLTR: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + curpos = this._getCurrentPosition(); + + if(wrapper.get_Value().substring(curpos).indexOf(this.get_cultureDecimalPlaceholder()) == -1) + //after decimal position + return; + + var value = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1), + newcur = value.indexOf(this.get_cultureDecimalPlaceholder()); + + if(newcur == -1) + //decimal not exist + return; + + var arr_num, + ClearText = this._getClearMask(wrapper.get_Value()); + + if(ClearText != "") { + ClearText = ClearText.replace(new RegExp("(\\" + this.get_cultureThousandsPlaceholder() + ")", "g"), "") + ''; + arr_num = ClearText.split(this.get_cultureDecimalPlaceholder()); + } else { + arr_num = this.get_cultureDecimalPlaceholder().split(this.get_cultureDecimalPlaceholder()); + } + + if(arr_num[0] == "") + arr_num[0] = "0"; + + // fill decimal + var QtdDec = value.length - newcur - 1; + while(arr_num[1].length < QtdDec) + arr_num[1] += "0"; + + var OldDir = this._inputDirection; + + this._inputDirection = Sys.Extended.UI.MaskedEditInputDirections.RightToLeft; + this.loadValue(arr_num[0] + this.get_cultureDecimalPlaceholder() + arr_num[1], this._LogicLastPos); + this._inputDirection = OldDir; + newcur += this._LogicFirstPos + 1; + this.setSelectionRange(newcur, newcur); + }, + + // adjust element Number to Decimal position (RightToleft Mode) + _AdjustElementDecimalRTL: function() { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + value = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1), + posdec = value.indexOf(this.get_cultureDecimalPlaceholder()); + + if(posdec == -1) + //decimal not exist + return; + + var curpos = this._getCurrentPosition(); + if(posdec + this._LogicFirstPos >= curpos) { + //before decimal position , EXECUTE LTR MODE + this._AdjustElementDecimalLTR(); + return; + } + + var arr_num, + ClearText = this._getClearMask(wrapper.get_Value()); + + if(ClearText != "") { + ClearText = ClearText.replace(new RegExp("(\\" + this.get_cultureThousandsPlaceholder() + ")", "g"), "") + ''; + arr_num = ClearText.split(this.get_cultureDecimalPlaceholder()); + } else { + arr_num = this.get_cultureDecimalPlaceholder().split(this.get_cultureDecimalPlaceholder()); + } + + if(arr_num[0] == "") + arr_num[0] = "0"; + + // fill decimal + var QtdDec = value.length - posdec - 1; + while(arr_num[1].length < QtdDec) + arr_num[1] += "0"; + + var OldDir = this._inputDirection; + this._inputDirection = Sys.Extended.UI.MaskedEditInputDirections.RightToLeft; + this.loadValue(arr_num[0] + this.get_cultureDecimalPlaceholder() + arr_num[1], this._LogicLastPos); + this._inputDirection = OldDir; + posdec += this._LogicFirstPos + 1; + this.setSelectionRange(posdec, posdec); + }, + + // adjust Time Format + _AdjustTime: function(value, ValueDefault) { + var emp = true; + var i; + + for(i = 0 ; i < parseInt(value.length, 10) ; i++) + if(value.substring(i, i + 1) != this._promptCharacter) + emp = false; + + if(emp) + return ValueDefault; + + var max = value.length; + value = value.replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + while(value.length < max) + value = "0" + value; + + return value; + }, + + // adjust Element Time Format + _AdjustElementTime: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + type = "", + curpos = this._getCurrentPosition() - this._LogicFirstPos, + m_mask = this._maskvalid, + newcur = curpos + this._LogicFirstPos, + QtdDt = 0; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + QtdDt = m_mask.split(" ")[0].length + 1; + + if(curpos < QtdDt) { + newcur = QtdDt + this._LogicFirstPos; + this.setSelectionRange(newcur, newcur); + + return; + } + + // without am/pm, The AP/PM will get from this._LogicSymbol + m_mask = m_mask.split(" ")[1]; + curpos -= QtdDt; + } + + m_mask = m_mask.split(":"); + if(curpos <= 1) { + type = "H"; + newcur = 3 + this._LogicFirstPos + QtdDt; + } else if(curpos >= 2 && curpos <= 4 && m_mask.length == 2) { + type = "M"; + newcur = QtdDt + this._LogicFirstPos; + } else if(curpos >= 2 && curpos <= 4 && m_mask.length == 3) { + type = "M"; + newcur = 6 + this._LogicFirstPos + QtdDt; + } else if(m_mask.length == 3) { + type = "S"; + newcur = QtdDt + this._LogicFirstPos; + } + + if(type == "") + return; + + var valueTM = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1); + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + valueTM = (this._SplitDateTime(valueTM))[1]; + + var m_arrTime = valueTM.split(this.get_cultureTimePlaceholder()), + elem = this._GetTimeElementText(type), + value; + + if(type == "H") { + value = elem + this.get_cultureTimePlaceholder() + m_arrTime[1]; + + if(m_arrTime.length == 3) + value += this.get_cultureTimePlaceholder() + m_arrTime[2]; + } else if(type == "M") { + value = m_arrTime[0] + this.get_cultureTimePlaceholder() + elem; + + if(m_arrTime.length == 3) + value += this.get_cultureTimePlaceholder() + m_arrTime[2]; + } else if(type == "S") { + value = m_arrTime[0] + this.get_cultureTimePlaceholder() + m_arrTime[1]; + value += this.get_cultureTimePlaceholder() + elem; + } + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + value = wrapper.get_Value().substring(this._LogicFirstPos, QtdDt) + value; + } + + this.loadMaskValue(value, this._LogicFirstPos, this._LogicSymbol); + this.setSelectionRange(newcur, newcur); + }, + + // Get Element Time + _GetTimeElementText: function(Type) { + var aux, + logiTxt = this._LogicTextMask.substring(this._LogicFirstPos, this._LogicLastPos + 1); + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + logiTxt = logiTxt.substring(this._maskvalid.split(" ")[0].length + 1); + + var m_arrTime = logiTxt.split(this.get_cultureTimePlaceholder()); + m_arrTime[0] = m_arrTime[0].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrTime[0].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrTime[0] = aux; + } + + m_arrTime[1] = m_arrTime[1].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrTime[1].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrTime[1] = aux; + } + + if(m_arrTime.length == 3) { + m_arrTime[2] = m_arrTime[2].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrTime[2].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrTime[2] = aux; + } + } + + if(Type == "H") + return m_arrTime[0]; + else if(Type == "M") + return m_arrTime[1]; + + // Type == "S" + return m_arrTime[2]; + }, + + // adjust Date Format + _AdjustElementDateTime: function(c) { + if(c == this.get_cultureDatePlaceholder()) + this._AdjustElementDate(); + + if(c == this.get_cultureTimePlaceholder()) + this._AdjustElementTime(); + }, + + _AdjustElementDate: function() { + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e), + input = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1); + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + input = this._SplitDateTime(input)[0]; + + var m_arrDate = input.split(this.get_cultureDatePlaceholder()), + type = "", + curpos = this._getCurrentPosition() - this._LogicFirstPos, + newcur = curpos + this._LogicFirstPos, + QtdY = (this._maskvalid.indexOf("9999") != -1) ? 2 : 0; + + if(this.get_cultureDateFormat() == "DMY") { + if(curpos <= 1) { + type = "D"; + newcur = 3 + this._LogicFirstPos; + } else if(curpos >= 2 && curpos <= 4) { + type = "M"; + newcur = 6 + this._LogicFirstPos; + } else { + if(curpos > 8 + QtdY && this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + this.setSelectionRange(this._LogicFirstPos, this._LogicFirstPos); + return; + } + type = "Y"; + newcur = this._LogicFirstPos; + } + } else if(this.get_cultureDateFormat() == "MDY") { + if(curpos <= 1) { + type = "M"; + newcur = 3 + this._LogicFirstPos; + } else if(curpos >= 2 && curpos <= 4) { + type = "D"; + newcur = 6 + this._LogicFirstPos; + } else { + if(curpos > 8 + QtdY && this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + this.setSelectionRange(this._LogicFirstPos, this._LogicFirstPos); + return; + } + type = "Y"; + newcur = this._LogicFirstPos; + } + } else if(this.get_cultureDateFormat() == "DYM") { + if(curpos <= 1) { + type = "D"; + newcur = 3 + this._LogicFirstPos; + } else if(curpos >= 2 && curpos <= 4 + QtdY) { + type = "Y"; + newcur = 6 + QtdY + this._LogicFirstPos; + } else { + type = "M"; + newcur = this._LogicFirstPos; + } + } else if(this.get_cultureDateFormat() == "MYD") { + if(curpos <= 1) { + type = "M"; + newcur = 3 + this._LogicFirstPos; + } else if(curpos >= 2 && curpos <= 4 + QtdY) { + type = "Y"; + newcur = 6 + QtdY + this._LogicFirstPos; + } else { + type = "D"; + newcur = this._LogicFirstPos; + } + } else if(this.get_cultureDateFormat() == "YMD") { + if(curpos <= 1 + QtdY) { + type = "Y"; + newcur = 3 + QtdY + this._LogicFirstPos; + } else if(curpos >= 2 + QtdY && curpos <= 4 + QtdY) { + type = "M"; + newcur = 6 + QtdY + this._LogicFirstPos; + } else { + type = "D"; + newcur = this._LogicFirstPos; + } + } else if(this.get_cultureDateFormat() == "YDM") { + if(curpos <= 1 + QtdY) { + type = "Y"; + newcur = 3 + QtdY + this._LogicFirstPos; + } else if(curpos >= 2 + QtdY && curpos <= 4 + QtdY) { + type = "D"; + newcur = 6 + QtdY + this._LogicFirstPos; + } else { + type = "M"; + newcur = this._LogicFirstPos; + } + } + + var elem = this._GetDateElementText(type); + m_arrDate[this.get_cultureDateFormat().indexOf(type)] = elem; + var value = m_arrDate[0] + this.get_cultureDatePlaceholder() + m_arrDate[1] + this._cultureDatePlaceholder + m_arrDate[2]; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + var aux = wrapper.get_Value().substring(this._LogicFirstPos, this._LogicLastPos + 1), + arr = this._SplitDateTime(aux), + time_arr = arr[1].split(" "); + + if(time_arr.length == 2) + value += " " + time_arr[0] + " " + time_arr[1]; + else + value += " " + arr[1]; + } + + this.loadMaskValue(value, this._LogicFirstPos, this._LogicSymbol); + this.setSelectionRange(newcur, newcur); + }, + + // Get Element Date + _GetDateElementText: function(Type) { + var aux, + m_arrDate; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + var auxdate = this._SplitDateTime(this._LogicTextMask.substring(this._LogicFirstPos, this._LogicLastPos + 1))[0]; + m_arrDate = auxdate.split(this.get_cultureDatePlaceholder()); + } else { + m_arrDate = this._LogicTextMask.substring(this._LogicFirstPos, this._LogicLastPos + 1).split(this.get_cultureDatePlaceholder()); + } + + m_arrDate[this.get_cultureDateFormat().indexOf("D")] = m_arrDate[this.get_cultureDateFormat().indexOf("D")].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrDate[this.get_cultureDateFormat().indexOf("D")].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrDate[this.get_cultureDateFormat().indexOf("D")] = aux + } + + m_arrDate[this.get_cultureDateFormat().indexOf("M")] = m_arrDate[this.get_cultureDateFormat().indexOf("M")].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrDate[this.get_cultureDateFormat().indexOf("M")].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrDate[this.get_cultureDateFormat().indexOf("M")] = aux; + } + + var Y4 = (this._maskvalid.indexOf("9999") != -1) ? true : false; + m_arrDate[this.get_cultureDateFormat().indexOf("Y")] = m_arrDate[this.get_cultureDateFormat().indexOf("Y")].replace(new RegExp("(\\" + this._LogicPrompt + ")", "g"), this._promptCharacter) + ''; + aux = m_arrDate[this.get_cultureDateFormat().indexOf("Y")].replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + ''; + + if(Y4) { + if(aux != "" && aux.length < 4) { + aux = this._century.toString().substr(0, aux.length) + aux; + m_arrDate[this.get_cultureDateFormat().indexOf("Y")] = aux; + } + } else { + if(aux != "" && aux.length < 2) { + aux = "0" + aux; + m_arrDate[this.get_cultureDateFormat().indexOf("Y")] = aux; + } + } + + return m_arrDate[this.get_cultureDateFormat().indexOf(Type)]; + }, + + _GetBoundSelection: function() { + var ret = null, + input = this.get_element(); + + if(input.setSelectionRange) { + if(input.selectionStart != input.selectionEnd) + ret = { left: parseInt(input.selectionStart, 10), right: parseInt(input.selectionEnd, 10) }; + } else if(document.selection) { + var sel = document.selection.createRange(); + + if(sel.text != "") { + var tam = parseInt(sel.text.length, 10); + sel.text = String.fromCharCode(3) + sel.text; + + var dummy = input.createTextRange(); + dummy.findText(String.fromCharCode(3)); + dummy.select(); + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(input); + var pos = parseInt(wrapper.get_Value().indexOf(String.fromCharCode(3)), 10); + + document.selection.clear(); + ret = { left: pos, right: pos + tam }; + } + } + + return ret; + }, + + _deleteTextSelection: function() { + var input = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(input), + masktext = wrapper.get_Value(), + lenaux = -1, + begin = -1, + isDel = false; + + if(input.setSelectionRange) { + if(input.selectionStart != input.selectionEnd) { + var ini = parseInt(input.selectionStart, 10); + var fim = parseInt(input.selectionEnd, 10); + + isDel = true; + lenaux = fim - ini; + begin = input.selectionStart; + input.selectionEnd = input.selectionStart; + } + } else if(document.selection) { + var sel = document.selection.createRange(); + + if(sel.text != "") { + isDel = true; + var aux = sel.text + String.fromCharCode(3); + + sel.text = aux; + var dummy = input.createTextRange(); + + dummy.findText(aux); + dummy.select(); + begin = wrapper.get_Value().indexOf(aux); + document.selection.clear(); + lenaux = parseInt(aux.length, 10) - 1; + } + } + + if(isDel) { + for(var i = 0 ; i < lenaux ; i++) + if(this._isValidMaskedEditPosition(begin + i)) { + masktext = masktext.substring(0, begin + i) + this._promptCharacter + masktext.substring(begin + i + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, begin + i) + this._LogicPrompt + this._LogicTextMask.substring(begin + i + 1); + } + + wrapper.set_Value(masktext); + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + begin += lenaux; + } + + this._DirectSelText = ""; + return begin; + }, + + _isNormalChar: function(evt, scanCode) { + var ret = true; + + if(Sys.Browser.agent == Sys.Browser.Opera && evt.type == "keydown") + this._SaveKeyDown = scanCode; + + if(scanCode < 32) { // < space + ret = false; + } else if(Sys.Browser.agent != Sys.Browser.InternetExplorer || evt.type == "keydown") { + switch(scanCode) { + case 33: //pg up or ! + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //pg up + ret = false; + break; + case 34: //pg down or " + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //pg down + ret = false; + break; + case 35: //end + if(Sys.Browser.agent == Sys.Browser.Opera && evt.type == "keypress") { + //at opera keydown = 51 keypress = 35 = # + if(this._SaveKeyDown == 35) + //END + ret = false; + } else { + ret = false; + } + break; + case 36: //home + if(Sys.Browser.agent == Sys.Browser.Opera && evt.type == "keypress") { + //at opera keydown = 52 keypress = 36 = $ + if(this._SaveKeyDown == 36) + //home + ret = false; + } else { + ret = false; + } + break; + case 37: //left or % + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //left + ret = false; + break; + case 38: //up or & + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //up + ret = false; + break; + case 39: //right or ' + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //right + ret = false; + break; + case 40: //down or ( + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null) + if(evt.rawEvent.which == 0) + //down + ret = false; + break; + case 45: //ins - at opera Inconsistency with - + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null && Sys.Browser.agent != Sys.Browser.Opera) { + if(evt.rawEvent.which == 0) + ret = false; + } else if(Sys.Browser.agent == Sys.Browser.Opera) { // re-valid Ins for opera + //assume ins = char "-" + //at opera Shift-ins in MaskedEdit not execute + ret = true; + } else { + ret = false; + } + break; + case 86: // V + case 118: // v + //ctrl press + if(!evt.rawEvent.shiftKey && evt.rawEvent.ctrlKey && !evt.rawEvent.altKey) + ret = false; + break; + case 46: //del FF ~ Mozilla - at opera Inconsistency with . + if(typeof (evt.rawEvent.which) != "undefined" && evt.rawEvent.which != null && Sys.Browser.agent != Sys.Browser.Opera) { + if(evt.rawEvent.which == 0) + ret = false; + } else if(Sys.Browser.agent == Sys.Browser.Opera && evt.type == "keypress") { + //at opera keydown = 78 keypress = 46 = . at numpad + if(this._SaveKeyDown == 127) + ret = false; + } else { + ret = false; + } + break; + case 127: //del IE - at opera Inconsistency with . + ret = false; + break; + } + } + + return ret; + }, + + _KeyCode: function(evt) { + // Get Keycode for any browser + // and convert keycode Safari to IE Code + var scanCode = 0; + if(evt.keyIdentifier) { + if(evt.charCode == 63272) //63272: 'KEY_DELETE', 46 + scanCode = 46; + else if(evt.charCode == 63302) //63302: 'KEY_INSERT', 45 + scanCode = 45; + else if(evt.charCode == 63233) //63233: 'KEY_ARROW_DOWN',40 + scanCode = 40; + else if(evt.charCode == 63235) //63235: 'KEY_ARROW_RIGHT', 39 + scanCode = 39; + else if(evt.charCode == 63232) //63232: 'KEY_ARROW_UP', 38 + scanCode = 38; + else if(evt.charCode == 63234) //63234: 'KEY_ARROW_LEFT', 37 + scanCode = 37; + else if(evt.charCode == 63273) //63273: 'KEY_HOME', 36 + scanCode = 36; + else if(evt.charCode == 63275) //63275: 'KEY_END', 35 + scanCode = 35; + else if(evt.charCode == 63277) //63277: 'KEY_PAGE_DOWN', 34 + scanCode = 34; + else if(evt.charCode == 63276) //63276: 'KEY_PAGE_UP', 33 + scanCode = 33; + else if(evt.charCode == 3) //3: 'KEY_ENTER', 13 + scanCode = 13; + } + + if(scanCode == 0) + if(evt.charCode) + scanCode = evt.charCode; + + if(scanCode == 0) + scanCode = evt.keyCode; + + return scanCode; + }, + + // Init value startup + _InitValue: function(value, loadFirst) { + this._LogicSymbol = ""; + + var e = this.get_element(), + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e); + + wrapper.set_Value(this._EmptyMask); + if(value == this._EmptyMask || value == "") + this.loadValue("", this._LogicFirstPos); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Date && value != "") + value = this.ConvFmtDate(value, loadFirst); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Time && value != "") + value = this.ConvFmtTime(value, loadFirst); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime && value != "") + value = this.ConvFmtDateTime(value, loadFirst); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && value != "") + value = this.ConvFmtNumber(value, loadFirst); + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight && value != "") { + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number) { + this._inputDirection = Sys.Extended.UI.MaskedEditInputDirections.RightToLeft; + this.loadValue(value, this._LogicLastPos); + this._inputDirection = Sys.Extended.UI.MaskedEditInputDirections.LeftToRight; + } else { + this.loadValue(value, this._LogicFirstPos); + } + } else if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && value != "") { + this.loadValue(value, this._LogicLastPos); + } + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number) + if(this._InLostfocus && this._LogicSymbol == "-" && this._onBlurCssNegative != "") + this.addCssClassMaskedEdit(this._onBlurCssNegative); + }, + + // Load initial value with mask + loadMaskValue: function(value, logicPosition, Symb) { + this._createMask(); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + wrapper.set_Value(this._EmptyMask); + + if((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.getCultureFirstLettersAMPM().toUpperCase().indexOf(Symb.toUpperCase().substring(0, 1)) != -1) { + if(this._acceptAmPm) + this.insertAMPM(Symb.toUpperCase().substring(0, 1)); + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(Symb) != -1) { + this.insertSignal(Symb); + } + + var i = 0; + for(i = 0 ; i < parseInt(value.length, 10) ; i++) { + var c = value.substring(i + logicPosition, i + logicPosition + 1); + + if(this._processKey(logicPosition + i, c)) + this._insertContent(c, logicPosition + i); + } + }, + + containsAMPMLetters: function(value, index) + { + var currentAMPMtext = value.substring(index); + + }, + + // Load initial value in mask + loadValue: function(value, logicPosition) { + var i; + this._createMask(); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + wrapper.set_Value(this._EmptyMask); + + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight) { + for(i = 0 ; i < parseInt(value.length, 10) ; i++) { + var c = value.substring(i, i + 1); + + if ((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.getCultureFirstLettersAMPM().toUpperCase().indexOf(c.toUpperCase()) != -1) { + if (this._acceptAmPm) { + this.insertAMPM(c); + break; + } + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) { + this.insertSignal(c); + } + + if(this._processKey(logicPosition, c)) { + if(this._maskType != Sys.Extended.UI.MaskedEditType.Number) + this._insertContent(c, logicPosition); + logicPosition = this._getNextPosition(logicPosition + 1); + } + } + } else if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + if(logicPosition == this._LogicLastInt) { + logicPosition = this._getPreviousPosition(logicPosition); + var arr_num = value.split(this.get_cultureDecimalPlaceholder()) + + // int element + for(i = parseInt(arr_num[0].length, 10) ; i > 0 ; i--) { + var c = arr_num[0].substring(i - 1, i); + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) + this.insertSignal(c); + + if(this._processKey(logicPosition, c)) { + this._insertContent(c, logicPosition); + logicPosition = this._getPreviousPosition(logicPosition - 1); + } + } + + // decimal element + if(arr_num.length > 1) { + logicPosition = this._getNextPosition(this._LogicLastInt); + + for(i = 0 ; i < parseInt(arr_num[1].length, 10) ; i++) { + var c = arr_num[1].substring(i, i + 1); + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) + this.insertSignal(c); + + if(this._processKey(logicPosition, c)) { + this._insertContent(c, logicPosition); + logicPosition = this._getNextPosition(logicPosition + 1); + } + } + } + } else { + for(i = parseInt(value.length, 10) ; i > 0 ; i--) { + var c = value.substring(i - 1, i); + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1) { + if(this._LogicSymbol == '-') + this._LogicSymbol = ' '; + + this.insertSignal(c); + } + + if(this._processKey(logicPosition, c)) + this._insertContent(c, logicPosition); + + oldLogicPosition = logicPosition; + logicPosition = this._getPreviousPosition(logicPosition - 1); + + if(this._maskType === Sys.Extended.UI.MaskedEditType.Number && logicPosition === oldLogicPosition) + break; + } + } + } + }, + + // AutoFormat (date and Time and number) + AutoFormatNumber: function() { + var i, + wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + + ValueText = wrapper.get_Value(); + + var AutoComp = this._autoCompleteValue, + okdgt = false; + + for(i = this._LogicFirstPos ; i <= this._LogicLastPos ; i++) { + if(this._LogicTextMask.substring(i, i + 1) == this._LogicPrompt) { + var CharComp = "0"; + + if(AutoComp != "") + CharComp = AutoComp.substring(i - this._LogicFirstPos, i + 1 - this._LogicFirstPos); + + if(okdgt) { + this._LogicTextMask = this._LogicTextMask.substring(0, i) + CharComp + this._LogicTextMask.substring(i + 1); + ValueText = ValueText.substring(0, i) + CharComp + ValueText.substring(i + 1); + } + } else if(this._LogicMask.substring(i, i + 1) == this._LogicPrompt && "123456789".indexOf(this._LogicTextMask.substring(i, i + 1)) != -1) { + okdgt = true; + } + } + wrapper.set_Value(ValueText); + + return ValueText; + }, + + getCurrentHour: function (date) + { + return date.getHours().toString(); + }, + + AutoFormatTime: function() { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + ValueText = wrapper.get_Value(); + var autocomp = this._autoCompleteValue; + + if(autocomp.indexOf(this.get_cultureTimePlaceholder()) == -1) + autocomp = ""; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + var arr = this._SplitDateTime(ValueText), + time_arr = arr[1].split(" "); + + if(time_arr.length == 2) + ValueText = time_arr[0] + " " + time_arr[1]; + else + ValueText = time_arr[0]; //arr[0]; + + if(autocomp != "") { + // if not have date... + if(autocomp.indexOf(this.get_cultureDatePlaceholder()) == -1) + autocomp = " " + autocomp; + + var autocomp_arr = this._SplitDateTime(autocomp), + autocomptime_arr = autocomp_arr[1].split(" "); + + if(autocomptime_arr.length == 2) + autocomp = autocomptime_arr[0] + " " + autocomptime_arr[1]; + else + autocomp = autocomp_arr[0]; + } + } + + var CurDate = new Date(), + Hcur = this.getCurrentHour(CurDate); + + if(Hcur.length < 2) + Hcur = "0" + Hcur; + + if(autocomp != "") + Hcur = autocomp.substring(0, 2); + + var SetAM = false, + SetPM = false, + LcAM = "", + LcPM = "", + Symb = ""; + + if(this.get_cultureAMPMPlaceholder() != "") { + var m_arrtm = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator); + + LcAM = m_arrtm[0]; + LcPM = m_arrtm[1]; + + if(autocomp == "") { + var Symb = LcAM; + + if(Hcur > 12) { + Hcur = (parseInt(Hcur, 10) - 12).toString(); + if(Hcur.length < 2) + Hcur = "0" + Hcur; + + Symb = LcPM; + } + } else { + Symb = LcAM; // default + if(autocomp.indexOf(LcPM) != -1) + // set by autocomplete + Symb = LcPM; + } + + // set by input + SetAM = true; // default + if(ValueText.indexOf(LcPM) != -1 && LcPM != "") + // set by input + SetPM = true; + + if(!this._acceptAmPm) { + Symb = ""; + SetPM = false; + SetAM = false; + } else { + //check empty hour to validate AM/PM + var emp = true; + if(ValueText.substring(0, 1) != this._promptCharacter || ValueText.substring(1, 2) != this._promptCharacter) + emp = false; + + if(emp && Symb != "") { + SetAM = true; // default; + SetPM = false; + + if(LcPM == Symb) + // set by current time + SetPM = true; + } + } + } + + var Mcur = CurDate.getMinutes().toString(); + if(Mcur.length < 2) + Mcur = "0" + Mcur; + + if(autocomp != "") + Mcur = autocomp.substring(3, 5); + + var Scur = "00", + PH, PM; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + PH = ValueText.substring(0, 2); + PH = this._AdjustTime(PH, Hcur); + PM = ValueText.substring(3, 5); + PM = this._AdjustTime(PM, Mcur); + } else { + PH = ValueText.substring(this._LogicFirstPos, this._LogicFirstPos + 2); + PH = this._AdjustTime(PH, Hcur); + PM = ValueText.substring(this._LogicFirstPos + 3, this._LogicFirstPos + 5); + PM = this._AdjustTime(PM, Mcur); + } + + var maskvld = this._maskvalid; + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + maskvld = maskvld.split(" ")[1]; + + if(maskvld == "99:99:99") { + if(autocomp != "") + Scur = autocomp.substring(6); + + var PS; + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + PS = ValueText.substring(6, 8); + PS = this._AdjustTime(PS, Scur); + } else { + PS = ValueText.substring(this._LogicFirstPos + 6, this._LogicFirstPos + 8); + PS = this._AdjustTime(PS, Scur); + } + + ValueText = PH + this.get_cultureTimePlaceholder() + PM + this.get_cultureTimePlaceholder() + PS; + } else { + ValueText = PH + this.get_cultureTimePlaceholder() + PM; + } + + if(SetPM) + ValueText += " " + LcPM; + else if(SetAM) + ValueText += " " + LcAM; + + if(this._maskType != Sys.Extended.UI.MaskedEditType.DateTime) + this.loadValue(ValueText, this._LogicFirstPos); + + return ValueText; + }, + + AutoFormatDateTime: function() { + var PartDt = this.AutoFormatDate(), + PartTm = this.AutoFormatTime(); + + this.loadValue(PartDt + " " + PartTm, this._LogicFirstPos); + + return PartDt + " " + PartTm; + }, + + AutoFormatDate: function() { + var D = this._GetDateElementText("D").replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + '', + M = this._GetDateElementText("M").replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + '', + Y = this._GetDateElementText("Y").replace(new RegExp("(\\" + this._promptCharacter + ")", "g"), "") + '', + Y4 = (this._maskvalid.indexOf("9999") != -1) ? true : false, + autocomp = this._autoCompleteValue; + + if(autocomp.indexOf(this.get_cultureDatePlaceholder()) == -1) + autocomp = ""; + + var Dcur, Mcur, Ycur; + if(autocomp == "") { + var CurDate = new Date(); + Dcur = (CurDate.getUTCDate()).toString(); + + if(Dcur.length < 2) + Dcur = "0" + Dcur; + + Mcur = (CurDate.getUTCMonth() + 1).toString(); + if(Mcur.length < 2) + Mcur = "0" + Mcur; + + Ycur = CurDate.getUTCFullYear().toString(); + if(!Y4) + Ycur = CurDate.getUTCFullYear().toString().substring(2); + } else { + var m_arrDate; + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + // if not have time... + if(autocomp.indexOf(this.get_cultureTimePlaceholder()) == -1) + autocomp = autocomp + " "; + + var partdt = this._SplitDateTime(autocomp)[0]; + m_arrDate = partdt.split(this.get_cultureDatePlaceholder()); + } else { + m_arrDate = autocomp.split(this.get_cultureDatePlaceholder()); + } + + if(this.get_cultureDateFormat() == "DMY") { + Dcur = m_arrDate[0]; + Mcur = m_arrDate[1]; + Ycur = m_arrDate[2]; + } else if(this.get_cultureDateFormat() == "MDY") { + Dcur = m_arrDate[1]; + Mcur = m_arrDate[0]; + Ycur = m_arrDate[2]; + } else if(this.get_cultureDateFormat() == "DYM") { + Dcur = m_arrDate[0]; + Mcur = m_arrDate[2]; + Ycur = m_arrDate[1]; + } else if(this.get_cultureDateFormat() == "MYD") { + Dcur = m_arrDate[2]; + Mcur = m_arrDate[0]; + Ycur = m_arrDate[1]; + } else if(this.get_cultureDateFormat() == "YMD") { + Dcur = m_arrDate[2]; + Mcur = m_arrDate[1]; + Ycur = m_arrDate[0]; + } else if(this.get_cultureDateFormat() == "YDM") { + Dcur = m_arrDate[1]; + Mcur = m_arrDate[2]; + Ycur = m_arrDate[0]; + } + + if(Dcur.length < 2) + Dcur = "0" + Dcur; + + if(Mcur.length < 2) + Mcur = "0" + Mcur; + + if(Y4) { + while(Ycur.length < 4) + Ycur = "0" + Ycur; + } else { + while(Ycur.length < 2) + Ycur = "0" + Ycur; + } + } + + if(D == "") + D = Dcur; + if(M == "") + M = Mcur; + if(Y == "") + Y = Ycur; + + var value; + if(this.get_cultureDateFormat() == "DMY") + value = D + this.get_cultureDatePlaceholder() + M + this._cultureDatePlaceholder + Y; + else if(this.get_cultureDateFormat() == "MDY") + value = M + this.get_cultureDatePlaceholder() + D + this._cultureDatePlaceholder + Y; + else if(this.get_cultureDateFormat() == "DYM") + value = D + this.get_cultureDatePlaceholder() + Y + this._cultureDatePlaceholder + M; + else if(this.get_cultureDateFormat() == "MYD") + value = M + this.get_cultureDatePlaceholder() + Y + this._cultureDatePlaceholder + D; + else if(this.get_cultureDateFormat() == "YMD") + value = Y + this.get_cultureDatePlaceholder() + M + this._cultureDatePlaceholder + D; + else if(this.get_cultureDateFormat() == "YDM") + value = Y + this.get_cultureDatePlaceholder() + D + this._cultureDatePlaceholder + M; + + if(this._maskType != Sys.Extended.UI.MaskedEditType.DateTime) + this.loadValue(value, this._LogicFirstPos); + + return value; + }, + + // normalize initial value (number) + ConvFmtNumber: function(input, loadFirst) { + if(this._maskvalid.split(this.get_cultureDecimalPlaceholder()).length == 2) { + if(input.substring(input.length - 1, input.length) == this.get_cultureDecimalPlaceholder()) + input = input.substring(0, input.length - 1); + } + + return input; + }, + + // normalize initial value (Time) + ConvFmtTime: function(input, loadFirst) { + var AddH = 0, + SetAM = false, + SetPM = false, + LcAM = "", + LcPM = ""; + + if(this.get_cultureAMPMPlaceholder() != "") { + LcAM = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator)[0]; + LcPM = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator)[1]; + } + + //perform convert for loading of a page + if(loadFirst) { + var LDLcAM = "", + LDLcPM = ""; + + if(this._cultureAMPMPlaceholder != "") { + LDLcAM = this._cultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[0]; + LDLcPM = this._cultureAMPMPlaceholder.split(this._AMPMPlaceholderSeparator)[1]; + } + + // convert current Culture to user culture format (24H) + if(this.get_userTimeFormat() == Sys.Extended.UI.MaskedEditUserTimeFormat.TwentyFourHour) { + input = input.replace(new RegExp("(\\" + LDLcAM + ")", "g"), ""); + if(input.indexOf(LDLcPM) != -1) + AddH = 12; + + input = input.replace(new RegExp("(\\" + LDLcPM + ")", "g"), ""); + } + } + + if(input.indexOf(LcAM) != -1 && LcAM != "") + SetAM = true; + else if(input.indexOf(LcPM) != -1 && LcPM != "") + SetPM = true; + + if(LcAM != "") + input = input.replace(new RegExp("(\\" + LcAM + ")", "g"), ""); + if(LcPM != "") + input = input.replace(new RegExp("(\\" + LcPM + ")", "g"), ""); + + input = input.replace(new RegExp("(\\" + " " + ")", "g"), ""); + + var m_arrTime = input.split(this.get_cultureTimePlaceholder()), + m_mask = this._maskvalid; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + m_mask = m_mask.split(" ")[1]; + + m_mask = m_mask.split(":"); + if(parseInt(m_arrTime.length, 10) < 2 || parseInt(m_arrTime.length, 10) > 3) + return ""; + + var H = parseInt(m_arrTime[0], 10) + AddH; + H = H.toString(); + if(H.length < m_mask[0].length) + while(H.length < m_mask[0].length) + H = "0" + H; + + m_arrTime[0] = H; + var M = parseInt(m_arrTime[1], 10) + ''; + if(M.length < m_mask[1].length) + while(M.length < m_mask[1].length) + M = "0" + M; + + m_arrTime[1] = M; + var value = ""; + if(parseInt(m_arrTime.length, 10) == 3) { + var S = parseInt(m_arrTime[2], 10) + ''; + + if(S.length < m_mask[2].length) + while(S.length < m_mask[2].length) + S = "0" + S; + + m_arrTime[2] = S; + value = m_arrTime[0] + this.get_cultureTimePlaceholder() + m_arrTime[1] + this.get_cultureTimePlaceholder() + m_arrTime[2]; + } else { + value = m_arrTime[0] + this.get_cultureTimePlaceholder() + m_arrTime[1]; + } + + if(SetAM) + value += " " + LcAM; + else if(SetPM) + value += " " + LcPM; + + return value; + }, + + // normalize initial value (Date) + ConvFmtDateTime: function(input, loadFirst) { + var arr = this._SplitDateTime(input), + partdt = arr[0], + parttm = arr[1]; + + if(parttm.split(" ").length == 2) + parttm += " " + parttm.split(" ")[1]; + + partdt = this.ConvFmtDate(partdt, loadFirst); + parttm = this.ConvFmtTime(parttm, loadFirst); + + return partdt + " " + parttm; + }, + + _filter: function (array, testFunc) { + var newArray = []; + for (var i = 0; i < array.length; i++) { + if (testFunc(array[i])) + newArray.push(array[i]); + } + + return newArray; + }, + + _map: function (array, mapFunc) { + var newArray = []; + for (var i = 0; i < array.length; i++) + newArray.push(mapFunc(array[i])); + + return newArray; + }, + + ConvFmtDate: function (input, loadFirst) { + var m_arrDateLD, + m_arrDate; + + m_arrDate = this._filter(input.split(this.get_CultureDatePlaceholder()), function (element) { + return element != ""; + }); + m_arrDate = this._map(m_arrDate, function (element) { + return element.replace(/[^\/\d]/g, '') + }); + + if(loadFirst) { + m_arrDateLD = input.split(this.get_CultureDatePlaceholder()); + if(this.get_UserDateFormat() != Sys.Extended.UI.MaskedEditUserDateFormat.None) { + if(this.get_UserDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.DayMonthYear) + this._cultureDateFormat = 'DMY'; + if(this.get_userDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.DayYearMonth) + this._cultureDateFormat = 'DYM'; + if(this.get_userDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.MonthDayYear) + this._cultureDateFormat = 'MDY'; + if(this.get_userDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.MonthYearDay) + this._cultureDateFormat = 'MYD'; + if(this.get_userDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.YearDayMonth) + this._cultureDateFormat = 'YDM'; + if(this.get_userDateFormat() == Sys.Extended.UI.MaskedEditUserDateFormat.YearMonthDay) + this._cultureDateFormat = 'YMD'; + + m_arrDate[this.get_cultureDateFormat().indexOf("D")] = m_arrDateLD[this._cultureDateFormat.indexOf("D")]; + m_arrDate[this.get_cultureDateFormat().indexOf("M")] = m_arrDateLD[this._cultureDateFormat.indexOf("M")]; + m_arrDate[this.get_cultureDateFormat().indexOf("Y")] = m_arrDateLD[this._cultureDateFormat.indexOf("Y")]; + } + } + + var m_mask = this._maskvalid; + if(this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + m_mask = m_mask.split(" ")[0]; + + m_mask = m_mask.split("/"); + if(parseInt(m_arrDate.length, 10) != 3) + return ""; + + var D = parseInt(m_arrDate[this.get_cultureDateFormat().indexOf("D")], 10) + ''; + if(D.length < m_mask[this.get_cultureDateFormat().indexOf("D")].length) + while(D.length < m_mask[this.get_cultureDateFormat().indexOf("D")].length) + D = "0" + D; + + m_arrDate[this.get_cultureDateFormat().indexOf("D")] = D; + var M = parseInt(m_arrDate[this.get_cultureDateFormat().indexOf("M")], 10) + ''; + if(M.length < m_mask[this.get_cultureDateFormat().indexOf("M")].length) + while(M.length < m_mask[this.get_cultureDateFormat().indexOf("M")].length) + M = "0" + M; + + m_arrDate[this.get_cultureDateFormat().indexOf("M")] = M; + var Y = parseInt(m_arrDate[this.get_cultureDateFormat().indexOf("Y")], 10) + ''; + while(Y.length < m_mask[this.get_cultureDateFormat().indexOf("Y")].length) + Y = "0" + Y; + + m_arrDate[this.get_cultureDateFormat().indexOf("Y")] = Y; + + return m_arrDate[0] + this.get_cultureDatePlaceholder() + m_arrDate[1] + this.get_cultureDatePlaceholder() + m_arrDate[2]; + }, + + /// + /// Sets the CSS class from MaskedEdit + /// + /// CSS class to add + /// + addCssClassMaskedEdit: function(cssClass) { + var e = this.get_element(); + + Sys.UI.DomElement.removeCssClass(e, this._onBlurCssNegative); + Sys.UI.DomElement.removeCssClass(e, this._onFocusCssClass); + Sys.UI.DomElement.removeCssClass(e, this._onFocusCssNegative); + Sys.UI.DomElement.removeCssClass(e, this._onInvalidCssClass); + + if(cssClass != "") + Sys.UI.DomElement.addCssClass(e, cssClass); + }, + + AddCssClassMaskedEdit: function(CssClass) { + Sys.Extended.Deprecated("AddCssClassMaskedEdit(CssClass)", "addCssClassMaskedEdit(cssClass)"); + this.addCssClassMaskedEdit(CssClass); + }, + + // Set Cancel Event for cross browser + _SetCancelEvent: function(evt) { + if(typeof (evt.returnValue) !== "undefined") + evt.returnValue = false; + + if(typeof (evt.cancelBubble) !== "undefined") + evt.cancelBubble = true; + + if(typeof (evt.preventDefault) !== "undefined") + evt.preventDefault(); + + if(typeof (evt.stopPropagation) !== "undefined") + evt.stopPropagation(); + }, + + // Capture result validator after Postback + _CaptureServerValidators: function() { + var ret = true, + msg = this._ExternalMessageError; + + if(typeof (Page_Validators) != "undefined") { + var ctrval = null, + first = true; + + for(var i = 0; i < Page_Validators.length; i++) { + ctrval = Page_Validators[i]; + + if(typeof (ctrval.enabled) == "undefined" || ctrval.enabled != false) { + if(ctrval.TargetValidator == this.get_element().id) { + if(!ctrval.isvalid) { + if(first) { + first = false; + msg = ""; + } + + if(typeof (ctrval.errormessage) == "string") { + if(msg != "") + msg += ", "; + + msg += ctrval.errormessage; + } + ret = false; + } + } + } + } + } + this._ExternalMessageError = msg; + + return ret; + }, + + // Capture and execute client validator to control + _CaptureClientsValidators: function() { + var ret = true; + + // clear local save External Message Error + var msg = ""; + this._ExternalMessageError = msg; + + // Page_Validators is a Array of script asp.net + if(typeof (Page_Validators) != "undefined") { + var ctrval = null; + + for(var i = 0; i < Page_Validators.length; i++) { + ctrval = Page_Validators[i]; + + if(typeof (ctrval.enabled) == "undefined" || ctrval.enabled != false) { + if(ctrval.TargetValidator == this.get_element().id) { + if(typeof (ctrval.evaluationfunction) == "function") { + var crtret = ctrval.evaluationfunction(ctrval); + + if(!crtret) { + ret = false; + if(typeof (ctrval.errormessage) == "string") { + if(msg != "") + msg += ", "; + + msg += ctrval.errormessage; + } + } + } else if(typeof (ctrval.evaluationfunction) == "string") { + var crtret; + eval("crtret = " + ctrval.evaluationfunction + "(" + ctrval.id + ")"); + + if(!crtret) { + ret = false; + + if(typeof (ctrval.errormessage) == "string") { + if(msg != "") + msg += ", "; + + msg += ctrval.errormessage; + } + } + } + } + } + } + } + this._ExternalMessageError = msg; + + return ret; + }, + + /// + /// Shows or hides the message tip + /// + /// Indicates whether or not to show or hide the message tip + /// + showTooltipMessage: function(visible) { + if(typeof (Page_Validators) == "undefined") + return; + + var msg = ""; + if(!visible) { + msg = this._CurrentMessageError; + this._CurrentMessageError = ""; + } + + var i = 0, + ctrval = null; + + for(i = 0; i < Page_Validators.length; i++) { + ctrval = Page_Validators[i]; + + if(ctrval.TargetValidator == this.get_element().id && ctrval.IsMaskedEdit == "true") { + if(!visible) { + ctrval.innerHTML = msg; + + if(typeof (ctrval.display) == "string") { + if(ctrval.display == "None") + return; + + if(ctrval.display == "Dynamic") { + ctrval.style.display = ctrval.isvalid ? "none" : "inline"; + return; + } + } + return; + } + + this._CurrentMessageError = ctrval.innerHTML; + ctrval.innerHTML = ctrval.TooltipMessage; + + if(typeof (ctrval.display) == "string") { + if(ctrval.display == "None") + return; + + if(ctrval.display == "Dynamic") { + ctrval.style.display = "inline"; + return; + } + } + ctrval.style.visibility = "visible"; + + return; + } + } + }, + + ShowTooltipMessage: function(Visible) { + Sys.Extended.Deprecated("ShowTooltipMessage(Visible)", "showTooltipMessage(visible)"); + this.showTooltipMessage(Visible); + }, + + _insertContent: function(value, curpos) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + masktext = wrapper.get_Value(); + + masktext = masktext.substring(0, curpos) + value + masktext.substring(curpos + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, curpos) + value + this._LogicTextMask.substring(curpos + 1); + wrapper.set_Value(masktext); + }, + + // Insert Content at last right position + _insertContentRight: function(value) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + masktext = wrapper.get_Value(), + curpos = this._getLastEmptyPosition(); + + if(curpos < 0) + return; + + var i, + resttext = masktext.substring(curpos + 1), + restlogi = this._LogicTextMask.substring(curpos + 1); + + masktext = masktext.substring(0, curpos) + this._promptCharacter; + this._LogicTextMask = this._LogicTextMask.substring(0, curpos) + this._LogicPrompt; + var posaux; + + // clear rest of mask + if(this._LogicLastInt != -1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) { + var arr_num = resttext.split(this.get_cultureDecimalPlaceholder()), + arr_log = restlogi.split(this.get_cultureDecimalPlaceholder()); + + for(i = 0 ; i < parseInt(arr_num[0].length, 10) ; i++) { + if(this._isValidMaskedEditPosition(curpos + 1 + i)) { + masktext += this._promptCharacter; + this._LogicTextMask += this._LogicPrompt; + } else { + masktext += arr_num[0].substring(i, i + 1); + this._LogicTextMask += arr_log[0].substring(i, i + 1); + } + } + + if(arr_num.length = 2) { + masktext += this.get_cultureDecimalPlaceholder() + arr_num[1]; + this._LogicTextMask += this.get_cultureDecimalPlaceholder() + arr_log[1]; + } + + // insert only valid text + posaux = this._getNextPosition(curpos); + for(i = 0 ; i < parseInt(arr_num[0].length, 10) ; i++) + if(this._isValidMaskedEditPosition(curpos + 1 + i) && arr_log[0].substring(i, i + 1) != this._LogicPrompt) { + masktext = masktext.substring(0, posaux) + arr_num[0].substring(i, i + 1) + masktext.substring(posaux + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, posaux) + arr_log[0].substring(i, i + 1) + this._LogicTextMask.substring(posaux + 1); + posaux = this._getNextPosition(posaux + 1); + } + } else { + for(i = 0 ; i < parseInt(resttext.length, 10) ; i++) { + if(this._isValidMaskedEditPosition(curpos + 1 + i)) { + masktext += this._promptCharacter; + this._LogicTextMask += this._LogicPrompt; + } else { + masktext += resttext.substring(i, i + 1); + this._LogicTextMask += restlogi.substring(i, i + 1); + } + } + + // insert only valid text + posaux = this._getNextPosition(curpos); + for(i = 0 ; i < parseInt(resttext.length, 10) ; i++) + if(this._isValidMaskedEditPosition(curpos + 1 + i) && restlogi.substring(i, i + 1) != this._LogicPrompt) { + masktext = masktext.substring(0, posaux) + resttext.substring(i, i + 1) + masktext.substring(posaux + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, posaux) + restlogi.substring(i, i + 1) + this._LogicTextMask.substring(posaux + 1); + posaux = this._getNextPosition(posaux + 1); + } + } + + // insert value + var dif = 0; + if(this._LogicLastInt != -1 && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + dif = this._LogicLastPos - this._LogicLastInt + 1; + + masktext = masktext.substring(0, this._LogicLastPos - dif) + value + masktext.substring(this._LogicLastPos - dif + 1); + this._LogicTextMask = this._LogicTextMask.substring(0, this._LogicLastPos - dif) + value + this._LogicTextMask.substring(this._LogicLastPos - dif + 1); + wrapper.set_Value(masktext); + }, + + /// + /// Inserts AM/PM symbol + /// + /// Value to insert + /// + insertAMPM: function(value) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + masktext = wrapper.get_Value(), + ASymMask = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator), + symb = ""; + + if(ASymMask.length == 2) { + if(value.toUpperCase() == this.getCultureFirstLetterAM().toUpperCase()) + symb = ASymMask[0]; + else if(value.toUpperCase() == this.getCultureFirstLetterPM().toUpperCase()) + symb = ASymMask[1]; + + this._LogicSymbol = symb; + } + + masktext = masktext.substring(0, this._LogicLastPos + 2) + symb + masktext.substring(this._LogicLastPos + 2 + symb.length); + wrapper.set_Value(masktext); + }, + + InsertAMPM: function(value) { + Sys.Extended.Deprecated("InsertAMPM(value)", "insertAMPM(value)"); + this.insertAMPM(value); + }, + + /// + /// Inserts symbol negative + /// + /// Value to insert + /// + insertSignal: function(value) { + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()), + masktext = wrapper.get_Value(); + + if(value == "-" && this._LogicSymbol == "-") + value = "+"; + + if(value == "+") { + value = " "; + this._LogicSymbol = ""; + + if(!this._InLostfocus && this._onFocusCssClass != "") + this.addCssClassMaskedEdit(this._onFocusCssClass); + else if(!this._InLostfocus) + this.addCssClassMaskedEdit(""); + } else { + this._LogicSymbol = "-"; + + if(!this._InLostfocus && this._onFocusCssNegative != "") + this.addCssClassMaskedEdit(this._onFocusCssNegative); + } + + if(this._acceptNegative == Sys.Extended.UI.MaskedEditShowSymbol.Left) + masktext = masktext.substring(0, this._LogicFirstPos - 1) + value + masktext.substring(this._LogicFirstPos); + else if(this._acceptNegative == Sys.Extended.UI.MaskedEditShowSymbol.Right) + masktext = masktext.substring(0, this._LogicLastPos + 1) + value + masktext.substring(this._LogicLastPos + 2); + + wrapper.set_Value(masktext); + }, + + InsertSignal: function(value) { + Sys.Extended.Deprecated("InsertSignal(value)", "insertSignal(value)"); + this.insertSignal(value); + }, + + /// + /// Sets Cursor at position in TextBox + /// + /// Selection start index + /// Selection end index + /// + setSelectionRange: function(selectionStart, selectionEnd) { + var input = this.get_element(); + + if(input.setSelectionRange) { + input.setSelectionRange(selectionStart, selectionEnd); + } else if(input.createTextRange) { + var range = input.createTextRange(); + range.collapse(true); + range.moveEnd('character', selectionEnd); + range.moveStart('character', selectionStart); + range.select(); + } + }, + + _getLastEmptyPosition: function() { + var pos = this._LogicLastPos; + if(this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft && this._LogicLastInt != -1) { + var curpos = this._getCurrentPosition(); + + if(curpos <= this._LogicLastInt) + pos = this._LogicLastInt; + } + + while(pos >= 0 && this._LogicTextMask.substring(pos, pos + 1) != this._LogicPrompt) + pos--; + + return pos; + }, + + _isValidMaskedEditPosition: function(pos) { + return (this._LogicMask.substring(pos, pos + 1) == this._LogicPrompt); + }, + + // Next valid Position + _getNextPosition: function(pos) { + while(!this._isValidMaskedEditPosition(pos) && pos < this._LogicLastPos + 1) + pos++; + + if(pos > this._LogicLastPos + 1) + pos = this._LogicLastPos + 1; + + return pos; + }, + + // Previous valid Position + _getPreviousPosition: function(pos) { + while(!this._isValidMaskedEditPosition(pos) && pos > this._LogicFirstPos) + pos--; + + if(pos < this._LogicFirstPos) + pos = this._LogicFirstPos; + + return pos; + }, + + _getCurrentPosition: function() { + var begin = 0, + input = this.get_element(); + + if(input.setSelectionRange) { + begin = parseInt(input.selectionStart, 10); + } else if(document.selection) { + var sel = document.selection.createRange(); + if(sel.text != "") { + var aux = "" + + if(this._DirectSelText == "R") + aux = sel.text + String.fromCharCode(3); + else if(this._DirectSelText == "L") + aux = String.fromCharCode(3) + sel.text; + + sel.text = aux; + this._DirectSelText == ""; + } else { + sel.text = String.fromCharCode(3); + this._DirectSelText == ""; + } + + var dummy = input.createTextRange(); + dummy.findText(String.fromCharCode(3)); + dummy.select(); + + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(input); + begin = wrapper.get_Value().indexOf(String.fromCharCode(3)); + document.selection.clear(); + } + + if(begin > this._LogicLastPos + 1) + begin = this._LogicLastPos + 1; + + if(begin < this._LogicFirstPos) + begin = this._LogicFirstPos; + + return begin; + }, + + // Validate key at position in mask and/or filter + _processKey: function(poscur, key) { + var posmask = this._LogicMaskConv; + + // 9 = only numeric + // L = only letter + // $ = only letter and spaces + // C = only Custom - read from this._filtered + // A = only letter and Custom + // N = only numeric and Custom + // ? = any digit + var filter; + if(posmask.substring(poscur, poscur + 1) == "9") + filter = this._charNumbers; + else if(posmask.substring(poscur, poscur + 1).toUpperCase() == "L") + filter = this._charLetters + this._charLetters.toLowerCase(); + else if(posmask.substring(poscur, poscur + 1) == "$") + filter = this._charLetters + this._charLetters.toLowerCase() + " "; + else if(posmask.substring(poscur, poscur + 1).toUpperCase() == "C") + filter = this._filtered; + else if(posmask.substring(poscur, poscur + 1).toUpperCase() == "A") + filter = this._charLetters + this._charLetters.toLowerCase() + this._filtered; + else if(posmask.substring(poscur, poscur + 1).toUpperCase() == "N") + filter = this._charNumbers + this._filtered; + else if(posmask.substring(poscur, poscur + 1) == "?") + filter = ""; + else + return false; + + if(filter == "") + return true; + + // return true if we should accept the character. + return (!filter || filter.length == 0 || filter.indexOf(key) != -1); + }, + + // create mask empty , logic mask empty + // convert escape code and Placeholder to culture + _createMask: function() { + if(this._maskConv == "" && this._mask != "") + this._convertMask(); + + var text = this._maskConv, + i = 0, + masktext = "", + maskvld = "", + flagescape = false; + + this._LogicTextMask = ""; + this._QtdValidInput = 0; + + while(i < parseInt(text.length, 10)) { + if(text.substring(i, i + 1) == this._charEscape && flagescape == false) { + flagescape = true; + } else if(this._CharsEditMask.indexOf(text.substring(i, i + 1)) == -1) { + if(flagescape == true) { + flagescape = false; + masktext += text.substring(i, i + 1); + maskvld += text.substring(i, i + 1); + this._LogicTextMask += this._LogicEscape; + } else { + if(this._CharsSpecialMask.indexOf(text.substring(i, i + 1)) != -1) { + this._QtdValidInput++; + + if(text.substring(i, i + 1) == "/") { + masktext += this.get_cultureDatePlaceholder(); + maskvld += "/"; + this._LogicTextMask += this.get_cultureDatePlaceholder(); + } else if(text.substring(i, i + 1) == ":") { + masktext += this.get_cultureTimePlaceholder(); + maskvld += ":"; + this._LogicTextMask += this.get_cultureTimePlaceholder(); + } else if(text.substring(i, i + 1) == ",") { + masktext += this.get_cultureThousandsPlaceholder(); + maskvld += "."; + this._LogicTextMask += this.get_cultureThousandsPlaceholder(); + } else if(text.substring(i, i + 1) == ".") { + masktext += this.get_cultureDecimalPlaceholder(); + maskvld += ","; + this._LogicTextMask += this.get_cultureDecimalPlaceholder(); + } + } else { + masktext += text.substring(i, i + 1); + maskvld += text.substring(i, i + 1); + this._LogicTextMask += text.substring(i, i + 1); + } + } + } else { + if(flagescape == true) { + flagescape = false; + masktext += text.substring(i, i + 1); + maskvld += text.substring(i, i + 1); + this._LogicTextMask += this._LogicEscape; + } else { + this._QtdValidInput++; + masktext += this._promptCharacter; + maskvld += text.substring(i, i + 1); + this._LogicTextMask += this._LogicPrompt; + } + } + i++; + } + + // Set First and last logic position + this._LogicFirstPos = -1; + this._LogicLastPos = -1; + this._LogicLastInt = -1; + this._LogicMask = this._LogicTextMask; + + for(i = 0 ; i < parseInt(this._LogicMask.length, 10) ; i++) { + if(this._LogicFirstPos == -1 && this._LogicMask.substring(i, i + 1) == this._LogicPrompt) + this._LogicFirstPos = i; + + if(this._LogicMask.substring(i, i + this.get_cultureDatePlaceholder().length) == this.get_cultureDatePlaceholder()) + continue; + else if(this._LogicMask.substring(i, i + 1) == " ") + this._LogicDateTimeSepPos = i; + + if(this._LogicMask.substring(i, i + 1) == this._LogicPrompt) + this._LogicLastPos = i; + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._inputDirection == Sys.Extended.UI.MaskedEditInputDirections.RightToLeft) + if(this._LogicMask.substring(i, i + 1) == this.get_cultureDecimalPlaceholder()) + this._LogicLastInt = i; + } + + this._maskvalid = maskvld.substring(this._LogicFirstPos, this._LogicLastPos + 1); + this._EmptyMask = masktext; + }, + + // return text without mask but with placeholders + _getClearMask: function(masktext) { + var i = 0, + clearmask = "", + qtdok = 0, + includedec = false; + + while(i < parseInt(this._LogicTextMask.length, 10)) { + if(qtdok < this._QtdValidInput) { + if(this._isValidMaskedEditPosition(i) && this._LogicTextMask.substring(i, i + 1) != this._LogicPrompt) { + if(clearmask == "" && includedec) { + clearmask += "0" + this.get_cultureDecimalPlaceholder(); + includedec = false; + } + + clearmask += this._LogicTextMask.substring(i, i + 1); + qtdok++; + } else if(this._LogicTextMask.substring(i, i + 1) != this._LogicPrompt && this._LogicTextMask.substring(i, i + 1) != this._LogicEscape) { + if(this._LogicTextMask.substring(i, i + this.get_cultureDatePlaceholder().length) == this.get_cultureDatePlaceholder() && (this._maskType == Sys.Extended.UI.MaskedEditType.Date || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime)) { + clearmask += (clearmask == "") ? "" : this.get_cultureDatePlaceholder(); + i += (this.get_cultureDatePlaceholder().length - 1); + } else if(this._LogicTextMask.substring(i, i + 1) == this.get_cultureTimePlaceholder() && (this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime)) { + clearmask += (clearmask == "") ? "" : this.get_cultureTimePlaceholder(); + } else if(this._LogicTextMask.substring(i, i + 1) == " " && this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) { + clearmask += (clearmask == "") ? "" : " "; + } else if(this._LogicTextMask.substring(i, i + 1) == this.get_cultureThousandsPlaceholder() && this._maskType == Sys.Extended.UI.MaskedEditType.Number) { + clearmask += (clearmask == "") ? "" : this.get_cultureThousandsPlaceholder(); + } else if(this._LogicTextMask.substring(i, i + 1) == this.get_cultureDecimalPlaceholder() && this._maskType == Sys.Extended.UI.MaskedEditType.Number) { + clearmask += (clearmask == "") ? "" : this.get_cultureDecimalPlaceholder(); + if(clearmask == "") + includedec = true; + } + } + } + i++; + } + + if(this._LogicSymbol != "" && clearmask != "") { + if(this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) + clearmask += " " + this._LogicSymbol; + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number) + clearmask = this._LogicSymbol + clearmask; + } + + return clearmask; + }, + + // Convert notation {Number} in PAD's Number + _convertMask: function() { + this._maskConv = ""; + + var qtdmask = "", + maskchar = "", + i; + + for(i = 0 ; i < parseInt(this._mask.length, 10) ; i++) { + if(this._CharsEditMask.indexOf(this._mask.substring(i, i + 1)) != -1) { + if(qtdmask.length == 0) { + this._maskConv += this._mask.substring(i, i + 1); + qtdmask = ""; + maskchar = this._mask.substring(i, i + 1); + } else if(this._mask.substring(i, i + 1) == "9") { + qtdmask += "9"; + } else if(this._mask.substring(i, i + 1) == "0") { + qtdmask += "0"; + } + } else if(this._CharsEditMask.indexOf(this._mask.substring(i, i + 1)) == -1 && this._mask.substring(i, i + 1) != this._DelimitStartDup && this._mask.substring(i, i + 1) != this._DelimitEndDup) { + if(qtdmask.length == 0) { + this._maskConv += this._mask.substring(i, i + 1); + qtdmask = ""; + maskchar = ""; + } else { + if(this._charNumbers.indexOf(this._mask.substring(i, i + 1)) != -1) + qtdmask += this._mask.substring(i, i + 1); + } + } else if(this._mask.substring(i, i + 1) == this._DelimitStartDup && qtdmask == "") { + qtdmask = "0"; + } else if(this._mask.substring(i, i + 1) == this._DelimitEndDup && qtdmask != "") { + var qtddup = parseInt(qtdmask, 10) - 1; + if(qtddup > 0) + for(var q = 0 ; q < qtddup ; q++) + this._maskConv += maskchar; + qtdmask = ""; + maskchar = ""; + } + } + + // set first and last position in mask for Symbols + var FirstPos = -1, + LastPos = -1, + flagescape = false; + + for(i = 0 ; i < parseInt(this._maskConv.length, 10) ; i++) { + if(this._maskConv.substring(i, i + 1) == this._charEscape && !flagescape) { + flagescape = true; + } else if(this._CharsEditMask.indexOf(this._maskConv.substring(i, i + 1)) != -1 && !flagescape) { + if(FirstPos == -1) + FirstPos = i; + + LastPos = i; + } else if(flagescape) { + flagescape = false; + } + } + + // set spaces for Symbols AM/PM + if((this._maskType == Sys.Extended.UI.MaskedEditType.Time || this._maskType == Sys.Extended.UI.MaskedEditType.DateTime) && this._acceptAmPm) { + var ASymMask = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator), + SymMask = ""; + + if(ASymMask.length == 2) { + SymMask = this._charEscape + " "; + + for(i = 0 ; i < parseInt(ASymMask[0].length, 10) ; i++) + SymMask += this._charEscape + " "; + } + this._maskConv = this._maskConv.substring(0, LastPos + 1) + SymMask + this._maskConv.substring(LastPos + 1); + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._displayMoney == Sys.Extended.UI.MaskedEditShowSymbol.Left) { // set spaces for Symbols Currency + var SymMask = ""; + + for(i = 0 ; i < parseInt(this.get_cultureCurrencySymbolPlaceholder().length, 10) ; i++) { + if(this._CharsEditMask.indexOf(this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1)) == -1) + SymMask += this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1); + else + SymMask += this._charEscape + this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1); + } + + SymMask += this._charEscape + " "; + this._maskConv = this._maskConv.substring(0, FirstPos) + SymMask + this._maskConv.substring(FirstPos); + FirstPos += SymMask.length; + LastPos += SymMask.length; + } else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._displayMoney == Sys.Extended.UI.MaskedEditShowSymbol.Right) { // set spaces for Symbols negative + var SymMask = this._charEscape + " "; + + for(i = 0 ; i < parseInt(this.get_cultureCurrencySymbolPlaceholder().length, 10) ; i++) + if(this._CharsEditMask.indexOf(this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1)) == -1) + SymMask += this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1); + else + SymMask += this._charEscape + this.get_cultureCurrencySymbolPlaceholder().substring(i, i + 1); + + this._maskConv = this._maskConv.substring(0, LastPos + 1) + SymMask + this._maskConv.substring(LastPos + 1); + } + + if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative == Sys.Extended.UI.MaskedEditShowSymbol.Right) + this._maskConv = this._maskConv.substring(0, LastPos + 1) + this._charEscape + " " + this._maskConv.substring(LastPos + 1); + else if(this._maskType == Sys.Extended.UI.MaskedEditType.Number && this._acceptNegative == Sys.Extended.UI.MaskedEditShowSymbol.Left) + this._maskConv = this._maskConv.substring(0, FirstPos) + this._charEscape + " " + this._maskConv.substring(FirstPos); + + this._convertMaskNotEscape(); + }, + + // Convert mask with escape to mask not escape + // length is equal to real position + _convertMaskNotEscape: function() { + this._LogicMaskConv = ""; + + var atumask = this._maskConv.replace(/(\/)/g, this.get_cultureDatePlaceholder()), + flagescape = false, + i; + + for(i = 0 ; i < parseInt(atumask.length, 10) ; i++) { + if(atumask.substring(i, i + 1) == this._charEscape) + flagescape = true; + else if(!flagescape) + this._LogicMaskConv += atumask.substring(i, i + 1); + else { + this._LogicMaskConv += this._LogicEscape; + flagescape = false; + } + } + }, + + // Helper properties + + /// + /// Mask to be applied to target TextBox + /// + /// get_mask + /// set_mask + /// + get_mask: function() { + if(this._maskConv == "" && this._mask != "") + this._convertMask(); + + return this._maskConv; + }, + set_mask: function(value) { + this._mask = value; + this.raisePropertyChanged('mask'); + }, + + get_Mask: function() { + Sys.Extended.Deprecated("get_Mask()", "get_mask()"); + return this.get_mask(); + }, + set_Mask: function(value) { + Sys.Extended.Deprecated("set_Mask(value)", "set_mask(value)"); + this.set_mask(value); + }, + + /// + /// Valid characters for mask type "C" (case-sensitive) + /// + /// get_filtered + /// set_filtered + /// + get_filtered: function() { + return this._filtered; + }, + set_filtered: function(value) { + this._filtered = value; + this.raisePropertyChanged('filtered'); + }, + + get_Filtered: function() { + Sys.Extended.Deprecated("get_Filtered()", "get_filtered()"); + return this.get_filtered(); + }, + set_Filtered: function(value) { + Sys.Extended.Deprecated("set_Filtered(value)", "set_filtered(value)"); + this.set_filtered(value); + }, + + /// + /// Text input direction + /// + /// + /// Possible values: + /// LeftToRight - Left to Right + /// RightToLeft - Right to left + /// + /// get_inputDirection + /// set_inputDirection + /// + get_inputDirection: function() { + return this._inputDirection; + }, + set_inputDirection: function(value) { + this._inputDirection = value; + this.raisePropertyChanged('inputDirection'); + }, + + get_InputDirection: function() { + Sys.Extended.Deprecated("get_InputDirection()", "get_inputDirection()"); + return this.get_inputDirection(); + }, + set_InputDirection: function(value) { + Sys.Extended.Deprecated("set_InputDirection(value)", "set_inputDirection(value)"); + this.set_inputDirection(value); + }, + + /// + /// Prompt character + /// + /// get_promptCharacter + /// set_promptCharacter + /// + get_promptCharacter: function() { + return this._promptCharacter; + }, + set_promptCharacter: function(value) { + this._promptCharacter = value; + this.raisePropertyChanged('promptCharacter'); + }, + + get_PromptCharacter: function() { + Sys.Extended.Deprecated("get_PromptCharacter()", "get_promptCharacter()"); + return this.get_promptCharacter(); + }, + set_PromptCharacter: function(value) { + Sys.Extended.Deprecated("set_PromptCharacter(value)", "set_promptCharacter(value)"); + this.set_promptCharacter(value); + }, + + /// + /// CSS class used when the TextBox receives focus + /// + /// get_onFocusCssClass + /// set_onFocusCssClass + /// + get_onFocusCssClass: function() { + return this._onFocusCssClass; + }, + set_onFocusCssClass: function(value) { + this._onFocusCssClass = value; + this.raisePropertyChanged('onFocusCssClass'); + }, + + get_OnFocusCssClass: function() { + Sys.Extended.Deprecated("get_OnFocusCssClass()", "get_onFocusCssClass()"); + return this.get_onFocusCssClass(); + }, + set_OnFocusCssClass: function(value) { + Sys.Extended.Deprecated("set_OnFocusCssClass(value)", "set_onFocusCssClass(value)"); + this.set_onFocusCssClass(value); + }, + + /// + /// CSS class used when the text is not valid + /// + /// get_onInvalidCssClass + /// set_onInvalidCssClass + /// + get_onInvalidCssClass: function() { + return this._onInvalidCssClass; + }, + set_onInvalidCssClass: function(value) { + this._onInvalidCssClass = value; + this.raisePropertyChanged('onInvalidCssClass'); + }, + + get_OnInvalidCssClass: function() { + Sys.Extended.Deprecated("get_OnInvalidCssClass()", "get_onInvalidCssClass()"); + return this.get_onInvalidCssClass(); + }, + set_OnInvalidCssClass: function(value) { + Sys.Extended.Deprecated("set_OnInvalidCssClass(value)", "set_onInvalidCssClass(value)"); + this.set_onInvalidCssClass(value); + }, + + /// + /// Name of culture to use (overrides the default page culture) + /// + /// get_cultureName + /// set_cultureName + /// + get_cultureName: function() { + return this._cultureName; + }, + set_cultureName: function(value) { + this._cultureName = value; + this.raisePropertyChanged('cultureName'); + }, + + get_CultureName: function() { + Sys.Extended.Deprecated("get_CultureName()", "get_cultureName()"); + return this.get_cultureName(); + }, + set_CultureName: function(value) { + Sys.Extended.Deprecated("set_CultureName(value)", "set_cultureName(value)"); + this.set_cultureName(value); + }, + + /// + /// Culture override + /// + /// get_cultureDatePlaceholder + /// set_cultureDatePlaceholder + /// + get_cultureDatePlaceholder: function() { + return this._cultureDatePlaceholder; + }, + set_cultureDatePlaceholder: function(value) { + this._cultureDatePlaceholder = value; + this.raisePropertyChanged('cultureDatePlaceholder'); + }, + + get_CultureDatePlaceholder: function() { + Sys.Extended.Deprecated("get_CultureDatePlaceholder()", "get_cultureDatePlaceholder()"); + return this.get_cultureDatePlaceholder(); + }, + set_CultureDatePlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureDatePlaceholder(value)", "set_cultureDatePlaceholder(value)"); + this.set_cultureDatePlaceholder(value); + }, + + /// + /// Culture override + /// + /// get_cultureTimePlaceholder + /// set_cultureTimePlaceholder + /// + get_cultureTimePlaceholder: function() { + return this._cultureTimePlaceholder; + }, + set_cultureTimePlaceholder: function(value) { + this._cultureTimePlaceholder = value; + this.raisePropertyChanged('cultureTimePlaceholder'); + }, + + get_CultureTimePlaceholder: function() { + Sys.Extended.Deprecated("get_CultureTimePlaceholder()", "get_cultureTimePlaceholder()"); + return this.get_cultureTimePlaceholder(); + }, + set_CultureTimePlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureTimePlaceholder(value)", "set_cultureTimePlaceholder(value)"); + this.set_cultureTimePlaceholder(value); + }, + + /// + /// Culture override + /// + /// get_cultureDecimalPlaceholder + /// set_cultureDecimalPlaceholder + /// + get_cultureDecimalPlaceholder: function() { + return this._cultureDecimalPlaceholder; + }, + set_cultureDecimalPlaceholder: function(value) { + this._cultureDecimalPlaceholder = value; + this.raisePropertyChanged('cultureDecimalPlaceholder'); + }, + + get_CultureDecimalPlaceholder: function() { + Sys.Extended.Deprecated("get_CultureDecimalPlaceholder()", "get_cultureDecimalPlaceholder()"); + return this.get_cultureDecimalPlaceholder(); + }, + set_CultureDecimalPlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureDecimalPlaceholder(value)", "set_cultureDecimalPlaceholder(value)"); + this.set_cultureDecimalPlaceholder(value); + }, + + /// + /// Culture override + /// + /// get_cultureThousandsPlaceholder + /// set_cultureThousandsPlaceholder + /// + get_cultureThousandsPlaceholder: function() { + return this._cultureThousandsPlaceholder; + }, + set_cultureThousandsPlaceholder: function(value) { + this._cultureThousandsPlaceholder = value; + this.raisePropertyChanged('cultureThousandsPlaceholder'); + }, + + get_CultureThousandsPlaceholder: function() { + Sys.Extended.Deprecated("get_CultureThousandsPlaceholder()", "get_cultureThousandsPlaceholder()"); + return this.get_cultureThousandsPlaceholder(); + }, + set_CultureThousandsPlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureThousandsPlaceholder(value)", "set_cultureThousandsPlaceholder(value)"); + this.set_cultureThousandsPlaceholder(value); + }, + + /// + /// Culture override + /// + /// get_cultureDateFormat + /// set_cultureDateFormat + /// + get_cultureDateFormat: function() { + var ret = this._cultureDateFormat; + + switch(this.get_userDateFormat()) { + case Sys.Extended.UI.MaskedEditUserDateFormat.DayMonthYear: + ret = "DMY"; + break; + case Sys.Extended.UI.MaskedEditUserDateFormat.DayYearMonth: + ret = "DYM"; + break; + case Sys.Extended.UI.MaskedEditUserDateFormat.MonthDayYear: + ret = "MDY"; + break; + case Sys.Extended.UI.MaskedEditUserDateFormat.MonthYearDay: + ret = "MYD"; + break; + case Sys.Extended.UI.MaskedEditUserDateFormat.YearDayMonth: + ret = "YDM"; + break; + case Sys.Extended.UI.MaskedEditUserDateFormat.YearMonthDay: + ret = "YMD"; + break; + } + + return ret; + }, + set_cultureDateFormat: function(value) { + this._cultureDateFormat = value; + this.raisePropertyChanged('cultureDateFormat'); + }, + + get_CultureDateFormat: function() { + Sys.Extended.Deprecated("get_CultureDateFormat()", "get_cultureDateFormat()"); + return this.get_cultureDateFormat(); + }, + set_CultureDateFormat: function(value) { + Sys.Extended.Deprecated("set_CultureDateFormat(value)", "set_cultureDateFormat(value)"); + this.set_cultureDateFormat(value); + }, + + /// + /// Culture override + /// + /// get_cultureCurrencySymbolPlaceholder + /// set_cultureCurrencySymbolPlaceholder + /// + get_cultureCurrencySymbolPlaceholder: function() { + return this._cultureCurrencySymbolPlaceholder; + }, + set_cultureCurrencySymbolPlaceholder: function(value) { + this._cultureCurrencySymbolPlaceholder = value; + this.raisePropertyChanged('cultureCurrencySymbolPlaceholder'); + }, + + get_CultureCurrencySymbolPlaceholder: function() { + Sys.Extended.Deprecated("get_CultureCurrencySymbolPlaceholder()", "get_cultureCurrencySymbolPlaceholder()"); + return this.get_cultureCurrencySymbolPlaceholder(); + }, + set_CultureCurrencySymbolPlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureCurrencySymbolPlaceholder(value)", "set_cultureCurrencySymbolPlaceholder(value)"); + this.set_cultureCurrencySymbolPlaceholder(value); + }, + + /// + /// Culture override + /// + /// get_cultureAMPMPlaceholder + /// set_cultureAMPMPlaceholder + /// + get_cultureAMPMPlaceholder: function() { + var value = this._cultureAMPMPlaceholder; + if(value.split(this._AMPMPlaceholderSeparator).length != 2 || value == this._AMPMPlaceholderSeparator) + value = ""; + + if(this.get_userTimeFormat() == Sys.Extended.UI.MaskedEditUserTimeFormat.TwentyFourHour) + value = ""; + + return value; + }, + set_cultureAMPMPlaceholder: function(value) { + this._cultureAMPMPlaceholder = value; + this.raisePropertyChanged('cultureAMPMPlaceholder'); + }, + + get_CultureAMPMPlaceholder: function() { + Sys.Extended.Deprecated("get_CultureAMPMPlaceholder()", "get_cultureAMPMPlaceholder()"); + return this.get_cultureAMPMPlaceholder(); + }, + set_CultureAMPMPlaceholder: function(value) { + Sys.Extended.Deprecated("set_CultureAMPMPlaceholder(value)", "set_cultureAMPMPlaceholder(value)"); + this.set_cultureAMPMPlaceholder(value); + }, + + /// + /// Returns culture's first AMPM letters + /// + /// First AMPM letters + /// + getCultureFirstLettersAMPM: function() { + if(this.get_cultureAMPMPlaceholder() != "") { + var ASymMask = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator); + return (ASymMask[0].substring(0, 1) + ASymMask[1].substring(0, 1)); + } + + return ""; + }, + + get_CultureFirstLettersAMPM: function() { + Sys.Extended.Deprecated("get_CultureFirstLettersAMPM()", "getCultureFirstLettersAMPM()"); + return this.getCultureFirstLettersAMPM(); + }, + + /// + /// Returns culture's first AM letter + /// + /// First AM letter + /// + getCultureFirstLetterAM: function() { + if(this.get_cultureAMPMPlaceholder() != "") { + var ASymMask = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator); + return ASymMask[0].substring(0, 1); + } + + return ""; + }, + + get_CultureFirstLetterAM: function() { + Sys.Extended.Deprecated("get_CultureFirstLetterAM()", "getCultureFirstLetterAM()"); + return this.getCultureFirstLetterAM(); + }, + + /// + /// Returns culture's first PM letter + /// + /// First PM letter + /// + getCultureFirstLetterPM: function() { + if(this.get_cultureAMPMPlaceholder() != "") { + var ASymMask = this.get_cultureAMPMPlaceholder().split(this._AMPMPlaceholderSeparator); + return ASymMask[1].substring(0, 1); + } + + return ""; + }, + + get_CultureFirstLetterPM: function() { + Sys.Extended.Deprecated("get_CultureFirstLetterPM()", "getCultureFirstLetterPM()"); + return this.getCultureFirstLetterPM(); + }, + + /// + /// True to remove the mask when the TextBox loses focus + /// + /// get_clearMaskOnLostFocus + /// set_clearMaskOnLostFocus + /// + get_clearMaskOnLostFocus: function() { + return this._clearMaskOnLostfocus; + }, + set_clearMaskOnLostFocus: function(value) { + this._clearMaskOnLostfocus = value; + this.raisePropertyChanged('clearMaskOnLostFocus'); + }, + + get_ClearMaskOnLostFocus: function() { + Sys.Extended.Deprecated("get_ClearMaskOnLostFocus()", "get_clearMaskOnLostFocus()"); + return this.get_clearMaskOnLostFocus(); + }, + set_ClearMaskOnLostFocus: function(value) { + Sys.Extended.Deprecated("set_ClearMaskOnLostFocus(value)", "set_clearMaskOnLostFocus(value)"); + this.set_clearMaskOnLostFocus(value); + }, + + /// + /// Message displayed when editing in TextBox + /// + /// get_messageValidatorTip + /// set_messageValidatorTip + /// + get_messageValidatorTip: function() { + return this._messageValidatorTip; + }, + set_messageValidatorTip: function(value) { + this._messageValidatorTip = value; + this.raisePropertyChanged('messageValidatorTip'); + }, + + get_MessageValidatorTip: function() { + Sys.Extended.Deprecated("get_MessageValidatorTip()", "get_messageValidatorTip()"); + return this.get_messageValidatorTip(); + }, + set_MessageValidatorTip: function(value) { + Sys.Extended.Deprecated("set_MessageValidatorTip(value)", "set_messageValidatorTip(value)"); + this.set_messageValidatorTip(value); + }, + + /// + /// Whether or not AM/PM is accepted on times. The default value is false + /// + /// get_acceptAMPM + /// set_acceptAMPM + /// + get_acceptAMPM: function() { + return this._acceptAmPm; + }, + set_acceptAMPM: function(value) { + this._acceptAmPm = value; + this.raisePropertyChanged('acceptAMPM'); + }, + + get_AcceptAMPM: function() { + Sys.Extended.Deprecated("get_AcceptAMPM()", "get_acceptAMPM()"); + return this.get_acceptAMPM(); + }, + set_AcceptAMPM: function(value) { + Sys.Extended.Deprecated("set_AcceptAMPM(value)", "set_acceptAMPM(value)"); + this.set_acceptAMPM(value); + }, + + /// + /// True if the negative sign (-) is allowed + /// + /// + /// Possible values: + /// None - Do not show the negative sign + /// Left - Show the negative sign on the left of the mask + /// Right - Show the negative sign on the right of the mask + /// + /// get_acceptNegative + /// set_acceptNegative + /// + get_acceptNegative: function() { + return this._acceptNegative; + }, + set_acceptNegative: function(value) { + this._acceptNegative = value; + this.raisePropertyChanged('acceptNegative'); + }, + + get_AcceptNegative: function() { + Sys.Extended.Deprecated("get_AcceptNegative()", "get_acceptNegative()"); + return this.get_acceptNegative(); + }, + set_AcceptNegative: function(value) { + Sys.Extended.Deprecated("set_AcceptNegative(value)", "set_acceptNegative(value)"); + this.set_acceptNegative(value); + }, + + /// + /// Specifies how the currency symbol is displayed + /// + /// + /// Possible values: + /// None - Do not show the currency symbol + /// Left - Show the currency symbol on the left of the mask + /// Right - Show the currency symbol on the right of the mask + /// + /// get_displayMoney + /// set_displayMoney + /// + get_displayMoney: function() { + return this._displayMoney; + }, + set_displayMoney: function(value) { + this._displayMoney = value; + this.raisePropertyChanged('displayMoney'); + }, + + get_DisplayMoney: function() { + Sys.Extended.Deprecated("get_DisplayMoney()", "get_displayMoney()"); + return this.get_displayMoney(); + }, + set_DisplayMoney: function(value) { + Sys.Extended.Deprecated("set_DisplayMoney(value)", "set_displayMoney(value)"); + this.set_displayMoney(value); + }, + + /// + /// CSS class used when the TextBox gets focus with a negative value + /// + /// get_onFocusCssNegative + /// set_onFocusCssNegative + /// + get_onFocusCssNegative: function() { + return this._onFocusCssNegative; + }, + set_onFocusCssNegative: function(value) { + this._onFocusCssNegative = value; + this.raisePropertyChanged('onFocusCssNegative'); + }, + + get_OnFocusCssNegative: function() { + Sys.Extended.Deprecated("get_OnFocusCssNegative()", "get_onFocusCssNegative()"); + return this.get_onFocusCssNegative(); + }, + set_OnFocusCssNegative: function(value) { + Sys.Extended.Deprecated("set_OnFocusCssNegative(value)", "set_onFocusCssNegative(value)"); + this.set_onFocusCssNegative(value); + }, + + /// + /// CSS class used when the TextBox loses focus with a negative value + /// + /// get_onBlurCssNegative + /// set_onBlurCssNegative + /// + get_onBlurCssNegative: function() { + return this._onBlurCssNegative; + }, + set_onBlurCssNegative: function(value) { + this._onBlurCssNegative = value; + this.raisePropertyChanged('onBlurCssNegative'); + }, + + get_OnBlurCssNegative: function() { + Sys.Extended.Deprecated("get_OnBlurCssNegative()", "get_onBlurCssNegative()"); + return this.get_onBlurCssNegative(); + }, + set_OnBlurCssNegative: function(value) { + Sys.Extended.Deprecated("set_OnBlurCssNegative(value)", "set_onBlurCssNegative(value)"); + this.set_onBlurCssNegative(value); + }, + + /// + /// Default century used when a date mask only has two digits for the year + /// + /// get_century + /// set_century + /// + get_century: function() { + return this._century; + }, + set_century: function(value) { + this._century = value; + this.raisePropertyChanged('century'); + }, + + get_Century: function() { + Sys.Extended.Deprecated("get_Century()", "get_century()"); + return this.get_century(); + }, + set_Century: function(value) { + Sys.Extended.Deprecated("set_Century(value)", "set_century(value)"); + this.set_century(value); + }, + + /// + /// True to automatically fill in empty mask characters not specified by the user + /// + /// + /// MaskType=Number - Empty mask characters will be filled with zeros + /// MaskType=Time - Empty mask characters will be filled with the current time + /// MaskType=Date - Empty mask characters will be filled with the current date + /// MaskType=DateTime - Empty mask characters will be filled with the current date/time + /// + /// get_autoComplete + /// set_autoComplete + /// + get_autoComplete: function() { + return this._autoComplete; + }, + set_autoComplete: function(value) { + this._autoComplete = value; + this.raisePropertyChanged('autoComplete'); + }, + + get_AutoComplete: function() { + Sys.Extended.Deprecated("get_AutoComplete()", "get_autoComplete()"); + return this.get_autoComplete(); + }, + set_AutoComplete: function(value) { + Sys.Extended.Deprecated("set_AutoComplete(value)", "set_autoComplete(value)"); + this.set_autoComplete(value); + }, + + /// + /// Default character to use when AutoComplete is enabled + /// + /// get_autoCompleteValue + /// set_autoCompleteValue + /// + get_autoCompleteValue: function() { + return this._autoCompleteValue; + }, + set_autoCompleteValue: function(value) { + this._autoCompleteValue = value; + this.raisePropertyChanged('autoCompleteValue'); + }, + + get_AutoCompleteValue: function() { + Sys.Extended.Deprecated("get_AutoCompleteValue()", "get_autoCompleteValue()"); + return this.get_autoCompleteValue(); + }, + set_AutoCompleteValue: function(value) { + Sys.Extended.Deprecated("set_AutoCompleteValue(value)", "set_autoCompleteValue(value)"); + this.set_autoCompleteValue(value); + }, + + /// + /// Type of validation to perform + /// + /// + /// Possible values: + /// None - No validation + /// Number - Number validation + /// Date - Date validation + /// Time - Time validation + /// DateTime - Date and time validation + /// + /// get_maskType + /// set_maskType + /// + get_maskType: function() { + return this._maskType; + }, + set_maskType: function(value) { + this._maskType = value; + this.raisePropertyChanged('maskType'); + }, + + get_MaskType: function() { + Sys.Extended.Deprecated("get_MaskType()", "get_maskType()"); + return this.get_maskType(); + }, + set_MaskType: function(value) { + Sys.Extended.Deprecated("set_MaskType(value)", "set_maskType(value)"); + this.set_maskType(value); + }, + + /// + /// True to clear the TextBox when invalid text is entered + /// + /// get_clearTextOnInvalid + /// set_clearTextOnInvalid + /// + get_clearTextOnInvalid: function() { + return this._clearTextOnInvalid; + }, + set_clearTextOnInvalid: function(value) { + if(this._clearTextOnInvalid !== value) { + this._clearTextOnInvalid = value; + this.raisePropertyChanged('clearTextOnInvalid'); + } + }, + + get_ClearTextOnInvalid: function() { + Sys.Extended.Deprecated("get_ClearTextOnInvalid()", "get_clearTextOnInvalid()"); + return this.get_clearTextOnInvalid(); + }, + set_ClearTextOnInvalid: function(value) { + Sys.Extended.Deprecated("set_ClearTextOnInvalid(value)", "set_clearTextOnInvalid(value)"); + this.set_clearTextOnInvalid(value); + }, + + /// + /// Prompt text to use when a clipboard paste is performed + /// + /// get_clipboardText + /// set_clipboardText + /// + get_clipboardText: function() { + return this._clipboardText; + }, + set_clipboardText: function(value) { + this._clipboardText = value; + this.raisePropertyChanged('clipboardText'); + }, + + get_ClipboardText: function() { + Sys.Extended.Deprecated("get_ClipboardText()", "get_clipboardText()"); + return this.get_clipboardText(); + }, + set_ClipboardText: function(value) { + Sys.Extended.Deprecated("set_ClipboardText(value)", "set_clipboardText(value)"); + this.set_clipboardText(value); + }, + + /// + /// True to allow copy/paste with the clipboard + /// + /// get_clipboardEnabled + /// set_clipboardEnabled + /// + get_clipboardEnabled: function() { + return this._allowCopyPaste; + }, + set_clipboardEnabled: function(value) { + this._allowCopyPaste = value; + this.raisePropertyChanged('clipboardEnabled'); + }, + + get_ClipboardEnabled: function() { + Sys.Extended.Deprecated("get_ClipboardEnabled()", "get_clipboardEnabled()"); + return this.get_clipboardEnabled(); + }, + set_ClipboardEnabled: function(value) { + Sys.Extended.Deprecated("set_ClipboardEnabled(value)", "set_clipboardEnabled(value)"); + this.set_clipboardEnabled(value); + }, + + /// + /// True to show a tooltip message when the mouse hovers over an invalid TextBox + /// + /// get_errorTooltipEnabled + /// set_errorTooltipEnabled + /// + get_errorTooltipEnabled: function() { + return this._showMessageErrorFloat; + }, + set_errorTooltipEnabled: function(value) { + this._showMessageErrorFloat = value; + this.raisePropertyChanged('errorTooltipEnabled'); + }, + + get_ErrorTooltipEnabled: function() { + Sys.Extended.Deprecated("get_ErrorTooltipEnabled()", "get_errorTooltipEnabled()"); + return this.get_errorTooltipEnabled(); + }, + set_ErrorTooltipEnabled: function(value) { + Sys.Extended.Deprecated("set_ErrorTooltipEnabled(value)", "set_errorTooltipEnabled(value)"); + this.set_errorTooltipEnabled(value); + }, + + /// + /// CSS class for the tooltip message + /// + /// get_errorTooltipCssClass + /// set_errorTooltipCssClass + /// + get_errorTooltipCssClass: function() { + return this._cssMessageErrorFloat; + }, + set_errorTooltipCssClass: function(value) { + this._cssMessageErrorFloat = value; + this.raisePropertyChanged('errorTooltipCssClass'); + }, + + get_ErrorTooltipCssClass: function() { + Sys.Extended.Deprecated("get_ErrorTooltipCssClass()", "get_errorTooltipCssClass()"); + return this.get_errorTooltipCssClass(); + }, + set_ErrorTooltipCssClass: function(value) { + Sys.Extended.Deprecated("set_ErrorTooltipCssClass(value)", "set_errorTooltipCssClass(value)"); + this.set_errorTooltipCssClass(value); + }, + + /// + /// Custom date format + /// + /// get_userDateFormat + /// set_userDateFormat + /// + get_userDateFormat: function() { + return this._userDateFormat; + }, + set_userDateFormat: function(value) { + this._userDateFormat = value; + this.raisePropertyChanged('userDateFormat'); + }, + + get_UserDateFormat: function() { + Sys.Extended.Deprecated("get_UserDateFormat()", "get_userDateFormat()"); + return this.get_userDateFormat(); + }, + set_UserDateFormat: function(value) { + Sys.Extended.Deprecated("set_UserDateFormat(value)", "set_userDateFormat(value)"); + this.set_userDateFormat(value); + }, + + /// + /// Custom time format + /// + /// get_userTimeFormat + /// set_userTimeFormat + /// + get_userTimeFormat: function() { + return this._userTimeFormat; + }, + set_userTimeFormat: function(value) { + this._userTimeFormat = value; + this.raisePropertyChanged('userTimeFormat'); + }, + + get_UserTimeFormat: function() { + Sys.Extended.Deprecated("get_UserTimeFormat()", "get_userTimeFormat()"); + return this.get_userTimeFormat(); + }, + set_UserTimeFormat: function(value) { + Sys.Extended.Deprecated("set_UserTimeFormat(value)", "set_userTimeFormat(value)"); + this.set_userTimeFormat(value); + } +} +Sys.Extended.UI.MaskedEditBehavior.registerClass('Sys.Extended.UI.MaskedEditBehavior', Sys.Extended.UI.DynamicPopulateBehaviorBase); + +// Register enumerations +Sys.Extended.UI.MaskedEditType = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.MaskedEditInputDirections = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.MaskedEditShowSymbol = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.MaskedEditUserDateFormat = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.MaskedEditUserTimeFormat = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.MaskedEditType.prototype = { + None: 0, + Date: 1, + Number: 2, + Time: 3, + DateTime: 4 +} + +Sys.Extended.UI.MaskedEditInputDirections.prototype = { + LeftToRight: 0, + RightToLeft: 1 +} + +Sys.Extended.UI.MaskedEditShowSymbol.prototype = { + None: 0, + Left: 1, + Right: 2 +} + +Sys.Extended.UI.MaskedEditUserDateFormat.prototype = { + None: 0, + DayMonthYear: 1, + DayYearMonth: 2, + MonthDayYear: 3, + MonthYearDay: 4, + YearDayMonth: 5, + YearMonthDay: 6 +} + +Sys.Extended.UI.MaskedEditUserTimeFormat.prototype = { + None: 0, + TwentyFourHour: 1 +} + +Sys.Extended.UI.MaskedEditType.registerEnum('Sys.Extended.UI.MaskedEditType'); +Sys.Extended.UI.MaskedEditInputDirections.registerEnum('Sys.Extended.UI.MaskedEditInputDirections'); +Sys.Extended.UI.MaskedEditShowSymbol.registerEnum('Sys.Extended.UI.MaskedEditShowSymbol'); +Sys.Extended.UI.MaskedEditUserDateFormat.registerEnum('Sys.Extended.UI.MaskedEditUserDateFormat'); +Sys.Extended.UI.MaskedEditUserTimeFormat.registerEnum('Sys.Extended.UI.MaskedEditUserTimeFormat'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEditValidator.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEditValidator.debug.js new file mode 100644 index 000000000..7b73bcfbe --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MaskedEditValidator.debug.js @@ -0,0 +1,690 @@ +function MaskedEditSetMessage(value, msg, txt) { + value.errormessage = msg; + + if(txt == "") + value.text = msg; + else + value.text = txt; + + value.innerHTML = value.text; +} + +function MaskedEditMessageShow(value, IsValid) { + if(typeof (value.display) == "string") { + if(value.display == "None") + return; + + if(value.display == "Dynamic") { + value.style.display = IsValid ? "none" : "inline"; + return; + } + } + + value.style.visibility = IsValid ? "hidden" : "visible"; +} + +function MaskedEditSetCssClass(value, Css) { + var target = $get(value.TargetValidator); + + Sys.UI.DomElement.removeCssClass(target, value.InvalidValueCssClass); + Sys.UI.DomElement.removeCssClass(target, value.CssBlurNegative); + Sys.UI.DomElement.removeCssClass(target, value.CssFocus); + Sys.UI.DomElement.removeCssClass(target, value.CssFocusNegative); + + if(Css != "") + Sys.UI.DomElement.addCssClass(target, Css); +} + +function MaskedEditValidatorDateTime(value) { + MaskedEditSetMessage(value, "", ""); + MaskedEditSetCssClass(value, ""); + MaskedEditMessageShow(value, true); + + if(value.IsMaskedEdit == "false") + return true; + + var target = $get(value.TargetValidator); + if(value.ValidEmpty == "false") { + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == value.InitialValue) { + MaskedEditSetMessage(value, value.EmptyValueMessage, value.EmptyValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == "") + return true; + + var ret = true, + mask = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(); + + // regular Exp + if(value.ValidationExpression != "") { + var rx = new RegExp(value.ValidationExpression), + matches = rx.exec(mask); + + ret = (matches != null && mask == matches[0]); + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + var PartDate = target.MaskedEditBehavior.AutoFormatDate(), + PartTime = target.MaskedEditBehavior.AutoFormatTime(), + MinVlDt = "", + MinVlTm = ""; + + if(value.MinimumValue != "") { + MinVlDt = value.MinimumValue.split(" ")[0]; + MinVlTm = value.MinimumValue.split(" ")[1]; + } + + var MaxVlDt = "", + MaxVlTm = ""; + if(value.MaximumValue != "") { + MaxVlDt = value.MaximumValue.split(" ")[0]; + MaxVlTm = value.MaximumValue.split(" ")[1]; + } + + ret = MaskedEditValidatorPartDate(value, PartDate, MinVlDt, MaxVlDt); + if(ret) + ret = MaskedEditValidatorPartTime(value, PartTime, MinVlTm, MaxVlTm); + + // custom valid + if(ret && value.ClientValidationFunction != "") { + var args = { Value: mask, IsValid: true }; + eval(value.ClientValidationFunction + "(value, args);"); + ret = args.IsValid; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(!ret) + MaskedEditMessageShow(value, ret); + + return ret; +} + +function MaskedEditValidatorPartTime(value, mask, MinVl, MaxVl) { + var ret = true, + AttibTmSep = value.TimeSeparator, + AttibTmSyb = value.AmPmSymbol; + + // hh:mm or hh:mm:ss + var SybTm = AttibTmSyb.split(";"), + tm = AttibTmSyb.replace(";", "|"), + reg1 = "^(^([0][0-9]|[1][0-2])" + AttibTmSep + "([0-5][0-9])" + AttibTmSep + "([0-5][0-9])\\s(" + tm + ")$)|(^([0][0-9]|[1][0-2])" + AttibTmSep + "([0-5][0-9])\\s(" + tm + ")$)$", + reg2 = "^(^([0-1][0-9]|[2][0-3])" + AttibTmSep + "([0-5][0-9])" + AttibTmSep + "([0-5][0-9])$)|(^([0-1][0-9]|[2][0-3])" + AttibTmSep + "([0-5][0-9])$)$", + H = -1, + M = -1, + S = -1, + aux = "", + m_arrValue = mask.split(AttibTmSep), + regex1 = new RegExp(reg1), + matches1 = regex1.exec(mask), + regex2 = new RegExp(reg2), + matches2 = regex2.exec(mask); + + if(matches1 && (matches1[0] == mask)) { + aux = mask.substring(mask.length - 2).substring(0, 1); + H = parseInt(m_arrValue[0], 10); + + if(aux.toUpperCase() == SybTm[1].substring(0, 1).toUpperCase()) { + H += 12; + if(H == 24) + H = 12; + } + + M = parseInt(m_arrValue[1], 10); + S = (value.length > 9 ? parseInt(m_arrValue[2].substring(0, 2), 10) : 0); + } else if(matches2 && (matches2[0] == mask)) { + H = parseInt(m_arrValue[0], 10); + M = parseInt(m_arrValue[1], 10); + S = (mask.length > 5 ? parseInt(m_arrValue[2], 10) : 0); + } + + if(H == -1 || M == -1 || S == -1) + ret = false; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + + if(ret && (MaxVl != "" || MinVl != "")) { + var Hr, + Mr, + Sr, + m_arr; + + if(MinVl != "") { + Hr = -1; + Mr = -1; + Sr = -1; + m_arr = MinVl.split(AttibTmSep); + matches1 = regex1.exec(MinVl); + matches2 = regex2.exec(MinVl); + + if(matches1 && (matches1[0] == MinVl)) { + aux = MinVl.substring(MinVl.length - 2).substring(0, 1); + Hr = parseInt(m_arr[0], 10); + + if(aux.toUpperCase() == SybTm[1].substring(0, 1).toUpperCase()) { + Hr += 12; + + if(Hr == 24) + Hr = 0; + } + + Mr = parseInt(m_arr[1], 10); + Sr = (MinVl.length > 9 ? parseInt(m_arr[2].substring(0, 2), 10) : 0); + } else if(matches2 && (matches2[0] == MinVl)) { + Hr = parseInt(m_arr[0], 10); + Mr = parseInt(m_arr[1], 10); + Sr = (MinVl.length > 5 ? parseInt(m_arr[2], 10) : 0); + } + + ret = (H > Hr || (H == Hr && M > Mr) || (H == Hr && M == Mr && S >= Sr)); + if(!ret) { + MaskedEditSetMessage(value, value.MinimumValueMessage, value.MinimumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(MaxVl != "" && ret) { + Hr = -1; + Mr = -1; + Sr = -1; + m_arr = MaxVl.split(AttibTmSep); + matches1 = regex1.exec(MaxVl); + matches2 = regex2.exec(MaxVl); + + if(matches1 && (matches1[0] == MaxVl)) { + aux = MaxVl.substring(MaxVl.length - 2).substring(0, 1); + Hr = parseInt(m_arr[0], 10); + + if(aux.toUpperCase() == SybTm[1].substring(0, 1).toUpperCase()) { + Hr += 12; + + if(Hr == 24) + Hr = 0; + } + + Mr = parseInt(m_arr[1], 10); + Sr = (MaxVl.length > 9 ? parseInt(m_arr[2].substring(0, 2), 10) : 0); + } else if(matches2 && (matches2[0] == MaxVl)) { + Hr = parseInt(m_arr[0], 10); + Mr = parseInt(m_arr[1], 10); + Sr = (MaxVl.length > 5 ? parseInt(m_arr[2], 10) : 0); + } + + ret = (H < Hr || (H == Hr && M < Mr) || (H == Hr && M == Mr && S <= Sr)); + if(!ret) { + MaskedEditSetMessage(value, value.MaximumValueMessage, value.MaximumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + } + + return ret; +} + +function MaskedEditValidatorPartDate(value, mask, MinVl, MaxVl) { + var ret = true, + AttibDtFmt = "MDY"; + + switch(value.DateFormat) { + case "DayMonthYear": + case "DMY": + AttibDtFmt = "DMY"; + break; + case "DayYearMonth": + case "DYM": + AttibDtFmt = "DYM"; + break; + case "MonthDayYear": + case "MDY": + AttibDtFmt = "MDY"; + break; + case "MonthYearDay": + case "MYD": + AttibDtFmt = "MYD"; + break; + case "YearDayMonth": + case "YDM": + AttibDtFmt = "YDM"; + break; + case "YearMonthDay": + case "YMD": + AttibDtFmt = "YMD"; + break; + } + + var AttibDtSep = value.DateSeparator, + m_arrDate = mask.split(AttibDtSep); + + if(parseInt(m_arrDate.length, 10) != 3) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + ret = false; + } + + if(AttibDtFmt.indexOf("D") == -1 || AttibDtFmt.indexOf("M") == -1 || AttibDtFmt.indexOf("Y") == -1) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + ret = false; + } + + var D = -1, + M = -1, + Y = -1; + + if(ret) { + D = parseInt(m_arrDate[AttibDtFmt.indexOf("D")], 10); + M = parseInt(m_arrDate[AttibDtFmt.indexOf("M")], 10); + Y = parseInt(m_arrDate[AttibDtFmt.indexOf("Y")], 10) + ret = (D > 0 && M > 0 && Y > 0 && (D <= [, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][M] || D == 29 && M == 2 && Y % 4 == 0 && (Y % 100 > 0 || Y % 400 == 0))); + } + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + + if(ret && (MaxVl != "" || MinVl != "")) { + var m_arr, + Dr = -1, + Mr = -1, + Yr = -1; + + if(MinVl != "") { + m_arr = MinVl.split(AttibDtSep); + Dr = parseInt(m_arr[AttibDtFmt.indexOf("D")], 10); + Mr = parseInt(m_arr[AttibDtFmt.indexOf("M")], 10); + Yr = parseInt(m_arr[AttibDtFmt.indexOf("Y")], 10); + ret = (Dr > 0 && Mr > 0 && Yr > 0 && Y > Yr || (Y == Yr && M > Mr) || (Y == Yr && M == Mr && D >= Dr)); + + if(!ret) { + MaskedEditSetMessage(value, value.MinimumValueMessage, value.MinimumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(ret && MaxVl != "") { + m_arr = MaxVl.split(AttibDtSep); + Dr = parseInt(m_arr[AttibDtFmt.indexOf("D")], 10); + Mr = parseInt(m_arr[AttibDtFmt.indexOf("M")], 10); + Yr = parseInt(m_arr[AttibDtFmt.indexOf("Y")], 10); + ret = (Dr > 0 && Mr > 0 && Yr > 0 && Y < Yr || (Y == Yr && M < Mr) || (Y == Yr && M == Mr && D <= Dr)); + + if(!ret) { + MaskedEditSetMessage(value, value.MaximumValueMessage, value.MaximumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + } + + return ret; +} + +function MaskedEditValidatorDate(value) { + MaskedEditSetMessage(value, "", ""); + MaskedEditSetCssClass(value, ""); + MaskedEditMessageShow(value, true); + + if(value.IsMaskedEdit == "false") + return true; + + var target = $get(value.TargetValidator); + if(value.ValidEmpty == "false") { + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == value.InitialValue) { + MaskedEditSetMessage(value, value.EmptyValueMessage, value.EmptyValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == "") + return true; + + var ret = true, + mask = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(); + + // regular Exp + if(value.ValidationExpression != "") { + var rx = new RegExp(value.ValidationExpression), + matches = rx.exec(mask); + + ret = (matches != null && mask == matches[0]); + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + ret = MaskedEditValidatorPartDate(value, mask, value.MinimumValue, value.MaximumValue); + if(ret && value.ClientValidationFunction != "") { + var args = { Value: mask, IsValid: true }; + eval(value.ClientValidationFunction + "(value, args);"); + ret = args.IsValid; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(!ret) + MaskedEditMessageShow(value, ret); + + return ret; +} + +// Validator time +function MaskedEditValidatorTime(value) { + MaskedEditSetMessage(value, "", ""); + MaskedEditSetCssClass(value, ""); + MaskedEditMessageShow(value, true); + + if(value.IsMaskedEdit == "false") + return true; + + var target = $get(value.TargetValidator); + if(value.ValidEmpty == "false") { + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == value.InitialValue) { + MaskedEditSetMessage(value, value.EmptyValueMessage, value.EmptyValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == "") + return true; + + var ret = true, + mask = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(); + + // regular Exp + if(value.ValidationExpression != "") { + var rx = new RegExp(value.ValidationExpression), + matches = rx.exec(mask); + + ret = (matches != null && mask == matches[0]); + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + ret = MaskedEditValidatorPartTime(value, mask, value.MinimumValue, value.MaximumValue); + if(ret && value.ClientValidationFunction != "") { + var args = { Value: mask, IsValid: true }; + eval(value.ClientValidationFunction + "(value, args);"); + ret = args.IsValid; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(!ret) + MaskedEditMessageShow(value, ret); + + return ret; +} + +// Validator Number +function MaskedEditValidatorNumber(value) { + MaskedEditSetMessage(value, "", ""); + MaskedEditSetCssClass(value, ""); + MaskedEditMessageShow(value, true); + + if(value.IsMaskedEdit == "false") + return true; + + var target = $get(value.TargetValidator), + numVal = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value().replace(new RegExp("(\[\w_.,\s\$ ])", "g"), ""); + + if(value.ValidEmpty == "false") { + if(numVal == value.InitialValue) { + MaskedEditSetMessage(value, value.EmptyValueMessage, value.EmptyValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + if(numVal == "") + return true; + + var ret = true, + AttibThSep = value.Thousands, + AttibDcSep = value.Decimal, + AttibCuSyb = value.Money, + AttibLastPos = value.LastMaskPosition + AttibCuSyb.length + 1; + + var mask = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(); + + if(value.ValidationExpression != "") { + var rx = new RegExp(value.ValidationExpression), + matches = rx.exec(mask); + + ret = (matches != null && mask == matches[0]); + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + ret = false; + var cleanInput = null, + exp = null, + m = null, + num = null, + Compnum = null; + + mask = mask.replace(new RegExp("(\\" + AttibThSep + ")", "g"), ""); + mask = mask.replace(new RegExp("(\\" + AttibCuSyb + ")", "g"), ""); + + // trim + m = mask.match(/^\s*(\S+(\s+\S+)*)\s*$/); + if(m != null) + mask = m[1]; + + // integer + exp = /^\s*[-\+]?\d+\s*$/; + if(mask.match(exp) != null) { + num = parseInt(mask, 10); + ret = (num == (isNaN(num) ? null : num)); + } + + if(ret) { + if(value.MaximumValue != "") { + Compnum = parseInt(value.MaximumValue, 10); + + if(Compnum == (isNaN(Compnum) ? null : Compnum)) + if(num > Compnum) { + ret = false; + MaskedEditSetMessage(value, value.MaximumValueMessage, value.MaximumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + if(ret && value.MinimumValue != "") { + Compnum = parseInt(value.MinimumValue, 10); + + if(Compnum == (isNaN(Compnum) ? null : Compnum)) + if(num < Compnum) { + ret = false; + MaskedEditSetMessage(value, value.MinimumValueMessage, value.MinimumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + } else { + // float + exp = new RegExp("^\\s*([-\\+])?(\\d+)?(\\" + AttibDcSep + "(\\d+))?\\s*$"); + m = mask.match(exp); + + if(m != null) { + cleanInput = null; + if(typeof (m[1]) != "undefined") + cleanInput = m[1] + (m[2].length > 0 ? m[2] : "0") + "." + m[4]; + else + cleanInput = (m[2].length > 0 ? m[2] : "0") + "." + m[4]; + + num = parseFloat(cleanInput); + ret = (num == (isNaN(num) ? null : num)); + } + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + + if(ret) { + if(value.MaximumValue != "") { + Compnum = parseFloat(value.MaximumValue); + + if(Compnum == (isNaN(Compnum) ? null : Compnum)) + if(num > Compnum) { + ret = false; + MaskedEditSetMessage(value, value.MaximumValueMessage, value.MaximumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(ret && value.MinimumValue != "") { + Compnum = parseFloat(value.MinimumValue); + + if(Compnum == (isNaN(Compnum) ? null : Compnum)) + if(num < Compnum) { + ret = false; + MaskedEditSetMessage(value, value.MinimumValueMessage, value.MinimumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + } + } + + if(ret && value.ClientValidationFunction != "") { + var args = { Value: mask, IsValid: true }; + eval(value.ClientValidationFunction + "(value, args);"); + ret = args.IsValid; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(!ret) + MaskedEditMessageShow(value, ret); + + return ret; +} + +// Validator None +function MaskedEditValidatorNone(value) { + MaskedEditSetMessage(value, "", ""); + MaskedEditSetCssClass(value, ""); + MaskedEditMessageShow(value, true); + + if(value.IsMaskedEdit == "false") + return true; + + var target = $get(value.TargetValidator); + if(value.ValidEmpty == "false") + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == value.InitialValue) { + MaskedEditSetMessage(value, value.EmptyValueMessage, value.EmptyValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value() == "") + return true; + + var ret = true, + mask = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(); + + if(value.ValidationExpression != "") { + var rx = new RegExp(value.ValidationExpression), + matches = rx.exec(mask); + + ret = (matches != null && mask == matches[0]); + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + MaskedEditMessageShow(value, false); + + return false; + } + } + + var exp = /^\d+\s*$/, + num = null; + + if(value.MaximumValue != "") + if(value.MaximumValue.match(exp) != null) { + num = parseInt(value.MaximumValue, 10); + + if(num == (isNaN(num) ? null : num)) + if(mask.length > num) { + ret = false; + MaskedEditSetMessage(value, value.MaximumValueMessage, value.MaximumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(ret && value.MinimumValue != "") + if(value.MinimumValue.match(exp) != null) { + num = parseInt(value.MinimumValue, 10); + + if(num == (isNaN(num) ? null : num)) + if(mask.length < num) { + ret = false; + MaskedEditSetMessage(value, value.MinimumValueMessage, value.MinimumValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(ret && value.ClientValidationFunction != "") { + var args = { Value: mask, IsValid: true }; + eval(value.ClientValidationFunction + "(value, args);"); + ret = args.IsValid; + + if(!ret) { + MaskedEditSetMessage(value, value.InvalidValueMessage, value.InvalidValueText); + MaskedEditSetCssClass(value, value.InvalidValueCssClass); + } + } + + if(!ret) + MaskedEditMessageShow(value, ret); + + return ret; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ModalPopup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ModalPopup.debug.js new file mode 100644 index 000000000..c57b0cce9 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ModalPopup.debug.js @@ -0,0 +1,1134 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ModalPopupRepositionMode = function() { + // The ModalPopupRepositionMode enumeration describes how the modal popup repositions + throw Error.invalidOperation(); +}; + +Sys.Extended.UI.ModalPopupRepositionMode.prototype = { + None: 0, + RepositionOnWindowResize: 1, + RepositionOnWindowScroll: 2, + RepositionOnWindowResizeAndScroll: 3 +}; + +Sys.Extended.UI.ModalPopupRepositionMode.registerEnum('Sys.Extended.UI.ModalPopupRepositionMode'); + +Sys.Extended.UI.ModalPopupBehavior = function(element) { + // The ModalPopupBehavior is used to display the target element as a modal dialog + Sys.Extended.UI.ModalPopupBehavior.initializeBase(this, [element]); + + // Properties + this._popupControlID = null; + this._popupDragHandleControlID = null; + this._backgroundCssClass = null; + this._dropShadow = false; + this._drag = false; + this._okControlID = null; + this._cancelControlID = null; + this._onOkScript = null; + this._onCancelScript = null; + this._xCoordinate = -1; + this._yCoordinate = -1; + this._repositionMode = Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll; + this._onShown = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); //element replaced later with popuptarget + this._onHidden = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); + this._onShowing = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); + this._onHiding = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); + + // Variables + this._backgroundElement = null; + this._foregroundElement = null; + this._relativeOrAbsoluteParentElement = null; + this._popupElement = null; + this._dragHandleElement = null; + this._showHandler = null; + this._okHandler = null; + this._cancelHandler = null; + this._scrollHandler = null; + this._resizeHandler = null; + this._windowHandlersAttached = false; + this._dropShadowBehavior = null; + this._dragBehavior = null; + this._isIE6 = false; + + this._saveTabIndexes = new Array(); + this._saveDesableSelect = new Array(); + this._tagWithTabIndex = new Array('A', 'AREA', 'BUTTON', 'INPUT', 'OBJECT', 'SELECT', 'TEXTAREA', 'IFRAME'); + + this._isAnimationJustEnded = false; + this._hidingAnimationEndedHandler = null; + this._showingAnimationEndedHandler = null; + +}; + +Sys.Extended.UI.ModalPopupBehavior.prototype = { + + initialize: function() { + //
    + Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, 'initialize'); + + this._isIE6 = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7); + if(this._popupDragHandleControlID) + this._dragHandleElement = $get(this._popupDragHandleControlID); + + this._popupElement = $get(this._popupControlID); + if(this._dropShadow) { + this._foregroundElement = document.createElement('div'); + this._foregroundElement.id = this.get_id() + '_foregroundElement'; + this._popupElement.parentNode.appendChild(this._foregroundElement); + this._foregroundElement.appendChild(this._popupElement); + } else { + this._foregroundElement = this._popupElement; + } + + this._backgroundElement = document.createElement('div'); + this._backgroundElement.id = this.get_id() + '_backgroundElement'; + this._backgroundElement.style.display = 'none'; + this._backgroundElement.style.position = 'fixed'; + this._backgroundElement.style.left = '0px'; + this._backgroundElement.style.top = '0px'; + + // Want zIndex to big enough that the background sits above everything else + // CSS 2.1 defines no bounds for the type, so pick arbitrarily + if(this._backgroundCssClass) + this._backgroundElement.className = this._backgroundCssClass; + + this._foregroundElement.parentNode.appendChild(this._backgroundElement); + this._foregroundElement.style.display = 'none'; + this._foregroundElement.style.position = 'fixed'; + + this._showHandler = Function.createDelegate(this, this._onShow); + $addHandler(this.get_element(), 'click', this._showHandler); + + if(this._okControlID) { + this._okHandler = Function.createDelegate(this, this._onOk); + $addHandler($get(this._okControlID), 'click', this._okHandler); + } + + if(this._cancelControlID) { + this._cancelHandler = Function.createDelegate(this, this._onCancel); + $addHandler($get(this._cancelControlID), 'click', this._cancelHandler); + } + + this._scrollHandler = Function.createDelegate(this, this._onLayout); + this._resizeHandler = Function.createDelegate(this, this._onLayout); + + // Need to know when partial updates complete + this.registerPartialUpdateEvents(); + + // We initally set it to the element, but needs to be targeted at + // the popup contorl + this._resetAnimationsTarget(); + + // attach to animation end events to signal hiding animation completed + // an call hide()/show() to hide/show the popup. + if(this._onHiding.get_animation()) { + this._hidingAnimationEndedHandler = Function.createDelegate(this, function() { + this._isAnimationJustEnded = true; + this.hide(); + }); + this._onHiding.get_animation().add_ended(this._hidingAnimationEndedHandler); + } + + if(this._onShowing.get_animation()) { + this._showingAnimationEndedHandler = Function.createDelegate(this, function() { + this._isAnimationJustEnded = true; + this.show(); + }); + this._onShowing.get_animation().add_ended(this._showingAnimationEndedHandler); + } + }, + + dispose: function() { + // Going away; restore any changes to the page + this._hideImplementation(); + + if(this._foregroundElement && this._foregroundElement.parentNode) { + // Remove background we added to the DOM + this._foregroundElement.parentNode.removeChild(this._backgroundElement); + + if(this._dropShadow) { + // Remove DIV wrapper added in initialize + this._foregroundElement.parentNode.appendChild(this._popupElement); + this._foregroundElement.parentNode.removeChild(this._foregroundElement); + } + } + + this._scrollHandler = null; + this._resizeHandler = null; + + if(this._cancelHandler && $get(this._cancelControlID)) { + $removeHandler($get(this._cancelControlID), 'click', this._cancelHandler); + this._cancelHandler = null; + } + + if(this._okHandler && $get(this._okControlID)) { + $removeHandler($get(this._okControlID), 'click', this._okHandler); + this._okHandler = null; + } + + if(this._showHandler) { + $removeHandler(this.get_element(), 'click', this._showHandler); + this._showHandler = null; + } + + if(this._hidingAnimationEndedHandler) { + this._onHiding.get_animation().remove_ended(this._hidingAnimationEndedHandler); + } + + if(this._showingAnimationEndedHandler) { + this._onShowing.get_animation().remove_ended(this._showingAnimationEndedHandler); + } + + Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, 'dispose'); + }, + + _attachPopup: function() { + if(this._dropShadow && !this._dropShadowBehavior) + this._dropShadowBehavior = $create(Sys.Extended.UI.DropShadowBehavior, {}, null, null, this._popupElement); + + if(this._dragHandleElement && !this._dragBehavior) + this._dragBehavior = $create(Sys.Extended.UI.FloatingBehavior, { "handle": this._dragHandleElement }, null, null, this._foregroundElement); + + $addHandler(window, 'resize', this._resizeHandler); + $addHandler(window, 'scroll', this._scrollHandler); + + this._windowHandlersAttached = true; + }, + + _detachPopup: function() { + if(this._windowHandlersAttached) { + if(this._scrollHandler) + $removeHandler(window, 'scroll', this._scrollHandler); + + if(this._resizeHandler) + $removeHandler(window, 'resize', this._resizeHandler); + + this._windowHandlersAttached = false; + } + + if(this._dragBehavior) { + this._dragBehavior.dispose(); + this._dragBehavior = null; + } + + if(this._dropShadowBehavior) { + this._dropShadowBehavior.dispose(); + this._dropShadowBehavior = null; + } + }, + + _onShow: function(e) { + // Handler for the target's click event + if(!this.get_element().disabled) { + this.show(); + e.preventDefault(); + + return false; + } + }, + + _onOk: function(e) { + // Handler for the modal dialog's OK button click + var element = $get(this._okControlID); + + if(element && !element.disabled) { + if(this.hide() && this._onOkScript) + window.setTimeout(this._onOkScript, 0); + + e.preventDefault(); + + return false; + } + }, + + _onCancel: function(e) { + // Handler for the modal dialog's Cancel button click + var element = $get(this._cancelControlID); + + if(element && !element.disabled) { + if(this.hide() && this._onCancelScript) + window.setTimeout(this._onCancelScript, 0); + + e.preventDefault(); + + return false; + } + }, + + _onLayout: function(e) { + // Handler for scrolling and resizing events that would require a repositioning of the modal dialog + var positioning = this.get_repositionMode(); + + if(((positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowScroll) || + (positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)) && (e.type === 'scroll')) { + this._layout(); + } else if(((positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResize) || + (positioning === Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)) && (e.type === 'resize')) { + this._layout(); + } else { + // Layout background element again to make sure it covers the whole background. + // This needs to be called separately since _layout will not be always called + // to reposition the popup depending on the RepositionMode but the background needs + // to handle the resize/scroll every time. + this._layoutBackgroundElement(); + } + }, + + /// + /// Displays an element that is referenced by the PopupControlID property as a modal dialog box + /// + /// + show: function() { + // Display the element referenced by PopupControlID as a modal dialog + if(!this._isAnimationJustEnded) { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + + if(eventArgs.get_cancel()) { + return; + } else if(this._onShowing.get_animation()) { + this._onShowing.play(); + return; + } + } else { + this._isAnimationJustEnded = false; + } + + var zindex = 10000 + (Sys.Extended.UI.ModalPopupBehavior._openCount++ * 1000); + this._showing = true; + this._backgroundElement.style.zIndex = zindex; + this._foregroundElement.style.zIndex = zindex + 1; + + this.populate(); + this._attachPopup(); + + this._backgroundElement.style.display = ''; + this._foregroundElement.style.display = ''; + this._popupElement.style.display = ''; + + if(this._isIE6) { + this._foregroundElement.style.position = 'absolute'; + this._backgroundElement.style.position = 'absolute'; + + // find the relative or absolute parent + var tempRelativeOrAbsoluteParent = this._foregroundElement.parentNode; + while(tempRelativeOrAbsoluteParent && (tempRelativeOrAbsoluteParent != document.documentElement)) { + if((tempRelativeOrAbsoluteParent.style.position != 'relative') && (tempRelativeOrAbsoluteParent.style.position != 'absolute')) { + tempRelativeOrAbsoluteParent = tempRelativeOrAbsoluteParent.parentNode; + } else { + this._relativeOrAbsoluteParentElement = tempRelativeOrAbsoluteParent; + break; + } + } + } + + + // Disable TAB + this.disableTab(); + + this._layout(); + // On pages that don't need scrollbars, Firefox and Safari act like + // one or both are present the first time the layout code runs which + // obviously leads to display issues - run the layout code a second + // time to work around this problem + this._layout(); + + this.raise_shown(Sys.EventArgs.Empty); + + this._onShown.play(); + }, + + /// + /// Changes tab indices so that tabbing moves focus only through the modal dialog box + /// + /// + disableTab: function() { + // Change the tab indices so we only tab through the modal popup + // (and hide SELECT tags in IE6) + + var i = 0, + tagElements, + tagElementsInPopUp = new Array(); + + Array.clear(this._saveTabIndexes); + + //Save all popup's tag in tagElementsInPopUp + for(var j = 0; j < this._tagWithTabIndex.length; j++) { + tagElements = this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]); + + for(var k = 0; k < tagElements.length; k++) { + tagElementsInPopUp[i] = tagElements[k]; + i++; + } + } + + i = 0; + for(var j = 0; j < this._tagWithTabIndex.length; j++) { + tagElements = document.getElementsByTagName(this._tagWithTabIndex[j]); + + for(var k = 0; k < tagElements.length; k++) { + if(Array.indexOf(tagElementsInPopUp, tagElements[k]) == -1) { + this._saveTabIndexes[i++] = { tag: tagElements[k], index: tagElements[k].tabIndex }; + tagElements[k].tabIndex = "-1"; + } + } + } + + //IE6 Bug with SELECT element always showing up on top + i = 0; + if((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) { + //Save SELECT in PopUp + var tagSelectInPopUp = new Array(); + + for(var j = 0; j < this._tagWithTabIndex.length; j++) { + tagElements = this._foregroundElement.getElementsByTagName('SELECT'); + + for(var k = 0; k < tagElements.length; k++) { + tagSelectInPopUp[i] = tagElements[k]; + i++; + } + } + + i = 0; + Array.clear(this._saveDesableSelect); + tagElements = document.getElementsByTagName('SELECT'); + + for(var k = 0; k < tagElements.length; k++) + if(Array.indexOf(tagSelectInPopUp, tagElements[k]) == -1) { + this._saveDesableSelect[i++] = { tag: tagElements[k], visib: $common.getCurrentStyle(tagElements[k], 'visibility') }; + tagElements[k].style.visibility = 'hidden'; + } + } + }, + + /// + /// Restores tab indices from the page + /// + /// + restoreTab: function() { + // Restore the tab indices so we tab through the page like normal + // (and restore SELECT tags in IE6) + for(var i = 0; i < this._saveTabIndexes.length; i++) { + this._saveTabIndexes[i].tag.tabIndex = this._saveTabIndexes[i].index; + } + Array.clear(this._saveTabIndexes); + + //IE6 Bug with SELECT element always showing up on top + if((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) { + for(var k = 0; k < this._saveDesableSelect.length; k++) + this._saveDesableSelect[k].tag.style.visibility = this._saveDesableSelect[k].visib; + + Array.clear(this._saveDesableSelect); + } + }, + + /// + /// Hides an element that is referenced by the PopupControlID property + /// + /// Whether the popup was hidden + /// + hide: function() { + // Hide the modal dialog + if(!this._isAnimationJustEnded) { + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + + if(eventArgs.get_cancel()) + return false; + else if(this._onHiding.get_animation()) { + this._onHiding.play(); + return true; + } + } else { + this._isAnimationJustEnded = false; + } + + this._hideImplementation(); + this.raise_hidden(Sys.EventArgs.Empty); + this._onHidden.play(); + + return true; + }, + + _hideImplementation: function() { + // Internal implementation to hide the modal dialog + Sys.Extended.UI.ModalPopupBehavior._openCount--; + this._backgroundElement.style.display = 'none'; + this._foregroundElement.style.display = 'none'; + + this.restoreTab(); + this._detachPopup(); + }, + + _layout: function() { + var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft), + scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); + + var clientBounds = $common.getClientBounds(), + clientWidth = clientBounds.width, + clientHeight = clientBounds.height; + + // Setup the location of the background element + this._layoutBackgroundElement(); + + var xCoord = 0; + var yCoord = 0; + if(this._xCoordinate < 0) { + var foregroundelementwidth = this._foregroundElement.offsetWidth ? this._foregroundElement.offsetWidth : this._foregroundElement.scrollWidth; + xCoord = ((clientWidth - foregroundelementwidth) / 2); + + // workaround for drag behavior which calls setlocation which in turn + // changes the position of the panel to be absolute and requiring us + // to add the scrollLeft so that it is positioned correctly. + if(this._foregroundElement.style.position == 'absolute') + xCoord += scrollLeft; + + this._foregroundElement.style.left = xCoord + 'px'; + } else { + if(this._isIE6) { + this._foregroundElement.style.left = (this._xCoordinate + scrollLeft) + 'px'; + xCoord = this._xCoordinate + scrollLeft; + } else { + this._foregroundElement.style.left = this._xCoordinate + 'px'; + xCoord = this._xCoordinate; + } + } + + if(this._yCoordinate < 0) { + var foregroundelementheight = this._foregroundElement.offsetHeight ? this._foregroundElement.offsetHeight : this._foregroundElement.scrollHeight; + yCoord = ((clientHeight - foregroundelementheight) / 2); + + // workaround for drag behavior which calls setlocation which in turn + // changes the position of the panel to be absolute and requiring us + // to add the scrollLeft so that it is positioned correctly. + if(this._foregroundElement.style.position == 'absolute') + yCoord += scrollTop; + + this._foregroundElement.style.top = yCoord + 'px'; + } else { + if(this._isIE6) { + this._foregroundElement.style.top = (this._yCoordinate + scrollTop) + 'px'; + yCoord = this._yCoordinate + scrollTop; + } else { + this._foregroundElement.style.top = this._yCoordinate + 'px'; + yCoord = this._yCoordinate; + } + } + + // make sure get location agrees with the location of the foreground element + this._layoutForegroundElement(xCoord, yCoord); + + if(this._dropShadowBehavior) { + this._dropShadowBehavior.setShadow(); + window.setTimeout(Function.createDelegate(this, this._fixupDropShadowBehavior), 0); + } + + // layout background element again to make sure it covers the whole background + // in case things moved around when laying out the foreground element + this._layoutBackgroundElement(); + }, + + _layoutForegroundElement: function(xCoord, yCoord) { + // Set the correct location of the foreground element to ensure that it is absolutely + // positioned with respect to the browser. This is just a workaround for IE 6 since + // elements nested in relative parents cause modal popup positioning issues and 'fixed' + // is not supported by IE 6. Hence we manually compute the right location of the popup. + + if(this._isIE6 && this._relativeOrAbsoluteParentElement) { + var foregroundLocation = $common.getLocation(this._foregroundElement), + relativeParentLocation = $common.getLocation(this._relativeOrAbsoluteParentElement), + getLocationXCoord = foregroundLocation.x; + + if(getLocationXCoord != xCoord) + // offset it by that amount + this._foregroundElement.style.left = (xCoord - relativeParentLocation.x) + 'px'; + + var getLocationYCoord = foregroundLocation.y; + if(getLocationYCoord != yCoord) + // offset it by that amount + this._foregroundElement.style.top = (yCoord - relativeParentLocation.y) + 'px'; + } + }, + + _layoutBackgroundElement: function() { + // Set the correct location of the background element to ensure that it is absolutely + // positioned with respect to the browser. + + // Background element needs to cover the visible client area completely hence its + // top and left coordinates need to be 0, and if relatively positioned its getlocation + // value needs to be 0. + if(this._isIE6) { + var backgroundLocation = $common.getLocation(this._backgroundElement), + backgroundXCoord = backgroundLocation.x; + + if(backgroundXCoord != 0) + // offset it by that amount. This is assuming only one level of nesting. If + // multiple parents with absolute/relative positioning are setup this may not + // cover the whole background. + this._backgroundElement.style.left = (-backgroundXCoord) + 'px'; + + var backgroundYCoord = backgroundLocation.y; + if(backgroundYCoord != 0) + // offset it by that amount. This is assuming only one level of nesting. If + // multiple parents with absolute/relative positioning are setup this may not + // cover the whole background. + this._backgroundElement.style.top = (-backgroundYCoord) + 'px'; + } + + var clientBounds = $common.getClientBounds(), + clientWidth = clientBounds.width, + clientHeight = clientBounds.height; + + this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth) + 'px'; + this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight) + 'px'; + }, + + _fixupDropShadowBehavior: function() { + // Some browsers don't update the location values immediately, so + // the location of the drop shadow would always be a step behind + // without this method + if(this._dropShadowBehavior) + this._dropShadowBehavior.setShadow(); + }, + + _partialUpdateEndRequest: function(sender, endRequestEventArgs) { + // Show the popup if requested during a partial postback + Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]); + + if(this.get_element()) { + // Look up result by element's ID + var action = endRequestEventArgs.get_dataItems()[this.get_element().id]; + + if("show" == action) + this.show(); + else if("hide" == action) + this.hide(); + } + + // Async postback may have added content; re-layout to accomodate it + this._layout(); + }, + + _onPopulated: function(sender, eventArgs) { + // Re-layout the popup after we've dynamically populated + Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]); + + // Dynamic populate may have added content; re-layout to accomodate it + this._layout(); + }, + + _replaceAnimationTarget: function(memberName, target) { + var json = this[memberName].get_json(); + + this[memberName] = new Sys.Extended.UI.Animation.GenericAnimationBehavior(target); + this[memberName].set_json(json); + this[memberName].initialize(); + }, + + _resetAnimationsTarget: function() { + var target = $get(this.get_popupControlID()); + + this._replaceAnimationTarget('_onShowing', target); + this._replaceAnimationTarget('_onShown', target); + this._replaceAnimationTarget('_onHiding', target); + this._replaceAnimationTarget('_onHidden', target); + }, + + /// + /// ID of an element to display as a modal popup + /// + /// get_popupControlID + /// set_popupControlID + /// + get_popupControlID: function() { + return this._popupControlID; + }, + set_popupControlID: function(value) { + if(this._popupControlID != value) { + this._popupControlID = value; + this.raisePropertyChanged('popupControlID'); + } + }, + + get_PopupControlID: function() { + Sys.Extended.Deprecated("get_PopupControlID()", "get_popupControlID()"); + return this.get_popupControlID(); + }, + set_PopupControlID: function(value) { + Sys.Extended.Deprecated("set_PopupControlID(value)", "set_popupControlID(value)"); + this.set_popupControlID(value); + }, + + /// + /// The distance from the left side of the modal popup to the left border of the browser window in pixels + /// + /// get_x + /// set_x + /// + get_x: function() { + return this._xCoordinate; + }, + set_x: function(value) { + if(this._xCoordinate != value) { + this._xCoordinate = value; + this.raisePropertyChanged('x'); + } + }, + + get_X: function() { + Sys.Extended.Deprecated("get_X()", "get_x()"); + return this.get_x(); + }, + set_X: function(value) { + Sys.Extended.Deprecated("set_X(value)", "set_x(value)"); + this.set_x(value); + }, + + /// + /// The distance from the top side of the modal popup to the top border of the browser window in pixels + /// + /// get_y + /// set_y + /// + get_y: function() { + return this._yCoordinate; + }, + set_y: function(value) { + if(this._yCoordinate != value) { + this._yCoordinate = value; + this.raisePropertyChanged('y'); + } + }, + + get_Y: function() { + Sys.Extended.Deprecated("get_Y()", "get_y()"); + return this.get_y(); + }, + set_Y: function(value) { + Sys.Extended.Deprecated("set_Y(value)", "set_y(value)"); + this.set_y(value); + }, + + /// + /// ID of an element to display as a drag handle for the modal popup + /// + /// get_popupDragHandleControlID + /// set_popupDragHandleControlID + /// + get_popupDragHandleControlID: function() { + return this._popupDragHandleControlID; + }, + set_popupDragHandleControlID: function(value) { + if(this._popupDragHandleControlID != value) { + this._popupDragHandleControlID = value; + this.raisePropertyChanged('popupDragHandleControlID'); + } + }, + + get_PopupDragHandleControlID: function() { + Sys.Extended.Deprecated("get_PopupDragHandleControlID()", "get_popupDragHandleControlID()"); + return this.get_popupDragHandleControlID(); + }, + set_PopupDragHandleControlID: function(value) { + Sys.Extended.Deprecated("set_PopupDragHandleControlID(value)", "set_popupDragHandleControlID(value)"); + this.set_popupDragHandleControlID(value); + }, + + /// + /// A CSS class to apply to the background when the modal popup is displayed + /// + /// get_backgroundCssClass + /// set_backgroundCssClass + /// + get_backgroundCssClass: function() { + return this._backgroundCssClass; + }, + set_backgroundCssClass: function(value) { + if(this._backgroundCssClass != value) { + this._backgroundCssClass = value; + this.raisePropertyChanged('backgroundCssClass'); + } + }, + + get_BackgroundCssClass: function() { + Sys.Extended.Deprecated("get_BackgroundCssClass()", "get_backgroundCssClass()"); + return this.get_backgroundCssClass(); + }, + set_BackgroundCssClass: function(value) { + Sys.Extended.Deprecated("set_BackgroundCssClass(value)", "set_backgroundCssClass(value)"); + this.set_backgroundCssClass(value); + }, + + /// + /// A Boolean value that specifies whether or not a drop shadow should be added to the modal popup + /// + /// get_dropShadow + /// set_dropShadow + /// + get_dropShadow: function() { + return this._dropShadow; + }, + set_dropShadow: function(value) { + if(this._dropShadow != value) { + this._dropShadow = value; + this.raisePropertyChanged('dropShadow'); + } + }, + + get_DropShadow: function() { + Sys.Extended.Deprecated("get_DropShadow()", "get_dropShadow()"); + return this.get_dropShadow(); + }, + set_DropShadow: function(value) { + Sys.Extended.Deprecated("set_DropShadow(value)", "set_dropShadow(value)"); + this.set_dropShadow(value); + }, + + /// + /// A Boolean value that specifies whether or not the modal popup can be dragged + /// + /// + /// This property is obsolete. + /// + /// get_drag + /// set_drag + /// + get_drag: function() { + // Obsolete: Setting the _drag property is a noop + return this._drag; + }, + set_drag: function(value) { + if(this._drag != value) { + this._drag = value; + this.raisePropertyChanged('drag'); + } + }, + + get_Drag: function() { + Sys.Extended.Deprecated("get_Drag()", "get_drag()"); + return this.get_drag(); + }, + set_Drag: function(value) { + Sys.Extended.Deprecated("set_Drag(value)", "set_drag(value)"); + this.set_drag(value); + }, + + /// + /// ID of an element that dismisses the modal popup + /// + /// get_okControlID + /// set_okControlID + /// + get_okControlID: function() { + return this._okControlID; + }, + set_okControlID: function(value) { + if(this._okControlID != value) { + this._okControlID = value; + this.raisePropertyChanged('okControlID'); + } + }, + + get_OkControlID: function() { + Sys.Extended.Deprecated("get_OkControlID()", "get_okControlID()"); + return this.get_okControlID(); + }, + set_OkControlID: function(value) { + Sys.Extended.Deprecated("set_OkControlID(value)", "set_okControlID(value)"); + this.set_okControlID(value); + }, + + /// + /// ID of an element that cancels the modal popup + /// + /// get_cancelControlID + /// set_cancelControlID + /// + get_cancelControlID: function() { + return this._cancelControlID; + }, + set_cancelControlID: function(value) { + if(this._cancelControlID != value) { + this._cancelControlID = value; + this.raisePropertyChanged('cancelControlID'); + } + }, + + get_CancelControlID: function() { + Sys.Extended.Deprecated("get_CancelControlID()", "get_cancelControlID()"); + return this.get_cancelControlID(); + }, + set_CancelControlID: function(value) { + Sys.Extended.Deprecated("set_CancelControlID(value)", "set_cancelControlID(value)"); + this.set_cancelControlID(value); + }, + + /// + /// A script to run when the modal popup is dismissed by the element specified using the okControlID property + /// + /// get_onOkScript + /// set_onOkScript + /// + get_onOkScript: function() { + return this._onOkScript; + }, + set_onOkScript: function(value) { + if(this._onOkScript != value) { + this._onOkScript = value; + this.raisePropertyChanged('onOkScript'); + } + }, + + get_OnOkScript: function() { + Sys.Extended.Deprecated("get_OnOkScript()", "get_onOkScript()"); + return this.get_onOkScript(); + }, + set_OnOkScript: function(value) { + Sys.Extended.Deprecated("set_OnOkScript(value)", "set_onOkScript(value)"); + this.set_onOkScript(value); + }, + + /// + /// A script to run when the modal popup is dismissed by the element specified using the cancelControlID property + /// + /// get_onCancelScript + /// set_onCancelScript + /// + get_onCancelScript: function() { + return this._onCancelScript; + }, + set_onCancelScript: function(value) { + if(this._onCancelScript != value) { + this._onCancelScript = value; + this.raisePropertyChanged('onCancelScript'); + } + }, + + get_OnCancelScript: function() { + Sys.Extended.Deprecated("get_OnCancelScript()", "get_onCancelScript()"); + return this.get_onCancelScript(); + }, + set_OnCancelScript: function(value) { + Sys.Extended.Deprecated("set_OnCancelScript(value)", "set_onCancelScript(value)"); + this.set_onCancelScript(value); + }, + + /// + /// The Sys.Extended.UI.ModalPopupRepositionMode object that determines whether the modal + /// popup should be repositioned on window resize or scroll + /// + /// get_repositionMode + /// set_repositionMode + /// + get_repositionMode: function() { + return this._repositionMode; + }, + set_repositionMode: function(value) { + if(this._repositionMode !== value) { + this._repositionMode = value; + this.raisePropertyChanged('repositionMode'); + } + }, + + /// + /// A JSON definition of generic OnShowing Animation. Played before the Popup is being shown + /// + /// get_onShowing + /// set_onShowing + /// + get_onShowing: function() { + return this._onShowing.get_json(); + }, + set_onShowing: function(value) { + this._onShowing.set_json(value); + this.raisePropertyChanged('onShowing'); + }, + + get_OnShowing: function() { + Sys.Extended.Deprecated("get_OnShowing()", "get_onShowing()"); + return this.get_onShowing(); + }, + set_OnShowing: function(value) { + Sys.Extended.Deprecated("set_OnShowing(value)", "set_onShowing(value)"); + this.set_onShowing(value); + }, + + /// + /// A JSON definition of generic OnShowing Animation. Played before the Popup is shown + /// + /// get_onShown + /// set_onShown + /// + get_onShown: function() { + return this._onShown.get_json(); + }, + set_onShown: function(value) { + this._onShown.set_json(value); + this.raisePropertyChanged('onShown'); + }, + + get_OnShown: function() { + Sys.Extended.Deprecated("get_OnShown()", "get_onShown()"); + return this.get_onShown(); + }, + set_OnShown: function(value) { + Sys.Extended.Deprecated("set_OnShown(value)", "set_onShown(value)"); + this.set_onShown(value); + }, + + /// + /// A JSON definition of generic OnShowing Animation. Played before the Popup is being hidden + /// + /// get_onHiding + /// set_onHiding + /// + get_onHiding: function() { + return this._onHiding.get_json(); + }, + set_onHiding: function(value) { + this._onHiding.set_json(value); + this.raisePropertyChanged('onHiding'); + }, + + get_OnHiding: function() { + Sys.Extended.Deprecated("get_OnHiding()", "get_onHiding()"); + return this.get_onHiding(); + }, + set_OnHiding: function(value) { + Sys.Extended.Deprecated("set_OnHiding(value)", "set_onHiding(value)"); + this.set_onHiding(value); + }, + + /// + /// A JSON definition of generic OnShowing Animation. Played before the Popup is hidden + /// + /// get_onHidden + /// set_onHidden + /// + get_onHidden: function() { + return this._onHidden.get_json(); + }, + set_onHidden: function(value) { + this._onHidden.set_json(value); + this.raisePropertyChanged('onHidden'); + }, + + get_OnHidden: function() { + Sys.Extended.Deprecated("get_OnHidden()", "get_onHidden()"); + return this.get_onHidden(); + }, + set_OnHidden: function(value) { + Sys.Extended.Deprecated("set_OnHidden(value)", "set_onHidden(value)"); + this.set_onHidden(value); + }, + + /// + /// Fires when the popup is being shown + /// + /// + /// + add_showing: function(handler) { + // Add an event handler for the showing event + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + // Remove an event handler from the showing event + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + + if(handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires when the popup is shown + /// + /// + /// + add_shown: function(handler) { + this.get_events().addHandler('shown', handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler('shown', handler); + }, + raise_shown: function(eventArgs) { + var handler = this.get_events().getHandler('shown'); + + if(handler) + handler(this, eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Fires when the popup is being hidden + /// + /// + /// + add_hiding: function(handler) { + this.get_events().addHandler('hiding', handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler('hiding', handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + + if(handler) + handler(this, eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Fires when the popup is hidden + /// + /// + /// + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + + if(handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + } +}; + +Sys.Extended.UI.ModalPopupBehavior.registerClass('Sys.Extended.UI.ModalPopupBehavior', Sys.Extended.UI.DynamicPopulateBehaviorBase); +Sys.Extended.UI.ModalPopupBehavior._openCount = 0; + +Sys.Extended.UI.ModalPopupBehavior.invokeViaServer = function(behaviorID, show) { + // This static function (that is intended to be called from script emitted + // on the server) will show or hide the behavior associated with behaviorID + // (i.e. to use this, the ModalPopupExtender must have an ID or BehaviorID) and + // will either show or hide depending on the show parameter. + var behavior = $find(behaviorID); + + if(behavior) { + if(show) + behavior.show(); + else + behavior.hide(); + } +}; diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MultiHandleSlider.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MultiHandleSlider.debug.js new file mode 100644 index 000000000..beddc489b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MultiHandleSlider.debug.js @@ -0,0 +1,2075 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI._MultiHandleSliderDragDropInternal = function() { + Sys.Extended.UI._MultiHandleSliderDragDropInternal.initializeBase(this); + this._instance = null; +}; + +Sys.Extended.UI._MultiHandleSliderDragDropInternal.prototype = { + _getInstance: function() { + // Do not use singleton pattern here; it will break the DragDropScripts.js implementation! + this._instance = new Sys.Extended.UI.GenericDragDropManager(); + this._instance.initialize(); + this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart)); + this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop)); + + return this._instance; + } +}; + +Sys.Extended.UI._MultiHandleSliderDragDropInternal.registerClass('Sys.Extended.UI._MultiHandleSliderDragDropInternal', Sys.Extended.UI._DragDropManager); +Sys.Extended.UI.DragDrop = new Sys.Extended.UI._MultiHandleSliderDragDropInternal(); + +Sys.Extended.UI.MultiHandleInnerRailStyle = function() { +}; + +Sys.Extended.UI.MultiHandleInnerRailStyle.prototype = { + AsIs: 0, + SlidingDoors: 1 +}; + +Sys.Extended.UI.MultiHandleInnerRailStyle.registerEnum('Sys.Extended.UI.MultiHandleInnerRailStyle', false); + +Sys.Extended.UI.MultiHandleSliderOrientation = function() { +}; + +Sys.Extended.UI.MultiHandleSliderOrientation.prototype = { + Horizontal: 0, + Vertical: 1 +}; + +Sys.Extended.UI.MultiHandleSliderOrientation.registerEnum('Sys.Extended.UI.MultiHandleSliderOrientation', false); + +Sys.Extended.UI.MultiHandleSliderBehavior = function(element) { + // A behavior that attaches a multi-handled slider to a TextBox control. + + Sys.Extended.UI.MultiHandleSliderBehavior.initializeBase(this, [element]); + + // Extender Properties + this._isServerControl = false; + this._minimum = null; + this._maximum = null; + this._orientation = Sys.Extended.UI.MultiHandleSliderOrientation.Horizontal; + this._cssClass = null; + this._multiHandleSliderTargets = null; + this._length = 150; + this._steps = 0; + this._enableHandleAnimation = false; + this._showInnerRail = false; + this._showHoverStyle = false; + this._showDragStyle = false; + this._raiseChangeOnlyOnMouseUp = true; + this._innerRailStyle = Sys.Extended.UI.MultiHandleInnerRailStyle.AsIs; + this._enableInnerRangeDrag = false; + this._enableRailClick = true; + this._isReadOnly = false; + this._increment = 1; + this._enableKeyboard = true; + this._enableMouseWheel = true; + this._tooltipText = ''; + + // Backwards-compatibility Properties + this._boundControlID = null; + this._handleCssClass = null; + this._handleImageUrl = null; + this._handleImage = null; + this._railCssClass = null; + this._decimals = 0; + + // Private Fields + this._textBox = null; + this._wrapper = null; + this._outer = null; + this._inner = null; + this._handleData = null; + this._handleAnimationDuration = 0.02; + this._handles = 0; + this._innerDragFlag = false; + this._isVertical = false; + + // Global Handlers + this._selectStartHandler = null; + this._mouseUpHandler = null; + this._mouseOutHandler = null; + this._keyDownHandler = null; + this._mouseWheelHandler = null; + this._mouseOverHandler = null; + + // Callbacks + + // State + this._animationPending = false; + this._selectStartPending = false; + this._initialized = false; + this._handleUnderDrag = null; + this._innerDrag = false; + this._blockInnerClick = false; +}; + +Sys.Extended.UI.MultiHandleSliderBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.MultiHandleSliderBehavior.callBaseMethod(this, 'initialize'); + + // Determine internal variables from configuration + if(this._boundControlID && !this._multiHandleSliderTargets) { + // Backwards compatibility support for upgrading existing SliderExtenders + this._multiHandleSliderTargets = [{ + "ControlID": this._boundControlID, + "HandleCssClass": this._handleCssClass, + "HandleImageUrl": this._handleImageUrl, + "Decimals": this._decimals + }]; + } + + this._handles = this._multiHandleSliderTargets ? this._multiHandleSliderTargets.length : 0; + if(this._handles === 0) { + // Support a boundless extender + var boundless = document.createElement("INPUT"); + boundless.id = "boundless"; + boundless.style.display = "none"; + boundless.value = this.get_minimum(); + document.forms[0].appendChild(boundless); + + this._multiHandleSliderTargets = [{ + "ControlID": boundless.id, + "HandleCssClass": this._handleCssClass, + "HandleImageUrl": this._handleImageUrl, + "Decimals": this._decimals + }]; + this._boundControlID = boundless.id; + this._handles = 1; + } + + this._isVertical = this._orientation === Sys.Extended.UI.MultiHandleSliderOrientation.Vertical; + + this._resolveNamingContainer(); + this._createWrapper(); + this._createOuterRail(); + this._createHandles(); + this._createInnerRail(); + this._setRailStyles(); + + if(this._length) + if(!this._cssClass && this._innerRailStyle !== Sys.Extended.UI.MultiHandleInnerRailStyle.SlidingDoors) + if(this._isVertical) + this._outer.style.height = this._length + "px"; + else + this._outer.style.width = this._length + "px"; + + this._build(); + this._enforceElementPositioning(); + this._initializeSlider(); + }, + + // Public Methods + + dispose: function() { + this._disposeHandlers(); + this._disposeMultiHandleSliderTargets(); + + if(this._enableHandleAnimation && this._handleAnimation) + this._handleAnimation.dispose(); + + Sys.Extended.UI.MultiHandleSliderBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Determines whether or not this slider is initialized + /// + /// + /// For backward compatibility with the original slider + /// + /// get_sliderInitialized + /// + get_sliderInitialized: function() { + return this._initialized; + }, + get_SliderInitialized: function() { + Sys.Extended.Deprecated("get_SliderInitialized()", "get_sliderInitialized()"); + return this.get_sliderInitialized(); + }, + + /// + /// Returns a value of a specific slider handle programmatically by index + /// + /// Handle index + /// Slider handle value + /// + getValue: function(index) { + var multiHandleSliderTarget = $get(this._multiHandleSliderTargets[index].ControlID); + return multiHandleSliderTarget.value; + }, + + /// + /// Sets a value of a specific slider handle programmatically by index + /// + /// Handle index + /// Value + /// + setValue: function(index, value) { + var multiHandleSliderTarget = $get(this._multiHandleSliderTargets[index].ControlID); + if(multiHandleSliderTarget) { + this.beginUpdate(); + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, this._getNearestStepValue(value)); + this.endUpdate(); + } + }, + + /// + /// A list of all handle values as a comma-delimited string + /// + /// + /// This is required for automated toolkit test behavior. + /// Returns a comma-delimited string of handle values + /// + /// get_values + /// + get_values: function() { + var values = [this._handles]; + for(var i = 0; i < this._handles; i++) { + var control = this._multiHandleSliderTargets[i]; + values[i] = control.value; + } + + return values.join(','); + }, + + // Private Methods + + _build: function() { + // Assembles the generated slider DOM elements on the page. + + this._textBox = this.get_element(); + this._textBox.parentNode.insertBefore(this._wrapper, this._textBox); + this._wrapper.appendChild(this._outer); + + if(this._inner && this._showInnerRail) + this._outer.appendChild(this._inner); + + this._textBox.style.display = 'none'; + }, + + _calculateInnerRailOffset: function(e) { + // Calculates the offset of the inner rail. + + var edge = this._isVertical ? this._inner.style.top : this._inner.style.left; + var offset = this._isVertical ? e.offsetY : e.offsetX; + offset += parseInt(edge, 10); + + return offset; + }, + + _calculateClick: function(offset) { + // Calculates where to move a handle during a rail click event. + + var railBounds = this._getOuterBounds(), + closestHandle = this._handleData[0]; + + var handleBounds = this._getBoundsInternal(closestHandle); + closestHandle = this._calculateClosestHandle(offset); + + var minOffset = handleBounds.width / 2, + maxOffset = railBounds.width - minOffset; + + offset = (offset < minOffset) ? minOffset : (offset > maxOffset) ? maxOffset : offset; + + var multiHandleSliderTarget = $get(closestHandle.multiHandleSliderTargetID); + this._calculateMultiHandleSliderTargetValue(multiHandleSliderTarget, offset, true); + $common.tryFireEvent(this.get_element(), "change"); + }, + + _calculateClosestHandle: function(offset) { + // Calculates the closest handle to a mouse click. + + var closestHandle = this._handleData[0], + distances = [this._handles], + outer = this._getOuterBounds(); + + for(var i = 0; i < this._handles; i++) { + var handle = this._handleData[i], + bounds = this._getBoundsInternal(handle); + + var pos = this._isVertical ? handle.offsetTop : bounds.x - outer.x; + distances[i] = Math.abs(pos - offset); + } + + var delta = distances[0]; + for(i = 0; i < this._handles; i++) { + var d = distances[i]; + + if(d < delta) { + handle = this._handleData[i]; + delta = d; + closestHandle = handle; + } + } + + // Determine precedent inner range + if(this._innerDrag) { + var index = Array.indexOf(this._handleData, closestHandle), + location = Sys.UI.DomElement.getLocation(closestHandle), + locationOffset = this._isVertical ? location.y : location.x - outer.x; + + if(locationOffset >= (offset + distances[index])) { + // Get the handle before the one we chose + var newHandle = this._handleData[index - 1]; + + if(newHandle) + closestHandle = newHandle; + } + } + + return closestHandle; + }, + + _calculateMultiHandleSliderTargetValue: function(multiHandleSliderTarget, mouseOffset, computed) { + // Determines the closest value to set a bound control + var secondaryHandle, + secondaryMultiHandleSliderTarget, + min = this._minimum, + max = this._maximum; + + if(this._handleUnderDrag && !multiHandleSliderTarget) { + handle = this._handleUnderDrag; + multiHandleSliderTarget = $get(this._handleUnderDrag.multiHandleSliderTargetID); + + if(this._innerDrag) { + var primary = Array.indexOf(this._handleData, handle); + secondaryHandle = this._handleData[primary + 1]; + + if(!secondaryHandle) + // On the last handle; use the previous instead + secondaryHandle = this._handleData[primary - 1]; + + secondaryMultiHandleSliderTarget = $get(secondaryHandle.multiHandleSliderTargetID); + } + } + + var handle = multiHandleSliderTarget.Handle, value = multiHandleSliderTarget.value; + + if(value && !computed) { + if(typeof (value) !== 'number') + try { + value = parseFloat(value); + } catch(ex) { + value = Number.NaN; + } + + if(isNaN(value)) + value = this._minimum; + + // Range constraints + val = Math.max(Math.min(value, max), min); + } else { + var handleBounds = this._getBoundsInternal(handle), + railBounds = this._getOuterBounds(), + mark = (mouseOffset) ? mouseOffset - handleBounds.width / 2 : handleBounds.x - railBounds.x, + extent = railBounds.width - handleBounds.width, percent = mark / extent; + + val = Math.max(Math.min(value, max), min); + val = (mark === 0) ? min : (mark === (railBounds.width - handleBounds.width)) ? max : min + percent * (max - min); + } + + // Steps + if(this._steps > 0) + val = this._getNearestStepValue(val); + + // Range constraints + val = Math.max(Math.min(val, max), min); + + // Collision + var previousControls = [], + nextControls = [], + cp = 0, + cn = 0, + block, + prev = true; + + for(var i = 0; i < this._handles; i++) { + var vc = this._multiHandleSliderTargets[i]; + + if(!vc.ControlID.match(multiHandleSliderTarget.id)) { + if(prev) { + previousControls[cp] = this._multiHandleSliderTargets[i]; + cp++; + } else { + nextControls[cn] = this._multiHandleSliderTargets[i]; + cn++; + } + } else { + prev = false; + } + } + + if(cp > 0) { + var p = parseFloat($get(previousControls[cp - 1].ControlID).value); + val = Math.max(val, p); + block = val === p; + } + + if(cn > 0) { + var n = parseFloat($get(nextControls[0].ControlID).value); + val = Math.min(val, n); + block = val === n; + } + + if(secondaryHandle) { + var delta = val - parseFloat(value), + secondaryValue = parseFloat(secondaryMultiHandleSliderTarget.value), + secondaryVal = secondaryValue + delta; + + // Find next maximum if there are other handles + var nextIndex = Array.indexOf(this._handleData, secondaryHandle) + 1; + if(nextIndex < this._multiHandleSliderTargets.length) + var nextMultiHandleSliderTargetID = this._multiHandleSliderTargets[nextIndex].ControlID; + + if(nextMultiHandleSliderTargetID) + var nextMultiHandleSliderTarget = $get(nextMultiHandleSliderTargetID); + + if(nextMultiHandleSliderTarget) + var nextValue = nextMultiHandleSliderTarget.value; + + if(secondaryVal > (nextValue || max)) { + secondaryVal = secondaryValue; + val = value; + block = true; + } + } + + if(!block && (Math.max(val, max) === max && Math.min(val, min) === min)) { + this.beginUpdate(); + + val = Math.max(Math.min(val, max), min); + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, val); + + if(secondaryHandle) + this._setMultiHandleSliderTargetValue(secondaryMultiHandleSliderTarget, secondaryVal); + + this.endUpdate(); + } else { + this.beginUpdate(); + + if(this._handles === 1) { + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, val); + } else { + multiHandleSliderTarget.value = val; + handle.Value = val; + this._setHandlePosition(handle, true); + } + + if(secondaryHandle) { + secondaryMultiHandleSliderTarget.value = secondaryVal; + secondaryHandle.Value = secondaryVal; + this._setHandlePosition(secondaryHandle, true); + } + + this.endUpdate(); + } + + return val; + }, + + _cancelDrag: function() { + if(Sys.Extended.UI.MultiHandleSliderBehavior.DropPending === this) { + Sys.Extended.UI.MultiHandleSliderBehavior.DropPending = null; + + if(this._selectStartPending) + $removeHandler(document, 'selectstart', this._selectStartHandler); + } + }, + + _createHandles: function() { + // Creates the handles elements and hover and drag effect callbacks. + + // Create handle DOM elements + for(var i = 0; i < this._handles; i++) { + // Assemble the handle data + var handleName = this.get_id() + "_handle_" + i, + v = this._isVertical, + hideStyle = '', + hoverStyle = '', + dragStyle = ''; + + // Backwards compatibility: Single handled slider image by URL + if(this._handles === 1 && this._handleImageUrl) + var img = ""; + + // Assemble the handle markup + var anchorStart = ""; + + this._outer.innerHTML += anchorStart + anchorEnd; + } + + // Create handle data container + this._handleData = [this._handles]; + + for(i = 0; i < this._handles; i++) { + // Detect handle style and events + var styleInfo = this._cssClass ? this._cssClass : "ajax__multi_slider_default", + handleCss = this._multiHandleSliderTargets[i].HandleCssClass; + + if(handleCss || this._cssClass) { + // Resolve custom class + hideStyle = handleCss ? handleCss + " " : this._cssClass + " "; + hoverStyle = hideStyle; + dragStyle = hideStyle; + + var dragCss = handleCss, + hoverCss = handleCss; + + hideStyle = !handleCss ? hideStyle + this._isVertical ? 'handle_vertical' : 'handle_horizontal' : hideStyle + handleCss; + hoverStyle = !hoverCss ? hoverStyle + this._isVertical ? 'handle_vertical_hover' : 'handle_horizontal_hover' : hoverStyle + hoverCss; + dragStyle = !dragCss ? dragStyle + this._isVertical ? 'handle_vertical_down' : 'handle_horizontal_down' : dragStyle + dragCss; + } + + // Build the handle hover effects from callbacks + this._handleCallbacks = { + mouseover: Function.createCallback(this._onShowHover, { vertical: v, custom: hoverStyle }), + mouseout: Function.createCallback(this._onHideHover, { vertical: v, custom: hideStyle }), + mousedown: Function.createCallback(this._onShowDrag, { vertical: v, custom: dragStyle }), + mouseup: Function.createCallback(this._onHideDrag, { vertical: v, custom: hideStyle }) + }; + + // Assign element to container + this._handleData[i] = this._outer.childNodes[i]; + this._handleData[i].style.overflow = 'hidden'; + + // Attach callbacks as events to given handle + $addHandlers(this._handleData[i], this._handleCallbacks); + + // Process handle styles + handleCss = this._multiHandleSliderTargets[i].HandleCssClass; + if(handleCss) { + Sys.UI.DomElement.addCssClass(this._handleData[i], styleInfo); + Sys.UI.DomElement.addCssClass(this._handleData[i], handleCss); + } else { + // Don't try this for custom styles; they might have arbitrary graphics + this._handleData[i].className = this._isVertical ? 'handle_vertical' : 'handle_horizontal'; + } + + // Map handle targets + if(this._multiHandleSliderTargets) { + var multiHandleSliderTargetID = this._multiHandleSliderTargets[i].ControlID; + this._handleData[i].multiHandleSliderTargetID = multiHandleSliderTargetID; + } + + // Opera-friendly explicit style settings + this._handleData[i].style.left = '0px'; + this._handleData[i].style.top = '0px'; + + // Animation + if(this._steps < 1) { + if(this._enableHandleAnimation) { + var animation = new Sys.Extended.UI.Animation.LengthAnimation(this._handleData[i], this._handleAnimationDuration, 100, 'style'); + + animation.add_ended(Function.createDelegate(this, this._onAnimationEnded)); + animation.add_step(Function.createDelegate(this, this._onAnimationStep)); + this._handleData[i].Animation = animation; + } + } else { + this._enableHandleAnimation = false; + } + } + }, + + _createInnerRail: function() { + if(this._handles > 1 && this._showInnerRail) { + this._inner = document.createElement('DIV'); + this._inner.id = this.get_id() + '_inner'; + this._inner.style.outline = "none"; + this._inner.tabIndex = -1; + } + }, + + _createOuterRail: function() { + this._outer = document.createElement('DIV'); + this._outer.id = this.get_id() + '_outer'; + this._outer.style.outline = "none"; + this._outer.tabIndex = -1; + }, + + _createWrapper: function() { + // Creates the relatively positioned wrapper DIV to contain the slider. + this._wrapper = document.createElement("DIV"); + this._wrapper.style.position = "relative"; + this._wrapper.style.outline = "none"; + }, + + _disposeHandlers: function() { + if(!this._isReadOnly) { + // Global Handlers + $removeHandler(document, 'mouseup', this._mouseUpHandler); + $removeHandler(document, 'mouseout', this._mouseOutHandler); + + if(this._outer) { + // Mouse wheel support + if(this._outer.addEventListener) + this._outer.removeEventListener('DOMMouseScroll', this._mouseWheelHandler, false); + else + this._outer.detachEvent('onmousewheel', this._mouseWheelHandler); + + $common.removeHandlers(this._outer, this._outerDelegates); + } + + for(var i = 0; i < this._handles; i++) { + if(this._handleDelegates) + $common.removeHandlers(this._handleData[i], this._handleDelegates); + + if(this._handleCallbacks) + $clearHandlers(this._handleData[i]); + } + + this._handleDelegates = null; + this._handleCallbacks = null; + + if(this._inner && this._showInnerRail && this._innerDelegates) + $common.removeHandlers(this._inner, this._innerDelegates); + + // Global Handlers + this._selectStartHandler = null; + this._mouseUpHandler = null; + this._mouseOutHandler = null; + this._mouseWheelHandler = null; + this._mouseOverHandler = null; + this._keyDownHandler = null; + } + }, + + _disposeMultiHandleSliderTargets: function() { + if(this._multiHandleSliderTargets) { + for(var i = 0; i < this._handles; i++) { + var multiHandleSliderTarget = this._multiHandleSliderTargets[i]; + var isInput = multiHandleSliderTarget && multiHandleSliderTarget.nodeName === 'INPUT'; + + if(isInput) { + $removeHandler(multiHandleSliderTarget, 'change', multiHandleSliderTarget.ChangeHandler); + $removeHandler(multiHandleSliderTarget, 'keypress', multiHandleSliderTarget.KeyPressHandler); + + multiHandleSliderTarget.ChangeHandler = null; + multiHandleSliderTarget.KeyPressHandler = null; + } + } + } + }, + + _ensureBinding: function(multiHandleSliderTarget) { + // Ensures control binding to a Label or TextBox element. + + if(multiHandleSliderTarget) { + var value = multiHandleSliderTarget.value; + + if(value >= this._minimum || value <= this._maximum) { + var isInputElement = multiHandleSliderTarget && multiHandleSliderTarget.nodeName === 'INPUT'; + + if(isInputElement) + multiHandleSliderTarget.value = value; + else if(multiHandleSliderTarget) + multiHandleSliderTarget.innerHTML = value; + } + } + }, + + _enforceElementPositioning: function() { + // Copies any styles from the parent element to the slider wrapper. + + var tbPosition = { + position: this.get_element().style.position, + top: this.get_element().style.top, + right: this.get_element().style.right, + bottom: this.get_element().style.bottom, + left: this.get_element().style.left + }; + + if(tbPosition.position !== '') + this._wrapper.style.position = tbPosition.position; + + if(tbPosition.top !== '') + this._wrapper.style.top = tbPosition.top; + + if(tbPosition.right !== '') + this._wrapper.style.right = tbPosition.right; + + if(tbPosition.bottom !== '') + this._wrapper.style.bottom = tbPosition.bottom; + + if(tbPosition.left !== '') + this._wrapper.style.left = tbPosition.left; + }, + + _getNearestStepValue: function(value) { + // Determines the closest discrete step value from a given value. + // param valueis the value to check against steps + // returns the nearest discrete step value from the specified value. + + if(this._steps === 0) + return value; + + var extent = this._maximum - this._minimum; + if(extent === 0) + return value; + + if((this._steps - 1) !== 0) + var delta = extent / (this._steps - 1); + else + return value; + + return Math.round(value / delta) * delta; + }, + + _getStepValues: function() { + // Computes a list of possible slider values based on steps and constraints. + + var steps = [this._steps], + extent = this._maximum - this._minimum; + + var increment = extent / (this._steps - 1); + steps[0] = this._minimum; + + for(var i = 1; i < this._steps; i++) + steps[i] = this._minimum + (increment * i); + + return steps; + }, + + _handleSlide: function(decrement) { + // Increments or decrements the value of all handles. + // If param decrement is true, decrement the slider value; otherwise, increment it. + + // Test the first handle when decrementing, last if incrementing + var index = decrement ? 0 : this._handles - 1, + start = decrement ? 1 : 0, + end = decrement ? this._handles : this._handles - 1, + multiHandleSliderTargetID = this._handleData[index].multiHandleSliderTargetID; + + if(this._slideMultiHandleSliderTarget(multiHandleSliderTargetID, decrement)) { + // Increment + for(var i = start; i < end; i++) { + multiHandleSliderTargetID = this._handleData[i].multiHandleSliderTargetID; + this._slideMultiHandleSliderTarget(multiHandleSliderTargetID, decrement); + } + } + this._initializeInnerRail(); + }, + + _initializeDragHandle: function(handle) { + // Creates a hidden drag handle element for managing drag functions. + // This hidden element is appended to the document's first form. + + var dragHandle = handle.DragHandle = document.createElement('DIV'); + + dragHandle.style.position = 'absolute'; + dragHandle.style.width = '1px'; + dragHandle.style.height = '1px'; + dragHandle.style.overflow = 'hidden'; + dragHandle.style.background = 'none'; + + // Adding to the body can produce style breaks in some layouts + document.forms[0].appendChild(handle.DragHandle); + }, + + _initializeHandlers: function() { + if(!this._isReadOnly) { + // Global Handlers + this._selectStartHandler = Function.createDelegate(this, this._onSelectStart); + this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp); + this._mouseOutHandler = Function.createDelegate(this, this._onMouseOut); + this._mouseWheelHandler = Function.createDelegate(this, this._onMouseWheel); + this._mouseOverHandler = Function.createDelegate(this, this._onMouseOver); + this._keyDownHandler = Function.createDelegate(this, this._onKeyDown); + + $addHandler(document, 'mouseup', this._mouseUpHandler); + $addHandler(document, 'mouseout', this._mouseOutHandler); + + this._handleDelegates = { + mousedown: Function.createDelegate(this, this._onMouseDown), + dragstart: Function.createDelegate(this, this._IEDragDropHandler), + drag: Function.createDelegate(this, this._IEDragDropHandler), + dragEnd: Function.createDelegate(this, this._IEDragDropHandler) + }; + + for(var i = 0; i < this._handles; i++) + $addHandlers(this._handleData[i], this._handleDelegates); + + if(this._outer) { + // Mouse wheel support + if(this._enableMouseWheel) + if(this._outer.addEventListener) + this._outer.addEventListener('DOMMouseScroll', this._mouseWheelHandler, false); + else + this._outer.attachEvent('onmousewheel', this._mouseWheelHandler); + + this._outerDelegates = { + click: Function.createDelegate(this, this._onOuterRailClick), + mouseover: Function.createDelegate(this, this._mouseOverHandler), + keydown: Function.createDelegate(this, this._keyDownHandler) + }; + + $addHandlers(this._outer, this._outerDelegates); + } + + if(this._inner && this._showInnerRail) { + this._innerDelegates = { + click: Function.createDelegate(this, this._onInnerRailClick), + mousedown: Function.createDelegate(this, this._onMouseDownInner), + mouseup: Function.createDelegate(this, this._onMouseUpInner), + mouseout: Function.createDelegate(this, this._onMouseOutInner), + mousemove: Function.createDelegate(this, this._onMouseMoveInner), + dragStart: Function.createDelegate(this, this._IEDragDropHandler), + drag: Function.createDelegate(this, this._IEDragDropHandler), + dragEnd: Function.createDelegate(this, this._IEDragDropHandler) + }; + + $addHandlers(this._inner, this._innerDelegates); + } + } + }, + + _initializeHandles: function() { + // Initializes data and events on handle elements. + + // Restore client state + var state = this.get_ClientState(); + if(state) + var handleStates = state.split(',', this._handles); + + for(var i = 0; i < this._handles; i++) { + var handle = this._handleData[i], + decimalPlaces = this._multiHandleSliderTargets[i].Decimals; + + if(handleStates) + handle.Value = parseFloat(handleStates[i]); + + this._initializeMultiHandleSliderTarget(handle.multiHandleSliderTargetID, decimalPlaces, handle); + this._initializeHandleValue(handle); + this._setHandlePosition(handle, true); + this._initializeDragHandle(handle); + } + }, + + _initializeHandleValue: function(handle) { + // Initializes the starting value of a given handle. + + // Check if value already exists from state + if(!handle.Value) { + try { + var multiHandleSliderTarget = $get(handle.multiHandleSliderTargetID), + isInput = multiHandleSliderTarget && multiHandleSliderTarget.nodeName === 'INPUT', + handleValue = parseFloat(isInput ? multiHandleSliderTarget.value : multiHandleSliderTarget.innerHTML); + } catch(ex) { + handleValue = Number.NaN; + } + + // Differentiate between a label and a textbox + if(isNaN(handleValue)) { + handle.Value = this._minimum; + + if(isInput) + multiHandleSliderTarget.value = handle.Value; + else + multiHandleSliderTarget.innerHTML = handle.Value; + } else { + handle.Value = handleValue; + } + } + }, + + _initializeInnerRail: function() { + // Initializes the appearance and location of the inner rail. Called multiple times to + // recalculate the inner rail's position. + + if(this._inner && this._showInnerRail) { + var firstIndex = 0, lastIndex = this._handles - 1, + handle = this._handleData[firstIndex], + lastHandle = this._handles > 1 ? this._handleData[lastIndex] : null; + + // Set the inner rail + if(lastHandle) { + // firstOffset and lastOffset account for user-defined offset handle width + var handleWidth = parseInt(this._getBoundsInternal(handle).width, 10), + handleLeft = parseInt(this._isVertical ? handle.style.top : handle.style.left, 10), + handleRight = parseInt(this._isVertical ? lastHandle.style.top : lastHandle.style.left, 10), + firstOffset = parseInt(this._multiHandleSliderTargets[firstIndex].Offset, 10), + lastOffset = parseInt(this._multiHandleSliderTargets[lastIndex].Offset, 10); + + handleLeft += firstOffset; + handleRight += lastOffset; + + if(this._isVertical) { + this._inner.style.top = handleLeft + "px"; + this._inner.style.height = handleRight + handleWidth - handleLeft + "px"; + } else { + this._inner.style.left = handleLeft + "px"; + this._inner.style.width = (handleRight + handleWidth - handleLeft) + "px"; + } + + // Slide the door + if(this._innerRailStyle === Sys.Extended.UI.MultiHandleInnerRailStyle.SlidingDoors) + this._inner.style.backgroundPosition = this._isVertical ? "0 -" + handleLeft + "px" : "-" + handleLeft + "px 0"; + } + } + }, + + _initializeMultiHandleSliderTarget: function(multiHandleSliderTargetID, decimalPlaces, handle) { + // Initializes a given element that is bound to a handle. + + if(multiHandleSliderTargetID) { + var multiHandleSliderTarget = $get(multiHandleSliderTargetID); + + if(handle.Value) + // Set from state + multiHandleSliderTarget.value = handle.Value; + + multiHandleSliderTarget.Handle = handle; + multiHandleSliderTarget.Decimals = decimalPlaces; + multiHandleSliderTarget.OldValue = multiHandleSliderTarget.value; + multiHandleSliderTarget.onchange = "setValue(this, " + multiHandleSliderTarget.value + ")"; + + if(!multiHandleSliderTarget.Decimals) + multiHandleSliderTarget.Decimals = 0; + + var isInput = multiHandleSliderTarget && multiHandleSliderTarget.nodeName === 'INPUT'; + if(isInput) { + multiHandleSliderTarget.KeyPressHandler = Function.createDelegate(this, this._onMultiHandleSliderTargetKeyPressed); + multiHandleSliderTarget.ChangeHandler = Function.createDelegate(this, this._onMultiHandleSliderTargetChange); + + $addHandler(multiHandleSliderTarget, 'keypress', multiHandleSliderTarget.KeyPressHandler); + $addHandler(multiHandleSliderTarget, 'change', multiHandleSliderTarget.ChangeHandler); + } + } + }, + + _initializeSlider: function() { + // Creates the generated slider DOM components. + + Sys.Extended.UI.DragDrop.registerDropTarget(this); + + this._initializeHandles(); + this._initializeHandlers(); + this._initializeInnerRail(); + this._initialized = true; + + this._raiseEvent('load'); + }, + + _resetDragHandle: function(handle) { + // Resets the position of the hidden drag handle. + var handleBounds = $common.getBounds(handle); + + $common.setLocation(handle.DragHandle, { + x: handleBounds.x, + y: handleBounds.y + }); + }, + + _resolveNamingContainer: function() { + // Uses the behavior name and client state to resolve the inner control IDs. + if(this._isServerControl && this._multiHandleSliderTargets && !this._boundControlID) { + var index = this._clientStateFieldID.lastIndexOf(this._id), + token = this._clientStateFieldID.substring(0, index); + + for(var i = 0; i < this._handles; i++) + this._multiHandleSliderTargets[i].ControlID = token + this._multiHandleSliderTargets[i].ControlID; + } + }, + + _saveState: function() { + // Sets the values of all handle controls in client state. + var state = [this._handles]; + for(var i = 0; i < this._handles; i++) + state[i] = $get(this._multiHandleSliderTargets[i].ControlID).value; + + this.set_ClientState(state.join(',')); + }, + + _setHandlePosition: function(handle, allowAnimation) { + // Sets the location of the handle when changing slider values. + + var min = this._minimum, max = this._maximum, value = handle.Value, + animate = this._enableHandleAnimation && this._animationPending && allowAnimation, + handleBounds = this._getBoundsInternal(handle), + railBounds = this._getOuterBounds(); + + if(handleBounds.width <= 0 && railBounds.width <= 0) { + handleBounds.width = parseInt($common.getCurrentStyle(handle, 'width'), 10); + railBounds.width = parseInt($common.getCurrentStyle(this._outer, 'width'), 10); + + if(handleBounds.width <= 0 || railBounds.width <= 0) + throw Error.argument('width', Sys.Extended.UI.Resources.MultiHandleSlider_CssHeightWidthRequired); + } + + var extent = max - min, fraction = (value - min) / extent, + o = Math.round(fraction * (railBounds.width - handleBounds.width)), + offset = (value === min) ? 0 : (value === max) ? (railBounds.width - handleBounds.width) : o; + + if(animate) { + handle.Animation.set_startValue(handleBounds.x - railBounds.x); + handle.Animation.set_endValue(offset); + handle.Animation.set_propertyKey(this._isVertical ? 'top' : 'left'); + handle.Animation.play(); + + this._animationPending = false; + } else { + o = offset + 'px'; + + if(this._isVertical) + handle.style.top = o; + else + handle.style.left = o; + } + }, + + _setRailStyles: function() { + // Determines from configuration the class names to use for slider elements. + + // Backwards-compatibility: rail style on single handle slider + if(!this._inner && this._railCssClass) { + this._outer.className = this._railCssClass; + return; + } + var styleInfo = this._cssClass ? this._cssClass : "ajax__multi_slider_default"; + + Sys.UI.DomElement.addCssClass(this.get_element(), styleInfo); + Sys.UI.DomElement.addCssClass(this._outer, styleInfo); + Sys.UI.DomElement.addCssClass(this._wrapper, styleInfo); + + if(this._inner) { + Sys.UI.DomElement.addCssClass(this._inner, styleInfo); + + var outer = this._isVertical ? 'outer_rail_vertical' : 'outer_rail_horizontal', + inner = this._isVertical ? 'inner_rail_vertical' : 'inner_rail_horizontal'; + + Sys.UI.DomElement.addCssClass(this._outer, outer); + Sys.UI.DomElement.addCssClass(this._inner, inner); + } else { + outer = this._isVertical ? 'inner_rail_vertical' : 'inner_rail_horizontal'; + + Sys.UI.DomElement.addCssClass(this._outer, outer); + } + }, + + _setMultiHandleSliderTargetValue: function(multiHandleSliderTarget, value) { + // Sets the value of a bound control. + var oldValue = multiHandleSliderTarget.OldValue, newValue = value; + + if(oldValue === newValue && this._isReadOnly) { + multiHandleSliderTarget.value = oldValue; + } else { + if(!this.get_isUpdating()) + newValue = this._calculateMultiHandleSliderTargetValue(multiHandleSliderTarget); + + multiHandleSliderTarget.value = newValue.toFixed(multiHandleSliderTarget.Decimals); + this._ensureBinding(multiHandleSliderTarget); + + if(!Number.isInstanceOfType(multiHandleSliderTarget.value)) + try { + multiHandleSliderTarget.value = parseFloat(multiHandleSliderTarget.value); + } catch(ex) { + multiHandleSliderTarget.value = Number.NaN; + } + + if(this._tooltipText) { + var handle = multiHandleSliderTarget.Handle; + handle.alt = handle.title = String.format(this._tooltipText, multiHandleSliderTarget.value); + } + + if(this._initialized) { + multiHandleSliderTarget.Handle.Value = newValue; + this._setHandlePosition(multiHandleSliderTarget.Handle, true); + + // Backwards compatibility for single-handled slider: set element value + if(this._handles === 1) + this.get_element().value = newValue; + + if(multiHandleSliderTarget.value !== oldValue) { + multiHandleSliderTarget.OldValue = multiHandleSliderTarget.value; + this._initializeInnerRail(); + + // Prevent click after drag + if(this._innerDrag) + this._blockInnerClick = true; + + this._raiseEvent('valueChanged'); + + if(this.get_isUpdating()) + if(!this._raiseChangeOnlyOnMouseUp) + $common.tryFireEvent(this.get_element(), "change"); + } + } + } + + // Store all values in client state + this._saveState(); + }, + + _setValueFromMultiHandleSliderTarget: function(multiHandleSliderTarget) { + // Sets the value of the slider based on the value inside a bound control. + + this.beginUpdate(); + if(multiHandleSliderTarget) { + if(!this._isReadOnly) { + if(this._handles === 1 && this._steps > 0) + // Bypass all the calculations since we already know the discrete value + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, multiHandleSliderTarget.value); + + this._calculateMultiHandleSliderTargetValue(multiHandleSliderTarget); + } else { + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, multiHandleSliderTarget.OldValue); + } + } + + this.endUpdate(); + }, + + _slideMultiHandleSliderTarget: function(multiHandleSliderTargetID, decrement) { + // Increments the value of a bound control. + + var multiHandleSliderTarget = $get(multiHandleSliderTargetID), + oldValue = multiHandleSliderTarget.value, + newValue, i; + + if(this._steps > 0) { + var stepValues = this._getStepValues(), + oldStep = this._getNearestStepValue(oldValue); + + newValue = oldStep; + + if(decrement) { + // Decrement + for(i = this._steps - 1; i > -1; i--) + if(stepValues[i] < oldStep) { + newValue = stepValues[i]; + break; + } + } else { + // Increment + for(i = 0; i < this._steps; i++) + if(stepValues[i] > oldStep) { + newValue = stepValues[i]; + break; + } + } + } else { + var prevValue = parseFloat(multiHandleSliderTarget.value); + newValue = decrement ? prevValue - parseFloat(this._increment) : prevValue + parseFloat(this._increment); + } + + multiHandleSliderTarget.value = newValue; + this._setValueFromMultiHandleSliderTarget(multiHandleSliderTarget); + return multiHandleSliderTarget.value == newValue; + }, + + _startDragDrop: function(handle) { + // Begins a drag and drop operation on the specified handle. Drag operations + // affect the hidden drag handle on the element, not the element itself. + this._resetDragHandle(handle); + this._handleUnderDrag = handle; + + Sys.Extended.UI.DragDrop.startDragDrop(this, handle.DragHandle, null); + }, + + // Event Handlers + + _onAnimationEnded: function() { + this._initializeInnerRail(); + }, + + _onAnimationStep: function() { + this._initializeInnerRail(); + }, + + _onHideDrag: function(e, p) { + // Reverses the class name used for drag effects when the callback event is raised. + // param p is the callback parameter object, containing custom style and orientation fields. + this.className = p.custom && p.custom.length > 0 ? p.custom : p.vertical ? 'handle_vertical' : 'handle_horizontal'; + }, + + _onHideHover: function(e, p) { + // Reverses the class name used for hover effects when the callback event is raised. + // param p is the callback parameter object, containing custom style and orientation fields. + this.className = p.custom && p.custom.length > 0 ? p.custom : p.vertical ? 'ajax__multi_slider_default handle_vertical' : 'ajax__multi_slider_default handle_horizontal'; + }, + + _onInnerRailClick: function(e) { + // Handler for the inner rail's click event. + if(this._enableRailClick) { + var target = e.target; + + if(target === this._inner && !this._blockInnerClick) { + this._animationPending = true; + this._onInnerRailClicked(e); + } else { + this._blockInnerClick = false; + } + } + }, + + _onInnerRailClicked: function(e) { + // Called when the inner rail's click event is handled. + var offset = this._calculateInnerRailOffset(e); + this._calculateClick(offset); + }, + + _onKeyDown: function(e) { + if(this._enableKeyboard) { + var evt = new Sys.UI.DomEvent(e), + handled = false; + + switch(evt.keyCode || evt.rawEvent.keyCode) { + case Sys.UI.Key.up: + case Sys.UI.Key.left: + if(!handled) { + this._handleSlide(true); + evt.preventDefault(); + handled = true; + } + return false; + case Sys.UI.Key.down: + case Sys.UI.Key.right: + if(!handled) { + this._handleSlide(false); + evt.preventDefault(); + handled = true; + } + return false; + default: + return false; + } + } + }, + + _onMouseOver: function(e) { + this._outer.focus(); + }, + + _onMouseWheel: function(e) { + var delta = 0; + + if(e.wheelDelta) { + delta = e.wheelDelta / 120; + + if(Sys.Browser.agent === Sys.Browser.Opera) + delta = -delta; + } else if(e.detail) { + delta = -e.detail / 3; + } + + if(delta) + this._handleSlide(delta <= 0); + + if(e.preventDefault) + e.preventDefault(); + + return false; + }, + + _onMouseUp: function(e) { + window._event = e; + e.preventDefault(); + + this._cancelDrag(); + }, + + _onMouseOut: function(e) { + window._event = e; + e.preventDefault(); + + this._outer.blur(); + if(this._handleUnderDrag) + this._cancelDrag(); + }, + + _onMouseOutInner: function(e) { + window._event = e; + e.preventDefault(); + + this._inner.blur(); + if(this._innerDrag) + this._cancelDrag(); + }, + + _onMouseDown: function(e) { + window._event = e; + e.preventDefault(); + + if(!Sys.Extended.UI.MultiHandleSliderBehavior.DropPending) { + Sys.Extended.UI.MultiHandleSliderBehavior.DropPending = this; + + $addHandler(document, 'selectstart', this._selectStartHandler); + this._selectStartPending = true; + + var handle = e.target; + this._startDragDrop(handle); + } + }, + + _onMouseDownInner: function(e) { + window._event = e; + e.preventDefault(); + + if(this._enableInnerRangeDrag) + if(!this._innerDragFlag) + this._innerDragFlag = true; + }, + + _onMouseUpInner: function(e) { + if(this._enableInnerRangeDrag) + this._innerDragFlag = false; + }, + + _onMouseMoveInner: function(e) { + window._event = e; + e.preventDefault(); + + if(this._enableInnerRangeDrag) { + if(!this._innerDrag && this._innerDragFlag) { + this._innerDragFlag = false; + + // Begin drag and drop operation for the inner rail + if(!Sys.Extended.UI.MultiHandleSliderBehavior.DropPending) { + Sys.Extended.UI.MultiHandleSliderBehavior.DropPending = this; + + $addHandler(document, 'selectstart', this._selectStartHandler); + this._selectStartPending = true; + + // Dragging inner handles + this._innerDrag = true; + + // Get nearest primary handle + var offset = this._calculateInnerRailOffset(e); + var handle = this._calculateClosestHandle(offset); + + // Start drag + this._startDragDrop(handle); + } + } + } + }, + + _onMultiHandleSliderTargetChange: function(e) { + // Handler for when a slider value changes programmatically. + this._animationPending = true; + var multiHandleSliderTarget = e.target; + this._setValueFromMultiHandleSliderTarget(multiHandleSliderTarget); + this._initializeInnerRail(); + + e.preventDefault(); + }, + + _onMultiHandleSliderTargetKeyPressed: function(e) { + var evt = new Sys.UI.DomEvent(e); + + if(evt.charCode === 13) { + this._animationPending = true; + var multiHandleSliderTarget = evt.target; + this._setValueFromMultiHandleSliderTarget(multiHandleSliderTarget); + this._initializeInnerRail(); + + evt.preventDefault(); + } + }, + + _onOuterRailClick: function(e) { + if(this._enableRailClick) { + var target = e.target; + + if(target === this._outer) { + this._animationPending = true; + this._onOuterRailClicked(e); + } + } + }, + + _onOuterRailClicked: function(e) { + var offset = this._isVertical ? e.offsetY : e.offsetX; + this._calculateClick(offset); + }, + + _onShowDrag: function(e, p) { + // Sets the class name used for drag effects when the callback event is raised. + // param p is the callback parameter object, containing custom style and orientation fields + this.className = p.custom && p.custom.length > 0 ? p.custom : p.vertical ? 'ajax__multi_slider_default handle_vertical_down' : 'ajax__multi_slider_default handle_horizontal_down'; + }, + + _onShowHover: function(e, p) { + // Sets the class name used for hover effects when the callback event is raised. + // param p the callback parameter object, containing custom style and orientation fields. + this.className = p.custom && p.custom.length > 0 ? p.custom : p.vertical ? 'ajax__multi_slider_default handle_vertical_hover' : 'ajax__multi_slider_default handle_horizontal_hover'; + }, + + // IDragSource Implementation + + get_dragDataType: function() { + return 'HTML'; + }, + + getDragData: function() { + return this._handleUnderDrag; + }, + + get_dragMode: function() { + return Sys.Extended.UI.DragMode.Move; + }, + + /// + /// Raises the OnDragStart event + /// + /// + onDragStart: function() { + this._resetDragHandle(this._handleUnderDrag); + this._raiseEvent('dragStart'); + }, + + /// + /// Raises the OnDrag event + /// + /// + onDrag: function() { + var dragHandleBounds = this._getBoundsInternal(this._handleUnderDrag.DragHandle), + handleBounds = this._getBoundsInternal(this._handleUnderDrag), + railBounds = this._getOuterBounds(), + handlePosition; + + if(this._isVertical) { + handlePosition = { + y: dragHandleBounds.x - railBounds.x, + x: 0 + }; + } else { + handlePosition = { + x: dragHandleBounds.x - railBounds.x, + y: 0 + }; + } + + $common.setLocation(this._handleUnderDrag, handlePosition); + + this._calculateMultiHandleSliderTargetValue(null, null, true); + + if(this._steps > 1) + this._setHandlePosition(this._handleUnderDrag, false); + + this._raiseEvent('drag'); + }, + + /// + /// Raises the OnDragEnd event + /// + /// + onDragEnd: function() { + this._initializeInnerRail(); + + if(this._raiseChangeOnlyOnMouseUp) + $common.tryFireEvent(this.get_element(), "change"); + + this._innerDrag = false; + this._handleUnderDrag = null; + this._raiseEvent('dragEnd'); + }, + + // IDropTarget Implementation + + get_dropTargetElement: function() { + return document.forms[0]; + }, + + canDrop: function(dragMode, dataType) { + return dataType == 'HTML'; + }, + + // Not implemented + drop: Function.emptyMethod, + onDragEnterTarget: Function.emptyMethod, + onDragLeaveTarget: Function.emptyMethod, + onDragInTarget: Function.emptyMethod, + + _IEDragDropHandler: function(e) { + e.preventDefault(); + }, + + _onSelectStart: function(e) { + // Handler for when the parent element is selected. + e.preventDefault(); + + return false; + }, + + // Helper Methods + + _getOuterBounds: function() { + return this._getBoundsInternal(this._outer); + }, + + _getInnerBounds: function() { + return this._getBoundsInternal(this._inner); + }, + + _getBoundsInternal: function(element) { + var bounds = $common.getBounds(element); + + if(this._isVertical) { + bounds = { + x: bounds.y, + y: bounds.x, + height: bounds.width, + width: bounds.height, + right: bounds.right, + left: bounds.left, + bottom: bounds.bottom, + location: { + x: bounds.y, + y: bounds.x + }, + size: { + width: bounds.height, + height: bounds.width + } + }; + } else { + bounds = { + x: bounds.x, + y: bounds.y, + height: bounds.height, + width: bounds.width, + right: bounds.right, + left: bounds.left, + bottom: bounds.bottom, + location: { + x: bounds.x, + y: bounds.y + }, + size: { + width: bounds.width, + height: bounds.height + } + }; + } + + return bounds; + }, + + _raiseEvent: function(eventName, eventArgs) { + var handler = this.get_events().getHandler(eventName); + + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + + handler(this, eventArgs); + } + }, + + // Backwards-compatible Property Accessors + + /// + /// A value of a single bound control for backward compatibility of the existing slider and tests. + /// Can be used only in this context + /// + /// get_value + /// set_value + /// + get_value: function() { + var bound = $get(this._boundControlID); + return bound.value ? bound.value : 0; + }, + set_value: function(value) { + var multiHandleSliderTarget = $get(this._multiHandleSliderTargets[0].ControlID); + + this.beginUpdate(); + this._setMultiHandleSliderTargetValue(multiHandleSliderTarget, this._getNearestStepValue(value)); + this.endUpdate(); + + // Raise an event after a hard set to enforce any constraints after the fact + $common.tryFireEvent(multiHandleSliderTarget, "change"); + }, + + get_Value: function() { + Sys.Extended.Deprecated("get_Value()", "get_value()"); + return this.get_value(); + }, + set_Value: function(value) { + Sys.Extended.Deprecated("set_Value(value)", "set_value(value)"); + this.set_value(value); + }, + + // Property Accessors + + /// + /// The lowest value on the slider + /// + /// get_minimum + /// set_minimum + /// + get_minimum: function() { + return this._minimum; + }, + set_minimum: function(value) { + if(value !== this._minimum) { + this._minimum = value; + this.raisePropertyChanged('minimum'); + } + }, + + /// + /// The highest value on the slider + /// + /// get_maximum + /// set_maximum + /// + get_maximum: function() { + return this._maximum; + }, + set_maximum: function(value) { + if(value !== this._maximum) { + this._maximum = value; + this.raisePropertyChanged('maximum'); + } + }, + + /// + /// The slider rail length in pixels + /// + /// get_length + /// set_length + /// + get_length: function() { + return this._length; + }, + set_length: function(value) { + if(value !== this._length) { + this._length = value; + this.raisePropertyChanged('length'); + } + }, + + /// + /// Determines the number of discrete locations on the slider. Otherwise, the slider is continous + /// + /// get_steps + /// set_steps + /// + get_steps: function() { + return this._steps; + }, + set_steps: function(value) { + var oldValue = this._steps; + this._steps = Math.abs(value); + this._steps = (this._steps === 1) ? 2 : this._steps; + + if(oldValue !== this._steps) + this.raisePropertyChanged('steps'); + }, + + /// + /// Determines if the slider's orientation is horizontal or vertical + /// + /// get_orientation + /// set_orientation + /// + get_orientation: function() { + return this._isVertical; + }, + set_orientation: function(value) { + if(value !== this._isVertical) { + this._orientation = value; + this.raisePropertyChanged('orientation'); + } + }, + + /// + /// Determines if the slider handles display an animation effect when the position is changed + /// + /// get_enableHandleAnimation + /// set_enableHandleAnimation + /// + get_enableHandleAnimation: function() { + return this._enableHandleAnimation; + }, + set_enableHandleAnimation: function(value) { + if(value !== this._enableHandleAnimation) { + this._enableHandleAnimation = value; + this.raisePropertyChanged('enableHandleAnimation'); + } + }, + + /// + /// Determines the total duration of the animation effect in seconds + /// + /// get_handleAnimationDuration + /// set_handleAnimationDuration + /// + get_handleAnimationDuration: function() { + return this._handleAnimationDuration; + }, + set_handleAnimationDuration: function(value) { + if(value !== this._handleAnimationDuration) { + this._handleAnimationDuration = value; + this.raisePropertyChanged('handleAnimationDuration'); + } + }, + + /// + /// Determines if changes events to the slider's values are raised during dragging. + /// Otherwise, they are raised when dragging is completed + /// + /// get_raiseChangeOnlyOnMouseUp + /// set_raiseChangeOnlyOnMouseUp + /// + get_raiseChangeOnlyOnMouseUp: function() { + return this._raiseChangeOnlyOnMouseUp; + }, + set_raiseChangeOnlyOnMouseUp: function(value) { + if(value !== this._raiseChangeOnlyOnMouseUp) { + this._raiseChangeOnlyOnMouseUp = value; + this.raisePropertyChanged('raiseChangeOnlyOnMouseUp'); + } + }, + + /// + /// Determines if the slider will show an inner selected range rail. Otherwise, + /// it will be displayed as a uniform rail + /// + /// get_showInnerRail + /// set_showInnerRail + /// + get_showInnerRail: function() { + return this._showInnerRail; + }, + set_showInnerRail: function(value) { + if(value !== this._showInnerRail) { + this._showInnerRail = value; + this.raisePropertyChanged('showInnerRail'); + } + }, + + /// + /// Determines if the slider handles will show a style effect when they are hovered over + /// + /// get_showHandleHoverStyle + /// set_showHandleHoverStyle + /// + get_showHandleHoverStyle: function() { + return this._showHoverStyle; + }, + set_showHandleHoverStyle: function(value) { + if(value !== this._showHoverStyle) { + this._showHoverStyle = value; + this.raisePropertyChanged('showHandleHoverStyle'); + } + }, + + /// + /// Determines if the slider handles will show a style effect when they are being dragged + /// + /// get_showHandleDragStyle + /// set_showHandleDragStyle + /// + get_showHandleDragStyle: function() { + return this._showDragStyle; + }, + set_showHandleDragStyle: function(value) { + if(value !== this._showDragStyle) { + this._showDragStyle = value; + this.raisePropertyChanged('showHandleDragStyle'); + } + }, + + /// + /// Determines how the inner rail style is handled + /// + /// get_innerRailStyle + /// set_innerRailStyle + /// + get_innerRailStyle: function() { + return this._innerRailStyle; + }, + set_innerRailStyle: function(value) { + if(value !== this._innerRailStyle) { + this._innerRailStyle = value; + this.raisePropertyChanged('innerRailStyle'); + } + }, + + /// + /// Determines if the inner rail range can be dragged as a whole moving both handles defining it + /// + /// get_enableInnerRangeDrag + /// set_enableInnerRangeDrag + /// + get_enableInnerRangeDrag: function() { + return this._enableInnerRangeDrag; + }, + set_enableInnerRangeDrag: function(value) { + if(value !== this._enableInnerRangeDrag) { + this._enableInnerRangeDrag = value; + this.raisePropertyChanged('enableInnerRangeDrag'); + } + }, + + /// + /// Determines if clicking the rail will detect and move the closest handle + /// + /// get_enableRailClick + /// set_enableRailClick + /// + get_enableRailClick: function() { + return this._enableRailClick; + }, + set_enableRailClick: function(value) { + if(value !== this._enableRailClick) { + this._enableRailClick = value; + this.raisePropertyChanged('enableRailClick'); + } + }, + + /// + /// Determines if the slider and its values can be manipulated + /// + /// get_isReadOnly + /// set_isReadOnly + /// + get_isReadOnly: function() { + return this._isReadOnly; + }, + set_isReadOnly: function(value) { + if(value !== this._isReadOnly) { + this._isReadOnly = value; + this.raisePropertyChanged('isReadOnly'); + } + }, + + /// + /// Determines if the slider will respond to arrow keys when it has focus + /// + /// get_enableKeyboard + /// set_enableKeyboard + /// + get_enableKeyboard: function() { + return this._enableKeyboard; + }, + set_enableKeyboard: function(value) { + if(value !== this._enableKeyboard) { + this._enableKeyboard = value; + this.raisePropertyChanged('enableKeyboard'); + } + }, + + /// + /// Determines if the slider will respond to the mouse wheel when it has focus + /// + /// get_enableMouseWheel + /// set_enableMouseWheel + /// + get_enableMouseWheel: function() { + return this._enableMouseWheel; + }, + set_enableMouseWheel: function(value) { + if(value !== this._enableMouseWheel) { + this._enableMouseWheel = value; + this.raisePropertyChanged('enableMouseWheel'); + } + }, + + /// + /// Determines the number of slider points to increment or decrement using the keyboard or mouse wheel. + /// It is ignored if the steps property is used + /// + /// get_increment + /// set_increment + /// + get_increment: function() { + return this._increment; + }, + set_increment: function(value) { + if(value !== this._increment) { + this._increment = value; + this.raisePropertyChanged('increment'); + } + }, + + /// + /// Determines the text to display as a tooltip; {0} denotes the current + /// handle's value in the format string + /// + /// get_tooltipText + /// set_tooltipText + /// + get_tooltipText: function() { + return this._tooltipText; + }, + set_tooltipText: function(value) { + if(value !== this._tooltipText) { + this._tooltipText = value; + this.raisePropertyChanged('tooltipText'); + } + }, + + /// + /// The list of controls used to bind slider handle values. These should be Label or TextBox controls + /// + /// get_multiHandleSliderTargets + /// set_multiHandleSliderTargets + /// + get_multiHandleSliderTargets: function() { + return this._multiHandleSliderTargets; + }, + set_multiHandleSliderTargets: function(value) { + if(value !== this._multiHandleSliderTargets) { + this._multiHandleSliderTargets = value; + this.raisePropertyChanged('multiHandleSliderTargets'); + } + }, + + /// + /// A master style to apply to slider graphical elements + /// + /// get_cssClass + /// set_cssClass + /// + get_cssClass: function() { + return this._cssClass; + }, + set_cssClass: function(value) { + if(value !== this._cssClass) { + this._cssClass = value; + this.raisePropertyChanged('cssClass'); + } + }, + + /// + /// ID of a control to use for a single handle + /// + /// get_boundControlID + /// set_boundControlID + /// + get_boundControlID: function() { + return this._boundControlID; + }, + set_boundControlID: function(value) { + this._boundControlID = value; + + if(this._boundControlID) + this._boundControl = $get(this._boundControlID); + else + this._boundControl = null; + }, + + /// + /// A CSS class of a single handle + /// + /// get_handleCssClass + /// set_handleCssClass + /// + get_handleCssClass: function() { + return this._handleCssClass; + }, + set_handleCssClass: function(value) { + this._handleCssClass = value; + }, + + /// + /// URL for an image to display in the slider's handle + /// + /// get_handleImageUrl + /// set_handleImageUrl + /// + get_handleImageUrl: function() { + return this._handleImageUrl; + }, + set_handleImageUrl: function(value) { + this._handleImageUrl = value; + }, + + /// + /// A CSS class for the slider's rail element + /// + /// get_railCssClass + /// set_railCssClass + /// + get_railCssClass: function() { + return this._railCssClass; + }, + set_railCssClass: function(value) { + this._railCssClass = value; + }, + + /// + /// The number of decimal digits in a single slider's value + /// + /// get_decimals + /// set_decimals + /// + get_decimals: function() { + return this._decimals; + }, + set_decimals: function(value) { + this._decimals = value; + }, + + // Event Accessors + + /// + /// The event is raised when the slider is completely loaded on the page + /// + /// + /// + add_load: function(handler) { + this.get_events().addHandler('load', handler); + }, + remove_load: function(handler) { + this.get_events().removeHandler('load', handler); + }, + + /// + /// The event is raised when a user initiates the drag operation on the slider + /// + /// + /// + add_dragStart: function(handler) { + this.get_events().addHandler('dragStart', handler); + }, + remove_dragStart: function(handler) { + this.get_events().removeHandler('dragStart', handler); + }, + + /// + /// The event is raised when the user drags the slider + /// + /// + /// + add_drag: function(handler) { + this.get_events().addHandler('drag', handler); + }, + remove_drag: function(handler) { + this.get_events().removeHandler('drag', handler); + }, + + /// + /// The event is raised when the user drops the slider + /// + /// + /// + add_dragEnd: function(handler) { + this.get_events().addHandler('dragEnd', handler); + }, + remove_dragEnd: function(handler) { + this.get_events().removeHandler('dragEnd', handler); + }, + + /// + /// The event is raised when the slider changes its state + /// + /// + /// + add_valueChanged: function(handler) { + this.get_events().addHandler('valueChanged', handler); + }, + remove_valueChanged: function(handler) { + this.get_events().removeHandler('valueChanged', handler); + } +}; + +Sys.Extended.UI.MultiHandleSliderBehavior.DropPending = null; +Sys.Extended.UI.MultiHandleSliderBehavior.registerClass('Sys.Extended.UI.MultiHandleSliderBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MutuallyExclusiveCheckBox.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MutuallyExclusiveCheckBox.debug.js new file mode 100644 index 000000000..431069eea --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/MutuallyExclusiveCheckBox.debug.js @@ -0,0 +1,143 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior = function(element) { + // The MutuallyExclusiveCheckBoxBehavior allows only one checkbox in + // a group with the same Key to be checked at a time + // "element" - the DOM Element the behavior is associated with + Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.initializeBase(this, [element]); + + this._key = ""; + this._clickHandler = Function.createDelegate(this, this._onclick); +} + +Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.callBaseMethod(this, 'initialize'); + $addHandler(this.get_element(), "click", this._clickHandler); + }, + + dispose: function() { + if(this._key) { + var keys = Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.Keys; + var ar = keys[this._key]; + Array.remove(ar, this); + this._key = null; + } + + if(this._clickHandler) { + $removeHandler(this.get_element(), "click", this._clickHandler); + this._clickHandler = null; + } + + Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// A unique key to use to associate check boxes + /// + /// get_key + /// set_key + /// + get_key: function() { + return this._key; + }, + set_key: function(value) { + var keys = Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.Keys; + + if(value != this._key) { + if(this._key) { + var ar = keys[this._key]; + Array.remove(ar, this._key); + } + + this._key = value; + if(value) { + var ar = keys[this._key]; + if(ar == null) + ar = keys[this._key] = []; + + Array.add(ar, this); + } + } + }, + + get_Key: function() { + Sys.Extended.Deprecated("get_Key()", "get_key()"); + return this.get_key(); + }, + set_Key: function(value) { + Sys.Extended.Deprecated("set_Key(value)", "set_key(value)"); + this.set_key(value); + }, + + _onclick: function() { + // Click handler used to ensure only one checkbox in its key is checked + var element = this.get_element(); + var keys = Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.Keys; + + if(this._key && element.checked) { + var ar = keys[this._key]; + var t = this; + + Array.forEach(ar, function(b) { + // Uncheck all other checkboxes in the same key group + // "b" - checkbox in the same key group + if(b != t) { + b.get_element().checked = false; + $common.tryFireEvent(b.get_element(), "change"); + } + }); + } + + this.raise_checked(new Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs(element, this._key)); + }, + + /// + /// Fires when the check box is checked + /// + /// + /// + add_checked: function(handler) { + this.get_events().addHandler('checked', handler); + }, + remove_checked: function(handler) { + this.get_events().removeHandler('checked', handler); + }, + raise_checked: function(eventArgs) { + var handler = this.get_events().getHandler('checked'); + if(handler) + handler(this, eventArgs); + }, + raiseChecked: function(eventArgs) { + Sys.Extended.Deprecated("raiseChecked(eventArgs)", "raise_checked(eventArgs)"); + this.raise_checked(eventArgs); + } +} + +Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.registerClass('Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior', Sys.Extended.UI.BehaviorBase); +Sys.Extended.UI.MutuallyExclusiveCheckBoxBehavior.Keys = {}; + +Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs = function(checkbox, key) { + // Event arguments used when the checked event is raised + // "checkbox" - checkbox that was checked or unchecked + // "key" - the unique key used to associate checkboxes + Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs.initializeBase(this); + + this._key = key; + this._checkbox = checkbox; +} + +Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs.prototype = { + get_checkbox: function() { + // Checkbox that was checked or unchecked + return this._checkbox; + }, + + get_key: function() { + // The unique key used to associate checkboxes + return this._key; + } +} + +Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs.registerClass('Sys.Extended.UI.MutuallyExclusiveCheckBoxEventArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NoBot.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NoBot.debug.js new file mode 100644 index 000000000..4ce8ba218 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NoBot.debug.js @@ -0,0 +1,51 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.NoBotBehavior = function (element) { + Sys.Extended.UI.NoBotBehavior.initializeBase(this, [element]); + + this._challengeScript = ""; +} + +Sys.Extended.UI.NoBotBehavior.prototype = { + + initialize: function () { + Sys.Extended.UI.NoBotBehavior.callBaseMethod(this, "initialize"); + + // Evaluate challenge script and store response in ClientState + var response = eval(this._challengeScript); + Sys.Extended.UI.NoBotBehavior.callBaseMethod(this, "set_ClientState", [response]); + }, + + dispose: function () { + Sys.Extended.UI.NoBotBehavior.callBaseMethod(this, "dispose"); + }, + + /// + /// Challenge script. + /// + /// get_challengeScript + /// set_challengeScript + /// + get_challengeScript: function () { + // JavaScript to be evaluated + return this._challengeScript; + }, + set_challengeScript: function (value) { + if (this._challengeScript != value) { + this._challengeScript = value; + this.raisePropertyChanged('challengeScript'); + } + }, + + get_ChallengeScript: function () { + Sys.Extended.Deprecated("get_ChallengeScript", "get_challengeScript"); + return this.get_challengeScript(); + }, + + set_ChallengeScript: function (value) { + Sys.Extended.Deprecated("set_ChallengeScript", "set_challengeScript"); + this.set_challengeScript(value); + } +} + +Sys.Extended.UI.NoBotBehavior.registerClass("Sys.Extended.UI.NoBotBehavior", Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NumericUpDown.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NumericUpDown.debug.js new file mode 100644 index 000000000..202a69b21 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/NumericUpDown.debug.js @@ -0,0 +1,748 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.NumericUpDownBehavior = function(element) { + // The NumericUpDownBehavior is used add up/down buttons to any textbox + // "element" - DOM Element the behavior is associated with + Sys.Extended.UI.NumericUpDownBehavior.initializeBase(this, [element]); + + // Properties + this._currentValue = null; + this._widthValue = null; + this._targetButtonUpIDValue = null; + this._targetButtonDownIDValue = null; + this._serviceUpPathValue = location.pathname; + this._serviceUpMethodValue = null; + this._serviceDownPathValue = location.pathname; + this._serviceDownMethodValue = null; + this._refValuesValue = null; + this._tagValue = null; + this._elementTextBox = null; + this._step = 1.0; + this._min = -Number.MAX_VALUE; + this._max = Number.MAX_VALUE; + + // Variables + this._bUp = null; + this._bDown = null; + this._stepPrecision = 0; + this._valuePrecision = 0; + + // Delegates + this._clickUpHandler = null; + this._clickDownHandler = null; + this._changeHandler = null; +} + +Sys.Extended.UI.NumericUpDownBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.NumericUpDownBehavior.callBaseMethod(this, 'initialize'); + $common.prepareHiddenElementForATDeviceUpdate(); + + var e = this.get_element(); + this._elementTextBox = e; + + if((this._refValuesValue) || (this._serviceUpMethodValue) || (this._serviceDownMethodValue)) + this._elementTextBox.readOnly = true; + else + this._elementTextBox.readOnly = false; + + // Init TextBox + this.readValue(); + + // Add Event + this._changeHandler = Function.createDelegate(this, this._onChange); + $addHandler(e, 'blur', this._changeHandler); + + // If no button design for include them + if(!this._targetButtonUpIDValue || !this._targetButtonDownIDValue) { + // Change Style TextBox + this._widthValue = Math.max(this._widthValue, 24); + e.style.width = (this._widthValue - 24) + 'px'; + e.style.textAlign = 'center'; + + // Create a new parent for TextBox + var _divContent = document.createElement('DIV'); + _divContent.style.position = 'relative'; + _divContent.style.width = this._widthValue + 'px'; + _divContent.style.fontSize = e.clientHeight + 'px'; + _divContent.style.height = e.clientHeight + 'px'; + _divContent.style.paddingRight = '24px'; + + if(!(Sys.Browser.agent == Sys.Browser.Firefox || Sys.Browser.agent == Sys.Browser.Safari)) + _divContent.style.display = 'inline'; + else + _divContent.style.display = 'inline-block'; + + e.parentNode.insertBefore(_divContent, e); + + var _innerTable = document.createElement('TABLE'), + _innerTbody = document.createElement('TBODY'), + _innerRow1 = document.createElement('TR'), + _innerRow2 = document.createElement('TR'), + _textboxCell = document.createElement('TD'), + _upButtonCell = document.createElement('TD'), + _downButtonCell = document.createElement('TD'); + + _textboxCell.rowSpan = '2'; + + _textboxCell.style.verticalAlign = 'middle'; + _upButtonCell.style.verticalAlign = 'bottom'; + _upButtonCell.style.lineHeight = '0'; + _downButtonCell.style.verticalAlign = 'top'; + _downButtonCell.style.lineHeight = '0'; + + _innerRow1.appendChild(_textboxCell); + _innerRow1.appendChild(_upButtonCell); + _innerRow2.appendChild(_downButtonCell); + _innerTbody.appendChild(_innerRow1); + _innerTbody.appendChild(_innerRow2); + _innerTable.appendChild(_innerTbody); + _divContent.appendChild(_innerTable); + + e.parentNode.removeChild(e); + _textboxCell.appendChild(e); + + _innerTable.style.borderCollapse = 'collapse'; + _innerTable.className += "ajax__numericupdown_container"; + + _innerTable.style.display = 'inline'; + _innerTable.style.position = 'relative'; + + _textboxCell.style.padding = '0'; + _upButtonCell.style.padding = '0'; + _downButtonCell.style.padding = '0'; + _textboxCell.style.margin = '0'; + _upButtonCell.style.margin = '0'; + _downButtonCell.style.margin = '0'; + } + + // If no Up button create it + if(!this._targetButtonUpIDValue) { + this._bUp = document.createElement('input'); + this._bUp.type = 'button'; + this._bUp.id = e.id + '_bUp'; + this._bUp.style.border = 'outset 1px'; + + if(Sys.Browser.agent == Sys.Browser.InternetExplorer) { + this._bUp.style.fontFamily = 'Webdings'; + this._bUp.style.fontSize = '9pt'; + this._bUp.value = '5'; + } else { + this._bUp.style.fontFamily = 'Tahoma, Arial, sans-serif'; + this._bUp.style.fontSize = '5pt'; + this._bUp.value = '\u25B2'; + this._bUp.style.fontWeight = 'bold'; + this._bUp.style.lineHeight = '3pt'; + } + + this._bUp.style.height = '12px'; + this._bUp.style.width = '24px'; + this._bUp.style.overflow = 'hidden'; + this._bUp.style.margin = '0'; + + _upButtonCell.appendChild(this._bUp); + } + + // If no Down button create it + if(!this._targetButtonDownIDValue) { + this._bDown = document.createElement('input'); + this._bDown.type = 'button'; + this._bDown.id = e.id + '_bDown'; + this._bDown.style.border = 'outset 1px'; + + if(Sys.Browser.agent == Sys.Browser.InternetExplorer) { + this._bDown.value = '6'; + this._bDown.style.fontFamily = 'Webdings'; + this._bDown.style.fontSize = '9pt'; + } else { + this._bDown.value = '\u25BC'; + this._bDown.style.fontFamily = 'Tahoma, Arial, sans-serif'; + this._bDown.style.fontSize = '5pt'; + this._bDown.style.fontWeight = 'bold'; + } + + this._bDown.style.height = '12px'; + this._bDown.style.width = '24px'; + this._bDown.style.overflow = 'hidden'; + this._bDown.style.margin = '0'; + + _downButtonCell.appendChild(this._bDown); + } + + // Add button Up Down Event + if(this._bUp == null) + this._bUp = document.getElementById(this._targetButtonUpIDValue); + + if(this._bUp) { + this._clickUpHandler = Function.createDelegate(this, this._clickUp); + $addHandler(this._bUp, 'click', this._clickUpHandler); + } + + if(this._bDown == null) + this._bDown = document.getElementById(this._targetButtonDownIDValue); + + if(this._bDown) { + this._clickDownHandler = Function.createDelegate(this, this._clickDown); + $addHandler(this._bDown, 'click', this._clickDownHandler); + } + }, + + dispose: function() { + if(this._changeHandler) { + $removeHandler(this.get_element(), 'blur', this._changeHandler); + this._changeHandler = null; + } + + if(this._clickUpHandler) + if(this._bUp) { + $removeHandler(this._bUp, 'click', this._clickUpHandler); + this._clickUpHandler = null; + } + + if(this._clickDownHandler) + if(this._bDown) { + $removeHandler(this._bDown, 'click', this._clickDownHandler); + this._clickDownHandler = null; + } + + Sys.Extended.UI.NumericUpDownBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Fires when the current textbox value changes + /// + /// + /// + add_currentChanged: function(handler) { + this.get_events().addHandler('currentChanged', handler); + }, + remove_currentChanged: function(handler) { + this.get_events().removeHandler('currentChanged', handler); + }, + raise_currentChanged: function(eventArgs) { + var handler = this.get_events().getHandler('currentChanged'); + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + handler(this, eventArgs); + } + }, + raiseCurrentChanged: function(eventArgs) { + Sys.Extended.Deprecated("raiseCurrentChanged(eventArgs)", "raise_currentChanged(eventArgs)"); + this.raise_currentChanged(eventArgs); + }, + + _onChange: function() { + this.readValue(); + + if(this._refValuesValue) { + this.setCurrentToTextBox(this._refValuesValue[this._currentValue]); + + if(this._elementTextBox) + this._elementTextBox.readOnly = true; + } else { + this.setCurrentToTextBox(this._currentValue); + + if(this._elementTextBox) + // Make the textbox readonly if its results come from a webservice + this._elementTextBox.readOnly = this._serviceUpMethodValue || this._serviceDownMethodValue; + } + }, + + /// + /// Reads a value of the associated textbox + /// + /// + readValue: function() { + // Parse value of textbox and this._currentValue to be that value. + // this._currentValue = this._min if some there is an exception + // when attempting to parse. + // Parse int or string element of RefValues + + if(this._elementTextBox) { + var v = this._elementTextBox.value; + // if textbox empty this._currentValue = this._min + if(!this._refValuesValue) { + if(!v) { + this._currentValue = this._min; + } else { + try { + this._currentValue = parseFloat(v); + } catch(ex) { + this._currentValue = this._min; + } + } + + if(isNaN(this._currentValue)) + this._currentValue = this._min; + + this.setCurrentToTextBox(this._currentValue); + this._valuePrecision = this._computePrecision(this._currentValue); + } else { + if(!v) { + this._currentValue = 0; + } else { + var find = 0; + for(var i = 0; i < this._refValuesValue.length; i++) + if(v.toLowerCase() == this._refValuesValue[i].toLowerCase()) + find = i; + + this._currentValue = find; + } + + this.setCurrentToTextBox(this._refValuesValue[this._currentValue]); + } + } + }, + + /// + /// Sets a value of the associated textbox + /// + /// Value to set + /// + setCurrentToTextBox: function(value) { + if(this._elementTextBox) { + this._elementTextBox.value = value; + this.raise_currentChanged(value); + + if(document.createEvent) { + var onchangeEvent = document.createEvent('HTMLEvents'); + onchangeEvent.initEvent('change', true, false); + this._elementTextBox.dispatchEvent(onchangeEvent); + } else if(document.createEventObject) { + this._elementTextBox.fireEvent('onchange'); + } + } + }, + + _incrementValue: function(step) { + // Use toFixed/parseFloat to prevent quantization when incrementing + var tmp = parseFloat((this._currentValue + step).toFixed(Math.max(this._stepPrecision, this._valuePrecision))); + + if(step > 0) + this._currentValue = Math.max(Math.min(tmp, this._max), this._min); + else + this._currentValue = Math.min(Math.max(tmp, this._min), this._max); + }, + + _computePrecision: function(value) { + // Compute the precision of the value by counting the number + // of digits in the fractional part of its string representation + // "value" - value + // returns fractional precision of the number + + if(value == Number.Nan) + return 0; + + // Call toString which does not localize, according to ECMA 262 + var str = value.toString(); + if(str) { + var fractionalPart = /\.(\d*)$/; + var matches = str.match(fractionalPart); + if(matches && matches.length == 2 && matches[1]) + return matches[1].length; + } + + return 0; + }, + + /// + /// Combined size of the TextBox and Up/Down buttons. Minimum value 25 + /// + /// + /// This property is not used if you provide custom buttons + /// + /// get_width + /// set_width + /// + get_width: function() { + return this._widthValue; + }, + set_width: function(value) { + if(this._widthValue != value) { + this._widthValue = value; + this.raisePropertyChanged('width'); + } + }, + + get_Width: function() { + Sys.Extended.Deprecated("get_Width()", "get_width()"); + return this.get_width(); + }, + set_Width: function(value) { + Sys.Extended.Deprecated("set_Width(value)", "set_width(value)"); + this.set_width(value); + }, + + /// + /// Custom parameter to pass to the Web Service + /// + /// get_tag + /// set_tag + /// + get_tag: function() { + return this._tagValue; + }, + set_tag: function(value) { + if(this._tagValue != value) { + this._tagValue = value; + this.raisePropertyChanged('tag'); + } + }, + + get_Tag: function() { + Sys.Extended.Deprecated("get_Tag()", "get_tag()"); + return this.get_tag(); + }, + set_Tag: function(value) { + Sys.Extended.Deprecated("set_Tag(value)", "set_tag(value)"); + this.set_tag(value); + }, + + /// + /// A reference to a custom Up button + /// + /// get_targetButtonUpID + /// set_targetButtonUpID + /// + get_targetButtonUpID: function() { + return this._targetButtonUpIDValue; + }, + set_targetButtonUpID: function(value) { + if(this._targetButtonUpIDValue != value) { + this._targetButtonUpIDValue = value; + this.raisePropertyChanged('targetButtonUpID'); + } + }, + + get_TargetButtonUpID: function() { + Sys.Extended.Deprecated("get_TargetButtonUpID()", "get_targetButtonUpID()"); + return this.get_targetButtonUpID(); + }, + set_TargetButtonUpID: function(value) { + Sys.Extended.Deprecated("set_TargetButtonUpID(value)", "set_targetButtonUpID(value)"); + this.set_targetButtonUpID(value); + }, + + /// + /// A reference to a custom Down button + /// + /// get_targetButtonDownID + /// set_targetButtonDownID + /// + get_targetButtonDownID: function() { + return this._targetButtonDownIDValue; + }, + set_targetButtonDownID: function(value) { + if(this._targetButtonDownIDValue != value) { + this._targetButtonDownIDValue = value; + this.raisePropertyChanged('targetButtonDownID'); + } + }, + + get_TargetButtonDownID: function() { + Sys.Extended.Deprecated("get_TargetButtonDownID()", "get_targetButtonDownID()"); + return this.get_targetButtonDownID(); + }, + set_TargetButtonDownID: function(value) { + Sys.Extended.Deprecated("set_TargetButtonDownID(value)", "set_targetButtonDownID(value)"); + this.set_targetButtonDownID(value); + }, + + /// + /// A path to a web service that returns data used to get the next value + /// + /// + /// If the ServiceUpPath property is empty, the PageMethod will be used instead of the Web service + /// + /// get_serviceUpPath + /// set_serviceUpPath + /// + get_serviceUpPath: function() { + return this._serviceUpPathValue; + }, + set_serviceUpPath: function(value) { + if(this._serviceUpPathValue != value) { + this._serviceUpPathValue = value; + this.raisePropertyChanged('serviceUpPath'); + } + }, + + get_ServiceUpPath: function() { + Sys.Extended.Deprecated("get_ServiceUpPath()", "get_serviceUpPath()"); + return this.get_serviceUpPath(); + }, + set_ServiceUpPath: function(value) { + Sys.Extended.Deprecated("set_ServiceUpPath(value)", "set_serviceUpPath(value)"); + this.set_serviceUpPath(value); + }, + + /// + /// A name of the method to call on the Web service (or the name of the PageMethod) to get the next value + /// + /// get_serviceUpMethod + /// set_serviceUpMethod + /// + get_serviceUpMethod: function() { + return this._serviceUpMethodValue; + }, + set_serviceUpMethod: function(value) { + if(this._serviceUpMethodValue != value) { + this._serviceUpMethodValue = value; + this.raisePropertyChanged('serviceUpMethod'); + + if(this._elementTextBox) + this._elementTextBox.readOnly = true; + } + }, + + get_ServiceUpMethod: function() { + Sys.Extended.Deprecated("get_ServiceUpMethod()", "get_serviceUpMethod()"); + return this.get_serviceUpMethod(); + }, + set_ServiceUpMethod: function(value) { + Sys.Extended.Deprecated("set_ServiceUpMethod(value)", "set_serviceUpMethod(value)"); + this.set_serviceUpMethod(value); + }, + + /// + /// A path to a Web service that returns data used to get the previous value + /// + /// + /// If the ServiceDownPath property is empty, the PageMethod will be used instead of the Web service + /// + /// get_serviceDownPath + /// set_serviceDownPath + /// + get_serviceDownPath: function() { + return this._serviceDownPathValue; + }, + set_serviceDownPath: function(value) { + if(this._serviceDownPathValue != value) { + this._serviceDownPathValue = value; + this.raisePropertyChanged('serviceDownPath'); + } + }, + + get_ServiceDownPath: function() { + Sys.Extended.Deprecated("get_ServiceDownPath()", "get_serviceDownPath()"); + return this.get_serviceDownPath(); + }, + set_ServiceDownPath: function(value) { + Sys.Extended.Deprecated("set_ServiceDownPath(value)", "set_serviceDownPath(value)"); + this.set_serviceDownPath(value); + }, + + /// + /// A name of the method to call on the Web service (or the name of the PageMethod) to get the previous value + /// + /// get_serviceDownMethod + /// set_serviceDownMethod + /// + get_serviceDownMethod: function() { + return this._serviceDownMethodValue; + }, + set_serviceDownMethod: function(value) { + if(this._serviceDownMethodValue != value) { + this._serviceDownMethodValue = value; + this.raisePropertyChanged('serviceDownMethod'); + + if(this._elementTextBox) + this._elementTextBox.readOnly = true; + } + }, + + get_ServiceDownMethod: function() { + Sys.Extended.Deprecated("get_ServiceDownMethod()", "get_serviceDownMethod()"); + return this.get_serviceDownMethod(); + }, + set_ServiceDownMethod: function(value) { + Sys.Extended.Deprecated("set_ServiceDownMethod(value)", "set_serviceDownMethod(value)"); + this.set_serviceDownMethod(value); + }, + + /// + /// A list of strings separated by semicolons (;) to be used as an enumeration by NumericUpDown + /// + /// get_refValues + /// set_refValues + /// + get_refValues: function() { + return this._refValuesValue ? this._refValuesValue.join(";") : ""; + }, + set_refValues: function(value) { + if(value != '') { + this._refValuesValue = value.split(';'); + this._onChange(); + + if(this._elementTextBox) + this._elementTextBox.readOnly = true; + } else { + this._refValuesValue = null; + + if(this._elementTextBox) + this._elementTextBox.readOnly = false; + } + + this.raisePropertyChanged('refValues'); + }, + + get_RefValues: function() { + Sys.Extended.Deprecated("get_RefValues()", "get_refValues()"); + return this.get_refValues(); + }, + set_RefValues: function(value) { + Sys.Extended.Deprecated("set_RefValues(value)", "set_refValues(value)"); + this.set_refValues(value); + }, + + /// + /// A step used for simple numeric incrementing and decrementing. The default value is 1 + /// + /// get_step + /// set_step + /// + get_step: function() { + return this._step; + }, + set_step: function(value) { + if(value != this._step) { + this._step = value; + this._stepPrecision = this._computePrecision(value); + this.raisePropertyChanged('step'); + } + }, + + get_Step: function() { + Sys.Extended.Deprecated("get_Step()", "get_step()"); + return this.get_step(); + }, + set_Step: function(value) { + Sys.Extended.Deprecated("set_Step(value)", "set_step(value)"); + this.set_step(value); + }, + + /// + /// The minimum value allowed by the extender + /// + /// + /// Currently, it does not prevent out of range values from being entered into the textbox + /// even if Minimum or Maximum are specified on the extender, but using the up/down buttons + /// should bring the value into the allowed range when clicked + /// + /// get_minimum + /// set_minimum + /// + get_minimum: function() { + return this._min; + }, + set_minimum: function(value) { + if(value != this._min) { + this._min = value; + this.raisePropertyChanged('minimum'); + } + }, + + get_Minimum: function() { + Sys.Extended.Deprecated("get_Minimum()", "get_minimum()"); + return this.get_minimum(); + }, + set_Minimum: function(value) { + Sys.Extended.Deprecated("set_Minimum(value)", "set_minimum(value)"); + this.set_minimum(value); + }, + + /// + /// The maximum value allowed by the extender + /// + /// get_maximum + /// set_maximum + /// + get_maximum: function() { + return this._max; + }, + set_maximum: function(value) { + if(value != this._max) { + this._max = value; + this.raisePropertyChanged('maximum'); + } + }, + + get_Maximum: function() { + Sys.Extended.Deprecated("get_Maximum()", "get_maximum()"); + return this.get_maximum(); + }, + set_Maximum: function(value) { + Sys.Extended.Deprecated("set_Maximum(value)", "set_maximum(value)"); + this.set_maximum(value); + }, + + _clickUp: function(evt) { + // Handler for the Up button's click event + // "evt" - event info + this.readValue(); + + // Proxy WebService + if(this._serviceUpPathValue && this._serviceUpMethodValue) { + // Call the helper web service + Sys.Net.WebServiceProxy.invoke(this._serviceUpPathValue, this._serviceUpMethodValue, false, + { current: this._currentValue, tag: this._tagValue }, + Function.createDelegate(this, this._onMethodUpDownComplete)); + $common.updateFormToRefreshATDeviceBuffer(); + } else { + // Else increment one element on _refValues or juste this._currentValue++ + if(this._refValuesValue) { + if((this._currentValue + 1) < this._refValuesValue.length) { + this._currentValue = this._currentValue + 1; + this.setCurrentToTextBox(this._refValuesValue[this._currentValue]); + } + } else { + this._incrementValue(this._step); + this.setCurrentToTextBox(this._currentValue); + } + } + + if(evt) + evt.preventDefault(); + + return false; + }, + + _clickDown: function(evt) { + this.readValue(); + + // Proxy WebService + if(this._serviceDownPathValue && this._serviceDownMethodValue) { + // Call the helper web service + Sys.Net.WebServiceProxy.invoke(this._serviceDownPathValue, this._serviceDownMethodValue, false, + { current: this._currentValue, tag: this._tagValue }, + Function.createDelegate(this, this._onMethodUpDownComplete)); + $common.updateFormToRefreshATDeviceBuffer(); + } else { + // Else decrement one element on _refValues or juste this._currentValue-- + if(this._refValuesValue) { + if((this._currentValue - 1) >= 0) { + this._currentValue = this._currentValue - 1; + this.setCurrentToTextBox(this._refValuesValue[this._currentValue]); + } + } else { + this._incrementValue(-this._step); + this.setCurrentToTextBox(this._currentValue); + } + } + + if(evt) + evt.preventDefault(); + + return false; + }, + + // Call BackWebServices + _onMethodUpDownComplete: function(result, userContext, methodName) { + this._currentValue = result; + this.setCurrentToTextBox(this._currentValue); + } +} + +Sys.Extended.UI.NumericUpDownBehavior.registerClass('Sys.Extended.UI.NumericUpDownBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PagingBulletedList.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PagingBulletedList.debug.js new file mode 100644 index 000000000..bccbd759b --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PagingBulletedList.debug.js @@ -0,0 +1,618 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.PagingBulletedListBehavior = function(element) { + // The PagingBulletedListBehavior provides sorting and paging of a bulleted list + // "element" - DOM element the behavior is associated with + Sys.Extended.UI.PagingBulletedListBehavior.initializeBase(this, [element]); + + this._indexSizeValue = 1; + this._separatorValue = ' - '; + + //From Server Componant + this._heightValue = null; + this._maxItemPerPage = null; + this._clientSortValue = false; + this._selectIndexCssClassValue = null; + this._unselectIndexCssClassValue = null; + + // Local + this._tabValue = new Array(); + this._tabValueObject = new Array(); + this._tabIndex = new Array(); + this._divContent = null; + this._divContentIndex = null; + this._divContentUl = null; + this._prevIndexSelected = null; + this._indexSelected = 0; + + // Event + this._clickIndex = null; +} + +Sys.Extended.UI.PagingBulletedListBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.PagingBulletedListBehavior.callBaseMethod(this, 'initialize'); + + // ClientState + var clientState = this.get_ClientState(); + if(clientState) { + var stateItems = clientState.split(";"); + + if(stateItems.length) { + this._indexSelected = stateItems[0]; + + if(stateItems[1] == "null") + this._indexSizeValue = null; + else + this._indexSizeValue = stateItems[1]; + + if(stateItems[2] == "null") + this._maxItemPerPage = null; + else + this._maxItemPerPage = stateItems[2]; + + if(stateItems[3] == "true") + this._clientSortValue = true; + else + this._clientSortValue = false; + } + } + + var e = this.get_element(); + // Div content + this._divContent = document.createElement('div'); + // Insert div + e.parentNode.insertBefore(this._divContent, e); + + var liElements = e.childNodes; + + // Create the OnClick Index + this._clickIndex = Function.createDelegate(this, this._onIndexClick); + + var inner, index; + + this._divContentIndex = document.createElement('DIV'); + this._divContentIndex.style.marginBottom = '5px'; + this._divContent.appendChild(this._divContentIndex); + + // Extract LI elements in _tabValueObject + for(var i = 0 ; i < liElements.length; i++) { + if(liElements[i].nodeName == 'LI') { + if((liElements[i].firstChild) && (liElements[i].firstChild.innerHTML)) + inner = liElements[i].firstChild.innerHTML; + else + inner = liElements[i].innerHTML; + + this._tabValueObject[this._tabValueObject.length] = { text: inner, obj: liElements[i], index: i }; + } + } + + // Sort if need + if(this._clientSortValue) + this._tabValueObject.sort(this.liElementSortText); + + // Generate Index and dispatch in TabIndex and TabValue + this._generateIndexAndTabForView(); + + // Remove LI + this._removeChilds(e.childNodes); + + // Add DIV for Index + this._divContentUl = document.createElement('DIV'); + + //Height of DivContent + this._changeHeightDivContent(); + + //Re-insert LI + this._divContentUl.appendChild(e); + this._divContent.appendChild(this._divContentUl); + + this._updateIndexAndView(this._indexSelected); + }, + + _changeHeightDivContent: function() { + // Change the height of the list + if(this._heightValue) { + this._divContentUl.style.overflow = 'scroll'; + this._divContentUl.style.height = (this._heightValue) + 'px'; + } else { + this._divContentUl.style.overflow = ''; + this._divContentUl.style.height = ''; + } + }, + + _createAHrefIndex: function(indexText, indexNumber) { + // Create an index and display it above the list + // "indexText" - text of the index + // "indexNumber" - index + // returns seperator element appended after the new index (so it can be removed later if last) + var spanSeparator; + var aIndex; + + // Create a for Index + aIndex = document.createElement('a'); + aIndex.href = ''; + + // Add _unSelectIndexCssClass by default + if(this._unselectIndexCssClassValue) + Sys.UI.DomElement.addCssClass(aIndex, this._unselectIndexCssClassValue); + aIndex.innerHTML = indexText; + aIndex.tag = indexNumber; + + // Attach event + $addHandler(aIndex, 'click', this._clickIndex); + + // Save a Object in _tabIndex + this._tabIndex[this._tabIndex.length] = aIndex; + this._divContentIndex.appendChild(aIndex); + + // Add SPAN + spanSeparator = document.createElement('SPAN'); + + // Add FEFF carater for not delete the first or last space + spanSeparator.innerHTML = '\uFEFF' + this._separatorValue + '\uFEFF'; + this._divContentIndex.appendChild(spanSeparator); + + // Return Separator for remove the last one + return spanSeparator; + }, + + liElementSortText: function(x, y) { + // Sort function to compare two strings + // "x" - object (of the form {text, index}) + // "y" - object (of the form {text, index}) + // returns -1 if the first is less than the second, 0 if they are equal, 1 if the first is greater than the second + + //Sort by text + if(x.text.toLowerCase() == y.text.toLowerCase()) { + return 0; + } else { + if(x.text.toLowerCase() < y.text.toLowerCase()) + return -1; + else + return 1; + } + }, + + liElementSortIndex: function(x, y) { + // Sort function to compare two indices + // "x" - object (of the form {text, index}) + // "y" - object (of the form {text, index}) + // returns -1 if the first is less than the second, 0 if they are equal, 1 if the first is greater than the second + + //Sort by index (init order) + return x.index - y.index; + }, + + _generateIndexAndTabForView: function() { + // Create the indices + + this._deleteTabIndexAndTabValue(); + this._tabValue = new Array(); + this._tabIndex = new Array(); + var lastSpanSeparator; + + this._removeChilds(this._divContentIndex.childNodes); + + // Cut array _tabValueObject in _tabValue with 1 dimension per 1 index + if(this._maxItemPerPage) { + // If _maxItemPerPage index generation become automatique + if(this._maxItemPerPage > 0) { + var j = -1; + + for(var i = 0; i < this._tabValueObject.length; i++) { + if((i % this._maxItemPerPage) == 0) { + index = this._tabValueObject[i].text; + this._tabValue[++j] = new Array(); + lastSpanSeparator = this._createAHrefIndex(index, j); + } + this._tabValue[j][this._tabValue[j].length] = this._tabValueObject[i].obj; + } + } + } else { + //if Generate index with _indexSizeValue + if(this._indexSizeValue > 0) { + var currentIndex = ''; + var j = -1; + + for(var i = 0; i < this._tabValueObject.length; i++) { + index = this._tabValueObject[i].text.substr(0, this._indexSizeValue).toUpperCase(); + + if(currentIndex != index) { + this._tabValue[++j] = new Array(); + lastSpanSeparator = this._createAHrefIndex(index, j); + currentIndex = index; + } + this._tabValue[j][this._tabValue[j].length] = this._tabValueObject[i].obj; + } + } + } + + //Remove last SpanSeparator + if(lastSpanSeparator) + this._divContentIndex.removeChild(lastSpanSeparator); + }, + + _deleteTabIndexAndTabValue: function() { + // Delete the indices + + //Remove Event + if(this._clickIndex) { + for(var i = 0; i < this._tabIndex.length; i++) { + var aIndex = this._tabIndex[i]; + + if(aIndex) + $removeHandler(aIndex, 'click', this._clickIndex); + } + + this._changeHandler = null; + } + + // Delete _tabIndex + delete this._tabIndex; + + // Delete Dimention two _tabValue[x] + for(var i = 0; i < this._tabValue.length; i++) + delete this._tabValue[i]; + + // Delete _tabValue + delete this._tabValue; + }, + + dispose: function() { + this._deleteTabIndexAndTabValue(); + delete this._tabValueObject; + + Sys.Extended.UI.PagingBulletedListBehavior.callBaseMethod(this, 'dispose'); + }, + + _removeChilds: function(eChilds) { + for(var i = 0; eChilds.length; i++) + eChilds[0].parentNode.removeChild(eChilds[0]); + }, + + _renderHtml: function(index) { + // Display the elements for the given index + // "index" - index + var e = this.get_element(); + + this._removeChilds(e.childNodes); + for(var i = 0; i < this._tabValue[index].length; i++) + e.appendChild(this._tabValue[index][i]); + + // Position scroll to top + this._divContentUl.scrollTop = 0; + }, + + _selectIndex: function(index) { + // Select the first index + + //Add Style Select to first Index + if(this._tabIndex.length > 0) { + if(this._unselectIndexCssClassValue) + Sys.UI.DomElement.removeCssClass(this._tabIndex[index], this._unselectIndexCssClassValue); + if(this._selectIndexCssClassValue) + Sys.UI.DomElement.addCssClass(this._tabIndex[index], this._selectIndexCssClassValue); + + // Save previous Select Index + this._prevIndexSelected = this._tabIndex[index]; + + // Invoke IndexChange + this.raise_indexChanged(this._tabIndex[index]); + } + }, + + _onIndexClick: function(evt) { + // Handle click events raised when the index is changed + // "evt" - event info + + var e = this.get_element(); + + // Get the control that raised the event + var aIndex = evt.target; + + //Change Style for selected index + if(this._selectIndexCssClassValue) + Sys.UI.DomElement.removeCssClass(this._prevIndexSelected, this._selectIndexCssClassValue); + if(this._unselectIndexCssClassValue) + Sys.UI.DomElement.addCssClass(this._prevIndexSelected, this._unselectIndexCssClassValue); + if(this._unselectIndexCssClassValue) + Sys.UI.DomElement.removeCssClass(aIndex, this._unselectIndexCssClassValue); + if(this._selectIndexCssClassValue) + Sys.UI.DomElement.addCssClass(aIndex, this._selectIndexCssClassValue); + + // Save previous index selected + this._prevIndexSelected = aIndex; + + // Clear + this._renderHtml(aIndex.tag); + + // Invoke IndexChange + this.raise_indexChanged(aIndex); + + evt.preventDefault(); + }, + + /// + /// Fires when the selected index changes + /// + /// + /// + add_indexChanged: function(handler) { + this.get_events().addHandler('indexChanged', handler); + }, + remove_indexChanged: function(handler) { + this.get_events().removeHandler('indexChanged', handler); + }, + raise_indexChanged: function(eventArgs) { + // Update the selected index + this._indexSelected = eventArgs.tag; + + var handler = this.get_events().getHandler('indexChanged'); + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + handler(this, eventArgs); + } + + this.set_ClientState(eventArgs.tag + ";" + this.get_indexSize() + ";" + this.get_maxItemPerPage() + ";" + this.get_clientSort()); + }, + raiseIndexChanged: function(eventArgs) { + Sys.Extended.Deprecated("raiseIndexChanged(eventArgs)", "raise_indexChanged(eventArgs)"); + this.raise_indexChanged(eventArgs); + }, + + /// + /// DOM elements of the indices + /// + /// get_tabIndex + /// + get_tabIndex: function() { + return this._tabIndex; + }, + + /// + /// DOM elements of items to display for each index + /// + /// get_tabValue + /// + get_tabValue: function() { + return this._tabValue; + }, + + _updateIndexAndView: function(index) { + // Regenerate the tables of indices and display + + // Re-Generate TabIndex and TabValue + this._generateIndexAndTabForView() + + // Select clientState index or default select first index + if(this._tabIndex.length > 0) { + if(index < this._tabIndex.length) { + this._renderHtml(this._tabIndex[index].tag); + this._selectIndex(index); + } else { + this._renderHtml(this._tabIndex[0].tag); + this._selectIndex(0); + } + } + }, + + /// + /// Bulleted list height + /// + /// get_height + /// set_height + /// + get_height: function() { + return this._heightValue; + }, + set_height: function(value) { + if(this._heightValue != value) { + this._heightValue = value; + + if(this.get_isInitialized()) + // Change Height in the DOM + this._changeHeightDivContent(); + + this.raisePropertyChanged('height'); + } + }, + + get_Height: function() { + Sys.Extended.Deprecated("get_Height()", "get_height()"); + return this.get_height(); + }, + set_Height: function(value) { + Sys.Extended.Deprecated("set_Height(value)", "set_height(value)"); + this.set_height(value); + }, + + /// + /// The number of characters in the index headings (ignored if MaxItemPerPage is set) + /// + /// get_indexSize + /// set_indexSize + /// + get_indexSize: function() { + return this._indexSizeValue; + }, + set_indexSize: function(value) { + if(this._indexSizeValue != value) { + // Clear ClientState to set 0 index + this.set_ClientState("0;" + value + ";" + this.get_maxItemPerPage() + ";" + this.get_clientSort()); + + this._indexSizeValue = value; + if(this.get_isInitialized()) + //Update TabIndex and TabValue and Select first Index + this._updateIndexAndView(0); + + this.raisePropertyChanged('indexSize'); + } + }, + + get_IndexSize: function() { + Sys.Extended.Deprecated("get_IndexSize()", "get_indexSize()"); + return this.get_indexSize(); + }, + set_IndexSize: function(value) { + Sys.Extended.Deprecated("set_IndexSize(value)", "set_indexSize(value)"); + this.set_indexSize(value); + }, + + /// + /// Maximum number of items per page (ignores the IndexSize property) + /// + /// get_maxItemPerPage + /// set_maxItemPerPage + /// + get_maxItemPerPage: function() { + return this._maxItemPerPage; + }, + set_maxItemPerPage: function(value) { + if(this._maxItemPerPage != value) { + // Clear ClientState to set 0 index + this.set_ClientState("0;" + this.get_indexSize() + ";" + value + ";" + this.get_clientSort()); + + this._maxItemPerPage = value; + if(this.get_isInitialized()) + //Update TabIndex and TabValue and Select first Index + this._updateIndexAndView(0); + + this.raisePropertyChanged('maxItemPerPage'); + } + }, + + get_MaxItemPerPage: function() { + Sys.Extended.Deprecated("get_MaxItemPerPage()", "get_maxItemPerPage()"); + return this.get_maxItemPerPage(); + }, + set_MaxItemPerPage: function(value) { + Sys.Extended.Deprecated("set_MaxItemPerPage(value)", "set_maxItemPerPage(value)"); + this.set_maxItemPerPage(value); + }, + + /// + /// Separator text to be placed between indices + /// + /// get_separator + /// set_separator + /// + get_separator: function() { + return this._separatorValue; + }, + set_separator: function(value) { + if(this._separatorValue != value) { + if(value) + this._separatorValue = value; + else + this._separatorValue = ''; + + if(this.get_isInitialized()) + // Update TabIndex and TabValue and Select first Index + this._updateIndexAndView(0); + + this.raisePropertyChanged('separator'); + } + }, + + get_Separator: function() { + Sys.Extended.Deprecated("get_Separator()", "get_separator()"); + return this.get_separator(); + }, + set_Separator: function(value) { + Sys.Extended.Deprecated("set_Separator(value)", "set_separator(value)"); + this.set_separator(value); + }, + + /// + /// Determines whether or not items should be sorted on the client side + /// + /// get_clientSort + /// set_clientSort + /// + get_clientSort: function() { + return this._clientSortValue; + }, + set_clientSort: function(value) { + if(this._clientSortValue != value) { + // Clear ClientState to set 0 index + this.set_ClientState("0;" + this.get_indexSize() + ";" + this.get_maxItemPerPage() + ";" + value); + + this._clientSortValue = value; + if(this.get_isInitialized()) { + if(this._clientSortValue) + this._tabValueObject.sort(this.liElementSortText); + else + this._tabValueObject.sort(this.liElementSortIndex); + + // Update TabIndex and TabValue and Select first Index + this._updateIndexAndView(0); + } + + this.raisePropertyChanged('clientSort'); + } + }, + + get_ClientSort: function() { + Sys.Extended.Deprecated("get_ClientSort()", "get_clientSort()"); + return this.get_clientSort(); + }, + set_ClientSort: function(value) { + Sys.Extended.Deprecated("set_ClientSort(value)", "set_clientSort(value)"); + this.set_clientSort(value); + }, + + /// + /// A CSS class for the selected index + /// + /// get_selectIndexCssClass + /// set_selectIndexCssClass + /// + get_selectIndexCssClass: function() { + return this._selectIndexCssClassValue; + }, + set_selectIndexCssClass: function(value) { + if(this._selectIndexCssClassValue != value) { + this._selectIndexCssClassValue = value; + this.raisePropertyChanged('selectIndexCssClass'); + } + }, + + get_SelectIndexCssClass: function() { + Sys.Extended.Deprecated("get_SelectIndexCssClass()", "get_selectIndexCssClass()"); + return this.get_selectIndexCssClass(); + }, + set_SelectIndexCssClass: function(value) { + Sys.Extended.Deprecated("set_SelectIndexCssClass(value)", "set_selectIndexCssClass(value)"); + this.set_selectIndexCssClass(value); + }, + + /// + /// A CSS class for indices that aren't selected + /// + /// get_unselectIndexCssClass + /// set_unselectIndexCssClass + /// + get_unselectIndexCssClass: function() { + return this._unselectIndexCssClassValue; + }, + set_unselectIndexCssClass: function(value) { + if(this._unselectIndexCssClassValue != value) { + this._unselectIndexCssClassValue = value; + this.raisePropertyChanged('unselectIndexCssClass'); + } + }, + + get_UnselectIndexCssClass: function() { + Sys.Extended.Deprecated("get_UnselectIndexCssClass()", "get_unselectIndexCssClass()"); + return this.get_unselectIndexCssClass(); + }, + set_UnselectIndexCssClass: function(value) { + Sys.Extended.Deprecated("set_UnselectIndexCssClass(value)", "set_unselectIndexCssClass(value)"); + this.set_unselectIndexCssClass(value); + } +} + +Sys.Extended.UI.PagingBulletedListBehavior.registerClass('Sys.Extended.UI.PagingBulletedListBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PasswordStrength.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PasswordStrength.debug.js new file mode 100644 index 000000000..b0823714c --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PasswordStrength.debug.js @@ -0,0 +1,1211 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.PasswordStrengthExtenderBehavior = function(element) { + Sys.Extended.UI.PasswordStrengthExtenderBehavior.initializeBase(this, [element]); + + // The array holding the default textual descriptions for the password strength levels + this._levelArray = new Array(); + this._styleArray = new Array(); + + this._txtPwdStrengthCssClass = null; + this._barBorderCssClass = null; + this._barIndicatorCssClass = null; + this._displayPosition = Sys.Extended.UI.DisplayPosition.RightSide; + this._strengthIndicator = Sys.Extended.UI.StrengthIndicatorTypes.Text; + + this._preferredPasswordLength = 0; + this._minimumNumericCharacters = 0; + this._minimumSymbolCharacters = 0; + this._requiresUpperAndLowerCaseCharacters = false; + this._helpHandleCssClass = ''; + this._helpHandlePosition = Sys.Extended.UI.DisplayPosition.AboveRight; + this._helpText = ''; + this._helpStatusLabelID = null; + + this._displayDiv = null; // The DIV for displaying the textual indicator + this._helpDiv = null; // The DIV that the user can click on to display the password requirements + + this._barOuterDiv = null; // The outer DIV for the bar indicator + this._barInnerDiv = null; // The Inner DIV for the bar indicator + + this._keyPressHandler = null; + this._blurHandler = null; + this._helpClickHandler = null; + this._prefixText = Sys.Extended.UI.Resources.PasswordStrength_StrengthPrompt; + + // The default set of textual strength descriptions + this._txtStrengthDescriptions = Sys.Extended.UI.Resources.PasswordStrength_DefaultStrengthDescriptions; + this._strengthStyles = ''; + this._barIndicatorStyles = ''; + this._txtseparator = ';'; + this._MIN_TXT_LEVEL_COUNT = 2; + this._MAX_TXT_LEVEL_COUNT = 10; + + // The default weighting/ratio used for password strength calculation. + // ...Password Length = 50% + // ...Numerics = 15% + // ...Casing = 15% + // ...Symbols = 20% + this._calcWeightings = "50;15;15;20"; + + this._minLowerCaseChars = 0; + this._minUpperCaseChars = 0; +} + +Sys.Extended.UI.PasswordStrengthExtenderBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.PasswordStrengthExtenderBehavior.callBaseMethod(this, 'initialize'); + + this._createIndicatorDisplayElement(); + + var e = this.get_element(); + + // Create our delegates + this._keyPressHandler = Function.createDelegate(this, this._onKeyPress); + this._blurHandler = Function.createDelegate(this, this._onBlur); + + // Attach events/associate the events with the delegates already defined above + $addHandler(e, 'keyup', this._keyPressHandler); + $addHandler(e, 'blur', this._blurHandler); + + // Set some defaults + if(this._preferredPasswordLength == null || this._preferredPasswordLength == '' || this._preferredPasswordLength <= 0) { + this._preferredPasswordLength = 10; // Set to at least 10 chars as a preferred pwd length, even though this is very small. + // Ideally, it should be set to 20 or greater for a passphrase type scenario. Remember this is preferred, NOT minimum + this.raisePropertyChanged('PreferredPasswordLength'); + } + + if(this._calcWeightings == null || this._calcWeightings == "") { + this._calcWeightings = "50;15;15;20"; + this.raisePropertyChanged('CalculationWeightings'); + } + + // Get our initial password strength calculated values. This performsn an initial calculation and sets up the helptext. + this._getPasswordStrength(); + }, + + _createIndicatorDisplayElement: function() { + if(this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) + this._createBarIndicatorDisplayElement(); + else + this._createTextDisplayElement(); + + // If the Help display DIV was created ok, then set its position. + if(this._createHelpDisplayElement() == true) { + // We need to do this first as we need to find its bounding area and can only do that after its been made visible + $common.setVisible(this._helpDiv, true); + + var bounds = $common.getBounds(this.get_element()); + + var helpBounds = $common.getBounds(this._helpDiv), + posY, + posX, + offset = 3; // 3 pixels for a very small amount of overlap to "connect" the help icon to the textbox + + if(this._helpHandlePosition == "LeftSide") { + posY = bounds.y + ((bounds.height / 2) - (helpBounds.height / 2)); + posX = bounds.x - helpBounds.width; + } else if(this._helpHandlePosition == "BelowRight") { + posY = bounds.y + bounds.height - offset; // Just one pixel for a small overlap + posX = bounds.x + bounds.width - offset; + } else if(this._helpHandlePosition == "BelowLeft") { + posY = bounds.y + bounds.height - offset; + posX = bounds.x - helpBounds.width + offset; + } else if(this._helpHandlePosition == "RightSide") { + posY = bounds.y + ((bounds.height / 2) - (helpBounds.height / 2)); + posX = bounds.x + bounds.width; + } else if(this._helpHandlePosition == "AboveLeft") { + posY = bounds.y - helpBounds.height + offset; + posX = bounds.x - helpBounds.width + offset; + } else { + // This fall through logic gets called if the Help position is "AboveRight" or anything else for that matter + posY = bounds.y - helpBounds.height + offset; + posX = bounds.x + bounds.width - offset; + } + + this._helpDiv.style.top = posY + 'px'; + this._helpDiv.style.left = posX + 'px'; + } + }, + + _createTextDisplayElement: function() { + // Create a DIV element so we can place our own content in there. + // This is for the textual display. + var p = document.createElement("label"); + p.style.position = "absolute"; + p.style.visibility = "hidden"; + p.style.display = "none"; + p.style.zIndex = Sys.Extended.UI.zIndex.PasswordStrengthTextDisplay; + + // Create the control id + if(this.get_element().id) + p.id = this.get_element().id + "_PasswordStrength"; + + this._displayDiv = p; + + this._setTextDisplayLocation(p); + + // Add the DIV element to the document + document.body.appendChild(p); + + this._setTextDisplayStyle(0); + }, + + _setTextDisplayStyle: function(index) { + // Takes care of setting the appropriate CSS class style for the textual strength display + if(this._styleArray.length == 0) { + if(this._txtPwdStrengthCssClass) + this._displayDiv.className = this._txtPwdStrengthCssClass; + else + this._displayDiv.style.backgroundColor = "yellow"; + } else { + this._displayDiv.style.backgroundColor = ""; + if(this._txtPwdStrengthCssClass && + Sys.UI.DomElement.containsCssClass(this._displayDiv, this._txtPwdStrengthCssClass)) { + Sys.UI.DomElement.removeCssClass(this._displayDiv, this._txtPwdStrengthCssClass) + } + this._displayDiv.className = this._styleArray[index]; + } + }, + + _setBarDisplayStyle: function(index) { + // Takes care of setting the appropriate CSS class style for the textual strength display + if(this._barBorderCssClass != '') + this._barOuterDiv.className = this._barBorderCssClass; + else { + d1.style.width = "200px"; + d1.style.borderStyle = "solid"; + d1.style.borderWidth = "1px"; + } + + if(this._styleArray.length == 0) { + if(this._barIndicatorCssClass != '') + this._barInnerDiv.className = this._barIndicatorCssClass; + else + this._barInnerDiv.style.backgroundColor = "red"; + } else { + if(this._barIndicatorCssClass && + Sys.UI.DomElement.containsCssClass(this._barInnerDiv, this._barIndicatorCssClass)) { + Sys.UI.DomElement.removeCssClass(this._barInnerDiv, this._barIndicatorCssClass) + } + this._barInnerDiv.className = this._styleArray[index]; + } + }, + + _createBarIndicatorDisplayElement: function() { + // Create the element for BarIndicator display + var d1 = document.createElement("div"); // outer div + d1.style.position = "absolute"; + d1.style.visibility = "hidden"; + d1.style.display = "none"; + + var d2 = document.createElement("div"); // inner div, the bar itself + d2.style.position = "absolute"; + d2.style.visibility = "hidden"; + d2.style.display = "none"; + + d1.style.height = this.get_element().offsetHeight + 4 + "px"; + + if(this.get_element().id) { + d1.id = this.get_element().id + "_PasswordStrengthBar1"; + d2.id = this.get_element().id + "_PasswordStrengthBar2"; + } + + this._barOuterDiv = d1; + this._barInnerDiv = d2; + + this._extractStyles(); + this._setBarDisplayStyle(0); + + document.body.appendChild(d1); + document.body.appendChild(d2); + + this._setBarDisplayLocation(d1, d2); + }, + + // Create the DIV element that is used to represent the image to click on to display + // the password requirements. If the _requirementsHandleCssClass is set then + // its created and appended to the document and returns true, otherwise it returns + // false and wont be displayed. + _createHelpDisplayElement: function() { + if(this._helpHandleCssClass != '') { + var req = document.createElement("a"); + + req.style.position = "absolute"; + req.style.visibility = "hidden"; + req.style.display = "none"; + req.href = "#"; // fix for work item #8217 + req.title = Sys.Extended.UI.Resources.PasswordStrength_GetHelpRequirements; + + if(this.get_element().id) + req.id = this.get_element().id + "_PasswordStrengthReqDisplay"; + + this._helpClickHandler = Function.createDelegate(this, this._onHelpClick); + $addHandler(req, 'click', this._helpClickHandler); + + this._helpDiv = req; + + this._helpDiv.className = this._helpHandleCssClass; + + if(this.get_element().parentElement != null && this.get_element().parentElement.canHaveChildren) + this.get_element().parentElement.appendChild(req); + else + document.body.appendChild(req); + + return true; + } else + return false; + }, + + _setTextDisplayLocation: function(htmlElement) { + // Whats our current position of the textbox + var location = $common.getLocation(this.get_element()), + bounds = $common.getBounds(this.get_element()), + offsetAmount = 15; + + if(this._displayPosition == Sys.Extended.UI.DisplayPosition.LeftSide) { + htmlElement.style.top = location.y + "px"; + htmlElement.style.left = location.x - bounds.width - offsetAmount + "px"; + } else if(this._displayPosition == "BelowRight") { + htmlElement.style.top = location.y + this.get_element().offsetHeight + "px"; + htmlElement.style.left = location.x + this.get_element().offsetWidth - (this.get_element().offsetWidth / 4) + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowLeft) { + htmlElement.style.top = location.y + this.get_element().offsetHeight + "px"; + htmlElement.style.left = location.x - offsetAmount + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveRight) { + htmlElement.style.top = location.y - this.get_element().offsetHeight + "px"; + htmlElement.style.left = location.x + this.get_element().offsetWidth - (this.get_element().offsetWidth / 4) + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveLeft) { + htmlElement.style.top = location.y - this.get_element().offsetHeight + "px"; + htmlElement.style.left = location.x - offsetAmount + "px"; + } else { + // This fall through logic gets called if the DisplayPositon is "RightSide" or anything else for that matter + htmlElement.style.top = location.y + "px"; + htmlElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + "px"; + } + }, + + _setBarDisplayLocation: function(outerElement, innerElement) { + // Re: issue #1893. If the target element has a display:none, the this.get_element().offsetHeight caclulation is 0, making + // this.get_element().offsetHeight -2 an invalid size. This test circumvents the negative problem, and we also recalc/set the + // inner and outer div height each time this routine is called. + if(this.get_element().offsetHeight > 0) { + var outerBorder = $common.getBorderBox(outerElement), + outerPadding = $common.getPaddingBox(outerElement), + leftIndent = outerBorder.left + outerPadding.left, + topIndent = outerBorder.top + outerPadding.top; + + innerElement.style.height = this.get_element().offsetHeight + "px"; + outerElement.style.height = this.get_element().offsetHeight + "px"; + + var location = $common.getLocation(this.get_element()); + var offsetAmount = 15; + + if(this._displayPosition == Sys.Extended.UI.DisplayPosition.LeftSide) { + // We need to work out how wide the outer/surrounding DIV element is so we can subtract that from the textbox x position. + // For whatever reason, we need to make the outer DIV element visible before the width is accurately reported, otherwise + // it always comes back as zero. Not sure if this is IE6 specific or not. + // To circumvent this, we briefly make the control visible, get its width, then make it invisble again. + + // Fix bug where the bar was displayed initially but then hidden after the calculation. + var initialVisibleState = $common.getVisible(this._barOuterDiv); + + // Get the content size so we take into account padding. + $common.setVisible(this._barOuterDiv, true); + var barBounds = $common.getContentSize(outerElement); + $common.setVisible(this._barOuterDiv, initialVisibleState); + + var _barIndicatorWidth = barBounds.width; + + outerElement.style.top = location.y + "px"; + outerElement.style.left = location.x - parseInt(_barIndicatorWidth) - offsetAmount + "px"; + + innerElement.style.top = location.y + topIndent + "px"; + innerElement.style.left = location.x - parseInt(_barIndicatorWidth) - offsetAmount + leftIndent + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowRight) { + outerElement.style.top = location.y + this.get_element().offsetHeight + "px"; + outerElement.style.left = location.x + this.get_element().offsetWidth + "px"; + + innerElement.style.top = location.y + this.get_element().offsetHeight + topIndent + "px"; + innerElement.style.left = location.x + this.get_element().offsetWidth + leftIndent + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.BelowLeft) { + outerElement.style.top = location.y + this.get_element().offsetHeight + "px"; + outerElement.style.left = location.x + "px"; + + innerElement.style.top = location.y + this.get_element().offsetHeight + topIndent + "px"; + innerElement.style.left = location.x + leftIndent + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveRight) { + outerElement.style.top = location.y - this.get_element().offsetHeight + "px"; + outerElement.style.left = location.x + this.get_element().offsetWidth + "px"; + + innerElement.style.top = location.y - this.get_element().offsetHeight + topIndent + "px"; + innerElement.style.left = location.x + this.get_element().offsetWidth + leftIndent + "px"; + } else if(this._displayPosition == Sys.Extended.UI.DisplayPosition.AboveLeft) { + outerElement.style.top = location.y - this.get_element().offsetHeight + "px"; + outerElement.style.left = location.x + "px"; + + innerElement.style.top = location.y - this.get_element().offsetHeight + topIndent + "px"; + innerElement.style.left = location.x + leftIndent + "px"; + } else { + // This fall through logic gets called if the DisplayPositon is "RightSide" or anything else for that matter + outerElement.style.top = location.y + "px"; + outerElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + "px"; + + innerElement.style.top = location.y + topIndent + "px"; + innerElement.style.left = location.x + this.get_element().offsetWidth + offsetAmount + leftIndent + "px"; + } + } + }, + + // Determine what mode of dispay we are using and show the appropriate indicator + _showStrength: function() { + var e = this.get_element(); + + // Here we check to see if the target element is in readonly mode. If so, then we dont want to + // display the password strength indicator. we do it here because the application may dynamically + // manipulate the readonly state so we need to ensure we check for it each time. + if(e.readOnly == true) + return; + + var pwdStrength = this._getPasswordStrength(); + + if(this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) { + // Set the visibility to true initially so that width and height calculations are accurate + $common.setVisible(this._barOuterDiv, true); + $common.setVisible(this._barInnerDiv, true); + + var index = 0; + if(this._styleArray != null && this._styleArray.length > 0) + index = parseInt(pwdStrength / 100 * (this._styleArray.length - 1)); + + this._setBarDisplayStyle(index); + this._setBarDisplayLocation(this._barOuterDiv, this._barInnerDiv); + this._showStrengthAsBarValue(pwdStrength); + } else { + this._createTextDescriptions(this._txtStrengthDescriptions); + + $common.setVisible(this._displayDiv, true); + + var index = parseInt(pwdStrength / 100 * (this._levelArray.length - 1)), + pwdStrengthText = this._levelArray[index]; + + this._setTextDisplayStyle(index); + this._setTextDisplayLocation(this._displayDiv); + this._showStrengthAsText(pwdStrengthText); + } + }, + + _showStrengthAsText: function(pwdStrengthVal) { + this._displayDiv.innerHTML = this._prefixText + pwdStrengthVal; + }, + + _showStrengthAsBarValue: function(strengthValue) { + var bounds = $common.getContentSize(this._barOuterDiv); + var outerPadding = $common.getPaddingBox(this._barOuterDiv); + var barLength = parseInt(bounds.width * (strengthValue / 100)); + this._barInnerDiv.style.width = barLength + "px"; + }, + + _getPasswordStrength: function() { + // work out how strong the text entered into the textbox is for a password + // and return an integer in between 1 .. 100 (ie. a percentage value) + // 1 = weakest + // 100 = strongest + // Note: Password determination involves + // Length (makes up 50% of score) + // Does it contain numbers (makes up 15% of score) + // Does it contain upper and lowercase (makes up 15% of score) + // Does it contain special symbols (makes up 20% of score) + + var pwd = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value(); + + var pwdRequirements = ''; // This will contain what is required to make this password a 'strong' password. + + var percentTotal = 0; + + // Extract the password calculation weighting ratios + var weights = this._calcWeightings.split(';'); + if(weights.length != 4) + Sys.Debug.assert(null, Sys.Extended.UI.Resources.PasswordStrength_InvalidWeightingRatios); + + var _ratioLen = parseInt(weights[0]); + var _ratioNum = parseInt(weights[1]); + var _ratioCas = parseInt(weights[2]); + var _ratioSym = parseInt(weights[3]); + + // Length Criteria + // Any pwd with a length > 20 is a passphrase and is a good thing + var ratio = pwd.length / this._preferredPasswordLength; + if(ratio > 1) + ratio = 1; + + var lengthStrength = (ratio * _ratioLen); + + // Add to our percentage total + percentTotal += lengthStrength; + + if(ratio < 1) + pwdRequirements = String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingCharacters, this._preferredPasswordLength - pwd.length); + + // Numeric Criteria + // Does it contain numbers? + if(this._minimumNumericCharacters > 0) { + var numbersRegex = new RegExp("[0-9]", "g"), + numCount = this._getRegexCount(numbersRegex, pwd); + + if(numCount >= this._minimumNumericCharacters) + percentTotal += _ratioNum; + + if(numCount < this._minimumNumericCharacters) { + if(pwdRequirements != '') + pwdRequirements += ', '; + pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingNumbers, this._minimumNumericCharacters - numCount); + } + } else { + // If the user has not specified that the password should contain numerics, then we just figure out the ratio according + // to the password length as that is always something + percentTotal += (ratio * _ratioNum); + } + + // Casing Criteria + // Does it contain lowercase AND uppercase Text + if(this._requiresUpperAndLowerCaseCharacters == true || + (typeof (this._requiresUpperAndLowerCaseCharacters) == 'String' && Boolean.parse(this._requiresUpperAndLowerCaseCharacters) == true)) { + var lowercaseRegex = new RegExp("[a-z]", "g"); + var uppercaseRegex = new RegExp("[A-Z]", "g"); + + var numLower = this._getRegexCount(lowercaseRegex, pwd), + numUpper = this._getRegexCount(uppercaseRegex, pwd); + + if(numLower > 0 || numUpper > 0) { + if(numLower >= this._minLowerCaseChars && numUpper >= this._minUpperCaseChars) + percentTotal += _ratioCas; + else { + if(this._minLowerCaseChars > 0 && (this._minLowerCaseChars - numLower) > 0) { + if(pwdRequirements != '') + pwdRequirements += ', '; + pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingLowerCase, this._minLowerCaseChars - numLower); + } + if(this._minUpperCaseChars > 0 && (this._minUpperCaseChars - numUpper) > 0) { + if(pwdRequirements != '') + pwdRequirements += ', '; + pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingUpperCase, this._minUpperCaseChars - numUpper); + } + } + } else { + if(pwdRequirements != '') + pwdRequirements += ', '; + pwdRequirements += Sys.Extended.UI.Resources.PasswordStrength_RemainingMixedCase; + } + } else { + // If the user has not specified that the password should contain numerics, then we just figure out the ratio according + // to the password length as that is always something + percentTotal += (ratio * _ratioCas); + } + + // Symbol Criteria + // Does it contain any special symbols? + if(this._minimumSymbolCharacters > 0) { + var symbolRegex = new RegExp("[^a-z,A-Z,0-9,\x20]", "g"), // related to work item 1034 + numCount = this._getRegexCount(symbolRegex, pwd); + + if(numCount >= this._minimumSymbolCharacters) + percentTotal += _ratioSym; + + if(numCount < this._minimumSymbolCharacters) { + if(pwdRequirements != '') + pwdRequirements += ', '; + pwdRequirements += String.format(Sys.Extended.UI.Resources.PasswordStrength_RemainingSymbols, this._minimumSymbolCharacters - numCount); + } + } else { + // If the user has not specified that the password should contain numerics, then we just figure out the ratio according + // to the password length as that is always something + percentTotal += (ratio * _ratioSym); + } + + this.set_helpText(pwdRequirements); + + return percentTotal; + }, + + // Determines the number of matches according to the regex spec and the test string + _getRegexCount: function(regex, testString) { + var cnt = 0; + + if(testString != null && testString != "") { + var results = testString.match(regex); + if(results != null) + cnt = results.length; + } + + return cnt; + }, + + // Extract the styles (if present) from out comma delimited list + _extractStyles: function() { + // Get our styles for each text indicator in the array + if(this._strengthStyles != null && this._strengthStyles != "") + this._styleArray = this._strengthStyles.split(this._txtseparator); + }, + + // Split the TextStrengthDescriptions property into our internal + // array + _createTextDescriptions: function(descriptions) { + this._levelArray = this._txtStrengthDescriptions.split(this._txtseparator); + + this._extractStyles(); + + // Make sure we have the same number of styles as per the number of actual text descriptions + if(this._styleArray.length > 0 && this._styleArray.length != this._levelArray.length) + Sys.Debug.assert(false, Sys.Extended.UI.Resources.PasswordStrength_InvalidStrengthDescriptionStyles); + + // Check to see that there were enough text descriptions specified and that it didn't exceed our maximum + if(this._levelArray.length < this._MIN_TXT_LEVEL_COUNT || this._levelArray > this._MAX_TXT_LEVEL_COUNT) + Sys.Debug.assert(false, Sys.Extended.UI.Resources.PasswordStrength_InvalidStrengthDescriptions); + }, + + _onKeyPress: function() { + this._showStrength(); + }, + + _onBlur: function() { + if(this._strengthIndicator == Sys.Extended.UI.StrengthIndicatorTypes.BarIndicator) { + $common.setVisible(this._barOuterDiv, false); + $common.setVisible(this._barInnerDiv, false); + } else { + $common.setVisible(this._displayDiv, false); + } + }, + + _onHelpClick: function() { + if(this._helpText == '') + alert(Sys.Extended.UI.Resources.PasswordStrength_Satisfied); + else + alert(this._helpText); + }, + + dispose: function() { + var e = this.get_element(); + + // Detach events + if(this._keyPressHandler) { + $removeHandler(e, 'keyup', this._keyPressHandler); + this._keyPressHandler = null; + } + + if(this._blurHandler) { + $removeHandler(e, 'blur', this._blurHandler); + this._blurHandler = null; + } + + if(this._helpClickHandler) { + $removeHandler(this._helpDiv, 'click', this._helpClickHandler); + this._helpClickHandler = null; + } + + // Clear text display if applicable + if(this._displayDiv) + $common.setVisible(this._displayDiv, false); + + // Clear Bar display if applicable + if(this._barOuterDiv) + $common.setVisible(this._barOuterDiv, false); + if(this._barInnerDiv) + $common.setVisible(this._barInnerDiv, false); + + + if(this._helpHandleCssClass != '' && this._helpDiv) + $common.setVisible(this._helpDiv, false); + + Sys.Extended.UI.PasswordStrengthExtenderBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Preferred length of the password + /// + /// + /// Passwords could be less than this amount but wont reach the 100% calculation + /// if less than this count. This is used to calculate 50% of the percentage strength of the password + /// Ideally, a password should be 20 characters in length to be a strong password. + /// + /// get_preferredPasswordLength + /// set_preferredPasswordLength + /// + get_preferredPasswordLength: function() { + return this._preferredPasswordLength; + }, + set_preferredPasswordLength: function(value) { + if(this._preferredPasswordLength != value) { + this._preferredPasswordLength = value; + this.raisePropertyChanged('preferredPasswordLength'); + } + }, + + get_PreferredPasswordLength: function() { + Sys.Extended.Deprecated("get_PreferredPasswordLength()", "get_preferredPasswordLength()"); + return this.get_preferredPasswordLength(); + }, + set_PreferredPasswordLength: function(value) { + Sys.Extended.Deprecated("set_PreferredPasswordLength(value)", "set_preferredPasswordLength(value)"); + this.set_preferredPasswordLength(value); + }, + + /// + /// Minimum number of numeric characters + /// + /// + /// If there are less than this property, then the password is not + /// considered strong. If there are equal to or more than this value, + /// then this will contribute 15% to the overall password strength percentage value. + /// + /// get_minimumNumericCharacters + /// set_minimumNumericCharacters + /// + get_minimumNumericCharacters: function() { + return this._minimumNumericCharacters; + }, + set_minimumNumericCharacters: function(value) { + if(this._minimumNumericCharacters != value) { + this._minimumNumericCharacters = value; + this.raisePropertyChanged('minimumNumericCharacters'); + } + }, + + get_MinimumNumericCharacters: function() { + Sys.Extended.Deprecated("get_MinimumNumericCharacters()", "get_minimumNumericCharacters()"); + return this.get_minimumNumericCharacters(); + }, + set_MinimumNumericCharacters: function(value) { + Sys.Extended.Deprecated("set_MinimumNumericCharacters(value)", "set_minimumNumericCharacters(value)"); + this.set_minimumNumericCharacters(value); + }, + + /// + /// Minimum number of symbol characters (ex. $ ^ *) + /// + /// + /// If there are less than this property, then the password is not considered strong. + /// If there are equal to or more than this value, then this will contribute 15% to the overall + /// password strength percentage value. + /// + /// get_minimumSymbolCharacters + /// set_minimumSymbolCharacters + /// + get_minimumSymbolCharacters: function() { + return this._minimumSymbolCharacters; + }, + set_minimumSymbolCharacters: function(value) { + if(this._minimumSymbolCharacters != value) { + this._minimumSymbolCharacters = value; + this.raisePropertyChanged('minimumSymbolCharacters'); + } + }, + + get_MinimumSymbolCharacters: function() { + Sys.Extended.Deprecated("get_MinimumSymbolCharacters()", "get_minimumSymbolCharacters()"); + return this.get_minimumSymbolCharacters(); + }, + set_MinimumSymbolCharacters: function(value) { + Sys.Extended.Deprecated("set_MinimumSymbolCharacters(value)", "set_minimumSymbolCharacters(value)"); + this.set_minimumSymbolCharacters(value); + }, + + /// + /// Specifies whether mixed case characters are required + /// + /// + /// Determines if mixed case passwords are required to be considered strong. + /// If true, then there must be at least one occurrence of mixed case + /// (upper and lower) letters in the password to be considered strong. If there is, + /// this will contribute 20% to the overall password strength percentage value. + /// + /// get_requiresUpperAndLowerCaseCharacters + /// set_requiresUpperAndLowerCaseCharacters + /// + get_requiresUpperAndLowerCaseCharacters: function() { + return this._requiresUpperAndLowerCaseCharacters; + }, + set_requiresUpperAndLowerCaseCharacters: function(value) { + if(this._requiresUpperAndLowerCaseCharacters != value) { + this._requiresUpperAndLowerCaseCharacters = value; + this.raisePropertyChanged('requiresUpperAndLowerCaseCharacters'); + } + }, + + get_RequiresUpperAndLowerCaseCharacters: function() { + Sys.Extended.Deprecated("get_RequiresUpperAndLowerCaseCharacters()", "get_requiresUpperAndLowerCaseCharacters()"); + return this.get_requiresUpperAndLowerCaseCharacters(); + }, + set_RequiresUpperAndLowerCaseCharacters: function(value) { + Sys.Extended.Deprecated("set_RequiresUpperAndLowerCaseCharacters(value)", "set_requiresUpperAndLowerCaseCharacters(value)"); + this.set_requiresUpperAndLowerCaseCharacters(value); + }, + + /// + /// CSS class applied to the text display when StrengthIndicatorType=Text + /// + /// get_textCssClass + /// set_textCssClass + /// + get_textCssClass: function() { + return this._txtPwdStrengthCssClass; + }, + set_textCssClass: function(value) { + if(this._txtPwdStrengthCssClass != value) { + this._txtPwdStrengthCssClass = value; + this.raisePropertyChanged('textCssClass'); + } + }, + + get_TextCssClass: function() { + Sys.Extended.Deprecated("get_TextCssClass()", "get_textCssClass()"); + return this.get_textCssClass(); + }, + set_TextCssClass: function(value) { + Sys.Extended.Deprecated("set_TextCssClass(value)", "set_textCssClass(value)"); + this.set_textCssClass(value); + }, + + /// + /// CSS class applied to the bar indicator's border when StrengthIndicatorType=BarIndicator + /// + /// get_barBorderCssClass + /// set_barBorderCssClass + /// + get_barBorderCssClass: function() { + return this._barBorderCssClass; + }, + set_barBorderCssClass: function(value) { + if(this._barBorderCssClass != value) { + this._barBorderCssClass = value; + this.raisePropertyChanged('barBorderCssClass'); + } + }, + + get_BarBorderCssClass: function() { + Sys.Extended.Deprecated("get_BarBorderCssClass()", "get_barBorderCssClass()"); + return this.get_barBorderCssClass(); + }, + set_BarBorderCssClass: function(value) { + Sys.Extended.Deprecated("set_BarBorderCssClass(value)", "set_barBorderCssClass(value)"); + this.set_barBorderCssClass(value); + }, + + /// + /// CSS class applied to the bar indicator's inner bar when StrengthIndicatorType=BarIndicator + /// + /// get_barIndicatorCssClass + /// set_barIndicatorCssClass + /// + get_barIndicatorCssClass: function() { + return this._barIndicatorCssClass; + }, + set_barIndicatorCssClass: function(value) { + if(this._barIndicatorCssClass != value) { + this._barIndicatorCssClass = value; + this.raisePropertyChanged('barIndicatorCssClass'); + } + }, + + get_BarIndicatorCssClass: function() { + Sys.Extended.Deprecated("get_BarIndicatorCssClass()", "get_barIndicatorCssClass()"); + return this.get_barIndicatorCssClass(); + }, + set_BarIndicatorCssClass: function(value) { + Sys.Extended.Deprecated("set_BarIndicatorCssClass(value)", "set_barIndicatorCssClass(value)"); + this.set_barIndicatorCssClass(value); + }, + + /// + /// Positioning of the strength indicator relative to the target control + /// + /// get_displayPosition + /// set_displayPosition + /// + get_displayPosition: function() { + return this._displayPosition; + }, + set_displayPosition: function(value) { + if(this._displayPosition != value) { + this._displayPosition = value; + this.raisePropertyChanged('displayPosition'); + } + }, + + get_DisplayPosition: function() { + Sys.Extended.Deprecated("get_DisplayPosition()", "get_displayPosition()"); + return this.get_displayPosition(); + }, + set_DisplayPosition: function(value) { + Sys.Extended.Deprecated("set_DisplayPosition(value)", "set_displayPosition(value)"); + this.set_displayPosition(value); + }, + + /// + /// Text prefixed to the display text when StrengthIndicatorType=Text + /// + /// get_prefixText + /// set_prefixText + /// + get_prefixText: function() { + return this._prefixText; + }, + set_prefixText: function(value) { + if(this._prefixText != value) { + this._prefixText = value; + this.raisePropertyChanged('prefixText'); + } + }, + + get_PrefixText: function() { + Sys.Extended.Deprecated("get_PrefixText()", "get_prefixText()"); + return this.get_prefixText(); + }, + set_PrefixText: function(value) { + Sys.Extended.Deprecated("set_PrefixText(value)", "set_prefixText(value)"); + this.set_prefixText(value); + }, + + /// + /// Strength indicator type (Text or BarIndicator) + /// + /// + /// BarIndicator - progress bar indicating password strength + /// Text - low, medium, high or excellent + /// + /// get_strengthIndicatorType + /// set_strengthIndicatorType + /// + get_strengthIndicatorType: function() { + return this._strengthIndicator; + }, + set_strengthIndicatorType: function(value) { + if(this._strengthIndicator != value) { + this._strengthIndicator = value; + this.raisePropertyChanged('strengthIndicatorType'); + } + }, + + get_StrengthIndicatorType: function() { + Sys.Extended.Deprecated("get_StrengthIndicatorType()", "get_strengthIndicatorType()"); + return this.get_strengthIndicatorType(); + }, + set_StrengthIndicatorType: function(value) { + Sys.Extended.Deprecated("set_StrengthIndicatorType(value)", "set_strengthIndicatorType(value)"); + this.set_strengthIndicatorType(value); + }, + + /// + /// List of semi-colon separated descriptions used when StrengthIndicatorType=Text + /// (Minimum of 2, maximum of 10; order is weakest to strongest) + /// + /// + /// Example: None;Weak;Medium;Strong;Excellent + /// + /// get_textStrengthDescriptions + /// set_textStrengthDescriptions + /// + get_textStrengthDescriptions: function() { + return this._txtStrengthDescriptions; + }, + set_textStrengthDescriptions: function(value) { + if(value != null && value != '' && value != this._txtStrengthDescriptions) { + this._txtStrengthDescriptions = value; + this.raisePropertyChanged('textStrengthDescriptions'); + } + }, + + get_TextStrengthDescriptions: function() { + Sys.Extended.Deprecated("get_TextStrengthDescriptions()", "get_textStrengthDescriptions()"); + return this.get_textStrengthDescriptions(); + }, + set_TextStrengthDescriptions: function(value) { + Sys.Extended.Deprecated("set_TextStrengthDescriptions(value)", "set_textStrengthDescriptions(value)"); + this.set_textStrengthDescriptions(value); + }, + + /// + /// List of semi-colon separated CSS classes that are used depending on the password's strength. + /// + /// + /// This property will override the BarIndicatorCssClass / TextIndicatorCssClass property if present. + /// The BarIndicatorCssClass / TextIndicatorCssClass property differs in that it attributes one + /// CSS style to the BarIndicator or Text Strength indicator (depending on which type is chosen) + /// regardless of password strength. This property will cause the style to change based on the password + /// strength and also to the number of styles specified in this property. For example, if 2 styles are + /// defined like StrengthStyles="style1;style2" then style1 is applied when the password strength is less + /// than 50%, and style2 is applied when password strength is >= 50%. This property can have up to 10 styles. + /// + /// get_strengthStyles + /// set_strengthStyles + /// + get_strengthStyles: function() { + return this._strengthStyles; + }, + set_strengthStyles: function(value) { + if(value != null && value != '' && value != this._strengthStyles) { + this._strengthStyles = value; + this.raisePropertyChanged('strengthStyles'); + } + }, + + get_StrengthStyles: function() { + Sys.Extended.Deprecated("get_StrengthStyles()", "get_strengthStyles()"); + return this.get_strengthStyles(); + }, + set_StrengthStyles: function(value) { + Sys.Extended.Deprecated("set_StrengthStyles(value)", "set_strengthStyles(value)"); + this.set_strengthStyles(value); + }, + + /// + /// A semi-colon delimited string that specifies the styles applicable to each + /// string descriptions for the password strength when using a textual display + /// + /// + /// Deprecated. Use StrengthStyles instead + /// + /// get_TextStrengthDescriptionStyles + /// set_TextStrengthDescriptionStyles + /// + get_TextStrengthDescriptionStyles: function() { + Sys.Extended.Deprecated("get_TextStrengthDescriptionStyles()", "get_strengthStyles()"); + return this.get_strengthStyles(); + }, + set_TextStrengthDescriptionStyles: function(value) { + Sys.Extended.Deprecated("set_TextStrengthDescriptionStyles(value)", "set_strengthStyles(value)"); + this.set_strengthStyles(value); + }, + + /// + /// CSS class applied to the help element used to display a dialog box + /// describing the password requirements + /// + /// + /// This is used so that the user can click on this image and get a display + /// on what is required to make the password strong according to the current properties + /// + /// get_helpHandleCssClass + /// set_helpHandleCssClass + /// + get_helpHandleCssClass: function() { + return this._helpHandleCssClass; + }, + set_helpHandleCssClass: function(value) { + if(this._helpHandleCssClass != value) { + this._helpHandleCssClass = value; + this.raisePropertyChanged('helpHandleCssClass'); + } + }, + + get_HelpHandleCssClass: function() { + Sys.Extended.Deprecated("get_HelpHandleCssClass()", "get_helpHandleCssClass()"); + return this.get_helpHandleCssClass(); + }, + set_HelpHandleCssClass: function(value) { + Sys.Extended.Deprecated("set_HelpHandleCssClass(value)", "set_helpHandleCssClass(value)"); + this.set_helpHandleCssClass(value); + }, + + /// + /// Positioning of the help handle element relative to the target control + /// + /// get_helpHandlePosition + /// set_helpHandlePosition + /// + get_helpHandlePosition: function() { + return this._helpHandlePosition; + }, + set_helpHandlePosition: function(value) { + if(this._helpHandlePosition != value) { + this._helpHandlePosition = value; + this.raisePropertyChanged('helpHandlePosition'); + } + }, + + get_HelpHandlePosition: function() { + Sys.Extended.Deprecated("get_HelpHandlePosition()", "get_helpHandlePosition()"); + return this.get_helpHandlePosition(); + }, + set_HelpHandlePosition: function(value) { + Sys.Extended.Deprecated("set_HelpHandlePosition(value)", "set_helpHandlePosition(value)"); + this.set_helpHandlePosition(value); + }, + + /// + /// List of semi-colon separated numeric values used to determine the weighting of a strength characteristic. + /// + /// + /// There must be 4 values specified which must total 100. + /// The default weighting values are defined as 50;15;15;20. + /// This corresponds to password length is 50% of the strength calculation, Numeric criteria is 15% of + /// strength calculation, casing criteria is 15% of calculation, and symbol criteria is 20% of calculation. + /// So the format is 'A;B;C;D' where A = length weighting, B = numeric weighting, C = casing weighting, D = symbol weighting. + /// + /// get_calculationWeightings + /// set_calculationWeightings + /// + get_calculationWeightings: function() { + return this._calcWeightings; + }, + set_calculationWeightings: function(value) { + if(this._calcWeightings != value) { + this._calcWeightings = value; + this.raisePropertyChanged('calculationWeightings'); + } + }, + + get_CalculationWeightings: function() { + Sys.Extended.Deprecated("get_CalculationWeightings()", "get_calculationWeightings()"); + return this.get_calculationWeightings(); + }, + set_CalculationWeightings: function(value) { + Sys.Extended.Deprecated("set_CalculationWeightings(value)", "set_calculationWeightings(value)"); + this.set_calculationWeightings(value); + }, + + /// + /// Help text to show + /// + /// get_helpText + /// set_helpText + /// + get_helpText: function() { + return this._helpText; + }, + set_helpText: function(value) { + if(this._helpStatusLabelID) { + var label = $get(this._helpStatusLabelID); + if(label) + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value().length > 0) + label.innerHTML = value; + else + label.innerHTML = ""; + } + + if(this._helpText != value) { + this._helpText = value; + this.raisePropertyChanged('helpText'); + } + }, + + get_HelpText: function() { + Sys.Extended.Deprecated("get_HelpText()", "get_helpText()"); + return this.get_helpText(); + }, + set_HelpText: function(value) { + Sys.Extended.Deprecated("set_HelpText(value)", "set_helpText(value)"); + this.set_helpText(value); + }, + + /// + /// Minimum number of lowercase characters required when requiring mixed case + /// characters as part of your password strength considerations + /// + /// + /// Only in effect if RequiresUpperAndLowerCaseCharacters property is true. + /// The default value is 0 which means this property is not in effect and + /// there is no minimum limit. + /// + /// get_minimumLowerCaseCharacters + /// set_minimumLowerCaseCharacters + /// + get_minimumLowerCaseCharacters: function() { + return this._minLowerCaseChars; + }, + set_minimumLowerCaseCharacters: function(value) { + this._minLowerCaseChars = value; + }, + + get_MinimumLowerCaseCharacters: function() { + Sys.Extended.Deprecated("get_MinimumLowerCaseCharacters()", "get_minimumLowerCaseCharacters()"); + return this.get_minimumLowerCaseCharacters(); + }, + set_MinimumLowerCaseCharacters: function(value) { + Sys.Extended.Deprecated("set_MinimumLowerCaseCharacters(value)", "set_minimumLowerCaseCharacters(value)"); + this.set_minimumLowerCaseCharacters(value); + }, + + /// + /// Minimum number of uppercase characters required when requiring mixed case + /// characters as part of your password strength considerations. + /// + /// + /// Only in effect if RequiresUpperAndLowerCaseCharacters property is true. + /// The default value is 0 which means this property is not in effect and + /// there is no minimum limit. + /// + /// get_minimumUpperCaseCharacters + /// set_minimumUpperCaseCharacters + /// + get_minimumUpperCaseCharacters: function() { + return this._minUpperCaseChars; + }, + set_minimumUpperCaseCharacters: function(value) { + this._minUpperCaseChars = value; + }, + + get_MinimumUpperCaseCharacters: function() { + Sys.Extended.Deprecated("get_MinimumUpperCaseCharacters()", "get_minimumUpperCaseCharacters()"); + return this.get_minimumUpperCaseCharacters(); + }, + set_MinimumUpperCaseCharacters: function(value) { + Sys.Extended.Deprecated("set_MinimumUpperCaseCharacters(value)", "set_minimumUpperCaseCharacters(value)"); + this.set_minimumUpperCaseCharacters(value); + }, + + /// + /// Control ID of the label used to display help text + /// + /// get_helpStatusLabelID + /// set_helpStatusLabelID + /// + get_helpStatusLabelID: function() { + return this._helpStatusLabelID; + }, + set_helpStatusLabelID: function(value) { + if(this._helpStatusLabelID != value) { + this._helpStatusLabelID = value; + this.raisePropertyChanged('helpStatusLabelID'); + } + }, + + get_HelpStatusLabelID: function() { + Sys.Extended.Deprecated("get_HelpStatusLabelID()", "get_helpStatusLabelID()"); + return this.get_helpStatusLabelID(); + }, + set_HelpStatusLabelID: function(value) { + Sys.Extended.Deprecated("set_HelpStatusLabelID(value)", "set_helpStatusLabelID(value)"); + this.set_helpStatusLabelID(value); + } +} + +Sys.Extended.UI.PasswordStrengthExtenderBehavior.registerClass('Sys.Extended.UI.PasswordStrengthExtenderBehavior', Sys.Extended.UI.BehaviorBase); + +// Register enumerations + +Sys.Extended.UI.StrengthIndicatorTypes = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.DisplayPosition = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.StrengthIndicatorTypes.prototype = { + Text: 0, + BarIndicator: 1 +} + +Sys.Extended.UI.DisplayPosition.prototype = { + RightSide: 0, + AboveRight: 1, + AboveLeft: 2, + LeftSide: 3, + BelowRight: 4, + BelowLeft: 5 +} + +Sys.Extended.UI.DisplayPosition.registerEnum('Sys.Extended.UI.DisplayPosition'); +Sys.Extended.UI.StrengthIndicatorTypes.registerEnum('Sys.Extended.UI.StrengthIndicatorTypes'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PieChart.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PieChart.debug.js new file mode 100644 index 000000000..0023a94d3 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PieChart.debug.js @@ -0,0 +1,246 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.PieChart = function(element) { + Sys.Extended.UI.PieChart.initializeBase(this, [element]); + var id = this.get_id(); + id = id.replace("_ctl00", ""); + this._parentDiv = document.getElementById(id + "__ParentDiv"); + + this._chartWidth = '300'; + this._chartHeight = '300'; + this._chartTitle = ''; + this._pieChartClientValues = null; + this._theme = 'PieChart'; + this._chartTitleColor = ''; + this.charLength = 3.5; +} + +Sys.Extended.UI.PieChart.prototype = { + + initialize: function() { + Sys.Extended.UI.PieChart.callBaseMethod(this, "initialize"); + + if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) + throw 'Current version of browser does not support SVG.'; + + this.generatePieChart(); + }, + + dispose: function() { + Sys.Extended.UI.PieChart.callBaseMethod(this, "dispose"); + }, + + generatePieChart: function() { + var radius = parseInt(this._chartWidth) > parseInt(this._chartHeight) ? (parseInt(this._chartHeight) - 10) / 3 : (parseInt(this._chartWidth) - 10) / 3, + startX = parseInt(this._chartWidth) / 2, + startY = parseInt(this._chartHeight) / 2.25; + + // initialize SVG + var svgContents = String.format('', this._theme); + svgContents = String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + ''; + svgContents = svgContents + String.format('', radius, startX, startY); + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + ''; + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight); + svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10); + // Set Title of Chart + svgContents = svgContents + String.format('{2}', parseInt(this._chartWidth) / 2 - (this._chartTitle.length * this.charLength), parseInt(this._chartHeight) * 5 / 100, this._chartTitle, this._chartTitleColor); + + // Legend Area + var legendAreaStartHeight = (parseInt(this._chartHeight) * 82 / 100) + 5, + legendBoxWidth = 7.5, + legendBoxHeight = 7.5, + spaceInLegendContents = 5; + + // Get length of text to display in legend + var legendCharLength = 0; + for(var i = 0; i < this._pieChartClientValues.length; i++) + legendCharLength = legendCharLength + this._pieChartClientValues[i].Category.length; + + var legendAreaWidth = Math.round((legendCharLength * 5) / 2) + Math.round((legendBoxWidth + (spaceInLegendContents * 2)) * this._pieChartClientValues.length), + isLegendNextLine = false; + + if(legendAreaWidth > parseInt(this._chartWidth) / 2) { + legendAreaWidth = legendAreaWidth / 2; + isLegendNextLine = true; + } + + svgContents = svgContents + ''; + svgContents = svgContents + String.format('', parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2), legendAreaStartHeight, parseInt(this._chartWidth) * 40 / 100 + (legendAreaWidth / 2), Math.round(parseInt(this._chartHeight) * 97.5 / 100)); + + var startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + 5 + legendBoxWidth + spaceInLegendContents, + nextStartText = startText, + startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + 5, + nextStartLegend = startLegend; + + for(var i = 0; i < this._pieChartClientValues.length; i++) { + if(isLegendNextLine && i == Math.round(this._pieChartClientValues.length / 2)) { + startText = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + 5 + legendBoxWidth + spaceInLegendContents; + nextStartText = startText; + startLegend = parseInt(this._chartWidth) * 40 / 100 - (legendAreaWidth / 2) + 5; + nextStartLegend = startLegend; + legendAreaStartHeight = (parseInt(this._chartHeight) * 89 / 100) + 5; + isLegendNextLine = false; + } + + startLegend = nextStartLegend; + startText = nextStartText; + svgContents = svgContents + String.format('', startLegend, legendAreaStartHeight + legendBoxHeight, startLegend + legendBoxWidth, legendAreaStartHeight + 15, i + 1, this._pieChartClientValues[i].PieChartValueColor, this._pieChartClientValues[i].PieChartValueStrokeColor); + svgContents = svgContents + String.format('{2}', startText, legendAreaStartHeight + 15, this._pieChartClientValues[i].Category); + + if(this._pieChartClientValues[i].Category.length > 10) { + nextStartLegend = startLegend + (this._pieChartClientValues[i].Category.length * 5.5) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = startText + (this._pieChartClientValues[i].Category.length * 5.5) + legendBoxWidth + (spaceInLegendContents * 2); + } else { + nextStartLegend = nextStartLegend + (this._pieChartClientValues[i].Category.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + nextStartText = nextStartText + (this._pieChartClientValues[i].Category.length * 6) + legendBoxWidth + (spaceInLegendContents * 2); + } + } + svgContents = svgContents + ''; + + // Draw PieChart + var categoryValue = 0, + totalValue = 0, + angle = 0, + radAngle = 0, + textRadAngle = 0, + endX = 0, + endY = 0, + arc = 0, + lastEndX = startX, + lastEndY = startY - radius, + textX = startX, + textY = startY - radius; + + for(var i = 0; i < this._pieChartClientValues.length; i++) + totalValue = totalValue + Math.abs(parseFloat(this._pieChartClientValues[i].Data)); + + this._parentDiv.innerHTML = svgContents; + this.drawSegments(this, 0, categoryValue, totalValue, radius, angle, radAngle, textRadAngle, startX, endX, startY, endY, textX, textY, lastEndX, lastEndY, arc); + }, + + drawSegments: function (me, index, categoryValue, totalValue, radius, angle, radAngle, textRadAngle, startX, endX, startY, endY, textX, textY, lastEndX, lastEndY, arc) { + var absClientValues = Math.abs(parseFloat(me._pieChartClientValues[index].Data)); + categoryValue = categoryValue + absClientValues; + angle = (categoryValue / totalValue) * 360; + radAngle = angle * (Math.PI / 180); + textRadAngle = (categoryValue - absClientValues / 2) / totalValue * 360; + textRadAngle = textRadAngle * (Math.PI / 180); + endX = parseFloat(Math.sin(radAngle) * radius); + endY = parseFloat(Math.cos(radAngle) * radius); + textX = parseFloat(Math.sin(textRadAngle) * (radius + 10)); + textY = parseFloat(Math.cos(textRadAngle) * (radius + 10)); + + textX = (startX + textX) > startX ? startX + textX : (startX + textX) - (me._pieChartClientValues[index].Data.toString().length * this.charLength); + textY = (startY + (-1 * textY)) < startY ? startY + (-1 * textY) : startY + (-1 * textY) + 10; + if (absClientValues > totalValue / 2) { + arc = 1; + } + else { + arc = 0; + } + me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('', '') + String.format('', lastEndX, lastEndY, radius, arc, startX + endX, startY + (-1 * endY), startX, startY, index + 1, me._pieChartClientValues[index].PieChartValueColor, me._pieChartClientValues[index].PieChartValueStrokeColor) + String.format('{2}', textX, textY, me._pieChartClientValues[index].Data) + ''; + + lastEndX = startX + endX; + lastEndY = startY + (-1 * endY); + index++; + + if(index < me._pieChartClientValues.length) // if the counter < series length, call the loop function + setTimeout(function() { + me.drawSegments(me, index, categoryValue, totalValue, radius, angle, radAngle, textRadAngle, startX, endX, startY, endY, textX, textY, lastEndX, lastEndY, arc); + }, 400); + }, + + /// + /// Width of the chart + /// + /// get_chartWidth + /// set_chartWidth + /// + get_chartWidth: function() { + return this._chartWidth; + }, + set_chartWidth: function(value) { + this._chartWidth = value; + }, + + /// + /// Height of the chart + /// + /// get_chartHeight + /// set_chartHeight + /// + get_chartHeight: function() { + return this._chartHeight; + }, + set_chartHeight: function(value) { + this._chartHeight = value; + }, + + /// + /// A title of the chart + /// + /// get_chartTitle + /// set_chartTitle + /// + get_chartTitle: function() { + return this._chartTitle; + }, + set_chartTitle: function(value) { + this._chartTitle = value; + }, + + /// + /// Provides the list of PieChartValues + /// + /// get_pieChartClientValues + /// set_pieChartClientValues + /// + get_pieChartClientValues: function() { + return this._pieChartClientValues; + }, + set_pieChartClientValues: function(value) { + this._pieChartClientValues = value; + }, + + get_PieChartClientValues: function() { + Sys.Extended.Deprecated("get_PieChartClientValues()", "get_pieChartClientValues()"); + return this.get_pieChartClientValues(); + }, + set_PieChartClientValues: function(value) { + Sys.Extended.Deprecated("set_PieChartClientValues(value)", "set_pieChartClientValues(value)"); + this.set_pieChartClientValues(value); + }, + + /// + /// A theme of the chart + /// + /// get_theme + /// set_theme + /// + get_theme: function() { + return this._theme; + }, + set_theme: function(value) { + this._theme = value; + }, + + /// + /// Font color of the chart title + /// + /// get_chartTitleColor + /// set_chartTitleColor + /// + get_chartTitleColor: function() { + return this._chartTitleColor; + }, + set_chartTitleColor: function(value) { + this._chartTitleColor = value; + } +}; + +Sys.Extended.UI.PieChart.registerClass("Sys.Extended.UI.PieChart", Sys.Extended.UI.ControlBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Popup.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Popup.debug.js new file mode 100644 index 000000000..50c887646 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Popup.debug.js @@ -0,0 +1,691 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.PopupBehavior = function(element) { + // The PopupBehavior is used to show/hide an element at a position + // relative to another element + // "element" - the DOM element the behavior is associated with + Sys.Extended.UI.PopupBehavior.initializeBase(this, [element]); + + this._x = 0; + this._y = 0; + this._positioningMode = Sys.Extended.UI.PositioningMode.Absolute; + this._parentElement = null; + this._parentElementID = null; + this._moveHandler = null; + this._firstPopup = true; + this._originalParent = null; + this._visible = false; + this._unselectable = null; + + // Generic animation behaviors that automatically build animations + // from JSON descriptions + this._onShow = null; + this._onHide = null; + + this._onShowEndedHandler = Function.createDelegate(this, this._onShowEnded); + this._onHideEndedHandler = Function.createDelegate(this, this._onHideEnded); +} + +Sys.Extended.UI.PopupBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.PopupBehavior.callBaseMethod(this, 'initialize'); + + this._hidePopup(); + this.get_element().style.position = "absolute"; + }, + + dispose: function() { + var element = this.get_element(); + + if(element) { + if(this._visible) + this.hide(); + + if(this._originalParent) { + element.parentNode.removeChild(element); + this._originalParent.appendChild(element); + this._originalParent = null; + } + + // Remove expando properties + element._hideWindowedElementsIFrame = null; + } + this._parentElement = null; + + // Remove the animation ended events and wipe the animations + // (we don't need to dispose them because that will happen + // automatically in our base dispose) + if(this._onShow && this._onShow.get_animation()) + this._onShow.get_animation().remove_ended(this._onShowEndedHandler); + + this._onShow = null; + if(this._onHide && this._onHide.get_animation()) + this._onHide.get_animation().remove_ended(this._onHideEndedHandler); + + this._onHide = null; + + Sys.Extended.UI.PopupBehavior.callBaseMethod(this, 'dispose'); + }, + + show: function() { + // Ignore requests to hide multiple times + if(this._visible) + return; + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_showing(eventArgs); + + if(eventArgs.get_cancel()) + return; + + // Either show the popup or play an animation that does + // (note: even if we're animating, we still show and position + // the popup before hiding it again and playing the animation + // which makes the animation much simpler) + this._visible = true; + var element = this.get_element(); + $common.setVisible(element, true); + this.setupPopup(); + + if(this._onShow) { + $common.setVisible(element, false); + this.onShow(); + } else { + this.raise_shown(Sys.EventArgs.Empty); + } + }, + + hide: function() { + // Ignore requests to hide multiple times + if(!this._visible) + return; + + var eventArgs = new Sys.CancelEventArgs(); + this.raise_hiding(eventArgs); + if(eventArgs.get_cancel()) + return; + + // Either hide the popup or play an animation that does + this._visible = false; + if(this._onHide) { + this.onHide(); + } else { + this._hidePopup(); + this._hideCleanup(); + } + }, + + getBounds: function() { + // Get the expected bounds of the popup relative to its parent + // returns bounds of the popup relative to its parent + + // The actual final position can only be calculated after it is + // initially set and we can verify it doesn't bleed off the edge + // of the screen. + var element = this.get_element(); + + // offsetParent (doc element if absolutely positioned or no offsetparent available) + var offsetParent = element.offsetParent || document.documentElement; + + // diff = difference in position between element's offsetParent and the element we will attach popup to. + // this is basically so we can position the popup in the right spot even though it may not be absolutely positioned + var diff; + var parentBounds; + + if(this.get_parentElement()) { + // we will be positioning the element against the assigned parent + parentBounds = $common.getBounds(this.get_parentElement()); + var offsetParentLocation = $common.getLocation(offsetParent); + diff = { x: parentBounds.x - offsetParentLocation.x, y: parentBounds.y - offsetParentLocation.y }; + } else { + // we will be positioning the element against the offset parent by default, since no parent element given + parentBounds = $common.getBounds(offsetParent); + diff = { x: 0, y: 0 }; + } + + // width/height of the element, needed for calculations that involve width like centering + var width = element.offsetWidth - (element.clientLeft ? element.clientLeft * 2 : 0), + height = element.offsetHeight - (element.clientTop ? element.clientTop * 2 : 0); + + // Setting the width causes the element to grow by border+passing every + // time. But not setting it causes strange behavior in safari. Just set it once. + if(this._firstpopup) { + element.style.width = width + "px"; + this._firstpopup = false; + } + + var position, pos; + switch(this._positioningMode) { + case Sys.Extended.UI.PositioningMode.Center: + pos = { + x: Math.round(parentBounds.width / 2 - width / 2), + y: Math.round(parentBounds.height / 2 - height / 2), + altX: Math.round(parentBounds.width / 2 - width / 2), + altY: Math.round(parentBounds.height / 2 - height / 2) + }; + break; + case Sys.Extended.UI.PositioningMode.BottomLeft: + pos = { + x: 0, + y: parentBounds.height, + altX: parentBounds.width - width, + altY: 0 - height + } + break; + case Sys.Extended.UI.PositioningMode.BottomRight: + pos = { + x: parentBounds.width - width, + y: parentBounds.height, + altX: 0, + altY: 0 - height + } + break; + case Sys.Extended.UI.PositioningMode.TopLeft: + pos = { + x: 0, + y: -element.offsetHeight, + altX: parentBounds.width - width, + altY: parentBounds.height + } + break; + case Sys.Extended.UI.PositioningMode.TopRight: + pos = { + x: parentBounds.width - width, + y: -element.offsetHeight, + altX: 0, + altY: parentBounds.height + } + break; + case Sys.Extended.UI.PositioningMode.Right: + pos = { + x: parentBounds.width, + y: 0, + altX: -element.offsetWidth, + altY: parentBounds.height - height + } + break; + case Sys.Extended.UI.PositioningMode.Left: + pos = { + x: -element.offsetWidth, + y: 0, + altX: parentBounds.width, + altY: parentBounds.height - height + } + break; + default: + pos = { x: 0, y: 0, altX: 0, altY: 0 }; + } + + pos.x += this._x + diff.x; + pos.altX += this._x + diff.x; + pos.y += this._y + diff.y; + pos.altY += this._y + diff.y; + + position = this._verifyPosition(pos, width, height, parentBounds); + + return new Sys.UI.Bounds(position.x, position.y, width, height); + }, + + _verifyPosition: function(pos, elementWidth, elementHeight, parentBounds) { + //Checks whether the popup is entirely visible and attempts to change its position to make it entirely visible. + var newX = 0, newY = 0; + var windowBounds = this._getWindowBounds(); + + // Check horizontal positioning + if(!((pos.x + elementWidth > windowBounds.x + windowBounds.width) || (pos.x < windowBounds.x))) { + newX = pos.x; + } else { + newX = pos.altX; + + if(pos.altX < windowBounds.x) { + if(pos.x > pos.altX) + newX = pos.x; + } else if(windowBounds.width + windowBounds.x - pos.altX < elementWidth) { + var xDiff = pos.x > pos.altX ? Math.abs(windowBounds.x - pos.x) : (windowBounds.x - pos.x); + if(xDiff < elementWidth - windowBounds.width - windowBounds.x + pos.altX) + newX = pos.x; + } + } + + // Check vertical positioning + if(!((pos.y + elementHeight > windowBounds.y + windowBounds.height) || (pos.y < windowBounds.y))) { + newY = pos.y; + } else { + newY = pos.altY; + + if(pos.altY < windowBounds.y) { + if(windowBounds.y - pos.altY > elementHeight - windowBounds.height - windowBounds.y + pos.y) + newY = pos.y; + } else if(windowBounds.height + windowBounds.y - pos.altY < elementHeight) { + if(windowBounds.y - pos.y < elementHeight - windowBounds.height - windowBounds.y + pos.altY) + newY = pos.y; + } + } + + return { x: newX, y: newY }; + }, + + _getWindowBounds: function() { + var bounds = { + x: this._getWindowScrollLeft(), + y: this._getWindowScrollTop(), + width: this._getWindowWidth(), + height: this._getWindowHeight() + }; + + return bounds; + }, + + _getWindowHeight: function() { + var windowHeight = 0; + + if(document.documentElement && document.documentElement.clientHeight) + windowHeight = document.documentElement.clientHeight; + else if(document.body && document.body.clientHeight) + windowHeight = document.body.clientHeight; + + return windowHeight; + }, + + _getWindowWidth: function() { + var windowWidth = 0; + + if(document.documentElement && document.documentElement.clientWidth) + windowWidth = document.documentElement.clientWidth; + else if(document.body && document.body.clientWidth) + windowWidth = document.body.clientWidth; + + return windowWidth; + }, + + _getWindowScrollTop: function() { + var scrollTop = 0; + + if(typeof (window.pageYOffset) == 'number') + scrollTop = window.pageYOffset; + if(document.body && document.body.scrollTop) + scrollTop = document.body.scrollTop; + else if(document.documentElement && document.documentElement.scrollTop) + scrollTop = document.documentElement.scrollTop; + + return scrollTop; + }, + + _getWindowScrollLeft: function() { + var scrollLeft = 0; + + if(typeof (window.pageXOffset) == 'number') + scrollLeft = window.pageXOffset; + else if(document.body && document.body.scrollLeft) + scrollLeft = document.body.scrollLeft; + else if(document.documentElement && document.documentElement.scrollLeft) + scrollLeft = document.documentElement.scrollLeft; + + return scrollLeft; + }, + + adjustPopupPosition: function(bounds) { + // Adjust the position of the popup after it's originally bet set + // to make sure that it's visible on the page. + // "bounds" - original bounds of the parent element + var element = this.get_element(); + if(!bounds) + bounds = this.getBounds(); + + // Get the new bounds now that we've shown the popup + var newPosition = $common.getBounds(element), + updateNeeded = false; + + if(newPosition.x < 0) { + bounds.x -= newPosition.x; + updateNeeded = true; + } + if(newPosition.y < 0) { + bounds.y -= newPosition.y; + updateNeeded = true; + } + + // If the popup was off the screen, reposition it + if(updateNeeded) + $common.setLocation(element, bounds); + }, + + addBackgroundIFrame: function() { + // Add an empty IFRAME behind the popup (for IE6 only) so that SELECT, etc., won't + // show through the popup. + + // Get the child frame + var element = this.get_element(); + if((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) { + var childFrame = element._hideWindowedElementsIFrame; + + // Create the child frame if it wasn't found + if(!childFrame) { + childFrame = document.createElement("iframe"); + childFrame.src = "javascript:'';"; + childFrame.style.position = "absolute"; + childFrame.style.display = "none"; + childFrame.scrolling = "no"; + childFrame.frameBorder = "0"; + childFrame.tabIndex = "-1"; + childFrame.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"; + element.parentNode.insertBefore(childFrame, element); + element._hideWindowedElementsIFrame = childFrame; + this._moveHandler = Function.createDelegate(this, this._onMove); + Sys.UI.DomEvent.addHandler(element, "move", this._moveHandler); + } + + // Position the frame exactly behind the element + $common.setBounds(childFrame, $common.getBounds(element)); + + childFrame.style.left = element.style.left; + childFrame.style.top = element.style.top; + childFrame.style.display = element.style.display; + + if(element.currentStyle && element.currentStyle.zIndex) + childFrame.style.zIndex = element.currentStyle.zIndex; + else if(element.style.zIndex) + childFrame.style.zIndex = element.style.zIndex; + } + }, + + setupPopup: function() { + // Position the popup relative to its parent + var element = this.get_element(); + var bounds = this.getBounds(); + $common.setLocation(element, bounds); + + // Tweak the position, set the zIndex, and add the background iframe in IE6 + this.adjustPopupPosition(bounds); + element.style.zIndex = Sys.Extended.UI.zIndex.Popup; + this.addBackgroundIFrame(); + }, + + _hidePopup: function() { + var element = this.get_element(); + $common.setVisible(element, false); + + if(element.originalWidth) { + element.style.width = element.originalWidth + "px"; + element.originalWidth = null; + } + }, + + _hideCleanup: function() { + // Perform cleanup after hiding the element + var element = this.get_element(); + + // Remove the tracking handler + if(this._moveHandler) { + Sys.UI.DomEvent.removeHandler(element, "move", this._moveHandler); + this._moveHandler = null; + } + + // Hide the child frame + if(Sys.Browser.agent === Sys.Browser.InternetExplorer) { + var childFrame = element._hideWindowedElementsIFrame; + if(childFrame) + childFrame.style.display = "none"; + } + + this.raise_hidden(Sys.EventArgs.Empty); + }, + + _onMove: function() { + // Track the popup's movements so the hidden IFrame (IE6 only) can + // be moved along with it + + var element = this.get_element(); + if(element._hideWindowedElementsIFrame) { + element.parentNode.insertBefore(element._hideWindowedElementsIFrame, element); + element._hideWindowedElementsIFrame.style.top = element.style.top; + element._hideWindowedElementsIFrame.style.left = element.style.left; + } + }, + + get_onShow: function() { + // Generic OnShow Animation's JSON definition + return this._onShow ? this._onShow.get_json() : null; + }, + + set_onShow: function(value) { + if(!this._onShow) { + this._onShow = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onShow.initialize(); + } + + this._onShow.set_json(value); + var animation = this._onShow.get_animation(); + + if(animation) + animation.add_ended(this._onShowEndedHandler); + + this.raisePropertyChanged('onShow'); + }, + + get_onShowBehavior: function() { + // Generic OnShow Animation's behavior + return this._onShow; + }, + + onShow: function() { + if(this._onShow) { + if(this._onHide) + this._onHide.quit(); + + this._onShow.play(); + } + }, + + _onShowEnded: function() { + // Make sure the popup is where it belongs + this.adjustPopupPosition(); + this.addBackgroundIFrame(); + + this.raise_shown(Sys.EventArgs.Empty); + }, + + get_onHide: function() { + // Generic OnHide Animation's JSON definition + return this._onHide ? this._onHide.get_json() : null; + }, + + set_onHide: function(value) { + if(!this._onHide) { + this._onHide = new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()); + this._onHide.initialize(); + } + + this._onHide.set_json(value); + var animation = this._onHide.get_animation(); + + if(animation) + animation.add_ended(this._onHideEndedHandler); + + this.raisePropertyChanged('onHide'); + }, + + get_onHideBehavior: function() { + // Generic OnHide Animation's behavior + return this._onHide; + }, + + onHide: function() { + if(this._onHide) { + if(this._onShow) + this._onShow.quit(); + + this._onHide.play(); + } + }, + + _onHideEnded: function() { + this._hideCleanup(); + }, + + get_parentElement: function() { + if(!this._parentElement && this._parentElementID) + this.set_parentElement($get(this._parentElementID)); + + return this._parentElement; + }, + + set_parentElement: function(element) { + this._parentElement = element; + this.raisePropertyChanged('parentElement'); + }, + + get_parentElementID: function() { + if(this._parentElement) + return this._parentElement.id + + return this._parentElementID; + }, + + set_parentElementID: function(elementID) { + this._parentElementID = elementID; + + if(this.get_isInitialized()) + this.set_parentElement($get(elementID)); + }, + + get_positioningMode: function() { + return this._positioningMode; + }, + + set_positioningMode: function(mode) { + this._positioningMode = mode; + this.raisePropertyChanged('positioningMode'); + }, + + get_x: function() { + return this._x; + }, + + set_x: function(value) { + if(value != this._x) { + this._x = value; + + // Reposition the popup if it's already showing + if(this._visible) + this.setupPopup(); + + this.raisePropertyChanged('x'); + } + }, + + get_y: function() { + return this._y; + }, + + set_y: function(value) { + if(value != this._y) { + this._y = value; + + // Reposition the popup if it's already showing + if(this._visible) + this.setupPopup(); + + this.raisePropertyChanged('y'); + } + }, + + get_visible: function() { + return this._visible; + }, + + add_showing: function(handler) { + this.get_events().addHandler('showing', handler); + }, + remove_showing: function(handler) { + this.get_events().removeHandler('showing', handler); + }, + raise_showing: function(eventArgs) { + var handler = this.get_events().getHandler('showing'); + if(handler) + handler(this, eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + add_shown: function(handler) { + this.get_events().addHandler('shown', handler); + }, + remove_shown: function(handler) { + this.get_events().removeHandler('shown', handler); + }, + raise_shown: function(eventArgs) { + var handler = this.get_events().getHandler('shown'); + if(handler) + handler(this, eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + add_hiding: function(handler) { + this.get_events().addHandler('hiding', handler); + }, + remove_hiding: function(handler) { + this.get_events().removeHandler('hiding', handler); + }, + raise_hiding: function(eventArgs) { + var handler = this.get_events().getHandler('hiding'); + if(handler) + handler(this, eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + add_hidden: function(handler) { + this.get_events().addHandler('hidden', handler); + }, + remove_hidden: function(handler) { + this.get_events().removeHandler('hidden', handler); + }, + raise_hidden: function(eventArgs) { + var handler = this.get_events().getHandler('hidden'); + if(handler) + handler(this, eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + }, + + get_unselectable: function() + { + return this._unselectable; + }, + + set_unselectable: function(value) + { + this._unselectable = value; + // TODO: _this.setAttribute('unselectable', 'on'); + this.raisePropertyChanged('unselectable'); + } +} +Sys.Extended.UI.PopupBehavior.registerClass('Sys.Extended.UI.PopupBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.PositioningMode = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.PositioningMode.prototype = { + Absolute: 0, + Center: 1, + BottomLeft: 2, + BottomRight: 3, + TopLeft: 4, + TopRight: 5, + Right: 6, + Left: 7 +} + +Sys.Extended.UI.PositioningMode.registerEnum('Sys.Extended.UI.PositioningMode'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PopupControl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PopupControl.debug.js new file mode 100644 index 000000000..194618218 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/PopupControl.debug.js @@ -0,0 +1,620 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.PopupControlBehavior = function(element) { + + // The PopupControlBehavior opens a popup window next to the target element + Sys.Extended.UI.PopupControlBehavior.initializeBase(this, [element]); + + // Properties + this._popupControlID = null; + this._commitProperty = null; + this._commitScript = null; + this._position = null; + this._offsetX = 0; + this._offsetY = 0; + this._extenderControlID = null; + + // Variables + this._popupElement = null; + this._popupBehavior = null; + this._popupVisible = false; + this._focusHandler = null; + this._popupKeyDownHandler = null; + this._popupClickHandler = null; + this._bodyClickHandler = null; + this._onShowJson = null; + this._onHideJson = null; +}; + +Sys.Extended.UI.PopupControlBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this, 'initialize'); + + // Identify popup element from control id + var e = this.get_element(); + this._popupElement = $get(this._popupControlID); + + // Hook up a PopupBehavior + this._popupBehavior = $create(Sys.Extended.UI.PopupBehavior, { 'id': this.get_id() + 'PopupBehavior', 'parentElement': e }, null, null, this._popupElement); + + // Create the animations (if they were set before initialize was called) + if(this._onShowJson) + this._popupBehavior.set_onShow(this._onShowJson); + + if(this._onHideJson) + this._popupBehavior.set_onHide(this._onHideJson); + + // Create delegates + this._focusHandler = Function.createDelegate(this, this._onFocus); + this._popupClickHandler = Function.createDelegate(this, this._onPopupClick); + this._bodyClickHandler = Function.createDelegate(this, this._onBodyClick); + this._popupKeyDownHandler = Function.createDelegate(this, this._onPopupKeyDown); + + // Attach events + $addHandler(e, 'focus', this._focusHandler); + $addHandler(e, 'click', this._focusHandler); // So that a dismissed popup can be more easily re-popped + $addHandler(document.body, 'click', this._bodyClickHandler); + $addHandler(this._popupElement, 'click', this._popupClickHandler); + $addHandler(this._popupElement, 'keydown', this._popupKeyDownHandler); + + // Need to know when partial updates complete + this.registerPartialUpdateEvents(); + + // If this popup was visible before what seems to have been a partial update, + // make it visible again now + if(Sys.Extended.UI.PopupControlBehavior.__VisiblePopup && (this.get_id() == Sys.Extended.UI.PopupControlBehavior.__VisiblePopup.get_id())) + this._onFocus(null); + }, + + dispose: function() { + var e = this.get_element(); + + this._onShowJson = null; + this._onHideJson = null; + + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + + if(this._focusHandler) { + $removeHandler(e, 'focus', this._focusHandler); + $removeHandler(e, 'click', this._focusHandler); + this._focusHandler = null; + } + + if(this._bodyClickHandler) { + $removeHandler(document.body, 'click', this._bodyClickHandler); + this._bodyClickHandler = null; + } + + if(this._popupClickHandler) { + $removeHandler(this._popupElement, 'click', this._popupClickHandler); + this._popupClickHandler = null; + } + + if(this._popupKeyDownHandler) { + $removeHandler(this._popupElement, 'keydown', this._popupKeyDownHandler); + this._popupKeyDownHandler = null; + } + + Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Shows the popup + /// + /// + showPopup: function() { + var old = Sys.Extended.UI.PopupControlBehavior.__VisiblePopup; + + if(old && old._popupBehavior) + old.hidePopup(); + + Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this, 'populate'); + + this._popupBehavior.set_x(this._getLeftOffset()); + this._popupBehavior.set_y(this._getTopOffset()); + this._popupBehavior.show(); + this._popupVisible = true; + + Sys.Extended.UI.PopupControlBehavior.__VisiblePopup = this; + }, + + /// + /// Hides the popup + /// + /// + hidePopup: function() { + this._popupBehavior.hide(); + this._popupVisible = false; + + Sys.Extended.UI.PopupControlBehavior.__VisiblePopup = null; + }, + + _onFocus: function(e) { + // Show the popup when its control is focused + + // Set the popup position and display it + if(!this._popupVisible) + this.showPopup(); + + if(e) e.stopPropagation(); + }, + + _onPopupKeyDown: function(e) { + // Handle key presses in the popup element + if(this._popupVisible && e.keyCode == 27 /* Escape */) + // Return focus to the control + this.get_element().focus(); + }, + + _onPopupClick: function(e) { + e.stopPropagation(); + }, + + _onBodyClick: function() { + // Handler for the HTML body tag's click event + + // Hide the popup if something other than our target or popup + // was clicked (since each of these stop the event from bubbling + // up to the body) + if(this._popupVisible) + this.hidePopup(); + }, + + // Called automatically when a page load/postback happens + _close: function(result) { + // Look at result of popup + var e = this.get_element(); + + if(null != result) { + if('$$CANCEL$$' != result) { + // Result is to be committed + if(this._commitProperty) + // Use the specified property + e[this._commitProperty] = result; + else if('text' == e.type) + // Use the default property + e.value = result; + else + Sys.Debug.assert(false, String.format(Sys.Extended.UI.Resources.PopupControl_NoDefaultProperty, e.id, e.type)); + + // Additionally run commit script if present + if(this._commitScript) + eval(this._commitScript); + } + + // Hide the popup + this.hidePopup(); + } + }, + + _partialUpdateEndRequest: function(sender, endRequestEventArgs) { + // Handler for UpdatePanel partial postback notifications + Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]); + + if(this.get_element()) { + // Look up result by element's ID + var result = endRequestEventArgs.get_dataItems()[this.get_element().id]; + + // If unsuccessful, look up result by proxy ID + if((undefined === result) && + Sys.Extended.UI.PopupControlBehavior.__VisiblePopup && + (this.get_id() == Sys.Extended.UI.PopupControlBehavior.__VisiblePopup.get_id())) { + + result = endRequestEventArgs.get_dataItems()["_PopupControl_Proxy_ID_"]; + } + + // If result available, apply it + if(undefined !== result) + this._close(result); + } + }, + + _onPopulated: function(sender, eventArgs) { + Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]); + + // Dynamic populate may have added content; re-layout to accomodate it + if(this._popupVisible) + this._popupBehavior.show(); + }, + + _getLeftOffset: function() { + // Get the left offset for the popup + if(Sys.Extended.UI.PopupControlPopupPosition.Left == this._position) + return (-1 * this.get_element().offsetWidth) + this._offsetX; + else if(Sys.Extended.UI.PopupControlPopupPosition.Right == this._position) + return this.get_element().offsetWidth + this._offsetX; + else + return this._offsetX; + }, + + _getTopOffset: function() { + // Get the top offset for the popup + var yoffSet; + + if(Sys.Extended.UI.PopupControlPopupPosition.Top == this._position) + yoffSet = (-1 * this.get_element().offsetHeight) + this._offsetY; + else if(Sys.Extended.UI.PopupControlPopupPosition.Bottom == this._position) + yoffSet = this.get_element().offsetHeight + this._offsetY; + else + yoffSet = this._offsetY; + + return yoffSet; + }, + + /// + /// A JSON definition of generic OnShow Animation + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onShow(value); + else + this._onShowJson = value; + + this.raisePropertyChanged('onShow'); + }, + + /// + /// Generic OnShow Animation behavior + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Plays OnShow animation + /// + /// + onShow: function() { + if(this._popupBehavior) + this._popupBehavior.onShow(); + }, + + /// + /// A JSON definition of generic OnHide Animation + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onHide(value); + else + this._onHideJson = value; + + this.raisePropertyChanged('onHide'); + }, + + /// + /// Generic OnHide Animation behavior + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// Plays OnHide animation + /// + /// + onHide: function() { + if(this._popupBehavior) + this._popupBehavior.onHide(); + }, + + /// + /// The ID of the control to display + /// + /// get_popupControlID + /// set_popupControlID + /// + get_popupControlID: function() { + return this._popupControlID; + }, + set_popupControlID: function(value) { + if(this._popupControlID != value) { + this._popupControlID = value; + this.raisePropertyChanged('popupControlID'); + } + }, + + get_PopupControlID: function() { + Sys.Extended.Deprecated("get_PopupControlID()", "get_popupControlID()"); + return this.get_popupControlID(); + }, + set_PopupControlID: function(value) { + Sys.Extended.Deprecated("set_PopupControlID(value)", "set_popupControlID(value)"); + this.set_popupControlID(value); + }, + + /// + /// The property of a control being extended that should be set with the result of the popup + /// + /// get_commitProperty + /// set_commitProperty + /// + get_commitProperty: function() { + return this._commitProperty; + }, + set_commitProperty: function(value) { + if(this._commitProperty != value) { + this._commitProperty = value; + this.raisePropertyChanged('commitProperty'); + } + }, + + get_CommitProperty: function() { + Sys.Extended.Deprecated("get_CommitProperty()", "get_commitProperty()"); + return this.get_commitProperty(); + }, + set_CommitProperty: function(value) { + Sys.Extended.Deprecated("set_CommitProperty(value)", "set_commitProperty(value)"); + this.set_commitProperty(value); + }, + + /// + /// An additional script to run after the result of the popup is set + /// + /// get_commitScript + /// set_commitScript + /// + get_commitScript: function() { + return this._commitScript; + }, + set_commitScript: function(value) { + if(this._commitScript != value) { + this._commitScript = value; + this.raisePropertyChanged('commitScript'); + } + }, + + get_CommitScript: function() { + Sys.Extended.Deprecated("get_CommitScript()", "get_commitScript()"); + return this.get_commitScript(); + }, + set_CommitScript: function(value) { + Sys.Extended.Deprecated("set_CommitScript(value)", "set_commitScript(value)"); + this.set_commitScript(value); + }, + + /// + /// Determines where the popup should be positioned relative to the target control + /// (Left, Right, Top, Bottom, or Center) + /// + /// get_position + /// set_position + /// + get_position: function() { + return this._position; + }, + set_position: function(value) { + if(this._position != value) { + this._position = value; + this.raisePropertyChanged('position'); + } + }, + + get_Position: function() { + Sys.Extended.Deprecated("get_Position()", "get_position()"); + return this.get_position(); + }, + set_Position: function(value) { + Sys.Extended.Deprecated("set_Position(value)", "set_position(value)"); + this.set_position(value); + }, + + /// + /// The ID of the extender control + /// + /// get_extenderControlID + /// set_extenderControlID + /// + get_extenderControlID: function() { + return this._extenderControlID; + }, + set_extenderControlID: function(value) { + if(this._extenderControlID != value) { + this._extenderControlID = value; + this.raisePropertyChanged('extenderControlID'); + } + }, + + get_ExtenderControlID: function() { + Sys.Extended.Deprecated("get_ExtenderControlID()", "get_extenderControlID()"); + return this.get_extenderControlID(); + }, + set_ExtenderControlID: function(value) { + Sys.Extended.Deprecated("set_ExtenderControlID(value)", "set_extenderControlID(value)"); + this.set_extenderControlID(value); + }, + + /// + /// The number of pixels to horizontally offset the Popup from its default position + /// + /// get_offsetX + /// set_offsetX + /// + get_offsetX: function() { + return this._offsetX; + }, + set_offsetX: function(value) { + if(this._offsetX != value) { + this._offsetX = value; + this.raisePropertyChanged('offsetX'); + } + }, + + get_OffsetX: function() { + Sys.Extended.Deprecated("get_OffsetX()", "get_offsetX()"); + return this.get_offsetX(); + }, + set_OffsetX: function(value) { + Sys.Extended.Deprecated("set_OffsetX(value)", "set_offsetX(value)"); + this.set_offsetX(value); + }, + + /// + /// The number of pixels to vertically offset the Popup from its default position + /// + /// get_offsetY + /// set_offsetY + /// + get_offsetY: function() { + return this._offsetY; + }, + set_offsetY: function(value) { + if(this._offsetY != value) { + this._offsetY = value; + this.raisePropertyChanged('offsetY'); + } + }, + + get_OffsetY: function() { + Sys.Extended.Deprecated("get_OffsetY()", "get_offsetY()"); + return this.get_offsetY(); + }, + set_OffsetY: function(value) { + Sys.Extended.Deprecated("set_OffsetY(value)", "set_offsetY(value)"); + this.set_offsetY(value); + }, + + /// + /// Determines whether or not the popup is visible + /// + /// get_popupVisible + /// + get_popupVisible: function() { + return this._popupVisible; + }, + + get_PopupVisible: function() { + Sys.Extended.Deprecated("get_PopupVisible()", "get_popupVisible()"); + return this.get_popupVisible(); + }, + + /// + /// Fires when the popup is being shown + /// + /// + /// + add_showing: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_showing(handler); + }, + remove_showing: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_showing(handler); + }, + raise_showing: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_showing(eventArgs); + }, + raiseShowing: function(eventArgs) { + Sys.Extended.Deprecated("raiseShowing(eventArgs)", "raise_showing(eventArgs)"); + this.raise_showing(eventArgs); + }, + + /// + /// Fires after the popup is shown + /// + /// + /// + add_shown: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_shown(handler); + }, + remove_shown: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_shown(handler); + }, + raise_shown: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_shown(eventArgs); + }, + raiseShown: function(eventArgs) { + Sys.Extended.Deprecated("raiseShown(eventArgs)", "raise_shown(eventArgs)"); + this.raise_shown(eventArgs); + }, + + /// + /// Fires when the popup is being hidden + /// + /// + /// + add_hiding: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_hiding(handler); + }, + remove_hiding: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_hiding(handler); + }, + raise_hiding: function() { + if(this._popupBehavior) + this._popupBehavior.raise_hiding(eventArgs); + }, + raiseHiding: function(eventArgs) { + Sys.Extended.Deprecated("raiseHiding(eventArgs)", "raise_hiding(eventArgs)"); + this.raise_hiding(eventArgs); + }, + + /// + /// Firs after the popup is hidden + /// + /// + /// + add_hidden: function(handler) { + if(this._popupBehavior) + this._popupBehavior.add_hidden(handler); + }, + remove_hidden: function(handler) { + if(this._popupBehavior) + this._popupBehavior.remove_hidden(handler); + }, + raise_hidden: function(eventArgs) { + if(this._popupBehavior) + this._popupBehavior.raise_hidden(eventArgs); + }, + raiseHidden: function(eventArgs) { + Sys.Extended.Deprecated("raiseHidden(eventArgs)", "raise_hidden(eventArgs)"); + this.raise_hidden(eventArgs); + } +}; + +Sys.Extended.UI.PopupControlBehavior.registerClass('Sys.Extended.UI.PopupControlBehavior', Sys.Extended.UI.DynamicPopulateBehaviorBase); + +// This global variable tracks the currently visible popup. Automatically +// hiding the popup when focus is lost does not work with our mechanism to +// hide the popup when something else is clicked... So we will instead go for +// the weaker strategy of letting at most one popup be visible at a time. +Sys.Extended.UI.PopupControlBehavior.__VisiblePopup = null; + +Sys.Extended.UI.PopupControlPopupPosition = function() { + // Position of the popup relative to the target control + throw Error.invalidOperation(); +}; + +Sys.Extended.UI.PopupControlPopupPosition.prototype = { + Center: 0, + Top: 1, + Left: 2, + Bottom: 3, + Right: 4 +}; + +Sys.Extended.UI.PopupControlPopupPosition.registerEnum("Sys.Extended.UI.PopupControlPopupPosition", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Rating.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Rating.debug.js new file mode 100644 index 000000000..17e5aa6b2 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Rating.debug.js @@ -0,0 +1,653 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.RatingBehavior = function(element) { + // The RatingBehavior creates a sequence of stars used to rate an item + Sys.Extended.UI.RatingBehavior.initializeBase(this, [element]); + + this._starCssClass = "rating_star"; + this._filledStarCssClass = "rating_filled"; + this._emptyStarCssClass = "rating_empty"; + this._waitingStarCssClass = null; + this._isServerControl = false; + this._readOnly = false; + this._ratingValue = 0; + this._currentRating = 0; + this._maxRatingValue = 5; + this._tag = ""; + this._ratingDirection = 0; + this._stars = null; + this._callbackID = null; + this._mouseOutHandler = Function.createDelegate(this, this._onMouseOut); + this._starClickHandler = Function.createDelegate(this, this._onStarClick); + this._starMouseOverHandler = Function.createDelegate(this, this._onStarMouseOver); + this._keyDownHandler = Function.createDelegate(this, this._onKeyDownBack); + this._autoPostBack = false; +} + +Sys.Extended.UI.RatingBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.RatingBehavior.callBaseMethod(this, 'initialize'); + + var elt = this.get_element(); + this._stars = []; + + for(var i = 1; i <= this._maxRatingValue; i++) { + starElement = $get(elt.id + '_Star_' + i); + starElement.value = i; + Array.add(this._stars, starElement); + + $addHandler(starElement, 'click', this._starClickHandler); + $addHandler(starElement, 'mouseover', this._starMouseOverHandler); + } + + $addHandler(elt, 'mouseout', this._mouseOutHandler); + $addHandler(elt, "keydown", this._keyDownHandler); + + this._update(); + }, + + dispose: function() { + var elt = this.get_element(); + + if(this._stars) { + for(var i = 0; i < this._stars.length; i++) { + var starElement = this._stars[i]; + + $removeHandler(starElement, 'click', this._starClickHandler); + $removeHandler(starElement, 'mouseover', this._starMouseOverHandler); + } + this._stars = null; + } + + $removeHandler(elt, 'mouseout', this._mouseOutHandler); + $removeHandler(elt, "keydown", this._keyDownHandler); + + Sys.Extended.UI.RatingBehavior.callBaseMethod(this, 'dispose'); + }, + + _onError: function(message, context) { + alert(String.format(Sys.Extended.UI.Resources.Rating_CallbackError, message)); + }, + + _receiveServerData: function(arg, context) { + // Handler for successful return from callback + context._waitingMode(false); + context.raise_endClientCallback(arg); + }, + + _onMouseOut: function(e) { + if(this._readOnly) + return; + + this._currentRating = this._ratingValue; + this._update(); + this.raise_mouseOut(this._currentRating); + }, + + _onStarClick: function(e) { + if(this._readOnly) + return; + + if(this._ratingValue != this._currentRating) + this.set_rating(this._currentRating); + }, + + _onStarMouseOver: function(e) { + if(this._readOnly) + return; + + if(this._ratingDirection == 0) + this._currentRating = e.target.value; + else + this._currentRating = this._maxRatingValue + 1 - e.target.value; + + this._update(); + this.raise_mouseOver(this._currentRating); + }, + + _onKeyDownBack: function(ev) { + if(this._readOnly) + return; + + var k = ev.keyCode ? ev.keyCode : ev.rawEvent.keyCode; + if((k == Sys.UI.Key.right) || (k == Sys.UI.Key.up)) { + this._currentRating = Math.min(this._currentRating + 1, this._maxRatingValue); + this.set_rating(this._currentRating); + + ev.preventDefault(); + ev.stopPropagation(); + } else if((k == Sys.UI.Key.left) || (k == Sys.UI.Key.down)) { + this._currentRating = Math.max(this._currentRating - 1, 1); + this.set_rating(this._currentRating); + + ev.preventDefault(); + ev.stopPropagation(); + } + }, + + _waitingMode: function(activated) { + // Update the display to indicate whether or not we are waiting + for(var i = 0; i < this._maxRatingValue; i++) { + var starElement; + + if(this._ratingDirection == 0) + starElement = this._stars[i]; + else + starElement = this._stars[this._maxRatingValue - i - 1]; + + if(this._currentRating > i) { + if(this._waitingStarCssClass) + if(activated) { + Sys.UI.DomElement.removeCssClass(starElement, this._filledStarCssClass); + Sys.UI.DomElement.addCssClass(starElement, this._waitingStarCssClass); + } + else { + Sys.UI.DomElement.removeCssClass(starElement, this._waitingStarCssClass); + Sys.UI.DomElement.addCssClass(starElement, this._filledStarCssClass); + } + } else { + if(this._waitingStarCssClass) + Sys.UI.DomElement.removeCssClass(starElement, this._waitingStarCssClass); + + Sys.UI.DomElement.removeCssClass(starElement, this._filledStarCssClass); + Sys.UI.DomElement.addCssClass(starElement, this._emptyStarCssClass); + } + } + }, + + _update: function() { + // Update title attribute element + var elt = this.get_element(); + $get(elt.id + "_A").title = this._currentRating; + + for(var i = 0; i < this._maxRatingValue; i++) { + var starElement; + + if(this._ratingDirection == 0) + starElement = this._stars[i]; + else + starElement = this._stars[this._maxRatingValue - i - 1]; + + if(this._currentRating > i) { + Sys.UI.DomElement.removeCssClass(starElement, this._emptyStarCssClass); + Sys.UI.DomElement.addCssClass(starElement, this._filledStarCssClass); + } else { + Sys.UI.DomElement.removeCssClass(starElement, this._filledStarCssClass); + Sys.UI.DomElement.addCssClass(starElement, this._emptyStarCssClass); + } + } + }, + + /// + /// Fires when rating has been marked + /// + /// + /// + add_rated: function(handler) { + this.get_events().addHandler("rated", handler); + }, + remove_rated: function(handler) { + this.get_events().removeHandler("rated", handler); + }, + raise_rated: function(rating) { + var handler = this.get_events().getHandler("rated"); + + if(handler) + handler(this, new Sys.Extended.UI.RatingEventArgs(rating)); + }, + + add_Rated: function(handler) { + Sys.Extended.Deprecated("add_Rated(handler)", "add_rated(handler)"); + this.add_rated(handler); + }, + remove_Rated: function(handler) { + Sys.Extended.Deprecated("remove_Rated(handler)", "remove_rated(handler)"); + this.remove_rated(handler); + }, + raiseRated: function(rating) { + Sys.Extended.Deprecated("raiseRated(rating)", "raise_rated(rating)"); + this.raise_rated(rating); + }, + + /// + /// Fires when mouse is over the Rating control + /// + /// + /// + add_mouseOver: function(handler) { + this.get_events().addHandler("mouseOver", handler); + }, + remove_mouseOver: function(handler) { + this.get_events().removeHandler("mouseOver", handler); + }, + raise_mouseOver: function(ratingTmp) { + var handler = this.get_events().getHandler("mouseOver"); + + if(handler) + handler(this, new Sys.Extended.UI.RatingEventArgs(rating_tmp)); + }, + + add_MouseOver: function(handler) { + Sys.Extended.Deprecated("add_MouseOver(handler)", "add_mouseOver(handler)"); + this.add_mouseOver(handler); + }, + remove_MouseOver: function(handler) { + Sys.Extended.Deprecated("remove_MouseOver(handler)", "remove_mouseOver(handler)"); + this.remove_mouseOver(handler); + }, + raiseMouseOver: function(rating_tmp) { + Sys.Extended.Deprecated("raiseMouseOver(rating_tmp)", "raise_mouseOver(ratingTmp)"); + this.raise_mouseOver(rating_tmp); + }, + + /// + /// Fires when mouse pointer leaves the Rating element + /// + /// + /// + add_mouseOut: function(handler) { + this.get_events().addHandler("mouseOut", handler); + }, + remove_mouseOut: function(handler) { + this.get_events().removeHandler("mouseOut", handler); + }, + raise_mouseOut: function(ratingOld) { + var handler = this.get_events().getHandler("mouseOut"); + + if(handler) + handler(this, new Sys.Extended.UI.RatingEventArgs(ratingOld)); + }, + + add_MouseOut: function(handler) { + Sys.Extended.Deprecated("add_MouseOut(handler)", "add_mouseOut(handler)"); + this.add_mouseOut(handler); + }, + remove_MouseOut: function(handler) { + Sys.Extended.Deprecated("remove_MouseOut(handler)", "remove_mouseOut(handler)"); + this.remove_mouseOut(handler); + }, + raiseMouseOut: function(rating_old) { + Sys.Extended.Deprecated("raiseMouseOut(rating_old)", "raise_mouseOut(ratingOld)"); + this.raise_mouseOut(rating_old); + }, + + /// + /// Fires when rating is changed + /// + /// + /// + add_endClientCallback: function(handler) { + this.get_events().addHandler("endClientCallback", handler); + }, + remove_endClientCallback: function(handler) { + this.get_events().removeHandler("endClientCallback", handler); + }, + raise_endClientCallback: function(result) { + var handler = this.get_events().getHandler("endClientCallback"); + + if(handler) + handler(this, new Sys.Extended.UI.RatingCallbackResultEventArgs(result)); + }, + + add_EndClientCallback: function(handler) { + Sys.Extended.Deprecated("add_EndClientCallback(handler)", "add_endClientCallback(handler)"); + this.add_endClientCallback(handler); + }, + remove_EndClientCallback: function(handler) { + Sys.Extended.Deprecated("remove_EndClientCallback(handler)", "remove_endClientCallback(handler)"); + this.remove_endClientCallback(handler); + }, + raiseEndClientCallback: function(result) { + Sys.Extended.Deprecated("raiseEndClientCallback()", "raise_endClientCallback()"); + this.raise_endClientCallback(result); + }, + + /// + /// Set to True to cause a postback on rating item click + /// + /// get_autoPostBack + /// set_autoPostBack + /// + get_autoPostBack: function() { + return this._autoPostBack; + }, + set_autoPostBack: function(value) { + this._autoPostBack = value; + }, + + get_AutoPostBack: function() { + Sys.Extended.Deprecated("get_AutoPostBack()", "get_autoPostBack()"); + return this.get_autoPostBack(); + }, + set_AutoPostBack: function(value) { + Sys.Extended.Deprecated("set_AutoPostBack(value)", "set_autoPostBack(value)"); + this.set_autoPostBack(value); + }, + + /// + /// An array of stars + /// + /// get_stars + /// + get_stars: function() { + return this._stars; + }, + get_Stars: function() { + Sys.Extended.Deprecated("get_Stars()", "get_stars()"); + return this.get_stars(); + }, + + /// + /// A custom parameter to pass to the ClientCallBack + /// + /// get_tag + /// set_tag + /// + get_tag: function() { + return this._tag; + }, + set_tag: function(value) { + if(this._tag != value) { + this._tag = value; + this.raisePropertyChanged('tag'); + } + }, + + get_Tag: function() { + Sys.Extended.Deprecated("get_Tag()", "get_tag()"); + return this.get_tag(); + }, + set_Tag: function(value) { + Sys.Extended.Deprecated("set_Tag(value)", "set_tag(value)"); + this.set_tag(value); + }, + + /// + /// ID of the callback + /// + /// get_callbackID + /// set_callbackID + /// + get_callbackID: function() { + return this._callbackID; + }, + set_callbackID: function(value) { + this._callbackID = value; + }, + + get_CallbackID: function() { + Sys.Extended.Deprecated("get_CallbackID()", "get_callbackID()"); + return this.get_callbackID(); + }, + set_CallbackID: function(value) { + Sys.Extended.Deprecated("set_CallbackID(value)", "set_callbackID(value)"); + this.set_callbackID(value); + }, + + /// + /// Orientation of stars (LeftToRightTopToBottom or RightToLeftBottomToTop) + /// + /// get_ratingDirection + /// set_ratingDirection + /// + get_ratingDirection: function() { + // TODO: We should create an enum for this + return this._ratingDirection; + }, + set_ratingDirection: function(value) { + if(this._ratingDirection != value) { + this._ratingDirection = value; + + if(this.get_isInitialized()) + this._update(); + + this.raisePropertyChanged('ratingDirection'); + } + }, + + get_RatingDirection: function() { + Sys.Extended.Deprecated("get_RatingDirection()", "get_ratingDirection()"); + return this.get_ratingDirection(); + }, + set_RatingDirection: function(value) { + Sys.Extended.Deprecated("set_RatingDirection(value)", "set_ratingDirection(value)"); + this.set_ratingDirection(value); + }, + + /// + /// A CSS class for a star in empty mode + /// + /// get_emptyStarCssClass + /// set_emptyStarCssClass + /// + get_emptyStarCssClass: function() { + return this._emptyStarCssClass; + }, + set_emptyStarCssClass: function(value) { + if(this._emptyStarCssClass != value) { + this._emptyStarCssClass = value; + this.raisePropertyChanged('emptyStarCssClass'); + } + }, + + get_EmptyStarCssClass: function() { + Sys.Extended.Deprecated("get_EmptyStarCssClass()", "get_emptyStarCssClass()"); + return this.get_emptyStarCssClass(); + }, + set_EmptyStarCssClass: function(value) { + Sys.Extended.Deprecated("set_EmptyStarCssClass(value)", "set_emptyStarCssClass(value)"); + this.set_emptyStarCssClass(value); + }, + + /// + /// A CSS class for star in filled mode + /// + /// get_filledStarCssClass + /// set_filledStarCssClass + /// + get_filledStarCssClass: function() { + return this._filledStarCssClass; + }, + set_filledStarCssClass: function(value) { + if(this._filledStarCssClass != value) { + this._filledStarCssClass = value; + this.raisePropertyChanged('filledStarCssClass'); + } + }, + + get_FilledStarCssClass: function() { + Sys.Extended.Deprecated("get_FilledStarCssClass()", "get_filledStarCssClass()"); + return this.get_filledStarCssClass(); + }, + set_FilledStarCssClass: function(value) { + Sys.Extended.Deprecated("set_FilledStarCssClass(value)", "set_filledStarCssClass(value)"); + this.set_filledStarCssClass(value); + }, + + /// + /// A CSS class for a star in waiting mode + /// + /// get_waitingStarCssClass + /// set_waitingStarCssClass + /// + get_waitingStarCssClass: function() { + return this._waitingStarCssClass; + }, + set_waitingStarCssClass: function(value) { + if(this._waitingStarCssClass != value) { + this._waitingStarCssClass = value; + this.raisePropertyChanged('waitingStarCssClass'); + } + }, + + get_WaitingStarCssClass: function() { + Sys.Extended.Deprecated("get_WaitingStarCssClass()", "get_waitingStarCssClass()"); + return this.get_waitingStarCssClass(); + }, + set_WaitingStarCssClass: function(value) { + Sys.Extended.Deprecated("set_WaitingStarCssClass(value)", "set_waitingStarCssClass(value)"); + this.set_waitingStarCssClass(value); + }, + + /// + /// A current rating value + /// + /// get_rating + /// set_rating + /// + get_rating: function() { + var hiddenValue = Sys.Extended.UI.RatingBehavior.callBaseMethod(this, 'get_ClientState'); + if(hiddenValue !== null && hiddenValue.length) + this._ratingValue = hiddenValue + + if(this._ratingValue == '') + this._ratingValue = null; + + return this._ratingValue; + }, + set_rating: function(value) { + if(this._ratingValue != value) { + this._ratingValue = value; + this._currentRating = value; + + if(this.get_isInitialized()) { + if((value < 0) || (value > this._maxRatingValue)) + return; + + this._update(); + + Sys.Extended.UI.RatingBehavior.callBaseMethod(this, 'set_ClientState', [this._ratingValue]); + + this.raisePropertyChanged('rating'); + this.raise_rated(this._currentRating); + + if(this._isServerControl) { + this._waitingMode(true); + + var args = this._currentRating + ";" + this._tag, + id = this._callbackID; + + if(this._autoPostBack) + __doPostBack(id, args); + else + WebForm_DoCallback(id, args, this._receiveServerData, this, this._onError, true) + } + } + } + }, + + get_Rating: function() { + Sys.Extended.Deprecated("get_Rating()", "get_rating()"); + return this.get_rating(); + }, + set_Rating: function(value) { + Sys.Extended.Deprecated("set_Rating(value)", "set_rating(value)"); + this.set_rating(value); + }, + + /// + /// A maximum rating value + /// + /// get_maxRating + /// set_maxRating + /// + get_maxRating: function() { + return this._maxRatingValue; + }, + set_maxRating: function(value) { + if(this._maxRatingValue != value) { + this._maxRatingValue = value; + this.raisePropertyChanged('maxRating'); + } + }, + + get_MaxRating: function() { + Sys.Extended.Deprecated("get_MaxRating()", "get_maxRating()"); + return this.get_maxRating(); + }, + set_MaxRating: function(value) { + Sys.Extended.Deprecated("set_MaxRating(value)", "set_maxRating(value)"); + this.set_maxRating(value); + }, + + /// + /// Whether or not the rating can be changed + /// + /// get_readOnly + /// set_readOnly + /// + get_readOnly: function() { + return this._readOnly; + }, + set_readOnly: function(value) { + if(this._readOnly != value) { + this._readOnly = value; + this.raisePropertyChanged('readOnly'); + } + }, + + get_ReadOnly: function() { + Sys.Extended.Deprecated("get_ReadOnly()", "get_readOnly()"); + return this.get_readOnly(); + }, + set_ReadOnly: function(value) { + Sys.Extended.Deprecated("set_ReadOnly(value)", "set_readOnly(value)"); + this.set_readOnly(value); + }, + + /// + /// A CSS class for a visible star + /// + /// get_starCssClass + /// set_starCssClass + /// + get_starCssClass: function() { + return this._starCssClass; + }, + set_starCssClass: function(value) { + if(this._starCssClass != value) { + this._starCssClass = value; + this.raisePropertyChanged('starCssClass'); + } + }, + + get_StarCssClass: function() { + Sys.Extended.Deprecated("get_StarCssClass()", "get_starCssClass()"); + return this.get_starCssClass(); + }, + set_StarCssClass: function(value) { + Sys.Extended.Deprecated("set_StarCssClass(value)", "set_starCssClass(value)"); + this.set_starCssClass(value); + } +} + +Sys.Extended.UI.RatingBehavior.registerClass('Sys.Extended.UI.RatingBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.RatingEventArgs = function(rating) { + Sys.Extended.UI.RatingEventArgs.initializeBase(this); + + this._rating = rating; +} + +Sys.Extended.UI.RatingEventArgs.prototype = { + get_Rating: function() { + return this._rating; + } +} + +Sys.Extended.UI.RatingEventArgs.registerClass('Sys.Extended.UI.RatingEventArgs', Sys.EventArgs); + +Sys.Extended.UI.RatingCallbackResultEventArgs = function(result) { + Sys.Extended.UI.RatingCallbackResultEventArgs.initializeBase(this); + + this._result = result; +} + +Sys.Extended.UI.RatingCallbackResultEventArgs.prototype = { + get_CallbackResult: function() { + return this._result; + } +} + +Sys.Extended.UI.RatingCallbackResultEventArgs.registerClass('Sys.Extended.UI.RatingCallbackResultEventArgs', Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ResizableControl.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ResizableControl.debug.js new file mode 100644 index 000000000..42e56850d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ResizableControl.debug.js @@ -0,0 +1,621 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ResizableControlBehavior = function(element) { + Sys.Extended.UI.ResizableControlBehavior.initializeBase(this, [element]); + + // Properties + this._handleCssClass = ""; + this._resizableCssClass = ""; + this._handleOffsetX = 0; + this._handleOffsetY = 0; + this._minimumWidth = 0; + this._minimumHeight = 0; + this._maximumWidth = 100000; + this._maximumHeight = 100000; + + // Variables + this._frame = null; + this._handle = null; + this._handleHolder = null; + this._lining = null; + this._tracking = false; + this._lastClientX = 0; + this._lastClientY = 0; + + // Delegates + this._onmouseoverDelegate = null; + this._onmouseoutDelegate = null; + this._onmousedownDelegate = null; + this._onmousemoveDelegate = null; + this._onmouseupDelegate = null; + this._onselectstartDelegate = null; +} + +Sys.Extended.UI.ResizableControlBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.ResizableControlBehavior.callBaseMethod(this, 'initialize'); + + this._frame = this.get_element(); + + var savedSizeString = Sys.Extended.UI.ResizableControlBehavior.callBaseMethod(this, 'get_ClientState'); + if(savedSizeString && (-1 != savedSizeString.indexOf(','))) { + var savedSize = savedSizeString.split(','); + this._frame.style.width = savedSize[0] + 'px'; + this._frame.style.height = savedSize[1] + 'px'; + } + + // The this._lining lets us measure the interior of the this._frame easily and + // protects the contents of this._frame (when resizing) from interactions + // with the mouse (ex: IFRAME grabbing mouse capture in IE or Firefox) + this._lining = document.createElement('DIV'); + this._lining.style.width = $common.getCurrentStyle(this._frame, 'width'); + this._lining.style.height = $common.getCurrentStyle(this._frame, 'height'); + this._lining.style.position = 'absolute'; + this._lining.style.backgroundColor = 'black'; // Keeps browsers from ignoring the content-free element + this._lining.style.opacity = "0"; // Makes the lining invisible + this._lining.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; // Ditto, for IE + this._lining.style.visibility = 'hidden'; + this._frame.insertBefore(this._lining, this._frame.firstChild); + + // The this._handleHolder provedes a wrapper with absolute positioning + // so that this._handle can be absolutely positioned relative to the + // this._frame instead of the page + this._handleHolder = document.createElement('DIV'); + this._handleHolder.style.width = '0px'; + this._handleHolder.style.height = '0px'; + this._handleHolder.style.position = ((Sys.Browser.agent === Sys.Browser.Opera) ? 'relative' : 'absolute'); + this._frame.insertBefore(this._handleHolder, this._frame.firstChild); + + // The this._handle represents the UI handle for the user to grab with + // the mouse + this._handle = document.createElement('DIV'); + this._handle.className = this._handleCssClass; + this._handle.style.position = 'absolute'; + this._handleHolder.appendChild(this._handle); + + this._onmouseoverDelegate = Function.createDelegate(this, this._onmouseover); + $addHandler(this._handle, 'mouseover', this._onmouseoverDelegate); + this._onmouseoutDelegate = Function.createDelegate(this, this._onmouseout); + $addHandler(this._handle, 'mouseout', this._onmouseoutDelegate); + this._onmousedownDelegate = Function.createDelegate(this, this._onmousedown); + $addHandler(this._handle, 'mousedown', this._onmousedownDelegate); + this._onmousemoveDelegate = Function.createDelegate(this, this._onmousemove); + this._onmouseupDelegate = Function.createDelegate(this, this._onmouseup); + this._onselectstartDelegate = Function.createDelegate(this, this._onselectstart); + + this._resizeControl(0, 0, 0, 0); + this._rememberSize(); + }, + + dispose: function() { + if(this._onmouseoverDelegate) { + $removeHandler(this._handle, 'mouseover', this._onmouseoverDelegate); + this._onmouseoverDelegate = null; + } + + if(this._onmouseoutDelegate) { + $removeHandler(this._handle, 'mouseout', this._onmouseoutDelegate); + this._onmouseoutDelegate = null; + } + + if(this._onmousedownDelegate) { + $removeHandler(this._handle, 'mousedown', this._onmousedownDelegate); + this._onmousedownDelegate = null; + } + + if(this._onmousemoveDelegate) { + if(this.tracking) + $removeHandler(document, 'mousemove', this._onmousemoveDelegate); + + this._onmousemoveDelegate = null; + } + + if(this._onmouseupDelegate) { + if(this.tracking) + $removeHandler(document, 'mouseup', this._onmouseupDelegate); + + this._onmouseupDelegate = null; + } + + if(this._onselectstartDelegate) { + if(this.tracking) { + $removeHandler(document, 'selectstart', this._onselectstartDelegate); + + if(Sys.Browser.agent === Sys.Browser.Opera) + $removeHandler(document, 'mousedown', this._onselectstartDelegate); + } + this._onselectstartDelegate = null; + } + + Sys.Extended.UI.ResizableControlBehavior.callBaseMethod(this, 'dispose'); + }, + + _onmouseover: function() { + Sys.UI.DomElement.addCssClass(this._frame, this._resizableCssClass); + }, + + _onmouseout: function() { + if(!this._tracking) + Sys.UI.DomElement.removeCssClass(this._frame, this._resizableCssClass); + }, + + _onmousedown: function(e) { + // TODO: Fix for new event model + if(!e) e = event; + + this._onmousedownImplementation(e.clientX, e.clientY); + }, + + _onmousedownImplementation: function(clientX, clientY) { + this._tracking = true; + this._resizeControl(clientX, clientY, 0, 0); + this._lining.style.visibility = 'visible'; // Overlay resizing control to avoid interacting with it (ex: IFRAME) + + $addHandler(document, 'mousemove', this._onmousemoveDelegate); + $addHandler(document, 'mouseup', this._onmouseupDelegate); + $addHandler(document, 'selectstart', this._onselectstartDelegate); + + if(Sys.Browser.agent === Sys.Browser.Opera) + $addHandler(document, 'mousedown', this._onselectstartDelegate); + + this.raise_resizeBegin(); + }, + + _onmousemove: function(e) { + // TODO: Fix for new event model + if(!e) e = event; + + this._onmousemoveImplementation(e.clientX, e.clientY); + }, + + _onmousemoveImplementation: function(clientX, clientY) { + if(this._tracking) { + var deltaX = (clientX - this._lastClientX); + var deltaY = (clientY - this._lastClientY); + this._resizeControl(clientX, clientY, deltaX, deltaY); + } + }, + + _onmouseup: function() { + this._tracking = false; + this._rememberSize(); + this._lining.style.visibility = 'hidden'; + + $removeHandler(document, 'mousemove', this._onmousemoveDelegate); + $removeHandler(document, 'mouseup', this._onmouseupDelegate); + $removeHandler(document, 'selectstart', this._onselectstartDelegate); + + if(Sys.Browser.agent === Sys.Browser.Opera) + $removeHandler(document, 'mousedown', this._onselectstartDelegate); + + Sys.UI.DomElement.removeCssClass(this._frame, this._resizableCssClass); + }, + + _onselectstart: function(e) { + // Don't allow selection during drag + e.preventDefault(); + + return false; + }, + + _resizeControl: function(clientX, clientY, deltaX, deltaY) { + // Save last client X/Y + this._lastClientX = clientX; + this._lastClientY = clientY; + + // Calculate new lining/frame width/height + var _liningWidth = Math.min(Math.max(this._lining.offsetWidth + deltaX, Math.max(this._minimumWidth, this._handle.offsetWidth)), this._maximumWidth), + _liningHeight = Math.min(Math.max(this._lining.offsetHeight + deltaY, Math.max(this._minimumHeight, this._handle.offsetHeight)), this._maximumHeight); + + // Set new lining/frame width/height + this._lining.style.width = _liningWidth + 'px'; + this._lining.style.height = _liningHeight + 'px'; + this._frame.style.width = _liningWidth + 'px'; + this._frame.style.height = _liningHeight + 'px'; + + // Calculate new handle left/top + var _handleLeft = this._lining.offsetWidth - this._handle.offsetWidth + this._handleOffsetX, + _handleTop = this._lining.offsetHeight - this._handle.offsetHeight + this._handleOffsetY; + + // Set new handle left/top + this._handle.style.left = _handleLeft + 'px'; + this._handle.style.top = _handleTop + 'px'; + + // Raise the resizing event + this.raise_resizing(); + }, + + _rememberSize: function() { + var size = this.get_size(); + // save the size in ClientState + Sys.Extended.UI.ResizableControlBehavior.callBaseMethod(this, 'set_ClientState', [size.width + ',' + size.height]); + // Raise the resize event + this.raise_resize(); + }, + + _measurementToNumber: function(m) { + // Get the magnitude of a measurement + // "m" - Measurement + // returns - magnitude of a measurement + return m.replace('px', ''); + }, + + /// + /// The name of the CSS class to apply to the resize handle + /// + /// get_handleCssClass + /// set_handleCssClass + /// + get_handleCssClass: function() { + return this._handleCssClass; + }, + set_handleCssClass: function(value) { + if(this._handleCssClass) + throw String.format(Sys.Extended.UI.Resources.ResizableControlBehavior_CannotChangeProperty, 'handleCssClass'); + + this._handleCssClass = value; + this.raisePropertyChanged('handleCssClass'); + }, + + get_HandleCssClass: function() { + Sys.Extended.Deprecated("get_HandleCssClass()", "get_handleCssClass()"); + return this.get_handleCssClass(); + }, + set_HandleCssClass: function(value) { + Sys.Extended.Deprecated("set_HandleCssClass(value)", "set_handleCssClass(value)"); + this.set_handleCssClass(value); + }, + + /// + /// The name of the CSS class to apply to the element when resizing + /// + /// get_resizableCssClass + /// set_resizableCssClass + /// + get_resizableCssClass: function() { + return this._resizableCssClass; + }, + set_resizableCssClass: function(value) { + if(this._resizableCssClass) + throw String.format(Sys.Extended.UI.Resources.ResizableControlBehavior_CannotChangeProperty, 'resizableCssClass'); + + this._resizableCssClass = value; + this.raisePropertyChanged('resizableCssClass'); + }, + + get_ResizableCssClass: function() { + Sys.Extended.Deprecated("get_ResizableCssClass()", "get_resizableCssClass()"); + return this.get_resizableCssClass(); + }, + set_ResizableCssClass: function(value) { + Sys.Extended.Deprecated("set_ResizableCssClass(value)", "set_resizableCssClass(value)"); + this.set_resizableCssClass(value); + }, + + /// + /// X-Offset to apply to the location of the resize handle + /// + /// get_handleOffsetX + /// set_handleOffsetX + /// + get_handleOffsetX: function() { + return this._handleOffsetX; + }, + set_handleOffsetX: function(value) { + if(this._handleOffsetX != value) { + this._handleOffsetX = value; + this.raisePropertyChanged('handleOffsetX'); + } + }, + + get_HandleOffsetX: function() { + Sys.Extended.Deprecated("get_HandleOffsetX()", "get_handleOffsetX()"); + return this.get_handleOffsetX(); + }, + set_HandleOffsetX: function(value) { + Sys.Extended.Deprecated("set_HandleOffsetX(value)", "set_handleOffsetX(value)"); + this.set_handleOffsetX(value); + }, + + /// + /// Y-Offset to apply to the location of the resize handle + /// + /// get_handleOffsetY + /// set_handleOffsetY + /// + get_handleOffsetY: function() { + return this._handleOffsetY; + }, + set_handleOffsetY: function(value) { + if(this._handleOffsetY != value) { + this._handleOffsetY = value; + this.raisePropertyChanged('handleOffsetY'); + } + }, + + get_HandleOffsetY: function() { + Sys.Extended.Deprecated("get_HandleOffsetY()", "get_handleOffsetY()"); + return this.get_handleOffsetY(); + }, + set_HandleOffsetY: function(value) { + Sys.Extended.Deprecated("set_HandleOffsetY(value)", "set_handleOffsetY(value)"); + this.set_handleOffsetY(value); + }, + + /// + /// Minimum width of the resizable element + /// + /// get_minimumWidth + /// set_minimumWidth + /// + get_minimumWidth: function() { + return this._minimumWidth; + }, + set_minimumWidth: function(value) { + if(this._minimumWidth != value) { + this._minimumWidth = value; + this.raisePropertyChanged('minimumWidth'); + } + }, + + get_MinimumWidth: function() { + Sys.Extended.Deprecated("get_MinimumWidth()", "get_minimumWidth()"); + return this.get_minimumWidth(); + }, + set_MinimumWidth: function(value) { + Sys.Extended.Deprecated("set_MinimumWidth(value)", "set_minimumWidth(value)"); + this.set_minimumWidth(value); + }, + + /// + /// Minimum height of the resizable element + /// + /// get_minimumHeight + /// set_minimumHeight + /// + get_minimumHeight: function() { + return this._minimumHeight; + }, + set_minimumHeight: function(value) { + if(this._minimumHeight != value) { + this._minimumHeight = value; + this.raisePropertyChanged('minimumHeight'); + } + }, + + get_MinimumHeight: function() { + Sys.Extended.Deprecated("get_MinimumHeight()", "get_minimumHeight()"); + return this.get_minimumHeight(); + }, + set_MinimumHeight: function(value) { + Sys.Extended.Deprecated("set_MinimumHeight(value)", "set_minimumHeight(value)"); + this.set_minimumHeight(value); + }, + + /// + /// Maximum width of the resizable element + /// + /// get_maximumWidth + /// set_maximumWidth + /// + get_maximumWidth: function() { + return this._maximumWidth; + }, + set_maximumWidth: function(value) { + if(this._maximumWidth != value) { + this._maximumWidth = value; + this.raisePropertyChanged('maximumWidth'); + } + }, + + get_MaximumWidth: function() { + Sys.Extended.Deprecated("get_MaximumWidth()", "get_maximumWidth()"); + return this.get_maximumWidth(); + }, + set_MaximumWidth: function(value) { + Sys.Extended.Deprecated("set_MaximumWidth(value)", "set_maximumWidth(value)"); + this.set_maximumWidth(value); + }, + + /// + /// Maximum height of the resizable element + /// + /// get_maximumHeight + /// set_maximumHeight + /// + get_maximumHeight: function() { + return this._maximumHeight; + }, + set_maximumHeight: function(value) { + if(this._maximumHeight != value) { + this._maximumHeight = value; + this.raisePropertyChanged('maximumHeight'); + } + }, + + get_MaximumHeight: function() { + Sys.Extended.Deprecated("get_MaximumHeight()", "get_maximumHeight()"); + return this.get_maximumHeight(); + }, + set_MaximumHeight: function(value) { + Sys.Extended.Deprecated("set_MaximumHeight(value)", "set_maximumHeight(value)"); + this.set_maximumHeight(value); + }, + + /// + /// Fires as the element is being resized + /// + /// + /// + add_resizing: function(handler) { + this.get_events().addHandler("resizing", handler); + }, + remove_resizing: function(handler) { + this.get_events().removeHandler("resizing", handler); + }, + raise_resizing: function() { + var onResizingHandler = this.get_events().getHandler("resizing"); + if(onResizingHandler) + onResizingHandler(this, Sys.EventArgs.Empty); + }, + raiseResizing: function() { + Sys.Extended.Deprecated("raiseResizing()", "raise_resizing()"); + this.raise_resizing(); + }, + + /// + /// The Resizing event handler + /// + /// get_resizing + /// set_resizing + /// + get_resizing: function() { + // Function to invoke on resizing (can a Function, name of a Function, or expression that evaluates to a Function) + return this.get_events().getHandler("resizing"); + }, + set_resizing: function(value) { + if(value && (0 < value.length)) { + var func = $common.resolveFunction(value); + + if(func) + this.add_resizing(func); + else + throw Error.argumentType('value', typeof (value), 'Function', String.format(Sys.Extended.UI.Resources.ResizableControlBehavior_InvalidHandler, 'resizing')); + } + }, + + /// + /// Fires when the element has been resized + /// + /// + /// + add_resize: function(handler) { + this.get_events().addHandler("resize", handler); + }, + remove_resize: function(handler) { + this.get_events().removeHandler("resize", handler); + }, + raise_resize: function() { + var onResizeHandler = this.get_events().getHandler("resize"); + if(onResizeHandler) + onResizeHandler(this, Sys.EventArgs.Empty); + }, + raiseResize: function() { + Sys.Extended.Deprecated("raiseResize()", "raise_resize()"); + this.raise_resize(); + }, + + /// + /// The Resize event handler + /// + /// get_resize + /// set_resize + /// + get_resize: function() { + // Function to invoke on resize (can be a Function, name of a Function, or expression that evaluates to a Function) + return this.get_events().getHandler("resize"); + }, + set_resize: function(value) { + if(value && (0 < value.length)) { + var func = $common.resolveFunction(value); + + if(func) + this.add_resize(func); + else + throw Error.argumentType('value', typeof (value), 'Function', String.format(Sys.Extended.UI.Resources.ResizableControlBehavior_InvalidHandler, 'resize')); + } + }, + + /// + /// Fires when the element starts being resized + /// + /// + /// + add_resizeBegin: function(handler) { + this.get_events().addHandler("resizeBegin", handler); + }, + remove_resizeBegin: function(handler) { + this.get_events().removeHandler("resizeBegin", handler); + }, + raise_resizeBegin: function() { + var onResizeBeginHandler = this.get_events().getHandler("resizeBegin"); + + if(onResizeBeginHandler) + onResizeBeginHandler(this, Sys.EventArgs.Empty); + }, + + add_resizebegin: function(handler) { + Sys.Extended.Deprecated("add_resizebegin(handler)", "add_resizeBegin(handler)"); + this.add_resizeBegin(handler); + }, + remove_resizebegin: function(handler) { + Sys.Extended.Deprecated("remove_resizebegin(handler)", "remove_resizeBegin(handler)"); + this.remove_resizeBegin(handler); + }, + raiseResizeBegin: function() { + Sys.Extended.Deprecated("raiseResizeBegin()", "raise_resizeBegin()"); + this.raise_resizeBegin(); + }, + + /// + /// The ResizeBegin event handler + /// + /// get_resizeBegin + /// set_resizeBegin + /// + get_resizeBegin: function() { + // Function to invoke on resizebegin (can be a Function, name of a Function, or expression that evaluates to a Function) + return this.get_events().getHandler("resizeBegin"); + }, + set_resizeBegin: function(value) { + if(value && (0 < value.length)) { + var func = $common.resolveFunction(value); + + if(func) + this.add_resizeBegin(func); + else + throw Error.argumentType('value', typeof (value), 'Function', String.format(Sys.Extended.UI.Resources.ResizableControlBehavior_InvalidHandler, 'resizeBegin')); + } + }, + + get_resizebegin: function() { + Sys.Extended.Deprecated("get_resizebegin()", "get_resizeBegin()"); + return this.get_resizeBegin(); + }, + set_resizebegin: function(value) { + Sys.Extended.Deprecated("set_resizebegin(value)", "set_resizeBegin(value)"); + this.set_resizeBegin(value); + }, + + /// + /// Size of the target (of the form {width, height}) + /// + /// get_size + /// set_size + /// + get_size: function() { + return { + width: this._measurementToNumber($common.getCurrentStyle(this._lining, 'width')), + height: this._measurementToNumber($common.getCurrentStyle(this._lining, 'height')) + }; + }, + set_size: function(value) { + var deltaX = value.width - this._measurementToNumber($common.getCurrentStyle(this._lining, 'width')), + deltaY = value.height - this._measurementToNumber($common.getCurrentStyle(this._lining, 'height')); + + this._resizeControl(0, 0, deltaX, deltaY); + this._rememberSize(); + this.raisePropertyChanged('size'); + }, + + get_Size: function() { + Sys.Extended.Deprecated("get_Size()", "get_size()"); + return this.get_size(); + }, + set_Size: function(value) { + Sys.Extended.Deprecated("set_Size(value)", "set_size(value)"); + this.set_size(value); + } +} + +Sys.Extended.UI.ResizableControlBehavior.registerClass('Sys.Extended.UI.ResizableControlBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/RoundedCorners.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/RoundedCorners.debug.js new file mode 100644 index 000000000..f197458a7 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/RoundedCorners.debug.js @@ -0,0 +1,514 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.BoxCorners = function() { + throw Error.invalidOperation(); +} + +Sys.Extended.UI.BoxCorners.prototype = { + None: 0x00, + + TopLeft: 0x01, + TopRight: 0x02, + BottomRight: 0x04, + BottomLeft: 0x08, + + Top: 0x01 | 0x02, + Right: 0x02 | 0x04, + Bottom: 0x04 | 0x08, + Left: 0x08 | 0x01, + All: 0x01 | 0x02 | 0x04 | 0x08 +} + +Sys.Extended.UI.BoxCorners.registerEnum("Sys.Extended.UI.BoxCorners", true); + +Sys.Extended.UI.RoundedCornersBehavior = function(element) { + // The RoundedCornersBehavior rounds the corners of its target element + // "element" - DOM element associated with the behavior + Sys.Extended.UI.RoundedCornersBehavior.initializeBase(this, [element]); + + this._corners = Sys.Extended.UI.BoxCorners.All; + this._radius = 5; + this._color = null; + this._parentDiv = null; + this._originalStyle = null; + this._borderColor = null; + this._isDirty = true; +} + +Sys.Extended.UI.RoundedCornersBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this, 'initialize'); + this.update(); + }, + + dispose: function() { + this.disposeParentDiv(); + Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this, 'dispose'); + }, + + update: function() { + // Create the surrounding div that will have rounded corners + var e = this.get_element(); + + if(!e || !this._isDirty || this.get_isUpdating()) + return; + + this.disposeParentDiv(); + + // This works with IE and latest versions of Chrome + if(e.style.borderRadius != undefined) { + e.style.borderRadius = this._radius + "px"; + + // if border color is not none then set + // border style to solid and border width to 1px + if(this._borderColor) { + e.style.border = "solid"; + e.style.borderWidth = "1px"; + e.style.borderColor = this._borderColor; + } + else { + e.style.border = "none"; + e.style.borderWidth = "0"; + } + + // if TopLeft corner is unchecked then Top left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)) + e.style.borderTopLeftRadius = "0"; + + // if BottomLeft corner is unchecked then Bottom left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)) + e.style.borderBottomLeftRadius = "0"; + + // if TopRight corner is unchecked then Top right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)) + e.style.borderTopRightRadius = "0"; + + // if BottomRight corner is unchecked then Bottom Right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)) + e.style.borderBottomRightRadius = "0"; + } + // This works with FireFox + else if(e.style.MozBorderRadius != undefined) { + e.style.MozBorderRadius = this._radius + "px"; + + // if border color is not none then set + // border style to solid and border width to 1px + if(this._borderColor) { + e.style.border = "solid"; + e.style.borderWidth = "1px"; + e.style.borderColor = this._borderColor; + } else { + e.style.border = "none"; + e.style.borderWidth = "0"; + } + + // if TopLeft corner is unchecked then Top left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)) + e.style.MozBorderRadiusTopleft = "0"; + + // if BottomLeft corner is unchecked then Bottom left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)) + e.style.MozBorderRadiusBottomleft = "0"; + + // if TopRight corner is unchecked then Top right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)) + e.style.MozBorderRadiusTopright = "0"; + + // if BottomRight corner is unchecked then Bottom Right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)) + e.style.MozBorderRadiusBottomright = "0"; + + } + // This works with older versions of google Chrome + else if(e.style.WebkitBorderRadius != undefined) { + e.style.WebkitBorderRadius = this._radius + "px"; + + // if border color is not none then set + // border style to solid and border width to 1px + if(this._borderColor) { + e.style.border = "solid"; + e.style.borderWidth = "1px"; + e.style.borderColor = this._borderColor; + } else { + e.style.border = "none"; + e.style.borderWidth = "0"; + } + + // if TopLeft corner is unchecked then Top left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)) + e.style.WebkitBorderRadiusTopLeft = "0"; + + // if BottomLeft corner is unchecked then Bottom left corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)) + e.style.WebkitBorderRadiusBottomLeft = "0"; + + // if TopRight corner is unchecked then Top right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)) + e.style.WebkitBorderRadiusTopRight = "0"; + + // if BottomRight corner is unchecked then Bottom Right corner will not be round + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)) + e.style.WebkitBorderRadiusBottomRight = "0"; + } + // if browser does not support css3 then continue old way to make corners round + else { + var color = this.getBackgroundColor(), + originalWidth = e.offsetWidth, + newParent = e.cloneNode(false); + + // move all children into the new div. + this.moveChildren(e, newParent); + + // modify the target element to be transparent + // and set up the new parent + this._originalStyle = e.style.cssText; + e.style.backgroundColor = "transparent"; + e.style.verticalAlign = "top"; + e.style.padding = "0"; + e.style.overflow = ""; + e.style.className = ""; + + // Don't assume there is a numerical value for height. A height of "auto" is possible. + if(e.style.height && e.style.height != "auto") + // Increase the height to account for the rounded corners + e.style.height = parseInt($common.getCurrentStyle(e, 'height')) + (this._radius * 2) + "px"; + else + // Note: Do NOT use $common.getCurrentStyle in the check below + // because that breaks the work-around + if(!e.style.width && (0 < originalWidth)) + // The following line works around a problem where IE renders the first + // rounded DIV about 6 pixels too high if e doesn't have a width or height + e.style.width = originalWidth + "px"; + + // these are properties we don't want cloned down to the new parent + newParent.style.position = ""; + newParent.style.border = ""; + newParent.style.margin = ""; + newParent.style.width = "100%"; + if((newParent.style.overflow == "") && ($common.getCurrentStyle(e, "overflow") == "visible")) + // If the style of the target element has not been set inline, + // and has not been set in a stylesheet to something other than "visible" + // (which is the default), then set it to "auto", so that any child block elements + // do not cause the rounded corner divs to display as separated from the target div + newParent.style.overflow = "auto"; + + newParent.id = ""; + newParent.removeAttribute("control"); + + if(this._borderColor) { + newParent.style.borderTopStyle = "none"; + newParent.style.borderBottomStyle = "none"; + newParent.style.borderLeftStyle = "solid"; + newParent.style.borderRightStyle = "solid"; + newParent.style.borderLeftColor = this._borderColor; + newParent.style.borderRightColor = this._borderColor; + newParent.style.borderLeftWidth = "1px"; + newParent.style.borderRightWidth = "1px"; + + if(this._radius == 0) { + newParent.style.borderTopStyle = "solid"; + newParent.style.borderBottomStyle = "solid"; + newParent.style.borderTopColor = this._borderColor; + newParent.style.borderBottomColor = this._borderColor; + newParent.style.borderTopWidth = "1px"; + newParent.style.borderBottomWidth = "1px"; + } + } else { + newParent.style.borderTopStyle = "none"; + newParent.style.borderBottomStyle = "none"; + newParent.style.borderLeftStyle = "none"; + newParent.style.borderRightStyle = "none"; + } + + // build a set of steps on each end to fake the corners. + // ------- (step 0) + // -------- (step n-1) + // --------- (step n) + // XXXXXXXXX (inner div) + // XXXXXXXXX + // --------- (bottom step n) + // -------- (bottom step n-1) + // ------ (bottom step 0) + + var lastDiv = null, + radius = this._radius, + lines = this._radius, + lastDelta = 0; + + for(var i = lines; i > 0; i--) { + // figure out how much we'll need to subtract from each item + var angle = Math.acos(i / radius), + delta = radius - Math.round(Math.sin(angle) * radius); + + // build a 1 pixel tall div + // that's delta pixels shorter on each end. + + // add the top one + var newDiv = document.createElement("DIV"); + newDiv.__roundedDiv = true; + newDiv.style.backgroundColor = color; + newDiv.style.marginLeft = delta + "px"; + newDiv.style.marginRight = (delta - (this._borderColor ? 2 : 0)) + "px"; + newDiv.style.height = "1px"; + newDiv.style.fontSize = "1px"; // workaround for IE wierdness with 1px divs. + newDiv.style.overflow = "hidden"; + + if(this._borderColor) { + newDiv.style.borderLeftStyle = "solid"; + newDiv.style.borderRightStyle = "solid"; + newDiv.style.borderLeftColor = this._borderColor; + newDiv.style.borderRightColor = this._borderColor; + + var offset = Math.max(0, lastDelta - delta - 1); + newDiv.style.borderLeftWidth = (offset + 1) + "px"; + newDiv.style.borderRightWidth = (offset + 1) + "px"; + + if(i == lines) { + newDiv.__roundedDivNoBorder = true; + newDiv.style.backgroundColor = this._borderColor; + } + } + + e.insertBefore(newDiv, lastDiv); + + var topDiv = newDiv; + + // add the bottom one one + newDiv = newDiv.cloneNode(true); + newDiv.__roundedDiv = true; + + e.insertBefore(newDiv, lastDiv); + + var bottomDiv = newDiv; + + lastDiv = newDiv; + lastDelta = delta; + + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)) { + topDiv.style.marginLeft = "0"; + if(this._borderColor) + topDiv.style.borderLeftWidth = "1px"; + } + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)) { + topDiv.style.marginRight = "0"; + if(this._borderColor) { + topDiv.style.borderRightWidth = "1px"; + topDiv.style.marginRight = "-2px"; + } + } + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)) { + bottomDiv.style.marginLeft = "0"; + if(this._borderColor) + bottomDiv.style.borderLeftWidth = "1px"; + } + if(!this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)) { + bottomDiv.style.marginRight = "0"; + if(this._borderColor) { + bottomDiv.style.borderRightWidth = "1px"; + bottomDiv.style.marginRight = "-2px"; + } + } + } + + // finally, add the newParent (which has all the original content) + // into the div. + e.insertBefore(newParent, lastDiv); + this._parentDiv = newParent; + this._isDirty = false; + } + }, + + disposeParentDiv: function() { + // Dispose the surrounding div with rounded corners + + if(this._parentDiv) { + // clean up the divs we added. + var e = this.get_element(), + children = e.childNodes; + + for(var i = children.length - 1; i >= 0; i--) { + var child = children[i]; + if(child) { + if(child == this._parentDiv) + this.moveChildren(child, e); + + try { + e.removeChild(child); + } catch(e) { + // Safari likes to throw NOT_FOUND_ERR (DOMException 8) + // but it seems to work fine anyway. + } + } + } + + // restore the original style + if(this._originalStyle) { + e.style.cssText = this._originalStyle; + this._originalStyle = null; + } + this._parentDiv = null; + } + }, + + /// + /// Returns the background color of the target element + /// + /// String contains the color of the target element + /// + getBackgroundColor: function() { + if(this._color) + return this._color; + return $common.getCurrentStyle(this.get_element(), 'backgroundColor'); + }, + + moveChildren: function(src, dest) { + // Move the child nodes from one element to another + // "src" - DOM Element + // "dest" - DOM Element + var moveCount = 0; + while(src.hasChildNodes()) { + var child = src.childNodes[0]; + child = src.removeChild(child); + dest.appendChild(child); + moveCount++; + } + return moveCount; + }, + + /// + /// Checks whether a flag for this corner has been set + /// + /// Corner to check + /// True if the corner has been set; otherwise, false + /// + isCornerSet: function(corner) { + return (this._corners & corner) != Sys.Extended.UI.BoxCorners.None; + }, + + /// + /// Sets a corner as one that should be rounded + /// + /// Corner to set + /// True to set the value, false to clear it + /// + setCorner: function(corner, value) { + if(value) + this.set_corners(this._corners | corner); + else + this.set_corners(this._corners & ~corner); + }, + + /// + /// A string that contains the background color of the rounded corner areas + /// + /// + /// By default, this property gets the background color of the panel that it is attached to + /// + /// get_color + /// set_color + /// + get_color: function() { + return this._color; + }, + set_color: function(value) { + if(value != this._color) { + this._color = value; + this._isDirty = true; + this.update(); + this.raisePropertyChanged('color'); + } + }, + + get_Color: function() { + Sys.Extended.Deprecated("get_Color()", "get_color()"); + return this.get_color(); + }, + set_Color: function(value) { + Sys.Extended.Deprecated("set_Color(value)", "set_color(value)"); + this.set_color(value); + }, + + /// + /// An integer value that specifies the radius of the corners (and the height of the added area). The default is 5 + /// The default is 5 + /// + /// get_radius + /// set_radius + /// + get_radius: function() { + return this._radius; + }, + set_radius: function(value) { + if(value != this._radius) { + this._radius = value; + this._isDirty = true; + this.update(); + this.raisePropertyChanged('radius'); + } + }, + + get_Radius: function() { + Sys.Extended.Deprecated("get_Radius()", "get_radius()"); + return this.get_radius(); + }, + set_Radius: function(value) { + Sys.Extended.Deprecated("set_Radius(value)", "set_radius(value)"); + this.set_radius(value); + }, + + /// + /// A Sys.Extended.UI.BoxCorners object that specifies which corners should be rounded + /// + /// get_corners + /// set_corners + /// + get_corners: function() { + return this._corners; + }, + set_corners: function(value) { + if(value != this._corners) { + this._corners = value; + this._isDirty = true; + this.update(); + this.raisePropertyChanged("corners"); + } + }, + + get_Corners: function() { + Sys.Extended.Deprecated("get_Corners()", "get_corners()"); + return this.get_corners(); + }, + set_Corners: function(value) { + Sys.Extended.Deprecated("set_Corners(value)", "set_corners(value)"); + this.set_corners(value); + }, + + /// + /// A string that contains the color of the border and therefore of the rounded corners + /// + /// get_borderColor + /// set_borderColor + /// + get_borderColor: function() { + return this._borderColor; + }, + set_borderColor: function(value) { + if(value != this._borderColor) { + this._borderColor = value; + this._isDirty = true; + this.update(); + this.raisePropertyChanged("borderColor"); + } + }, + + get_BorderColor: function() { + Sys.Extended.Deprecated("get_BorderColor()", "get_borderColor()"); + return this.get_borderColor(); + }, + set_BorderColor: function(value) { + Sys.Extended.Deprecated("set_BorderColor(value)", "set_borderColor(value)"); + this.set_borderColor(value); + } +} + +Sys.Extended.UI.RoundedCornersBehavior.registerClass('Sys.Extended.UI.RoundedCornersBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Seadragon.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Seadragon.debug.js new file mode 100644 index 000000000..3fbb69dbf --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Seadragon.debug.js @@ -0,0 +1,4512 @@ +Type.registerNamespace('Sys.Extended.UI.Seadragon'); +Type.registerNamespace('Seadragon'); + +Seadragon.Utils = function() { + + // Enumerations + var Browser = { + UNKNOWN: 0, + IE: 1, + FIREFOX: 2, + SAFARI: 3, + CHROME: 4, + OPERA: 5 + }; + + Seadragon.Browser = Browser; + + // Fields + var self = this; + + var arrActiveX = ["Msxml2.XMLHTTP", "Msxml3.XMLHTTP", "Microsoft.XMLHTTP"]; + var fileFormats = { + "bmp": false, + "jpeg": true, + "jpg": true, + "png": true, + "tif": false, + "wdp": false + }; + + var browser = Browser.UNKNOWN; + var browserVersion = 0; + var badAlphaBrowser = false; // updated in constructor + + var urlParams = {}; + + // Constructor + (function() { + + // Browser detect + var app = navigator.appName; + var ver = navigator.appVersion; + var ua = navigator.userAgent; + + if(app == "Microsoft Internet Explorer" && + !!window.attachEvent && !!window.ActiveXObject) { + + var ieOffset = ua.indexOf("MSIE"); + browser = Browser.IE; + browserVersion = parseFloat( + ua.substring(ieOffset + 5, ua.indexOf(";", ieOffset))); + } else if(app == "Netscape" && !!window.addEventListener) { + + var ffOffset = ua.indexOf("Firefox"); + var saOffset = ua.indexOf("Safari"); + var chOffset = ua.indexOf("Chrome"); + + if(ffOffset >= 0) { + browser = Browser.FIREFOX; + browserVersion = parseFloat(ua.substring(ffOffset + 8)); + } else if(saOffset >= 0) { + var slash = ua.substring(0, saOffset).lastIndexOf("/"); + browser = (chOffset >= 0) ? Browser.CHROME : Browser.SAFARI; + browserVersion = parseFloat(ua.substring(slash + 1, saOffset)); + } + } else if(app == "Opera" && !!window.opera && !!window.attachEvent) { + browser = Browser.OPERA; + browserVersion = parseFloat(ver); + } + + // Url parameters + var query = window.location.search.substring(1); // ignore '?' + var parts = query.split('&'); + + for(var i = 0; i < parts.length; i++) { + var part = parts[i]; + var sep = part.indexOf('='); + + if(sep > 0) + urlParams[part.substring(0, sep)] = decodeURIComponent(part.substring(sep + 1)); + } + + // Browser behaviors + + // update: chrome 2 no longer has this problem! + badAlphaBrowser = (browser == Browser.IE || (browser == Browser.CHROME && browserVersion < 2)); + })(); + + // Helpers + + function getOffsetParent(elmt, isFixed) { + // IE and Opera "fixed" position elements don't have offset parents. + // regardless, if it's fixed, its offset parent is the body. + if(isFixed && elmt != document.body) + return document.body; + else + return elmt.offsetParent; + } + + // Methods + + this.getBrowser = function() { + return browser; + }; + + this.getBrowserVersion = function() { + return browserVersion; + }; + + this.getElement = function(elmt) { + if(typeof (elmt) == "string") + elmt = document.getElementById(elmt); + + return elmt; + }; + + this.getElementPosition = function(elmt) { + var elmt = self.getElement(elmt); + var result = new Seadragon.Point(); + + // technique from: + // http://www.quirksmode.org/js/findpos.html + // with special check for "fixed" elements. + + var isFixed = self.getElementStyle(elmt).position == "fixed"; + var offsetParent = getOffsetParent(elmt, isFixed); + + while(offsetParent) { + result.x += elmt.offsetLeft; + result.y += elmt.offsetTop; + + if(isFixed) + result = result.plus(self.getPageScroll()); + + elmt = offsetParent; + isFixed = self.getElementStyle(elmt).position == "fixed"; + offsetParent = getOffsetParent(elmt, isFixed); + } + + return result; + }; + + this.getElementSize = function(elmt) { + var elmt = self.getElement(elmt); + return new Seadragon.Point(elmt.clientWidth, elmt.clientHeight); + }; + + this.getElementStyle = function(elmt) { + var elmt = self.getElement(elmt); + + if(elmt.currentStyle) + return elmt.currentStyle; + else if(window.getComputedStyle) + return window.getComputedStyle(elmt, ""); + else + Seadragon.Debug.fail("Unknown element style, no known technique."); + }; + + this.getEvent = function(event) { + return event ? event : window.event; + }; + + this.getMousePosition = function(event) { + var event = self.getEvent(event); + var result = new Seadragon.Point(); + + // technique from: + // http://www.quirksmode.org/js/events_properties.html + + if(typeof (event.pageX) == "number") { + result.x = event.pageX; + result.y = event.pageY; + } else if(typeof (event.clientX) == "number") { + result.x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + result.y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop; + } else { + Seadragon.Debug.fail("Unknown event mouse position, no known technique."); + } + + return result; + }; + + this.getPageScroll = function() { + var result = new Seadragon.Point(); + var docElmt = document.documentElement || {}; + var body = document.body || {}; + + // technique from: + // http://www.howtocreate.co.uk/tutorials/javascript/browserwindow + + if(typeof (window.pageXOffset) == "number") { + // most browsers + result.x = window.pageXOffset; + result.y = window.pageYOffset; + } else if(body.scrollLeft || body.scrollTop) { + // W3C spec, IE6+ in quirks mode + result.x = body.scrollLeft; + result.y = body.scrollTop; + } else if(docElmt.scrollLeft || docElmt.scrollTop) { + // IE6+ in standards mode + result.x = docElmt.scrollLeft; + result.y = docElmt.scrollTop; + } + + // note: we specifically aren't testing for typeof here, because IE sets + // the appropriate variables undefined instead of 0 under certain + // conditions. this means we also shouldn't fail if none of the three + // cases are hit; we'll just assume the page scroll is 0. + + return result; + }; + + this.getWindowSize = function() { + var result = new Seadragon.Point(); + var docElmt = document.documentElement || {}; + var body = document.body || {}; + + // technique from: + // http://www.howtocreate.co.uk/tutorials/javascript/browserwindow + + // important: i originally cleaned up the second and third IE checks to + // check if the typeof was number. but this fails for quirks mode, + // because docElmt.clientWidth is indeed a number, but it's incorrectly + // zero. so no longer checking typeof is number for those cases. + + if(typeof (window.innerWidth) == 'number') { + // non-IE browsers + result.x = window.innerWidth; + result.y = window.innerHeight; + } else if(docElmt.clientWidth || docElmt.clientHeight) { + // IE6+ in standards mode + result.x = docElmt.clientWidth; + result.y = docElmt.clientHeight; + } else if(body.clientWidth || body.clientHeight) { + // IE6+ in quirks mode + result.x = body.clientWidth; + result.y = body.clientHeight; + } else { + Seadragon.Debug.fail("Unknown window size, no known technique."); + } + + return result; + }; + + this.imageFormatSupported = function(ext) { + var ext = ext ? ext : ""; + return !!fileFormats[ext.toLowerCase()]; + }; + + this.makeCenteredNode = function(elmt) { + var elmt = Seadragon.Utils.getElement(elmt); + var div = self.makeNeutralElement("div"); + var html = []; + + // technique for vertically centering (in IE!!!) from: + // http://www.jakpsatweb.cz/css/css-vertical-center-solution.html + // with explicit neutralizing of styles added by me. + html.push('
    '); + // the text-align:left guards against incorrect centering in IE + html.push('
    '); + html.push('
    '); + + div.innerHTML = html.join(''); + div = div.firstChild; + + // now add the element as a child to the inner-most div + var innerDiv = div; + var innerDivs = div.getElementsByTagName("div"); + while(innerDivs.length > 0) { + innerDiv = innerDivs[0]; + innerDivs = innerDiv.getElementsByTagName("div"); + } + + innerDiv.appendChild(elmt); + + return div; + }; + + this.makeNeutralElement = function(tagName) { + var elmt = document.createElement(tagName); + var style = elmt.style; + + // TODO reset neutral element's style in a better way + style.background = "transparent none"; + style.border = "none"; + style.margin = "0px"; + style.padding = "0px"; + style.position = "static"; + + return elmt; + }; + + this.makeTransparentImage = function(src) { + var img = self.makeNeutralElement("img"); + var elmt = null; + + if(browser == Browser.IE && browserVersion < 7) { + elmt = self.makeNeutralElement("span"); + elmt.style.display = "inline-block"; + + // to size span correctly, load image and get natural size, + // but don't override any user-set CSS values + img.onload = function() { + elmt.style.width = elmt.style.width || img.width + "px"; + elmt.style.height = elmt.style.height || img.height + "px"; + + img.onload = null; + img = null; // to prevent memory leaks in IE + }; + + img.src = src; + elmt.style.filter = + "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + + src + "', sizingMethod='scale')"; + } else { + elmt = img; + elmt.src = src; + } + + return elmt; + }; + + this.setElementOpacity = function(elmt, opacity, usesAlpha) { + var elmt = self.getElement(elmt); + + if(usesAlpha && badAlphaBrowser) + // images with alpha channels won't fade well, so round + opacity = Math.round(opacity); + + // for CSS opacity browsers, remove opacity value if it's unnecessary + if(opacity < 1) + elmt.style.opacity = opacity; + else + elmt.style.opacity = ""; + + // for CSS filter browsers (IE), remove alpha filter if it's unnecessary + if(opacity == 1) { + var prevFilter = elmt.style.filter || ""; + elmt.style.filter = prevFilter.replace(/alpha\(.*?\)/g, ""); + // important: note the lazy star! this protects against + // multiple filters; we don't want to delete the other ones. + return; + } + + var ieOpacity = Math.round(100 * opacity); + var ieFilter = " alpha(opacity=" + ieOpacity + ") "; + + // check if this element has filters associated with it (IE only), + // but prevent bug where IE throws error "Member not found" sometimes. + try { + if(elmt.filters && elmt.filters.alpha) + elmt.filters.alpha.opacity = ieOpacity; + else + elmt.style.filter += ieFilter; + } catch(e) { + elmt.style.filter += ieFilter; + } + }; + + this.addEvent = function(elmt, eventName, handler, useCapture) { + var elmt = self.getElement(elmt); + + // technique from: + // http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/ + + if(elmt.addEventListener) { + elmt.addEventListener(eventName, handler, useCapture); + } else if(elmt.attachEvent) { + elmt.attachEvent("on" + eventName, handler); + if(useCapture && elmt.setCapture) + elmt.setCapture(); + } else { + Seadragon.Debug.fail("Unable to attach event handler, no known technique."); + } + }; + + this.removeEvent = function(elmt, eventName, handler, useCapture) { + var elmt = self.getElement(elmt); + + // technique from: + // http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/ + + if(elmt.removeEventListener) { + elmt.removeEventListener(eventName, handler, useCapture); + } else if(elmt.detachEvent) { + elmt.detachEvent("on" + eventName, handler); + if(useCapture && elmt.releaseCapture) + elmt.releaseCapture(); + } else { + Seadragon.Debug.fail("Unable to detach event handler, no known technique."); + } + }; + + this.cancelEvent = function(event) { + var event = self.getEvent(event); + + // technique from: + // http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/ + + if(event.preventDefault) + event.preventDefault(); // W3C for preventing default + + event.cancel = true; // legacy for preventing default + event.returnValue = false; // IE for preventing default + }; + + this.stopEvent = function(event) { + var event = self.getEvent(event); + + // technique from: + // http://blog.paranoidferret.com/index.php/2007/08/10/javascript-working-with-events/ + + if(event.stopPropagation) { + event.stopPropagation(); // W3C for stopping propagation + } + + event.cancelBubble = true; // IE for stopping propagation + }; + + this.createCallback = function(object, method) { + // create callback args + var initialArgs = []; + for(var i = 2; i < arguments.length; i++) + initialArgs.push(arguments[i]); + + // create closure to apply method + return function() { + // concatenate new args, but make a copy of initialArgs first + var args = initialArgs.concat([]); + for(var i = 0; i < arguments.length; i++) + args.push(arguments[i]); + + return method.apply(object, args); + }; + }; + + this.getUrlParameter = function(key) { + var value = urlParams[key]; + return value ? value : null; + }; + + this.makeAjaxRequest = function(url, callback) { + var async = typeof (callback) == "function"; + var req = null; + + if(async) { + var actual = callback; + var callback = function() { + window.setTimeout(Seadragon.Utils.createCallback(null, actual, req), 1); + }; + } + + if(window.ActiveXObject) + for(var i = 0; i < arrActiveX.length; i++) + try { + req = new ActiveXObject(arrActiveX[i]); + break; + } catch(e) { + continue; + } + else if(window.XMLHttpRequest) + req = new XMLHttpRequest(); + + if(!req) + Seadragon.Debug.fail("Browser doesn't support XMLHttpRequest."); + + if(async) + req.onreadystatechange = function() { + if(req.readyState == 4) { + // prevent memory leaks by breaking circular reference now + req.onreadystatechange = new Function(); + callback(); + } + }; + + try { + req.open("GET", url, async); + req.send(null); + } catch(e) { + Seadragon.Debug.log(e.name + " while making AJAX request: " + e.message); + + req.onreadystatechange = null; + req = null; + + if(async) + callback(); + } + + return async ? null : req; + }; + + this.parseXml = function(string) { + var xmlDoc = null; + + if(window.ActiveXObject) + try { + xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = false; + xmlDoc.loadXML(string); + } catch(e) { + Seadragon.Debug.log(e.name + " while parsing XML (ActiveX): " + e.message); + } + else if(window.DOMParser) + try { + var parser = new DOMParser(); + xmlDoc = parser.parseFromString(string, "text/xml"); + } catch(e) { + Seadragon.Debug.log(e.name + " while parsing XML (DOMParser): " + e.message); + } + else + Seadragon.Debug.fail("Browser doesn't support XML DOM."); + + return xmlDoc; + }; + +}; +// Seadragon.Utils is a static class, so make it singleton instance +Seadragon.Utils = new Seadragon.Utils(); + + +Sys.Extended.UI.Seadragon.ButtonState = function() { + throw Error.invalidOperation(); +}; +Sys.Extended.UI.Seadragon.ButtonState.prototype = { + REST: 0, + GROUP: 1, + HOVER: 2, + DOWN: 3 +}; +Sys.Extended.UI.Seadragon.ButtonState.registerEnum("Sys.Extended.UI.Seadragon.ButtonState", false); + +Sys.Extended.UI.Seadragon.Button = function() { + Sys.Extended.UI.Seadragon.Button.initializeBase(this); + + this._tooltip = null; + this._srcRest = null; + this._srcGroup = null; + this._srcHover = null; + this._srcDown = null; + this._button = null; + this.config = null; + +}; +Sys.Extended.UI.Seadragon.Button.prototype = { + initialize: function() { + Sys.Extended.UI.Seadragon.Button.callBaseMethod(this, 'initialize'); + + this._button = Seadragon.Utils.makeNeutralElement("span"); + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.GROUP; + this._tracker = new Seadragon.MouseTracker(this._button, this.config.clickTimeThreshold, this.config.clickDistThreshold); + this._imgRest = Seadragon.Utils.makeTransparentImage(this._srcRest); + this._imgGroup = Seadragon.Utils.makeTransparentImage(this._srcGroup); + this._imgHover = Seadragon.Utils.makeTransparentImage(this._srcHover); + this._imgDown = Seadragon.Utils.makeTransparentImage(this._srcDown); + + this._fadeDelay = 0; // begin fading immediately + this._fadeLength = 2000; // fade over a period of 2 seconds + this._fadeBeginTime = null; + this._shouldFade = false; + + this._button.style.display = "inline-block"; + this._button.style.position = "relative"; + this._button.title = this._tooltip; + + this._button.appendChild(this._imgRest); + this._button.appendChild(this._imgGroup); + this._button.appendChild(this._imgHover); + this._button.appendChild(this._imgDown); + + var styleRest = this._imgRest.style; + var styleGroup = this._imgGroup.style; + var styleHover = this._imgHover.style; + var styleDown = this._imgDown.style; + + // DON'T position imgRest absolutely -- let it be inline so it fills + // up the div, sizing the div appropriately + styleGroup.position = styleHover.position = styleDown.position = "absolute"; + styleGroup.top = styleHover.top = styleDown.top = "0px"; + styleGroup.left = styleHover.left = styleDown.left = "0px"; + styleHover.visibility = styleDown.visibility = "hidden"; + // rest and group are always visible + + // FF2 is very buggy with inline-block. it squashes the button div, + // making the group-pressed states' images lower than rest. but + // apparently, clearing the "top" style fixes this. (note that this + // breaks the buttons in every other browser, so we're not clearing + // the "top" style by default...) + if(Seadragon.Utils.getBrowser() == Seadragon.Browser.FIREFOX && + Seadragon.Utils.getBrowserVersion() < 3) + styleGroup.top = styleHover.top = styleDown.top = ""; + + this._tracker.enterHandler = Function.createDelegate(this, this._enterHandler); + this._tracker.exitHandler = Function.createDelegate(this, this._exitHandler); + this._tracker.pressHandler = Function.createDelegate(this, this._pressHandler); + this._tracker.releaseHandler = Function.createDelegate(this, this._releaseHandler); + this._tracker.clickHandler = Function.createDelegate(this, this._clickHandler); + + this._tracker.setTracking(true); + this._outTo(Sys.Extended.UI.Seadragon.ButtonState.REST); + }, + dispose: function() { + }, + _scheduleFade: function() { + window.setTimeout(Function.createDelegate(this, this._updateFade), 20); + }, + _updateFade: function() { + if(this._shouldFade) { + var currentTime = new Date().getTime(); + var deltaTime = currentTime - this._fadeBeginTime; + var opacity = 1.0 - deltaTime / this._fadeLength; + + opacity = Math.min(1.0, opacity); + opacity = Math.max(0.0, opacity); + + Seadragon.Utils.setElementOpacity(this._imgGroup, opacity, true); + if(opacity > 0) + this._scheduleFade(); // fade again + } + }, + _beginFading: function() { + this._shouldFade = true; + this._fadeBeginTime = new Date().getTime() + this._fadeDelay; + window.setTimeout(Function.createDelegate(this, this._scheduleFade), this._fadeDelay); + }, + _stopFading: function() { + this._shouldFade = false; + Seadragon.Utils.setElementOpacity(this._imgGroup, 1.0, true); + }, + _inTo: function(newState) { + if(newState >= Sys.Extended.UI.Seadragon.ButtonState.GROUP && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.REST) { + this._stopFading(); + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.GROUP; + } + + if(newState >= Sys.Extended.UI.Seadragon.ButtonState.HOVER && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.GROUP) { + // important: don't explicitly say "visibility: visible". + // see note in Viewer.setVisible() for explanation. + this._imgHover.style.visibility = ""; + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.HOVER; + } + + if(newState >= Sys.Extended.UI.Seadragon.ButtonState.DOWN && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.HOVER) { + // important: don't explicitly say "visibility: visible". + // see note in Viewer.setVisible() for explanation. + this._imgDown.style.visibility = ""; + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.DOWN; + } + }, + _outTo: function(newState) { + if(newState <= Sys.Extended.UI.Seadragon.ButtonState.HOVER && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.DOWN) { + this._imgDown.style.visibility = "hidden"; + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.HOVER; + } + + if(newState <= Sys.Extended.UI.Seadragon.ButtonState.GROUP && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.HOVER) { + this._imgHover.style.visibility = "hidden"; + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.GROUP; + } + + if(this._newState <= Sys.Extended.UI.Seadragon.ButtonState.REST && this._currentState == Sys.Extended.UI.Seadragon.ButtonState.GROUP) { + this._beginFading(); + this._currentState = Sys.Extended.UI.Seadragon.ButtonState.REST; + } + }, + _enterHandler: function(tracker, position, buttonDownElmt, buttonDownAny) { + if(buttonDownElmt) { + this._inTo(Sys.Extended.UI.Seadragon.ButtonState.DOWN); + this._raiseEvent("onEnter", this); + } else if(!buttonDownAny) { + this._inTo(Sys.Extended.UI.Seadragon.ButtonState.HOVER); + } + }, + _exitHandler: function(tracker, position, buttonDownElmt, buttonDownAny) { + this._outTo(Sys.Extended.UI.Seadragon.ButtonState.GROUP); + if(buttonDownElmt) + this._raiseEvent("onExit", this); + }, + _pressHandler: function(tracker, position) { + this._inTo(Sys.Extended.UI.Seadragon.ButtonState.DOWN); + this._raiseEvent("onPress", this); + }, + _releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) { + if(insideElmtPress && insideElmtRelease) { + this._outTo(Sys.Extended.UI.Seadragon.ButtonState.HOVER); + this._raiseEvent("onRelease", this); + } else if(insideElmtPress) { + this._outTo(Sys.Extended.UI.Seadragon.ButtonState.GROUP); + } else { + // pressed elsewhere, but released on it. if we ignored the + // enter event because a button was down, activate hover now + this._inTo(Sys.Extended.UI.Seadragon.ButtonState.HOVER); + } + }, + _clickHandler: function(tracker, position, quick, shift) { + if(quick) + this._raiseEvent("onClick", this); + }, + _raiseEvent: function(eventName, eventArgs) { + // Get handler for event. + var handler = this.get_events().getHandler(eventName); + + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + + // Fire event. + handler(this, eventArgs); + } + }, + + get_element: function() { + return this._button; + }, + + get_tooltip: function() { + return this._tooltip; + }, + set_tooltip: function(value) { + this._tooltip = value; + }, + + get_config: function() { + return this.config; + }, + set_config: function(value) { + this.config = value; + }, + + get_srcRest: function() { + return this._srcRest; + }, + set_srcRest: function(value) { + this._srcRest = value; + }, + + get_srcGroup: function() { + return this._srcGroup; + }, + set_srcGroup: function(value) { + this._srcGroup = value; + }, + + get_srcHover: function() { + return this._srcHover; + }, + set_srcHover: function(value) { + this._srcHover = value; + }, + + get_srcDown: function() { + return this._srcDown; + }, + set_srcDown: function(value) { + this._srcDown = value; + }, + + add_onPress: function(handler) { + this.get_events().addHandler("onPress", handler); + }, + remove_onPress: function(handler) { + this.get_events().removeHandler("onPress", handler); + }, + + add_onClick: function(handler) { + this.get_events().addHandler("onClick", handler); + }, + remove_onClick: function(handler) { + this.get_events().removeHandler("onClick", handler); + }, + + add_onEnter: function(handler) { + this.get_events().addHandler("onEnter", handler); + }, + remove_onEnter: function(handler) { + this.get_events().removeHandler("onEnter", handler); + }, + + add_onRelease: function(handler) { + this.get_events().addHandler("onRelease", handler); + }, + remove_onRelease: function(handler) { + this.get_events().removeHandler("onRelease", handler); + }, + + add_onExit: function(handler) { + this.get_events().addHandler("onExit", handler); + }, + remove_onExit: function(handler) { + this.get_events().removeHandler("onExit", handler); + }, + + notifyGroupEnter: function() { + this._inTo(Sys.Extended.UI.Seadragon.ButtonState.GROUP); + }, + + notifyGroupExit: function() { + this._outTo(Sys.Extended.UI.Seadragon.ButtonState.REST); + } +}; +Sys.Extended.UI.Seadragon.Button.registerClass('Sys.Extended.UI.Seadragon.Button', Sys.Component); + +Sys.Extended.UI.Seadragon.ButtonGroup = function() { + Sys.Extended.UI.Seadragon.ButtonGroup.initializeBase(this); + + this._buttons = null; + this._group = null; + this.config = null; +}; +Sys.Extended.UI.Seadragon.ButtonGroup.prototype = { + initialize: function() { + Sys.Extended.UI.Seadragon.ButtonGroup.callBaseMethod(this, 'initialize'); + + this._group = Seadragon.Utils.makeNeutralElement("span"); + var buttons = this._buttons.concat([]); // copy + var tracker = new Seadragon.MouseTracker(this._group, this.config.clickTimeThreshold, this.config.clickDistThreshold); + this._group.style.display = "inline-block"; + + for(var i = 0; i < buttons.length; i++) + this._group.appendChild(buttons[i].get_element()); + + tracker.enterHandler = Function.createDelegate(this, this._enterHandler); + tracker.exitHandler = Function.createDelegate(this, this._exitHandler); + tracker.releaseHandler = Function.createDelegate(this, this._releaseHandler); + + tracker.setTracking(true); + }, + dispose: function() { + }, + + get_buttons: function() { + return this._buttons; + }, + set_buttons: function(value) { + this._buttons = value; + }, + + get_element: function() { + return this._group; + }, + + get_config: function() { + return this.config; + }, + set_config: function(value) { + this.config = value; + }, + _enterHandler: function(tracker, position, buttonDownElmt, buttonDownAny) { + // somewhat office ribbon style -- we do this regardless of whether + // the mouse is down from elsewhere. it's a nice soft glow effect. + for(var i = 0; i < this._buttons.length; i++) + this._buttons[i].notifyGroupEnter(); + }, + _exitHandler: function(tracker, position, buttonDownElmt, buttonDownAny) { + if(!buttonDownElmt) + // only go to rest if the mouse isn't down from a button + for(var i = 0; i < this._buttons.length; i++) + this._buttons[i].notifyGroupExit(); + }, + _releaseHandler: function(tracker, position, insideElmtPress, insideElmtRelease) { + + if(!insideElmtRelease) + // this means was the mouse was inside the div during press, so + // since it's no longer inside the div during release, it left + // the div. but onDivExit() ignored it since the mouse was down + // from the div, so we'll go out to rest state now. + for(var i = 0; i < this._buttons.length; i++) + this._buttons[i].notifyGroupExit(); + }, + + emulateEnter: function() { + this._enterHandler(); + }, + + emulateExit: function() { + this._exitHandler(); + } +}; +Sys.Extended.UI.Seadragon.ButtonGroup.registerClass('Sys.Extended.UI.Seadragon.ButtonGroup', Sys.Component); + +Sys.Extended.UI.Seadragon.Config = function() { + + this.debugMode = true; + this.animationTime = 1.5; + this.blendTime = 0.5; + this.alwaysBlend = false; + this.autoHideControls = true; + this.immediateRender = false; + this.wrapHorizontal = false; + this.wrapVertical = false; + this.minZoomDimension = 0.8; + this.maxZoomPixelRatio = 2; + this.visibilityRatio = 0.5; + this.springStiffness = 5.0; + this.imageLoaderLimit = 2; + this.clickTimeThreshold = 200; + this.clickDistThreshold = 5; + this.zoomPerClick = 2.0; + this.zoomPerSecond = 2.0; + this.showNavigationControl = true; + this.maxImageCacheCount = 100; + this.minPixelRatio = 0.5; + this.mouseNavEnabled = true; + + this.navImages = { + zoomIn: { + REST: Sys.Extended.UI.Images["Seadragon.ZoomIn-Rest.png"], + GROUP: Sys.Extended.UI.Images["Seadragon.ZoomIn-Grouphover.png"], + HOVER: Sys.Extended.UI.Images["Seadragon.ZoomIn-Hover.png"], + DOWN: Sys.Extended.UI.Images["Seadragon.ZoomIn-Pressed.png"] + }, + zoomOut: { + REST: Sys.Extended.UI.Images["Seadragon.ZoomOut-Rest.png"], + GROUP: Sys.Extended.UI.Images["Seadragon.ZoomOut-Grouphover.png"], + HOVER: Sys.Extended.UI.Images["Seadragon.ZoomOut-Hover.png"], + DOWN: Sys.Extended.UI.Images["Seadragon.ZoomOut-Pressed.png"] + }, + home: { + REST: Sys.Extended.UI.Images["Seadragon.Home-Rest.png"], + GROUP: Sys.Extended.UI.Images["Seadragon.Home-Grouphover.png"], + HOVER: Sys.Extended.UI.Images["Seadragon.Home-Hover.png"], + DOWN: Sys.Extended.UI.Images["Seadragon.Home-Pressed.png"] + }, + fullpage: { + REST: Sys.Extended.UI.Images["Seadragon.Fullscreen-Rest.png"], + GROUP: Sys.Extended.UI.Images["Seadragon.Fullscreen-Grouphover.png"], + HOVER: Sys.Extended.UI.Images["Seadragon.Fullscreen-Hover.png"], + DOWN: Sys.Extended.UI.Images["Seadragon.Fullscreen-Pressed.png"] + } + }; +}; +Sys.Extended.UI.Seadragon.Config.registerClass('Sys.Extended.UI.Seadragon.Config', null, Sys.IDisposable); + +if(!window.SIGNAL) + window.SIGNAL = "----seadragon----"; + + +Sys.Extended.UI.Seadragon.ControlAnchor = function() { + throw Error.invalidOperation(); +}; +Sys.Extended.UI.Seadragon.ControlAnchor.prototype = { + NONE: 0, + TOP_LEFT: 1, + TOP_RIGHT: 2, + BOTTOM_RIGHT: 3, + BOTTOM_LEFT: 4 +}; +Sys.Extended.UI.Seadragon.ControlAnchor.registerEnum("Sys.Extended.UI.Seadragon.ControlAnchor", false); + +Seadragon.ControlAnchor = Sys.Extended.UI.Seadragon.ControlAnchor; + +Sys.Extended.UI.Seadragon.OverlayPlacement = function() { + throw Error.invalidOperation(); +}; +Sys.Extended.UI.Seadragon.OverlayPlacement.prototype = { + CENTER: 0, + TOP_LEFT: 1, + TOP: 2, + TOP_RIGHT: 3, + RIGHT: 4, + BOTTOM_RIGHT: 5, + BOTTOM: 6, + BOTTOM_LEFT: 7, + LEFT: 8 +}; +Sys.Extended.UI.Seadragon.OverlayPlacement.registerEnum("Sys.Extended.UI.Seadragon.OverlayPlacement", false); +Seadragon.OverlayPlacement = Sys.Extended.UI.Seadragon.OverlayPlacement; + +Sys.Extended.UI.Seadragon.NavControl = function(viewer) { + this._group = null; + this._zooming = false; // whether we should be continuously zooming + this._zoomFactor = null; // how much we should be continuously zooming by + this._lastZoomTime = null; + this._viewer = viewer; + this.config = this._viewer.config; + + this.elmt = null; + this.initialize(); +}; +Sys.Extended.UI.Seadragon.NavControl.prototype = { + initialize: function() { + var beginZoomingInHandler = Function.createDelegate(this, this._beginZoomingIn); + var endZoomingHandler = Function.createDelegate(this, this._endZooming); + var doSingleZoomInHandler = Function.createDelegate(this, this._doSingleZoomIn); + var beginZoomingOutHandler = Function.createDelegate(this, this._beginZoomingOut); + var doSingleZoomOutHandler = Function.createDelegate(this, this._doSingleZoomOut); + var onHomeHandler = Function.createDelegate(this, this._onHome); + var onFullPageHandler = Function.createDelegate(this, this._onFullPage); + + var navImages = this._viewer.config.navImages; + var zoomIn = $create(Sys.Extended.UI.Seadragon.Button, + { config: this._viewer.config, tooltip: Seadragon.Strings.getString("Tooltips.ZoomIn"), srcRest: this._resolveUrl(navImages.zoomIn.REST), srcGroup: this._resolveUrl(navImages.zoomIn.GROUP), srcHover: this._resolveUrl(navImages.zoomIn.HOVER), srcDown: this._resolveUrl(navImages.zoomIn.DOWN) }, + { onPress: beginZoomingInHandler, onRelease: endZoomingHandler, onClick: doSingleZoomInHandler, onEnter: beginZoomingInHandler, onExit: endZoomingHandler }, null, null); + var zoomOut = $create(Sys.Extended.UI.Seadragon.Button, + { config: this._viewer.config, tooltip: Seadragon.Strings.getString("Tooltips.ZoomOut"), srcRest: this._resolveUrl(navImages.zoomOut.REST), srcGroup: this._resolveUrl(navImages.zoomOut.GROUP), srcHover: this._resolveUrl(navImages.zoomOut.HOVER), srcDown: this._resolveUrl(navImages.zoomOut.DOWN) }, + { onPress: beginZoomingOutHandler, onRelease: endZoomingHandler, onClick: doSingleZoomOutHandler, onEnter: beginZoomingOutHandler, onExit: endZoomingHandler }, null, null); + var goHome = $create(Sys.Extended.UI.Seadragon.Button, + { config: this._viewer.config, tooltip: Seadragon.Strings.getString("Tooltips.Home"), srcRest: this._resolveUrl(navImages.home.REST), srcGroup: this._resolveUrl(navImages.home.GROUP), srcHover: this._resolveUrl(navImages.home.HOVER), srcDown: this._resolveUrl(navImages.home.DOWN) }, + { onRelease: onHomeHandler }, null, null); + var fullPage = $create(Sys.Extended.UI.Seadragon.Button, + { config: this._viewer.config, tooltip: Seadragon.Strings.getString("Tooltips.FullPage"), srcRest: this._resolveUrl(navImages.fullpage.REST), srcGroup: this._resolveUrl(navImages.fullpage.GROUP), srcHover: this._resolveUrl(navImages.fullpage.HOVER), srcDown: this._resolveUrl(navImages.fullpage.DOWN) }, + { onRelease: onFullPageHandler }, null, null); + this._group = $create(Sys.Extended.UI.Seadragon.ButtonGroup, + { config: this._viewer.config, buttons: [zoomIn, zoomOut, goHome, fullPage] }, null, null, null); + + this.elmt = this._group.get_element(); + this.elmt[SIGNAL] = true; // hack to get our controls to fade + this._viewer.add_open(Function.createDelegate(this, this._lightUp)); + }, + dispose: function() { + }, + _resolveUrl: function(url) { + return String.format("{1}", this._viewer.get_prefixUrl(), url); + }, + _beginZoomingIn: function() { + this._lastZoomTime = new Date().getTime(); + this._zoomFactor = this.config.zoomPerSecond; + this._zooming = true; + this._scheduleZoom(); + }, + _beginZoomingOut: function() { + this._lastZoomTime = new Date().getTime(); + this._zoomFactor = 1.0 / this.config.zoomPerSecond; + this._zooming = true; + this._scheduleZoom(); + }, + + _endZooming: function() { + this._zooming = false; + }, + _scheduleZoom: function() { + window.setTimeout(Function.createDelegate(this, this._doZoom), 10); + }, + _doZoom: function() { + if(this._zooming && this._viewer.viewport) { + var currentTime = new Date().getTime(); + var deltaTime = currentTime - this._lastZoomTime; + var adjustedFactor = Math.pow(this._zoomFactor, deltaTime / 1000); + + this._viewer.viewport.zoomBy(adjustedFactor); + this._viewer.viewport.applyConstraints(); + this._lastZoomTime = currentTime; + this._scheduleZoom(); + } + }, + _doSingleZoomIn: function() { + if(this._viewer.viewport) { + this._zooming = false; + this._viewer.viewport.zoomBy(this.config.zoomPerClick / 1.0); + this._viewer.viewport.applyConstraints(); + } + }, + _doSingleZoomOut: function() { + if(this._viewer.viewport) { + this._zooming = false; + this._viewer.viewport.zoomBy(1.0 / this.config.zoomPerClick); + this._viewer.viewport.applyConstraints(); + } + }, + _lightUp: function() { + this._group.emulateEnter(); + this._group.emulateExit(); + }, + _onHome: function() { + if(this._viewer.viewport) + this._viewer.viewport.goHome(); + }, + _onFullPage: function() { + this._viewer.setFullPage(!this._viewer.isFullPage()); + this._group.emulateExit(); // correct for no mouseout event on change + + if(this._viewer.viewport) + this._viewer.viewport.applyConstraints(); + } +}; +Sys.Extended.UI.Seadragon.NavControl.registerClass('Sys.Extended.UI.Seadragon.NavControl', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Control = function(elmt, anchor, container) { + // Properties + this.elmt = elmt; + this.anchor = anchor; + this.container = container; + this.wrapper = Seadragon.Utils.makeNeutralElement("span"); + this.initialize(); +}; +Sys.Extended.UI.Seadragon.Control.prototype = { + initialize: function() { + this.wrapper = Seadragon.Utils.makeNeutralElement("span"); + // Constructor + this.wrapper.style.display = "inline-block"; + this.wrapper.appendChild(this.elmt); + if(this.anchor == Seadragon.ControlAnchor.NONE) + this.wrapper.style.width = this.wrapper.style.height = "100%"; // IE6 fix + this.addToAnchor(); + }, + addToAnchor: function() { + if(this.anchor == Seadragon.ControlAnchor.TOP_RIGHT || this.anchor == Seadragon.ControlAnchor.BOTTOM_RIGHT) + this.container.insertBefore(this.elmt, this.container.firstChild); + else + this.container.appendChild(this.elmt); + }, + destroy: function() { + this.wrapper.removeChild(this.elmt); + this.container.removeChild(this.wrapper); + }, + isVisible: function() { + // see note in setVisible() below about using "display: none" + return this.wrapper.style.display != "none"; + }, + setVisible: function(visible) { + // using "display: none" instead of "visibility: hidden" so that mouse + // events are no longer blocked by this invisible control. + this.wrapper.style.display = visible ? "inline-block" : "none"; + }, + setOpacity: function(opacity) { + // like with setVisible() above, we really should be working with the + // wrapper element and not the passed in element directly, so that we + // don't conflict with the developer's own opacity settings. but this + // doesn't work in IE always, so for our controls, use a hack for now... + if(this.elmt[SIGNAL] && Seadragon.Utils.getBrowser() == Seadragon.Browser.IE) + Seadragon.Utils.setElementOpacity(this.elmt, opacity, true); + else + Seadragon.Utils.setElementOpacity(this.wrapper, opacity, true); + } +}; +Sys.Extended.UI.Seadragon.Control.registerClass('Sys.Extended.UI.Seadragon.Control', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Viewer = function(element) { + Sys.Extended.UI.Seadragon.Viewer.initializeBase(this, [element]); + + //Fields + this.config = new Sys.Extended.UI.Seadragon.Config(); + this._prefixUrl = null; + + this._controls = []; + this._customControls = null; + this._overlays = []; + this._overlayControls = null; + this._container = null; + this._canvas = null; + this._controlsTL = null; + this._controlsTR = null; + this._controlsBR = null; + this._controlsBL = null; + this._bodyWidth = null; + this._bodyHeight = null; + this._bodyOverflow = null; + this._docOverflow = null; + this._fsBoundsDelta = null; + this._prevContainerSize = null; + this._lastOpenStartTime = 0; + this._lastOpenEndTime = 0; + this._animating = false; + this._forceRedraw = false; + this._mouseInside = false; + this._xmlPath = null; + + //Public fields + this.source = null; + this.drawer = null; + this.viewport = null; + this.profiler = null; + +}; +Sys.Extended.UI.Seadragon.Viewer.prototype = { + initialize: function() { + Sys.Extended.UI.Seadragon.Viewer.callBaseMethod(this, 'initialize'); + + this._container = Seadragon.Utils.makeNeutralElement("div"); + this._canvas = Seadragon.Utils.makeNeutralElement("div"); + + this._controlsTL = Seadragon.Utils.makeNeutralElement("div"); + this._controlsTR = Seadragon.Utils.makeNeutralElement("div"); + this._controlsBR = Seadragon.Utils.makeNeutralElement("div"); + this._controlsBL = Seadragon.Utils.makeNeutralElement("div"); + + var innerTracker = new Seadragon.MouseTracker(this._canvas, this.config.clickTimeThreshold, this.config.clickDistThreshold); + var outerTracker = new Seadragon.MouseTracker(this._container, this.config.clickTimeThreshold, this.config.clickDistThreshold); + + this._bodyWidth = document.body.style.width; + this._bodyHeight = document.body.style.height; + this._bodyOverflow = document.body.style.overflow; + this._docOverflow = document.documentElement.style.overflow; + + this._fsBoundsDelta = new Sys.Extended.UI.Seadragon.Point(1, 1); + + var canvasStyle = this._canvas.style; + var containerStyle = this._container.style; + var controlsTLStyle = this._controlsTL.style; + var controlsTRStyle = this._controlsTR.style; + var controlsBRStyle = this._controlsBR.style; + var controlsBLStyle = this._controlsBL.style; + + containerStyle.width = "100%"; + containerStyle.height = "100%"; + containerStyle.position = "relative"; + containerStyle.left = "0px"; + containerStyle.top = "0px"; + containerStyle.textAlign = "left"; // needed to protect against + // incorrect centering + + canvasStyle.width = "100%"; + canvasStyle.height = "100%"; + canvasStyle.overflow = "hidden"; + canvasStyle.position = "absolute"; + canvasStyle.top = "0px"; + canvasStyle.left = "0px"; + + controlsTLStyle.position = controlsTRStyle.position = + controlsBRStyle.position = controlsBLStyle.position = + "absolute"; + + controlsTLStyle.top = controlsTRStyle.top = "0px"; + controlsTLStyle.left = controlsBLStyle.left = "0px"; + controlsTRStyle.right = controlsBRStyle.right = "0px"; + controlsBLStyle.bottom = controlsBRStyle.bottom = "0px"; + + // mouse tracker handler for canvas (pan and zoom) + innerTracker.clickHandler = Function.createDelegate(this, this._onCanvasClick); + innerTracker.dragHandler = Function.createDelegate(this, this._onCanvasDrag); + innerTracker.releaseHandler = Function.createDelegate(this, this._onCanvasRelease); + innerTracker.setTracking(true); // default state + + // create default navigation control + if(this.get_showNavigationControl()) { + navControl = (new Sys.Extended.UI.Seadragon.NavControl(this)).elmt; + navControl.style.marginRight = "4px"; + navControl.style.marginBottom = "4px"; + this.addControl(navControl, Sys.Extended.UI.Seadragon.ControlAnchor.BOTTOM_RIGHT); + } + for(var i = 0; i < this._customControls.length; i++) + this.addControl(this._customControls[i].id, this._customControls[i].anchor); + + // mouse tracker handler for container (controls fading) + outerTracker.enterHandler = Function.createDelegate(this, this._onContainerEnter); + outerTracker.exitHandler = Function.createDelegate(this, this._onContainerExit); + outerTracker.releaseHandler = Function.createDelegate(this, this._onContainerRelease); + outerTracker.setTracking(true); // always tracking + window.setTimeout(Function.createDelegate(this, this._beginControlsAutoHide), 1); // initial fade out + + //append to DOM only at end + this._container.appendChild(this._canvas); + this._container.appendChild(this._controlsTL); + this._container.appendChild(this._controlsTR); + this._container.appendChild(this._controlsBR); + this._container.appendChild(this._controlsBL); + this.get_element().appendChild(this._container); + + if(this._xmlPath) + this.openDzi(this._xmlPath); + }, + _raiseEvent: function(eventName, eventArgs) { + // Get handler for event. + var handler = this.get_events().getHandler(eventName); + + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + + // Fire event. + handler(this, eventArgs); + } + }, + _beginControlsAutoHide: function() { + if(!this.config.autoHideControls) + return; + + this._controlsShouldFade = true; + this._controlsFadeBeginTime = new Date().getTime() + this._controlsFadeDelay; + window.setTimeout(Function.createDelegate(this, this._scheduleControlsFade), this._controlsFadeDelay); + }, + _scheduleControlsFade: function() { + window.setTimeout(Function.createDelegate(this, this._updateControlsFade), 20); + }, + _updateControlsFade: function() { + if(this._controlsShouldFade) { + var currentTime = new Date().getTime(); + var deltaTime = currentTime - this._controlsFadeBeginTime; + var opacity = 1.0 - deltaTime / this._controlsFadeLength; + + opacity = Math.min(1.0, opacity); + opacity = Math.max(0.0, opacity); + + for(var i = this._controls.length - 1; i >= 0; i--) + this._controls[i].setOpacity(opacity); + + if(opacity > 0) + this._scheduleControlsFade(); // fade again + } + }, + _onCanvasClick: function(tracker, position, quick, shift) { + if(this.viewport && quick) { // ignore clicks where mouse moved + var zoomPerClick = this.config.zoomPerClick; + var factor = shift ? 1.0 / zoomPerClick : zoomPerClick; + this.viewport.zoomBy(factor, this.viewport.pointFromPixel(position, true)); + this.viewport.applyConstraints(); + } + }, + _onCanvasDrag: function(tracker, position, delta, shift) { + if(this.viewport) + // negate since dragging is opposite of panning. + // analogy: in adobe pdf, dragging vs using scrollbars. + this.viewport.panBy(this.viewport.deltaPointsFromPixels(delta.negate())); + }, + _onCanvasRelease: function(tracker, position, insideElmtPress, insideElmtRelease) { + if(insideElmtPress && this.viewport) + this.viewport.applyConstraints(); + }, + _onContainerExit: function(tracker, position, buttonDownElmt, buttonDownAny) { + // fade controls out over time, only if the mouse isn't down from + // within the container (e.g. panning, or using a control) + if(!buttonDownElmt) { + this._mouseInside = false; + if(!this._animating) + this._beginControlsAutoHide(); + } + }, + _onContainerRelease: function(tracker, position, insideElmtPress, insideElmtRelease) { + // the mouse may have exited the container and we ignored it if the + // mouse was down from within the container. now when the mouse is + // released, we should fade the controls out now. + if(!insideElmtRelease) { + this._mouseInside = false; + if(!this._animating) + this._beginControlsAutoHide(); + } + }, + _getControlIndex: function(elmt) { + for(var i = this._controls.length - 1; i >= 0; i--) + if(this._controls[i].elmt == elmt) + return i; + + return -1; + }, + _abortControlsAutoHide: function() { + this._controlsShouldFade = false; + for(var i = this._controls.length - 1; i >= 0; i--) + this._controls[i].setOpacity(1.0); + }, + _onContainerEnter: function(tracker, position, buttonDownElmt, buttonDownAny) { + this._mouseInside = true; + this._abortControlsAutoHide(); + }, + _updateOnce: function() { + if(!this.source) + return; + + this.profiler.beginUpdate(); + + var containerSize = Seadragon.Utils.getElementSize(this._container); + + if(!containerSize.equals(this._prevContainerSize)) { + this.viewport.resize(containerSize, true); // maintain image position + this._prevContainerSize = containerSize; + this._raiseEvent("resize", this); + } + + var animated = this.viewport.update(); + + if(!this._animating && animated) { + // we weren't animating, and now we did ==> animation start + this._raiseEvent("animationstart", self); + this._abortControlsAutoHide(); + } + + if(animated) { + // viewport moved + this.drawer.update(); + this._raiseEvent("animation", self); + } else if(this._forceRedraw || this.drawer.needsUpdate()) { + // need to load or blend images, etc. + this.drawer.update(); + this._forceRedraw = false; + } else { + // no changes, so preload images, etc. + this.drawer.idle(); + } + + if(this._animating && !animated) { + // we were animating, and now we're not anymore ==> animation finish + this._raiseEvent("animationfinish", this); + + // if the mouse has left the container, begin fading controls + if(!this._mouseInside) + this._beginControlsAutoHide(); + } + + this._animating = animated; + this.profiler.endUpdate(); + }, + _onClose: function() { + // TODO need destroy() methods to prevent leaks? check for null if so. + + // nullify fields and properties + this.source = null; + this.viewport = null; + this.drawer = null; + this.profiler = null; + + // clear all tiles and any message + this._canvas.innerHTML = ""; + }, + _beforeOpen: function() { + if(this.source) + this._onClose(); + + this._lastOpenStartTime = new Date().getTime(); // to ignore earlier opens + + // show loading message after a delay if it still hasn't loaded + window.setTimeout(Function.createDelegate(this, function() { + if(this._lastOpenStartTime > this._lastOpenEndTime) + this._setMessage(Seadragon.Strings.getString("Messages.Loading")); + }), 2000); + + return this._lastOpenStartTime; + }, + _setMessage: function(message) { + var textNode = document.createTextNode(message); + + this._canvas.innerHTML = ""; + this._canvas.appendChild(Seadragon.Utils.makeCenteredNode(textNode)); + + var textStyle = textNode.parentNode.style; + + // explicit styles for error message + textStyle.color = "white"; + textStyle.fontFamily = "verdana"; + textStyle.fontSize = "13px"; + textStyle.fontSizeAdjust = "none"; + textStyle.fontStyle = "normal"; + textStyle.fontStretch = "normal"; + textStyle.fontVariant = "normal"; + textStyle.fontWeight = "normal"; + textStyle.lineHeight = "1em"; + textStyle.textAlign = "center"; + textStyle.textDecoration = "none"; + }, + _onOpen: function(time, _source, error) { + this._lastOpenEndTime = new Date().getTime(); + + if(time < this._lastOpenStartTime) { + Seadragon.Debug.log("Ignoring out-of-date open."); + this._raiseEvent("ignore"); + return; + } else if(!_source) { + this._setMessage(error); + this._raiseEvent("error"); + return; + } + + // clear any previous message + this._canvas.innerHTML = ""; + this._prevContainerSize = Seadragon.Utils.getElementSize(this._container); + + // assign fields + this.source = _source; + this.viewport = new Sys.Extended.UI.Seadragon.Viewport(this._prevContainerSize, this.source.dimensions, this.config); + this.drawer = new Sys.Extended.UI.Seadragon.Drawer(this.source, this.viewport, this._canvas); + this.profiler = new Sys.Extended.UI.Seadragon.Profiler(); + + // begin updating + this._animating = false; + this._forceRedraw = true; + this._scheduleUpdate(this._updateMulti); + + for(var i = 0; i < this._overlayControls.length; i++) { + var overlay = this._overlayControls[i]; + if(overlay.point != null) + this.drawer.addOverlay(overlay.id, new Sys.Extended.UI.Seadragon.Point(overlay.point.X, overlay.point.Y), Sys.Extended.UI.Seadragon.OverlayPlacement.TOP_LEFT); + else + this.drawer.addOverlay(overlay.id, new Sys.Extended.UI.Seadragon.Rect(overlay.rect.Point.X, overlay.rect.Point.Y, overlay.rect.Width, overlay.rect.Height), overlay.placement); + } + this._raiseEvent("open"); + }, + _scheduleUpdate: function(updateFunc, prevUpdateTime) { + // if we're animating, update as fast as possible to stay smooth + if(this._animating) + return window.setTimeout(Function.createDelegate(this, updateFunc), 1); + + // if no previous update, consider this an update + var currentTime = new Date().getTime(); + var prevUpdateTime = prevUpdateTime ? prevUpdateTime : currentTime; + var targetTime = prevUpdateTime + 1000 / 60; // 60 fps ideal + + // calculate delta time to be a positive number + var deltaTime = Math.max(1, targetTime - currentTime); + return window.setTimeout(Function.createDelegate(this, updateFunc), deltaTime); + }, + _updateMulti: function() { + if(!this.source) + return; + + var beginTime = new Date().getTime(); + + this._updateOnce(); + this._scheduleUpdate(arguments.callee, beginTime); + }, + _updateOnce: function() { + if(!this.source) + return; + + this.profiler.beginUpdate(); + + var containerSize = Seadragon.Utils.getElementSize(this._container); + + if(!containerSize.equals(this._prevContainerSize)) { + this.viewport.resize(containerSize, true); // maintain image position + this._prevContainerSize = containerSize; + this._raiseEvent("resize"); + } + + var animated = this.viewport.update(); + + if(!this._animating && animated) { + // we weren't animating, and now we did ==> animation start + this._raiseEvent("animationstart"); + this._abortControlsAutoHide(); + } + + if(animated) { + // viewport moved + this.drawer.update(); + this._raiseEvent("animation"); + } else if(this._forceRedraw || this.drawer.needsUpdate()) { + // need to load or blend images, etc. + this.drawer.update(); + this._forceRedraw = false; + } else { + // no changes, so preload images, etc. + this.drawer.idle(); + } + + if(this._animating && !animated) { + // we were animating, and now we're not anymore ==> animation finish + this._raiseEvent("animationfinish"); + + // if the mouse has left the container, begin fading controls + if(!this._mouseInside) + this._beginControlsAutoHide(); + } + + this._animating = animated; + this.profiler.endUpdate(); + }, + + /// + /// Returns a navigation control of the viewer + /// + /// Navigation control + /// + getNavControl: function() { + return this._navControl; + }, + + /// + /// An XML path + /// + /// get_xmlPath + /// set_xmlPath + /// + get_xmlPath: function() { + return this._xmlPath; + }, + set_xmlPath: function(value) { + this._xmlPath = value; + }, + + /// + /// Determines whether or not the debug mode is enabled + /// + /// get_debugMode + /// set_debugMode + /// + get_debugMode: function() { + return this.config.debugMode; + }, + set_debugMode: function(value) { + this.config.debugMode = value; + }, + + /// + /// The amount of time in seconds that animations should last. Default is 1.5 + /// + /// get_animationTime + /// set_animationTime + /// + get_animationTime: function() { + return this.config.animationTime; + }, + set_animationTime: function(value) { + this.config.animationTime = value; + }, + + /// + /// The amount of time in seconds that new tiles take to blend from transparent to opaque. + /// Default is 0.5 + /// + /// get_blendTime + /// set_blendTime + /// + get_blendTime: function() { + return this.config.blendTime; + }, + set_blendTime: function(value) { + this.config.blendTime = value; + }, + + /// + /// Determines whether or not tiles should always blend in and out, not just when they're first loaded. + /// Default is false + /// + /// get_alwaysBlend + /// set_alwaysBlend + /// + get_alwaysBlend: function() { + return this.config.alwaysBlend; + }, + set_alwaysBlend: function(value) { + this.config.alwaysBlend = value; + }, + + /// + /// Determines whether or not controls should be automatically hidden when a user + /// moves the mouse away from the viewer and the image has stopped animating. + /// Default is true + /// + /// get_autoHideControl + /// set_autoHideControl + /// + get_autoHideControls: function() { + return this.config.autoHideControls; + }, + set_autoHideControls: function(value) { + this.config.autoHideControls = value; + }, + + /// + /// Determines whether or not the most appropriate tiles should always be rendered before any + /// low-resolution tiles are rendered. The sharpening effect is lost, and instead a visible + /// tiling effect occurs. Default is false + /// + /// get_immediateRender + /// set_immediateRender + /// + get_immediateRender: function() { + return this.config.immediateRender; + }, + set_immediateRender: function(value) { + this.config.immediateRender = value; + }, + + /// + /// Determines whether or not the control uses horizontal wrapping + /// + /// get_wrapHorizontal + /// set_wrapHorizontal + /// + get_wrapHorizontal: function() { + return this.config.wrapHorizontal; + }, + set_wrapHorizontal: function(value) { + this.config.wrapHorizontal = value; + }, + + /// + /// Determines whether or not the control uses vertical wrapping + /// + /// get_wrapVertical + /// set_wrapVertical + /// + get_wrapVertical: function() { + return this.config.wrapVertical; + }, + set_wrapVertical: function(value) { + this.config.wrapVertical = value; + }, + + /// + /// Minimum size (in screen pixels) of a dimension that can be obtained from zooming out. + /// Default is 16 + /// + /// get_minZoomDimension + /// set_minZoomDimension + /// + get_minZoomDimension: function() { + return this.config.minZoomDimension; + }, + set_minZoomDimension: function(value) { + this.config.minZoomDimension = value; + }, + + /// + /// Maximum pixel ratio (screen pixel to content pixel) that can be obtained from zooming in. + /// Default is 4 + /// + /// get_maxZoomPixelRation + /// set_maxZoomPixelRation + /// + get_maxZoomPixelRatio: function() { + return this.config.maxZoomPixelRatio; + }, + set_maxZoomPixelRatio: function(value) { + this.config.maxZoomPixelRatio = value; + }, + + /// + /// Minimum portion of the viewport that must show visible content in both dimensions. + /// Default is 0.1 + /// + /// get_visibilityRatio + /// set_visibilityRatio + /// + get_visibilityRatio: function() { + return this.config.visibilityRatio; + }, + set_visibilityRatio: function(value) { + this.config.visibilityRatio = value; + }, + + /// + /// Determines how sharply springs used for animations move. + /// Default is 5.0 + /// + /// get_springStiffness + /// set_springStiffness + /// + get_springStiffness: function() { + return this.config.springStiffness; + }, + set_springStiffness: function(value) { + this.config.springStiffness = value; + }, + + /// + /// Maximum number of concurrent image downloads that can be performed by each viewer. + /// Default is 2 + /// + /// get_imageLoaderLimit + /// set_imageLoaderLimit + /// + get_imageLoaderLimit: function() { + return this.config.imageLoaderLimit; + }, + set_imageLoaderLimit: function(value) { + this.config.imageLoaderLimit = value; + }, + + /// + /// Maximum number of milliseconds that can pass between a mousedown and mouseup for an + /// action to be considered as a quick click. Default is 200 + /// + /// get_clickTimeThreshold + /// set_clickTimeThreshold + /// + get_clickTimeThreshold: function() { + return this.config.clickTimeThreshold; + }, + set_clickTimeThreshold: function(value) { + this.config.clickTimeThreshold = value; + }, + + /// + /// Maximum number of pixels the mouse can move between a mousedown and mouseup fo + /// an action to be considered as a quick click. Default is 5 + /// + /// get_clickDistThreshold + /// set_clickDistThreshold + /// + get_clickDistThreshold: function() { + return this.config.clickDistThreshold; + }, + set_clickDistThreshold: function(value) { + this.config.clickDistThreshold = value; + }, + + /// + /// The factor by which images should zoom in on being clicked. Default is 2 + /// + /// get_zoomPerClick + /// set_zoomPerClick + /// + get_zoomPerClick: function() { + return this.config.zoomPerClick; + }, + set_zoomPerClick: function(value) { + this.config.zoomPerClick = value; + }, + + /// + /// The factor by which images should zoom in each second the zoom buttons are held down. + /// Default is 2 + /// + /// get_zoomPerSecond + /// set_zoomPerSecond + /// + get_zoomPerSecond: function() { + return this.config.zoomPerSecond; + }, + set_zoomPerSecond: function(value) { + this.config.zoomPerSecond = value; + }, + + /// + /// Maximum number of cached images + /// + /// get_maxImageCacheCount + /// set_maxImageCacheCount + /// + get_maxImageCacheCount: function() { + return this.config.maxImageCacheCount; + }, + set_maxImageCacheCount: function(value) { + this.config.maxImageCacheCount = value; + }, + + /// + /// Determines whether or not navigation buttons should be shown + /// + /// get_showNavigationControl + /// set_showNavigationControl + /// + get_showNavigationControl: function() { + return this.config.showNavigationControl; + }, + set_showNavigationControl: function(value) { + this.config.showNavigationControl = value; + }, + + /// + /// Minimum pixel ratio + /// + /// get_minPixelRatio + /// set_minPixelRatio + /// + get_minPixelRatio: function() { + return this.config.minPixelRatio; + }, + set_minPixelRatio: function(value) { + this.config.minPixelRatio = value; + }, + + /// + /// Determines whether or not mouse navigation is enabled + /// + /// get_mouseNavEnabled + /// set_mouseNavEnabled + /// + get_mouseNavEnabled: function() { + return this.config.mouseNavEnabled; + }, + set_mouseNavEnabled: function(value) { + this.config.mouseNavEnabled = value; + }, + + /// + /// A list of controls + /// + /// get_controls + /// set_controls + /// + get_controls: function() { + return this._customControls; + }, + set_controls: function(value) { + this._customControls = value; + }, + + /// + /// A list of overlay controls + /// + /// get_overlays + /// set_overlays + /// + get_overlays: function() { + return this._overlayControls; + }, + set_overlays: function(value) { + this._overlayControls = value; + }, + + /// + /// Prefix URL + /// + /// get_prefixUrl + /// set_prefixUrl + /// + get_prefixUrl: function() { + return this._prefixUrl; + }, + set_prefixUrl: function(value) { + this._prefixUrl = value; + }, + + /// + /// Fires when the viewer opens + /// + /// + /// + add_open: function(handler) { + this.get_events().addHandler("open", handler); + }, + remove_open: function(handler) { + this.get_events().removeHandler("open", handler); + }, + + /// + /// Fires when the error occurs + /// + /// + /// + add_error: function(handler) { + this.get_events().addHandler("error", handler); + }, + remove_error: function(handler) { + this.get_events().removeHandler("error", handler); + }, + + /// + /// Fires when the ignore event occurs + /// + /// + /// + add_ignore: function(handler) { + this.get_events().addHandler("ignore", handler); + }, + remove_ignore: function(handler) { + this.get_events().removeHandler("ignore", handler); + }, + + /// + /// Fires on viewer resizing + /// + /// + /// + add_resize: function(handler) { + this.get_events().addHandler("resize", handler); + }, + remove_resize: function(handler) { + this.get_events().removeHandler("resize", handler); + }, + + /// + /// Fires when animation starts + /// + /// + /// + add_animationstart: function(handler) { + this.get_events().addHandler("animationstart", handler); + }, + remove_animationstart: function(handler) { + this.get_events().removeHandler("animationstart", handler); + }, + + /// + /// Fires when animation ends + /// + /// + /// + add_animationend: function(handler) { + this.get_events().addHandler("animationend", handler); + }, + remove_animationend: function(handler) { + this.get_events().removeHandler("animationend", handler); + }, + + addControl: function(elmt, anchor) { + var elmt = Seadragon.Utils.getElement(elmt); + + if(this._getControlIndex(elmt) >= 0) + return; // they're trying to add a duplicate control + + var div = null; + + switch(anchor) { + case Sys.Extended.UI.Seadragon.ControlAnchor.TOP_RIGHT: + div = this._controlsTR; + elmt.style.position = "relative"; + break; + case Sys.Extended.UI.Seadragon.ControlAnchor.BOTTOM_RIGHT: + div = this._controlsBR; + elmt.style.position = "relative"; + break; + case Sys.Extended.UI.Seadragon.ControlAnchor.BOTTOM_LEFT: + div = this._controlsBL; + elmt.style.position = "relative"; + break; + case Sys.Extended.UI.Seadragon.ControlAnchor.TOP_LEFT: + div = this._controlsTL; + elmt.style.position = "relative"; + break; + case Sys.Extended.UI.Seadragon.ControlAnchor.NONE: + default: + div = this._container; + elmt.style.position = "absolute"; + break; + } + + this._controls.push(new Sys.Extended.UI.Seadragon.Control(elmt, anchor, div)); + }, + + isOpen: function() { + return !!this.source; + }, + + openDzi: function(xmlUrl, xmlString) { + var currentTime = this._beforeOpen(); + Sys.Extended.UI.Seadragon.DziTileSourceHelper.createFromXml(xmlUrl, xmlString, + Seadragon.Utils.createCallback(null, Function.createDelegate(this, this._onOpen), currentTime)); + }, + + openTileSource: function(tileSource) { + var currentTime = this._beforeOpen(); + window.setTimeout(Function.createDelegate(this, function() { + this._onOpen(currentTime, tileSource); + }), 1); + }, + + close: function() { + if(!this.source) + return; + + this._onClose(); + }, + + removeControl: function(elmt) { + var elmt = Seadragon.Utils.getElement(elmt); + var i = this._getControlIndex(elmt); + + if(i >= 0) { + this._controls[i].destroy(); + this._controls.splice(i, 1); + } + }, + + clearControls: function() { + while(this._controls.length > 0) + this._controls.pop().destroy(); + }, + + isDashboardEnabled: function() { + for(var i = this._controls.length - 1; i >= 0; i--) + if(this._controls[i].isVisible()) + return true; + + return false; + }, + + isFullPage: function() { + return this._container.parentNode == document.body; + }, + + isMouseNavEnabled: function() { + return this._innerTracker.isTracking(); + }, + + isVisible: function() { + return this._container.style.visibility != "hidden"; + }, + + setDashboardEnabled: function(enabled) { + for(var i = this._controls.length - 1; i >= 0; i--) + this._controls[i].setVisible(enabled); + }, + + setFullPage: function(fullPage) { + if(fullPage == this.isFullPage()) + return; + + // copy locally to improve perf + var body = document.body; + var bodyStyle = body.style; + var docStyle = document.documentElement.style; + var containerStyle = this._container.style; + var canvasStyle = this._canvas.style; + + if(fullPage) { + // change overflow, but preserve what current values are + bodyOverflow = bodyStyle.overflow; + docOverflow = docStyle.overflow; + bodyStyle.overflow = "hidden"; + docStyle.overflow = "hidden"; + + // IE6 needs the body width/height to be 100% also + bodyWidth = bodyStyle.width; + bodyHeight = bodyStyle.height; + bodyStyle.width = "100%"; + bodyStyle.height = "100%"; + + // always show black background, etc., for fullpage + canvasStyle.backgroundColor = "black"; + canvasStyle.color = "white"; + + // make container attached to the window, immune to scrolling, + // and above any other things with a z-index set. + containerStyle.position = "fixed"; + containerStyle.zIndex = Sys.Extended.UI.zIndex.SeadragonContainer; + + body.appendChild(this._container); + this._prevContainerSize = Seadragon.Utils.getWindowSize(); + + this._onContainerEnter(); // mouse will be inside container now + } else { + // restore previous values for overflow + bodyStyle.overflow = bodyOverflow; + docStyle.overflow = docOverflow; + + // IE6 needed to overwrite the body width/height also + bodyStyle.width = bodyWidth; + bodyStyle.height = bodyHeight; + + // return to inheriting style + canvasStyle.backgroundColor = ""; + canvasStyle.color = ""; + + // make container be inline on page again, and auto z-index + containerStyle.position = "relative"; + containerStyle.zIndex = ""; + + this.get_element().appendChild(this._container); + this._prevContainerSize = Seadragon.Utils.getElementSize(this.get_element()); + + this._onContainerExit(); // mouse will likely be outside now + } + if(this.viewport) { + var oldBounds = this.viewport.getBounds(); + this.viewport.resize(this._prevContainerSize); + var newBounds = this.viewport.getBounds(); + + if(fullPage) { + // going to fullpage, remember how much bounds changed by. + this._fsBoundsDelta = new Sys.Extended.UI.Seadragon.Point(newBounds.width / oldBounds.width, + newBounds.height / oldBounds.height); + } else { + // leaving fullpage, negate how much the fullpage zoomed by. + // note that we have to negate the bigger of the two changes. + // we have to zoom about the center of the new bounds, but + // that's NOT the zoom point. so we have to manually update + // first so that that center becomes the viewport center. + this.viewport.update(); + this.viewport.zoomBy(Math.max(this._fsBoundsDelta.x, this._fsBoundsDelta.y), + null, true); + } + + this._forceRedraw = true; + this._raiseEvent("resize", this); + this._updateOnce(); + } + }, + + setMouseNavEnabled: function(enabled) { + this._innerTracker.setTracking(enabled); + }, + + setVisible: function(visible) { + // important: don't explicitly say "visibility: visible", because + // the W3C spec actually says children of hidden elements that have + // "visibility: visible" should still be rendered. that's usually + // not what we (or developers) want. browsers are inconsistent in + // this regard, but IE seems to follow this spec. + this._container.style.visibility = visible ? "" : "hidden"; + } + +}; +Sys.Extended.UI.Seadragon.Viewer.registerClass('Sys.Extended.UI.Seadragon.Viewer', Sys.UI.Control); + +(function() { + + // DUPLICATION CHECK -- necessary here because of private static state + if(Seadragon.MouseTracker) + return; + + // Constants + var isIE = Seadragon.Utils.getBrowser() == Seadragon.Browser.IE; + + // Static fields + + var buttonDownAny = false; + var ieCapturingAny = false; + var ieTrackersActive = {}; // dictionary from hash to MouseTracker + var ieTrackersCapturing = []; // list of trackers interested in capture + + // Static helpers + + function getMouseAbsolute(event) { + return Seadragon.Utils.getMousePosition(event); + } + + function getMouseRelative(event, elmt) { + var mouse = Seadragon.Utils.getMousePosition(event); + var offset = Seadragon.Utils.getElementPosition(elmt); + + return mouse.minus(offset); + } + + /** + * Returns true if elmtB is a child node of elmtA, or if they're equal. + */ + function isChild(elmtA, elmtB) { + var body = document.body; + while(elmtB && elmtA != elmtB && body != elmtB) + try { + elmtB = elmtB.parentNode; + } catch(e) { + // Firefox sometimes fires events for XUL elements, which throws + // a "permission denied" error. so this is not a child. + return false; + } + + return elmtA == elmtB; + } + + function onGlobalMouseDown() { + buttonDownAny = true; + } + + function onGlobalMouseUp() { + buttonDownAny = false; + } + + // Static constructor + + (function() { + // the W3C event model lets us listen to the capture phase of events, so + // to know if the mouse is globally up or down, we'll listen to the + // capture phase of the window's events. we can't do this in IE, so + // we'll give it a best effort by listening to the regular bubble phase, + // and on the document since window isn't legal in IE for mouse events. + if(isIE) { + Seadragon.Utils.addEvent(document, "mousedown", onGlobalMouseDown, false); + Seadragon.Utils.addEvent(document, "mouseup", onGlobalMouseUp, false); + } else { + Seadragon.Utils.addEvent(window, "mousedown", onGlobalMouseDown, true); + Seadragon.Utils.addEvent(window, "mouseup", onGlobalMouseUp, true); + } + })(); + + // Class + + Seadragon.MouseTracker = function(elmt, clickTimeThreshold, clickDistThreshold) { + + // Fields + + var self = this; + var ieSelf = null; + + var hash = Math.random(); // a unique hash for this tracker + var elmt = Seadragon.Utils.getElement(elmt); + + var tracking = false; + var capturing = false; + var buttonDownElmt = false; + var insideElmt = false; + + var lastPoint = null; // position of last mouse down/move + var lastMouseDownTime = null; // time of last mouse down + var lastMouseDownPoint = null; // position of last mouse down + var clickTimeThreshold = clickTimeThreshold; + var clickDistThreshold = clickDistThreshold; + + // Properties + + this.target = elmt; + this.enterHandler = null; // function(tracker, position, buttonDownElmt, buttonDownAny) + this.exitHandler = null; // function(tracker, position, buttonDownElmt, buttonDownAny) + this.pressHandler = null; // function(tracker, position) + this.releaseHandler = null; // function(tracker, position, insideElmtPress, insideElmtRelease) + this.clickHandler = null; // function(tracker, position, quick, shift) + this.dragHandler = null; // function(tracker, position, delta, shift) + + // Helpers + + function startTracking() { + if(!tracking) { + Seadragon.Utils.addEvent(elmt, "mouseover", onMouseOver, false); + Seadragon.Utils.addEvent(elmt, "mouseout", onMouseOut, false); + Seadragon.Utils.addEvent(elmt, "mousedown", onMouseDown, false); + Seadragon.Utils.addEvent(elmt, "mouseup", onMouseUp, false); + Seadragon.Utils.addEvent(elmt, "click", onMouseClick, false); + + tracking = true; + ieTrackersActive[hash] = ieSelf; + } + } + + function stopTracking() { + if(tracking) { + Seadragon.Utils.removeEvent(elmt, "mouseover", onMouseOver, false); + Seadragon.Utils.removeEvent(elmt, "mouseout", onMouseOut, false); + Seadragon.Utils.removeEvent(elmt, "mousedown", onMouseDown, false); + Seadragon.Utils.removeEvent(elmt, "mouseup", onMouseUp, false); + Seadragon.Utils.removeEvent(elmt, "click", onMouseClick, false); + + releaseMouse(); + tracking = false; + delete ieTrackersActive[hash]; + } + } + + function captureMouse() { + if(!capturing) { + // IE lets the element capture the mouse directly, but other + // browsers use the capture phase on the highest element. + if(isIE) { + // we need to capture the mouse, but we also don't want to + // handle mouseup like normally (special case for bubbling) + Seadragon.Utils.removeEvent(elmt, "mouseup", onMouseUp, false); + Seadragon.Utils.addEvent(elmt, "mouseup", onMouseUpIE, true); + Seadragon.Utils.addEvent(elmt, "mousemove", onMouseMoveIE, true); + } else { + Seadragon.Utils.addEvent(window, "mouseup", onMouseUpWindow, true); + Seadragon.Utils.addEvent(window, "mousemove", onMouseMove, true); + } + + capturing = true; + } + } + + function releaseMouse() { + if(capturing) { + // similar reasoning as captureMouse() + if(isIE) { + // we need to release the mouse, and also go back to handling + // mouseup like normal (no longer a hack for capture phase) + Seadragon.Utils.removeEvent(elmt, "mousemove", onMouseMoveIE, true); + Seadragon.Utils.removeEvent(elmt, "mouseup", onMouseUpIE, true); + Seadragon.Utils.addEvent(elmt, "mouseup", onMouseUp, false); + } else { + Seadragon.Utils.removeEvent(window, "mousemove", onMouseMove, true); + Seadragon.Utils.removeEvent(window, "mouseup", onMouseUpWindow, true); + } + + capturing = false; + } + } + + // IE-specific helpers + + function triggerOthers(eventName, event) { + // update: protecting against properties added to the Object class's + // prototype, which can and does happen (e.g. through js libraries) + var trackers = ieTrackersActive; + for(var otherHash in trackers) + if(trackers.hasOwnProperty(otherHash) && hash != otherHash) + trackers[otherHash][eventName](event); + } + + function hasMouse() { + return insideElmt; + } + + // Listeners + + function onMouseOver(event) { + var event = Seadragon.Utils.getEvent(event); + + // IE capturing model doesn't raise or bubble the events on any + // other element if we're capturing currently. so pass this event to + // other elements being tracked so they can adjust if the element + // was from them or from a child. however, IE seems to always fire + // events originating from parents to those parents, so don't double + // fire the event if the event originated from a parent. + if(isIE && capturing && !isChild(event.srcElement, elmt)) + triggerOthers("onMouseOver", event); + + // similar to onMouseOut() tricky bubbling case... + var to = event.target ? event.target : event.srcElement; + var from = event.relatedTarget ? event.relatedTarget : event.fromElement; + if(!isChild(elmt, to) || isChild(elmt, from)) + // the mouseover needs to end on this or a child node, and it + // needs to start from this or an outer node. + return; + + insideElmt = true; + + if(typeof (self.enterHandler) == "function") + try { + self.enterHandler(self, getMouseRelative(event, elmt), + buttonDownElmt, buttonDownAny); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + + " while executing enter handler: " + e.message, e); + } + } + + function onMouseOut(event) { + var event = Seadragon.Utils.getEvent(event); + + // similar to onMouseOver() case for IE capture model + if(isIE && capturing && !isChild(event.srcElement, elmt)) + triggerOthers("onMouseOut", event); + + // we have to watch out for a tricky case: a mouseout occurs on a + // child element, but the mouse is still inside the parent element. + // the mouseout event will bubble up to us. this happens in all + // browsers, so we need to correct for this. technique from: + // http://www.quirksmode.org/js/events_mouse.html + var from = event.target ? event.target : event.srcElement; + var to = event.relatedTarget ? event.relatedTarget : event.toElement; + if(!isChild(elmt, from) || isChild(elmt, to)) + // the mouseout needs to start from this or a child node, and it + // needs to end on this or an outer node. + return; + + insideElmt = false; + + if(typeof (self.exitHandler) == "function") + try { + self.exitHandler(self, getMouseRelative(event, elmt), + buttonDownElmt, buttonDownAny); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + + " while executing exit handler: " + e.message, e); + } + } + + function onMouseDown(event) { + var event = Seadragon.Utils.getEvent(event); + + // don't consider right-clicks (fortunately this is cross-browser) + if(event.button == 2) + return; + + buttonDownElmt = true; + + lastPoint = getMouseAbsolute(event); + lastMouseDownPoint = lastPoint; + lastMouseDownTime = new Date().getTime(); + + if(typeof (self.pressHandler) == "function") + try { + self.pressHandler(self, getMouseRelative(event, elmt)); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + + " while executing press handler: " + e.message, e); + } + + if(self.pressHandler || self.dragHandler) + // if a press or drag handler is registered, don't drag-drop images, etc. + Seadragon.Utils.cancelEvent(event); + + if(!isIE || !ieCapturingAny) { + captureMouse(); + ieCapturingAny = true; + ieTrackersCapturing = [ieSelf]; // reset to empty & add us + } else if(isIE) { + ieTrackersCapturing.push(ieSelf); // add us to the list + } + } + + function onMouseUp(event) { + var event = Seadragon.Utils.getEvent(event); + var insideElmtPress = buttonDownElmt; + var insideElmtRelease = insideElmt; + + // don't consider right-clicks (fortunately this is cross-browser) + if(event.button == 2) + return; + + buttonDownElmt = false; + + if(typeof (self.releaseHandler) == "function") + try { + self.releaseHandler(self, getMouseRelative(event, elmt), + insideElmtPress, insideElmtRelease); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + + " while executing release handler: " + e.message, e); + } + + // some browsers sometimes don't fire click events when we're also + // listening for mouseup events. i'm not sure why, it could be + // something i'm doing. in the meantime, this is a temporary fix. + if(insideElmtPress && insideElmtRelease) + handleMouseClick(event); + } + + /** + * Only triggered once by the deepest element that initially received + * the mouse down event. We want to make sure THIS event doesn't bubble. + * Instead, we want to trigger the elements that initially received the + * mouse down event (including this one) only if the mouse is no longer + * inside them. Then, we want to release capture, and emulate a regular + * mouseup on the event that this event was meant for. + */ + function onMouseUpIE(event) { + var event = Seadragon.Utils.getEvent(event); + + // don't consider right-clicks (fortunately this is cross-browser) + if(event.button == 2) + return; + + // first trigger those that were capturing + for(var i = 0; i < ieTrackersCapturing.length; i++) { + var tracker = ieTrackersCapturing[i]; + if(!tracker.hasMouse()) + tracker.onMouseUp(event); + } + + // then release capture and emulate a regular event + releaseMouse(); + ieCapturingAny = false; + event.srcElement.fireEvent("on" + event.type, document.createEventObject(event)); + + // make sure to stop this event -- shouldn't bubble up + Seadragon.Utils.stopEvent(event); + } + + /** + * Only triggered in W3C browsers by elements within which the mouse was + * initially pressed, since they are now listening to the window for + * mouseup during the capture phase. We shouldn't handle the mouseup + * here if the mouse is still inside this element, since the regular + * mouseup handler will still fire. + */ + function onMouseUpWindow(event) { + if(!insideElmt) + onMouseUp(event); + + releaseMouse(); + } + + function onMouseClick(event) { + // see onMouseUp() bug -- handleClick() is already called by + // onMouseUp() as a temporary fix, so don't duplicate the call here. + + if(self.clickHandler) + // since a click handler was registered, don't follow href's, etc. + Seadragon.Utils.cancelEvent(event); + } + + function handleMouseClick(event) { + var event = Seadragon.Utils.getEvent(event); + + // don't consider right-clicks (fortunately this is cross-browser) + if(event.button == 2) + return; + + var time = new Date().getTime() - lastMouseDownTime; + var point = getMouseAbsolute(event); + var distance = lastMouseDownPoint.distanceTo(point); + var quick = time <= clickTimeThreshold && distance <= clickDistThreshold; + + if(typeof (self.clickHandler) == "function") + try { + self.clickHandler(self, getMouseRelative(event, elmt), + quick, event.shiftKey); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + + " while executing click handler: " + e.message, e); + } + } + + function onMouseMove(event) { + var event = Seadragon.Utils.getEvent(event); + var point = getMouseAbsolute(event); + var delta = point.minus(lastPoint); + + lastPoint = point; + + if(typeof (self.dragHandler) == "function") { + try { + self.dragHandler(self, getMouseRelative(event, elmt), delta, event.shiftKey); + } catch(e) { + // handler threw an error, ignore + Seadragon.Debug.error(e.name + " while executing drag handler: " + e.message, e); + } + + // since a drag handler was registered, don't allow highlighting, etc. + Seadragon.Utils.cancelEvent(event); + } + } + + /** + * Only triggered once by the deepest element that initially received + * the mouse down event. Since no other element has captured the mouse, + * we want to trigger the elements that initially received the mouse + * down event (including this one). + */ + function onMouseMoveIE(event) { + // manually trigger those that are capturing + for(var i = 0; i < ieTrackersCapturing.length; i++) + ieTrackersCapturing[i].onMouseMove(event); + + // make sure to stop this event -- shouldn't bubble up. note that at + // the time of this writing, there is no harm in letting it bubble, + // but a minor change to our implementation would necessitate this. + Seadragon.Utils.stopEvent(event); + } + + // Constructor + + (function() { + ieSelf = { + hasMouse: hasMouse, + onMouseOver: onMouseOver, + onMouseOut: onMouseOut, + onMouseUp: onMouseUp, + onMouseMove: onMouseMove + }; + })(); + + // Methods + + this.isTracking = function() { + return tracking; + }; + + this.setTracking = function(track) { + if(track) + startTracking(); + else + stopTracking(); + }; + }; +})(); + +Seadragon.Point = Sys.Extended.UI.Seadragon.Point = function(x, y) { + this.x = typeof (x) == "number" ? x : 0; + this.y = typeof (y) == "number" ? y : 0; +}; +Sys.Extended.UI.Seadragon.Point.prototype = { + // Methods + + plus: function(point) { + return new Sys.Extended.UI.Seadragon.Point(this.x + point.x, this.y + point.y); + }, + + minus: function(point) { + return new Sys.Extended.UI.Seadragon.Point(this.x - point.x, this.y - point.y); + }, + + times: function(factor) { + return new Sys.Extended.UI.Seadragon.Point(this.x * factor, this.y * factor); + }, + + divide: function(factor) { + return new Sys.Extended.UI.Seadragon.Point(this.x / factor, this.y / factor); + }, + + negate: function() { + return new Sys.Extended.UI.Seadragon.Point(-this.x, -this.y); + }, + + distanceTo: function(point) { + return Math.sqrt(Math.pow(this.x - point.x, 2) + Math.pow(this.y - point.y, 2)); + }, + + apply: function(func) { + return new Sys.Extended.UI.Seadragon.Point(func(this.x), func(this.y)); + }, + + equals: function(point) { + return (point instanceof Sys.Extended.UI.Seadragon.Point) && (this.x === point.x) && (this.y === point.y); + }, + + toString: function() { + return "(" + this.x + "," + this.y + ")"; + } +}; +Sys.Extended.UI.Seadragon.Point.registerClass('Sys.Extended.UI.Seadragon.Point', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Strings = { + Errors: { + Failure: "Sorry, but Seadragon Ajax can't run on your browser!\n" + + "Please try using IE 7 or Firefox 3.\n", + Dzc: "Sorry, we don't support Deep Zoom Collections!", + Dzi: "Hmm, this doesn't appear to be a valid Deep Zoom Image.", + Xml: "Hmm, this doesn't appear to be a valid Deep Zoom Image.", + Empty: "You asked us to open nothing, so we did just that.", + ImageFormat: "Sorry, we don't support {0}-based Deep Zoom Images.", + Security: "It looks like a security restriction stopped us from " + + "loading this Deep Zoom Image.", + Status: "This space unintentionally left blank ({0} {1}).", + Unknown: "Whoops, something inexplicably went wrong. Sorry!" + }, + + Messages: { + Loading: "Loading..." + }, + + Tooltips: { + FullPage: "Toggle full page", + Home: "Go home", + ZoomIn: "Zoom in", + ZoomOut: "Zoom out" + }, + getString: function(prop) { + var props = prop.split('.'); + var string = Sys.Extended.UI.Seadragon.Strings; + + // get property, which may contain dots, meaning subproperty + for(var i = 0; i < props.length; i++) + string = string[props[i]] || {}; // in case not a subproperty + + // in case the string didn't exist + if(typeof (string) != "string") + string = ""; + + // regular expression and lambda technique from: + // http://frogsbrain.wordpress.com/2007/04/28/javascript-stringformat-method/#comment-236 + var args = arguments; + return string.replace(/\{\d+\}/g, function(capture) { + var i = parseInt(capture.match(/\d+/)) + 1; + return i < args.length ? args[i] : ""; + }); + }, + + setString: function(prop, value) { + var props = prop.split('.'); + var container = Seadragon.Strings; + + // get property's container, up to but not after last dot + for(var i = 0; i < props.length - 1; i++) + if(!container[props[i]]) + container[props[i]] = {}; + container = container[props[i]]; + + container[props[i]] = value; + } + +}; +Seadragon.Strings = Sys.Extended.UI.Seadragon.Strings; + +// Constants + +var QUOTA = 100; // the max number of images we should keep in memory +var MIN_PIXEL_RATIO = 0.5; // the most shrunk a tile should be + +// Method of drawing + +var browser = Seadragon.Utils.getBrowser(); +var browserVer = Seadragon.Utils.getBrowserVersion(); + +// only Firefox and Opera implement with subpixel rendering. +// update: safari 4 does too now! update: and chrome 2! +var subpixelRenders = browser == Seadragon.Browser.FIREFOX || + browser == Seadragon.Browser.OPERA || + (browser == Seadragon.Browser.SAFARI && browserVer >= 4) || + (browser == Seadragon.Browser.CHROME && browserVer >= 2); + +// make sure browser supports , and only use it if we know browser +// does subpixel rendering with (that's the main advantage) +var useCanvas = + typeof (document.createElement("canvas").getContext) == "function" && + subpixelRenders; +Sys.Extended.UI.Seadragon.Tile = function(level, x, y, bounds, exists, url) { + // Core + this.level = level; + this.x = x; + this.y = y; + this.bounds = bounds; // where this tile fits, in normalized coordinates + this.exists = exists; // part of sparse image? tile hasn't failed to load? + this.loaded = false; // is this tile loaded? + this.loading = false; // or is this tile loading? + + // Image + this.elmt = null; // the HTML element for this tile + this.image = null; // the Image object for this tile + this.url = url; // the URL of this tile's image + + // Drawing + this.style = null; // alias of this.elmt.style + this.position = null; // this tile's position on screen, in pixels + this.size = null; // this tile's size on screen, in pixels + this.blendStart = null; // the start time of this tile's blending + this.opacity = null; // the current opacity this tile should be + this.distance = null; // the distance of this tile to the viewport center + this.visibility = null; // the visibility score of this tile + + // Caching + this.beingDrawn = false; // whether this tile is currently being drawn + this.lastTouchTime = 0; // the time that tile was last touched +}; +Sys.Extended.UI.Seadragon.Tile.prototype = { + dispose: function() { + }, + toString: function() { + return this.level + "/" + this.x + "_" + this.y; + }, + drawHTML: function(container) { + if(!this.loaded) { + Seadragon.Debug.error("Attempting to draw tile " + this.toString() + + " when it's not yet loaded."); + return; + } + + // initialize if first time + if(!this.elmt) { + this.elmt = Seadragon.Utils.makeNeutralElement("img"); + this.elmt.src = this.url; + this.style = this.elmt.style; + this.style.position = "absolute"; + this.style.msInterpolationMode = "nearest-neighbor"; + // IE only property. bicubic is ideal, but it causes seams. + // explicitly use nearest-neighbor so it's not overridden to + // bicubic on page zoom. + } + + var elmt = this.elmt; + var style = this.style; + var position = this.position.apply(Math.floor); + var size = this.size.apply(Math.ceil); + + // this was an alternate idea to hopefully make the rendering more + // accurate, by prioritizing the edges of the image and not the size, + // but it hasn't seemed to make any difference. + //var topLeft = this.position; + //var bottomRight = topLeft.plus(this.size); + //var position = topLeft.apply(Math.floor); + //var size = bottomRight.minus(topLeft).apply(Math.floor); + + if(elmt.parentNode != container) + container.appendChild(elmt); + + style.left = position.x + "px"; + style.top = position.y + "px"; + style.width = size.x + "px"; + style.height = size.y + "px"; + + Seadragon.Utils.setElementOpacity(elmt, this.opacity); + }, + drawCanvas: function(context) { + if(!this.loaded) { + Seadragon.Debug.error("Attempting to draw tile " + this.toString() + + " when it's not yet loaded."); + return; + } + + var position = this.position; + var size = this.size; + + context.globalAlpha = this.opacity; + context.drawImage(this.image, position.x, position.y, size.x, size.y); + }, + unload: function() { + if(this.elmt && this.elmt.parentNode) + this.elmt.parentNode.removeChild(this.elmt); + + this.elmt = null; + this.image = null; + this.loaded = false; + this.loading = false; + } +}; +Sys.Extended.UI.Seadragon.Tile.registerClass('Sys.Extended.UI.Seadragon.Tile', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Overlay = function(elmt, loc, placement) { + // Core + this.elmt = elmt; + this.scales = (loc instanceof Sys.Extended.UI.Seadragon.Rect); + this.bounds = new Sys.Extended.UI.Seadragon.Rect(loc.x, loc.y, loc.width, loc.height); + // Drawing + this.placement = loc instanceof Sys.Extended.UI.Seadragon.Point ? placement : Sys.Extended.UI.Seadragon.OverlayPlacement.TOP_LEFT; // rects are always top-left + this.position = new Sys.Extended.UI.Seadragon.Point(loc.x, loc.y); + this.size = new Sys.Extended.UI.Seadragon.Point(loc.width, loc.height); + this.style = elmt.style; +}; +Sys.Extended.UI.Seadragon.Overlay.prototype = { + + adjust: function(position, size) { + switch(this.placement) { + case Sys.Extended.UI.Seadragon.OverlayPlacement.TOP_LEFT: + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.TOP: + position.x -= size.x / 2; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.TOP_RIGHT: + position.x -= size.x; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.RIGHT: + position.x -= size.x; + position.y -= size.y / 2; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.BOTTOM_RIGHT: + position.x -= size.x; + position.y -= size.y; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.BOTTOM: + position.x -= size.x / 2; + position.y -= size.y; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.BOTTOM_LEFT: + position.y -= size.y; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.LEFT: + position.y -= size.y / 2; + break; + case Sys.Extended.UI.Seadragon.OverlayPlacement.CENTER: + default: + position.x -= size.x / 2; + position.y -= size.y / 2; + break; + } + }, + destroy: function() { + var elmt = this.elmt; + var style = this.style; + + if(elmt.parentNode) + elmt.parentNode.removeChild(elmt); + + style.top = ""; + style.left = ""; + style.position = ""; + + if(this.scales) { + style.width = ""; + style.height = ""; + } + }, + drawHTML: function(container) { + var elmt = this.elmt; + var style = this.style; + var scales = this.scales; + + if(elmt.parentNode != container) + container.appendChild(elmt); + + // override calculated size if this element doesn't scale with image + if(!scales) + this.size = Seadragon.Utils.getElementSize(elmt); + + var position = this.position; + var size = this.size; + + // adjust position based on placement (default is center) + this.adjust(position, size); + + position = position.apply(Math.floor); + size = size.apply(Math.ceil); + + style.left = position.x + "px"; + style.top = position.y + "px"; + style.position = "absolute"; + + if(scales) { + style.width = size.x + "px"; + style.height = size.y + "px"; + } + }, + update: function(loc, placement) { + this.scales = (loc instanceof Sys.Extended.UI.Seadragon.Rect); + this.bounds = new Sys.Extended.UI.Seadragon.Rect(loc.x, loc.y, loc.width, loc.height); + this.placement = loc instanceof Sys.Extended.UI.Seadragon.Point ? + placement : Sys.Extended.UI.Seadragon.OverlayPlacement.TOP_LEFT; // rects are always top-left + } + +}; +Sys.Extended.UI.Seadragon.Overlay.registerClass('Sys.Extended.UI.Seadragon.Overlay', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Drawer = function(source, viewport, elmt) { + this._container = Seadragon.Utils.getElement(elmt); + this._canvas = Seadragon.Utils.makeNeutralElement(useCanvas ? "canvas" : "div"); + this._context = useCanvas ? this._canvas.getContext("2d") : null; + this._viewport = viewport; + this._source = source; + this.config = this._viewport.config; + + this._imageLoader = new Sys.Extended.UI.Seadragon.ImageLoader(this.config.imageLoaderLimit); + this._profiler = new Sys.Extended.UI.Seadragon.Profiler(); + + this._minLevel = source.minLevel; + this._maxLevel = source.maxLevel; + this._tileSize = source.tileSize; + this._tileOverlap = source.tileOverlap; + this._normHeight = source.dimensions.y / source.dimensions.x; + + this._cacheNumTiles = {}; // 1d dictionary [level] --> Point + this._cachePixelRatios = {}; // 1d dictionary [level] --> Point + this._tilesMatrix = {}; // 3d dictionary [level][x][y] --> Tile + this._tilesLoaded = []; // unordered list of Tiles with loaded images + this._coverage = {}; // 3d dictionary [level][x][y] --> Boolean + + this._overlays = []; // unordered list of Overlays added + this._lastDrawn = []; // unordered list of Tiles drawn last frame + this._lastResetTime = 0; + this._midUpdate = false; + this._updateAgain = true; + + // Properties + this.elmt = this._container; + + // Constructor + this._init(); +}; +Sys.Extended.UI.Seadragon.Drawer.prototype = { + dispose: function() { + }, + _init: function() { + this._canvas.style.width = "100%"; + this._canvas.style.height = "100%"; + this._canvas.style.position = "absolute"; + this._container.style.textAlign = "left"; // explicit left-align + this._container.appendChild(this._canvas); + }, + _compareTiles: function(prevBest, tile) { + // figure out if this tile is better than the previous best tile... + // note that if there is no prevBest, this is automatically better. + if(!prevBest) + return tile; + + if(tile.visibility > prevBest.visibility) + return tile; + else if(tile.visibility == prevBest.visibility) + if(tile.distance < prevBest.distance) + return tile; + + return prevBest; + }, + _getNumTiles: function(level) { + if(!this._cacheNumTiles[level]) + this._cacheNumTiles[level] = this._source.getNumTiles(level); + + return this._cacheNumTiles[level]; + }, + + _getPixelRatio: function(level) { + if(!this._cachePixelRatios[level]) + this._cachePixelRatios[level] = this._source.getPixelRatio(level); + + return this._cachePixelRatios[level]; + }, + + // Helpers -- TILES + + _getTile: function(level, x, y, time, numTilesX, numTilesY) { + if(!this._tilesMatrix[level]) + this._tilesMatrix[level] = {}; + + if(!this._tilesMatrix[level][x]) + this._tilesMatrix[level][x] = {}; + + // initialize tile object if first time + if(!this._tilesMatrix[level][x][y]) { + // where applicable, adjust x and y to support wrapping. + var xMod = (numTilesX + (x % numTilesX)) % numTilesX; + var yMod = (numTilesY + (y % numTilesY)) % numTilesY; + var bounds = this._source.getTileBounds(level, xMod, yMod); + var exists = this._source.tileExists(level, xMod, yMod); + var url = this._source.getTileUrl(level, xMod, yMod); + + // also adjust bounds to support wrapping. + bounds.x += 1.0 * (x - xMod) / numTilesX; + bounds.y += this._normHeight * (y - yMod) / numTilesY; + + this._tilesMatrix[level][x][y] = new Sys.Extended.UI.Seadragon.Tile(level, x, y, bounds, exists, url); + } + + var tile = this._tilesMatrix[level][x][y]; + + // mark tile as touched so we don't reset it too soon + tile.lastTouchTime = time; + + return tile; + }, + + _loadTile: function(tile, time) { + tile.loading = this._imageLoader.loadImage(tile.url, + Seadragon.Utils.createCallback(null, Function.createDelegate(this, this._onTileLoad), tile, time)); + }, + + _onTileLoad: function(tile, time, image) { + tile.loading = false; + + if(this._midUpdate) { + Seadragon.Debug.error("Tile load callback in middle of drawing routine."); + return; + } else if(!image) { + Seadragon.Debug.log("Tile " + tile + " failed to load: " + tile.url); + tile.exists = false; + return; + } else if(time < this._lastResetTime) { + Seadragon.Debug.log("Ignoring tile " + tile + " loaded before reset: " + tile.url); + return; + } + + tile.loaded = true; + tile.image = image; + + var insertionIndex = this._tilesLoaded.length; + + if(this._tilesLoaded.length >= QUOTA) { + var cutoff = Math.ceil(Math.log(this._tileSize) / Math.log(2)); + // don't delete any single-tile levels. this takes priority. + + var worstTile = null; + var worstTileIndex = -1; + + for(var i = this._tilesLoaded.length - 1; i >= 0; i--) { + var prevTile = this._tilesLoaded[i]; + + if(prevTile.level <= this._cutoff || prevTile.beingDrawn) { + continue; + } else if(!worstTile) { + worstTile = prevTile; + worstTileIndex = i; + continue; + } + + var prevTime = prevTile.lastTouchTime; + var worstTime = worstTile.lastTouchTime; + var prevLevel = prevTile.level; + var worstLevel = worstTile.level; + + if(prevTime < worstTime || + (prevTime == worstTime && prevLevel > worstLevel)) { + worstTile = prevTile; + worstTileIndex = i; + } + } + + if(worstTile && worstTileIndex >= 0) { + worstTile.unload(); + insertionIndex = worstTileIndex; + // note: we don't want or need to delete the actual Tile + // object from tilesMatrix; that's negligible memory. + } + } + + this._tilesLoaded[insertionIndex] = tile; + this._updateAgain = true; + }, + + _clearTiles: function() { + this._tilesMatrix = {}; + this._tilesLoaded = []; + }, + + // Helpers -- COVERAGE + + // Coverage scheme: it's required that in the draw routine, coverage for + // every tile within the viewport is initially explicitly set to false. + // This way, if a given level's coverage has been initialized, and a tile + // isn't found, it means it's offscreen and thus provides coverage (since + // there's no content needed to be covered). And if every tile that is found + // does provide coverage, the entire visible level provides coverage. + + // Returns true if the given tile provides coverage to lower-level tiles of + // lower resolution representing the same content. If neither x nor y is + // given, returns true if the entire visible level provides coverage. + // + // Note that out-of-bounds tiles provide coverage in this sense, since + // there's no content that they would need to cover. Tiles at non-existent + // levels that are within the image bounds, however, do not. + _providesCoverage: function(level, x, y) { + if(!this._coverage[level]) + return false; + + if(x === undefined || y === undefined) { + // check that every visible tile provides coverage. + // update: protecting against properties added to the Object + // class's prototype, which can definitely (and does) happen. + var rows = this._coverage[level]; + for(var i in rows) + if(rows.hasOwnProperty(i)) { + var cols = rows[i]; + for(var j in cols) + if(cols.hasOwnProperty(j) && !cols[j]) + return false; + } + + return true; + } + + return (this._coverage[level][x] === undefined || + this._coverage[level][x][y] === undefined || + this._coverage[level][x][y] === true); + }, + + // Returns true if the given tile is completely covered by higher-level + // tiles of higher resolution representing the same content. If neither x + // nor y is given, returns true if the entire visible level is covered. + _isCovered: function(level, x, y) { + if(x === undefined || y === undefined) + return this._providesCoverage(level + 1); + else + return (this._providesCoverage(level + 1, 2 * x, 2 * y) && + this._providesCoverage(level + 1, 2 * x, 2 * y + 1) && + this._providesCoverage(level + 1, 2 * x + 1, 2 * y) && + this._providesCoverage(level + 1, 2 * x + 1, 2 * y + 1)); + }, + + // Sets whether the given tile provides coverage or not. + _setCoverage: function(level, x, y, covers) { + if(!this._coverage[level]) { + Seadragon.Debug.error("Setting coverage for a tile before its " + + "level's coverage has been reset: " + level); + return; + } + + if(!this._coverage[level][x]) + this._coverage[level][x] = {}; + + this._coverage[level][x][y] = covers; + }, + + // Resets coverage information for the given level. This should be called + // after every draw routine. Note that at the beginning of the next draw + // routine, coverage for every visible tile should be explicitly set. + _resetCoverage: function(level) { + this._coverage[level] = {}; + }, + + // Helpers -- SCORING + + _compareTiles: function(prevBest, tile) { + // figure out if this tile is better than the previous best tile... + // note that if there is no prevBest, this is automatically better. + if(!prevBest) + return tile; + + if(tile.visibility > prevBest.visibility) + return tile; + else if(tile.visibility == prevBest.visibility) + if(tile.distance < prevBest.distance) + return tile; + + return prevBest; + }, + + // Helpers -- OVERLAYS + + _getOverlayIndex: function(elmt) { + for(var i = this._overlays.length - 1; i >= 0; i--) + if(this._overlays[i].elmt == elmt) + return i; + + return -1; + }, + + // Helpers -- CORE + + _updateActual: function() { + // assume we won't need to update again after this update. + // we'll set this if we find a reason to update again. + this._updateAgain = false; + + // make local references to variables & functions referenced in + // loops in order to improve perf + var _canvas = this._canvas, + _context = this._context, + _container = this._container, + _useCanvas = useCanvas, + _lastDrawn = this._lastDrawn; + + // the tiles that were drawn last frame, but won't be this frame, + // can be cleared from the cache, so they should be marked as such. + while(_lastDrawn.length > 0) { + var tile = _lastDrawn.pop(); + tile.beingDrawn = false; + } + + // we need the size of the viewport (in pixels) in multiple places + var viewportSize = this._viewport.getContainerSize(), + viewportWidth = viewportSize.x, + viewportHeight = viewportSize.y; + + // clear canvas, whether in mode or HTML mode. + // this is important as scene may be empty this frame. + _canvas.innerHTML = ""; + if(_useCanvas) { + _canvas.width = viewportWidth; + _canvas.height = viewportHeight; + _context.clearRect(0, 0, viewportWidth, viewportHeight); + // this last line shouldn't be needed. setting the width and + // height should clear , but Firefox doesn't always. + } + + // if viewport is off image entirely, don't bother drawing. + // UPDATE: logic modified to support horizontal/vertical wrapping. + var viewportBounds = this._viewport.getBounds(true), + viewportTL = viewportBounds.getTopLeft(), + viewportBR = viewportBounds.getBottomRight(); + if(!this.config.wrapHorizontal && (viewportBR.x < 0 || viewportTL.x > 1)) + // we're not wrapping horizontally, and viewport is off in x + return; + else if(!this.config.wrapVertical && (viewportBR.y < 0 || viewportTL.y > this._normHeight)) + // we're not wrapping vertically, and viewport is off in y + return; + + // the below section is commented out because it's more relevant to + // collections, where you don't want 10 items to all load their xml + // at the same time when 9 of them won't be in the viewport soon. + + // same for Math functions + var _abs = Math.abs, + _ceil = Math.ceil, + _floor = Math.floor, + _log = Math.log, + _max = Math.max, + _min = Math.min; + + var alwaysBlend = this.config.alwaysBlend, + blendTimeMillis = 1000 * this.config.blendTime, + immediateRender = this.config.immediateRender, + minDimension = this.config.minZoomDimension, // for backwards compatibility + minImageRatio = this.config.minImageRatio, + wrapHorizontal = this.config.wrapHorizontal, + wrapVertical = this.config.wrapVertical; + + // restrain bounds of viewport relative to image. + // UPDATE: logic modified to support horizontal/vertical wrapping. + if(!wrapHorizontal) { + viewportTL.x = _max(viewportTL.x, 0); + viewportBR.x = _min(viewportBR.x, 1); + } + if(!wrapVertical) { + viewportTL.y = _max(viewportTL.y, 0); + viewportBR.y = _min(viewportBR.y, this._normHeight); + } + + var best = null, + haveDrawn = false, + currentTime = new Date().getTime(); + + // calculate values for scoring -- this is based on TARGET values + var viewportCenter = this._viewport.pixelFromPoint(this._viewport.getCenter()), + zeroRatioT = this._viewport.deltaPixelsFromPoints(this._source.getPixelRatio(0), false).x, + optimalPixelRatio = immediateRender ? 1 : zeroRatioT; + + // adjust levels to iterate over -- this is based on CURRENT values + // TODO change this logic to use minImageRatio, but for backwards + // compatibility, use minDimension if it's been explicitly set. + // TEMP for now, original minDimension logic with default 64. + minDimension = minDimension || 64; + var lowestLevel = _max(this._minLevel, _floor(_log(minDimension) / _log(2))), + zeroRatioC = this._viewport.deltaPixelsFromPoints(this._source.getPixelRatio(0), true).x, + highestLevel = _min(this._maxLevel, _floor(_log(zeroRatioC / MIN_PIXEL_RATIO) / _log(2))); + + // with very small images, this edge case can occur... + lowestLevel = _min(lowestLevel, highestLevel); + + for(var level = highestLevel; level >= lowestLevel; level--) { + var drawLevel = false; + var renderPixelRatioC = this._viewport.deltaPixelsFromPoints(this._source.getPixelRatio(level), true).x; // note the .x! + + // if we haven't drawn yet, only draw level if tiles are big enough + if((!haveDrawn && renderPixelRatioC >= MIN_PIXEL_RATIO) || level == lowestLevel) { + drawLevel = true; + haveDrawn = true; + } else if(!haveDrawn) { + continue; + } + + this._resetCoverage(level); + + // calculate scores applicable to all tiles on this level -- + // note that we're basing visibility on the TARGET pixel ratio + var levelOpacity = _min(1, (renderPixelRatioC - 0.5) / 0.5), + renderPixelRatioT = this._viewport.deltaPixelsFromPoints(this._source.getPixelRatio(level), false).x, + levelVisibility = optimalPixelRatio / _abs(optimalPixelRatio - renderPixelRatioT); + + // only iterate over visible tiles + var tileTL = this._source.getTileAtPoint(level, viewportTL), + tileBR = this._source.getTileAtPoint(level, viewportBR), + numTiles = this._getNumTiles(level), + numTilesX = numTiles.x, + numTilesY = numTiles.y; + + if(!wrapHorizontal) + tileBR.x = _min(tileBR.x, numTilesX - 1); + if(!wrapVertical) + tileBR.y = _min(tileBR.y, numTilesY - 1); + + for(var x = tileTL.x; x <= tileBR.x; x++) { + for(var y = tileTL.y; y <= tileBR.y; y++) { + var tile = this._getTile(level, x, y, currentTime, numTilesX, numTilesY); + var drawTile = drawLevel; + + // assume this tile doesn't cover initially + this._setCoverage(level, x, y, false); + + if(!tile.exists) + // not part of sparse image, or failed to load + continue; + + // if we've drawn a higher-resolution level and we're not + // going to draw this level, then say this tile does cover + // if it's covered by higher-resolution tiles. if we're not + // covered, then we should draw this tile regardless. + if(haveDrawn && !drawTile) + if(this._isCovered(level, x, y)) + this._setCoverage(level, x, y, true); + else + drawTile = true; + + if(!drawTile) + continue; + + // calculate tile's position and size in pixels + var boundsTL = tile.bounds.getTopLeft(), + boundsSize = tile.bounds.getSize(), + positionC = this._viewport.pixelFromPoint(boundsTL, true), + sizeC = this._viewport.deltaPixelsFromPoints(boundsSize, true); + + // if there is no tile overlap, we need to oversize the + // tiles by 1px to prevent seams at imperfect zooms. + // fortunately, this is not an issue with regular dzi's + // created from Deep Zoom Composer, which uses overlap. + if(!this._tileOverlap) + sizeC = sizeC.plus(new Sys.Extended.UI.Seadragon.Point(1, 1)); + + // calculate distance from center of viewport -- note + // that this is based on tile's TARGET position + var positionT = this._viewport.pixelFromPoint(boundsTL, false), + sizeT = this._viewport.deltaPixelsFromPoints(boundsSize, false), + tileCenter = positionT.plus(sizeT.divide(2)), + tileDistance = viewportCenter.distanceTo(tileCenter); + + // update tile's scores and values + tile.position = positionC; + tile.size = sizeC; + tile.distance = tileDistance; + tile.visibility = levelVisibility; + + if(tile.loaded) { + if(!tile.blendStart) + // image was just added, blend it + tile.blendStart = currentTime; + + var deltaTime = currentTime - tile.blendStart; + var opacity = _min(1, deltaTime / blendTimeMillis); + + if(alwaysBlend) + opacity *= levelOpacity; + + tile.opacity = opacity; + + // queue tile for drawing in reverse order + _lastDrawn.push(tile); + + // if fully blended in, this tile now provides coverage, + // otherwise we need to update again to keep blending + if(opacity == 1) + this._setCoverage(level, x, y, true); + else if(deltaTime < blendTimeMillis) + updateAgain = true; + } else if(tile.Loading) { + // nothing to see here, move on + } else { + // means tile isn't loaded yet, so score it + best = this._compareTiles(best, tile); + } + } + } + + // we may not need to draw any more lower-res levels + if(this._providesCoverage(level)) + break; + } + + // now draw the tiles, but in reverse order since we want higher-res + // tiles to be drawn on top of lower-res ones. also mark each tile + // as being drawn so it won't get cleared from the cache. + for(var i = _lastDrawn.length - 1; i >= 0; i--) { + var tile = _lastDrawn[i]; + + if(_useCanvas) + tile.drawCanvas(_context); + else + tile.drawHTML(_canvas); + + tile.beingDrawn = true; + } + + // draw the overlays -- TODO optimize based on viewport like tiles, + // but this is tricky for non-scaling overlays like pins... + var numOverlays = this._overlays.length; + for(var i = 0; i < numOverlays; i++) { + var overlay = this._overlays[i], + bounds = overlay.bounds; + + overlay.position = this._viewport.pixelFromPoint(bounds.getTopLeft(), true); + overlay.size = this._viewport.deltaPixelsFromPoints(bounds.getSize(), true); + overlay.drawHTML(_container); + } + + // load next tile if there is one to load + if(best) { + this._loadTile(best, currentTime); + this._updateAgain = true; // because we haven't finished drawing, so + // we should be re-evaluating and re-scoring + } + }, + + // Methods -- OVERLAYS + + addOverlay: function(elmt, loc, placement) { + var elmt = Seadragon.Utils.getElement(elmt); + + if(this._getOverlayIndex(elmt) >= 0) + return; // they're trying to add a duplicate overlay + + this._overlays.push(new Sys.Extended.UI.Seadragon.Overlay(elmt, loc, placement)); + this._updateAgain = true; + }, + + updateOverlay: function(elmt, loc, placement) { + var elmt = Seadragon.Utils.getElement(elmt), + i = this._getOverlayIndex(elmt); + + if(i >= 0) { + this._overlays[i].update(loc, placement); + this._updateAgain = true; + } + }, + + removeOverlay: function(elmt) { + var elmt = Seadragon.Utils.getElement(elmt), + i = this._getOverlayIndex(elmt); + + if(i >= 0) { + this._overlays[i].destroy(); + this._overlays.splice(i, 1); + this._updateAgain = true; + } + }, + + clearOverlays: function() { + while(this._overlays.length > 0) { + this._overlays.pop().destroy(); + this._updateAgain = true; + } + }, + + // Methods -- CORE + + needsUpdate: function() { + return this._updateAgain; + }, + + numTilesLoaded: function() { + return this._tilesLoaded.length; + }, + + reset: function() { + this._clearTiles(); + this._lastResetTime = new Date().getTime(); + this._updateAgain = true; + }, + + update: function() { + this._profiler.beginUpdate(); + this._midUpdate = true; + this._updateActual(); + this._midUpdate = false; + this._profiler.endUpdate(); + }, + + idle: function() { + // TODO idling function + } +}; +Sys.Extended.UI.Seadragon.Drawer.registerClass('Sys.Extended.UI.Seadragon.Drawer', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.TileSource = function(width, height, tileSize, tileOverlap, minLevel, maxLevel) { + this.aspectRatio = width / height; + this.dimensions = new Sys.Extended.UI.Seadragon.Point(width, height); + this.minLevel = minLevel ? minLevel : 0; + this.maxLevel = maxLevel ? maxLevel : Math.ceil(Math.log(Math.max(width, height)) / Math.log(2)); + this.tileSize = tileSize ? tileSize : 0; + this.tileOverlap = tileOverlap ? tileOverlap : 0; +}; +Sys.Extended.UI.Seadragon.TileSource.prototype = { + getLevelScale: function(level) { + // equivalent to Math.pow(0.5, numLevels - level); + return 1 / (1 << (this.maxLevel - level)); + }, + + getNumTiles: function(level) { + var scale = this.getLevelScale(level), + x = Math.ceil(scale * this.dimensions.x / this.tileSize), + y = Math.ceil(scale * this.dimensions.y / this.tileSize); + + return new Sys.Extended.UI.Seadragon.Point(x, y); + }, + + getPixelRatio: function(level) { + var imageSizeScaled = this.dimensions.times(this.getLevelScale(level)), + rx = 1.0 / imageSizeScaled.x, + ry = 1.0 / imageSizeScaled.y; + + return new Sys.Extended.UI.Seadragon.Point(rx, ry); + }, + + getTileAtPoint: function(level, point) { + var pixel = point.times(this.dimensions.x).times(this.getLevelScale(level)); + + var tx = Math.floor(pixel.x / this.tileSize), + ty = Math.floor(pixel.y / this.tileSize); + + return new Sys.Extended.UI.Seadragon.Point(tx, ty); + }, + + getTileBounds: function(level, x, y) { + // work in scaled pixels for this level + var dimensionsScaled = this.dimensions.times(this.getLevelScale(level)); + + // find position, adjust for no overlap data on top and left edges + var px = (x === 0) ? 0 : this.tileSize * x - this.tileOverlap, + py = (y === 0) ? 0 : this.tileSize * y - this.tileOverlap; + + // find size, adjust for no overlap data on top and left edges + var sx = this.tileSize + (x === 0 ? 1 : 2) * this.tileOverlap, + sy = this.tileSize + (y === 0 ? 1 : 2) * this.tileOverlap; + + // adjust size for single-tile levels where the image size is smaller + // than the regular tile size, and for tiles on the bottom and right + // edges that would exceed the image bounds + sx = Math.min(sx, dimensionsScaled.x - px); + sy = Math.min(sy, dimensionsScaled.y - py); + + // finally, normalize... + // note that isotropic coordinates ==> only dividing by scaled x! + var scale = 1.0 / dimensionsScaled.x; + + return new Sys.Extended.UI.Seadragon.Rect(px * scale, py * scale, sx * scale, sy * scale); + }, + + getTileUrl: function(level, x, y) { + throw new Error("Method not implemented."); + }, + + tileExists: function(level, x, y) { + var numTiles = this.getNumTiles(level); + return level >= this.minLevel && level <= this.maxLevel && + x >= 0 && y >= 0 && x < numTiles.x && y < numTiles.y; + } +}; +Sys.Extended.UI.Seadragon.TileSource.registerClass('Sys.Extended.UI.Seadragon.TileSource', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.DziError = function(message) { + Sys.Extended.UI.Seadragon.DziError.initializeBase(this, [message]); + this.message = message; +}; +Sys.Extended.UI.Seadragon.DziError.registerClass('Sys.Extended.UI.Seadragon.DziError', Error); + +Sys.Extended.UI.Seadragon.DziTileSource = function(width, height, tileSize, tileOverlap, tilesUrl, fileFormat, displayRects) { + Sys.Extended.UI.Seadragon.DziTileSource.initializeBase(this, [width, height, tileSize, tileOverlap, null, null]); + this._levelRects = {}; + this.tilesUrl = tilesUrl; + + this.fileFormat = fileFormat; + this.displayRects = displayRects; + this._init(); +}; +Sys.Extended.UI.Seadragon.DziTileSource.prototype = { + _init: function() { + if(!this.displayRects) + return; + + for(var i = this.displayRects.length - 1; i >= 0; i--) { + var rect = this.displayRects[i]; + for(var level = rect.minLevel; level <= rect.maxLevel; level++) { + if(!this._levelRects[level]) + this._levelRects[level] = []; + this._levelRects[level].push(rect); + } + } + }, + getTileUrl: function(level, x, y) { + // using array join because it's faster than string concatenation + return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join(''); + }, + + tileExists: function(level, x, y) { + var rects = this._levelRects[level]; + + if(!rects || !rects.length) + return true; + + for(var i = rects.length - 1; i >= 0; i--) { + var rect = rects[i]; + + // check level + if(level < rect.minLevel || level > rect.maxLevel) + continue; + + // transform rectangle coordinates to this level + var scale = this.getLevelScale(level), + xMin = rect.x * scale, + yMin = rect.y * scale, + xMax = xMin + rect.width * scale, + yMax = yMin + rect.height * scale; + + // convert to rows and columns -- note that we're ignoring tile + // overlap, but it's a reasonable approximation. it errs on the side + // of false positives, which is much better than false negatives. + xMin = Math.floor(xMin / this.tileSize); + yMin = Math.floor(yMin / this.tileSize); + xMax = Math.ceil(xMax / this.tileSize); + yMax = Math.ceil(yMax / this.tileSize); + + if(xMin <= x && x < xMax && yMin <= y && y < yMax) + return true; + } + + return false; + } +}; +Sys.Extended.UI.Seadragon.DziTileSource.registerClass('Sys.Extended.UI.Seadragon.DziTileSource', Sys.Extended.UI.Seadragon.TileSource); +Sys.Extended.UI.Seadragon._DziTileSourceHelper = function() { + +}; +Sys.Extended.UI.Seadragon._DziTileSourceHelper.prototype = { + createFromXml: function(xmlUrl, xmlString, callback) { + var async = typeof (callback) == "function", + error = null; + + if(!xmlUrl) { + this.error = Seadragon.Strings.getString("Errors.Empty"); + if(async) { + window.setTimeout(function() { + callback(null, error); + }, 1); + return null; + } + throw new Sys.Extended.UI.Seadragon.DziError(error); + } + + // extract tile url + var urlParts = xmlUrl.split('/'), + filename = urlParts[urlParts.length - 1], + lastDot = filename.lastIndexOf('.'); + + if(lastDot > -1) + urlParts[urlParts.length - 1] = filename.slice(0, lastDot); + + var tilesUrl = urlParts.join('/') + "_files/"; + function finish(func, obj) { + try { + return func(obj, tilesUrl); + } catch(e) { + if(async) { + error = this.getError(e).message; + return null; + } else { + throw this.getError(e); + } + } + } + + if(async) { + if(xmlString) { + var handler = Function.createDelegate(this, this.processResponse); + window.setTimeout(function() { + var source = finish(handler, Seadragon.Utils.parseXml(xmlString)); + callback(source, error); // call after finish sets error + }, 1); + } else { + var handler = Function.createDelegate(this, this.processResponse); + Seadragon.Utils.makeAjaxRequest(xmlUrl, function(xhr) { + var source = finish(handler, xhr); + callback(source, error); // call after finish sets error + }); + } + + return null; + } + + // synchronous version + if(xmlString) + return finish(Function.createDelegate(this, this.processXml), Seadragon.Utils.parseXml(xmlString)); + else + return finish(Function.createDelegate(this, this.processResponse), Seadragon.Utils.makeAjaxRequest(xmlUrl)); + }, + processResponse: function(xhr, tilesUrl) { + if(!xhr) { + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Security")); + } else if(xhr.status !== 200 && xhr.status !== 0) { + // chrome has bug where it sends "OK" for 404 + var status = xhr.status; + var statusText = (status == 404) ? "Not Found" : xhr.statusText; + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Status", status, statusText)); + } + + var doc = null; + + if(xhr.responseXML && xhr.responseXML.documentElement) + doc = xhr.responseXML; + else if(xhr.responseText) + doc = Seadragon.Utils.parseXml(xhr.responseText); + + return this.processXml(doc, tilesUrl); + }, + + processXml: function(xmlDoc, tilesUrl) { + if(!xmlDoc || !xmlDoc.documentElement) + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Xml")); + + var root = xmlDoc.documentElement, + rootName = root.tagName; + + if(rootName == "Image") + try { + return this.processDzi(root, tilesUrl); + } catch(e) { + var defMsg = Seadragon.Strings.getString("Errors.Dzi"); + throw (e instanceof Sys.Extended.UI.Seadragon.DziError) ? e : new Sys.Extended.UI.Seadragon.DziError(defMsg); + } + else if(rootName == "Collection") + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Dzc")); + else if(rootName == "Error") + return this.processError(root); + + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Dzi")); + }, + + processDzi: function(imageNode, tilesUrl) { + var fileFormat = imageNode.getAttribute("Format"); + + if(!Seadragon.Utils.imageFormatSupported(fileFormat)) + throw new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.ImageFormat", fileFormat.toUpperCase())); + + var sizeNode = imageNode.getElementsByTagName("Size")[0], + dispRectNodes = imageNode.getElementsByTagName("DisplayRect"); + + var width = parseInt(sizeNode.getAttribute("Width"), 10), + height = parseInt(sizeNode.getAttribute("Height"), 10), + tileSize = parseInt(imageNode.getAttribute("TileSize")), + tileOverlap = parseInt(imageNode.getAttribute("Overlap")), + dispRects = []; + + for(var i = 0; i < dispRectNodes.length; i++) { + var dispRectNode = dispRectNodes[i], + rectNode = dispRectNode.getElementsByTagName("Rect")[0]; + + dispRects.push(new Seadragon.DisplayRect( + parseInt(rectNode.getAttribute("X"), 10), + parseInt(rectNode.getAttribute("Y"), 10), + parseInt(rectNode.getAttribute("Width"), 10), + parseInt(rectNode.getAttribute("Height"), 10), + 0, // ignore MinLevel attribute, bug in Deep Zoom Composer + parseInt(dispRectNode.getAttribute("MaxLevel"), 10) + )); + } + return new Sys.Extended.UI.Seadragon.DziTileSource(width, height, tileSize, tileOverlap, + tilesUrl, fileFormat, dispRects); + }, + + processError: function(errorNode) { + var messageNode = errorNode.getElementsByTagName("Message")[0], + message = messageNode.firstChild.nodeValue; + + throw new Sys.Extended.UI.Seadragon.DziError(message); + }, + getError: function(e) { + if(!(e instanceof DziError)) { + // shouldn't happen, but if it does, fail fast or at least log it + Seadragon.Debug.error(e.name + " while creating DZI from XML: " + e.message); + e = new Sys.Extended.UI.Seadragon.DziError(Seadragon.Strings.getString("Errors.Unknown")); + } + + } +}; +//Static objects +Sys.Extended.UI.Seadragon.DziTileSourceHelper = new Sys.Extended.UI.Seadragon._DziTileSourceHelper(); + +Sys.Extended.UI.Seadragon.Rect = function(x, y, width, height) { + // Properties + this.x = typeof (x) == "number" ? x : 0; + this.y = typeof (y) == "number" ? y : 0; + this.width = typeof (width) == "number" ? width : 0; + this.height = typeof (height) == "number" ? height : 0; +}; +Sys.Extended.UI.Seadragon.Rect.prototype = { + getAspectRatio: function() { + return this.width / this.height; + }, + + getTopLeft: function() { + return new Sys.Extended.UI.Seadragon.Point(this.x, this.y); + }, + + getBottomRight: function() { + return new Sys.Extended.UI.Seadragon.Point(this.x + this.width, this.y + this.height); + }, + + getCenter: function() { + return new Sys.Extended.UI.Seadragon.Point(this.x + this.width / 2.0, this.y + this.height / 2.0); + }, + + getSize: function() { + return new Sys.Extended.UI.Seadragon.Point(this.width, this.height); + }, + + equals: function(other) { + return (other instanceof Seadragon.Rect) && + (this.x === other.x) && (this.y === other.y) && + (this.width === other.width) && (this.height === other.height); + }, + + toString: function() { + return "[" + this.x + "," + this.y + "," + this.width + "x" + this.height + "]"; + } +}; +Sys.Extended.UI.Seadragon.Rect.registerClass('Sys.Extended.UI.Seadragon.Rect', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Job = function(src, callback) { + this._image = null; + this._timeout = null; + this._src = src; + this._callback = callback; + this.TIMEOUT = 5000; +}; +Sys.Extended.UI.Seadragon.Job.prototype = { + _finish: function(success) { + this._image.onload = null; + this._image.onabort = null; + this._image.onerror = null; + + if(this._timeout) + window.clearTimeout(this._timeout); + + // call on a timeout to ensure asynchronous behavior + var image = this._image, + callback = this._callback; + + window.setTimeout(function() { + callback(this._src, success ? image : null); + }, 1); + }, + _onloadHandler: function() { + this._finish(true); + }, + _onerrorHandler: function() { + this._finish(false); + }, + start: function() { + this._image = new Image(); + this._image.onload = Function.createDelegate(this, this._onloadHandler); + this._image.onabort = Function.createDelegate(this, this._onerrorHandler); + this._image.onerror = Function.createDelegate(this, this._onerrorHandler); + + // consider it a failure if the image times out. + this._timeout = window.setTimeout(Function.createDelegate(this, this._onerrorHandler), this.TIMEOUT); + + this._image.src = this._src; + } +}; +Sys.Extended.UI.Seadragon.Job.registerClass('Sys.Extended.UI.Seadragon.Job', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.ImageLoader = function(imageLoaderLimit) { + this._downloading = 0; + this.imageLoaderLimit = imageLoaderLimit; +}; +Sys.Extended.UI.Seadragon.ImageLoader.prototype = { + _onComplete: function(callback, src, image) { + this._downloading--; + if(typeof (callback) == "function") + try { + callback(image); + } catch(e) { + Seadragon.Debug.error(e.name + " while executing " + src + " callback: " + e.message, e); + } + }, + loadImage: function(src, callback) { + if(this._downloading >= this.imageLoaderLimit) + return false; + + var func = Seadragon.Utils.createCallback(null, Function.createDelegate(this, this._onComplete), callback), + job = new Sys.Extended.UI.Seadragon.Job(src, func); + + this._downloading++; + job.start(); + + return true; + } +}; +Sys.Extended.UI.Seadragon.ImageLoader.registerClass('Sys.Extended.UI.Seadragon.ImageLoader', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Profiler = function() { + this._midUpdate = false; + this._numUpdates = 0; + + this._lastBeginTime = null; + this._lastEndTime = null; + + this._minUpdateTime = Infinity; + this._avgUpdateTime = 0; + this._maxUpdateTime = 0; + + this._minIdleTime = Infinity; + this._avgIdleTime = 0; + this._maxIdleTime = 0; +}; +Sys.Extended.UI.Seadragon.Profiler.prototype = { + // Methods -- UPDATE TIME ACCESSORS + + getAvgUpdateTime: function() { + return this._avgUpdateTime; + }, + + getMinUpdateTime: function() { + return this._minUpdateTime; + }, + + getMaxUpdateTime: function() { + return this._maxUpdateTime; + }, + + // Methods -- IDLING TIME ACCESSORS + + getAvgIdleTime: function() { + return this._avgIdleTime; + }, + + getMinIdleTime: function() { + return this._minIdleTime; + }, + + getMaxIdleTime: function() { + return this._maxIdleTime; + }, + + // Methods -- GENERAL ACCESSORS + + isMidUpdate: function() { + return this._midUpdate; + }, + + getNumUpdates: function() { + return this._numUpdates; + }, + + // Methods -- MODIFIERS + + beginUpdate: function() { + if(this._midUpdate) + this.endUpdate(); + + this._midUpdate = true; + this._lastBeginTime = new Date().getTime(); + + if(this._numUpdates < 1) + return; // this is the first update + + var time = this._lastBeginTime - this._lastEndTime; + + this._avgIdleTime = (this._avgIdleTime * (this._numUpdates - 1) + time) / this._numUpdates; + + if(time < this._minIdleTime) + this._minIdleTime = time; + if(time > this._maxIdleTime) + this._maxIdleTime = time; + }, + + endUpdate: function() { + if(!this._midUpdate) + return; + + this._lastEndTime = new Date().getTime(); + this._midUpdate = false; + + var time = this._lastEndTime - this._lastBeginTime; + + this._numUpdates++; + this._avgUpdateTime = (this._avgUpdateTime * (this._numUpdates - 1) + time) / this._numUpdates; + + if(time < this._minUpdateTime) + this._minUpdateTime = time; + if(time > this._maxUpdateTime) + this._maxUpdateTime = time; + }, + + clearProfile: function() { + this._midUpdate = false; + this._numUpdates = 0; + + this._lastBeginTime = null; + this._lastEndTime = null; + + this._minUpdateTime = Infinity; + this._avgUpdateTime = 0; + this._maxUpdateTime = 0; + + this._minIdleTime = Infinity; + this._avgIdleTime = 0; + this._maxIdleTime = 0; + } +}; +Sys.Extended.UI.Seadragon.Profiler.registerClass('Sys.Extended.UI.Seadragon.Profiler', null, Sys.IDisposable); + +Seadragon.Spring = Sys.Extended.UI.Seadragon.Spring = function(initialValue, config) { + this._currentValue = typeof (initialValue) == "number" ? initialValue : 0; + this._startValue = this._currentValue; + this._targetValue = this._currentValue; + this.config = config; + + this._currentTime = new Date().getTime(); // always work in milliseconds + this._startTime = this._currentTime; + this._targetTime = this._currentTime; +}; +Sys.Extended.UI.Seadragon.Spring.prototype = { + _transform: function(x) { + var s = this.config.springStiffness; + return (1.0 - Math.exp(-x * s)) / (1.0 - Math.exp(-s)); + }, + getCurrent: function() { + return this._currentValue; + }, + + getTarget: function() { + return this._targetValue; + }, + + resetTo: function(target) { + this._targetValue = target; + this._targetTime = this._currentTime; + this._startValue = this._targetValue; + this._startTime = this._targetTime; + }, + + springTo: function(target) { + this._startValue = this._currentValue; + this._startTime = this._currentTime; + this._targetValue = target; + this._targetTime = this._startTime + 1000 * this.config.animationTime; + }, + + shiftBy: function(delta) { + this._startValue += delta; + this._targetValue += delta; + }, + + update: function() { + this._currentTime = new Date().getTime(); + this._currentValue = (this._currentTime >= this._targetTime) ? this._targetValue : + this._startValue + (this._targetValue - this._startValue) * + this._transform((this._currentTime - this._startTime) / (this._targetTime - this._startTime)); + } +}; +Sys.Extended.UI.Seadragon.Spring.registerClass('Sys.Extended.UI.Seadragon.Spring', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.Viewport = function(containerSize, contentSize, config) { + this.zoomPoint = null; + this.config = config; + this._containerSize = containerSize; + this._contentSize = contentSize; + this._contentAspect = contentSize.x / contentSize.y; + this._contentHeight = contentSize.y / contentSize.x; + this._centerSpringX = new Seadragon.Spring(0, this.config); + this._centerSpringY = new Seadragon.Spring(0, this.config); + this._zoomSpring = new Seadragon.Spring(1, this.config); + this._homeBounds = new Sys.Extended.UI.Seadragon.Rect(0, 0, 1, this._contentHeight); + this.goHome(true); + this.update(); +}; +Sys.Extended.UI.Seadragon.Viewport.prototype = { + _getHomeZoom: function() { + var aspectFactor = this._contentAspect / this.getAspectRatio(); + // if content is wider, we'll fit width, otherwise height + return (aspectFactor >= 1) ? 1 : aspectFactor; + }, + + _getMinZoom: function() { + var homeZoom = this._getHomeZoom(); + + // for backwards compatibility, respect minZoomDimension if present + if(this.config.minZoomDimension) + var zoom = (this._contentSize.x <= this._contentSize.y) ? + this.config.minZoomDimension / this._containerSize.x : + this.config.minZoomDimension / (this._containerSize.x * this._contentHeight); + else + var zoom = this.config.minZoomImageRatio * homeZoom; + + return Math.min(zoom, homeZoom); + }, + + _getMaxZoom: function() { + var zoom = this._contentSize.x * this.config.maxZoomPixelRatio / this._containerSize.x; + return Math.max(zoom, this._getHomeZoom()); + }, + + /// + /// Returns viewport aspect ratio + /// + /// Aspect ratio + /// + getAspectRatio: function() { + return this._containerSize.x / this._containerSize.y; + }, + + /// + /// Returns viewport container size + /// + /// Container size + /// + getContainerSize: function() { + return new Sys.Extended.UI.Seadragon.Point(this._containerSize.x, this._containerSize.y); + }, + + /// + /// Returns viewport bounds + /// + /// Viewport bounds + /// + getBounds: function(current) { + var center = this.getCenter(current), + width = 1.0 / this.getZoom(current), + height = width / this.getAspectRatio(); + + return new Sys.Extended.UI.Seadragon.Rect(center.x - width / 2.0, center.y - height / 2.0, width, height); + }, + + /// + /// Returns viewport center point + /// + /// Viewport center point + /// + getCenter: function(current) { + var centerCurrent = new Sys.Extended.UI.Seadragon.Point(this._centerSpringX.getCurrent(), this._centerSpringY.getCurrent()), + centerTarget = new Sys.Extended.UI.Seadragon.Point(this._centerSpringX.getTarget(), this._centerSpringY.getTarget()); + + if(current) + return centerCurrent; + else if(!this.zoomPoint) + // no adjustment necessary since we're not zooming + return centerTarget; + + // to get the target center, we need to adjust for the zoom point. + // we'll do this in the same way as the update() method. + var oldZoomPixel = this.pixelFromPoint(this.zoomPoint, true); + + // manually calculate bounds based on this unadjusted target center. + // this is mostly a duplicate of getBounds() above. note that this is + // based on the TARGET zoom but the CURRENT center. + var zoom = this.getZoom(), + width = 1.0 / zoom, + height = width / this.getAspectRatio(), + bounds = new Sys.Extended.UI.Seadragon.Rect(centerCurrent.x - width / 2.0, centerCurrent.y - height / 2.0, width, height); + + // the conversions here are identical to the pixelFromPoint() and + // deltaPointsFromPixels() methods. + var newZoomPixel = this.zoomPoint.minus(bounds.getTopLeft()).times(this._containerSize.x / bounds.width), + deltaZoomPixels = newZoomPixel.minus(oldZoomPixel), + deltaZoomPoints = deltaZoomPixels.divide(this._containerSize.x * zoom); + + // finally, shift center to negate the change. + return centerTarget.plus(deltaZoomPoints); + }, + + /// + /// Returns viewport current zoom level + /// + /// Viewport current zoom level + /// + getZoom: function(current) { + if(current) + return this._zoomSpring.getCurrent(); + else + return this._zoomSpring.getTarget(); + }, + + // Methods -- MODIFIERS + + applyConstraints: function(immediately) { + // first, apply zoom constraints + var actualZoom = this.getZoom(); + var constrainedZoom = Math.max(Math.min(actualZoom, this._getMaxZoom()), this._getMinZoom()); + if(actualZoom != constrainedZoom) + this.zoomTo(constrainedZoom, this.zoomPoint, immediately); + + // then, apply pan constraints + var bounds = this.getBounds(), + visibilityRatio = this.config.visibilityRatio; + + // threshold in normalized coordinates + var horThres = visibilityRatio * bounds.width, + verThres = visibilityRatio * bounds.height; + + // amount visible in normalized coordinates + var left = bounds.x + bounds.width, + right = 1 - bounds.x, + top = bounds.y + bounds.height, + bottom = this._contentHeight - bounds.y; + + // adjust viewport horizontally -- in normalized coordinates! + var dx = 0; + if(this.config.wrapHorizontal) { } + // nothing to constrain + else if(left < horThres) + dx = horThres - left; + else if(right < horThres) + dx = right - horThres; + + // adjust viewport vertically -- in normalized coordinates! + var dy = 0; + if(this.config.wrapVertical) { } + // nothing to constrain + else if(top < verThres) + dy = verThres - top; + else if(bottom < verThres) + dy = bottom - verThres; + + // pan if we aren't zooming, otherwise set the zoom point if we are. + // we've already implemented logic in fitBounds() for this. + if(dx || dy) { + bounds.x += dx; + bounds.y += dy; + this.fitBounds(bounds, immediately); + } + }, + + ensureVisible: function(immediately) { + // for backwards compatibility + this.applyConstraints(immediately); + }, + + fitBounds: function(bounds, immediately) { + var aspect = this.getAspectRatio(), + center = bounds.getCenter(); + + // resize bounds to match viewport's aspect ratio, maintaining center. + // note that zoom = 1/width, and width = height*aspect. + var newBounds = new Sys.Extended.UI.Seadragon.Rect(bounds.x, bounds.y, bounds.width, bounds.height); + if(newBounds.getAspectRatio() >= aspect) { + // width is bigger relative to viewport, resize height + newBounds.height = bounds.width / aspect; + newBounds.y = center.y - newBounds.height / 2; + } else { + // height is bigger relative to viewport, resize width + newBounds.width = bounds.height * aspect; + newBounds.x = center.x - newBounds.width / 2; + } + + // stop movement first! this prevents the operation from missing + this.panTo(this.getCenter(true), true); + this.zoomTo(this.getZoom(true), null, true); + + // capture old values for bounds and width. we need both, but we'll + // also use both for redundancy, to protect against precision errors. + // note: use target bounds, since update() hasn't been called yet! + var oldBounds = this.getBounds(), + oldZoom = this.getZoom(); + + // if we're already at the correct zoom, just pan and we're done. + // we'll check both zoom and bounds for redundancy, to protect against + // precision errors (see note below). + var newZoom = 1.0 / newBounds.width; + if(newZoom == oldZoom || newBounds.width == oldBounds.width) { + this.panTo(center, immediately); + return; + } + + // otherwise, we need to zoom about the only point whose pixel transform + // is constant between the old and new bounds. this is just tricky math. + var refPoint = oldBounds.getTopLeft().times(this._containerSize.x / oldBounds.width).minus( + newBounds.getTopLeft().times(this._containerSize.x / newBounds.width)).divide( + this._containerSize.x / oldBounds.width - this._containerSize.x / newBounds.width); + + // note: that last line (cS.x / oldB.w - cS.x / newB.w) was causing a + // divide by 0 in the case that oldBounds.width == newBounds.width. + // that should have been picked up by the zoom check, but in certain + // cases, the math is slightly off and the zooms are different. so now, + // the zoom check has an extra check added. + this.zoomTo(newZoom, refPoint, immediately); + }, + + goHome: function(immediately) { + // calculate center adjusted for zooming + var center = this.getCenter(); + + // if we're wrapping horizontally, "unwind" the horizontal spring + if(this.config.wrapHorizontal) { + // this puts center.x into the range [0, 1) always + center.x = (1 + (center.x % 1)) % 1; + this._centerSpringX.resetTo(center.x); + this._centerSpringX.update(); + } + + // if we're wrapping vertically, "unwind" the vertical spring + if(this.config.wrapVertical) { + // this puts center.y into the range e.g. [0, 0.75) always + center.y = (this._contentHeight + (center.y % this._contentHeight)) % this._contentHeight; + this._centerSpringY.resetTo(center.y); + this._centerSpringY.update(); + } + + this.fitBounds(this._homeBounds, immediately); + }, + + panBy: function(delta, immediately) { + // this breaks if we call self.getCenter(), since that adjusts the + // center for zoom. we don't want that, so use the unadjusted center. + var center = new Sys.Extended.UI.Seadragon.Point(this._centerSpringX.getTarget(), + this._centerSpringY.getTarget()); + this.panTo(center.plus(delta), immediately); + }, + + panTo: function(center, immediately) { + if(immediately) { + this._centerSpringX.resetTo(center.x); + this._centerSpringY.resetTo(center.y); + } else { + this._centerSpringX.springTo(center.x); + this._centerSpringY.springTo(center.y); + } + }, + + zoomBy: function(factor, refPoint, immediately) { + this.zoomTo(this._zoomSpring.getTarget() * factor, refPoint, immediately); + }, + + zoomTo: function(zoom, refPoint, immediately) { + // we used to constrain zoom automatically here; now it needs to be + // explicitly constrained, via applyConstraints(). + //zoom = Math.max(zoom, getMinZoom()); + //zoom = Math.min(zoom, getMaxZoom()); + + if(immediately) + this._zoomSpring.resetTo(zoom); + else + this._zoomSpring.springTo(zoom); + + this.zoomPoint = refPoint instanceof Sys.Extended.UI.Seadragon.Point ? refPoint : null; + }, + + resize: function(newContainerSize, maintain) { + // default behavior: just ensure the visible content remains visible. + // note that this keeps the center (relative to the content) constant. + var oldBounds = this.getBounds(), + newBounds = oldBounds, + widthDeltaFactor = newContainerSize.x / this._containerSize.x; + + // update container size, but make copy first + this._containerSize = new Sys.Extended.UI.Seadragon.Point(newContainerSize.x, newContainerSize.y); + + if(maintain) { + // no resize relative to screen, resize relative to viewport. + // keep origin constant, zoom out (increase bounds) by delta factor. + newBounds.width = oldBounds.width * widthDeltaFactor; + newBounds.height = newBounds.width / this.getAspectRatio(); + } + + this.fitBounds(newBounds, true); + }, + + update: function() { + var oldCenterX = this._centerSpringX.getCurrent(), + oldCenterY = this._centerSpringY.getCurrent(), + oldZoom = this._zoomSpring.getCurrent(); + + // remember position of zoom point + if(this.zoomPoint) + var oldZoomPixel = this.pixelFromPoint(this.zoomPoint, true); + + // now update zoom only, don't update pan yet + this._zoomSpring.update(); + + // adjust for change in position of zoom point, if we've zoomed + if(this.zoomPoint && this._zoomSpring.getCurrent() != oldZoom) { + var newZoomPixel = this.pixelFromPoint(this.zoomPoint, true), + deltaZoomPixels = newZoomPixel.minus(oldZoomPixel), + deltaZoomPoints = this.deltaPointsFromPixels(deltaZoomPixels, true); + + // shift pan to negate the change + this._centerSpringX.shiftBy(deltaZoomPoints.x); + this._centerSpringY.shiftBy(deltaZoomPoints.y); + } else { + // don't try to adjust next time; this improves performance + this.zoomPoint = null; + } + + // now after adjustment, update pan + this._centerSpringX.update(); + this._centerSpringY.update(); + + return this._centerSpringX.getCurrent() != oldCenterX || + this._centerSpringY.getCurrent() != oldCenterY || + this._zoomSpring.getCurrent() != oldZoom; + }, + + // Methods -- CONVERSION HELPERS + + deltaPixelsFromPoints: function(deltaPoints, current) { + return deltaPoints.times(this._containerSize.x * this.getZoom(current)); + }, + + deltaPointsFromPixels: function(deltaPixels, current) { + return deltaPixels.divide(this._containerSize.x * this.getZoom(current)); + }, + + pixelFromPoint: function(point, current) { + var bounds = this.getBounds(current); + return point.minus(bounds.getTopLeft()).times(this._containerSize.x / bounds.width); + }, + + pointFromPixel: function(pixel, current) { + var bounds = this.getBounds(current); + return pixel.divide(this._containerSize.x / bounds.width).plus(bounds.getTopLeft()); + } +}; +Sys.Extended.UI.Seadragon.Viewport.registerClass('Sys.Extended.UI.Seadragon.Viewport', null, Sys.IDisposable); + +Sys.Extended.UI.Seadragon.DisplayRect = function(x, y, width, height, minLevel, maxLevel) { + Sys.Extended.UI.Seadragon.DisplayRect.initializeBase(this, [x, y, width, height]); + + this.minLevel = minLevel; + this.maxLevel = maxLevel; +}; +Sys.Extended.UI.Seadragon.DisplayRect.registerClass('Sys.Extended.UI.Seadragon.DisplayRect', Sys.Extended.UI.Seadragon.Rect); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/SlideShow.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/SlideShow.debug.js new file mode 100644 index 000000000..d3e5610af --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/SlideShow.debug.js @@ -0,0 +1,1265 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.SlideShowBehavior = function(element) { + Sys.Extended.UI.SlideShowBehavior.initializeBase(this, [element]); + // Properties + this._nextButtonID = null; + this._previousButtonID = null; + this._imageDescriptionLabelID = null; + this._imageTitleLabelID = null; + this._playButtonID = null; + this._playButtonValue = '||>'; + this._stopButtonValue = '[]'; + this._slideShowServicePath = location.pathname; + this._slideShowServiceMethod = null; + this._contextKey = null; + this._useContextKey = false; + this._playInterval = 3000; + this._tickHandler = null; + this._loop = false; + this._autoPlay = false; + this._slideShowAnimationType = Sys.Extended.UI.SlideShowAnimationType.None; + this._imageHeight = 300; + this._imageWidth = 400; + + // Variables + this._inPlayMode = false; + this._elementImage = null; + this._bNext = null; + this._bPrevious = null; + this._currentIndex = -1; + this._currentValue = null; + this._imageDescriptionLabel = null; + this._imageTitleLabel = null; + this._bPlay = null; + this._slides = null; + this._timer = null; + this._currentImageElement = null; + this._images = null; + this._cachedImageIndex = -1; + this._current = 0; + this._previousImage = null; + this._currentImage = null; + this._nextImage = null; + this._isNext = false; + + // Delegates + this._clickNextHandler = null; + this._clickPreviousHandler = null; + this._clickPlayHandler = null; + this._tickHandler = null; + this._imageLoadedHandler = null; +} + +Sys.Extended.UI.SlideShowBehavior.prototype = { + initialize: function() { + + Sys.Extended.UI.SlideShowBehavior.callBaseMethod(this, 'initialize'); + var e = this.get_element(); + this._elementImage = e; + + // check if browser supports animation or not. + if(!this.supportsAnimation('transition')) + this._slideShowAnimationType = Sys.Extended.UI.SlideShowAnimationType.None; + + if(this._slideShowAnimationType != Sys.Extended.UI.SlideShowAnimationType.SlideRight || + this._slideShowAnimationType != Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + + // create an invisible img element + this._currentImageElement = document.createElement('IMG'); + this._currentImageElement.style.display = 'none'; + document.body.appendChild(this._currentImageElement); + + //Create a new parent for Image + var _divContent = document.createElement('DIV'); + e.parentNode.insertBefore(_divContent, e); + e.parentNode.removeChild(e); + _divContent.appendChild(e); + _divContent.align = 'center'; + + this._imageLoadedHandler = Function.createDelegate(this, this._onImageLoaded); + $addHandler(this._currentImageElement, 'load', this._imageLoadedHandler); + } + + this.controlsSetup(); + // Create handlers for slideshow buttons clicks events and for image loaded events. + if(this._bNext) { + this._clickNextHandler = Function.createDelegate(this, this._onClickNext); + $addHandler(this._bNext, 'click', this._clickNextHandler); + } + if(this._bPrevious) { + this._clickPreviousHandler = Function.createDelegate(this, this._onClickPrevious); + $addHandler(this._bPrevious, 'click', this._clickPreviousHandler); + } + if(this._bPlay) { + this._clickPlayHandler = Function.createDelegate(this, this._onClickPlay); + $addHandler(this._bPlay, 'click', this._clickPlayHandler); + } + + // init slideshow + this._slideShowInit(); + }, + + dispose: function() { + if(this._clickNextHandler) { + $removeHandler(this._bNext, 'click', this._clickNextHandler); + this._clickNextHandler = null; + } + if(this._clickPreviousHandler) { + $removeHandler(this._bPrevious, 'click', this._clickPreviousHandler); + this._clickPreviousHandler = null; + } + if(this._clickPlayHandler) { + $removeHandler(this._bPlay, 'click', this._clickPlayHandler); + this._clickPlayHandler = null; + } + if(this._imageLoadedHandler) { + $removeHandler(this._currentImageElement, 'load', this._imageLoadedHandler); + this._imageLoadedHandler = null; + } + if(this._timer) { + this._timer.dispose(); + this._timer = null; + } + Sys.Extended.UI.SlideShowBehavior.callBaseMethod(this, 'dispose'); + }, + + /// + /// Fires when a slide changes + /// + /// + /// + add_slideChanged: function(handler) { + this.get_events().addHandler('slideChanged', handler); + }, + remove_slideChanged: function(handler) { + this.get_events().removeHandler('slideChanged', handler); + }, + raise_slideChanged: function(eventArgs) { + var handler = this.get_events().getHandler('slideChanged'); + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + handler(this, eventArgs); + } + }, + raiseSlideChanged: function(eventArgs) { + Sys.Extended.Deprecated("raiseSlideChanged(eventArgs)", "raise_slideChanged(eventArgs)"); + this.raise_slideChanged(eventArgs); + }, + + /// + /// Fires when a slide begins to change + /// + /// + /// + add_slideChanging: function(handler) { + this.get_events().addHandler('slideChanging', handler); + }, + remove_slideChanging: function(handler) { + this.get_events().removeHandler('slideChanging', handler); + }, + raise_slideChanging: function(previousSlide, newSlide) { + var handler = this.get_events().getHandler('slideChanging'); + if(handler) { + var eventArgs = new Sys.Extended.UI.SlideShowEventArgs(previousSlide, newSlide, this._currentIndex); + handler(this, eventArgs); + return eventArgs.get_cancel(); + } + return false; + }, + raiseSlideChanging: function(previousSlide, newSlide) { + Sys.Extended.Deprecated("raiseSlideChanging(previousSlide, newSlide)", "raise_slideChanging(previousSlide, newSlide)"); + return this.raise_slideChanging(previousSlide, newSlide); + }, + + /// + /// User/page specific context provided to an optional overload of the web + /// method described by ServiceMethod/ServicePath + /// + /// + /// If the context key is used, it should have the same signature with an + /// additional parameter named contextKey of the string type + /// + /// get_contextKey + /// set_contextKey + /// + get_contextKey: function() { + return this._contextKey; + }, + set_contextKey: function(value) { + if(this._contextKey != value) { + this._contextKey = value; + this.set_useContextKey(true); + // if initialize has not been called + // then do not reset the slideshow. + if(this._elementImage) + this._slideShowInit(); + this.raisePropertyChanged('contextKey'); + } + }, + + /// + /// Whether or not the ContextKey property should be used + /// + /// + /// This will be automatically enabled if the ContextKey property is ever set + /// (on either the client or the server). If the context key is used, it should have + /// the same signature with an additional parameter named contextKey of the string type + /// + /// get_useContextKey + /// set_useContextKey + /// + get_useContextKey: function() { + return this._useContextKey; + }, + set_useContextKey: function(value) { + if(this._useContextKey != value) { + this._useContextKey = value; + this.raisePropertyChanged('useContextKey'); + } + }, + + /// + /// Width of the image container to animate slides smoothly from left to right or right to left + /// + /// get_imageWidth + /// set_imageWidth + /// + get_imageWidth: function() { + // To fix the size of container to display slides smoothly. + return this._imageWidth; + }, + set_imageWidth: function(value) { + if(this._imageWidth != value) { + this._imageWidth = value; + this.raisePropertyChanged('imageWidth'); + } + }, + + /// + /// Height of the image container to animate slides smoothly from up to down or down to up + /// + /// get_imageHeight + /// set_imageHeight + /// + get_imageHeight: function() { + // To fix the size of container to display slides smoothly. + return this._imageHeight; + }, + set_imageHeight: function(value) { + if(this._imageHeight != value) { + this._imageHeight = value; + this.raisePropertyChanged('imageHeight'); + } + }, + + /// + /// Gets handles to various slideshow controls if specified + /// + /// + controlsSetup: function() { + if(this._previousButtonID) { + this._bPrevious = document.getElementById(this._previousButtonID); + } + if(this._imageDescriptionLabelID) { + this._imageDescriptionLabel = document.getElementById(this._imageDescriptionLabelID); + } + if(this._imageTitleLabelID) { + this._imageTitleLabel = document.getElementById(this._imageTitleLabelID); + } + if(this._nextButtonID) { + this._bNext = document.getElementById(this._nextButtonID); + } + if(this._playButtonID) { + this._bPlay = document.getElementById(this._playButtonID); + this._bPlay.value = this._playButtonValue; + } + }, + + /// + /// Maintains various button states + /// + /// + resetButtons: function() { + if(!this._loop) { + // at the last slide + if(this._slides.length <= this._currentIndex + 1) { + if(this._bNext) this._bNext.disabled = true; + if(this._bPlay) this._bPlay.disabled = true; + if(this._bPrevious) this._bPrevious.disabled = false; + + // turn off play mode if on + this._inPlayMode = false; + if(this._timer) + this._timer.set_enabled(false); + if(this._bPlay) + this._bPlay.value = this._playButtonValue; + + } else { + if(this._bNext) + this._bNext.disabled = false; + if(this._bPlay) + this._bPlay.disabled = false; + } + // at the first slide + if(this._currentIndex <= 0) { + if(this._bPrevious) + this._bPrevious.disabled = true; + } else { + if(this._bPrevious) + this._bPrevious.disabled = false; + } + } + else { + if(this._slides.length == 0) { + if(this._bPrevious) + this._bPrevious.disabled = true; + if(this._bNext) + this._bNext.disabled = true; + if(this._bPlay) + this._bPlay.disabled = true; + } + } + if(this._inPlayMode) { + // restart timer + this._timer.set_enabled(false); + this._timer.set_enabled(true); + } + }, + + /// + /// Maintains the play button state to reflect whether the slideshow is in play mode + /// + /// + resetSlideShowButtonState: function() { + if(this._inPlayMode) { + if(this._bPlay) + this._bPlay.value = this._stopButtonValue; + } + else { + this.resetButtons(); + if(this._bPlay) + this._bPlay.value = this._playButtonValue; + } + }, + + /// + /// Maintains a slideshow current image + /// + /// + setCurrentImage: function() { + if(this._slides[this._currentIndex]) { + this._currentImageElement.src = this._slides[this._currentIndex].ImagePath; + if(this._slides[this._currentIndex].Url != null) { + this._currentImageElement.style.cursor = 'pointer'; + this._currentImageElement.onclick = function() { window.open(this._slides[this._currentIndex].Url); }; + } + else { + this._currentImageElement.style.cursor = 'auto'; + this._currentImageElement.onclick = function() { }; + } + } else { + this._currentImageElement.src = ''; + } + if(Sys.Browser.agent == Sys.Browser.Opera) { + // call the handler explicitly for opera + this._onImageLoaded(true); + } + }, + + _getXYPosition: function(element) { + if (!element) + return { x : 0, y : 0 }; + + var xy = { + "x" : element.offsetLeft, + "y" : element.offsetTop + } + + var parent = this._getXYPosition(element.offsetParent); + for (var key in parent) + xy[key] += parent[key]; + + return xy; + }, + + _placeImageOver: function(underImage, overImage) { + overImage.style.border = null; + overImage.style.position = "absolute"; + + var coordinates = this._getXYPosition(underImage); + var x = coordinates.x; + var y = coordinates.y; + + overImage.style.left = x + "px"; + overImage.style.top = y + "px"; + overImage.alt = ""; + + overImage.style.marginLeft = "1px"; + overImage.style.marginTop = "1px"; + + underImage.parentNode.appendChild(overImage); + }, + + _fadeIn: function(image) { + image.className += " invisible"; + setTimeout(function() { + image.className = "ajax__slide_show_fadeIn"; + }, 20); + }, + + _fadeOut: function(image) { + image.className += " visible"; + setTimeout(function() { + image.className = "ajax__slide_show_fadeOut"; + }, 20); + }, + + /// + /// Updates a slideshow current image + /// + /// Image to update + /// + updateImage: function(value) { + if(value) { + if(this.raise_slideChanging(this._currentValue, value)) + return; + + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.FadeInOut) { + var fadeOutImage = this._elementImage.cloneNode(), + fadeInImage = this._elementImage; + + this._placeImageOver(fadeInImage, fadeOutImage); + + this.setImage(value); + + this._fadeIn(fadeInImage); + this._fadeOut(fadeOutImage); + + setTimeout(function() { + fadeInImage.parentNode.removeChild(fadeOutImage); + }, 1000); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.ScaleX) { + this._elementImage.className = "ajax__slide_show_Animation ajax__slide_show_scaleX"; + var me = this; + setTimeout(function() { + me._elementImage.className = "ajax__slide_show_Animation"; + me.setImage(value); + }, 1000); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.ScaleY) { + this._elementImage.className = "ajax__slide_show_Animation ajax__slide_show_scaleY"; + var me = this; + setTimeout(function() { + me._elementImage.className = "ajax__slide_show_Animation"; + me.setImage(value); + }, 1000); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.ZoomInOut) { + this._elementImage.className = "ajax__slide_show_Animation ajax__slide_show_zoomOut"; + var me = this; + setTimeout(function() { + me._elementImage.className = "ajax__slide_show_Animation ajax__slide_show_zoomIn"; + me.setImage(value); + }, 1000); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.Rotate) { + this._elementImage.className = "ajax__slide_show_Animation ajax__slide_show_rotate"; + var me = this; + setTimeout(function() { + me._elementImage.className = "ajax__slide_show_Animation"; + me.setImage(value); + }, 1000); + } + else { + this.setImage(value); + } + } + }, + + /// + /// Sets a slideshow image + /// + /// Image to set + /// + setImage: function(value) { + this._currentValue = value; + + this._elementImage.src = value.ImagePath; + this._elementImage.alt = value.Name; + + if(this._imageDescriptionLabel) + this._imageDescriptionLabel.innerHTML = value.Description || ""; + + if(this._imageTitleLabel) + this._imageTitleLabel.innerHTML = value.Name || ""; + + if(value.Url) { + this._elementImage.style.cursor = 'pointer'; + this._elementImage.onclick = function() { window.open(value.Url); } + } else { + this._elementImage.style.cursor = 'auto'; + this._elementImage.onclick = function() { } + } + + this.raise_slideChanged(value); + this.resetButtons(); + }, + + /// + /// ID of Label describing the current picture + /// + /// get_imageDescriptionLabelID + /// set_imageDescriptionLabelID + /// + get_imageDescriptionLabelID: function() { + return this._imageDescriptionLabelID; + }, + set_imageDescriptionLabelID: function(value) { + if(this._imageDescriptionLabelID != value) { + this._imageDescriptionLabelID = value; + this.raisePropertyChanged('imageDescriptionLabelID'); + } + }, + + /// + /// ID of Label displaying the current picture's title + /// + /// get_imageTitleLabelID + /// set_imageTitleLabelID + /// + get_imageTitleLabelID: function() { + return this._imageTitleLabelID; + }, + set_imageTitleLabelID: function(value) { + if(this._imageTitleLabelID != value) { + this._imageTitleLabelID = value; + this.raisePropertyChanged('imageTitleLabelID'); + } + }, + + /// + /// ID of the button that will allow you to see the next picture + /// + /// get_nextButtonID + /// set_nextButtonID + /// + get_nextButtonID: function() { + return this._nextButtonID; + }, + set_nextButtonID: function(value) { + if(this._nextButtonID != value) { + this._nextButtonID = value; + this.raisePropertyChanged('nextButtonID'); + } + }, + + /// + /// ID of the button that will allow you to play/stop the slideshow + /// + /// get_playButtonID + /// set_playButtonID + /// + get_playButtonID: function() { + return this._playButtonID; + }, + set_playButtonID: function(value) { + if(this._playButtonID != value) { + this._playButtonID = value; + this.raisePropertyChanged('playButtonID'); + } + }, + + /// + /// The text to be shown in the play button to play the slideshow + /// + /// get_playButtonText + /// set_playButtonText + /// + get_playButtonText: function() { + return this._playButtonValue; + }, + set_playButtonText: function(value) { + if(this._playButtonValue != value) { + this._playButtonValue = value; + this.raisePropertyChanged('playButtonText'); + } + }, + + /// + /// The text to be shown in the play button to stop the slideshow + /// + /// get_stopButtonText + /// set_stopButtonText + /// + get_stopButtonText: function() { + return this._stopButtonValue; + }, + set_stopButtonText: function(value) { + if(this._stopButtonValue != value) { + this._stopButtonValue = value; + this.raisePropertyChanged('stopButtonText'); + } + }, + + /// + /// An interval in milliseconds between slide transitions in play mode + /// + /// get_playInterval + /// set_playInterval + /// + get_playInterval: function() { + // Interval in milliseconds between slide switches. + return this._playInterval; + }, + set_playInterval: function(value) { + if(this._playInterval != value) { + this._playInterval = value; + this.raisePropertyChanged('playInterval'); + } + }, + + /// + /// ID of the button that will allow you to see the previous picture + /// + /// get_previousButtonID + /// set_previousButtonID + /// + get_previousButtonID: function() { + return this._previousButtonID; + }, + set_previousButtonID: function(value) { + if(this._previousButtonID != value) { + this._previousButtonID = value; + this.raisePropertyChanged('previousButtonID'); + } + }, + + /// + /// The path to the webservice that the extender will pull the images from + /// + /// get_slideShowServicePath + /// set_slideShowServicePath + /// + get_slideShowServicePath: function() { + return this._slideShowServicePath; + }, + + set_slideShowServicePath: function(value) { + if(this._slideShowServicePath != value) { + this._slideShowServicePath = value; + this.raisePropertyChanged('slideShowServicePath'); + } + }, + + /// + /// The webservice method that will be called to supply images + /// + /// get_slideShowServiceMethod + /// set_slideShowServiceMethod + /// + get_slideShowServiceMethod: function() { + return this._slideShowServiceMethod; + }, + set_slideShowServiceMethod: function(value) { + if(this._slideShowServiceMethod != value) { + this._slideShowServiceMethod = value; + this.raisePropertyChanged('slideShowServiceMethod'); + } + }, + + /// + /// Setting it to true will allow displaying pictures in cycle + /// + /// get_loop + /// set_loop + /// + get_loop: function() { + return this._loop; + }, + set_loop: function(value) { + if(this._loop != value) { + this._loop = value; + this.raisePropertyChanged('loop'); + } + }, + + /// + /// Setting it to true will play the slideshow automatically on render + /// + /// get_autoPlay + /// set_autoPlay + /// + get_autoPlay: function() { + return this._autoPlay; + }, + set_autoPlay: function(value) { + if(this._autoPlay != value) { + this._autoPlay = value; + this.raisePropertyChanged('autoPlay'); + } + }, + + /// + /// Type of animation used on changing one slide to another + /// + /// + /// If you set SlideShowAnimationType to either SlideDown or SlideRight, then you must + /// set both the Height and Width properties on the Image control being extended by + /// the SlideShow extender + /// + /// get_slideShowAnimationType + /// set_slideShowAnimationType + /// + get_slideShowAnimationType: function() { + return this._slideShowAnimationType; + }, + set_slideShowAnimationType: function(value) { + if(this._slideShowAnimationType != value) { + this._slideShowAnimationType = value; + this.raisePropertyChanged('slideShowAnimationType'); + } + }, + + _onClickNext: function(e) { + // prevent server post-back for asp.net buttons. + e.preventDefault(); + e.stopPropagation(); + this._clickNext(); + }, + + _onImageLoaded: function(e) { + this.updateImage(this._slides[this._currentIndex]); + this.resetButtons(); + this._cacheImages(); + }, + + _clickNext: function() { + if(this._slides) { + if((this._currentIndex + 1) < this._slides.length) + ++this._currentIndex; + else if(this._loop) + this._currentIndex = 0; + else + return false; + + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || + this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._isNext = true; + this.setCurrentSlide(); + } + else { + this.setCurrentImage(); + } + return true; + } + return false; + }, + + _onClickPrevious: function(e) { + // prevent server post-back for asp.net buttons. + e.preventDefault(); + e.stopPropagation(); + this._clickPrevious(); + }, + + _clickPrevious: function() { + if(this._slides) { + if((this._currentIndex - 1) >= 0) + --this._currentIndex; + else if(this._loop) + this._currentIndex = this._slides.length - 1; + else + return false; + + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || + this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._isNext = false; + this.setCurrentSlide(); + } + else { + this.setCurrentImage(); + } + return true; + } + return false; + }, + + _onClickPlay: function(e) { + // prevent server post-back for asp.net buttons. + e.preventDefault(); + e.stopPropagation(); + this._play(); + }, + + _play: function() { + if(this._inPlayMode) { + this._inPlayMode = false; + this._timer.set_enabled(false); + this.resetSlideShowButtonState(); + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + if(this._bNext) + this._bNext.disabled = false; + if(this._bPrevious) + this._bPrevious.disabled = false; + } + } else { + // play the side show + this._inPlayMode = true; + if(!this._timer) { + this._timer = new Sys.Timer(); + this._timer.set_interval(this._playInterval); + this._tickHandler = Function.createDelegate(this, this._onPlay); + this._timer.add_tick(this._tickHandler); + } + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + if(this._bNext) + this._bNext.disabled = true; + if(this._bPrevious) + this._bPrevious.disabled = true; + } + this.resetSlideShowButtonState(); + this._timer.set_enabled(true); + } + }, + + _onPlay: function(e) { + if(this._slides) { + if((this._currentIndex + 1) < this._slides.length) { + ++this._currentIndex; + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || + this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._isNext = true; + this.setCurrentSlide(); + } + else { + this.setCurrentImage(); + } + return true; + } else if(this._loop) { + this._currentIndex = 0; + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight || + this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._isNext = true; + this.setCurrentSlide(); + } + else { + this.setCurrentImage(); + } + return true; + } else { + this._inPlayMode = false; + this.resetSlideShowButtonState(); + } + } + return false; + }, + + _slideShowInit: function() { + // Initializes the slideshow by invoking the webservice to retrieve the slides + // and sets the first slide. + + // clear the state of the slideshow + this._currentIndex = -1; + this._cachedImageIndex = -1; + this._inPlayMode = false; + this._currentValue = null; + // clear the cache + this._images = null; + // Create the service parameters and optionally add the context parameter + // (thereby determining which method signature we're expecting...) + var params = null; + if(this._useContextKey) + params = { contextKey: this._contextKey }; + + Sys.Net.WebServiceProxy.invoke( + this._slideShowServicePath, + this._slideShowServiceMethod, + false, + params, + Function.createDelegate(this, this._initSlides), + null, + null); + }, + + _initSlides: function(sender, eventArgs) { + this._slides = sender; + if(this._slides) { + // create image containers if animation is of type LeftRight or UpDown. + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight) { + this._createElementsForSlideRight(); + this._setInitialState(); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._createElementsForSlideDown(); + this._setInitialState(); + } + else { + this._images = new Array(); + this._clickNext(); + } + if(this._autoPlay) { + this._isNext = true; + this._play(); + } + } + }, + + _cacheImages: function() { + // Caches 4 more slides periodically. + + // cache if current index is divisible by 3 + if((this._currentIndex) % 3 == 0) { + var oldCachedImageIndex = this._cachedImageIndex; + for(var i = this._cachedImageIndex + 1; i < this._slides.length; i++) + if(this._slides[i]) { + this._images[i] = new Image(); + this._images[i].src = this._slides[i].ImagePath; + this._cachedImageIndex = i; + + if((oldCachedImageIndex + 4) <= i) + // cached 4 slides + break; + } + } + }, + + _createElementsForSlideRight: function() { + var e = this.get_element(); + // create parent container + var _divContainer = document.createElement('DIV'); + _divContainer.id = e.id + '_slider'; + _divContainer.className = 'ajax__slide_show_container'; + _divContainer.style.width = this._imageWidth + 'px'; + _divContainer.style.height = this._imageHeight + 'px'; + e.parentNode.insertBefore(_divContainer, e); + e.parentNode.removeChild(e); + _divContainer.appendChild(e); + _divContainer.align = 'center'; + + // create container for mask + var _divMask = document.createElement('DIV'); + _divMask.id = e.id + '_mask'; + _divMask.style.width = this._imageWidth + 'px'; + _divContainer.appendChild(_divMask); + + // create array to keep all images + this._images = new Array(); + for(var i = 0; i < this._slides.length; i++) { + // create div to hold image + var _divImage = document.createElement('DIV'); + _divImage.id = e.id + '_imageDiv' + i; + _divImage.style.position = 'absolute'; + _divImage.style.top = '0px'; + _divImage.className = 'ajax__slide_show_slideAnimation'; + _divMask.appendChild(_divImage); + + // create hyperlink for image + if(this._slides[i].Url != null) { + var _imageLink = document.createElement('A'); + _imageLink.href = this._slides[i].Url; + _imageLink.target = '_blank'; + _divImage.appendChild(_imageLink); + } + + // create image element + var _imageElement = document.createElement('IMG'); + _imageElement.style.width = this._imageWidth + 'px'; + _imageElement.style.height = this._imageHeight + 'px'; + _imageElement.src = this._slides[i].ImagePath; + if(this._slides[i].Url != null) + _imageLink.appendChild(_imageElement); + else + _divImage.appendChild(_imageElement); + + this._images[i] = _divImage; + } + }, + + _createElementsForSlideDown: function() { + var e = this.get_element(); + + // create parent container + var _divContainer = document.createElement('DIV'); + _divContainer.id = e.id + '_slider'; + _divContainer.className = 'ajax__slide_show_container'; + _divContainer.style.width = this._imageWidth + 'px'; + _divContainer.style.height = this._imageHeight + 'px'; + e.parentNode.insertBefore(_divContainer, e); + e.parentNode.removeChild(e); + _divContainer.appendChild(e); + _divContainer.align = 'center'; + + // create container for mask + var _divMask = document.createElement('DIV'); + _divMask.style.width = this._imageWidth + 'px'; + _divContainer.appendChild(_divMask); + + var _ULContainer = document.createElement('UL'); + _ULContainer.style.className = 'ajax__slide_show_sliderUL'; + _divMask.appendChild(_ULContainer); + + // create array to keep all images + this._images = new Array(); + for(var i = 0; i < this._slides.length; i++) { + // create div to hold image + var _LIImage = document.createElement('LI'); + _LIImage.id = e.id + '_imageDiv' + i; + _LIImage.style.position = 'absolute'; + _LIImage.className = 'ajax__slide_show_slideAnimation'; + _ULContainer.appendChild(_LIImage); + + // create hyperlink for image + if(this._slides[i].Url != null) { + var _imageLink = document.createElement('A'); + _imageLink.href = this._slides[i].Url; + _imageLink.target = '_blank'; + _LIImage.appendChild(_imageLink); + } + + // create image element + var _imageElement = document.createElement('IMG'); + _imageElement.style.width = this._imageWidth + 'px'; + _imageElement.style.height = this._imageHeight + 'px'; + _imageElement.src = this._slides[i].ImagePath; + + if(this._slides[i].Url != null) + _imageLink.appendChild(_imageElement); + else + _LIImage.appendChild(_imageElement); + + this._images[i] = _LIImage; + } + }, + + _setInitialState: function() { + this._currentIndex++; + this._currentImage = this._images[this._currentIndex]; + this._nextImage = this._images.length > 1 ? this._images[this._currentIndex + 1] : this._images[this._currentIndex]; + + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight) { + this._currentImage.style.left = '0px'; + for(var i = 1; i < this._images.length; i++) + this._images[i].style.left = '-' + (this._imageWidth + 5) + 'px'; + } + else { + this._currentImage.style.top = '0px'; + for(var i = 0; i < this._images.length; i++) + this._images[i].style.left = '0px'; + } + + this._previousImage = this._images[this._images.length - 1]; + + this._currentImage.style.width = this._imageWidth + 'px'; + this._nextImage.style.width = this._imageWidth + 'px'; + this._previousImage.style.width = this._imageWidth + 'px'; + + this._currentImage.style.height = this._imageHeight + 'px'; + this._nextImage.style.height = this._imageHeight + 'px'; + this._previousImage.style.height = this._imageHeight + 'px'; + + if(this._imageDescriptionLabel) + this._imageDescriptionLabel.innerHTML = this._slides[this._currentIndex].Description ? this._slides[this._currentIndex].Description : ""; + if(this._imageTitleLabel) + this._imageTitleLabel.innerHTML = this._slides[this._currentIndex].Name ? this._slides[this._currentIndex].Name : ""; + }, + + /// + /// Maintains a slideshow current slide + /// + /// + setCurrentSlide: function() { + if(this._isNext) { + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight) { + this._nextImage = this._images[this._currentIndex]; + this._elementImage.alt = this._nextImage.Name; + + this._nextImage.className = ''; + this._nextImage.style.left = '-' + (this._imageWidth + 5) + 'px'; + + var me = this; + setTimeout(function() { + me._nextImage.className = 'ajax__slide_show_slideAnimation'; + + if(me._imageDescriptionLabel) + me._imageDescriptionLabel.innerHTML = me._slides[me._currentIndex].Description ? me._slides[me._currentIndex].Description : ""; + if(me._imageTitleLabel) + me._imageTitleLabel.innerHTML = me._slides[me._currentIndex].Name ? me._slides[me._currentIndex].Name : ""; + + me._currentImage.style.left = me._imageWidth + 'px'; + me._nextImage.style.left = '0px'; + }, 200); + + setTimeout(function() { + me._previousImage = me._currentImage; + me._currentImage = me._nextImage; + me._previousImage.className = ''; + me._previousImage.style.left = '-' + (me._imageWidth + 5) + 'px'; + setTimeout(function() { + me._previousImage.className = 'ajax__slide_show_slideAnimation'; + this._isNext = false; + }, 1000); + }, 1200); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._nextImage = this._images[this._currentIndex]; + this._nextImage.className = ''; + this._nextImage.style.top = '-' + (this._imageHeight + 5) + 'px'; + + var me = this; + setTimeout(function() { + me._nextImage.className = 'ajax__slide_show_slideAnimation'; + + if(me._imageDescriptionLabel) + me._imageDescriptionLabel.innerHTML = me._slides[me._currentIndex].Description ? me._slides[me._currentIndex].Description : ""; + if(me._imageTitleLabel) + me._imageTitleLabel.innerHTML = me._slides[me._currentIndex].Name ? me._slides[me._currentIndex].Name : ""; + + me._currentImage.style.top = me._imageHeight + 'px'; + me._nextImage.style.top = '0px'; + }, 200); + + setTimeout(function() { + me._previousImage = me._currentImage; + me._currentImage = me._nextImage; + me._previousImage.className = ''; + me._previousImage.style.top = '-' + (me._imageHeight + 5) + 'px'; + setTimeout(function() { + me._previousImage.className = 'ajax__slide_show_slideAnimation'; + this._isNext = false; + }, 1000); + }, 1200); + } + } + else { + if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideRight) { + this._previousImage = this._images[this._currentIndex]; + this._previousImage.className = ''; + this._previousImage.style.left = (this._imageWidth + 5) + 'px'; + + var me = this; + setTimeout(function() { + me._previousImage.className = 'ajax__slide_show_slideAnimation'; + + if(me._imageDescriptionLabel) + me._imageDescriptionLabel.innerHTML = me._slides[me._currentIndex].Description ? me._slides[me._currentIndex].Description : ""; + if(me._imageTitleLabel) + me._imageTitleLabel.innerHTML = me._slides[me._currentIndex].Name ? me._slides[me._currentIndex].Name : ""; + + me._currentImage.style.left = '-' + (me._imageWidth + 5) + 'px'; + me._previousImage.style.left = '0px'; + }, 200); + + setTimeout(function() { + me._nextImage = me._currentImage; + me._currentImage = me._previousImage; + me._nextImage.className = ''; + me._nextImage.style.left = (me._imageWidth + 5) + 'px'; + setTimeout(function() { + me._nextImage.className = 'ajax__slide_show_slideAnimation'; + this._isNext = false; + }, 1000); + }, 1200); + } + else if(this._slideShowAnimationType == Sys.Extended.UI.SlideShowAnimationType.SlideDown) { + this._previousImage = this._images[this._currentIndex]; + this._previousImage.className = ''; + this._previousImage.style.top = (this._imageHeight + 5) + 'px'; + + var me = this; + setTimeout(function() { + me._previousImage.className = 'ajax__slide_show_slideAnimation'; + + if(me._imageDescriptionLabel) + me._imageDescriptionLabel.innerHTML = me._slides[me._currentIndex].Description ? me._slides[me._currentIndex].Description : ""; + if(me._imageTitleLabel) + me._imageTitleLabel.innerHTML = me._slides[me._currentIndex].Name ? me._slides[me._currentIndex].Name : ""; + + me._currentImage.style.top = '-' + (me._imageHeight + 5) + 'px'; + me._previousImage.style.top = '0px'; + }, 200); + + setTimeout(function() { + me._nextImage = me._currentImage; + me._currentImage = me._previousImage; + me._nextImage.className = ''; + me._nextImage.style.top = (me._imageHeight + 5) + 'px'; + setTimeout(function() { + me._nextImage.className = 'ajax__slide_show_slideAnimation'; + this._isNext = false; + }, 1000); + }, 1200); + } + } + }, + + /// + /// Whether a slideshow supports a given animation name + /// + /// Name of the animation + /// Boolean value indicates that given animation name is supported + /// + supportsAnimation: function(animationName) { + var isSupport = false, + domPrefixes = 'Webkit Moz ms O'.split(' '), + elm = document.createElement('div'), + animationNameCapital = null; + + animationName = animationName.toLowerCase(); + + if(elm.style[animationName]) + isSupport = true; + + if(isSupport === false) { + animationNameCapital = animationName.charAt(0).toUpperCase() + animationName.substr(1); + for(var i = 0; i < domPrefixes.length; i++) + if(elm.style[domPrefixes[i] + animationNameCapital] !== undefined) { + isSupport = true; + break; + } + } + return isSupport; + } + +} +Sys.Extended.UI.SlideShowBehavior.registerClass('Sys.Extended.UI.SlideShowBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.SlideShowEventArgs = function(previousSlide, nextSlide, slideIndex) { + Sys.Extended.UI.SlideShowEventArgs.initializeBase(this); + + this._previousSlide = previousSlide; + this._nextSlide = nextSlide; + this._slideIndex = slideIndex; +} +Sys.Extended.UI.SlideShowEventArgs.prototype = { + get_previousSlide: function() { + return this._previousSlide; + }, + + get_nextSlide: function() { + return this._nextSlide; + }, + + get_slideIndex: function() { + return this._slideIndex; + } +} +Sys.Extended.UI.SlideShowEventArgs.registerClass('Sys.Extended.UI.SlideShowEventArgs', Sys.CancelEventArgs); + +Sys.Extended.UI.SlideShowAnimationType = function() { + throw Error.invalidOperation(); +} +Sys.Extended.UI.SlideShowAnimationType.prototype = { + None: 0, + FadeInOut: 1, + ScaleX: 2, + ScaleY: 3, + ZoomInOut: 4, + Rotate: 5, + SlideRight: 6, + SlideDown: 7 +} + +Sys.Extended.UI.SlideShowAnimationType.registerEnum("Sys.Extended.UI.SlideShowAnimationType", false); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Slider.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Slider.debug.js new file mode 100644 index 000000000..d523dbce6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Slider.debug.js @@ -0,0 +1,1167 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI._SliderDragDropManagerInternal = function() { + Sys.Extended.UI._SliderDragDropManagerInternal.initializeBase(this); + + this._instance = null; +} +Sys.Extended.UI._SliderDragDropManagerInternal.prototype = { + _getInstance: function() { + this._instance = new Sys.Extended.UI.GenericDragDropManager(); + + this._instance.initialize(); + this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart)); + this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop)); + + return this._instance; + } +} +Sys.Extended.UI._SliderDragDropManagerInternal.registerClass('Sys.Extended.UI._SliderDragDropManagerInternal', Sys.Extended.UI._DragDropManager); +Sys.Extended.UI.SliderDragDropManagerInternal = new Sys.Extended.UI._SliderDragDropManagerInternal(); + +Sys.Extended.UI.SliderOrientation = function() { + +} +Sys.Extended.UI.SliderOrientation.prototype = { + Horizontal: 0, + Vertical: 1 +} +Sys.Extended.UI.SliderOrientation.registerEnum('Sys.Extended.UI.SliderOrientation', false); + +Sys.Extended.UI.SliderBehavior = function(element) { + Sys.Extended.UI.SliderBehavior.initializeBase(this, [element]); + + this._minimum = 0; + this._maximum = 100; + this._value = null; + this._steps = 0; + this._decimals = 0; + this._orientation = Sys.Extended.UI.SliderOrientation.Horizontal; + this._railElement = null; + this._railCssClass = null; + this._isHorizontal = true; + this._isUpdatingInternal = false; + this._isInitializedInternal = false; + this._enableHandleAnimation = false; + this._handle = null; + this._handleImage = null; + this._handleAnimation = null; + this._handleAnimationDuration = 0.1; + this._handleImageUrl = null; + this._handleCssClass = null; + this._dragHandle = null; + this._mouseupHandler = null; + this._selectstartHandler = null; + this._boundControlChangeHandler = null; + this._boundControlKeyPressHandler = null; + this._boundControlID = null; + this._boundControl = null; + this._length = null; + this._raiseChangeOnlyOnMouseUp = true; + this._animationPending = false; + this._selectstartPending = false; + this._tooltipText = ''; + + this._enableKeyboard = true; + + this._keyDownHandler = null; + +} +Sys.Extended.UI.SliderBehavior.prototype = { + + initialize: function() { + Sys.Extended.UI.SliderBehavior.callBaseMethod(this, 'initialize'); + + this._initializeLayout(); + }, + + dispose: function() { + this._disposeHandlers(); + + this._disposeBoundControl(); + + if(this._enableHandleAnimation && this._handleAnimation) + this._handleAnimation.dispose(); + + Sys.Extended.UI.SliderBehavior.callBaseMethod(this, 'dispose'); + }, + + _initializeLayout: function() { + this._railElement = document.createElement('DIV'); + this._railElement.id = this.get_id() + '_railElement'; + + this._railElement.tabIndex = -1; + + this._railElement.innerHTML = '
    '; + this._handle = this._railElement.childNodes[0]; + this._handle.style.overflow = 'hidden'; + this._handle.style.position = 'absolute'; + + if(Sys.Browser.agent == Sys.Browser.Opera) { + this._handle.style.left = '0px'; + this._handle.style.top = '0px'; + } + + var textBoxElement = this.get_element(); + var textBoxElementBounds = $common.getBounds(textBoxElement); + textBoxElement.parentNode.insertBefore(this._railElement, textBoxElement); + + this._isHorizontal = (this._orientation == Sys.Extended.UI.SliderOrientation.Horizontal); + + var defaultRailCssClass = (this._isHorizontal) ? 'ajax__slider_h_rail' : 'ajax__slider_v_rail'; + var defaultHandleCssClass = (this._isHorizontal) ? 'ajax__slider_h_handle' : 'ajax__slider_v_handle'; + var defaultHandleImageUrl = (this._isHorizontal) + ? Sys.Extended.UI.Images["Slider.Handle-Horizontal.gif"] + : Sys.Extended.UI.Images["Slider.Handle-Vertical.gif"]; + + this._railElement.className = (this._railCssClass) ? this._railCssClass : defaultRailCssClass; + this._handle.className = (this._handleCssClass) ? this._handleCssClass : defaultHandleCssClass; + if(!this._handleImageUrl) + this._handleImageUrl = defaultHandleImageUrl; + + if(this._isHorizontal) { + if(this._length) + this._railElement.style.width = this._length; + } + else { + if(this._length) + this._railElement.style.height = this._length; + } + + this._loadHandleImage(); + this._enforceTextBoxElementPositioning(); + this._hideTextBoxElement(); + this._initializeSlider(); + }, + + _enforceTextBoxElementPositioning: function() { + var tbPosition = { + position: this.get_element().style.position, + top: this.get_element().style.top, + right: this.get_element().style.right, + bottom: this.get_element().style.bottom, + left: this.get_element().style.left + }; + + if(tbPosition.position != '') + this._railElement.style.position = tbPosition.position; + if(tbPosition.top != '') + this._railElement.style.top = tbPosition.top; + if(tbPosition.right != '') + this._railElement.style.right = tbPosition.right; + if(tbPosition.bottom != '') + this._railElement.style.bottom = tbPosition.bottom; + if(tbPosition.left != '') + this._railElement.style.left = tbPosition.left; + }, + + _hideTextBoxElement: function() { + var textBoxElement = this.get_element(); + + textBoxElement.readOnly = true; + + var dimension = '0px'; + + if(Sys.Browser.agent == Sys.Browser.Safari) + dimension = '1px'; + + textBoxElement.style.width = dimension; + textBoxElement.style.height = dimension; + textBoxElement.style.border = '0px'; + textBoxElement.style.padding = '0px'; + textBoxElement.style.margin = '0px'; + textBoxElement.style.fontSize = '1px'; + textBoxElement.style.lineHeight = '1px'; + textBoxElement.style.outline = '0'; + + textBoxElement.style.position = 'absolute'; + }, + + _loadHandleImage: function() { + this._handleImage = document.createElement('IMG'); + this._handleImage.id = this.get_id() + '_handleImage'; + this._handle.appendChild(this._handleImage); + this._handleImage.src = this._handleImageUrl; + }, + + _initializeSlider: function() { + this._initializeBoundControl(); + + var _elementValue; + try { + _elementValue = parseFloat(this.get_element().value); + } catch(ex) { + _elementValue = Number.NaN; + } + + this.set_value(_elementValue); + this._setHandleOffset(this._value); + this._initializeDragHandle(); + + Sys.Extended.UI.SliderDragDropManagerInternal.registerDropTarget(this); + + this._initializeHandlers(); + this._initializeHandleAnimation(); + + this._isInitializedInternal = true; + this._raiseEvent('sliderInitialized'); + }, + + _initializeBoundControl: function() { + if(this._boundControl) { + var isInputElement = this._boundControl.nodeName == 'INPUT'; + + if(isInputElement) { + this._boundControlChangeHandler = Function.createDelegate(this, this._onBoundControlChange); + this._boundControlKeyPressHandler = Function.createDelegate(this, this._onBoundControlKeyPress); + + $addHandler(this._boundControl, 'change', this._boundControlChangeHandler); + $addHandler(this._boundControl, 'keypress', this._boundControlKeyPressHandler); + } + } + }, + + _disposeBoundControl: function() { + if(this._boundControl) {; + var isInputElement = this._boundControl.nodeName == 'INPUT'; + + if(isInputElement) { + $removeHandler(this._boundControl, 'change', this._boundControlChangeHandler); + $removeHandler(this._boundControl, 'keypress', this._boundControlKeyPressHandler); + } + } + }, + + _onBoundControlChange: function(evt) { + this._animationPending = true; + this._setValueFromBoundControl(); + }, + + _onBoundControlKeyPress: function(evt) { + if(evt.charCode == 13) { + this._animationPending = true; + this._setValueFromBoundControl(); + evt.preventDefault(); + } + }, + + _setValueFromBoundControl: function() { + this._isUpdatingInternal = true; + + if(this._boundControlID) + this._calcValue($get(this._boundControlID).value); + + this._isUpdatingInternal = false; + }, + + _initializeHandleAnimation: function() { + if(this._steps > 0) { + this._enableHandleAnimation = false; + return; + } + + if(this._enableHandleAnimation) + this._handleAnimation = new Sys.Extended.UI.Animation.LengthAnimation( + this._handle, this._handleAnimationDuration, 100, 'style'); + }, + + _ensureBinding: function() { + if(this._boundControl) { + var value = this._value; + + if(value >= this._minimum || value <= this._maximum) { + var isInputElement = this._boundControl.nodeName == 'INPUT'; + + if(isInputElement) + this._boundControl.value = value; + else if(this._boundControl) + this._boundControl.innerHTML = value; + } + } + }, + + _getBoundsInternal: function(element) { + var bounds = $common.getBounds(element); + + function hasSize() { + return bounds.width > 0 && bounds.height > 0; + } + + if(!hasSize()) { + bounds.width = parseInt($common.getCurrentStyle(element, 'width')); + bounds.height = parseInt($common.getCurrentStyle(element, 'height')); + + if(!hasSize()) { + var tempNode = element.cloneNode(true); + tempNode.visibility = 'hidden'; + document.body.appendChild(tempNode); + + bounds.width = parseInt($common.getCurrentStyle(tempNode, 'width')); + bounds.height = parseInt($common.getCurrentStyle(tempNode, 'height')); + document.body.removeChild(tempNode); + + if(!hasSize()) + throw Error.argument('element size', Sys.Extended.UI.Resources.Slider_NoSizeProvided); + } + } + + if(this._orientation == Sys.Extended.UI.SliderOrientation.Vertical) { + bounds = { + x: bounds.y, + y: bounds.x, + height: bounds.width, + width: bounds.height, + right: bounds.right, + bottom: bounds.bottom, + location: { x: bounds.y, y: bounds.x }, + size: { width: bounds.height, height: bounds.width } + }; + } + + return bounds; + }, + + _getRailBounds: function() { + var bounds = this._getBoundsInternal(this._railElement); + + return bounds; + }, + + _getHandleBounds: function() { + return this._getBoundsInternal(this._handle); + }, + + _initializeDragHandle: function() { + var dh = this._dragHandle = document.createElement('DIV'); + + dh.style.position = 'absolute'; + dh.style.width = '1px'; + dh.style.height = '1px'; + dh.style.overflow = 'hidden'; + dh.style.zIndex = Sys.Extended.UI.zIndex.SliderDragHandle; + dh.style.background = 'none'; + + document.body.appendChild(this._dragHandle); + }, + + _resetDragHandle: function() { + var handleBounds = $common.getBounds(this._handle); + + $common.setLocation(this._dragHandle, { x: handleBounds.x, y: handleBounds.y }); + }, + + _initializeHandlers: function() { + this._selectstartHandler = Function.createDelegate(this, this._onSelectStart); + this._mouseupHandler = Function.createDelegate(this, this._onMouseUp); + + this._keyDownHandler = Function.createDelegate(this, this._onKeyDown); + + $addHandler(document, 'mouseup', this._mouseupHandler); + + $addHandler(this.get_element(), 'keydown', this._keyDownHandler); + + $addHandlers(this._handle, { + 'mousedown': this._onMouseDown, + 'dragstart': this._IEDragDropHandler, + 'drag': this._IEDragDropHandler, + 'dragend': this._IEDragDropHandler + }, + this); + + $addHandlers(this._railElement, { + 'click': this._onRailClick + }, + this); + }, + + _disposeHandlers: function() { + $clearHandlers(this._handle); + $clearHandlers(this._railElement); + + $removeHandler(this.get_element(), 'keydown', this._keyDownHandler); + + $removeHandler(document, 'mouseup', this._mouseupHandler); + + this._keyDownHandler = null; + this._mouseupHandler = null; + this._selectstartHandler = null; + }, + + startDragDrop: function(dragVisual) { + this._resetDragHandle(); + + Sys.Extended.UI.SliderDragDropManagerInternal.startDragDrop(this, dragVisual, null); + }, + + _onMouseDown: function(evt) { + window._event = evt; + evt.preventDefault(); + + if(!Sys.Extended.UI.SliderBehavior.DropPending) { + Sys.Extended.UI.SliderBehavior.DropPending = this; + + $addHandler(document, 'selectstart', this._selectstartHandler); + this._selectstartPending = true; + + this.startDragDrop(this._dragHandle); + } + }, + + _onMouseUp: function(evt) { + var srcElement = evt.target; + + if(Sys.Extended.UI.SliderBehavior.DropPending == this) { + Sys.Extended.UI.SliderBehavior.DropPending = null; + + if(this._selectstartPending) + $removeHandler(document, 'selectstart', this._selectstartHandler); + } + }, + + _onKeyDown: function(e) { + if(this._enableKeyboard) { + var evt = new Sys.UI.DomEvent(e); + + switch(evt.keyCode || evt.rawEvent.keyCode) { + case Sys.UI.Key.up: + case Sys.UI.Key.left: + this._handleSlide(true); + evt.preventDefault(); + return; + case Sys.UI.Key.down: + case Sys.UI.Key.right: + this._handleSlide(false); + evt.preventDefault(); + return false; + default: + return false; + } + } + }, + + _handleSlide: function(decrement) { + this._animationPending = true; + + this._isUpdatingInternal = true; + + var currentValue = this.get_value(); + var increment; + + if(this._steps > 0) { + var extent = this._maximum - this._minimum; + + var delta = (extent / (this._steps - 1)).toFixed(this._decimals); + + increment = delta; + } else { + increment = this._decimals == 0 ? 1 : 1 / Math.pow(10, this._decimals); + } + + if(decrement) + increment = 0 - increment + + this._calcValue(parseFloat(currentValue) + parseFloat(increment)); + this._isUpdatingInternal = false; + this._fireTextBoxChangeEvent(); + }, + + _onRailClick: function(evt) { + if(evt.target == this._railElement) { + this._animationPending = true; + this._onRailClicked(evt); + } + }, + + _IEDragDropHandler: function(evt) { + evt.preventDefault(); + }, + + _onSelectStart: function(evt) { + evt.preventDefault(); + }, + + _calcValue: function(value, mouseOffset) { + var val; + + if(value != null) { + if(!Number.isInstanceOfType(value)) { + try { + value = parseFloat(value); + } catch(ex) { + value = Number.NaN; + } + } + + if(isNaN(value)) + value = this._minimum; + + val = (value < this._minimum) ? this._minimum + : (value > this._maximum) ? this._maximum + : value; + } + else { + var _minimum = this._minimum; + var _maximum = this._maximum; + var handleBounds = this._getHandleBounds(); + var sliderBounds = this._getRailBounds(); + var handleX = (mouseOffset) ? mouseOffset - handleBounds.width / 2 + : handleBounds.x - sliderBounds.x; + var extent = sliderBounds.width - handleBounds.width; + var percent = handleX / extent; + + val = (handleX == 0) ? _minimum + : (handleX == (sliderBounds.width - handleBounds.width)) ? _maximum + : _minimum + percent * (_maximum - _minimum); + } + + if(this._steps > 0) + val = this._getNearestStepValue(val); + + val = (val < this._minimum) ? this._minimum + : (val > this._maximum) ? this._maximum + : val; + + this._isUpdatingInternal = true; + this.set_value(val); + this._isUpdatingInternal = false; + + return val; + }, + + _setHandleOffset: function(value, playHandleAnimation) { + var _minimum = this._minimum; + var _maximum = this._maximum; + var handleBounds = this._getHandleBounds(); + var sliderBounds = this._getRailBounds(); + + var extent = _maximum - _minimum; + var fraction = (value - _minimum) / extent; + var hypOffset = Math.round(fraction * (sliderBounds.width - handleBounds.width)); + + var offset = (value == _minimum) ? 0 + : (value == _maximum) ? (sliderBounds.width - handleBounds.width) + : hypOffset; + + if(playHandleAnimation) { + this._handleAnimation.set_startValue(handleBounds.x - sliderBounds.x); + this._handleAnimation.set_endValue(offset); + this._handleAnimation.set_propertyKey((this._isHorizontal) ? 'left' : 'top'); + this._handleAnimation.play(); + + this._animationPending = false; + } + else { + if(this._isHorizontal) + this._handle.style.left = offset + 'px'; + else + this._handle.style.top = offset + 'px'; + } + }, + + _getNearestStepValue: function(value) { + if(this._steps == 0) + return value; + + var extent = this._maximum - this._minimum; + if(extent == 0) + return value; + + var delta = extent / (this._steps - 1); + + return Math.round(value / delta) * delta; + }, + + _onHandleReleased: function() { + if(this._raiseChangeOnlyOnMouseUp) + this._fireTextBoxChangeEvent(); + + this._raiseEvent('slideEnd'); + }, + + _onRailClicked: function(evt) { + var handleBounds = this._getHandleBounds(); + var sliderBounds = this._getRailBounds(); + var offset = (this._isHorizontal) ? evt.offsetX : evt.offsetY; + var minOffset = handleBounds.width / 2; + var maxOffset = sliderBounds.width - minOffset; + + offset = (offset < minOffset) ? minOffset + : (offset > maxOffset) ? maxOffset + : offset; + + this._calcValue(null, offset, true); + + this._fireTextBoxChangeEvent(); + }, + + _fireTextBoxChangeEvent: function() { + if(document.createEvent) { + var onchangeEvent = document.createEvent('HTMLEvents'); + onchangeEvent.initEvent('change', true, false); + + this.get_element().dispatchEvent(onchangeEvent); + } + else if(document.createEventObject) { + this.get_element().fireEvent('onchange'); + } + }, + + /// + /// A slider drag data type + /// + /// get_dragDataType + /// + get_dragDataType: function() { + return "HTML"; + }, + + /// + /// Returns slider data + /// + /// + getDragData: function() { + return this._handle; + }, + + /// + /// Slider dra mode + /// + /// dragMode + /// + get_dragMode: function() { + return Sys.Extended.UI.DragMode.Move; + }, + + onDragStart: function() { + this._resetDragHandle(); + this._raiseEvent('slideStart'); + }, + + onDrag: function() { + var dragHandleBounds = this._getBoundsInternal(this._dragHandle); + var handleBounds = this._getHandleBounds(); + var sliderBounds = this._getRailBounds(); + + var handlePosition; + if(this._isHorizontal) + handlePosition = { x: dragHandleBounds.x - sliderBounds.x, y: 0 }; + else + handlePosition = { y: dragHandleBounds.x - sliderBounds.x, x: 0 }; + + $common.setLocation(this._handle, handlePosition); + + this._calcValue(null, null); + + if(this._steps > 1) + this._setHandleOffset(this.get_value(), false); + }, + + onDragEnd: function() { + this._onHandleReleased(); + }, + + /// + /// A slider drop target element + /// + /// get_dropTargetElement + /// + get_dropTargetElement: function() { + return document.body; + }, + + canDrop: function(dragMode, dataType) { + return dataType == 'HTML'; + }, + + drop: Function.emptyMethod, + + onDragEnterTarget: Function.emptyMethod, + + onDragLeaveTarget: Function.emptyMethod, + + onDragInTarget: Function.emptyMethod, + + /// + /// Fires when the slider is initialized + /// + /// + /// + add_sliderInitialized: function(handler) { + this.get_events().addHandler('sliderInitialized', handler); + }, + remove_sliderInitialized: function(handler) { + this.get_events().removeHandler('sliderInitialized', handler); + }, + + /// + /// Fires when the slider value changes + /// + /// + /// + add_valueChanged: function(handler) { + this.get_events().addHandler('valueChanged', handler); + }, + remove_valueChanged: function(handler) { + this.get_events().removeHandler('valueChanged', handler); + }, + + /// + /// Fires when sliding starts + /// + /// + /// + add_slideStart: function(handler) { + this.get_events().addHandler('slideStart', handler); + }, + remove_slideStart: function(handler) { + this.get_events().removeHandler('slideStart', handler); + }, + + /// + /// Fires when sliding ends + /// + /// + /// + add_slideEnd: function(handler) { + this.get_events().addHandler('slideEnd', handler); + }, + remove_slideEnd: function(handler) { + this.get_events().removeHandler('slideEnd', handler); + }, + + _raiseEvent: function(eventName, eventArgs) { + var handler = this.get_events().getHandler(eventName); + if(handler) { + if(!eventArgs) + eventArgs = Sys.EventArgs.Empty; + handler(this, eventArgs); + } + }, + + /// + /// A slider current value + /// + /// get_value + /// set_value + /// + get_value: function() { + return this._value; + }, + set_value: function(value) { + var oldValue = this._value; + var newValue = value; + + if(!this._isUpdatingInternal) + newValue = this._calcValue(value); + + this.get_element().value = this._value = newValue.toFixed(this._decimals); + + this._ensureBinding(); + + if(!Number.isInstanceOfType(this._value)) { + try { + this._value = parseFloat(this._value); + } catch(ex) { + this._value = Number.NaN; + } + } + + if(this._tooltipText) + this._handle.alt = this._handle.title = String.format(this._tooltipText, this._value); + + if(this._isInitializedInternal) { + this._setHandleOffset(newValue, this._enableHandleAnimation && this._animationPending); + + if(this._isUpdatingInternal) + if(!this._raiseChangeOnlyOnMouseUp) + this._fireTextBoxChangeEvent(); + + if(this._value != oldValue) + this._raiseEvent('valueChanged'); + } + }, + + get_Value: function() { + Sys.Extended.Deprecated("get_Value()", "get_value()"); + return this.get_value(); + }, + set_Value: function(value) { + Sys.Extended.Deprecated("set_Value(value)", "set_value(value)"); + this.set_value(value); + }, + + /// + /// A CSS class for the slider's rail + /// + /// get_railCssClass + /// set_railCssClass + /// + get_railCssClass: function() { + return this._railCssClass; + }, + set_railCssClass: function(value) { + this._railCssClass = value; + }, + + get_RailCssClass: function() { + Sys.Extended.Deprecated("get_RailCssClass()", "get_railCssClass()"); + return this.get_railCssClass(); + }, + set_RailCssClass: function(value) { + Sys.Extended.Deprecated("set_RailCssClass(value)", "set_railCssClass(value)"); + this.set_railCssClass(value); + }, + + /// + /// The URL of an image to display as the slider's handle + /// + /// get_handleImageUrl + /// set_handleImageUrl + /// + get_handleImageUrl: function() { + return this._handleImageUrl; + }, + set_handleImageUrl: function(value) { + this._handleImageUrl = value; + }, + + get_HandleImageUrl: function() { + Sys.Extended.Deprecated("get_HandleImageUrl()", "get_handleImageUrl()"); + return this.get_handleImageUrl(); + }, + set_HandleImageUrl: function(value) { + Sys.Extended.Deprecated("set_HandleImageUrl(value)", "set_handleImageUrl(value)"); + this.set_handleImageUrl(value); + }, + + /// + /// A CSS class for the slider's handle + /// + /// get_handleCssClass + /// set_handleCssClass + /// + get_handleCssClass: function() { + return this._handleCssClass; + }, + set_handleCssClass: function(value) { + this._handleCssClass = value; + }, + + get_HandleCssClass: function() { + Sys.Extended.Deprecated("get_HandleCssClass()", "get_handleCssClass()"); + return this.get_handleCssClass(); + }, + set_HandleCssClass: function(value) { + Sys.Extended.Deprecated("set_HandleCssClass(value)", "set_handleCssClass(value)"); + this.set_handleCssClass(value); + }, + + /// + /// Minimum value allowed + /// + /// get_minimum + /// set_minimum + /// + get_minimum: function() { + return this._minimum; + }, + set_minimum: function(value) { + this._minimum = value; + }, + + get_Minimum: function() { + Sys.Extended.Deprecated("get_Minimum()", "get_minimum()"); + return this.get_minimum(); + }, + set_Minimum: function(value) { + Sys.Extended.Deprecated("set_Minimum(value)", "set_minimum(value)"); + this.set_minimum(value); + }, + + /// + /// Maximum value allowed + /// + /// get_maximum + /// set_maximum + /// + get_maximum: function() { + return this._maximum; + }, + set_maximum: function(value) { + this._maximum = value; + }, + + get_Maximum: function() { + Sys.Extended.Deprecated("get_Maximum()", "get_maximum()"); + return this.get_maximum(); + }, + set_Maximum: function(value) { + Sys.Extended.Deprecated("set_Maximum(value)", "set_maximum(value)"); + this.set_maximum(value); + }, + + /// + /// Slider orientation + /// + /// get_orientation + /// set_orientation + /// + get_orientation: function() { + return this._orientation; + }, + set_orientation: function(value) { + this._orientation = value; + }, + + get_Orientation: function() { + Sys.Extended.Deprecated("get_Orientation()", "get_orientation()"); + return this.get_orientation(); + }, + set_Orientation: function(value) { + Sys.Extended.Deprecated("set_Orientation(value)", "set_orientation(value)"); + this.set_orientation(value); + }, + + /// + /// A number of discrete values inside the slider's range + /// + /// get_steps + /// set_steps + /// + get_steps: function() { + return this._steps; + }, + set_steps: function(value) { + this._steps = Math.abs(value); + this._steps = (this._steps == 1) ? 2 : this._steps; + }, + + get_Steps: function() { + Sys.Extended.Deprecated("get_Steps()", "get_steps()"); + return this.get_steps(); + }, + set_Steps: function(value) { + Sys.Extended.Deprecated("set_Steps(value)", "set_steps(value)"); + this.set_steps(value); + }, + + /// + /// A number of decimal digits for the value + /// + /// get_decimals + /// set_decimals + /// + get_decimals: function() { + return this._decimals; + }, + set_decimals: function(value) { + this._decimals = Math.abs(value); + }, + + get_Decimals: function() { + Sys.Extended.Deprecated("get_Decimals()", "get_decimals()"); + return this.get_decimals(); + }, + set_Decimals: function(value) { + Sys.Extended.Deprecated("set_Decimals(value)", "set_decimals(value)"); + this.set_decimals(value); + }, + + /// + /// Enable/disable the handle animation + /// + /// get_enableHandleAnimation + /// set_enableHandleAnimation + /// + get_enableHandleAnimation: function() { + return this._enableHandleAnimation; + }, + set_enableHandleAnimation: function(value) { + this._enableHandleAnimation = value; + }, + + get_EnableHandleAnimation: function() { + Sys.Extended.Deprecated("get_EnableHandleAnimation()", "get_enableHandleAnimation()"); + return this.get_enableHandleAnimation(); + }, + set_EnableHandleAnimation: function(value) { + Sys.Extended.Deprecated("set_EnableHandleAnimation(value)", "set_enableHandleAnimation(value)"); + this.set_enableHandleAnimation(value); + }, + + /// + /// Duration of the handle animation + /// + /// get_handleAnimationDuration + /// set_handleAnimationDuration + /// + get_handleAnimationDuration: function() { + return this._handleAnimationDuration; + }, + set_handleAnimationDuration: function(value) { + this._handleAnimationDuration = value; + }, + + get_HandleAnimationDuration: function() { + Sys.Extended.Deprecated("get_HandleAnimationDuration()", "get_handleAnimationDuration()"); + return this.get_handleAnimationDuration(); + }, + set_HandleAnimationDuration: function(value) { + Sys.Extended.Deprecated("set_HandleAnimationDuration(value)", "set_handleAnimationDuration(value)"); + this.set_handleAnimationDuration(value); + }, + + /// + /// ID of the TextBox or Label that dynamically displays the slider's value + /// + /// get_boundControlID + /// set_boundControlID + /// + get_boundControlID: function() { + return this._boundControlID; + }, + set_boundControlID: function(value) { + this._boundControlID = value; + if(this._boundControlID) + this._boundControl = $get(this._boundControlID); + else + this._boundControl = null; + }, + + get_BoundControlID: function() { + Sys.Extended.Deprecated("get_BoundControlID()", "get_boundControlID()"); + return this.get_boundControlID(); + }, + set_BoundControlID: function(value) { + Sys.Extended.Deprecated("set_BoundControlID(value)", "set_boundControlID(value)"); + this.set_boundControlID(value); + }, + + /// + /// Width/height of a horizontal/vertical slider when the default layout is used + /// + /// get_length + /// set_length + /// + get_length: function() { + return this._length; + }, + set_length: function(value) { + this._length = value + 'px'; + }, + + get_Length: function() { + Sys.Extended.Deprecated("get_Length()", "get_length()"); + return this.get_length(); + }, + set_Length: function(value) { + Sys.Extended.Deprecated("set_Length(value)", "set_length(value)"); + this.set_length(value); + }, + + /// + /// Determines whether the slider is initialized + /// + /// Boolean value indicates whether slider is initialized + /// + isSliderInitialized: function() { + return this._isInitializedInternal; + }, + + get_SliderInitialized: function() { + Sys.Extended.Deprecated("get_SliderInitialized()", "isSliderInitialized()"); + return this.isSliderInitialized(); + }, + + /// + /// If true, fires the change event on the extended TextBox only when the left mouse button is released + /// mouse button is released + /// + /// get_raiseChangeOnlyOnMouseUp + /// set_raiseChangeOnlyOnMouseUp + /// + get_raiseChangeOnlyOnMouseUp: function() { + return this._raiseChangeOnlyOnMouseUp; + }, + set_raiseChangeOnlyOnMouseUp: function(value) { + this._raiseChangeOnlyOnMouseUp = value; + }, + + get_RaiseChangeOnlyOnMouseUp: function() { + Sys.Extended.Deprecated("get_RaiseChangeOnlyOnMouseUp()", "get_raiseChangeOnlyOnMouseUp()"); + return this.get_raiseChangeOnlyOnMouseUp(); + }, + set_RaiseChangeOnlyOnMouseUp: function(value) { + Sys.Extended.Deprecated("set_RaiseChangeOnlyOnMouseUp(value)", "set_raiseChangeOnlyOnMouseUp(value)"); + this.set_raiseChangeOnlyOnMouseUp(value); + }, + + /// + /// Text to display in a tooltip when the handle is hovered + /// + /// + /// The {0} placeholder in the text is replaced with the current value of the slider + /// + /// get_tooltipText + /// set_tooltipText + /// + get_tooltipText: function() { + return this._tooltipText; + }, + set_tooltipText: function(value) { + this._tooltipText = value; + }, + + get_TooltipText: function() { + Sys.Extended.Deprecated("get_TooltipText()", "get_tooltipText()"); + return this.get_tooltipText(); + }, + set_TooltipText: function(value) { + Sys.Extended.Deprecated("set_TooltipText(value)", "set_tooltipText(value)"); + this.set_tooltipText(value); + }, + + /// + /// Determines if the slider will respond to arrow keys when it has focus + /// + /// get_enableKeyboard + /// set_enableKeyboard + /// + get_enableKeyboard: function() { + return this._enableKeyboard; + }, + set_enableKeyboard: function(value) { + if(value !== this._enableKeyboard) { + this._enableKeyboard = value; + this.raisePropertyChanged('enableKeyboard'); + } + }, + + /// + /// A client state + /// + /// get_clientState + /// set_clientState + /// + get_clientState: function() { + var value = Sys.Extended.UI.SliderBehavior.callBaseMethod(this, 'get_ClientState'); + if(value == '') + value = null; + return value; + }, + set_clientState: function(value) { + return Sys.Extended.UI.SliderBehavior.callBaseMethod(this, 'set_ClientState', [value]); + }, + + getClientState: function() { + Sys.Extended.Deprecated("getClientState()", "get_clientState()"); + return this.get_clientState(); + }, + setClientState: function(value) { + Sys.Extended.Deprecated("setClientState(value)", "set_clientState(value)"); + return this.set_clientState(value); + } +} + +Sys.Extended.UI.SliderBehavior.DropPending = null; // Global, used to work around an issue when using the GenericDragDropManager in IE. +Sys.Extended.UI.SliderBehavior.registerClass('Sys.Extended.UI.SliderBehavior', Sys.Extended.UI.BehaviorBase, Sys.Extended.UI.IDragSource, Sys.Extended.UI.IDropTarget); diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Tabs.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Tabs.debug.js new file mode 100644 index 000000000..90a638e01 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/Tabs.debug.js @@ -0,0 +1,977 @@ +Type.registerNamespace("Sys.Extended.UI"); + +Sys.Extended.UI.TabStripPlacement = function() { } +Sys.Extended.UI.TabStripPlacement.prototype = { + Top: 0, + Bottom: 1, + TopRight: 2, + BottomRight: 3 +} +Sys.Extended.UI.TabStripPlacement.registerEnum("Sys.Extended.UI.TabStripPlacement", true); + +Sys.Extended.UI.UseVerticalStripPlacement = function() { } +Sys.Extended.UI.OnDemand = function() { } + +Sys.Extended.UI.OnDemandMode = function() { } +Sys.Extended.UI.OnDemandMode.prototype = { + None: 0, + Always: 1, + Once: 2 +} +Sys.Extended.UI.OnDemandMode.registerEnum("Sys.Extended.UI.OnDemandMode", true); + +Sys.Extended.UI.TabContainer = function(element) { + Sys.Extended.UI.TabContainer.initializeBase(this, [element]); + this._cachedActiveTabIndex = -1; + this._activeTabIndex = -1; + this._scrollBars = Sys.Extended.UI.ScrollBars.None; + this._tabs = null; + this._header = null; + this._body = null; + this._loaded = false; + this._autoPostBackId = null; + this._useVerticalStripPlacement = false; + this._onDemand = false; + this._pageRequestManager = null; + this._tabStripPlacement = Sys.Extended.UI.TabStripPlacement.Top; + this._app_onload$delegate = Function.createDelegate(this, this._app_onload); +} +Sys.Extended.UI.TabContainer.prototype = { + + /// + /// Fires when a tab is changed + /// + /// + /// + add_activeTabChanged: function(handler) { + this.get_events().addHandler("activeTabChanged", handler); + }, + remove_activeTabChanged: function(handler) { + this.get_events().removeHandler("activeTabChanged", handler); + }, + raise_activeTabChanged: function() { + var eh = this.get_events().getHandler("activeTabChanged"); + if(eh) + eh(this, Sys.EventArgs.Empty); + if(this._autoPostBackId) + __doPostBack(this._autoPostBackId, "activeTabChanged:" + this.get_activeTabIndex()); + }, + raiseActiveTabChanged: function() { + Sys.Extended.Deprecated("raiseActiveTabChanged()", "raise_activeTabChanged()"); + this.raise_activeTabChanged(); + }, + + /// + /// The first tab to show + /// + /// get_activeTabIndex + /// set_activeTabIndex + /// + get_activeTabIndex: function() { + if(this._cachedActiveTabIndex > -1) + return this._cachedActiveTabIndex; + return this._activeTabIndex; + }, + set_activeTabIndex: function(valuePassed) { + var value = valuePassed; + if(!this.get_isInitialized()) { + this._cachedActiveTabIndex = value; + } else { + if(value < -1) + throw Error.argumentOutOfRange("value"); + if(value >= this.get_tabs().length) + value = this.get_tabs().length - 1; + if(value != this._activeTabIndex) { + if(this._activeTabIndex != -1) { + var oldTab = this.get_tabs()[this._activeTabIndex]; + oldTab._set_active(false); + } + + var changed = (this._activeTabIndex != value); + + this._activeTabIndex = value; + + if(this._activeTabIndex != -1) + this.get_tabs()[this._activeTabIndex]._set_active(true); + + if(this._loaded && changed) { + if(this._onDemand) { + var activeTab = this.get_tabs()[this._activeTabIndex]; + if(activeTab._onDemandMode != Sys.Extended.UI.OnDemandMode.None) { + if((activeTab._onDemandMode == Sys.Extended.UI.OnDemandMode.Once && activeTab._wasLoadedOnce == false) + || activeTab._onDemandMode == Sys.Extended.UI.OnDemandMode.Always) { + this._pageRequestManager.beginAsyncPostBack([activeTab._updatePanelID], null, null, false, null); + activeTab.set_wasLoadedOnce(true); + } + } + } + this.raise_activeTabChanged(); + } + this.raisePropertyChanged("activeTabIndex"); + } + } + }, + + /// + /// A collection of tabs + /// + /// get_tabs + /// + get_tabs: function() { + if(this._tabs == null) + this._tabs = []; + return this._tabs; + }, + + /// + /// The currently active tab + /// + /// get_activeTab + /// set_activeTab + /// + get_activeTab: function() { + if(this._activeTabIndex > -1) + return this.get_tabs()[this._activeTabIndex]; + return null; + }, + set_activeTab: function(value) { + var i = Array.indexOf(this.get_tabs(), value); + if(i == -1) + throw Error.argument("value", Sys.Extended.UI.Resources.Tabs_ActiveTabArgumentOutOfRange); + this.set_activeTabIndex(i); + }, + + /// + /// AutoPostback ID + /// + /// get_autoPostBackId + /// set_autoPostBackId + /// + get_autoPostBackId: function() { + return this._autoPostBackId; + }, + set_autoPostBackId: function(value) { + this._autoPostBackId = value; + }, + + /// + /// Determines whether or not to display scrollbars (None, Horizontal, Vertical, Both, Auto) + /// in the TabContainer body + /// + /// get_scrollBars + /// set_scrollBars + /// + get_scrollBars: function() { + return this._scrollBars; + }, + set_scrollBars: function(value) { + if(this._scrollBars != value) { + this._scrollBars = value; + this._invalidate(); + this.raisePropertyChanged("scrollBars"); + } + }, + + /// + /// Determines whether or not to render tabs on top of the container or below (Top, Bottom) + /// + /// get_tabStripPlacement + /// set_tabStripPlacement + /// + get_tabStripPlacement: function() { + return this._tabStripPlacement; + }, + set_tabStripPlacement: function(value) { + if(this._tabStripPlacement != value) { + this._tabStripPlacement = value; + this._invalidate(); + this.raisePropertyChanged("tabStripPlacement"); + } + }, + + /// + /// Determines whether or not to render tabs on the left or right side of the container + /// + /// get_useVerticalStripPlacement + /// set_useVerticalStripPlacement + /// + get_useVerticalStripPlacement: function() { + return this._useVerticalStripPlacement; + }, + set_useVerticalStripPlacement: function(value) { + if(this._useVerticalStripPlacement != value) { + this._useVerticalStripPlacement = value; + this._invalidate(); + this.raisePropertyChanged("useVerticalStripPlacement"); + } + }, + + /// + /// Determines whether or not to render/load tabs on demand or all tabs on page load + /// + /// get_onDemand + /// set_onDemand + /// + get_onDemand: function() { + return this._onDemand; + }, + set_onDemand: function(value) { + if(this._onDemand != value) { + this._onDemand = value; + this._invalidate(); + this.raisePropertyChanged("onDemand"); + } + }, + + initialize: function() { + Sys.Extended.UI.TabContainer.callBaseMethod(this, "initialize"); + + var elt = this.get_element(); + this._header = $get(this.get_id() + "_header"); + this._body = $get(this.get_id() + "_body"); + + // default classes + $common.addCssClasses(elt, [ + "ajax__tab_container", + "ajax__tab_default" + ]); + + this._invalidate(); + if(this._onDemand) + this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); + Sys.Application.add_load(this._app_onload$delegate); + }, + dispose: function() { + $clearHandlers(this.get_element()); + Sys.Application.remove_load(this._app_onload$delegate); + Sys.Extended.UI.TabContainer.callBaseMethod(this, "dispose"); + }, + + /// + /// Returns TabContainer's first tab + /// + /// Include disabled tabs + /// First tab + /// + getFirstTab: function(includeDisabled) { + var tabs = this.get_tabs(); + for(var i = 0; i < tabs.length; i++) + if(includeDisabled || tabs[i].get_enabled()) + return tabs[i]; + return null; + }, + + /// + /// Returns TabContainer's last tab + /// + /// Include disabled tabs + /// Last tab + /// + getLastTab: function(includeDisabled) { + var tabs = this.get_tabs(); + for(var i = tabs.length - 1; i >= 0; i--) + if(includeDisabled || tabs[i].get_enabled()) + return tabs[i]; + return null; + }, + + /// + /// Returns TabContainer's next tab + /// + /// Include disabled tabs + /// Next tab + /// + getNextTab: function(includeDisabled) { + var tabs = this.get_tabs(); + var active = this.get_activeTabIndex(); + for(var i = 1; i < tabs.length; i++) { + var tabIndex = (active + i) % tabs.length; + var tab = tabs[tabIndex]; + if(includeDisabled || tab.get_enabled()) + return tab; + } + return null; + }, + + /// + /// Returns TabContainer's previous tab + /// + /// Include disabled Tabs + /// Previous tab + /// + getPreviousTab: function(includeDisabled) { + var tabs = this.get_tabs(); + var active = this.get_activeTabIndex(); + for(var i = 1; i < tabs.length; i++) { + var tabIndex = (tabs.length + (active - i)) % tabs.length; + var tab = tabs[tabIndex]; + if(includeDisabled || tab.get_enabled()) + return tab; + } + return null; + }, + + /// + /// Returns TabContainer's nearest tab + /// + /// Include disabled tabs + /// + getNearestTab: function(includeDisabled) { + var prev = this.getPreviousTab(includeDisabled); + var next = this.getNextTab(includeDisabled); + if(prev && prev.get_tabIndex() < this._activeTabIndex) + return prev; + else if(next && next.get_tabIndex() > this._activeTabIndex) + return next; + return null; + }, + + /// + /// Saves JSON state serialized on the client side + /// + /// Client state + /// + saveClientState: function() { + var tabs = this.get_tabs(); + + var tabEnabledState = []; + var tabWasLoadedOnceState = []; + for(var i = 0; i < tabs.length; i++) { + Array.add(tabEnabledState, tabs[i].get_enabled()); + Array.add(tabWasLoadedOnceState, tabs[i].get_wasLoadedOnce()); + } + var state = { + ActiveTabIndex: this._activeTabIndex, + TabEnabledState: tabEnabledState, + TabWasLoadedOnceState: tabWasLoadedOnceState + }; + return Sys.Serialization.JavaScriptSerializer.serialize(state); + }, + _invalidate: function() { + if(this.get_isInitialized()) { + $common.removeCssClasses(this._body, [ + "ajax__scroll_horiz", + "ajax__scroll_vert", + "ajax__scroll_both", + "ajax__scroll_auto", + "ajax__scroll_none" + ]); + switch(this._scrollBars) { + case Sys.Extended.UI.ScrollBars.Horizontal: + Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_horiz"); + break; + case Sys.Extended.UI.ScrollBars.Vertical: + Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_vert"); + break; + case Sys.Extended.UI.ScrollBars.Both: + Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_both"); + break; + case Sys.Extended.UI.ScrollBars.Auto: + Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_auto"); + break; + case Sys.Extended.UI.ScrollBars.None: + Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_none"); + break; + } + if(this._useVerticalStripPlacement) { + var headBounds = $common.getBounds(this._header); + var bodyBounds = $common.getBounds(this._body); + var spannerHeight = (bodyBounds.height - headBounds.height - 1) + "px"; + $get(this.get_id() + "_headerSpannerHeight").style.height = spannerHeight; + + if(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) { + if(this._tabStripPlacement == Sys.Extended.UI.TabStripPlacement.Top || + this._tabStripPlacement == Sys.Extended.UI.TabStripPlacement.Bottom) { + var newBounds = { + x: headBounds.x + headBounds.width, + y: headBounds.y, + width: bodyBounds.width, + height: bodyBounds.height + }; + $common.setBounds(this._body, newBounds); + } else { + var newBounds = { + x: bodyBounds.x + bodyBounds.width, + y: headBounds.y, + width: headBounds.width, + height: headBounds.height + }; + $common.setBounds(this._header, newBounds); + $common.setBounds(this._body, bodyBounds); + } + } + } + } + }, + _app_onload: function(sender, e) { + if(this._cachedActiveTabIndex != -1) { + this.set_activeTabIndex(this._cachedActiveTabIndex); + this._cachedActiveTabIndex = -1; + + var activeTab = this.get_tabs()[this._activeTabIndex]; + if(activeTab) { + activeTab.set_wasLoadedOnce(true); + } + } + this._loaded = true; + } +} +Sys.Extended.UI.TabContainer.registerClass("Sys.Extended.UI.TabContainer", Sys.Extended.UI.ControlBase); + +Sys.Extended.UI.TabPanel = function(element) { + Sys.Extended.UI.TabPanel.initializeBase(this, [element]); + this._active = false; + this._tab = null; + this._headerOuter = null; + this._headerInner = null; + this._header = null; + this._owner = null; + this._ownerID = null; + this._enabled = true; + this._tabIndex = -1; + this._dynamicContextKey = null; + this._dynamicServicePath = null; + this._dynamicServiceMethod = null; + this._dynamicPopulateBehavior = null; + this._scrollBars = Sys.Extended.UI.ScrollBars.None; + this._onDemandMode = Sys.Extended.UI.OnDemandMode.Always; + this._wasLoadedOnce = false; + this._updatePanelID = ""; + this.isAttachedDisabledEvents = false; + this.isAttachedEnabledEvents = false; + this._dynamicPopulate_onpopulated$delegate = Function.createDelegate(this, this._dynamicPopulate_onpopulated); + + _oncancel$delegate = Function.createDelegate(this, this._oncancel); + + this._headerEventHandlers = { + mousedown: Function.createDelegate(this, this._header_onmousedown), + dragstart: _oncancel$delegate, + selectstart: _oncancel$delegate, + select: _oncancel$delegate + }; + + this._enabledHeaderEventHandlers = { + click: Function.createDelegate(this, this._header_onclick), + mouseover: Function.createDelegate(this, this._header_onmouseover), + mouseout: Function.createDelegate(this, this._header_onmouseout), + keydown: Function.createDelegate(this, this._onkeydown) + }; +} + +Sys.Extended.UI.TabPanel.prototype = { + + /// + /// Fires on a click + /// + /// + /// + add_click: function(handler) { + this.get_events().addHandler("click", handler); + }, + remove_click: function(handler) { + this.get_events().removeHandler("click", handler); + }, + raise_click: function() { + var eh = this.get_events().getHandler("click"); + if(eh) + eh(this, Sys.EventArgs.Empty); + }, + raiseClick: function() { + Sys.Extended.Deprecated("raiseClick()", "raise_click()"); + this.raise_click(); + }, + + /// + /// Fires when tab populating begins + /// + /// + /// + add_populating: function(handler) { + this.get_events().addHandler("populating", handler); + }, + remove_populating: function(handler) { + this.get_events().removeHandler("populating", handler); + }, + raise_populating: function() { + var eh = this.get_events().getHandler("populating"); + if(eh) + eh(this, Sys.EventArgs.Empty); + }, + raisePopulating: function() { + Sys.Extended.Deprecated("raisePopulating()", "raise_populating()"); + this.raise_populating(); + }, + + /// + /// Fires when tab populating is performed + /// + /// + /// + add_populated: function(handler) { + this.get_events().addHandler("populated", handler); + }, + remove_populated: function(handler) { + this.get_events().removeHandler("populated", handler); + }, + raise_populated: function() { + var eh = this.get_events().getHandler("populated"); + if(eh) + eh(this, Sys.EventArgs.Empty); + }, + raisePopulated: function() { + Sys.Extended.Deprecated("raisePopulated()", "raise_populated()"); + this.raise_populated(); + }, + + /// + /// Text to display in the tab + /// + /// get_headerText + /// set_headerText + /// + get_headerText: function() { + if(this.get_isInitialized()) + return this._header.innerHTML; + return ""; + }, + set_headerText: function(value) { + if(!this.get_isInitialized()) + throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetBeforeInitialization, 'headerText')); + if(this.get_headerText() != value) { + this._header.innerHTML = value; + this.raisePropertyChanged("headerText"); + } + }, + + /// + /// A header tab + /// + /// get_headerTab + /// set_headerTab + /// + get_headerTab: function() { + return this._header; + }, + set_headerTab: function(value) { + if(typeof (value) === "string") { + value = Sys.get(value); + if(!value) + throw new Error.argumentNull("value"); + } + if(this._header != value) { + if(this.get_isInitialized()) + throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization, 'headerTab')); + this._header = value; + this.raisePropertyChanged("value"); + } + }, + + /// + /// Determines whether or not to display the tab for the TabPanel by default + /// + /// get_enabled + /// set_enabled + /// + get_enabled: function() { + return this._enabled; + }, + set_enabled: function(value) { + if(value != this._enabled) { + this._enabled = value; + if(this.get_isInitialized()) + this._makeEnabled(this._enabled); + this.raisePropertyChanged("enabled"); + } + }, + + /// + /// The owner TabContainer + /// + /// get_owner + /// set_owner + /// + get_owner: function() { + return this._owner; + }, + set_owner: function(value) { + if(value instanceof Sys.ComponentSet) value = value.get(0); + if(this._owner != value) { + if(this.get_isInitialized()) + throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization, 'owner')); + this._owner = value; + this.raisePropertyChanged("owner"); + } + }, + + /// + /// The ID of the owner TabContainer element + /// + /// get_ownerID + /// set_ownerID + /// + get_ownerID: function() { + return this._ownerID; + }, + set_ownerID: function(value) { + this._ownerID = value; + }, + + /// + /// Determines whether or not to display scrollbars (None, Horizontal, Vertical, Both, Auto) in the body of the TabPanel + /// + /// get_scrollBars + /// set_scrollBars + /// + get_scrollBars: function() { + return this._scrollBars; + }, + set_scrollBars: function(value) { + if(this._scrollBars != value) { + this._scrollBars = value; + this.raisePropertyChanged("scrollBars"); + } + }, + + /// + /// Determines whether or not to load the tab (Always, Once, None) when the container's onDemand property is true + /// + /// get_onDemandMode + /// set_onDemandMode + /// + get_onDemandMode: function() { + return this._onDemandMode; + }, + set_onDemandMode: function(value) { + if(this._onDemandMode != value) { + this._onDemandMode = value; + this.raisePropertyChanged("onDemandMode"); + } + }, + + /// + /// The current tab index + /// + /// get_tabIndex + /// + get_tabIndex: function() { + return this._tabIndex; + }, + + /// + /// An arbitrary string value to be passed to the dynamically populated web method + /// + /// get_dynamicContextKey + /// set_dynamicContextKey + /// + get_dynamicContextKey: function() { + return this._dynamicContextKey; + }, + set_dynamicContextKey: function(value) { + if(this._dynamicContextKey != value) { + this._dynamicContextKey = value; + this.raisePropertyChanged('dynamicContextKey'); + } + }, + + /// + /// The URL of the web service to call + /// + /// get_dynamicServicePath + /// set_dynamicServicePath + /// + get_dynamicServicePath: function() { + return this._dynamicServicePath; + }, + set_dynamicServicePath: function(value) { + if(this._dynamicServicePath != value) { + this._dynamicServicePath = value; + this.raisePropertyChanged('dynamicServicePath'); + } + }, + + /// + /// The name of the method to call on the page or web service + /// + /// get_dynamicServiceMethod + /// set_dynamicServiceMethod + /// + get_dynamicServiceMethod: function() { + return this._dynamicServiceMethod; + }, + set_dynamicServiceMethod: function(value) { + if(this._dynamicServiceMethod != value) { + this._dynamicServiceMethod = value; + this.raisePropertyChanged('dynamicServiceMethod'); + } + }, + + _get_active: function() { + return this._active; + }, + _set_active: function(value) { + this._active = value; + if(value) + this._activate(); + else + this._deactivate(); + }, + + /// + /// ID of the panel to update + /// + /// get_updatePanelID + /// set_updatePanelID + /// + get_updatePanelID: function() { + return this._updatePanelID; + }, + set_updatePanelID: function(value) { + if(this._updatePanelID != value) { + this._updatePanelID = value; + this.raisePropertyChanged("updatePanelID"); + } + }, + + /// + /// Determines the loading status of the tab in Once demand mode + /// + /// get_wasLoadedOnce + /// set_wasLoadedOnce + /// + get_wasLoadedOnce: function() { + return this._wasLoadedOnce; + }, + set_wasLoadedOnce: function(value) { + if(value != this._wasLoadedOnce) { + this._wasLoadedOnce = value; + this.raisePropertyChanged("wasLoadedOnce"); + } + }, + + initialize: function() { + var owner = this.get_owner(); + if(!owner) { + owner = $find(this.get_ownerID()); + if(owner) { + owner.initialize(); + this.set_owner(owner); + } + } + + Sys.Extended.UI.TabPanel.callBaseMethod(this, "initialize"); + + if(!owner) + throw Error.invalidOperation(Sys.Extended.UI.Resources.Tabs_OwnerExpected); + + this._tabIndex = owner.get_tabs().length; + + Array.add(owner.get_tabs(), this); + var tabId = this.get_id() + "_tab"; + this._tab = document.getElementById(tabId); + + this._makeEnabled(this._enabled); + + $addHandlers(this._header, this._headerEventHandlers); + + var serverRendered = (this._tab != null); + if(!serverRendered) { + this._headerOuterWrapper = document.createElement('span'); + this._headerInnerWrapper = document.createElement('span'); + this._tab = document.createElement('span'); + this._tab.id = tabId; + this._header.parentNode.replaceChild(this._tab, this._header); + this._tab.appendChild(this._headerOuterWrapper); + this._headerOuterWrapper.appendChild(this._headerInnerWrapper); + this._headerInnerWrapper.appendChild(this._header); + + Sys.UI.DomElement.addCssClass(this._headerOuterWrapper, "ajax__tab_outer"); + Sys.UI.DomElement.addCssClass(this._headerInnerWrapper, "ajax__tab_inner"); + Sys.UI.DomElement.addCssClass(this._header, "ajax__tab_tab"); + Sys.UI.DomElement.addCssClass(this.get_element(), "ajax__tab_panel"); + } + }, + + dispose: function() { + if(this._dynamicPopulateBehavior) { + this._dynamicPopulateBehavior.dispose(); + this._dynamicPopulateBehavior = null; + } + + $common.removeHandlers(this._header, this._headerEventHandlers); + + if(this._enabled) + if(this._isAttachedEnabledEvents) + this._removeHandlersOnEnabled(); + else + if(this._isAttachedDisabledEvents) + $common.removeHandlers(this._header, { + click: this._disabled_onclick + }); + + Sys.Extended.UI.TabPanel.callBaseMethod(this, "dispose"); + }, + + _addHandlersOnEnabled: function() { + $addHandlers(this._header, this._enabledHeaderEventHandlers); + this._isAttachedEnabledEvents = true; + }, + + _removeHandlersOnEnabled: function() { + $common.removeHandlers(this._header, this._enabledHeaderEventHandlers); + }, + + populate: function(contextKeyOverride) { + if(this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != this.get_element())) { + this._dynamicPopulateBehavior.dispose(); + this._dynamicPopulateBehavior = null; + } + + if(!this._dynamicPopulateBehavior && this._dynamicServiceMethod) + this._dynamicPopulateBehavior = $create(Sys.Extended.UI.DynamicPopulateBehavior, + { "ContextKey": this._dynamicContextKey, "ServicePath": this._dynamicServicePath, "ServiceMethod": this._dynamicServiceMethod }, + { "populated": this._dynamicPopulate_onpopulated$delegate }, null, this.get_element()); + + if(this._dynamicPopulateBehavior) { + this.raise_populating(); + this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._dynamicContextKey); + } + }, + + _activate: function() { + if(this._enabled) { + $common.setVisible(this.get_element(), true); + + Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_active"); + + this.populate(); + } else if(this._get_active()) { + var next = this._owner.getNearestTab(false); + if(!!next) + this._owner.set_activeTab(next); + } + this._owner.get_element().style.visibility = 'visible'; + }, + + _deactivate: function() { + $common.setVisible(this.get_element(), false); + + Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_disabled"); + Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_active"); + }, + + _show: function() { + this._tab.style.display = ''; + }, + _hide: function() { + this._tab.style.display = 'none'; + if(this._get_active()) { + var next = this._owner.getNearestTab(false); + if(!!next) + this._owner.set_activeTab(next); + } + this._deactivate(); + }, + + _makeEnabled: function(enable) { + var hyperlinkId = "__tab_" + this.get_element().id; + + if(enable) { + if(this._isAttachedDisabledEvents) { + $common.removeHandlers(this._header, { + click: this._disabled_onclick + }); + this._isAttachedDisabledEvents = false; + } + this._addHandlersOnEnabled(); + Sys.UI.DomElement.removeCssClass($get(hyperlinkId), "ajax__tab_disabled"); + } else { + if(this._isAttachedEnabledEvents) { + this._removeHandlersOnEnabled(); + this._isAttachedEnabledEvents = false; + } + $addHandlers(this._header, { + click: this._disabled_onclick + }); + this._isAttachedDisabledEvents = true; + if(this._get_active()) { + var next = this._owner.getNearestTab(false); + if(!!next) + this._owner.set_activeTab(next); + } + this._deactivate(); + Sys.UI.DomElement.addCssClass($get(hyperlinkId), "ajax__tab_disabled"); + } + }, + _setFocus: function(obj) { + var tabEl = $get("__tab_" + obj.get_element().id); + if(tabEl.offsetHeight === 0) + return; + + tabEl.focus(); + }, + _header_onclick: function(e) { + e.preventDefault(); + this.raise_click(); + this.get_owner().set_activeTab(this); + this._setFocus(this); + }, + _header_onmouseover: function(e) { + Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_hover"); + }, + _header_onmouseout: function(e) { + Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_hover"); + }, + _header_onmousedown: function(e) { + e.preventDefault(); + }, + _oncancel: function(e) { + e.stopPropagation(); + e.preventDefault(); + }, + _onkeydown: function(e) { + var keyCode = ('which' in e) ? e.which : e.keyCode; + //right or down + if((keyCode == "39" && !this._owner._useVerticalStripPlacement) || (keyCode == "40" && this._owner._useVerticalStripPlacement)) { + e.preventDefault(); + var next = this._owner.getNextTab(false); + if(next) { + this._owner.set_activeTab(next); + this._setFocus(next); + } + } + //left or up + else if((keyCode == "37" && !this._owner._useVerticalStripPlacement) || (keyCode == "38" && this._owner._useVerticalStripPlacement)) { + e.preventDefault(); + var next = this._owner.getPreviousTab(false); + if(next) { + this._owner.set_activeTab(next); + this._setFocus(next); + } + } + // end + else if(keyCode == "35") { + e.preventDefault(); + var next = this._owner.getLastTab(false); + if(next) { + this._owner.set_activeTab(next); + this._setFocus(next); + } + } + //home + else if(keyCode == "36") { + e.preventDefault(); + var next = this._owner.getFirstTab(false); + if(next) { + this._owner.set_activeTab(next); + this._setFocus(next); + } + } + }, + _dynamicPopulate_onpopulated: function(sender, e) { + this.raise_populated(); + }, + _disabled_onclick: function(e) { + e.preventDefault(); + } +} +Sys.Extended.UI.TabPanel.registerClass("Sys.Extended.UI.TabPanel", Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/TextBoxWatermark.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/TextBoxWatermark.debug.js new file mode 100644 index 000000000..484890c25 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/TextBoxWatermark.debug.js @@ -0,0 +1,342 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.TextBoxWatermarkBehavior = function(element) { + // The TextBoxWatermarkBehavior applies a watermark to a textbox + // "element" - textbox associated with the behavior + Sys.Extended.UI.TextBoxWatermarkBehavior.initializeBase(this, [element]); + + // Properties + this._watermarkText = null; + this._watermarkCssClass = null; + + // Member variables + this._focusHandler = null; + this._blurHandler = null; + this._keyPressHandler = null; + this._propertyChangedHandler = null; + this._watermarkChangedHandler = null; + this._oldClassName = null; + this._clearedForSubmit = null; + this._maxLength = null; + + // Hook into the ASP.NET WebForm_OnSubmit function to clear watermarks prior to submission + if ((typeof(WebForm_OnSubmit) == 'function') && !Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit) { + Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit = WebForm_OnSubmit; + WebForm_OnSubmit = Sys.Extended.UI.TextBoxWatermarkBehavior.WebForm_OnSubmit; + } +} +Sys.Extended.UI.TextBoxWatermarkBehavior.prototype = { + initialize : function() { + // Initialize the behavior + Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(this, 'initialize'); + + var e = this.get_element(); + + // Determine if this textbox is focused initially + var hasInitialFocus = false; + + var clientState = Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(this, 'get_ClientState'); + if (clientState != null && clientState != "") { + hasInitialFocus = (clientState == "Focused"); + Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(this, 'set_ClientState', null); + } + + // Capture the initial style so we can toggle back and forth + // between this and the watermarked style + this._oldClassName = e.className; + + // Create delegates + this._focusHandler = Function.createDelegate(this, this._onFocus); + this._blurHandler = Function.createDelegate(this, this._onBlur); + this._keyPressHandler = Function.createDelegate(this, this._onKeyPress); + + // Attach events + $addHandler(e, 'focus', this._focusHandler); + $addHandler(e, 'blur', this._blurHandler); + $addHandler(e, 'keypress', this._keyPressHandler); + + this.registerPropertyChanged(); + + // Initialize state and simulate a blur to apply the watermark if appropriate + // Note: The comparison against _watermarkText is undesirable, but seemingly + // necessary to support the load->Home->Back scenario in IE + var currentValue = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Current(); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + if (("" == currentValue) || (this._watermarkText == currentValue)) { + wrapper.set_Watermark(this._watermarkText) + wrapper.set_IsWatermarked(true); + } + if (hasInitialFocus) { + this._onFocus(); + } else { + e.blur(); + this._onBlur(); + } + + this._clearedForSubmit = false; + + this.registerPartialUpdateEvents(); + + this._watermarkChangedHandler = Function.createDelegate(this, this._onWatermarkChanged); + wrapper.add_WatermarkChanged(this._watermarkChangedHandler); + }, + + dispose : function() { + // Dispose the behavior + var e = this.get_element(); + + if (this._watermarkChangedHandler) { + Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).remove_WatermarkChanged(this._watermarkChangedHandler); + this._watermarkChangedHandler = null; + } + + // Unhook from Sys.Preview.UI.TextBox if present + if(e.control && this._propertyChangedHandler) { + e.control.remove_propertyChanged(this._propertyChangedHandler); + this._propertyChangedHandler = null; + } + + // Detach events + if (this._focusHandler) { + $removeHandler(e, 'focus', this._focusHandler); + this._focusHandler = null; + } + if (this._blurHandler) { + $removeHandler(e, 'blur', this._blurHandler); + this._blurHandler = null; + } + if (this._keyPressHandler) { + $removeHandler(e, 'keypress', this._keyPressHandler); + this._keyPressHandler = null; + } + + // Clear watermark text to avoid confusion during Refresh/Back/Forward + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()) + this.clearText(false); + + Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(this, 'dispose'); + }, + + _onWatermarkChanged : function(sender, eventArgs) { + // Handler invoked when the watermark changes + if (Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()) + this._onBlur(); + else + this._onFocus(); + }, + + /// + /// Clears the text from the target + /// + /// Whether or not we are focusing on the textbox + /// + clearText : function(focusing) { + var element = this.get_element(); + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(element); + wrapper.set_Value(""); + wrapper.set_IsWatermarked(false); + if(focusing) + element.select(); // This fix displays the blinking cursor in a focused, empty text box in IE + }, + + _onFocus : function(evt) { + // Handler for the textbox's focus event + // "evt" - event info + var e = this.get_element(); + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e).get_IsWatermarked()) { + // Clear watermark + this.clearText(evt ? true : false); + } + e.className = this._oldClassName; + + // Restore the MaxLength on the TextBox when we edit + // the non-watermarked text + if (this._maxLength > 0) { + this.get_element().maxLength = this._maxLength; + this._maxLength = null; + } + }, + + _onBlur : function() { + // Handle the textbox's blur event + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + if(("" == wrapper.get_Current()) || wrapper.get_IsWatermarked()) { + // Enlarge the TextBox's MaxLength if it's not big enough + // to accomodate the watermark + if (this.get_element().maxLength > 0 && this._watermarkText.length > this.get_element().maxLength) { + this._maxLength = this.get_element().maxLength; + this.get_element().maxLength = this._watermarkText.length; + } + + this._applyWatermark(); + } + }, + + _applyWatermark : function() { + // Apply the watermark to the textbox + var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()); + wrapper.set_Watermark(this._watermarkText); + wrapper.set_IsWatermarked(true); + + if(!this._watermarkCssClass) + return; + + var classList = this.get_element().className.split(); + if(classList.indexOf(this._watermarkCssClass) === -1) { + classList.push(this._watermarkCssClass); + this.get_element().className = classList.join(" "); + } + }, + + _onKeyPress : function() { + // Handle the textbox's keypress event + Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).set_IsWatermarked(false); + }, + + /// + /// A method to call to be assigned to Sys.Preview.UI.TextBox if any + /// + /// + /// This method must be called manually if Sys.Preview.UI.TextBox + /// is added after TextBoxWatermarkBehavior is initialized + /// + /// + registerPropertyChanged : function() { + var e = this.get_element(); + if(e.control && !this._propertyChangedHandler) { + this._propertyChangedHandler = Function.createDelegate(this, this._onPropertyChanged); + e.control.add_propertyChanged(this._propertyChangedHandler); + } + }, + + _onPropertyChanged : function(sender, propertyChangedEventArgs) { + // Handler called automatically when a property change event is fired + // "sender" - sender + // "propertyChangedEventArgs" - event arguments + if("text" == propertyChangedEventArgs.get_propertyName()) + this.set_Text(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Current()); + }, + + _onSubmit : function() { + // Handler Called automatically when a submit happens to clear the watermark before posting back + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()) { + // Clear watermark text before page is submitted + this.clearText(false); + this._clearedForSubmit = true; + } + }, + + _partialUpdateEndRequest : function(sender, endRequestEventArgs) { + // Handler Called automatically when a partial postback ends + // "sender" - sender + // "endRequestEventArgs" - event arguments + Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]); + + if (this.get_element() && this._clearedForSubmit) { + // Restore the cleared watermark (useful when the submit was wrapped in an UpdatePanel) + this.get_element().blur(); + this._onBlur(); + this._clearedForSubmit = false; + } + }, + + /// + /// Text to show when the control has no value + /// + /// get_watermarkText + /// set_watermarkText + /// + get_watermarkText: function() { + return this._watermarkText; + }, + set_watermarkText: function(value) { + if(this._watermarkText != value) { + this._watermarkText = value; + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()) + this._applyWatermark(); + this.raisePropertyChanged('watermarkText'); + } + }, + + get_WatermarkText : function() { + Sys.Extended.Deprecated("get_WatermarkText()", "get_watermarkText()"); + return this.get_watermarkText(); + }, + set_WatermarkText : function(value) { + Sys.Extended.Deprecated("set_WatermarkText(value)", "set_watermarkText(value)"); + this.set_watermarkText(value); + }, + + /// + /// A CSS class to apply to the TextBox when it has no value (e.g. watermark text is shown) + /// + /// get_watermarkCssClass + /// set_watermarkCssClass + /// + get_watermarkCssClass: function() { + return this._watermarkCssClass; + }, + set_watermarkCssClass: function(value) { + if(this._watermarkCssClass != value) { + this._watermarkCssClass = value; + if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()) + this._applyWatermark(); + this.raisePropertyChanged('watermarkCssClass'); + } + }, + + get_WatermarkCssClass : function() { + Sys.Extended.Deprecated("get_WatermarkCssClass()", "get_watermarkCssClass()"); + return this.get_watermarkCssClass(); + }, + set_WatermarkCssClass : function(value) { + Sys.Extended.Deprecated("set_WatermarkCssClass(value)", "set_watermarkCssClass(value)"); + this.set_watermarkCssClass(value); + }, + + /// + /// Text of the target TextBox + /// + /// get_text + /// set_text + /// + get_text: function() { + // Wrapper for the textbox's text that will ignore or create the watermark as appropriate + return Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value(); + }, + set_text: function(value) { + if ("" == value) { + Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).set_Current(""); + this.get_element().blur(); + this._onBlur(); // onBlur needs to see "" + } else { + this._onFocus(); // onFocus sets "" + Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).set_Current(value); + } + }, + + get_Text : function() { + Sys.Extended.Deprecated("get_Text()", "get_text()"); + return this.get_text(); + }, + set_Text : function(value) { + Sys.Extended.Deprecated("set_Text(value)", "set_text(value)"); + this.set_text(value); + } +} +Sys.Extended.UI.TextBoxWatermarkBehavior.registerClass('Sys.Extended.UI.TextBoxWatermarkBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.TextBoxWatermarkBehavior.WebForm_OnSubmit = function() { + // Wraps ASP.NET's WebForm_OnSubmit in order to strip all watermarks prior to submission + // returns - result of original WebForm_OnSubmit + var result = Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit(); + if (result) { + var components = Sys.Application.getComponents(); + for(var i = 0 ; i < components.length ; i++) { + var component = components[i]; + if (Sys.Extended.UI.TextBoxWatermarkBehavior.isInstanceOfType(component)) + component._onSubmit(); + } + } + return result; +} \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ToggleButton.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ToggleButton.debug.js new file mode 100644 index 000000000..2afa6c485 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ToggleButton.debug.js @@ -0,0 +1,459 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ToggleButtonBehavior = function(element) { + // The ToggleButtonBehavior is used to replace a checkbox with a pair of images + Sys.Extended.UI.ToggleButtonBehavior.initializeBase(this, [element]); + + // "Constants" + this._idDecoration = '_ToggleButton'; + + // Properties + this._imageWidth = null; + this._imageHeight = null; + this._uncheckedImageUrl = null; + this._checkedImageUrl = null; + this._disabledUncheckedImageUrl = null; + this._disabledCheckedImageUrl = null; + this._checkedImageOverUrl = null; + this._uncheckedImageOverUrl = null; + this._uncheckedImageAlternateText = null; + this._checkedImageAlternateText = null; + this._checkedImageOverAlternateText = null; + this._uncheckedImageOverAlternateText = null; + + // Member variables + this._decoyElement = null; + this._decoyElementClickHandler = null; + this._checkChangedHandler = null; + this._divContent = null; + this._clickHandler = null; + this._decoyElementMouseOverHandler = null; + this._decoyElementMouseOutHandler = null; +} +Sys.Extended.UI.ToggleButtonBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.ToggleButtonBehavior.callBaseMethod(this, 'initialize'); + + var e = this.get_element(); + + // Create a decoy element to overlay the checkbox graphic and click it when clicked + this._divContent = document.createElement('div'); + this._divContent.style.position = 'relative'; + this._decoyElement = document.createElement('a'); + e.parentNode.insertBefore(this._divContent, e); + this._decoyElement.id = e.id + this._idDecoration; + this._decoyElement.href = ''; + this._divContent.appendChild(this._decoyElement); + + // Set the style of the checkbox to size it and hide it + e.style.visibility = 'hidden'; + // Set the style of the decoy element to position absolutely over the checkbox graphic + var decoyElementStyle = this._decoyElement.style; + decoyElementStyle.position = 'absolute'; + // Initialize left and top to 0px for Opera + decoyElementStyle.left = '0px'; + decoyElementStyle.top = '0px'; + decoyElementStyle.width = this._imageWidth + 'px'; + decoyElementStyle.height = this._imageHeight + 'px'; + + //Firefox uses fontSize to determine the height of href + decoyElementStyle.fontSize = this._imageHeight + 'px'; + + // Make the decoy element look right + decoyElementStyle.backgroundRepeat = 'no-repeat'; + this._onClick(); + + // Create delegates + this._clickHandler = Function.createDelegate(this, this._onClick); + this._checkChangedHandler = Function.createDelegate(this, this._onClick); + this._decoyElementClickHandler = Function.createDelegate(this, this._onDecoyElementClick); + this._decoyElementMouseOverHandler = Function.createDelegate(this, this._onDecoyElementMouseOver); + this._decoyElementMouseOutHandler = Function.createDelegate(this, this._onDecoyElementMouseOut); + + // Attach events + $addHandler(e, "click", this._clickHandler); + $addHandler(e, "change", this._checkChangedHandler); + $addHandler(this._decoyElement, "click", this._decoyElementClickHandler); + $addHandler(this._decoyElement, "mouseover", this._decoyElementMouseOverHandler); + $addHandler(this._decoyElement, "mouseout", this._decoyElementMouseOutHandler); + + // Find any any label elements "for" the checkbox and update them to be "for" the decoy element + // Only for Internet Explorer + if(Sys.Browser.agent === Sys.Browser.InternetExplorer) { + var labels = this._divContent.parentNode.getElementsByTagName('label'); + for(i = 0 ; i < labels.length ; i++) + if(e.id == labels[i].htmlFor) + labels[i].htmlFor = e.id + this._idDecoration; + } + }, + + dispose: function() { + // Detach events + if(this._decoyElementClickHandler) { + $removeHandler(this._decoyElement, "click", this._decoyElementClickHandler); + this._decoyElementClickHandler = null; + } + if(this._checkChangedHandler) { + $removeHandler(this.get_element(), "change", this._checkChangedHandler); + this._checkChangedHandler = null; + } + if(this._clickHandler) { + $removeHandler(this.get_element(), "click", this._clickHandler); + this._clickHandler = null; + } + if(this._decoyElementMouseOverHandler) { + $removeHandler(this._decoyElement, "mouseover", this._decoyElementMouseOverHandler); + this._decoyElementMouseOverHandler = null; + } + if(this._decoyElementMouseOutHandler) { + $removeHandler(this._decoyElement, "mouseout", this._decoyElementMouseOutHandler); + this._decoyElementMouseOutHandler = null; + } + + Sys.Extended.UI.ToggleButtonBehavior.callBaseMethod(this, 'dispose'); + }, + + _onClick: function() { + if(this.get_element().checked) { + this._decoyElement.style.backgroundImage = 'url(' + (this.get_element().disabled ? this.get_disabledCheckedImageUrl() : this._checkedImageUrl) + ')'; + if(this._checkedImageAlternateText) + this._decoyElement.title = this._checkedImageAlternateText; + } else { + this._decoyElement.style.backgroundImage = 'url(' + (this.get_element().disabled ? this.get_disabledUncheckedImageUrl() : this._uncheckedImageUrl) + ')'; + if(this._uncheckedImageAlternateText) + this._decoyElement.title = this._uncheckedImageAlternateText; + } + }, + + _onDecoyElementClick: function(e) { + this.get_element().click(); + e.preventDefault(); + return false; + }, + + _onDecoyElementMouseOver: function(e) { + var e = this.get_element(); + if(e && !e.disabled) + if(e.checked && this._checkedImageOverUrl) { + this._decoyElement.style.backgroundImage = 'url(' + this._checkedImageOverUrl + ')'; + if(this._checkedImageOverAlternateText) + this._decoyElement.title = this._checkedImageOverAlternateText; + } else if(!e.checked && this._uncheckedImageOverUrl) { + this._decoyElement.style.backgroundImage = 'url(' + this._uncheckedImageOverUrl + ')'; + if(this._uncheckedImageOverAlternateText) + this._decoyElement.title = this._uncheckedImageOverAlternateText; + } + }, + + _onDecoyElementMouseOut: function(e) { + // Call _onClick because it restores the correct image + this._onClick(); + }, + + /// + /// The width of an image + /// + /// get_imageWidth + /// set_imageWidth + /// + get_imageWidth: function() { + return this._imageWidth; + }, + set_imageWidth: function(value) { + if(this._imageWidth != value) { + this._imageWidth = value; + this.raisePropertyChanged('imageWidth'); + } + }, + + get_ImageWidth: function() { + Sys.Extended.Deprecated("get_ImageWidth()", "get_imageWidth()"); + return this.get_imageWidth(); + }, + set_ImageWidth: function(value) { + Sys.Extended.Deprecated("set_ImageWidth(value)", "set_imageWidth(value)"); + this.set_imageWidth(value); + }, + + /// + /// The height of an image + /// + /// get_imageHeight + /// set_imageHeight + /// + get_imageHeight: function() { + return this._imageHeight; + }, + set_imageHeight: function(value) { + if(this._imageHeight != value) { + this._imageHeight = value; + this.raisePropertyChanged('imageHeight'); + } + }, + + get_ImageHeight: function() { + Sys.Extended.Deprecated("get_ImageHeight()", "get_imageHeight()"); + return this.get_imageHeight(); + }, + set_ImageHeight: function(value) { + Sys.Extended.Deprecated("set_ImageHeight(value)", "set_imageHeight(value)"); + this.set_imageHeight(value); + }, + + /// + /// The URL of an image to show when the toggle button is in the unchecked state + /// + /// get_uncheckedImageUrl + /// set_uncheckedImageUrl + /// + get_uncheckedImageUrl: function() { + return this._uncheckedImageUrl; + }, + set_uncheckedImageUrl: function(value) { + if(this._uncheckedImageUrl != value) { + this._uncheckedImageUrl = value; + this.raisePropertyChanged('uncheckedImageUrl'); + } + }, + + get_UncheckedImageUrl: function() { + Sys.Extended.Deprecated("get_UncheckedImageUrl()", "get_uncheckedImageUrl()"); + return this.get_uncheckedImageUrl(); + }, + set_UncheckedImageUrl: function(value) { + Sys.Extended.Deprecated("set_UncheckedImageUrl(value)", "set_uncheckedImageUrl(value)"); + this.set_uncheckedImageUrl(value); + }, + + /// + /// The URL of an image to show when the toggle button is in the checked state + /// + /// get_checkedImageUrl + /// set_checkedImageUrl + /// + get_checkedImageUrl: function() { + return this._checkedImageUrl; + }, + set_checkedImageUrl: function(value) { + if(this._checkedImageUrl != value) { + this._checkedImageUrl = value; + this.raisePropertyChanged('checkedImageUrl'); + } + }, + + get_CheckedImageUrl: function() { + Sys.Extended.Deprecated("get_CheckedImageUrl()", "get_checkedImageUrl()"); + return this.get_checkedImageUrl(); + }, + set_CheckedImageUrl: function(value) { + Sys.Extended.Deprecated("set_CheckedImageUrl(value)", "set_checkedImageUrl(value)"); + this.set_checkedImageUrl(value); + }, + + /// + /// The URL of an image to show when the toggle button is disabled and in the unchecked state + /// + /// get_disabledUncheckedImageUrl + /// set_disabledUncheckedImageUrl + /// + get_disabledUncheckedImageUrl: function() { + return (this._disabledUncheckedImageUrl != undefined) ? + this._disabledUncheckedImageUrl : this._uncheckedImageUrl; + }, + set_disabledUncheckedImageUrl: function(value) { + if(this._disabledUncheckedImageUrl != value) { + this._disabledUncheckedImageUrl = value; + this.raisePropertyChanged('disabledUncheckedImageUrl'); + } + }, + + get_DisabledUncheckedImageUrl: function() { + Sys.Extended.Deprecated("get_DisabledUncheckedImageUrl()", "get_disabledUncheckedImageUrl()"); + return this.get_disabledUncheckedImageUrl(); + }, + set_DisabledUncheckedImageUrl: function(value) { + Sys.Extended.Deprecated("set_DisabledUncheckedImageUrl(value)", "set_disabledUncheckedImageUrl(value)"); + this.set_disabledUncheckedImageUrl(value); + }, + + /// + /// The URL of an image to show when the toggle button is disabled and in the checked state + /// + /// get_disabledCheckedImageUrl + /// set_disabledCheckedImageUrl + /// + get_disabledCheckedImageUrl: function() { + return (this._disabledUncheckedImageUrl != undefined) ? + this._disabledCheckedImageUrl : this._checkedImageUrl; + }, + set_disabledCheckedImageUrl: function(value) { + if(this._disabledCheckedImageUrl != value) { + this._disabledCheckedImageUrl = value; + this.raisePropertyChanged('disabledCheckedImageUrl'); + } + }, + + get_DisabledCheckedImageUrl: function() { + Sys.Extended.Deprecated("get_DisabledCheckedImageUrl()", "get_disabledCheckedImageUrl()"); + return this.get_disabledCheckedImageUrl(); + }, + set_DisabledCheckedImageUrl: function(value) { + Sys.Extended.Deprecated("set_DisabledCheckedImageUrl(value)", "set_disabledCheckedImageUrl(value)"); + this.set_disabledCheckedImageUrl(value); + }, + + /// + /// The URL of an image to show when the toggle button is in the checked + /// state and the mouse is over the button + /// + /// get_checkedImageOverUrl + /// set_checkedImageOverUrl + /// + get_checkedImageOverUrl: function() { + return this._checkedImageOverUrl; + }, + set_checkedImageOverUrl: function(value) { + if(this._checkedImageOverUrl != value) { + this._checkedImageOverUrl = value; + this.raisePropertyChanged('checkedImageOverUrl'); + } + }, + + get_CheckedImageOverUrl: function() { + Sys.Extended.Deprecated("get_CheckedImageOverUrl()", "get_checkedImageOverUrl()"); + return this.get_checkedImageOverUrl(); + }, + set_CheckedImageOverUrl: function(value) { + Sys.Extended.Deprecated("set_CheckedImageOverUrl(value)", "set_checkedImageOverUrl(value)"); + this.set_checkedImageOverUrl(value); + }, + + /// + /// The URL of an image to show when the toggle button is in the unchecked + /// state and the mouse is over the button + /// + /// get_uncheckedImageOverUrl + /// set_uncheckedImageOverurl + /// + get_uncheckedImageOverUrl: function() { + return this._uncheckedImageOverUrl; + }, + set_uncheckedImageOverUrl: function(value) { + if(this._uncheckedImageOverUrl != value) { + this._uncheckedImageOverUrl = value; + this.raisePropertyChanged('uncheckedImageOverUrl'); + } + }, + + get_UncheckedImageOverUrl: function() { + Sys.Extended.Deprecated("get_UncheckedImageOverUrl()", "get_uncheckedImageOverUrl()"); + return this.get_uncheckedImageOverUrl(); + }, + set_UncheckedImageOverUrl: function(value) { + Sys.Extended.Deprecated("set_UncheckedImageOverUrl(value)", "set_uncheckedImageOverUrl(value)"); + this.set_uncheckedImageOverUrl(value); + }, + + /// + /// The alt text to show when the toggle button is in the unchecked state + /// + /// get_uncheckedImageAlternateText + /// set_uncheckedImageAlternateText + /// + get_uncheckedImageAlternateText: function() { + return this._uncheckedImageAlternateText; + }, + set_uncheckedImageAlternateText: function(value) { + if(this._uncheckedImageAlternateText != value) { + this._uncheckedImageAlternateText = value; + this.raisePropertyChanged('uncheckedImageAlternateText'); + } + }, + + get_UncheckedImageAlternateText: function() { + Sys.Extended.Deprecated("get_UncheckedImageAlternateText()", "get_uncheckedImageAlternateText()"); + return this.get_uncheckedImageAlternateText(); + }, + set_UncheckedImageAlternateText: function(value) { + Sys.Extended.Deprecated("set_UncheckedImageAlternateText(value)", "set_uncheckedImageAlternateText(value)"); + this.set_uncheckedImageAlternateText(value); + }, + + /// + /// The alt text to show when the toggle button is in the checked state + /// + /// get_checkedImageAlternateText + /// set_checkedImageAlternateText + /// + get_checkedImageAlternateText: function() { + return this._checkedImageAlternateText; + }, + set_checkedImageAlternateText: function(value) { + if(this._checkedImageAlternateText != value) { + this._checkedImageAlternateText = value; + this.raisePropertyChanged('checkedImageAlternateText'); + } + }, + + get_CheckedImageAlternateText: function() { + Sys.Extended.Deprecated("get_CheckedImageAlternateText()", "get_checkedImageAlternateText()"); + return this.get_checkedImageAlternateText(); + }, + set_CheckedImageAlternateText: function(value) { + Sys.Extended.Deprecated("set_CheckedImageAlternateText(value)", "set_checkedImageAlternateText(value)"); + this.set_checkedImageAlternateText(value); + }, + + /// + /// The alt text to show when the toggle button is in the checked state + /// and the mouse is over the button + /// + /// get_checkedImageOverAlternateText + /// set_checkedImageOverAlternateText + /// + get_checkedImageOverAlternateText: function() { + return this._checkedImageOverAlternateText; + }, + set_checkedImageOverAlternateText: function(value) { + if(this._checkedImageOverAlternateText != value) { + this._checkedImageOverAlternateText = value; + this.raisePropertyChanged('checkedImageOverAlternateText'); + } + }, + + get_CheckedImageOverAlternateText: function() { + Sys.Extended.Deprecated("get_CheckedImageOverAlternateText()", "get_checkedImageOverAlternateText()"); + return this.get_checkedImageOverAlternateText(); + }, + set_CheckedImageOverAlternateText: function(value) { + Sys.Extended.Deprecated("set_CheckedImageOverAlternateText(value)", "set_checkedImageOverAlternateTet(value)"); + this.set_checkedImageOverAlternateText(value); + }, + + /// + /// The alt text to show when the toggle button is in the unchecked + /// state and the mouse is over the button + /// + /// get_uncheckedImageOverAlternateText + /// set_uncheckedImageOverAlternateText + /// + get_uncheckedImageOverAlternateText: function() { + return this._uncheckedImageOverAlternateText; + }, + set_uncheckedImageOverAlternateText: function(value) { + if(this._uncheckedImageOverAlternateText != value) { + this._uncheckedImageOverAlternateText = value; + this.raisePropertyChanged('uncheckedImageOverAlternateText'); + } + }, + + get_UncheckedImageOverAlternateText: function() { + Sys.Extended.Deprecated("get_UncheckedImageOverAlternateText()", "get_uncheckedImageOverAlternateText()"); + return this.get_uncheckedImageOverAlternateText(); + }, + set_UncheckedImageOverAlternateText: function(value) { + Sys.Extended.Deprecated("set_UncheckedImageOverAlternateText(value)", "set_uncheckedImageOverAlternateTet(value)"); + this.set_uncheckedImageOverAlternateText(value); + } +} +Sys.Extended.UI.ToggleButtonBehavior.registerClass('Sys.Extended.UI.ToggleButtonBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/UpdatePanelAnimation.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/UpdatePanelAnimation.debug.js new file mode 100644 index 000000000..54fe44f26 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/UpdatePanelAnimation.debug.js @@ -0,0 +1,239 @@ +Type.registerNamespace('Sys.Extended.UI.Animation'); + +Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior = function(element) { + // Play animations just before and just after an UpdatePanel updates + // "element" - updatePanel associated with the behavior + Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.initializeBase(this, [element]); + + // Generic animation behaviors that automatically build animations from JSON descriptions + this._onUpdating = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); + this._onUpdated = new Sys.Extended.UI.Animation.GenericAnimationBehavior(element); + + this._postBackPending = null; + this._pageLoadedHandler = null; + this._alwaysFinishOnUpdatingAnimation = null; + this._triggerControlsClientID = null; +}; +Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.callBaseMethod(this, 'initialize'); + + // Wrap the UpdatePanel in another div (or span) that we'll do the animation with + var element = this.get_element(); + var parentDiv = document.createElement(element.tagName); + element.parentNode.insertBefore(parentDiv, element); + parentDiv.appendChild(element); + + // Move the behavior from the UpdatePanel to the new parent div + Array.remove(element._behaviors, this); + Array.remove(element._behaviors, this._onUpdating); + Array.remove(element._behaviors, this._onUpdated); + if(parentDiv._behaviors) { + Array.add(parentDiv._behaviors, this); + Array.add(parentDiv._behaviors, this._onUpdating); + Array.add(parentDiv._behaviors, this._onUpdated); + } else { + parentDiv._behaviors = [this, this._onUpdating, this._onUpdated]; + } + this._element = this._onUpdating._element = this._onUpdated._element = parentDiv; + + // Initialize the generic animation behaviors + this._onUpdating.initialize(); + this._onUpdated.initialize(); + + // Attach to the beginRequest/pageLoaded events (and we'll get _pageRequestManager + // from calling registerPartialUpdates) + this.registerPartialUpdateEvents(); + this._pageLoadedHandler = Function.createDelegate(this, this._pageLoaded); + this._pageRequestManager.add_pageLoaded(this._pageLoadedHandler); + }, + + dispose: function() { + // Important: remove event handler before calling base dispose + // (which will set _pageRequestManager to null) + if(this._pageRequestManager && this._pageLoadedHandler) { + this._pageRequestManager.remove_pageLoaded(this._pageLoadedHandler); + this._pageLoadedHandler = null; + } + + Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.callBaseMethod(this, 'dispose'); + }, + + _partialUpdateBeginRequest: function(sender, beginRequestEventArgs) { + // Method that will be called when a partial update (via an UpdatePanel) begins, + // if registerPartialUpdateEvents() has been called. + // "sender" - sender + // "beginRequestEventArgs" - event arguments + Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.callBaseMethod(this, '_partialUpdateBeginRequest', [sender, beginRequestEventArgs]); + + if(!this._postBackPending) { + if(this._triggerControlsClientID.indexOf(sender._activeElement.id) != -1) + { + this._postBackPending = true; + this._onUpdated.quit(); + this._onUpdating.play(); + } + } + }, + + _pageLoaded: function(sender, args) { + // Method that will be called when a partial update (via an UpdatePanel) finishes + // "sender" - sender + // "args" - event arguments + if(this._postBackPending) { + this._postBackPending = false; + + var element = this.get_element(); + var panels = args.get_panelsUpdated(); + for(var i = 0; i < panels.length; i++) { + if(panels[i].parentNode == element) + if(this._alwaysFinishOnUpdatingAnimation) { + this._tryAndStopOnUpdating(); + } + else { + this._onUpdating.quit(); + this._onUpdated.play(); + } + break; + } + } + }, + + _tryAndStopOnUpdating: function() { + if(this._onUpdating.get_animation().get_isPlaying()) { + var context = this; + window.setTimeout(function() { context._tryAndStopOnUpdating.apply(context); }, 200); + } + else { + this._onUpdating.quit(); + this._onUpdated.play(); + } + }, + + /// + /// Generic animation played as when any UpdatePanel begins updating + /// + /// get_onUpdating + /// set_onUpdating + /// + get_onUpdating: function() { + return this._onUpdating.get_json(); + }, + set_onUpdating: function(value) { + this._onUpdating.set_json(value); + this.raisePropertyChanged('onUpdating'); + }, + + get_OnUpdating: function() { + Sys.Extended.Deprecated("get_OnUpdating()", "get_onUpdating()"); + return this.get_onUpdating(); + }, + set_OnUpdating: function(value) { + Sys.Extended.Deprecated("set_OnUpdating(value)", "set_onUpdating(value)"); + this.set_onUpdating(); + }, + + /// + /// Generic OnUpdating Animation's behavior + /// + /// get_onUpdatingBehavior + /// + get_onUpdatingBehavior: function() { + return this._onUpdating; + }, + get_OnUpdatingBehavior: function() { + Sys.Extended.Deprecated("get_OnUpdatingBehavior()", "get_onUpdatingBehavior()"); + return this.get_onUpdatingBehavior(); + }, + + /// + /// Generic animation played after the UpdatePanel has finished updating + /// (but only if the UpdatePanel was changed) + /// + /// get_onUpdated + /// set_onUpdated + /// + get_onUpdated: function() { + return this._onUpdated.get_json(); + }, + set_onUpdated: function(value) { + this._onUpdated.set_json(value); + this.raisePropertyChanged('onUpdated'); + }, + + get_OnUpdated: function() { + Sys.Extended.Deprecated("get_OnUpdated()", "get_onUpdated()"); + return this.get_onUpdated(); + }, + set_OnUpdated: function(value) { + Sys.Extended.Deprecated("set_OnUpdated(value)", "set_onUpdated(value)"); + this.set_onUpdated(value); + }, + + /// + /// Generic OnUpdated Animation's behavior + /// + /// get_onUpdatedBehavior + /// + get_onUpdatedBehavior: function() { + return this._onUpdated; + }, + get_OnUpdatedBehavior: function() { + Sys.Extended.Deprecated("get_OnUpdatedBehavior()", "get_onUpdatedBehavior()"); + return this.get_onUpdatedBehavior(); + }, + + /// + /// An optional property that makes sure the OnUpdated event will fire + /// only after the onUpdating event is completed + /// + /// get_alwaysFinishOnUpdatingAnimation + /// set_alwaysFinishOnUpdatingAnimation + /// + get_alwaysFinishOnUpdatingAnimation: function() { + // Indicates whether to always finish play the OnUpating animation before the + // OnUpdated animation starts. + return this._alwaysFinishOnUpdatingAnimation; + }, + set_alwaysFinishOnUpdatingAnimation: function(value) { + if(this._alwaysFinishOnUpdatingAnimation != value) { + this._alwaysFinishOnUpdatingAnimation = value; + this.raisePropertyChanged('alwaysFinishOnUpdatingAnimation'); + } + }, + + get_AlwaysFinishOnUpdatingAnimation: function() { + Sys.Extended.Deprecated("get_AlwaysFinishOnUpdatingAnimation()", "get_alwaysFinishOnUpdatingAnimation()"); + return this.get_alwaysFinishOnUpdatingAnimation(); + }, + set_AlwaysFinishOnUpdatingAnimation: function(value) { + Sys.Extended.Deprecated("set_AlwaysFinishOnUpdatingAnimation(value)", "set_alwaysFinishOnUpdatingAnimation(value)"); + this.set_alwaysFinishOnUpdatingAnimation(value); + }, + + /// + /// ClientIDs of the trigger controls + /// + /// get_triggerControlsClientID + /// set_triggerControlsClientID + /// + get_triggerControlsClientID: function() { + return this._triggerControlsClientID;; + }, + set_triggerControlsClientID: function(value) { + if(this._triggerControlsClientID != value) { + this._triggerControlsClientID = value; + this.raisePropertyChanged('triggerControlsClientID'); + } + }, + + get_TriggerControlsClientID: function() { + Sys.Extended.Deprecated("get_TriggerControlsClientID()", "get_triggerControlsClientID()"); + return this._triggerControlsClientID; + }, + set_TriggerControlsClientID: function(value) { + Sys.Extended.Deprecated("set_TriggerControlsClientID(value)", "set_triggerControlsClientID(value)"); + this.set_triggerControlsClientID(value); + } +}; +Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.registerClass('Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior', Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ValidatorCallout.debug.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ValidatorCallout.debug.js new file mode 100644 index 000000000..0922796d4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Debug/ValidatorCallout.debug.js @@ -0,0 +1,564 @@ +Type.registerNamespace('Sys.Extended.UI'); + +Sys.Extended.UI.ValidatorCalloutBehavior = function Sys$Extended$UI$ValidatorCalloutBehavior(element) { + Sys.Extended.UI.ValidatorCalloutBehavior.initializeBase(this, [element]); + + this._warningIconImageUrl = null; + this._closeImageUrl = null; + this._cssClass = "ajax__validatorcallout"; + this._highlightCssClass = null; + this._popupPosition = Sys.Extended.UI.ValidatorCalloutPosition.Right; + this._width = "200px"; + this._invalid = false; + this._originalValidationMethod = null; + this._validationMethodOverride = null; + this._elementToValidate = null; + this._popupTable = null; + this._errorMessageCell = null; + this._calloutArrowCell = null; + this._warningIconImage = null; + this._closeImage = null; + this._closeCellInnerDiv = null; + this._popupBehavior = null; + this._onShowJson = null; + this._onHideJson = null; + this._focusAttached = false; + this._isBuilt = false; + this._focusHandler = Function.createDelegate(this, this._onfocus); + this._closeClickHandler = Function.createDelegate(this, this._oncloseClick); +}; + +Sys.Extended.UI.ValidatorCalloutBehavior.prototype = { + initialize: function() { + Sys.Extended.UI.ValidatorCalloutBehavior.callBaseMethod(this, 'initialize'); + var elt = this.get_element(); + + // Override the evaluation method of the current validator + if(elt.evaluationfunction) { + this._originalValidationMethod = Function.createDelegate(elt, elt.evaluationfunction); + this._validationMethodOverride = Function.createDelegate(this, this._onvalidate); + elt.evaluationfunction = this._validationMethodOverride; + } + + // Check for failed server-side validation (indicated by non-empty ClientState) + var clientState = this.get_ClientState(); + if((null != clientState) && ("" !== clientState)) { + this._ensureCallout(); + // Apply HightLightCssClass for failed server-side validation + if(this._highlightCssClass) + Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass); + this.show(); + } + }, + + _ensureCallout: function() { + if(!this._isBuilt) { + var elt = this.get_element(); + + // create the DOM elements + var elementToValidate = this._elementToValidate = $get(elt.controltovalidate); + var popupTableBody = document.createElement("tbody"); + var popupTableRow = document.createElement("tr"); + var calloutCell = document.createElement("td"); + var calloutTable = document.createElement("table"); + var calloutTableBody = document.createElement("tbody"); + var calloutTableRow = document.createElement("tr"); + var iconCell = document.createElement("td"); + var closeCell = document.createElement("td"); + var closeCellInnerDiv = this._closeCellInnerDiv = document.createElement("div"); + var popupTable = this._popupTable = document.createElement("table"); + var calloutArrowCell = this._calloutArrowCell = document.createElement("td"); + var warningIconImage = this._warningIconImage = document.createElement("img"); + var closeImage = this._closeImage = document.createElement("img"); + var errorMessageCell = this._errorMessageCell = document.createElement("td"); + + // popupTable + popupTable.id = this.get_id() + "_popupTable"; + popupTable.width = this.get_width(); + popupTable.className = this._cssClass + " ajax__validatorcallout_popup_table"; + + // popupTableRow + popupTableRow.className = "ajax__validatorcallout_popup_table_row"; + + // calloutCell + calloutCell.className = "ajax__validatorcallout_callout_cell"; + + // calloutTable + calloutTable.className = "ajax__validatorcallout_callout_table"; + + // calloutTableRow + calloutTableRow.className = "ajax__validatorcallout_callout_table_row"; + + // calloutArrowCell + if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft) + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell_bottomleftpos"; + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomRight) + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell_bottomrightpos"; + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopLeft) + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell_topleftpos"; + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopRight) + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell_toprightpos"; + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.Left) + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell_leftpos"; + else + calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell"; + + // iconCell + iconCell.className = "ajax__validatorcallout_icon_cell"; + + // _warningIconImage + warningIconImage.border = 0; + warningIconImage.src = this.get_warningIconImageUrl(); + + // _errorMessageCell + errorMessageCell.className = "ajax__validatorcallout_error_message_cell"; + errorMessageCell.innerHTML = this._getErrorMessage(); + + // closeCell + closeCell.className = "ajax__validatorcallout_close_button_cell"; + + // closeImage + closeCellInnerDiv.className = "ajax__validatorcallout_innerdiv"; + closeImage.src = this.get_closeImageUrl(); + + // Create the DOM tree + elt.parentNode.appendChild(popupTable); + popupTable.appendChild(popupTableBody); + popupTableBody.appendChild(popupTableRow); + popupTableRow.appendChild(calloutCell); + calloutCell.appendChild(calloutTable); + calloutTable.appendChild(calloutTableBody); + calloutTableBody.appendChild(calloutTableRow); + calloutTableRow.appendChild(calloutArrowCell); + popupTableRow.appendChild(iconCell); + iconCell.appendChild(warningIconImage); + popupTableRow.appendChild(errorMessageCell); + popupTableRow.appendChild(closeCell); + closeCellInnerDiv.appendChild(closeImage); + closeCell.appendChild(closeCellInnerDiv); + if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft || + this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomRight) { + var calloutExtraTableRow = document.createElement("tr"); + popupTableBody.insertBefore(calloutExtraTableRow, popupTableRow); + calloutArrowCell.colSpan = 2; + calloutExtraTableRow.appendChild(calloutArrowCell); + popupTableRow.appendChild(iconCell); + popupTableRow.appendChild(errorMessageCell); + popupTableRow.appendChild(closeCell); + } + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopLeft || + this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopRight) { + var calloutExtraTableRow = document.createElement("tr"); + popupTableBody.appendChild(calloutExtraTableRow); + calloutArrowCell.colSpan = 2; + calloutExtraTableRow.appendChild(calloutArrowCell); + popupTableRow.appendChild(iconCell); + popupTableRow.appendChild(errorMessageCell); + popupTableRow.appendChild(closeCell); + } else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.Left) { + popupTableRow.appendChild(iconCell); + popupTableRow.appendChild(errorMessageCell); + popupTableRow.appendChild(closeCell); + popupTableRow.appendChild(calloutCell); + } + else { + popupTableRow.appendChild(calloutCell); + popupTableRow.appendChild(iconCell); + popupTableRow.appendChild(errorMessageCell); + popupTableRow.appendChild(closeCell); + } + + // initialize callout arrow + var div = document.createElement("div"); + div.className = "ajax__validatorcallout_innerdiv"; + calloutArrowCell.appendChild(div); + if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft || + this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomRight) { + var pixel = document.createElement("div"); + pixel.style.width = "1px"; + pixel.className = "arrowpixel"; + div.appendChild(pixel); + for(var i = 1; i < 22; i += 2) { + var line = document.createElement("div"); + line.style.width = i.toString() + "px"; + div.appendChild(line); + } + } + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopLeft || + this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopRight) { + for(var i = 23; i > 0; i -= 2) { + var line = document.createElement("div"); + line.style.width = i.toString() + "px"; + div.appendChild(line); + } + var pixel = document.createElement("div"); + pixel.style.width = "1px"; + pixel.className = "arrowpixel"; + div.appendChild(pixel); + } + else { + for(var i = 14; i > 0; i--) { + var line = document.createElement("div"); + line.style.width = i.toString() + "px"; + div.appendChild(line); + } + } + + // initialize behaviors + this._popupBehavior = $create( + Sys.Extended.UI.PopupBehavior, + { + //positioningMode : Sys.Extended.UI.PositioningMode.Absolute, + parentElement: elementToValidate + }, + {}, + null, + this._popupTable); + + if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopLeft) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopLeft); + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.TopRight) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopRight); + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomLeft); + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.BottomRight) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomRight); + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.Right) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Right); + else if(this._popupPosition == Sys.Extended.UI.ValidatorCalloutPosition.Left) + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Left); + else + this._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Right); + + // Create the animations (if they were set before initialize was called) + if(this._onShowJson) + this._popupBehavior.set_onShow(this._onShowJson); + if(this._onHideJson) + this._popupBehavior.set_onHide(this._onHideJson); + + $addHandler(this._closeCellInnerDiv, "click", this._closeClickHandler); + this._isBuilt = true; + } + }, + + dispose: function() { + if(this._isBuilt) { + this.hide(); + + if(this._focusAttached) { + $removeHandler(this._elementToValidate, "focus", this._focusHandler); + this._focusAttached = false; + } + $removeHandler(this._closeCellInnerDiv, "click", this._closeClickHandler); + + this._onShowJson = null; + this._onHideJson = null; + if(this._popupBehavior) { + this._popupBehavior.dispose(); + this._popupBehavior = null; + } + if(this._closeBehavior) { + this._closeBehavior.dispose(); + this._closeBehavior = null; + } + if(this._popupTable) { + this._popupTable.parentNode.removeChild(this._popupTable); + this._popupTable = null; + this._errorMessageCell = null; + this._elementToValidate = null; + this._calloutArrowCell = null; + this._warningIconImage = null; + this._closeImage = null; + this._closeCellInnerDiv = null; + } + this._isBuilt = false; + } + Sys.Extended.UI.ValidatorCalloutBehavior.callBaseMethod(this, 'dispose'); + }, + + _getErrorMessage: function() { + return this.get_element().errormessage || Sys.Extended.UI.Resources.ValidatorCallout_DefaultErrorMessage; + }, + + /// + /// Shows the ValidatorCallout popup + /// + /// + show: function(force) { + if(force || !this.isOpen()) { + if(force && Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout) + Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout.hide(); + if(Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout != null) + return; + Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout = this; + this._errorMessageCell.innerHTML = this._getErrorMessage(); + this._popupBehavior.show(); + } + }, + + /// + /// Hides the ValidatorCallout popup + /// + /// + hide: function() { + if(Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout == this) + Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout = null; + if(this.isOpen()) + this._popupBehavior.hide(); + }, + + _onfocus: function(e) { + if(!this._originalValidationMethod(this.get_element())) { + this._ensureCallout(); + if(this._highlightCssClass) + Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass); + this.show(true); + return false; + } else { + this.hide(); + return true; + } + }, + + _oncloseClick: function(e) { + this.hide(); + }, + + _onvalidate: function(val) { + if(!this._originalValidationMethod(val)) { + this._ensureCallout(); + if(this._highlightCssClass) + Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass); + if(!this._focusAttached) { + $addHandler(this._elementToValidate, "focus", this._focusHandler); + this._focusAttached = true; + } + this.show(false); + this._invalid = true; + return false; + } else { + if(this._highlightCssClass && this._invalid) + Sys.UI.DomElement.removeCssClass(this._elementToValidate, this._highlightCssClass); + this._invalid = false; + this.hide(); + return true; + } + }, + + /// + /// Generic OnShow animation for the ValidatorCallout extender + /// + /// + /// The OnShow animation will be played each time the validation popup is displayed. + /// The popup will be positioned correctly, but hidden. The animation can be used to + /// display the popup along with any other visual effects. + /// + /// See Animation Reference for more details + /// + /// get_onShow + /// set_onShow + /// + get_onShow: function() { + // Generic OnShow Animation's JSON definition + return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson; + }, + set_onShow: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onShow(value); + else + this._onShowJson = value; + this.raisePropertyChanged('onShow'); + }, + + onShow: function() { + if(this._popupBehavior) + this._popupBehavior.onShow(); + }, + + /// + /// Generic OnShow Animation's behavior + /// + /// get_onShowBehavior + /// + get_onShowBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null; + }, + + /// + /// Generic OnHide animation for the ValidatorCallout extender + /// + /// + /// The OnHide animation will be played each time the validation popup is hidden + /// + /// get_onHide + /// set_onHide + /// + get_onHide: function() { + // Generic OnHide Animation's JSON definition + return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson; + }, + set_onHide: function(value) { + if(this._popupBehavior) + this._popupBehavior.set_onHide(value); + else + this._onHideJson = value; + this.raisePropertyChanged('onHide'); + }, + + onHide: function() { + if(this._popupBehavior) + this._popupBehavior.onHide(); + }, + + /// + /// Generic OnHide Animation's behavior + /// + /// get_onHideBehavior + /// + get_onHideBehavior: function() { + return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null; + }, + + /// + /// The path to a custom warning icon image + /// + /// get_warningIconImageUrl + /// set_warningIconImageUrl + /// + get_warningIconImageUrl: function() { + return this._warningIconImageUrl; + }, + set_warningIconImageUrl: function(value) { + if(this._warningIconImageUrl != value) { + this._warningIconImageUrl = value; + if(this.get_isInitialized()) + this._warningIconImage.src = value; + this.raisePropertyChanged("warningIconImageUrl"); + } + }, + + /// + /// The path to a custom close image + /// + /// get_closeImageUrl + /// set_closeImageUrl + /// + get_closeImageUrl: function() { + return this._closeImageUrl; + }, + set_closeImageUrl: function(value) { + if(this._closeImageUrl != value) { + this._closeImageUrl = value; + if(this.get_isInitialized()) + this._closeImage.src = value; + this.raisePropertyChanged("closeImageUrl"); + } + }, + + /// + /// The width of the callout + /// + /// get_width + /// set_width + /// + get_width: function() { + return this._width; + }, + set_width: function(value) { + if(this._width != value) { + this._width = value; + if(this.get_isInitialized()) + this._popupTable.style.width = _width; + this.raisePropertyChanged("width"); + } + }, + + /// + /// Indicates where the ValidatorCallout popup should appear relatively to the control to validate + /// + /// + /// Possible values: + /// * BottomLeft + /// * BottomRight + /// * TopLeft + /// * TopRight + /// * Left + /// * Right + /// + /// get_popupPosition + /// set_popupPosition + /// + get_popupPosition: function() { + return this._popupPosition; + }, + set_popupPosition: function(value) { + if(this._popupPosition != value) { + this._popupPosition = value; + this.raisePropertyChanged('popupPosition'); + } + }, + + /// + /// Name of the CSS class used to style the ValidatorCallout + /// + /// + /// See the ValidatorCallout Theming section for more information + /// + /// get_cssClass + /// set_cssClass + /// + get_cssClass: function() { + return this._cssClass; + }, + set_cssClass: function(value) { + if(this._cssClass != value) { + this._cssClass = value; + this.raisePropertyChanged("cssClass"); + } + }, + + /// + /// A CSS class to apply to an invalid field + /// + /// get_highlightCssClass + /// set_highlightCssClass + /// + get_highlightCssClass: function() { + return this._highlightCssClass; + }, + set_highlightCssClass: function(value) { + if(this._highlightCssClass != value) { + this._highlightCssClass = value; + this.raisePropertyChanged("highlightCssClass"); + } + }, + + /// + /// Determines whether the ValidatorCallout popup is opened + /// + /// + /// Boolean value, which is true when ValidatorCallout popup is open + /// + /// + isOpen: function() { + return $common.getVisible(this._popupTable); + }, + get_isOpen: function() { + Sys.Extended.Deprecated("get_isOpen()", "isOpen()"); + return this.isOpen(); + } +}; +Sys.Extended.UI.ValidatorCalloutBehavior.registerClass('Sys.Extended.UI.ValidatorCalloutBehavior', Sys.Extended.UI.BehaviorBase); + +Sys.Extended.UI.ValidatorCalloutPosition = function() { + throw Error.invalidOperation(); +}; +Sys.Extended.UI.ValidatorCalloutPosition.prototype = { + Right: 0, + Left: 1, + BottomLeft: 2, + BottomRight: 3, + TopLeft: 4, + TopRight: 5 +}; +Sys.Extended.UI.ValidatorCalloutPosition.registerEnum('Sys.Extended.UI.ValidatorCalloutPosition'); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Accordion.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Accordion.js new file mode 100644 index 000000000..ef88101c8 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Accordion.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.AutoSize=function(){throw Error.invalidOperation();};Sys.Extended.UI.AutoSize.prototype={None:0,Fill:1,Limit:2};Sys.Extended.UI.AutoSize.registerEnum("Sys.Extended.UI.AutoSize",!1);Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs=function(n,t){Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.initializeBase(this);this._oldIndex=n;this._selectedIndex=t};Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.prototype={get_oldIndex:function(){return this._oldIndex},set_oldIndex:function(n){this._oldIndex=n},get_selectedIndex:function(){return this._selectedIndex},set_selectedIndex:function(n){this._selectedIndex=n}};Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs.registerClass("Sys.Extended.UI.AccordionSelectedIndexChangeEventArgs",Sys.CancelEventArgs);Sys.Extended.UI.AccordionBehavior=function(n){Sys.Extended.UI.AccordionBehavior.initializeBase(this,[n]);this._selectedIndex=0;this._panes=[];this._fadeTransitions=!1;this._duration=.25;this._framesPerSecond=30;this._autoSize=Sys.Extended.UI.AutoSize.None;this._requireOpenedPane=!0;this._suppressHeaderPostbacks=!1;this._headersSize=0;this._headerClickHandler=null;this._headerCssClass="";this._headerSelectedCssClass="";this._resizeHandler=null;this._isIE8InStandardMode=Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version>7&&Sys.Browser.documentMode!=0};Sys.Extended.UI.AccordionBehavior.prototype={initialize:function(){var t,i,n,r,u;for(Sys.Extended.UI.AccordionBehavior.callBaseMethod(this,"initialize"),this._headerClickHandler=Function.createDelegate(this,this._onHeaderClick),t=this.get_ClientState(),t!==null&&t!==""&&this._changeSelectedIndex(parseInt(t),!1,!0),i=this.get_element().childNodes,n={},n.value=0;n.value0&&this._changeSelectedIndex(0,!1,!0);this._initializeLayout()},_getNextDiv:function(n,t){for(var i=null;t.value=7,(!i||i&&n.height&&n.height.length>0)&&(n.height="auto"),(!i||i&&n.overflow&&n.overflow.length>0)&&(n.overflow="auto")):(this._addResizeHandler(),n.height=u.offsetHeight+"px",n.overflow="hidden"),t=0;t=0;t--)n=this._panes[t],n&&(n.header&&(n.header._index=null,$removeHandler(n.header,"click",this._headerClickHandler),n.header=null),n.content&&(n.content._original=null,n.content=null),this._panes[t]=null,delete this._panes[t]);this._panes=null;this._headerClickHandler=null;Sys.Extended.UI.AccordionBehavior.callBaseMethod(this,"dispose")},_disposeResizeHandler:function(){this._resizeHandler&&($removeHandler(window,"resize",this._resizeHandler),this._resizeHandler=null)},_disposeAnimations:function(){for(var n,t=0;t0&&(t=Math.min(t,r)))),t},_getTotalSize:function(n){var t=$common.getSize(n),i=$common.getMarginBox(n);return t.width+=i.horizontal,t.height+=i.vertical,t},_getGutterSize:function(n){var i={width:0,height:0},t;try{t=$common.getPaddingBox(n);i.width+=t.horizontal;i.height+=t.vertical}catch(r){}try{t=$common.getBorderBox(n);i.width+=t.horizontal;i.height+=t.vertical}catch(r){}return t=$common.getMarginBox(n),i.width+=t.horizontal,i.height+=t.vertical,i},add_selectedIndexChanging:function(n){this.get_events().addHandler("selectedIndexChanging",n)},remove_selectedIndexChanging:function(n){this.get_events().removeHandler("selectedIndexChanging",n)},raiseSelectedIndexChanging:function(n){Sys.Extended.Deprecated("raiseSelectedIndexChanging(eventArgs)","raise_selectedIndexChanging(eventArgs)");this.raise_selectedIndexChanging(n)},raise_selectedIndexChanging:function(n){var t=this.get_events().getHandler("selectedIndexChanging");t&&t(this,n)},add_selectedIndexChanged:function(n){this.get_events().addHandler("selectedIndexChanged",n)},remove_selectedIndexChanged:function(n){this.get_events().removeHandler("selectedIndexChanged",n)},raiseSelectedIndexChanged:function(n){Sys.Extended.Deprecated("raiseSelectedIndexChanged(eventArgs)","raise_selectedIndexChanged(eventArgs)");this.raise_selectedIndexChanged(n)},raise_selectedIndexChanged:function(n){var t=this.get_events().getHandler("selectedIndexChanged");t&&t(this,n)},getPane:function(n){return(n===undefined||n===null)&&(n=this._selectedIndex),this._panes&&n>=0&&n=0?n.lastIndexOf("\\"):n.lastIndexOf("/"),t=n.substring(r),(t.indexOf("\\")===0||t.indexOf("/")===0)&&(t=t.substring(1)),i=t)}return encodeURIComponent(i)};this.getFileType=function(n){if(!n)throw"file must defined or not null";if(!n.value&&n.name)return n.name.substring(n.name.lastIndexOf(".")+1);if(n.value&&(n=n.value),typeof n!="string")throw"can't resolve file type.";return n.substring(n.lastIndexOf(".")+1)};this.sizeToString=function(n){if(!n||n<=0)return"0 Kb";var t=Math.floor(Math.log(n)/Math.log(1024));return(n/Math.pow(1024,Math.floor(t))).toFixed(2)+" "+["bytes","kb","MB","GB","TB","PB"][t]};this.checkHtml5BrowserSupport=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob&&(new XMLHttpRequest).upload}};Sys.Extended.UI.AjaxFileUpload.Item=function(n,t,i){this._deleteButton=null;this._parentId=n;this._inputElementValue=t.value;this._id=t.id;this._slices=t.slices;this._sliceIndex=0;this._fileInfoContainer=null;this._fileStatusText=null;this._isUploaded=!1;this._isUploading=!1;this._fileSize=0;this._fileName="";this._fileType="";this._bytesUploaded=0;this._ui=this.initUI(i)};Sys.Extended.UI.AjaxFileUpload.Item.prototype={initUI:function(n){var l=this,t=this._inputElementValue,e=new Sys.Extended.UI.AjaxFileUpload.Utils,a=e.checkHtml5BrowserSupport(),i=this._id,r=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileItemContainer_"+i},cssClasses:["ajax__fileupload_fileItemInfo"]}),u=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileInfoContainer_"+i,style:{display:"inline-block"}}}),o=$common.createElementFromTemplate({nodeName:"span",properties:{id:this._parentId+"_FileItemInfo_"+i},cssClasses:["ajax__fileupload_fileItemInfo"]}),h=$common.createElementFromTemplate({nodeName:"span",properties:{id:this._parentId+"_FileItemStatus_"+i},cssClasses:["uploadstatus"]}),f=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileItemDeleteButton_"+i},cssClasses:["removeButton"]}),s,c;return this._fileName=e.getFileName(t),s=decodeURIComponent(this._fileName),a?(this._fileSize=t.size,c=t.type?'('+t.type+")<\/span>":"",o.innerHTML=''+s+"<\/span> "+c+' - '+e.sizeToString(t.size)+"<\/span> ",this._fileType=t.type):(o.innerHTML=''+s+"<\/span>",this._fileType=e.getFileType(t)),u.appendChild(o),u.appendChild(h),$common.setText(f,Sys.Extended.UI.Resources.AjaxFileUpload_Remove),$addHandlers(f,{click:Function.createDelegate(this,function(){n(l)})}),Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<=8?(r.appendChild(f),r.appendChild(u)):(r.appendChild(u),r.appendChild(f)),this._fileInfoContainer=u,this._deleteButton=f,this._fileStatusText=h,r},setStatus:function(n,t){$common.setText(this._fileStatusText," ("+t+")");this._fileInfoContainer.setAttribute("class",n+"State")},disabled:function(n){this._deleteButton.disabled=n?"disabled":""},hide:function(){this._deleteButton.style.visibility="hidden"},destroy:function(){$common.removeElement(this._inputElementValue);$common.removeElement(this._deleteButton);$common.removeElement(this._ui)},get_inputElementValue:function(){return this._inputElementValue},appendNodeTo:function(n){n.appendChild(this._ui)},removeNodeFrom:function(n){n.removeChild(this._ui)}};Sys.Extended.UI.AjaxFileUpload.Processor=function(n,t){var r=new Sys.Extended.UI.AjaxFileUpload.Utils,i=new XMLHttpRequest;this._iframe=null;this._iframeName=n.get_id()+"_uploadIframe";this._form=null;this.initialize=function(){this.attachEvents();this.createIFrame();this.createForm()};this.attachEvents=function(){this.onFileSelected$delegate=Function.createDelegate(this,this.onFileSelectedHandler);this.attachFileInputEvents(t.inputFile,!0);var r=this;i.onreadystatechange=function(){if(i.readyState==4&&i.status==200){var t=i.responseText;t&&(t=parseFloat(t).toFixed(2),n.setPercent(t));t<100&&setTimeout(function(){r.pollingServerProgress(!0)},500)}}};this.attachFileInputEvents=function(n,t){t?$addHandlers(n,{change:this.onFileSelected$delegate}):$common.removeHandlers(n,{change:this.onFileSelected$delegate})};this.onFileSelectedHandler=function(){var i={id:r.generateGuid(),value:t.inputFile,type:r.getFileType(t.inputFile.value)};n.fileTypeIsValid(i.type)?(n.addFileToQueue(i),this.createInputFileElement()):n.confirmFileIsInvalid(i)};this.createInputFileElement=function(){var i=t.inputFile,f,u;i.style.zIndex=-999;$common.setLocation(i,{x:-99999,y:-99999});this.attachFileInputEvents(i,!1);f=n.get_id()+"_file_"+r.generateGuid();u=$common.createElementFromTemplate({nodeName:"input",properties:{id:f,name:"act-file-data",type:"file",style:{zIndex:0,cursor:"pointer",position:"absolute"}}},i.parentNode);$common.setElementOpacity(u,0);this.attachFileInputEvents(u,!0);t.inputFile=u};this.startUpload=function(){var t=this._form,i=n.getNextFile(),r;if(!i){n._currentFileId=null;this.setThrobber(!1);n.done();return}for(n.setAsUploading(i),r=i.get_inputElementValue(),n._currentFileId=i._id,this.setThrobber(!0);t.firstChild;)t.removeChild(t.firstChild);r.name="act-file-data";t.appendChild(r);t.setAttribute("action",n._uploadUrl+"?contextKey="+n.get_id()+"&fileId="+n._currentFileId+"&fileName="+i._fileName+"&usePoll="+(n.get_serverPollingSupport()?"true":"false"));t.submit()};this.cancelUpload=function(){var t=new XMLHttpRequest,r=this;i&&i.abort();t.open("POST","?contextKey="+n.get_id()+"&cancel=1&guid="+n._currentFileId,!0);t.onreadystatechange=function(){if(r.setThrobber(!1),t.readyState==4)if(t.status==200)n.cancelUpload();else{r.raiseUploadError(t);throw"Failed to cancel upload.";}};t.send(null)};this.createIFrame=function(){var t=this._iframeName,n=document.createElement("IFRAME");n.width="0";n.height="0";n.style.display="none";n.src="about:blank";n.id=t;n.name=t;n.security="restricted";document.body.appendChild(n);n.contentWindow.name=t;$addHandlers(n,{load:Function.createDelegate(this,this.onIFrameLoadedHandler)});this._iframe=n};this.onIFrameLoadedHandler=function(t){if(n._currentFileId)try{var i=this._iframe,r=null;if(i.contentDocument?r=i.contentDocument:i.contentWindow?r=i.contentWindow.document:i.document&&(r=i.document),r==null)throw"Document not initialized";n.doneAndUploadNextFile(n.getCurrentFileItem())}catch(t){if(!n._canceled||!(t.message&&(t.message.indexOf("Access is denied")>-1||t.message.indexOf("Permission denied")>-1))){this.raiseUploadError(t);throw t;}}};this.setThrobber=function(i){if(n.get_serverPollingSupport()){n.setPercent(0);$common.setVisible(t.progressBar,i?!0:!1);$common.setVisible(t.progressBarContainer,i?!0:!1);this.pollingServerProgress(i);return}n.get_throbber()!=null&&(n.get_throbber().style.display=i?"":"none")};this.pollingServerProgress=function(t){t&&n._currentFileId&&(i.open("GET","?contextKey="+n.get_id()+"&poll=1&guid="+n._currentFileId,!0),i.send(null))};this.createForm=function(){var t,i="___postForm"+n.get_id();try{t=document.createElement('')}catch(r){t=document.createElement("form");t.setAttribute("id",i);t.setAttribute("method","post");t.setAttribute("target",this._iframe.id);t.setAttribute("enctype","multipart/form-data")}t.style.visibility="hidden";t.style.display="none";document.body.appendChild(t);this._form=t};this.raiseUploadError=function(t){n.raise_uploadError(t);n.setFileStatus(n._currentFileId,"error",Sys.Extended.UI.Resources.AjaxFileUpload_error);i&&i.abort();n._currentFileId=null}};Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5=function(n,t){var i=new Sys.Extended.UI.AjaxFileUpload.Utils,r=n.get_chunkSize()*1e3,u=0,f=null;this.initialize=function(){$common.setVisible(t.dropZone,!0);t.dropZone.innerHTML=Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles;this.attachEvents()};this.attachEvents=function(){this.onFileDropped$delegate=Function.createDelegate(this,this.onFileDroppedHandler);this.onFileDragOver$delegate=Function.createDelegate(this,this.onFileDragOverHandler);this.onFileSelected$delegate=Function.createDelegate(this,this.onFileSelectedHandler);t.inputFile.addEventListener("change",this.onFileSelected$delegate,!1);t.dropZone.addEventListener("drop",this.onFileDropped$delegate,!1);t.dropZone.addEventListener("dragover",this.onFileDragOver$delegate,!1)};this.onFileDroppedHandler=function(n){n.stopPropagation();n.preventDefault();this.addFilesToQueue(n.dataTransfer.files)};this.onFileDragOverHandler=function(n){n.stopPropagation();n.preventDefault()};this.onFileSelectedHandler=function(n){this.addFilesToQueue(n.target.files);this.createInputFileElement()};this.createInputFileElement=function(){var u=t.inputFile,f,r;delete u;f=n.get_id()+"_file_"+i.generateGuid();r=$common.createElementFromTemplate({nodeName:"input",properties:{id:f,name:"act-file-data",type:"file",style:{zIndex:0,cursor:"pointer",position:"absolute"}}},u.parentNode);$common.setElementOpacity(r,0);this.attachFileInputEvents(r,!0);t.inputFile=r};this.attachFileInputEvents=function(n,t){t?$addHandlers(n,{change:this.onFileSelected$delegate}):$common.removeHandlers(n,{change:this.onFileSelected$delegate})};this.addFilesToQueue=function(u){for(var o,s,e,f=0;fr&&(s=Math.ceil(o.size/r)),e={id:i.generateGuid(),value:u[f],type:i.getFileType(u[f]),uploaded:!1,slices:s},n.fileTypeIsValid(e.type)){if(!n.addFileToQueue(e))break}else n.confirmFileIsInvalid(e);t.inputFile.value=null};this.cancelUpload=function(){f&&f.abort();n.cancelUpload()};this.startUpload=function(){var i=n.getNextFile();i?(i._sliceIndex===0&&n.setPercent(0),$common.setVisible(t.progressBarContainer,!0),this.upload(i)):(n._currentFileId=null,n.setPercent(0),$common.setVisible(t.progressBarContainer,!1),n.done())};this.upload=function(i){var o,s;if(n._isUploading){$common.setVisible(t.progressBar,!0);n.setAsUploading(i);var f=i.get_inputElementValue(),a=i._fileName,h=i._slices&&i._slices>0,v=i._sliceIndex==0;h&&(o=i._sliceIndex*r,s=o+r,f=f.slice(o,s>f.size?f.size:s));var c=new FormData,l=n._currentFileId=i._id,u=new XMLHttpRequest,y=this,e=function(n){return function(t){n.call(y,l,t)}};u.upload.addEventListener("progress",e(this.onProgressHandler),!1);u.addEventListener("load",e(this.onUploadCompleteHandler),!1);u.addEventListener("error",e(this.onUploadFailedHandler),!1);u.addEventListener("abort",e(this.onUploadCanceledHandler),!1);u.open("POST",n._uploadUrl+"?contextKey="+n.get_id()+"&fileId="+l+"&fileName="+a+"&chunked="+(h?"true":"false")+"&firstChunk="+v,!0);c.append("act-file-data",f);u.send(c)}};this.onProgressHandler=function(t,i){if(n._isUploading&&i.lengthComputable){u=i.loaded;var r=n.getFileItem(t),f=r._slices,e=r._bytesUploaded+u,o=f-r._sliceIndex==1?e:i.total*f,s=f==0?(i.loaded*100/i.total).toFixed(2):(e/o*100).toFixed(2);n.setPercent(s)}};this.onUploadCompleteHandler=function(t){var e=this,r=n.getFileItem(t),f=r.get_inputElementValue();r._slices&&r._slices>0&&r._sliceIndex+10&&this._filesInQueue.length>=i?(alert(Sys.Extended.UI.Resources.AjaxFileUpload_MaxNumberOfFilesExceeded),!1):(t=new Sys.Extended.UI.AjaxFileUpload.Item(this.get_id(),n,Function.createDelegate(this,this.removeFileFromQueueHandler)),t.appendNodeTo(this._elements.queueContainer),t.setStatus("pending",Sys.Extended.UI.Resources.AjaxFileUpload_Pending),$common.setVisible(this._elements.queueContainer,!0),$common.setVisible(this._elements.uploadOrCancelButton,!0),this._filesInQueue.push(t),this._showFilesCount(),!0)},_showFilesCount:function(){var n=this._filesInQueue.length==0;this.setStatusMessage(n?Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload:String.format(Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue,this._filesInQueue.length.toString()))},fileTypeIsValid:function(n){var i,t,r;if(!this._allowedFileTypes)return!0;for(i=this._allowedFileTypes.split(","),t=0;t=100&&(n="100");t.style.width=n+"%";$common.setText(t,String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage,n))},get_allowedFileTypes:function(){return this._allowedFileTypes},set_allowedFileTypes:function(n){this._allowedFileTypes=n},get_contextKey:function(){return this._contextKey},set_contextKey:function(n){this._contextKey=n},get_postBackUrl:function(){return this._postBackUrl},set_postBackUrl:function(n){this._postBackUrl=n},get_mode:function(){return this._mode},set_mode:function(n){this._mode=n},get_serverPollingSupport:function(){return this._serverPollingSupport},set_serverPollingSupport:function(n){this._serverPollingSupport=n},get_throbber:function(){return this._throbber},set_throbber:function(n){this._throbber=n},get_maximumNumberOfFiles:function(){return this._maximumNumberOfFiles},set_maximumNumberOfFiles:function(n){this._maximumNumberOfFiles=n},get_chunkSize:function(){return this._chunkSize},set_chunkSize:function(n){this._chunkSize=n},get_clearFileListAfterUpload:function(){return this._clearFileListAfterUpload},set_clearFileListAfterUpload:function(n){this._clearFileListAfterUpload=n},add_uploadStart:function(n){this.get_events().addHandler("uploadStart",n)},remove_uploadStart:function(n){this.get_events().removeHandler("uploadStart",n)},raiseUploadStart:function(n){Sys.Extended.Deprecated("raiseUploadStart(e)","raise_uploadStart(e)");this.raise_uploadStart(n)},raise_uploadStart:function(n){var t=this.get_events().getHandler("uploadStart"),i;t&&(i=new Sys.Extended.UI.AjaxFileUploadStartEventArgs(n.FilesInQueue,n.ServerArguments),t(this,i))},add_uploadComplete:function(n){this.get_events().addHandler("uploadComplete",n)},remove_uploadComplete:function(n){this.get_events().removeHandler("uploadComplete",n)},raiseUploadComplete:function(n){Sys.Extended.Deprecated("raiseUploadComplete(e)","raise_uploadComplete(e)");this.raise_uploadComplete(n)},raise_uploadComplete:function(n){var t=this.getCurrentFileItem(),i,r,u;if(!t||!n||n.FileId!==t._id)throw"Invalid finalizing upload server response.";this.setFileStatus(t,"uploaded",Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded);this.setStatusMessage("Uploaded "+this._currentQueueIndex+" of "+this._filesInQueue.length+" file(s)");t._isUploaded=!0;t._isUploading=!1;t.hide();i=this.get_events().getHandler("uploadComplete");i&&(r=Array.indexOf(this._filesInQueue,t),u=new Sys.Extended.UI.AjaxFileUploadEventArgs(n.FileId,n.StatusMessage,n.FileName,n.FileSize,n.ContentType,n.PostedUrl,r,this._filesInQueue.length),i(this,u))},add_uploadCompleteAll:function(n){this.get_events().addHandler("uploadCompleteAll",n)},remove_uploadCompleteAll:function(n){this.get_events().removeHandler("uploadCompleteAll",n)},raiseUploadCompleteAll:function(){Sys.Extended.Deprecated("raiseUploadCompleteAll(e)","raise_uploadCompleteAll(e)");this.raise_uploadCompleteAll("raiseUploadCompleteAll(e)","raise_uploadCompleteAll(e)")},raise_uploadCompleteAll:function(n){var t=this.get_events().getHandler("uploadCompleteAll"),i;t&&(i=new Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs(n.FilesInQueue,n.FilesUploaded,n.Reason,n.ServerArguments),t(this,i))},add_uploadError:function(n){this.get_events().addHandler("uploadError",n)},remove_uploadError:function(n){this.get_events().removeHandler("uploadError",n)},raiseUploadError:function(n){Sys.Extended.Deprecated("raiseUploadError(e)","raise_uploadError(e)");this.raise_uploadError(n)},raise_uploadError:function(n){var t=this.get_events().getHandler("uploadError");t&&t(this,n);this._canceled=!1;this._isUploading=!1;this.enableControls(!0)},getCurrentFileItem:function(){return this.getFileItem(this._currentFileId)},getNextFile:function(){var n,t;if(!this._isUploading)return null;for(n=0;n100&&(n=100),this._percentComplete=n,this.raisePropertyChanged("percentComplete"),t)this.onStep(n);n===100&&this.stop(!1)},setOwner:function(n){this._owner=n},raiseStarted:function(){var n=this.get_events().getHandler("started");n&&n(this,Sys.EventArgs.Empty)},add_started:function(n){this.get_events().addHandler("started",n)},remove_started:function(n){this.get_events().removeHandler("started",n)},raiseEnded:function(){var n=this.get_events().getHandler("ended");n&&n(this,Sys.EventArgs.Empty)},add_ended:function(n){this.get_events().addHandler("ended",n)},remove_ended:function(n){this.get_events().removeHandler("ended",n)},raiseStep:function(){var n=this.get_events().getHandler("step");n&&n(this,Sys.EventArgs.Empty)},add_step:function(n){this.get_events().addHandler("step",n)},remove_step:function(n){this.get_events().removeHandler("step",n)},get_target:function(){return!this._target&&this._parentAnimation?this._parentAnimation.get_target():this._target},set_target:function(n){this._target!=n&&(this._target=n,this.raisePropertyChanged("target"))},set_animationTarget:function(n){var i=null,t=$get(n),r;if(t?i=t:(r=$find(n),r&&(t=r.get_element(),t&&(i=t))),i)this.set_target(i);else throw Error.argument("id",String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound,n));},get_duration:function(){return this._duration},set_duration:function(n){n=this._getFloat(n);this._duration!=n&&(this._duration=n,this.raisePropertyChanged("duration"))},get_fps:function(){return this._fps},set_fps:function(n){n=this._getInteger(n);this.fps!=n&&(this._fps=n,this.raisePropertyChanged("fps"))},get_isActive:function(){return this._timer!==null},get_isPlaying:function(){return this._timer!==null&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(n){return String.isInstanceOfType(n)?Boolean.parse(n):n},_getInteger:function(n){return String.isInstanceOfType(n)?parseInt(n):n},_getFloat:function(n){return String.isInstanceOfType(n)?parseFloat(n):n},_getEnum:function(n,t){return String.isInstanceOfType(n)&&t&&t.parse?t.parse(n):n}};$AA.Animation.registerClass("Sys.Extended.UI.Animation.Animation",Sys.Component);$AA.registerAnimation("animation",$AA.Animation);$AA.ParentAnimation=function(n,t,i,r){if($AA.ParentAnimation.initializeBase(this,[n,t,i]),this._animations=[],r&&r.length)for(var u=0;u=0;n--)this._animations[n].dispose(),this._animations[n]=null;Array.clear(this._animations);this._animations=[];this.raisePropertyChanged("animations")}}};$AA.ParentAnimation.registerClass("Sys.Extended.UI.Animation.ParentAnimation",$AA.Animation);$AA.registerAnimation("parent",$AA.ParentAnimation);$AA.ParallelAnimation=function(n,t,i,r){$AA.ParallelAnimation.initializeBase(this,[n,t,i,r])};$AA.ParallelAnimation.prototype={add:function(n){$AA.ParallelAnimation.callBaseMethod(this,"add",[n]);n.setOwner(this)},onStart:function(){var t,n;for($AA.ParallelAnimation.callBaseMethod(this,"onStart"),t=this.get_animations(),n=0;n=1||this._iterations<=0?(this._remainingIterations--,this._index=0,i=n[0],i.add_ended(this._handler),i.play()):this.stop()},onStep:function(){throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence);},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,"onEnd")},get_isActive:function(){return!0},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(n){n=this._getInteger(n);this._iterations!=n&&(this._iterations=n,this.raisePropertyChanged("iterations"))},get_isInfinite:function(){return this._iterations<=0}};$AA.SequenceAnimation.registerClass("Sys.Extended.UI.Animation.SequenceAnimation",$AA.ParentAnimation);$AA.registerAnimation("sequence",$AA.SequenceAnimation);$AA.SelectionAnimation=function(n,t,i,r){$AA.SelectionAnimation.initializeBase(this,[n,t,i,r]);this._selectedIndex=-1;this._selected=null};$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented();},onStart:function(){$AA.SelectionAnimation.callBaseMethod(this,"onStart");var n=this.get_animations();this._selectedIndex=this.getSelectedIndex();this._selectedIndex>=0&&this._selectedIndex0)try{selected=eval(this._conditionScript)?0:1}catch(ex){}return selected},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(n){this._conditionScript!=n&&(this._conditionScript=n,this.raisePropertyChanged("conditionScript"))}};$AA.ConditionAnimation.registerClass("Sys.Extended.UI.Animation.ConditionAnimation",$AA.SelectionAnimation);$AA.registerAnimation("condition",$AA.ConditionAnimation);$AA.CaseAnimation=function(n,t,i,r,u){$AA.CaseAnimation.initializeBase(this,[n,t,i,r]);this._selectScript=u};$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1,result;if(this._selectScript&&this._selectScript.length>0)try{result=eval(this._selectScript);result!==undefined&&(selected=result)}catch(ex){}return selected},get_selectScript:function(){return this._selectScript},set_selectScript:function(n){this._selectScript!=n&&(this._selectScript=n,this.raisePropertyChanged("selectScript"))}};$AA.CaseAnimation.registerClass("Sys.Extended.UI.Animation.CaseAnimation",$AA.SelectionAnimation);$AA.registerAnimation("case",$AA.CaseAnimation);$AA.FadeEffect=function(){throw Error.invalidOperation();};$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1};$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect",!1);$AA.FadeAnimation=function(n,t,i,r,u,f,e){$AA.FadeAnimation.initializeBase(this,[n,t,i]);this._effect=r!==undefined?r:$AA.FadeEffect.FadeIn;this._max=f!==undefined?f:1;this._min=u!==undefined?u:0;this._start=this._min;this._end=this._max;this._layoutCreated=!1;this._forceLayoutInIE=e===undefined||e===null?!0:e;this._currentTarget=null;this._resetOpacities()};$AA.FadeAnimation.prototype={_resetOpacities:function(){this._effect==$AA.FadeEffect.FadeIn?(this._start=this._min,this._end=this._max):(this._start=this._max,this._end=this._min)},_createLayout:function(){var n=this._currentTarget,t;n&&(this._originalWidth=$common.getCurrentStyle(n,"width"),t=$common.getCurrentStyle(n,"height"),this._originalBackColor=$common.getCurrentStyle(n,"backgroundColor"),this._originalWidth&&this._originalWidth!=""&&this._originalWidth!="auto"||t&&t!=""&&t!="auto"||(n.style.width=n.offsetWidth+"px"),this._originalBackColor&&this._originalBackColor!=""&&this._originalBackColor!="transparent"&&this._originalBackColor!="rgba(0, 0, 0, 0)"||(n.style.backgroundColor=$common.getInheritedBackgroundColor(n)),this._layoutCreated=!0)},onStart:function(){$AA.FadeAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target();this.setValue(this._start);this._forceLayoutInIE&&!this._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer&&this._createLayout()},getAnimatedValue:function(n){return this.interpolate(this._start,this._end,n)},setValue:function(n){this._currentTarget&&$common.setElementOpacity(this._currentTarget,n)},get_effect:function(){return this._effect},set_effect:function(n){n=this._getEnum(n,$AA.FadeEffect);this._effect!=n&&(this._effect=n,this._resetOpacities(),this.raisePropertyChanged("effect"))},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(n){n=this._getFloat(n);this._min!=n&&(this._min=n,this._resetOpacities(),this.raisePropertyChanged("minimumOpacity"))},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(n){n=this._getFloat(n);this._max!=n&&(this._max=n,this._resetOpacities(),this.raisePropertyChanged("maximumOpacity"))},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(n){n=this._getBoolean(n);this._forceLayoutInIE!=n&&(this._forceLayoutInIE=n,this.raisePropertyChanged("forceLayoutInIE"))},set_startValue:function(n){n=this._getFloat(n);this._start=n}};$AA.FadeAnimation.registerClass("Sys.Extended.UI.Animation.FadeAnimation",$AA.Animation);$AA.registerAnimation("fade",$AA.FadeAnimation);$AA.FadeInAnimation=function(n,t,i,r,u,f){$AA.FadeInAnimation.initializeBase(this,[n,t,i,$AA.FadeEffect.FadeIn,r,u,f])};$AA.FadeInAnimation.prototype={onStart:function(){$AA.FadeInAnimation.callBaseMethod(this,"onStart");this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}};$AA.FadeInAnimation.registerClass("Sys.Extended.UI.Animation.FadeInAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeIn",$AA.FadeInAnimation);$AA.FadeOutAnimation=function(n,t,i,r,u,f){$AA.FadeOutAnimation.initializeBase(this,[n,t,i,$AA.FadeEffect.FadeOut,r,u,f])};$AA.FadeOutAnimation.prototype={onStart:function(){$AA.FadeOutAnimation.callBaseMethod(this,"onStart");this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}};$AA.FadeOutAnimation.registerClass("Sys.Extended.UI.Animation.FadeOutAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation);$AA.PulseAnimation=function(n,t,i,r,u,f,e){$AA.PulseAnimation.initializeBase(this,[n,t,i,null,r!==undefined?r:3]);this._out=new $AA.FadeOutAnimation(n,t,i,u,f,e);this.add(this._out);this._in=new $AA.FadeInAnimation(n,t,i,u,f,e);this.add(this._in)};$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(n){n=this._getFloat(n);this._out.set_minimumOpacity(n);this._in.set_minimumOpacity(n);this.raisePropertyChanged("minimumOpacity")},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(n){n=this._getFloat(n);this._out.set_maximumOpacity(n);this._in.set_maximumOpacity(n);this.raisePropertyChanged("maximumOpacity")},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(n){n=this._getBoolean(n);this._out.set_forceLayoutInIE(n);this._in.set_forceLayoutInIE(n);this.raisePropertyChanged("forceLayoutInIE")},set_duration:function(n){n=this._getFloat(n);$AA.PulseAnimation.callBaseMethod(this,"set_duration",[n]);this._in.set_duration(n);this._out.set_duration(n)},set_fps:function(n){n=this._getInteger(n);$AA.PulseAnimation.callBaseMethod(this,"set_fps",[n]);this._in.set_fps(n);this._out.set_fps(n)}};$AA.PulseAnimation.registerClass("Sys.Extended.UI.Animation.PulseAnimation",$AA.SequenceAnimation);$AA.registerAnimation("pulse",$AA.PulseAnimation);$AA.PropertyAnimation=function(n,t,i,r,u){$AA.PropertyAnimation.initializeBase(this,[n,t,i]);this._property=r;this._propertyKey=u;this._currentTarget=null};$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target()},setValue:function(n){var t=this._currentTarget;t&&this._property&&this._property.length>0&&(this._propertyKey&&this._propertyKey.length>0&&t[this._property]?t[this._property][this._propertyKey]=n:t[this._property]=n)},getValue:function(){var t=this.get_target(),n;return t&&this._property&&this._property.length>0&&(n=t[this._property],n)?this._propertyKey&&this._propertyKey.length>0?n[this._propertyKey]:n:null},get_property:function(){return this._property},set_property:function(n){this._property!=n&&(this._property=n,this.raisePropertyChanged("property"))},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(n){this._propertyKey!=n&&(this._propertyKey=n,this.raisePropertyChanged("propertyKey"))}};$AA.PropertyAnimation.registerClass("Sys.Extended.UI.Animation.PropertyAnimation",$AA.Animation);$AA.registerAnimation("property",$AA.PropertyAnimation);$AA.DiscreteAnimation=function(n,t,i,r,u,f){$AA.DiscreteAnimation.initializeBase(this,[n,t,i,r,u]);this._values=f&&f.length?f:[]};$AA.DiscreteAnimation.prototype={getAnimatedValue:function(n){var t=Math.floor(this.interpolate(0,this._values.length-1,n));return this._values[t]},get_values:function(){return this._values},set_values:function(n){this._values!=n&&(this._values=n,this.raisePropertyChanged("values"))}};$AA.DiscreteAnimation.registerClass("Sys.Extended.UI.Animation.DiscreteAnimation",$AA.PropertyAnimation);$AA.registerAnimation("discrete",$AA.DiscreteAnimation);$AA.InterpolatedAnimation=function(n,t,i,r,u,f,e){$AA.InterpolatedAnimation.initializeBase(this,[n,t,i,r!==undefined?r:"style",u]);this._startValue=f;this._endValue=e};$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(n){n=this._getFloat(n);this._startValue!=n&&(this._startValue=n,this.raisePropertyChanged("startValue"))},get_endValue:function(){return this._endValue},set_endValue:function(n){n=this._getFloat(n);this._endValue!=n&&(this._endValue=n,this.raisePropertyChanged("endValue"))}};$AA.InterpolatedAnimation.registerClass("Sys.Extended.UI.Animation.InterpolatedAnimation",$AA.PropertyAnimation);$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation);$AA.ColorAnimation=function(n,t,i,r,u,f,e){$AA.ColorAnimation.initializeBase(this,[n,t,i,r,u,f,e]);this._start=null;this._end=null;this._interpolateRed=!1;this._interpolateGreen=!1;this._interpolateBlue=!1};$AA.ColorAnimation.prototype={onStart:function(){$AA.ColorAnimation.callBaseMethod(this,"onStart");this._start=$AA.ColorAnimation.getRGB(this.get_startValue());this._end=$AA.ColorAnimation.getRGB(this.get_endValue());this._interpolateRed=this._start.Red!=this._end.Red;this._interpolateGreen=this._start.Green!=this._end.Green;this._interpolateBlue=this._start.Blue!=this._end.Blue},getAnimatedValue:function(n){var t=this._start.Red,i=this._start.Green,r=this._start.Blue;return this._interpolateRed&&(t=Math.round(this.interpolate(t,this._end.Red,n))),this._interpolateGreen&&(i=Math.round(this.interpolate(i,this._end.Green,n))),this._interpolateBlue&&(r=Math.round(this.interpolate(r,this._end.Blue,n))),$AA.ColorAnimation.toColor(t,i,r)},set_startValue:function(n){this._startValue!=n&&(this._startValue=n,this.raisePropertyChanged("startValue"))},set_endValue:function(n){this._endValue!=n&&(this._endValue=n,this.raisePropertyChanged("endValue"))}};$AA.ColorAnimation.getRGB=function(n){if(!n||n.length!=7)throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor,n);return{Red:parseInt(n.substr(1,2),16),Green:parseInt(n.substr(3,2),16),Blue:parseInt(n.substr(5,2),16)}};$AA.ColorAnimation.toColor=function(n,t,i){var r=n.toString(16),u=t.toString(16),f=i.toString(16);return r.length==1&&(r="0"+r),u.length==1&&(u="0"+u),f.length==1&&(f="0"+f),"#"+r+u+f};$AA.ColorAnimation.registerClass("Sys.Extended.UI.Animation.ColorAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("color",$AA.ColorAnimation);$AA.LengthAnimation=function(n,t,i,r,u,f,e,o){$AA.LengthAnimation.initializeBase(this,[n,t,i,r,u,f,e]);this._unit=o!=null?o:"px"};$AA.LengthAnimation.prototype={getAnimatedValue:function(n){var t=this.interpolate(this.get_startValue(),this.get_endValue(),n);return Math.round(t)+this._unit},get_unit:function(){return this._unit},set_unit:function(n){this._unit!=n&&(this._unit=n,this.raisePropertyChanged("unit"))}};$AA.LengthAnimation.registerClass("Sys.Extended.UI.Animation.LengthAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("length",$AA.LengthAnimation);$AA.MoveAnimation=function(n,t,i,r,u,f,e){$AA.MoveAnimation.initializeBase(this,[n,t,i,null]);this._horizontal=r?r:0;this._vertical=u?u:0;this._relative=f===undefined?!0:f;this._horizontalAnimation=new $AA.LengthAnimation(n,t,i,"style","left",null,null,e);this._verticalAnimation=new $AA.LengthAnimation(n,t,i,"style","top",null,null,e);this.add(this._verticalAnimation);this.add(this._horizontalAnimation)};$AA.MoveAnimation.prototype={onStart:function(){$AA.MoveAnimation.callBaseMethod(this,"onStart");var n=this.get_target();this._horizontalAnimation.set_startValue(n.offsetLeft);this._horizontalAnimation.set_endValue(this._relative?n.offsetLeft+this._horizontal:this._horizontal);this._verticalAnimation.set_startValue(n.offsetTop);this._verticalAnimation.set_endValue(this._relative?n.offsetTop+this._vertical:this._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(n){n=this._getFloat(n);this._horizontal!=n&&(this._horizontal=n,this.raisePropertyChanged("horizontal"))},get_vertical:function(){return this._vertical},set_vertical:function(n){n=this._getFloat(n);this._vertical!=n&&(this._vertical=n,this.raisePropertyChanged("vertical"))},get_relative:function(){return this._relative},set_relative:function(n){n=this._getBoolean(n);this._relative!=n&&(this._relative=n,this.raisePropertyChanged("relative"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(n){var t=this._horizontalAnimation.get_unit();t!=n&&(this._horizontalAnimation.set_unit(n),this._verticalAnimation.set_unit(n),this.raisePropertyChanged("unit"))}};$AA.MoveAnimation.registerClass("Sys.Extended.UI.Animation.MoveAnimation",$AA.ParallelAnimation);$AA.registerAnimation("move",$AA.MoveAnimation);$AA.ResizeAnimation=function(n,t,i,r,u,f){$AA.ResizeAnimation.initializeBase(this,[n,t,i,null]);this._width=r;this._height=u;this._horizontalAnimation=new $AA.LengthAnimation(n,t,i,"style","width",null,null,f);this._verticalAnimation=new $AA.LengthAnimation(n,t,i,"style","height",null,null,f);this.add(this._horizontalAnimation);this.add(this._verticalAnimation)};$AA.ResizeAnimation.prototype={onStart:function(){$AA.ResizeAnimation.callBaseMethod(this,"onStart");var n=this.get_target();this._horizontalAnimation.set_startValue(n.offsetWidth);this._verticalAnimation.set_startValue(n.offsetHeight);this._horizontalAnimation.set_endValue(this._width!==null&&this._width!==undefined?this._width:n.offsetWidth);this._verticalAnimation.set_endValue(this._height!==null&&this._height!==undefined?this._height:n.offsetHeight)},get_width:function(){return this._width},set_width:function(n){n=this._getFloat(n);this._width!=n&&(this._width=n,this.raisePropertyChanged("width"))},get_height:function(){return this._height},set_height:function(n){n=this._getFloat(n);this._height!=n&&(this._height=n,this.raisePropertyChanged("height"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(n){var t=this._horizontalAnimation.get_unit();t!=n&&(this._horizontalAnimation.set_unit(n),this._verticalAnimation.set_unit(n),this.raisePropertyChanged("unit"))}};$AA.ResizeAnimation.registerClass("Sys.Extended.UI.Animation.ResizeAnimation",$AA.ParallelAnimation);$AA.registerAnimation("resize",$AA.ResizeAnimation);$AA.ScaleAnimation=function(n,t,i,r,u,f,e,o){$AA.ScaleAnimation.initializeBase(this,[n,t,i]);this._scaleFactor=r!==undefined?r:1;this._unit=u!==undefined?u:"px";this._center=f;this._scaleFont=e;this._fontUnit=o!==undefined?o:"pt";this._element=null;this._initialHeight=null;this._initialWidth=null;this._initialTop=null;this._initialLeft=null;this._initialFontSize=null};$AA.ScaleAnimation.prototype={getAnimatedValue:function(n){return this.interpolate(1,this._scaleFactor,n)},onStart:function(){$AA.ScaleAnimation.callBaseMethod(this,"onStart");this._element=this.get_target();this._element&&(this._initialHeight=this._element.offsetHeight,this._initialWidth=this._element.offsetWidth,this._center&&(this._initialTop=this._element.offsetTop,this._initialLeft=this._element.offsetLeft),this._scaleFont&&(this._initialFontSize=parseFloat($common.getCurrentStyle(this._element,"fontSize"))))},setValue:function(n){var i,r,t;this._element&&(i=Math.round(this._initialWidth*n),r=Math.round(this._initialHeight*n),this._element.style.width=i+this._unit,this._element.style.height=r+this._unit,this._center&&(this._element.style.top=this._initialTop+Math.round((this._initialHeight-r)/2)+this._unit,this._element.style.left=this._initialLeft+Math.round((this._initialWidth-i)/2)+this._unit),this._scaleFont&&(t=this._initialFontSize*n,(this._fontUnit=="px"||this._fontUnit=="pt")&&(t=Math.round(t)),this._element.style.fontSize=t+this._fontUnit))},onEnd:function(){this._element=null;this._initialHeight=null;this._initialWidth=null;this._initialTop=null;this._initialLeft=null;this._initialFontSize=null;$AA.ScaleAnimation.callBaseMethod(this,"onEnd")},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(n){n=this._getFloat(n);this._scaleFactor!=n&&(this._scaleFactor=n,this.raisePropertyChanged("scaleFactor"))},get_unit:function(){return this._unit},set_unit:function(n){this._unit!=n&&(this._unit=n,this.raisePropertyChanged("unit"))},get_center:function(){return this._center},set_center:function(n){n=this._getBoolean(n);this._center!=n&&(this._center=n,this.raisePropertyChanged("center"))},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(n){n=this._getBoolean(n);this._scaleFont!=n&&(this._scaleFont=n,this.raisePropertyChanged("scaleFont"))},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(n){this._fontUnit!=n&&(this._fontUnit=n,this.raisePropertyChanged("fontUnit"))}};$AA.ScaleAnimation.registerClass("Sys.Extended.UI.Animation.ScaleAnimation",$AA.Animation);$AA.registerAnimation("scale",$AA.ScaleAnimation);$AA.Action=function(n,t,i){$AA.Action.initializeBase(this,[n,t,i]);t===undefined&&this.set_duration(0)};$AA.Action.prototype={onEnd:function(){this.doAction();$AA.Action.callBaseMethod(this,"onEnd")},doAction:function(){throw Error.notImplemented();},getAnimatedValue:function(){},setValue:function(){}};$AA.Action.registerClass("Sys.Extended.UI.Animation.Action",$AA.Animation);$AA.registerAnimation("action",$AA.Action);$AA.EnableAction=function(n,t,i,r){$AA.EnableAction.initializeBase(this,[n,t,i]);this._enabled=r!==undefined?r:!0};$AA.EnableAction.prototype={doAction:function(){var n=this.get_target();n&&(n.disabled=!this._enabled)},get_enabled:function(){return this._enabled},set_enabled:function(n){n=this._getBoolean(n);this._enabled!=n&&(this._enabled=n,this.raisePropertyChanged("enabled"))}};$AA.EnableAction.registerClass("Sys.Extended.UI.Animation.EnableAction",$AA.Action);$AA.registerAnimation("enableAction",$AA.EnableAction);$AA.HideAction=function(n,t,i,r){$AA.HideAction.initializeBase(this,[n,t,i]);this._visible=r};$AA.HideAction.prototype={doAction:function(){var n=this.get_target();n&&$common.setVisible(n,this._visible)},get_visible:function(){return this._visible},set_visible:function(n){this._visible!=n&&(this._visible=n,this.raisePropertyChanged("visible"))}};$AA.HideAction.registerClass("Sys.Extended.UI.Animation.HideAction",$AA.Action);$AA.registerAnimation("hideAction",$AA.HideAction);$AA.StyleAction=function(n,t,i,r,u){$AA.StyleAction.initializeBase(this,[n,t,i]);this._attribute=r;this._value=u};$AA.StyleAction.prototype={doAction:function(){var n=this.get_target();n&&(n.style[this._attribute]=this._value)},get_attribute:function(){return this._attribute},set_attribute:function(n){this._attribute!=n&&(this._attribute=n,this.raisePropertyChanged("attribute"))},get_value:function(){return this._value},set_value:function(n){this._value!=n&&(this._value=n,this.raisePropertyChanged("value"))}};$AA.StyleAction.registerClass("Sys.Extended.UI.Animation.StyleAction",$AA.Action);$AA.registerAnimation("styleAction",$AA.StyleAction);$AA.OpacityAction=function(n,t,i,r){$AA.OpacityAction.initializeBase(this,[n,t,i]);this._opacity=r};$AA.OpacityAction.prototype={doAction:function(){var n=this.get_target();n&&$common.setElementOpacity(n,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(n){n=this._getFloat(n);this._opacity!=n&&(this._opacity=n,this.raisePropertyChanged("opacity"))}};$AA.OpacityAction.registerClass("Sys.Extended.UI.Animation.OpacityAction",$AA.Action);$AA.registerAnimation("opacityAction",$AA.OpacityAction);$AA.ScriptAction=function(n,t,i,r){$AA.ScriptAction.initializeBase(this,[n,t,i]);this._script=r};$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(ex){}},get_script:function(){return this._script},set_script:function(n){this._script!=n&&(this._script=n,this.raisePropertyChanged("script"))}};$AA.ScriptAction.registerClass("Sys.Extended.UI.Animation.ScriptAction",$AA.Action);$AA.registerAnimation("scriptAction",$AA.ScriptAction);var $AA; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AreaChart.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AreaChart.js new file mode 100644 index 000000000..b3dad6283 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AreaChart.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.AreaChart=function(n){Sys.Extended.UI.AreaChart.initializeBase(this,[n]);var t=this.get_id();t=t.replace("_ctl00","");this._parentDiv=document.getElementById(t+"__ParentDiv");this._displayValues=!0;this._chartWidth="300";this._chartHeight="300";this._chartTitle="";this._categoriesAxis="";this._series=null;this._chartType=Sys.Extended.UI.AreaChartType.Basic;this._theme="AreaChart";this._valueAxisLines=9;this._chartTitleColor="";this._valueAxisLineColor="";this._categoryAxisLineColor="";this._baseLineColor="";this.yMax=0;this.yMin=0;this.roundedTickRange=0;this.startX=0;this.startY=0;this.endX=0;this.endY=0;this.xInterval=0;this.yInterval=0;this.arrXAxis;this.arrXAxisLength=0;this.charLength=3.5;this.arrCombinedData=null};Sys.Extended.UI.AreaChart.prototype={initialize:function(){if(Sys.Extended.UI.AreaChart.callBaseMethod(this,"initialize"),!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))throw"Current version of browser does not support SVG.";this._valueAxisLines==0&&(this._valueAxisLines=9);this.generateAreaChart()},dispose:function(){Sys.Extended.UI.AreaChart.callBaseMethod(this,"dispose")},generateAreaChart:function(){this.arrXAxis=this._categoriesAxis.split(",");this.arrXAxisLength=this.arrXAxis.length;this.calculateMinMaxValues();this.calculateInterval();this.calculateValueAxis();var n=this.initializeSVG();n=n+String.format('{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n=n+this.drawBackgroundHorizontalLines();n=n+this.drawBackgroundVerticalLines();n=n+this.drawBaseLines();n=n+this.drawLegendArea();n=n+this.drawAxisValues();this._parentDiv.innerHTML=n;this.drawAreas()},calculateInterval:function(){this.startX=this._chartWidth/10+.5;this.endX=parseInt(this._chartWidth)-4.5;this.startY=this.yMin>=0?Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)*24/100)+.5:Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)*12/100)/2+.5;this.yInterval=this.startY/(this._valueAxisLines+1)},calculateMinMaxValues:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.AreaChartType.Basic)for(n=0;nthis.yMax&&(this.yMax=u),i=0?this.yMax:this.yMax>Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t);this.startX=this.startX+(this.roundedTickRange*10*this._valueAxisLines/10).toString().length*this.charLength},drawBackgroundHorizontalLines:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._categoryAxisLineColor);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._categoryAxisLineColor);return t},drawBackgroundVerticalLines:function(){var t="",n;for(this.xInterval=Math.round((parseInt(this._chartWidth)-this.startX)/this.arrXAxisLength),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);if(this.yMin<0)for(n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);return t},drawBaseLines:function(){var n="",t;for(n=n+String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),t=0;t<\/path>',parseInt(this._chartWidth)-5-this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);for(t=0;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*t,this._baseLineColor);if(this.yMin<0)for(n=n+String.format('<\/path>',this.startX,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),t=1;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*t,this._baseLineColor);return n},drawLegendArea:function(){for(var r,l,t="",o=parseInt(this._chartHeight)*82/100+5,i=7.5,u=5,c=0,n=0;nparseInt(this._chartWidth)/2&&(r=r/2,l=!0);t=t+"";t=t+String.format('<\/path>',parseInt(this._chartWidth)/2-r/2,o,Math.round(parseInt(this._chartWidth)/2+c*5)+Math.round((i+u*2)*this._series.length),Math.round(parseInt(this._chartHeight)*97.5/100));var e=parseInt(this._chartWidth)*40/100-r/2+i+u,s=e,f=parseInt(this._chartWidth)*40/100-r/2,h=f;for(n=0;n<\/path>',f,o+7.5,f+i,o+15,n+1,this._series[n].AreaColor),t=t+String.format('{2}<\/text>',e,o+15,this._series[n].Name),this._series[n].Name.length>10?(h=f+this._series[n].Name.length*5+i+u*2,s=e+this._series[n].Name.length*5+i+u*2):(h=h+this._series[n].Name.length*6+i+u*2,s=s+this._series[n].Name.length*6+i+u*2);return t+"<\/g>"},drawAxisValues:function(){for(var t="",i=0,n=0;n{2}<\/text>',Math.round(this.startX+this.xInterval*10*n/10+this.xInterval/2-i),this.startY+Math.round(this.yInterval*65/100),this.arrXAxis[n]);for(n=0;n<=this._valueAxisLines;n++)i=(this.roundedTickRange*10*n/10).toString().length*5.5,t=t+String.format('{2}<\/text>',this.startX-i-15,this.startY-this.yInterval*10*n/10+3.5,this.roundedTickRange*10*n/10);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)i=(this.roundedTickRange*10*n/10).toString().length*5.5,t=t+String.format('-{2}<\/text>',this.startX-i-19,this.startY+this.yInterval*10*n/10,this.roundedTickRange*10*n/10);return t},initializeSVG:function(){var n=String.format('',this._theme);return n=n+String.format('',this._chartWidth,this._chartHeight),n=n+"",n=n+'',n=n+'<\/stop>',n=n+'<\/stop>',n=n+'<\/stop><\/linearGradient>',n=n+"<\/defs>",n=n+String.format('<\/path>',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10),n=n+String.format('<\/path>',this._chartWidth,this._chartHeight),n+String.format('<\/path>',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10)},drawAreas:function(){for(var n,f,h,e=this.get_displayValues(),r="",t=[],o=[],s=[],u=[],i=0;i0?r+String.format('{2}<\/text>',this.startX+this.xInterval*i+this.xInterval/2-t[n].toString().length*this.charLength,this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))-7.5,e?t[n]:""):r+String.format('{2}<\/text>',this.startX+this.xInterval*i+this.xInterval/2-t[n].toString().length*this.charLength,this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))+7.5,e?t[n]:"");o[n]=this.startX+this.xInterval*i+this.xInterval/2;s[n]=this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))}this._parentDiv.innerHTML=this._parentDiv.innerHTML+r;h=this._parentDiv.innerHTML;this._drawArea(u,0)},_drawArea:function(n,t){var i=this;i._parentDiv.innerHTML=i._parentDiv.innerHTML.replace("<\/svg>","")+String.format('<\/path><\/g><\/svg>',n[t],t+1,i._series[t].AreaColor);t++;t0){if(t[0]=="error"){this._onError(t[1]);return}u=parseInt(t[0])}t.length>1&&(i=t[1]);this.get_completeBackColor()!=""&&(this._innerTB!=null?this._innerTB.style.backgroundColor=this.get_completeBackColor():this._inputFile.style.backgroundColor=this.get_completeBackColor());this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value,u,i,null))},_onload:function(n){var l=!0,f=this,i=document.getElementById(this._formName),t,a,u,e,v,o,r,s,h,y,c,n;try{if(t=this._iframe.contentWindow.document,t==null||t.location==null){n={message:Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem};throw n;}else if(t.location.href=="about:blank"){if(this._removeTimer(),this.get_uploadingBackColor()!=""&&(this._innerTB!=null?this._innerTB.style.backgroundColor=this.get_uploadingBackColor():this._inputFile.style.backgroundColor=this.get_uploadingBackColor()),a=this._onStart(this._inputFile.value),a)return u=this._postBackUrl,u+=u.indexOf("?")===-1?"?":"&",i.action=u+"AsyncFileUploadID="+this.get_element().id+"&rnd="+Math.random().toString().replace(/\./g,""),i.target=this._iframeName,l=!1,this.setThrobber(!0),setTimeout(function(){i.submit();f._waitTimer=setTimeout(function(){f._wait()},100)},0),!0}else{if(t.body.innerHTML=="")return!0;if(e=t.getElementById(this.get_element().id),o="",e!=null){if(r=e.innerHTML.split("------"),r.length>0){if(r[0]=="error"){n={message:r[1]};throw n;}v=parseInt(r[0])}r.length>1&&(o=r[1])}else{s=Sys.Extended.UI.Resources.AsyncFileUpload_UnknownServerError;function w(n,t){return s=t,""}if(t.body.innerHTML.replace(/Exception\]:([^\n\r]+)[\n\r]/,w),h=Sys.Extended.UI.Resources.AsyncFileUpload_ServerResponseError+": '"+s+"'",y=confirm(h+"\n\n"+Sys.Extended.UI.Resources.AsyncFileUpload_ConfirmToSeeErrorPage),y){c=window.open("","NotFoundInAnswer","toolbar=0,status=1,scrollbars=1,resizable=1,width=600,height=400");function p(){try{c.document||setTimeout(p,100)}catch(i){return}var n=c.document;n.open();n.write(""+t.body.innerHTML+"<\/body>");n.close()}setTimeout(p,0)}n={message:h};throw n;}this._removeTimer();i.target="_top";i.action=this._postBackUrl;this.get_completeBackColor()!=""&&(this._innerTB!=null?this._innerTB.style.backgroundColor=this.get_completeBackColor():this._inputFile.style.backgroundColor=this.get_completeBackColor());this.setThrobber(!1);this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value,v,o,null))}}catch(b){this._removeTimer();i.target="_top";i.action=this._postBackUrl;this._onError(b.message)}finally{l&&setTimeout(function(){f._removeIframe()},100)}},_wait:function(){var n;if(this._waitTimer!=null){n=this;try{var t=this._iframe.contentWindow.document,i=t.location,r=i.href;this._waitTimer=setTimeout(function(){n._wait()},100)}catch(u){setTimeout(function(){n._removeIframe()},100);setTimeout(function(){n._onError(Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem)},0);this._waitTimer=null}}}};Sys.Extended.UI.AsyncFileUpload.registerClass("Sys.Extended.UI.AsyncFileUpload",Sys.Extended.UI.ControlBase);Sys.Extended.UI.AsyncFileUploadEventArgs=function(n,t,i,r){if(arguments.length!=4)throw Error.parameterCount();Sys.Extended.UI.AsyncFileUploadEventArgs.initializeBase(this);this._fileName=n;this._length=t;this._contentType=i;this._errorMessage=r};Sys.Extended.UI.AsyncFileUploadEventArgs.prototype={get_fileName:function(){var n=this._fileName.lastIndexOf("/"),t=this._fileName.lastIndexOf("\\");return this._fileName.substr((n>t?n:t)+1)},get_path:function(){return this._fileName},get_length:function(){return this._length},get_contentType:function(){return this._contentType},get_errorMessage:function(){return this._errorMessage}};Sys.Extended.UI.AsyncFileUploadEventArgs.registerClass("Sys.Extended.UI.AsyncFileUploadEventArgs",Sys.EventArgs); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AutoComplete.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AutoComplete.js new file mode 100644 index 000000000..d15944cbc --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/AutoComplete.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.AutoCompleteBehavior=function(n){Sys.Extended.UI.AutoCompleteBehavior.initializeBase(this,[n]);this._servicePath=null;this._serviceMethod=null;this._contextKey=null;this._useContextKey=!1;this._minimumPrefixLength=3;this._completionSetCount=10;this._completionInterval=1e3;this._completionListElementID=null;this._completionListElement=null;this._textColor="windowtext";this._textBackground="window";this._popupBehavior=null;this._popupBehaviorHiddenHandler=null;this._onShowJson=null;this._onHideJson=null;this._timer=null;this._cache=null;this._currentPrefix=null;this._selectIndex=-1;this._focusHandler=null;this._blurHandler=null;this._bodyClickHandler=null;this._completionListBlurHandler=null;this._keyDownHandler=null;this._mouseDownHandler=null;this._mouseUpHandler=null;this._mouseOverHandler=null;this._tickHandler=null;this._enableCaching=!0;this._flyoutHasFocus=!1;this._textBoxHasFocus=!1;this._completionListCssClass=null;this._completionListItemCssClass=null;this._highlightedItemCssClass=null;this._delimiterCharacters=null;this._firstRowSelected=!1;this._showOnlyCurrentWordInCompletionListItem=!1;this._webRequest=null};Sys.Extended.UI.AutoCompleteBehavior.prototype={initialize:function(){Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this,"initialize");$common.prepareHiddenElementForATDeviceUpdate();this._popupBehaviorHiddenHandler=Function.createDelegate(this,this._popupHidden);this._tickHandler=Function.createDelegate(this,this._onTimerTick);this._focusHandler=Function.createDelegate(this,this._onGotFocus);this._blurHandler=Function.createDelegate(this,this._onLostFocus);this._keyDownHandler=Function.createDelegate(this,this._onKeyDown);this._mouseDownHandler=Function.createDelegate(this,this._onListMouseDown);this._mouseUpHandler=Function.createDelegate(this,this._onListMouseUp);this._mouseOverHandler=Function.createDelegate(this,this._onListMouseOver);this._completionListBlurHandler=Function.createDelegate(this,this._onCompletionListBlur);this._bodyClickHandler=Function.createDelegate(this,this._onCompletionListBlur);this._timer=new Sys.Timer;this.initializeTimer(this._timer);var n=this.get_element();this.initializeTextBox(n);this._completionListElementID!==null&&(this._completionListElement=$get(this._completionListElementID));this._completionListElement==null&&(this._completionListElement=document.createElement("ul"),this._completionListElement.id=this.get_id()+"_completionListElem",Sys.Browser.agent===Sys.Browser.Safari?document.body.appendChild(this._completionListElement):n.parentNode.insertBefore(this._completionListElement,n.nextSibling));this.initializeCompletionList(this._completionListElement);this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"PopupBehavior",parentElement:n,positioningMode:Sys.Extended.UI.PositioningMode.BottomLeft},null,null,this._completionListElement);this._popupBehavior.add_hidden(this._popupBehaviorHiddenHandler);this._onShowJson&&this._popupBehavior.set_onShow(this._onShowJson);this._onHideJson&&this._popupBehavior.set_onHide(this._onHideJson)},dispose:function(){this._onShowJson=null;this._onHideJson=null;this._popupBehavior&&(this._popupBehaviorHiddenHandler&&this._popupBehavior.remove_hidden(this._popupBehaviorHiddenHandler),this._popupBehavior.dispose(),this._popupBehavior=null);this._timer&&(this._timer.dispose(),this._timer=null);var n=this.get_element();n&&($removeHandler(n,"focus",this._focusHandler),$removeHandler(n,"blur",this._blurHandler),$removeHandler(n,"keydown",this._keyDownHandler),$removeHandler(this._completionListElement,"blur",this._completionListBlurHandler),$removeHandler(this._completionListElement,"mousedown",this._mouseDownHandler),$removeHandler(this._completionListElement,"mouseup",this._mouseUpHandler),$removeHandler(this._completionListElement,"mouseover",this._mouseOverHandler));this._bodyClickHandler&&($removeHandler(document.body,"click",this._bodyClickHandler),this._bodyClickHandler=null);this._popupBehaviorHiddenHandler=null;this._tickHandler=null;this._focusHandler=null;this._blurHandler=null;this._keyDownHandler=null;this._completionListBlurHandler=null;this._mouseDownHandler=null;this._mouseUpHandler=null;this._mouseOverHandler=null;Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this,"dispose")},initializeTimer:function(n){n.set_interval(this._completionInterval);n.add_tick(this._tickHandler)},initializeTextBox:function(n){n.autocomplete="off";$addHandler(n,"focus",this._focusHandler);$addHandler(n,"blur",this._blurHandler);$addHandler(n,"keydown",this._keyDownHandler)},initializeCompletionList:function(n){if(this._completionListCssClass)Sys.UI.DomElement.addCssClass(n,this._completionListCssClass);else{var t=n.style;t.textAlign="left";t.visibility="hidden";t.cursor="default";t.listStyle="none";t.padding="0px";t.margin="0px! important";Sys.Browser.agent===Sys.Browser.Safari?(t.border="solid 1px gray",t.backgroundColor="white",t.color="black"):(t.border="solid 1px buttonshadow",t.backgroundColor=this._textBackground,t.color=this._textColor)}$addHandler(n,"mousedown",this._mouseDownHandler);$addHandler(n,"mouseup",this._mouseUpHandler);$addHandler(n,"mouseover",this._mouseOverHandler);$addHandler(n,"blur",this._completionListBlurHandler);$addHandler(document.body,"click",this._bodyClickHandler)},_currentCompletionWord:function(){var u=this.get_element(),t=u.value,r=t,n,i;return this.get_isMultiWord()&&(n=this._getCurrentWordStartIndex(),i=this._getCurrentWordEndIndex(n),r=i<=n?t.substring(n):t.substring(n,i)),r},_getCursorIndex:function(){return this.get_element().selectionStart},_getCurrentWordStartIndex:function(){for(var r,u=this.get_element(),f=u.value.substring(0,this._getCursorIndex()),n=0,t=-1,i=0;it&&(t=r);return n=t,n>=this._getCursorIndex()&&(n=0),n<0?0:n+1},_getCurrentWordEndIndex:function(n){for(var i,u=this.get_element(),f=u.value.substring(n),t=0,r=0;r0&&(i0&&(f=r.substring(0,t));u>t&&(e=r.substring(u));i=f+n+e}return i},_hideCompletionList:function(){var n=new Sys.CancelEventArgs;(this.raise_hiding(n),n.get_cancel())||this.hidePopup()},showPopup:function(){this._popupBehavior.show();this.raise_shown(Sys.EventArgs.Empty)},hidePopup:function(){this._popupBehavior?this._popupBehavior.hide():this._popupHidden()},_popupHidden:function(){this._completionListElement.innerHTML="";this._selectIndex=-1;this._flyoutHasFocus=!1;this.raise_hidden(Sys.EventArgs.Empty)},_highlightItem:function(n){for(var t,r=this._completionListElement.childNodes,i=0;i0&&(this._selectIndex--,this._handleScroll(this._completionListElement.childNodes[this._selectIndex],this._selectIndex),this._highlightItem(this._completionListElement.childNodes[this._selectIndex]),n.stopPropagation(),n.preventDefault()):t===Sys.UI.Key.down?this._selectIndex=0&&(i.scrollTop+=r.height*t-(i.clientHeight+i.scrollTop)+r.height);r.height*(u-(t+1))-(i.scrollHeight-i.scrollTop)>=0&&(i.scrollTop-=r.height*(u-(t+1))-(i.scrollHeight-i.scrollTop)+r.height);i.scrollTop%r.height!=0&&(r.height*(t+1)-(i.clientHeight+i.scrollTop)>=0?i.scrollTop-=i.scrollTop%r.height:i.scrollTop+=r.height-i.scrollTop%r.height)},_handleFlyoutFocus:function(){this._textBoxHasFocus||this._flyoutHasFocus||(this._webRequest&&(this._webRequest.get_executor().abort(),this._webRequest=null),this._hideCompletionList())},_onLostFocus:function(){this._textBoxHasFocus=!1;this._timer.set_enabled(!1);window.setTimeout(Function.createDelegate(this,this._handleFlyoutFocus),500)},_onMethodComplete:function(n,t){this._webRequest=null;this._update(t,n,!0)},_onMethodFailed:function(){this._webRequest=null},_onTimerTick:function(n,t){var i,t,r;if(this._timer.set_enabled(!1),this._servicePath&&this._serviceMethod){if(i=this._currentCompletionWord(),i.trim().length0&&f-r>c-l?u{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n=n+this.drawBackgroundHorizontalLinesForColumnType();n=n+this.drawBackgroundVerticalLinesForColumnType();n=n+this.drawBaseLinesForColumnType();n=n+this.drawLegendArea();n=n+this.drawAxisValuesForColumnType();n=n+this.drawBarsForColumnType();n=n+"<\/svg>";this._parentDiv.innerHTML=n},calculateIntervalForColumnType:function(){this.startX=this._chartWidth/10+.5;this.endX=parseInt(this._chartWidth)-4.5;this.startY=this.yMin>=0?Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)*24/100)+.5:Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)*12/100)/2+.5;this.yInterval=this.startY/(this._valueAxisLines+1)},calculateMinMaxValuesForColumnType:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.BarChartType.Column)for(n=0;nthis.yMax&&(this.yMax=u),i=0?this.yMax:this.yMax>Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t);this.startX=this.startX+(this.roundedTickRange*10*this._valueAxisLines/10).toString().length*this.charLength},drawBackgroundHorizontalLinesForColumnType:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._categoryAxisLineColor);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._categoryAxisLineColor);return t},drawBackgroundVerticalLinesForColumnType:function(){var t="",n;for(this.xInterval=Math.round((parseInt(this._chartWidth)-this.startX)/this.arrXAxisLength),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);if(this.yMin<0)for(n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);return t},drawBaseLinesForColumnType:function(){var n="",t;for(n=n+String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),t=0;t<\/path>',parseInt(this._chartWidth)-5-this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);for(t=0;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*t,this._baseLineColor);if(this.yMin<0)for(n=n+String.format('<\/path>',this.startX,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),t=1;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*t,this._baseLineColor);return n},drawAxisValuesForColumnType:function(){for(var t="",i=0,n=0;n{2}<\/text>',Math.round(this.startX+this.xInterval*10*n/10+this.xInterval/2-i),this.startY+Math.round(this.yInterval*65/100),this.arrXAxis[n]);for(n=0;n<=this._valueAxisLines;n++)i=(this.roundedTickRange*10*n/10).toString().length*5.5,t=t+String.format('{2}<\/text>',this.startX-i-15,this.startY-this.yInterval*10*n/10+3.5,this.roundedTickRange*10*n/10);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)i=(this.roundedTickRange*10*n/10).toString().length*5.5,t=t+String.format('-{2}<\/text>',this.startX-i-19,this.startY+this.yInterval*10*n/10,this.roundedTickRange*10*n/10);return t},drawBarsForColumnType:function(){var i="",o=this._series.length,e=this.xInterval/10,r,s,t,u,f,n;for(r=this._chartType==Sys.Extended.UI.BarChartType.Column?Math.round((this.xInterval*80/100-e*o)/o):Math.round(this.xInterval*80/100),s="",t=0;t",this._chartType==Sys.Extended.UI.BarChartType.Column)for(n=0;n',this.startX+this.xInterval*t+this.xInterval*15/100+(e+r)*n,this.startX+this.xInterval*t+this.xInterval*15/100+(e+r)*n+r,this.startY,this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):i+String.format('',this.startX+this.xInterval*t+this.xInterval*12.5/100+(e+r)*n,this.startX+this.xInterval*t+this.xInterval*12.5/100+(e+r)*n+r,this.startY,this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor),i=this.yVal>0?i+String.format('{2}<\/text>',this.startX+this.xInterval*t+this.xInterval/5+(e+r)*n+r/10-Math.round(this.yVal.toString().length*this.charLength/2),this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange))-7.5,this.yVal):i+String.format('{2}<\/text>',this.startX+this.xInterval*t+this.xInterval/5+(e+r)*n+r/10-Math.round(this.yVal.toString().length*this.charLength/2),this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange))+7.5,this.yVal);else for(u=this.startY,f=this.startY,n=0;n0?i+String.format('',this.startX+this.xInterval*10*t/10+this.xInterval*7.5/100,this.startX+this.xInterval*10*t/10+this.xInterval*7.5/100+r,u,u-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):i+String.format('',this.startX+this.xInterval*10*t/10+this.xInterval*7.5/100,this.startX+this.xInterval*10*t/10+this.xInterval*7.5/100+r,f,f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):this.yVal>0?i+String.format('',this.startX+this.xInterval*10*t/10+this.xInterval/20,this.startX+this.xInterval*10*t/10+this.xInterval/20+r,u,u-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):i+String.format('',this.startX+this.xInterval*10*t/10+this.xInterval/20,this.startX+this.xInterval*10*t/10+this.xInterval/20+r,f,f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor),this.yVal>0?(i=i+String.format('{2}<\/text>',this.startX+this.xInterval*10*t/10+this.xInterval*30/100+r/10,u-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)/2),this.yVal),u=u-Math.round(this.yVal*(this.yInterval/this.roundedTickRange))):(i=i+String.format('{2}<\/text>',this.startX+this.xInterval*10*t/10+this.xInterval*30/100+r/10,f+Math.round(Math.abs(this.yVal)*(this.yInterval/this.roundedTickRange)/2),this.yVal),f=f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)));i=i+"<\/g>"}return i},initializeSVG:function(){var n=String.format('',this._theme);return n=n+String.format('',this._chartWidth,this._chartHeight),n=n+"",n=n+'',n=n+'<\/stop>',n=n+'<\/stop>',n=n+'<\/stop><\/linearGradient>',n=n+"<\/defs>",n=n+String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10),n=n+String.format('',this._chartWidth,this._chartHeight),n+String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10)},drawLegendArea:function(){for(var t,c,i="",o=parseInt(this._chartHeight)*84/100+5,r=7.5,u=5,l=0,n=0;nparseInt(this._chartWidth)/2&&(t=t/2,c=!0);i=i+"";i=i+String.format('<\/path>',Math.round(parseInt(this._chartWidth)/2-t/2),o,Math.round(parseInt(this._chartWidth)/2+t/2),Math.round(parseInt(this._chartHeight)*97.5/100));var e=parseInt(this._chartWidth)*40/100-t/2+r+u,s=e,f=parseInt(this._chartWidth)*40/100-t/2,h=f;for(n=0;n<\/path>',f,o+7.5,f+r,o+15,n+1,this._series[n].BarColor),i=i+String.format('{2}<\/text>',e,o+15,this._series[n].Name),this._series[n].Name.length>10?(h=f+this._series[n].Name.length*5+r+u*2,s=e+this._series[n].Name.length*5+r+u*2):(h=h+this._series[n].Name.length*6+r+u*2,s=s+this._series[n].Name.length*6+r+u*2);return i+"<\/g>"},generateBarChart:function(){this.arrYAxis=this._categoriesAxis.split(",");this.arrYAxisLength=this.arrYAxis.length;this.calculateMinMaxValuesForBarType();this.calculateIntervalForBarType();this.calculateValueAxisForBarType();var n=this.initializeSVG();n=n+String.format('{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n=n+this.drawBackgroundHorizontalLinesForBarType();n=n+this.drawBackgroundVerticalLinesForBarType();n=n+this.drawBaseLinesForBarType();n=n+this.drawLegendArea();n=n+this.drawAxisValuesForBarType();n=n+this.drawBarsForBarType();n=n+"<\/svg>";this._parentDiv.innerHTML=n},calculateIntervalForBarType:function(){this.startY=Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/5)+.5;this.endY=parseInt(this._chartHeight)*8/100+5;this.endX=parseInt(this._chartWidth)-10+.5;this.startX=this.xMin>=0?this._chartWidth*15/100+.5:Math.round(parseInt(this._chartWidth)/2)+.5;this.xInterval=Math.round((this.endX-this.startX)/this._valueAxisLines)},calculateMinMaxValuesForBarType:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.BarChartType.Bar)for(n=0;nthis.xMax&&(this.xMax=u),i=0?this.xMax:this.xMax>Math.abs(this.xMin)?this.xMax:Math.abs(this.xMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t)},drawBackgroundVerticalLinesForBarType:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY-this.yInterval*this.arrYAxisLength,this._categoryAxisLineColor);if(this.xMin<0)for(n=1;n<=this._valueAxisLines;n++)t=t+String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY-this.yInterval*this.arrYAxisLength,this._categoryAxisLineColor);return t},drawBackgroundHorizontalLinesForBarType:function(){var t="",n;for(this.yInterval=Math.round((this.startY-this.endY)/this.arrYAxisLength),n=0;n<=this.arrYAxisLength;n++)t=t+String.format('<\/path>',this.startX,this.startX+this.xInterval*this._valueAxisLines,this.startY-this.yInterval*n,this._valueAxisLineColor);if(this.xMin<0)for(n=0;n<=this.arrYAxisLength;n++)t=t+String.format('<\/path>',this.startX,this.startX-this.xInterval*this._valueAxisLines,this.startY-this.yInterval*n,this._valueAxisLineColor);return t},drawBaseLinesForBarType:function(){var n="",t;for(n=n+String.format('<\/path>',this.startX,this.startY,this.endY,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startX-4,this.startY,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.endX,this.startY,this._baseLineColor),t=0;t<\/path>',this.startX,this.startX-4,this.startY-this.yInterval*t,this._baseLineColor);for(t=0;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX+this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);if(this.xMin<0)for(n=n+String.format('<\/path>',this.startX,this.startX-this.xInterval*this._valueAxisLines,this.startY,this._baseLineColor),t=1;t<=this._valueAxisLines;t++)n=n+String.format('<\/path>',this.startX-this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);return n},drawAxisValuesForBarType:function(){for(var t="",i=0,n=0;n{2}<\/text>',this.startX-this.xInterval*15/100-i,Math.round(this.startY-this.yInterval*(n+1)+this.yInterval*60/100),this.arrYAxis[n]);for(n=0;n<=this._valueAxisLines;n++)t=t+String.format('{2}<\/text>',this.startX+this.xInterval*n-(this.roundedTickRange*n).toString().length*this.charLength,this.startY+this.yInterval*35/100,this.roundedTickRange*n);if(this.xMin<0)for(n=1;n<=this._valueAxisLines;n++)t=t+String.format('-{2}<\/text>',this.startX-this.xInterval*n-(this.roundedTickRange*n).toString().length*this.charLength,this.startY+this.yInterval*35/100,this.roundedTickRange*n);return t},drawBarsForBarType:function(){for(var u,f,n,i="",o=this._series.length,e=this.yInterval/10,r=this._chartType==Sys.Extended.UI.BarChartType.Bar?Math.round((this.yInterval*80/100-e*o)/o):Math.round(this.yInterval*80/100),t=0;t",this._chartType==Sys.Extended.UI.BarChartType.Bar)for(n=0;n',this.startX,this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval*15/100-(e+r)*n,this.startY-this.yInterval*t-this.yInterval*15/100-(e+r)*n-r,n+1,this._series[n].BarColor):i+String.format('',this.startX,this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval*12.5/100-(e+r)*n,this.startY-this.yInterval*t-this.yInterval*12.5/100-(e+r)*n-r,n+1,this._series[n].BarColor),i=this.xVal>0?i+String.format('{2}<\/text>',this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange))+this.xVal.toString().length*this.charLength,this.startY-this.yInterval*t-this.yInterval/5-(e+r)*n-r/10,this.xVal):i+String.format('{2}<\/text>',this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange))-(this.xVal.toString().length+1)*this.charLength-5,this.startY-this.yInterval*t-this.yInterval/5-(e+r)*n-r/10,this.xVal);else for(u=this.startX,f=this.startX,n=0;n0?i+String.format('',u,u+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval/10,this.startY-this.yInterval*t-this.xInterval/10-r,n+1,this._series[n].BarColor):i+String.format('',f,f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval/10,this.startY-this.yInterval*t-this.xInterval/10-r,n+1,this._series[n].BarColor):this.xVal>0?i+String.format('',u,u+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval*7.55/100,this.startY-this.yInterval*t-this.xInterval*7.5/100-r,n+1,this._series[n].BarColor):i+String.format('',f,f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval*7.55/100,this.startY-this.yInterval*t-this.xInterval*7.5/100-r,n+1,this._series[n].BarColor),this.xVal>0?(i=i+String.format('{2}<\/text>',u+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)/2),this.startY-this.yInterval*t-this.yInterval*30/100-r/10,this.xVal),u=u+Math.round(this.xVal*(this.xInterval/this.roundedTickRange))):(i=i+String.format('{2}<\/text>',f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)/2),this.startY-this.yInterval*t-this.yInterval*30/100-r/10,this.xVal),f=f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)));i=i+"<\/g>"}return i},get_chartWidth:function(){return this._chartWidth},set_chartWidth:function(n){this._chartWidth=n},get_chartHeight:function(){return this._chartHeight},set_chartHeight:function(n){this._chartHeight=n},get_chartTitle:function(){return this._chartTitle},set_chartTitle:function(n){this._chartTitle=n},get_categoriesAxis:function(){return this._categoriesAxis},set_categoriesAxis:function(n){this._categoriesAxis=n},get_clientSeries:function(){return this._series},set_clientSeries:function(n){this._series=n},get_ClientSeries:function(){return Sys.Extended.Deprecated("get_ClientSeries","get_clientSeries"),this.get_clientSeries()},set_ClientSeries:function(n){Sys.Extended.Deprecated("set_ClientSeries","set_clientSeries");this.set_clientSeries(n)},get_chartType:function(){return this._chartType},set_chartType:function(n){this._chartType=n},get_theme:function(){return this._theme},set_theme:function(n){this._theme=n},get_valueAxisLines:function(){return this._valueAxisLines},set_valueAxisLines:function(n){this._valueAxisLines=n},get_chartTitleColor:function(){return this._chartTitleColor},set_chartTitleColor:function(n){this._chartTitleColor=n},get_valueAxisLineColor:function(){return this._valueAxisLineColor},set_valueAxisLineColor:function(n){this._valueAxisLineColor=n},get_categoryAxisLineColor:function(){return this._categoryAxisLineColor},set_categoryAxisLineColor:function(n){this._categoryAxisLineColor=n},get_baseLineColor:function(){return this._baseLineColor},set_baseLineColor:function(n){this._baseLineColor=n}};Sys.Extended.UI.BarChart.registerClass("Sys.Extended.UI.BarChart",Sys.Extended.UI.ControlBase);Sys.Extended.UI.BarChartType=function(){throw Error.invalidOperation();};Sys.Extended.UI.BarChartType.prototype={Column:0,Bar:1,StackedColumn:2,StackedBar:3};Sys.Extended.UI.BarChartType.registerEnum("Sys.Extended.UI.BarChartType",!1); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/BaseScripts.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/BaseScripts.js new file mode 100644 index 000000000..b64596cb4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/BaseScripts.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.BehaviorBase=function(n){Sys.Extended.UI.BehaviorBase.initializeBase(this,[n]);this._clientStateFieldID=null;this._pageRequestManager=null;this._partialUpdateBeginRequestHandler=null;this._partialUpdateEndRequestHandler=null};Sys.Extended.UI.BehaviorBase.prototype={initialize:function(){Sys.Extended.UI.BehaviorBase.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.BehaviorBase.callBaseMethod(this,"dispose");this._pageRequestManager&&(this._partialUpdateBeginRequestHandler&&(this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler),this._partialUpdateBeginRequestHandler=null),this._partialUpdateEndRequestHandler&&(this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler),this._partialUpdateEndRequestHandler=null),this._pageRequestManager=null)},get_ClientStateFieldID:function(){return this._clientStateFieldID},set_ClientStateFieldID:function(n){this._clientStateFieldID!=n&&(this._clientStateFieldID=n,this.raisePropertyChanged("ClientStateFieldID"))},get_ClientState:function(){if(this._clientStateFieldID){var n=document.getElementById(this._clientStateFieldID);if(n)return n.value}return null},set_ClientState:function(n){if(this._clientStateFieldID){var t=document.getElementById(this._clientStateFieldID);t&&(t.value=n)}},registerPartialUpdateEvents:function(){Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager&&(this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance(),this._pageRequestManager&&(this._partialUpdateBeginRequestHandler=Function.createDelegate(this,this._partialUpdateBeginRequest),this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler),this._partialUpdateEndRequestHandler=Function.createDelegate(this,this._partialUpdateEndRequest),this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler)))},_partialUpdateBeginRequest:function(){},_partialUpdateEndRequest:function(){}};Sys.Extended.UI.BehaviorBase.registerClass("Sys.Extended.UI.BehaviorBase",Sys.UI.Behavior);Sys.Extended.UI.DynamicPopulateBehaviorBase=function(n){Sys.Extended.UI.DynamicPopulateBehaviorBase.initializeBase(this,[n]);this._DynamicControlID=null;this._DynamicContextKey=null;this._DynamicServicePath=null;this._DynamicServiceMethod=null;this._cacheDynamicResults=!1;this._dynamicPopulateBehavior=null;this._populatingHandler=null;this._populatedHandler=null};Sys.Extended.UI.DynamicPopulateBehaviorBase.prototype={initialize:function(){Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this,"initialize");this._populatingHandler=Function.createDelegate(this,this._onPopulating);this._populatedHandler=Function.createDelegate(this,this._onPopulated)},dispose:function(){this._populatedHandler&&(this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.remove_populated(this._populatedHandler),this._populatedHandler=null);this._populatingHandler&&(this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.remove_populating(this._populatingHandler),this._populatingHandler=null);this._dynamicPopulateBehavior&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this,"dispose")},populate:function(n){this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.get_element()!=$get(this._DynamicControlID)&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);!this._dynamicPopulateBehavior&&this._DynamicControlID&&this._DynamicServiceMethod&&(this._dynamicPopulateBehavior=$create(Sys.Extended.UI.DynamicPopulateBehavior,{id:this.get_id()+"_DynamicPopulateBehavior",ContextKey:this._DynamicContextKey,ServicePath:this._DynamicServicePath,ServiceMethod:this._DynamicServiceMethod,cacheDynamicResults:this._cacheDynamicResults},null,null,$get(this._DynamicControlID)),this._dynamicPopulateBehavior.add_populating(this._populatingHandler),this._dynamicPopulateBehavior.add_populated(this._populatedHandler));this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.populate(n?n:this._DynamicContextKey)},_onPopulating:function(n,t){this.raisePopulating(t)},_onPopulated:function(n,t){this.raisePopulated(t)},get_dynamicControlID:function(){return this._DynamicControlID},get_DynamicControlID:this.get_dynamicControlID,set_dynamicControlID:function(n){this._DynamicControlID!=n&&(this._DynamicControlID=n,this.raisePropertyChanged("dynamicControlID"),this.raisePropertyChanged("DynamicControlID"))},set_DynamicControlID:this.set_dynamicControlID,get_dynamicContextKey:function(){return this._DynamicContextKey},get_DynamicContextKey:this.get_dynamicContextKey,set_dynamicContextKey:function(n){this._DynamicContextKey!=n&&(this._DynamicContextKey=n,this.raisePropertyChanged("dynamicContextKey"),this.raisePropertyChanged("DynamicContextKey"))},set_DynamicContextKey:this.set_dynamicContextKey,get_dynamicServicePath:function(){return this._DynamicServicePath},get_DynamicServicePath:this.get_dynamicServicePath,set_dynamicServicePath:function(n){this._DynamicServicePath!=n&&(this._DynamicServicePath=n,this.raisePropertyChanged("dynamicServicePath"),this.raisePropertyChanged("DynamicServicePath"))},set_DynamicServicePath:this.set_dynamicServicePath,get_dynamicServiceMethod:function(){return this._DynamicServiceMethod},get_DynamicServiceMethod:this.get_dynamicServiceMethod,set_dynamicServiceMethod:function(n){this._DynamicServiceMethod!=n&&(this._DynamicServiceMethod=n,this.raisePropertyChanged("dynamicServiceMethod"),this.raisePropertyChanged("DynamicServiceMethod"))},set_DynamicServiceMethod:this.set_dynamicServiceMethod,get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(n){this._cacheDynamicResults!=n&&(this._cacheDynamicResults=n,this.raisePropertyChanged("cacheDynamicResults"))},add_populated:function(n){this.get_events().addHandler("populated",n)},remove_populated:function(n){this.get_events().removeHandler("populated",n)},raisePopulated:function(n){var t=this.get_events().getHandler("populated");t&&t(this,n)},add_populating:function(n){this.get_events().addHandler("populating",n)},remove_populating:function(n){this.get_events().removeHandler("populating",n)},raisePopulating:function(n){var t=this.get_events().getHandler("populating");t&&t(this,n)}};Sys.Extended.UI.DynamicPopulateBehaviorBase.registerClass("Sys.Extended.UI.DynamicPopulateBehaviorBase",Sys.Extended.UI.BehaviorBase);Sys.Extended.UI.ControlBase=function(n){Sys.Extended.UI.ControlBase.initializeBase(this,[n]);this._clientStateField=null;this._callbackTarget=null;this._onsubmit$delegate=Function.createDelegate(this,this._onsubmit);this._oncomplete$delegate=Function.createDelegate(this,this._oncomplete);this._onerror$delegate=Function.createDelegate(this,this._onerror)};Sys.Extended.UI.ControlBase.__doPostBack=function(n,t){if(!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())for(var i=0;i{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);this.calculateIntervals();n=n+this.drawBackgroundHorizontalLines();n=n+this.drawBackgroundVerticalLines();n=n+this.drawBaseLines();n=n+this.drawAxisValues();this._parentDiv.innerHTML=this._parentDiv.innerHTML+n;this.drawBubbles(this,0)},intializeSVG:function(){var n=String.format('',this._theme);return n=String.format('',this._chartWidth,this._chartHeight,parseFloat(this._chartWidth)*.99,parseFloat(this._chartHeight)*.99),n=n+String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10),n=n+String.format('',this._chartWidth,parseInt(this._chartHeight)-5),n+String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10)},drawBubbles:function(n,t){n._parentDiv.innerHTML=n._parentDiv.innerHTML.replace("<\/svg>","")+String.format('<\/circle><\/svg>',n.startX+Math.round(parseFloat(n._bubbleChartClientValues[t].X)/n.xRoundedIntervalLabelSize*n.xInterval),n.startY+Math.round(-1*parseFloat(n._bubbleChartClientValues[t].Y)/n.yRoundedIntervalLabelSize*n.yInterval),Math.round(parseFloat(n._bubbleChartClientValues[t].Data)/n.roundedBubbleSize*n._bubbleSizes),n._bubbleChartClientValues[t].BubbleColor,t+1,n._bubbleChartClientValues[t].Category,n._bubbleChartClientValues[t].Data,n._bubbleLabel);t++;tthis.dataMax&&(this.dataMax=parseFloat(this._bubbleChartClientValues[n].Data)),parseFloat(this._bubbleChartClientValues[n].Data)this.xMax&&(this.xMax=parseFloat(this._bubbleChartClientValues[n].X)),parseFloat(this._bubbleChartClientValues[n].Data)this.yMax&&(this.yMax=parseFloat(this._bubbleChartClientValues[n].Y)),parseFloat(this._bubbleChartClientValues[n].Y)Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin):this.yMax;n=i/(this._yAxisLines-1);n<1?this.yRoundedIntervalLabelSize=n.toFixed(1):(x=Math.ceil(Math.log(n)/Math.log(10)-1),pow10x=Math.pow(10,x),this.yRoundedIntervalLabelSize=Math.ceil(n/pow10x)*pow10x);r=this.xMin<0?this.xMax>Math.abs(this.xMin)?this.xMax:Math.abs(this.xMin):this.xMax;t=r/(this._xAxisLines-1);n<1?this.xRoundedIntervalLabelSize=t.toFixed(1):(x=Math.ceil(Math.log(t)/Math.log(10)-1),pow10x=Math.pow(10,x),this.xRoundedIntervalLabelSize=Math.ceil(t/pow10x)*pow10x)},calculateIntervals:function(){this.endX=parseFloat(this._chartWidth)-parseFloat(this._chartWidth)/20;this.startX=this.xMin<0?Math.round(parseFloat(this._chartWidth)+parseFloat(this._chartWidth)/10)/2+.5:parseFloat(this._chartWidth)/5+.5;this.xInterval=this.xMin<0?(this.endX-this.startX)/this._xAxisLines:Math.round((this.endX-this.startX)/this._xAxisLines);this.startY=this.yMin<0?Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/20)/2+.5:Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/5)+.5;this.yInterval=this.startY/(this._yAxisLines+1);this.endY=this.startY-this.yInterval*this._yAxisLines},drawBackgroundHorizontalLines:function(){for(var t="",n=1;n<=this._yAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._xAxisLineColor);if(this.yMin<0)for(n=1;n<=this._yAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._xAxisLineColor);if(this.xMin<0)for(n=1;n<=this._yAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY-this.yInterval*n,this._xAxisLineColor);if(this.xMin<0&&this.yMin<0)for(n=1;n<=this._yAxisLines;n++)t=t+String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY+this.yInterval*n,this._xAxisLineColor);return t},drawBackgroundVerticalLines:function(){for(var t="",n=1;n<=this._xAxisLines;n++)t=t+String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.endY,this._yAxisLineColor);if(this.xMin<0)for(n=1;n<=this._xAxisLines;n++)t=t+String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.endY,this._yAxisLineColor);if(this.yMin<0)for(n=1;n<=this._xAxisLines;n++)t=t+String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);if(this.xMin<0&&this.yMin<0)for(n=1;n<=this._xAxisLines;n++)t=t+String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);return t},drawBaseLines:function(){var n="",t;for(n=n+String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY,this.endY,this._baseLineColor),n=n+String.format('<\/path>',this.startX,this.startY,this.startX+4,this._baseLineColor),t=0;t<=this._yAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*t,this._baseLineColor);if(this.yMin<0){for(t=1;t<=this._yAxisLines;t++)n=n+String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*t,this._baseLineColor);n=n+String.format('<\/path>',this.startX-this.xInterval*this._xAxisLines,this.startY,this.startY+4,this._baseLineColor);n=n+String.format('<\/path>',this.startX,this.startY,this.startY+this.yInterval*this._yAxisLines,this._baseLineColor)}for(t=0;t<=this._xAxisLines;t++)n=n+String.format('<\/path>',this.startX+this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);if(this.xMin<0){for(t=1;t<=this._xAxisLines;t++)n=n+String.format('<\/path>',this.startX-this.xInterval*t,this.startY,this.startY+4,this._baseLineColor);n=n+String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY,this._baseLineColor)}return n},drawAxisValues:function(){for(var r,t="",i=0,n=1;n<=this._yAxisLines;n++)i=(this.yRoundedIntervalLabelSize*10*n/10).toString().length*5.5,t=t+String.format('{2}<\/text>',this.startX-i-10,this.startY-this.yInterval*n+4,this.yRoundedIntervalLabelSize*10*n/10);if(this.yMin<0)for(n=1;n<=this._yAxisLines;n++)i=(this.yRoundedIntervalLabelSize*10*n/10).toString().length*5.5+5.5,t=t+String.format('-{2}<\/text>',this.startX-i-10,this.startY+this.yInterval*n+4,this.yRoundedIntervalLabelSize*10*n/10);for(n=1;n<=this._xAxisLines;n++)i=(this.xRoundedIntervalLabelSize*10*n/10).toString().length*5.5,t=t+String.format('{2}<\/text>',Math.round(this.startX+this.xInterval*n-i/2),this.startY+Math.round(this.yInterval/4)+5,this.xRoundedIntervalLabelSize*10*n/10);if(this.xMin<0)for(n=1;n<=this._xAxisLines;n++)i=(this.xRoundedIntervalLabelSize*10*n/10).toString().length*5.5+5.5,t=t+String.format('-{2}<\/text>',Math.round(this.startX-this.xInterval*n-i/2),this.startY+Math.round(this.yInterval/4)+5,this.xRoundedIntervalLabelSize*10*n/10);return r=this.yMin<0?Math.round(this.startY+this.yInterval*this._yAxisLines-(this.startY-this.yInterval*this._yAxisLines))/2:Math.round((this.startY-this.endY)/2),t=t+String.format('{2}<\/text>',Math.round(parseFloat(this._chartWidth)/20),r+this._yAxisLabel.toString().length*this.charLength,this._yAxisLabel,this._axislabelFontColor),t+String.format('{2}<\/text>',Math.round(parseInt(this._chartWidth)/2-this._xAxisLabel.toString().length*this.charLength/2),Math.round(parseInt(this._chartHeight)*90/100+5),this._xAxisLabel,this._axislabelFontColor)},get_chartWidth:function(){return this._chartWidth},set_chartWidth:function(n){this._chartWidth=n},get_chartHeight:function(){return this._chartHeight},set_chartHeight:function(n){this._chartHeight=n},get_chartTitle:function(){return this._chartTitle},set_chartTitle:function(n){this._chartTitle=n},get_bubbleChartClientValues:function(){return this._bubbleChartClientValues},set_bubbleChartClientValues:function(n){this._bubbleChartClientValues=n},get_BubbleChartClientValues:function(){return Sys.Extended.Deprecated("get_BubbleChartClientValues","get_bubbleChartClientValues"),this.get_bubbleChartClientValues()},set_BubbleChartClientValues:function(n){Sys.Extended.Deprecated("set_BubbleChartClientValues","set_bubbleChartClientValues");this.set_bubbleChartClientValues(n)},get_theme:function(){return this._theme},set_theme:function(n){this._theme=n},get_yAxisLines:function(){return this._yAxisLines},set_yAxisLines:function(n){this._yAxisLines=n},get_xAxisLines:function(){return this._xAxisLines},set_xAxisLines:function(n){this._xAxisLines=n},get_chartTitleColor:function(){return this._chartTitleColor},set_chartTitleColor:function(n){this._chartTitleColor=n},get_yAxisLineColor:function(){return this._yAxisLineColor},set_yAxisLineColor:function(n){this._yAxisLineColor=n},get_xAxisLineColor:function(){return this._xAxisLineColor},set_xAxisLineColor:function(n){this._xAxisLineColor=n},get_bubbleSizes:function(){return this._bubbleSizes},set_bubbleSizes:function(n){this._bubbleSizes=n},get_baseLineColor:function(){return this._baseLineColor},set_baseLineColor:function(n){this._baseLineColor=n},get_tooltipBackgroundColor:function(){return this.tooltipBackgroundColor},set_tooltipBackgroundColor:function(n){this.tooltipBackgroundColor=n},get_tooltipFontColor:function(){return this._tooltipFontColor},set_tooltipFontColor:function(n){this._tooltipFontColor=n},get_tooltipBorderColor:function(){return this._tooltipBorderColor},set_tooltipBorderColor:function(n){this._tooltipBorderColor=n},get_xAxisLabel:function(){return this._xAxisLabel},set_xAxisLabel:function(n){this._xAxisLabel=n},get_yAxisLabel:function(){return this._yAxisLabel},set_yAxisLabel:function(n){this._yAxisLabel=n},get_bubbleLabel:function(){return this._bubbleLabel},set_bubbleLabel:function(n){this._bubbleLabel=n},get_axislabelFontColor:function(){return this._axislabelFontColor},set_axislabelFontColor:function(n){this._axislabelFontColor=n}};Sys.Extended.UI.BubbleChart.registerClass("Sys.Extended.UI.BubbleChart",Sys.Extended.UI.ControlBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Calendar.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Calendar.js new file mode 100644 index 000000000..6cf3dedba --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Calendar.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.CalendarBehavior=function(n){Sys.Extended.UI.CalendarBehavior.initializeBase(this,[n]);this._textbox=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(n);this._format="d";this._todaysDateFormat="MMMM d, yyyy";this._daysModeTitleFormat="MMMM, yyyy";this._cssClass="ajax__calendar";this._enabled=!0;this._animated=!0;this._buttonID=null;this._layoutRequested=0;this._layoutSuspended=!1;this._button=null;this._popupMouseDown=!1;this._selectedDate=null;this._startDate=null;this._endDate=null;this._visibleDate=null;this._todaysDate=null;this._firstDayOfWeek=Sys.Extended.UI.FirstDayOfWeek.Default;this._firstPopUp=!0;this._container=null;this._popupDiv=null;this._header=null;this._prevArrow=null;this._nextArrow=null;this._title=null;this._body=null;this._today=null;this._days=null;this._daysTable=null;this._daysTableHeader=null;this._daysTableHeaderRow=null;this._daysBody=null;this._months=null;this._monthsTable=null;this._monthsBody=null;this._years=null;this._yearsTable=null;this._yearsBody=null;this._popupPosition=Sys.Extended.UI.CalendarPosition.BottomLeft;this._defaultView=Sys.Extended.UI.CalendarDefaultView.Days;this._popupBehavior=null;this._modeChangeAnimation=null;this._modeChangeMoveTopOrLeftAnimation=null;this._modeChangeMoveBottomOrRightAnimation=null;this._mode="days";this._selectedDateChanging=!1;this._isOpen=!1;this._isAnimating=!1;this._clearTime=!1;this._width=170;this._height=139;this._modes={days:null,months:null,years:null};this._modeOrder={days:0,months:1,years:2};this._blur=new Sys.Extended.UI.DeferredOperation(1,this,this.blur);this._button$delegates={click:Function.createDelegate(this,this._button_onclick),keypress:Function.createDelegate(this,this._button_onkeypress),blur:Function.createDelegate(this,this._button_onblur)};this._element$delegates={change:Function.createDelegate(this,this._element_onchange),keypress:Function.createDelegate(this,this._element_onkeypress),click:Function.createDelegate(this,this._element_onclick),focus:Function.createDelegate(this,this._element_onfocus),blur:Function.createDelegate(this,this._element_onblur)};this._popup$delegates={mousedown:Function.createDelegate(this,this._popup_onmousedown),mouseup:Function.createDelegate(this,this._popup_onmouseup),drag:Function.createDelegate(this,this._popup_onevent),dragstart:Function.createDelegate(this,this._popup_onevent)};this._cell$delegates={mouseover:Function.createDelegate(this,this._cell_onmouseover),mouseout:Function.createDelegate(this,this._cell_onmouseout),click:Function.createDelegate(this,this._cell_onclick)}};Sys.Extended.UI.CalendarBehavior.prototype={get_clearTime:function(){return this._clearTime},set_clearTime:function(n){this._clearTime!=n&&(this._clearTime=n,this.raisePropertyChanged("clearTime"))},get_animated:function(){return this._animated},set_animated:function(n){this._animated!=n&&(this._animated=n,this.raisePropertyChanged("animated"))},get_enabled:function(){return this._enabled},set_enabled:function(n){this._enabled!=n&&(this._enabled=n,this.raisePropertyChanged("enabled"))},get_button:function(){return this._button},set_button:function(n){this._button!=n&&(this._button&&this.get_isInitialized()&&$common.removeHandlers(this._button,this._button$delegates),this._button=n,this._button&&this.get_isInitialized()&&$addHandlers(this._button,this._button$delegates),this.raisePropertyChanged("button"))},get_popupPosition:function(){return this._popupPosition},set_popupPosition:function(n){this._popupPosition!=n&&(this._popupPosition=n,this.raisePropertyChanged("popupPosition"))},get_startDate:function(){return this._startDate},set_startDate:function(n){this._startDate!=n&&(this._startDate=new Date(n),this.raisePropertyChanged("startDate"))},get_endDate:function(){return this._endDate},set_endDate:function(n){this._endDate!=n&&(this._endDate=new Date(n),this.raisePropertyChanged("endDate"))},get_format:function(){return this._format},set_format:function(n){this._format!=n&&(this._format=n,this.raisePropertyChanged("format"))},get_todaysDateFormat:function(){return this._todaysDateFormat},set_todaysDateFormat:function(n){this._todaysDateFormat!=n&&(this._todaysDateFormat=n,this.raisePropertyChanged("todaysDateFormat"))},get_daysModeTitleFormat:function(){return this._daysModeTitleFormat},set_daysModeTitleFormat:function(n){this._daysModeTitleFormat!=n&&(this._daysModeTitleFormat=n,this.raisePropertyChanged("daysModeTitleFormat"))},get_selectedDate:function(){if(this._selectedDate==null){var n=this._textbox.get_Value();n&&(n=this._parseTextValue(n),n&&(this._selectedDate=n))}return this._selectedDate},set_selectedDate:function(n){var i,t;n&&String.isInstanceOfType(n)&&n.length!=0&&(n=Date.fromISO(n));this._selectedDate!=n&&(this._selectedDate=n,this._selectedDateChanging=!0,i="",n&&(i=this._convertToLocal(n).localeFormat(this._format),this._clearTime||(t=this._textbox.get_Value(),t&&(t=this._parseTextValue(t)),t&&n!=t.getDateOnly()&&(n.setUTCHours(t.getUTCHours()),n.setUTCMinutes(t.getUTCMinutes()),n.setUTCSeconds(t.getUTCSeconds()),n.setUTCMilliseconds(t.getUTCMilliseconds()),i=this._convertToLocal(n).localeFormat(this._format)))),i!=this._textbox.get_Value()&&(this._textbox.set_Value(i),this._fireChanged()),this._selectedDateChanging=!1,this.invalidate(),this.raisePropertyChanged("selectedDate"))},get_defaultView:function(){return this._defaultView},set_defaultView:function(n){this._defaultView!=n&&(this._defaultView=n,this.raisePropertyChanged("defaultView"))},get_visibleDate:function(){return this._visibleDate},set_visibleDate:function(n){n&&String.isInstanceOfType(n)&&n.length!=0&&(n=new Date(n));this._visibleDate!=n&&(this._switchMonth(n,!this._isOpen),this.raisePropertyChanged("visibleDate"))},get_isOpen:function(){return this._isOpen},get_todaysDate:function(){return this._todaysDate!=null?this._todaysDate:new Date},set_todaysDate:function(n){this._todaysDate!=n&&(this._todaysDate=n,this.invalidate(),this.raisePropertyChanged("todaysDate"))},get_firstDayOfWeek:function(){return this._firstDayOfWeek},set_firstDayOfWeek:function(n){this._firstDayOfWeek!=n&&(this._firstDayOfWeek=n,this.invalidate(),this.raisePropertyChanged("firstDayOfWeek"))},get_cssClass:function(){return this._cssClass},set_cssClass:function(n){this._cssClass!=n&&(this._cssClass&&this.get_isInitialized()&&Sys.UI.DomElement.removeCssClass(this._container,this._cssClass),this._cssClass=n,this._cssClass&&this.get_isInitialized()&&Sys.UI.DomElement.addCssClass(this._container,this._cssClass),this.raisePropertyChanged("cssClass"))},get_todayButton:function(){return this._today},get_dayCell:function(n,t){return this._daysBody?this._daysBody.rows[n].cells[t].firstChild:null},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)");this.raise_showing(n)},add_shown:function(n){this.get_events().addHandler("shown",n)},remove_shown:function(n){this.get_events().removeHandler("shown",n)},raise_shown:function(){var n=this.get_events().getHandler("shown");n&&n(this,Sys.EventArgs.Empty)},raiseShown:function(){Sys.Extended.Deprecated("raiseShown","raise_shown");this.raise_shown()},add_hiding:function(n){this.get_events().addHandler("hiding",n)},remove_hiding:function(n){this.get_events().removeHandler("hiding",n)},raise_hiding:function(n){var t=this.get_events().getHandler("hiding");t&&t(this,n)},raiseHiding:function(n){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)");this.raise_hiding(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(){var n=this.get_events().getHandler("hidden");n&&n(this,Sys.EventArgs.Empty)},raiseHidden:function(){Sys.Extended.Deprecated("raiseHidden","raise_hidden");this.raise_hidden()},add_dateSelectionChanged:function(n){this.get_events().addHandler("dateSelectionChanged",n)},remove_dateSelectionChanged:function(n){this.get_events().removeHandler("dateSelectionChanged",n)},raise_dateSelectionChanged:function(){var n=this.get_events().getHandler("dateSelectionChanged");n&&n(this,Sys.EventArgs.Empty)},raiseDateSelectionChanged:function(){Sys.Extended.Deprecated("raiseDateSelectionChanged","raise_dateSelectionChanged");this.raise_dateSelectionChanged()},initialize:function(){var t,n;Sys.Extended.UI.CalendarBehavior.callBaseMethod(this,"initialize");t=this.get_element();$addHandlers(t,this._element$delegates);this._button&&$addHandlers(this._button,this._button$delegates);this._modeChangeMoveTopOrLeftAnimation=new Sys.Extended.UI.Animation.LengthAnimation(null,null,null,"style",null,0,0,"px");this._modeChangeMoveBottomOrRightAnimation=new Sys.Extended.UI.Animation.LengthAnimation(null,null,null,"style",null,0,0,"px");this._modeChangeAnimation=new Sys.Extended.UI.Animation.ParallelAnimation(null,.25,null,[this._modeChangeMoveTopOrLeftAnimation,this._modeChangeMoveBottomOrRightAnimation]);n=this.get_selectedDate();n&&this.set_selectedDate(n)},dispose:function(){var n,i,t,r;if(this._popupBehavior&&(this._popupBehavior.dispose(),this._popupBehavior=null),this._modes=null,this._modeOrder=null,this._modeChangeMoveTopOrLeftAnimation&&(this._modeChangeMoveTopOrLeftAnimation.dispose(),this._modeChangeMoveTopOrLeftAnimation=null),this._modeChangeMoveBottomOrRightAnimation&&(this._modeChangeMoveBottomOrRightAnimation.dispose(),this._modeChangeMoveBottomOrRightAnimation=null),this._modeChangeAnimation&&(this._modeChangeAnimation.dispose(),this._modeChangeAnimation=null),this._container&&(this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=null),this._popupDiv&&($common.removeHandlers(this._popupDiv,this._popup$delegates),this._popupDiv=null),this._prevArrow&&($common.removeHandlers(this._prevArrow,this._cell$delegates),this._prevArrow=null),this._nextArrow&&($common.removeHandlers(this._nextArrow,this._cell$delegates),this._nextArrow=null),this._title&&($common.removeHandlers(this._title,this._cell$delegates),this._title=null),this._today&&($common.removeHandlers(this._today,this._cell$delegates),this._today=null),this._button&&($common.removeHandlers(this._button,this._button$delegates),this._button=null),this._daysBody){for(n=0;n0?this._layoutRequested=!0:this._performLayout()},_buildCalendar:function(){var t=this.get_element(),n=this.get_id();this._container=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_container"},cssClasses:[this._cssClass],visible:!1},t.parentNode);this._popupDiv=$common.createElementFromTemplate({nodeName:"div",events:this._popup$delegates,properties:{id:n+"_popupDiv"},cssClasses:["ajax__calendar_container"]},this._container)},_buildHeader:function(){var n=this.get_id(),t,i,r;this._header=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_header"},cssClasses:["ajax__calendar_header"]},this._popupDiv);t=$common.createElementFromTemplate({nodeName:"div"},this._header);this._prevArrow=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_prevArrow",mode:"prev"},events:this._cell$delegates,cssClasses:["ajax__calendar_prev"]},t);i=$common.createElementFromTemplate({nodeName:"div"},this._header);this._nextArrow=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_nextArrow",mode:"next"},events:this._cell$delegates,cssClasses:["ajax__calendar_next"]},i);r=$common.createElementFromTemplate({nodeName:"div"},this._header);this._title=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_title",mode:"title"},events:this._cell$delegates,cssClasses:["ajax__calendar_title"]},r)},_buildBody:function(){this._body=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_body"},cssClasses:["ajax__calendar_body"]},this._popupDiv);this._buildDays();this._buildMonths();this._buildYears()},_buildFooter:function(){var n=$common.createElementFromTemplate({nodeName:"div"},this._popupDiv);this._today=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_today",mode:"today"},events:this._cell$delegates,cssClasses:["ajax__calendar_footer","ajax__calendar_today"]},n)},_buildDays:function(){var e=Sys.CultureInfo.CurrentCulture.dateTimeFormat,t=this.get_id(),n,f,r,i,u;for(this._days=$common.createElementFromTemplate({nodeName:"div",properties:{id:t+"_days"},cssClasses:["ajax__calendar_days"]},this._body),this._modes.days=this._days,this._daysTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:t+"_daysTable",style:{margin:"auto"}}},this._days),this._daysTableHeader=$common.createElementFromTemplate({nodeName:"thead",properties:{id:t+"_daysTableHeader"}},this._daysTable),this._daysTableHeaderRow=$common.createElementFromTemplate({nodeName:"tr",properties:{id:t+"_daysTableHeaderRow"}},this._daysTableHeader),n=0;n<7;n++)i=$common.createElementFromTemplate({nodeName:"td"},this._daysTableHeaderRow),u=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_dayname"]},i);for(this._daysBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:t+"_daysBody"}},this._daysTable),n=0;n<6;n++)for(f=$common.createElementFromTemplate({nodeName:"tr"},this._daysBody),r=0;r<7;r++)i=$common.createElementFromTemplate({nodeName:"td"},f),u=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"day",id:t+"_day_"+n+"_"+r,innerHTML:" "},events:this._cell$delegates,cssClasses:["ajax__calendar_day"]},i)},_buildMonths:function(){var f=Sys.CultureInfo.CurrentCulture.dateTimeFormat,i=this.get_id(),n,r,t,u,e;for(this._months=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_months"},cssClasses:["ajax__calendar_months"],visible:!1},this._body),this._modes.months=this._months,this._monthsTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:i+"_monthsTable",style:{margin:"auto"}}},this._months),this._monthsBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:i+"_monthsBody"}},this._monthsTable),n=0;n<3;n++)for(r=$common.createElementFromTemplate({nodeName:"tr"},this._monthsBody),t=0;t<4;t++)u=$common.createElementFromTemplate({nodeName:"td"},r),e=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_month_"+n+"_"+t,mode:"month",month:n*4+t,innerHTML:"
    "+f.AbbreviatedMonthNames[n*4+t]},events:this._cell$delegates,cssClasses:["ajax__calendar_month"]},u)},_buildYears:function(){var i=this.get_id(),n,r,t,u,f;for(this._years=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_years"},cssClasses:["ajax__calendar_years"],visible:!1},this._body),this._modes.years=this._years,this._yearsTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:i+"_yearsTable",style:{margin:"auto"}}},this._years),this._yearsBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:i+"_yearsBody"}},this._yearsTable),n=0;n<3;n++)for(r=$common.createElementFromTemplate({nodeName:"tr"},this._yearsBody),t=0;t<4;t++)u=$common.createElementFromTemplate({nodeName:"td"},r),f=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_year_"+n+"_"+t,mode:"year",year:n*4+t-1},events:this._cell$delegates,cssClasses:["ajax__calendar_year"]},u)},_isInDateRange:function(n,t){switch(t){case"d":if(this._startDate&&this._getDateOnly(n)this._getDateOnly(this._endDate))return!1;break;case"M":if(this._startDate&&this._getMonthOnly(n)this._getMonthOnly(this._endDate))return!1;break;case"y":if(this._startDate&&n.getUTCFullYear()this._endDate.getUTCFullYear())return!1;break;case"yy":var i=n.getUTCFullYear(),r=n.getUTCFullYear()+9;return this._startDate&&this._endDate?ithis._endDate.getUTCFullYear()?!0:!1:!this._startDate&&!this._endDate?!0:this._startDate&&r>this._startDate.getUTCFullYear()?!0:this._endDate&&ithis._getDateOnly(this._startDate))return!1;break;case"M":if(this._startDate&&this._getMonthOnly(n)>this._getMonthOnly(this._startDate))return!1;break;case"y":if(this._startDate&&n.getUTCFullYear()>this._startDate.getUTCFullYear())return!1;break;case"yy":var i=n.getUTCFullYear(),r=n.getUTCFullYear();if(this._startDate&&n.getUTCFullYear()>this._startDate.getUTCFullYear())return!1}return!0},_isInPrevDateRange:function(n,t){switch(t){case"d":if(this._endDate&&this._getDateOnly(n)this._endDate.getUTCFullYear())return!0}return!0},_getDateOnly:function(n){return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},_getMonthOnly:function(n){return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1))},_convertToUTC:function(n){return n&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()))),n},_convertToLocal:function(n){var t=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds());return t.getDate()!=n.getUTCDate()&&(t=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours()+1,n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds())),t},_performLayout:function(){var p=this.get_element(),v,s,h,u,c,y,l,t,e,r,o,f,n;if(p&&this.get_isInitialized()&&this._isOpen){var w=Sys.CultureInfo.CurrentCulture.dateTimeFormat,b=this.get_selectedDate(),i=this._getEffectiveVisibleDate(),a=this.get_todaysDate();switch(this._mode){case"days":for(v=this._getFirstDayOfWeek(),s=i.getUTCDay()-v,s<=0&&(s+=7),h=new Date(i),h.setUTCDate(h.getUTCDate()-s),u=new Date(h),r=0;r<7;r++)t=this._daysTableHeaderRow.cells[r].firstChild,t.firstChild&&t.removeChild(t.firstChild),t.appendChild(document.createTextNode(w.ShortestDayNames[(r+v)%7]));for(c=0;c<6;c++)for(y=this._daysBody.rows[c],l=0;l<7;l++)t=y.cells[l].firstChild,t.firstChild&&t.removeChild(t.firstChild),t.appendChild(document.createTextNode(u.getUTCDate())),t.title=this._convertToLocal(u).localeFormat("D"),t.date=u,$common.removeCssClasses(t.parentNode,["ajax__calendar_other","ajax__calendar_active","ajax__calendar_today"]),this._isInDateRange(u,"d")?($common.removeCssClasses(t.parentNode,["ajax__calendar_invalid","ajax__calendar_other","ajax__calendar_active",""]),Sys.UI.DomElement.addCssClass(t.parentNode,this._getCssClass(t.date,"d"))):($common.removeCssClasses(t.parentNode,["ajax__calendar_other","ajax__calendar_active"]),Sys.UI.DomElement.addCssClass(t.parentNode,"ajax__calendar_invalid")),u=new Date(u),u.setUTCDate(u.getUTCDate()+1);this._prevArrow.date=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth()-1,1));this._nextArrow.date=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth()+1,1));this._title.firstChild&&this._title.removeChild(this._title.firstChild);this._title.appendChild(document.createTextNode(this._convertToLocal(i).localeFormat(this.get_daysModeTitleFormat())));this._title.date=i;break;case"months":for(r=0;rn?($common.setLocation(r,{x:-162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(r),this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_endValue(0),$common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(i),this._modeChangeMoveBottomOrRightAnimation.set_startValue(0),this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width)):($common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(i),this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_startValue(0),$common.setLocation(r,{x:162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(r),this._modeChangeMoveBottomOrRightAnimation.set_endValue(0),this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width)),this._visibleDate=n,this.invalidate(),f=Function.createDelegate(this,function(){this._body.removeChild(i);i=null;this._isAnimating=!1;this._modeChangeAnimation.remove_ended(f)}),this._modeChangeAnimation.add_ended(f),this._modeChangeAnimation.play()):(this._visibleDate=n,this.invalidate()))},_switchNextRange:function(n,t){this._isAnimating||(!n||this._canSwitchNextRange(n))&&this._switchRange(n,t)},_switchPrevRange:function(n,t){this._isAnimating||(!n||this._canSwitchPrevRange(n))&&this._switchRange(n,t)},_switchRange:function(n,t){var u=this._getEffectiveVisibleDate(),r,i,f;n&&n.getFullYear()==u.getFullYear()&&n.getMonth()==u.getMonth()&&(t=!0);this._animated&&!t?(this._isAnimating=!0,r=this._modes[this._mode],i=r.cloneNode(!0),this._body.appendChild(i),u>n?($common.setLocation(r,{x:-162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(r),this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_endValue(0),$common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(i),this._modeChangeMoveBottomOrRightAnimation.set_startValue(0),this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width)):($common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(i),this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_startValue(0),$common.setLocation(r,{x:162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(r),this._modeChangeMoveBottomOrRightAnimation.set_endValue(0),this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width)),this._visibleDate=n,this.invalidate(),f=Function.createDelegate(this,function(){this._body.removeChild(i);i=null;this._isAnimating=!1;this._modeChangeAnimation.remove_ended(f)}),this._modeChangeAnimation.add_ended(f),this._modeChangeAnimation.play()):(this._visibleDate=n,this.invalidate())},_canSwitchMonth:function(n){switch(this._mode){case"days":if(!this._isInDateRange(n,"M"))return!1;break;case"months":if(!this._isInDateRange(n,"y"))return!1;break;case"years":if(!this._isInDateRange(n,"yy"))return!1}return!0},_canSwitchNextRange:function(n){switch(this._mode){case"days":return this._isInNextDateRange(n,"M");case"months":return this._isInNextDateRange(n,"y");case"years":return this._isInNextDateRange(n,"yy")}},_canSwitchPrevRange:function(n){switch(this._mode){case"days":return this._isInPrevDateRange(n,"M");case"months":return this._isInPrevDateRange(n,"y");case"years":return this._isInPrevDateRange(n,"yy")}},_switchMode:function(n,t){var u;if(!this._isAnimating&&this._mode!=n){var f=this._modeOrder[this._mode]1:n>0},_setOptions:function(n,t,i){var r,s,h,o,f,e,u,v;if(this.get_isInitialized()){if(r=this.get_element(),this._clearItems(),h="",i&&this._loadingText?(s=this._loadingText,this._selectedValue&&(h=this._selectedValue)):!i&&n&&0==n.length&&null!=this._emptyText?(s=this._emptyText,this._emptyValue&&(h=this._emptyValue)):this._promptText&&(s=this._promptText,this._promptValue&&(h=this._promptValue)),s&&(o=new Option(s,h),r.options[r.options.length]=o),f=null,e=-1,n){for(u=0;u0)?t||f||i||this.set_selectedValue("",""):this.set_selectedValue(r.options[0].value,r.options[0].text):(r.options[e].selected=!0,this.set_selectedValue(r.options[e].value,r.options[e].text)),r.childDropDown&&!i)for(u=0;u=0&&(n.height=this.get_textBoxControl().offsetHeight+"px");n.width==""&&(n.width=n.height);n.padding==""&&(n.padding="0px");this._buttonControl.style.visibility="visible"},initializeOptionList:function(){var h,t,c,r,o,u,l,f,i,e;if(this.get_optionListControl()==null&&(h=document.createElement("ul"),this.get_element().appendChild(h),this.set_optionListControl(h)),t=this.get_optionListControl(),Sys.Browser.agent===Sys.Browser.Safari||Sys.Browser.agent===Sys.Browser.WebKit){for(c=t.parentNode,c!=null&&c.removeChild(t),r=this.get_element().parentNode;typeof r!=typeof document.forms[0];)r=r.parentNode;o=document.createElement("div");o.className=this.get_element().className;o.appendChild(t);r.appendChild(o)}for(u=t.style,u.display="block",u.zIndex=Sys.Extended.UI.zIndex.ComboBoxList,this._optionListItems=[],l=t.childNodes,f=0;f=0;)n=n.substring(0,s).trim()+" "+n.substring(s+1,n.length).trim(),s=n.indexOf("\r");for(e=n.indexOf("\n");e>=0;)n=n.substring(0,e).trim()+" "+n.substring(e+1,n.length).trim(),e=n.indexOf("\n");n=n.replace(/\&/g,"&").replace(/\"/g,'"').replace(/\>/g,">").replace(/\</g,"<");a.text=n.trim();Array.add(this._optionListItems,a);this.initializeOptionListItem(i)}u.width=this._getOptionListBounds().width+"px";u.width="0px";this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"_PopupBehavior",parentElement:this.get_textBoxControl(),positioningMode:Sys.Extended.UI.PositioningMode.BottomLeft},null,null,t);this._popupBehavior.add_showing(this._popupShowingHandler);this._popupBehavior.add_shown(this._popupShownHandler);this._popupBehavior.add_hiding(this._popupHidingHandler);this.get_selectedIndex()>=0?(this._highlightListItem(this.get_selectedIndex()),this.get_textBoxControl().value=this._optionListItems[this.get_selectedIndex()].text):this.get_textBoxControl().value="";this._popupShowing();t.style.display="none"},initializeOptionListItem:function(n){n._textIsEmpty=!1;n.innerHTML.length<1&&(n.innerHTML=" ",n._textIsEmpty=!0)},_popupShowing:function(){var t=this._getWindowBounds(),i=Sys.UI.DomElement.getBounds(this.get_comboTableControl()),c=this._getOptionListBounds(),a=t.y+t.height/2,v=i.y+i.height,y=t.x+t.width/2,p=i.x+i.width/2,r=i.y-t.y,s="Top",h,n,e,f,u,o;v<=a&&(s="Bottom",r=t.height-i.height-r);h=this._getOptionListItemHeight();r=r>=c.height?c.height:h*(Math.floor(r/h)-2);var w=r/h,l=w=f&&(n=f)):n>=f&&(n=f);e=="Right"&&n=1?1:-1:n.rawEvent.wheelDelta>1?-1:1,this.get_optionListControl().scrollTop+=this._getOptionListItemHeight()*t,n.stopPropagation(),n.preventDefault(),!1},_onListMouseOver:function(n){var r=this.get_optionListControl(),u,i,t;if(n.target!==r)for(u=n.target,i=r.childNodes,t=0;t=0?(this.set_selectedIndex(this._highlightedIndex),this.get_textBoxControl().value=this._optionListItems[this.get_selectedIndex()].text):n==-3&&i.length>0&&this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.DropDownList?this.set_selectedIndex(-2):this._optionListItems.length<1&&(i==""||this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList)?(this.set_selectedIndex(-1),this.get_textBoxControl().value=""):this._optionListItems.length>=0&&n==-3&&this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList?(this.set_selectedIndex(0),this.get_textBoxControl().value=this._optionListItems[0].text):n>=0&&(this.set_selectedIndex(n),this.get_textBoxControl().value=this._optionListItems[n].text);this._popupBehavior.hide();this.get_autoPostBack()!=!0||this._doingPostBack||this._originalSelectedIndex==this.get_selectedIndex()||(this._doingPostBack=!0,__doPostBack(this.get_element().id,""))},_onTextBoxKeyDown:function(n){var i=this._handleEnterKey(n),t;return i!=null?i:(this._handleArrowKey(n),t=this._handleErasureKeys(n),t!=null)?t:!0},_onTextBoxKeyPress:function(n){var c=this._handleEnterKey(n),e,o,f,h;if(c!=null)return c;if(e=this._handleArrowKey(n),e!=null)return e;if(o=this._handleNonCharacterKey(n),o!=null)return o;if(this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.Simple||this._popupBehavior._visible||this._popupBehavior.show(),this.get_selectedIndex()==-1&&this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList&&this._optionListItems.length==0)return this.get_textBoxControl().value="",n.preventDefault(),n.stopPropagation(),!1;var t=this._getTextSelectionInfo(this.get_textBoxControl(),n),r=t.selectionStart,u=t.selectionEnd,l=t.selectionPrefix+t.typedCharacter+t.selectionText.substring(1)+t.selectionSuffix,i=t.selectionPrefix+t.typedCharacter,s=this.get_textBoxControl().maxLength;return(s<0&&(s=Number.MAX_VALUE),i.length>s&&(i=i.substring(0,this.get_textBoxControl().maxLength)),f=this._suggestIndex(l,i),(this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.Suggest||this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend)&&(this._highlightSuggestedItem=!0,this._popupBehavior._visible||this._popupBehavior.show()),f>=0?this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.Append||this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend?(this.get_textBoxControl().value=this._optionListItems[f].text,r=t.selectionStart+1,u=this.get_textBoxControl().value.length):(this.get_textBoxControl().value=this._optionListItems[f].text.substring(0,i.length),r=this.get_textBoxControl().value.length,u=this.get_textBoxControl().value.length):(this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.Simple||this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDown)&&(this.get_textBoxControl().value=i,r=i.length,u=i.length),h=this._handleErasureKeys(n),h!=null)?h:(this._ensureHighlightedIndex(),this._ensureScrollTop(),this._setTextSelectionRange(this.get_textBoxControl(),r,u),n.preventDefault(),n.stopPropagation(),!1)},_onDocumentClick:function(){this._popupBehavior._visible&&this._popupBehavior.hide()},_onDocumentMouseWheel:function(){return this._popupBehavior&&this._popupBehavior.hide(),!0},_handleTextBoxFocus:function(n){!this._supressFocusHide&&this._popupBehavior._visible&&(this._popupBehavior.hide(),this._supressFocusHide=!0,this.get_autoPostBack()&&!this._doingPostBack&&this._originalSelectedIndex!=this.get_selectedIndex()&&(this._doingPostBack=!0,__doPostBack(this.get_element().id,"")));this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.Simple&&this._popupBehavior.show();this._setTextSelectionRange(this.get_textBoxControl(),0,this.get_textBoxControl().value.length);n!=null&&(n.preventDefault(),n.stopPropagation())},_highlightListItem:function(n,t){if(n==undefined||n<0){this._highlightedIndex!=undefined&&this._highlightedIndex>=0&&this._highlightListItem(this._highlightedIndex,!1);return}var r=this.get_optionListControl().childNodes,i=r[n];if(t==!0){if(this._highlightedIndex==n)return;n>=0&&(this.get_listItemHoverCssClass()==undefined||this.get_listItemHoverCssClass()==""?(i.style.backgroundColor="Highlight",i.style.color="HighlightText"):i.className=this.get_listItemHoverCssClass);this._highlightedIndex!=null&&this._highlightedIndex!=n&&this._highlightedIndex>=0&&this._highlightListItem(this._highlightedIndex,!1);this._highlightedIndex=n}else this.get_listItemHoverCssClass()==undefined||this.get_listItemHoverCssClass()==""?(i.style.backgroundColor="",i.style.color=""):i.className="",n==this._highlightedIndex&&(this._highlightedIndex=-1)},_suggestIndex:function(n,t){for(var e,o,f=-1,i=!1,u=!1,r=0;r0||i==1&&this._highlightedIndex=0&&(this.get_textBoxControl().value=this._optionListItems[this._highlightedIndex].text,this.set_selectedIndex(this._highlightedIndex),__doPostBack(this.get_element().id,"")),this._popupBehavior.hide(),n.preventDefault(),n.stopPropagation(),!1):this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.Simple||this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDown||this._highlightedIndex==this.get_selectedIndex()?!0:(n.preventDefault(),n.stopPropagation(),!1):null},_handleErasureKeys:function(n){var o=this._getKeyboardCode(n),s=o==Sys.UI.Key.backspace,f=o==Sys.UI.Key.del,t,r,u,i,e,h;return(typeof event=="undefined"&&n.type=="keypress"&&(f=n.rawEvent.keyCode==46),s||f)?(t=this._getTextSelectionInfo(this.get_textBoxControl(),n),t.selectionStart0?(e=1,t.selectionPrefix.charCodeAt(t.selectionPrefix.length-1)==8&&(e=2),i=t.selectionPrefix.substr(0,t.selectionPrefix.length-e),i+=t.selectionSuffix,this.get_textBoxControl().value=i,r=t.selectionStart-1,u=t.selectionStart-1):f&&t.selectionStart=0&&(h=this._isExactMatch(this._optionListItems[this._highlightedIndex].text,this.get_textBoxControl().value),h||this._highlightListItem(this._highlightedIndex,!1)),n.preventDefault(),n.stopPropagation(),!1):null},_handleNonCharacterKey:function(n){var t=this._getKeyboardCode(n),r=t==Sys.UI.Key.backspace,i=t==Sys.UI.Key.del;return(n.type=="keypress"&&(i=n.rawEvent.code==46),r||i)?null:this._isNonCharacterKey(n)?t==Sys.UI.Key.esc?(this._popupBehavior.hide(),this.get_textBoxControl().blur(),n.preventDefault(),n.stopPropagation(),!1):!0:null},_isNonCharacterKey:function(n){var t=this._getKeyboardCode(n);if(t==Sys.UI.Key.enter||t==Sys.UI.Key.esc)return!0;if(Sys.Browser.agent==Sys.Browser.Safari&&Sys.Browser.version<500){if(t==8||t==9||t==63272||t==63276||t==63277||t==63275||t==63273||t==63234||t==63235||t>=63236&&t<=63243||t==63248)return!0}else if(Sys.Browser.agent==Sys.Browser.WebKit){if(t==8||t==9||t==19||t==33||t==34||t==35||t==36||t==37||t==39||t==45||t==46||t==91||t==92||t==93||t==113||t==115||t==118||t==119||t==120||t==122||t==145)return!0}else if(Sys.Browser.agent!=Sys.Browser.InternetExplorer)if(t==8||t==9||t==33||t==34||t==35||t==36||t==37||t==39||t==45||t==46){if(!n.shiftKey)return!0}else{if(t==145||t==19)return!0;if(Sys.Browser.agent==Sys.Browser.Opera){if(t==0||t==16||t==17)return!0}else if(Sys.Browser.agent==Sys.Browser.Firefox&&(t==91||t==92||t==93))return!0}else if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&t==46)return!0;return!1},_ensureScrollTop:function(){var n=this.get_optionListControl();if(this._highlightedIndex>=0){var t=this._getOptionListItemHeight(),i=t*this._highlightedIndex,r=n.scrollTop+n.clientHeight;(i<=n.scrollTop||i>=r)&&(n.scrollTop=this._highlightedIndex*t)}},_ensureSelectedIndex:function(){var n=this.get_hiddenFieldControl().value;n==""&&(n=this._optionListItems.length>0?0:-1,this.get_hiddenFieldControl().value=n.toString());this._originalSelectedIndex==null&&(this._originalSelectedIndex=parseInt(n))},_ensureHighlightedIndex:function(){var i=this.get_textBoxControl().value,t,r,n,u;if(this._highlightedIndex==null||!(this._highlightedIndex>=0)||!this._isExactMatch(this._optionListItems[this._highlightedIndex].text,i)){for(t=-1,r=!1,n=0;n=i.selectionStart?i.textBoxValue.substring(0,i.selectionStart):"",i.selectionText=i.textBoxValue.length>=i.selectionEnd?i.textBoxValue.substring(i.selectionStart,i.selectionEnd):"",i.selectionSuffix=i.textBoxValue.length>=i.selectionEnd?i.textBoxValue.substring(i.selectionEnd,i.textBoxValue.length):"",i.selectionTextFirst=i.selectionText.substring(0,1),i},_getOptionListItemHeight:function(){var n=this.get_optionListControl();return this._optionListItemHeight==null&&n.scrollHeight>0?this._optionListItemHeight=Math.round(n.scrollHeight/this._optionListItems.length):Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7&&Math.round(n.scrollHeight/this._optionListItems.length)n.getTicks()?1:this._ticksSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._borderStyleNames[t],r=this.getCurrentStyle(n,i);return r!="none"},getMargin:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._marginWidthNames[t],r=this.getCurrentStyle(n,i);try{return this.parsePadding(r)}catch(u){return 0}},getBorderWidth:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));if(!this.isBorderVisible(n,t))return 0;var i=this._borderWidthNames[t],r=this.getCurrentStyle(n,i);return this.parseBorderWidth(r)},getPadding:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._paddingWidthNames[t],r=this.getCurrentStyle(n,i);return this.parsePadding(r)},parseBorderWidth:function(n){var r,t,i,u,f;if(this._borderThicknesses||(r={},t=document.createElement("div"),t.style.visibility="hidden",t.style.position="absolute",t.style.fontSize="1px",document.body.appendChild(t),i=document.createElement("div"),i.style.height="0px",i.style.overflow="hidden",t.appendChild(i),u=t.offsetHeight,i.style.borderTop="solid black",i.style.borderTopWidth="thin",r.thin=t.offsetHeight-u,i.style.borderTopWidth="medium",r.medium=t.offsetHeight-u,i.style.borderTopWidth="thick",r.thick=t.offsetHeight-u,t.removeChild(i),document.body.removeChild(t),this._borderThicknesses=r),n){switch(n){case"thin":case"medium":case"thick":return this._borderThicknesses[n];case"inherit":return 0}return f=this.parseUnit(n),Sys.Debug.assert(f.type=="px",String.format(Sys.Extended.UI.Resources.Common_InvalidBorderWidthUnit,f.type)),f.size}return 0},parsePadding:function(n){if(n){if(n=="inherit")return 0;var t=this.parseUnit(n);return t.type!=="px"&&Sys.Debug.fail(String.format(Sys.Extended.UI.Resources.Common_InvalidPaddingUnit,t.type)),t.size}return 0},parseUnit:function(n){var f,t,r,i,e,u;if(!n)throw Error.argumentNull("value");for(n=n.trim().toLowerCase(),f=n.length,t=-1,r=0;r"9")&&i!="-"&&i!="."&&i!=",")break;t=r}if(t==-1)throw Error.create(Sys.Extended.UI.Resources.Common_UnitHasNoDigits);return e=t0){var func;if((func=window[value])instanceof Function||(func=eval(value))instanceof Function)return func}}return null},addCssClasses:function(n,t){for(var i=0;i=n.x&&t=n.y&&it&&(f=r=="l"?f.substr(f.length-t,t):f.substr(0,t)),f},__DOMEvents:{focusin:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focusin",!0,!1,window,1)}},focusout:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focusout",!0,!1,window,1)}},activate:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("activate",!0,!0,window,1)}},focus:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focus",!1,!1,window,1)}},blur:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("blur",!1,!1,window,1)}},click:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("click",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},dblclick:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("click",!0,!0,window,2,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mousedown:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousedown",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseup:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mouseup",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseover:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mouseover",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mousemove:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousemove",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseout:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousemove",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},load:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("load",!1,!1)}},unload:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("unload",!1,!1)}},select:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("select",!0,!1)}},change:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("change",!0,!1)}},submit:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("submit",!0,!0)}},reset:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("reset",!0,!1)}},resize:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("resize",!0,!1)}},scroll:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("scroll",!0,!1)}}},tryFireRawEvent:function(n,t){try{if(n.fireEvent)return n.fireEvent("on"+t.type,t),!0;if(n.dispatchEvent)return n.dispatchEvent(t),!0}catch(i){}return!1},tryFireEvent:function(n,t,i){var u,r;try{if(document.createEventObject)return r=document.createEventObject(),$common.applyProperties(r,i||{}),n.fireEvent("on"+t,r),!0;if(document.createEvent&&(u=$common.__DOMEvents[t],u))return r=document.createEvent(u.eventGroup),u.init(r,i||{}),n.dispatchEvent(r),!0}catch(r){}return!1},wrapElement:function(n,t,i){var r=n.parentNode;r.replaceChild(t,n);(i||t).appendChild(n)},unwrapElement:function(n,t){var i=t.parentNode;i!=null&&($common.removeElement(n),i.replaceChild(n,t))},removeElement:function(n){var t=n.parentNode;t!=null&&t.removeChild(n)},applyProperties:function(n,t){var r,i,u;for(r in t)i=t[r],i!=null&&Object.getType(i)===Object?(u=n[r],$common.applyProperties(u,i)):n[r]=i},createElementFromTemplate:function(n,t,i){var f,h,r,e,s,c,o,u;if(typeof n.nameTable!="undefined"&&(f=n.nameTable,String.isInstanceOfType(f)&&(f=i[f]),f!=null&&(i=f)),h=null,typeof n.name!="undefined"&&(h=n.name),r=document.createElement(n.nodeName),typeof n.name!="undefined"&&i&&(i[n.name]=r),typeof n.parent!="undefined"&&t==null&&(e=n.parent,String.isInstanceOfType(e)&&(e=i[e]),e!=null&&(t=e)),typeof n.properties!="undefined"&&n.properties!=null&&$common.applyProperties(r,n.properties),typeof n.cssClasses!="undefined"&&n.cssClasses!=null&&$common.addCssClasses(r,n.cssClasses),typeof n.events!="undefined"&&n.events!=null&&$addHandlers(r,n.events),typeof n.visible!="undefined"&&n.visible!=null&&this.setVisible(r,n.visible),t&&t.appendChild(r),typeof n.opacity!="undefined"&&n.opacity!=null&&$common.setElementOpacity(r,n.opacity),typeof n.children!="undefined"&&n.children!=null)for(s=0;s0&&(this._scrollDeltaX=this._scrollDeltaY=0,t.clientXn.width-this._scrollEdgeConst&&(this._scrollDeltaX=this._scrollByConst),t.clientYn.height-this._scrollEdgeConst&&(this._scrollDeltaY=this._scrollByConst),this._scrollDeltaX!=0||this._scrollDeltaY!=0?this._scroller.set_enabled(!0):this._scroller.set_enabled(!1))},_onScrollerTick:function(){var t=document.body.scrollLeft,i=document.body.scrollTop;window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);var r=document.body.scrollLeft,u=document.body.scrollTop,n=this._activeDragVisual,f={x:parseInt(n.style.left)+(r-t),y:parseInt(n.style.top)+(u-i)};$common.setLocation(n,f)}};Sys.Extended.UI.GenericDragDropManager.registerClass("Sys.Extended.UI.GenericDragDropManager",Sys.Extended.UI.IEDragDropManager); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Compat.Timer.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Compat.Timer.js new file mode 100644 index 000000000..9141ccd0f --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Compat.Timer.js @@ -0,0 +1 @@ +Sys.Timer=function(){Sys.Timer.initializeBase(this);this._interval=1e3;this._enabled=!1;this._timer=null};Sys.Timer.prototype={get_interval:function(){return this._interval},set_interval:function(n){this._interval!==n&&(this._interval=n,this.raisePropertyChanged("interval"),this.get_isUpdating()||this._timer===null||(this._stopTimer(),this._startTimer()))},get_enabled:function(){return this._enabled},set_enabled:function(n){n!==this.get_enabled()&&(this._enabled=n,this.raisePropertyChanged("enabled"),this.get_isUpdating()||(n?this._startTimer():this._stopTimer()))},add_tick:function(n){this.get_events().addHandler("tick",n)},remove_tick:function(n){this.get_events().removeHandler("tick",n)},dispose:function(){this.set_enabled(!1);this._stopTimer();Sys.Timer.callBaseMethod(this,"dispose")},updated:function(){Sys.Timer.callBaseMethod(this,"updated");this._enabled&&(this._stopTimer(),this._startTimer())},_timerCallback:function(){var n=this.get_events().getHandler("tick");n&&n(this,Sys.EventArgs.Empty)},_startTimer:function(){this._timer=window.setInterval(Function.createDelegate(this,this._timerCallback),this._interval)},_stopTimer:function(){window.clearInterval(this._timer);this._timer=null}};Sys.Timer.descriptor={properties:[{name:"interval",type:Number},{name:"enabled",type:Boolean}],events:[{name:"tick"}]};Sys.Timer.registerClass("Sys.Timer",Sys.Component); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ComponentSet.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ComponentSet.js new file mode 100644 index 000000000..b4ee0873d --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ComponentSet.js @@ -0,0 +1 @@ +Sys.ComponentSet=function(n,t,i){this._elementSet=n||(n=new Sys.ElementSet);this._components=this._execute(n,t,i)};Sys.ComponentSet.prototype={__class:!0,setProperties:function(n){return this.each(function(){Sys._set(this,n)})},get:function(n){var t=this._components;return typeof n=="undefined"?Array.apply(null,t):t[n||0]||null},each:function(n){return foreach(this._components,function(t,i){if(n.call(t,i)===!1)return!0}),this},elements:function(){return this._elementSet},_execute:function(n,t,i){function u(n){var i;return n instanceof t||(i=n.constructor)&&(i===t||i.inheritsFrom&&i.inheritsFrom(t)||i.implementsInterface&&i.implementsInterface(t))}var r=[];return t instanceof Array?r.push.apply(r,t):n.each(function(){var n=this.control;n&&(!t||u(n))&&r.push(n);foreach(this._behaviors,function(n){(!t||u(n))&&r.push(n)})}),typeof i!="undefined"&&(r=r[i]?[r[i]]:[]),r}}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ConfirmButton.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ConfirmButton.js new file mode 100644 index 000000000..b3d9723b5 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/ConfirmButton.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.ConfirmButtonHiddenEventArgs=function(n){Sys.Extended.UI.ConfirmButtonHiddenEventArgs.initializeBase(this);this._confirmed=n};Sys.Extended.UI.ConfirmButtonHiddenEventArgs.prototype={get_confirmed:function(){return this._confirmed}};Sys.Extended.UI.ConfirmButtonHiddenEventArgs.registerClass("Sys.Extended.UI.ConfirmButtonHiddenEventArgs",Sys.EventArgs);Sys.Extended.UI.ConfirmButtonBehavior=function(n){Sys.Extended.UI.ConfirmButtonBehavior.initializeBase(this,[n]);this._ConfirmTextValue=null;this._OnClientCancelValue=null;this._ConfirmOnFormSubmit=!1;this._displayModalPopupID=null;this._postBackScript=null;this._clickHandler=null;this._oldScript=null};Sys.Extended.UI.ConfirmButtonBehavior.prototype={initialize:function(){Sys.Extended.UI.ConfirmButtonBehavior.callBaseMethod(this,"initialize");var n=this.get_element();this._clickHandler=Function.createDelegate(this,this._onClick);$addHandler(n,"click",this._clickHandler);this._oldScript=n.getAttribute("onclick");this._oldScript&&n.setAttribute("onclick",null);this._ConfirmOnFormSubmit&&typeof WebForm_OnSubmit=="function"&&!Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit&&(Sys.Extended.UI.TextBoxWatermarkBehavior&&Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit?(Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit=Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit,Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit=Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit):(Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit=WebForm_OnSubmit,WebForm_OnSubmit=Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit))},dispose:function(){this._clickHandler&&($removeHandler(this.get_element(),"click",this._clickHandler),this._clickHandler=null);this._oldScript&&(this.get_element().setAttribute("onclick",this._oldScript),this._oldScript=null);Sys.Extended.UI.ConfirmButtonBehavior.callBaseMethod(this,"dispose")},_onClick:function(e){if(this.get_element()&&!this.get_element().disabled)if(this._ConfirmOnFormSubmit)Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior=this;else if(this._displayConfirmDialog())this._oldScript&&(String.isInstanceOfType(this._oldScript)?eval(this._oldScript):typeof this._oldScript=="function"&&this._oldScript());else return e.preventDefault(),!1},_displayConfirmDialog:function(){var i=new Sys.CancelEventArgs,n,t;if(this.raise_showing(i),!i.get_cancel()){if(this._displayModalPopupID){if(n=$find(this._displayModalPopupID),!n)throw Error.argument("displayModalPopupID",String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID,this._displayModalPopupID));return n.set_OnOkScript("$find('"+this.get_id()+"')._handleConfirmDialogCompletion(true);"),n.set_OnCancelScript("$find('"+this.get_id()+"')._handleConfirmDialogCompletion(false);"),n.show(),!1}return t=window.confirm(this._ConfirmTextValue),this._handleConfirmDialogCompletion(t),t}},_handleConfirmDialogCompletion:function(result){this.raise_hidden(new Sys.Extended.UI.ConfirmButtonHiddenEventArgs(result));result?this._postBackScript&&eval(this._postBackScript):this._OnClientCancelValue&&window[this._OnClientCancelValue]()},get_onClientCancel:function(){return this._OnClientCancelValue},set_onClientCancel:function(n){this._OnClientCancelValue!=n&&(this._OnClientCancelValue=n,this.raisePropertyChanged("onClientCancel"))},get_OnClientCancel:function(){return Sys.Extended.Deprecated("get_OnClientCancel()","get_onClientCancel()"),this.get_onClientCancel()},set_OnClientCancel:function(n){Sys.Extended.Deprecated("set_OnClientCancel(value)","set_onClientCancel(value)");this.set_onClientCancel(n)},get_confirmText:function(){return this._ConfirmTextValue},set_confirmText:function(n){this._ConfirmTextValue!=n&&(this._ConfirmTextValue=n,this.raisePropertyChanged("confirmText"))},get_ConfirmText:function(){return Sys.Extended.Deprecated("get_ConfirmText()","get_confirmText()"),this.get_confirmText()},set_ConfirmText:function(n){Sys.Extended.Deprecated("set_ConfirmText(value)","set_confirmText(value)");this.set_confirmText(n)},get_confirmOnFormSubmit:function(){return this._ConfirmOnFormSubmit},set_confirmOnFormSubmit:function(n){this._ConfirmOnFormSubmit!=n&&(this._ConfirmOnFormSubmit=n,this.raisePropertyChanged("confirmOnFormSubmit"))},get_ConfirmOnFormSubmit:function(){return Sys.Extended.Deprecated("get_ConfirmOnFormSubmit()","get_confirmOnFormSubmit()"),this.get_confirmOnFormSubmit()},set_ConfirmOnFormSubmit:function(n){Sys.Extended.Deprecated("set_ConfirmOnFormSubmit(value)","set_confirmOnFormSubmit(value)");this.set_confirmOnFormSubmit(n)},get_displayModalPopupID:function(){return this._displayModalPopupID},set_displayModalPopupID:function(n){this._displayModalPopupID!=n&&(this._displayModalPopupID=n,this.raisePropertyChanged("displayModalPopupID"))},get_postBackScript:function(){return this._postBackScript},set_postBackScript:function(n){this._postBackScript!=n&&(this._postBackScript=n,this.raisePropertyChanged("postBackScript"))},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing","raise_showing");this.raise_showing(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(n){var t=this.get_events().getHandler("hidden");t&&t(this,n)},raiseHidden:function(n){Sys.Extended.Deprecated("raiseHidden","raise_hidden");this.raise_hidden(n)}};Sys.Extended.UI.ConfirmButtonBehavior.registerClass("Sys.Extended.UI.ConfirmButtonBehavior",Sys.Extended.UI.BehaviorBase);Sys.Extended.UI.ConfirmButtonBehavior.WebForm_OnSubmit=function(){var n=Sys.Extended.UI.ConfirmButtonBehavior._originalWebForm_OnSubmit();return n&&Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior&&(n=Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior._displayConfirmDialog()),Sys.Extended.UI.ConfirmButtonBehavior._clickedBehavior=null,n}; \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DraggableListItem.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DraggableListItem.js new file mode 100644 index 000000000..0ae856451 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DraggableListItem.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.DraggableListItem=function(n){Sys.Extended.UI.DraggableListItem.initializeBase(this,[n]);this._data=null;this._handle=null;this._dragVisualTemplate=null;this._dragVisualTemplateInstance=null;this._mouseDownHandler=null};Sys.Extended.UI.DraggableListItem.prototype={dispose:function(){var n=this.get_element();this.set_handle(null);Sys.Extended.UI.DraggableListItem.callBaseMethod(this,"dispose")},get_data:function(){if(this._data==null){var n=this._findDragSource();if(n!=null&&Sys.Extended.UI.DragDropList.IsValidDataType(n.get_dragDataType()))return this.get_element()}return this._data},set_data:function(n){this._data!=n&&(this._data=n,this.raisePropertyChanged("data"))},get_handle:function(){return this._handle},set_handle:function(n){this._handle!=null&&($removeHandler(this._handle,"mousedown",this.get_mouseDownHandler()),this._handle.__draggableBehavior=null);n?(n.element&&(n=n.element),this._handle=n,this.raisePropertyChanged("handle"),this._handle.__draggableBehavior=this,$addHandler(this._handle,"mousedown",this.get_mouseDownHandler()),this._handle.__draggableBehavior=this):this._handle=null},get_mouseDownHandler:function(){return this._mouseDownHandler==null&&(this._mouseDownHandler=Function.createDelegate(this,this._onMouseDown)),this._mouseDownHandler},get_dragVisualTemplate:function(){return this._dragVisualTemplate},set_dragVisualTemplate:function(n){this._dragVisualTemplate!=n&&(this._dragVisualTemplate=n,this.raisePropertyChanged("dragVisualTemplate"))},_onMouseDown:function(n){window._event=n.rawEvent;this._handle.__draggableBehavior._mouseDownHandlerInternal(n)},_mouseDownHandlerInternal:function(n){var n=window.testEvent?window.testEvent:n,t,i;n.button<=1&&(t=this._findDragSource(),t!=null&&(i=this._createDragVisual(),t.startDragDrop(this.get_element(),this.get_data(),i),n.returnValue=!1))},_createDragVisual:function(){var t=window.testEvent?window.testEvent:window.event,n;return this._dragVisualTemplate!=null&&(this._dragVisualTemplateInstance==null?this._dragVisualTemplateInstance=this._dragVisualTemplate.cloneElement():Sys.UI.DragDropManager._getInstance().hasParent(this._dragVisualTemplateInstance)||this.get_element().appendChild(this._dragVisualTemplateInstance),n={x:t.clientX,y:t.clientY},n=Sys.UI.DragDropManager._getInstance().addPoints(n,Sys.UI.DragDropManager._getInstance().getScrollOffset(document.body,!0)),$common.setLocation(this._dragVisualTemplateInstance,n)),this._dragVisualTemplateInstance},_findDragSource:function(){for(var n=this.get_element();n!=null;){if(n.__dragDropList!=null)return n.__dragDropList;n=n.parentNode}return null}};Sys.Extended.UI.DraggableListItem.registerClass("Sys.Extended.UI.DraggableListItem",Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropDown.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropDown.js new file mode 100644 index 000000000..6cc9b3ae6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropDown.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.DropDownBehavior=function(n){Sys.Extended.UI.DropDownBehavior.initializeBase(this,[n]);this._dropDownControl=null;this._highlightBorderColor="#2353B2";this._highlightBackgroundColor="#FFF3DB";this._dropArrowBackgroundColor="#C6E1FF";this._dropArrowImageUrl=null;this._dropArrowWidth="16px";this._oldBackgroundColor=null;this._dropFrame=null;this._dropArrow=null;this._dropArrowImage=null;this._dropWrapper=null;this._isOpen=!1;this._isOver=!1;this._wasClicked=null;this._dropWrapperHoverBehavior=null;this._dropPopupPopupBehavior=null;this._onShowJson=null;this._onHideJson=null;this._dropDownControl$delegates={click:Function.createDelegate(this,this._dropDownControl_onclick),contextmenu:Function.createDelegate(this,this._dropDownControl_oncontextmenu)};this._dropFrame$delegates={click:Function.createDelegate(this,this._dropFrame_onclick),contextmenu:Function.createDelegate(this,this._dropFrame_oncontextmenu)};this._dropWrapper$delegates={click:Function.createDelegate(this,this._dropWrapper_onclick),contextmenu:Function.createDelegate(this,this._dropWrapper_oncontextmenu)};this._document$delegates={click:Function.createDelegate(this,this._document_onclick),contextmenu:Function.createDelegate(this,this._document_oncontextmenu)};this._dropWrapperHoverBehavior$delegates={hover:Function.createDelegate(this,this._dropWrapperHoverBehavior_onhover),unhover:Function.createDelegate(this,this._dropWrapperHoverBehavior_onunhover)}};Sys.Extended.UI.DropDownBehavior.prototype={initialize:function(){var n,t,i;Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"initialize");n=this.get_element();t=n.parentNode;this._dropDownControl==null&&$common.createElementFromTemplate({parent:t,nameTable:this,name:"_dropDownControl",nodeName:"div",visible:!1,cssClasses:this._dropDownControl?null:["ajax__dropdown_panel"],properties:{__GENERATED:!0}});$addHandlers(this._dropDownControl,this._dropDownControl$delegates);i={};this._dropArrowImageUrl&&(i.src=this._dropArrowImageUrl);$common.createElementFromTemplate({parent:t,nameTable:this,name:"_dropFrame",nodeName:"span",visible:!1,children:[{name:"_dropFrameTop",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameRight",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameBottom",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameLeft",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropArrow",nodeName:"div",cssClasses:this._dropArrowImageUrl?["ajax__dropdown_arrow"]:["ajax__dropdown_arrow","ajax__dropdown_arrow_image"],properties:{style:{width:this._dropArrowWidth,backgroundColor:this._dropArrowBackgroundColor}},events:this._dropFrame$delegates,children:[{name:"_dropArrowWrapper",nodeName:"div",visible:!!this._dropArrowImageUrl,cssClasses:["ajax__dropdown_arrow_wrapper"],children:[{name:"_dropArrowImage",nodeName:"img",properties:i}]}]}]});$common.createElementFromTemplate({parent:null,nameTable:this,name:"_dropWrapper",nodeName:"span",properties:{id:n.id+"_dropWrapper",style:{cursor:"default"}},events:this._dropWrapper$delegates,content:n});this._dropPopupPopupBehavior=$create(Sys.Extended.UI.PopupBehavior,{positioningMode:Sys.Extended.UI.PositioningMode.BottomRight,parentElement:n,y:-1},null,null,this._dropDownControl);this._onShowJson&&this._dropPopupPopupBehavior.set_onShow(this._onShowJson);this._onHideJson&&this._dropPopupPopupBehavior.set_onHide(this._onHideJson);this._dropWrapperHoverBehavior=$create(Sys.Extended.UI.HoverBehavior,{hoverElement:this._dropFrame},this._dropWrapperHoverBehavior$delegates,null,this._dropWrapper);$addHandlers(document,this._document$delegates)},dispose:function(){var n=this.get_element();this._isOpen&&(this.hide(),this.unhover(),this._isOpen=!1);$common.removeHandlers(document,this._document$delegates);this._onShowJson=null;this._onHideJson=null;this._dropPopupPopupBehavior&&(this._dropPopupPopupBehavior.dispose(),this._dropPopupPopupBehavior=null);this._dropWrapperHoverBehavior&&(this._dropWrapperHoverBehavior.dispose(),this._dropWrapperHoverBehavior=null);this._dropFrame&&($common.removeElement(this._dropFrame),this._dropFrame=null,this._dropFrameTop=null,this._dropFrameRight=null,this._dropFrameBottom=null,this._dropFrameLeft=null,this._dropArrow=null,this._dropArrowWrapper=null,this._dropArrowImage=null);this._dropWrapper&&($common.removeHandlers(this._dropWrapper,this._dropWrapper$delegates),$common.unwrapElement(n,this._dropWrapper),this._dropWrapper=null);this._dropDownControl&&($common.removeHandlers(this._dropDownControl,this._dropDownControl$delegates),this._dropDownControl.__GENERATED&&$common.removeElement(this._dropDownControl),this._dropDownControl=null);Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"dispose")},hover:function(){var t=this.get_element(),n,i,r;this._isOver||(this._isOver=!0,this.raiseHoverOver(Sys.EventArgs.Empty),n=$common.getBounds(t),$common.setLocation(this._dropFrame,{x:0,y:0}),$common.setVisible(this._dropFrame,!0),i=$common.getLocation(this._dropFrame),$common.setVisible(this._dropFrame,!1),n.x-=i.x,n.y-=i.y,$common.setBounds(this._dropFrameTop,{x:n.x,y:n.y,width:n.width,height:1}),$common.setBounds(this._dropFrameRight,{x:n.x+n.width-1,y:n.y,width:1,height:n.height}),$common.setBounds(this._dropFrameBottom,{x:n.x,y:n.y+n.height-1,width:n.width,height:1}),$common.setBounds(this._dropFrameLeft,{x:n.x,y:n.y,width:1,height:n.height}),$common.setBounds(this._dropArrow,{x:n.x+n.width-17,y:n.y+1,width:16,height:n.height-2}),this._dropFrameTop.style.backgroundColor=this._highlightBorderColor,this._dropFrameRight.style.backgroundColor=this._highlightBorderColor,this._dropFrameBottom.style.backgroundColor=this._highlightBorderColor,this._dropFrameLeft.style.backgroundColor=this._highlightBorderColor,$common.setVisible(this._dropFrame,!0),this._oldBackgroundColor||(this._oldBackgroundColor=$common.getCurrentStyle(t,"backgroundColor")),r=/\d{0,3},\s*\d{0,3},\s*\d{0,3}/,t.style.backgroundColor=r.test(this._highlightBackgroundColor)?"rgb("+this._highlightBackgroundColor+")":this._highlightBackgroundColor)},unhover:function(){var n=this.get_element();(this._isOver||!this._isOpen)&&(this._isOver=!1,this._isOpen||($common.setVisible(this._dropFrame,!1),this._oldBackgroundColor?(n.style.backgroundColor=this._oldBackgroundColor,this._oldBackgroundColor=null):n.style.backgroundColor="transparent"),this.raise_hoverOut(Sys.EventArgs.Empty))},show:function(){if(!this._isOpen){this.hover();var n=new Sys.CancelEventArgs;if(this.raise_showing(n),this.raise_popup(n),n.get_cancel())return;this._isOpen=!0;this.populate();(!this._dynamicPopulateBehavior||this._dynamicPopulateBehavior._populated&&this._cacheDynamicResults)&&this._showPopup()}},_showPopup:function(){this._dropPopupPopupBehavior.show();this.raise_shown(Sys.EventArgs.Empty)},hide:function(){if(this._isOpen){var n=new Sys.CancelEventArgs;if(this.raise_hiding(n),n.get_cancel())return;this._isOpen=!1;this._dropPopupPopupBehavior.hide();this.raise_hidden(Sys.EventArgs.Empty)}},_dropWrapperHoverBehavior_onhover:function(){this.hover()},_dropWrapperHoverBehavior_onunhover:function(){this.unhover()},_dropWrapper_onclick:function(n){n.target.tagName!="A"&&(this._isOpen?this.hide():this.show(),this._wasClicked=!0)},_dropWrapper_oncontextmenu:function(n){n.target.tagName!="A"&&(this._wasClicked=!0,n.preventDefault(),this.show())},_dropFrame_onclick:function(){this._isOpen?this.hide():this.show();this._wasClicked=!0},_dropFrame_oncontextmenu:function(n){this._wasClicked=!0;n.preventDefault();this.show()},_dropDownControl_onclick:function(){},_dropDownControl_oncontextmenu:function(n){this._wasClicked=!0;n.preventDefault()},_document_onclick:function(){this._wasClicked?this._wasClicked=!1:this._isOpen&&(this.hide(),this.unhover())},_document_oncontextmenu:function(){this._wasClicked?this._wasClicked=!1:this._isOpen&&(this.hide(),this.unhover())},_onPopulated:function(n,t){Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"_onPopulated",[n,t]);this._isOpen&&this._showPopup()},get_onShow:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onShow():this._onShowJson},set_onShow:function(n){this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.set_onShow(n):this._onShowJson=n;this.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onShowBehavior():null},onShow:function(){this._dropPopupPopupBehavior&&this._dropPopupPopupBehavior.onShow()},get_onHide:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onHide():this._onHideJson},set_onHide:function(n){this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.set_onHide(n):this._onHideJson=n;this.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onHideBehavior():null},onHide:function(){this._dropPopupPopupBehavior&&this._dropPopupPopupBehavior.onHide()},get_dropDownControl:function(){return this._dropDownControl},set_dropDownControl:function(n){this._dropDownControl!=n&&(this._dropDownControl=n,this.raisePropertyChanged("dropDownControl"))},get_highlightBorderColor:function(){return this._highlightBorderColor},set_highlightBorderColor:function(n){this._highlightBorderColor!=n&&(this._highlightBorderColor=n,this.raisePropertyChanged("highlightBorderColor"))},get_highlightBackgroundColor:function(){return this._highlightBackgroundColor},set_highlightBackgroundColor:function(n){this._highlightBackgroundColor!=n&&(this._highlightBackgroundColor=n,this.get_isInitialized()&&this._isOpen&&(this._dropWrapper.style.backgroundColor=n),this.raisePropertyChanged("highlightBackgroundColor"))},get_dropArrowBackgroundColor:function(){return this._dropArrowBackgroundColor},set_dropArrowBackgroundColor:function(n){this._dropArrowBackgroundColor!=n&&(this._dropArrowBackgroundColor=n,this.get_isInitialized()&&(this._dropArrow.style.backgroundColor=n),this.raisePropertyChanged("dropArrowBackgroundColor"))},get_dropArrowImageUrl:function(){return this._dropArrowImageUrl},set_dropArrowImageUrl:function(n){this._dropArrowImageUrl!=n&&(this._dropArrowImageUrl=n,this.get_isInitialized()&&(this._dropArrow.className&&(this._dropArrow.className="",this._dropArrowWrapper.style.display="block"),this._dropArrowImage.src=n),this.raisePropertyChanged("dropArrowImageUrl"))},get_dropArrowWidth:function(){return this._dropArrowWidth},set_dropArrowWidth:function(n){this._dropArrowWidth!=n&&(this._dropArrowWidth=n,this.get_isInitialized()&&(this._dropArrow.style.width=n),this.raisePropertyChanged("dropArrowWidth"))},get_isOver:function(){return this._isOver},get_isOpen:function(){return this._isOpen},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)");this.raise_showing(n)},add_shown:function(n){this.get_events().addHandler("shown",n)},remove_shown:function(n){this.get_events().removeHandler("shown",n)},raise_shown:function(n){var t=this.get_events().getHandler("shown");t&&t(this,n)},raiseShown:function(n){Sys.Extended.Deprecated("raiseShown(eventArgs)","raise_shown(eventArgs)");this.raise_shown(n)},add_popup:function(n){this.get_events().addHandler("popup",n)},remove_popup:function(n){this.get_events().removeHandler("popup",n)},raise_popup:function(n){var t=this.get_events().getHandler("popup");t&&t(this,n)},raisePopup:function(n){Sys.Extended.Deprecated("raisePopup(eventArgs)","raise_popup(eventArgs)");this.raise_popup(n)},add_hiding:function(n){this.get_events().addHandler("hiding",n)},remove_hiding:function(n){this.get_events().removeHandler("hiding",n)},raise_hiding:function(n){var t=this.get_events().getHandler("hiding");t&&t(this,n)},raiseHiding:function(n){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)");this.raise_hiding(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(n){var t=this.get_events().getHandler("hidden");t&&t(this,n)},raiseHidden:function(n){Sys.Extended.Deprecated("raiseHidden(eventArgs)","raise_hidden(eventArgs)");this.raise_hidden(n)},add_hoverOver:function(n){this.get_events().addHandler("hoverOver",n)},remove_hoverOver:function(n){this.get_events().removeHandler("hoverOver",n)},raise_hoverOver:function(n){var t=this.get_events().getHandler("hoverOver");t&&t(this,n)},raiseHoverOver:function(n){Sys.Extended.Deprecated("raiseHoverOver(eventArgs)","raise_hoverOver(eventArgs)");this.raise_hoverOver(n)},add_hoverOut:function(n){this.get_events().addHandler("hoverOut",n)},remove_hoverOut:function(n){this.get_events().removeHandler("hoverOut",n)},raise_hoverOut:function(n){var t=this.get_events().getHandler("hoverOut");t&&t(this,n)},raiseHoverOut:function(n){Sys.Extended.Deprecated("raiseHoverOut(eventArgs)","raise_hoverOut(eventArgs)");this.raise_hoverOut(n)}};Sys.Extended.UI.DropDownBehavior.registerClass("Sys.Extended.UI.DropDownBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropShadow.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropShadow.js new file mode 100644 index 000000000..d79147f98 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropShadow.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.DropShadowBehavior=function(n){Sys.Extended.UI.DropShadowBehavior.initializeBase(this,[n]);this._opacity=1;this._width=5;this._shadowDiv=null;this._trackPosition=null;this._trackPositionDelay=50;this._timer=null;this._tickHandler=null;this._roundedBehavior=null;this._shadowRoundedBehavior=null;this._rounded=!1;this._radius=5;this._lastX=null;this._lastY=null;this._lastW=null;this._lastH=null};Sys.Extended.UI.DropShadowBehavior.prototype={initialize:function(){Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this,"initialize");e=this.get_element();$common.getCurrentStyle(e,"position",e.style.position)!="absolute"&&(e.style.position="relative");this._rounded&&this.setupRounded();this._trackPosition&&this.startTimer();this.setShadow()},dispose:function(){this.stopTimer();this.disposeShadowDiv();Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this,"dispose")},buildShadowDiv:function(){if((e=this.get_element(),this.get_isInitialized()&&e&&this._width)&&e.style.boxShadow==undefined&&e.style.MozBoxShadow==undefined&&e.style.WebkitBoxShadow==undefined){var n=document.createElement("DIV");n.style.backgroundColor="black";n.style.position="absolute";e.id&&(n.id=e.id+"_DropShadow");this._shadowDiv=n;e.parentNode.appendChild(n);this._rounded?(this._shadowDiv.style.height=Math.max(0,e.offsetHeight-2*this._radius)+"px",this._shadowRoundedBehavior?this._shadowRoundedBehavior.set_radius(this._radius):this._shadowRoundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,{Radius:this._radius},null,null,this._shadowDiv)):this._shadowRoundedBehavior&&this._shadowRoundedBehavior.set_radius(0);this._opacity!=1&&this.setupOpacity();this.setShadow(!1,!0);this.updateZIndex()}},disposeShadowDiv:function(){this._shadowDiv&&(this._shadowDiv.parentNode&&this._shadowDiv.parentNode.removeChild(this._shadowDiv),this._shadowDiv=null);this._shadowRoundedBehavior&&(this._shadowRoundedBehavior.dispose(),this._shadowRoundedBehavior=null)},onTimerTick:function(){this.setShadow()},startTimer:function(){this._timer||(this._tickHandler||(this._tickHandler=Function.createDelegate(this,this.onTimerTick)),this._timer=new Sys.Timer,this._timer.set_interval(this._trackPositionDelay),this._timer.add_tick(this._tickHandler),this._timer.set_enabled(!0))},stopTimer:function(){this._timer&&(this._timer.remove_tick(this._tickHandler),this._timer.set_enabled(!1),this._timer.dispose(),this._timer=null)},setShadow:function(n,t){var u,i,f,r,o;(e=this.get_element(),this.get_isInitialized()&&e&&(this._width||n))&&(e.style.boxShadow==undefined&&e.style.MozBoxShadow==undefined&&e.style.WebkitBoxShadow==undefined?(u=this._shadowDiv,u||this.buildShadowDiv(),i={x:e.offsetLeft,y:e.offsetTop},(n||this._lastX!=i.x||this._lastY!=i.y||!u)&&(this._lastX=i.x,this._lastY=i.y,r=this.get_width(),i.x+=r,i.y+=r,$common.setLocation(this._shadowDiv,i)),f=e.offsetHeight,r=e.offsetWidth,(n||f!=this._lastH||r!=this._lastW||!u)&&(this._lastW=r,this._lastH=f,this._rounded&&u&&!t?(this.disposeShadowDiv(),this.setShadow()):(this._shadowDiv.style.width=r+"px",this._shadowDiv.style.height=f+"px")),this._shadowDiv&&(this._shadowDiv.style.visibility=$common.getCurrentStyle(e,"visibility"))):(o=this._opacity==".25"?this._width+"px "+this._width+"px "+this._width+"px #D3D3D3":this._opacity==".5"?this._width+"px "+this._width+"px "+this._width+"px #778899":this._opacity==".75"?this._width+"px "+this._width+"px "+this._width+"px #808080":this._width+"px "+this._width+"px "+this._width+"px #000",e.style.boxShadow!=undefined?e.style.boxShadow=o:e.style.MozBoxShadow!=undefined?e.style.MozBoxShadow=o:e.style.WebkitBoxShadow!=undefined&&(e.style.WebkitBoxShadow=o)))},setupOpacity:function(){this.get_isInitialized()&&this._shadowDiv&&$common.setElementOpacity(this._shadowDiv,this._opacity)},setupRounded:function(){!this._roundedBehavior&&this._rounded&&(this._roundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,null,null,null,this.get_element()));this._roundedBehavior&&this._roundedBehavior.set_radius(this._rounded?this._radius:0)},updateZIndex:function(){if(this._shadowDiv){var i=this.get_element(),n=i.style.zIndex,t=this._shadowDiv.style.zIndex;t&&n&&n>t||(n=Math.max(2,n),t=n-1,i.style.zIndex=n,this._shadowDiv.style.zIndex=t)}},updateRoundedCorners:function(){this.get_isInitialized()&&(this.setupRounded(),this.disposeShadowDiv(),this.setShadow())},get_opacity:function(){return this._opacity},set_opacity:function(n){this._opacity!=n&&(this._opacity=n,this.setShadow(),this.setupOpacity(),this.raisePropertyChanged("opacity"))},get_Opacity:function(){return Sys.Extended.Deprecated("get_Opacity","get_opacity"),this.get_opacity()},set_Opacity:function(n){Sys.Extended.Deprecated("set_Opacity","set_opacity");this.set_opacity(n)},get_rounded:function(){return this._rounded},set_rounded:function(n){n!=this._rounded&&(this._rounded=n,this.updateRoundedCorners(),this.raisePropertyChanged("rounded"))},get_Rounded:function(){return Sys.Extended.Deprecated("get_Rounded","get_rounded"),this.get_rounded()},set_Rounded:function(n){Sys.Extended.Deprecated("set_Rounded","set_rounded");this.set_rounded(n)},get_radius:function(){return this._radius},set_radius:function(n){n!=this._radius&&(this._radius=n,this.updateRoundedCorners(),this.raisePropertyChanged("radius"))},get_Radius:function(){return Sys.Extended.Deprecated("get_Radius","get_radius"),this.get_radius()},set_Radius:function(n){Sys.Extended.Deprecated("set_Radius","set_radius");this.set_radius(n)},get_width:function(){return this._width},set_width:function(n){n!=this._width&&(this._width=n,this._shadowDiv&&$common.setVisible(this._shadowDiv,n>0),this.setShadow(!0),this.raisePropertyChanged("width"))},get_Width:function(){return Sys.Extended.Deprecated("get_Width","get_width"),this.get_width()},set_Width:function(n){Sys.Extended.Deprecated("set_Width","set_width");this.set_width(n)},get_trackPositionDelay:function(){return this._trackPositionDelay},set_trackPositionDelay:function(n){n!=this._trackPositionDelay&&(this._trackPositionDelay=n,e||(e=this.get_element()),e.style.boxShadow==undefined&&e.style.MozBoxShadow==undefined&&e.style.WebkitBoxShadow==undefined&&(this._trackPosition&&(this.stopTimer(),this.startTimer()),this.raisePropertyChanged("trackPositionDelay")))},get_TrackPositionDelay:function(){return Sys.Extended.Deprecated("get_TrackPositionDelay","get_trackPositionDelay"),this.get_trackPositionDelay()},set_TrackPositionDelay:function(n){Sys.Extended.Deprecated("set_TrackPositionDelay","set_trackPositionDelay");this.set_trackPositionDelay(n)},get_trackPosition:function(){return this._trackPosition},set_trackPosition:function(n){n!=this._trackPosition&&(this._trackPosition=n,e||(e=this.get_element()),e.style.boxShadow==undefined&&e.style.MozBoxShadow==undefined&&e.style.WebkitBoxShadow==undefined&&(this.get_element()&&(n?this.startTimer():this.stopTimer()),this.raisePropertyChanged("trackPosition")))},get_TrackPosition:function(){return Sys.Extended.Deprecated("get_TrackPosition","get_trackPosition"),this.get_trackPosition()},set_TrackPosition:function(n){Sys.Extended.Deprecated("set_TrackPosition","set_trackPosition");this.set_trackPosition(n)}};Sys.Extended.UI.DropShadowBehavior.registerClass("Sys.Extended.UI.DropShadowBehavior",Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropWatcher.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropWatcher.js new file mode 100644 index 000000000..257f49ff1 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/DropWatcher.js @@ -0,0 +1 @@ +function callbackSuccessStub(n,t){var i=t.split(":"),u=i[0],r=$find(u);r&&r._onCallbackSuccess(n,i[1])}function callbackErrorStub(n,t){var i=t.split(":"),u=i[0],r=$find(u);alert("error");r&&r._onCallbackError(n,i[1])}Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.RepeatDirection=function(){throw Error.invalidOperation();};Sys.Extended.UI.RepeatDirection.prototype={Vertical:0,Horizontal:1};Sys.Extended.UI.RepeatDirection.registerEnum("Sys.Extended.UI.RepeatDirection");Sys.Extended.UI.DragDropList=function(n){Sys.Extended.UI.DragDropList.initializeBase(this,[n]);this._acceptedDataTypes=[];this._isDragging=null;this._dataType=null;this._dragMode=Sys.Extended.UI.DragMode.Move;this._dragVisual=null;this._direction=Sys.Extended.UI.RepeatDirection.Vertical;this._emptyTemplate=null;this._emptyTemplateInstance=null;this._dropCueTemplate=null;this._dropCueTemplateInstance=null;this._floatContainerInstance=null;this._originalParent=null;this._originalNextSibling=null;this._originalZIndex=null;this._currentContext=null;this._data=null};Sys.Extended.UI.DragDropList.IsValidDataType=function(n){return n&&typeof n=="string"&&n.length>=4?n.substring(0,4)==="HTML":!1};Sys.Extended.UI.DragDropList.prototype={get_data:function(){return this._data},set_data:function(n){this._data=n},initialize:function(){Sys.Extended.UI.DragDropList.callBaseMethod(this,"initialize");this.get_element().__dragDropList=this;Sys.Extended.UI.DragDropManager.registerDropTarget(this)},startDragDrop:function(n,t,i){this._isDragging||(this._isDragging=!0,this._currentContext=t,i?this._dragVisual=i:i=this.createDragVisual(n),Sys.Extended.UI.DragDropManager.startDragDrop(this,i,t,!(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version>7&&Sys.Browser.documentMode!=0)))},createDragVisual:function(n){var i,u,t,r,f,e;return this._dragVisual=this._dragMode===Sys.Extended.UI.DragMode.Copy?n.cloneNode(!0):n,i=Sys.Extended.UI.DragDropManager._getInstance().getScrollOffset(n,!0),this._dragVisual.preDragWidth=this._dragVisual.style.width,this._dragVisual.preDragHeight=this._dragVisual.style.height,this._dragVisual.style.width=n.offsetWidth+"px",this._dragVisual.style.height=n.offsetHeight+"px",this._dragVisual.style.opacity="0.4",this._dragVisual.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity=0.4);",this._originalZIndex=this._dragVisual.style.zIndex,this._dragVisual.style.zIndex=Sys.Extended.UI.zIndex.DropWatcherDragVisual,this._originalParent=this._dragVisual.parentNode,this._originalNextSibling=Sys.Extended.UI.DragDropManager._getInstance().getNextSibling(this._dragVisual),u=$common.getLocation(n),t=this._getFloatContainer(),$common.setLocation(t,u),Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._dragVisual)&&this._dragVisual.parentNode.removeChild(this._dragVisual),t.appendChild(this._dragVisual),r=Sys.Extended.UI.DragDropManager._getInstance().getScrollOffset(n,!0),(i.x!==r.x||i.y!==r.y)&&(f=Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(i,r),e=Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(u,f),$common.setLocation(t,e)),t},get_emptyTemplate:function(){return this._emptyTemplate},set_emptyTemplate:function(n){this._emptyTemplate=n},get_dragDataType:function(){return this._dataType},set_dragDataType:function(n){this._dataType=n},getDragData:function(n){return n},get_dragMode:function(){return this._dragMode},set_dragMode:function(n){this._dragMode=n},dispose:function(){Sys.Extended.UI.DragDropManager.unregisterDropTarget(this);this.get_element().__dragDropList=null;Sys.Extended.UI.DragDropList.callBaseMethod(this,"dispose")},onDragStart:function(){this._validate()},onDrag:function(){},onDragEnd:function(n){if(this._floatContainerInstance?(this._dragMode===Sys.Extended.UI.DragMode.Copy?this._floatContainerInstance.removeChild(this._dragVisual):(this._dragVisual.style.opacity="0.999",this._dragVisual.style.filter="",this._dragVisual.style.zIndex=this._originalZIndex?this._originalZIndex:0,this._dragVisual.preDragWidth!=null&&(this._dragVisual.style.width=this._dragVisual.preDragWidth,this._dragVisual.preDragWidth=null),this._dragVisual.preDragHeight!=null&&(this._dragVisual.style.height=this._dragVisual.preDragHeight,this._dragVisual.preDragHeight=null),n?(this._dragVisual.parentNode.removeChild(this._dragVisual),this._originalNextSibling!=null?this._originalParent.insertBefore(this._dragVisual,this._originalNextSibling):this._originalParent.appendChild(this._dragVisual)):this._dragVisual.parentNode===this._floatContainerInstance&&this._dragVisual.parentNode.removeChild(this._dragVisual)),document.body.removeChild(this._floatContainerInstance)):this._dragVisual.parentNode.removeChild(this._dragVisual),!n&&this._data&&this._dragMode===Sys.Extended.UI.DragMode.Move){var t=this.getDragData(this._currentContext);this._data&&t&&Array.remove(this._data,t)}this._isDragging=!1;this._validate()},get_direction:function(){return this._direction},set_direction:function(n){this._direction=n},get_acceptedDataTypes:function(){return this._acceptedDataTypes},set_acceptedDataTypes:function(n){this._acceptedDataTypes=typeof n=="string"?n.split(","):n},get_dropCueTemplate:function(){return this._dropCueTemplate},set_dropCueTemplate:function(n){this._dropCueTemplate=n},get_dropTargetElement:function(){return this.get_element()},canDrop:function(n,t){for(var i=0;i0&&(t=!1);this._setEmptyTemplateVisible(t)},_setEmptyTemplateVisible:function(n){this._emptyTemplate&&(n?this._emptyTemplateInstance?Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._emptyTemplateInstance)||this.get_element().appendChild(this._emptyTemplateInstance):this._emptyTemplateInstance=this._emptyTemplate.createInstance(this.get_element()).instanceElement:this._emptyTemplateInstance&&Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._emptyTemplateInstance)&&this.get_element().removeChild(this._emptyTemplateInstance))},_getFloatContainer:function(){if(this._floatContainerInstance)Sys.Extended.UI.DragDropManager._getInstance().hasParent(this._floatContainerInstance)||document.body.appendChild(this._floatContainerInstance);else{this._floatContainerInstance=document.createElement(this.get_element().tagName);var n="0px 0px 0px 0px";this._floatContainerInstance.style.position="absolute";this._floatContainerInstance.style.padding=n;this._floatContainerInstance.style.margin=n;this._floatContainerInstance.className="dragVisualContainer";document.body.appendChild(this._floatContainerInstance)}return this._floatContainerInstance}};Sys.Extended.UI.DragDropList.registerClass("Sys.Extended.UI.DragDropList",Sys.Extended.UI.BehaviorBase,Sys.Extended.UI.IDragSource,Sys.Extended.UI.IDropTarget,Sys.IDisposable);Sys.Extended.UI.DragDropWatcher=function(n){Sys.Extended.UI.DragDropWatcher.initializeBase(this,[n]);this._childList=[];this._inProgressDrops={};this._postbackCode=null;this._callbackCssStyle=null;this._argReplaceString=null;this._argContextString=null;this._argErrorString=null;this._argSuccessString=null};Sys.Extended.UI.DragDropWatcher.prototype={dispose:function(){Sys.Extended.UI.DragDropWatcher.callBaseMethod(this,"dispose")},initialize:function(){Sys.Extended.UI.DragDropWatcher.callBaseMethod(this,"initialize");this._saveChildOrder()},add_reorderComplete:function(n){this.get_events().addHandler("reorderComplete",n)},remove_reorderComplete:function(n){this.get_events().removeHandler("reorderComplete",n)},raiseReorderComplete:function(){var n=this.get_events().getHandler("reorderComplete");n&&n(this,Sys.EventArgs.Empty)},findChild:function(n,t){for(var i,u=0,f=n.childNodes,r=0;r0)return!1;if(u=Sys.Extended.UI.DragDropWatcher.callBaseMethod(this,"canDrop",[n,t,i]),u){var o=$common.getBounds(i),e,f=!1,s=this.get_element();for(r=s.firstChild;r!=null&&!f;r=r.nextSibling)if(r.id){if(e=$common.getBounds(r),o.y<=e.y)break;f=r.id.lastIndexOf("Insert",r.id.length-6)!=-1}u=!f}return u},drop:function(n,t,i){var r,u,f;(Sys.Extended.UI.DragDropWatcher.callBaseMethod(this,"drop",[n,t,i]),r=i.id,this._postbackCode&&r)&&(u=this.findChild(this.get_element(),r),Sys.Debug.assert(u!=-1,String.format(Sys.Extended.UI.Resources.ReorderList_DropWatcherBehavior_NoChild,r)),f=this._getSavedChildIndex(r),u!=-1&&u!=f&&(this._saveChildOrder(),this.doPostBack(r,u,f)))},_setupDropState:function(n,t,i){if(n){var r=$get(n);this._inProgressDrops[n]={oldCss:r.className,newIndex:t,oldIndex:i};this._callbackCssStyle&&(r.className=this._callbackCssStyle)}},_onDropCallback:function(n){var t,i;if(n)return this.set_ClientState("true"),t=this._inProgressDrops[n],t&&(i=$get(n),this._callbackCssStyle&&(i.className=t.oldCss),delete this._inProgressDrops[n]),t},doPostBack:function(n,t,i){var f=this._inProgressDrops[n],u,r;f||(u="reorder:"+n+":"+i.toString()+":"+t.toString(),r=this._postbackCode.replace(this._argReplaceString,u),this._argSuccessString&&(r=r.replace(this._argSuccessString,"callbackSuccessStub")),this._argErrorString&&(r=r.replace(this._argErrorString,"callbackErrorStub")),this._argContextString&&(r=r.replace(this._argContextString,this.get_id()+":"+n)),this._setupDropState(n,t,i),window.setTimeout(r,0))},_onCallbackSuccess:function(n,t){n&&n.length>0?this._onCallbackError(n,t):(this._onDropCallback(t),this.raiseReorderComplete())},_onCallbackError:function(n,t){var i=this._onDropCallback(t);(i.oldIndex||i.newIndex)&&(this._saveChildOrder(),this.doReorder(i.newIndex,i.oldIndex,!0));alert(String.format(Sys.Extended.UI.Resources.ReorderList_DropWatcherBehavior_CallbackError,n))},doReorder:function(n,t,i){var f=this.get_element(),u=this._childList,r,e,o,s;if(n>=0&&u.length>n&&n!=t){if(r=$get(u[n]),e=this._inProgressDrops[r.id],e)return;if(r){t>n&&t++;o=t>=u.length;try{f.removeChild(r)}catch(f){}o?f.appendChild(r):(s=$get(u[t]),f.insertBefore(r,s));i?(this._saveChildOrder(),this.raiseReorderComplete()):this.doPostBack(r.id,t,n)}}},getItem:function(n){return this._childList||this._saveChildOrder(),this._childList[n]},_getSavedChildIndex:function(n){if(this._childList&&n)for(var t=0;t=32&&(i=String.fromCharCode(t),this._processKey(i)||n.preventDefault())}},_processKey:function(n){var t="",i=!1,r;return(this._filterMode==Sys.Extended.UI.FilterModes.ValidChars?(t=this._getValidChars(),i=t&&t.length>0&&t.indexOf(n)==-1):(t=this._getInvalidChars(),i=t&&t.length>0&&t.indexOf(n)>-1),r=new Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs(n,Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value(),i),this.raise_processKey(r),r.get_allowKey())?!0:(this.raiseFiltered(new Sys.Extended.UI.FilteredTextBoxEventArgs(n)),!1)},_onchange:function(){for(var r,t=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()),u=t.get_Value()||"",i=new Sys.StringBuilder,n=0;n0?!1:Array.indexOf(["input","button","select","textarea","label"],t.toLowerCase())>-1?!1:!0};this.get_dragDataType=function(){return"_floatingObject"};this.getDragData=function(){return null};this.get_dragMode=function(){return Sys.Extended.UI.DragMode.Move};this.onDragStart=function(){};this.onDrag=function(){};this.onDragEnd=function(n){var i,r,f;n||(i=this.get_events().getHandler("move"),i&&(r=new Sys.CancelEventArgs,i(this,r),n=r.get_cancel()));f=this.get_element();n?$common.setLocation(f,u):(t=$common.getLocation(f),this.raisePropertyChanged("location"))};this.startDragDrop=function(n){Sys.Extended.UI.DragDropManager.startDragDrop(this,n,null)};this.get_dropTargetElement=function(){return document.body};this.canDrop=function(n,t){return t=="_floatingObject"};this.drop=function(){};this.onDragEnterTarget=function(){};this.onDragLeaveTarget=function(){};this.onDragInTarget=function(){}};Sys.Extended.UI.FloatingBehavior.registerClass("Sys.Extended.UI.FloatingBehavior",Sys.Extended.UI.BehaviorBase,Sys.Extended.UI.IDragSource,Sys.Extended.UI.IDropTarget,Sys.IDisposable); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Hover.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Hover.js new file mode 100644 index 000000000..788760ed5 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/Hover.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.HoverBehavior=function(n){Sys.Extended.UI.HoverBehavior.initializeBase(this,[n]);this._elementHandlers=null;this._hoverElementHandlers=null;this._hoverElement=null;this._hoverCount=0;this._unhoverDelay=0;this._hoverDelay=0;this._hoverScript=null;this._unhoverScript=null;this._hoverFired=!1};Sys.Extended.UI.HoverBehavior.prototype={_setupHandlersArray:function(){var n=[];return n[0]=Function.createDelegate(this,this._onHover),n[1]=Function.createDelegate(this,this._onUnhover),n},get_elementHandlers:function(){return this._elementHandlers||(this._elementHandlers=this._setupHandlersArray()),this._elementHandlers},get_hoverElementHandlers:function(){return this._hoverElementHandlers||(this._hoverElementHandlers=this._setupHandlersArray()),this._hoverElementHandlers},get_hoverElement:function(){return this._hoverElement},set_hoverElement:function(n){n!=this._hoverElement&&(this._hoverElement&&this._setupHandlers(this._hoverElement,this.get_hoverElementHandlers(),!1),this._hoverElement=n,this._hoverElement&&this._setupHandlers(this._hoverElement,this.get_hoverElementHandlers(),!0))},get_hoverDelay:function(){return this._hoverDelay},set_hoverDelay:function(n){this._hoverDelay=n;this.raisePropertyChanged("hoverDelay")},get_hoverScript:function(){return this._hoverScript},set_hoverScript:function(n){this._hoverScript=n},get_unhoverDelay:function(){return this._unhoverDelay},set_unhoverDelay:function(n){this._unhoverDelay=n;this.raisePropertyChanged("unhoverDelay")},get_unhoverScript:function(){return this._unhoverScript},set_unhoverScript:function(n){this._unhoverScript=n},dispose:function(){var t=this.get_element(),n;this._elementHandlers&&(n=this.get_elementHandlers(),this._setupHandlers(t,n,!1),this._elementHandlers=null);this._hoverElement&&(n=this.get_hoverElementHandlers(),this._setupHandlers(this._hoverElement,n,!1),this._hoverElement=null);Sys.Extended.UI.HoverBehavior.callBaseMethod(this,"dispose")},initialize:function(){Sys.Extended.UI.HoverBehavior.callBaseMethod(this,"initialize");var n=this.get_elementHandlers();this._setupHandlers(this.get_element(),n,!0);this._hoverElement&&(n=this.get_hoverElementHandlers(),this._setupHandlers(this._hoverElement,n,!0))},add_hover:function(n){this.get_events().addHandler("hover",n)},remove_hover:function(n){this.get_events().removeHandler("hover",n)},_fireHover:function(){if(this._hoverCount&&!this._hoverFired){var handler=this.get_events().getHandler("hover");handler&&handler(this,Sys.EventArgs.Empty);this._hoverScript&&eval(this._hoverScript);this._hoverFired=!0}},_onHover:function(){this._hoverCount++;this._hoverDelay?window.setTimeout(Function.createDelegate(this,this._fireHover),this._hoverDelay):this._fireHover()},add_unhover:function(n){this.get_events().addHandler("unhover",n)},remove_unhover:function(n){this.get_events().removeHandler("unhover",n)},_fireUnhover:function(){if(this._hoverFired&&!this._hoverCount){this._hoverFired=!1;var handler=this.get_events().getHandler("unhover");handler&&handler(this,Sys.EventArgs.Empty);this._unhoverScript&&eval(this._unhoverScript)}},_onUnhover:function(){this._hoverCount--;this._hoverCount<=0&&(this._hoverCount=0,this._unhoverDelay?window.setTimeout(Function.createDelegate(this,this._fireUnhover),this._unhoverDelay):this._fireUnhover())},_setupHandlers:function(n,t,i){this.get_isInitialized()&&n&&(i?($addHandler(n,"mouseover",t[0]),$addHandler(n,"focus",t[0]),$addHandler(n,"mouseout",t[1]),$addHandler(n,"blur",t[1])):($removeHandler(n,"mouseover",t[0]),$removeHandler(n,"focus",t[0]),$removeHandler(n,"mouseout",t[1]),$removeHandler(n,"blur",t[1])))}};Sys.Extended.UI.HoverBehavior.descriptor={properties:[{name:"hoverElement",isDomElement:!0},{name:"unhoverDelay",type:Number}],events:[{name:"hover"},{name:"unhover"}]};Sys.Extended.UI.HoverBehavior.registerClass("Sys.Extended.UI.HoverBehavior",Sys.Extended.UI.BehaviorBase); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HoverMenu.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HoverMenu.js new file mode 100644 index 000000000..c3758ebbf --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HoverMenu.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.HoverMenuBehavior=function(n){Sys.Extended.UI.HoverMenuBehavior.initializeBase(this,[n]);this._hoverBehavior=null;this._popupBehavior=null;this._mouseEnterHandler=null;this._mouseLeaveHandler=null;this._unhoverHandler=null;this._hoverHandler=null;this._inHover=null;this._oldClass=null;this._popupElement=null;this._onShowJson=null;this._onHideJson=null;this._popupElement=null;this._hoverCssClass=null;this._offsetX=0;this._offsetY=0;this._popDelay=100;this._hoverDelay=0;this._popupPosition=null};Sys.Extended.UI.HoverMenuBehavior.prototype={initialize:function(){Sys.Extended.UI.HoverMenuBehavior.callBaseMethod(this,"initialize");this._hoverHandler=Function.createDelegate(this,this._onHover);this._unhoverHandler=Function.createDelegate(this,this._onUnhover);this._mouseEnterHandler=Function.createDelegate(this,this._onmouseover);this._mouseLeaveHandler=Function.createDelegate(this,this._onmouseout);var n=this.get_element();$addHandler(n,"mouseover",this._mouseEnterHandler);$addHandler(n,"mouseout",this._mouseLeaveHandler);this._popupElement&&(this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"_PopupBehavior"},null,null,this._popupElement),this._popupPosition?this._popupBehavior.set_positioningMode(Sys.Extended.UI.HoverMenuPopupPosition.Absolute):this._popupBehavior.set_positioningMode(Sys.Extended.UI.HoverMenuPopupPosition.Center),this._onShowJson&&this._popupBehavior.set_onShow(this._onShowJson),this._onHideJson&&this._popupBehavior.set_onHide(this._onHideJson),this._hoverBehavior=$create(Sys.Extended.UI.HoverBehavior,{id:this.get_id()+"_HoverBehavior",hoverDelay:this._hoverDelay,unhoverDelay:this._popDelay,hoverElement:this._popupElement},null,null,n),this._hoverBehavior.add_hover(this._hoverHandler),this._hoverBehavior.add_unhover(this._unhoverHandler))},dispose:function(){this._onShowJson=null;this._onHideJson=null;this._popupBehavior&&(this._popupBehavior.dispose(),this._popupBehavior=null);this._popupElement&&(this._popupElement=null);this._mouseEnterHandler&&$removeHandler(this.get_element(),"mouseover",this._mouseEnterHandler);this._mouseLeaveHandler&&$removeHandler(this.get_element(),"mouseout",this._mouseLeaveHandler);this._hoverBehavior&&(this._hoverHandler&&(this._hoverBehavior.remove_hover(this._hoverHandler),this._hoverHandler=null),this._unhoverHandler&&(this._hoverBehavior.remove_hover(this._unhoverHandler),this._unhoverHandler=null),this._hoverBehavior.dispose(),this._hoverBehavior=null);Sys.Extended.UI.HoverMenuBehavior.callBaseMethod(this,"dispose")},_getLeftOffset:function(){var t=$common.getLocation(this.get_element()).x,i=$common.getLocation(this.get_popupElement().offsetParent).x,n=0;switch(this._popupPosition){case Sys.Extended.UI.HoverMenuPopupPosition.Left:n=-1*this._popupElement.offsetWidth;break;case Sys.Extended.UI.HoverMenuPopupPosition.Right:n=this.get_element().offsetWidth}return n+t-i+this._offsetX},_getTopOffset:function(){var t=$common.getLocation(this.get_element()).y,i=$common.getLocation(this.get_popupElement().offsetParent).y,n=0;switch(this._popupPosition){case Sys.Extended.UI.HoverMenuPopupPosition.Top:n=-1*this._popupElement.offsetHeight;break;case Sys.Extended.UI.HoverMenuPopupPosition.Bottom:n=this.get_element().offsetHeight}return t-i+n+this._offsetY},_onHover:function(){if(!this._inHover){var n=new Sys.CancelEventArgs;(this.raise_showing(n),n.get_cancel())||(this._inHover=!0,this.populate(),this._popupBehavior.show(),$common.getCurrentStyle(this._popupElement,"display")=="none"&&(this._popupElement.style.display="block"),this._popupBehavior.set_x(this._getLeftOffset()),this._popupBehavior.set_y(this._getTopOffset()),this.raise_shown(Sys.EventArgs.Empty))}},_onUnhover:function(){var n=new Sys.CancelEventArgs;(this.raise_hiding(n),n.get_cancel())||(this._inHover=!1,this._resetCssClass(),this._popupBehavior.hide(),this.raise_hidden(Sys.EventArgs.Empty))},_onmouseover:function(){var n=this.get_element();this._hoverCssClass&&n.className!=this._hoverCssClass&&(this._oldClass=n.className,n.className=this._hoverCssClass)},_onmouseout:function(){this._resetCssClass()},_resetCssClass:function(){var n=this.get_element();!this._inHover&&this._hoverCssClass&&n.className==this._hoverCssClass&&(n.className=this._oldClass)},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShowJson},set_onShow:function(n){this._popupBehavior?this._popupBehavior.set_onShow(n):this._onShowJson=n;this.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onShowBehavior():null},onShow:function(){this._popupBehavior&&this._popupBehavior.onShow()},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHideJson},set_onHide:function(n){this._popupBehavior?this._popupBehavior.set_onHide(n):this._onHideJson=n;this.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onHideBehavior():null},onHide:function(){this._popupBehavior&&this._popupBehavior.onHide()},get_popupElement:function(){return this._popupElement},set_popupElement:function(n){this._popupElement!=n&&(this._popupElement=n,this.get_isInitialized()&&this._hoverBehavior&&this._hoverBehavior.set_hoverElement(this._popupElement),this.raisePropertyChanged("popupElement"))},get_hoverCssClass:function(){return this._hoverCssClass},set_hoverCssClass:function(n){this._hoverCssClass!=n&&(this._hoverCssClass=n,this.raisePropertyChanged("hoverCssClass"))},get_HoverCssClass:function(){return Sys.Extended.Deprecated("get_HoverCssClass","get_hoverCssClass"),this.get_hoverCssClass()},set_HoverCssClass:function(n){Sys.Extended.Deprecated("set_HoverCssClass","set_hoverCssClass");this.set_hoverCssClass(n)},get_offsetX:function(){return this._offsetX},set_offsetX:function(n){this._offsetX!=n&&(this._offsetX=n,this.raisePropertyChanged("offsetX"))},get_OffsetX:function(){return Sys.Extended.Deprecated("get_OffsetX()","get_offsetX()"),this.get_offsetX()},set_OffsetX:function(n){Sys.Extended.Deprecated("set_OffsetX(value)","set_offsetX(value)");this.set_offsetX(n)},get_offsetY:function(){return this._offsetY},set_offsetY:function(n){this._offsetY!=n&&(this._offsetY=n,this.raisePropertyChanged("offsetY"))},get_OffsetY:function(){return Sys.Extended.Deprecated("get_OffsetY()","get_offsetY()"),this.get_offsetY()},set_OffsetY:function(n){Sys.Extended.Deprecated("set_OffsetY(value)","set_offsetY(value)");this.set_offsetY(n)},get_popupPosition:function(){return this._popupPosition},set_popupPosition:function(n){this._popupPosition!=n&&(this._popupPosition=n,this.raisePropertyChanged("popupPosition"))},get_PopupPosition:function(){return Sys.Extended.Deprecated("get_PopupPosition()","get_popupPosition()"),this.get_popupPosition()},set_PopupPosition:function(n){Sys.Extended.Deprecated("set_PopupPosition(value)","set_popupPosition(value)");this.set_popupPosition(n)},get_popDelay:function(){return this._popDelay},set_popDelay:function(n){this._popDelay!=n&&(this._popDelay=n,this.raisePropertyChanged("popDelay"))},get_PopDelay:function(){return Sys.Extended.Deprecated("get_PopDelay","get_popDelay"),this.get_popDelay()},set_PopDelay:function(n){Sys.Extended.Deprecated("set_PopDelay","set_popDelay");this.set_popDelay(n)},get_hoverDelay:function(){return this._hoverDelay},set_hoverDelay:function(n){this._hoverDelay!=n&&(this._hoverDelay=n,this.raisePropertyChanged("hoverDelay"))},get_HoverDelay:function(){return Sys.Extended.Deprecated("get_HoverDelay","get_hoverDelay"),this.get_hoverDelay()},set_HoverDelay:function(n){Sys.Extended.Deprecated("set_HoverDelay","set_hoverDelay");this.set_hoverDelay(n)},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)");this.raise_showing(n)},add_shown:function(n){this.get_events().addHandler("shown",n)},remove_shown:function(n){this.get_events().removeHandler("shown",n)},raise_shown:function(n){var t=this.get_events().getHandler("shown");t&&t(this,n)},raiseShown:function(n){Sys.Extended.Deprecated("raiseShown(eventArgs)","raise_shown(eventArgs)");this.raise_shown(n)},add_hiding:function(n){this.get_events().addHandler("hiding",n)},remove_hiding:function(n){this.get_events().removeHandler("hiding",n)},raise_hiding:function(n){var t=this.get_events().getHandler("hiding");t&&t(this,n)},raiseHiding:function(n){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)");this.raise_hiding(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(n){var t=this.get_events().getHandler("hidden");t&&t(this,n)},raiseHidden:function(n){Sys.Extended.Deprecated("raiseHidden(eventArgs)","raise_hidden(eventArgs)");this.raise_hidden(n)}};Sys.Extended.UI.HoverMenuBehavior.registerClass("Sys.Extended.UI.HoverMenuBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase);Sys.Extended.UI.HoverMenuPopupPosition=function(){throw Error.invalidOperation();};Sys.Extended.UI.HoverMenuPopupPosition.prototype={Center:0,Top:1,Left:2,Bottom:3,Right:4};Sys.Extended.UI.HoverMenuPopupPosition.registerEnum("Sys.Extended.UI.HoverMenuPopupPosition"); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.DesignPanel.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.DesignPanel.js new file mode 100644 index 000000000..f7f20f582 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.DesignPanel.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.DesignPanel=function(n){Sys.Extended.UI.HtmlEditor.DesignPanel.initializeBase(this,[n]);this._doc=null;this._updated_now=!1;this._updateTimer=null;this._popup=null;this._contextElement=null;this._a_prize=!1;this.__stack=null;this._StyleForTyping=null;this.isWord=!1;this.isPlainText=!1;this.dfltBlockElement="P";this._FontNotSet=!0;this._design_timer1=null;this._events$delegate=Function.createDelegate(this,Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler);this._blur$delegate=Function.createDelegate(this,this._blur);this._focus$delegate=Function.createDelegate(this,this._focus_event)};Sys.Extended.UI.HtmlEditor.DesignPanel.prototype={initialize:function(){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"dispose")},_activate:function(n){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"_activate");this._wasFocused=!1;this._initIframe(n);this._onDocumentLoaded()},_deactivate:function(){this._deactivateCommon();Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.open(),this._doc.write(""),this._doc.close(),this.get_element().src="javascript:false;");this._doc=null;Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"_deactivate")},_deactivateCommon:function(){var t,n;for(this._editPanel.__blured=!1,t=this._doc.body.getElementsByTagName("IMG"),n=0;n0)try{Sys.Extended.UI.HtmlEditor.isIE?$removeHandler(t[n],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$removeHandler(t[n],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}catch(i){}Sys.Extended.UI.HtmlEditor._removeEvents(this._doc,["keydown","keypress","mousedown","mouseup","dblclick"],this._events$delegate);Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["blur"],this._blur$delegate);Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["focus"],this._focus$delegate)},_initIframe:function(n){Sys.Extended.UI.HtmlEditor.isIE||(this._savedValue=n,this._absAndFixedParents=this._getAbsAndFixedParents());var t=Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(n));this._doc=this.get_element().contentWindow.document;Sys.Extended.UI.HtmlEditor.isIE||(this._doc.designMode="on");this._doc.open();this._doc.write('<\/head>'+t+"<\/body><\/html>");this._doc.close();this._doc.id="EditorDocument";Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.body.contentEditable=!0,this._tryForward=!0)},_blur:function(n){return this._editPanel.__blured=!0,Sys.Extended.UI.HtmlEditor.isIE||this._design_timer1==null||(clearTimeout(this._design_timer1),this._design_timer1=null),this.isPopup||this._editPanel._validate(n,null),!0},_focus_event:function(){if(this._editPanel.__blured=!1,Sys.Extended.UI.HtmlEditor.isIE)this._really_focused();else{var n=this;Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel=this._editPanel;this._design_timer1==null&&(this._design_timer1=setTimeout(function(){n._really_focused();n._design_timer1=null},0))}return!0},_getAbsAndFixedParents:function(){for(var n=this.get_element(),t="";n!=null&&n.tagName&&n.tagName.toLowerCase()!="body";)t+=n.tagName,(n.style.position=="absolute"||n.style.position=="fixed")&&(t+=": "+n.style.position),t+="\n",n=n.parentNode;return t},_onDocumentLoaded:function(){var n=this,t,i;if(!Sys.Extended.UI.HtmlEditor.isIE&&(t=this._getAbsAndFixedParents(),t!=this._absAndFixedParents)){this._initIframe(this._savedValue);setTimeout(function(){n._onDocumentLoaded()},10);return}try{if(!Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.queryCommandValue("forecolor"),(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&!Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element()))){setTimeout(function(){n._onDocumentLoaded()},10);return}i=n._doc.body.innerHTML}catch(r){setTimeout(function(){n._onDocumentLoaded()},10);return}this._afterBodyIsFormed();setTimeout(function(){n._activateFinished();Sys.Extended.UI.HtmlEditor.isIE&&!n._editPanel.get_autofocus()&&n._getSelection().empty()},0)},_afterBodyIsFormed:function(){var i=this,n,t;if(Sys.Extended.UI.HtmlEditor._addEvents(this._doc,["keydown","keypress","mousedown","mouseup","dblclick"],this._events$delegate),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor.inspectForShadows(i._doc.body),n=this._doc.body,n.childNodes.length==1&&n.firstChild.tagName&&n.firstChild.tagName.toUpperCase()=="DIV"&&n.firstChild.style.cssText.length>0&&n.firstChild.style.direction.length>0&&Sys.Extended.UI.HtmlEditor.getStyle(n.firstChild,"position")!="absolute"){for(n.style.cssText=n.firstChild.style.cssText,t=n.firstChild;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}i._clearP()},_getContent:function(){var p,n,w,u,a,v,s,h,t,c,f,l,i,e;if(this._popup!=null&&typeof this._popup._forceImClose=="function"&&(p=this._popup._forceImClose,p(this._popup._iframe.contentWindow)),this._clearP(),Sys.Extended.UI.HtmlEditor.isIE)Sys.Extended.UI.HtmlEditor.spanJoiner(this._doc.body,this._doc),n=Sys.Extended.UI.HtmlEditor.getHTML(this._doc.body,!1,!0),n=n.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig,"$1 $3").replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/ig,"$1
    $3").replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/ig,"$1
    $3"),n=(this._doc.body.style.cssText.length>0?'
    ':"")+n+(this._doc.body.style.cssText.length>0?"<\/div>":""),this._editPanel.get_noScript()&&(n=n.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,"")),/)/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1$3").replace(/()/ig,"$1wmode=$3$4").replace(/()/ig,"$1$3")),w=new RegExp("(<[/]?)(teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":)","ig"),n=n.replace(w,"$1");else{for(u=this._doc.createElement("DIV"),a=new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover,u.style.cssText=this._doc.body.style.cssText,this._editPanel.get_noScript()||this._doc.body.innerHTML.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi,function(n,t){return a.regReplScript1(n,t)}),u.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML),v=u.getElementsByTagName("IMG"),s=[],f=0;f0&&c.toLowerCase()=="embed"){var k=t.getAttribute("dummysrc"),o=t.getAttribute("dummybgcolor"),y=t.getAttribute("pseudomode"),b=t.attributes,r=this._doc.createElement("EMBED");for(r.src=k,r.width=t.width,r.height=t.height,o&&o.length>0&&(o=Sys.Extended.UI.HtmlEditor.tryReplaceRgb(o),r.setAttribute("bgcolor",o)),y&&y.length>0&&r.setAttribute("wmode",y),f=0;f0&&(r.style.width=t.style.width);t.style.height&&t.style.height.length>0&&(r.style.height=t.style.height);t.parentNode.insertBefore(r,t);t.parentNode.removeChild(t)}Sys.Extended.UI.HtmlEditor.spanJoiner(u,this._doc);n=Sys.Extended.UI.HtmlEditor.getHTML(u,u.style.cssText.length>0?!0:!1,!0);n=this._editPanel.get_noScript()?n.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,""):n.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi,function(n,t,i,r){return a.regReplFromScript1(n,t,i,r)});delete u}return n=Sys.Extended.UI.HtmlEditor.brXHTML(n.replace(/^([\n|\r]+)/,"")),this._editPanel.get_noUnicode()&&(n=n.replace(/([\u0080-\uFFFF])/g,function(n,t){return"&#"+t.charCodeAt(0).toString(10)+";"})),Sys.Extended.UI.HtmlEditor.Trim(n)=="
    "&&(n=""),n},_setContent:function(n){this._deactivateCommon();var t=Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(n));this._doc.open();this._doc.write('<\/head>'+t+"<\/body><\/html>");this._doc.close();Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.body.contentEditable=!0,this._tryForward=!0);this._afterBodyIsFormed();this._editPanel.get_autofocus()&&this._focus();Sys.Extended.UI.HtmlEditor.isIE&&!this._editPanel.get_autofocus()&&this._getSelection().empty()},_focus:function(n){this.focusEditor();this._focused(n)},focusEditor:function(){try{this.get_element().contentWindow.focus()}catch(n){}this._wasFocused||(this._wasFocused=!0,this._editPanel.get_startEnd()||this._setToEnd())},_prepareContent:function(n){var t=n,o,e,l,s,h,r,c,f,n;if(t=t.replace(/]*?)>(?:[^\u0000]*?)(]*?)>)(?:[^\u0000]*?)<\/object(?:[^>]*?)>/gi,"$1"),Sys.Extended.UI.HtmlEditor.isIE)return t=Sys.Extended.UI.HtmlEditor.Trim(t.replace(/([\n\r]+<)/g,"<").replace(/([^>])([\n\r]+)([^<])/g,"$1 $3")).replace(/(&)/g,"&amp;").replace(/\s*<\/td>/ig,"<\/td>").replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig,"$1 $3").replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/ig,"$1 $3"),/)/ig,"$1pseudomode=$3$4").replace(/(]*?>)/ig,'$1 wmode="transparent"$2')),t.replace(/&/ig,"&");for(o=new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover,e=document.createElement("DIV"),this._editPanel.get_noScript()||t.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi,function(n,t){return o.regReplScript1(n,t)}),e.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(t.replace(/([^>])([\n\r]+)([^<])/g,"$1 $3")),l=e.getElementsByTagName("EMBED"),s=[],r=0;r0&&(u.style.width=i.style.width);i.style.height&&i.style.height.length>0&&(u.style.height=i.style.height);i.parentNode.insertBefore(u,i);i.parentNode.removeChild(i)}return Sys.Extended.UI.HtmlEditor.spanJoiner(e,document),t=Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(e,!1,!0)),this._editPanel.get_noScript()||(t=t.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi,function(n,t,i,r){return o.regReplFromScript1(n,t,i,r)})),delete e,delete o,t=Sys.Extended.UI.HtmlEditor.brXHTML(t),t.length==0&&(t="
    "),t},_clearP:function(){var n,i,t,r,u;try{if(n=this._doc.body,n.firstChild&&n.firstChild.nodeType==3&&(i=Sys.Extended.UI.HtmlEditor.Trim(""+n.firstChild.data+""),i.length==0?n.removeChild(n.firstChild):i!=""+n.firstChild.data+""&&(n.firstChild.data=i)),Sys.Extended.UI.HtmlEditor.isIE&&n.childNodes.length==1&&(n=n.firstChild,n.nodeType==1&&(t=n.tagName.toLowerCase(),t=="p"||t=="ul"||t=="ol"))){r=!1;u=t=="ul"||t=="ol";function f(n){var i=!1,t;if(n.nodeType==1){if((t=n.tagName.toUpperCase(),!(u&&t=="LI")&&(Sys.Extended.UI.HtmlEditor.isRestricted(n)||t=="IMG"||t=="IFRAME"||t=="EMBED"||t=="SCRIPT"))||n.childNodes.length>1)return!0;if(n.childNodes.length==0)return!1;i|=f(n.firstChild)}else n.nodeType==3&&(i|=!0);return i}n.childNodes.length==1&&(f(n.firstChild)||n.removeChild(n.firstChild));r=!0;(r||n.parentNode.innerHTML.toLowerCase()=="

     <\/p>")&&this._doc.body.removeChild(n)}}catch(e){}},isControl:function(){var i,n,t;try{return i=this._getSelection(),Sys.Extended.UI.HtmlEditor.isIE?i.type.toLowerCase()=="control"?!0:!1:(n=this._createRange(i),t=this._getParent(n),t.nodeType!=3&&n.startContainer==n.endContainer?t.tagName?n.startContainer.childNodes.item(n.startOffset)==null?!1:n.startOffset==n.endOffset&&n.startContainer.childNodes.item(n.startOffset).tagName&&(n.startContainer.childNodes.item(n.startOffset).tagName.toUpperCase()=="BR"||Sys.Extended.UI.HtmlEditor.isStyleTag(n.startContainer.childNodes.item(n.startOffset).tagName))?!1:t.tagName.toUpperCase()=="BODY"&&n.startOffset==0&&n.endOffset>0&&n.endOffset==t.childNodes.length?!1:n.startOffset==n.endOffset&&n.startContainer.childNodes.item(n.startOffset).nodeType==3?!1:!0:!1:!1)}catch(r){return!0}},isPopup:function(){return this._popup!=null},_getSelection:function(){var n,t,i,r;if(Sys.Extended.UI.HtmlEditor.isIE)return n=this._doc.selection;this.focusEditor();r=this.get_element().contentWindow;n=r.getSelection();t=this._createRange(n);i=t.startContainer;try{while(i&&i.nodeType)i=i.parentNode}catch(u){this._removeAllRanges(n);t=this._createRange(n);t.setStart(this._saved_startContainer,this._saved_startOffset);t.setEnd(this._saved_startContainer,this._saved_startOffset);this._selectRange(n,t);n=r.getSelection()}return n},_createRange:function(n){if(Sys.Extended.UI.HtmlEditor.isIE)return typeof n=="undefined"?this._doc.body.createTextRange():n.createRange();if(this.focusEditor(),typeof n=="undefined")return this._doc.createRange();try{return n.getRangeAt(0)}catch(i){return this._doc.createRange()}},toEndOfProtected:function(){var i=this,f=this._getSelection(),n,u,r,t;try{t=this._createRange(f)}catch(e){return!1}if(Sys.Extended.UI.HtmlEditor.isIE?n=Sys.Extended.UI.HtmlEditor.contentEditable(Sys.Extended.UI.HtmlEditor.getSelParent(i)):(n=Sys.Extended.UI.HtmlEditor.contentEditable(t.startContainer),n==null&&(n=Sys.Extended.UI.HtmlEditor.contentEditable(t.endContainer))),Sys.Extended.UI.HtmlEditor.isIE&&n!=null){try{t.remove(n)}catch(o){}t=i._doc.body.createControlRange();t.add(n);t.select()}else Sys.Extended.UI.HtmlEditor.isIE||n==null||(u=i._getSelection(),n.nextSibling!=null&&n.nextSibling.nodeType==3?r=n.nextSibling:(r=i._doc.createTextNode(""),n.nextSibling!=null?n.parentNode.insertBefore(r,n.nextSibling):n.parentNode.appendChild(r)),i._removeAllRanges(u),t=i._createRange(u),t.setStart(r,0),t.setEnd(r,0),i._selectRange(u,t));return!0},_commonPaste:function(n){var t=this,r,i,f,u;this._saveContent();Sys.Extended.UI.HtmlEditor.isIE?(this.openWait(),setTimeout(function(){t._paste(!t._editPanel.get_noPaste());t.closeWait()},0),Sys.Extended.UI.HtmlEditor._stopEvent(n)):this.isPlainText||this.isWord||this._editPanel.get_noPaste()?(r=t._getSafePlace(),r!=null?(i=t._doc.createElement("div"),i.style.display="inline",i.style.borderStyle="none",r.parentNode.insertBefore(i,r),i.appendChild(r),i.removeChild(r),i.innerHTML="xx",f=t._getSelection(),u=t._createRange(),t._removeAllRanges(f),u.setStart(i.firstChild,0),u.setEnd(i.firstChild,1),t._selectRange(f,u),t.openWait(),setTimeout(function(){var h=i.parentNode,f,o,r,n,u,s,e;for(i.lastChild.deleteData(i.lastChild.length-1,1),t.isWord?(i.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(i.innerHTML),Sys.Extended.UI.HtmlEditor.replaceOldTags(i,t),Sys.Extended.UI.HtmlEditor.spanJoiner(i,t._doc)):(f=document.createElement("div"),f.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(i.innerHTML),o=new Sys.Extended.UI.HtmlEditor.jsDocument(!0),Sys.Extended.UI.HtmlEditor.__MozillaGetInnerText(f,o),i.innerHTML=o.toString().replace(//g,">").replace(/\r/g,"").replace(/\n/g,"
    ").replace(/\t/g," "),delete f);i.firstChild;)h.insertBefore(i.firstChild,i);r=null;n=null;i.nextSibling&&i.nextSibling.nodeType==3&&i.previousSibling&&i.previousSibling.nodeType==3&&(r=i.nextSibling,n=i.previousSibling);h.removeChild(i);u=null;r!=null&&n!=null&&(u=n.data.length,n.data=""+n.data+""+r.data+"",r.parentNode.removeChild(r));t.isWord=!1;t.isPlainText=!1;t.closeWait();u!=null&&(s=t._getSelection(),e=t._createRange(),t._removeAllRanges(s),e.setStart(n,u),e.setEnd(n,u),t._selectRange(s,e));t.onContentChanged()},0)):Sys.Extended.UI.HtmlEditor._stopEvent(n)):setTimeout(function(){Sys.Extended.UI.HtmlEditor.operateAnchors(t,t._doc,!t._editPanel.get_showAnchors());Sys.Extended.UI.HtmlEditor.operatePlaceHolders(t,t._doc,!t._editPanel.get_showPlaceHolders());Sys.Extended.UI.HtmlEditor.inspectForShadows(t._doc.body);t._checkImages(t._doc.body);t.onContentChanged()},0)},_selectRange:function(n,t){n.addRange(t);this.focusEditor()},_selectRng:function(n){var i=this._getSelection(),r,e;if(Sys.Extended.UI.HtmlEditor.isIE){var t=this._createRange(i),u=this._createRange(i),o=this._doc.createElement("span"),f=this._doc.createElement("span");n[0].parentNode.insertBefore(o,n[0]);n[n.length-1].nextSibling?n[n.length-1].parentNode.insertBefore(f,n[n.length-1].nextSibling):n[n.length-1].parentNode.appendChild(f);try{t.moveToElementText(o);e=t.moveStart("character",1);t.moveStart("character",-e);u.moveToElementText(f);e=u.moveEnd("character",-1);u.moveEnd("character",-e);t.setEndPoint("EndToEnd",u);t.select()}catch(s){}n[0].parentNode.removeChild(o);n[n.length-1].parentNode.removeChild(f)}else r=this._doc.createRange(),r.setStart(n[0],0),r.setEnd(n[n.length-1],(""+n[n.length-1].data+"").length),this._removeAllRanges(i),this._selectRange(i,r)},_removeAllRanges:function(n){n.removeAllRanges()},_setToEnd:function(){var n=this;setTimeout(function(){n._setToEnd_();n._editPanel.updateToolbar()},0)},_setToEnd_:function(){var n=this,e,u,r,i;if(Sys.Extended.UI.HtmlEditor.isIE){u=n._getSelection();r=n._createRange(u);u.type.toLowerCase()!="control"&&(r.moveEnd("textedit",1),r.collapse(!1));r.select();n.focusEditor();return}var f=0,t=n._doc.body,i=null;if(t.lastChild&&t.lastChild.nodeType==3?(t=t.lastChild,f=(""+t.data+"").length):(e=n._doc.createTextNode(""),t.lastChild&&t.lastChild.nodeType==1&&t.lastChild.tagName.toUpperCase()=="BR"?t.insertBefore(e,t.lastChild):t.appendChild(e),t=e,f=0),u=n._getSelection(),n._removeAllRanges(u),r=n._createRange(),r.setStart(t,f),r.setEnd(t,f),n._selectRange(u,r),i!=null&&n._doc.body.removeChild(i),n.focusEditor(),!Sys.Extended.UI.HtmlEditor.isSafari&&!Sys.Extended.UI.HtmlEditor.isOpera)try{i=n._doc.createElement("button");i.style.width="0px";i.style.height="20px";n._doc.body.appendChild(i);i.focus();i.blur();n.focusEditor();n._doc.body.removeChild(i)}catch(o){}},isShadowed:function(){var t,n,i,r,u;if(!this.isControl())return!1;if(t=this._getSelection(),n=this._createRange(t),i=Sys.Extended.UI.HtmlEditor.isIE?n.item(0):n.startContainer.childNodes.item(n.startOffset),i.tagName&&i.tagName.toUpperCase()=="IMG"&&i.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute)&&i.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute).length>0){if(r=this.getAttachedElement(i),r!=null){if(Sys.Extended.UI.HtmlEditor.isIE)n=this._doc.body.createControlRange(),n.add(r),n.select();else try{u=Sys.Extended.UI.HtmlEditor.__getIndex(r);t.collapseToEnd();this._removeAllRanges(t);n=this._createRange(t);n.setStart(r.parentNode,u);n.setEnd(r.parentNode,u+1);this._selectRange(t,n)}catch(f){return!0}return!1}return!0}return!1},_ifShadow:function(){var e,f,u,t;if(Sys.Extended.UI.HtmlEditor.isIE)try{e=this._doc.selection}catch(o){return!1}for(var i=this,r=null,n=Sys.Extended.UI.HtmlEditor.getSelParent(i);n&&(n.nodeType==3||n.tagName&&n.tagName.toUpperCase()!="BODY");){if(n.nodeType==3||!n.tagName){n=n.parentNode;continue}if(f=n.tagName.toUpperCase(),f=="TABLE"&&n.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute)&&n.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute)=="yes"){r=n.rows.item(0).cells.item(0).firstChild;Sys.Extended.UI.HtmlEditor.isIE&&f=="P"&&(r=r.firstChild);break}n=n.parentNode}if(r!=null)if(u=i._getSelection(),t=i._createRange(u),Sys.Extended.UI.HtmlEditor.isIE)t=i._doc.body.createControlRange(),t.add(r),t.select();else try{u.collapseToEnd();i._removeAllRanges(u);t=i._createRange(u);t.setStart(r.parentNode,0);t.setEnd(r.parentNode,1);i._selectRange(u,t)}catch(o){}},_saveContent:function(){var n,t,i;try{try{n=this._getSelection();t=this._createRange(n)}catch(r){}i=new Sys.Extended.UI.HtmlEditor._Marker(this,t,n)}catch(r){return}for(this.__stack||(this.__stack=[],this.__stackPos=0);this.__stackPos=0&&this.__stackPos]*/ig,"")+(r=='"X"'?"":"align="+r)+u.replace(/\salign=[^\s>]*/ig,"")}for(c=this._doc.body.getElementsByTagName("EMBED"),e=[],n=0;n)/ig,y),this._doc.body.innerHTML="!!!<\/span>"+Sys.Extended.UI.HtmlEditor.Trim(f),this._doc.body.firstChild&&this._doc.body.removeChild(this._doc.body.firstChild),this._doc.body.firstChild&&this._doc.body.removeChild(this._doc.body.firstChild),s=Sys.Extended.UI.HtmlEditor.getHrefsText(f),Sys.Extended.UI.HtmlEditor.setHrefsText(this._doc.body,s),this._editPanel.get_relativeImages()&&(s=Sys.Extended.UI.HtmlEditor.getImagesText(f),Sys.Extended.UI.HtmlEditor.setImagesText(this._doc.body,s)),Sys.Extended.UI.HtmlEditor.setNames(this._doc.body,t._nArr),Sys.Extended.UI.HtmlEditor.operateAnchors(this,this._doc,!this._editPanel.get_showAnchors()),Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this,this._doc,!this._editPanel.get_showPlaceHolders()),t._tree!=null){i=this._doc.body;try{for(n=t._tree.length-1;n>=0;n--)i=i.childNodes.item(t._tree[n])}catch(p){this.__stackPos>0&&(this.__stackPos--,this._restoreContent(),this.__stackPos++);return}try{l=this._doc.body.createControlRange();l.add(i);l.select()}catch(p){}}else h=this,setTimeout(function(){try{if(h._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel){if(u=h._getSelection(),r=h._createRange(u),u.type.toLowerCase()!="control")try{r.moveToPoint(t._offsetLeft,t._offsetTop)}catch(n){}r.select()}}catch(n){}},0)}else{if(Sys.Extended.UI.HtmlEditor.isOpera)this._doc.body.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(t._save);else for(this._doc.body.innerHTML="",n=0;n=0;n--)v+=" "+t._tree[n],i=i.childNodes.item(t._tree[n]);a=t._offset;try{r.setStart(i,a);r.setEnd(i,a)}catch(p){Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body);return}try{this._selectRange(u,r)}catch(p){}}try{Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body)}catch(p){}}},SaveContent:function(){this._saveContent()},RestoreContent:function(){this._undo(!1)},_undo:function(n){var i,t;if(this.__stack&&this.__stackPos>0){this.__stackPos==this.__stack.length&&n&&this._saveContent();do i=Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML),this.__stackPos--,this._restoreContent();while(Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML)==i&&this.__stackPos>0&&n);t=this;setTimeout(function(){try{t._ifShadow()}catch(i){}if(t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel)try{t._editPanel.updateToolbar()}catch(i){}n||t.onContentChanged()},0)}},_redo:function(){var i,t,n;this.__stack&&this.__stackPos0&&(t=n._body.ownerDocument.createElement("div"),n._body.appendChild(t),setTimeout(function(){n._body.removeChild(t)},0))),this._restoreContent(),n=this,setTimeout(function(){n._ifShadow();n._editPanel.updateToolbar()},0))},undo:function(){this._undo(!0);this.onContentChanged()},redo:function(){this._redo();this.onContentChanged()},_contextMenuCallP:function(){},onContentChanged:function(){},_copyCut:function(n,t){var v=this,c,f,l,e,a,u,h,y,r,i;if(Sys.Extended.UI.HtmlEditor.isIE){var r=this._getSelection(),i=this._createRange(r),s=!1,o="";if(n=="x"&&this._saveContent(),r.type.toLowerCase()=="control")s=!0,o=Sys.Extended.UI.HtmlEditor.getHTML(i.item(0),!0);else if(i.text!=""){if(s=!0,o=i.htmlText,c=i.duplicate(),f=this._getTextNodeCollection(),f.length<1)return;if(l=Sys.Extended.UI.HtmlEditor._commonParent(f[0],f[f.length-1]),l!=null&&f[0].previousSibling&&f[0].previousSibling.nodeType==3)for(e=l.parent;e&&e.tagName.toUpperCase()!="BODY"&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName);)a=e.cloneNode(!1),a.innerHTML=o,o=a.outerHTML,e=e.parentNode;r=this._getSelection();r.empty();i=this._createRange(r);i.setEndPoint("EndToEnd",c);i.setEndPoint("StartToStart",c);i.select()}else i.htmlText!=""&&(s=!0,o=i.htmlText);s?(u=this._doc.createElement("DIV"),u.innerHTML="!!!<\/span>"+o,u.removeChild(u.firstChild),u.removeChild(u.firstChild),h=Sys.Extended.UI.HtmlEditor.getHTML(u,!1,!0),y=new RegExp("(<[/]?)(teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":)","ig"),h=h.replace(y,"$1"),delete u,this._contentCopy(h,!0),i.select(),n=="x"&&(r.clear(),this._clearP())):n=="x"&&(r.clear(),this._clearP());t&&setTimeout(function(){v._editPanel.updateToolbar()},0)}else n=="x"?(this._saveContent(),r=this._getSelection(),i=this._createRange(r),this._removeAllRanges(r),i.deleteContents(),this._doc.body.innerHTML==""&&(this._doc.body.innerHTML="
    ",i.setStart(this._doc.body,0),i.setEnd(this._doc.body,0)),v.onContentChanged(),this._selectRange(r,i)):(r=this._getSelection(),i=this._createRange(r),this._removeAllRanges(r),alert(String.format(Sys.Extended.UI.Resources.HTMLEditor_toolbar_button_Use_verb,Sys.Extended.UI.HtmlEditor.isSafari&&navigator.userAgent.indexOf("mac")!=-1?"Apple-C":"Ctrl-C")),this._selectRange(r,i))},_paste:function(n,t){var f=this,v=this._getSelection(),o=this._createRange(v),l,a,r,i,s,h,e,c,u;if(!n){l=o.offsetLeft;a=o.offsetTop;this.insertHTML(this._getPlain());f.onContentChanged();return}if(!this._editPanel.get_noPaste()){if(l=o.offsetLeft,a=o.offsetTop,r=this._doc.createElement("span"),s=this._contentCopy("",!1,t),/<[\/]*p[\s>]+/i.test(s)||/<[\/]*h/i.test(s))i=this._getSafePlace();else{if(i=this._doc.createElement("SPAN"),i.id=Sys.Extended.UI.HtmlEditor.smartClassName,!this.insertHTML(Sys.Extended.UI.HtmlEditor.getHTML(i,!0)))return;i=this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName);i&&(i.id=null,i.removeAttribute("id"),i.setAttribute("para","no"))}if(r.innerHTML=s,i){if(this._checkImages(r),h=i.parentNode,e=i.getAttribute("para"),e!="no"){if(e.indexOf("left")>=0&&r.firstChild&&r.firstChild.tagName&&r.firstChild.tagName.toUpperCase()=="P"){while(r.firstChild.firstChild)i.previousSibling.appendChild(r.firstChild.firstChild);r.removeChild(r.firstChild)}if(e.indexOf("right")>=0&&r.lastChild&&r.lastChild.tagName&&r.lastChild.tagName.toUpperCase()=="P"){while(r.lastChild.lastChild)i.nextSibling.insertBefore(r.lastChild.lastChild,i.nextSibling.firstChild);r.removeChild(r.lastChild)}}if(c=i,u=null,r.childNodes.length==0&&e.indexOf("left")>=0&&e.indexOf("right")>=0){for(i.nextSibling.firstChild&&(u=this._doc.createElement("span"),c=u,u.innerHTML="111",i.previousSibling.appendChild(u));i.nextSibling.firstChild;)i.previousSibling.appendChild(i.nextSibling.firstChild);h.removeChild(i.nextSibling)}else while(r.firstChild)h.insertBefore(r.firstChild,i);setTimeout(function(){var t=f._getSelection(),n=f._createRange(t);if(t.type.toLowerCase()=="control")while(n.length>0)n.remove(0);try{n.collapse(!1)}catch(r){}f.focusEditor();Sys.Extended.UI.HtmlEditor._setCursor(c,f);u&&u.parentNode.removeChild(u);h.removeChild(i);Sys.Extended.UI.HtmlEditor.inspectForShadows(f._doc.body);f.onContentChanged();n.select()},0)}}},_contentCopy:function(n,t,i){var o,r,c,a,v,h,f,l,s,u,e,y;if(n!=""&&(n=n.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig,"$1 $3").replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/ig,"$1
    $3").replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/ig,"$1
    $3")),o=this._doc.createElement("iframe"),o.width="0",o.height="0",Sys.Extended.UI.HtmlEditor.isIE&&(o.src="javascript:false;"),this._doc.appendChild(o),r=o.contentWindow.document,r.write("<\/head>"+n+"<\/body><\/html>"),r.close(),r.body.contentEditable=!0,c=r.body.createTextRange(),a=!1,n==""){for(c.execCommand("paste"),v=r.createElement("DIV"),u=0;u=0&&h.nextSibling&&h.nextSibling.nodeType==3&&(f=""+h.nextSibling.data+"",f.length&&f.charCodeAt(0)==160))){f=f.substr(1);h.nextSibling.data=f;a=!0;break}if(typeof i!="undefined"&&i&&(r.body.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(r.body.innerHTML)),f=Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(r.body,!1,!0)),f=f.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,""),r.body.innerHTML=f,!t){for(Sys.Extended.UI.HtmlEditor.operateAnchors(this,r,!this.showAnchors),Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this,r,!this.showPlaceHolders),l=r.body.getElementsByTagName("EMBED"),s=[],u=0;u\s*<\/td>/ig,"<\/td>").replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/ig,"$1 $3").replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/ig,"$1 $3").replace(/()/ig,"$1pseudomode=$3$4").replace(/(]*?>)/ig,'$1 wmode="transparent"$2'),l=r.body.getElementsByTagName("EMBED"),s=[];for(u=0;u

     <\/p><\/p>/ig,"
    ").replace(/]*?\/>/ig,"").replace(/<(p|div)[^>]*?> <\/(\1)[^>]*?>/ig,"").replace(/<(p|div)[^>]*?><\/(\1)[^>]*?>/ig,""),i;do r=t,t=t.replace(/<([^>]*)(?:class|size|lang|face|start|type|border|[ovwxp]:\w+)=(?:\'[^\']*\'|\"[^\"]*\"|[^> ]+)([^>]*)>/ig,"<$1$2>");while(t!=r);i=document.createElement("div");i.innerHTML=t;u(i);t=Sys.Extended.UI.HtmlEditor.Trim(i.innerHTML);delete i;t=t.replace(/<[\/]?(xml|del|ins)[^>]*?>/ig,"").replace(/<(p|div)[^>]*?>/ig,"").replace(/<\/(p|div)[^>]*?>/ig,"
    ");do r=t,t=t.replace(/<\/b>/ig,"").replace(/<\/i>/ig,"").replace(/<\/u>/ig,"").replace(/<\/strong>/ig,"").replace(/<\/em>/ig,"").replace(/<\/sub>/ig,"").replace(/<\/sup>/ig,""),t=t.replace(/]*?><\/span>/ig,"").replace(/([^<]+?)<\/span>/ig,"$1"),t=t.replace(/]*?><\/font>/ig,"").replace(/([^<]+?)<\/font>/ig,"$1");while(t!=r);return t=t.replace(/’/g,"'").replace(/‘/g,"'").replace(/–/g,"-").replace(/—/g,"-").replace(/…/g,"...").replace(/"/g,'"').replace(/“/g,'"').replace(/”/g,'"').replace(//g,"").replace(/•/g,"").replace(/[ \s]+/g," ").replace(/(( )+)/g," "),document.all&&(t=t.replace(/^[\x00-\x1F]* /,"")),t},Sys.Extended.UI.HtmlEditor.spanJoiner=function(n,t,i,r,u){var y=0,h=n.childNodes.length,c,f,p,w,v,o,b,e,l,s;for(typeof i!="undefined"&&i!=null&&(y=i),typeof r!="undefined"&&r!=null&&(h=r),c=y;c0||f.getAttribute("class")&&f.getAttribute("class").length>0)&&!Sys.Extended.UI.HtmlEditor.isTempElement(f)){n.removeChild(f);c--;h--;continue}if(f.tagName.toUpperCase()=="SPAN"){while(f.childNodes.length==1&&f.firstChild.nodeType==1){if(f.firstChild.tagName.toUpperCase()!="SPAN"||Sys.Extended.UI.HtmlEditor.isTempElement(f.firstChild))f.firstChild.tagName.toUpperCase()=="SPAN"&&Sys.Extended.UI.HtmlEditor.isTempElement(f.firstChild)&&(w=f.firstChild,f.parentNode.insertBefore(f.firstChild,f),f.parentNode.removeChild(f),f=w);else{for(var l=Sys.Extended.UI.HtmlEditor.differAttr(f.firstChild,[]),s=Sys.Extended.UI.HtmlEditor.differStyle(f.firstChild),a=f.firstChild,k=a.childNodes;a.firstChild!=null;)f.insertBefore(a.firstChild,a);for(e=0;e=0)f.style[s[e][0]]=s[e][1];else try{p=f.style[s[e][0]];f.style[s[e][0]]=f.style[s[e][0]]+" "+s[e][1];p==f.style[s[e][0]]&&(f.style[s[e][0]]=s[e][1])}catch(d){f.style[s[e][0]]=s[e][1]}else f.style[s[e][0]]=s[e][1]}catch(g){}for(e=0;e0||f.getAttribute("class")&&f.getAttribute("class").length>0||Sys.Extended.UI.HtmlEditor.isTempElement(f))Sys.Extended.UI.HtmlEditor.spanJoiner(f,t);else{n.removeChild(f);c--;h--;continue}}},Sys.Extended.UI.HtmlEditor._styleTags=["strong","em","u","strike","s","span","font","b","sub","sup","a","i"],Sys.Extended.UI.HtmlEditor.isStyleTag=function(n){if(!n)return!1;for(var t=0;t0&&n.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName)>=0?!0:!1},Sys.Extended.UI.HtmlEditor.differAttr=function(n,t,i){var s=[],u=n.parentNode,f,r,h,e,o;if(typeof i!="undefined"&&(u=i),u&&u.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(u.tagName)||(u=null),n.attributes)for(f=0;f/ig,"
    ")},Sys.Extended.UI.HtmlEditor._needsClosingTag=function(n){return" script style div span a del strong em u strike font b sub sup p iframe li ul ol placeholder textarea td tr ".indexOf(" "+n.tagName.toLowerCase()+" ")!=-1},Sys.Extended.UI.HtmlEditor._encodeText_=function(n){return n.replace(/&/ig,"&").replace(//ig,">").replace(/\"/ig,""").replace(/\xA0/ig," ")},Sys.Extended.UI.HtmlEditor._noNeedsClosingTag=function(n){return" hr br ".indexOf(" "+n.tagName.toLowerCase()+" ")!=-1},Sys.Extended.UI.HtmlEditor.canBeInsideP=function(n,t){var r,i;if(n&&n.style&&n.style.display&&n.style.display.toLowerCase()=="inline")return!0;if(r=n.tagName.toUpperCase(),r.length==2&&r.substr(0,1)=="H"&&parseInt(r.substr(1,1))>0)return!1;switch(r){case"TBODY":case"TR":case"TD":if(typeof t!="undefined"){for(i=n.parentNode;i&&i.tagName&&i.tagName.toUpperCase()!="TABLE";)i=i.parentNode;if(i.tagName.toUpperCase()=="TABLE"&&i.style&&i.style.display&&i.style.display.toLowerCase()=="inline")return!0}case"P":case"PRE":case"TABLE":case"OL":case"UL":case"LI":case"HR":case"DIV":case"BLOCKQUOTE":case"FORM":case"FIELDSET":case"LEGEND":return!1;default:return!0}},Sys.Extended.UI.HtmlEditor.convertAlign=function(n){var t,i;try{i=parseInt(n)-1}catch(r){return n}switch(i){case 1:t="left";break;case 2:t="right";break;case 3:t="texttop";break;case 4:t="absmiddle";break;case 5:t="baseline";break;case 6:t="absbottom";break;case 7:t="bottom";break;case 8:t="middle";break;case 9:t="top";break;default:t=n.replace(/\"/g,""")}return t},Sys.Extended.UI.HtmlEditor.getHTML=function(n,t,i){try{if(typeof i=="undefined")if(t||n.nodeType!=1){if(t&&n.nodeType==1&&Sys.Extended.UI.HtmlEditor.isIE)return n.outerHTML}else return n.innerHTML}catch(u){}var r=new Sys.Extended.UI.HtmlEditor.jsDocument(!0);return Sys.Extended.UI.HtmlEditor._getHTML_(r,n,t),r.toString()},Sys.Extended.UI.HtmlEditor._getHTML_=function(n,t,i){var h,l,y,e,f,p,c,w,b,v,a,u,o,r,k,s;switch(t.nodeType){case 1:case 11:if(t.tagName&&t.tagName.indexOf("/")>=0){if(Sys.Extended.UI.HtmlEditor.isIE){if(f=t.tagName.toLowerCase().substr(t.tagName.indexOf("/")+1),h=t.previousSibling,f=="embed")return;while(h!=null){if(h.nodeType==t.nodeType&&h.tagName&&h.tagName.toLowerCase()==f){n.append("<\/teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":"+t.tagName.toLowerCase().substr(t.tagName.indexOf("/")+1)+">");return}h=h.previousSibling}}return}if(i&&t.tagName.length>0){if(f=t.tagName.toLowerCase(),l=!(t.hasChildNodes()||Sys.Extended.UI.HtmlEditor._needsClosingTag(t)),y=!0,p="",Sys.Extended.UI.HtmlEditor.isIE&&t.scopeName&&typeof t.scopeName!="undefined"&&(p=t.scopeName.toUpperCase()=="HTML"?"":t.scopeName+":"),Sys.Extended.UI.HtmlEditor.isIE&&(l||f=="placeholder")&&!Sys.Extended.UI.HtmlEditor._noNeedsClosingTag(t)&&f!="embed")for(c=t.nextSibling;c!=null;){if(c.nodeType==t.nodeType&&c.tagName&&(w=c.tagName,w.indexOf("/")>=0&&w.toLowerCase().substr(w.indexOf("/")+1)==f)){l=!1;y=!1;break}c=c.nextSibling}for(Sys.Extended.UI.HtmlEditor.canBeInsideP(t)||n.append("\n"),n.append("<"+(!l&&!y?"teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":":p)+f),Sys.Extended.UI.HtmlEditor.isIE&&t.name&&t.name.length>0&&n.append(' name="'+t.name.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.value&&t.value.length>0&&f!="textarea"&&n.append(' value="'+t.value.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.className&&t.className.length>0&&n.append(' class="'+t.className.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.align&&t.align.length>0&&n.append(' align="'+t.align.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.color&&t.color.length>0&&n.append(' color="'+t.color.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.size&&t.size.length>0&&t.size!="+0"&&n.append(' size="'+t.size.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.shape&&t.shape.length>0&&n.write(' shape="'+t.shape.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.coords&&t.coords.length>0&&n.write(' coords="'+t.coords.replace(/\"/g,""")+'"'),b=t.attributes,v=null,e=0;e]*?width=)([\\d]+)","ig"),function(n,t){o=t}),r!=o&&(r=o));else if(u=="height")r=t.height,Sys.Extended.UI.HtmlEditor.isIE&&r==0&&(o=0,t.outerHTML.replace(new RegExp("^(?:<[^>]*?height=)([\\d]+)","ig"),function(n,t){o=t}),r!=o&&(r=o));else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="name"&&t.name&&t.name.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="value"&&t.value&&t.value.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="align"&&t.align&&t.align.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="class"&&t.className&&t.className.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="color"&&t.color&&t.color.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="size"&&t.size&&t.size.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="shape"&&t.shape&&t.shape.length>0)continue;else if(Sys.Extended.UI.HtmlEditor.isIE&&u=="coords"&&t.coords&&t.coords.length>0)continue;else if(f=="embed"&&u=="align"&&Sys.Extended.UI.HtmlEditor.isIE)r=Sys.Extended.UI.HtmlEditor.convertAlign(a.value);else{if(r=a.value,Sys.Extended.UI.HtmlEditor.isSafari&&u=="class"&&/apple-style/ig.test(r))continue;(u=="src"||u=="href")&&(Sys.Extended.UI.HtmlEditor.isIE&&(r=Sys.Extended.UI.HtmlEditor.getRealAttributeIE(t,u,r)),r=r.replace(/(\(S\([A-Za-z0-9_]+\)\)\/)/,""));r=r.replace(/\"/g,""")}else{Sys.Extended.UI.HtmlEditor.isSafari&&(v=a.value);continue}s='"';(""+r+"").indexOf('"')>=0&&(s="'");u!=null&&n.append(" "+u+"="+s+r+s)}if(t.style.cssText.length>0||v!=null){var u="style",d=/(url\((?:[^\)]*)\))/ig,g=[];function nt(n,t){g.push(t)}r=(v!=null?v:t.style.cssText).toLowerCase();r.replace(d,nt);k=0;function tt(){var n=g[k];return k++,n}if(r=Sys.Extended.UI.HtmlEditor.tryReplaceRgb(r.replace(d,tt)).replace(/(font-weight\s*:\s*)(700)/ig,"$1bold").replace(/([\s]*-moz-[^;]*[;][\s]*)/ig,"").replace(/(-moz-.*)$/i,"").replace(/(background-position: 0% 0%[;]*[\s]*)/ig,""),Sys.Extended.UI.HtmlEditor.isSafari){function it(n,t,i,r){return t+i.replace(/(,)/g,"")+r}r=r.replace(/(text-decoration:)([^;$]+)([;$])/ig,it)}if(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera){function rt(n,t,i,r){return t+i.replace(/(['"])/g,"")+r}r=r.replace(/(font-family:)([^;]+)([;]*)/ig,rt)}r.length>0&&(s='"',(""+r+"").indexOf('"')>=0&&(s="'"),n.append(" "+u+"="+s+r+s))}n.append(l?" />":">");f=="br"&&n.append("\n")}if(t.tagName&&t.tagName.toUpperCase()=="SCRIPT"&&n.append(t.text),t.tagName&&t.tagName.toUpperCase()=="STYLE")n.append(t.innerHTML);else for(e=t.firstChild;e;e=e.nextSibling)Sys.Extended.UI.HtmlEditor._getHTML_(n,e,!0);i&&t.tagName.length>0&&!l&&y&&n.append("<\/"+p+t.tagName.toLowerCase()+">");break;case 3:n.append(Sys.Extended.UI.HtmlEditor._encodeText_(""+t.data+""));break;case 8:t.length>0?n.append(""):n.append("")}},Sys.Extended.UI.HtmlEditor.RemoveContextMenu=function(){var n=this,t=n._contextElement.parentNode.removeChild(n._contextElement);t&&delete t;n._contextElement=null;n._contextTable=null;n.__saved_range__&&(n.__saved_range__.select(),n.__saved_range__=null)},Sys.Extended.UI.HtmlEditor.contentEditable=function(n,t){for(var i,r;n!=null;){try{if(i=null,n.contentEditable==null||typeof n.contentEditable=="undefined"||Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera?(r=n.getAttribute("contenteditable"),typeof r=="boolean"?i=r:typeof r=="string"&&r.toLowerCase()=="false"&&(i=!1)):i=n.contentEditable&&n.contentEditable!="false"?!0:!1,i!=null&&typeof i=="boolean"&&!i)return n}catch(u){}if(typeof t!="undefined"&&t)return null;if(n.tagName!=null&&typeof n.tagName!="undefined"&&(n.tagName.toUpperCase()=="BODY"||n.tagName.toUpperCase()=="HTML"))break;n=n.parentNode}return null},Sys.Extended.UI.HtmlEditor.getSelParent=function(n){var r=n._getSelection(),i=n._createRange(r),t=null,u;return Sys.Extended.UI.HtmlEditor.isIE?t=r.type.toLowerCase()=="control"?i.item(0):n._getParent(i):(t=n._getParent(i),t.nodeType!=3&&i.startContainer==i.endContainer&&(u=t,t=t.childNodes.item(i.startOffset),t==null&&(t=u))),t},Sys.Extended.UI.HtmlEditor.__getIndex=function(n){var t=0;if(n.parentNode)for(;t0)return!1;switch(t){case"BR":case"TBODY":case"TR":case"TD":case"P":case"PRE":case"TABLE":case"OL":case"UL":case"LI":case"HR":case"DIV":case"BLOCKQUOTE":case"FORM":case"FIELDSET":case"LEGEND":return!1;default:return!0}},Sys.Extended.UI.HtmlEditor.capLock=function(n){var t=n.charCode,i=n.shiftKey?n.shiftKey:t==16?!0:!1;return t>=65&&t<=90&&!i||t>=97&&t<=122&&i?!0:!1},Sys.Extended.UI.HtmlEditor.operateAnchors=function(n,t,i){for(var r,e,o,u,f,h=t.getElementsByTagName("A"),c=!1,s=0;s0){for(e=[],o=0;o0)r.removeChild(e.pop());i||(f=t.createElement("IMG"),f.title=r.name,f.src=n._editPanel.get_imagePath_anchor(),f.setAttribute(n.noContextMenuAttributeName(),"yes"),r.appendChild(f))}return c},Sys.Extended.UI.HtmlEditor.operatePlaceHolders=function(n,t,i){var v=!1,c,l,o,e,f,r,u,a,s,h;if(i){for(e=t.getElementsByTagName("IMG"),f=[],r=0;r0&&c.toLowerCase()=="placeholder"&&(l=t.createElement("PLACEHOLDER"),o=u.title,(o==null||typeof o=="undefined")&&(o=u.getAttribute("title")),l.name=o,l.setAttribute("name",o),u.parentNode.insertBefore(l,u),u.parentNode.removeChild(u),v=!0)}else{for(e=t.getElementsByTagName("PLACEHOLDER"),f=[],r=0;r0&&(a=!1)}catch(y){}a&&(s=u.name,(s==null||typeof s=="undefined")&&(s=u.getAttribute("name")),h=t.createElement("IMG"),h.title=s,h.src=n._editPanel.get_imagePath_placeHolder(),h.setAttribute("dummytag","placeholder"),h.setAttribute("title",s),u.parentNode.insertBefore(h,u),u.parentNode.removeChild(u))}}return v},Sys.Extended.UI.HtmlEditor.inspectForShadows=function(n){for(var i=n.getElementsByTagName("IMG"),t=0;t0){try{Sys.Extended.UI.HtmlEditor.isIE?$removeHandler(i[t],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$removeHandler(i[t],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}catch(r){}Sys.Extended.UI.HtmlEditor.isIE?$addHandler(i[t],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$addHandler(i[t],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}},Sys.Extended.UI.HtmlEditor.attachedIdAttribute="obout-attached-id",Sys.Extended.UI.HtmlEditor.stopDrag=function(n){return n&&n.stopPropagation(),n.preventDefault(),!1},Sys.Extended.UI.HtmlEditor.replacingRules=[["strong","font-weight","bold"],["b","font-weight","bold"],["strong","font-weight","700"],["em","font-style","italic"],["i","font-style","italic"],["u","text-decoration","underline"],["strike","text-decoration","line-through"]],Sys.Extended.UI.HtmlEditor.replaceOldTags=function(n,t){for(var a,o,i,f,s,r,h,e,c=n.innerHTML,l=!1,u=0;u]","ig"),a.test(c)){l=!0;break}if(l||/]/ig.test(c))for(o=0;o0)e.appendChild(r),i=r;else{while(r.firstChild)e.appendChild(r.firstChild);n.removeChild(r);i=e}else i=r}Sys.Extended.UI.HtmlEditor.replaceOldTags(i,t)}},Sys.Extended.UI.HtmlEditor.getStyle=function(n,t){var i="";if(n.nodeType==1)if(n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.getComputedStyle)i=n.ownerDocument.defaultView.getComputedStyle(n,"").getPropertyValue(t);else if(n.currentStyle)try{t=t.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()});i=n.currentStyle[t]}catch(r){i=n.style[t]}else i=n.style[t];return i},Sys.Extended.UI.HtmlEditor._Marker=function(n,t,i){var r,u;if(Sys.Extended.UI.HtmlEditor.isIE)if(this._nArr=Sys.Extended.UI.HtmlEditor.getNames(n._doc.body),this._save=n._doc.body.innerHTML,this._tree=null,i.type.toLowerCase()=="control")try{for(r=t.item(0),this._tree=[];r&&(r.nodeType==3||!r.tagName||r.tagName.toUpperCase()!="BODY");){for(u=0;r.previousSibling;)u++,r=r.previousSibling;this._tree.push(u);r=r.parentNode}}catch(f){}else this._offsetLeft=t.offsetLeft,this._offsetTop=t.offsetTop;else{this._save=Sys.Extended.UI.HtmlEditor.isOpera?Sys.Extended.UI.HtmlEditor.Trim(n._doc.body.innerHTML):n._doc.body.cloneNode(!0);this._tree=[];this._offset=0;try{for(r=t.startContainer,this._offset=t.startOffset,r&&r.nodeType==1&&r.tagName.toUpperCase()=="HTML"&&(r=n._doc.body,setTimeout(function(){try{i=n._getSelection();t=n._createRange();n._removeAllRanges(i);t.setStart(r,0);t.setEnd(r,0);n._selectRange(i,t)}catch(u){}},0));r&&r.nodeType&&(r.nodeType==3||!r.tagName||r.tagName.toUpperCase()!="BODY");){for(u=0;r.previousSibling;)u++,Sys.Extended.UI.HtmlEditor.isOpera&&r.nodeType==3&&r.previousSibling!=null&&r.previousSibling.nodeType==3&&u--,r=r.previousSibling;this._tree.push(u);r=r.parentNode}}catch(f){}}},Sys.Extended.UI.HtmlEditor.__stackMaxSize=30,Sys.Extended.UI.HtmlEditor.getNames=function(n){for(var t,i,f=n.all,e=[],o=[],u=0;u0){var r=t.tagName,s=n.getElementsByTagName(r),h=0;for(i=0;it[i][1]&&(n.getElementsByTagName(t[i][0])[t[i][1]].name=t[i][2])},Sys.Extended.UI.HtmlEditor._lookChild=function(n,t){for(var r,i=0;i=0)return i;return-1},Sys.Extended.UI.HtmlEditor.getHrefsText=function(n){function i(n,i,r,u,f,e){for(var s=i.replace(/^<([^\s>]+)/,"$1"),h=!0,o=0;o<]+)([^><]*?)(href=)(\"|')([^\\4]*?)(\\4)((?:[^><]*?)>)","ig");return n.replace(r,i),t},Sys.Extended.UI.HtmlEditor.setHrefsText=function(n,t){for(var u,f,r,e,i=0;i0&&(Sys.Extended.UI.HtmlEditor.isIE&&(e=u[r].innerHTML),u[r].href=t[i][f].replace(/&/ig,"&"),Sys.Extended.UI.HtmlEditor.isIE&&(u[r].innerHTML=e)),f++)},Sys.Extended.UI.HtmlEditor.getImagesText=function(n){function i(n,i,r,u){return t.push(u),n}var t=[];return n.replace(/()/ig,i),t},Sys.Extended.UI.HtmlEditor.setImagesText=function(n,t){for(var u=n.getElementsByTagName("IMG"),i=0,r=0;r0&&(u[r].src=t[i].replace(/&/ig,"&")),i++)},Sys.Extended.UI.HtmlEditor.canHaveChildren=function(n){return Sys.Extended.UI.HtmlEditor.isIE?n.canHaveChildren:!/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(n.tagName.toLowerCase())},Sys.Extended.UI.HtmlEditor._setCursor=function(n,t){var r=n,e,f,u,i;if(Sys.Extended.UI.HtmlEditor.isIE){u=t._getSelection();i=t._createRange(u);u.type.toLowerCase()=="control"&&(i.remove(0),u.empty(),i=t._createRange());e=r.nodeType==3;e&&(f=t._doc.createElement("SPAN"),f.innerHTML=" ",r.parentNode.insertBefore(f,r),r=f);var o=$common.getLocation(r),s=o.x,h=o.y;e&&f.parentNode.removeChild(f);try{i.moveToPoint(s,h)}catch(c){}i.select()}else u=t._getSelection(),i=t._createRange(),i.setStart(r,0),i.setEnd(r,0),t._removeAllRanges(u),t._selectRange(u,i),t.focusEditor()},Sys.Extended.UI.HtmlEditor.myClone=function(n,t,i){var r,u;if(Sys.Extended.UI.HtmlEditor.isIE&&n.tagName&&(n.tagName.toUpperCase()=="EMBED"||n.tagName.toUpperCase()=="OBJECT")){u=t.createElement("DIV");try{u.innerHTML=n.outerHTML;r=u.firstChild}catch(f){r=n}delete u}else r=n.cloneNode(i);return r},Sys.Extended.UI.HtmlEditor.unStyle=function(n){var t=n.parentNode!=null&&typeof n.parentNode!="undefined"?n.parentNode:null,i,s,r;if(t){for(i=null;t&&t.tagName&&t.tagName.toUpperCase()!="BODY"&&Sys.Extended.UI.HtmlEditor.isStyleTag(t.tagName)&&t.tagName.toUpperCase()!="A";)i=t,t=t.parentNode;if(i){function o(n,t,r,u,f){var e=r.cloneNode(!1),h,v,l,c,a,s;if(n)if(n.push&&typeof n.push=="function")for(h=0;h0)&&(t.nodeType==1&&t.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(t.tagName)&&t.childNodes.length==0&&!Sys.Extended.UI.HtmlEditor.isTempElement(t)&&(t=null),t&&(e.childNodes.length!=0&&u?e.insertBefore(t,e.firstChild):e.appendChild(t))),t=v;if(e.childNodes.length==0)delete e,e=null;else if(e.childNodes.length==1&&e.firstChild.nodeType==3&&(""+e.firstChild.data+"").length==0)delete e,e=null;else if(!f&&e.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName)&&e.tagName.toUpperCase()!="A"&&!Sys.Extended.UI.HtmlEditor.isTempElement(e)){for(l=e.childNodes.length,c=0;c0&&(n=t);var f=o(null,n.previousSibling,n.parentNode,!0,!1),e=o(null,n.nextSibling,n.parentNode,!1,!1),u=i.parentNode;if(f)if(f.push&&typeof f.push=="function")for(r=0;r0&&n.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName)>=0?!0:!1},Sys.Extended.UI.HtmlEditor._moveTagsUp=function(n,t){function r(n){var t,i;if(Sys.Extended.UI.HtmlEditor.isInlineElement(n)&&n.nodeType!=3){if(n.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(n.tagName)&&n.tagName.toUpperCase()!="A"&&!Sys.Extended.UI.HtmlEditor.isTempElement(n))for(t=n.firstChild;t!=null;)i=t.nextSibling,r(t),t=i}else Sys.Extended.UI.HtmlEditor.unStyle(n)}for(var i=n,u;i!=null&&i!=t;)u=i.nextSibling,r(i),i=u},Sys.Extended.UI.HtmlEditor._commonTotalParent=function(n,t){for(var i=n.parentNode,e=n,u,f,r;i;){if(i.tagName&&!Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&(u=Sys.Extended.UI.HtmlEditor._lookChild(i,t),u>=0)){for(f=0,r=0;r=0){for(f=0,r=0;r=0;u--)if(r(e.substr(u,1)))break}else for(u=0;u=0&&u0||i&&u==0)&&(u0&&(this.text[this.text.length-1]!="\n"||n!="\n"))&&(this.text[this.text.length]=n)};this.append=this.write;this.writeln=function(n){this.text[this.text.length]=n+"\n"};this.toString=function(){return this.text.join("")};this.clear=function(){delete this.text;this.text=null;this.text=[]}},Sys.Extended.UI.HtmlEditor.isHeader=function(n){var t=n.tagName.toUpperCase();return t.length==2&&t.substr(0,1)=="H"&&parseInt(t.substr(1,1))>0?!0:!1},Sys.Extended.UI.HtmlEditor._getReallyFirst=function(n){return typeof n.firstChild!="undefined"&&n.firstChild!=null&&typeof n.firstChild.childNodes!="undefined"&&n.firstChild.childNodes!=null?Sys.Extended.UI.HtmlEditor._getReallyFirst(n.firstChild):n},Sys.Extended.UI.HtmlEditor._getReallyLast=function(n){return typeof n.lastChild!="undefined"&&n.lastChild!=null&&typeof n.lastChild.childNodes!="undefined"&&n.lastChild.childNodes!=null?Sys.Extended.UI.HtmlEditor._getReallyLast(n.lastChild):n},Sys.Extended.UI.HtmlEditor._reallyFirst=function(n,t){if(n.firstChild){if(n.firstChild==t)return!0;if(n.firstChild.childNodes&&Sys.Extended.UI.HtmlEditor._lookChild(n.firstChild,t)==0)return Sys.Extended.UI.HtmlEditor._reallyFirst(n.firstChild,t)}return!1},Sys.Extended.UI.HtmlEditor._reallyLast=function(n,t){if(n.lastChild){if(n.lastChild==t)return!0;if(n.lastChild.childNodes&&Sys.Extended.UI.HtmlEditor._lookChild(n.lastChild,t)==n.lastChild.childNodes.length-1)return Sys.Extended.UI.HtmlEditor._reallyLast(n.lastChild,t)}return!1},Sys.Extended.UI.HtmlEditor.getContainer=function(n,t){var r,i,u;if(t==n)return n;if(n.nodeType==1)for(r=0;r=0))return i.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&i.tagName.toUpperCase()!="A"&&!Sys.Extended.UI.HtmlEditor.isTempElement(i)?Sys.Extended.UI.HtmlEditor.getContainer(i,t):i}return null},Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt=function(n,t,i){var f=n.replace(/^(\d+)\.(\d+)px/i,"$1px"),e,o,r,s,u;if(!Sys.Extended.UI.HtmlEditor.isIE&&f&&f.length>0){if(e=f.toLowerCase().split(",")[0],typeof i!="undefined"&&(o=document.getElementById(i),o!=null)){for(r=0;r6&&document.compatMode!="BackCompat"&&t.parentNode.clientHeight>0&&(this._shouldResize=!0);Sys.Extended.UI.HtmlEditor.HtmlPanel.callBaseMethod(this,"_activate");Sys.Extended.UI.HtmlEditor.isIE?(t.value="",i=this,setTimeout(function(){t.value=n},0)):t.value=n;$addHandlers(t,{focus:this._onfocus$delegate});this._shouldResize&&$addHandlers(t,{resize:this._onresize$delegate});this._activateFinished()},_deactivate:function(){var n=this.get_element();this._shouldResize&&$common.removeHandlers(n,{resize:this._onresize$delegate});this._shouldResize=!1;$common.removeHandlers(n,{focus:this._onfocus$delegate});n.value="";Sys.Extended.UI.HtmlEditor.HtmlPanel.callBaseMethod(this,"_deactivate")},_getContent:function(){return this.get_element().value},_setContent:function(n){if(this.get_element().value=n,Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element().parentNode))try{var t=this.get_element();t.focus();setTimeout(function(){try{Sys.Extended.UI.HtmlEditor.setSelectionRange(t,0,0)}catch(n){}},0)}catch(i){}},_focus:function(){var n,t;if(Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element().parentNode))try{n=this.get_element();n.focus();setTimeout(function(){try{Sys.Extended.UI.HtmlEditor.setSelectionRange(n,0,0)}catch(t){}},0)}catch(i){}t=this;setTimeout(function(){t._focused()},0)},_onfocus:function(){this._really_focused();var n=this.get_element();return setTimeout(function(){n.focus()},0),!0},_onresize:function(){var n=this.get_element(),t=n.parentNode.clientHeight;t>0&&(n.style.height=t+"px")}};Sys.Extended.UI.HtmlEditor.HtmlPanel.registerClass("Sys.Extended.UI.HtmlEditor.HtmlPanel",Sys.Extended.UI.HtmlEditor.ModePanel); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.ModePanel.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.ModePanel.js new file mode 100644 index 000000000..9f7baa153 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.ModePanel.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.ModePanel=function(n){Sys.Extended.UI.HtmlEditor.ModePanel.initializeBase(this,[n]);this._activated=!1;this._isActivating=!1;this._editPanel=null;this._cachedContent=null;this._onbeforeunload$delegate=Function.createDelegate(this,this._onbeforeunload)};Sys.Extended.UI.HtmlEditor.ModePanel.prototype={set_editPanel:function(n){this._editPanel=n},get_content:function(){return this._activated?this._getContent():this._cachedContent!=null?this._cachedContent:""},set_content:function(n){if(this._cachedContent=n,this._activated||this._isActivating){if(this._isActivating){var t=this;return setTimeout(function(){t.set_content(n)},10),!1}this._setContent(n)}else this._activate(n);return!0},_activate:function(){this.get_element().style.display="";this._isActivating=!0},_activateFinished:function(){this._activated=!0;this._isActivating=!1;this._editPanel._setActive();this._editPanel.get_autofocus()&&this._focus()},_deactivate:function(){this.get_element().style.display="none";this._activated=!1;this._isActivating=!1},initialize:function(){Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"initialize");Sys.Extended.UI.HtmlEditor.isIE&&$addHandlers(window,{beforeunload:this._onbeforeunload$delegate})},dispose:function(){Sys.Extended.UI.HtmlEditor.isIE&&$common.removeHandlers(window,{beforeunload:this._onbeforeunload$delegate});this._activated&&(Sys.Extended.UI.HtmlEditor.isIE&&this._onbeforeunload(),this._deactivate());Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"dispose")},_onbeforeunload:function(){this._activated&&(this._editPanel._contentPrepared||(this._editPanel._prepareContentForPostback(this.get_content()),this._editPanel._contentPrepared=!0))},_getContent:function(){return this._cachedContent!=null?this._cachedContent:""},_setContent:function(){},_focus:function(){this._focused()},_focused:function(n){this._editPanel._focused(n);this._editPanel.set_autofocus(!0)},_really_focused:function(){this._editPanel._really_focused();this._editPanel.set_autofocus(!0)}};Sys.Extended.UI.HtmlEditor.ModePanel.registerClass("Sys.Extended.UI.HtmlEditor.ModePanel",Sys.UI.Control); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedPopup.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedPopup.js new file mode 100644 index 000000000..72191a0b4 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedPopup.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup=function(n){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.initializeBase(this,[n]);this._relatedElement=null};Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.prototype={get_relatedElement:function(){return this._relatedElement},set_relatedElement:function(n){this._relatedElement=n},open:function(n){var h,f,e,o,s;if(this._relatedElement!=null){if(h=this,!this.checkCorrectLoaded(function(){h.open(n)}))return;for(var c=$common.getLocation(this._relatedElement),i=c.x,r=c.y+this._relatedElement.offsetHeight,t=this.get_element().parentNode;t&&t.tagName&&t.tagName.toUpperCase()!="BODY";){if(f=Sys.Extended.UI.HtmlEditor.getStyle(t,"position"),f=="absolute"||f=="fixed"){e=parseInt(Sys.Extended.UI.HtmlEditor.getStyle(t,"top"));o=parseInt(Sys.Extended.UI.HtmlEditor.getStyle(t,"left"));isNaN(e)||isNaN(o)||(i-=o,r-=e);break}else f=="relative"&&(s=$common.getLocation(t),i-=s.x,r-=s.y);t=t.parentNode}var u=Sys.Extended.UI.HtmlEditor.getClientViewportElement(this._iframe),l=u.clientWidth+u.scrollLeft,a=u.clientHeight+u.scrollTop;ra&&(r-=r+this._iframe.offsetHeight-a);i+this._iframe.offsetWidth>l&&(i-=i+this._iframe.offsetWidth-l);Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"open",[n,r,i])}},close:function(n){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"close",[n])},initialize:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"dispose")}};Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup",Sys.Extended.UI.HtmlEditor.Popups.Popup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedTemplatePopup.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedTemplatePopup.js new file mode 100644 index 000000000..91ae93058 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedTemplatePopup.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup=function(n){Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.initializeBase(this,[n]);this._contentDiv=null};Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.prototype={get_contentDiv:function(){return this._contentDiv},set_contentDiv:function(n){this._contentDiv=n},initialize:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.callBaseMethod(this,"initialize");this.set_initialContent(this._contentDiv.innerHTML)},dispose:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.callBaseMethod(this,"dispose")}};Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup",Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.BaseColorsPopup.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.BaseColorsPopup.js new file mode 100644 index 000000000..acf1cf117 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.BaseColorsPopup.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup=function(n){Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.initializeBase(this,[n])};Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.prototype={};Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.BaseColorsPopup",Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.LinkProperties.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.LinkProperties.js new file mode 100644 index 000000000..0a1f2b485 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.LinkProperties.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.LinkProperties=function(n){Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.initializeBase(this,[n]);this._defaultTarget="_self";this._targetTextHolder=null;this._urlTextHolder=null};Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.prototype={get_defaultTarget:function(){return this._defaultTarget},set_defaultTarget:function(n){this._defaultTarget=n}};Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.registerClass("Sys.Extended.UI.HtmlEditor.Popups.LinkProperties",Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.js new file mode 100644 index 000000000..c0a31cc12 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.OkCancelAttachedTemplatePopup.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup=function(n){Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.initializeBase(this,[n])};Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.prototype={initialize:function(){Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.callBaseMethod(this,"dispose")}};Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup",Sys.Extended.UI.HtmlEditor.Popups.AttachedTemplatePopup); \ No newline at end of file diff --git a/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.Popup.js b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.Popup.js new file mode 100644 index 000000000..2cf6f92b6 --- /dev/null +++ b/packages/AjaxControlToolkit.StaticResources.15.1.4.0/Content/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.Popup.js @@ -0,0 +1 @@ +Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.Popup=function(n){Sys.Extended.UI.HtmlEditor.Popups.Popup.initializeBase(this,[n]);this._iframe=null;this._top=0;this._left=0;this._doc=null;this._initialContent="";this._cssPath="";this._autoDimensions=!0;this._registeredFields=[];this._registeredHandlers=[];this._app_onload$delegate=Function.createDelegate(this,this._app_onload);this.isOpened=!1;this.isLoaded=!1;this.isLoading=!1};Sys.Extended.UI.HtmlEditor.Popups.Popup.prototype={getDocument:function(){return this._doc},getPopupMediator:function(){return this._iframe.contentWindow&&this._iframe.contentWindow.popupMediator?this._iframe.contentWindow.popupMediator:null},get_registeredFields:function(){return this._registeredFields},set_registeredFields:function(value){this._registeredFields=eval(value)},get_registeredHandlers:function(){return this._registeredHandlers},set_registeredHandlers:function(value){this._registeredHandlers=eval(value)},get_initialContent:function(){return this._initialContent},set_initialContent:function(n){this._initialContent=n},get_cssPath:function(){return this._cssPath},set_cssPath:function(n){this._cssPath=n},get_autoDimensions:function(){return this._autoDimensions},set_autoDimensions:function(n){this._autoDimensions=n},get_iframe:function(){return this._iframe},set_iframe:function(n){this._iframe=n},checkCorrectLoaded:function(n){var t=this;return(t.isLoaded&&(t._iframe.style.height=="0px"||t._iframe.style.width=="0px")&&(this.isLoaded=!1),!this.isLoaded)?(this.isLoading||this.reload(),typeof n!="undefined"&&setTimeout(n,10),!1):!0},_baseOpen:function(n,t,i){var r=this,u;this.checkCorrectLoaded(function(){r._baseOpen(n,t,i)})&&(u=this.get_element(),typeof i!="undefined"&&(this._left=parseInt(i)),typeof t!="undefined"&&(this._top=parseInt(t)),u.style.top=this._top+"px",u.style.left=this._left+"px",setTimeout(function(){typeof n=="function"&&r._onDocumentLoaded(n);r.isOpened=!0},0))},open:function(n,t,i){this._baseOpen(n,t,i)},close:function(n){var t=this.get_element();this.isOpened=!1;t.style.top="-2000px";t.style.left="-2000px";typeof n=="function"&&n()},reload:function(){var t,i,n;this.isLoading=!0;t=this.get_element();i=t.parentNode;document.body.appendChild(t);i.appendChild(this.get_element());this._doc=this._iframe.contentWindow.document;this._doc.open();n=new Sys.StringBuilder;n.append('');this._cssPath.length>0&&n.append('');n.append("